diff -Nru wine-staging-1.9.6/aclocal.m4 wine-staging-1.9.7~ubuntu15.04.1/aclocal.m4 --- wine-staging-1.9.6/aclocal.m4 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/aclocal.m4 2016-04-04 18:06:32.000000000 +0000 @@ -395,29 +395,18 @@ if wine_fn_has_flag staticimplib then wine_fn_append_rule \ -"__builddeps__: $ac_file.$IMPLIBEXT $ac_file.$STATIC_IMPLIBEXT -$ac_file.$STATIC_IMPLIBEXT $ac_file.cross.a: $ac_deps -$ac_file.def: $srcdir/$ac_dir/$ac_name.spec \$(WINEBUILD) - \$(WINEBUILD) \$(TARGETFLAGS)$ac_implibflags -w --def -o \$[@] --export $srcdir/$ac_dir/$ac_name.spec -$ac_file.$STATIC_IMPLIBEXT: dummy - @cd $ac_dir && \$(MAKE) lib$ac_implib.$STATIC_IMPLIBEXT +"__builddeps__: $ac_file.a +$ac_file.a $ac_file.cross.a: $ac_deps +$ac_file.a: dummy + @cd $ac_dir && \$(MAKE) lib$ac_implib.a .PHONY: $ac_dir/install-dev $ac_dir/uninstall -$ac_dir/install-dev:: $ac_file.$IMPLIBEXT - \$(INSTALL_DATA) $ac_file.$IMPLIBEXT \$(DESTDIR)\$(dlldir)/lib$ac_implib.$IMPLIBEXT +$ac_dir/install-dev:: $ac_file.a + \$(INSTALL_DATA) $ac_file.a \$(DESTDIR)\$(dlldir)/lib$ac_implib.a $ac_dir/uninstall:: - \$(RM) \$(DESTDIR)\$(dlldir)/lib$ac_implib.$IMPLIBEXT + \$(RM) \$(DESTDIR)\$(dlldir)/lib$ac_implib.a install install-dev:: $ac_dir/install-dev __uninstall__: $ac_dir/uninstall" - if test "$IMPLIBEXT" != "$STATIC_IMPLIBEXT" - then - wine_fn_append_rule \ -"$ac_dir/install-dev:: $ac_file.$STATIC_IMPLIBEXT __builddeps__ - \$(INSTALL_DATA) $ac_file.$STATIC_IMPLIBEXT \$(DESTDIR)\$(dlldir)/lib$ac_implib.$STATIC_IMPLIBEXT -$ac_dir/uninstall:: - \$(RM) \$(DESTDIR)\$(dlldir)/lib$ac_implib.$STATIC_IMPLIBEXT" - fi - if test -n "$CROSSTARGET" -a -z "$ac_implibflags" then wine_fn_append_rule \ diff -Nru wine-staging-1.9.6/ANNOUNCE wine-staging-1.9.7~ubuntu15.04.1/ANNOUNCE --- wine-staging-1.9.6/ANNOUNCE 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/ANNOUNCE 2016-04-04 18:06:32.000000000 +0000 @@ -1,15 +1,17 @@ -The Wine development release 1.9.6 is now available. +The Wine development release 1.9.7 is now available. What's new in this release (see below for details): - - Better video card detection when using Mesa. - - Support for Shader Model 5 shaders. - - C++ exception handling improvements. + - More work towards the WineD3D command stream. + - More support for Shader Model 5 shaders. + - C++ exception handling on x86-64. + - Support for Windows-style static import libraries. + - Performance fixes in the XML writer. - Various bug fixes. The source is available from the following locations: - http://dl.winehq.org/wine/source/1.9/wine-1.9.6.tar.bz2 - http://mirrors.ibiblio.org/wine/source/1.9/wine-1.9.6.tar.bz2 + http://dl.winehq.org/wine/source/1.9/wine-1.9.7.tar.bz2 + http://mirrors.ibiblio.org/wine/source/1.9/wine-1.9.7.tar.bz2 Binary packages for various distributions will be available from: @@ -25,343 +27,460 @@ ---------------------------------------------------------------- -Bugs fixed in 1.9.6 (total 32): +Bugs fixed in 1.9.7 (total 42): - 17540 Zondervan Pradis 6.0 hangs due to ole32.dll.CoGetCurrentLogicalThreadId stub - 21475 TI Interactive application fails when attempting to display the TI math palette - 22533 Half-Life: Logo video rendering is wrong (msrle32 does not handle frames with 0 biClrUsed) - 25086 Multiple games and applications need kernel32.GetLogicalProcessorInformationEx implementation (CPU-Z 1.72, Splinter Cell: Blacklist, Adobe CC 2015, Kontakt 5) - 28177 Adventure games from Kheops Studio hang after the logo screen (Safecracker, Destination: Treasure Island, Nostradamus: Lost Prophecy, Dracula 3, Return to Mysterious Island 2) - 29458 Explorer sometimes crashes on drag-and-drop in folders accessed from "/" - 32237 A slower speed of light: Summer 2012 version crashes after Intro - 32314 Pikachu Volleyball (English version) crashes on restart - 32827 Legrand XlPro 3 (MFC app) crashes on startup (failure to load registry-free COM servers via app hook, 'OleCreate' must ignore HRESULT of 'IOleObject::GetMiscStatus') - 33787 IE8 crashes on new tab - 34303 underlined 8 point Times New Roman text doesn't display as underlined - 35471 Telepone (MTSP FIM) needs msvcr100.dll._CreateFrameInfo - 37949 eLicenser Control Center needs msvcr80.dll.__CxxRegisterExceptionObject - 39239 ole32:compobj fails if privileges not high enough - 39278 Multiple DirectX 10 games crash on unimplemented function d3d10_1.dll.D3D10CreateDeviceAndSwapChain1 (Assassin's Creed) - 39461 Garmin Homeport 2.2.9 crashes on unimplemented function msvcr90.dll.__CxxRegisterExceptionObject - 39510 EZCastPro 1.4/1.5 crashes on unimplemented function USER32.dll.QueryDisplayConfig - 39577 Fallout 4 needs WINED3DFMT_R11G11B10_FLOAT render target - 39674 3Dmark03, 05, 06 not started "System Info Error" - 39797 The suffering does not start, needs wmasf.dll - 39878 Diablo II does not start on 64bit system with more than 2GB VRAM cards - 39918 Mail.Ru GameCenter installer does not work - 40115 ole32:compobj regression (privilege issue) - 40147 Assertion 'm->state == STATE_PASSIVE' failed at pulse/mainloop.c:827 on starting Skype 7.18.0.112 - 40190 7z fails at enumerating network places - 40201 EccoPro only works on Wine 1.6.2 - 40221 Adobe Illustrator CC 2015 needs user32.GetGestureConfig - 40222 IMalloc(Spy)::Free nullptr - 40246 Please document WINEBUILD in the winegcc manpage - 40253 Build regression: Can't remove fonts: is a directory (--with-wine64, shared wow64) - 40287 steamwebhelper crashes in Windows 7 mode - 40312 Please look for builtin *.fon fonts in fontdir + 10063 wineconsole run fail on korean locale. + 10156 oleidl.h has OLECONTF_ONLYUSER misspelled + 12400 Display problems in Indiana Jones and The Emperor's Tomb with vertex shader enabled + 15537 Game "PURE" shows black screen + 19081 Force closing winhlp32 without a file loaded pops up an error dialog (appinstall) + 19171 Powerpoint viewer 2003 & 2007 show weird characters (appinstall) + 19538 Microsoft Publisher 2007 and 2010 crash when opening documents/templates (TSF manager 'ITextStoreACPSink' must support QI with 'IID_ITextStoreACPServices') + 19585 Water is red in Settlers: Heritage of Kings demo + 20695 Cannot scroll documents being compared in winmerge + 26767 U-he Tyrell, Uhbik and ACE vst plugins: GUI Knob bug (image files files not being sorted correctly) + 26942 CSPRO 4 editing : context menu on grid header not working properly + 26978 tokenadmin.exe crash : Unimplemented function winscard.dll.SCardListReadersA + 28172 Civilization II crashes on startup + 29319 Internet Explorer 8 fails to start an InPrivate Browsing session + 29979 ElsterFormular crashes when trying to print already sent income tax return + 30488 IE8 shows corrupted previews on the quick tabs screen + 31393 Nvidia force antialiasing no longer works + 32347 Alien8 and Head Over Heels crash when window is moved partly off-screen + 35092 Multiple 64-bit applications need __CxxFrameHandler implementation (Ableton Live 9.1, Adobe Cloud apps) + 35711 Winelib: compile error in wincon.h if NOGDI is defined before #include + 36136 oleaut32/tests/vartest.c test shows a couple leaks with valgrind + 36297 valgrind shows uninitialized memory in msxml3/tests/domdoc.c + 36383 valgrind shows several uninitialized values in ddraw_CreateSurface() in ddraw/tests/dsurface.c + 36748 valgrind shows two possible leaks in d3drm/tests/d3drm.c + 38347 Canon PIXMA MP495 driver setup needs setupapi.dll.SetupDiSetDeviceInstallParamsW + 38670 advapi32/registry tests shows several uninitialized values + 38971 Allied Telesis Smart Switch Management Utility v1.0.0.7 crashes on unimplemented function mgmtapi.dll.SnmpMgrTrapListen + 39215 Nvidia GeForce GTX960M detected as GTX470 + 39435 The 64 bit mshtml:xmlhttprequest fails on Windows 8/10 + 39667 dinput: MotoGP 3 demo launcher crashes on leaving key configuration dialog. + 39681 Unimplemented function crypt32.dll.CryptMsgVerifyCountersignatureEncoded + 39786 GoodSync crashes, needs oleaut32.OleLoadPictureFile + 40048 Camtasia Studio 8 : crashes on unimplemented function dwmapi.dll.DwmSetPresentParameters + 40081 CLM Explorer needs fontsub.dll.CreateFontPackage + 40113 mshtml:xmlhttprequest regression + 40135 msvcirt.c:1386:5: warning: comparison of unsigned expression < 0 is always false + 40182 Elder Scrolls Online: Login connection issues + 40297 Multiple app crashes in macdrv_EnumDisplayMonitors + 40304 EveHQ2 crashes with builtin gdiplus + 40306 Overexposed/wrong gamma? on The Legend of Heroes Trails in the Sky SC + 40319 VerbAce Dictionary does not install correctly + 40331 The Legend of Heroes Trails in the Sky SC crashes on start with runtime error R6025 ---------------------------------------------------------------- -Changes since 1.9.5: +Changes since 1.9.6: + +Aaryaman Vasishta (2): + d3drm: Move struct d3drm_texture to header for global access. + d3drm: Fix signature macro of IDirect3DRM*::CreateObject. + +Adam Buchbinder (1): + riched20: Implement ITextRange::ScrollIntoView. Alex Henrie (1): - user32: Don't put a default icon on modal dialogs. + ole32: Fix sizeof mismatch in CompositeMonikerImpl_Construct. + +Alexandre Julliard (26): + winebuild: Use strarray objects instead of pointers where possible. + winebuild: Use strarray objects for a few more string arrays. + kernel32/tests: Use Interlocked functions to avoid fault counters being optimized out. + winebuild: Don't store the full spec for an imported dll. + winebuild: Store a C-compatible version of the dll name. + winebuild: Store dll imports in a list instead of an array. + winebuild: Store delayed imports in a separate list. + winebuild: Add a separate structure to store the data of imported functions. + winebuild: Use a global flag to determine when to generate the get_pc thunk. + winebuild: Add a common helper to find an imported dll. + winebuild: Add support for creating static import libraries. + winebuild: Add support for linking to static import libraries. + makefiles: Expand the names of static libraries in linker commands. + makefiles: Build import libraries that contain object files as static libraries. + makefiles: Always expand the library name for cross-compiled import libraries. + makefiles: Add tool dependencies for winegcc and winebuild. + winegcc: Use explicit library file name when loading cross libraries. + makefiles: When supported, use -Ttext-segment also for the main loader. + makefiles: Reduce the maximum page size for modules that have a base address. + makefiles: Move the main loader base address to cope with huge page alignment. + kernel32: Lower the load address to accomodate the dll size. + wineconsole: If necessary, fallback to a font without the right properties instead of failing. + makedep: Sort makefile variables. + user32: Use kernel32 functions for character types and case conversions. + winegcc: Support building from the top directory. + makedep: Rename top_dir_path to top_src_dir_path for consistency. + +Alistair Leslie-Hughes (2): + include: Add d3dx10tex.h. + d3d10: Add D3D10CreateEffectPoolFromMemory stub. -Alexandre Julliard (5): - configure: Don't create makefiles in directories that are symlinks in a Wow64 build. - libwine: Don't include backwards compatibility functions on Android. - advapi32: Fix null termination in RegQueryInfoKeyA. - vssapi: Undefine __thiscall before redefining it. - gdi32: Take into account the fontdir directory specified at build time. - -Alistair Leslie-Hughes (3): - d3d10_1: Implement D3D10CreateDeviceAndSwapChain1(). - user32: Don't crash in DrawTextEx when tab length is zero. - include: Add authz.h. - -Andrew Eikum (7): - winepulse.drv: Check that the server connection actually succeeded. - mmdevapi: Implement IAudioEndpointVolume::GetVolumeRange. - mmdevapi: Implement Set/GetMasterVolumeLevel. - mmdevapi: Implement Set/GetMute. - dinput: Fix condition effect joystick offset calculation. - windowscodecs: Stub IWICMetadataQueryReader. - windowscodecs: Stub IMetadataBlockReader for jpegformat. - -André Hentschel (3): - wrc: Remove getopt prototype. - winemaker: Markup fixes in German translation. - advapi32: Add CreatePrivateObjectSecurityEx. +Andrew Eikum (1): + winecoreaudio.drv: Ensure divide-by-zero SSE exceptions are masked before calling AudioConverterNew. + +André Hentschel (1): + shell32: Provide helper function a buffer of correct size. Austin English (8): - wmasf: Add stub dll. - api-ms-win-core-file-l1-2-1: Add dll. - api-ms-win-core-memory-l1-1-2: Add dll. - api-ms-win-core-version-l1-1-0: Add dll. - api-ms-win-core-string-l2-1-0: Add dll. - user32: Add GetGestureConfig stub. - user32: Add QueryDisplayConfig stub. - bthprops.cpl: Add BluetoothFindFirstRadio/BluetoothFindRadioClose stubs. + include: Fix GetCurrentConsoleFontEx/SetCurrentConsoleFontEx definition. + crypt32: Add CryptMsgVerifyCountersignatureEncoded stub. + mgmtapi: Add SnmpMgrTrapListen stub. + dwmapi: Add DwmSetPresentParameters stub. + winscard: Add stubs for SCardListReadersA/W. + oleaut32: Add OleLoadPictureFile stub. + sfc: Document ordinal only exports. + setupapi: Add SetupDiSetDeviceInstallParamsW stub. + +Bernhard Übelacker (2): + dinput: Implement device property DIPROP_USERNAME. + d3drm/tests: Release two retrieved interfaces to allow proper cleanup. Bruno Jesus (1): - msrle32: Use the correct number of colors when biClrUsed = 0. + comctl32/tests: Add initial tests for the animation control. + +Caron Wills (1): + wined3d: Add Nvidia GeForce GTX 860. -François Gouget (3): - include: Don't use the visibility attribute on Solaris. - shlwapi/tests: Fix a test failure on Windows 10. - d3dx9/tests: Add a trailing '\n' to an ok() call. - -Frédéric Delanoy (1): - winemaker: Markup fixes in French translation. - -Hans Leidekker (2): - webservices: Keep track of prefix bindings. - winhttp/tests: Fix test failures. +Daniel Lehman (3): + ucrtbase: Add hypot forward. + msvcp120: Add _Mtx_current_owns. + msvcr120: Add asinh. + +Detlef Riekenberg (1): + kernelbase: Add dll with forwards to kernel32.dll. + +François Gouget (11): + shell32/tests: Delete the shlproto test class when done. + shell32/tests: Move a file URL test to test_fileurl(). + shell32/tests: Test default verb detection for files as well as for URLs. + dinput: Make ff_effect_direction_to_rad() static. + shell32/tests: Make shlexec's reset_association_description() static. + wined3d: Make wined3d_texture_force_reload() static. + mshtml: Make some functions static. + d3dx9_36: Make d3dx_set_shader_const_state() static. + winecfg: Highlight spelling fixes. + cmd/tests: Slash spelling fix. + gdi32: Fix the PAN_WEIGHT_INDEX constant name. + +Hans Leidekker (7): + iphlpapi/tests: Trace network prefixes in the test for GetAdaptersAddresses. + webservices: Add support for optional values in WsReadType. + webservices: Fix memory leaks on error paths in WsCreateReader. + webservices: Add a helper to determine node type. + webservices: Add support for text field mappings in WsReadType. + webservices/tests: Add more structure type tests. + webservices: Add support for repeating element field mappings in WsReadType. Henri Verbeet (50): - wined3d: Get resource info from the texture in context_setup_target(). - wined3d: Get resource info from the texture in wined3d_device_set_cursor_properties(). - wined3d: Get resource info from the rendertarget view in device_clear_render_targets(). - wined3d: Get resource info from the rendertarget view in draw_primitive(). - wined3d: Get resource info from the texture in wined3d_surface_blt(). - wined3d: Replace device_update_volume() with a function to update multiple levels of a 3D texture. - wined3d: Pass a texture and sub-resource index to wined3d_device_create_cursor_texture(). - wined3d: Use the resource map/unmap functions in wined3d_device_set_cursor_properties(). - wined3d: Pass a texture and sub-resource index to surface_convert_format(). - wined3d: Pass textures and sub-resource indices to surface_cpu_blt(). - wined3d: Use D3DCOLORTOGLFLOAT4 in drawStridedSlow(). - wined3d: Get rid of the D3DCOLOR_[RGBA] macros. - wined3d: Replace D3DCOLORTOGLFLOAT4 with an inline function. - wined3d: Sanitise map flags in wined3d_surface_map(). - wined3d: Introduce wined3d_volume_prepare_location(). - wined3d: Keep track of the download count in the texture. - wined3d: Introduce helpers functions to calculate texture level dimensions. - wined3d: Don't call surface_load_ds_location() directly. - wined3d: Properly handle discarded surfaces in surface_load_location(). - wined3d: Use ARB_map_buffer_range in wined3d_surface_map() when available. - wined3d: "render_targets" is never NULL in context_find_fbo_entry(). - ddraw/tests: Skip initialising "quad" and "indices" in test_specular_lighting() if a 3D device can't be created. - d3dx9: "param" should never be NULL in free_parameter(). - d3dx9/tests: Get rid of a redundant NULL check in test_effect_states(). - d3dx9/tests: Get rid of some redundant NULL checks in D3DXCreateTextTest(). - wined3d: Get resource info from the texture in wined3d_surface_cleanup(). - wined3d: Get resource info from the texture in surface_create_dib_section(). - wined3d: Get resource info from the texture in surface_private_setup(). - wined3d: Get resource info from the texture in surface_depth_blt_fbo(). - wined3d: Get resource info from the texture in surface_blt_fbo(). - wined3d: Get resource info from the texture in surface_convert_depth_to_float(). - wined3d: Allow swapchain sample counts to be overridden with a registry key. - ddraw: Do not destroy surfaces that are still attached. - ddraw: Avoid d3d_device_update_depth_stencil() in ddraw_surface_delete_attached_surface(). - ddraw: Just return an error if we failed to find the predecessor in ddraw_surface_delete_attached_surface(). - opengl32: Introduce WGL_WINE_query_renderer. - winex11: Implement WGL_WINE_query_renderer on top of GLX_MESA_query_renderer. - wined3d: Use WGL_WINE_query_renderer to query GPU information. - wined3d: Get resource info from the texture in wined3d_surface_depth_fill(). - wined3d: Get resource info from the texture in surface_download_data(). - wined3d: Get resource info from the texture in wined3d_surface_upload_data(). - wined3d: Get resource info from the texture in surface_upload_from_surface(). - wined3d: Get resource info from the texture in surface_set_compatible_renderbuffer(). - wined3d: Get resource info from the texture in surface_load(). - wined3d: Properly check if sRGB writes should be enabled in context_apply_clear_state(). - wined3d: Require a valid rectangle pointer if rect_count is non-zero in device_clear_render_targets(). - wined3d: Ignore the dirty region for swapchain presents more explicitly. - wined3d: Handle NULL rectangles in wined3d_swapchain_present(). - wined3d: Explicitly check for WINED3DUSAGE_TEXTURE when validating surface dimensions in surface_private_setup(). - wined3d: Get rid of the WINED3DUSAGE_OVERLAY check in gdi_surface_private_setup(). - -Hugh McMaster (3): - reg: Correctly handle cases with no data argument. - reg: Fail if /v is passed without an argument. - reg: Fail if multiple /v switches are passed in. - -Huw D. M. Davies (5): - gdi32: Generate EMR_POLYPOLY{LINE|GON}16 records if the co-ords fit. - gdi32: Don't update the bounds if any poly{line|gon} has fewer than two points. - gdi32/tests: Add tests for EMF PolyPolyline record creation. - riched20: \pard resets the reading direction. - riched20: Set the base embedding level for RTL paragraphs. - -Jacek Caban (6): - winex11.drv: Use grabbed window display in SetCapture. - kernel32: Don't set unconditionally SECTION_QUERY flag in OpenFileMapping. - msxml3: Store xmlnode reference in xmlnodemap object. - msxml6: Added support for CLSID_XMLSchemaCache60 in XMLSchemaCache60::QueryInterface. - mshtml: Fixed cloning comment nodes. - mshtml: Fixed copy&paste typo in GetAsciiHostPort implementation. - -Jens Reyer (1): - winegcc: Document WINEBUILD in the manpage. - -Józef Kucia (43): - d3d10_1/tests: Port test_create_device() from d3d11. - d3d10core/tests: Add test for creating RTV with DXGI_FORMAT_UNKNOWN. - d3d11/tests: Add test for creating RTV with DXGI_FORMAT_UNKNOWN. - d3d10core/tests: Add test for creating DSV with DXGI_FORMAT_UNKNOWN. - d3d11/tests: Add test for creating DSV with DXGI_FORMAT_UNKNOWN. - d3d11/tests: Introduce d3d11_test_context for visual tests. - d3d11/tests: Introduce draw_quad(). - wined3d: Recognize aoffimmi shader instruction modifier. - wined3d: Extend shader_glsl_gen_sample_code() to support offsets. - wined3d: Implement aoffimmi modifier for SM4 ld instruction in GLSL backend. - wined3d: Implement aoffimmi modifier for SM4 sample instructions in GLSL backend. - wined3d: Simplify shader_glsl_append_imm_ivec(). - wined3d: Improve ERR() message in shader_glsl_get_sample_function(). - d3d10core/tests: Introduce d3d10core_test_context for visual tests. - d3d10core/tests: Introduce draw_quad(). - d3d11/tests: Drop redundant feature level check. - wined3d: Advertise WINED3DFMT_BC{4, 5}_UNORM 3D textures as not supported. - wined3d: Limit amount of video memory for older Windows versions. - d3d11/tests: Trace feature level. - d3d10core/tests: Move typeless textures test to test_create_texture{2d, 3d}(). - d3d11/tests: Move typeless textures test to test_create_texture{2d, 3d}(). - d3d11/tests: Add more create texture tests. - d3d11: Translate WINED3DERR_INVALIDCALL to E_INVALIDARG in d3d_texture{2d, 3d}_init(). - d3d10core/tests: Add more create texture tests. - wined3d: Introduce debug_color(). - wined3d: Implement depth clear in wined3d_device_clear_rendertarget_view(). - wined3d: Implement stencil clear in wined3d_device_clear_rendertarget_view(). - d3d11: Implement d3d11_immediate_context_ClearDepthStencilView(). - d3d11: Implement d3d10_device_ClearDepthStencilView(). - d3d10core/tests: Add test for ClearDepthStencilView(). - d3d11/tests: Add test for ClearDepthStencilView(). - d3d11: Fill unused fields in D3D11_DEPTH_STENCIL_DESC with default values. - d3d10core/tests: Test values of unused fields in D3D10_DEPTH_STENCIL_DESC. - d3d11/tests: Test values of unused fields in D3D11_DEPTH_STENCIL_DESC. - d3d11: Implement d3d11_immediate_context_OMSetDepthStencilState(). - d3d11: Forward d3d10_device_OMSetDepthStencilState() to d3d11_immediate_context_OMSetDepthStencilState(). - d3d11: Introduce debug_float4(). - wined3d: Recognize SM5 ld_structured opcode. - wined3d: Recognize SM5 deriv_rtx_coarse opcode. - wined3d: Recognize SM5 deriv_rty_coarse opcode. - wined3d: Recognize SM5 deriv_rtx_fine opcode. - wined3d: Recognize SM5 deriv_rty_fine opcode. - wined3d: Use GLuint instead of GLenum to store ARB blitter shaders. - -Louis Lenders (1): - ntdll: Add stub for RtlAddAccessDeniedObjectAce and forward to AddAccessDeniedObjectAce in advapi32. - -Matteo Bruni (13): - d3dx9: Trace the parameter passed to IsParameterUsed(). - d3d11/tests: Require feature level 11_0 or 10_0 by default. - dxgi: Add feature level support. - d3d11: Implement device_GetFeatureLevel(). - d3d11: Only accept shader versions supported by the feature level of the device. - d3d11: Pass the requested feature levels to dxgi. - d3d11/tests: Add a test for the default feature level selection. - d3d11/tests: Test creating SM4 shaders on feature level 9. - d3dx9: Cleanup header includes. - d3d10core: Add feature level support. - wined3d: Enable SM5 shaders in the GLSL backend, when possible. - d3d11/tests: Add a feature_level parameter to init_test_context(). - d3d11/tests: Test relative addressing in constant buffers. - -Michael Stefaniuc (7): - dbghelp: Use CONTAINING_RECORD instead of reimplementing it. - riched20: Use SetRectEmpty() instead of open coding it. - winefile: Use SetRectEmpty() instead of open coding it. - wined3d: Use SetRect() instead of open coding it. - winex11: Use debugstr_a to print strings that can be NULL. - d3drm: Use debugstr_a to print a string that can be NULL. - dinput: Support IUnknown in the IDirectInputEffect COM object. - -Miklós Máté (2): - wined3d: Warn only once about unsupported wrap state. - winex11: Don't create a temporary context each time X11DRV_wglBindTexImageARB is called. - -Nikolay Sivov (29): - ole32/tests: Fix tests failing on limited account. - ole32/tests: Don't trace last error when error code is returned directly. - ole32/tests: Fixed CoGetPSClsid() test failures when running on limited account. - dwrite: Use correct return code on allocation failure. - dwrite: Update to IDWriteFont3. - include: Added IDWriteFactory3 method definitions. - notepad: Make sure to use large enough buffer when composing window title (Coverity). - oleview: Fix buffer length passed to Reg* functions (Coverity). - dwrite: Update to IDWriteFontFamily1. - dwrite: Implement IDWriteFontFamily1::GetFont(). - dwrite: Update to IDWriteFontCollection1. - dwrite: Remove flag marking system collections. - dwrite: Update to IDWriteFontList1. - ole32/tests: A test to show data cache QI problems. - avifil32: Use matching buffer length for dest string (Coverity). - ole32: Implement CoGetCurrentLogicalThreadId(). - ole32: Implement IComThreadingInfo::GetCurrentLogicalThreadId(). - mpr: Implement WNetUseConnectionA(). - ieframe: Handle CreateView() failure in ActivateMe() (Coverity). - xmllite: Support get/set for XmlResolver property. - msxml3: Accept VT_UNKNOWN input for IXMLDOMSchemaCollection::add(). - comctl32/monthcal: MCM_GETRANGE does not return BOOL values. - ole32: Use CoGetApartmentType() to implement IComThreadingInfo. - comctl32/monthcal: Always reset range flags and date limits on MCM_SETRANGE. - comctl32/datetime: Use MCM_GETRANGE result directly in DTM_GETRANGE. - xmllite/writer: Implement WriteComment(). - ole32: Fix refcounting of IObjContext per-thread instance. - ole32/tests: Some tests for IInitializeSpy. - xmllite/writer: Implement WriteCData(). - -Patrick Armstrong (3): - bcrypt: Implement MD5 algorithm and add tests. - bcrypt: Make BCryptHashData behave more like Windows with empty input. - bcrypt: Implement support for HMAC. - -Paul Gofman (3): - d3dx9: IsParameterUsed stub should return TRUE. - d3dx9: Support setting texture through SetValue in effect. - d3dx9: Fix D3DXIntersectTri function. - -Pierre Schweitzer (1): - mpr: Don't send lpRemoteName when requesting network place. - -Piotr Caban (17): - user32: Return window procedure pointer in WINPROC_AllocProc if it's not possible to allocate handle. - user32/tests: Add initial out of window procedure slots test. - user32: Call window procedure even if we're out of winproc handles. - user32/tests: Show that message conversion should work on window procedures without handles. - user32/tests: Show that messages are not converted when function pointer is passed to CallWindowProc. - msvcrt: Add i386 _IsExceptionObjectToBeDestroyed implementation. - msvcrt: Destroy exception object if it's no longer used when exiting catch. - msvcrt: Handle try blocks inside current catch block in nested frame handler. - msvcrt: Destroy exception object when frame storing it is unwound. - msvcr80: Add _CreateFrameInfo implementation. - msvcr80: Add _FindAndUnlinkFrame implementation. - msvcrt: Add __CxxRegisterExceptionObject implementation. - msvcrt: Add __DestructExceptionObject implementation. - msvcrt: Add __CxxUnregisterExceptionObject partial implementation. - msvcr80: Use Cxx(Un)RegisterExceptionObject helpers in i386 nested exception handler. - msvcrt: Handle non c++ exceptions in __DestructExceptionObject. - msvcrt: Destroy thrown c++ object before calling handler in _except_handler4_common. + wined3d: Get resource info from the texture in read_from_framebuffer(). + wined3d: Get resource info from the texture in surface_load_fb_texture(). + wined3d: Get resource info from the texture in surface_prepare_rb(). + wined3d: Get resource info from the texture in fb_copy_to_texture_direct(). + wined3d: Get resource info from the texture in fb_copy_to_texture_hwstretch(). + wined3d: Get rid of wined3d_surface_ops.surface_private_setup(). + wined3d: Validate (2D) texture dimensions in texture_init(). + wined3d: Check for compressed and height scaled formats in texture_init(). + wined3d: Merge surface_private_setup() into wined3d_surface_init(). + d3drm/tests: Properly initialise context.obj in test_Viewport(). + ddraw/tests: Rewrite blt_test(). + ddraw/tests: Get rid of the unused "d3d" variable in test_shademode(). + wined3d: Get resource info from the texture in surface_blt_to_drawable(). + wined3d: Get resource info from the texture in surface_blt_special(). + wined3d: Get resource info from the texture in surface_depth_blt(). + dxgi: Simplify the shader model comparison in dxgi_check_feature_level_support(). + d3d11: Use %#x for tracing the feature level in layer_set_feature_level(). + wined3d: Get the framebuffer height from the view in shader_glsl_load_constants(). + wined3d: Pass a texture instead of a surface to context_create(). + wined3d: Introduce wined3d_texture_get_gl_buffer(). + wined3d: Get resource info from the texture in surface_load_ds_location(). + wined3d: Get resource info from the texture in surface_copy_simple_location(). + wined3d: Get resource info from the texture in surface_load_drawable(). + wined3d: Get resource info from the texture in surface_load_texture(). + wined3d: Get resource info from the texture in surface_load_renderbuffer(). + wined3d: Replace context_generate_rt_mask_from_surface() with context_generate_rt_mask_from_resource(). + wined3d: Pass a texture instead of a surface to context_generate_rt_mask_no_fbo(). + wined3d: Use wined3d_texture_blt() in wined3d_device_copy_resource(). + wined3d: Use wined3d_texture_blt() in wined3d_device_copy_sub_resource_region(). + wined3d: Use wined3d_texture_blt() in wined3d_swapchain_get_front_buffer_data(). + wined3d: Get resource info from the texture in surface_load_location(). + wined3d: Get resource info from the texture in swapchain_blit(). + wined3d: Get resource info from the texture in wined3d_volume_upload_data(). + wined3d: Get resource info from the texture in wined3d_volume_download_data(). + wined3d: Get resource info from the texture in wined3d_volume_load_location(). + wined3d: Use wined3d_texture_blt() in swapchain_gl_present(). + wined3d: Store the context's current rendertarget as a texture and sub-resource index. + wined3d: Simplify checking if the released resource is in use as a rendertarget in device_resource_released(). + wined3d: Validate the sub-resource index in wined3d_rendertarget_view_init(). + wined3d: Get rid of the d3d_surface and d3d_texture debug channels. + wined3d: Use the texture dimension helpers in arbfp_blit_surface(). + wined3d: Use the texture dimension helpers in context_find_fbo_entry(). + wined3d: Use the texture dimension helpers in is_full_clear(). + wined3d: Use the texture dimension helpers in prepare_ds_clear(). + wined3d: Use the texture dimension helpers in wined3d_device_update_texture_3d(). + wined3d: Avoid surface_from_resource() in device_load_logo(). + wined3d: Avoid surface_from_resource() in wined3d_device_init_3d(). + wined3d: Avoid surface_from_resource() in wined3d_device_update_texture(). + wined3d: Avoid surface_from_resource() in swapchain_gl_present(). + wined3d: Avoid surface_from_resource() in swapchain_gdi_frontbuffer_updated(). + +Hugh McMaster (4): + reg: Allow values to be added, deleted or modified in root keys. + kernel32: Add a stub for SetCurrentConsoleFontEx. + regedit: Display REG_DWORD_BIG_ENDIAN values. + regedit: Display REG_NONE values. + +Huw D. M. Davies (1): + wineqtdecoder: Use thread-safe initialization. + +Iván Matellanes (1): + msvcirt: Avoid superfluous comparison in some compilers. + +Jacek Caban (49): + mshtml/tests: Fixed xmlhttprequest test failures. + mshtml/tests: Fixed remaining xmlhttprequest test failures. + jscript: Removed no longer used argument from exec_source. + jscript: Added a few more arguments tests. + jscript: Keep track of active call in a separated structure. + jscript: Store bytecode pointer in call_frame_t. + jscript: Store function description in call_frame_t. + jscript: Added new helpers for jumps. + jscript: Store exception frame in call_frame_t. + jscript: Store instruction pointer in call_frame_t. + jscript: Store stack base in call_frame_t. + jscript: Store current scope chain in call_frame_t. + jscript: Store entry scope chain in call_frame_t. + jscript: Pass script context instead of execution context to op handlers. + jscript: Moved stack from execution context to script context. + jscript: Store this object in call_frame_t. + jscript: Store variable object in call_frame_t. + jscript: Store return value in call_frame_t. + jscript: Store is_global flag in call_frame_t. + jscript: Get rid of no longer needed exec_ctx_t. + secur32: Use %LATEST_RECORD_VERSION gnutls priority. + jscript: Don't assume that ret value is cleared when it's not set explicitly. + jscript: Clear stack outside OP_new handler. + jscript: Clear stack outside OP_call* handlers. + jscript: Sore is_global as a flag. + jscript: Moved constructor return logic to interpreter. + jscript: Merge setup_call_frame into exec_source. + jscript: Keep reference to bytecode in call_frame_t. + jscript: Moved more return object logic to enter_bytecode loop. + jscript: Moved arguments object destuction to interpreter. + jscript: Find Function.arguments on the stack instead of storing it in FunctionInstance object. + jscript: Use already running interpreter for execution of member source function. + jscript: Use already running interpreter for execution expressions that are source functions. + jscript: Use already running interpreter for execution new expressions. + jscript: Use already running interpreter for Function.apply() execution. + jscript: Use already running interpreter for Function.call() execution. + jscript: Use already running interpreter for eval() execution. + mshtml: Moved createAttribute tests to test_attr. + mshtml: Split conversion to string out of get_elem_attr_value_by_dispid. + mshtml: Added support for IHTMLDOMAttribute2::get_value on detached attributes. + mshtml: Added IHTMLDOMAttribute2::get_parentNode implementation. + mshtml: Added IHTMLElement4::setAttributeNode implementation. + mshtml: Return NULL instead of empty string in get_node_text. + mshtml: Added IHTMLElement::get_outerText implementation. + mshtml: Added IHTMLElement::put_outerText implementation. + mshtml: Added IHTMLElement::outerText tests. + mshtml.idl: Added IHTMLHtmlElement declaration. + mshtml: Added HTMLHtmlElement object implementation. + mshtml: Added IHTMLDivElement declaration. + +Józef Kucia (46): + wined3d: Add extension detection for ARB_copy_buffer. + wined3d: Implement copying of buffer resources. + wined3d: Add support for buffers in wined3d_device_copy_sub_resource(). + d3d10core/tests: Add test for copying buffer resources. + d3d11/tests: Add test for copying buffer resources. + wined3d: Prevent possible integer overflow in buffer_invalidate_bo_range(). + wined3d: Fix driver version check. + wined3d: Introduce helper function for binding buffers. + wined3d: Allow draw calls without color attachments. + d3d10core/tests: Test render to depth texture. + d3d11/tests: Test render to depth texture. + d3d10core/tests: Add test for ClearRenderTargetView(). + d3d11/tests: Add test for ClearRenderTargetView(). + wined3d: Implement SM4 sample_c instruction. + wined3d: Implement SM4 sample_c_lz instruction. + wined3d: Use dcl_sampler to determine if shadow sampler is needed. + d3d8: Avoid '\n' in middle of TRACE() messages. + d3d9: Avoid '\n' in middle of TRACE() messages. + wined3d: Improve advertized driver version for Windows 10. + d3dx9: Avoid '\n' in middle of TRACE() message. + d3dcompiler: Avoid '\n' in middle of TRACE() messages. + wined3d: Recognize SM 4.1 ld2dms opcode. + wined3d: Recognize SM5 dcl_resource_structured opcode. + wined3d: Use lower case letters for simple data types in SM4 "opcode_table". + wined3d: Recognize SM5 dcl_uav_typed opcode. + wined3d: Recognize SM5 store_uav_typed opcode. + d3d11: Implement private data methods for immediate ID3D11DeviceContext. + d3d11: Add ID3D11HullShader interface stub. + wined3d: Add hull shader type. + wined3d: Introduce wined3d_shader_create_hs(). + wined3d: Recognize SM5 hs_decls opcode. + wined3d: Recognize SM5 hs_fork_phase opcode. + wined3d: Recognize SM5 dcl_input_control_point_count opcode. + wined3d: Recognize SM5 dcl_output_control_point_count opcode. + wined3d: Add system value names used by tessellation shaders. + wined3d: Improve wined3d_sysval_semantic enum values naming. + wined3d: Recognize SM5 dcl_hs_fork_phase_instance_count opcode. + wined3d: Avoid abbreviations in SM5 opcode names. + wined3d: Recognize SM5 dcl_hs_max_tessfactor opcode. + wined3d: Recognize SM5 vForkInstanceId register. + wined3d: Recognize SM5 dcl_tessellator_domain opcode. + wined3d: Recognize SM5 dcl_tessellator_output_primitive opcode. + wined3d: Recognize SM5 dcl_tessellator_partitioning opcode. + wined3d: Get rid of long else-if sequence from shader_sm4_read_instruction(). + wined3d: Add domain shader type. + d3d11: Implement d3d11_device_CreateDomainShader(). + +Ken Thomases (1): + user32: Call the EnumDisplayMonitors callback using a wrapper. + +Kerstin Noa (1): + wined3d: Add NVIDIA GeForce GTX 980 GPU information. + +Louis Lenders (3): + gdiplus: GdipTransformPath should return Ok if matrix = NULL. + gdiplus/tests: Add test for GdipTransformPath with null-matrix. + user32: Add stub for IsProcessDPIAware. + +Mark Jansen (1): + user32: Correctly determine bit count for BITMAPCOREINFO in is_dib_monochrome. + +Matteo Bruni (19): + wined3d: Emulate luminance texture formats on core profile. + wined3d: Add ARB_texture_swizzle extension. + wined3d: Use ARB_texture_swizzle for color fixups when possible. + d3d11/tests: Add a test for DXGI_FORMAT_A8_UNORM textures. + d3d10core/tests: Add a test for DXGI_FORMAT_A8_UNORM textures. + d3d11: Add a couple missing wined3d_mutex_unlock() in d3d_shader_resource_view_init() error paths. + wined3d: Get rid of WINED3D_GLSL_SAMPLE_NPOT. + wined3d: Clamp diffuse and specular color in GLSL vertex ffp replacement for core profile. + wined3d: Don't flag vertex color clamping for changes on core profile. + wined3d: Don't call glClampColorARB() on core profile. + d3d9/tests: Add a test for color varyings clamping. + d3d8/tests: Add a test for color varyings clamping. + wined3d: Don't set legacy light and texture environment state on core profile contexts. + wined3d: Disable ARB_point_sprite on core profile contexts. + wined3d: Don't try to set line stippling on core profile contexts. + ddraw/tests: Add a test for color varyings clamping. + wined3d: Avoid the deprecated GLSL "attribute" keyword on core profile contexts. + wined3d: Avoid the deprecated gl_FragData on core profile contexts. + wined3d: Don't read texcoord attributes unless necessary. + +Michael Müller (2): + kernel32: Set ERROR_DLL_NOT_FOUND as error code in load_library for Win 9x compatibility. + kernel32: Check for invalid filename pointers in CreateFileA for Win9x compatibility. + +Michael Stefaniuc (1): + ddraw: Use SetRect() instead of open coding it. + +Nikolay Sivov (41): + include: Added shimgdata.idl. + msctf: Make ITextStoreACPSink a part of context object. + msctf: Added stub ITextStoreACPServices support for context ITextStoreACPSink. + xmllite/writer: Implement WriteRaw(). + xmllite/tests: Use static linking to xmllite.dll. + xmllite/tests: Add a helper to test writer output. + xmllite/tests: Add a helper to create/set writer output. + ole32: Make CoGetInstanceFromFile() propagate failure codes to returned MULTI_QI data (Coverity). + ole32: Fix CreataDataCache() return value when requested riid is not IUnknown, for aggregation case. + msctf/tests: Fix a crash on unsupported interface. + oleaut32/tests: Fix a test crash on some XP SP1 VM. + xmllite/tests: A test for Write* behaviour on initial writer state. + xmllite/writer: Fix initial state handling in WriteEndDocument(). + xmllite/writer: Properly fail on initial state in WriteEndElement(). + xmllite/writer: Fix WriteEndElement()/WriteFullEndElement() on ready state. + msxml3/mxwriter: Don't allocate output buffer structure separately from the writer. + msxml3/mxwriter: Simplify argument check in externalEntityDecl(). + msxml3/tests: Remove useless VariantClear(). + msxml3/tests: Use win_skip() consistently. + xmllite/writer: Handle initial and ready states in the rest of tested Write* methods. + xmllite/writer: Put writer into closed state on WriteAttributeString(). + xmllite/writer: Fix a bunch of Write* methods to set closed state. + xmllite/writer: Make it possible to use WriteRaw() multiple times. + user32: For EnableScrollBar() always go through EnableWindow() in SB_CTL case. + include: Added IDXGISurface1 definition. + msxml3/mxwriter: No need to use contiguous allocation in case of BSTR output. + msxml3/mxwriter: Handle allocation failure in get_output(). + msxml3/mxwriter: Flush internal buffer as soon as it's filled. + msxml3/mxwriter: Use 4K for internal buffer size. + dwrite: Use regular QI way to return interface client asked for. + dwrite: Update to IDWriteFactory3. + include: Fix ID2D1DCRenderTarget definition. + d2d1: Don't use render target pointer directly in bitmap initialization helpers. + dxgi: Update to IDXGISurface1. + d2d1/tests: Basic test for ID2D1DCRenderTarget creation. + d2d1: Move bitmap creation helpers to common location. + t2embed: Implement TTGetEmbeddingType(). + fontsub: Added CreateFontPackage() stub. + d2d1: Move brush creation helpers to common location. + d2d1: Move mesh creation to mesh.c. + dwrite: Always initialize context and font table pointers. + +Patrick Armstrong (1): + bcrypt: Added BCryptHash function. + +Paul Gofman (4): + d3dx9: Add test for preshader in effect. + d3d9/tests: Add test for D3DFMT_L8 format as render target. + wined3d: Support D3DFMT_L8 format as render target. + d3dx9: Introduce preshaders in effect. + +Piotr Caban (11): + msvcrt: Fix exception parameters number validation in x86_64 __CxxDetectRethrow. + msvcrt: Dump exception information in x86_64 __CxxFrameHandler. + msvcrt: Restore exception object stored in thread storage after frames unwinding. + msvcrt: Register exception object before unwinding. + msvcrt: Update previous exception stored in cxx_frame_info after frames unwinding. + msvcrt: Call C structured exception translator in x86_64 __CxxFrameHandler. + msvcrt: Improve dump_function_descr helper. + msvcrt: Add x86_64 __CxxFrameHandler implementation. + msvcrt: Handle frames with CXX_FRAME_MAGIC_VC6 and CXX_FRAME_MAGIC_VC7 magic value. + include: Fix ITargetFrame definition. + ieframe: Add ITargetFrame stub. + +Rob Walker (1): + wined3d: Add Nvidia GPU SKUs 950,950M,960,960M. Sebastian Lackner (9): - services: Fix a typo. - services: Hold scmdatabase lock while checking marked_for_delete. - services: Initialize service ref_count directly in service_create. - services: Introduce refcounting for processes. - services: Pass a process argument to send_start_message function. - services: Pass a process argument to send_control function. - services: Pass a process argument to wait_for_startup function. - setupapi: Fix parsing of inf files containing garbage at the beginning of the file. - ieframe: Fix implementation of impl_from_ITargetFrame2. + ntdll: Fix off-by-one errors in __wine_set_signal_handler. + quartz: Fix use of CONTAINING_RECORD in impl_from_TransformFilter. + jscript: Fix off-by-one error in decode_dword. + include: Add definition for TP_CALLBACK_ENVIRON_V3. + ntdll/tests: Add test for threadpool environment version 3. + ntdll: Don't warn about unsupported environment version 3. + kernel32: Fix handling of GetOverlappedResult when status remains STATUS_PENDING. + user32: Set %ecx to address of rect in EnumDisplayMonitors callback. + ntdll: Use close_handle instead of NtClose for internal memory management functions. Stefan Dösinger (10): - wined3d: Merge surface_prepare_map_memory() into wined3d_surface_prepare(). - wined3d: Call wined3d_surface_prepare() in surface_load_sysmem(). - wined3d: Call wined3d_volume_prepare_location() in wined3d_volume_load_location(). - wined3d: Merge wined3d_surface_unmap() and wined3d_volume_unmap(). - wined3d: Merge wined3d_surface_map() and wined3d_volume_map(). - wined3d: Introduce wined3d_texture_use_pbo(). - wined3d: Merge wined3d_surface_update_desc() into wined3d_texture_update_desc(). - wined3d: Get rid of texture_ops.texture_sub_resource_add_dirty_region(). - wined3d: Get rid of state access in shader_generate_glsl_declarations(). - wined3d: Avoid storing a material pointer in struct wined3d_cs_set_material. - -Vincent Povirk (3): - mscoree: Restore previous domain whenever we set it. - user32: Set capture earlier on popup menus. - user32: Skip menu loop for empty popup menus. + wined3d: Avoid storing a clip plane pointer in struct wined3d_cs_set_clip_plane. + wined3d: Avoid storing a transformation matrix pointer in struct wined3d_cs_set_transform. + wined3d: Avoid storing a rectangle pointer in struct wined3d_cs_set_scissor_rect. + wined3d: Avoid storing a viewport pointer in struct wined3d_cs_set_viewport. + wined3d: Avoid storing color and rectangle pointers in struct wined3d_cs_clear. + wined3d: Avoid storing rectangle pointers in struct wined3d_cs_present. + wined3d: Store sub-resource locations in the sub-resource structure. + wined3d: Introduce wined3d_texture_validate_location(). + wined3d: Introduce wined3d_texture_invalidate_location(). + wined3d: Introduce wined3d_texture_get_memory(). + +Theodore Dubois (2): + shell32: Fix return value for ASSOCSTR_FRIENDLYDOCNAME and ASSOCSTR_DEFAULTICON when passed a ProgID. + shell32/tests: Additional tests for IQueryAssociations. + +Thomas Faber (3): + dbghelp: Use documented member name in SYMBOL_INFO structure. + user32/tests: Test loading monochrome icons. + user32: Handle BITMAPCOREINFO when loading icons. -Zhenbo Li (1): - authz: Stub AuthzAccessCheck, AuthzFreeContext, AuthzInitializeContextFromSid, AuthzInitializeContextFromToken. +Vincent Povirk (1): + mscoree: Enable crash chaining in Mono. -- Alexandre Julliard diff -Nru wine-staging-1.9.6/AUTHORS wine-staging-1.9.7~ubuntu15.04.1/AUTHORS --- wine-staging-1.9.6/AUTHORS 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/AUTHORS 2016-04-04 18:06:32.000000000 +0000 @@ -10,6 +10,7 @@ Achim Kaiser A C Hurst Adam Bolte +Adam Buchbinder Adam D. Moss Adam Gundy Adam Martinson @@ -789,6 +790,7 @@ Kenneth MacDonald Ken Sharp Ken Thomases +Kerstin Noa Kester Maddock Kevin Eaves Kevin Groeneveld @@ -1240,6 +1242,7 @@ Robert Wilhelm Rob Farnum Rob McClinton +Rob Walker Roderick Colenbrander Roger Hoang Roger Koot @@ -1369,6 +1372,7 @@ Tapio Kautto Tatyana Fokina Ted Percival +Theodore Dubois Theodore S. Hetke Thomas Brix Larsen Thomas Faber diff -Nru wine-staging-1.9.6/configure wine-staging-1.9.7~ubuntu15.04.1/configure --- wine-staging-1.9.6/configure 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/configure 2016-04-04 18:06:32.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.6. +# Generated by GNU Autoconf 2.69 for Wine 1.9.7. # # Report bugs to . # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='Wine' PACKAGE_TARNAME='wine' -PACKAGE_VERSION='1.9.6' -PACKAGE_STRING='Wine 1.9.6' +PACKAGE_VERSION='1.9.7' +PACKAGE_STRING='Wine 1.9.7' PACKAGE_BUGREPORT='wine-devel@winehq.org' PACKAGE_URL='http://www.winehq.org' @@ -1156,6 +1156,7 @@ enable_jscript enable_jsproxy enable_kernel32 +enable_kernelbase enable_ksuser enable_ktmw32 enable_loadperf @@ -2132,7 +2133,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.6 to adapt to many kinds of systems. +\`configure' configures Wine 1.9.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -2202,7 +2203,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Wine 1.9.6:";; + short | recursive ) echo "Configuration of Wine 1.9.7:";; esac cat <<\_ACEOF @@ -2407,7 +2408,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Wine configure 1.9.6 +Wine configure 1.9.7 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2925,7 +2926,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.6, which was +It was created by Wine $as_me 1.9.7, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -7183,7 +7184,6 @@ LIBEXT="so" DLLEXT=".so" IMPLIBEXT="def" -STATIC_IMPLIBEXT="def.a" # Extract the first word of "ldd", so it can be a program name with args. set dummy ldd; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -7621,29 +7621,18 @@ if wine_fn_has_flag staticimplib then wine_fn_append_rule \ -"__builddeps__: $ac_file.$IMPLIBEXT $ac_file.$STATIC_IMPLIBEXT -$ac_file.$STATIC_IMPLIBEXT $ac_file.cross.a: $ac_deps -$ac_file.def: $srcdir/$ac_dir/$ac_name.spec \$(WINEBUILD) - \$(WINEBUILD) \$(TARGETFLAGS)$ac_implibflags -w --def -o \$@ --export $srcdir/$ac_dir/$ac_name.spec -$ac_file.$STATIC_IMPLIBEXT: dummy - @cd $ac_dir && \$(MAKE) lib$ac_implib.$STATIC_IMPLIBEXT +"__builddeps__: $ac_file.a +$ac_file.a $ac_file.cross.a: $ac_deps +$ac_file.a: dummy + @cd $ac_dir && \$(MAKE) lib$ac_implib.a .PHONY: $ac_dir/install-dev $ac_dir/uninstall -$ac_dir/install-dev:: $ac_file.$IMPLIBEXT - \$(INSTALL_DATA) $ac_file.$IMPLIBEXT \$(DESTDIR)\$(dlldir)/lib$ac_implib.$IMPLIBEXT +$ac_dir/install-dev:: $ac_file.a + \$(INSTALL_DATA) $ac_file.a \$(DESTDIR)\$(dlldir)/lib$ac_implib.a $ac_dir/uninstall:: - \$(RM) \$(DESTDIR)\$(dlldir)/lib$ac_implib.$IMPLIBEXT + \$(RM) \$(DESTDIR)\$(dlldir)/lib$ac_implib.a install install-dev:: $ac_dir/install-dev __uninstall__: $ac_dir/uninstall" - if test "$IMPLIBEXT" != "$STATIC_IMPLIBEXT" - then - wine_fn_append_rule \ -"$ac_dir/install-dev:: $ac_file.$STATIC_IMPLIBEXT __builddeps__ - \$(INSTALL_DATA) $ac_file.$STATIC_IMPLIBEXT \$(DESTDIR)\$(dlldir)/lib$ac_implib.$STATIC_IMPLIBEXT -$ac_dir/uninstall:: - \$(RM) \$(DESTDIR)\$(dlldir)/lib$ac_implib.$STATIC_IMPLIBEXT" - fi - if test -n "$CROSSTARGET" -a -z "$ac_implibflags" then wine_fn_append_rule \ @@ -7920,7 +7909,6 @@ LIBEXT="dll" DLLEXT="" IMPLIBEXT="a" - STATIC_IMPLIBEXT="a" enable_iphlpapi=${enable_iphlpapi:-no} enable_kernel32=${enable_kernel32:-no} enable_msvcrt=${enable_msvcrt:-no} @@ -8562,61 +8550,63 @@ case $host_cpu in *i[3456789]86* | x86_64) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,--section-start,.interp=0x7bf00400" >&5 -$as_echo_n "checking whether the compiler supports -Wl,--section-start,.interp=0x7bf00400... " >&6; } -if ${ac_cv_cflags__Wl___section_start__interp_0x7bf00400+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,-Ttext-segment=0x7bc00000" >&5 +$as_echo_n "checking whether the compiler supports -Wl,-Ttext-segment=0x7bc00000... " >&6; } +if ${ac_cv_cflags__Wl__Ttext_segment_0x7bc00000+:} false; then : $as_echo_n "(cached) " >&6 else ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wl,--section-start,.interp=0x7bf00400" +CFLAGS="$CFLAGS -Wl,-Ttext-segment=0x7bc00000" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main(int argc, char **argv) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_cflags__Wl___section_start__interp_0x7bf00400=yes + ac_cv_cflags__Wl__Ttext_segment_0x7bc00000=yes else - ac_cv_cflags__Wl___section_start__interp_0x7bf00400=no + ac_cv_cflags__Wl__Ttext_segment_0x7bc00000=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ac_wine_try_cflags_saved fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl___section_start__interp_0x7bf00400" >&5 -$as_echo "$ac_cv_cflags__Wl___section_start__interp_0x7bf00400" >&6; } -if test "x$ac_cv_cflags__Wl___section_start__interp_0x7bf00400" = xyes; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl__Ttext_segment_0x7bc00000" >&5 +$as_echo "$ac_cv_cflags__Wl__Ttext_segment_0x7bc00000" >&6; } +if test "x$ac_cv_cflags__Wl__Ttext_segment_0x7bc00000" = xyes; then : case $host_os in - freebsd* | kfreebsd*-gnu) LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x60000400" ;; - *) LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x7bf00400" ;; + freebsd* | kfreebsd*-gnu) LDEXECFLAGS="$LDEXECFLAGS -Wl,-Ttext-segment=0x60000000" ;; + *) LDEXECFLAGS="$LDEXECFLAGS -Wl,-Ttext-segment=0x7c000000" ;; esac - -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,-Ttext-segment=0x7bc00000" >&5 -$as_echo_n "checking whether the compiler supports -Wl,-Ttext-segment=0x7bc00000... " >&6; } -if ${ac_cv_cflags__Wl__Ttext_segment_0x7bc00000+:} false; then : +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,--section-start,.interp=0x7c000400" >&5 +$as_echo_n "checking whether the compiler supports -Wl,--section-start,.interp=0x7c000400... " >&6; } +if ${ac_cv_cflags__Wl___section_start__interp_0x7c000400+:} false; then : $as_echo_n "(cached) " >&6 else ac_wine_try_cflags_saved=$CFLAGS -CFLAGS="$CFLAGS -Wl,-Ttext-segment=0x7bc00000" +CFLAGS="$CFLAGS -Wl,--section-start,.interp=0x7c000400" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main(int argc, char **argv) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_cflags__Wl__Ttext_segment_0x7bc00000=yes + ac_cv_cflags__Wl___section_start__interp_0x7c000400=yes else - ac_cv_cflags__Wl__Ttext_segment_0x7bc00000=no + ac_cv_cflags__Wl___section_start__interp_0x7c000400=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ac_wine_try_cflags_saved fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl__Ttext_segment_0x7bc00000" >&5 -$as_echo "$ac_cv_cflags__Wl__Ttext_segment_0x7bc00000" >&6; } -if test "x$ac_cv_cflags__Wl__Ttext_segment_0x7bc00000" = xyes; then : - : -else - # Extract the first word of "prelink", so it can be a program name with args. +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl___section_start__interp_0x7c000400" >&5 +$as_echo "$ac_cv_cflags__Wl___section_start__interp_0x7c000400" >&6; } +if test "x$ac_cv_cflags__Wl___section_start__interp_0x7c000400" = xyes; then : + case $host_os in + freebsd* | kfreebsd*-gnu) LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x60000400" ;; + *) LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x7c000400" ;; + esac +fi + # Extract the first word of "prelink", so it can be a program name with args. set dummy prelink; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } @@ -8662,6 +8652,31 @@ as_fn_append wine_warnings "|prelink not found and linker does not support relocation, base address of core dlls won't be set correctly." fi fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wl,-z,max-page-size=0x1000" >&5 +$as_echo_n "checking whether the compiler supports -Wl,-z,max-page-size=0x1000... " >&6; } +if ${ac_cv_cflags__Wl__z_max_page_size_0x1000+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_wine_try_cflags_saved=$CFLAGS +CFLAGS="$CFLAGS -Wl,-z,max-page-size=0x1000" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int main(int argc, char **argv) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_cflags__Wl__z_max_page_size_0x1000=yes +else + ac_cv_cflags__Wl__z_max_page_size_0x1000=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +CFLAGS=$ac_wine_try_cflags_saved +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__Wl__z_max_page_size_0x1000" >&5 +$as_echo "$ac_cv_cflags__Wl__z_max_page_size_0x1000" >&6; } +if test "x$ac_cv_cflags__Wl__z_max_page_size_0x1000" = xyes; then : + LDEXECFLAGS="$LDEXECFLAGS -Wl,-z,max-page-size=0x1000" +fi ;; esac @@ -16843,6 +16858,8 @@ fi for ac_func in \ + asinh \ + asinhf \ cbrt \ cbrtf \ erf \ @@ -17682,6 +17699,7 @@ wine_fn_config_dll jsproxy enable_jsproxy implib wine_fn_config_dll kernel32 enable_kernel32 clean,implib wine_fn_config_test dlls/kernel32/tests kernel32_test +wine_fn_config_dll kernelbase enable_kernelbase wine_fn_config_dll keyboard.drv16 enable_win16 wine_fn_config_dll krnl386.exe16 enable_win16 implib kernel wine_fn_config_dll ksuser enable_ksuser @@ -17953,7 +17971,8 @@ wine_fn_config_dll sxs enable_sxs implib wine_fn_config_test dlls/sxs/tests sxs_test wine_fn_config_dll system.drv16 enable_win16 -wine_fn_config_dll t2embed enable_t2embed +wine_fn_config_dll t2embed enable_t2embed implib +wine_fn_config_test dlls/t2embed/tests t2embed_test wine_fn_config_dll tapi32 enable_tapi32 implib wine_fn_config_dll taskschd enable_taskschd clean wine_fn_config_test dlls/taskschd/tests taskschd_test @@ -18808,7 +18827,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.6, which was +This file was extended by Wine $as_me 1.9.7, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -18879,7 +18898,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.6 +Wine config.status 1.9.7 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru wine-staging-1.9.6/configure.ac wine-staging-1.9.7~ubuntu15.04.1/configure.ac --- wine-staging-1.9.6/configure.ac 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/configure.ac 2016-04-04 18:06:32.000000000 +0000 @@ -676,7 +676,6 @@ LIBEXT="so" DLLEXT=".so" IMPLIBEXT="def" -STATIC_IMPLIBEXT="def.a" WINE_PATH_SONAME_TOOLS WINE_CONFIG_HELPERS @@ -691,7 +690,6 @@ LIBEXT="dll" DLLEXT="" IMPLIBEXT="a" - STATIC_IMPLIBEXT="a" dnl Disable modules that can't be used on Windows enable_iphlpapi=${enable_iphlpapi:-no} enable_kernel32=${enable_kernel32:-no} @@ -897,18 +895,23 @@ case $host_cpu in *i[[3456789]]86* | x86_64) - WINE_TRY_CFLAGS([-Wl,--section-start,.interp=0x7bf00400], + WINE_TRY_CFLAGS([-Wl,-Ttext-segment=0x7bc00000], [case $host_os in - freebsd* | kfreebsd*-gnu) LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x60000400" ;; - *) LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x7bf00400" ;; - esac - ]) - WINE_TRY_CFLAGS([-Wl,-Ttext-segment=0x7bc00000],[:], - [AC_PATH_PROG(PRELINK, prelink, false, [/sbin /usr/sbin $PATH]) + freebsd* | kfreebsd*-gnu) LDEXECFLAGS="$LDEXECFLAGS -Wl,-Ttext-segment=0x60000000" ;; + *) LDEXECFLAGS="$LDEXECFLAGS -Wl,-Ttext-segment=0x7c000000" ;; + esac], + [WINE_TRY_CFLAGS([-Wl,--section-start,.interp=0x7c000400], + [case $host_os in + freebsd* | kfreebsd*-gnu) LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x60000400" ;; + *) LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x7c000400" ;; + esac]) + AC_PATH_PROG(PRELINK, prelink, false, [/sbin /usr/sbin $PATH]) if test "x$PRELINK" = xfalse then WINE_WARNING([prelink not found and linker does not support relocation, base address of core dlls won't be set correctly.]) fi]) + WINE_TRY_CFLAGS([-Wl,-z,max-page-size=0x1000], + [LDEXECFLAGS="$LDEXECFLAGS -Wl,-z,max-page-size=0x1000"]) ;; esac @@ -2513,6 +2516,8 @@ fi AC_CHECK_FUNCS(\ + asinh \ + asinhf \ cbrt \ cbrtf \ erf \ @@ -2991,6 +2996,7 @@ WINE_CONFIG_DLL(jsproxy,,[implib]) WINE_CONFIG_DLL(kernel32,,[clean,implib]) WINE_CONFIG_TEST(dlls/kernel32/tests) +WINE_CONFIG_DLL(kernelbase) WINE_CONFIG_DLL(keyboard.drv16,enable_win16) WINE_CONFIG_DLL(krnl386.exe16,enable_win16,[implib],[kernel]) WINE_CONFIG_DLL(ksuser) @@ -3262,7 +3268,8 @@ WINE_CONFIG_DLL(sxs,,[implib]) WINE_CONFIG_TEST(dlls/sxs/tests) WINE_CONFIG_DLL(system.drv16,enable_win16) -WINE_CONFIG_DLL(t2embed) +WINE_CONFIG_DLL(t2embed,,[implib]) +WINE_CONFIG_TEST(dlls/t2embed/tests) WINE_CONFIG_DLL(tapi32,,[implib]) WINE_CONFIG_DLL(taskschd,,[clean]) WINE_CONFIG_TEST(dlls/taskschd/tests) diff -Nru wine-staging-1.9.6/debian/bzr-builder.manifest wine-staging-1.9.7~ubuntu15.04.1/debian/bzr-builder.manifest --- wine-staging-1.9.6/debian/bzr-builder.manifest 2016-03-22 02:52:03.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/debian/bzr-builder.manifest 2016-04-04 19:27:41.000000000 +0000 @@ -1,4 +1,4 @@ -# bzr-builder format 0.4 deb-version 1.9.6-1 -lp:wine revid:git-v1:6bc0ce26a853b51f11958545bfa5570bdcb1cf01 -merge wine-staging-files lp:wine-compholio revid:git-v1:ffad0e5c7b87b81937c84d3a72a7e0a2976ea813 -merge wine-build-staging lp:~wine/wine/build-staging revid:sebastian@fds-team.de-20160322012150-21dkiuvm1bbuaqah +# bzr-builder format 0.4 deb-version 1.9.7 +lp:wine revid:git-v1:442e60b7e4c010e6622d524f47a2dd0d26ba19d4 +merge wine-staging-files lp:wine-compholio revid:git-v1:9aba381edd2c3e3938a88720df6de87e22bd2c4f +merge wine-build-staging lp:~wine/wine/build-staging revid:sebastian@fds-team.de-20160404180149-u4nes2fn8le06ix6 diff -Nru wine-staging-1.9.6/debian/changelog wine-staging-1.9.7~ubuntu15.04.1/debian/changelog --- wine-staging-1.9.6/debian/changelog 2016-03-22 02:52:03.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/debian/changelog 2016-04-04 19:27:41.000000000 +0000 @@ -1,9 +1,9 @@ -wine-staging (1.9.6-1~ubuntu15.04.1) vivid; urgency=low +wine-staging (1.9.7~ubuntu15.04.1) vivid; urgency=low * Auto build. - -- Sebastian Lackner Tue, 22 Mar 2016 02:52:03 +0000 + -- Sebastian Lackner Mon, 04 Apr 2016 19:27:41 +0000 -wine-staging (1.9.6-1) unstable; urgency=low +wine-staging (1.9.7) unstable; urgency=low * Auto build. - -- Michael Müller Tue, 22 Mar 2016 01:14:03 -0000 + -- Michael Müller Mon, 04 Apr 2016 16:59:31 -0000 diff -Nru wine-staging-1.9.6/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec wine-staging-1.9.7~ubuntu15.04.1/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec --- wine-staging-1.9.6/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec 2016-04-04 18:06:32.000000000 +0000 @@ -129,9 +129,9 @@ @ stub acoshl @ cdecl asin(double) ucrtbase.asin @ cdecl -arch=arm,x86_64 asinf(float) ucrtbase.asinf -@ stub asinh -@ stub asinhf -@ stub asinhl +@ cdecl asinh(double double) ucrtbase.asinh +@ cdecl asinhf(float float) ucrtbase.asinhf +@ cdecl asinhl(double double) ucrtbase.asinhl @ cdecl atan(double) ucrtbase.atan @ cdecl atan2(double double) ucrtbase.atan2 @ cdecl -arch=arm,x86_64 atan2f(float float) ucrtbase.atan2f @@ -252,7 +252,7 @@ @ cdecl fmod(double double) ucrtbase.fmod @ cdecl -arch=arm,x86_64 fmodf(float float) ucrtbase.fmodf @ cdecl frexp(double ptr) ucrtbase.frexp -@ stub hypot +@ cdecl hypot(double double) ucrtbase.hypot @ stub ilogb @ stub ilogbf @ stub ilogbl diff -Nru wine-staging-1.9.6/dlls/bcrypt/bcrypt_main.c wine-staging-1.9.7~ubuntu15.04.1/dlls/bcrypt/bcrypt_main.c --- wine-staging-1.9.6/dlls/bcrypt/bcrypt_main.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/bcrypt/bcrypt_main.c 2016-04-04 18:06:32.000000000 +0000 @@ -808,6 +808,38 @@ } } +NTSTATUS WINAPI BCryptHash( BCRYPT_ALG_HANDLE algorithm, UCHAR *secret, ULONG secretlen, + UCHAR *input, ULONG inputlen, UCHAR *output, ULONG outputlen ) +{ + NTSTATUS status; + BCRYPT_HASH_HANDLE handle; + + TRACE( "%p, %p, %u, %p, %u, %p, %u\n", algorithm, secret, secretlen, + input, inputlen, output, outputlen ); + + status = BCryptCreateHash( algorithm, &handle, NULL, 0, secret, secretlen, 0); + if (status != STATUS_SUCCESS) + { + return status; + } + + status = BCryptHashData( handle, input, inputlen, 0 ); + if (status != STATUS_SUCCESS) + { + BCryptDestroyHash( handle ); + return status; + } + + status = BCryptFinishHash( handle, output, outputlen, 0 ); + if (status != STATUS_SUCCESS) + { + BCryptDestroyHash( handle ); + return status; + } + + return BCryptDestroyHash( handle ); +} + BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) { switch (reason) diff -Nru wine-staging-1.9.6/dlls/bcrypt/bcrypt.spec wine-staging-1.9.7~ubuntu15.04.1/dlls/bcrypt/bcrypt.spec --- wine-staging-1.9.6/dlls/bcrypt/bcrypt.spec 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/bcrypt/bcrypt.spec 2016-04-04 18:06:32.000000000 +0000 @@ -29,6 +29,7 @@ @ stub BCryptGenerateSymmetricKey @ stdcall BCryptGetFipsAlgorithmMode(ptr) @ stdcall BCryptGetProperty(ptr wstr ptr long ptr long) +@ stdcall BCryptHash(ptr ptr long ptr long ptr long) @ stdcall BCryptHashData(ptr ptr long long) @ stub BCryptImportKey @ stub BCryptImportKeyPair diff -Nru wine-staging-1.9.6/dlls/bcrypt/tests/bcrypt.c wine-staging-1.9.7~ubuntu15.04.1/dlls/bcrypt/tests/bcrypt.c --- wine-staging-1.9.6/dlls/bcrypt/tests/bcrypt.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/bcrypt/tests/bcrypt.c 2016-04-04 18:06:32.000000000 +0000 @@ -26,6 +26,9 @@ #include "wine/test.h" +static NTSTATUS (WINAPI *pBCryptHash)( BCRYPT_ALG_HANDLE algorithm, UCHAR *secret, ULONG secretlen, + UCHAR *input, ULONG inputlen, UCHAR *output, ULONG outputlen ); + static void test_BCryptGenRandom(void) { NTSTATUS ret; @@ -648,8 +651,55 @@ ok(ret == STATUS_SUCCESS, "got %08x\n", ret); } +static void test_BcryptHash(void) +{ + static const char expected[] = + "e2a3e68d23ce348b8f68b3079de3d4c9"; + static const char expected_hmac[] = + "7bda029b93fa8d817fcc9e13d6bdf092"; + BCRYPT_ALG_HANDLE alg; + UCHAR md5[16], md5_hmac[16]; + char str[65]; + NTSTATUS ret; + + alg = NULL; + ret = BCryptOpenAlgorithmProvider(&alg, BCRYPT_MD5_ALGORITHM, MS_PRIMITIVE_PROVIDER, 0); + ok(ret == STATUS_SUCCESS, "got %08x\n", ret); + ok(alg != NULL, "alg not set\n"); + + test_hash_length(alg, 16); + test_alg_name(alg, "MD5"); + + memset(md5, 0, sizeof(md5)); + ret = pBCryptHash(alg, NULL, 0, (UCHAR *)"test", sizeof("test"), md5, sizeof(md5)); + ok(ret == STATUS_SUCCESS, "got %08x\n", ret); + format_hash( md5, sizeof(md5), str ); + ok(!strcmp(str, expected), "got %s\n", str); + + ret = BCryptCloseAlgorithmProvider(alg, 0); + ok(ret == STATUS_SUCCESS, "got %08x\n", ret); + + alg = NULL; + memset(md5_hmac, 0, sizeof(md5_hmac)); + ret = BCryptOpenAlgorithmProvider(&alg, BCRYPT_MD5_ALGORITHM, MS_PRIMITIVE_PROVIDER, BCRYPT_ALG_HANDLE_HMAC_FLAG); + ok(ret == STATUS_SUCCESS, "got %08x\n", ret); + ok(alg != NULL, "alg not set\n"); + + ret = pBCryptHash(alg, (UCHAR *)"key", sizeof("key"), (UCHAR *)"test", sizeof("test"), md5_hmac, sizeof(md5_hmac)); + ok(ret == STATUS_SUCCESS, "got %08x\n", ret); + format_hash( md5_hmac, sizeof(md5_hmac), str ); + ok(!strcmp(str, expected_hmac), "got %s\n", str); + + ret = BCryptCloseAlgorithmProvider(alg, 0); + ok(ret == STATUS_SUCCESS, "got %08x\n", ret); +} + START_TEST(bcrypt) { + HMODULE module; + + module = GetModuleHandleA( "bcrypt.dll" ); + test_BCryptGenRandom(); test_BCryptGetFipsAlgorithmMode(); test_sha1(); @@ -657,4 +707,11 @@ test_sha384(); test_sha512(); test_md5(); + + pBCryptHash = (void *)GetProcAddress( module, "BCryptHash" ); + + if (pBCryptHash) + test_BcryptHash(); + else + win_skip("BCryptHash is not available\n"); } diff -Nru wine-staging-1.9.6/dlls/comctl32/tests/animate.c wine-staging-1.9.7~ubuntu15.04.1/dlls/comctl32/tests/animate.c --- wine-staging-1.9.6/dlls/comctl32/tests/animate.c 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/comctl32/tests/animate.c 2016-04-04 18:06:32.000000000 +0000 @@ -0,0 +1,185 @@ +/* Unit tests for the animate control. + * + * Copyright 2016 Bruno Jesus + * + * 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 "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" +#include "commctrl.h" + +#include "wine/test.h" + +#define SEARCHING_AVI_INDEX 151 /* From shell32 resource library */ +#define INVALID_AVI_INDEX 0xffff + +static HWND hAnimateParentWnd, hAnimateWnd; +static const char animateTestClass[] = "AnimateTestClass"; +static WNDPROC animate_wndproc; +static HANDLE shell32; + +/* try to make sure pending X events have been processed before continuing */ +static void flush_events(void) +{ + MSG msg; + int diff = 100; + DWORD time = GetTickCount() + diff; + + while (diff > 0) + { + if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min(10,diff), QS_ALLINPUT ) == WAIT_TIMEOUT) break; + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); + diff = time - GetTickCount(); + } +} + +static LRESULT CALLBACK animate_test_wnd_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch(msg) + { + case WM_DESTROY: + PostQuitMessage(0); + break; + + default: + return DefWindowProcA(hWnd, msg, wParam, lParam); + } + return 0L; +} + +static void update_window(HWND hWnd) +{ + UpdateWindow(hWnd); + ok(!GetUpdateRect(hWnd, NULL, FALSE), "GetUpdateRect must return zero after UpdateWindow\n"); +} + +static void create_animate(DWORD parent_style, DWORD animate_style) +{ + WNDCLASSA wc; + RECT rect; + BOOL ret; + + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = GetModuleHandleA(NULL); + wc.hIcon = NULL; + wc.hCursor = LoadCursorA(NULL, (LPCSTR)IDC_ARROW); + wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW); + wc.lpszMenuName = NULL; + wc.lpszClassName = animateTestClass; + wc.lpfnWndProc = animate_test_wnd_proc; + RegisterClassA(&wc); + + rect.left = 0; + rect.top = 0; + rect.right = 200; + rect.bottom = 200; + ret = AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW, FALSE); + ok(ret, "got %d\n", ret); + + hAnimateParentWnd = CreateWindowExA(0, animateTestClass, "Animate Test", WS_OVERLAPPEDWINDOW | parent_style, + CW_USEDEFAULT, CW_USEDEFAULT, rect.right - rect.left, rect.bottom - rect.top, NULL, NULL, GetModuleHandleA(NULL), 0); + ok(hAnimateParentWnd != NULL, "failed to create parent wnd\n"); + + GetClientRect(hAnimateParentWnd, &rect); + hAnimateWnd = CreateWindowExA(0, ANIMATE_CLASSA, NULL, WS_CHILD | WS_VISIBLE | animate_style, + 0, 0, rect.right, rect.bottom, hAnimateParentWnd, NULL, shell32, 0); + ok(hAnimateWnd != NULL, "failed to create parent wnd\n"); + animate_wndproc = (WNDPROC)SetWindowLongPtrA(hAnimateWnd, GWLP_WNDPROC, 0); + + ShowWindow(hAnimateParentWnd, SW_SHOWNORMAL); + ok(GetUpdateRect(hAnimateParentWnd, NULL, FALSE), "GetUpdateRect: There should be a region that needs to be updated\n"); + flush_events(); + update_window(hAnimateParentWnd); +} + +static void init(void) +{ + HMODULE hComctl32; + BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*); + + hComctl32 = GetModuleHandleA("comctl32.dll"); + pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx"); + if (pInitCommonControlsEx) + { + INITCOMMONCONTROLSEX iccex; + iccex.dwSize = sizeof(iccex); + iccex.dwICC = ICC_ANIMATE_CLASS; + pInitCommonControlsEx(&iccex); + } + else + InitCommonControls(); + + shell32 = LoadLibraryA("Shell32.dll"); +} + +static void destroy_animate(void) +{ + MSG msg; + + PostMessageA(hAnimateParentWnd, WM_CLOSE, 0, 0); + while (GetMessageA(&msg,0,0,0)) + { + TranslateMessage(&msg); + DispatchMessageA(&msg); + } + hAnimateParentWnd = NULL; +} + +static void cleanup(void) +{ + UnregisterClassA(animateTestClass, GetModuleHandleA(NULL)); +} + +static void test_play(void) +{ + LONG res; + DWORD err; + + create_animate(0, 0); + SetLastError(0xdeadbeef); + res = SendMessageA(hAnimateWnd, ACM_OPENA,(WPARAM)shell32, MAKEINTRESOURCE(INVALID_AVI_INDEX)); + err = GetLastError(); + ok(res == 0, "Invalid video should have failed\n"); + ok(err == ERROR_RESOURCE_NAME_NOT_FOUND, "Expected 1814, got %u\n", err); + + SetLastError(0xdeadbeef); + res = SendMessageA(hAnimateWnd, ACM_PLAY, (WPARAM) -1, MAKELONG(0, -1)); + ok(res == 0, "Play should have failed\n"); + ok(err == ERROR_RESOURCE_NAME_NOT_FOUND, "Expected 1814, got %u\n", err); + destroy_animate(); + + create_animate(0, 0); + res = SendMessageA(hAnimateWnd, ACM_OPENA,(WPARAM)shell32, MAKEINTRESOURCE(SEARCHING_AVI_INDEX)); + ok(res != 0, "Load AVI resource failed\n"); + res = SendMessageA(hAnimateWnd, ACM_PLAY, (WPARAM) -1, MAKELONG(0, -1)); + ok(res != 0, "Play should have worked\n"); + destroy_animate(); +} + +START_TEST(animate) +{ + init(); + + test_play(); + + cleanup(); +} diff -Nru wine-staging-1.9.6/dlls/comctl32/tests/Makefile.in wine-staging-1.9.7~ubuntu15.04.1/dlls/comctl32/tests/Makefile.in --- wine-staging-1.9.6/dlls/comctl32/tests/Makefile.in 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/comctl32/tests/Makefile.in 2016-04-04 18:06:32.000000000 +0000 @@ -2,6 +2,7 @@ IMPORTS = comctl32 ole32 user32 gdi32 advapi32 C_SRCS = \ + animate.c \ button.c \ comboex.c \ datetime.c \ diff -Nru wine-staging-1.9.6/dlls/crypt32/crypt32.spec wine-staging-1.9.7~ubuntu15.04.1/dlls/crypt32/crypt32.spec --- wine-staging-1.9.6/dlls/crypt32/crypt32.spec 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/crypt32/crypt32.spec 2016-04-04 18:06:32.000000000 +0000 @@ -160,7 +160,7 @@ @ stdcall CryptMsgOpenToEncode(long long long ptr str ptr) @ stdcall CryptMsgSignCTL(long ptr long ptr long ptr ptr) @ stdcall CryptMsgUpdate(ptr ptr long long) -@ stub CryptMsgVerifyCountersignatureEncoded +@ stdcall CryptMsgVerifyCountersignatureEncoded(ptr long ptr long ptr long ptr) @ stdcall CryptMsgVerifyCountersignatureEncodedEx(ptr long ptr long ptr long long ptr long ptr) @ stdcall CryptProtectData(ptr wstr ptr ptr ptr long ptr) @ stdcall CryptProtectMemory(ptr long long) diff -Nru wine-staging-1.9.6/dlls/crypt32/msg.c wine-staging-1.9.7~ubuntu15.04.1/dlls/crypt32/msg.c --- wine-staging-1.9.6/dlls/crypt32/msg.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/crypt32/msg.c 2016-04-04 18:06:32.000000000 +0000 @@ -3737,6 +3737,17 @@ return ret; } +BOOL WINAPI CryptMsgVerifyCountersignatureEncoded(HCRYPTPROV_LEGACY hCryptProv, + DWORD dwEncodingType, BYTE *pbSignerInfo, DWORD cbSignerInfo, + PBYTE pbSignerInfoCountersignature, DWORD cbSignerInfoCountersignature, + CERT_INFO *pciCountersigner) +{ + FIXME("(%08lx, %08x, %p, %d, %p, %d, %p): stub\n", hCryptProv, + dwEncodingType, pbSignerInfo, cbSignerInfo, pbSignerInfoCountersignature, + cbSignerInfoCountersignature, pciCountersigner); + return FALSE; +} + BOOL WINAPI CryptMsgVerifyCountersignatureEncodedEx(HCRYPTPROV_LEGACY hCryptProv, DWORD dwEncodingType, PBYTE pbSignerInfo, DWORD cbSignerInfo, PBYTE pbSignerInfoCountersignature, DWORD cbSignerInfoCountersignature, diff -Nru wine-staging-1.9.6/dlls/d2d1/bitmap.c wine-staging-1.9.7~ubuntu15.04.1/dlls/d2d1/bitmap.c --- wine-staging-1.9.6/dlls/d2d1/bitmap.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d2d1/bitmap.c 2016-04-04 18:06:32.000000000 +0000 @@ -20,6 +20,7 @@ #include "wine/port.h" #include "d2d1_private.h" +#include "wincodec.h" WINE_DEFAULT_DEBUG_CHANNEL(d2d); @@ -238,8 +239,8 @@ } } -HRESULT d2d_bitmap_init_memory(struct d2d_bitmap *bitmap, struct d2d_d3d_render_target *render_target, - D2D1_SIZE_U size, const void *src_data, UINT32 pitch, const D2D1_BITMAP_PROPERTIES *desc) +HRESULT d2d_bitmap_create(ID2D1Factory *factory, ID3D10Device *device, D2D1_SIZE_U size, const void *src_data, + UINT32 pitch, const D2D1_BITMAP_PROPERTIES *desc, struct d2d_bitmap **bitmap) { D3D10_SUBRESOURCE_DATA resource_data; D3D10_TEXTURE2D_DESC texture_desc; @@ -269,14 +270,14 @@ resource_data.pSysMem = src_data; resource_data.SysMemPitch = pitch; - if (FAILED(hr = ID3D10Device_CreateTexture2D(render_target->device, &texture_desc, + if (FAILED(hr = ID3D10Device_CreateTexture2D(device, &texture_desc, src_data ? &resource_data : NULL, &texture))) { ERR("Failed to create texture, hr %#x.\n", hr); return hr; } - hr = ID3D10Device_CreateShaderResourceView(render_target->device, (ID3D10Resource *)texture, NULL, &view); + hr = ID3D10Device_CreateShaderResourceView(device, (ID3D10Resource *)texture, NULL, &view); ID3D10Texture2D_Release(texture); if (FAILED(hr)) { @@ -284,14 +285,19 @@ return hr; } - d2d_bitmap_init(bitmap, render_target->factory, view, size, desc); + if ((*bitmap = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(**bitmap)))) + { + d2d_bitmap_init(*bitmap, factory, view, size, desc); + TRACE("Created bitmap %p.\n", *bitmap); + } + ID3D10ShaderResourceView_Release(view); - return S_OK; + return *bitmap ? S_OK : E_OUTOFMEMORY; } -HRESULT d2d_bitmap_init_shared(struct d2d_bitmap *bitmap, struct d2d_d3d_render_target *render_target, - REFIID iid, void *data, const D2D1_BITMAP_PROPERTIES *desc) +HRESULT d2d_bitmap_create_shared(ID2D1Factory *factory, ID3D10Device *target_device, + REFIID iid, void *data, const D2D1_BITMAP_PROPERTIES *desc, struct d2d_bitmap **bitmap) { if (IsEqualGUID(iid, &IID_ID2D1Bitmap)) { @@ -299,12 +305,12 @@ D2D1_BITMAP_PROPERTIES d; ID3D10Device *device; - if (src_impl->factory != render_target->factory) + if (src_impl->factory != factory) return D2DERR_WRONG_FACTORY; ID3D10ShaderResourceView_GetDevice(src_impl->view, &device); ID3D10Device_Release(device); - if (device != render_target->device) + if (device != target_device) return D2DERR_UNSUPPORTED_OPERATION; if (!desc) @@ -322,7 +328,11 @@ return D2DERR_UNSUPPORTED_PIXEL_FORMAT; } - d2d_bitmap_init(bitmap, render_target->factory, src_impl->view, src_impl->pixel_size, desc); + if (!(*bitmap = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(**bitmap)))) + return E_OUTOFMEMORY; + + d2d_bitmap_init(*bitmap, factory, src_impl->view, src_impl->pixel_size, desc); + TRACE("Created bitmap %p.\n", *bitmap); return S_OK; } @@ -332,6 +342,109 @@ return E_INVALIDARG; } +HRESULT d2d_bitmap_create_from_wic_bitmap(ID2D1Factory *factory, ID3D10Device *device, IWICBitmapSource *bitmap_source, + const D2D1_BITMAP_PROPERTIES *desc, struct d2d_bitmap **bitmap) +{ + const D2D1_PIXEL_FORMAT *d2d_format; + D2D1_BITMAP_PROPERTIES bitmap_desc; + WICPixelFormatGUID wic_format; + unsigned int bpp, data_size; + D2D1_SIZE_U size; + unsigned int i; + WICRect rect; + UINT32 pitch; + HRESULT hr; + void *data; + + static const struct + { + const WICPixelFormatGUID *wic; + D2D1_PIXEL_FORMAT d2d; + } + format_lookup[] = + { + {&GUID_WICPixelFormat32bppPBGRA, {DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED}}, + {&GUID_WICPixelFormat32bppBGR, {DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_IGNORE}}, + }; + + if (FAILED(hr = IWICBitmapSource_GetSize(bitmap_source, &size.width, &size.height))) + { + WARN("Failed to get bitmap size, hr %#x.\n", hr); + return hr; + } + + if (!desc) + { + bitmap_desc.pixelFormat.format = DXGI_FORMAT_UNKNOWN; + bitmap_desc.pixelFormat.alphaMode = D2D1_ALPHA_MODE_UNKNOWN; + bitmap_desc.dpiX = 0.0f; + bitmap_desc.dpiY = 0.0f; + } + else + { + bitmap_desc = *desc; + } + + if (FAILED(hr = IWICBitmapSource_GetPixelFormat(bitmap_source, &wic_format))) + { + WARN("Failed to get bitmap format, hr %#x.\n", hr); + return hr; + } + + for (i = 0, d2d_format = NULL; i < sizeof(format_lookup) / sizeof(*format_lookup); ++i) + { + if (IsEqualGUID(&wic_format, format_lookup[i].wic)) + { + d2d_format = &format_lookup[i].d2d; + break; + } + } + + if (!d2d_format) + { + WARN("Unsupported WIC bitmap format %s.\n", debugstr_guid(&wic_format)); + return D2DERR_UNSUPPORTED_PIXEL_FORMAT; + } + + if (bitmap_desc.pixelFormat.format == DXGI_FORMAT_UNKNOWN) + bitmap_desc.pixelFormat.format = d2d_format->format; + if (bitmap_desc.pixelFormat.alphaMode == D2D1_ALPHA_MODE_UNKNOWN) + bitmap_desc.pixelFormat.alphaMode = d2d_format->alphaMode; + + switch (bitmap_desc.pixelFormat.format) + { + case DXGI_FORMAT_B8G8R8A8_UNORM: + bpp = 4; + break; + + default: + FIXME("Unhandled format %#x.\n", bitmap_desc.pixelFormat.format); + return D2DERR_UNSUPPORTED_PIXEL_FORMAT; + } + + pitch = ((bpp * size.width) + 15) & ~15; + data_size = pitch * size.height; + if (!(data = HeapAlloc(GetProcessHeap(), 0, data_size))) + return E_OUTOFMEMORY; + + rect.X = 0; + rect.Y = 0; + rect.Width = size.width; + rect.Height = size.height; + if (FAILED(hr = IWICBitmapSource_CopyPixels(bitmap_source, &rect, pitch, data_size, data))) + { + WARN("Failed to copy bitmap pixels, hr %#x.\n", hr); + HeapFree(GetProcessHeap(), 0, data); + return hr; + } + + hr = d2d_bitmap_create(factory, device, size, data, pitch, &bitmap_desc, bitmap); + + HeapFree(GetProcessHeap(), 0, data); + + return hr; +} + struct d2d_bitmap *unsafe_impl_from_ID2D1Bitmap(ID2D1Bitmap *iface) { if (!iface) diff -Nru wine-staging-1.9.6/dlls/d2d1/brush.c wine-staging-1.9.7~ubuntu15.04.1/dlls/d2d1/brush.c --- wine-staging-1.9.6/dlls/d2d1/brush.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d2d1/brush.c 2016-04-04 18:06:32.000000000 +0000 @@ -138,20 +138,27 @@ d2d_gradient_GetExtendMode, }; -HRESULT d2d_gradient_init(struct d2d_gradient *gradient, ID2D1Factory *factory, - const D2D1_GRADIENT_STOP *stops, UINT32 stop_count, D2D1_GAMMA gamma, D2D1_EXTEND_MODE extend_mode) +HRESULT d2d_gradient_create(ID2D1Factory *factory, const D2D1_GRADIENT_STOP *stops, + UINT32 stop_count, D2D1_GAMMA gamma, D2D1_EXTEND_MODE extend_mode, struct d2d_gradient **gradient) { + if (!(*gradient = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(**gradient)))) + return E_OUTOFMEMORY; + FIXME("Ignoring gradient properties.\n"); - gradient->ID2D1GradientStopCollection_iface.lpVtbl = &d2d_gradient_vtbl; - gradient->refcount = 1; - ID2D1Factory_AddRef(gradient->factory = factory); + (*gradient)->ID2D1GradientStopCollection_iface.lpVtbl = &d2d_gradient_vtbl; + (*gradient)->refcount = 1; + ID2D1Factory_AddRef((*gradient)->factory = factory); - gradient->stop_count = stop_count; - if (!(gradient->stops = HeapAlloc(GetProcessHeap(), 0, stop_count * sizeof(*stops)))) + (*gradient)->stop_count = stop_count; + if (!((*gradient)->stops = HeapAlloc(GetProcessHeap(), 0, stop_count * sizeof(*stops)))) + { + HeapFree(GetProcessHeap(), 0, *gradient); return E_OUTOFMEMORY; - memcpy(gradient->stops, stops, stop_count * sizeof(*stops)); + } + memcpy((*gradient)->stops, stops, stop_count * sizeof(*stops)); + TRACE("Created gradient %p.\n", *gradient); return S_OK; } @@ -308,12 +315,18 @@ d2d_solid_color_brush_GetColor, }; -void d2d_solid_color_brush_init(struct d2d_brush *brush, ID2D1Factory *factory, - const D2D1_COLOR_F *color, const D2D1_BRUSH_PROPERTIES *desc) +HRESULT d2d_solid_color_brush_create(ID2D1Factory *factory, const D2D1_COLOR_F *color, + const D2D1_BRUSH_PROPERTIES *desc, struct d2d_brush **brush) { - d2d_brush_init(brush, factory, D2D_BRUSH_TYPE_SOLID, desc, + if (!(*brush = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(**brush)))) + return E_OUTOFMEMORY; + + d2d_brush_init(*brush, factory, D2D_BRUSH_TYPE_SOLID, desc, (ID2D1BrushVtbl *)&d2d_solid_color_brush_vtbl); - brush->u.solid.color = *color; + (*brush)->u.solid.color = *color; + + TRACE("Created brush %p.\n", *brush); + return S_OK; } static inline struct d2d_brush *impl_from_ID2D1LinearGradientBrush(ID2D1LinearGradientBrush *iface) @@ -464,14 +477,19 @@ d2d_linear_gradient_brush_GetGradientStopCollection, }; -void d2d_linear_gradient_brush_init(struct d2d_brush *brush, ID2D1Factory *factory, - const D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES *gradient_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc, - ID2D1GradientStopCollection *gradient) +HRESULT d2d_linear_gradient_brush_create(ID2D1Factory *factory, const D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES *gradient_brush_desc, + const D2D1_BRUSH_PROPERTIES *brush_desc, ID2D1GradientStopCollection *gradient, struct d2d_brush **brush) { + if (!(*brush = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(**brush)))) + return E_OUTOFMEMORY; + FIXME("Ignoring brush properties.\n"); - d2d_brush_init(brush, factory, D2D_BRUSH_TYPE_LINEAR, brush_desc, + d2d_brush_init(*brush, factory, D2D_BRUSH_TYPE_LINEAR, brush_desc, (ID2D1BrushVtbl *)&d2d_linear_gradient_brush_vtbl); + + TRACE("Created brush %p.\n", *brush); + return S_OK; } static inline struct d2d_brush *impl_from_ID2D1BitmapBrush(ID2D1BitmapBrush *iface) @@ -690,25 +708,31 @@ d2d_bitmap_brush_GetBitmap, }; -void d2d_bitmap_brush_init(struct d2d_brush *brush, ID2D1Factory *factory, ID2D1Bitmap *bitmap, - const D2D1_BITMAP_BRUSH_PROPERTIES *bitmap_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc) +HRESULT d2d_bitmap_brush_create(ID2D1Factory *factory, ID2D1Bitmap *bitmap, const D2D1_BITMAP_BRUSH_PROPERTIES *bitmap_brush_desc, + const D2D1_BRUSH_PROPERTIES *brush_desc, struct d2d_brush **brush) { - d2d_brush_init(brush, factory, D2D_BRUSH_TYPE_BITMAP, + if (!(*brush = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(**brush)))) + return E_OUTOFMEMORY; + + d2d_brush_init(*brush, factory, D2D_BRUSH_TYPE_BITMAP, brush_desc, (ID2D1BrushVtbl *)&d2d_bitmap_brush_vtbl); - if ((brush->u.bitmap.bitmap = unsafe_impl_from_ID2D1Bitmap(bitmap))) - ID2D1Bitmap_AddRef(&brush->u.bitmap.bitmap->ID2D1Bitmap_iface); + if (((*brush)->u.bitmap.bitmap = unsafe_impl_from_ID2D1Bitmap(bitmap))) + ID2D1Bitmap_AddRef(&(*brush)->u.bitmap.bitmap->ID2D1Bitmap_iface); if (bitmap_brush_desc) { - brush->u.bitmap.extend_mode_x = bitmap_brush_desc->extendModeX; - brush->u.bitmap.extend_mode_y = bitmap_brush_desc->extendModeY; - brush->u.bitmap.interpolation_mode = bitmap_brush_desc->interpolationMode; + (*brush)->u.bitmap.extend_mode_x = bitmap_brush_desc->extendModeX; + (*brush)->u.bitmap.extend_mode_y = bitmap_brush_desc->extendModeY; + (*brush)->u.bitmap.interpolation_mode = bitmap_brush_desc->interpolationMode; } else { - brush->u.bitmap.extend_mode_x = D2D1_EXTEND_MODE_CLAMP; - brush->u.bitmap.extend_mode_y = D2D1_EXTEND_MODE_CLAMP; - brush->u.bitmap.interpolation_mode = D2D1_BITMAP_INTERPOLATION_MODE_LINEAR; + (*brush)->u.bitmap.extend_mode_x = D2D1_EXTEND_MODE_CLAMP; + (*brush)->u.bitmap.extend_mode_y = D2D1_EXTEND_MODE_CLAMP; + (*brush)->u.bitmap.interpolation_mode = D2D1_BITMAP_INTERPOLATION_MODE_LINEAR; } + + TRACE("Created brush %p.\n", *brush); + return S_OK; } struct d2d_brush *unsafe_impl_from_ID2D1Brush(ID2D1Brush *iface) diff -Nru wine-staging-1.9.6/dlls/d2d1/d2d1_private.h wine-staging-1.9.7~ubuntu15.04.1/dlls/d2d1/d2d1_private.h --- wine-staging-1.9.6/dlls/d2d1/d2d1_private.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d2d1/d2d1_private.h 2016-04-04 18:06:32.000000000 +0000 @@ -125,9 +125,9 @@ UINT32 stop_count; }; -HRESULT d2d_gradient_init(struct d2d_gradient *gradient, ID2D1Factory *factory, - const D2D1_GRADIENT_STOP *stops, UINT32 stop_count, D2D1_GAMMA gamma, - D2D1_EXTEND_MODE extend_mode) DECLSPEC_HIDDEN; +HRESULT d2d_gradient_create(ID2D1Factory *factory, const D2D1_GRADIENT_STOP *stops, + UINT32 stop_count, D2D1_GAMMA gamma, D2D1_EXTEND_MODE extend_mode, + struct d2d_gradient **gradient) DECLSPEC_HIDDEN; struct d2d_brush { @@ -156,14 +156,13 @@ } u; }; -void d2d_solid_color_brush_init(struct d2d_brush *brush, ID2D1Factory *factory, - const D2D1_COLOR_F *color, const D2D1_BRUSH_PROPERTIES *desc) DECLSPEC_HIDDEN; -void d2d_linear_gradient_brush_init(struct d2d_brush *brush, ID2D1Factory *factory, - const D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES *gradient_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc, - ID2D1GradientStopCollection *gradient) DECLSPEC_HIDDEN; -void d2d_bitmap_brush_init(struct d2d_brush *brush, ID2D1Factory *factory, - ID2D1Bitmap *bitmap, const D2D1_BITMAP_BRUSH_PROPERTIES *bitmap_brush_desc, - const D2D1_BRUSH_PROPERTIES *brush_desc) DECLSPEC_HIDDEN; +HRESULT d2d_solid_color_brush_create(ID2D1Factory *factory, const D2D1_COLOR_F *color, + const D2D1_BRUSH_PROPERTIES *desc, struct d2d_brush **brush) DECLSPEC_HIDDEN; +HRESULT d2d_linear_gradient_brush_create(ID2D1Factory *factory, const D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES *gradient_brush_desc, + const D2D1_BRUSH_PROPERTIES *brush_desc, ID2D1GradientStopCollection *gradient, + struct d2d_brush **brush) DECLSPEC_HIDDEN; +HRESULT d2d_bitmap_brush_create(ID2D1Factory *factory, ID2D1Bitmap *bitmap, const D2D1_BITMAP_BRUSH_PROPERTIES *bitmap_brush_desc, + const D2D1_BRUSH_PROPERTIES *brush_desc, struct d2d_brush **brush) DECLSPEC_HIDDEN; void d2d_brush_bind_resources(struct d2d_brush *brush, struct d2d_brush *opacity_brush, struct d2d_d3d_render_target *render_target, enum d2d_shape_type shape_type) DECLSPEC_HIDDEN; HRESULT d2d_brush_get_ps_cb(struct d2d_brush *brush, struct d2d_brush *opacity_brush, @@ -189,7 +188,7 @@ ID2D1Factory *factory; }; -void d2d_mesh_init(struct d2d_mesh *mesh, ID2D1Factory *factory) DECLSPEC_HIDDEN; +HRESULT d2d_mesh_create(ID2D1Factory *factory, struct d2d_mesh **mesh) DECLSPEC_HIDDEN; struct d2d_bitmap { @@ -204,10 +203,12 @@ float dpi_y; }; -HRESULT d2d_bitmap_init_memory(struct d2d_bitmap *bitmap, struct d2d_d3d_render_target *render_target, - D2D1_SIZE_U size, const void *src_data, UINT32 pitch, const D2D1_BITMAP_PROPERTIES *desc) DECLSPEC_HIDDEN; -HRESULT d2d_bitmap_init_shared(struct d2d_bitmap *bitmap, struct d2d_d3d_render_target *render_target, - REFIID iid, void *data, const D2D1_BITMAP_PROPERTIES *desc) DECLSPEC_HIDDEN; +HRESULT d2d_bitmap_create(ID2D1Factory *factory, ID3D10Device *device, D2D1_SIZE_U size, const void *src_data, + UINT32 pitch, const D2D1_BITMAP_PROPERTIES *desc, struct d2d_bitmap **bitmap) DECLSPEC_HIDDEN; +HRESULT d2d_bitmap_create_shared(ID2D1Factory *factory, ID3D10Device *device, REFIID iid, void *data, + const D2D1_BITMAP_PROPERTIES *desc, struct d2d_bitmap **bitmap) DECLSPEC_HIDDEN; +HRESULT d2d_bitmap_create_from_wic_bitmap(ID2D1Factory *factory, ID3D10Device *device, IWICBitmapSource *bitmap_source, + const D2D1_BITMAP_PROPERTIES *desc, struct d2d_bitmap **bitmap) DECLSPEC_HIDDEN; struct d2d_bitmap *unsafe_impl_from_ID2D1Bitmap(ID2D1Bitmap *iface) DECLSPEC_HIDDEN; struct d2d_state_block diff -Nru wine-staging-1.9.6/dlls/d2d1/mesh.c wine-staging-1.9.7~ubuntu15.04.1/dlls/d2d1/mesh.c --- wine-staging-1.9.6/dlls/d2d1/mesh.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d2d1/mesh.c 2016-04-04 18:06:32.000000000 +0000 @@ -98,9 +98,15 @@ d2d_mesh_Open, }; -void d2d_mesh_init(struct d2d_mesh *mesh, ID2D1Factory *factory) +HRESULT d2d_mesh_create(ID2D1Factory *factory, struct d2d_mesh **mesh) { - mesh->ID2D1Mesh_iface.lpVtbl = &d2d_mesh_vtbl; - mesh->refcount = 1; - ID2D1Factory_AddRef(mesh->factory = factory); + if (!(*mesh = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(**mesh)))) + return E_OUTOFMEMORY; + + (*mesh)->ID2D1Mesh_iface.lpVtbl = &d2d_mesh_vtbl; + (*mesh)->refcount = 1; + ID2D1Factory_AddRef((*mesh)->factory = factory); + + TRACE("Created mesh %p.\n", *mesh); + return S_OK; } diff -Nru wine-staging-1.9.6/dlls/d2d1/render_target.c wine-staging-1.9.7~ubuntu15.04.1/dlls/d2d1/render_target.c --- wine-staging-1.9.6/dlls/d2d1/render_target.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d2d1/render_target.c 2016-04-04 18:06:32.000000000 +0000 @@ -20,7 +20,6 @@ #include "wine/port.h" #include "d2d1_private.h" -#include "wincodec.h" WINE_DEFAULT_DEBUG_CHANNEL(d2d); @@ -309,124 +308,25 @@ TRACE("iface %p, size {%u, %u}, src_data %p, pitch %u, desc %p, bitmap %p.\n", iface, size.width, size.height, src_data, pitch, desc, bitmap); - if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) - return E_OUTOFMEMORY; + if (SUCCEEDED(hr = d2d_bitmap_create(render_target->factory, render_target->device, size, src_data, pitch, desc, &object))) + *bitmap = &object->ID2D1Bitmap_iface; - if (FAILED(hr = d2d_bitmap_init_memory(object, render_target, size, src_data, pitch, desc))) - { - WARN("Failed to initialize bitmap, hr %#x.\n", hr); - HeapFree(GetProcessHeap(), 0, object); - return hr; - } - - TRACE("Created bitmap %p.\n", object); - *bitmap = &object->ID2D1Bitmap_iface; - - return S_OK; + return hr; } static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateBitmapFromWicBitmap(ID2D1RenderTarget *iface, IWICBitmapSource *bitmap_source, const D2D1_BITMAP_PROPERTIES *desc, ID2D1Bitmap **bitmap) { - const D2D1_PIXEL_FORMAT *d2d_format; - D2D1_BITMAP_PROPERTIES bitmap_desc; - WICPixelFormatGUID wic_format; - unsigned int bpp, data_size; - D2D1_SIZE_U size; - unsigned int i; - WICRect rect; - UINT32 pitch; + struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); + struct d2d_bitmap *object; HRESULT hr; - void *data; - - static const struct - { - const WICPixelFormatGUID *wic; - D2D1_PIXEL_FORMAT d2d; - } - format_lookup[] = - { - {&GUID_WICPixelFormat32bppPBGRA, {DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED}}, - {&GUID_WICPixelFormat32bppBGR, {DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_IGNORE}}, - }; TRACE("iface %p, bitmap_source %p, desc %p, bitmap %p.\n", iface, bitmap_source, desc, bitmap); - if (FAILED(hr = IWICBitmapSource_GetSize(bitmap_source, &size.width, &size.height))) - { - WARN("Failed to get bitmap size, hr %#x.\n", hr); - return hr; - } - - if (!desc) - { - bitmap_desc.pixelFormat.format = DXGI_FORMAT_UNKNOWN; - bitmap_desc.pixelFormat.alphaMode = D2D1_ALPHA_MODE_UNKNOWN; - bitmap_desc.dpiX = 0.0f; - bitmap_desc.dpiY = 0.0f; - } - else - { - bitmap_desc = *desc; - } - - if (FAILED(hr = IWICBitmapSource_GetPixelFormat(bitmap_source, &wic_format))) - { - WARN("Failed to get bitmap format, hr %#x.\n", hr); - return hr; - } - - for (i = 0, d2d_format = NULL; i < sizeof(format_lookup) / sizeof(*format_lookup); ++i) - { - if (IsEqualGUID(&wic_format, format_lookup[i].wic)) - { - d2d_format = &format_lookup[i].d2d; - break; - } - } - - if (!d2d_format) - { - WARN("Unsupported WIC bitmap format %s.\n", debugstr_guid(&wic_format)); - return D2DERR_UNSUPPORTED_PIXEL_FORMAT; - } - - if (bitmap_desc.pixelFormat.format == DXGI_FORMAT_UNKNOWN) - bitmap_desc.pixelFormat.format = d2d_format->format; - if (bitmap_desc.pixelFormat.alphaMode == D2D1_ALPHA_MODE_UNKNOWN) - bitmap_desc.pixelFormat.alphaMode = d2d_format->alphaMode; - - switch (bitmap_desc.pixelFormat.format) - { - case DXGI_FORMAT_B8G8R8A8_UNORM: - bpp = 4; - break; - - default: - FIXME("Unhandled format %#x.\n", bitmap_desc.pixelFormat.format); - return D2DERR_UNSUPPORTED_PIXEL_FORMAT; - } - - pitch = ((bpp * size.width) + 15) & ~15; - data_size = pitch * size.height; - if (!(data = HeapAlloc(GetProcessHeap(), 0, data_size))) - return E_OUTOFMEMORY; - - rect.X = 0; - rect.Y = 0; - rect.Width = size.width; - rect.Height = size.height; - if (FAILED(hr = IWICBitmapSource_CopyPixels(bitmap_source, &rect, pitch, data_size, data))) - { - WARN("Failed to copy bitmap pixels, hr %#x.\n", hr); - HeapFree(GetProcessHeap(), 0, data); - return hr; - } - - hr = d2d_d3d_render_target_CreateBitmap(iface, size, data, pitch, &bitmap_desc, bitmap); - - HeapFree(GetProcessHeap(), 0, data); + if (SUCCEEDED(hr = d2d_bitmap_create_from_wic_bitmap(render_target->factory, render_target->device, bitmap_source, + desc, &object))) + *bitmap = &object->ID2D1Bitmap_iface; return hr; } @@ -441,20 +341,10 @@ TRACE("iface %p, iid %s, data %p, desc %p, bitmap %p.\n", iface, debugstr_guid(iid), data, desc, bitmap); - if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) - return E_OUTOFMEMORY; - - if (FAILED(hr = d2d_bitmap_init_shared(object, render_target, iid, data, desc))) - { - WARN("Failed to initialize bitmap, hr %#x.\n", hr); - HeapFree(GetProcessHeap(), 0, object); - return hr; - } - - TRACE("Created bitmap %p.\n", object); - *bitmap = &object->ID2D1Bitmap_iface; + if (SUCCEEDED(hr = d2d_bitmap_create_shared(render_target->factory, render_target->device, iid, data, desc, &object))) + *bitmap = &object->ID2D1Bitmap_iface; - return S_OK; + return hr; } static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateBitmapBrush(ID2D1RenderTarget *iface, @@ -463,19 +353,15 @@ { struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); struct d2d_brush *object; + HRESULT hr; TRACE("iface %p, bitmap %p, bitmap_brush_desc %p, brush_desc %p, brush %p.\n", iface, bitmap, bitmap_brush_desc, brush_desc, brush); - if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) - return E_OUTOFMEMORY; + if (SUCCEEDED(hr = d2d_bitmap_brush_create(render_target->factory, bitmap, bitmap_brush_desc, brush_desc, &object))) + *brush = (ID2D1BitmapBrush *)&object->ID2D1Brush_iface; - d2d_bitmap_brush_init(object, render_target->factory, bitmap, bitmap_brush_desc, brush_desc); - - TRACE("Created brush %p.\n", object); - *brush = (ID2D1BitmapBrush *)&object->ID2D1Brush_iface; - - return S_OK; + return hr; } static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateSolidColorBrush(ID2D1RenderTarget *iface, @@ -483,18 +369,14 @@ { struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); struct d2d_brush *object; + HRESULT hr; TRACE("iface %p, color %p, desc %p, brush %p.\n", iface, color, desc, brush); - if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) - return E_OUTOFMEMORY; + if (SUCCEEDED(hr = d2d_solid_color_brush_create(render_target->factory, color, desc, &object))) + *brush = (ID2D1SolidColorBrush *)&object->ID2D1Brush_iface; - d2d_solid_color_brush_init(object, render_target->factory, color, desc); - - TRACE("Created brush %p.\n", object); - *brush = (ID2D1SolidColorBrush *)&object->ID2D1Brush_iface; - - return S_OK; + return hr; } static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateGradientStopCollection(ID2D1RenderTarget *iface, @@ -508,20 +390,10 @@ TRACE("iface %p, stops %p, stop_count %u, gamma %#x, extend_mode %#x, gradient %p.\n", iface, stops, stop_count, gamma, extend_mode, gradient); - if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) - return E_OUTOFMEMORY; - - if (FAILED(hr = d2d_gradient_init(object, render_target->factory, stops, stop_count, gamma, extend_mode))) - { - WARN("Failed to initialize gradient, hr %#x.\n", hr); - HeapFree(GetProcessHeap(), 0, object); - return hr; - } + if (SUCCEEDED(hr = d2d_gradient_create(render_target->factory, stops, stop_count, gamma, extend_mode, &object))) + *gradient = &object->ID2D1GradientStopCollection_iface; - TRACE("Created gradient %p.\n", object); - *gradient = &object->ID2D1GradientStopCollection_iface; - - return S_OK; + return hr; } static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateLinearGradientBrush(ID2D1RenderTarget *iface, @@ -530,19 +402,16 @@ { struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); struct d2d_brush *object; + HRESULT hr; TRACE("iface %p, gradient_brush_desc %p, brush_desc %p, gradient %p, brush %p.\n", iface, gradient_brush_desc, brush_desc, gradient, brush); - if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) - return E_OUTOFMEMORY; - - d2d_linear_gradient_brush_init(object, render_target->factory, gradient_brush_desc, brush_desc, gradient); + if (SUCCEEDED(hr = d2d_linear_gradient_brush_create(render_target->factory, gradient_brush_desc, brush_desc, + gradient, &object))) + *brush = (ID2D1LinearGradientBrush *)&object->ID2D1Brush_iface; - TRACE("Created brush %p.\n", object); - *brush = (ID2D1LinearGradientBrush *)&object->ID2D1Brush_iface; - - return S_OK; + return hr; } static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateRadialGradientBrush(ID2D1RenderTarget *iface, @@ -577,18 +446,14 @@ { struct d2d_d3d_render_target *render_target = impl_from_ID2D1RenderTarget(iface); struct d2d_mesh *object; + HRESULT hr; TRACE("iface %p, mesh %p.\n", iface, mesh); - if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) - return E_OUTOFMEMORY; - - d2d_mesh_init(object, render_target->factory); + if (SUCCEEDED(hr = d2d_mesh_create(render_target->factory, &object))) + *mesh = &object->ID2D1Mesh_iface; - TRACE("Created mesh %p.\n", object); - *mesh = &object->ID2D1Mesh_iface; - - return S_OK; + return hr; } static void STDMETHODCALLTYPE d2d_d3d_render_target_DrawLine(ID2D1RenderTarget *iface, diff -Nru wine-staging-1.9.6/dlls/d2d1/tests/d2d1.c wine-staging-1.9.7~ubuntu15.04.1/dlls/d2d1/tests/d2d1.c --- wine-staging-1.9.6/dlls/d2d1/tests/d2d1.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d2d1/tests/d2d1.c 2016-04-04 18:06:32.000000000 +0000 @@ -2626,6 +2626,71 @@ DestroyWindow(window); } +static void test_dc_target(void) +{ + static const D2D1_PIXEL_FORMAT invalid_formats[] = + { + { DXGI_FORMAT_UNKNOWN, D2D1_ALPHA_MODE_PREMULTIPLIED }, + { DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_UNKNOWN }, + { DXGI_FORMAT_R8G8B8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED }, + }; + D2D1_RENDER_TARGET_PROPERTIES desc; + ID2D1SolidColorBrush *brush; + ID2D1DCRenderTarget *rt; + ID2D1Factory *factory; + D2D1_COLOR_F color; + D2D1_SIZE_F size; + unsigned int i; + HRESULT hr; + + hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory); + ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr); + + for (i = 0; i < sizeof(invalid_formats) / sizeof(*invalid_formats); ++i) + { + desc.type = D2D1_RENDER_TARGET_TYPE_DEFAULT; + desc.pixelFormat = invalid_formats[i]; + desc.dpiX = 96.0f; + desc.dpiY = 96.0f; + desc.usage = D2D1_RENDER_TARGET_USAGE_NONE; + desc.minLevel = D2D1_FEATURE_LEVEL_DEFAULT; + + hr = ID2D1Factory_CreateDCRenderTarget(factory, &desc, &rt); + todo_wine + ok(hr == D2DERR_UNSUPPORTED_PIXEL_FORMAT, "Got unexpected hr %#x.\n", hr); + } + + desc.type = D2D1_RENDER_TARGET_TYPE_DEFAULT; + desc.pixelFormat.format = DXGI_FORMAT_B8G8R8A8_UNORM; + desc.pixelFormat.alphaMode = D2D1_ALPHA_MODE_PREMULTIPLIED; + desc.dpiX = 96.0f; + desc.dpiY = 96.0f; + desc.usage = D2D1_RENDER_TARGET_USAGE_NONE; + desc.minLevel = D2D1_FEATURE_LEVEL_DEFAULT; + hr = ID2D1Factory_CreateDCRenderTarget(factory, &desc, &rt); +todo_wine + ok(SUCCEEDED(hr), "Failed to create target, hr %#x.\n", hr); +if (SUCCEEDED(hr)) +{ + size = ID2D1DCRenderTarget_GetSize(rt); + ok(size.width == 0.0f, "got width %.08e.\n", size.width); + ok(size.height == 0.0f, "got height %.08e.\n", size.height); + + /* object creation methods work without BindDC() */ + set_color(&color, 0.0f, 0.0f, 0.0f, 0.0f); + hr = ID2D1DCRenderTarget_CreateSolidColorBrush(rt, &color, NULL, &brush); + ok(SUCCEEDED(hr), "Failed to create a brush, hr %#x.\n", hr); + ID2D1SolidColorBrush_Release(brush); + + ID2D1DCRenderTarget_BeginDraw(rt); + hr = ID2D1DCRenderTarget_EndDraw(rt, NULL, NULL); + ok(hr == D2DERR_WRONG_STATE, "Got unexpected hr %#x.\n", hr); + + ID2D1DCRenderTarget_Release(rt); +} + ID2D1Factory_Release(factory); +} + START_TEST(d2d1) { test_clip(); @@ -2640,4 +2705,5 @@ test_opacity_brush(); test_create_target(); test_draw_text_layout(); + test_dc_target(); } diff -Nru wine-staging-1.9.6/dlls/d3d10/d3d10_main.c wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d10/d3d10_main.c --- wine-staging-1.9.6/dlls/d3d10/d3d10_main.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d10/d3d10_main.c 2016-04-04 18:06:32.000000000 +0000 @@ -252,6 +252,14 @@ return E_NOTIMPL; } +HRESULT WINAPI D3D10CreateEffectPoolFromMemory(void *data, SIZE_T data_size, UINT fx_flags, + ID3D10Device *device, ID3D10EffectPool **effect_pool) +{ + FIXME("data %p, data_size %lu, fx_flags %#x, device %p, effect_pool %p stub.\n", + data, data_size, fx_flags, device, effect_pool); + + return E_NOTIMPL; +} const char * WINAPI D3D10GetVertexShaderProfile(ID3D10Device *device) { diff -Nru wine-staging-1.9.6/dlls/d3d10/d3d10.spec wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d10/d3d10.spec --- wine-staging-1.9.6/dlls/d3d10/d3d10.spec 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d10/d3d10.spec 2016-04-04 18:06:32.000000000 +0000 @@ -4,7 +4,7 @@ @ stdcall D3D10CreateDevice(ptr long ptr long long ptr) @ stdcall D3D10CreateDeviceAndSwapChain(ptr long ptr long long ptr ptr ptr) @ stdcall D3D10CreateEffectFromMemory(ptr long long ptr ptr ptr) -@ stub D3D10CreateEffectPoolFromMemory +@ stdcall D3D10CreateEffectPoolFromMemory(ptr long long ptr ptr) @ stdcall D3D10CreateStateBlock(ptr ptr ptr) @ stub D3D10DisassembleEffect @ stdcall D3D10DisassembleShader(ptr long long ptr ptr) diff -Nru wine-staging-1.9.6/dlls/d3d10_1/d3d10_1.spec wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d10_1/d3d10_1.spec --- wine-staging-1.9.6/dlls/d3d10_1/d3d10_1.spec 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d10_1/d3d10_1.spec 2016-04-04 18:06:32.000000000 +0000 @@ -5,7 +5,7 @@ @ stdcall D3D10CreateDevice1(ptr long ptr long long long ptr) @ stdcall D3D10CreateDeviceAndSwapChain1(ptr long ptr long long long ptr ptr ptr) @ stdcall D3D10CreateEffectFromMemory(ptr long long ptr ptr ptr) d3d10.D3D10CreateEffectFromMemory -@ stub D3D10CreateEffectPoolFromMemory +@ stdcall D3D10CreateEffectPoolFromMemory(ptr long long ptr ptr) d3d10.D3D10CreateEffectPoolFromMemory @ stdcall D3D10CreateStateBlock(ptr ptr ptr) d3d10.D3D10CreateStateBlock @ stub D3D10DisassembleEffect @ stub D3D10DisassembleShader diff -Nru wine-staging-1.9.6/dlls/d3d10core/tests/device.c wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d10core/tests/device.c --- wine-staging-1.9.6/dlls/d3d10core/tests/device.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d10core/tests/device.c 2016-04-04 18:06:32.000000000 +0000 @@ -228,6 +228,27 @@ return NULL; } +static BOOL is_warp_device(ID3D10Device *device) +{ + DXGI_ADAPTER_DESC adapter_desc; + IDXGIDevice *dxgi_device; + IDXGIAdapter *adapter; + HRESULT hr; + + hr = ID3D10Device_QueryInterface(device, &IID_IDXGIDevice, (void **)&dxgi_device); + ok(SUCCEEDED(hr), "Failed to query IDXGIDevice interface, hr %#x.\n", hr); + hr = IDXGIDevice_GetAdapter(dxgi_device, &adapter); + ok(SUCCEEDED(hr), "Failed to get adapter, hr %#x.\n", hr); + IDXGIDevice_Release(dxgi_device); + hr = IDXGIAdapter_GetDesc(adapter, &adapter_desc); + ok(SUCCEEDED(hr), "Failed to get adapter desc, hr %#x.\n", hr); + IDXGIAdapter_Release(adapter); + + return !adapter_desc.SubSysId && !adapter_desc.Revision + && ((!adapter_desc.VendorId && !adapter_desc.DeviceId) + || (adapter_desc.VendorId == 0x1414 && adapter_desc.DeviceId == 0x008c)); +} + #define SWAPCHAIN_FLAG_SHADER_INPUT 0x1 struct swapchain_desc @@ -2348,24 +2369,19 @@ static const float red[] = {1.0f, 0.0f, 0.0f, 1.0f}; static const DWORD ps_code[] = { - /* float4 main(float4 position : SV_POSITION) : SV_Target - * { - * return float4(0.0, 1.0, 0.0, 1.0); - * } */ - 0x43425844, 0xe70802a0, 0xee334047, 0x7bfd0c79, 0xaeff7804, 0x00000001, 0x000001b0, 0x00000005, - 0x00000034, 0x0000008c, 0x000000c0, 0x000000f4, 0x00000134, 0x46454452, 0x00000050, 0x00000000, - 0x00000000, 0x00000000, 0x0000001c, 0xffff0400, 0x00000100, 0x0000001c, 0x7263694d, 0x666f736f, - 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x39207265, 0x2e30332e, - 0x30303239, 0x3336312e, 0xab003438, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, +#if 0 + float4 main(float4 position : SV_POSITION) : SV_Target + { + return float4(0.0, 1.0, 0.0, 1.0); + } +#endif + 0x43425844, 0x30240e72, 0x012f250c, 0x8673c6ea, 0x392e4cec, 0x00000001, 0x000000d4, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x505f5653, 0x5449534f, 0x004e4f49, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000038, 0x00000040, 0x0000000e, 0x03000065, 0x001020f2, 0x00000000, 0x08000036, 0x001020f2, 0x00000000, 0x00004002, - 0x00000000, 0x3f800000, 0x00000000, 0x3f800000, 0x0100003e, 0x54415453, 0x00000074, 0x00000002, - 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x3f800000, 0x00000000, 0x3f800000, 0x0100003e, }; if (!init_test_context(&test_context)) @@ -3774,6 +3790,13 @@ 0xffb1c4de, 0xfff0f1f2, 0xfffafdfe, 0xff5a560f, 0xffd5ff00, 0xffc8f99f, 0xffaa00aa, 0xffdd55bb, }; + static const BYTE a8_data[] = + { + 0x00, 0x10, 0x20, 0x30, + 0x40, 0x50, 0x60, 0x70, + 0x80, 0x90, 0xa0, 0xb0, + 0xc0, 0xd0, 0xe0, 0xf0, + }; static const BYTE bc1_data[] = { 0x00, 0xf8, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, @@ -3820,6 +3843,8 @@ }; static const struct texture srgb_texture = {4, 4, 1, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, {{srgb_data, 4 * sizeof(*srgb_data)}}}; + static const struct texture a8_texture = {4, 4, 1, DXGI_FORMAT_A8_UNORM, + {{a8_data, 4 * sizeof(*a8_data)}}}; 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}}}; @@ -3860,6 +3885,13 @@ 0xff708cba, 0xffdee0e2, 0xfff3fbfd, 0xff1a1801, 0xffa9ff00, 0xff93f159, 0xff670067, 0xffb8177f, }; + static const DWORD a8_colors[] = + { + 0x00000000, 0x10000000, 0x20000000, 0x30000000, + 0x40000000, 0x50000000, 0x60000000, 0x70000000, + 0x80000000, 0x90000000, 0xa0000000, 0xb0000000, + 0xc0000000, 0xd0000000, 0xe0000000, 0xf0000000, + }; static const DWORD bc_colors[] = { 0xff0000ff, 0xff0000ff, 0xff00ff00, 0xff00ff00, @@ -3932,6 +3964,7 @@ {&ps_sample, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 2.0f, 0.0f, D3D10_FLOAT32_MAX, 0.0f, rgba_level_0}, {&ps_sample, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 8.0f, 0.0f, D3D10_FLOAT32_MAX, 0.0f, level_1_colors}, {&ps_sample, &srgb_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, srgb_colors}, + {&ps_sample, &a8_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, a8_colors}, {&ps_sample_b, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D10_FLOAT32_MAX, 0.0f, rgba_level_0}, {&ps_sample_b, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 8.0f, 0.0f, D3D10_FLOAT32_MAX, 0.0f, level_1_colors}, {&ps_sample_b, &rgba_texture, D3D10_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, D3D10_FLOAT32_MAX, 8.0f, level_1_colors}, @@ -4085,9 +4118,9 @@ draw_quad(&test_context); get_texture_readback(test_context.backbuffer, &rb); - for (x = 0; x < 4; ++x) + for (y = 0; y < 4; ++y) { - for (y = 0; y < 4; ++y) + for (x = 0; x < 4; ++x) { color = get_readback_color(&rb, 80 + x * 160, 60 + y * 120); ok(compare_color(color, test->expected_colors[y * 4 + x], 1), @@ -4990,11 +5023,14 @@ { struct d3d10core_test_context test_context; ID3D10Texture2D *dst_texture, *src_texture; + ID3D10Buffer *dst_buffer, *src_buffer; D3D10_SUBRESOURCE_DATA resource_data; D3D10_TEXTURE2D_DESC texture_desc; ID3D10SamplerState *sampler_state; ID3D10ShaderResourceView *ps_srv; D3D10_SAMPLER_DESC sampler_desc; + D3D10_BUFFER_DESC buffer_desc; + struct vec4 float_colors[16]; struct texture_readback rb; ID3D10PixelShader *ps; ID3D10Device *device; @@ -5029,6 +5065,31 @@ 0x3b088889, 0x00000000, 0x00000000, 0x09000045, 0x001020f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0100003e, }; + static const DWORD ps_buffer_code[] = + { +#if 0 + float4 buffer[16]; + + float4 main(float4 position : SV_POSITION) : SV_TARGET + { + float2 p = (float2)4; + p *= float2(position.x / 640.0f, position.y / 480.0f); + return buffer[(int)p.y * 4 + (int)p.x]; + } +#endif + 0x43425844, 0x57e7139f, 0x4f0c9e52, 0x598b77e3, 0x5a239132, 0x00000001, 0x0000016c, 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, 0x000000d0, 0x00000040, + 0x00000034, 0x04000859, 0x00208e46, 0x00000000, 0x00000010, 0x04002064, 0x00101032, 0x00000000, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000001, 0x0a000038, 0x00100032, + 0x00000000, 0x00101516, 0x00000000, 0x00004002, 0x3c088889, 0x3bcccccd, 0x00000000, 0x00000000, + 0x0500001b, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x07000029, 0x00100012, 0x00000000, + 0x0010000a, 0x00000000, 0x00004001, 0x00000002, 0x0700001e, 0x00100012, 0x00000000, 0x0010000a, + 0x00000000, 0x0010001a, 0x00000000, 0x07000036, 0x001020f2, 0x00000000, 0x04208e46, 0x00000000, + 0x0010000a, 0x00000000, 0x0100003e, + }; static const float red[] = {1.0f, 0.0f, 0.0f, 0.5f}; static const DWORD bitmap_data[] = { @@ -5152,10 +5213,90 @@ release_texture_readback(&rb); ID3D10PixelShader_Release(ps); - ID3D10SamplerState_Release(sampler_state); + hr = ID3D10Device_CreatePixelShader(device, ps_buffer_code, sizeof(ps_buffer_code), &ps); + ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x.\n", hr); + ID3D10ShaderResourceView_Release(ps_srv); + ps_srv = NULL; + + ID3D10SamplerState_Release(sampler_state); + sampler_state = NULL; + ID3D10Texture2D_Release(dst_texture); ID3D10Texture2D_Release(src_texture); + + ID3D10Device_PSSetShaderResources(device, 0, 1, &ps_srv); + ID3D10Device_PSSetSamplers(device, 0, 1, &sampler_state); + ID3D10Device_PSSetShader(device, ps); + + buffer_desc.ByteWidth = sizeof(float_colors); + buffer_desc.Usage = D3D10_USAGE_DEFAULT; + buffer_desc.BindFlags = D3D10_BIND_CONSTANT_BUFFER; + buffer_desc.CPUAccessFlags = 0; + buffer_desc.MiscFlags = 0; + + hr = ID3D10Device_CreateBuffer(device, &buffer_desc, NULL, &dst_buffer); + ok(SUCCEEDED(hr), "Failed to create buffer, hr %#x.\n", hr); + + ID3D10Device_PSSetConstantBuffers(device, 0, 1, &dst_buffer); + + buffer_desc.ByteWidth = 256 * sizeof(*float_colors); + buffer_desc.BindFlags = 0; + + hr = ID3D10Device_CreateBuffer(device, &buffer_desc, NULL, &src_buffer); + ok(SUCCEEDED(hr), "Failed to create buffer, hr %#x.\n", hr); + + for (i = 0; i < 4; ++i) + { + for (j = 0; j < 4; ++j) + { + float_colors[j + i * 4].x = ((bitmap_data[j + i * 4] >> 0) & 0xff) / 255.0f; + float_colors[j + i * 4].y = ((bitmap_data[j + i * 4] >> 8) & 0xff) / 255.0f; + float_colors[j + i * 4].z = ((bitmap_data[j + i * 4] >> 16) & 0xff) / 255.0f; + float_colors[j + i * 4].w = ((bitmap_data[j + i * 4] >> 24) & 0xff) / 255.0f; + } + } + set_box(&box, 0, 0, 0, sizeof(float_colors), 1, 1); + ID3D10Device_UpdateSubresource(device, (ID3D10Resource *)src_buffer, 0, &box, float_colors, 0, 0); + + set_box(&box, 0, 0, 0, sizeof(float_colors), 0, 1); + ID3D10Device_CopySubresourceRegion(device, (ID3D10Resource *)dst_buffer, 0, + 0, 0, 0, (ID3D10Resource *)src_buffer, 0, &box); + draw_quad(&test_context); + check_texture_color(test_context.backbuffer, 0x00000000, 0); + + set_box(&box, 0, 0, 0, sizeof(float_colors), 1, 0); + ID3D10Device_CopySubresourceRegion(device, (ID3D10Resource *)dst_buffer, 0, + 0, 0, 0, (ID3D10Resource *)src_buffer, 0, &box); + draw_quad(&test_context); + check_texture_color(test_context.backbuffer, 0x00000000, 0); + + set_box(&box, 0, 0, 0, sizeof(float_colors), 0, 0); + ID3D10Device_CopySubresourceRegion(device, (ID3D10Resource *)dst_buffer, 0, + 0, 0, 0, (ID3D10Resource *)src_buffer, 0, &box); + draw_quad(&test_context); + check_texture_color(test_context.backbuffer, 0x00000000, 0); + + set_box(&box, 0, 0, 0, sizeof(float_colors), 1, 1); + ID3D10Device_CopySubresourceRegion(device, (ID3D10Resource *)dst_buffer, 0, + 0, 0, 0, (ID3D10Resource *)src_buffer, 0, &box); + draw_quad(&test_context); + get_texture_readback(test_context.backbuffer, &rb); + for (i = 0; i < 4; ++i) + { + for (j = 0; j < 4; ++j) + { + color = get_readback_color(&rb, 80 + j * 160, 60 + i * 120); + ok(compare_color(color, bitmap_data[j + i * 4], 1), + "Got unexpected color 0x%08x at (%u, %u), expected 0x%08x.\n", + color, j, i, bitmap_data[j + i * 4]); + } + } + release_texture_readback(&rb); + + ID3D10Buffer_Release(dst_buffer); + ID3D10Buffer_Release(src_buffer); + ID3D10PixelShader_Release(ps); release_test_context(&test_context); } @@ -5755,6 +5896,97 @@ DestroyWindow(window); } +static void test_clear_render_target_view(void) +{ + static const DWORD expected_color = 0xbf4c7f19, expected_srgb_color = 0xbf95bc59; + static const float color[] = {0.1f, 0.5f, 0.3f, 0.75f}; + + struct d3d10core_test_context test_context; + ID3D10Texture2D *texture, *srgb_texture; + ID3D10RenderTargetView *rtv, *srgb_rtv; + D3D10_RENDER_TARGET_VIEW_DESC rtv_desc; + D3D10_TEXTURE2D_DESC texture_desc; + ID3D10Device *device; + HRESULT hr; + + if (!init_test_context(&test_context)) + return; + + device = test_context.device; + + texture_desc.Width = 640; + texture_desc.Height = 480; + texture_desc.MipLevels = 1; + texture_desc.ArraySize = 1; + texture_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + texture_desc.SampleDesc.Count = 1; + texture_desc.SampleDesc.Quality = 0; + texture_desc.Usage = D3D10_USAGE_DEFAULT; + texture_desc.BindFlags = D3D10_BIND_RENDER_TARGET; + texture_desc.CPUAccessFlags = 0; + texture_desc.MiscFlags = 0; + hr = ID3D10Device_CreateTexture2D(device, &texture_desc, NULL, &texture); + ok(SUCCEEDED(hr), "Failed to create depth texture, hr %#x.\n", hr); + + texture_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM_SRGB; + hr = ID3D10Device_CreateTexture2D(device, &texture_desc, NULL, &srgb_texture); + ok(SUCCEEDED(hr), "Failed to create depth texture, hr %#x.\n", hr); + + hr = ID3D10Device_CreateRenderTargetView(device, (ID3D10Resource *)texture, NULL, &rtv); + ok(SUCCEEDED(hr), "Failed to create render target view, hr %#x.\n", hr); + + hr = ID3D10Device_CreateRenderTargetView(device, (ID3D10Resource *)srgb_texture, NULL, &srgb_rtv); + ok(SUCCEEDED(hr), "Failed to create render target view, hr %#x.\n", hr); + + ID3D10Device_ClearRenderTargetView(device, test_context.backbuffer_rtv, color); + check_texture_color(test_context.backbuffer, expected_color, 1); + + ID3D10Device_ClearRenderTargetView(device, rtv, color); + check_texture_color(texture, expected_color, 1); + + ID3D10Device_ClearRenderTargetView(device, srgb_rtv, color); + check_texture_color(srgb_texture, expected_srgb_color, 1); + + ID3D10RenderTargetView_Release(srgb_rtv); + ID3D10RenderTargetView_Release(rtv); + ID3D10Texture2D_Release(srgb_texture); + ID3D10Texture2D_Release(texture); + + texture_desc.Format = DXGI_FORMAT_R8G8B8A8_TYPELESS; + hr = ID3D10Device_CreateTexture2D(device, &texture_desc, NULL, &texture); + ok(SUCCEEDED(hr), "Failed to create depth texture, hr %#x.\n", hr); + + rtv_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM_SRGB; + rtv_desc.ViewDimension = D3D10_RTV_DIMENSION_TEXTURE2D; + U(rtv_desc).Texture2D.MipSlice = 0; + hr = ID3D10Device_CreateRenderTargetView(device, (ID3D10Resource *)texture, &rtv_desc, &srgb_rtv); + ok(SUCCEEDED(hr), "Failed to create render target view, hr %#x.\n", hr); + + rtv_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + rtv_desc.ViewDimension = D3D10_RTV_DIMENSION_TEXTURE2D; + U(rtv_desc).Texture2D.MipSlice = 0; + hr = ID3D10Device_CreateRenderTargetView(device, (ID3D10Resource *)texture, &rtv_desc, &rtv); + ok(SUCCEEDED(hr), "Failed to create render target view, hr %#x.\n", hr); + + ID3D10Device_ClearRenderTargetView(device, rtv, color); + check_texture_color(texture, expected_color, 1); + + if (!is_warp_device(device)) + { + ID3D10Device_ClearRenderTargetView(device, srgb_rtv, color); + todo_wine check_texture_color(texture, expected_srgb_color, 1); + } + else + { + win_skip("sRGB clears are broken on WARP.\n"); + } + + ID3D10RenderTargetView_Release(srgb_rtv); + ID3D10RenderTargetView_Release(rtv); + ID3D10Texture2D_Release(texture); + release_test_context(&test_context); +} + static void test_clear_depth_stencil_view(void) { D3D10_TEXTURE2D_DESC texture_desc; @@ -5828,6 +6060,177 @@ ok(!refcount, "Device has %u references left.\n", refcount); } +static void test_draw_depth_only(void) +{ + ID3D10DepthStencilState *depth_stencil_state; + D3D10_DEPTH_STENCIL_DESC depth_stencil_desc; + struct d3d10core_test_context test_context; + ID3D10PixelShader *ps_color, *ps_depth; + D3D10_TEXTURE2D_DESC texture_desc; + D3D10_BUFFER_DESC buffer_desc; + ID3D10DepthStencilView *dsv; + struct texture_readback rb; + ID3D10Texture2D *texture; + ID3D10Device *device; + unsigned int i, j; + D3D10_VIEWPORT vp; + struct vec4 depth; + ID3D10Buffer *cb; + HRESULT hr; + + static const DWORD ps_color_code[] = + { +#if 0 + float4 main(float4 position : SV_POSITION) : SV_Target + { + return float4(0.0, 1.0, 0.0, 1.0); + } +#endif + 0x43425844, 0x30240e72, 0x012f250c, 0x8673c6ea, 0x392e4cec, 0x00000001, 0x000000d4, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x505f5653, 0x5449534f, 0x004e4f49, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000038, 0x00000040, + 0x0000000e, 0x03000065, 0x001020f2, 0x00000000, 0x08000036, 0x001020f2, 0x00000000, 0x00004002, + 0x00000000, 0x3f800000, 0x00000000, 0x3f800000, 0x0100003e, + }; + static const DWORD ps_depth_code[] = + { +#if 0 + float depth; + + float main() : SV_Depth + { + return depth; + } +#endif + 0x43425844, 0x91af6cd0, 0x7e884502, 0xcede4f54, 0x6f2c9326, 0x00000001, 0x000000b0, 0x00000003, + 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, + 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0xffffffff, + 0x00000e01, 0x445f5653, 0x68747065, 0xababab00, 0x52444853, 0x00000038, 0x00000040, 0x0000000e, + 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x02000065, 0x0000c001, 0x05000036, 0x0000c001, + 0x0020800a, 0x00000000, 0x00000000, 0x0100003e, + }; + + if (!init_test_context(&test_context)) + return; + + device = test_context.device; + + buffer_desc.ByteWidth = sizeof(depth); + buffer_desc.Usage = D3D10_USAGE_DEFAULT; + buffer_desc.BindFlags = D3D10_BIND_CONSTANT_BUFFER; + buffer_desc.CPUAccessFlags = 0; + buffer_desc.MiscFlags = 0; + + hr = ID3D10Device_CreateBuffer(device, &buffer_desc, NULL, &cb); + ok(SUCCEEDED(hr), "Failed to create constant buffer, hr %#x.\n", hr); + + texture_desc.Width = 640; + texture_desc.Height = 480; + texture_desc.MipLevels = 1; + texture_desc.ArraySize = 1; + texture_desc.Format = DXGI_FORMAT_D32_FLOAT; + texture_desc.SampleDesc.Count = 1; + texture_desc.SampleDesc.Quality = 0; + texture_desc.Usage = D3D10_USAGE_DEFAULT; + texture_desc.BindFlags = D3D10_BIND_DEPTH_STENCIL; + texture_desc.CPUAccessFlags = 0; + texture_desc.MiscFlags = 0; + + hr = ID3D10Device_CreateTexture2D(device, &texture_desc, NULL, &texture); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + + hr = ID3D10Device_CreateDepthStencilView(device, (ID3D10Resource *)texture, NULL, &dsv); + ok(SUCCEEDED(hr), "Failed to create depth stencil view, hr %#x.\n", hr); + + depth_stencil_desc.DepthEnable = TRUE; + depth_stencil_desc.DepthWriteMask = D3D10_DEPTH_WRITE_MASK_ALL; + depth_stencil_desc.DepthFunc = D3D10_COMPARISON_LESS; + depth_stencil_desc.StencilEnable = FALSE; + + hr = ID3D10Device_CreateDepthStencilState(device, &depth_stencil_desc, &depth_stencil_state); + ok(SUCCEEDED(hr), "Failed to create depth stencil state, hr %#x.\n", hr); + + hr = ID3D10Device_CreatePixelShader(device, ps_color_code, sizeof(ps_color_code), &ps_color); + ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x.\n", hr); + hr = ID3D10Device_CreatePixelShader(device, ps_depth_code, sizeof(ps_depth_code), &ps_depth); + ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x.\n", hr); + + ID3D10Device_PSSetConstantBuffers(device, 0, 1, &cb); + ID3D10Device_PSSetShader(device, ps_color); + ID3D10Device_OMSetRenderTargets(device, 0, NULL, dsv); + ID3D10Device_OMSetDepthStencilState(device, depth_stencil_state, 0); + + ID3D10Device_ClearDepthStencilView(device, dsv, D3D10_CLEAR_DEPTH, 1.0f, 0); + check_texture_float(texture, 1.0f, 1); + draw_quad(&test_context); + check_texture_float(texture, 0.0f, 1); + + ID3D10Device_PSSetShader(device, ps_depth); + + depth.x = 0.7f; + ID3D10Device_UpdateSubresource(device, (ID3D10Resource *)cb, 0, NULL, &depth, 0, 0); + draw_quad(&test_context); + check_texture_float(texture, 0.0f, 1); + ID3D10Device_ClearDepthStencilView(device, dsv, D3D10_CLEAR_DEPTH, 1.0f, 0); + check_texture_float(texture, 1.0f, 1); + draw_quad(&test_context); + check_texture_float(texture, 0.7f, 1); + depth.x = 0.8f; + ID3D10Device_UpdateSubresource(device, (ID3D10Resource *)cb, 0, NULL, &depth, 0, 0); + draw_quad(&test_context); + check_texture_float(texture, 0.7f, 1); + depth.x = 0.5f; + ID3D10Device_UpdateSubresource(device, (ID3D10Resource *)cb, 0, NULL, &depth, 0, 0); + draw_quad(&test_context); + check_texture_float(texture, 0.5f, 1); + + ID3D10Device_ClearDepthStencilView(device, dsv, D3D10_CLEAR_DEPTH, 1.0f, 0); + depth.x = 0.1f; + for (i = 0; i < 4; ++i) + { + for (j = 0; j < 4; ++j) + { + depth.x = 1.0f / 16.0f * (j + 4 * i); + ID3D10Device_UpdateSubresource(device, (ID3D10Resource *)cb, 0, NULL, &depth, 0, 0); + + vp.TopLeftX = 160 * j; + vp.TopLeftY = 120 * i; + vp.Width = 160; + vp.Height = 120; + vp.MinDepth = 0.0f; + vp.MaxDepth = 1.0f; + ID3D10Device_RSSetViewports(device, 1, &vp); + + draw_quad(&test_context); + } + } + get_texture_readback(texture, &rb); + for (i = 0; i < 4; ++i) + { + for (j = 0; j < 4; ++j) + { + float obtained_depth, expected_depth; + + obtained_depth = get_readback_float(&rb, 80 + j * 160, 60 + i * 120); + expected_depth = 1.0f / 16.0f * (j + 4 * i); + ok(compare_float(obtained_depth, expected_depth, 1), + "Got unexpected depth %.8e at (%u, %u), expected %.8e.\n", + obtained_depth, j, i, expected_depth); + } + } + release_texture_readback(&rb); + + ID3D10Buffer_Release(cb); + ID3D10PixelShader_Release(ps_color); + ID3D10PixelShader_Release(ps_depth); + ID3D10DepthStencilView_Release(dsv); + ID3D10DepthStencilState_Release(depth_stencil_state); + ID3D10Texture2D_Release(texture); + release_test_context(&test_context); +} + START_TEST(device) { test_feature_level(); @@ -5861,5 +6264,7 @@ test_check_multisample_quality_levels(); test_cb_relative_addressing(); test_swapchain_flip(); + test_clear_render_target_view(); test_clear_depth_stencil_view(); + test_draw_depth_only(); } diff -Nru wine-staging-1.9.6/dlls/d3d11/d3d11_main.c wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d11/d3d11_main.c --- wine-staging-1.9.6/dlls/d3d11/d3d11_main.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d11/d3d11_main.c 2016-04-04 18:06:32.000000000 +0000 @@ -106,7 +106,7 @@ { struct d3d_device *d3d_device = device; - TRACE("id %#x, device %p, feature_level %u.\n", id, device, feature_level); + TRACE("id %#x, device %p, feature_level %#x.\n", id, device, feature_level); if (id != DXGI_DEVICE_LAYER_D3D10_DEVICE) { diff -Nru wine-staging-1.9.6/dlls/d3d11/d3d11_private.h wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d11/d3d11_private.h --- wine-staging-1.9.6/dlls/d3d11/d3d11_private.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d11/d3d11_private.h 2016-04-04 18:06:32.000000000 +0000 @@ -250,6 +250,34 @@ struct d3d_vertex_shader *unsafe_impl_from_ID3D11VertexShader(ID3D11VertexShader *iface) DECLSPEC_HIDDEN; struct d3d_vertex_shader *unsafe_impl_from_ID3D10VertexShader(ID3D10VertexShader *iface) DECLSPEC_HIDDEN; +/* ID3D11HullShader */ +struct d3d11_hull_shader +{ + ID3D11HullShader ID3D11HullShader_iface; + LONG refcount; + + struct wined3d_private_store private_store; + struct wined3d_shader *wined3d_shader; + ID3D11Device *device; +}; + +HRESULT d3d11_hull_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, + struct d3d11_hull_shader **shader) DECLSPEC_HIDDEN; + +/* ID3D11DomainShader */ +struct d3d11_domain_shader +{ + ID3D11DomainShader ID3D11DomainShader_iface; + LONG refcount; + + struct wined3d_private_store private_store; + struct wined3d_shader *wined3d_shader; + ID3D11Device *device; +}; + +HRESULT d3d11_domain_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, + struct d3d11_domain_shader **shader) DECLSPEC_HIDDEN; + /* ID3D11GeometryShader, ID3D10GeometryShader */ struct d3d_geometry_shader { @@ -385,6 +413,8 @@ { ID3D11DeviceContext ID3D11DeviceContext_iface; LONG refcount; + + struct wined3d_private_store private_store; }; /* ID3D11Device, ID3D10Device1 */ diff -Nru wine-staging-1.9.6/dlls/d3d11/device.c wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d11/device.c --- wine-staging-1.9.6/dlls/d3d11/device.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d11/device.c 2016-04-04 18:06:32.000000000 +0000 @@ -109,25 +109,31 @@ static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_GetPrivateData(ID3D11DeviceContext *iface, REFGUID guid, UINT *data_size, void *data) { - FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext(iface); - return E_NOTIMPL; + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_get_private_data(&context->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_SetPrivateData(ID3D11DeviceContext *iface, REFGUID guid, UINT data_size, const void *data) { - FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext(iface); - return E_NOTIMPL; + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_set_private_data(&context->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_SetPrivateDataInterface(ID3D11DeviceContext *iface, REFGUID guid, const IUnknown *data) { - FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext(iface); - return E_NOTIMPL; + TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); + + return d3d_set_private_data_interface(&context->private_store, guid, data); } static void STDMETHODCALLTYPE d3d11_immediate_context_VSSetConstantBuffers(ID3D11DeviceContext *iface, @@ -1919,14 +1925,19 @@ d3d11_immediate_context_FinishCommandList, }; -static HRESULT d3d11_immediate_context_init(struct d3d11_immediate_context *context, struct d3d_device *device) +static void d3d11_immediate_context_init(struct d3d11_immediate_context *context, struct d3d_device *device) { context->ID3D11DeviceContext_iface.lpVtbl = &d3d11_immediate_context_vtbl; context->refcount = 1; ID3D11Device_AddRef(&device->ID3D11Device_iface); - return S_OK; + wined3d_private_store_init(&context->private_store); +} + +static void d3d11_immediate_context_destroy(struct d3d11_immediate_context *context) +{ + wined3d_private_store_cleanup(&context->private_store); } /* ID3D11Device methods */ @@ -2167,19 +2178,43 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateHullShader(ID3D11Device *iface, const void *byte_code, SIZE_T byte_code_length, ID3D11ClassLinkage *class_linkage, ID3D11HullShader **shader) { - FIXME("iface %p, byte_code %p, byte_code_length %lu, class_linkage %p, shader %p stub!\n", + struct d3d_device *device = impl_from_ID3D11Device(iface); + struct d3d11_hull_shader *object; + HRESULT hr; + + TRACE("iface %p, byte_code %p, byte_code_length %lu, class_linkage %p, shader %p.\n", iface, byte_code, byte_code_length, class_linkage, shader); - return E_NOTIMPL; + if (class_linkage) + FIXME("Class linkage is not implemented yet.\n"); + + if (FAILED(hr = d3d11_hull_shader_create(device, byte_code, byte_code_length, &object))) + return hr; + + *shader = &object->ID3D11HullShader_iface; + + return S_OK; } static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDomainShader(ID3D11Device *iface, const void *byte_code, SIZE_T byte_code_length, ID3D11ClassLinkage *class_linkage, ID3D11DomainShader **shader) { - FIXME("iface %p, byte_code %p, byte_code_length %lu, class_linkage %p, shader %p stub!\n", + struct d3d_device *device = impl_from_ID3D11Device(iface); + struct d3d11_domain_shader *object; + HRESULT hr; + + TRACE("iface %p, byte_code %p, byte_code_length %lu, class_linkage %p, shader %p.\n", iface, byte_code, byte_code_length, class_linkage, shader); - return E_NOTIMPL; + if (class_linkage) + FIXME("Class linkage is not implemented yet.\n"); + + if (FAILED(hr = d3d11_domain_shader_create(device, byte_code, byte_code_length, &object))) + return hr; + + *shader = &object->ID3D11DomainShader_iface; + + return S_OK; } static HRESULT STDMETHODCALLTYPE d3d11_device_CreateComputeShader(ID3D11Device *iface, const void *byte_code, @@ -2777,6 +2812,7 @@ if (!refcount) { + d3d11_immediate_context_destroy(&device->immediate_context); if (device->wined3d_device) { wined3d_mutex_lock(); @@ -5110,11 +5146,7 @@ /* COM aggregation always takes place */ device->outer_unk = outer_unknown; - if (FAILED(d3d11_immediate_context_init(&device->immediate_context, device))) - { - WARN("Failed to initialize immediate device context.\n"); - return E_FAIL; - } + d3d11_immediate_context_init(&device->immediate_context, device); ID3D11DeviceContext_Release(&device->immediate_context.ID3D11DeviceContext_iface); if (wine_rb_init(&device->blend_states, &d3d_blend_state_rb_ops) == -1) diff -Nru wine-staging-1.9.6/dlls/d3d11/shader.c wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d11/shader.c --- wine-staging-1.9.6/dlls/d3d11/shader.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d11/shader.c 2016-04-04 18:06:32.000000000 +0000 @@ -471,6 +471,398 @@ return impl_from_ID3D10VertexShader(iface); } +/* ID3D11HullShader methods */ + +static inline struct d3d11_hull_shader *impl_from_ID3D11HullShader(ID3D11HullShader *iface) +{ + return CONTAINING_RECORD(iface, struct d3d11_hull_shader, ID3D11HullShader_iface); +} + +static HRESULT STDMETHODCALLTYPE d3d11_hull_shader_QueryInterface(ID3D11HullShader *iface, + REFIID riid, void **object) +{ + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + + if (IsEqualGUID(riid, &IID_ID3D11HullShader) + || IsEqualGUID(riid, &IID_ID3D11DeviceChild) + || IsEqualGUID(riid, &IID_IUnknown)) + { + ID3D11HullShader_AddRef(iface); + *object = iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + + *object = NULL; + return E_NOINTERFACE; +} + +static ULONG STDMETHODCALLTYPE d3d11_hull_shader_AddRef(ID3D11HullShader *iface) +{ + struct d3d11_hull_shader *shader = impl_from_ID3D11HullShader(iface); + ULONG refcount = InterlockedIncrement(&shader->refcount); + + TRACE("%p increasing refcount to %u.\n", shader, refcount); + + return refcount; +} + +static ULONG STDMETHODCALLTYPE d3d11_hull_shader_Release(ID3D11HullShader *iface) +{ + struct d3d11_hull_shader *shader = impl_from_ID3D11HullShader(iface); + ULONG refcount = InterlockedDecrement(&shader->refcount); + + TRACE("%p decreasing refcount to %u.\n", shader, refcount); + + if (!refcount) + { + ID3D11Device *device = shader->device; + + wined3d_mutex_lock(); + wined3d_shader_decref(shader->wined3d_shader); + wined3d_mutex_unlock(); + + /* Release the device last, it may cause the wined3d device to be + * destroyed. */ + ID3D11Device_Release(device); + } + + return refcount; +} + +static void STDMETHODCALLTYPE d3d11_hull_shader_GetDevice(ID3D11HullShader *iface, + ID3D11Device **device) +{ + struct d3d11_hull_shader *shader = impl_from_ID3D11HullShader(iface); + + TRACE("iface %p, device %p.\n", iface, device); + + *device = shader->device; + ID3D11Device_AddRef(*device); +} + +static HRESULT STDMETHODCALLTYPE d3d11_hull_shader_GetPrivateData(ID3D11HullShader *iface, + REFGUID guid, UINT *data_size, void *data) +{ + struct d3d11_hull_shader *shader = impl_from_ID3D11HullShader(iface); + + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_get_private_data(&shader->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_hull_shader_SetPrivateData(ID3D11HullShader *iface, + REFGUID guid, UINT data_size, const void *data) +{ + struct d3d11_hull_shader *shader = impl_from_ID3D11HullShader(iface); + + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_set_private_data(&shader->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_hull_shader_SetPrivateDataInterface(ID3D11HullShader *iface, + REFGUID guid, const IUnknown *data) +{ + struct d3d11_hull_shader *shader = impl_from_ID3D11HullShader(iface); + + TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); + + return d3d_set_private_data_interface(&shader->private_store, guid, data); +} + +static const struct ID3D11HullShaderVtbl d3d11_hull_shader_vtbl = +{ + /* IUnknown methods */ + d3d11_hull_shader_QueryInterface, + d3d11_hull_shader_AddRef, + d3d11_hull_shader_Release, + /* ID3D11DeviceChild methods */ + d3d11_hull_shader_GetDevice, + d3d11_hull_shader_GetPrivateData, + d3d11_hull_shader_SetPrivateData, + d3d11_hull_shader_SetPrivateDataInterface, +}; + +static void STDMETHODCALLTYPE d3d11_hull_shader_wined3d_object_destroyed(void *parent) +{ + struct d3d11_hull_shader *shader = parent; + + wined3d_private_store_cleanup(&shader->private_store); + HeapFree(GetProcessHeap(), 0, parent); +} + +static const struct wined3d_parent_ops d3d11_hull_shader_wined3d_parent_ops = +{ + d3d11_hull_shader_wined3d_object_destroyed, +}; + +static HRESULT d3d11_hull_shader_init(struct d3d11_hull_shader *shader, struct d3d_device *device, + const void *byte_code, SIZE_T byte_code_length) +{ + struct wined3d_shader_signature output_signature; + struct wined3d_shader_signature input_signature; + struct d3d_shader_info shader_info; + struct wined3d_shader_desc desc; + HRESULT hr; + + shader->ID3D11HullShader_iface.lpVtbl = &d3d11_hull_shader_vtbl; + shader->refcount = 1; + wined3d_mutex_lock(); + wined3d_private_store_init(&shader->private_store); + + shader_info.input_signature = &input_signature; + shader_info.output_signature = &output_signature; + if (FAILED(hr = shader_extract_from_dxbc(byte_code, byte_code_length, &shader_info))) + { + WARN("Failed to extract shader, hr %#x.\n", hr); + wined3d_private_store_cleanup(&shader->private_store); + wined3d_mutex_unlock(); + return hr; + } + + desc.byte_code = shader_info.shader_code; + desc.input_signature = &input_signature; + desc.output_signature = &output_signature; + desc.max_version = d3d_sm_from_feature_level(device->feature_level); + + hr = wined3d_shader_create_hs(device->wined3d_device, &desc, shader, + &d3d11_hull_shader_wined3d_parent_ops, &shader->wined3d_shader); + shader_free_signature(&input_signature); + shader_free_signature(&output_signature); + if (FAILED(hr)) + { + WARN("Failed to create wined3d hull shader, hr %#x.\n", hr); + wined3d_private_store_cleanup(&shader->private_store); + wined3d_mutex_unlock(); + return E_INVALIDARG; + } + wined3d_mutex_unlock(); + + shader->device = &device->ID3D11Device_iface; + ID3D11Device_AddRef(shader->device); + + return S_OK; +} + +HRESULT d3d11_hull_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, + struct d3d11_hull_shader **shader) +{ + struct d3d11_hull_shader *object; + HRESULT hr; + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + if (FAILED(hr = d3d11_hull_shader_init(object, device, byte_code, byte_code_length))) + { + HeapFree(GetProcessHeap(), 0, object); + return hr; + } + + TRACE("Created hull shader %p.\n", object); + *shader = object; + + return S_OK; +} + +/* ID3D11DomainShader methods */ + +static inline struct d3d11_domain_shader *impl_from_ID3D11DomainShader(ID3D11DomainShader *iface) +{ + return CONTAINING_RECORD(iface, struct d3d11_domain_shader, ID3D11DomainShader_iface); +} + +static HRESULT STDMETHODCALLTYPE d3d11_domain_shader_QueryInterface(ID3D11DomainShader *iface, + REFIID riid, void **object) +{ + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + + if (IsEqualGUID(riid, &IID_ID3D11DomainShader) + || IsEqualGUID(riid, &IID_ID3D11DeviceChild) + || IsEqualGUID(riid, &IID_IUnknown)) + { + ID3D11DomainShader_AddRef(iface); + *object = iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + + *object = NULL; + return E_NOINTERFACE; +} + +static ULONG STDMETHODCALLTYPE d3d11_domain_shader_AddRef(ID3D11DomainShader *iface) +{ + struct d3d11_domain_shader *shader = impl_from_ID3D11DomainShader(iface); + ULONG refcount = InterlockedIncrement(&shader->refcount); + + TRACE("%p increasing refcount to %u.\n", shader, refcount); + + return refcount; +} + +static ULONG STDMETHODCALLTYPE d3d11_domain_shader_Release(ID3D11DomainShader *iface) +{ + struct d3d11_domain_shader *shader = impl_from_ID3D11DomainShader(iface); + ULONG refcount = InterlockedDecrement(&shader->refcount); + + TRACE("%p decreasing refcount to %u.\n", shader, refcount); + + if (!refcount) + { + ID3D11Device *device = shader->device; + + wined3d_mutex_lock(); + wined3d_shader_decref(shader->wined3d_shader); + wined3d_mutex_unlock(); + + /* Release the device last, it may cause the wined3d device to be + * destroyed. */ + ID3D11Device_Release(device); + } + + return refcount; +} + +static void STDMETHODCALLTYPE d3d11_domain_shader_GetDevice(ID3D11DomainShader *iface, + ID3D11Device **device) +{ + struct d3d11_domain_shader *shader = impl_from_ID3D11DomainShader(iface); + + TRACE("iface %p, device %p.\n", iface, device); + + *device = shader->device; + ID3D11Device_AddRef(*device); +} + +static HRESULT STDMETHODCALLTYPE d3d11_domain_shader_GetPrivateData(ID3D11DomainShader *iface, + REFGUID guid, UINT *data_size, void *data) +{ + struct d3d11_domain_shader *shader = impl_from_ID3D11DomainShader(iface); + + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_get_private_data(&shader->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_domain_shader_SetPrivateData(ID3D11DomainShader *iface, + REFGUID guid, UINT data_size, const void *data) +{ + struct d3d11_domain_shader *shader = impl_from_ID3D11DomainShader(iface); + + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_set_private_data(&shader->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_domain_shader_SetPrivateDataInterface(ID3D11DomainShader *iface, + REFGUID guid, const IUnknown *data) +{ + struct d3d11_domain_shader *shader = impl_from_ID3D11DomainShader(iface); + + TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); + + return d3d_set_private_data_interface(&shader->private_store, guid, data); +} + +static const struct ID3D11DomainShaderVtbl d3d11_domain_shader_vtbl = +{ + /* IUnknown methods */ + d3d11_domain_shader_QueryInterface, + d3d11_domain_shader_AddRef, + d3d11_domain_shader_Release, + /* ID3D11DeviceChild methods */ + d3d11_domain_shader_GetDevice, + d3d11_domain_shader_GetPrivateData, + d3d11_domain_shader_SetPrivateData, + d3d11_domain_shader_SetPrivateDataInterface, +}; + +static void STDMETHODCALLTYPE d3d11_domain_shader_wined3d_object_destroyed(void *parent) +{ + struct d3d11_domain_shader *shader = parent; + + wined3d_private_store_cleanup(&shader->private_store); + HeapFree(GetProcessHeap(), 0, parent); +} + +static const struct wined3d_parent_ops d3d11_domain_shader_wined3d_parent_ops = +{ + d3d11_domain_shader_wined3d_object_destroyed, +}; + +static HRESULT d3d11_domain_shader_init(struct d3d11_domain_shader *shader, struct d3d_device *device, + const void *byte_code, SIZE_T byte_code_length) +{ + struct wined3d_shader_signature output_signature; + struct wined3d_shader_signature input_signature; + struct d3d_shader_info shader_info; + struct wined3d_shader_desc desc; + HRESULT hr; + + shader->ID3D11DomainShader_iface.lpVtbl = &d3d11_domain_shader_vtbl; + shader->refcount = 1; + wined3d_mutex_lock(); + wined3d_private_store_init(&shader->private_store); + + shader_info.input_signature = &input_signature; + shader_info.output_signature = &output_signature; + if (FAILED(hr = shader_extract_from_dxbc(byte_code, byte_code_length, &shader_info))) + { + WARN("Failed to extract shader, hr %#x.\n", hr); + wined3d_private_store_cleanup(&shader->private_store); + wined3d_mutex_unlock(); + return hr; + } + + desc.byte_code = shader_info.shader_code; + desc.input_signature = &input_signature; + desc.output_signature = &output_signature; + desc.max_version = d3d_sm_from_feature_level(device->feature_level); + + hr = wined3d_shader_create_ds(device->wined3d_device, &desc, shader, + &d3d11_domain_shader_wined3d_parent_ops, &shader->wined3d_shader); + shader_free_signature(&input_signature); + shader_free_signature(&output_signature); + if (FAILED(hr)) + { + WARN("Failed to create wined3d domain shader, hr %#x.\n", hr); + wined3d_private_store_cleanup(&shader->private_store); + wined3d_mutex_unlock(); + return E_INVALIDARG; + } + wined3d_mutex_unlock(); + + shader->device = &device->ID3D11Device_iface; + ID3D11Device_AddRef(shader->device); + + return S_OK; +} + +HRESULT d3d11_domain_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, + struct d3d11_domain_shader **shader) +{ + struct d3d11_domain_shader *object; + HRESULT hr; + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + if (FAILED(hr = d3d11_domain_shader_init(object, device, byte_code, byte_code_length))) + { + HeapFree(GetProcessHeap(), 0, object); + return hr; + } + + TRACE("Created domain shader %p.\n", object); + *shader = object; + + return S_OK; +} + /* ID3D11GeometryShader methods */ static inline struct d3d_geometry_shader *impl_from_ID3D11GeometryShader(ID3D11GeometryShader *iface) diff -Nru wine-staging-1.9.6/dlls/d3d11/tests/d3d11.c wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d11/tests/d3d11.c --- wine-staging-1.9.6/dlls/d3d11/tests/d3d11.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d11/tests/d3d11.c 2016-04-04 18:06:32.000000000 +0000 @@ -265,6 +265,27 @@ return NULL; } +static BOOL is_warp_device(ID3D11Device *device) +{ + DXGI_ADAPTER_DESC adapter_desc; + IDXGIDevice *dxgi_device; + IDXGIAdapter *adapter; + HRESULT hr; + + hr = ID3D11Device_QueryInterface(device, &IID_IDXGIDevice, (void **)&dxgi_device); + ok(SUCCEEDED(hr), "Failed to query IDXGIDevice interface, hr %#x.\n", hr); + hr = IDXGIDevice_GetAdapter(dxgi_device, &adapter); + ok(SUCCEEDED(hr), "Failed to get adapter, hr %#x.\n", hr); + IDXGIDevice_Release(dxgi_device); + hr = IDXGIAdapter_GetDesc(adapter, &adapter_desc); + ok(SUCCEEDED(hr), "Failed to get adapter desc, hr %#x.\n", hr); + IDXGIAdapter_Release(adapter); + + return !adapter_desc.SubSysId && !adapter_desc.Revision + && ((!adapter_desc.VendorId && !adapter_desc.DeviceId) + || (adapter_desc.VendorId == 0x1414 && adapter_desc.DeviceId == 0x008c)); +} + static IDXGISwapChain *create_swapchain(ID3D11Device *device, HWND window, BOOL windowed) { IDXGISwapChain *swapchain; @@ -3606,6 +3627,13 @@ 0xffb1c4de, 0xfff0f1f2, 0xfffafdfe, 0xff5a560f, 0xffd5ff00, 0xffc8f99f, 0xffaa00aa, 0xffdd55bb, }; + static const BYTE a8_data[] = + { + 0x00, 0x10, 0x20, 0x30, + 0x40, 0x50, 0x60, 0x70, + 0x80, 0x90, 0xa0, 0xb0, + 0xc0, 0xd0, 0xe0, 0xf0, + }; static const BYTE bc1_data[] = { 0x00, 0xf8, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, @@ -3652,6 +3680,8 @@ }; static const struct texture srgb_texture = {4, 4, 1, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, {{srgb_data, 4 * sizeof(*srgb_data)}}}; + static const struct texture a8_texture = {4, 4, 1, DXGI_FORMAT_A8_UNORM, + {{a8_data, 4 * sizeof(*a8_data)}}}; 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}}}; @@ -3692,6 +3722,13 @@ 0xff708cba, 0xffdee0e2, 0xfff3fbfd, 0xff1a1801, 0xffa9ff00, 0xff93f159, 0xff670067, 0xffb8177f, }; + static const DWORD a8_colors[] = + { + 0x00000000, 0x10000000, 0x20000000, 0x30000000, + 0x40000000, 0x50000000, 0x60000000, 0x70000000, + 0x80000000, 0x90000000, 0xa0000000, 0xb0000000, + 0xc0000000, 0xd0000000, 0xe0000000, 0xf0000000, + }; static const DWORD bc_colors[] = { 0xff0000ff, 0xff0000ff, 0xff00ff00, 0xff00ff00, @@ -3764,6 +3801,7 @@ {&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, &srgb_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, srgb_colors}, + {&ps_sample, &a8_texture, D3D11_FILTER_MIN_MAG_MIP_POINT, 0.0f, 0.0f, 0.0f, 0.0f, a8_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}, @@ -3919,9 +3957,9 @@ draw_quad(&test_context); get_texture_readback(test_context.backbuffer, &rb); - for (x = 0; x < 4; ++x) + for (y = 0; y < 4; ++y) { - for (y = 0; y < 4; ++y) + for (x = 0; x < 4; ++x) { color = get_readback_color(&rb, 80 + x * 160, 60 + y * 120); ok(compare_color(color, test->expected_colors[y * 4 + x], 1), @@ -4139,20 +4177,13 @@ return float4(0.0, 1.0, 0.0, 1.0); } #endif - 0x43425844, 0xe70802a0, 0xee334047, 0x7bfd0c79, 0xaeff7804, 0x00000001, 0x000001b0, 0x00000005, - 0x00000034, 0x0000008c, 0x000000c0, 0x000000f4, 0x00000134, 0x46454452, 0x00000050, 0x00000000, - 0x00000000, 0x00000000, 0x0000001c, 0xffff0400, 0x00000100, 0x0000001c, 0x7263694d, 0x666f736f, - 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x39207265, 0x2e30332e, - 0x30303239, 0x3336312e, 0xab003438, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x43425844, 0x30240e72, 0x012f250c, 0x8673c6ea, 0x392e4cec, 0x00000001, 0x000000d4, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x505f5653, 0x5449534f, 0x004e4f49, 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000038, 0x00000040, 0x0000000e, 0x03000065, 0x001020f2, 0x00000000, 0x08000036, 0x001020f2, 0x00000000, 0x00004002, - 0x00000000, 0x3f800000, 0x00000000, 0x3f800000, 0x0100003e, 0x54415453, 0x00000074, 0x00000002, - 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, - 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x3f800000, 0x00000000, 0x3f800000, 0x0100003e, }; if (!init_test_context(&test_context, NULL)) @@ -4736,12 +4767,15 @@ { ID3D11Texture2D *dst_texture, *src_texture; struct d3d11_test_context test_context; + ID3D11Buffer *dst_buffer, *src_buffer; D3D11_SUBRESOURCE_DATA resource_data; D3D11_TEXTURE2D_DESC texture_desc; ID3D11SamplerState *sampler_state; ID3D11ShaderResourceView *ps_srv; D3D11_SAMPLER_DESC sampler_desc; + D3D11_BUFFER_DESC buffer_desc; ID3D11DeviceContext *context; + struct vec4 float_colors[16]; struct texture_readback rb; ID3D11PixelShader *ps; ID3D11Device *device; @@ -4776,6 +4810,31 @@ 0x3b088889, 0x00000000, 0x00000000, 0x09000045, 0x001020f2, 0x00000000, 0x00100046, 0x00000000, 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0100003e, }; + static const DWORD ps_buffer_code[] = + { +#if 0 + float4 buffer[16]; + + float4 main(float4 position : SV_POSITION) : SV_TARGET + { + float2 p = (float2)4; + p *= float2(position.x / 640.0f, position.y / 480.0f); + return buffer[(int)p.y * 4 + (int)p.x]; + } +#endif + 0x43425844, 0x57e7139f, 0x4f0c9e52, 0x598b77e3, 0x5a239132, 0x00000001, 0x0000016c, 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, 0x000000d0, 0x00000040, + 0x00000034, 0x04000859, 0x00208e46, 0x00000000, 0x00000010, 0x04002064, 0x00101032, 0x00000000, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000001, 0x0a000038, 0x00100032, + 0x00000000, 0x00101516, 0x00000000, 0x00004002, 0x3c088889, 0x3bcccccd, 0x00000000, 0x00000000, + 0x0500001b, 0x00100032, 0x00000000, 0x00100046, 0x00000000, 0x07000029, 0x00100012, 0x00000000, + 0x0010000a, 0x00000000, 0x00004001, 0x00000002, 0x0700001e, 0x00100012, 0x00000000, 0x0010000a, + 0x00000000, 0x0010001a, 0x00000000, 0x07000036, 0x001020f2, 0x00000000, 0x04208e46, 0x00000000, + 0x0010000a, 0x00000000, 0x0100003e, + }; static const float red[] = {1.0f, 0.0f, 0.0f, 0.5f}; static const DWORD bitmap_data[] = { @@ -4900,10 +4959,91 @@ release_texture_readback(&rb); ID3D11PixelShader_Release(ps); - ID3D11SamplerState_Release(sampler_state); + hr = ID3D11Device_CreatePixelShader(device, ps_buffer_code, sizeof(ps_buffer_code), NULL, &ps); + ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x.\n", hr); + ID3D11ShaderResourceView_Release(ps_srv); + ps_srv = NULL; + + ID3D11SamplerState_Release(sampler_state); + sampler_state = NULL; + ID3D11Texture2D_Release(dst_texture); ID3D11Texture2D_Release(src_texture); + + ID3D11DeviceContext_PSSetShaderResources(context, 0, 1, &ps_srv); + ID3D11DeviceContext_PSSetSamplers(context, 0, 1, &sampler_state); + ID3D11DeviceContext_PSSetShader(context, ps, NULL, 0); + + buffer_desc.ByteWidth = sizeof(float_colors); + buffer_desc.Usage = D3D11_USAGE_DEFAULT; + buffer_desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; + buffer_desc.CPUAccessFlags = 0; + buffer_desc.MiscFlags = 0; + buffer_desc.StructureByteStride = 0; + + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, NULL, &dst_buffer); + ok(SUCCEEDED(hr), "Failed to create buffer, hr %#x.\n", hr); + + ID3D11DeviceContext_PSSetConstantBuffers(context, 0, 1, &dst_buffer); + + buffer_desc.ByteWidth = 256 * sizeof(*float_colors); + buffer_desc.BindFlags = 0; + + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, NULL, &src_buffer); + ok(SUCCEEDED(hr), "Failed to create buffer, hr %#x.\n", hr); + + for (i = 0; i < 4; ++i) + { + for (j = 0; j < 4; ++j) + { + float_colors[j + i * 4].x = ((bitmap_data[j + i * 4] >> 0) & 0xff) / 255.0f; + float_colors[j + i * 4].y = ((bitmap_data[j + i * 4] >> 8) & 0xff) / 255.0f; + float_colors[j + i * 4].z = ((bitmap_data[j + i * 4] >> 16) & 0xff) / 255.0f; + float_colors[j + i * 4].w = ((bitmap_data[j + i * 4] >> 24) & 0xff) / 255.0f; + } + } + set_box(&box, 0, 0, 0, sizeof(float_colors), 1, 1); + ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)src_buffer, 0, &box, float_colors, 0, 0); + + set_box(&box, 0, 0, 0, sizeof(float_colors), 0, 1); + ID3D11DeviceContext_CopySubresourceRegion(context, (ID3D11Resource *)dst_buffer, 0, + 0, 0, 0, (ID3D11Resource *)src_buffer, 0, &box); + draw_quad(&test_context); + check_texture_color(test_context.backbuffer, 0x00000000, 0); + + set_box(&box, 0, 0, 0, sizeof(float_colors), 1, 0); + ID3D11DeviceContext_CopySubresourceRegion(context, (ID3D11Resource *)dst_buffer, 0, + 0, 0, 0, (ID3D11Resource *)src_buffer, 0, &box); + draw_quad(&test_context); + check_texture_color(test_context.backbuffer, 0x00000000, 0); + + set_box(&box, 0, 0, 0, sizeof(float_colors), 0, 0); + ID3D11DeviceContext_CopySubresourceRegion(context, (ID3D11Resource *)dst_buffer, 0, + 0, 0, 0, (ID3D11Resource *)src_buffer, 0, &box); + draw_quad(&test_context); + check_texture_color(test_context.backbuffer, 0x00000000, 0); + + set_box(&box, 0, 0, 0, sizeof(float_colors), 1, 1); + ID3D11DeviceContext_CopySubresourceRegion(context, (ID3D11Resource *)dst_buffer, 0, + 0, 0, 0, (ID3D11Resource *)src_buffer, 0, &box); + draw_quad(&test_context); + get_texture_readback(test_context.backbuffer, &rb); + for (i = 0; i < 4; ++i) + { + for (j = 0; j < 4; ++j) + { + color = get_readback_color(&rb, 80 + j * 160, 60 + i * 120); + ok(compare_color(color, bitmap_data[j + i * 4], 1), + "Got unexpected color 0x%08x at (%u, %u), expected 0x%08x.\n", + color, j, i, bitmap_data[j + i * 4]); + } + } + release_texture_readback(&rb); + + ID3D11Buffer_Release(dst_buffer); + ID3D11Buffer_Release(src_buffer); + ID3D11PixelShader_Release(ps); release_test_context(&test_context); } @@ -5175,6 +5315,100 @@ ok(!refcount, "Device has %u references left.\n", refcount); } +static void test_clear_render_target_view(void) +{ + static const DWORD expected_color = 0xbf4c7f19, expected_srgb_color = 0xbf95bc59; + static const float color[] = {0.1f, 0.5f, 0.3f, 0.75f}; + + ID3D11Texture2D *texture, *srgb_texture; + struct d3d11_test_context test_context; + ID3D11RenderTargetView *rtv, *srgb_rtv; + D3D11_RENDER_TARGET_VIEW_DESC rtv_desc; + D3D11_TEXTURE2D_DESC texture_desc; + ID3D11DeviceContext *context; + ID3D11Device *device; + HRESULT hr; + + if (!init_test_context(&test_context, NULL)) + return; + + device = test_context.device; + context = test_context.immediate_context; + + texture_desc.Width = 640; + texture_desc.Height = 480; + texture_desc.MipLevels = 1; + texture_desc.ArraySize = 1; + texture_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + texture_desc.SampleDesc.Count = 1; + texture_desc.SampleDesc.Quality = 0; + texture_desc.Usage = D3D11_USAGE_DEFAULT; + texture_desc.BindFlags = D3D11_BIND_RENDER_TARGET; + texture_desc.CPUAccessFlags = 0; + texture_desc.MiscFlags = 0; + hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, &texture); + ok(SUCCEEDED(hr), "Failed to create depth texture, hr %#x.\n", hr); + + texture_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM_SRGB; + hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, &srgb_texture); + ok(SUCCEEDED(hr), "Failed to create depth texture, hr %#x.\n", hr); + + hr = ID3D11Device_CreateRenderTargetView(device, (ID3D11Resource *)texture, NULL, &rtv); + ok(SUCCEEDED(hr), "Failed to create render target view, hr %#x.\n", hr); + + hr = ID3D11Device_CreateRenderTargetView(device, (ID3D11Resource *)srgb_texture, NULL, &srgb_rtv); + ok(SUCCEEDED(hr), "Failed to create render target view, hr %#x.\n", hr); + + ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, color); + check_texture_color(test_context.backbuffer, expected_color, 1); + + ID3D11DeviceContext_ClearRenderTargetView(context, rtv, color); + check_texture_color(texture, expected_color, 1); + + ID3D11DeviceContext_ClearRenderTargetView(context, srgb_rtv, color); + check_texture_color(srgb_texture, expected_srgb_color, 1); + + ID3D11RenderTargetView_Release(srgb_rtv); + ID3D11RenderTargetView_Release(rtv); + ID3D11Texture2D_Release(srgb_texture); + ID3D11Texture2D_Release(texture); + + texture_desc.Format = DXGI_FORMAT_R8G8B8A8_TYPELESS; + hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, &texture); + ok(SUCCEEDED(hr), "Failed to create depth texture, hr %#x.\n", hr); + + rtv_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM_SRGB; + rtv_desc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D; + U(rtv_desc).Texture2D.MipSlice = 0; + hr = ID3D11Device_CreateRenderTargetView(device, (ID3D11Resource *)texture, &rtv_desc, &srgb_rtv); + ok(SUCCEEDED(hr), "Failed to create render target view, hr %#x.\n", hr); + + rtv_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + rtv_desc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D; + U(rtv_desc).Texture2D.MipSlice = 0; + hr = ID3D11Device_CreateRenderTargetView(device, (ID3D11Resource *)texture, &rtv_desc, &rtv); + ok(SUCCEEDED(hr), "Failed to create render target view, hr %#x.\n", hr); + + ID3D11DeviceContext_ClearRenderTargetView(context, rtv, color); + check_texture_color(texture, expected_color, 1); + + if (!is_warp_device(device)) + { + ID3D11DeviceContext_ClearRenderTargetView(context, srgb_rtv, color); + todo_wine check_texture_color(texture, expected_srgb_color, 1); + } + else + { + win_skip("Skipping broken test on WARP.\n"); + } + + + ID3D11RenderTargetView_Release(srgb_rtv); + ID3D11RenderTargetView_Release(rtv); + ID3D11Texture2D_Release(texture); + release_test_context(&test_context); +} + static void test_clear_depth_stencil_view(void) { D3D11_TEXTURE2D_DESC texture_desc; @@ -5253,6 +5487,180 @@ ok(!refcount, "Device has %u references left.\n", refcount); } +static void test_draw_depth_only(void) +{ + ID3D11DepthStencilState *depth_stencil_state; + D3D11_DEPTH_STENCIL_DESC depth_stencil_desc; + struct d3d11_test_context test_context; + ID3D11PixelShader *ps_color, *ps_depth; + D3D11_TEXTURE2D_DESC texture_desc; + D3D11_BUFFER_DESC buffer_desc; + ID3D11DeviceContext *context; + ID3D11DepthStencilView *dsv; + struct texture_readback rb; + ID3D11Texture2D *texture; + ID3D11Device *device; + unsigned int i, j; + D3D11_VIEWPORT vp; + struct vec4 depth; + ID3D11Buffer *cb; + HRESULT hr; + + static const DWORD ps_color_code[] = + { +#if 0 + float4 main(float4 position : SV_POSITION) : SV_Target + { + return float4(0.0, 1.0, 0.0, 1.0); + } +#endif + 0x43425844, 0x30240e72, 0x012f250c, 0x8673c6ea, 0x392e4cec, 0x00000001, 0x000000d4, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x505f5653, 0x5449534f, 0x004e4f49, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000038, 0x00000040, + 0x0000000e, 0x03000065, 0x001020f2, 0x00000000, 0x08000036, 0x001020f2, 0x00000000, 0x00004002, + 0x00000000, 0x3f800000, 0x00000000, 0x3f800000, 0x0100003e, + }; + static const DWORD ps_depth_code[] = + { +#if 0 + float depth; + + float main() : SV_Depth + { + return depth; + } +#endif + 0x43425844, 0x91af6cd0, 0x7e884502, 0xcede4f54, 0x6f2c9326, 0x00000001, 0x000000b0, 0x00000003, + 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, + 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0xffffffff, + 0x00000e01, 0x445f5653, 0x68747065, 0xababab00, 0x52444853, 0x00000038, 0x00000040, 0x0000000e, + 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x02000065, 0x0000c001, 0x05000036, 0x0000c001, + 0x0020800a, 0x00000000, 0x00000000, 0x0100003e, + }; + + if (!init_test_context(&test_context, NULL)) + return; + + device = test_context.device; + context = test_context.immediate_context; + + buffer_desc.ByteWidth = sizeof(depth); + buffer_desc.Usage = D3D11_USAGE_DEFAULT; + buffer_desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; + buffer_desc.CPUAccessFlags = 0; + buffer_desc.MiscFlags = 0; + buffer_desc.StructureByteStride = 0; + + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, NULL, &cb); + ok(SUCCEEDED(hr), "Failed to create constant buffer, hr %#x.\n", hr); + + texture_desc.Width = 640; + texture_desc.Height = 480; + texture_desc.MipLevels = 1; + texture_desc.ArraySize = 1; + texture_desc.Format = DXGI_FORMAT_D32_FLOAT; + texture_desc.SampleDesc.Count = 1; + texture_desc.SampleDesc.Quality = 0; + texture_desc.Usage = D3D11_USAGE_DEFAULT; + texture_desc.BindFlags = D3D11_BIND_DEPTH_STENCIL; + texture_desc.CPUAccessFlags = 0; + texture_desc.MiscFlags = 0; + + hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, &texture); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + + hr = ID3D11Device_CreateDepthStencilView(device, (ID3D11Resource *)texture, NULL, &dsv); + ok(SUCCEEDED(hr), "Failed to create depth stencil view, hr %#x.\n", hr); + + depth_stencil_desc.DepthEnable = TRUE; + depth_stencil_desc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL; + depth_stencil_desc.DepthFunc = D3D11_COMPARISON_LESS; + depth_stencil_desc.StencilEnable = FALSE; + + hr = ID3D11Device_CreateDepthStencilState(device, &depth_stencil_desc, &depth_stencil_state); + ok(SUCCEEDED(hr), "Failed to create depth stencil state, hr %#x.\n", hr); + + hr = ID3D11Device_CreatePixelShader(device, ps_color_code, sizeof(ps_color_code), NULL, &ps_color); + ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x.\n", hr); + hr = ID3D11Device_CreatePixelShader(device, ps_depth_code, sizeof(ps_depth_code), NULL, &ps_depth); + ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x.\n", hr); + + ID3D11DeviceContext_PSSetConstantBuffers(context, 0, 1, &cb); + ID3D11DeviceContext_PSSetShader(context, ps_color, NULL, 0); + ID3D11DeviceContext_OMSetRenderTargets(context, 0, NULL, dsv); + ID3D11DeviceContext_OMSetDepthStencilState(context, depth_stencil_state, 0); + + ID3D11DeviceContext_ClearDepthStencilView(context, dsv, D3D11_CLEAR_DEPTH, 1.0f, 0); + check_texture_float(texture, 1.0f, 1); + draw_quad(&test_context); + check_texture_float(texture, 0.0f, 1); + + ID3D11DeviceContext_PSSetShader(context, ps_depth, NULL, 0); + + depth.x = 0.7f; + ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &depth, 0, 0); + draw_quad(&test_context); + check_texture_float(texture, 0.0f, 1); + ID3D11DeviceContext_ClearDepthStencilView(context, dsv, D3D11_CLEAR_DEPTH, 1.0f, 0); + check_texture_float(texture, 1.0f, 1); + draw_quad(&test_context); + check_texture_float(texture, 0.7f, 1); + depth.x = 0.8f; + ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &depth, 0, 0); + draw_quad(&test_context); + check_texture_float(texture, 0.7f, 1); + depth.x = 0.5f; + ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &depth, 0, 0); + draw_quad(&test_context); + check_texture_float(texture, 0.5f, 1); + + ID3D11DeviceContext_ClearDepthStencilView(context, dsv, D3D11_CLEAR_DEPTH, 1.0f, 0); + depth.x = 0.1f; + for (i = 0; i < 4; ++i) + { + for (j = 0; j < 4; ++j) + { + depth.x = 1.0f / 16.0f * (j + 4 * i); + ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)cb, 0, NULL, &depth, 0, 0); + + vp.TopLeftX = 160.0f * j; + vp.TopLeftY = 120.0f * i; + vp.Width = 160.0f; + vp.Height = 120.0f; + vp.MinDepth = 0.0f; + vp.MaxDepth = 1.0f; + ID3D11DeviceContext_RSSetViewports(context, 1, &vp); + + draw_quad(&test_context); + } + } + get_texture_readback(texture, &rb); + for (i = 0; i < 4; ++i) + { + for (j = 0; j < 4; ++j) + { + float obtained_depth, expected_depth; + + obtained_depth = get_readback_float(&rb, 80 + j * 160, 60 + i * 120); + expected_depth = 1.0f / 16.0f * (j + 4 * i); + ok(compare_float(obtained_depth, expected_depth, 1), + "Got unexpected depth %.8e at (%u, %u), expected %.8e.\n", + obtained_depth, j, i, expected_depth); + } + } + release_texture_readback(&rb); + + ID3D11Buffer_Release(cb); + ID3D11PixelShader_Release(ps_color); + ID3D11PixelShader_Release(ps_depth); + ID3D11DepthStencilView_Release(dsv); + ID3D11DepthStencilState_Release(depth_stencil_state); + ID3D11Texture2D_Release(texture); + release_test_context(&test_context); +} + static void test_cb_relative_addressing(void) { struct d3d11_test_context test_context; @@ -5484,6 +5892,8 @@ test_resource_map(); test_multisample_init(); test_check_multisample_quality_levels(); + test_clear_render_target_view(); test_clear_depth_stencil_view(); + test_draw_depth_only(); test_cb_relative_addressing(); } diff -Nru wine-staging-1.9.6/dlls/d3d11/view.c wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d11/view.c --- wine-staging-1.9.6/dlls/d3d11/view.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d11/view.c 2016-04-04 18:06:32.000000000 +0000 @@ -1503,6 +1503,7 @@ wined3d_mutex_lock(); if (!(wined3d_resource = wined3d_resource_from_d3d11_resource(resource))) { + wined3d_mutex_unlock(); ERR("Failed to get wined3d resource for d3d10 resource %p.\n", resource); return E_FAIL; } @@ -1510,6 +1511,7 @@ if (FAILED(hr = wined3d_shader_resource_view_create(wined3d_resource, view, &d3d_null_wined3d_parent_ops, &view->wined3d_view))) { + wined3d_mutex_unlock(); WARN("Failed to create wined3d shader resource view, hr %#x.\n", hr); return hr; } diff -Nru wine-staging-1.9.6/dlls/d3d8/device.c wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d8/device.c --- wine-staging-1.9.6/dlls/d3d8/device.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d8/device.c 2016-04-04 18:06:32.000000000 +0000 @@ -942,8 +942,8 @@ struct wined3d_texture *texture; HRESULT hr; - TRACE("device %p, width %u, height %u, format %#x, flags %#x, surface %p,\n" - "\tusage %#x, pool %#x, multisample_type %#x, multisample_quality %u.\n", + TRACE("device %p, width %u, height %u, format %#x, flags %#x, surface %p, " + "usage %#x, pool %#x, multisample_type %#x, multisample_quality %u.\n", device, width, height, format, flags, surface, usage, pool, multisample_type, multisample_quality); @@ -2130,7 +2130,7 @@ UINT vtx_size = vertex_count * vertex_stride; UINT vb_pos, align; - TRACE("iface %p, primitive_type %#x, min_vertex_idx %u, vertex_count %u, primitive_count %u,\n" + TRACE("iface %p, primitive_type %#x, min_vertex_idx %u, vertex_count %u, primitive_count %u, " "index_data %p, index_format %#x, vertex_data %p, vertex_stride %u.\n", iface, primitive_type, min_vertex_idx, vertex_count, primitive_count, index_data, index_format, vertex_data, vertex_stride); diff -Nru wine-staging-1.9.6/dlls/d3d8/tests/visual.c wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d8/tests/visual.c --- wine-staging-1.9.6/dlls/d3d8/tests/visual.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d8/tests/visual.c 2016-04-04 18:06:32.000000000 +0000 @@ -9176,6 +9176,182 @@ DestroyWindow(window); } +static void test_color_clamping(void) +{ + static const D3DMATRIX mat = + {{{ + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f, + }}}; + static const struct vec3 quad[] = + { + {-1.0f, -1.0f, 0.1f}, + {-1.0f, 1.0f, 0.1f}, + { 1.0f, -1.0f, 0.1f}, + { 1.0f, 1.0f, 0.1f}, + }; + static const DWORD decl[] = + { + D3DVSD_STREAM(0), + D3DVSD_REG(D3DVSDE_POSITION, D3DVSDT_FLOAT3), + D3DVSD_CONST(0, 1), 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, /* def c0, 1.0, 1.0, 1.0, 1.0 */ + D3DVSD_END() + }; + static const DWORD vs1_code[] = + { + 0xfffe0101, /* vs_1_1 */ + 0x00000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */ + 0x00000002, 0xd00f0000, 0xa0e40000, 0xa0e40000, /* add oD0, c0, c0 */ + 0x00000002, 0xd00f0001, 0xa0e40000, 0xa0e40000, /* add oD1, c0, c0 */ + 0x0000ffff + }; + static const DWORD ps1_code[] = + { + 0xffff0101, /* ps_1_1 */ + 0x00000051, 0xa00f0000, 0x3e800000, 0x3e800000, 0x3e800000, 0x3e800000, /* def c0, 0.25, 0.25, 0.25, 0.25 */ + 0x00000002, 0x800f0000, 0x90e40000, 0x90e40001, /* add r0, v0, v1 */ + 0x00000005, 0x800f0000, 0x80e40000, 0xa0e40000, /* mul r0, r0, c0 */ + 0x0000ffff + }; + static const struct + { + DWORD vs_version; + const DWORD *vs; + DWORD ps_version; + const DWORD *ps; + D3DCOLOR expected, broken; + } + tests[] = + { + {0, NULL, 0, NULL, 0x00404040}, + {0, NULL, D3DPS_VERSION(1, 1), ps1_code, 0x00404040, 0x00808080}, + {D3DVS_VERSION(1, 1), vs1_code, 0, NULL, 0x00404040}, + {D3DVS_VERSION(1, 1), vs1_code, D3DPS_VERSION(1, 1), ps1_code, 0x007f7f7f}, + }; + IDirect3DDevice8 *device; + IDirect3D8 *d3d; + unsigned int i; + ULONG refcount; + D3DCOLOR color; + D3DCAPS8 caps; + DWORD vs, ps; + HWND window; + HRESULT hr; + + window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate8(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + IDirect3D8_Release(d3d); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice8_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); + + hr = IDirect3DDevice8_SetTransform(device, D3DTS_WORLD, &mat); + ok(SUCCEEDED(hr), "Failed to set world transform, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTransform(device, D3DTS_VIEW, &mat); + ok(SUCCEEDED(hr), "Failed to set view transform, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTransform(device, D3DTS_PROJECTION, &mat); + ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_CLIPPING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable clipping, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_ZENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable Z test, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_FOGENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable fog, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_STENCILENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable stencil test, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_CULLMODE, D3DCULL_NONE); + ok(SUCCEEDED(hr), "Failed to disable culling, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); + + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_TEXTUREFACTOR, 0xff404040); + ok(SUCCEEDED(hr), "Failed to set texture factor, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_ADD); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_DIFFUSE); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_COLORARG2, D3DTA_SPECULAR); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTextureStageState(device, 1, D3DTSS_COLOROP, D3DTOP_MODULATE); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTextureStageState(device, 1, D3DTSS_COLORARG1, D3DTA_TFACTOR); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTextureStageState(device, 1, D3DTSS_COLORARG2, D3DTA_CURRENT); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + + for (i = 0; i < sizeof(tests) / sizeof(tests[0]); ++i) + { + if (caps.VertexShaderVersion < tests[i].vs_version + || caps.PixelShaderVersion < tests[i].ps_version) + { + skip("Vertex / pixel shader version not supported, skipping test %u.\n", i); + continue; + } + if (tests[i].vs) + { + hr = IDirect3DDevice8_CreateVertexShader(device, decl, tests[i].vs, &vs, 0); + ok(SUCCEEDED(hr), "Failed to create vertex shader, hr %#x (case %u).\n", hr, i); + } + else + { + vs = D3DFVF_XYZ; + } + if (tests[i].ps) + { + hr = IDirect3DDevice8_CreatePixelShader(device, tests[i].ps, &ps); + ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x (case %u).\n", hr, i); + } + else + { + ps = 0; + } + + hr = IDirect3DDevice8_SetVertexShader(device, vs); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetPixelShader(device, ps); + ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); + + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff00ff00, 0.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + + hr = IDirect3DDevice8_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + + hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(quad[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice8_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + + color = getPixelColor(device, 320, 240); + ok(color_match(color, tests[i].expected, 1) || broken(color_match(color, tests[i].broken, 1)), + "Got unexpected color 0x%08x, case %u.\n", color, i); + + if (vs != D3DFVF_XYZ) + IDirect3DDevice8_DeleteVertexShader(device, vs); + if (ps) + IDirect3DDevice8_DeletePixelShader(device, ps); + } + + hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); + + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D8_Release(d3d); + DestroyWindow(window); +} + START_TEST(visual) { D3DADAPTER_IDENTIFIER8 identifier; @@ -9242,4 +9418,5 @@ test_shademode(); test_multisample_init(); test_texture_blending(); + test_color_clamping(); } diff -Nru wine-staging-1.9.6/dlls/d3d9/device.c wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d9/device.c --- wine-staging-1.9.6/dlls/d3d9/device.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d9/device.c 2016-04-04 18:06:32.000000000 +0000 @@ -2314,7 +2314,7 @@ struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); HRESULT hr; - TRACE("iface %p, primitive_type %#x, base_vertex_idx %u, min_vertex_idx %u,\n" + TRACE("iface %p, primitive_type %#x, base_vertex_idx %u, min_vertex_idx %u, " "vertex_count %u, start_idx %u, primitive_count %u.\n", iface, primitive_type, base_vertex_idx, min_vertex_idx, vertex_count, start_idx, primitive_count); @@ -2339,13 +2339,13 @@ UINT size = max(device->vertex_buffer_size * 2, min_size); struct wined3d_buffer *buffer; - TRACE("Growing vertex buffer to %u bytes\n", size); + TRACE("Growing vertex buffer to %u bytes.\n", size); hr = wined3d_buffer_create_vb(device->wined3d_device, size, WINED3DUSAGE_DYNAMIC | WINED3DUSAGE_WRITEONLY, WINED3D_POOL_DEFAULT, NULL, &d3d9_null_wined3d_parent_ops, &buffer); if (FAILED(hr)) { - ERR("(%p) wined3d_buffer_create_vb failed with hr = %08x\n", device, hr); + ERR("(%p) wined3d_buffer_create_vb failed with hr = %08x.\n", device, hr); return hr; } @@ -2423,13 +2423,13 @@ UINT size = max(device->index_buffer_size * 2, min_size); struct wined3d_buffer *buffer; - TRACE("Growing index buffer to %u bytes\n", size); + TRACE("Growing index buffer to %u bytes.\n", size); hr = wined3d_buffer_create_ib(device->wined3d_device, size, WINED3DUSAGE_DYNAMIC | WINED3DUSAGE_WRITEONLY, WINED3D_POOL_DEFAULT, NULL, &d3d9_null_wined3d_parent_ops, &buffer); if (FAILED(hr)) { - ERR("(%p) wined3d_buffer_create_ib failed with hr = %08x\n", device, hr); + ERR("(%p) wined3d_buffer_create_ib failed with hr = %08x.\n", device, hr); return hr; } @@ -2460,14 +2460,14 @@ UINT vtx_size = vertex_count * vertex_stride; UINT vb_pos, align; - TRACE("iface %p, primitive_type %#x, min_vertex_idx %u, vertex_count %u, primitive_count %u,\n" + TRACE("iface %p, primitive_type %#x, min_vertex_idx %u, vertex_count %u, primitive_count %u, " "index_data %p, index_format %#x, vertex_data %p, vertex_stride %u.\n", iface, primitive_type, min_vertex_idx, vertex_count, primitive_count, index_data, index_format, vertex_data, vertex_stride); if (!primitive_count) { - WARN("primitive_count is 0, returning D3D_OK\n"); + WARN("primitive_count is 0, returning D3D_OK.\n"); return D3D_OK; } @@ -3259,7 +3259,7 @@ IDirect3DSurface9 *src_surface, IDirect3DSurface9 *dst_surface, IDirect3DVertexBuffer9 *src_descs, UINT rect_count, IDirect3DVertexBuffer9 *dst_descs, D3DCOMPOSERECTSOP operation, INT offset_x, INT offset_y) { - FIXME("iface %p, src_surface %p, dst_surface %p, src_descs %p, rect_count %u,\n" + FIXME("iface %p, src_surface %p, dst_surface %p, src_descs %p, rect_count %u, " "dst_descs %p, operation %#x, offset_x %u, offset_y %u stub!\n", iface, src_surface, dst_surface, src_descs, rect_count, dst_descs, operation, offset_x, offset_y); @@ -3372,7 +3372,7 @@ UINT width, UINT height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality, BOOL lockable, IDirect3DSurface9 **surface, HANDLE *shared_handle, DWORD usage) { - FIXME("iface %p, width %u, height %u, format %#x, multisample_type %#x, multisample_quality %u,\n" + FIXME("iface %p, width %u, height %u, format %#x, multisample_type %#x, multisample_quality %u, " "lockable %#x, surface %p, shared_handle %p, usage %#x stub!\n", iface, width, height, format, multisample_type, multisample_quality, lockable, surface, shared_handle, usage); diff -Nru wine-staging-1.9.6/dlls/d3d9/tests/visual.c wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d9/tests/visual.c --- wine-staging-1.9.6/dlls/d3d9/tests/visual.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3d9/tests/visual.c 2016-04-04 18:06:32.000000000 +0000 @@ -11272,13 +11272,14 @@ } test_formats[] = { - {"D3DFMT_G16R16", D3DFMT_G16R16, 0x001818ff, 0x002010ff}, + {"D3DFMT_G16R16", D3DFMT_G16R16, 0x001820ff, 0x002010ff}, {"D3DFMT_R16F", D3DFMT_R16F, 0x0018ffff, 0x0020ffff}, - {"D3DFMT_G16R16F", D3DFMT_G16R16F, 0x001818ff, 0x002010ff}, - {"D3DFMT_A16B16G16R16F", D3DFMT_A16B16G16R16F, 0x00181800, 0x00201000}, + {"D3DFMT_G16R16F", D3DFMT_G16R16F, 0x001820ff, 0x002010ff}, + {"D3DFMT_A16B16G16R16F", D3DFMT_A16B16G16R16F, 0x00182000, 0x00201000}, {"D3DFMT_R32F", D3DFMT_R32F, 0x0018ffff, 0x0020ffff}, - {"D3DFMT_G32R32F", D3DFMT_G32R32F, 0x001818ff, 0x002010ff}, - {"D3DFMT_A32B32G32R32F", D3DFMT_A32B32G32R32F, 0x00181800, 0x00201000}, + {"D3DFMT_G32R32F", D3DFMT_G32R32F, 0x001820ff, 0x002010ff}, + {"D3DFMT_A32B32G32R32F", D3DFMT_A32B32G32R32F, 0x00182000, 0x00201000}, + {"D3DFMT_L8", D3DFMT_L8, 0x00181818, 0x00202020}, }; static const float quad[][5] = { @@ -11292,15 +11293,13 @@ struct vec3 position; DWORD diffuse; } - /* Quad with R=0x10, G=0x20 */ quad1[] = { - {{-1.0f, -1.0f, 0.1f}, 0x80102000}, - {{-1.0f, 1.0f, 0.1f}, 0x80102000}, - {{ 1.0f, -1.0f, 0.1f}, 0x80102000}, - {{ 1.0f, 1.0f, 0.1f}, 0x80102000}, + {{-1.0f, -1.0f, 0.1f}, 0x80103000}, + {{-1.0f, 1.0f, 0.1f}, 0x80103000}, + {{ 1.0f, -1.0f, 0.1f}, 0x80103000}, + {{ 1.0f, 1.0f, 0.1f}, 0x80103000}, }, - /* Quad with R=0x20, G=0x10 */ quad2[] = { {{-1.0f, -1.0f, 0.1f}, 0x80201000}, @@ -20004,7 +20003,7 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZWRITEENABLE, FALSE); ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP,D3DTOP_SELECTARG1); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TFACTOR); ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); @@ -21452,6 +21451,229 @@ DestroyWindow(window); } +static void test_color_clamping(void) +{ + static const D3DMATRIX mat = + {{{ + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f, + }}}; + static const struct vec3 quad[] = + { + {-1.0f, -1.0f, 0.1f}, + {-1.0f, 1.0f, 0.1f}, + { 1.0f, -1.0f, 0.1f}, + { 1.0f, 1.0f, 0.1f}, + }; + static const DWORD vs1_code[] = + { + 0xfffe0101, /* vs_1_1 */ + 0x0000001f, 0x80000000, 0x900f0000, /* dcl_position v0 */ + 0x00000051, 0xa00f0000, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, /* def c0, 1.0, 1.0, 1.0, 1.0 */ + 0x00000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */ + 0x00000002, 0xd00f0000, 0xa0e40000, 0xa0e40000, /* add oD0, c0, c0 */ + 0x00000002, 0xd00f0001, 0xa0e40000, 0xa0e40000, /* add oD1, c0, c0 */ + 0x0000ffff + }; + static const DWORD vs2_code[] = + { + 0xfffe0200, /* vs_2_0 */ + 0x0200001f, 0x80000000, 0x900f0000, /* dcl_position v0 */ + 0x05000051, 0xa00f0000, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, /* def c0, 1.0, 1.0, 1.0, 1.0 */ + 0x02000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */ + 0x03000002, 0xd00f0000, 0xa0e40000, 0xa0e40000, /* add oD0, c0, c0 */ + 0x03000002, 0xd00f0001, 0xa0e40000, 0xa0e40000, /* add oD1, c0, c0 */ + 0x0000ffff + }; + static const DWORD vs3_code[] = + { + 0xfffe0300, /* vs_3_0 */ + 0x0200001f, 0x80000000, 0x900f0000, /* dcl_position v0 */ + 0x0200001f, 0x80000000, 0xe00f0000, /* dcl_position o0 */ + 0x0200001f, 0x8000000a, 0xe00f0001, /* dcl_color0 o1 */ + 0x0200001f, 0x8001000a, 0xe00f0002, /* dcl_color1 o2 */ + 0x05000051, 0xa00f0000, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, /* def c0, 1.0, 1.0, 1.0, 1.0 */ + 0x02000001, 0xe00f0000, 0x90e40000, /* mov o0, v0 */ + 0x03000002, 0xe00f0001, 0xa0e40000, 0xa0e40000, /* add o1, c0, c0 */ + 0x03000002, 0xe00f0002, 0xa0e40000, 0xa0e40000, /* add o2, c0, c0 */ + 0x0000ffff + }; + static const DWORD ps1_code[] = + { + 0xffff0101, /* ps_1_1 */ + 0x00000051, 0xa00f0000, 0x3e800000, 0x3e800000, 0x3e800000, 0x3e800000, /* def c0, 0.25, 0.25, 0.25, 0.25 */ + 0x00000002, 0x800f0000, 0x90e40000, 0x90e40001, /* add r0, v0, v1 */ + 0x00000005, 0x800f0000, 0x80e40000, 0xa0e40000, /* mul r0, r0, c0 */ + 0x0000ffff + }; + static const DWORD ps2_code[] = + { + 0xffff0200, /* ps_2_0 */ + 0x0200001f, 0x80000000, 0x900f0000, /* dcl v0 */ + 0x0200001f, 0x80000000, 0x900f0001, /* dcl v1 */ + 0x05000051, 0xa00f0000, 0x3e800000, 0x3e800000, 0x3e800000, 0x3e800000, /* def c0, 0.25, 0.25, 0.25, 0.25 */ + 0x02000001, 0x800f0000, 0x90e40000, /* mov r0, v0 */ + 0x03000002, 0x800f0000, 0x80e40000, 0x90e40001, /* add r0, r0, v1 */ + 0x03000005, 0x800f0000, 0x80e40000, 0xa0e40000, /* mul r0, r0, c0 */ + 0x02000001, 0x800f0800, 0x80e40000, /* mov oC0, r0 */ + 0x0000ffff + }; + static const DWORD ps3_code[] = + { + 0xffff0300, /* ps_3_0 */ + 0x0200001f, 0x8000000a, 0x900f0000, /* dcl_color0 v0 */ + 0x0200001f, 0x8001000a, 0x900f0001, /* dcl_color1 v1 */ + 0x05000051, 0xa00f0000, 0x3e800000, 0x3e800000, 0x3e800000, 0x3e800000, /* def c0, 0.25, 0.25, 0.25, 0.25 */ + 0x02000001, 0x800f0000, 0x90e40000, /* mov r0, v0 */ + 0x03000002, 0x800f0000, 0x80e40000, 0x90e40001, /* add r0, r0, v1 */ + 0x03000005, 0x800f0800, 0x80e40000, 0xa0e40000, /* mul oC0, r0, c0 */ + 0x0000ffff + }; + static const struct + { + DWORD vs_version; + const DWORD *vs; + DWORD ps_version; + const DWORD *ps; + D3DCOLOR expected, broken; + } + tests[] = + { + {0, NULL, 0, NULL, 0x00404040}, + {0, NULL, D3DPS_VERSION(1, 1), ps1_code, 0x00404040, 0x00808080}, + {D3DVS_VERSION(1, 1), vs1_code, 0, NULL, 0x00404040}, + {D3DVS_VERSION(1, 1), vs1_code, D3DPS_VERSION(1, 1), ps1_code, 0x007f7f7f}, + {D3DVS_VERSION(2, 0), vs2_code, D3DPS_VERSION(2, 0), ps2_code, 0x007f7f7f}, + {D3DVS_VERSION(3, 0), vs3_code, D3DPS_VERSION(3, 0), ps3_code, 0x00ffffff}, + }; + IDirect3DVertexShader9 *vs; + IDirect3DPixelShader9 *ps; + IDirect3DDevice9 *device; + IDirect3D9 *d3d9; + unsigned int i; + ULONG refcount; + D3DCOLOR color; + D3DCAPS9 caps; + HWND window; + HRESULT hr; + + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d9 = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d9, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d9, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + IDirect3D9_Release(d3d9); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetTransform(device, D3DTS_WORLD, &mat); + ok(SUCCEEDED(hr), "Failed to set world transform, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTransform(device, D3DTS_VIEW, &mat); + ok(SUCCEEDED(hr), "Failed to set view transform, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTransform(device, D3DTS_PROJECTION, &mat); + ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CLIPPING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable clipping, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable Z test, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable fog, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable stencil test, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CULLMODE, D3DCULL_NONE); + ok(SUCCEEDED(hr), "Failed to disable culling, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_TEXTUREFACTOR, 0xff404040); + ok(SUCCEEDED(hr), "Failed to set texture factor, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_ADD); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_DIFFUSE); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG2, D3DTA_SPECULAR); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_COLOROP, D3DTOP_MODULATE); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_COLORARG1, D3DTA_TFACTOR); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_COLORARG2, D3DTA_CURRENT); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + + for (i = 0; i < sizeof(tests) / sizeof(tests[0]); ++i) + { + if (caps.VertexShaderVersion < tests[i].vs_version + || caps.PixelShaderVersion < tests[i].ps_version) + { + skip("Vertex / pixel shader version not supported, skipping test %u.\n", i); + continue; + } + if (tests[i].vs) + { + hr = IDirect3DDevice9_CreateVertexShader(device, tests[i].vs, &vs); + ok(SUCCEEDED(hr), "Failed to create vertex shader, hr %#x (case %u).\n", hr, i); + } + else + { + vs = NULL; + } + if (tests[i].ps) + { + hr = IDirect3DDevice9_CreatePixelShader(device, tests[i].ps, &ps); + ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x (case %u).\n", hr, i); + } + else + { + ps = NULL; + } + + hr = IDirect3DDevice9_SetVertexShader(device, vs); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetPixelShader(device, ps); + ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff00ff00, 0.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(quad[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + + color = getPixelColor(device, 320, 240); + ok(color_match(color, tests[i].expected, 1) || broken(color_match(color, tests[i].broken, 1)), + "Got unexpected color 0x%08x, case %u.\n", color, i); + + if (vs) + IDirect3DVertexShader9_Release(vs); + if (ps) + IDirect3DVertexShader9_Release(ps); + } + + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D9_Release(d3d9); + DestroyWindow(window); +} + START_TEST(visual) { D3DADAPTER_IDENTIFIER9 identifier; @@ -21574,4 +21796,5 @@ test_uninitialized_varyings(); test_multisample_init(); test_texture_blending(); + test_color_clamping(); } diff -Nru wine-staging-1.9.6/dlls/d3dcompiler_43/compiler.c wine-staging-1.9.7~ubuntu15.04.1/dlls/d3dcompiler_43/compiler.c --- wine-staging-1.9.6/dlls/d3dcompiler_43/compiler.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3dcompiler_43/compiler.c 2016-04-04 18:06:32.000000000 +0000 @@ -471,8 +471,8 @@ { HRESULT hr; - TRACE("data %p, datasize %lu, filename %s, defines %p, include %p, sflags %#x,\n" - "shader %p, error_messages %p\n", + TRACE("data %p, datasize %lu, filename %s, defines %p, include %p, sflags %#x, " + "shader %p, error_messages %p.\n", data, datasize, debugstr_a(filename), defines, include, flags, shader, error_messages); EnterCriticalSection(&wpp_mutex); @@ -700,9 +700,9 @@ { HRESULT hr; - TRACE("data %p, data_size %lu, filename %s, defines %p, include %p, entrypoint %s,\n" - "target %s, sflags %#x, eflags %#x, secondary_flags %#x, secondary_data %p,\n" - "secondary_data_size %lu, shader %p, error_messages %p\n", + TRACE("data %p, data_size %lu, filename %s, defines %p, include %p, entrypoint %s, " + "target %s, sflags %#x, eflags %#x, secondary_flags %#x, secondary_data %p, " + "secondary_data_size %lu, shader %p, error_messages %p.\n", data, data_size, debugstr_a(filename), defines, include, debugstr_a(entrypoint), debugstr_a(target), sflags, eflags, secondary_flags, secondary_data, secondary_data_size, shader, error_messages); @@ -728,8 +728,8 @@ const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint, const char *target, UINT sflags, UINT eflags, ID3DBlob **shader, ID3DBlob **error_messages) { - TRACE("data %p, data_size %lu, filename %s, defines %p, include %p, entrypoint %s,\n" - "target %s, sflags %#x, eflags %#x, shader %p, error_messages %p\n", + TRACE("data %p, data_size %lu, filename %s, defines %p, include %p, entrypoint %s, " + "target %s, sflags %#x, eflags %#x, shader %p, error_messages %p.\n", data, data_size, debugstr_a(filename), defines, include, debugstr_a(entrypoint), debugstr_a(target), sflags, eflags, shader, error_messages); diff -Nru wine-staging-1.9.6/dlls/d3drm/d3drm.c wine-staging-1.9.7~ubuntu15.04.1/dlls/d3drm/d3drm.c --- wine-staging-1.9.6/dlls/d3drm/d3drm.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3drm/d3drm.c 2016-04-04 18:06:32.000000000 +0000 @@ -3,6 +3,7 @@ * * Copyright 2010, 2012 Christian Costa * Copyright 2011 André Hentschel + * Copyright 2016 Aaryaman Vasishta * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -192,9 +193,17 @@ static HRESULT WINAPI d3drm1_CreateTexture(IDirect3DRM *iface, D3DRMIMAGE *image, IDirect3DRMTexture **texture) { + struct d3drm_texture *object; + HRESULT hr; + FIXME("iface %p, image %p, texture %p partial stub.\n", iface, image, texture); - return Direct3DRMTexture_create(&IID_IDirect3DRMTexture, (IUnknown **)texture); + if (FAILED(hr = d3drm_texture_create(&object))) + return hr; + + *texture = &object->IDirect3DRMTexture_iface; + + return D3DRM_OK; } static HRESULT WINAPI d3drm1_CreateLight(IDirect3DRM *iface, @@ -402,17 +411,33 @@ static HRESULT WINAPI d3drm1_LoadTexture(IDirect3DRM *iface, const char *filename, IDirect3DRMTexture **texture) { + struct d3drm_texture *object; + HRESULT hr; + FIXME("iface %p, filename %s, texture %p stub!\n", iface, debugstr_a(filename), texture); - return Direct3DRMTexture_create(&IID_IDirect3DRMTexture, (IUnknown **)texture); + if (FAILED(hr = d3drm_texture_create(&object))) + return hr; + + *texture = &object->IDirect3DRMTexture_iface; + + return D3DRM_OK; } static HRESULT WINAPI d3drm1_LoadTextureFromResource(IDirect3DRM *iface, HRSRC resource, IDirect3DRMTexture **texture) { + struct d3drm_texture *object; + HRESULT hr; + FIXME("iface %p, resource %p, texture %p stub!\n", iface, resource, texture); - return Direct3DRMTexture_create(&IID_IDirect3DRMTexture, (IUnknown **)texture); + if (FAILED(hr = d3drm_texture_create(&object))) + return hr; + + *texture = &object->IDirect3DRMTexture_iface; + + return D3DRM_OK; } static HRESULT WINAPI d3drm1_SetSearchPath(IDirect3DRM *iface, const char *path) @@ -632,9 +657,17 @@ static HRESULT WINAPI d3drm2_CreateTexture(IDirect3DRM2 *iface, D3DRMIMAGE *image, IDirect3DRMTexture2 **texture) { + struct d3drm_texture *object; + HRESULT hr; + FIXME("iface %p, image %p, texture %p partial stub.\n", iface, image, texture); - return Direct3DRMTexture_create(&IID_IDirect3DRMTexture2, (IUnknown **)texture); + if (FAILED(hr = d3drm_texture_create(&object))) + return hr; + + *texture = &object->IDirect3DRMTexture2_iface; + + return D3DRM_OK; } static HRESULT WINAPI d3drm2_CreateLight(IDirect3DRM2 *iface, @@ -820,18 +853,34 @@ static HRESULT WINAPI d3drm2_LoadTexture(IDirect3DRM2 *iface, const char *filename, IDirect3DRMTexture2 **texture) { + struct d3drm_texture *object; + HRESULT hr; + FIXME("iface %p, filename %s, texture %p stub!\n", iface, debugstr_a(filename), texture); - return Direct3DRMTexture_create(&IID_IDirect3DRMTexture2, (IUnknown **)texture); + if (FAILED(hr = d3drm_texture_create(&object))) + return hr; + + *texture = &object->IDirect3DRMTexture2_iface; + + return D3DRM_OK; } static HRESULT WINAPI d3drm2_LoadTextureFromResource(IDirect3DRM2 *iface, HMODULE module, const char *resource_name, const char *resource_type, IDirect3DRMTexture2 **texture) { + struct d3drm_texture *object; + HRESULT hr; + FIXME("iface %p, resource_name %s, resource_type %s, texture %p stub!\n", iface, debugstr_a(resource_name), debugstr_a(resource_type), texture); - return Direct3DRMTexture_create(&IID_IDirect3DRMTexture2, (IUnknown **)texture); + if (FAILED(hr = d3drm_texture_create(&object))) + return hr; + + *texture = &object->IDirect3DRMTexture2_iface; + + return D3DRM_OK; } static HRESULT WINAPI d3drm2_SetSearchPath(IDirect3DRM2 *iface, const char *path) @@ -1057,9 +1106,17 @@ static HRESULT WINAPI d3drm3_CreateTexture(IDirect3DRM3 *iface, D3DRMIMAGE *image, IDirect3DRMTexture3 **texture) { + struct d3drm_texture *object; + HRESULT hr; + FIXME("iface %p, image %p, texture %p partial stub.\n", iface, image, texture); - return Direct3DRMTexture_create(&IID_IDirect3DRMTexture3, (IUnknown **)texture); + if (FAILED(hr = d3drm_texture_create(&object))) + return hr; + + *texture = &object->IDirect3DRMTexture3_iface; + + return D3DRM_OK; } static HRESULT WINAPI d3drm3_CreateLight(IDirect3DRM3 *iface, @@ -1295,18 +1352,34 @@ static HRESULT WINAPI d3drm3_LoadTexture(IDirect3DRM3 *iface, const char *filename, IDirect3DRMTexture3 **texture) { + struct d3drm_texture *object; + HRESULT hr; + FIXME("iface %p, filename %s, texture %p stub!\n", iface, debugstr_a(filename), texture); - return Direct3DRMTexture_create(&IID_IDirect3DRMTexture3, (IUnknown **)texture); + if (FAILED(hr = d3drm_texture_create(&object))) + return hr; + + *texture = &object->IDirect3DRMTexture3_iface; + + return D3DRM_OK; } static HRESULT WINAPI d3drm3_LoadTextureFromResource(IDirect3DRM3 *iface, HMODULE module, const char *resource_name, const char *resource_type, IDirect3DRMTexture3 **texture) { + struct d3drm_texture *object; + HRESULT hr; + FIXME("iface %p, module %p, resource_name %s, resource_type %s, texture %p stub!\n", iface, module, debugstr_a(resource_name), debugstr_a(resource_type), texture); - return Direct3DRMTexture_create(&IID_IDirect3DRMTexture3, (IUnknown **)texture); + if (FAILED(hr = d3drm_texture_create(&object))) + return hr; + + *texture = &object->IDirect3DRMTexture3_iface; + + return D3DRM_OK; } static HRESULT WINAPI d3drm3_SetSearchPath(IDirect3DRM3 *iface, const char *path) diff -Nru wine-staging-1.9.6/dlls/d3drm/d3drm_private.h wine-staging-1.9.7~ubuntu15.04.1/dlls/d3drm/d3drm_private.h --- wine-staging-1.9.6/dlls/d3drm/d3drm_private.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3drm/d3drm_private.h 2016-04-04 18:06:32.000000000 +0000 @@ -34,12 +34,22 @@ struct list destroy_callbacks; }; +struct d3drm_texture +{ + IDirect3DRMTexture IDirect3DRMTexture_iface; + IDirect3DRMTexture2 IDirect3DRMTexture2_iface; + IDirect3DRMTexture3 IDirect3DRMTexture3_iface; + LONG ref; + DWORD app_data; +}; + void d3drm_object_init(struct d3drm_object *object) DECLSPEC_HIDDEN; HRESULT d3drm_object_add_destroy_callback(struct d3drm_object *object, D3DRMOBJECTCALLBACK cb, void *ctx) DECLSPEC_HIDDEN; HRESULT d3drm_object_delete_destroy_callback(struct d3drm_object *object, D3DRMOBJECTCALLBACK cb, void *ctx) DECLSPEC_HIDDEN; void d3drm_object_cleanup(IDirect3DRMObject *iface, struct d3drm_object *object) DECLSPEC_HIDDEN; HRESULT d3drm_device_create(struct d3drm_device **out) DECLSPEC_HIDDEN; +HRESULT d3drm_texture_create(struct d3drm_texture **texture) DECLSPEC_HIDDEN; IDirect3DRMDevice *IDirect3DRMDevice_from_impl(struct d3drm_device *device) DECLSPEC_HIDDEN; IDirect3DRMDevice2 *IDirect3DRMDevice2_from_impl(struct d3drm_device *device) DECLSPEC_HIDDEN; IDirect3DRMDevice3 *IDirect3DRMDevice3_from_impl(struct d3drm_device *device) DECLSPEC_HIDDEN; @@ -50,7 +60,6 @@ HRESULT Direct3DRMMeshBuilder_create(REFIID riid, IUnknown** ppObj) DECLSPEC_HIDDEN; HRESULT Direct3DRMViewport_create(REFIID riid, IUnknown** ppObj) DECLSPEC_HIDDEN; HRESULT Direct3DRMMaterial_create(IDirect3DRMMaterial2** ret_iface) DECLSPEC_HIDDEN; -HRESULT Direct3DRMTexture_create(REFIID riid, IUnknown** ret_iface) DECLSPEC_HIDDEN; HRESULT load_mesh_data(IDirect3DRMMeshBuilder3 *iface, IDirectXFileData *data, D3DRMLOADTEXTURECALLBACK load_texture_proc, void *arg) DECLSPEC_HIDDEN; diff -Nru wine-staging-1.9.6/dlls/d3drm/meshbuilder.c wine-staging-1.9.7~ubuntu15.04.1/dlls/d3drm/meshbuilder.c --- wine-staging-1.9.6/dlls/d3drm/meshbuilder.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3drm/meshbuilder.c 2016-04-04 18:06:32.000000000 +0000 @@ -1162,6 +1162,7 @@ IDirectXFileObject *child; DWORD i = 0; float* values; + struct d3drm_texture *texture_object; TRACE("Process MeshMaterialList\n"); @@ -1299,13 +1300,12 @@ if (file != INVALID_HANDLE_VALUE) { CloseHandle(file); - - hr = Direct3DRMTexture_create(&IID_IDirect3DRMTexture3, (IUnknown**)&This->materials[i].texture); - if (FAILED(hr)) + if (FAILED(hr = d3drm_texture_create(&texture_object))) { IDirectXFileData_Release(data); goto end; } + This->materials[i].texture = &texture_object->IDirect3DRMTexture3_iface; } } } diff -Nru wine-staging-1.9.6/dlls/d3drm/tests/d3drm.c wine-staging-1.9.7~ubuntu15.04.1/dlls/d3drm/tests/d3drm.c --- wine-staging-1.9.6/dlls/d3drm/tests/d3drm.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3drm/tests/d3drm.c 2016-04-04 18:06:32.000000000 +0000 @@ -994,6 +994,8 @@ ok(hr == D3DRM_OK, "Cannot get parent frame (hr = %x)\n", hr); ok(pFrameTmp == pFrameP1, "pFrameTmp = %p\n", pFrameTmp); CHECK_REFCOUNT(pFrameP1, 2); + IDirect3DRMFrame_Release(pFrameTmp); + CHECK_REFCOUNT(pFrameP1, 1); /* Add child to second parent */ hr = IDirect3DRM_CreateFrame(d3drm, NULL, &pFrameP2); @@ -1037,6 +1039,8 @@ ok(pFrameTmp == pFrameP2, "pFrameTmp = %p\n", pFrameTmp); CHECK_REFCOUNT(pFrameP2, 2); CHECK_REFCOUNT(pFrameC, 2); + IDirect3DRMFrame_Release(pFrameTmp); + CHECK_REFCOUNT(pFrameP2, 1); /* Add child again */ hr = IDirect3DRMFrame_AddChild(pFrameP2, pFrameC); @@ -1088,7 +1092,7 @@ hr = IDirect3DRMFrame_AddChild(pFrameP2, pFrameP1); ok(hr == D3DRM_OK, "Cannot add child frame (hr = %x)\n", hr); - CHECK_REFCOUNT(pFrameP1, 3); + CHECK_REFCOUNT(pFrameP1, 2); frame_array = NULL; hr = IDirect3DRMFrame_GetChildren(pFrameP2, &frame_array); @@ -1111,11 +1115,11 @@ /* [Add/Delete]Visual with NULL pointer */ hr = IDirect3DRMFrame_AddVisual(pFrameP1, NULL); ok(hr == D3DRMERR_BADOBJECT, "Should have returned D3DRMERR_BADOBJECT (hr = %x)\n", hr); - CHECK_REFCOUNT(pFrameP1, 3); + CHECK_REFCOUNT(pFrameP1, 2); hr = IDirect3DRMFrame_DeleteVisual(pFrameP1, NULL); ok(hr == D3DRMERR_BADOBJECT, "Should have returned D3DRMERR_BADOBJECT (hr = %x)\n", hr); - CHECK_REFCOUNT(pFrameP1, 3); + CHECK_REFCOUNT(pFrameP1, 2); /* Create Visual */ hr = IDirect3DRM_CreateMeshBuilder(d3drm, &mesh_builder); @@ -1125,7 +1129,7 @@ /* Add Visual to first parent */ hr = IDirect3DRMFrame_AddVisual(pFrameP1, visual1); ok(hr == D3DRM_OK, "Cannot add visual (hr = %x)\n", hr); - CHECK_REFCOUNT(pFrameP1, 3); + CHECK_REFCOUNT(pFrameP1, 2); CHECK_REFCOUNT(visual1, 2); visual_array = NULL; @@ -1145,17 +1149,17 @@ /* Delete Visual */ hr = IDirect3DRMFrame_DeleteVisual(pFrameP1, visual1); ok(hr == D3DRM_OK, "Cannot delete visual (hr = %x)\n", hr); - CHECK_REFCOUNT(pFrameP1, 3); + CHECK_REFCOUNT(pFrameP1, 2); IDirect3DRMMeshBuilder_Release(mesh_builder); /* [Add/Delete]Light with NULL pointer */ hr = IDirect3DRMFrame_AddLight(pFrameP1, NULL); ok(hr == D3DRMERR_BADOBJECT, "Should have returned D3DRMERR_BADOBJECT (hr = %x)\n", hr); - CHECK_REFCOUNT(pFrameP1, 3); + CHECK_REFCOUNT(pFrameP1, 2); hr = IDirect3DRMFrame_DeleteLight(pFrameP1, NULL); ok(hr == D3DRMERR_BADOBJECT, "Should have returned D3DRMERR_BADOBJECT (hr = %x)\n", hr); - CHECK_REFCOUNT(pFrameP1, 3); + CHECK_REFCOUNT(pFrameP1, 2); /* Create Light */ hr = IDirect3DRM_CreateLightRGB(d3drm, D3DRMLIGHT_SPOT, 0.1, 0.2, 0.3, &light1); @@ -1164,7 +1168,7 @@ /* Add Light to first parent */ hr = IDirect3DRMFrame_AddLight(pFrameP1, light1); ok(hr == D3DRM_OK, "Cannot add light (hr = %x)\n", hr); - CHECK_REFCOUNT(pFrameP1, 3); + CHECK_REFCOUNT(pFrameP1, 2); CHECK_REFCOUNT(light1, 2); light_array = NULL; @@ -1184,7 +1188,7 @@ /* Delete Light */ hr = IDirect3DRMFrame_DeleteLight(pFrameP1, light1); ok(hr == D3DRM_OK, "Cannot delete light (hr = %x)\n", hr); - CHECK_REFCOUNT(pFrameP1, 3); + CHECK_REFCOUNT(pFrameP1, 2); IDirect3DRMLight_Release(light1); /* Test SceneBackground on first parent */ @@ -1203,8 +1207,8 @@ /* Cleanup */ IDirect3DRMFrame_Release(pFrameP2); - CHECK_REFCOUNT(pFrameC, 2); - CHECK_REFCOUNT(pFrameP1, 3); + CHECK_REFCOUNT(pFrameC, 1); + CHECK_REFCOUNT(pFrameP1, 1); IDirect3DRMFrame_Release(pFrameC); IDirect3DRMFrame_Release(pFrameP1); @@ -1372,6 +1376,9 @@ ok(hr == D3DRM_OK, "expected D3DRM_OK (hr = %x)\n", hr); context.called = 0; + hr = IDirect3DRMViewport_QueryInterface(viewport, &IID_IDirect3DRMObject, (void**)&context.obj); + ok(hr == D3DRM_OK, "expected D3DRM_OK (hr = %x)\n", hr); + IDirect3DRMObject_Release(context.obj); IDirect3DRMViewport_Release(viewport); ok(context.called == 2, "got %d, expected 2\n", context.called); @@ -1436,6 +1443,9 @@ ok(hr == D3DRM_OK, "expected D3DRM_OK (hr = %x)\n", hr); context.called = 0; + hr = IDirect3DRMViewport2_QueryInterface(viewport2, &IID_IDirect3DRMObject, (void**)&context.obj); + ok(hr == D3DRM_OK, "expected D3DRM_OK (hr = %x)\n", hr); + IDirect3DRMObject_Release(context.obj); IDirect3DRMViewport2_Release(viewport2); ok(context.called == 2, "got %d, expected 2\n", context.called); diff -Nru wine-staging-1.9.6/dlls/d3drm/texture.c wine-staging-1.9.7~ubuntu15.04.1/dlls/d3drm/texture.c --- wine-staging-1.9.6/dlls/d3drm/texture.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3drm/texture.c 2016-04-04 18:06:32.000000000 +0000 @@ -29,15 +29,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3drm); -struct d3drm_texture -{ - IDirect3DRMTexture IDirect3DRMTexture_iface; - IDirect3DRMTexture2 IDirect3DRMTexture2_iface; - IDirect3DRMTexture3 IDirect3DRMTexture3_iface; - LONG ref; - DWORD app_data; -}; - static inline struct d3drm_texture *impl_from_IDirect3DRMTexture(IDirect3DRMTexture *iface) { return CONTAINING_RECORD(iface, struct d3drm_texture, IDirect3DRMTexture_iface); @@ -1038,12 +1029,11 @@ d3drm_texture3_SetValidationCallback, }; -HRESULT Direct3DRMTexture_create(REFIID riid, IUnknown **out) +HRESULT d3drm_texture_create(struct d3drm_texture **texture) { struct d3drm_texture *object; - HRESULT hr; - TRACE("riid %s, out %p.\n", debugstr_guid(riid), out); + TRACE("texture %p.\n", texture); if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) return E_OUTOFMEMORY; @@ -1053,8 +1043,7 @@ object->IDirect3DRMTexture3_iface.lpVtbl = &d3drm_texture3_vtbl; object->ref = 1; - hr = IDirect3DRMTexture3_QueryInterface(&object->IDirect3DRMTexture3_iface, riid, (void **)out); - IDirect3DRMTexture3_Release(&object->IDirect3DRMTexture3_iface); + *texture = object; - return hr; + return D3DRM_OK; } diff -Nru wine-staging-1.9.6/dlls/d3dx9_36/d3dx9_private.h wine-staging-1.9.7~ubuntu15.04.1/dlls/d3dx9_36/d3dx9_private.h --- wine-staging-1.9.6/dlls/d3dx9_36/d3dx9_private.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3dx9_36/d3dx9_private.h 2016-04-04 18:06:32.000000000 +0000 @@ -108,4 +108,40 @@ void set_number(void *outdata, D3DXPARAMETER_TYPE outtype, const void *indata, D3DXPARAMETER_TYPE intype) DECLSPEC_HIDDEN; +struct d3dx_param_eval; + +struct d3dx_parameter +{ + char *name; + char *semantic; + void *data; + D3DXPARAMETER_CLASS class; + D3DXPARAMETER_TYPE type; + UINT rows; + UINT columns; + UINT element_count; + UINT annotation_count; + UINT member_count; + DWORD flags; + UINT bytes; + DWORD object_id; + + D3DXHANDLE handle; + + struct d3dx_parameter *annotations; + struct d3dx_parameter *members; + + struct d3dx_parameter *referenced_param; + struct d3dx_param_eval *param_eval; +}; + +struct d3dx9_base_effect; + +struct d3dx_parameter *get_parameter_by_name(struct d3dx9_base_effect *base, + struct d3dx_parameter *parameter, const char *name) DECLSPEC_HIDDEN; + +HRESULT d3dx_create_param_eval(struct d3dx9_base_effect *base_effect, void *byte_code, + unsigned int byte_code_size, D3DXPARAMETER_TYPE type, struct d3dx_param_eval **peval) DECLSPEC_HIDDEN; +void d3dx_free_param_eval(struct d3dx_param_eval *peval) DECLSPEC_HIDDEN; + #endif /* __WINE_D3DX9_PRIVATE_H */ diff -Nru wine-staging-1.9.6/dlls/d3dx9_36/effect.c wine-staging-1.9.7~ubuntu15.04.1/dlls/d3dx9_36/effect.c --- wine-staging-1.9.6/dlls/d3dx9_36/effect.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3dx9_36/effect.c 2016-04-04 18:06:32.000000000 +0000 @@ -94,30 +94,6 @@ ST_ARRAY_SELECTOR, }; -struct d3dx_parameter -{ - char *name; - char *semantic; - void *data; - D3DXPARAMETER_CLASS class; - D3DXPARAMETER_TYPE type; - UINT rows; - UINT columns; - UINT element_count; - UINT annotation_count; - UINT member_count; - DWORD flags; - UINT bytes; - DWORD object_id; - - D3DXHANDLE handle; - - struct d3dx_parameter *annotations; - struct d3dx_parameter *members; - - struct d3dx_parameter *referenced_param; -}; - struct d3dx_object { UINT size; @@ -206,8 +182,6 @@ struct d3dx9_base_effect base_effect; }; -static struct d3dx_parameter *get_parameter_by_name(struct d3dx9_base_effect *base, - struct d3dx_parameter *parameter, const char *name); static struct d3dx_parameter *get_annotation_by_name(UINT count, struct d3dx_parameter *parameters, const char *name); static HRESULT d3dx9_parse_state(struct d3dx9_base_effect *base, struct d3dx_state *state, @@ -535,6 +509,12 @@ TRACE("Free parameter %p, name %s, type %s, child %s\n", param, param->name, debug_d3dxparameter_type(param->type), child ? "yes" : "no"); + if (param->param_eval) + { + d3dx_free_param_eval(param->param_eval); + param->param_eval = NULL; + } + if (param->annotations) { for (i = 0; i < param->annotation_count; ++i) @@ -886,7 +866,7 @@ return NULL; } -static struct d3dx_parameter *get_parameter_by_name(struct d3dx9_base_effect *base, +struct d3dx_parameter *get_parameter_by_name(struct d3dx9_base_effect *base, struct d3dx_parameter *parameter, const char *name) { UINT i, count, length; @@ -2645,7 +2625,7 @@ } } -HRESULT d3dx_set_shader_const_state(IDirect3DDevice9 *device, enum SHADER_CONSTANT_TYPE op, UINT index, +static HRESULT d3dx_set_shader_const_state(IDirect3DDevice9 *device, enum SHADER_CONSTANT_TYPE op, UINT index, struct d3dx_parameter *param, void *value_ptr) { static const struct @@ -5419,6 +5399,7 @@ DWORD string_size; struct d3dx_object *object = &base->objects[param->object_id]; char *ptr = object->data; + HRESULT ret; TRACE("Parsing array entry selection state for parameter %p.\n", param); @@ -5435,9 +5416,32 @@ } TRACE("Unknown DWORD: 0x%.8x.\n", *(DWORD *)(ptr + string_size)); - FIXME("Parse preshader.\n"); + if (string_size % sizeof(DWORD)) + FIXME("Unaligned string_size %u.\n", string_size); + d3dx_create_param_eval(base, (DWORD *)(ptr + string_size) + 1, object->size - (string_size + sizeof(DWORD)), + D3DXPT_INT, ¶m->param_eval); + ret = D3D_OK; + param = param->referenced_param; + if (param->type == D3DXPT_VERTEXSHADER || param->type == D3DXPT_PIXELSHADER) + { + unsigned int i; - return D3D_OK; + for (i = 0; i < param->element_count; i++) + { + if (param->members[i].type != param->type) + { + FIXME("Unexpected member parameter type %u, expected %u.\n", param->members[i].type, param->type); + return D3DXERR_INVALIDDATA; + } + if (!param->members[i].param_eval) + { + TRACE("Creating preshader for object %u.\n", param->members[i].object_id); + object = &base->objects[param->members[i].object_id]; + d3dx_create_param_eval(base, object->data, object->size, param->type, ¶m->members[i].param_eval); + } + } + } + return ret; } static HRESULT d3dx9_parse_resource(struct d3dx9_base_effect *base, const char *data, const char **ptr) @@ -5543,7 +5547,11 @@ return hr; if (object->data) - hr = d3dx9_create_object(base, object); + { + if (FAILED(hr = d3dx9_create_object(base, object))) + return hr; + d3dx_create_param_eval(base, object->data, object->size, param->type, ¶m->param_eval); + } break; case D3DXPT_BOOL: @@ -5551,7 +5559,9 @@ case D3DXPT_FLOAT: case D3DXPT_STRING: state->type = ST_FXLC; - hr = d3dx9_copy_data(&base->objects[param->object_id], ptr); + if (FAILED(hr = d3dx9_copy_data(&base->objects[param->object_id], ptr))) + return hr; + d3dx_create_param_eval(base, object->data, object->size, param->type, ¶m->param_eval); break; default: @@ -5569,7 +5579,17 @@ param->referenced_param = get_parameter_by_name(base, NULL, object->data); if (param->referenced_param) { - TRACE("Mapping to parameter %p.\n", param->referenced_param); + struct d3dx_parameter *refpar = param->referenced_param; + + TRACE("Mapping to parameter %p, having object id %u.\n", refpar, refpar->object_id); + if (refpar->type == D3DXPT_VERTEXSHADER || refpar->type == D3DXPT_PIXELSHADER) + { + struct d3dx_object *refobj = &base->objects[refpar->object_id]; + + if (!refpar->param_eval) + d3dx_create_param_eval(base, refobj->data, refobj->size, + refpar->type, &refpar->param_eval); + } } else { diff -Nru wine-staging-1.9.6/dlls/d3dx9_36/Makefile.in wine-staging-1.9.7~ubuntu15.04.1/dlls/d3dx9_36/Makefile.in --- wine-staging-1.9.6/dlls/d3dx9_36/Makefile.in 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3dx9_36/Makefile.in 2016-04-04 18:06:32.000000000 +0000 @@ -11,6 +11,7 @@ line.c \ math.c \ mesh.c \ + preshader.c \ render.c \ shader.c \ skin.c \ diff -Nru wine-staging-1.9.6/dlls/d3dx9_36/preshader.c wine-staging-1.9.7~ubuntu15.04.1/dlls/d3dx9_36/preshader.c --- wine-staging-1.9.6/dlls/d3dx9_36/preshader.c 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3dx9_36/preshader.c 2016-04-04 18:06:32.000000000 +0000 @@ -0,0 +1,41 @@ +/* + * Copyright 2016 Paul Gofman + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" +#include "wine/port.h" + +#include "d3dx9_private.h" + +#include + +WINE_DEFAULT_DEBUG_CHANNEL(d3dx); + +HRESULT d3dx_create_param_eval(struct d3dx9_base_effect *base_effect, void *byte_code, unsigned int byte_code_size, + D3DXPARAMETER_TYPE type, struct d3dx_param_eval **peval_out) +{ + FIXME("stub, base_effect %p, byte_code %p, byte_code_size %u, type %u, peval_out %p.\n", + base_effect, byte_code, byte_code_size, type, peval_out); + + *peval_out = NULL; + return E_NOTIMPL; +} + +void d3dx_free_param_eval(struct d3dx_param_eval *peval) +{ + FIXME("stub, peval %p.\n", peval); +} diff -Nru wine-staging-1.9.6/dlls/d3dx9_36/tests/effect.c wine-staging-1.9.7~ubuntu15.04.1/dlls/d3dx9_36/tests/effect.c --- wine-staging-1.9.6/dlls/d3dx9_36/tests/effect.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3dx9_36/tests/effect.c 2016-04-04 18:06:32.000000000 +0000 @@ -22,6 +22,8 @@ #include "wine/test.h" #include "d3dx9.h" +#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(*arr)) + /* helper functions */ static BOOL compare_float(FLOAT f, FLOAT g, UINT ulps) { @@ -3008,6 +3010,882 @@ ok(value == 3, "Got result %u, expected %u.\n", value, 1); } +/* + * fxc.exe /Tfx_2_0 + */ +#if 0 +float4 g_Pos1; +float4 g_Pos2; +float4 g_Selector[2] = {{0, 0, 0, 0}, {10, 10, 10, 10}}; + +float4 opvect1 = {0.0, -0.0, -2.2, 3.402823466e+38F}; +float4 opvect2 = {1.0, 2.0, -3.0, 4.0}; +float4 opvect3 = {0.0, -0.0, -2.2, 3.402823466e+38F}; + +int4 g_iVect = {4, 3, 2, 1}; + +vertexshader vs_arr[3] = +{ + asm + { + vs_1_0 + def c0, 1, 1, 1, 1 + mov oPos, c0 + }, + asm + { + vs_1_1 + def c0, 2, 2, 2, 2 + mov oPos, c0 + }, + asm + { + vs_2_0 + def c0, 3, 3, 3, 3 + mov oPos, c0 + } +}; + +row_major float4x3 m4x3row = {{11, 12, 13}, {21, 22, 23}, {31, 32, 33}, {41, 42, 43}}; +row_major float3x4 m3x4row = {{11, 12, 13, 14}, {21, 22, 23, 24}, {31, 32, 33, 34}}; +column_major float4x3 m4x3column = {{11, 12, 13},{21, 22, 23},{31, 32, 33},{41, 42, 43}}; +column_major float3x4 m3x4column = {{11, 12, 13, 14}, {21, 22, 23, 24}, {31, 32, 33, 34}}; +row_major float2x2 m2x2row = {{11, 12}, {21, 22}}; +column_major float2x2 m2x2column = {{11, 12}, {21, 22}}; +row_major float2x3 m2x3row = {{11, 12, 13}, {21, 22, 23}}; +column_major float2x3 m2x3column = {{11, 12, 13}, {21, 22, 23}}; +row_major float3x2 m3x2row = {{11, 12}, {21, 22}, {31, 32}}; +column_major float3x2 m3x2column = {{11, 12}, {21, 22}, {31, 32}}; + +row_major bool2x3 mb2x3row = {{true, false, true}, {false, true, true}}; +column_major bool2x3 mb2x3column = {{true, false, true}, {false, true, true}}; + +struct test_struct +{ + float3 v1; + float fv; + float4 v2; +}; + +test_struct ts1[1] = {{{9, 10, 11}, 12, {13, 14, 15, 16}}}; +test_struct ts2[2] = {{{0, 0, 0}, 0, {0, 0, 0, 0}}, {{1, 2, 3}, 4, {5, 6, 7, 8}}}; + +float arr1[1] = {91}; +float arr2[2] = {92, 93}; + +struct VS_OUTPUT +{ + float4 Position : POSITION; + float2 TextureUV : TEXCOORD0; + float4 Diffuse : COLOR0; +}; +VS_OUTPUT RenderSceneVS(float4 vPos : POSITION, + float3 vNormal : NORMAL, + float2 vTexCoord0 : TEXCOORD0, + uniform int nNumLights, + uniform bool bTexture) +{ + VS_OUTPUT Output; + + if (g_Selector[1].y > float4(0.5, 0.5, 0.5, 0.5).y) + Output.Position = -g_Pos1 * 2 - float4(-4, -5, -6, -7); + else + Output.Position = -g_Pos2 * 3 - float4(-4, -5, -6, -7); + Output.TextureUV = float2(0, 0); + Output.Diffuse = 0; + Output.Diffuse.xyz = mul(vPos, m4x3column); + Output.Diffuse += mul(vPos, m3x4column); + Output.Diffuse += mul(vPos, m3x4row); + Output.Diffuse.xyz += mul(vPos, m4x3row); + Output.Diffuse += mul(vPos, ts1[0].fv); + Output.Diffuse += mul(vPos, ts1[0].v2); + Output.Diffuse += mul(vPos, ts2[1].fv); + Output.Diffuse += mul(vPos, ts2[1].v2); + Output.Diffuse += mul(vPos, arr1[0]); + Output.Diffuse += mul(vPos, arr2[1]); + return Output; +} + +struct PS_OUTPUT +{ + float4 RGBColor : COLOR0; /* Pixel color */ +}; +PS_OUTPUT RenderScenePS( VS_OUTPUT In, uniform bool2x3 mb) +{ + PS_OUTPUT Output; + + Output.RGBColor = In.Diffuse; + Output.RGBColor.xy += mul(In.Diffuse, m2x2row); + Output.RGBColor.xy += mul(In.Diffuse, m2x2column); + Output.RGBColor.xy += mul(In.Diffuse, m3x2row); + Output.RGBColor.xy += mul(In.Diffuse, m3x2column); + Output.RGBColor.xyz += mul(In.Diffuse, m2x3row); + Output.RGBColor.xyz += mul(In.Diffuse, m2x3column); + if (mb[1][1]) + { + Output.RGBColor += sin(Output.RGBColor); + Output.RGBColor += cos(Output.RGBColor); + Output.RGBColor.xyz += mul(Output.RGBColor, m2x3column); + Output.RGBColor.xyz += mul(Output.RGBColor, m2x3row); + Output.RGBColor.xy += mul(Output.RGBColor, m3x2column); + Output.RGBColor.xy += mul(Output.RGBColor, m3x2row); + } + return Output; +} + +technique tech0 +{ + pass p0 + { + VertexShader = compile vs_3_0 RenderSceneVS(1, true); + PixelShader = compile ps_3_0 RenderScenePS(mb2x3row); + + LightEnable[0] = TRUE; + LightEnable[1] = TRUE; + LightEnable[2] = TRUE; + LightEnable[3] = TRUE; + LightEnable[4] = TRUE; + LightEnable[5] = TRUE; + LightEnable[6] = TRUE; + LightEnable[7] = TRUE; + LightType[0] = POINT; + LightType[1] = POINT; + LightType[2] = POINT; + LightType[3] = POINT; + LightType[4] = POINT; + LightType[5] = POINT; + LightType[6] = POINT; + LightType[7] = POINT; + LightDiffuse[0] = 1 / opvect1; + LightDiffuse[1] = rsqrt(opvect1); + LightDiffuse[2] = opvect1 * opvect2; + LightDiffuse[3] = opvect1 + opvect2; + LightDiffuse[4] = float4(opvect1 < opvect2); + LightDiffuse[5] = float4(opvect1 >= opvect2); + LightDiffuse[6] = -opvect1; + LightDiffuse[7] = rcp(opvect1); + + LightAmbient[0] = frac(opvect1); + LightAmbient[1] = min(opvect1, opvect2); + LightAmbient[2] = max(opvect1, opvect2); + LightAmbient[3] = sin(opvect1); + LightAmbient[4] = cos(opvect1); + LightAmbient[5] = 1e-2 / opvect1; + LightAmbient[6] = float4(0, dot(opvect1, opvect2), dot(opvect2, opvect2), 0); + LightAmbient[7] = opvect1 + 1e-12 * opvect2 - opvect3; + } + pass p1 + { + VertexShader = vs_arr[g_iVect.z]; + } +} +#endif +static const DWORD test_effect_preshader_effect_blob[] = +{ + 0xfeff0901, 0x00000c30, 0x00000000, 0x00000003, 0x00000001, 0x00000030, 0x00000000, 0x00000000, + 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x6f505f67, + 0x00003173, 0x00000003, 0x00000001, 0x00000068, 0x00000000, 0x00000000, 0x00000004, 0x00000001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000007, 0x6f505f67, 0x00003273, 0x00000003, + 0x00000001, 0x000000b0, 0x00000000, 0x00000002, 0x00000004, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x41200000, 0x41200000, 0x41200000, 0x41200000, 0x0000000b, 0x65535f67, + 0x7463656c, 0x0000726f, 0x00000003, 0x00000001, 0x000000ec, 0x00000000, 0x00000000, 0x00000004, + 0x00000001, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x00000008, 0x6576706f, 0x00317463, + 0x00000003, 0x00000001, 0x00000124, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x3f800000, + 0x40000000, 0xc0400000, 0x40800000, 0x00000008, 0x6576706f, 0x00327463, 0x00000003, 0x00000001, + 0x0000015c, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x80000000, 0xc00ccccd, + 0x7f7fffff, 0x00000008, 0x6576706f, 0x00337463, 0x00000002, 0x00000001, 0x00000194, 0x00000000, + 0x00000000, 0x00000004, 0x00000001, 0x00000004, 0x00000003, 0x00000002, 0x00000001, 0x00000008, + 0x56695f67, 0x00746365, 0x00000010, 0x00000004, 0x000001c0, 0x00000000, 0x00000003, 0x00000001, + 0x00000002, 0x00000003, 0x00000007, 0x615f7376, 0x00007272, 0x00000003, 0x00000002, 0x00000218, + 0x00000000, 0x00000000, 0x00000004, 0x00000003, 0x41300000, 0x41400000, 0x41500000, 0x41a80000, + 0x41b00000, 0x41b80000, 0x41f80000, 0x42000000, 0x42040000, 0x42240000, 0x42280000, 0x422c0000, + 0x00000008, 0x3378346d, 0x00776f72, 0x00000003, 0x00000002, 0x00000270, 0x00000000, 0x00000000, + 0x00000003, 0x00000004, 0x41300000, 0x41400000, 0x41500000, 0x41600000, 0x41a80000, 0x41b00000, + 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000, 0x42080000, 0x00000008, 0x3478336d, + 0x00776f72, 0x00000003, 0x00000002, 0x000002c8, 0x00000000, 0x00000000, 0x00000004, 0x00000003, + 0x41300000, 0x41400000, 0x41500000, 0x41a80000, 0x41b00000, 0x41b80000, 0x41f80000, 0x42000000, + 0x42040000, 0x42240000, 0x42280000, 0x422c0000, 0x0000000b, 0x3378346d, 0x756c6f63, 0x00006e6d, + 0x00000003, 0x00000002, 0x00000324, 0x00000000, 0x00000000, 0x00000003, 0x00000004, 0x41300000, + 0x41400000, 0x41500000, 0x41600000, 0x41a80000, 0x41b00000, 0x41b80000, 0x41c00000, 0x41f80000, + 0x42000000, 0x42040000, 0x42080000, 0x0000000b, 0x3478336d, 0x756c6f63, 0x00006e6d, 0x00000003, + 0x00000002, 0x00000360, 0x00000000, 0x00000000, 0x00000002, 0x00000002, 0x41300000, 0x41400000, + 0x41a80000, 0x41b00000, 0x00000008, 0x3278326d, 0x00776f72, 0x00000003, 0x00000002, 0x00000398, + 0x00000000, 0x00000000, 0x00000002, 0x00000002, 0x41300000, 0x41400000, 0x41a80000, 0x41b00000, + 0x0000000b, 0x3278326d, 0x756c6f63, 0x00006e6d, 0x00000003, 0x00000002, 0x000003dc, 0x00000000, + 0x00000000, 0x00000002, 0x00000003, 0x41300000, 0x41400000, 0x41500000, 0x41a80000, 0x41b00000, + 0x41b80000, 0x00000008, 0x3378326d, 0x00776f72, 0x00000003, 0x00000002, 0x0000041c, 0x00000000, + 0x00000000, 0x00000002, 0x00000003, 0x41300000, 0x41400000, 0x41500000, 0x41a80000, 0x41b00000, + 0x41b80000, 0x0000000b, 0x3378326d, 0x756c6f63, 0x00006e6d, 0x00000003, 0x00000002, 0x00000460, + 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x41300000, 0x41400000, 0x41a80000, 0x41b00000, + 0x41f80000, 0x42000000, 0x00000008, 0x3278336d, 0x00776f72, 0x00000003, 0x00000002, 0x000004a0, + 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x41300000, 0x41400000, 0x41a80000, 0x41b00000, + 0x41f80000, 0x42000000, 0x0000000b, 0x3278336d, 0x756c6f63, 0x00006e6d, 0x00000001, 0x00000002, + 0x000004e4, 0x00000000, 0x00000000, 0x00000002, 0x00000003, 0x00000001, 0x00000000, 0x00000001, + 0x00000000, 0x00000001, 0x00000001, 0x00000009, 0x7832626d, 0x776f7233, 0x00000000, 0x00000001, + 0x00000002, 0x00000528, 0x00000000, 0x00000000, 0x00000002, 0x00000003, 0x00000001, 0x00000000, + 0x00000001, 0x00000000, 0x00000001, 0x00000001, 0x0000000c, 0x7832626d, 0x6c6f6333, 0x006e6d75, + 0x00000000, 0x00000005, 0x000005c4, 0x00000000, 0x00000001, 0x00000003, 0x00000003, 0x00000001, + 0x000005cc, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000003, 0x00000000, 0x000005d4, + 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000003, 0x00000001, 0x000005dc, 0x00000000, + 0x00000000, 0x00000004, 0x00000001, 0x41100000, 0x41200000, 0x41300000, 0x41400000, 0x41500000, + 0x41600000, 0x41700000, 0x41800000, 0x00000004, 0x00317374, 0x00000003, 0x00003176, 0x00000003, + 0x00007666, 0x00000003, 0x00003276, 0x00000000, 0x00000005, 0x00000690, 0x00000000, 0x00000002, + 0x00000003, 0x00000003, 0x00000001, 0x00000698, 0x00000000, 0x00000000, 0x00000003, 0x00000001, + 0x00000003, 0x00000000, 0x000006a0, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000003, + 0x00000001, 0x000006a8, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x40000000, + 0x40400000, 0x40800000, 0x40a00000, 0x40c00000, 0x40e00000, 0x41000000, 0x00000004, 0x00327374, + 0x00000003, 0x00003176, 0x00000003, 0x00007666, 0x00000003, 0x00003276, 0x00000003, 0x00000000, + 0x000006d0, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x42b60000, 0x00000005, 0x31727261, + 0x00000000, 0x00000003, 0x00000000, 0x00000700, 0x00000000, 0x00000002, 0x00000001, 0x00000001, + 0x42b80000, 0x42ba0000, 0x00000005, 0x32727261, 0x00000000, 0x00000004, 0x00000010, 0x00000004, + 0x00000000, 0x00000000, 0x00000000, 0x00000005, 0x0000000f, 0x00000004, 0x00000000, 0x00000000, + 0x00000000, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, + 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, + 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, + 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, + 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, + 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, + 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, + 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, + 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, + 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, + 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, + 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, + 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, + 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, + 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, + 0x00000001, 0x00000001, 0x00000002, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000001, + 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, + 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, + 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, + 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, + 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, + 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, + 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, + 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, + 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, + 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, + 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000003, + 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000004, + 0x00000001, 0x00000003, 0x00003070, 0x00000006, 0x00000010, 0x00000004, 0x00000000, 0x00000000, + 0x00000000, 0x00000003, 0x00003170, 0x00000006, 0x68636574, 0x00000030, 0x00000018, 0x00000001, + 0x00000008, 0x00000007, 0x00000004, 0x00000020, 0x00000000, 0x00000000, 0x0000003c, 0x00000058, + 0x00000000, 0x00000000, 0x00000074, 0x00000090, 0x00000000, 0x00000000, 0x000000c0, 0x000000dc, + 0x00000000, 0x00000000, 0x000000f8, 0x00000114, 0x00000000, 0x00000000, 0x00000130, 0x0000014c, + 0x00000000, 0x00000000, 0x00000168, 0x00000184, 0x00000000, 0x00000000, 0x000001a0, 0x000001b4, + 0x00000000, 0x00000000, 0x000001cc, 0x000001e8, 0x00000000, 0x00000000, 0x00000224, 0x00000240, + 0x00000000, 0x00000000, 0x0000027c, 0x00000298, 0x00000000, 0x00000000, 0x000002d8, 0x000002f4, + 0x00000000, 0x00000000, 0x00000334, 0x00000350, 0x00000000, 0x00000000, 0x0000036c, 0x00000388, + 0x00000000, 0x00000000, 0x000003a8, 0x000003c4, 0x00000000, 0x00000000, 0x000003e8, 0x00000404, + 0x00000000, 0x00000000, 0x0000042c, 0x00000448, 0x00000000, 0x00000000, 0x0000046c, 0x00000488, + 0x00000000, 0x00000000, 0x000004b0, 0x000004cc, 0x00000000, 0x00000000, 0x000004f4, 0x00000510, + 0x00000000, 0x00000000, 0x00000538, 0x000005a4, 0x00000000, 0x00000000, 0x000005e4, 0x00000650, + 0x00000000, 0x00000000, 0x000006b0, 0x000006cc, 0x00000000, 0x00000000, 0x000006dc, 0x000006f8, + 0x00000000, 0x00000000, 0x00000c24, 0x00000000, 0x00000002, 0x00000bfc, 0x00000000, 0x00000022, + 0x00000092, 0x00000000, 0x00000710, 0x0000070c, 0x00000093, 0x00000000, 0x00000728, 0x00000724, + 0x00000091, 0x00000000, 0x00000740, 0x0000073c, 0x00000091, 0x00000001, 0x00000760, 0x0000075c, + 0x00000091, 0x00000002, 0x00000780, 0x0000077c, 0x00000091, 0x00000003, 0x000007a0, 0x0000079c, + 0x00000091, 0x00000004, 0x000007c0, 0x000007bc, 0x00000091, 0x00000005, 0x000007e0, 0x000007dc, + 0x00000091, 0x00000006, 0x00000800, 0x000007fc, 0x00000091, 0x00000007, 0x00000820, 0x0000081c, + 0x00000084, 0x00000000, 0x00000840, 0x0000083c, 0x00000084, 0x00000001, 0x00000860, 0x0000085c, + 0x00000084, 0x00000002, 0x00000880, 0x0000087c, 0x00000084, 0x00000003, 0x000008a0, 0x0000089c, + 0x00000084, 0x00000004, 0x000008c0, 0x000008bc, 0x00000084, 0x00000005, 0x000008e0, 0x000008dc, + 0x00000084, 0x00000006, 0x00000900, 0x000008fc, 0x00000084, 0x00000007, 0x00000920, 0x0000091c, + 0x00000085, 0x00000000, 0x0000094c, 0x0000093c, 0x00000085, 0x00000001, 0x00000978, 0x00000968, + 0x00000085, 0x00000002, 0x000009a4, 0x00000994, 0x00000085, 0x00000003, 0x000009d0, 0x000009c0, + 0x00000085, 0x00000004, 0x000009fc, 0x000009ec, 0x00000085, 0x00000005, 0x00000a28, 0x00000a18, + 0x00000085, 0x00000006, 0x00000a54, 0x00000a44, 0x00000085, 0x00000007, 0x00000a80, 0x00000a70, + 0x00000087, 0x00000000, 0x00000aac, 0x00000a9c, 0x00000087, 0x00000001, 0x00000ad8, 0x00000ac8, + 0x00000087, 0x00000002, 0x00000b04, 0x00000af4, 0x00000087, 0x00000003, 0x00000b30, 0x00000b20, + 0x00000087, 0x00000004, 0x00000b5c, 0x00000b4c, 0x00000087, 0x00000005, 0x00000b88, 0x00000b78, + 0x00000087, 0x00000006, 0x00000bb4, 0x00000ba4, 0x00000087, 0x00000007, 0x00000be0, 0x00000bd0, + 0x00000c1c, 0x00000000, 0x00000001, 0x00000092, 0x00000000, 0x00000c08, 0x00000c04, 0x00000003, + 0x00000013, 0x00000001, 0x0000002c, 0xfffe0101, 0x00000051, 0xa00f0000, 0x3f800000, 0x3f800000, + 0x3f800000, 0x3f800000, 0x00000001, 0xc00f0000, 0xa0e40000, 0x0000ffff, 0x00000002, 0x0000002c, + 0xfffe0101, 0x00000051, 0xa00f0000, 0x40000000, 0x40000000, 0x40000000, 0x40000000, 0x00000001, + 0xc00f0000, 0xa0e40000, 0x0000ffff, 0x00000003, 0x0000002c, 0xfffe0200, 0x05000051, 0xa00f0000, + 0x40400000, 0x40400000, 0x40400000, 0x40400000, 0x02000001, 0xc00f0000, 0xa0e40000, 0x0000ffff, + 0x00000000, 0x00000001, 0xffffffff, 0x00000000, 0x00000002, 0x000000e8, 0x00000008, 0x615f7376, + 0x00007272, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, + 0x0000001c, 0x00000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, + 0x56695f67, 0x00746365, 0x00020001, 0x00040001, 0x00000001, 0x00000000, 0x40800000, 0x40400000, + 0x40000000, 0x3f800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, + 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, + 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, + 0x00000002, 0x00000002, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, + 0x00000000, 0x00000000, 0xffffffff, 0x00000021, 0x00000000, 0x00000248, 0x46580200, 0x003efffe, + 0x42415443, 0x0000001c, 0x000000c3, 0x46580200, 0x00000003, 0x0000001c, 0x20000100, 0x000000c0, + 0x00000058, 0x00000002, 0x00000001, 0x00000060, 0x00000070, 0x00000080, 0x00010002, 0x00000001, + 0x00000088, 0x00000098, 0x000000a8, 0x00020002, 0x00000001, 0x000000b0, 0x00000070, 0x6576706f, + 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, + 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, + 0x40000000, 0xc0400000, 0x40800000, 0x6576706f, 0x00337463, 0x00030001, 0x00040001, 0x00000001, + 0x00000000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, + 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0022fffe, 0x54494c43, + 0x00000010, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x812dea11, 0x3d719799, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x002dfffe, 0x434c5846, 0x00000004, 0xa0500004, 0x00000002, 0x00000000, 0x00000001, + 0x0000000c, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000007, 0x00000000, 0x20400004, + 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, + 0x00000007, 0x00000004, 0x10100004, 0x00000001, 0x00000000, 0x00000002, 0x00000008, 0x00000000, + 0x00000007, 0x00000000, 0x20400004, 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000, + 0x00000007, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, + 0x00000000, 0x00000000, 0xffffffff, 0x00000020, 0x00000000, 0x000001f0, 0x46580200, 0x0033fffe, + 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094, + 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, + 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, + 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, + 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, + 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, + 0x392e3932, 0x332e3235, 0x00313131, 0x001afffe, 0x54494c43, 0x0000000c, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x002afffe, 0x434c5846, + 0x00000004, 0x50000004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, + 0x00000004, 0x00000000, 0x00000004, 0x00000001, 0x50000004, 0x00000002, 0x00000000, 0x00000002, + 0x00000004, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000002, 0x10000001, + 0x00000001, 0x00000000, 0x00000001, 0x00000008, 0x00000000, 0x00000004, 0x00000000, 0x10000001, + 0x00000001, 0x00000000, 0x00000001, 0x00000008, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, + 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001f, 0x00000000, 0x000001a8, + 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, + 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, + 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, + 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, + 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0012fffe, 0x54494c43, + 0x00000008, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x47ae147b, 0x3f847ae1, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x002ffffe, 0x434c5846, 0x00000005, 0x10300001, 0x00000001, 0x00000000, 0x00000002, + 0x00000000, 0x00000000, 0x00000007, 0x00000000, 0x10300001, 0x00000001, 0x00000000, 0x00000002, + 0x00000001, 0x00000000, 0x00000007, 0x00000001, 0x10300001, 0x00000001, 0x00000000, 0x00000002, + 0x00000002, 0x00000000, 0x00000007, 0x00000002, 0x10300001, 0x00000001, 0x00000000, 0x00000002, + 0x00000003, 0x00000000, 0x00000007, 0x00000003, 0xa0500004, 0x00000002, 0x00000000, 0x00000001, + 0x00000004, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, + 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001e, 0x00000000, 0x000000dc, + 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, + 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, + 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, + 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, + 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, + 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10900004, 0x00000001, 0x00000000, 0x00000002, + 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, + 0x00000000, 0xffffffff, 0x0000001d, 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, + 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, + 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, + 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, + 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, + 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, + 0x00000001, 0x10800004, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, + 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001c, + 0x00000000, 0x00000124, 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, + 0x00000002, 0x0000001c, 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, + 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, + 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, + 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, + 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, + 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, + 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20100004, 0x00000002, 0x00000000, + 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, + 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001b, 0x00000000, + 0x00000124, 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, + 0x0000001c, 0x20000100, 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, + 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, + 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, + 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, + 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, + 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, + 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20000004, 0x00000002, 0x00000000, 0x00000002, + 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, + 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x0000001a, 0x00000000, 0x000000dc, + 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, + 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, + 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, + 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, + 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, + 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10400004, 0x00000001, 0x00000000, 0x00000002, + 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, + 0x00000000, 0xffffffff, 0x00000019, 0x00000000, 0x0000013c, 0x46580200, 0x0024fffe, 0x42415443, + 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, + 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, + 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, + 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, + 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846, + 0x00000004, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, + 0x00000000, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004, + 0x00000001, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004, + 0x00000002, 0x10300001, 0x00000001, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000004, + 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000018, + 0x00000000, 0x000000dc, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, + 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, + 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, + 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, + 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, + 0x0002fffe, 0x54494c43, 0x00000000, 0x000cfffe, 0x434c5846, 0x00000001, 0x10100004, 0x00000001, + 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, + 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000017, 0x00000000, 0x00000124, 0x46580200, + 0x0033fffe, 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, + 0x00000094, 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, + 0x00000001, 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, + 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, + 0x00040001, 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, + 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, + 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, + 0x434c5846, 0x00000001, 0x20300004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, + 0x00000002, 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, + 0x00000000, 0x00000000, 0xffffffff, 0x00000016, 0x00000000, 0x00000124, 0x46580200, 0x0033fffe, + 0x42415443, 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094, + 0x00000044, 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, + 0x00000074, 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, + 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, + 0x00000001, 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, + 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, + 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846, + 0x00000001, 0x20200004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, + 0x00000004, 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, + 0x00000000, 0xffffffff, 0x00000015, 0x00000000, 0x00000124, 0x46580200, 0x0033fffe, 0x42415443, + 0x0000001c, 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094, 0x00000044, + 0x00000002, 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, 0x00000074, + 0x00000084, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, + 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, + 0x00000000, 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73, + 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, + 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, + 0x20400004, 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, + 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, + 0xffffffff, 0x00000014, 0x00000000, 0x00000124, 0x46580200, 0x0033fffe, 0x42415443, 0x0000001c, + 0x00000097, 0x46580200, 0x00000002, 0x0000001c, 0x20000100, 0x00000094, 0x00000044, 0x00000002, + 0x00000001, 0x0000004c, 0x0000005c, 0x0000006c, 0x00010002, 0x00000001, 0x00000074, 0x00000084, + 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, + 0xc00ccccd, 0x7f7fffff, 0x6576706f, 0x00327463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, + 0x3f800000, 0x40000000, 0xc0400000, 0x40800000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, + 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, + 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x000ffffe, 0x434c5846, 0x00000001, 0x20500004, + 0x00000002, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000004, 0x00000000, + 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, + 0x00000013, 0x00000000, 0x0000013c, 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, + 0x46580200, 0x00000001, 0x0000001c, 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, + 0x00000038, 0x00000048, 0x6576706f, 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, + 0x00000000, 0x80000000, 0xc00ccccd, 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, + 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, + 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, 0x0024fffe, 0x434c5846, 0x00000004, 0x10700001, + 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10700001, + 0x00000001, 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000004, 0x00000001, 0x10700001, + 0x00000001, 0x00000000, 0x00000002, 0x00000002, 0x00000000, 0x00000004, 0x00000002, 0x10700001, + 0x00000001, 0x00000000, 0x00000002, 0x00000003, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, + 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, 0xffffffff, 0x00000012, 0x00000000, 0x0000013c, + 0x46580200, 0x0024fffe, 0x42415443, 0x0000001c, 0x0000005b, 0x46580200, 0x00000001, 0x0000001c, + 0x20000100, 0x00000058, 0x00000030, 0x00000002, 0x00000001, 0x00000038, 0x00000048, 0x6576706f, + 0x00317463, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x00000000, 0x80000000, 0xc00ccccd, + 0x7f7fffff, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, + 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, + 0x00000000, 0x0024fffe, 0x434c5846, 0x00000004, 0x10300001, 0x00000001, 0x00000000, 0x00000002, + 0x00000000, 0x00000000, 0x00000004, 0x00000000, 0x10300001, 0x00000001, 0x00000000, 0x00000002, + 0x00000001, 0x00000000, 0x00000004, 0x00000001, 0x10300001, 0x00000001, 0x00000000, 0x00000002, + 0x00000002, 0x00000000, 0x00000004, 0x00000002, 0x10300001, 0x00000001, 0x00000000, 0x00000002, + 0x00000003, 0x00000000, 0x00000004, 0x00000003, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, + 0x00000000, 0xffffffff, 0x00000001, 0x00000000, 0x00000724, 0xffff0300, 0x00a5fffe, 0x42415443, + 0x0000001c, 0x0000025f, 0xffff0300, 0x00000007, 0x0000001c, 0x20000000, 0x00000258, 0x000000a8, + 0x00080002, 0x00000002, 0x000000b4, 0x000000c4, 0x000000e4, 0x00060002, 0x00000002, 0x000000ec, + 0x000000fc, 0x0000011c, 0x00000002, 0x00000003, 0x00000128, 0x00000138, 0x00000168, 0x000a0002, + 0x00000002, 0x00000170, 0x00000180, 0x000001a0, 0x000c0002, 0x00000002, 0x000001ac, 0x000001bc, + 0x000001dc, 0x00030002, 0x00000003, 0x000001e4, 0x000001f4, 0x00000224, 0x00000000, 0x00000005, + 0x00000230, 0x00000240, 0x3278326d, 0x756c6f63, 0xab006e6d, 0x00030003, 0x00020002, 0x00000001, + 0x00000000, 0x41300000, 0x41a80000, 0x00000000, 0x00000000, 0x41400000, 0x41b00000, 0x00000000, + 0x00000000, 0x3278326d, 0x00776f72, 0x00030002, 0x00020002, 0x00000001, 0x00000000, 0x41300000, + 0x41400000, 0x00000000, 0x00000000, 0x41a80000, 0x41b00000, 0x00000000, 0x00000000, 0x3378326d, + 0x756c6f63, 0xab006e6d, 0x00030003, 0x00030002, 0x00000001, 0x00000000, 0x41300000, 0x41a80000, + 0x00000000, 0x00000000, 0x41400000, 0x41b00000, 0x00000000, 0x00000000, 0x41500000, 0x41b80000, + 0x00000000, 0x00000000, 0x3378326d, 0x00776f72, 0x00030002, 0x00030002, 0x00000001, 0x00000000, + 0x41300000, 0x41400000, 0x41500000, 0x00000000, 0x41a80000, 0x41b00000, 0x41b80000, 0x00000000, + 0x3278336d, 0x756c6f63, 0xab006e6d, 0x00030003, 0x00020003, 0x00000001, 0x00000000, 0x41300000, + 0x41a80000, 0x41f80000, 0x00000000, 0x41400000, 0x41b00000, 0x42000000, 0x00000000, 0x3278336d, + 0x00776f72, 0x00030002, 0x00020003, 0x00000001, 0x00000000, 0x41300000, 0x41400000, 0x00000000, + 0x00000000, 0x41a80000, 0x41b00000, 0x00000000, 0x00000000, 0x41f80000, 0x42000000, 0x00000000, + 0x00000000, 0x7832626d, 0x776f7233, 0xababab00, 0x00010002, 0x00030002, 0x00000001, 0x00000000, + 0xffffffff, 0x00000000, 0xffffffff, 0x00000000, 0xffffffff, 0xffffffff, 0x335f7370, 0x4d00305f, + 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, + 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x05000051, 0xa00f000e, 0x3d2aaaa4, 0xbf000000, + 0x3f800000, 0xbe22f983, 0x05000051, 0xa00f000f, 0x00000000, 0x3e22f983, 0x3e800000, 0xbab609ba, + 0x05000051, 0xa00f0010, 0x40c90fdb, 0xc0490fdb, 0xb4878163, 0x37cfb5a1, 0x0200001f, 0x8000000a, + 0x900f0000, 0x03000005, 0x80030000, 0xa0e40007, 0x90550000, 0x04000004, 0x80030000, 0x90000000, + 0xa0e40006, 0x80e40000, 0x03000002, 0x80030000, 0x80e40000, 0x90e40000, 0x02000001, 0x80010001, + 0xa000000f, 0x0400005a, 0x80010002, 0x90e40000, 0xa0e40008, 0x80000001, 0x0400005a, 0x80020002, + 0x90e40000, 0xa0e40009, 0x80000001, 0x03000002, 0x80030000, 0x80e40000, 0x80e40002, 0x03000005, + 0x800c0000, 0xa0440004, 0x90550000, 0x04000004, 0x800c0000, 0x90000000, 0xa0440003, 0x80e40000, + 0x04000004, 0x800c0000, 0x90aa0000, 0xa0440005, 0x80e40000, 0x03000002, 0x80030000, 0x80ee0000, + 0x80e40000, 0x03000008, 0x80010002, 0x90e40000, 0xa0e4000c, 0x03000008, 0x80020002, 0x90e40000, + 0xa0e4000d, 0x03000002, 0x80030000, 0x80e40000, 0x80e40002, 0x03000005, 0x800e0001, 0xa090000b, + 0x90550000, 0x04000004, 0x800e0001, 0x90000000, 0xa090000a, 0x80e40001, 0x02000001, 0x80040000, + 0x90aa0000, 0x03000002, 0x80070000, 0x80e40000, 0x80f90001, 0x0400005a, 0x80010002, 0x90e40000, + 0xa0e40000, 0x80000001, 0x0400005a, 0x80020002, 0x90e40000, 0xa0e40001, 0x80000001, 0x0400005a, + 0x80040002, 0x90e40000, 0xa0e40002, 0x80000001, 0x03000002, 0x80070000, 0x80e40000, 0x80e40002, + 0x01000028, 0xe0e40804, 0x02000001, 0x80080000, 0x90ff0000, 0x04000004, 0x800f0002, 0x80e40000, + 0xa055000f, 0xa0aa000f, 0x02000013, 0x800f0002, 0x80e40002, 0x04000004, 0x800f0002, 0x80e40002, + 0xa0000010, 0xa0550010, 0x03000005, 0x800f0002, 0x80e40002, 0x80e40002, 0x04000004, 0x800f0003, + 0x80e40002, 0xa0aa0010, 0xa0ff0010, 0x04000004, 0x800f0003, 0x80e40002, 0x80e40003, 0xa0ff000f, + 0x04000004, 0x800f0003, 0x80e40002, 0x80e40003, 0xa000000e, 0x04000004, 0x800f0003, 0x80e40002, + 0x80e40003, 0xa055000e, 0x04000004, 0x800f0002, 0x80e40002, 0x80e40003, 0x80e40000, 0x03000002, + 0x800f0002, 0x80e40002, 0xa0aa000e, 0x04000004, 0x800f0003, 0x80e40002, 0xa1ff000e, 0xa155000e, + 0x02000013, 0x800f0003, 0x80e40003, 0x04000004, 0x800f0003, 0x80e40003, 0xa0000010, 0xa0550010, + 0x03000005, 0x800f0003, 0x80e40003, 0x80e40003, 0x04000004, 0x800f0004, 0x80e40003, 0xa0aa0010, + 0xa0ff0010, 0x04000004, 0x800f0004, 0x80e40003, 0x80e40004, 0xa0ff000f, 0x04000004, 0x800f0004, + 0x80e40003, 0x80e40004, 0xa000000e, 0x04000004, 0x800f0004, 0x80e40003, 0x80e40004, 0xa055000e, + 0x04000004, 0x800f0002, 0x80e40003, 0x80e40004, 0x80e40002, 0x03000002, 0x800f0002, 0x80e40002, + 0xa0aa000e, 0x0400005a, 0x80010003, 0x80e40002, 0xa0e40000, 0x80000001, 0x0400005a, 0x80020003, + 0x80e40002, 0xa0e40001, 0x80000001, 0x0400005a, 0x80040003, 0x80e40002, 0xa0e40002, 0x80000001, + 0x03000002, 0x80070001, 0x80e40002, 0x80e40003, 0x03000005, 0x80070002, 0x80550001, 0xa0e4000b, + 0x04000004, 0x80070002, 0x80000001, 0xa0e4000a, 0x80e40002, 0x03000002, 0x80070001, 0x80e40001, + 0x80e40002, 0x03000008, 0x80010002, 0x80e40001, 0xa0e4000c, 0x03000008, 0x80020002, 0x80e40001, + 0xa0e4000d, 0x03000002, 0x80030001, 0x80e40001, 0x80e40002, 0x03000005, 0x80030002, 0x80550001, + 0xa0e40004, 0x04000004, 0x80030002, 0x80000001, 0xa0e40003, 0x80e40002, 0x04000004, 0x80030002, + 0x80aa0001, 0xa0e40005, 0x80e40002, 0x03000002, 0x80030800, 0x80e40001, 0x80e40002, 0x02000001, + 0x80040800, 0x80aa0001, 0x02000001, 0x80080800, 0x80ff0002, 0x0000002a, 0x02000001, 0x80070800, + 0x80e40000, 0x02000001, 0x80080800, 0x90ff0000, 0x0000002b, 0x0000ffff, 0x00000000, 0x00000000, + 0xffffffff, 0x00000000, 0x00000000, 0x0000098c, 0xfffe0300, 0x00ebfffe, 0x42415443, 0x0000001c, + 0x00000377, 0xfffe0300, 0x00000008, 0x0000001c, 0x20000000, 0x00000370, 0x000000bc, 0x00190002, + 0x00000001, 0x000000c4, 0x000000d4, 0x000000e4, 0x00170002, 0x00000002, 0x000000ec, 0x000000fc, + 0x0000011c, 0x000a0002, 0x00000004, 0x00000128, 0x00000138, 0x00000178, 0x000e0002, 0x00000003, + 0x00000180, 0x00000190, 0x000001c0, 0x00110002, 0x00000003, 0x000001cc, 0x000001dc, 0x0000020c, + 0x00060002, 0x00000004, 0x00000214, 0x00000224, 0x00000264, 0x00140002, 0x00000003, 0x000002bc, + 0x000002cc, 0x000002fc, 0x00000002, 0x00000006, 0x00000300, 0x00000310, 0x31727261, 0xababab00, + 0x00030000, 0x00010001, 0x00000001, 0x00000000, 0x42b60000, 0x00000000, 0x00000000, 0x00000000, + 0x32727261, 0xababab00, 0x00030000, 0x00010001, 0x00000002, 0x00000000, 0x42b80000, 0x00000000, + 0x00000000, 0x00000000, 0x42ba0000, 0x00000000, 0x00000000, 0x00000000, 0x3478336d, 0x756c6f63, + 0xab006e6d, 0x00030003, 0x00040003, 0x00000001, 0x00000000, 0x41300000, 0x41a80000, 0x41f80000, + 0x00000000, 0x41400000, 0x41b00000, 0x42000000, 0x00000000, 0x41500000, 0x41b80000, 0x42040000, + 0x00000000, 0x41600000, 0x41c00000, 0x42080000, 0x00000000, 0x3478336d, 0x00776f72, 0x00030002, + 0x00040003, 0x00000001, 0x00000000, 0x41300000, 0x41400000, 0x41500000, 0x41600000, 0x41a80000, + 0x41b00000, 0x41b80000, 0x41c00000, 0x41f80000, 0x42000000, 0x42040000, 0x42080000, 0x3378346d, + 0x756c6f63, 0xab006e6d, 0x00030003, 0x00030004, 0x00000001, 0x00000000, 0x41300000, 0x41a80000, + 0x41f80000, 0x42240000, 0x41400000, 0x41b00000, 0x42000000, 0x42280000, 0x41500000, 0x41b80000, + 0x42040000, 0x422c0000, 0x3378346d, 0x00776f72, 0x00030002, 0x00030004, 0x00000001, 0x00000000, + 0x41300000, 0x41400000, 0x41500000, 0x00000000, 0x41a80000, 0x41b00000, 0x41b80000, 0x00000000, + 0x41f80000, 0x42000000, 0x42040000, 0x00000000, 0x42240000, 0x42280000, 0x422c0000, 0x00000000, + 0x00317374, 0xab003176, 0x00030001, 0x00030001, 0x00000001, 0x00000000, 0xab007666, 0x00030000, + 0x00010001, 0x00000001, 0x00000000, 0xab003276, 0x00030001, 0x00040001, 0x00000001, 0x00000000, + 0x00000268, 0x0000026c, 0x0000027c, 0x00000280, 0x00000290, 0x00000294, 0x00000005, 0x00080001, + 0x00030001, 0x000002a4, 0x41100000, 0x41200000, 0x41300000, 0x00000000, 0x41400000, 0x00000000, + 0x00000000, 0x00000000, 0x41500000, 0x41600000, 0x41700000, 0x41800000, 0x00327374, 0x00000005, + 0x00080001, 0x00030002, 0x000002a4, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, + 0x40000000, 0x40400000, 0x00000000, 0x40800000, 0x00000000, 0x00000000, 0x00000000, 0x40a00000, + 0x40c00000, 0x40e00000, 0x41000000, 0x335f7376, 0x4d00305f, 0x6f726369, 0x74666f73, 0x29522820, + 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, + 0x00313131, 0x00ecfffe, 0x53455250, 0x46580201, 0x0043fffe, 0x42415443, 0x0000001c, 0x000000d7, + 0x46580201, 0x00000003, 0x0000001c, 0x20000100, 0x000000d4, 0x00000058, 0x00020002, 0x00000001, + 0x00000060, 0x00000070, 0x00000080, 0x00030002, 0x00000001, 0x00000088, 0x00000070, 0x00000098, + 0x00000002, 0x00000002, 0x000000a4, 0x000000b4, 0x6f505f67, 0xab003173, 0x00030001, 0x00040001, + 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x6f505f67, 0xab003273, + 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x65535f67, 0x7463656c, 0xab00726f, 0x00030001, + 0x00040001, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x41200000, + 0x41200000, 0x41200000, 0x41200000, 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, + 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, + 0x000cfffe, 0x49535250, 0x0000001a, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, + 0x00000001, 0x0000001a, 0x00000001, 0x00000000, 0x00000000, 0x0032fffe, 0x54494c43, 0x00000018, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x3fe00000, 0x00000000, 0xc0000000, 0x00000000, 0xc0080000, 0x00000000, 0x00000000, + 0x00000000, 0x40100000, 0x00000000, 0x40140000, 0x00000000, 0x40180000, 0x00000000, 0x401c0000, + 0x0064fffe, 0x434c5846, 0x00000009, 0xa0500004, 0x00000002, 0x00000000, 0x00000001, 0x00000011, + 0x00000000, 0x00000002, 0x00000008, 0x00000000, 0x00000007, 0x00000000, 0x20400004, 0x00000002, + 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000001, 0x00000014, 0x00000000, 0x00000007, + 0x00000004, 0xa0500004, 0x00000002, 0x00000000, 0x00000001, 0x00000012, 0x00000000, 0x00000002, + 0x0000000c, 0x00000000, 0x00000007, 0x00000000, 0x20400004, 0x00000002, 0x00000000, 0x00000007, + 0x00000000, 0x00000000, 0x00000001, 0x00000014, 0x00000000, 0x00000007, 0x00000008, 0x10100004, + 0x00000001, 0x00000000, 0x00000007, 0x00000008, 0x00000000, 0x00000007, 0x00000000, 0x20400004, + 0x00000002, 0x00000000, 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x00000004, 0x00000000, + 0x00000007, 0x0000000c, 0xa0200001, 0x00000002, 0x00000000, 0x00000001, 0x00000010, 0x00000000, + 0x00000002, 0x00000005, 0x00000000, 0x00000007, 0x00000000, 0xa0500004, 0x00000002, 0x00000000, + 0x00000007, 0x00000000, 0x00000000, 0x00000007, 0x0000000c, 0x00000000, 0x00000007, 0x00000004, + 0x20400004, 0x00000002, 0x00000000, 0x00000007, 0x00000004, 0x00000000, 0x00000007, 0x00000008, + 0x00000000, 0x00000004, 0x00000068, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x05000051, 0xa00f001b, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0200001f, 0x80000000, 0x900f0000, 0x0200001f, + 0x80000000, 0xe00f0000, 0x0200001f, 0x80000005, 0xe0030001, 0x0200001f, 0x8000000a, 0xe00f0002, + 0x03000009, 0x80010000, 0x90e40000, 0xa0e40011, 0x03000009, 0x80020000, 0x90e40000, 0xa0e40012, + 0x03000009, 0x80040000, 0x90e40000, 0xa0e40013, 0x03000008, 0x80010001, 0x90e40000, 0xa0e4000a, + 0x03000008, 0x80020001, 0x90e40000, 0xa0e4000b, 0x03000008, 0x80040001, 0x90e40000, 0xa0e4000c, + 0x03000008, 0x80080001, 0x90e40000, 0xa0e4000d, 0x02000001, 0x80080000, 0xa000001b, 0x03000002, + 0x800f0000, 0x80e40000, 0x80e40001, 0x03000005, 0x800f0001, 0xa0e4000f, 0x90550000, 0x04000004, + 0x800f0001, 0x90000000, 0xa0e4000e, 0x80e40001, 0x04000004, 0x800f0001, 0x90aa0000, 0xa0e40010, + 0x80e40001, 0x03000002, 0x800f0000, 0x80e40000, 0x80e40001, 0x03000005, 0x80070001, 0xa0e40007, + 0x90550000, 0x04000004, 0x80070001, 0x90000000, 0xa0e40006, 0x80e40001, 0x04000004, 0x80070001, + 0x90aa0000, 0xa0e40008, 0x80e40001, 0x04000004, 0x80070001, 0x90ff0000, 0xa0e40009, 0x80e40001, + 0x03000002, 0x80070000, 0x80e40000, 0x80e40001, 0x04000004, 0x800f0000, 0x90e40000, 0xa0000015, + 0x80e40000, 0x03000009, 0x80010001, 0x90e40000, 0xa0e40016, 0x03000002, 0x800f0000, 0x80e40000, + 0x80000001, 0x04000004, 0x800f0000, 0x90e40000, 0xa0000004, 0x80e40000, 0x03000009, 0x80010001, + 0x90e40000, 0xa0e40005, 0x03000002, 0x800f0000, 0x80e40000, 0x80000001, 0x04000004, 0x800f0000, + 0x90e40000, 0xa0000019, 0x80e40000, 0x04000004, 0xe00f0002, 0x90e40000, 0xa0000018, 0x80e40000, + 0x02000001, 0xe00f0000, 0xa0e4001a, 0x02000001, 0xe0030001, 0xa000001b, 0x0000ffff, +}; +#define TEST_EFFECT_PRESHADER_VSHADER_POS 1035 +#define TEST_EFFECT_PRESHADER_VSHADER_LEN 13 + +static void test_effect_preshader(IDirect3DDevice9 *device) +{ + static const D3DXVECTOR4 test_effect_preshader_fconstsv[] = + { + {0.0f, 0.0f, 0.0f, 0.0f}, + {0.0f, 0.0f, 0.0f, 0.0f}, + {0.0f, 0.0f, 0.0f, 0.0f}, + {1.0f, 2.0f, 3.0f, 0.0f}, + {4.0f, 0.0f, 0.0f, 0.0f}, + {5.0f, 6.0f, 7.0f, 8.0f}, + {11.0f, 12.0f, 13.0f, 0.0f}, + {21.0f, 22.0f, 23.0f, 0.0f}, + {31.0f, 32.0f, 33.0f, 0.0f}, + {41.0f, 42.0f, 43.0f, 0.0f}, + {11.0f, 21.0f, 31.0f, 0.0f}, + {12.0f, 22.0f, 32.0f, 0.0f}, + {13.0f, 23.0f, 33.0f, 0.0f}, + {14.0f, 24.0f, 34.0f, 0.0f}, + {11.0f, 12.0f, 13.0f, 14.0f}, + {21.0f, 22.0f, 23.0f, 24.0f}, + {31.0f, 32.0f, 33.0f, 34.0f}, + {11.0f, 21.0f, 31.0f, 41.0f}, + {12.0f, 22.0f, 32.0f, 42.0f}, + {13.0f, 23.0f, 33.0f, 43.0f}, + {9.0f, 10.0f, 11.0f, 0.0f}, + {12.0f, 0.0f, 0.0f, 0.0f}, + {13.0f, 14.0f, 15.0f, 16.0f}, + {92.0f, 0.0f, 0.0f, 0.0f}, + {93.0f, 0.0f, 0.0f, 0.0f}, + {91.0f, 0.0f, 0.0f, 0.0f}, + {4.0f, 5.0f, 6.0f, 7.0f} + }; + static const D3DXVECTOR4 test_effect_preshader_fconstsp[] = + { + {11.0f, 21.0f, 0.0f, 0.0f}, + {12.0f, 22.0f, 0.0f, 0.0f}, + {13.0f, 23.0f, 0.0f, 0.0f}, + {11.0f, 12.0f, 0.0f, 0.0f}, + {21.0f, 22.0f, 0.0f, 0.0f}, + {31.0f, 32.0f, 0.0f, 0.0f}, + {11.0f, 12.0f, 0.0f, 0.0f}, + {21.0f, 22.0f, 0.0f, 0.0f}, + {11.0f, 21.0f, 0.0f, 0.0f}, + {12.0f, 22.0f, 0.0f, 0.0f}, + {11.0f, 12.0f, 13.0f, 0.0f}, + {21.0f, 22.0f, 23.0f, 0.0f}, + {11.0f, 21.0f, 31.0f, 0.0f}, + {12.0f, 22.0f, 32.0f, 0.0f} + }; + static const BOOL test_effect_preshader_bconsts[] = + { + TRUE, FALSE, TRUE, FALSE, TRUE, FALSE + }; + static const struct + { + const char *comment; + BOOL todo[4]; + unsigned int result[4]; + } + test_effect_preshader_op_results[] = + { + {"1 / op", { TRUE, TRUE, TRUE, TRUE}, {0x7f800000, 0xff800000, 0xbee8ba2e, 0x00200000}}, +#if __x86_64__ + {"rsq", { TRUE, TRUE, TRUE, TRUE}, {0x7f800000, 0x7f800000, 0x3f2c985d, 0x1f800000}}, +#else + {"rsq", { TRUE, TRUE, TRUE, TRUE}, {0x7f800000, 0x7f800000, 0x3f2c985c, 0x1f800001}}, +#endif + {"mul", { TRUE, TRUE, TRUE, TRUE}, {0x00000000, 0x80000000, 0x40d33334, 0x7f800000}}, + {"add", {FALSE, TRUE, TRUE, TRUE}, {0x3f800000, 0x40000000, 0xc0a66666, 0x7f7fffff}}, + {"lt", {FALSE, FALSE, TRUE, FALSE}, {0x3f800000, 0x3f800000, 0x00000000, 0x00000000}}, + {"ge", { TRUE, TRUE, FALSE, TRUE}, {0x00000000, 0x00000000, 0x3f800000, 0x3f800000}}, + {"neg", { TRUE, TRUE, TRUE, TRUE}, {0x80000000, 0x00000000, 0x400ccccd, 0xff7fffff}}, + {"rcp", { TRUE, TRUE, TRUE, TRUE}, {0x7f800000, 0xff800000, 0xbee8ba2e, 0x00200000}}, + {"frac", {FALSE, FALSE, TRUE, FALSE}, {0x00000000, 0x00000000, 0x3f4ccccc, 0x00000000}}, + {"min", {FALSE, TRUE, TRUE, TRUE}, {0x00000000, 0x80000000, 0xc0400000, 0x40800000}}, + {"max", { TRUE, TRUE, TRUE, TRUE}, {0x3f800000, 0x40000000, 0xc00ccccd, 0x7f7fffff}}, +#if __x86_64__ + {"sin", {FALSE, TRUE, TRUE, TRUE}, {0x00000000, 0x80000000, 0xbf4ef99e, 0xbf0599b3}}, + {"cos", { TRUE, TRUE, TRUE, TRUE}, {0x3f800000, 0x3f800000, 0xbf16a803, 0x3f5a5f96}}, +#else + {"sin", {FALSE, TRUE, TRUE, TRUE}, {0x00000000, 0x80000000, 0xbf4ef99e, 0x3f792dc4}}, + {"cos", { TRUE, TRUE, TRUE, TRUE}, {0x3f800000, 0x3f800000, 0xbf16a803, 0xbe6acefc}}, +#endif + {"den mul",{ TRUE, TRUE, TRUE, TRUE}, {0x7f800000, 0xff800000, 0xbb94f209, 0x000051ec}}, + {"dot", {FALSE, TRUE, TRUE, FALSE}, {0x00000000, 0x7f800000, 0x41f00000, 0x00000000}}, +#if __x86_64__ + {"prec", { TRUE, TRUE, TRUE, FALSE}, {0x2b8cbccc, 0x2c0cbccc, 0xac531800, 0x00000000}} +#else + {"prec", { TRUE, TRUE, FALSE, FALSE}, {0x2b8cbccc, 0x2c0cbccc, 0x00000000, 0x00000000}} +#endif + }; +#define TEST_EFFECT_PRES_NFLOATV ARRAY_SIZE(test_effect_preshader_fconstsv) +#define TEST_EFFECT_PRES_NFLOATP ARRAY_SIZE(test_effect_preshader_fconstsp) +#define TEST_EFFECT_PRES_NFLOATMAX (TEST_EFFECT_PRES_NFLOATV > TEST_EFFECT_PRES_NFLOATP ? \ + TEST_EFFECT_PRES_NFLOATV : TEST_EFFECT_PRES_NFLOATP) +#define TEST_EFFECT_PRES_NBOOL ARRAY_SIZE(test_effect_preshader_bconsts) +#define TEST_EFFECT_PRES_NOPTESTS ARRAY_SIZE(test_effect_preshader_op_results) + + static const D3DXVECTOR4 fvect1 = {28.0f, 29.0f, 30.0f, 31.0f}; + static const D3DXVECTOR4 fvect2 = {0.0f, 0.0f, 1.0f, 0.0f}; + static const D3DXVECTOR4 fvect_empty = {-9999.0f, -9999.0f, -9999.0f, -9999.0f}; + HRESULT hr; + ID3DXEffect *effect; + D3DXHANDLE par; + unsigned int npasses; + BOOL bval; + D3DLIGHT9 light; + D3DXVECTOR4 fdata[TEST_EFFECT_PRES_NFLOATMAX]; + BOOL bdata[TEST_EFFECT_PRES_NBOOL]; + IDirect3DVertexShader9 *vshader; + void *byte_code; + unsigned int byte_code_size; + unsigned int i, j; + D3DCAPS9 caps; + + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.VertexShaderVersion < D3DVS_VERSION(3, 0) + || caps.PixelShaderVersion < D3DPS_VERSION(3, 0)) + { + skip("Test requires VS >= 3 and PS >= 3, skipping.\n"); + return; + } + + hr = D3DXCreateEffect(device, test_effect_preshader_effect_blob, sizeof(test_effect_preshader_effect_blob), + NULL, NULL, 0, NULL, &effect, NULL); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + + for (i = 0; i < 256; ++i) + { + hr = IDirect3DDevice9_SetVertexShaderConstantF(device, i, &fvect_empty.x, 1); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + } + for (i = 0; i < 224; ++i) + { + hr = IDirect3DDevice9_SetPixelShaderConstantF(device, i, &fvect_empty.x, 1); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + } + bval = FALSE; + for (i = 0; i < 16; ++i) + { + hr = IDirect3DDevice9_SetPixelShaderConstantB(device, i, &bval, 1); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + } + + hr = effect->lpVtbl->Begin(effect, &npasses, 0); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + + par = effect->lpVtbl->GetParameterByName(effect, NULL, "g_Pos2"); + ok(par != NULL, "GetParameterByName failed.\n"); + + hr = effect->lpVtbl->SetVector(effect, par, &fvect1); + ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr); + + hr = effect->lpVtbl->BeginPass(effect, 0); + todo_wine ok(hr == D3D_OK, "Got result %#x.\n", hr); + + hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, &fdata[0].x, TEST_EFFECT_PRES_NFLOATV); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + todo_wine ok(!memcmp(fdata, test_effect_preshader_fconstsv, sizeof(test_effect_preshader_fconstsv)), + "Vertex shader float constants do not match.\n"); + for (i = TEST_EFFECT_PRES_NFLOATV; i < 256; ++i) + { + hr = IDirect3DDevice9_GetVertexShaderConstantF(device, i, &fdata[0].x, 1); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + ok(!memcmp(fdata, &fvect_empty, sizeof(fvect_empty)), + "Vertex shader float constants do not match.\n"); + } + hr = IDirect3DDevice9_GetPixelShaderConstantF(device, 0, &fdata[0].x, TEST_EFFECT_PRES_NFLOATP); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + todo_wine ok(!memcmp(fdata, test_effect_preshader_fconstsp, sizeof(test_effect_preshader_fconstsp)), + "Pixel shader float constants do not match.\n"); + for (i = TEST_EFFECT_PRES_NFLOATP; i < 224; ++i) + { + hr = IDirect3DDevice9_GetPixelShaderConstantF(device, i, &fdata[0].x, 1); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + ok(!memcmp(fdata, &fvect_empty, sizeof(fvect_empty)), + "Vertex shader float constants do not match.\n"); + } + + hr = IDirect3DDevice9_GetPixelShaderConstantB(device, 0, bdata, TEST_EFFECT_PRES_NBOOL); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + for (i = 0; i < TEST_EFFECT_PRES_NBOOL; ++i) + todo_wine_if(!bdata[i] != !test_effect_preshader_bconsts[i]) + ok(!bdata[i] == !test_effect_preshader_bconsts[i], + "Pixel shader boolean constants do not match.\n"); + for (; i < 16; ++i) + { + hr = IDirect3DDevice9_GetPixelShaderConstantB(device, i, &bval, 1); + ok(hr == D3D_OK && !bval, "Got result %#x, boolean register value %u.\n", hr, bval); + } + + for (i = 0; i < TEST_EFFECT_PRES_NOPTESTS; ++i) + { + unsigned int *v; + + hr = IDirect3DDevice9_GetLight(device, i % 8, &light); + v = i < 8 ? (unsigned int *)&light.Diffuse : (unsigned int *)&light.Ambient; + ok(hr == D3D_OK, "Got result %#x.\n", hr); + for (j = 0; j < 4; ++j) + todo_wine_if(test_effect_preshader_op_results[i].todo[j]) + ok(v[j] == test_effect_preshader_op_results[i].result[j], + "Operation %s, component %u, expected %#x, got %#x (%g).\n", + test_effect_preshader_op_results[i].comment, j, + test_effect_preshader_op_results[i].result[j], v[j], ((float *)v)[j]); + } + + hr = effect->lpVtbl->EndPass(effect); + + par = effect->lpVtbl->GetParameterByName(effect, NULL, "g_iVect"); + ok(par != NULL, "GetParameterByName failed.\n"); + hr = effect->lpVtbl->SetVector(effect, par, &fvect2); + ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr); + hr = effect->lpVtbl->BeginPass(effect, 1); + todo_wine ok(hr == D3D_OK, "Got result %#x.\n", hr); + + hr = IDirect3DDevice9_GetVertexShader(device, &vshader); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + ok(!!vshader, "Got NULL vshader.\n"); + + hr = IDirect3DVertexShader9_GetFunction(vshader, NULL, &byte_code_size); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + byte_code = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, byte_code_size); + hr = IDirect3DVertexShader9_GetFunction(vshader, byte_code, &byte_code_size); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + ok(byte_code_size > 1, "Got unexpected byte code size %u.\n", byte_code_size); + todo_wine ok(!memcmp(byte_code, + &test_effect_preshader_effect_blob[TEST_EFFECT_PRESHADER_VSHADER_POS + + TEST_EFFECT_PRESHADER_VSHADER_LEN], byte_code_size), + "Incorrect shader selected.\n"); + HeapFree(GetProcessHeap(), 0, byte_code); + IDirect3DVertexShader9_Release(vshader); + + hr = IDirect3DDevice9_SetVertexShader(device, NULL); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + + hr = effect->lpVtbl->SetVector(effect, par, &fvect1); + ok(hr == D3D_OK, "SetVector failed, hr %#x.\n", hr); + hr = effect->lpVtbl->CommitChanges(effect); + todo_wine ok(hr == D3D_OK, "Got result %#x.\n", hr); + hr = IDirect3DDevice9_GetVertexShader(device, &vshader); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + ok(!vshader, "Incorrect shader selected.\n"); + + hr = effect->lpVtbl->EndPass(effect); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + + hr = effect->lpVtbl->End(effect); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + effect->lpVtbl->Release(effect); +} + START_TEST(effect) { HWND wnd; @@ -3048,6 +3926,7 @@ test_effect_variable_names(device); test_effect_compilation_errors(device); test_effect_states(device); + test_effect_preshader(device); count = IDirect3DDevice9_Release(device); ok(count == 0, "The device was not properly freed: refcount %u\n", count); diff -Nru wine-staging-1.9.6/dlls/d3dx9_36/volume.c wine-staging-1.9.7~ubuntu15.04.1/dlls/d3dx9_36/volume.c --- wine-staging-1.9.6/dlls/d3dx9_36/volume.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/d3dx9_36/volume.c 2016-04-04 18:06:32.000000000 +0000 @@ -240,14 +240,16 @@ D3DBOX box; D3DXIMAGE_INFO image_info; - TRACE("dst_volume %p, dst_palette %p, dst_box %p, src_data %p, src_data_size %u, src_box %p,\n", - dst_volume, dst_palette, dst_box, src_data, src_data_size, src_box); - TRACE("filter %#x, color_key %#x, src_info %p.\n", filter, color_key, src_info); + TRACE("dst_volume %p, dst_palette %p, dst_box %p, src_data %p, src_data_size %u, src_box %p, " + "filter %#x, color_key 0x%08x, src_info %p.\n", + dst_volume, dst_palette, dst_box, src_data, src_data_size, src_box, + filter, color_key, src_info); - if (!dst_volume || !src_data) return D3DERR_INVALIDCALL; + if (!dst_volume || !src_data) + return D3DERR_INVALIDCALL; - hr = D3DXGetImageInfoFromFileInMemory(src_data, src_data_size, &image_info); - if (FAILED(hr)) return hr; + if (FAILED(hr = D3DXGetImageInfoFromFileInMemory(src_data, src_data_size, &image_info))) + return hr; if (src_box) { diff -Nru wine-staging-1.9.6/dlls/dbghelp/symbol.c wine-staging-1.9.7~ubuntu15.04.1/dlls/dbghelp/symbol.c --- wine-staging-1.9.6/dlls/dbghelp/symbol.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/dbghelp/symbol.c 2016-04-04 18:06:32.000000000 +0000 @@ -564,7 +564,7 @@ if (!symt_get_info(pair->effective, sym, TI_GET_TYPE, &sym_info->TypeIndex)) sym_info->TypeIndex = 0; - sym_info->info = symt_ptr2index(pair->effective, sym); + sym_info->Index = symt_ptr2index(pair->effective, sym); sym_info->Reserved[0] = sym_info->Reserved[1] = 0; if (!symt_get_info(pair->effective, sym, TI_GET_LENGTH, &size) && (!sym_info->TypeIndex || @@ -723,7 +723,7 @@ const struct symt_function* func, const struct symt* sym) { symt_fill_sym_info(pair, func, sym, se->sym_info); - if (se->index && se->sym_info->info != se->index) return FALSE; + if (se->index && se->sym_info->Index != se->index) return FALSE; if (se->tag && se->sym_info->Tag != se->tag) return FALSE; if (se->addr && !(se->addr >= se->sym_info->Address && se->addr < se->sym_info->Address + se->sym_info->Size)) return FALSE; return !se->cb(se->sym_info, se->sym_info->Size, se->user); @@ -987,7 +987,7 @@ siw->TypeIndex = si->TypeIndex; siw->Reserved[0] = si->Reserved[0]; siw->Reserved[1] = si->Reserved[1]; - siw->Index = si->info; /* FIXME: see dbghelp.h */ + siw->Index = si->Index; siw->Size = si->Size; siw->ModBase = si->ModBase; siw->Flags = si->Flags; diff -Nru wine-staging-1.9.6/dlls/dbghelp/type.c wine-staging-1.9.7~ubuntu15.04.1/dlls/dbghelp/type.c --- wine-staging-1.9.6/dlls/dbghelp/type.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/dbghelp/type.c 2016-04-04 18:06:32.000000000 +0000 @@ -471,7 +471,7 @@ { type = *(struct symt**)vector_at(&pair.effective->vtypes, i); sym_info->TypeIndex = symt_ptr2index(pair.effective, type); - sym_info->info = 0; /* FIXME */ + sym_info->Index = 0; /* FIXME */ symt_get_info(pair.effective, type, TI_GET_LENGTH, &size); sym_info->Size = size; sym_info->ModBase = pair.requested->module.BaseOfImage; diff -Nru wine-staging-1.9.6/dlls/ddraw/device.c wine-staging-1.9.7~ubuntu15.04.1/dlls/ddraw/device.c --- wine-staging-1.9.6/dlls/ddraw/device.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/ddraw/device.c 2016-04-04 18:06:32.000000000 +0000 @@ -6077,11 +6077,7 @@ wined3d_mutex_lock(); if (!src_rect) - { - srcrect.left = srcrect.top = 0; - srcrect.right = src->surface_desc.dwWidth; - srcrect.bottom = src->surface_desc.dwHeight; - } + SetRect(&srcrect, 0, 0, src->surface_desc.dwWidth, src->surface_desc.dwHeight); else srcrect = *src_rect; diff -Nru wine-staging-1.9.6/dlls/ddraw/surface.c wine-staging-1.9.7~ubuntu15.04.1/dlls/ddraw/surface.c --- wine-staging-1.9.6/dlls/ddraw/surface.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/ddraw/surface.c 2016-04-04 18:06:32.000000000 +0000 @@ -1407,16 +1407,10 @@ UINT i; if (!dst_rect_in) - { - dst_rect.left = 0; - dst_rect.top = 0; - dst_rect.right = dst_surface->surface_desc.dwWidth; - dst_rect.bottom = dst_surface->surface_desc.dwHeight; - } + SetRect(&dst_rect, 0, 0, dst_surface->surface_desc.dwWidth, + dst_surface->surface_desc.dwHeight); else - { dst_rect = *dst_rect_in; - } if (IsRectEmpty(&dst_rect)) return DDERR_INVALIDRECT; @@ -1424,16 +1418,10 @@ if (src_surface) { if (!src_rect_in) - { - src_rect.left = 0; - src_rect.top = 0; - src_rect.right = src_surface->surface_desc.dwWidth; - src_rect.bottom = src_surface->surface_desc.dwHeight; - } + SetRect(&src_rect, 0, 0, src_surface->surface_desc.dwWidth, + src_surface->surface_desc.dwHeight); else - { src_rect = *src_rect_in; - } if (IsRectEmpty(&src_rect)) return DDERR_INVALIDRECT; diff -Nru wine-staging-1.9.6/dlls/ddraw/tests/ddraw1.c wine-staging-1.9.7~ubuntu15.04.1/dlls/ddraw/tests/ddraw1.c --- wine-staging-1.9.6/dlls/ddraw/tests/ddraw1.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/ddraw/tests/ddraw1.c 2016-04-04 18:06:32.000000000 +0000 @@ -7939,7 +7939,6 @@ DWORD color0, color1; UINT i, inst_length; IDirectDraw *ddraw; - IDirect3D *d3d; ULONG refcount; HWND window; HRESULT hr; @@ -7986,8 +7985,6 @@ return; } - hr = IDirect3DDevice_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get d3d interface, hr %#x.\n", hr); hr = IDirect3DDevice_QueryInterface(device, &IID_IDirectDrawSurface, (void **)&rt); ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); @@ -8061,7 +8058,6 @@ destroy_viewport(device, viewport); destroy_material(background); IDirectDrawSurface_Release(rt); - IDirect3D_Release(d3d); refcount = IDirect3DDevice_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); IDirectDraw_Release(ddraw); @@ -8497,6 +8493,86 @@ DestroyWindow(window); } +static void test_blt(void) +{ + IDirectDrawSurface *surface, *rt; + DDSURFACEDESC surface_desc; + IDirect3DDevice *device; + IDirectDraw *ddraw; + unsigned int i; + ULONG refcount; + HWND window; + HRESULT hr; + + static struct + { + RECT src_rect; + RECT dst_rect; + HRESULT hr; + } + test_data[] = + { + {{160, 0, 640, 480}, { 0, 0, 480, 480}, DD_OK}, /* Overlapped blit. */ + {{160, 480, 640, 0}, { 0, 0, 480, 480}, DDERR_INVALIDRECT}, /* Overlapped blit, flipped source. */ + {{640, 0, 160, 480}, { 0, 0, 480, 480}, DDERR_INVALIDRECT}, /* Overlapped blit, mirrored source. */ + {{160, 0, 480, 480}, { 0, 0, 480, 480}, DD_OK}, /* Overlapped blit, stretched x. */ + {{160, 160, 640, 480}, { 0, 0, 480, 480}, DD_OK}, /* Overlapped blit, stretched y. */ + {{ 0, 0, 640, 480}, { 0, 0, 640, 480}, DD_OK}, /* Full surface blit. */ + {{ 0, 0, 640, 480}, { 0, 480, 640, 0}, DDERR_INVALIDRECT}, /* Full surface, flipped destination. */ + {{ 0, 0, 640, 480}, {640, 0, 0, 480}, DDERR_INVALIDRECT}, /* Full surface, mirrored destination. */ + {{ 0, 480, 640, 0}, { 0, 0, 640, 480}, DDERR_INVALIDRECT}, /* Full surface, flipped source. */ + {{640, 0, 0, 480}, { 0, 0, 640, 480}, DDERR_INVALIDRECT}, /* Full surface, mirrored source. */ + }; + + 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"); + if (!(device = create_device(ddraw, window, DDSCL_NORMAL))) + { + skip("Failed to create a 3D device, skipping test.\n"); + IDirectDraw_Release(ddraw); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice_QueryInterface(device, &IID_IDirectDrawSurface, (void **)&rt); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS; + surface_desc.dwWidth = 640; + surface_desc.dwHeight = 480; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface_Blt(surface, NULL, surface, NULL, 0, NULL); + ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + + hr = IDirectDrawSurface_Blt(surface, NULL, rt, NULL, 0, NULL); + ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + + for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i) + { + hr = IDirectDrawSurface_Blt(surface, &test_data[i].dst_rect, + surface, &test_data[i].src_rect, DDBLT_WAIT, NULL); + ok(hr == test_data[i].hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, test_data[i].hr); + + hr = IDirectDrawSurface_Blt(surface, &test_data[i].dst_rect, + rt, &test_data[i].src_rect, DDBLT_WAIT, NULL); + ok(hr == test_data[i].hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, test_data[i].hr); + } + + IDirectDrawSurface_Release(surface); + IDirectDrawSurface_Release(rt); + refcount = IDirect3DDevice_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirectDraw_Release(ddraw); + DestroyWindow(window); +} + START_TEST(ddraw1) { IDirectDraw *ddraw; @@ -8573,4 +8649,5 @@ test_yv12_overlay(); test_offscreen_overlay(); test_overlay_rect(); + test_blt(); } diff -Nru wine-staging-1.9.6/dlls/ddraw/tests/ddraw2.c wine-staging-1.9.7~ubuntu15.04.1/dlls/ddraw/tests/ddraw2.c --- wine-staging-1.9.6/dlls/ddraw/tests/ddraw2.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/ddraw/tests/ddraw2.c 2016-04-04 18:06:32.000000000 +0000 @@ -9063,7 +9063,6 @@ DWORD color0, color1; IDirectDraw2 *ddraw; D3DLVERTEX *quad; - IDirect3D2 *d3d; ULONG refcount; UINT i, count; HWND window; @@ -9113,8 +9112,6 @@ return; } - hr = IDirect3DDevice2_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get d3d interface, hr %#x.\n", hr); hr = IDirect3DDevice2_GetRenderTarget(device, &rt); ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); @@ -9164,7 +9161,6 @@ destroy_viewport(device, viewport); destroy_material(background); IDirectDrawSurface_Release(rt); - IDirect3D2_Release(d3d); refcount = IDirect3DDevice2_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); IDirectDraw_Release(ddraw); @@ -9604,6 +9600,86 @@ DestroyWindow(window); } +static void test_blt(void) +{ + IDirectDrawSurface *surface, *rt; + DDSURFACEDESC surface_desc; + IDirect3DDevice2 *device; + IDirectDraw2 *ddraw; + unsigned int i; + ULONG refcount; + HWND window; + HRESULT hr; + + static struct + { + RECT src_rect; + RECT dst_rect; + HRESULT hr; + } + test_data[] = + { + {{160, 0, 640, 480}, { 0, 0, 480, 480}, DD_OK}, /* Overlapped blit. */ + {{160, 480, 640, 0}, { 0, 0, 480, 480}, DDERR_INVALIDRECT}, /* Overlapped blit, flipped source. */ + {{640, 0, 160, 480}, { 0, 0, 480, 480}, DDERR_INVALIDRECT}, /* Overlapped blit, mirrored source. */ + {{160, 0, 480, 480}, { 0, 0, 480, 480}, DD_OK}, /* Overlapped blit, stretched x. */ + {{160, 160, 640, 480}, { 0, 0, 480, 480}, DD_OK}, /* Overlapped blit, stretched y. */ + {{ 0, 0, 640, 480}, { 0, 0, 640, 480}, DD_OK}, /* Full surface blit. */ + {{ 0, 0, 640, 480}, { 0, 480, 640, 0}, DDERR_INVALIDRECT}, /* Full surface, flipped destination. */ + {{ 0, 0, 640, 480}, {640, 0, 0, 480}, DDERR_INVALIDRECT}, /* Full surface, mirrored destination. */ + {{ 0, 480, 640, 0}, { 0, 0, 640, 480}, DDERR_INVALIDRECT}, /* Full surface, flipped source. */ + {{640, 0, 0, 480}, { 0, 0, 640, 480}, DDERR_INVALIDRECT}, /* Full surface, mirrored source. */ + }; + + 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"); + if (!(device = create_device(ddraw, window, DDSCL_NORMAL))) + { + skip("Failed to create a 3D device, skipping test.\n"); + IDirectDraw2_Release(ddraw); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice2_GetRenderTarget(device, &rt); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS; + surface_desc.dwWidth = 640; + surface_desc.dwHeight = 480; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface_Blt(surface, NULL, surface, NULL, 0, NULL); + ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + + hr = IDirectDrawSurface_Blt(surface, NULL, rt, NULL, 0, NULL); + ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + + for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i) + { + hr = IDirectDrawSurface_Blt(surface, &test_data[i].dst_rect, + surface, &test_data[i].src_rect, DDBLT_WAIT, NULL); + ok(hr == test_data[i].hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, test_data[i].hr); + + hr = IDirectDrawSurface_Blt(surface, &test_data[i].dst_rect, + rt, &test_data[i].src_rect, DDBLT_WAIT, NULL); + ok(hr == test_data[i].hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, test_data[i].hr); + } + + IDirectDrawSurface_Release(surface); + IDirectDrawSurface_Release(rt); + refcount = IDirect3DDevice2_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirectDraw2_Release(ddraw); + DestroyWindow(window); +} + START_TEST(ddraw2) { IDirectDraw2 *ddraw; @@ -9687,4 +9763,5 @@ test_yv12_overlay(); test_offscreen_overlay(); test_overlay_rect(); + test_blt(); } diff -Nru wine-staging-1.9.6/dlls/ddraw/tests/ddraw4.c wine-staging-1.9.7~ubuntu15.04.1/dlls/ddraw/tests/ddraw4.c --- wine-staging-1.9.6/dlls/ddraw/tests/ddraw4.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/ddraw/tests/ddraw4.c 2016-04-04 18:06:32.000000000 +0000 @@ -10205,7 +10205,6 @@ static void test_shademode(void) { IDirect3DVertexBuffer *vb_strip, *vb_list, *buffer; - D3DRECT clear_rect = {{0}, {0}, {640}, {480}}; IDirect3DViewport3 *viewport; IDirect3DDevice3 *device; D3DVERTEXBUFFERDESC desc; @@ -10217,6 +10216,7 @@ UINT i, count; HWND window; HRESULT hr; + static D3DRECT clear_rect = {{0}, {0}, {640}, {480}}; static const struct { struct vec3 position; @@ -10775,6 +10775,187 @@ DestroyWindow(window); } +static void test_blt(void) +{ + IDirectDrawSurface4 *surface, *rt; + DDSURFACEDESC2 surface_desc; + IDirect3DDevice3 *device; + IDirectDraw4 *ddraw; + IDirect3D3 *d3d; + unsigned int i; + ULONG refcount; + HWND window; + HRESULT hr; + + static struct + { + RECT src_rect; + RECT dst_rect; + HRESULT hr; + } + test_data[] = + { + {{160, 0, 640, 480}, { 0, 0, 480, 480}, DD_OK}, /* Overlapped blit. */ + {{160, 480, 640, 0}, { 0, 0, 480, 480}, DDERR_INVALIDRECT}, /* Overlapped blit, flipped source. */ + {{640, 0, 160, 480}, { 0, 0, 480, 480}, DDERR_INVALIDRECT}, /* Overlapped blit, mirrored source. */ + {{160, 0, 480, 480}, { 0, 0, 480, 480}, DD_OK}, /* Overlapped blit, stretched x. */ + {{160, 160, 640, 480}, { 0, 0, 480, 480}, DD_OK}, /* Overlapped blit, stretched y. */ + {{ 0, 0, 640, 480}, { 0, 0, 640, 480}, DD_OK}, /* Full surface blit. */ + {{ 0, 0, 640, 480}, { 0, 480, 640, 0}, DDERR_INVALIDRECT}, /* Full surface, flipped destination. */ + {{ 0, 0, 640, 480}, {640, 0, 0, 480}, DDERR_INVALIDRECT}, /* Full surface, mirrored destination. */ + {{ 0, 480, 640, 0}, { 0, 0, 640, 480}, DDERR_INVALIDRECT}, /* Full surface, flipped source. */ + {{640, 0, 0, 480}, { 0, 0, 640, 480}, DDERR_INVALIDRECT}, /* Full surface, mirrored source. */ + }; + + window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, 0, 0, 0, 0); + if (!(device = create_device(window, DDSCL_NORMAL))) + { + skip("Failed to create a 3D device, skipping test.\n"); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice3_GetDirect3D(device, &d3d); + ok(SUCCEEDED(hr), "Failed to get Direct3D3 interface, hr %#x.\n", hr); + hr = IDirect3D3_QueryInterface(d3d, &IID_IDirectDraw4, (void **)&ddraw); + ok(SUCCEEDED(hr), "Failed to get DirectDraw4 interface, hr %#x.\n", hr); + IDirect3D3_Release(d3d); + hr = IDirect3DDevice3_GetRenderTarget(device, &rt); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS; + surface_desc.dwWidth = 640; + surface_desc.dwHeight = 480; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface_Blt(surface, NULL, surface, NULL, 0, NULL); + ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + + hr = IDirectDrawSurface_Blt(surface, NULL, rt, NULL, 0, NULL); + ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + + for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i) + { + hr = IDirectDrawSurface_Blt(surface, &test_data[i].dst_rect, + surface, &test_data[i].src_rect, DDBLT_WAIT, NULL); + ok(hr == test_data[i].hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, test_data[i].hr); + + hr = IDirectDrawSurface_Blt(surface, &test_data[i].dst_rect, + rt, &test_data[i].src_rect, DDBLT_WAIT, NULL); + ok(hr == test_data[i].hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, test_data[i].hr); + } + + IDirectDrawSurface4_Release(surface); + IDirectDrawSurface4_Release(rt); + IDirectDraw4_Release(ddraw); + refcount = IDirect3DDevice3_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + DestroyWindow(window); +} + +static void test_color_clamping(void) +{ + static D3DRECT clear_rect = {{0}, {0}, {640}, {480}}; + static D3DMATRIX mat = + { + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f, + }; + static struct vec3 quad[] = + { + {-1.0f, -1.0f, 0.1f}, + {-1.0f, 1.0f, 0.1f}, + { 1.0f, -1.0f, 0.1f}, + { 1.0f, 1.0f, 0.1f}, + }; + IDirect3DViewport3 *viewport; + IDirect3DDevice3 *device; + IDirectDrawSurface4 *rt; + ULONG refcount; + D3DCOLOR color; + HWND window; + HRESULT hr; + + window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + + if (!(device = create_device(window, DDSCL_NORMAL))) + { + skip("Failed to create a 3D device, skipping test.\n"); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice3_GetRenderTarget(device, &rt); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + + viewport = create_viewport(device, 0, 0, 640, 480); + hr = IDirect3DDevice3_SetCurrentViewport(device, viewport); + ok(SUCCEEDED(hr), "Failed to activate the viewport, hr %#x.\n", hr); + + hr = IDirect3DDevice3_SetTransform(device, D3DTRANSFORMSTATE_WORLD, &mat); + ok(SUCCEEDED(hr), "Failed to set world transform, hr %#x.\n", hr); + hr = IDirect3DDevice3_SetTransform(device, D3DTRANSFORMSTATE_VIEW, &mat); + ok(SUCCEEDED(hr), "Failed to set view transform, hr %#x.\n", hr); + hr = IDirect3DDevice3_SetTransform(device, D3DTRANSFORMSTATE_PROJECTION, &mat); + ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#x.\n", hr); + hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_CLIPPING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable clipping, hr %#x.\n", hr); + hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_ZENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable Z test, hr %#x.\n", hr); + hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_FOGENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable fog, hr %#x.\n", hr); + hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_STENCILENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable stencil test, hr %#x.\n", hr); + hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE); + ok(SUCCEEDED(hr), "Failed to disable culling, hr %#x.\n", hr); + hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); + + hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_TEXTUREFACTOR, 0xff404040); + ok(SUCCEEDED(hr), "Failed to set texture factor, hr %#x.\n", hr); + hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_ADD); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_DIFFUSE); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLORARG2, D3DTA_SPECULAR); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + hr = IDirect3DDevice3_SetTextureStageState(device, 1, D3DTSS_COLOROP, D3DTOP_MODULATE); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + hr = IDirect3DDevice3_SetTextureStageState(device, 1, D3DTSS_COLORARG1, D3DTA_TFACTOR); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + hr = IDirect3DDevice3_SetTextureStageState(device, 1, D3DTSS_COLORARG2, D3DTA_CURRENT); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + + hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xff00ff00, 0.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + + hr = IDirect3DDevice3_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + + hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, quad, 4, 0); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice3_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + + color = get_surface_color(rt, 320, 240); + ok(compare_color(color, 0x00404040, 1), "Got unexpected color 0x%08x.\n", color); + + destroy_viewport(device, viewport); + IDirectDrawSurface4_Release(rt); + refcount = IDirect3DDevice3_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + DestroyWindow(window); +} + START_TEST(ddraw4) { IDirectDraw4 *ddraw; @@ -10865,4 +11046,6 @@ test_yv12_overlay(); test_offscreen_overlay(); test_overlay_rect(); + test_blt(); + test_color_clamping(); } diff -Nru wine-staging-1.9.6/dlls/ddraw/tests/ddraw7.c wine-staging-1.9.7~ubuntu15.04.1/dlls/ddraw/tests/ddraw7.c --- wine-staging-1.9.6/dlls/ddraw/tests/ddraw7.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/ddraw/tests/ddraw7.c 2016-04-04 18:06:32.000000000 +0000 @@ -11048,6 +11048,180 @@ DestroyWindow(window); } +static void test_blt(void) +{ + IDirectDrawSurface7 *surface, *rt; + DDSURFACEDESC2 surface_desc; + IDirect3DDevice7 *device; + IDirectDraw7 *ddraw; + IDirect3D7 *d3d; + unsigned int i; + ULONG refcount; + HWND window; + HRESULT hr; + + static struct + { + RECT src_rect; + RECT dst_rect; + HRESULT hr; + } + test_data[] = + { + {{160, 0, 640, 480}, { 0, 0, 480, 480}, DD_OK}, /* Overlapped blit. */ + {{160, 480, 640, 0}, { 0, 0, 480, 480}, DDERR_INVALIDRECT}, /* Overlapped blit, flipped source. */ + {{640, 0, 160, 480}, { 0, 0, 480, 480}, DDERR_INVALIDRECT}, /* Overlapped blit, mirrored source. */ + {{160, 0, 480, 480}, { 0, 0, 480, 480}, DD_OK}, /* Overlapped blit, stretched x. */ + {{160, 160, 640, 480}, { 0, 0, 480, 480}, DD_OK}, /* Overlapped blit, stretched y. */ + {{ 0, 0, 640, 480}, { 0, 0, 640, 480}, DD_OK}, /* Full surface blit. */ + {{ 0, 0, 640, 480}, { 0, 480, 640, 0}, DDERR_INVALIDRECT}, /* Full surface, flipped destination. */ + {{ 0, 0, 640, 480}, {640, 0, 0, 480}, DDERR_INVALIDRECT}, /* Full surface, mirrored destination. */ + {{ 0, 480, 640, 0}, { 0, 0, 640, 480}, DDERR_INVALIDRECT}, /* Full surface, flipped source. */ + {{640, 0, 0, 480}, { 0, 0, 640, 480}, DDERR_INVALIDRECT}, /* Full surface, mirrored source. */ + }; + + window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, 0, 0, 0, 0); + if (!(device = create_device(window, DDSCL_NORMAL))) + { + skip("Failed to create a 3D device, skipping test.\n"); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice7_GetDirect3D(device, &d3d); + ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#x.\n", hr); + hr = IDirect3D7_QueryInterface(d3d, &IID_IDirectDraw7, (void **)&ddraw); + ok(SUCCEEDED(hr), "Failed to get DirectDraw7 interface, hr %#x.\n", hr); + IDirect3D7_Release(d3d); + hr = IDirect3DDevice7_GetRenderTarget(device, &rt); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS; + surface_desc.dwWidth = 640; + surface_desc.dwHeight = 480; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface_Blt(surface, NULL, surface, NULL, 0, NULL); + ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + + hr = IDirectDrawSurface_Blt(surface, NULL, rt, NULL, 0, NULL); + ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + + for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i) + { + hr = IDirectDrawSurface_Blt(surface, &test_data[i].dst_rect, + surface, &test_data[i].src_rect, DDBLT_WAIT, NULL); + ok(hr == test_data[i].hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, test_data[i].hr); + + hr = IDirectDrawSurface_Blt(surface, &test_data[i].dst_rect, + rt, &test_data[i].src_rect, DDBLT_WAIT, NULL); + ok(hr == test_data[i].hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, test_data[i].hr); + } + + IDirectDrawSurface7_Release(surface); + IDirectDrawSurface7_Release(rt); + IDirectDraw7_Release(ddraw); + refcount = IDirect3DDevice7_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + DestroyWindow(window); +} + +static void test_color_clamping(void) +{ + static D3DMATRIX mat = + { + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f, + }; + static struct vec3 quad[] = + { + {-1.0f, -1.0f, 0.1f}, + {-1.0f, 1.0f, 0.1f}, + { 1.0f, -1.0f, 0.1f}, + { 1.0f, 1.0f, 0.1f}, + }; + IDirect3DDevice7 *device; + IDirectDrawSurface7 *rt; + ULONG refcount; + D3DCOLOR color; + HWND window; + HRESULT hr; + + window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + + if (!(device = create_device(window, DDSCL_NORMAL))) + { + skip("Failed to create a 3D device, skipping test.\n"); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice7_GetRenderTarget(device, &rt); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + + hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_WORLD, &mat); + ok(SUCCEEDED(hr), "Failed to set world transform, hr %#x.\n", hr); + hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_VIEW, &mat); + ok(SUCCEEDED(hr), "Failed to set view transform, hr %#x.\n", hr); + hr = IDirect3DDevice7_SetTransform(device, D3DTRANSFORMSTATE_PROJECTION, &mat); + ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#x.\n", hr); + hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_CLIPPING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable clipping, hr %#x.\n", hr); + hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ZENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable Z test, hr %#x.\n", hr); + hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable fog, hr %#x.\n", hr); + hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_STENCILENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable stencil test, hr %#x.\n", hr); + hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE); + ok(SUCCEEDED(hr), "Failed to disable culling, hr %#x.\n", hr); + hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); + + hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_TEXTUREFACTOR, 0xff404040); + ok(SUCCEEDED(hr), "Failed to set texture factor, hr %#x.\n", hr); + hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_ADD); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_DIFFUSE); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLORARG2, D3DTA_SPECULAR); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + hr = IDirect3DDevice7_SetTextureStageState(device, 1, D3DTSS_COLOROP, D3DTOP_MODULATE); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + hr = IDirect3DDevice7_SetTextureStageState(device, 1, D3DTSS_COLORARG1, D3DTA_TFACTOR); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + hr = IDirect3DDevice7_SetTextureStageState(device, 1, D3DTSS_COLORARG2, D3DTA_CURRENT); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + + hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff00ff00, 0.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + + hr = IDirect3DDevice7_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + + hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, quad, 4, 0); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice7_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + + color = get_surface_color(rt, 320, 240); + ok(compare_color(color, 0x00404040, 1), "Got unexpected color 0x%08x.\n", color); + + IDirectDrawSurface7_Release(rt); + refcount = IDirect3DDevice7_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + DestroyWindow(window); +} + START_TEST(ddraw7) { HMODULE module = GetModuleHandleA("ddraw.dll"); @@ -11149,4 +11323,6 @@ test_yv12_overlay(); test_offscreen_overlay(); test_overlay_rect(); + test_blt(); + test_color_clamping(); } diff -Nru wine-staging-1.9.6/dlls/ddraw/tests/visual.c wine-staging-1.9.7~ubuntu15.04.1/dlls/ddraw/tests/visual.c --- wine-staging-1.9.6/dlls/ddraw/tests/visual.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/ddraw/tests/visual.c 2016-04-04 18:06:32.000000000 +0000 @@ -582,113 +582,6 @@ ok(hr == D3D_OK, "Turning off fog calculations returned %08x\n", hr); } -static void blt_test(IDirect3DDevice7 *device) -{ - IDirectDrawSurface7 *backbuffer = NULL, *offscreen = NULL; - DDSURFACEDESC2 ddsd; - HRESULT hr; - - memset(&ddsd, 0, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - U4(ddsd).ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat); - ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS; - ddsd.dwWidth = 640; - ddsd.dwHeight = 480; - ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_3DDEVICE; - hr = IDirectDraw7_CreateSurface(DirectDraw, &ddsd, &offscreen, NULL); - ok(hr == D3D_OK, "Creating the offscreen render target failed, hr = %08x\n", hr); - - /* Offscreen blits with the same source as destination */ - if(SUCCEEDED(hr)) - { - RECT src_rect, dst_rect; - - /* Blit the whole surface to itself */ - hr = IDirectDrawSurface_Blt(offscreen, NULL, offscreen, NULL, 0, NULL); - ok(hr == DD_OK, "IDirectDrawSurface7_Blt returned %08x\n", hr); - - /* Overlapped blit */ - dst_rect.left = 0; dst_rect.right = 480; - dst_rect.top = 0; dst_rect.bottom = 480; - src_rect.left = 160; src_rect.right = 640; - src_rect.top = 0; src_rect.bottom = 480; - hr = IDirectDrawSurface_Blt(offscreen, &dst_rect, offscreen, &src_rect, 0, NULL); - ok(hr == DD_OK, "IDirectDrawSurface7_Blt returned %08x\n", hr); - - /* Overlapped blit, flip-y through source rectangle (not allowed) */ - dst_rect.left = 0; dst_rect.right = 480; - dst_rect.top = 0; dst_rect.bottom = 480; - src_rect.left = 160; src_rect.right = 640; - src_rect.top = 480; src_rect.bottom = 0; - hr = IDirectDrawSurface_Blt(offscreen, &dst_rect, offscreen, &src_rect, 0, NULL); - ok(hr == DDERR_INVALIDRECT, "IDirectDrawSurface7_Blt returned %08x\n", hr); - - /* Overlapped blit, with shrinking in x */ - dst_rect.left = 0; dst_rect.right = 480; - dst_rect.top = 0; dst_rect.bottom = 480; - src_rect.left = 160; src_rect.right = 480; - src_rect.top = 0; src_rect.bottom = 480; - hr = IDirectDrawSurface_Blt(offscreen, &dst_rect, offscreen, &src_rect, 0, NULL); - ok(hr == DD_OK, "IDirectDrawSurface7_Blt returned %08x\n", hr); - } - - hr = IDirect3DDevice7_GetRenderTarget(device, &backbuffer); - ok(hr == D3D_OK, "Unable to obtain a surface pointer to the backbuffer, hr = %08x\n", hr); - - /* backbuffer ==> texture blits */ - if(SUCCEEDED(hr) && offscreen) - { - RECT src_rect, dst_rect; - - /* backbuffer ==> texture, src_rect=NULL, dst_rect=NULL, no scaling */ - hr = IDirectDrawSurface_Blt(offscreen, NULL, backbuffer, NULL, 0, NULL); - ok(hr == DD_OK, "fullscreen Blt from backbuffer => texture failed with hr = %08x\n", hr); - - /* backbuffer ==> texture, full surface blits, no scaling */ - dst_rect.left = 0; dst_rect.right = 640; - dst_rect.top = 0; dst_rect.bottom = 480; - src_rect.left = 0; src_rect.right = 640; - src_rect.top = 0; src_rect.bottom = 480; - hr = IDirectDrawSurface_Blt(offscreen, &dst_rect, backbuffer, &src_rect, 0, NULL); - ok(hr == DD_OK, "fullscreen Blt from backbuffer => texture failed with hr = %08x\n", hr); - - /* backbuffer ==> texture, flip in y-direction through source rectangle, no scaling (allowed) */ - dst_rect.left = 0; dst_rect.right = 640; - dst_rect.top = 480; dst_rect.top = 0; - src_rect.left = 0; src_rect.right = 640; - src_rect.top = 0; src_rect.bottom = 480; - hr = IDirectDrawSurface_Blt(offscreen, &dst_rect, backbuffer, &src_rect, 0, NULL); - ok(hr == DD_OK, "backbuffer => texture flip-y src_rect failed with hr = %08x\n", hr); - - /* backbuffer ==> texture, flip in x-direction through source rectangle, no scaling (not allowed) */ - dst_rect.left = 640; dst_rect.right = 0; - dst_rect.top = 0; dst_rect.top = 480; - src_rect.left = 0; src_rect.right = 640; - src_rect.top = 0; src_rect.bottom = 480; - hr = IDirectDrawSurface_Blt(offscreen, &dst_rect, backbuffer, &src_rect, 0, NULL); - ok(hr == DDERR_INVALIDRECT, "backbuffer => texture flip-x src_rect failed with hr = %08x\n", hr); - - /* backbuffer ==> texture, flip in y-direction through destination rectangle (not allowed) */ - dst_rect.left = 0; dst_rect.right = 640; - dst_rect.top = 0; dst_rect.top = 480; - src_rect.left = 0; src_rect.right = 640; - src_rect.top = 480; src_rect.bottom = 0; - hr = IDirectDrawSurface_Blt(offscreen, &dst_rect, backbuffer, &src_rect, 0, NULL); - ok(hr == DDERR_INVALIDRECT, "backbuffer => texture flip-y dst_rect failed with hr = %08x\n", hr); - - /* backbuffer ==> texture, flip in x-direction through destination rectangle, no scaling (not allowed) */ - dst_rect.left = 0; dst_rect.right = 640; - dst_rect.top = 0; dst_rect.top = 480; - src_rect.left = 640; src_rect.right = 0; - src_rect.top = 0; src_rect.bottom = 480; - hr = IDirectDrawSurface_Blt(offscreen, &dst_rect, backbuffer, &src_rect, 0, NULL); - ok(hr == DDERR_INVALIDRECT, "backbuffer => texture flip-x dst_rect failed with hr = %08x\n", hr); - } - - if(offscreen) IDirectDrawSurface7_Release(offscreen); - if(backbuffer) IDirectDrawSurface7_Release(backbuffer); -} - static void offscreen_test(IDirect3DDevice7 *device) { HRESULT hr; @@ -2130,7 +2023,6 @@ } /* Now run the tests */ - blt_test(Direct3DDevice); depth_clamp_test(Direct3DDevice); clear_test(Direct3DDevice); fog_test(Direct3DDevice); diff -Nru wine-staging-1.9.6/dlls/dinput/device.c wine-staging-1.9.7~ubuntu15.04.1/dlls/dinput/device.c --- wine-staging-1.9.6/dlls/dinput/device.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/dinput/device.c 2016-04-04 18:06:32.000000000 +0000 @@ -783,6 +783,7 @@ DIOBJECTDATAFORMAT *obj_df = NULL; DIPROPDWORD dp; DIPROPRANGE dpr; + DIPROPSTRING dps; WCHAR username[MAX_PATH]; DWORD username_size = MAX_PATH; int i, action = 0, num_actions = 0; @@ -863,6 +864,16 @@ else lstrcpynW(username, lpszUserName, MAX_PATH); + dps.diph.dwSize = sizeof(dps); + dps.diph.dwHeaderSize = sizeof(DIPROPHEADER); + dps.diph.dwObj = 0; + dps.diph.dwHow = DIPH_DEVICE; + if (dwFlags & DIDSAM_NOUSER) + dps.wsz[0] = '\0'; + else + lstrcpynW(dps.wsz, username, sizeof(dps.wsz)/sizeof(WCHAR)); + IDirectInputDevice8_SetProperty(iface, DIPROP_USERNAME, &dps.diph); + /* Save the settings to disk */ save_mapping_settings(iface, lpdiaf, username); @@ -1251,6 +1262,15 @@ TRACE("buffersize = %d\n", pd->dwData); break; } + case (DWORD_PTR) DIPROP_USERNAME: + { + LPDIPROPSTRING ps = (LPDIPROPSTRING)pdiph; + + if (pdiph->dwSize != sizeof(DIPROPSTRING)) return DIERR_INVALIDPARAM; + + lstrcpynW(ps->wsz, This->username, sizeof(ps->wsz)/sizeof(WCHAR)); + break; + } case (DWORD_PTR) DIPROP_VIDPID: FIXME("DIPROP_VIDPID not implemented\n"); return DIERR_UNSUPPORTED; @@ -1324,6 +1344,15 @@ LeaveCriticalSection(&This->crit); break; } + case (DWORD_PTR) DIPROP_USERNAME: + { + LPCDIPROPSTRING ps = (LPCDIPROPSTRING)pdiph; + + if (pdiph->dwSize != sizeof(DIPROPSTRING)) return DIERR_INVALIDPARAM; + + lstrcpynW(This->username, ps->wsz, sizeof(This->username)/sizeof(WCHAR)); + break; + } default: WARN("Unknown property %s\n", debugstr_guid(rguid)); return DIERR_UNSUPPORTED; diff -Nru wine-staging-1.9.6/dlls/dinput/device_private.h wine-staging-1.9.7~ubuntu15.04.1/dlls/dinput/device_private.h --- wine-staging-1.9.6/dlls/dinput/device_private.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/dinput/device_private.h 2016-04-04 18:06:32.000000000 +0000 @@ -81,6 +81,7 @@ /* Action mapping */ int num_actions; /* number of actions mapped */ ActionMap *action_map; /* array of mappings */ + WCHAR username[MAX_PATH]; }; extern BOOL get_app_key(HKEY*, HKEY*) DECLSPEC_HIDDEN; diff -Nru wine-staging-1.9.6/dlls/dinput/effect_linuxinput.c wine-staging-1.9.7~ubuntu15.04.1/dlls/dinput/effect_linuxinput.c --- wine-staging-1.9.6/dlls/dinput/effect_linuxinput.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/dinput/effect_linuxinput.c 2016-04-04 18:06:32.000000000 +0000 @@ -67,7 +67,7 @@ return CONTAINING_RECORD(iface, LinuxInputEffectImpl, IDirectInputEffect_iface); } -double ff_effect_direction_to_rad(unsigned int dir) +static double ff_effect_direction_to_rad(unsigned int dir) { return (dir & 0xffff) * M_PI / 0x8000; } diff -Nru wine-staging-1.9.6/dlls/dinput8/tests/device.c wine-staging-1.9.7~ubuntu15.04.1/dlls/dinput8/tests/device.c --- wine-staging-1.9.6/dlls/dinput8/tests/device.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/dinput8/tests/device.c 2016-04-04 18:06:32.000000000 +0000 @@ -223,8 +223,8 @@ dps.wsz[0] = '\0'; hr = IDirectInputDevice_GetProperty(lpdid, DIPROP_USERNAME, &dps.diph); - todo_wine ok (SUCCEEDED(hr), "GetProperty failed hr=%08x\n", hr); - todo_wine ok (!lstrcmpW(usernameW, dps.wsz), "Username not set correctly expected=%s, got=%s\n", wine_dbgstr_wn(usernameW, -1), wine_dbgstr_wn(dps.wsz, -1)); + ok (SUCCEEDED(hr), "GetProperty failed hr=%08x\n", hr); + ok (!lstrcmpW(usernameW, dps.wsz), "Username not set correctly expected=%s, got=%s\n", wine_dbgstr_w(usernameW), wine_dbgstr_w(dps.wsz)); /* Test buffer size */ memset(&dp, 0, sizeof(dp)); @@ -275,6 +275,7 @@ HINSTANCE hinst = GetModuleHandleA(NULL); IDirectInput8A *pDI = NULL; DIACTIONFORMATA af; + DIPROPSTRING dps; struct enum_data data = {pDI, &af, NULL, NULL, NULL, 0}; HWND hwnd; @@ -342,6 +343,30 @@ af.dwDataSize = 4 * sizeof(actionMapping) / sizeof(actionMapping[0]); af.dwNumActions = sizeof(actionMapping) / sizeof(actionMapping[0]); + + /* test DIDSAM_NOUSER */ + dps.diph.dwSize = sizeof(dps); + dps.diph.dwHeaderSize = sizeof(DIPROPHEADER); + dps.diph.dwObj = 0; + dps.diph.dwHow = DIPH_DEVICE; + dps.wsz[0] = '\0'; + + hr = IDirectInputDevice_GetProperty(data.keyboard, DIPROP_USERNAME, &dps.diph); + ok (SUCCEEDED(hr), "GetProperty failed hr=%08x\n", hr); + ok (dps.wsz[0] != 0, "Expected any username, got=%s\n", wine_dbgstr_w(dps.wsz)); + + hr = IDirectInputDevice8_SetActionMap(data.keyboard, data.lpdiaf, NULL, DIDSAM_NOUSER); + ok (SUCCEEDED(hr), "SetActionMap failed hr=%08x\n", hr); + + dps.diph.dwSize = sizeof(dps); + dps.diph.dwHeaderSize = sizeof(DIPROPHEADER); + dps.diph.dwObj = 0; + dps.diph.dwHow = DIPH_DEVICE; + dps.wsz[0] = '\0'; + + hr = IDirectInputDevice_GetProperty(data.keyboard, DIPROP_USERNAME, &dps.diph); + ok (SUCCEEDED(hr), "GetProperty failed hr=%08x\n", hr); + ok (dps.wsz[0] == 0, "Expected empty username, got=%s\n", wine_dbgstr_w(dps.wsz)); } if (data.mouse != NULL) diff -Nru wine-staging-1.9.6/dlls/dwmapi/dwmapi_main.c wine-staging-1.9.7~ubuntu15.04.1/dlls/dwmapi/dwmapi_main.c --- wine-staging-1.9.6/dlls/dwmapi/dwmapi_main.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/dwmapi/dwmapi_main.c 2016-04-04 18:06:32.000000000 +0000 @@ -259,3 +259,12 @@ FIXME("(%p, %p) stub\n", thumbnail, props); return E_NOTIMPL; } + +/********************************************************************** + * DwmSetPresentParameters (DWMAPI.@) + */ +HRESULT WINAPI DwmSetPresentParameters(HWND hwnd, DWM_PRESENT_PARAMETERS *params) +{ + FIXME("(%p %p) stub\n", hwnd, params); + return S_OK; +}; diff -Nru wine-staging-1.9.6/dlls/dwmapi/dwmapi.spec wine-staging-1.9.7~ubuntu15.04.1/dlls/dwmapi/dwmapi.spec --- wine-staging-1.9.6/dlls/dwmapi/dwmapi.spec 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/dwmapi/dwmapi.spec 2016-04-04 18:06:32.000000000 +0000 @@ -39,7 +39,7 @@ @ stub DwmQueryThumbnailSourceSize @ stdcall DwmRegisterThumbnail(long long ptr) @ stub DwmSetDxFrameDuration -@ stub DwmSetPresentParameters +@ stdcall DwmSetPresentParameters(ptr ptr) @ stdcall DwmSetWindowAttribute(long long ptr long) @ stdcall DwmUnregisterThumbnail(long) @ stdcall DwmUpdateThumbnailProperties(ptr ptr) diff -Nru wine-staging-1.9.6/dlls/dwrite/analyzer.c wine-staging-1.9.7~ubuntu15.04.1/dlls/dwrite/analyzer.c --- wine-staging-1.9.6/dlls/dwrite/analyzer.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/dwrite/analyzer.c 2016-04-04 18:06:32.000000000 +0000 @@ -198,7 +198,7 @@ struct dwrite_fontfallback { IDWriteFontFallback IDWriteFontFallback_iface; - IDWriteFactory2 *factory; + IDWriteFactory3 *factory; IDWriteFontCollection *systemcollection; const struct fallback_mapping *mappings; UINT32 count; @@ -1748,14 +1748,14 @@ { struct dwrite_fontfallback *fallback = impl_from_IDWriteFontFallback(iface); TRACE("(%p)\n", fallback); - return IDWriteFactory2_AddRef(fallback->factory); + return IDWriteFactory3_AddRef(fallback->factory); } static ULONG WINAPI fontfallback_Release(IDWriteFontFallback *iface) { struct dwrite_fontfallback *fallback = impl_from_IDWriteFontFallback(iface); TRACE("(%p)\n", fallback); - return IDWriteFactory2_Release(fallback->factory); + return IDWriteFactory3_Release(fallback->factory); } static int compare_fallback_mapping(const void *a, const void *b) @@ -1931,7 +1931,7 @@ fontfallback_MapCharacters }; -HRESULT create_system_fontfallback(IDWriteFactory2 *factory, IDWriteFontFallback **ret) +HRESULT create_system_fontfallback(IDWriteFactory3 *factory, IDWriteFontFallback **ret) { struct dwrite_fontfallback *fallback; @@ -1945,7 +1945,7 @@ fallback->factory = factory; fallback->mappings = fontfallback_neutral_data; fallback->count = sizeof(fontfallback_neutral_data)/sizeof(fontfallback_neutral_data[0]); - IDWriteFactory2_GetSystemFontCollection(fallback->factory, &fallback->systemcollection, FALSE); + IDWriteFactory2_GetSystemFontCollection((IDWriteFactory2*)fallback->factory, &fallback->systemcollection, FALSE); *ret = &fallback->IDWriteFontFallback_iface; return S_OK; diff -Nru wine-staging-1.9.6/dlls/dwrite/dwrite_private.h wine-staging-1.9.7~ubuntu15.04.1/dlls/dwrite/dwrite_private.h --- wine-staging-1.9.6/dlls/dwrite/dwrite_private.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/dwrite/dwrite_private.h 2016-04-04 18:06:32.000000000 +0000 @@ -115,24 +115,24 @@ extern HRESULT create_numbersubstitution(DWRITE_NUMBER_SUBSTITUTION_METHOD,const WCHAR *locale,BOOL,IDWriteNumberSubstitution**) DECLSPEC_HIDDEN; extern HRESULT create_textformat(const WCHAR*,IDWriteFontCollection*,DWRITE_FONT_WEIGHT,DWRITE_FONT_STYLE,DWRITE_FONT_STRETCH, FLOAT,const WCHAR*,IDWriteTextFormat**) DECLSPEC_HIDDEN; -extern HRESULT create_textlayout(IDWriteFactory2*,const WCHAR*,UINT32,IDWriteTextFormat*,FLOAT,FLOAT,IDWriteTextLayout**) DECLSPEC_HIDDEN; -extern HRESULT create_gdicompat_textlayout(IDWriteFactory2*,const WCHAR*,UINT32,IDWriteTextFormat*,FLOAT,FLOAT,FLOAT, +extern HRESULT create_textlayout(IDWriteFactory3*,const WCHAR*,UINT32,IDWriteTextFormat*,FLOAT,FLOAT,IDWriteTextLayout**) DECLSPEC_HIDDEN; +extern HRESULT create_gdicompat_textlayout(IDWriteFactory3*,const WCHAR*,UINT32,IDWriteTextFormat*,FLOAT,FLOAT,FLOAT, const DWRITE_MATRIX*,BOOL,IDWriteTextLayout**) DECLSPEC_HIDDEN; -extern HRESULT create_trimmingsign(IDWriteFactory2*,IDWriteTextFormat*,IDWriteInlineObject**) DECLSPEC_HIDDEN; +extern HRESULT create_trimmingsign(IDWriteFactory3*,IDWriteTextFormat*,IDWriteInlineObject**) DECLSPEC_HIDDEN; extern HRESULT create_typography(IDWriteTypography**) DECLSPEC_HIDDEN; -extern HRESULT create_gdiinterop(IDWriteFactory2*,IDWriteGdiInterop**) DECLSPEC_HIDDEN; +extern HRESULT create_gdiinterop(IDWriteFactory3*,IDWriteGdiInterop**) DECLSPEC_HIDDEN; extern void release_gdiinterop(IDWriteGdiInterop*) DECLSPEC_HIDDEN; extern HRESULT create_localizedstrings(IDWriteLocalizedStrings**) DECLSPEC_HIDDEN; extern HRESULT add_localizedstring(IDWriteLocalizedStrings*,const WCHAR*,const WCHAR*) DECLSPEC_HIDDEN; extern HRESULT clone_localizedstring(IDWriteLocalizedStrings *iface, IDWriteLocalizedStrings **strings) DECLSPEC_HIDDEN; extern void set_en_localizedstring(IDWriteLocalizedStrings*,const WCHAR*) DECLSPEC_HIDDEN; -extern HRESULT get_system_fontcollection(IDWriteFactory2*,IDWriteFontCollection**) DECLSPEC_HIDDEN; -extern HRESULT get_eudc_fontcollection(IDWriteFactory2*,IDWriteFontCollection**) DECLSPEC_HIDDEN; +extern HRESULT get_system_fontcollection(IDWriteFactory3*,IDWriteFontCollection**) DECLSPEC_HIDDEN; +extern HRESULT get_eudc_fontcollection(IDWriteFactory3*,IDWriteFontCollection**) DECLSPEC_HIDDEN; extern HRESULT get_textanalyzer(IDWriteTextAnalyzer**) DECLSPEC_HIDDEN; extern HRESULT create_font_file(IDWriteFontFileLoader *loader, const void *reference_key, UINT32 key_size, IDWriteFontFile **font_file) DECLSPEC_HIDDEN; extern HRESULT create_localfontfileloader(IDWriteLocalFontFileLoader** iface) DECLSPEC_HIDDEN; extern HRESULT create_fontface(DWRITE_FONT_FACE_TYPE,UINT32,IDWriteFontFile* const*,UINT32,DWRITE_FONT_SIMULATIONS,IDWriteFontFace3**) DECLSPEC_HIDDEN; -extern HRESULT create_font_collection(IDWriteFactory2*,IDWriteFontFileEnumerator*,BOOL,IDWriteFontCollection**) DECLSPEC_HIDDEN; +extern HRESULT create_font_collection(IDWriteFactory3*,IDWriteFontFileEnumerator*,BOOL,IDWriteFontCollection**) DECLSPEC_HIDDEN; extern HRESULT create_glyphrunanalysis(DWRITE_RENDERING_MODE,DWRITE_MEASURING_MODE,DWRITE_GLYPH_RUN const*,FLOAT,const DWRITE_MATRIX*, DWRITE_GRID_FIT_MODE,DWRITE_TEXT_ANTIALIAS_MODE,FLOAT,FLOAT,IDWriteGlyphRunAnalysis**) DECLSPEC_HIDDEN; extern BOOL is_system_collection(IDWriteFontCollection*) DECLSPEC_HIDDEN; @@ -143,7 +143,7 @@ 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; -extern HRESULT create_system_fontfallback(IDWriteFactory2*,IDWriteFontFallback**) DECLSPEC_HIDDEN; +extern HRESULT create_system_fontfallback(IDWriteFactory3*,IDWriteFontFallback**) DECLSPEC_HIDDEN; extern void release_system_fontfallback(IDWriteFontFallback*) DECLSPEC_HIDDEN; extern HRESULT create_matching_font(IDWriteFontCollection*,const WCHAR*,DWRITE_FONT_WEIGHT,DWRITE_FONT_STYLE,DWRITE_FONT_STRETCH, IDWriteFont**) DECLSPEC_HIDDEN; diff -Nru wine-staging-1.9.6/dlls/dwrite/font.c wine-staging-1.9.7~ubuntu15.04.1/dlls/dwrite/font.c --- wine-staging-1.9.6/dlls/dwrite/font.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/dwrite/font.c 2016-04-04 18:06:32.000000000 +0000 @@ -82,7 +82,7 @@ IDWriteLocalizedStrings *names; /* data needed to create fontface instance */ - IDWriteFactory2 *factory; + IDWriteFactory3 *factory; DWRITE_FONT_FACE_TYPE face_type; IDWriteFontFile *file; UINT32 face_index; @@ -390,7 +390,7 @@ IDWriteLocalizedStrings_Release(data->names); IDWriteFontFile_Release(data->file); - IDWriteFactory2_Release(data->factory); + IDWriteFactory3_Release(data->factory); heap_free(data->facename); heap_free(data); } @@ -1211,7 +1211,7 @@ *fontface = NULL; - hr = IDWriteFactory2_CreateFontFace(data->factory, data->face_type, 1, &data->file, + hr = IDWriteFactory3_CreateFontFace(data->factory, data->face_type, 1, &data->file, data->face_index, font->data->simulations, &face); if (FAILED(hr)) return hr; @@ -3022,7 +3022,7 @@ return TRUE; } -static HRESULT init_font_data(IDWriteFactory2 *factory, IDWriteFontFile *file, DWRITE_FONT_FACE_TYPE face_type, UINT32 face_index, +static HRESULT init_font_data(IDWriteFactory3 *factory, IDWriteFontFile *file, DWRITE_FONT_FACE_TYPE face_type, UINT32 face_index, IDWriteLocalizedStrings **family_name, struct dwrite_font_data **ret) { struct dwrite_font_props props; @@ -3051,7 +3051,7 @@ data->bold_sim_tested = 0; data->oblique_sim_tested = 0; IDWriteFontFile_AddRef(file); - IDWriteFactory2_AddRef(factory); + IDWriteFactory3_AddRef(factory); opentype_get_font_properties(stream, face_type, face_index, &props); opentype_get_font_metrics(stream, face_type, face_index, &data->metrics, NULL); @@ -3103,7 +3103,7 @@ data->style = DWRITE_FONT_STYLE_OBLIQUE; memset(data->info_strings, 0, sizeof(data->info_strings)); data->names = NULL; - IDWriteFactory2_AddRef(data->factory); + IDWriteFactory3_AddRef(data->factory); IDWriteFontFile_AddRef(data->file); create_localizedstrings(&data->names); @@ -3359,7 +3359,7 @@ RegCloseKey(hkey); } -HRESULT create_font_collection(IDWriteFactory2* factory, IDWriteFontFileEnumerator *enumerator, BOOL is_system, IDWriteFontCollection **ret) +HRESULT create_font_collection(IDWriteFactory3 *factory, IDWriteFontFileEnumerator *enumerator, BOOL is_system, IDWriteFontCollection **ret) { struct fontfile_enum { struct list entry; @@ -3493,7 +3493,7 @@ IDWriteFontFileEnumerator IDWriteFontFileEnumerator_iface; LONG ref; - IDWriteFactory2 *factory; + IDWriteFactory3 *factory; HKEY hkey; int index; }; @@ -3528,7 +3528,7 @@ ULONG ref = InterlockedDecrement(&enumerator->ref); if (!ref) { - IDWriteFactory2_Release(enumerator->factory); + IDWriteFactory3_Release(enumerator->factory); RegCloseKey(enumerator->hkey); heap_free(enumerator); } @@ -3536,7 +3536,7 @@ return ref; } -static HRESULT create_local_file_reference(IDWriteFactory2 *factory, const WCHAR *filename, IDWriteFontFile **file) +static HRESULT create_local_file_reference(IDWriteFactory3 *factory, const WCHAR *filename, IDWriteFontFile **file) { HRESULT hr; @@ -3549,10 +3549,10 @@ strcatW(fullpathW, fontsW); strcatW(fullpathW, filename); - hr = IDWriteFactory2_CreateFontFileReference(factory, fullpathW, NULL, file); + hr = IDWriteFactory3_CreateFontFileReference(factory, fullpathW, NULL, file); } else - hr = IDWriteFactory2_CreateFontFileReference(factory, filename, NULL, file); + hr = IDWriteFactory3_CreateFontFileReference(factory, filename, NULL, file); return hr; } @@ -3640,7 +3640,7 @@ systemfontfileenumerator_GetCurrentFontFile }; -static HRESULT create_system_fontfile_enumerator(IDWriteFactory2 *factory, IDWriteFontFileEnumerator **ret) +static HRESULT create_system_fontfile_enumerator(IDWriteFactory3 *factory, IDWriteFontFileEnumerator **ret) { struct system_fontfile_enumerator *enumerator; static const WCHAR fontslistW[] = { @@ -3659,11 +3659,11 @@ enumerator->ref = 1; enumerator->factory = factory; enumerator->index = -1; - IDWriteFactory2_AddRef(factory); + IDWriteFactory3_AddRef(factory); if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, fontslistW, 0, GENERIC_READ, &enumerator->hkey)) { ERR("failed to open fonts list key\n"); - IDWriteFactory2_Release(factory); + IDWriteFactory3_Release(factory); heap_free(enumerator); return E_FAIL; } @@ -3673,7 +3673,7 @@ return S_OK; } -HRESULT get_system_fontcollection(IDWriteFactory2 *factory, IDWriteFontCollection **collection) +HRESULT get_system_fontcollection(IDWriteFactory3 *factory, IDWriteFontCollection **collection) { IDWriteFontFileEnumerator *enumerator; HRESULT hr; @@ -3690,7 +3690,7 @@ return hr; } -static HRESULT eudc_collection_add_family(IDWriteFactory2 *factory, struct dwrite_fontcollection *collection, +static HRESULT eudc_collection_add_family(IDWriteFactory3 *factory, struct dwrite_fontcollection *collection, const WCHAR *keynameW, const WCHAR *pathW) { static const WCHAR defaultfontW[] = {'S','y','s','t','e','m','D','e','f','a','u','l','t','E','U','D','C','F','o','n','t',0}; @@ -3760,7 +3760,7 @@ return hr; } -HRESULT get_eudc_fontcollection(IDWriteFactory2 *factory, IDWriteFontCollection **ret) +HRESULT get_eudc_fontcollection(IDWriteFactory3 *factory, IDWriteFontCollection **ret) { static const WCHAR eudckeyfmtW[] = {'E','U','D','C','\\','%','u',0}; struct dwrite_fontcollection *collection; diff -Nru wine-staging-1.9.6/dlls/dwrite/gdiinterop.c wine-staging-1.9.7~ubuntu15.04.1/dlls/dwrite/gdiinterop.c --- wine-staging-1.9.6/dlls/dwrite/gdiinterop.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/dwrite/gdiinterop.c 2016-04-04 18:06:32.000000000 +0000 @@ -34,7 +34,7 @@ struct gdiinterop { IDWriteGdiInterop IDWriteGdiInterop_iface; - IDWriteFactory2 *factory; + IDWriteFactory3 *factory; }; struct dib_data { @@ -605,14 +605,14 @@ { struct gdiinterop *This = impl_from_IDWriteGdiInterop(iface); TRACE("(%p)\n", This); - return IDWriteFactory2_AddRef(This->factory); + return IDWriteFactory3_AddRef(This->factory); } static ULONG WINAPI gdiinterop_Release(IDWriteGdiInterop *iface) { struct gdiinterop *This = impl_from_IDWriteGdiInterop(iface); TRACE("(%p)\n", This); - return IDWriteFactory2_Release(This->factory); + return IDWriteFactory3_Release(This->factory); } static HRESULT WINAPI gdiinterop_CreateFontFromLOGFONT(IDWriteGdiInterop *iface, @@ -632,7 +632,7 @@ if (!logfont) return E_INVALIDARG; - hr = IDWriteFactory2_GetSystemFontCollection(This->factory, &collection, FALSE); + hr = IDWriteFactory2_GetSystemFontCollection((IDWriteFactory2*)This->factory, &collection, FALSE); if (FAILED(hr)) { ERR("failed to get system font collection: 0x%08x.\n", hr); return hr; @@ -847,7 +847,7 @@ return E_FAIL; } - hr = IDWriteFactory2_CreateFontFileReference(This->factory, fileinfo->path, &fileinfo->writetime, + hr = IDWriteFactory3_CreateFontFileReference(This->factory, fileinfo->path, &fileinfo->writetime, &file); heap_free(fileinfo); if (FAILED(hr)) @@ -861,7 +861,7 @@ } /* Simulations flags values match DWRITE_FONT_SIMULATIONS */ - hr = IDWriteFactory2_CreateFontFace(This->factory, facetype, 1, &file, info.face_index, info.simulations, + hr = IDWriteFactory3_CreateFontFace(This->factory, facetype, 1, &file, info.face_index, info.simulations, fontface); IDWriteFontFile_Release(file); return hr; @@ -886,7 +886,7 @@ gdiinterop_CreateBitmapRenderTarget }; -HRESULT create_gdiinterop(IDWriteFactory2 *factory, IDWriteGdiInterop **ret) +HRESULT create_gdiinterop(IDWriteFactory3 *factory, IDWriteGdiInterop **ret) { struct gdiinterop *This; diff -Nru wine-staging-1.9.6/dlls/dwrite/layout.c wine-staging-1.9.7~ubuntu15.04.1/dlls/dwrite/layout.c --- wine-staging-1.9.6/dlls/dwrite/layout.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/dwrite/layout.c 2016-04-04 18:06:32.000000000 +0000 @@ -238,7 +238,7 @@ IDWriteTextAnalysisSource1 IDWriteTextAnalysisSource1_iface; LONG ref; - IDWriteFactory2 *factory; + IDWriteFactory3 *factory; WCHAR *str; UINT32 len; @@ -781,7 +781,7 @@ IDWriteFontFallback_AddRef(fallback); } else { - hr = IDWriteFactory2_GetSystemFontFallback(layout->factory, &fallback); + hr = IDWriteFactory3_GetSystemFontFallback(layout->factory, &fallback); if (FAILED(hr)) return hr; } @@ -2599,7 +2599,7 @@ TRACE("(%p)->(%d)\n", This, ref); if (!ref) { - IDWriteFactory2_Release(This->factory); + IDWriteFactory3_Release(This->factory); free_layout_ranges_list(This); free_layout_eruns(This); free_layout_runs(This); @@ -4441,7 +4441,7 @@ return IDWriteTextFormat_GetFontCollection(format, &layout->format.collection); } -static HRESULT init_textlayout(IDWriteFactory2 *factory, const WCHAR *str, UINT32 len, IDWriteTextFormat *format, +static HRESULT init_textlayout(IDWriteFactory3 *factory, const WCHAR *str, UINT32 len, IDWriteTextFormat *format, FLOAT maxwidth, FLOAT maxheight, struct dwrite_textlayout *layout) { struct layout_range_header *range, *strike, *underline, *effect, *spacing, *typography; @@ -4511,7 +4511,7 @@ } layout->factory = factory; - IDWriteFactory2_AddRef(layout->factory); + IDWriteFactory3_AddRef(layout->factory); list_add_head(&layout->ranges, &range->entry); list_add_head(&layout->strike_ranges, &strike->entry); list_add_head(&layout->underline_ranges, &underline->entry); @@ -4525,7 +4525,7 @@ return hr; } -HRESULT create_textlayout(IDWriteFactory2 *factory, const WCHAR *str, UINT32 len, IDWriteTextFormat *format, +HRESULT create_textlayout(IDWriteFactory3 *factory, const WCHAR *str, UINT32 len, IDWriteTextFormat *format, FLOAT maxwidth, FLOAT maxheight, IDWriteTextLayout **ret) { struct dwrite_textlayout *layout; @@ -4546,7 +4546,7 @@ return hr; } -HRESULT create_gdicompat_textlayout(IDWriteFactory2 *factory, const WCHAR *str, UINT32 len, IDWriteTextFormat *format, +HRESULT create_gdicompat_textlayout(IDWriteFactory3 *factory, const WCHAR *str, UINT32 len, IDWriteTextFormat *format, FLOAT maxwidth, FLOAT maxheight, FLOAT ppdip, const DWRITE_MATRIX *transform, BOOL use_gdi_natural, IDWriteTextLayout **ret) { struct dwrite_textlayout *layout; @@ -4701,7 +4701,7 @@ (direction == DWRITE_FLOW_DIRECTION_BOTTOM_TO_TOP); } -HRESULT create_trimmingsign(IDWriteFactory2 *factory, IDWriteTextFormat *format, IDWriteInlineObject **sign) +HRESULT create_trimmingsign(IDWriteFactory3 *factory, IDWriteTextFormat *format, IDWriteInlineObject **sign) { static const WCHAR ellipsisW = 0x2026; struct dwrite_trimmingsign *This; @@ -4727,7 +4727,7 @@ This->IDWriteInlineObject_iface.lpVtbl = &dwritetrimmingsignvtbl; This->ref = 1; - hr = IDWriteFactory2_CreateTextLayout(factory, &ellipsisW, 1, format, 0.0f, 0.0f, &This->layout); + hr = IDWriteFactory3_CreateTextLayout(factory, &ellipsisW, 1, format, 0.0f, 0.0f, &This->layout); if (FAILED(hr)) { heap_free(This); return hr; diff -Nru wine-staging-1.9.6/dlls/dwrite/main.c wine-staging-1.9.7~ubuntu15.04.1/dlls/dwrite/main.c --- wine-staging-1.9.6/dlls/dwrite/main.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/dwrite/main.c 2016-04-04 18:06:32.000000000 +0000 @@ -34,8 +34,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(dwrite); -static IDWriteFactory2 *shared_factory; -static void release_shared_factory(IDWriteFactory2*); +static IDWriteFactory3 *shared_factory; +static void release_shared_factory(IDWriteFactory3*); BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved) { @@ -506,7 +506,7 @@ }; struct dwritefactory { - IDWriteFactory2 IDWriteFactory2_iface; + IDWriteFactory3 IDWriteFactory3_iface; LONG ref; IDWriteFontCollection *system_collection; @@ -521,14 +521,14 @@ struct list file_loaders; }; -static inline struct dwritefactory *impl_from_IDWriteFactory2(IDWriteFactory2 *iface) +static inline struct dwritefactory *impl_from_IDWriteFactory3(IDWriteFactory3 *iface) { - return CONTAINING_RECORD(iface, struct dwritefactory, IDWriteFactory2_iface); + return CONTAINING_RECORD(iface, struct dwritefactory, IDWriteFactory3_iface); } -void notify_factory_fallback_removed(IDWriteFactory2 *iface) +void notify_factory_fallback_removed(IDWriteFactory3 *iface) { - struct dwritefactory *factory = impl_from_IDWriteFactory2(iface); + struct dwritefactory *factory = impl_from_IDWriteFactory3(iface); factory->fallback = NULL; } @@ -579,11 +579,11 @@ heap_free(factory); } -static void release_shared_factory(IDWriteFactory2 *iface) +static void release_shared_factory(IDWriteFactory3 *iface) { struct dwritefactory *factory; if (!iface) return; - factory = impl_from_IDWriteFactory2(iface); + factory = impl_from_IDWriteFactory3(iface); release_dwritefactory(factory); } @@ -615,19 +615,20 @@ return found; } -static HRESULT WINAPI dwritefactory_QueryInterface(IDWriteFactory2 *iface, REFIID riid, void **obj) +static HRESULT WINAPI dwritefactory_QueryInterface(IDWriteFactory3 *iface, REFIID riid, void **obj) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj); - if (IsEqualIID(riid, &IID_IDWriteFactory2) || + if (IsEqualIID(riid, &IID_IDWriteFactory3) || + IsEqualIID(riid, &IID_IDWriteFactory2) || IsEqualIID(riid, &IID_IDWriteFactory1) || IsEqualIID(riid, &IID_IDWriteFactory) || IsEqualIID(riid, &IID_IUnknown)) { *obj = iface; - IDWriteFactory2_AddRef(iface); + IDWriteFactory3_AddRef(iface); return S_OK; } @@ -636,17 +637,17 @@ return E_NOINTERFACE; } -static ULONG WINAPI dwritefactory_AddRef(IDWriteFactory2 *iface) +static ULONG WINAPI dwritefactory_AddRef(IDWriteFactory3 *iface) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); ULONG ref = InterlockedIncrement(&This->ref); TRACE("(%p)->(%d)\n", This, ref); return ref; } -static ULONG WINAPI dwritefactory_Release(IDWriteFactory2 *iface) +static ULONG WINAPI dwritefactory_Release(IDWriteFactory3 *iface) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); ULONG ref = InterlockedDecrement(&This->ref); TRACE("(%p)->(%d)\n", This, ref); @@ -657,11 +658,11 @@ return ref; } -static HRESULT WINAPI dwritefactory_GetSystemFontCollection(IDWriteFactory2 *iface, +static HRESULT WINAPI dwritefactory_GetSystemFontCollection(IDWriteFactory3 *iface, IDWriteFontCollection **collection, BOOL check_for_updates) { HRESULT hr = S_OK; - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); TRACE("(%p)->(%p %d)\n", This, collection, check_for_updates); if (check_for_updates) @@ -678,10 +679,10 @@ return hr; } -static HRESULT WINAPI dwritefactory_CreateCustomFontCollection(IDWriteFactory2 *iface, +static HRESULT WINAPI dwritefactory_CreateCustomFontCollection(IDWriteFactory3 *iface, IDWriteFontCollectionLoader *loader, void const *key, UINT32 key_size, IDWriteFontCollection **collection) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); IDWriteFontFileEnumerator *enumerator; struct collectionloader *found; HRESULT hr; @@ -706,10 +707,10 @@ return hr; } -static HRESULT WINAPI dwritefactory_RegisterFontCollectionLoader(IDWriteFactory2 *iface, +static HRESULT WINAPI dwritefactory_RegisterFontCollectionLoader(IDWriteFactory3 *iface, IDWriteFontCollectionLoader *loader) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); struct collectionloader *entry; TRACE("(%p)->(%p)\n", This, loader); @@ -731,10 +732,10 @@ return S_OK; } -static HRESULT WINAPI dwritefactory_UnregisterFontCollectionLoader(IDWriteFactory2 *iface, +static HRESULT WINAPI dwritefactory_UnregisterFontCollectionLoader(IDWriteFactory3 *iface, IDWriteFontCollectionLoader *loader) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); struct collectionloader *found; TRACE("(%p)->(%p)\n", This, loader); @@ -753,10 +754,10 @@ return S_OK; } -static HRESULT WINAPI dwritefactory_CreateFontFileReference(IDWriteFactory2 *iface, +static HRESULT WINAPI dwritefactory_CreateFontFileReference(IDWriteFactory3 *iface, WCHAR const *path, FILETIME const *writetime, IDWriteFontFile **font_file) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); UINT32 key_size; HRESULT hr; void *key; @@ -781,10 +782,10 @@ return hr; } -static HRESULT WINAPI dwritefactory_CreateCustomFontFileReference(IDWriteFactory2 *iface, +static HRESULT WINAPI dwritefactory_CreateCustomFontFileReference(IDWriteFactory3 *iface, void const *reference_key, UINT32 key_size, IDWriteFontFileLoader *loader, IDWriteFontFile **font_file) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); TRACE("(%p)->(%p %u %p %p)\n", This, reference_key, key_size, loader, font_file); @@ -796,11 +797,11 @@ return create_font_file(loader, reference_key, key_size, font_file); } -static HRESULT WINAPI dwritefactory_CreateFontFace(IDWriteFactory2 *iface, +static HRESULT WINAPI dwritefactory_CreateFontFace(IDWriteFactory3 *iface, DWRITE_FONT_FACE_TYPE req_facetype, UINT32 files_number, IDWriteFontFile* const* font_files, UINT32 index, DWRITE_FONT_SIMULATIONS simulations, IDWriteFontFace **font_face) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); DWRITE_FONT_FILE_TYPE file_type; DWRITE_FONT_FACE_TYPE face_type; IDWriteFontFileLoader *loader; @@ -906,9 +907,9 @@ return S_OK; } -static HRESULT WINAPI dwritefactory_CreateRenderingParams(IDWriteFactory2 *iface, IDWriteRenderingParams **params) +static HRESULT WINAPI dwritefactory_CreateRenderingParams(IDWriteFactory3 *iface, IDWriteRenderingParams **params) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); HMONITOR monitor; POINT pt; @@ -916,13 +917,13 @@ pt.x = pt.y = 0; monitor = MonitorFromPoint(pt, MONITOR_DEFAULTTOPRIMARY); - return IDWriteFactory2_CreateMonitorRenderingParams(iface, monitor, params); + return IDWriteFactory3_CreateMonitorRenderingParams(iface, monitor, params); } -static HRESULT WINAPI dwritefactory_CreateMonitorRenderingParams(IDWriteFactory2 *iface, HMONITOR monitor, +static HRESULT WINAPI dwritefactory_CreateMonitorRenderingParams(IDWriteFactory3 *iface, HMONITOR monitor, IDWriteRenderingParams **params) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); IDWriteRenderingParams2 *params2; static int fixme_once = 0; HRESULT hr; @@ -932,30 +933,30 @@ if (!fixme_once++) FIXME("(%p): monitor setting ignored\n", monitor); - hr = IDWriteFactory2_CreateCustomRenderingParams(iface, 0.0f, 0.0f, 1.0f, 0.0f, DWRITE_PIXEL_GEOMETRY_FLAT, DWRITE_RENDERING_MODE_DEFAULT, + hr = IDWriteFactory2_CreateCustomRenderingParams((IDWriteFactory2*)iface, 0.0f, 0.0f, 1.0f, 0.0f, DWRITE_PIXEL_GEOMETRY_FLAT, DWRITE_RENDERING_MODE_DEFAULT, DWRITE_GRID_FIT_MODE_DEFAULT, ¶ms2); *params = (IDWriteRenderingParams*)params2; return hr; } -static HRESULT WINAPI dwritefactory_CreateCustomRenderingParams(IDWriteFactory2 *iface, FLOAT gamma, FLOAT enhancedContrast, +static HRESULT WINAPI dwritefactory_CreateCustomRenderingParams(IDWriteFactory3 *iface, FLOAT gamma, FLOAT enhancedContrast, FLOAT cleartype_level, DWRITE_PIXEL_GEOMETRY geometry, DWRITE_RENDERING_MODE mode, IDWriteRenderingParams **params) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); IDWriteRenderingParams2 *params2; HRESULT hr; TRACE("(%p)->(%f %f %f %d %d %p)\n", This, gamma, enhancedContrast, cleartype_level, geometry, mode, params); - hr = IDWriteFactory2_CreateCustomRenderingParams(iface, gamma, enhancedContrast, 1.0f, cleartype_level, geometry, + hr = IDWriteFactory2_CreateCustomRenderingParams((IDWriteFactory2*)iface, gamma, enhancedContrast, 1.0f, cleartype_level, geometry, mode, DWRITE_GRID_FIT_MODE_DEFAULT, ¶ms2); *params = (IDWriteRenderingParams*)params2; return hr; } -static HRESULT WINAPI dwritefactory_RegisterFontFileLoader(IDWriteFactory2 *iface, IDWriteFontFileLoader *loader) +static HRESULT WINAPI dwritefactory_RegisterFontFileLoader(IDWriteFactory3 *iface, IDWriteFontFileLoader *loader) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); struct fileloader *entry; TRACE("(%p)->(%p)\n", This, loader); @@ -981,9 +982,9 @@ return S_OK; } -static HRESULT WINAPI dwritefactory_UnregisterFontFileLoader(IDWriteFactory2 *iface, IDWriteFontFileLoader *loader) +static HRESULT WINAPI dwritefactory_UnregisterFontFileLoader(IDWriteFactory3 *iface, IDWriteFontFileLoader *loader) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); struct fileloader *found; TRACE("(%p)->(%p)\n", This, loader); @@ -1002,11 +1003,11 @@ return S_OK; } -static HRESULT WINAPI dwritefactory_CreateTextFormat(IDWriteFactory2 *iface, WCHAR const* family_name, +static HRESULT WINAPI dwritefactory_CreateTextFormat(IDWriteFactory3 *iface, WCHAR const* family_name, IDWriteFontCollection *collection, DWRITE_FONT_WEIGHT weight, DWRITE_FONT_STYLE style, DWRITE_FONT_STRETCH stretch, FLOAT size, WCHAR const *locale, IDWriteTextFormat **format) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); IDWriteFontCollection *syscollection = NULL; HRESULT hr; @@ -1014,7 +1015,7 @@ size, debugstr_w(locale), format); if (!collection) { - hr = IDWriteFactory2_GetSystemFontCollection(iface, &syscollection, FALSE); + hr = IDWriteFactory2_GetSystemFontCollection((IDWriteFactory2*)iface, &syscollection, FALSE); if (FAILED(hr)) return hr; } @@ -1025,16 +1026,16 @@ return hr; } -static HRESULT WINAPI dwritefactory_CreateTypography(IDWriteFactory2 *iface, IDWriteTypography **typography) +static HRESULT WINAPI dwritefactory_CreateTypography(IDWriteFactory3 *iface, IDWriteTypography **typography) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); TRACE("(%p)->(%p)\n", This, typography); return create_typography(typography); } -static HRESULT WINAPI dwritefactory_GetGdiInterop(IDWriteFactory2 *iface, IDWriteGdiInterop **gdi_interop) +static HRESULT WINAPI dwritefactory_GetGdiInterop(IDWriteFactory3 *iface, IDWriteGdiInterop **gdi_interop) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); TRACE("(%p)->(%p)\n", This, gdi_interop); @@ -1052,21 +1053,21 @@ return S_OK; } -static HRESULT WINAPI dwritefactory_CreateTextLayout(IDWriteFactory2 *iface, WCHAR const* string, +static HRESULT WINAPI dwritefactory_CreateTextLayout(IDWriteFactory3 *iface, WCHAR const* string, UINT32 len, IDWriteTextFormat *format, FLOAT max_width, FLOAT max_height, IDWriteTextLayout **layout) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); TRACE("(%p)->(%s:%u %p %f %f %p)\n", This, debugstr_wn(string, len), len, format, max_width, max_height, layout); return create_textlayout(iface, string, len, format, max_width, max_height, layout); } -static HRESULT WINAPI dwritefactory_CreateGdiCompatibleTextLayout(IDWriteFactory2 *iface, WCHAR const* string, +static HRESULT WINAPI dwritefactory_CreateGdiCompatibleTextLayout(IDWriteFactory3 *iface, WCHAR const* string, UINT32 len, IDWriteTextFormat *format, FLOAT layout_width, FLOAT layout_height, FLOAT pixels_per_dip, DWRITE_MATRIX const* transform, BOOL use_gdi_natural, IDWriteTextLayout **layout) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); 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); @@ -1075,34 +1076,34 @@ use_gdi_natural, layout); } -static HRESULT WINAPI dwritefactory_CreateEllipsisTrimmingSign(IDWriteFactory2 *iface, IDWriteTextFormat *format, +static HRESULT WINAPI dwritefactory_CreateEllipsisTrimmingSign(IDWriteFactory3 *iface, IDWriteTextFormat *format, IDWriteInlineObject **trimming_sign) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); TRACE("(%p)->(%p %p)\n", This, format, trimming_sign); return create_trimmingsign(iface, format, trimming_sign); } -static HRESULT WINAPI dwritefactory_CreateTextAnalyzer(IDWriteFactory2 *iface, IDWriteTextAnalyzer **analyzer) +static HRESULT WINAPI dwritefactory_CreateTextAnalyzer(IDWriteFactory3 *iface, IDWriteTextAnalyzer **analyzer) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); TRACE("(%p)->(%p)\n", This, analyzer); return get_textanalyzer(analyzer); } -static HRESULT WINAPI dwritefactory_CreateNumberSubstitution(IDWriteFactory2 *iface, DWRITE_NUMBER_SUBSTITUTION_METHOD method, +static HRESULT WINAPI dwritefactory_CreateNumberSubstitution(IDWriteFactory3 *iface, DWRITE_NUMBER_SUBSTITUTION_METHOD method, WCHAR const* locale, BOOL ignore_user_override, IDWriteNumberSubstitution **substitution) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); TRACE("(%p)->(%d %s %d %p)\n", This, method, debugstr_w(locale), ignore_user_override, substitution); return create_numbersubstitution(method, locale, ignore_user_override, substitution); } -static HRESULT WINAPI dwritefactory_CreateGlyphRunAnalysis(IDWriteFactory2 *iface, DWRITE_GLYPH_RUN const *run, +static HRESULT WINAPI dwritefactory_CreateGlyphRunAnalysis(IDWriteFactory3 *iface, DWRITE_GLYPH_RUN const *run, FLOAT ppdip, DWRITE_MATRIX const* transform, DWRITE_RENDERING_MODE rendering_mode, DWRITE_MEASURING_MODE measuring_mode, FLOAT originX, FLOAT originY, IDWriteGlyphRunAnalysis **analysis) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); TRACE("(%p)->(%p %.2f %p %d %d %.2f %.2f %p)\n", This, run, ppdip, transform, rendering_mode, measuring_mode, originX, originY, analysis); @@ -1116,10 +1117,10 @@ DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE, originX, originY, analysis); } -static HRESULT WINAPI dwritefactory1_GetEudcFontCollection(IDWriteFactory2 *iface, IDWriteFontCollection **collection, +static HRESULT WINAPI dwritefactory1_GetEudcFontCollection(IDWriteFactory3 *iface, IDWriteFontCollection **collection, BOOL check_for_updates) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); HRESULT hr = S_OK; TRACE("(%p)->(%p %d)\n", This, collection, check_for_updates); @@ -1138,25 +1139,25 @@ return hr; } -static HRESULT WINAPI dwritefactory1_CreateCustomRenderingParams(IDWriteFactory2 *iface, FLOAT gamma, +static HRESULT WINAPI dwritefactory1_CreateCustomRenderingParams(IDWriteFactory3 *iface, FLOAT gamma, FLOAT enhcontrast, FLOAT enhcontrast_grayscale, FLOAT cleartype_level, DWRITE_PIXEL_GEOMETRY geometry, DWRITE_RENDERING_MODE mode, IDWriteRenderingParams1** params) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); IDWriteRenderingParams2 *params2; HRESULT hr; TRACE("(%p)->(%.2f %.2f %.2f %.2f %d %d %p)\n", This, gamma, enhcontrast, enhcontrast_grayscale, cleartype_level, geometry, mode, params); - hr = IDWriteFactory2_CreateCustomRenderingParams(iface, gamma, enhcontrast, enhcontrast_grayscale, + hr = IDWriteFactory2_CreateCustomRenderingParams((IDWriteFactory2*)iface, gamma, enhcontrast, enhcontrast_grayscale, cleartype_level, geometry, mode, DWRITE_GRID_FIT_MODE_DEFAULT, ¶ms2); *params = (IDWriteRenderingParams1*)params2; return hr; } -static HRESULT WINAPI dwritefactory2_GetSystemFontFallback(IDWriteFactory2 *iface, IDWriteFontFallback **fallback) +static HRESULT WINAPI dwritefactory2_GetSystemFontFallback(IDWriteFactory3 *iface, IDWriteFontFallback **fallback) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); TRACE("(%p)->(%p)\n", This, fallback); @@ -1173,39 +1174,39 @@ return S_OK; } -static HRESULT WINAPI dwritefactory2_CreateFontFallbackBuilder(IDWriteFactory2 *iface, IDWriteFontFallbackBuilder **fallbackbuilder) +static HRESULT WINAPI dwritefactory2_CreateFontFallbackBuilder(IDWriteFactory3 *iface, IDWriteFontFallbackBuilder **fallbackbuilder) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); FIXME("(%p)->(%p): stub\n", This, fallbackbuilder); return E_NOTIMPL; } -static HRESULT WINAPI dwritefactory2_TranslateColorGlyphRun(IDWriteFactory2 *iface, FLOAT originX, FLOAT originY, +static HRESULT WINAPI dwritefactory2_TranslateColorGlyphRun(IDWriteFactory3 *iface, FLOAT originX, FLOAT originY, const DWRITE_GLYPH_RUN *run, const DWRITE_GLYPH_RUN_DESCRIPTION *rundescr, DWRITE_MEASURING_MODE mode, const DWRITE_MATRIX *transform, UINT32 palette, IDWriteColorGlyphRunEnumerator **colorlayers) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); TRACE("(%p)->(%.2f %.2f %p %p %d %p %u %p)\n", This, originX, originY, run, rundescr, mode, transform, palette, colorlayers); return create_colorglyphenum(originX, originY, run, rundescr, mode, transform, palette, colorlayers); } -static HRESULT WINAPI dwritefactory2_CreateCustomRenderingParams(IDWriteFactory2 *iface, FLOAT gamma, FLOAT contrast, +static HRESULT WINAPI dwritefactory2_CreateCustomRenderingParams(IDWriteFactory3 *iface, FLOAT gamma, FLOAT contrast, FLOAT grayscalecontrast, FLOAT cleartype_level, DWRITE_PIXEL_GEOMETRY geometry, DWRITE_RENDERING_MODE mode, DWRITE_GRID_FIT_MODE gridfit, IDWriteRenderingParams2 **params) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); TRACE("(%p)->(%.2f %.2f %.2f %.2f %d %d %d %p)\n", This, gamma, contrast, grayscalecontrast, cleartype_level, geometry, mode, gridfit, params); return create_renderingparams(gamma, contrast, grayscalecontrast, cleartype_level, geometry, mode, gridfit, params); } -static HRESULT WINAPI dwritefactory2_CreateGlyphRunAnalysis(IDWriteFactory2 *iface, const DWRITE_GLYPH_RUN *run, +static HRESULT WINAPI dwritefactory2_CreateGlyphRunAnalysis(IDWriteFactory3 *iface, const DWRITE_GLYPH_RUN *run, const DWRITE_MATRIX *transform, DWRITE_RENDERING_MODE rendering_mode, DWRITE_MEASURING_MODE measuring_mode, DWRITE_GRID_FIT_MODE gridfit_mode, DWRITE_TEXT_ANTIALIAS_MODE aa_mode, FLOAT originX, FLOAT originY, IDWriteGlyphRunAnalysis **analysis) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); TRACE("(%p)->(%p %p %d %d %d %d %.2f %.2f %p)\n", This, run, transform, rendering_mode, measuring_mode, gridfit_mode, aa_mode, originX, originY, analysis); @@ -1213,7 +1214,99 @@ return create_glyphrunanalysis(rendering_mode, measuring_mode, run, 1.0f, transform, gridfit_mode, aa_mode, originX, originY, analysis); } -static const struct IDWriteFactory2Vtbl dwritefactoryvtbl = { +static HRESULT WINAPI dwritefactory3_CreateGlyphRunAnalysis(IDWriteFactory3 *iface, DWRITE_GLYPH_RUN const *run, + DWRITE_MATRIX const *transform, DWRITE_RENDERING_MODE1 rendering_mode, DWRITE_MEASURING_MODE measuring_mode, + DWRITE_GRID_FIT_MODE gridfit_mode, DWRITE_TEXT_ANTIALIAS_MODE aa_mode, FLOAT originX, FLOAT originY, + IDWriteGlyphRunAnalysis **analysis) +{ + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); + + FIXME("(%p)->(%p %p %d %d %d %d %.2f %.2f %p): stub\n", This, run, transform, rendering_mode, measuring_mode, + gridfit_mode, aa_mode, originX, originY, analysis); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dwritefactory3_CreateCustomRenderingParams(IDWriteFactory3 *iface, FLOAT gamma, FLOAT contrast, + FLOAT grayscale_contrast, FLOAT cleartype_level, DWRITE_PIXEL_GEOMETRY pixel_geometry, DWRITE_RENDERING_MODE1 rendering_mode, + DWRITE_GRID_FIT_MODE gridfit_mode, IDWriteRenderingParams3 **params) +{ + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); + + FIXME("(%p)->(%.2f %.2f %.2f %.2f %d %d %d %p): stub\n", This, gamma, contrast, grayscale_contrast, cleartype_level, + pixel_geometry, rendering_mode, gridfit_mode, params); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dwritefactory3_CreateFontFaceReference(IDWriteFactory3 *iface, WCHAR const *path, FILETIME const *writetime, + UINT32 index, DWRITE_FONT_SIMULATIONS simulations, IDWriteFontFaceReference **reference) +{ + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); + + FIXME("(%p)->(%s %p %u %x, %p): stub\n", This, debugstr_w(path), writetime, index, simulations, reference); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dwritefactory3_CreateFontFaceReference_(IDWriteFactory3 *iface, IDWriteFontFile *file, UINT32 index, + DWRITE_FONT_SIMULATIONS simulations, IDWriteFontFaceReference **reference) +{ + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); + + FIXME("(%p)->(%p %u %x %p): stub\n", This, file, index, simulations, reference); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dwritefactory3_GetSystemFontSet(IDWriteFactory3 *iface, IDWriteFontSet **fontset) +{ + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); + + FIXME("(%p)->(%p): stub\n", This, fontset); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dwritefactory3_CreateFontSetBuilder(IDWriteFactory3 *iface, IDWriteFontSetBuilder **builder) +{ + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); + + FIXME("(%p)->(%p): stub\n", This, builder); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dwritefactory3_CreateFontCollectionFromFontSet(IDWriteFactory3 *iface, IDWriteFontSet *fontset, + IDWriteFontCollection1 **collection) +{ + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); + + FIXME("(%p)->(%p %p): stub\n", This, fontset, collection); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dwritefactory3_GetSystemFontCollection(IDWriteFactory3 *iface, BOOL include_downloadable, + IDWriteFontCollection1 **collection, BOOL check_for_updates) +{ + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); + + FIXME("(%p)->(%d %p %d): stub\n", This, include_downloadable, collection, check_for_updates); + + return E_NOTIMPL; +} + +static HRESULT WINAPI dwritefactory3_GetFontDownloadQueue(IDWriteFactory3 *iface, IDWriteFontDownloadQueue **queue) +{ + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); + + FIXME("(%p)->(%p): stub\n", This, queue); + + return E_NOTIMPL; +} + +static const struct IDWriteFactory3Vtbl dwritefactoryvtbl = { dwritefactory_QueryInterface, dwritefactory_AddRef, dwritefactory_Release, @@ -1244,24 +1337,33 @@ dwritefactory2_CreateFontFallbackBuilder, dwritefactory2_TranslateColorGlyphRun, dwritefactory2_CreateCustomRenderingParams, - dwritefactory2_CreateGlyphRunAnalysis + dwritefactory2_CreateGlyphRunAnalysis, + dwritefactory3_CreateGlyphRunAnalysis, + dwritefactory3_CreateCustomRenderingParams, + dwritefactory3_CreateFontFaceReference, + dwritefactory3_CreateFontFaceReference_, + dwritefactory3_GetSystemFontSet, + dwritefactory3_CreateFontSetBuilder, + dwritefactory3_CreateFontCollectionFromFontSet, + dwritefactory3_GetSystemFontCollection, + dwritefactory3_GetFontDownloadQueue }; -static ULONG WINAPI shareddwritefactory_AddRef(IDWriteFactory2 *iface) +static ULONG WINAPI shareddwritefactory_AddRef(IDWriteFactory3 *iface) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); TRACE("(%p)\n", This); return 2; } -static ULONG WINAPI shareddwritefactory_Release(IDWriteFactory2 *iface) +static ULONG WINAPI shareddwritefactory_Release(IDWriteFactory3 *iface) { - struct dwritefactory *This = impl_from_IDWriteFactory2(iface); + struct dwritefactory *This = impl_from_IDWriteFactory3(iface); TRACE("(%p)\n", This); return 1; } -static const struct IDWriteFactory2Vtbl shareddwritefactoryvtbl = { +static const struct IDWriteFactory3Vtbl shareddwritefactoryvtbl = { dwritefactory_QueryInterface, shareddwritefactory_AddRef, shareddwritefactory_Release, @@ -1292,12 +1394,21 @@ dwritefactory2_CreateFontFallbackBuilder, dwritefactory2_TranslateColorGlyphRun, dwritefactory2_CreateCustomRenderingParams, - dwritefactory2_CreateGlyphRunAnalysis + dwritefactory2_CreateGlyphRunAnalysis, + dwritefactory3_CreateGlyphRunAnalysis, + dwritefactory3_CreateCustomRenderingParams, + dwritefactory3_CreateFontFaceReference, + dwritefactory3_CreateFontFaceReference_, + dwritefactory3_GetSystemFontSet, + dwritefactory3_CreateFontSetBuilder, + dwritefactory3_CreateFontCollectionFromFontSet, + dwritefactory3_GetSystemFontCollection, + dwritefactory3_GetFontDownloadQueue }; static void init_dwritefactory(struct dwritefactory *factory, DWRITE_FACTORY_TYPE type) { - factory->IDWriteFactory2_iface.lpVtbl = type == DWRITE_FACTORY_TYPE_SHARED ? &shareddwritefactoryvtbl : &dwritefactoryvtbl; + factory->IDWriteFactory3_iface.lpVtbl = type == DWRITE_FACTORY_TYPE_SHARED ? &shareddwritefactoryvtbl : &dwritefactoryvtbl; factory->ref = 1; factory->localfontfileloader = NULL; factory->system_collection = NULL; @@ -1313,21 +1424,14 @@ HRESULT WINAPI DWriteCreateFactory(DWRITE_FACTORY_TYPE type, REFIID riid, IUnknown **ret) { struct dwritefactory *factory; + HRESULT hr; TRACE("(%d, %s, %p)\n", type, debugstr_guid(riid), ret); *ret = NULL; - if (!IsEqualIID(riid, &IID_IDWriteFactory) && - !IsEqualIID(riid, &IID_IDWriteFactory1) && - !IsEqualIID(riid, &IID_IDWriteFactory2)) - return E_FAIL; - - if (type == DWRITE_FACTORY_TYPE_SHARED && shared_factory) { - *ret = (IUnknown*)shared_factory; - IDWriteFactory2_AddRef(shared_factory); - return S_OK; - } + if (type == DWRITE_FACTORY_TYPE_SHARED && shared_factory) + return IDWriteFactory3_QueryInterface(shared_factory, riid, (void**)ret); factory = heap_alloc(sizeof(struct dwritefactory)); if (!factory) return E_OUTOFMEMORY; @@ -1335,13 +1439,12 @@ init_dwritefactory(factory, type); if (type == DWRITE_FACTORY_TYPE_SHARED) - if (InterlockedCompareExchangePointer((void**)&shared_factory, &factory->IDWriteFactory2_iface, NULL)) { - release_shared_factory(&factory->IDWriteFactory2_iface); - *ret = (IUnknown*)shared_factory; - IDWriteFactory2_AddRef(shared_factory); - return S_OK; + if (InterlockedCompareExchangePointer((void**)&shared_factory, &factory->IDWriteFactory3_iface, NULL)) { + release_shared_factory(&factory->IDWriteFactory3_iface); + return IDWriteFactory3_QueryInterface(shared_factory, riid, (void**)ret); } - *ret = (IUnknown*)&factory->IDWriteFactory2_iface; - return S_OK; + hr = IDWriteFactory3_QueryInterface(&factory->IDWriteFactory3_iface, riid, (void**)ret); + IDWriteFactory3_Release(&factory->IDWriteFactory3_iface); + return hr; } diff -Nru wine-staging-1.9.6/dlls/dwrite/opentype.c wine-staging-1.9.7~ubuntu15.04.1/dlls/dwrite/opentype.c --- wine-staging-1.9.6/dlls/dwrite/opentype.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/dwrite/opentype.c 2016-04-04 18:06:32.000000000 +0000 @@ -967,6 +967,9 @@ if (found) *found = FALSE; if (table_size) *table_size = 0; + *table_data = NULL; + *table_context = NULL; + if (type == DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION) { const TTC_Header_V1 *ttc_header; void * ttc_context; diff -Nru wine-staging-1.9.6/dlls/dwrite/tests/font.c wine-staging-1.9.7~ubuntu15.04.1/dlls/dwrite/tests/font.c --- wine-staging-1.9.6/dlls/dwrite/tests/font.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/dwrite/tests/font.c 2016-04-04 18:06:32.000000000 +0000 @@ -2312,6 +2312,11 @@ hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, &IID_IDWriteFactory, (IUnknown**)&shared2); ok(hr == S_OK, "got 0x%08x\n", hr); ok(shared == shared2, "got %p, and %p\n", shared, shared2); + IDWriteFactory_Release(shared2); + + hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, &IID_IUnknown, (IUnknown**)&shared2); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(shared == shared2, "got %p, and %p\n", shared, shared2); IDWriteFactory_Release(shared); IDWriteFactory_Release(shared2); @@ -2330,6 +2335,10 @@ ok(isolated != isolated2, "got %p, and %p\n", isolated, isolated2); IDWriteFactory_Release(isolated2); + hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_ISOLATED, &IID_IUnknown, (IUnknown**)&isolated2); + ok(hr == S_OK, "got 0x%08x\n", hr); + IDWriteFactory_Release(isolated2); + hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED+1, &IID_IDWriteFactory, (IUnknown**)&isolated2); ok(hr == S_OK, "got 0x%08x\n", hr); ok(shared != isolated2, "got %p, and %p\n", shared, isolated2); @@ -2914,6 +2923,15 @@ IDWriteFontFace_ReleaseFontTable(fontface, context2); IDWriteFontFace_ReleaseFontTable(fontface, context); + /* table does not exist */ + exists = TRUE; + context = (void*)0xdeadbeef; + table = (void*)0xdeadbeef; + hr = IDWriteFontFace_TryGetFontTable(fontface, 0xabababab, &table, &size, &context, &exists); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(exists == FALSE, "got %d\n", exists); + ok(context == NULL && table == NULL, "got context %p, table pointer %p\n", context, table); + IDWriteFontFace_Release(fontface); IDWriteFontFile_Release(file); IDWriteFactory_Release(factory); @@ -5416,13 +5434,14 @@ ok(hr == S_OK, "got 0x%08x\n", hr); ret = IDWriteFont3_HasCharacter(font3, 'A'); + todo_wine ok(ret, "got %d\n", ret); IDWriteFont3_Release(font3); IDWriteFactory3_Release(factory3); } else - skip("IDWriteFont3 is not supported.\n"); + win_skip("IDWriteFont3 is not supported.\n"); IDWriteFont_Release(font); IDWriteFactory_Release(factory); diff -Nru wine-staging-1.9.6/dlls/dxgi/device.c wine-staging-1.9.7~ubuntu15.04.1/dlls/dxgi/device.c --- wine-staging-1.9.6/dlls/dxgi/device.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/dxgi/device.c 2016-04-04 18:06:32.000000000 +0000 @@ -304,7 +304,7 @@ } TRACE("Created IDXGISurface %p\n", object); - *surface = outer ? &object->IUnknown_iface : (IUnknown *)&object->IDXGISurface_iface; + *surface = outer ? &object->IUnknown_iface : (IUnknown *)&object->IDXGISurface1_iface; return S_OK; } diff -Nru wine-staging-1.9.6/dlls/dxgi/dxgi_private.h wine-staging-1.9.7~ubuntu15.04.1/dlls/dxgi/dxgi_private.h --- wine-staging-1.9.6/dlls/dxgi/dxgi_private.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/dxgi/dxgi_private.h 2016-04-04 18:06:32.000000000 +0000 @@ -165,7 +165,7 @@ /* IDXGISurface */ struct dxgi_surface { - IDXGISurface IDXGISurface_iface; + IDXGISurface1 IDXGISurface1_iface; IUnknown IUnknown_iface; IUnknown *outer_unknown; LONG refcount; diff -Nru wine-staging-1.9.6/dlls/dxgi/surface.c wine-staging-1.9.7~ubuntu15.04.1/dlls/dxgi/surface.c --- wine-staging-1.9.6/dlls/dxgi/surface.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/dxgi/surface.c 2016-04-04 18:06:32.000000000 +0000 @@ -37,13 +37,14 @@ TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); - if (IsEqualGUID(riid, &IID_IDXGISurface) + if (IsEqualGUID(riid, &IID_IDXGISurface1) + || IsEqualGUID(riid, &IID_IDXGISurface) || IsEqualGUID(riid, &IID_IDXGIDeviceSubObject) || IsEqualGUID(riid, &IID_IDXGIObject) || IsEqualGUID(riid, &IID_IUnknown)) { - IDXGISurface_AddRef(&surface->IDXGISurface_iface); - *out = &surface->IDXGISurface_iface; + IDXGISurface1_AddRef(&surface->IDXGISurface1_iface); + *out = &surface->IDXGISurface1_iface; return S_OK; } @@ -79,70 +80,70 @@ return refcount; } -static inline struct dxgi_surface *impl_from_IDXGISurface(IDXGISurface *iface) +static inline struct dxgi_surface *impl_from_IDXGISurface1(IDXGISurface1 *iface) { - return CONTAINING_RECORD(iface, struct dxgi_surface, IDXGISurface_iface); + return CONTAINING_RECORD(iface, struct dxgi_surface, IDXGISurface1_iface); } /* IUnknown methods */ -static HRESULT STDMETHODCALLTYPE dxgi_surface_QueryInterface(IDXGISurface *iface, REFIID riid, +static HRESULT STDMETHODCALLTYPE dxgi_surface_QueryInterface(IDXGISurface1 *iface, REFIID riid, void **object) { - struct dxgi_surface *This = impl_from_IDXGISurface(iface); + struct dxgi_surface *This = impl_from_IDXGISurface1(iface); TRACE("Forwarding to outer IUnknown\n"); return IUnknown_QueryInterface(This->outer_unknown, riid, object); } -static ULONG STDMETHODCALLTYPE dxgi_surface_AddRef(IDXGISurface *iface) +static ULONG STDMETHODCALLTYPE dxgi_surface_AddRef(IDXGISurface1 *iface) { - struct dxgi_surface *This = impl_from_IDXGISurface(iface); + struct dxgi_surface *This = impl_from_IDXGISurface1(iface); TRACE("Forwarding to outer IUnknown\n"); return IUnknown_AddRef(This->outer_unknown); } -static ULONG STDMETHODCALLTYPE dxgi_surface_Release(IDXGISurface *iface) +static ULONG STDMETHODCALLTYPE dxgi_surface_Release(IDXGISurface1 *iface) { - struct dxgi_surface *This = impl_from_IDXGISurface(iface); + struct dxgi_surface *This = impl_from_IDXGISurface1(iface); TRACE("Forwarding to outer IUnknown\n"); return IUnknown_Release(This->outer_unknown); } /* IDXGIObject methods */ -static HRESULT STDMETHODCALLTYPE dxgi_surface_SetPrivateData(IDXGISurface *iface, +static HRESULT STDMETHODCALLTYPE dxgi_surface_SetPrivateData(IDXGISurface1 *iface, REFGUID guid, UINT data_size, const void *data) { - struct dxgi_surface *surface = impl_from_IDXGISurface(iface); + struct dxgi_surface *surface = impl_from_IDXGISurface1(iface); TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); return dxgi_set_private_data(&surface->private_store, guid, data_size, data); } -static HRESULT STDMETHODCALLTYPE dxgi_surface_SetPrivateDataInterface(IDXGISurface *iface, +static HRESULT STDMETHODCALLTYPE dxgi_surface_SetPrivateDataInterface(IDXGISurface1 *iface, REFGUID guid, const IUnknown *object) { - struct dxgi_surface *surface = impl_from_IDXGISurface(iface); + struct dxgi_surface *surface = impl_from_IDXGISurface1(iface); TRACE("iface %p, guid %s, object %p.\n", iface, debugstr_guid(guid), object); return dxgi_set_private_data_interface(&surface->private_store, guid, object); } -static HRESULT STDMETHODCALLTYPE dxgi_surface_GetPrivateData(IDXGISurface *iface, +static HRESULT STDMETHODCALLTYPE dxgi_surface_GetPrivateData(IDXGISurface1 *iface, REFGUID guid, UINT *data_size, void *data) { - struct dxgi_surface *surface = impl_from_IDXGISurface(iface); + struct dxgi_surface *surface = impl_from_IDXGISurface1(iface); TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); return dxgi_get_private_data(&surface->private_store, guid, data_size, data); } -static HRESULT STDMETHODCALLTYPE dxgi_surface_GetParent(IDXGISurface *iface, REFIID riid, void **parent) +static HRESULT STDMETHODCALLTYPE dxgi_surface_GetParent(IDXGISurface1 *iface, REFIID riid, void **parent) { - struct dxgi_surface *This = impl_from_IDXGISurface(iface); + struct dxgi_surface *This = impl_from_IDXGISurface1(iface); TRACE("iface %p, riid %s, parent %p.\n", iface, debugstr_guid(riid), parent); @@ -151,9 +152,9 @@ /* IDXGIDeviceSubObject methods */ -static HRESULT STDMETHODCALLTYPE dxgi_surface_GetDevice(IDXGISurface *iface, REFIID riid, void **device) +static HRESULT STDMETHODCALLTYPE dxgi_surface_GetDevice(IDXGISurface1 *iface, REFIID riid, void **device) { - struct dxgi_surface *This = impl_from_IDXGISurface(iface); + struct dxgi_surface *This = impl_from_IDXGISurface1(iface); TRACE("iface %p, riid %s, device %p.\n", iface, debugstr_guid(riid), device); @@ -161,9 +162,9 @@ } /* IDXGISurface methods */ -static HRESULT STDMETHODCALLTYPE dxgi_surface_GetDesc(IDXGISurface *iface, DXGI_SURFACE_DESC *desc) +static HRESULT STDMETHODCALLTYPE dxgi_surface_GetDesc(IDXGISurface1 *iface, DXGI_SURFACE_DESC *desc) { - struct dxgi_surface *surface = impl_from_IDXGISurface(iface); + struct dxgi_surface *surface = impl_from_IDXGISurface1(iface); struct wined3d_resource_desc wined3d_desc; TRACE("iface %p, desc %p.\n", iface, desc); @@ -179,21 +180,36 @@ return S_OK; } -static HRESULT STDMETHODCALLTYPE dxgi_surface_Map(IDXGISurface *iface, DXGI_MAPPED_RECT *mapped_rect, UINT flags) +static HRESULT STDMETHODCALLTYPE dxgi_surface_Map(IDXGISurface1 *iface, DXGI_MAPPED_RECT *mapped_rect, UINT flags) { FIXME("iface %p, mapped_rect %p, flags %#x stub!\n", iface, mapped_rect, flags); return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE dxgi_surface_Unmap(IDXGISurface *iface) +static HRESULT STDMETHODCALLTYPE dxgi_surface_Unmap(IDXGISurface1 *iface) { FIXME("iface %p stub!\n", iface); return E_NOTIMPL; } -static const struct IDXGISurfaceVtbl dxgi_surface_vtbl = +/* IDXGISurface1 methods */ +static HRESULT STDMETHODCALLTYPE dxgi_surface_GetDC(IDXGISurface1 *iface, BOOL discard, HDC *hdc) +{ + FIXME("iface %p, discard %d, hdc %p stub!\n", iface, discard, hdc); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE dxgi_surface_ReleaseDC(IDXGISurface1 *iface, RECT *dirty_rect) +{ + FIXME("iface %p, rect %p stub!\n", iface, dirty_rect); + + return E_NOTIMPL; +} + +static const struct IDXGISurface1Vtbl dxgi_surface_vtbl = { /* IUnknown methods */ dxgi_surface_QueryInterface, @@ -210,6 +226,9 @@ dxgi_surface_GetDesc, dxgi_surface_Map, dxgi_surface_Unmap, + /* IDXGISurface1 methods */ + dxgi_surface_GetDC, + dxgi_surface_ReleaseDC, }; static const struct IUnknownVtbl dxgi_surface_inner_unknown_vtbl = @@ -223,7 +242,7 @@ HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device, IUnknown *outer, struct wined3d_resource *wined3d_resource) { - surface->IDXGISurface_iface.lpVtbl = &dxgi_surface_vtbl; + surface->IDXGISurface1_iface.lpVtbl = &dxgi_surface_vtbl; surface->IUnknown_iface.lpVtbl = &dxgi_surface_inner_unknown_vtbl; surface->refcount = 1; wined3d_private_store_init(&surface->private_store); diff -Nru wine-staging-1.9.6/dlls/dxgi/tests/device.c wine-staging-1.9.7~ubuntu15.04.1/dlls/dxgi/tests/device.c --- wine-staging-1.9.6/dlls/dxgi/tests/device.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/dxgi/tests/device.c 2016-04-04 18:06:32.000000000 +0000 @@ -188,6 +188,7 @@ DXGI_SURFACE_DESC desc; IDXGISurface *surface; IDXGIDevice *device; + IUnknown *surface1; IUnknown *texture; ULONG refcount; HRESULT hr; @@ -216,6 +217,11 @@ "Surface should implement ID3D11Texture2D.\n"); if (SUCCEEDED(hr)) IUnknown_Release(texture); + hr = IDXGISurface_QueryInterface(surface, &IID_IDXGISurface1, (void **)&surface1); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Surface should implement IDXGISurface1.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(surface1); + IDXGISurface_Release(surface); refcount = IDXGIDevice_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); diff -Nru wine-staging-1.9.6/dlls/dxgi/utils.c wine-staging-1.9.7~ubuntu15.04.1/dlls/dxgi/utils.c --- wine-staging-1.9.6/dlls/dxgi/utils.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/dxgi/utils.c 2016-04-04 18:06:32.000000000 +0000 @@ -491,6 +491,7 @@ {D3D_FEATURE_LEVEL_9_1, 2}, }; D3D_FEATURE_LEVEL selected_feature_level = 0; + unsigned int shader_model; unsigned int i, j; WINED3DCAPS caps; HRESULT hr; @@ -504,14 +505,14 @@ if (FAILED(hr)) level_count = 0; + shader_model = min(caps.VertexShaderVersion, caps.PixelShaderVersion); for (i = 0; i < level_count; ++i) { for (j = 0; j < sizeof(feature_levels_sm) / sizeof(feature_levels_sm[0]); ++j) { if (feature_levels[i] == feature_levels_sm[j].feature_level) { - if (caps.VertexShaderVersion >= feature_levels_sm[j].sm - && caps.PixelShaderVersion >= feature_levels_sm[j].sm) + if (shader_model >= feature_levels_sm[j].sm) { selected_feature_level = feature_levels[i]; TRACE("Choosing supported feature level %s (SM%u).\n", diff -Nru wine-staging-1.9.6/dlls/fontsub/fontsub.spec wine-staging-1.9.7~ubuntu15.04.1/dlls/fontsub/fontsub.spec --- wine-staging-1.9.6/dlls/fontsub/fontsub.spec 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/fontsub/fontsub.spec 2016-04-04 18:06:32.000000000 +0000 @@ -1,2 +1,2 @@ -@ stub CreateFontPackage +@ cdecl CreateFontPackage(ptr long ptr ptr ptr long long long long long long ptr long ptr ptr ptr ptr) @ stub MergeFontPackage diff -Nru wine-staging-1.9.6/dlls/fontsub/main.c wine-staging-1.9.7~ubuntu15.04.1/dlls/fontsub/main.c --- wine-staging-1.9.6/dlls/fontsub/main.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/fontsub/main.c 2016-04-04 18:06:32.000000000 +0000 @@ -19,6 +19,7 @@ #include #include "windef.h" #include "winbase.h" +#include "fontsub.h" #include "wine/debug.h" @@ -38,3 +39,16 @@ return TRUE; } + +ULONG __cdecl CreateFontPackage(const unsigned char *src, const ULONG src_len, unsigned char **dest, + ULONG *dest_len, ULONG *written, const unsigned short flags, const unsigned short face_index, + const unsigned short format, const unsigned short lang, const unsigned short platform, const unsigned short encoding, + const unsigned short *keep_list, const unsigned short keep_len, CFP_ALLOCPROC allocproc, + CFP_REALLOCPROC reallocproc, CFP_FREEPROC freeproc, void *reserved) +{ + FIXME("(%p %u %p %p %p %#x %u %u %u %u %u %p %u %p %p %p %p): stub\n", src, src_len, dest, dest_len, + written, flags, face_index, format, lang, platform, encoding, keep_list, keep_len, allocproc, + reallocproc, freeproc, reserved); + + return ERR_GENERIC; +} diff -Nru wine-staging-1.9.6/dlls/gdiplus/graphicspath.c wine-staging-1.9.7~ubuntu15.04.1/dlls/gdiplus/graphicspath.c --- wine-staging-1.9.6/dlls/gdiplus/graphicspath.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/gdiplus/graphicspath.c 2016-04-04 18:06:32.000000000 +0000 @@ -1216,11 +1216,9 @@ if(path->pathdata.Count == 0) return Ok; - if(matrix){ - stat = GdipTransformPath(path, matrix); - if (stat != Ok) - return stat; - } + stat = GdipTransformPath(path, matrix); + if(stat != Ok) + return stat; pt = path->pathdata.Points[0]; if(!init_path_list(&list, pt.X, pt.Y)) @@ -1677,7 +1675,7 @@ if(!path) return InvalidParameter; - if(path->pathdata.Count == 0) + if(path->pathdata.Count == 0 || !matrix) return Ok; return GdipTransformMatrixPoints(matrix, path->pathdata.Points, diff -Nru wine-staging-1.9.6/dlls/gdiplus/tests/graphicspath.c wine-staging-1.9.7~ubuntu15.04.1/dlls/gdiplus/tests/graphicspath.c --- wine-staging-1.9.6/dlls/gdiplus/tests/graphicspath.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/gdiplus/tests/graphicspath.c 2016-04-04 18:06:32.000000000 +0000 @@ -1012,6 +1012,9 @@ status = GdipFlattenPath(path, NULL, 1.0); expect(Ok, status); + status = GdipTransformPath(path, 0); + expect(Ok, status); + status = GdipAddPathEllipse(path, 0.0, 0.0, 100.0, 50.0); expect(Ok, status); diff -Nru wine-staging-1.9.6/dlls/ieframe/client.c wine-staging-1.9.7~ubuntu15.04.1/dlls/ieframe/client.c --- wine-staging-1.9.6/dlls/ieframe/client.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/ieframe/client.c 2016-04-04 18:06:32.000000000 +0000 @@ -668,6 +668,11 @@ return IWebBrowser2_QueryInterface(This->wb, riid, ppv); } + if(IsEqualGUID(&IID_ITargetFrame, guidService)) { + TRACE("(%p)->(IID_ITargetFrame %s %p)\n", This, debugstr_guid(riid), ppv); + return IWebBrowser2_QueryInterface(This->wb, riid, ppv); + } + if(IsEqualGUID(&IID_IWebBrowserApp, guidService)) { TRACE("IWebBrowserApp service\n"); return IWebBrowser2_QueryInterface(This->wb, riid, ppv); diff -Nru wine-staging-1.9.6/dlls/ieframe/ieframe.h wine-staging-1.9.7~ubuntu15.04.1/dlls/ieframe/ieframe.h --- wine-staging-1.9.6/dlls/ieframe/ieframe.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/ieframe/ieframe.h 2016-04-04 18:06:32.000000000 +0000 @@ -55,6 +55,7 @@ typedef struct { IHlinkFrame IHlinkFrame_iface; + ITargetFrame ITargetFrame_iface; ITargetFrame2 ITargetFrame2_iface; ITargetFramePriv2 ITargetFramePriv2_iface; IWebBrowserPriv2IE9 IWebBrowserPriv2IE9_iface; diff -Nru wine-staging-1.9.6/dlls/ieframe/navigate.c wine-staging-1.9.7~ubuntu15.04.1/dlls/ieframe/navigate.c --- wine-staging-1.9.6/dlls/ieframe/navigate.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/ieframe/navigate.c 2016-04-04 18:06:32.000000000 +0000 @@ -1241,6 +1241,149 @@ HlinkFrame_UpdateHlink }; +static inline HlinkFrame *impl_from_ITargetFrame(ITargetFrame *iface) +{ + return CONTAINING_RECORD(iface, HlinkFrame, ITargetFrame_iface); +} + +static HRESULT WINAPI TargetFrame_QueryInterface(ITargetFrame *iface, REFIID riid, void **ppv) +{ + HlinkFrame *This = impl_from_ITargetFrame(iface); + return IUnknown_QueryInterface(This->outer, riid, ppv); +} + +static ULONG WINAPI TargetFrame_AddRef(ITargetFrame *iface) +{ + HlinkFrame *This = impl_from_ITargetFrame(iface); + return IUnknown_AddRef(This->outer); +} + +static ULONG WINAPI TargetFrame_Release(ITargetFrame *iface) +{ + HlinkFrame *This = impl_from_ITargetFrame(iface); + return IUnknown_Release(This->outer); +} + +static HRESULT WINAPI TargetFrame_SetFrameName(ITargetFrame *iface, LPCWSTR pszFrameName) +{ + HlinkFrame *This = impl_from_ITargetFrame(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(pszFrameName)); + return E_NOTIMPL; +} + +static HRESULT WINAPI TargetFrame_GetFrameName(ITargetFrame *iface, LPWSTR *ppszFrameName) +{ + HlinkFrame *This = impl_from_ITargetFrame(iface); + FIXME("(%p)->(%p)\n", This, ppszFrameName); + return E_NOTIMPL; +} + +static HRESULT WINAPI TargetFrame_GetParentFrame(ITargetFrame *iface, IUnknown **ppunkParent) +{ + HlinkFrame *This = impl_from_ITargetFrame(iface); + FIXME("(%p)->(%p)\n", This, ppunkParent); + return E_NOTIMPL; +} + +static HRESULT WINAPI TargetFrame_FindFrame(ITargetFrame *iface, LPCWSTR pszTargetName, + IUnknown *ppunkContextFrame, DWORD dwFlags, IUnknown **ppunkTargetFrame) +{ + HlinkFrame *This = impl_from_ITargetFrame(iface); + FIXME("(%p)->(%s %p %x %p)\n", This, debugstr_w(pszTargetName), + ppunkContextFrame, dwFlags, ppunkTargetFrame); + return E_NOTIMPL; +} + +static HRESULT WINAPI TargetFrame_SetFrameSrc(ITargetFrame *iface, LPCWSTR pszFrameSrc) +{ + HlinkFrame *This = impl_from_ITargetFrame(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(pszFrameSrc)); + return E_NOTIMPL; +} + +static HRESULT WINAPI TargetFrame_GetFrameSrc(ITargetFrame *iface, LPWSTR *ppszFrameSrc) +{ + HlinkFrame *This = impl_from_ITargetFrame(iface); + FIXME("(%p)->(%p)\n", This, ppszFrameSrc); + return E_NOTIMPL; +} + +static HRESULT WINAPI TargetFrame_GetFramesContainer(ITargetFrame *iface, IOleContainer **ppContainer) +{ + HlinkFrame *This = impl_from_ITargetFrame(iface); + FIXME("(%p)->(%p)\n", This, ppContainer); + return E_NOTIMPL; +} + +static HRESULT WINAPI TargetFrame_SetFrameOptions(ITargetFrame *iface, DWORD dwFlags) +{ + HlinkFrame *This = impl_from_ITargetFrame(iface); + FIXME("(%p)->(%x)\n", This, dwFlags); + return E_NOTIMPL; +} + +static HRESULT WINAPI TargetFrame_GetFrameOptions(ITargetFrame *iface, DWORD *pdwFlags) +{ + HlinkFrame *This = impl_from_ITargetFrame(iface); + FIXME("(%p)->(%p)\n", This, pdwFlags); + return E_NOTIMPL; +} + +static HRESULT WINAPI TargetFrame_SetFrameMargins(ITargetFrame *iface, DWORD dwWidth, DWORD dwHeight) +{ + HlinkFrame *This = impl_from_ITargetFrame(iface); + FIXME("(%p)->(%d %d)\n", This, dwWidth, dwHeight); + return E_NOTIMPL; +} + +static HRESULT WINAPI TargetFrame_GetFrameMargins(ITargetFrame *iface, DWORD *pdwWidth, DWORD *pdwHeight) +{ + HlinkFrame *This = impl_from_ITargetFrame(iface); + FIXME("(%p)->(%p %p)\n", This, pdwWidth, pdwHeight); + return E_NOTIMPL; +} + +static HRESULT WINAPI TargetFrame_RemoteNavigate(ITargetFrame *iface, ULONG cLength, ULONG *pulData) +{ + HlinkFrame *This = impl_from_ITargetFrame(iface); + FIXME("(%p)->(%u %p)\n", This, cLength, pulData); + return E_NOTIMPL; +} + +static HRESULT WINAPI TargetFrame_OnChildFrameActivate(ITargetFrame *iface, IUnknown *pUnkChildFrame) +{ + HlinkFrame *This = impl_from_ITargetFrame(iface); + FIXME("(%p)->(%p)\n", This, pUnkChildFrame); + return E_NOTIMPL; +} + +static HRESULT WINAPI TargetFrame_OnChildFrameDeactivate(ITargetFrame *iface, IUnknown *pUnkChildFrame) +{ + HlinkFrame *This = impl_from_ITargetFrame(iface); + FIXME("(%p)->(%p)\n", This, pUnkChildFrame); + return E_NOTIMPL; +} + +static const ITargetFrameVtbl TargetFrameVtbl = { + TargetFrame_QueryInterface, + TargetFrame_AddRef, + TargetFrame_Release, + TargetFrame_SetFrameName, + TargetFrame_GetFrameName, + TargetFrame_GetParentFrame, + TargetFrame_FindFrame, + TargetFrame_SetFrameSrc, + TargetFrame_GetFrameSrc, + TargetFrame_GetFramesContainer, + TargetFrame_SetFrameOptions, + TargetFrame_GetFrameOptions, + TargetFrame_SetFrameMargins, + TargetFrame_GetFrameMargins, + TargetFrame_RemoteNavigate, + TargetFrame_OnChildFrameActivate, + TargetFrame_OnChildFrameDeactivate +}; + static inline HlinkFrame *impl_from_ITargetFrame2(ITargetFrame2 *iface) { return CONTAINING_RECORD(iface, HlinkFrame, ITargetFrame2_iface); @@ -1517,6 +1660,9 @@ if(IsEqualGUID(&IID_IHlinkFrame, riid)) { TRACE("(%p)->(IID_IHlinkFrame %p)\n", This, ppv); *ppv = &This->IHlinkFrame_iface; + }else if(IsEqualGUID(&IID_ITargetFrame, riid)) { + TRACE("(%p)->(IID_ITargetFrame %p)\n", This, ppv); + *ppv = &This->ITargetFrame_iface; }else if(IsEqualGUID(&IID_ITargetFrame2, riid)) { TRACE("(%p)->(IID_ITargetFrame2 %p)\n", This, ppv); *ppv = &This->ITargetFrame2_iface; @@ -1539,7 +1685,8 @@ void HlinkFrame_Init(HlinkFrame *This, IUnknown *outer, DocHost *doc_host) { - This->IHlinkFrame_iface.lpVtbl = &HlinkFrameVtbl; + This->IHlinkFrame_iface.lpVtbl = &HlinkFrameVtbl; + This->ITargetFrame_iface.lpVtbl = &TargetFrameVtbl; This->ITargetFrame2_iface.lpVtbl = &TargetFrame2Vtbl; This->ITargetFramePriv2_iface.lpVtbl = &TargetFramePriv2Vtbl; This->IWebBrowserPriv2IE9_iface.lpVtbl = &WebBrowserPriv2IE9Vtbl; diff -Nru wine-staging-1.9.6/dlls/ieframe/tests/webbrowser.c wine-staging-1.9.7~ubuntu15.04.1/dlls/ieframe/tests/webbrowser.c --- wine-staging-1.9.6/dlls/ieframe/tests/webbrowser.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/ieframe/tests/webbrowser.c 2016-04-04 18:06:32.000000000 +0000 @@ -29,6 +29,7 @@ #include "ole2.h" #include "exdisp.h" #include "htiframe.h" +#include "htiface.h" #include "mshtmhst.h" #include "mshtmcid.h" #include "mshtml.h" @@ -3546,6 +3547,11 @@ ok(hres == S_OK, "QueryService failed: %08x\n", hres); ok(iface_cmp(service, (IUnknown*)webbrowser), "service != unk\n"); IUnknown_Release(service); + + hres = IServiceProvider_QueryService(serv_prov, &IID_ITargetFrame, &IID_ITargetFrame, (void**)&service); + ok(hres == S_OK, "QueryService failed: %08x\n", hres); + ok(iface_cmp(service, (IUnknown*)webbrowser), "service != unk\n"); + IUnknown_Release(service); hres = IServiceProvider_QueryService(serv_prov, &IID_IShellBrowser, &IID_IShellBrowser, (void**)&service); ok(hres == S_OK, "QueryService failed: %08x\n", hres); diff -Nru wine-staging-1.9.6/dlls/iphlpapi/tests/iphlpapi.c wine-staging-1.9.7~ubuntu15.04.1/dlls/iphlpapi/tests/iphlpapi.c --- wine-staging-1.9.6/dlls/iphlpapi/tests/iphlpapi.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/iphlpapi/tests/iphlpapi.c 2016-04-04 18:06:32.000000000 +0000 @@ -1379,13 +1379,14 @@ size *= 2; osize = size; ptr = HeapAlloc(GetProcessHeap(), 0, osize); - ret = pGetAdaptersAddresses(AF_UNSPEC, 0, NULL, ptr, &osize); + ret = pGetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_PREFIX, NULL, ptr, &osize); ok(!ret, "expected ERROR_SUCCESS got %u\n", ret); ok(osize == size, "expected %d, got %d\n", size, osize); for (aa = ptr; !ret && aa; aa = aa->Next) { char temp[128]; + IP_ADAPTER_PREFIX *prefix; ok(S(U(*aa)).Length == sizeof(IP_ADAPTER_ADDRESSES_LH) || S(U(*aa)).Length == sizeof(IP_ADAPTER_ADDRESSES_XP), @@ -1452,6 +1453,18 @@ sprintf(temp + strlen(temp), "%d ", aa->ZoneIndices[i]); trace("ZoneIndices: %s\n", temp); trace("FirstPrefix: %p\n", aa->FirstPrefix); + prefix = aa->FirstPrefix; + while (prefix) + { + trace("\tLength: %u\n", S(U(*prefix)).Length); + trace("\tFlags: 0x%08x\n", S(U(*prefix)).Flags); + trace("\tNext: %p\n", prefix->Next); + trace("\tAddress.lpSockaddr: %p\n", prefix->Address.lpSockaddr); + trace("\tAddress.iSockaddrLength: %d\n", prefix->Address.iSockaddrLength); + trace("\tPrefixLength: %u\n", prefix->PrefixLength); + trace("\n"); + prefix = prefix->Next; + } if (S(U(*aa)).Length < sizeof(IP_ADAPTER_ADDRESSES_LH)) continue; trace("TransmitLinkSpeed: %s\n", debugstr_longlong(aa->TransmitLinkSpeed)); diff -Nru wine-staging-1.9.6/dlls/jscript/compile.c wine-staging-1.9.7~ubuntu15.04.1/dlls/jscript/compile.c --- wine-staging-1.9.6/dlls/jscript/compile.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/jscript/compile.c 2016-04-04 18:06:32.000000000 +0000 @@ -558,12 +558,20 @@ arg_cnt++; } - return push_instr_uint(ctx, OP_new, arg_cnt); + hres = push_instr_uint(ctx, OP_new, arg_cnt); + if(FAILED(hres)) + return hres; + + hres = push_instr_uint(ctx, OP_pop, arg_cnt+1); + if(FAILED(hres)) + return hres; + + return push_instr(ctx, OP_push_ret) ? S_OK : E_OUTOFMEMORY; } static HRESULT compile_call_expression(compiler_ctx_t *ctx, call_expression_t *expr, BOOL emit_ret) { - unsigned arg_cnt = 0; + unsigned arg_cnt = 0, extra_args; argument_t *arg; unsigned instr; jsop_t op; @@ -571,9 +579,11 @@ if(is_memberid_expr(expr->expression->type)) { op = OP_call_member; + extra_args = 2; hres = compile_memberid_expression(ctx, expr->expression, 0); }else { op = OP_call; + extra_args = 1; hres = compile_expression(ctx, expr->expression, TRUE); } @@ -593,7 +603,12 @@ instr_ptr(ctx, instr)->u.arg[0].uint = arg_cnt; instr_ptr(ctx, instr)->u.arg[1].lng = emit_ret; - return S_OK; + + hres = push_instr_uint(ctx, OP_pop, arg_cnt + extra_args); + if(FAILED(hres)) + return hres; + + return !emit_ret || push_instr(ctx, OP_push_ret) ? S_OK : E_OUTOFMEMORY; } static HRESULT compile_delete_expression(compiler_ctx_t *ctx, unary_expression_t *expr) @@ -1479,7 +1494,7 @@ if(FAILED(hres)) return hres; - return push_instr(ctx, OP_ret) ? S_OK : E_OUTOFMEMORY; + return push_instr_uint(ctx, OP_ret, !stat->expr); } /* ECMA-262 3rd Edition 12.10 */ @@ -1857,8 +1872,9 @@ resolve_labels(ctx, off); - if(!push_instr(ctx, OP_ret)) - return E_OUTOFMEMORY; + hres = push_instr_uint(ctx, OP_ret, !from_eval); + if(FAILED(hres)) + return hres; if(TRACE_ON(jscript_disas)) dump_code(ctx, off); diff -Nru wine-staging-1.9.6/dlls/jscript/decode.c wine-staging-1.9.7~ubuntu15.04.1/dlls/jscript/decode.c --- wine-staging-1.9.6/dlls/jscript/decode.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/jscript/decode.c 2016-04-04 18:06:32.000000000 +0000 @@ -91,7 +91,7 @@ DWORD i; for(i=0; i<6; i++) { - if(p[i] > sizeof(digits)/sizeof(*digits) || digits[p[i]] == 0xff) + if(p[i] >= sizeof(digits)/sizeof(*digits) || digits[p[i]] == 0xff) return FALSE; } if(p[6] != '=' || p[7] != '=') diff -Nru wine-staging-1.9.6/dlls/jscript/dispex.c wine-staging-1.9.7~ubuntu15.04.1/dlls/jscript/dispex.c --- wine-staging-1.9.6/dlls/jscript/dispex.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/jscript/dispex.c 2016-04-04 18:06:32.000000000 +0000 @@ -377,6 +377,8 @@ if(prop->name || This->builtin_info->class != JSCLASS_FUNCTION) { vdisp_t vthis; + if(This->builtin_info->class != JSCLASS_FUNCTION && prop->u.p->invoke != JSGlobal_eval) + flags &= ~DISPATCH_JSCRIPT_INTERNAL_MASK; if(jsthis) set_disp(&vthis, jsthis); else @@ -1060,7 +1062,7 @@ { HRESULT hres; - assert(!(flags & ~(DISPATCH_METHOD|DISPATCH_CONSTRUCT))); + assert(!(flags & ~(DISPATCH_METHOD|DISPATCH_CONSTRUCT|DISPATCH_JSCRIPT_INTERNAL_MASK))); if(is_class(jsfunc, JSCLASS_FUNCTION)) { hres = Function_invoke(jsfunc, jsthis, flags, argc, argv, r); @@ -1073,6 +1075,7 @@ } set_disp(&vdisp, jsthis); + flags &= ~DISPATCH_JSCRIPT_INTERNAL_MASK; hres = jsfunc->builtin_info->value_prop.invoke(jsfunc->ctx, &vdisp, flags, argc, argv, r); vdisp_release(&vdisp); } @@ -1123,6 +1126,7 @@ return hres; } + flags &= ~DISPATCH_JSCRIPT_INTERNAL_MASK; if(ret && argc) flags |= DISPATCH_PROPERTYGET; @@ -1187,6 +1191,7 @@ hres = variant_to_jsval(&retv, ret); VariantClear(&retv); } + return hres; } @@ -1200,7 +1205,7 @@ unsigned i; HRESULT hres; - assert(!(flags & ~(DISPATCH_METHOD|DISPATCH_CONSTRUCT))); + assert(!(flags & ~(DISPATCH_METHOD|DISPATCH_CONSTRUCT|DISPATCH_JSCRIPT_INTERNAL_MASK))); jsdisp = iface_to_jsdisp((IUnknown*)disp); if(jsdisp) { @@ -1209,6 +1214,7 @@ return hres; } + flags &= ~DISPATCH_JSCRIPT_INTERNAL_MASK; if(r && argc && flags == DISPATCH_METHOD) flags |= DISPATCH_PROPERTYGET; diff -Nru wine-staging-1.9.6/dlls/jscript/engine.c wine-staging-1.9.7~ubuntu15.04.1/dlls/jscript/engine.c --- wine-staging-1.9.6/dlls/jscript/engine.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/jscript/engine.c 2016-04-04 18:06:32.000000000 +0000 @@ -61,14 +61,14 @@ } u; } exprval_t; -static HRESULT stack_push(exec_ctx_t *ctx, jsval_t v) +static HRESULT stack_push(script_ctx_t *ctx, jsval_t v) { if(!ctx->stack_size) { ctx->stack = heap_alloc(16*sizeof(*ctx->stack)); if(!ctx->stack) return E_OUTOFMEMORY; ctx->stack_size = 16; - }else if(ctx->stack_size == ctx->top) { + }else if(ctx->stack_size == ctx->stack_top) { jsval_t *new_stack; new_stack = heap_realloc(ctx->stack, ctx->stack_size*2*sizeof(*new_stack)); @@ -81,11 +81,11 @@ ctx->stack_size *= 2; } - ctx->stack[ctx->top++] = v; + ctx->stack[ctx->stack_top++] = v; return S_OK; } -static inline HRESULT stack_push_string(exec_ctx_t *ctx, const WCHAR *str) +static inline HRESULT stack_push_string(script_ctx_t *ctx, const WCHAR *str) { jsstr_t *v; @@ -96,7 +96,7 @@ return stack_push(ctx, jsval_string(v)); } -static HRESULT stack_push_objid(exec_ctx_t *ctx, IDispatch *disp, DISPID id) +static HRESULT stack_push_objid(script_ctx_t *ctx, IDispatch *disp, DISPID id) { HRESULT hres; @@ -107,50 +107,50 @@ return stack_push(ctx, jsval_number(id)); } -static inline jsval_t stack_top(exec_ctx_t *ctx) +static inline jsval_t stack_top(script_ctx_t *ctx) { - assert(ctx->top); - return ctx->stack[ctx->top-1]; + assert(ctx->stack_top > ctx->call_ctx->stack_base); + return ctx->stack[ctx->stack_top-1]; } -static inline jsval_t stack_topn(exec_ctx_t *ctx, unsigned n) +static inline jsval_t stack_topn(script_ctx_t *ctx, unsigned n) { - assert(ctx->top > n); - return ctx->stack[ctx->top-1-n]; + assert(ctx->stack_top > ctx->call_ctx->stack_base+n); + return ctx->stack[ctx->stack_top-1-n]; } -static inline jsval_t *stack_args(exec_ctx_t *ctx, unsigned n) +static inline jsval_t *stack_args(script_ctx_t *ctx, unsigned n) { if(!n) return NULL; - assert(ctx->top > n-1); - return ctx->stack + ctx->top-n; + assert(ctx->stack_top > ctx->call_ctx->stack_base+n-1); + return ctx->stack + ctx->stack_top-n; } -static inline jsval_t stack_pop(exec_ctx_t *ctx) +static inline jsval_t stack_pop(script_ctx_t *ctx) { - assert(ctx->top); - return ctx->stack[--ctx->top]; + assert(ctx->stack_top > ctx->call_ctx->stack_base); + return ctx->stack[--ctx->stack_top]; } -static void stack_popn(exec_ctx_t *ctx, unsigned n) +static void stack_popn(script_ctx_t *ctx, unsigned n) { while(n--) jsval_release(stack_pop(ctx)); } -static HRESULT stack_pop_number(exec_ctx_t *ctx, double *r) +static HRESULT stack_pop_number(script_ctx_t *ctx, double *r) { jsval_t v; HRESULT hres; v = stack_pop(ctx); - hres = to_number(ctx->script, v, r); + hres = to_number(ctx, v, r); jsval_release(v); return hres; } -static HRESULT stack_pop_object(exec_ctx_t *ctx, IDispatch **r) +static HRESULT stack_pop_object(script_ctx_t *ctx, IDispatch **r) { jsval_t v; HRESULT hres; @@ -158,27 +158,27 @@ v = stack_pop(ctx); if(is_object_instance(v)) { if(!get_object(v)) - return throw_type_error(ctx->script, JS_E_OBJECT_REQUIRED, NULL); + return throw_type_error(ctx, JS_E_OBJECT_REQUIRED, NULL); *r = get_object(v); return S_OK; } - hres = to_object(ctx->script, v, r); + hres = to_object(ctx, v, r); jsval_release(v); return hres; } -static inline HRESULT stack_pop_int(exec_ctx_t *ctx, INT *r) +static inline HRESULT stack_pop_int(script_ctx_t *ctx, INT *r) { - return to_int32(ctx->script, stack_pop(ctx), r); + return to_int32(ctx, stack_pop(ctx), r); } -static inline HRESULT stack_pop_uint(exec_ctx_t *ctx, DWORD *r) +static inline HRESULT stack_pop_uint(script_ctx_t *ctx, DWORD *r) { - return to_uint32(ctx->script, stack_pop(ctx), r); + return to_uint32(ctx, stack_pop(ctx), r); } -static inline IDispatch *stack_pop_objid(exec_ctx_t *ctx, DISPID *id) +static inline IDispatch *stack_pop_objid(script_ctx_t *ctx, DISPID *id) { assert(is_number(stack_top(ctx)) && is_object_instance(stack_topn(ctx, 1))); @@ -186,7 +186,7 @@ return get_object(stack_pop(ctx)); } -static inline IDispatch *stack_topn_objid(exec_ctx_t *ctx, unsigned n, DISPID *id) +static inline IDispatch *stack_topn_objid(script_ctx_t *ctx, unsigned n, DISPID *id) { assert(is_number(stack_topn(ctx, n)) && is_object_instance(stack_topn(ctx, n+1))); @@ -194,6 +194,18 @@ return get_object(stack_topn(ctx, n+1)); } +static inline jsval_t steal_ret(call_frame_t *frame) +{ + jsval_t r = frame->ret; + frame->ret = jsval_undefined(); + return r; +} + +static inline void clear_ret(call_frame_t *frame) +{ + jsval_release(steal_ret(frame)); +} + static void exprval_release(exprval_t *val) { switch(val->type) { @@ -295,72 +307,6 @@ heap_free(scope); } -HRESULT create_exec_ctx(script_ctx_t *script_ctx, IDispatch *this_obj, jsdisp_t *var_disp, - scope_chain_t *scope, BOOL is_global, exec_ctx_t **ret) -{ - exec_ctx_t *ctx; - - ctx = heap_alloc_zero(sizeof(exec_ctx_t)); - if(!ctx) - return E_OUTOFMEMORY; - - ctx->ref = 1; - ctx->is_global = is_global; - ctx->ret = jsval_undefined(); - - /* ECMA-262 3rd Edition 11.2.3.7 */ - if(this_obj) { - jsdisp_t *jsthis; - - jsthis = iface_to_jsdisp((IUnknown*)this_obj); - if(jsthis) { - if(jsthis->builtin_info->class == JSCLASS_GLOBAL || jsthis->builtin_info->class == JSCLASS_NONE) - this_obj = NULL; - jsdisp_release(jsthis); - } - } - - if(this_obj) - ctx->this_obj = this_obj; - else if(script_ctx->host_global) - ctx->this_obj = script_ctx->host_global; - else - ctx->this_obj = to_disp(script_ctx->global); - IDispatch_AddRef(ctx->this_obj); - - jsdisp_addref(var_disp); - ctx->var_disp = var_disp; - - script_addref(script_ctx); - ctx->script = script_ctx; - - if(scope) { - scope_addref(scope); - ctx->scope_chain = scope; - } - - *ret = ctx; - return S_OK; -} - -void exec_release(exec_ctx_t *ctx) -{ - if(--ctx->ref) - return; - - if(ctx->scope_chain) - scope_release(ctx->scope_chain); - if(ctx->var_disp) - jsdisp_release(ctx->var_disp); - if(ctx->this_obj) - IDispatch_Release(ctx->this_obj); - if(ctx->script) - script_release(ctx->script); - jsval_release(ctx->ret); - heap_free(ctx->stack); - heap_free(ctx); -} - static HRESULT disp_get_id(script_ctx_t *ctx, IDispatch *disp, const WCHAR *name, BSTR name_bstr, DWORD flags, DISPID *id) { IDispatchEx *dispex; @@ -511,8 +457,8 @@ TRACE("%s\n", debugstr_w(identifier)); - if(ctx->exec_ctx) { - for(scope = ctx->exec_ctx->scope_chain; scope; scope = scope->next) { + if(ctx->call_ctx) { + for(scope = ctx->call_ctx->scope; scope; scope = scope->next) { if(scope->jsobj) hres = jsdisp_get_id(scope->jsobj, identifier, fdexNameImplicit, &id); else @@ -567,28 +513,48 @@ return S_OK; } -static inline BSTR get_op_bstr(exec_ctx_t *ctx, int i){ - return ctx->code->instrs[ctx->ip].u.arg[i].bstr; +static inline BSTR get_op_bstr(script_ctx_t *ctx, int i) +{ + call_frame_t *frame = ctx->call_ctx; + return frame->bytecode->instrs[frame->ip].u.arg[i].bstr; +} + +static inline unsigned get_op_uint(script_ctx_t *ctx, int i) +{ + call_frame_t *frame = ctx->call_ctx; + return frame->bytecode->instrs[frame->ip].u.arg[i].uint; } -static inline unsigned get_op_uint(exec_ctx_t *ctx, int i){ - return ctx->code->instrs[ctx->ip].u.arg[i].uint; +static inline unsigned get_op_int(script_ctx_t *ctx, int i) +{ + call_frame_t *frame = ctx->call_ctx; + return frame->bytecode->instrs[frame->ip].u.arg[i].lng; +} + +static inline jsstr_t *get_op_str(script_ctx_t *ctx, int i) +{ + call_frame_t *frame = ctx->call_ctx; + return frame->bytecode->instrs[frame->ip].u.arg[i].str; } -static inline unsigned get_op_int(exec_ctx_t *ctx, int i){ - return ctx->code->instrs[ctx->ip].u.arg[i].lng; +static inline double get_op_double(script_ctx_t *ctx) +{ + call_frame_t *frame = ctx->call_ctx; + return frame->bytecode->instrs[frame->ip].u.dbl; } -static inline jsstr_t *get_op_str(exec_ctx_t *ctx, int i){ - return ctx->code->instrs[ctx->ip].u.arg[i].str; +static inline void jmp_next(script_ctx_t *ctx) +{ + ctx->call_ctx->ip++; } -static inline double get_op_double(exec_ctx_t *ctx){ - return ctx->code->instrs[ctx->ip].u.dbl; +static inline void jmp_abs(script_ctx_t *ctx, unsigned dst) +{ + ctx->call_ctx->ip = dst; } /* ECMA-262 3rd Edition 12.2 */ -static HRESULT interp_var_set(exec_ctx_t *ctx) +static HRESULT interp_var_set(script_ctx_t *ctx) { const BSTR name = get_op_bstr(ctx, 0); jsval_t val; @@ -597,13 +563,13 @@ TRACE("%s\n", debugstr_w(name)); val = stack_pop(ctx); - hres = jsdisp_propput_name(ctx->var_disp, name, val); + hres = jsdisp_propput_name(ctx->call_ctx->variable_obj, name, val); jsval_release(val); return hres; } /* ECMA-262 3rd Edition 12.6.4 */ -static HRESULT interp_forin(exec_ctx_t *ctx) +static HRESULT interp_forin(script_ctx_t *ctx) { const HRESULT arg = get_op_uint(ctx, 0); IDispatch *var_obj, *obj = NULL; @@ -651,21 +617,21 @@ stack_pop(ctx); stack_push(ctx, jsval_number(id)); /* safe, just after pop() */ - hres = disp_propput(ctx->script, var_obj, var_id, jsval_string(str)); + hres = disp_propput(ctx, var_obj, var_id, jsval_string(str)); jsstr_release(str); if(FAILED(hres)) return hres; - ctx->ip++; + jmp_next(ctx); }else { stack_popn(ctx, 4); - ctx->ip = arg; + jmp_abs(ctx, arg); } return S_OK; } /* ECMA-262 3rd Edition 12.10 */ -static HRESULT interp_push_scope(exec_ctx_t *ctx) +static HRESULT interp_push_scope(script_ctx_t *ctx) { IDispatch *disp; jsval_t v; @@ -674,27 +640,27 @@ TRACE("\n"); v = stack_pop(ctx); - hres = to_object(ctx->script, v, &disp); + hres = to_object(ctx, v, &disp); jsval_release(v); if(FAILED(hres)) return hres; - hres = scope_push(ctx->scope_chain, to_jsdisp(disp), disp, &ctx->scope_chain); + hres = scope_push(ctx->call_ctx->scope, to_jsdisp(disp), disp, &ctx->call_ctx->scope); IDispatch_Release(disp); return hres; } /* ECMA-262 3rd Edition 12.10 */ -static HRESULT interp_pop_scope(exec_ctx_t *ctx) +static HRESULT interp_pop_scope(script_ctx_t *ctx) { TRACE("\n"); - scope_pop(&ctx->scope_chain); + scope_pop(&ctx->call_ctx->scope); return S_OK; } /* ECMA-262 3rd Edition 12.13 */ -static HRESULT interp_case(exec_ctx_t *ctx) +static HRESULT interp_case(script_ctx_t *ctx) { const unsigned arg = get_op_uint(ctx, 0); jsval_t v; @@ -711,33 +677,33 @@ if(b) { stack_popn(ctx, 1); - ctx->ip = arg; + jmp_abs(ctx, arg); }else { - ctx->ip++; + jmp_next(ctx); } return S_OK; } /* ECMA-262 3rd Edition 12.13 */ -static HRESULT interp_throw(exec_ctx_t *ctx) +static HRESULT interp_throw(script_ctx_t *ctx) { TRACE("\n"); - jsval_release(ctx->script->ei.val); - ctx->script->ei.val = stack_pop(ctx); + jsval_release(ctx->ei.val); + ctx->ei.val = stack_pop(ctx); return DISP_E_EXCEPTION; } -static HRESULT interp_throw_ref(exec_ctx_t *ctx) +static HRESULT interp_throw_ref(script_ctx_t *ctx) { const HRESULT arg = get_op_uint(ctx, 0); TRACE("%08x\n", arg); - return throw_reference_error(ctx->script, arg, NULL); + return throw_reference_error(ctx, arg, NULL); } -static HRESULT interp_throw_type(exec_ctx_t *ctx) +static HRESULT interp_throw_type(script_ctx_t *ctx) { const HRESULT hres = get_op_uint(ctx, 0); jsstr_t *str = get_op_str(ctx, 1); @@ -746,20 +712,21 @@ TRACE("%08x %s\n", hres, debugstr_jsstr(str)); ptr = jsstr_flatten(str); - return ptr ? throw_type_error(ctx->script, hres, ptr) : E_OUTOFMEMORY; + return ptr ? throw_type_error(ctx, hres, ptr) : E_OUTOFMEMORY; } /* ECMA-262 3rd Edition 12.14 */ -static HRESULT interp_push_except(exec_ctx_t *ctx) +static HRESULT interp_push_except(script_ctx_t *ctx) { const unsigned arg1 = get_op_uint(ctx, 0); const BSTR arg2 = get_op_bstr(ctx, 1); + call_frame_t *frame = ctx->call_ctx; except_frame_t *except; unsigned stack_top; TRACE("\n"); - stack_top = ctx->top; + stack_top = ctx->stack_top; if(!arg2) { HRESULT hres; @@ -777,31 +744,32 @@ return E_OUTOFMEMORY; except->stack_top = stack_top; - except->scope = ctx->scope_chain; + except->scope = frame->scope; except->catch_off = arg1; except->ident = arg2; - except->next = ctx->except_frame; - ctx->except_frame = except; + except->next = frame->except_frame; + frame->except_frame = except; return S_OK; } /* ECMA-262 3rd Edition 12.14 */ -static HRESULT interp_pop_except(exec_ctx_t *ctx) +static HRESULT interp_pop_except(script_ctx_t *ctx) { + call_frame_t *frame = ctx->call_ctx; except_frame_t *except; TRACE("\n"); - except = ctx->except_frame; + except = frame->except_frame; assert(except != NULL); - ctx->except_frame = except->next; + frame->except_frame = except->next; heap_free(except); return S_OK; } /* ECMA-262 3rd Edition 12.14 */ -static HRESULT interp_end_finally(exec_ctx_t *ctx) +static HRESULT interp_end_finally(script_ctx_t *ctx) { jsval_t v; @@ -813,7 +781,7 @@ if(!get_bool(v)) { TRACE("passing exception\n"); - ctx->script->ei.val = stack_pop(ctx); + ctx->ei.val = stack_pop(ctx); return DISP_E_EXCEPTION; } @@ -822,16 +790,17 @@ } /* ECMA-262 3rd Edition 13 */ -static HRESULT interp_func(exec_ctx_t *ctx) +static HRESULT interp_func(script_ctx_t *ctx) { unsigned func_idx = get_op_uint(ctx, 0); + call_frame_t *frame = ctx->call_ctx; jsdisp_t *dispex; HRESULT hres; TRACE("%d\n", func_idx); - hres = create_source_function(ctx->script, ctx->code, ctx->func_code->funcs+func_idx, - ctx->scope_chain, &dispex); + hres = create_source_function(ctx, frame->bytecode, frame->function->funcs+func_idx, + frame->scope, &dispex); if(FAILED(hres)) return hres; @@ -839,7 +808,7 @@ } /* ECMA-262 3rd Edition 11.2.1 */ -static HRESULT interp_array(exec_ctx_t *ctx) +static HRESULT interp_array(script_ctx_t *ctx) { jsstr_t *name_str; const WCHAR *name; @@ -858,17 +827,17 @@ return hres; } - hres = to_flat_string(ctx->script, namev, &name_str, &name); + hres = to_flat_string(ctx, namev, &name_str, &name); jsval_release(namev); if(FAILED(hres)) { IDispatch_Release(obj); return hres; } - hres = disp_get_id(ctx->script, obj, name, NULL, 0, &id); + hres = disp_get_id(ctx, obj, name, NULL, 0, &id); jsstr_release(name_str); if(SUCCEEDED(hres)) { - hres = disp_propget(ctx->script, obj, id, &v); + hres = disp_propget(ctx, obj, id, &v); }else if(hres == DISP_E_UNKNOWNNAME) { v = jsval_undefined(); hres = S_OK; @@ -881,7 +850,7 @@ } /* ECMA-262 3rd Edition 11.2.1 */ -static HRESULT interp_member(exec_ctx_t *ctx) +static HRESULT interp_member(script_ctx_t *ctx) { const BSTR arg = get_op_bstr(ctx, 0); IDispatch *obj; @@ -895,9 +864,9 @@ if(FAILED(hres)) return hres; - hres = disp_get_id(ctx->script, obj, arg, arg, 0, &id); + hres = disp_get_id(ctx, obj, arg, arg, 0, &id); if(SUCCEEDED(hres)) { - hres = disp_propget(ctx->script, obj, id, &v); + hres = disp_propget(ctx, obj, id, &v); }else if(hres == DISP_E_UNKNOWNNAME) { v = jsval_undefined(); hres = S_OK; @@ -910,7 +879,7 @@ } /* ECMA-262 3rd Edition 11.2.1 */ -static HRESULT interp_memberid(exec_ctx_t *ctx) +static HRESULT interp_memberid(script_ctx_t *ctx) { const unsigned arg = get_op_uint(ctx, 0); jsval_t objv, namev; @@ -925,10 +894,10 @@ namev = stack_pop(ctx); objv = stack_pop(ctx); - hres = to_object(ctx->script, objv, &obj); + hres = to_object(ctx, objv, &obj); jsval_release(objv); if(SUCCEEDED(hres)) { - hres = to_flat_string(ctx->script, namev, &name_str, &name); + hres = to_flat_string(ctx, namev, &name_str, &name); if(FAILED(hres)) IDispatch_Release(obj); } @@ -936,7 +905,7 @@ if(FAILED(hres)) return hres; - hres = disp_get_id(ctx->script, obj, name, NULL, arg, &id); + hres = disp_get_id(ctx, obj, name, NULL, arg, &id); jsstr_release(name_str); if(FAILED(hres)) { IDispatch_Release(obj); @@ -953,7 +922,7 @@ } /* ECMA-262 3rd Edition 11.2.1 */ -static HRESULT interp_refval(exec_ctx_t *ctx) +static HRESULT interp_refval(script_ctx_t *ctx) { IDispatch *disp; jsval_t v; @@ -964,9 +933,9 @@ disp = stack_topn_objid(ctx, 0, &id); if(!disp) - return throw_reference_error(ctx->script, JS_E_ILLEGAL_ASSIGN, NULL); + return throw_reference_error(ctx, JS_E_ILLEGAL_ASSIGN, NULL); - hres = disp_propget(ctx->script, disp, id, &v); + hres = disp_propget(ctx, disp, id, &v); if(FAILED(hres)) return hres; @@ -974,11 +943,11 @@ } /* ECMA-262 3rd Edition 11.2.2 */ -static HRESULT interp_new(exec_ctx_t *ctx) +static HRESULT interp_new(script_ctx_t *ctx) { const unsigned argc = get_op_uint(ctx, 0); - jsval_t r, constr; - HRESULT hres; + call_frame_t *frame = ctx->call_ctx; + jsval_t constr; TRACE("%d\n", argc); @@ -987,79 +956,69 @@ /* NOTE: Should use to_object here */ if(is_null(constr)) - return throw_type_error(ctx->script, JS_E_OBJECT_EXPECTED, NULL); + return throw_type_error(ctx, JS_E_OBJECT_EXPECTED, NULL); else if(!is_object_instance(constr)) - return throw_type_error(ctx->script, JS_E_INVALID_ACTION, NULL); + return throw_type_error(ctx, JS_E_INVALID_ACTION, NULL); else if(!get_object(constr)) - return throw_type_error(ctx->script, JS_E_INVALID_PROPERTY, NULL); - - hres = disp_call_value(ctx->script, get_object(constr), NULL, DISPATCH_CONSTRUCT, argc, stack_args(ctx, argc), &r); - if(FAILED(hres)) - return hres; + return throw_type_error(ctx, JS_E_INVALID_PROPERTY, NULL); - stack_popn(ctx, argc+1); - return stack_push(ctx, r); + clear_ret(frame); + return disp_call_value(ctx, get_object(constr), NULL, DISPATCH_CONSTRUCT | DISPATCH_JSCRIPT_CALLEREXECSSOURCE, + argc, stack_args(ctx, argc), &frame->ret); } /* ECMA-262 3rd Edition 11.2.3 */ -static HRESULT interp_call(exec_ctx_t *ctx) +static HRESULT interp_call(script_ctx_t *ctx) { const unsigned argn = get_op_uint(ctx, 0); const int do_ret = get_op_int(ctx, 1); - jsval_t r, obj; - HRESULT hres; + call_frame_t *frame = ctx->call_ctx; + jsval_t obj; TRACE("%d %d\n", argn, do_ret); obj = stack_topn(ctx, argn); if(!is_object_instance(obj)) - return throw_type_error(ctx->script, JS_E_INVALID_PROPERTY, NULL); - - hres = disp_call_value(ctx->script, get_object(obj), NULL, DISPATCH_METHOD, argn, stack_args(ctx, argn), - do_ret ? &r : NULL); - if(FAILED(hres)) - return hres; + return throw_type_error(ctx, JS_E_INVALID_PROPERTY, NULL); - stack_popn(ctx, argn+1); - return do_ret ? stack_push(ctx, r) : S_OK; + clear_ret(frame); + return disp_call_value(ctx, get_object(obj), NULL, DISPATCH_METHOD | DISPATCH_JSCRIPT_CALLEREXECSSOURCE, + argn, stack_args(ctx, argn), do_ret ? &frame->ret : NULL); } /* ECMA-262 3rd Edition 11.2.3 */ -static HRESULT interp_call_member(exec_ctx_t *ctx) +static HRESULT interp_call_member(script_ctx_t *ctx) { const unsigned argn = get_op_uint(ctx, 0); const int do_ret = get_op_int(ctx, 1); + call_frame_t *frame = ctx->call_ctx; IDispatch *obj; - jsval_t r; DISPID id; - HRESULT hres; TRACE("%d %d\n", argn, do_ret); obj = stack_topn_objid(ctx, argn, &id); if(!obj) - return throw_type_error(ctx->script, id, NULL); - - hres = disp_call(ctx->script, obj, id, DISPATCH_METHOD, argn, stack_args(ctx, argn), do_ret ? &r : NULL); - if(FAILED(hres)) - return hres; - - stack_popn(ctx, argn+2); - return do_ret ? stack_push(ctx, r) : S_OK; + return throw_type_error(ctx, id, NULL); + clear_ret(frame); + return disp_call(ctx, obj, id, DISPATCH_METHOD | DISPATCH_JSCRIPT_CALLEREXECSSOURCE, + argn, stack_args(ctx, argn), do_ret ? &frame->ret : NULL); } /* ECMA-262 3rd Edition 11.1.1 */ -static HRESULT interp_this(exec_ctx_t *ctx) +static HRESULT interp_this(script_ctx_t *ctx) { + call_frame_t *frame = ctx->call_ctx; + TRACE("\n"); - IDispatch_AddRef(ctx->this_obj); - return stack_push(ctx, jsval_disp(ctx->this_obj)); + IDispatch_AddRef(frame->this_obj); + return stack_push(ctx, jsval_disp(frame->this_obj)); } /* ECMA-262 3rd Edition 10.1.4 */ -static HRESULT interp_ident(exec_ctx_t *ctx) +static HRESULT interp_ident(script_ctx_t *ctx) { const BSTR arg = get_op_bstr(ctx, 0); exprval_t exprval; @@ -1068,14 +1027,14 @@ TRACE("%s\n", debugstr_w(arg)); - hres = identifier_eval(ctx->script, arg, &exprval); + hres = identifier_eval(ctx, arg, &exprval); if(FAILED(hres)) return hres; if(exprval.type == EXPRVAL_INVALID) - return throw_type_error(ctx->script, JS_E_UNDEFINED_VARIABLE, arg); + return throw_type_error(ctx, JS_E_UNDEFINED_VARIABLE, arg); - hres = exprval_to_value(ctx->script, &exprval, &v); + hres = exprval_to_value(ctx, &exprval, &v); exprval_release(&exprval); if(FAILED(hres)) return hres; @@ -1084,7 +1043,7 @@ } /* ECMA-262 3rd Edition 10.1.4 */ -static HRESULT interp_identid(exec_ctx_t *ctx) +static HRESULT interp_identid(script_ctx_t *ctx) { const BSTR arg = get_op_bstr(ctx, 0); const unsigned flags = get_op_uint(ctx, 1); @@ -1093,18 +1052,18 @@ TRACE("%s %x\n", debugstr_w(arg), flags); - hres = identifier_eval(ctx->script, arg, &exprval); + hres = identifier_eval(ctx, arg, &exprval); if(FAILED(hres)) return hres; if(exprval.type == EXPRVAL_INVALID && (flags & fdexNameEnsure)) { DISPID id; - hres = jsdisp_get_id(ctx->script->global, arg, fdexNameEnsure, &id); + hres = jsdisp_get_id(ctx->global, arg, fdexNameEnsure, &id); if(FAILED(hres)) return hres; - exprval_set_idref(&exprval, to_disp(ctx->script->global), id); + exprval_set_idref(&exprval, to_disp(ctx->global), id); } if(exprval.type != EXPRVAL_IDREF) { @@ -1117,7 +1076,7 @@ } /* ECMA-262 3rd Edition 7.8.1 */ -static HRESULT interp_null(exec_ctx_t *ctx) +static HRESULT interp_null(script_ctx_t *ctx) { TRACE("\n"); @@ -1125,7 +1084,7 @@ } /* ECMA-262 3rd Edition 7.8.2 */ -static HRESULT interp_bool(exec_ctx_t *ctx) +static HRESULT interp_bool(script_ctx_t *ctx) { const int arg = get_op_int(ctx, 0); @@ -1135,7 +1094,7 @@ } /* ECMA-262 3rd Edition 7.8.3 */ -static HRESULT interp_int(exec_ctx_t *ctx) +static HRESULT interp_int(script_ctx_t *ctx) { const int arg = get_op_int(ctx, 0); @@ -1145,7 +1104,7 @@ } /* ECMA-262 3rd Edition 7.8.3 */ -static HRESULT interp_double(exec_ctx_t *ctx) +static HRESULT interp_double(script_ctx_t *ctx) { const double arg = get_op_double(ctx); @@ -1155,7 +1114,7 @@ } /* ECMA-262 3rd Edition 7.8.4 */ -static HRESULT interp_str(exec_ctx_t *ctx) +static HRESULT interp_str(script_ctx_t *ctx) { jsstr_t *str = get_op_str(ctx, 0); @@ -1165,7 +1124,7 @@ } /* ECMA-262 3rd Edition 7.8 */ -static HRESULT interp_regexp(exec_ctx_t *ctx) +static HRESULT interp_regexp(script_ctx_t *ctx) { jsstr_t *source = get_op_str(ctx, 0); const unsigned flags = get_op_uint(ctx, 1); @@ -1174,7 +1133,7 @@ TRACE("%s %x\n", debugstr_jsstr(source), flags); - hres = create_regexp(ctx->script, source, flags, ®exp); + hres = create_regexp(ctx, source, flags, ®exp); if(FAILED(hres)) return hres; @@ -1182,7 +1141,7 @@ } /* ECMA-262 3rd Edition 11.1.4 */ -static HRESULT interp_carray(exec_ctx_t *ctx) +static HRESULT interp_carray(script_ctx_t *ctx) { const unsigned arg = get_op_uint(ctx, 0); jsdisp_t *array; @@ -1192,7 +1151,7 @@ TRACE("%u\n", arg); - hres = create_array(ctx->script, arg, &array); + hres = create_array(ctx, arg, &array); if(FAILED(hres)) return hres; @@ -1211,14 +1170,14 @@ } /* ECMA-262 3rd Edition 11.1.5 */ -static HRESULT interp_new_obj(exec_ctx_t *ctx) +static HRESULT interp_new_obj(script_ctx_t *ctx) { jsdisp_t *obj; HRESULT hres; TRACE("\n"); - hres = create_object(ctx->script, NULL, &obj); + hres = create_object(ctx, NULL, &obj); if(FAILED(hres)) return hres; @@ -1226,7 +1185,7 @@ } /* ECMA-262 3rd Edition 11.1.5 */ -static HRESULT interp_obj_prop(exec_ctx_t *ctx) +static HRESULT interp_obj_prop(script_ctx_t *ctx) { const BSTR name = get_op_bstr(ctx, 0); jsdisp_t *obj; @@ -1246,7 +1205,7 @@ } /* ECMA-262 3rd Edition 11.11 */ -static HRESULT interp_cnd_nz(exec_ctx_t *ctx) +static HRESULT interp_cnd_nz(script_ctx_t *ctx) { const unsigned arg = get_op_uint(ctx, 0); BOOL b; @@ -1259,16 +1218,16 @@ return hres; if(b) { - ctx->ip = arg; + jmp_abs(ctx, arg); }else { stack_popn(ctx, 1); - ctx->ip++; + jmp_next(ctx); } return S_OK; } /* ECMA-262 3rd Edition 11.11 */ -static HRESULT interp_cnd_z(exec_ctx_t *ctx) +static HRESULT interp_cnd_z(script_ctx_t *ctx) { const unsigned arg = get_op_uint(ctx, 0); BOOL b; @@ -1282,15 +1241,15 @@ if(b) { stack_popn(ctx, 1); - ctx->ip++; + jmp_next(ctx); }else { - ctx->ip = arg; + jmp_abs(ctx, arg); } return S_OK; } /* ECMA-262 3rd Edition 11.10 */ -static HRESULT interp_or(exec_ctx_t *ctx) +static HRESULT interp_or(script_ctx_t *ctx) { INT l, r; HRESULT hres; @@ -1309,7 +1268,7 @@ } /* ECMA-262 3rd Edition 11.10 */ -static HRESULT interp_xor(exec_ctx_t *ctx) +static HRESULT interp_xor(script_ctx_t *ctx) { INT l, r; HRESULT hres; @@ -1328,7 +1287,7 @@ } /* ECMA-262 3rd Edition 11.10 */ -static HRESULT interp_and(exec_ctx_t *ctx) +static HRESULT interp_and(script_ctx_t *ctx) { INT l, r; HRESULT hres; @@ -1347,7 +1306,7 @@ } /* ECMA-262 3rd Edition 11.8.6 */ -static HRESULT interp_instanceof(exec_ctx_t *ctx) +static HRESULT interp_instanceof(script_ctx_t *ctx) { jsdisp_t *obj, *iter, *tmp = NULL; jsval_t prot, v; @@ -1359,7 +1318,7 @@ v = stack_pop(ctx); if(!is_object_instance(v) || !get_object(v)) { jsval_release(v); - return throw_type_error(ctx->script, JS_E_FUNCTION_EXPECTED, NULL); + return throw_type_error(ctx, JS_E_FUNCTION_EXPECTED, NULL); } obj = iface_to_jsdisp((IUnknown*)get_object(v)); @@ -1372,7 +1331,7 @@ if(is_class(obj, JSCLASS_FUNCTION)) { hres = jsdisp_propget_name(obj, prototypeW, &prot); }else { - hres = throw_type_error(ctx->script, JS_E_FUNCTION_EXPECTED, NULL); + hres = throw_type_error(ctx, JS_E_FUNCTION_EXPECTED, NULL); } jsdisp_release(obj); if(FAILED(hres)) @@ -1405,7 +1364,7 @@ } /* ECMA-262 3rd Edition 11.8.7 */ -static HRESULT interp_in(exec_ctx_t *ctx) +static HRESULT interp_in(script_ctx_t *ctx) { const WCHAR *str; jsstr_t *jsstr; @@ -1419,18 +1378,18 @@ obj = stack_pop(ctx); if(!is_object_instance(obj) || !get_object(obj)) { jsval_release(obj); - return throw_type_error(ctx->script, JS_E_OBJECT_EXPECTED, NULL); + return throw_type_error(ctx, JS_E_OBJECT_EXPECTED, NULL); } v = stack_pop(ctx); - hres = to_flat_string(ctx->script, v, &jsstr, &str); + hres = to_flat_string(ctx, v, &jsstr, &str); jsval_release(v); if(FAILED(hres)) { IDispatch_Release(get_object(obj)); return hres; } - hres = disp_get_id(ctx->script, get_object(obj), str, NULL, 0, &id); + hres = disp_get_id(ctx, get_object(obj), str, NULL, 0, &id); IDispatch_Release(get_object(obj)); jsstr_release(jsstr); if(SUCCEEDED(hres)) @@ -1496,7 +1455,7 @@ } /* ECMA-262 3rd Edition 11.6.1 */ -static HRESULT interp_add(exec_ctx_t *ctx) +static HRESULT interp_add(script_ctx_t *ctx) { jsval_t l, r, ret; HRESULT hres; @@ -1506,7 +1465,7 @@ TRACE("%s + %s\n", debugstr_jsval(l), debugstr_jsval(r)); - hres = add_eval(ctx->script, l, r, &ret); + hres = add_eval(ctx, l, r, &ret); jsval_release(l); jsval_release(r); if(FAILED(hres)) @@ -1516,7 +1475,7 @@ } /* ECMA-262 3rd Edition 11.6.2 */ -static HRESULT interp_sub(exec_ctx_t *ctx) +static HRESULT interp_sub(script_ctx_t *ctx) { double l, r; HRESULT hres; @@ -1535,7 +1494,7 @@ } /* ECMA-262 3rd Edition 11.5.1 */ -static HRESULT interp_mul(exec_ctx_t *ctx) +static HRESULT interp_mul(script_ctx_t *ctx) { double l, r; HRESULT hres; @@ -1554,7 +1513,7 @@ } /* ECMA-262 3rd Edition 11.5.2 */ -static HRESULT interp_div(exec_ctx_t *ctx) +static HRESULT interp_div(script_ctx_t *ctx) { double l, r; HRESULT hres; @@ -1573,7 +1532,7 @@ } /* ECMA-262 3rd Edition 11.5.3 */ -static HRESULT interp_mod(exec_ctx_t *ctx) +static HRESULT interp_mod(script_ctx_t *ctx) { double l, r; HRESULT hres; @@ -1592,7 +1551,7 @@ } /* ECMA-262 3rd Edition 11.4.2 */ -static HRESULT interp_delete(exec_ctx_t *ctx) +static HRESULT interp_delete(script_ctx_t *ctx) { jsval_t objv, namev; IDispatch *obj; @@ -1605,21 +1564,21 @@ namev = stack_pop(ctx); objv = stack_pop(ctx); - hres = to_object(ctx->script, objv, &obj); + hres = to_object(ctx, objv, &obj); jsval_release(objv); if(FAILED(hres)) { jsval_release(namev); return hres; } - hres = to_string(ctx->script, namev, &name); + hres = to_string(ctx, namev, &name); jsval_release(namev); if(FAILED(hres)) { IDispatch_Release(obj); return hres; } - hres = disp_delete_name(ctx->script, obj, name, &ret); + hres = disp_delete_name(ctx, obj, name, &ret); IDispatch_Release(obj); jsstr_release(name); if(FAILED(hres)) @@ -1629,7 +1588,7 @@ } /* ECMA-262 3rd Edition 11.4.2 */ -static HRESULT interp_delete_ident(exec_ctx_t *ctx) +static HRESULT interp_delete_ident(script_ctx_t *ctx) { const BSTR arg = get_op_bstr(ctx, 0); exprval_t exprval; @@ -1638,7 +1597,7 @@ TRACE("%s\n", debugstr_w(arg)); - hres = identifier_eval(ctx->script, arg, &exprval); + hres = identifier_eval(ctx, arg, &exprval); if(FAILED(hres)) return hres; @@ -1663,7 +1622,7 @@ } /* ECMA-262 3rd Edition 11.4.2 */ -static HRESULT interp_void(exec_ctx_t *ctx) +static HRESULT interp_void(script_ctx_t *ctx) { TRACE("\n"); @@ -1710,7 +1669,7 @@ } /* ECMA-262 3rd Edition 11.4.3 */ -static HRESULT interp_typeofid(exec_ctx_t *ctx) +static HRESULT interp_typeofid(script_ctx_t *ctx) { const WCHAR *ret; IDispatch *obj; @@ -1724,7 +1683,7 @@ if(!obj) return stack_push(ctx, jsval_string(jsstr_undefined())); - hres = disp_propget(ctx->script, obj, id, &v); + hres = disp_propget(ctx, obj, id, &v); IDispatch_Release(obj); if(FAILED(hres)) return stack_push_string(ctx, unknownW); @@ -1738,7 +1697,7 @@ } /* ECMA-262 3rd Edition 11.4.3 */ -static HRESULT interp_typeofident(exec_ctx_t *ctx) +static HRESULT interp_typeofident(script_ctx_t *ctx) { const BSTR arg = get_op_bstr(ctx, 0); exprval_t exprval; @@ -1748,7 +1707,7 @@ TRACE("%s\n", debugstr_w(arg)); - hres = identifier_eval(ctx->script, arg, &exprval); + hres = identifier_eval(ctx, arg, &exprval); if(FAILED(hres)) return hres; @@ -1758,7 +1717,7 @@ return hres; } - hres = exprval_to_value(ctx->script, &exprval, &v); + hres = exprval_to_value(ctx, &exprval, &v); exprval_release(&exprval); if(FAILED(hres)) return hres; @@ -1772,7 +1731,7 @@ } /* ECMA-262 3rd Edition 11.4.3 */ -static HRESULT interp_typeof(exec_ctx_t *ctx) +static HRESULT interp_typeof(script_ctx_t *ctx) { const WCHAR *ret; jsval_t v; @@ -1790,7 +1749,7 @@ } /* ECMA-262 3rd Edition 11.4.7 */ -static HRESULT interp_minus(exec_ctx_t *ctx) +static HRESULT interp_minus(script_ctx_t *ctx) { double n; HRESULT hres; @@ -1805,7 +1764,7 @@ } /* ECMA-262 3rd Edition 11.4.6 */ -static HRESULT interp_tonum(exec_ctx_t *ctx) +static HRESULT interp_tonum(script_ctx_t *ctx) { jsval_t v; double n; @@ -1814,7 +1773,7 @@ TRACE("\n"); v = stack_pop(ctx); - hres = to_number(ctx->script, v, &n); + hres = to_number(ctx, v, &n); jsval_release(v); if(FAILED(hres)) return hres; @@ -1823,7 +1782,7 @@ } /* ECMA-262 3rd Edition 11.3.1 */ -static HRESULT interp_postinc(exec_ctx_t *ctx) +static HRESULT interp_postinc(script_ctx_t *ctx) { const int arg = get_op_int(ctx, 0); IDispatch *obj; @@ -1835,15 +1794,15 @@ obj = stack_pop_objid(ctx, &id); if(!obj) - return throw_type_error(ctx->script, JS_E_OBJECT_EXPECTED, NULL); + return throw_type_error(ctx, JS_E_OBJECT_EXPECTED, NULL); - hres = disp_propget(ctx->script, obj, id, &v); + hres = disp_propget(ctx, obj, id, &v); if(SUCCEEDED(hres)) { double n; - hres = to_number(ctx->script, v, &n); + hres = to_number(ctx, v, &n); if(SUCCEEDED(hres)) - hres = disp_propput(ctx->script, obj, id, jsval_number(n+(double)arg)); + hres = disp_propput(ctx, obj, id, jsval_number(n+(double)arg)); if(FAILED(hres)) jsval_release(v); } @@ -1855,7 +1814,7 @@ } /* ECMA-262 3rd Edition 11.4.4, 11.4.5 */ -static HRESULT interp_preinc(exec_ctx_t *ctx) +static HRESULT interp_preinc(script_ctx_t *ctx) { const int arg = get_op_int(ctx, 0); IDispatch *obj; @@ -1868,17 +1827,17 @@ obj = stack_pop_objid(ctx, &id); if(!obj) - return throw_type_error(ctx->script, JS_E_OBJECT_EXPECTED, NULL); + return throw_type_error(ctx, JS_E_OBJECT_EXPECTED, NULL); - hres = disp_propget(ctx->script, obj, id, &v); + hres = disp_propget(ctx, obj, id, &v); if(SUCCEEDED(hres)) { double n; - hres = to_number(ctx->script, v, &n); + hres = to_number(ctx, v, &n); jsval_release(v); if(SUCCEEDED(hres)) { ret = n+(double)arg; - hres = disp_propput(ctx->script, obj, id, jsval_number(ret)); + hres = disp_propput(ctx, obj, id, jsval_number(ret)); } } IDispatch_Release(obj); @@ -1969,7 +1928,7 @@ } /* ECMA-262 3rd Edition 11.9.1 */ -static HRESULT interp_eq(exec_ctx_t *ctx) +static HRESULT interp_eq(script_ctx_t *ctx) { jsval_t l, r; BOOL b; @@ -1980,7 +1939,7 @@ TRACE("%s == %s\n", debugstr_jsval(l), debugstr_jsval(r)); - hres = equal_values(ctx->script, l, r, &b); + hres = equal_values(ctx, l, r, &b); jsval_release(l); jsval_release(r); if(FAILED(hres)) @@ -1990,7 +1949,7 @@ } /* ECMA-262 3rd Edition 11.9.2 */ -static HRESULT interp_neq(exec_ctx_t *ctx) +static HRESULT interp_neq(script_ctx_t *ctx) { jsval_t l, r; BOOL b; @@ -2001,7 +1960,7 @@ TRACE("%s != %s\n", debugstr_jsval(l), debugstr_jsval(r)); - hres = equal_values(ctx->script, l, r, &b); + hres = equal_values(ctx, l, r, &b); jsval_release(l); jsval_release(r); if(FAILED(hres)) @@ -2011,7 +1970,7 @@ } /* ECMA-262 3rd Edition 11.9.4 */ -static HRESULT interp_eq2(exec_ctx_t *ctx) +static HRESULT interp_eq2(script_ctx_t *ctx) { jsval_t l, r; BOOL b; @@ -2032,7 +1991,7 @@ } /* ECMA-262 3rd Edition 11.9.5 */ -static HRESULT interp_neq2(exec_ctx_t *ctx) +static HRESULT interp_neq2(script_ctx_t *ctx) { jsval_t l, r; BOOL b; @@ -2089,7 +2048,7 @@ } /* ECMA-262 3rd Edition 11.8.1 */ -static HRESULT interp_lt(exec_ctx_t *ctx) +static HRESULT interp_lt(script_ctx_t *ctx) { jsval_t l, r; BOOL b; @@ -2100,7 +2059,7 @@ TRACE("%s < %s\n", debugstr_jsval(l), debugstr_jsval(r)); - hres = less_eval(ctx->script, l, r, FALSE, &b); + hres = less_eval(ctx, l, r, FALSE, &b); jsval_release(l); jsval_release(r); if(FAILED(hres)) @@ -2110,7 +2069,7 @@ } /* ECMA-262 3rd Edition 11.8.1 */ -static HRESULT interp_lteq(exec_ctx_t *ctx) +static HRESULT interp_lteq(script_ctx_t *ctx) { jsval_t l, r; BOOL b; @@ -2121,7 +2080,7 @@ TRACE("%s <= %s\n", debugstr_jsval(l), debugstr_jsval(r)); - hres = less_eval(ctx->script, r, l, TRUE, &b); + hres = less_eval(ctx, r, l, TRUE, &b); jsval_release(l); jsval_release(r); if(FAILED(hres)) @@ -2131,7 +2090,7 @@ } /* ECMA-262 3rd Edition 11.8.2 */ -static HRESULT interp_gt(exec_ctx_t *ctx) +static HRESULT interp_gt(script_ctx_t *ctx) { jsval_t l, r; BOOL b; @@ -2142,7 +2101,7 @@ TRACE("%s > %s\n", debugstr_jsval(l), debugstr_jsval(r)); - hres = less_eval(ctx->script, r, l, FALSE, &b); + hres = less_eval(ctx, r, l, FALSE, &b); jsval_release(l); jsval_release(r); if(FAILED(hres)) @@ -2152,7 +2111,7 @@ } /* ECMA-262 3rd Edition 11.8.4 */ -static HRESULT interp_gteq(exec_ctx_t *ctx) +static HRESULT interp_gteq(script_ctx_t *ctx) { jsval_t l, r; BOOL b; @@ -2163,7 +2122,7 @@ TRACE("%s >= %s\n", debugstr_jsval(l), debugstr_jsval(r)); - hres = less_eval(ctx->script, l, r, TRUE, &b); + hres = less_eval(ctx, l, r, TRUE, &b); jsval_release(l); jsval_release(r); if(FAILED(hres)) @@ -2173,7 +2132,7 @@ } /* ECMA-262 3rd Edition 11.4.8 */ -static HRESULT interp_bneg(exec_ctx_t *ctx) +static HRESULT interp_bneg(script_ctx_t *ctx) { jsval_t v; INT i; @@ -2182,7 +2141,7 @@ TRACE("\n"); v = stack_pop(ctx); - hres = to_int32(ctx->script, v, &i); + hres = to_int32(ctx, v, &i); jsval_release(v); if(FAILED(hres)) return hres; @@ -2191,7 +2150,7 @@ } /* ECMA-262 3rd Edition 11.4.9 */ -static HRESULT interp_neg(exec_ctx_t *ctx) +static HRESULT interp_neg(script_ctx_t *ctx) { jsval_t v; BOOL b; @@ -2209,7 +2168,7 @@ } /* ECMA-262 3rd Edition 11.7.1 */ -static HRESULT interp_lshift(exec_ctx_t *ctx) +static HRESULT interp_lshift(script_ctx_t *ctx) { DWORD r; INT l; @@ -2227,7 +2186,7 @@ } /* ECMA-262 3rd Edition 11.7.2 */ -static HRESULT interp_rshift(exec_ctx_t *ctx) +static HRESULT interp_rshift(script_ctx_t *ctx) { DWORD r; INT l; @@ -2245,7 +2204,7 @@ } /* ECMA-262 3rd Edition 11.7.3 */ -static HRESULT interp_rshift2(exec_ctx_t *ctx) +static HRESULT interp_rshift2(script_ctx_t *ctx) { DWORD r, l; HRESULT hres; @@ -2262,7 +2221,7 @@ } /* ECMA-262 3rd Edition 11.13.1 */ -static HRESULT interp_assign(exec_ctx_t *ctx) +static HRESULT interp_assign(script_ctx_t *ctx) { IDispatch *disp; DISPID id; @@ -2276,10 +2235,10 @@ disp = stack_pop_objid(ctx, &id); if(!disp) { jsval_release(v); - return throw_reference_error(ctx->script, JS_E_ILLEGAL_ASSIGN, NULL); + return throw_reference_error(ctx, JS_E_ILLEGAL_ASSIGN, NULL); } - hres = disp_propput(ctx->script, disp, id, v); + hres = disp_propput(ctx, disp, id, v); IDispatch_Release(disp); if(FAILED(hres)) { jsval_release(v); @@ -2290,7 +2249,7 @@ } /* JScript extension */ -static HRESULT interp_assign_call(exec_ctx_t *ctx) +static HRESULT interp_assign_call(script_ctx_t *ctx) { const unsigned argc = get_op_uint(ctx, 0); IDispatch *disp; @@ -2302,9 +2261,9 @@ disp = stack_topn_objid(ctx, argc+1, &id); if(!disp) - return throw_reference_error(ctx->script, JS_E_ILLEGAL_ASSIGN, NULL); + return throw_reference_error(ctx, JS_E_ILLEGAL_ASSIGN, NULL); - hres = disp_call(ctx->script, disp, id, DISPATCH_PROPERTYPUT, argc+1, stack_args(ctx, argc+1), NULL); + hres = disp_call(ctx, disp, id, DISPATCH_PROPERTYPUT, argc+1, stack_args(ctx, argc+1), NULL); if(FAILED(hres)) return hres; @@ -2313,24 +2272,24 @@ return stack_push(ctx, v); } -static HRESULT interp_undefined(exec_ctx_t *ctx) +static HRESULT interp_undefined(script_ctx_t *ctx) { TRACE("\n"); return stack_push(ctx, jsval_undefined()); } -static HRESULT interp_jmp(exec_ctx_t *ctx) +static HRESULT interp_jmp(script_ctx_t *ctx) { const unsigned arg = get_op_uint(ctx, 0); TRACE("%u\n", arg); - ctx->ip = arg; + jmp_abs(ctx, arg); return S_OK; } -static HRESULT interp_jmp_z(exec_ctx_t *ctx) +static HRESULT interp_jmp_z(script_ctx_t *ctx) { const unsigned arg = get_op_uint(ctx, 0); BOOL b; @@ -2346,13 +2305,13 @@ return hres; if(b) - ctx->ip++; + jmp_next(ctx); else - ctx->ip = arg; + jmp_abs(ctx, arg); return S_OK; } -static HRESULT interp_pop(exec_ctx_t *ctx) +static HRESULT interp_pop(script_ctx_t *ctx) { const unsigned arg = get_op_uint(ctx, 0); @@ -2362,24 +2321,51 @@ return S_OK; } -static HRESULT interp_ret(exec_ctx_t *ctx) +static HRESULT interp_ret(script_ctx_t *ctx) { + const unsigned clear_ret = get_op_uint(ctx, 0); + call_frame_t *frame = ctx->call_ctx; + TRACE("\n"); - ctx->ip = -1; + if(clear_ret) + jsval_release(steal_ret(frame)); + + if((frame->flags & EXEC_CONSTRUCTOR) && !is_object_instance(frame->ret)) { + jsval_release(frame->ret); + IDispatch_AddRef(frame->this_obj); + frame->ret = jsval_disp(frame->this_obj); + } + + jmp_abs(ctx, -1); return S_OK; } -static HRESULT interp_setret(exec_ctx_t *ctx) +static HRESULT interp_setret(script_ctx_t *ctx) { + call_frame_t *frame = ctx->call_ctx; + TRACE("\n"); - jsval_release(ctx->ret); - ctx->ret = stack_pop(ctx); + jsval_release(frame->ret); + frame->ret = stack_pop(ctx); return S_OK; } -typedef HRESULT (*op_func_t)(exec_ctx_t*); +static HRESULT interp_push_ret(script_ctx_t *ctx) +{ + call_frame_t *frame = ctx->call_ctx; + HRESULT hres; + + TRACE("\n"); + + hres = stack_push(ctx, frame->ret); + if(SUCCEEDED(hres)) + frame->ret = jsval_undefined(); + return hres; +} + +typedef HRESULT (*op_func_t)(script_ctx_t*); static const op_func_t op_funcs[] = { #define X(x,a,b,c) interp_##x, @@ -2393,27 +2379,65 @@ #undef X }; -static HRESULT unwind_exception(exec_ctx_t *ctx) +static void release_call_frame(call_frame_t *frame) +{ + if(frame->arguments_obj) { + /* Reset arguments value to cut the reference cycle. Note that since all activation contexts have + * their own arguments property, it's impossible to use prototype's one during name lookup */ + static const WCHAR argumentsW[] = {'a','r','g','u','m','e','n','t','s',0}; + jsdisp_propput_name(frame->variable_obj, argumentsW, jsval_undefined()); + jsdisp_release(frame->arguments_obj); + } + if(frame->function_instance) + jsdisp_release(frame->function_instance); + if(frame->variable_obj) + jsdisp_release(frame->variable_obj); + if(frame->this_obj) + IDispatch_Release(frame->this_obj); + if(frame->scope) + scope_release(frame->scope); + jsval_release(frame->ret); + release_bytecode(frame->bytecode); + heap_free(frame); +} + +static HRESULT unwind_exception(script_ctx_t *ctx, HRESULT exception_hres) { except_frame_t *except_frame; + call_frame_t *frame; jsval_t except_val; BSTR ident; HRESULT hres; - except_frame = ctx->except_frame; - ctx->except_frame = except_frame->next; + for(frame = ctx->call_ctx; !frame->except_frame; frame = ctx->call_ctx) { + DWORD flags; + + while(frame->scope != frame->base_scope) + scope_pop(&frame->scope); + + stack_popn(ctx, ctx->stack_top-frame->stack_base); + + ctx->call_ctx = frame->prev_frame; + flags = frame->flags; + release_call_frame(frame); + if(!(flags & EXEC_RETURN_TO_INTERP)) + return exception_hres; + } + + except_frame = frame->except_frame; + frame->except_frame = except_frame->next; - assert(except_frame->stack_top <= ctx->top); - stack_popn(ctx, ctx->top - except_frame->stack_top); + assert(except_frame->stack_top <= ctx->stack_top); + stack_popn(ctx, ctx->stack_top - except_frame->stack_top); - while(except_frame->scope != ctx->scope_chain) - scope_pop(&ctx->scope_chain); + while(except_frame->scope != frame->scope) + scope_pop(&frame->scope); - ctx->ip = except_frame->catch_off; + frame->ip = except_frame->catch_off; - except_val = ctx->script->ei.val; - ctx->script->ei.val = jsval_undefined(); - clear_ei(ctx->script); + except_val = ctx->ei.val; + ctx->ei.val = jsval_undefined(); + clear_ei(ctx); ident = except_frame->ident; heap_free(except_frame); @@ -2421,7 +2445,7 @@ if(ident) { jsdisp_t *scope_obj; - hres = create_dispex(ctx->script, NULL, NULL, &scope_obj); + hres = create_dispex(ctx, NULL, NULL, &scope_obj); if(SUCCEEDED(hres)) { hres = jsdisp_propput_name(scope_obj, ident, except_val); if(FAILED(hres)) @@ -2431,7 +2455,7 @@ if(FAILED(hres)) return hres; - hres = scope_push(ctx->scope_chain, scope_obj, to_disp(scope_obj), &ctx->scope_chain); + hres = scope_push(frame->scope, scope_obj, to_disp(scope_obj), &frame->scope); jsdisp_release(scope_obj); }else { hres = stack_push(ctx, except_val); @@ -2444,65 +2468,45 @@ return hres; } -static HRESULT enter_bytecode(script_ctx_t *ctx, bytecode_t *code, function_code_t *func, jsval_t *ret) +static HRESULT enter_bytecode(script_ctx_t *ctx, jsval_t *r) { - exec_ctx_t *exec_ctx = ctx->exec_ctx; - except_frame_t *prev_except_frame; - function_code_t *prev_func; - unsigned prev_ip, prev_top; - scope_chain_t *prev_scope; - bytecode_t *prev_code; + call_frame_t *frame; jsop_t op; HRESULT hres = S_OK; TRACE("\n"); - prev_top = exec_ctx->top; - prev_scope = exec_ctx->scope_chain; - prev_except_frame = exec_ctx->except_frame; - prev_ip = exec_ctx->ip; - prev_code = exec_ctx->code; - prev_func = exec_ctx->func_code; - exec_ctx->ip = func->instr_off; - exec_ctx->except_frame = NULL; - exec_ctx->code = code; - exec_ctx->func_code = func; - - while(exec_ctx->ip != -1) { - op = code->instrs[exec_ctx->ip].op; - hres = op_funcs[op](exec_ctx); + while(1) { + frame = ctx->call_ctx; + op = frame->bytecode->instrs[frame->ip].op; + hres = op_funcs[op](ctx); if(FAILED(hres)) { TRACE("EXCEPTION %08x\n", hres); - if(!exec_ctx->except_frame) - break; - - hres = unwind_exception(exec_ctx); + hres = unwind_exception(ctx, hres); if(FAILED(hres)) + return hres; + }else if(frame->ip == -1) { + const DWORD return_to_interp = frame->flags & EXEC_RETURN_TO_INTERP; + + assert(ctx->stack_top == frame->stack_base); + assert(frame->scope == frame->base_scope); + + ctx->call_ctx = frame->prev_frame; + if(return_to_interp) { + clear_ret(ctx->call_ctx); + ctx->call_ctx->ret = steal_ret(frame); + }else if(r) { + *r = steal_ret(frame); + } + release_call_frame(frame); + if(!return_to_interp) break; }else { - exec_ctx->ip += op_move[op]; + frame->ip += op_move[op]; } } - exec_ctx->ip = prev_ip; - exec_ctx->except_frame = prev_except_frame; - exec_ctx->code = prev_code; - exec_ctx->func_code = prev_func; - - if(FAILED(hres)) { - while(exec_ctx->scope_chain != prev_scope) - scope_pop(&exec_ctx->scope_chain); - stack_popn(exec_ctx, exec_ctx->top-prev_top); - return hres; - } - - assert(exec_ctx->top == prev_top+1 || exec_ctx->top == prev_top); - assert(exec_ctx->scope_chain == prev_scope); - assert(exec_ctx->top == prev_top); - - *ret = exec_ctx->ret; - exec_ctx->ret = jsval_undefined(); return S_OK; } @@ -2543,54 +2547,94 @@ return hres; } -HRESULT exec_source(exec_ctx_t *ctx, bytecode_t *code, function_code_t *func, BOOL from_eval, jsval_t *ret) +HRESULT exec_source(script_ctx_t *ctx, DWORD flags, bytecode_t *bytecode, function_code_t *function, scope_chain_t *scope, + IDispatch *this_obj, jsdisp_t *function_instance, jsdisp_t *variable_obj, jsdisp_t *arguments_obj, jsval_t *r) { - exec_ctx_t *prev_ctx; - jsval_t val; + call_frame_t *frame; unsigned i; - HRESULT hres = S_OK; + HRESULT hres; - for(i = 0; i < func->func_cnt; i++) { + for(i = 0; i < function->func_cnt; i++) { jsdisp_t *func_obj; - if(!func->funcs[i].name) + if(!function->funcs[i].name) continue; - hres = create_source_function(ctx->script, code, func->funcs+i, ctx->scope_chain, &func_obj); + hres = create_source_function(ctx, bytecode, function->funcs+i, scope, &func_obj); if(FAILED(hres)) return hres; - if(func->funcs[i].event_target) - hres = bind_event_target(ctx->script, func->funcs+i, func_obj); + if(function->funcs[i].event_target) + hres = bind_event_target(ctx, function->funcs+i, func_obj); else - hres = jsdisp_propput_name(ctx->var_disp, func->funcs[i].name, jsval_obj(func_obj)); + hres = jsdisp_propput_name(variable_obj, function->funcs[i].name, jsval_obj(func_obj)); jsdisp_release(func_obj); if(FAILED(hres)) return hres; } - for(i=0; i < func->var_cnt; i++) { - if(!ctx->is_global || !lookup_global_members(ctx->script, func->variables[i], NULL)) { + for(i=0; i < function->var_cnt; i++) { + if(!(flags & EXEC_GLOBAL) || !lookup_global_members(ctx, function->variables[i], NULL)) { DISPID id = 0; - hres = jsdisp_get_id(ctx->var_disp, func->variables[i], fdexNameEnsure, &id); + hres = jsdisp_get_id(variable_obj, function->variables[i], fdexNameEnsure, &id); if(FAILED(hres)) return hres; } } - prev_ctx = ctx->script->exec_ctx; - ctx->script->exec_ctx = ctx; + /* ECMA-262 3rd Edition 11.2.3.7 */ + if(this_obj) { + jsdisp_t *jsthis; - hres = enter_bytecode(ctx->script, code, func, &val); - assert(ctx->script->exec_ctx == ctx); - ctx->script->exec_ctx = prev_ctx; - if(FAILED(hres)) - return hres; + jsthis = iface_to_jsdisp((IUnknown*)this_obj); + if(jsthis) { + if(jsthis->builtin_info->class == JSCLASS_GLOBAL || jsthis->builtin_info->class == JSCLASS_NONE) + this_obj = NULL; + jsdisp_release(jsthis); + } + } + + frame = heap_alloc_zero(sizeof(*frame)); + if(!frame) + return E_OUTOFMEMORY; - if(ret) - *ret = val; + frame->bytecode = bytecode_addref(bytecode); + frame->function = function; + frame->ip = function->instr_off; + frame->stack_base = ctx->stack_top; + frame->ret = jsval_undefined(); + if(scope) + frame->base_scope = frame->scope = scope_addref(scope); + + if(this_obj) + frame->this_obj = this_obj; + else if(ctx->host_global) + frame->this_obj = ctx->host_global; else - jsval_release(val); - return S_OK; + frame->this_obj = to_disp(ctx->global); + IDispatch_AddRef(frame->this_obj); + + if(function_instance) + frame->function_instance = jsdisp_addref(function_instance); + if(arguments_obj) + frame->arguments_obj = jsdisp_addref(arguments_obj); + + frame->flags = flags; + frame->variable_obj = jsdisp_addref(variable_obj); + + frame->prev_frame = ctx->call_ctx; + ctx->call_ctx = frame; + + if(flags & EXEC_RETURN_TO_INTERP) { + /* + * We're called directly from interpreter, so we may just setup call frame and return. + * Already running interpreter will take care of execution. + */ + if(r) + *r = jsval_undefined(); + return S_OK; + } + + return enter_bytecode(ctx, r); } diff -Nru wine-staging-1.9.6/dlls/jscript/engine.h wine-staging-1.9.7~ubuntu15.04.1/dlls/jscript/engine.h --- wine-staging-1.9.6/dlls/jscript/engine.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/jscript/engine.h 2016-04-04 18:06:32.000000000 +0000 @@ -70,6 +70,7 @@ X(postinc, 1, ARG_INT, 0) \ X(preinc, 1, ARG_INT, 0) \ X(push_except,1, ARG_ADDR, ARG_BSTR) \ + X(push_ret, 1, 0,0) \ X(push_scope, 1, 0,0) \ X(regexp, 1, ARG_STR, ARG_UINT) \ X(rshift, 1, 0,0) \ @@ -167,9 +168,10 @@ HRESULT compile_script(script_ctx_t*,const WCHAR*,const WCHAR*,const WCHAR*,BOOL,BOOL,bytecode_t**) DECLSPEC_HIDDEN; void release_bytecode(bytecode_t*) DECLSPEC_HIDDEN; -static inline void bytecode_addref(bytecode_t *code) +static inline bytecode_t *bytecode_addref(bytecode_t *code) { code->ref++; + return code; } typedef struct _scope_chain_t { @@ -182,41 +184,41 @@ HRESULT scope_push(scope_chain_t*,jsdisp_t*,IDispatch*,scope_chain_t**) DECLSPEC_HIDDEN; void scope_release(scope_chain_t*) DECLSPEC_HIDDEN; -static inline void scope_addref(scope_chain_t *scope) +static inline scope_chain_t *scope_addref(scope_chain_t *scope) { scope->ref++; + return scope; } typedef struct _except_frame_t except_frame_t; struct _parser_ctx_t; -struct _exec_ctx_t { - LONG ref; - - struct _parser_ctx_t *parser; - bytecode_t *code; - script_ctx_t *script; - scope_chain_t *scope_chain; - jsdisp_t *var_disp; - IDispatch *this_obj; - function_code_t *func_code; - BOOL is_global; - - jsval_t *stack; - unsigned stack_size; - unsigned top; +typedef struct _call_frame_t { + unsigned ip; except_frame_t *except_frame; + unsigned stack_base; + scope_chain_t *scope; + scope_chain_t *base_scope; + jsval_t ret; - unsigned ip; -}; + IDispatch *this_obj; + jsdisp_t *function_instance; + jsdisp_t *variable_obj; + jsdisp_t *arguments_obj; + DWORD flags; + + bytecode_t *bytecode; + function_code_t *function; + + struct _call_frame_t *prev_frame; +} call_frame_t; + +#define EXEC_GLOBAL 0x0001 +#define EXEC_CONSTRUCTOR 0x0002 +#define EXEC_RETURN_TO_INTERP 0x0004 -static inline void exec_addref(exec_ctx_t *ctx) -{ - ctx->ref++; -} +HRESULT exec_source(script_ctx_t*,DWORD,bytecode_t*,function_code_t*,scope_chain_t*,IDispatch*, + jsdisp_t*,jsdisp_t*,jsdisp_t*,jsval_t*) DECLSPEC_HIDDEN; -void exec_release(exec_ctx_t*) DECLSPEC_HIDDEN; -HRESULT create_exec_ctx(script_ctx_t*,IDispatch*,jsdisp_t*,scope_chain_t*,BOOL,exec_ctx_t**) DECLSPEC_HIDDEN; -HRESULT exec_source(exec_ctx_t*,bytecode_t*,function_code_t*,BOOL,jsval_t*) DECLSPEC_HIDDEN; HRESULT create_source_function(script_ctx_t*,bytecode_t*,function_code_t*,scope_chain_t*,jsdisp_t**) DECLSPEC_HIDDEN; diff -Nru wine-staging-1.9.6/dlls/jscript/function.c wine-staging-1.9.7~ubuntu15.04.1/dlls/jscript/function.c --- wine-staging-1.9.6/dlls/jscript/function.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/jscript/function.c 2016-04-04 18:06:32.000000000 +0000 @@ -34,7 +34,6 @@ bytecode_t *code; function_code_t *func_code; DWORD length; - jsdisp_t *arguments; } FunctionInstance; typedef struct { @@ -203,10 +202,9 @@ } static HRESULT invoke_source(script_ctx_t *ctx, FunctionInstance *function, IDispatch *this_obj, unsigned argc, jsval_t *argv, - jsval_t *r) + BOOL is_constructor, BOOL caller_execs_source, jsval_t *r) { jsdisp_t *var_disp, *arg_disp; - exec_ctx_t *exec_ctx; scope_chain_t *scope; HRESULT hres; @@ -239,57 +237,23 @@ hres = scope_push(function->scope_chain, var_disp, to_disp(var_disp), &scope); if(SUCCEEDED(hres)) { - hres = create_exec_ctx(ctx, this_obj, var_disp, scope, FALSE, &exec_ctx); - scope_release(scope); - - if(SUCCEEDED(hres)) { - jsdisp_t *prev_args; + DWORD exec_flags = 0; - prev_args = function->arguments; - function->arguments = arg_disp; - hres = exec_source(exec_ctx, function->code, function->func_code, FALSE, r); - function->arguments = prev_args; + if(caller_execs_source) + exec_flags |= EXEC_RETURN_TO_INTERP; + if(is_constructor) + exec_flags |= EXEC_CONSTRUCTOR; + hres = exec_source(ctx, exec_flags, function->code, function->func_code, scope, this_obj, + &function->dispex, var_disp, arg_disp, r); - exec_release(exec_ctx); - } + scope_release(scope); } - /* Reset arguments value to cut the reference cycle. Note that since all activation contexts have - * their own arguments property, it's impossible to use prototype's one during name lookup */ - jsdisp_propput_name(var_disp, argumentsW, jsval_undefined()); - jsdisp_release(arg_disp); jsdisp_release(var_disp); return hres; } -static HRESULT invoke_constructor(script_ctx_t *ctx, FunctionInstance *function, unsigned argc, jsval_t *argv, - jsval_t *r) -{ - jsdisp_t *this_obj; - jsval_t var; - HRESULT hres; - - hres = create_object(ctx, &function->dispex, &this_obj); - if(FAILED(hres)) - return hres; - - hres = invoke_source(ctx, function, to_disp(this_obj), argc, argv, &var); - if(FAILED(hres)) { - jsdisp_release(this_obj); - return hres; - } - - if(is_object_instance(var)) { - jsdisp_release(this_obj); - *r = var; - }else { - jsval_release(var); - *r = jsval_obj(this_obj); - } - return S_OK; -} - static HRESULT invoke_value_proc(script_ctx_t *ctx, FunctionInstance *function, IDispatch *this_disp, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) { @@ -310,12 +274,12 @@ } static HRESULT call_function(script_ctx_t *ctx, FunctionInstance *function, IDispatch *this_obj, - unsigned argc, jsval_t *argv, jsval_t *r) + unsigned argc, jsval_t *argv, BOOL caller_execs_source, jsval_t *r) { if(function->value_proc) return invoke_value_proc(ctx, function, this_obj, DISPATCH_METHOD, argc, argv, r); - return invoke_source(ctx, function, this_obj, argc, argv, r); + return invoke_source(ctx, function, this_obj, argc, argv, FALSE, caller_execs_source, r); } static HRESULT function_to_string(FunctionInstance *function, jsstr_t **ret) @@ -350,6 +314,7 @@ HRESULT Function_invoke(jsdisp_t *func_this, IDispatch *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) { + const BOOL caller_execs_source = (flags & DISPATCH_JSCRIPT_CALLEREXECSSOURCE) != 0; FunctionInstance *function; TRACE("func %p this %p\n", func_this, jsthis); @@ -357,14 +322,25 @@ assert(is_class(func_this, JSCLASS_FUNCTION)); function = (FunctionInstance*)func_this; + flags &= ~DISPATCH_JSCRIPT_INTERNAL_MASK; if(function->value_proc) return invoke_value_proc(function->dispex.ctx, function, jsthis, flags, argc, argv, r); - if(flags == DISPATCH_CONSTRUCT) - return invoke_constructor(function->dispex.ctx, function, argc, argv, r); + if(flags == DISPATCH_CONSTRUCT) { + jsdisp_t *this_obj; + HRESULT hres; + + hres = create_object(function->dispex.ctx, &function->dispex, &this_obj); + if(FAILED(hres)) + return hres; + + hres = invoke_source(function->dispex.ctx, function, to_disp(this_obj), argc, argv, TRUE, caller_execs_source, r); + jsdisp_release(this_obj); + return hres; + } assert(flags == DISPATCH_METHOD); - return invoke_source(function->dispex.ctx, function, jsthis, argc, argv, r); + return invoke_source(function->dispex.ctx, function, jsthis, argc, argv, FALSE, caller_execs_source, r); } static HRESULT Function_get_length(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) @@ -483,7 +459,7 @@ } if(SUCCEEDED(hres)) - hres = call_function(ctx, function, this_obj, cnt, args, r); + hres = call_function(ctx, function, this_obj, cnt, args, (flags & DISPATCH_JSCRIPT_CALLEREXECSSOURCE) != 0, r); if(this_obj) IDispatch_Release(this_obj); @@ -516,7 +492,7 @@ cnt = argc-1; } - hres = call_function(ctx, function, this_obj, cnt, argv+1, r); + hres = call_function(ctx, function, this_obj, cnt, argv+1, (flags & DISPATCH_JSCRIPT_CALLEREXECSSOURCE) != 0, r); if(this_obj) IDispatch_Release(this_obj); @@ -559,10 +535,18 @@ static HRESULT Function_get_arguments(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) { FunctionInstance *function = function_from_jsdisp(jsthis); + call_frame_t *frame; TRACE("\n"); - *r = function->arguments ? jsval_obj(jsdisp_addref(function->arguments)) : jsval_null(); + for(frame = ctx->call_ctx; frame; frame = frame->prev_frame) { + if(frame->function_instance == &function->dispex) { + *r = jsval_obj(jsdisp_addref(frame->arguments_obj)); + return S_OK; + } + } + + *r = jsval_null(); return S_OK; } diff -Nru wine-staging-1.9.6/dlls/jscript/global.c wine-staging-1.9.7~ubuntu15.04.1/dlls/jscript/global.c --- wine-staging-1.9.6/dlls/jscript/global.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/jscript/global.c 2016-04-04 18:06:32.000000000 +0000 @@ -185,9 +185,11 @@ } /* ECMA-262 3rd Edition 15.1.2.1 */ -static HRESULT JSGlobal_eval(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, +HRESULT JSGlobal_eval(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) { + call_frame_t *frame; + DWORD exec_flags = 0; bytecode_t *code; const WCHAR *src; HRESULT hres; @@ -206,7 +208,7 @@ return S_OK; } - if(!ctx->exec_ctx) { + if(!(frame = ctx->call_ctx)) { FIXME("No active exec_ctx\n"); return E_UNEXPECTED; } @@ -222,7 +224,12 @@ return throw_syntax_error(ctx, hres, NULL); } - hres = exec_source(ctx->exec_ctx, code, &code->global_code, TRUE, r); + if(frame->flags & EXEC_GLOBAL) + exec_flags |= EXEC_GLOBAL; + if(flags & DISPATCH_JSCRIPT_CALLEREXECSSOURCE) + exec_flags |= EXEC_RETURN_TO_INTERP; + hres = exec_source(ctx, exec_flags, code, &code->global_code, frame->scope, + frame->this_obj, NULL, frame->variable_obj, NULL, r); release_bytecode(code); return hres; } diff -Nru wine-staging-1.9.6/dlls/jscript/jscript.c wine-staging-1.9.7~ubuntu15.04.1/dlls/jscript/jscript.c --- wine-staging-1.9.6/dlls/jscript/jscript.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/jscript/jscript.c 2016-04-04 18:06:32.000000000 +0000 @@ -74,6 +74,8 @@ heap_pool_free(&ctx->tmp_heap); if(ctx->last_match) jsstr_release(ctx->last_match); + assert(!ctx->stack_top); + heap_free(ctx->stack); ctx->jscaller->ctx = NULL; IServiceProvider_Release(&ctx->jscaller->IServiceProvider_iface); @@ -100,18 +102,12 @@ static HRESULT exec_global_code(JScript *This, bytecode_t *code) { - exec_ctx_t *exec_ctx; HRESULT hres; - hres = create_exec_ctx(This->ctx, NULL, This->ctx->global, NULL, TRUE, &exec_ctx); - if(FAILED(hres)) - return hres; - IActiveScriptSite_OnEnterScript(This->site); clear_ei(This->ctx); - hres = exec_source(exec_ctx, code, &code->global_code, FALSE, NULL); - exec_release(exec_ctx); + hres = exec_source(This->ctx, EXEC_GLOBAL, code, &code->global_code, NULL, NULL, NULL, This->ctx->global, NULL, NULL); IActiveScriptSite_OnLeaveScript(This->site); return hres; @@ -772,26 +768,19 @@ return hres; if(dwFlags & SCRIPTTEXT_ISEXPRESSION) { - exec_ctx_t *exec_ctx; - - hres = create_exec_ctx(This->ctx, NULL, This->ctx->global, NULL, TRUE, &exec_ctx); - if(SUCCEEDED(hres)) { - jsval_t r; - - IActiveScriptSite_OnEnterScript(This->site); + jsval_t r; - clear_ei(This->ctx); - hres = exec_source(exec_ctx, code, &code->global_code, TRUE, &r); - if(SUCCEEDED(hres)) { - if(pvarResult) - hres = jsval_to_variant(r, pvarResult); - jsval_release(r); - } - exec_release(exec_ctx); + IActiveScriptSite_OnEnterScript(This->site); - IActiveScriptSite_OnLeaveScript(This->site); + clear_ei(This->ctx); + hres = exec_source(This->ctx, EXEC_GLOBAL, code, &code->global_code, NULL, NULL, NULL, This->ctx->global, NULL, &r); + if(SUCCEEDED(hres)) { + if(pvarResult) + hres = jsval_to_variant(r, pvarResult); + jsval_release(r); } + IActiveScriptSite_OnLeaveScript(This->site); return hres; } diff -Nru wine-staging-1.9.6/dlls/jscript/jscript.h wine-staging-1.9.7~ubuntu15.04.1/dlls/jscript/jscript.h --- wine-staging-1.9.6/dlls/jscript/jscript.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/jscript/jscript.h 2016-04-04 18:06:32.000000000 +0000 @@ -36,7 +36,6 @@ typedef struct _jsval_t jsval_t; typedef struct _jsstr_t jsstr_t; typedef struct _script_ctx_t script_ctx_t; -typedef struct _exec_ctx_t exec_ctx_t; typedef struct _dispex_prop_t dispex_prop_t; typedef struct { @@ -102,6 +101,14 @@ #define PROPF_CONST 0x0800 #define PROPF_DONTDELETE 0x1000 +/* + * This is our internal dispatch flag informing calee that it's called directly from interpreter. + * If calee is executed as interpreted function, we may let already running interpreter to take + * of execution. + */ +#define DISPATCH_JSCRIPT_CALLEREXECSSOURCE 0x8000 +#define DISPATCH_JSCRIPT_INTERNAL_MASK DISPATCH_JSCRIPT_CALLEREXECSSOURCE + /* NOTE: Keep in sync with names in Object.toString implementation */ typedef enum { JSCLASS_NONE, @@ -385,7 +392,7 @@ SCRIPTSTATE state; IActiveScript *active_script; - exec_ctx_t *exec_ctx; + struct _call_frame_t *call_ctx; named_item_t *named_items; IActiveScriptSite *site; IInternetHostSecurityManager *secmgr; @@ -400,6 +407,10 @@ IDispatch *host_global; + jsval_t *stack; + unsigned stack_size; + unsigned stack_top; + jsstr_t *last_match; match_result_t match_parens[9]; DWORD last_match_index; @@ -464,6 +475,8 @@ BOOL bool_obj_value(jsdisp_t*) DECLSPEC_HIDDEN; unsigned array_get_length(jsdisp_t*) DECLSPEC_HIDDEN; +HRESULT JSGlobal_eval(script_ctx_t*,vdisp_t*,WORD,unsigned,jsval_t*,jsval_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.6/dlls/jscript/tests/lang.js wine-staging-1.9.7~ubuntu15.04.1/dlls/jscript/tests/lang.js --- wine-staging-1.9.6/dlls/jscript/tests/lang.js 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/jscript/tests/lang.js 2016-04-04 18:06:32.000000000 +0000 @@ -194,6 +194,24 @@ testRecFunc(true); ok(testRecFunc.arguments === null, "testRecFunc.arguments = " + testRecFunc.arguments); +function argumentsTest() { + var save = arguments; + with({arguments: 1}) { + ok(arguments === 1, "arguments = " + arguments); + (function() { + ok(argumentsTest.arguments === save, "unexpected argumentsTest.arguments"); + })(); + } + eval('ok(arguments === save, "unexpected arguments");'); + [1,2].sort(function() { + ok(argumentsTest.arguments === save, "unexpected argumentsTest.arguments"); + return 1; + }); +} +/* FIXME: It seems that when function is called as an expression, instance object arguments is not set. + * We currently always set it in Wine. */ +argumentsTest(); + tmp = (function() {1;})(); ok(tmp === undefined, "tmp = " + tmp); tmp = eval("1;"); diff -Nru wine-staging-1.9.6/dlls/kernel32/console.c wine-staging-1.9.7~ubuntu15.04.1/dlls/kernel32/console.c --- wine-staging-1.9.6/dlls/kernel32/console.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/kernel32/console.c 2016-04-04 18:06:32.000000000 +0000 @@ -3346,3 +3346,10 @@ SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; } + +BOOL WINAPI SetCurrentConsoleFontEx(HANDLE hConsole, BOOL maxwindow, CONSOLE_FONT_INFOEX *cfix) +{ + FIXME("(%p %d %p): stub!\n", hConsole, maxwindow, cfix); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} diff -Nru wine-staging-1.9.6/dlls/kernel32/file.c wine-staging-1.9.7~ubuntu15.04.1/dlls/kernel32/file.c --- wine-staging-1.9.6/dlls/kernel32/file.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/kernel32/file.c 2016-04-04 18:06:32.000000000 +0000 @@ -625,7 +625,9 @@ if (WaitForSingleObject( lpOverlapped->hEvent ? lpOverlapped->hEvent : hFile, INFINITE ) == WAIT_FAILED) return FALSE; + status = lpOverlapped->Internal; + if (status == STATUS_PENDING) status = STATUS_SUCCESS; } *lpTransferred = lpOverlapped->InternalHigh; @@ -1629,6 +1631,7 @@ { WCHAR *nameW; + if ((GetVersion() & 0x80000000) && IsBadStringPtrA(filename, -1)) return INVALID_HANDLE_VALUE; if (!(nameW = FILE_name_AtoW( filename, FALSE ))) return INVALID_HANDLE_VALUE; return CreateFileW( nameW, access, sharing, sa, creation, attributes, template ); } diff -Nru wine-staging-1.9.6/dlls/kernel32/kernel32.spec wine-staging-1.9.7~ubuntu15.04.1/dlls/kernel32/kernel32.spec --- wine-staging-1.9.6/dlls/kernel32/kernel32.spec 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/kernel32/kernel32.spec 2016-04-04 18:06:32.000000000 +0000 @@ -1369,7 +1369,7 @@ @ stdcall SetConsoleTitleW(wstr) @ stdcall SetConsoleWindowInfo(long long ptr) @ stdcall SetCriticalSectionSpinCount(ptr long) ntdll.RtlSetCriticalSectionSpinCount -# @ stub SetCurrentConsoleFontEx +@ stdcall SetCurrentConsoleFontEx(long long ptr) @ stdcall SetCurrentDirectoryA(str) @ stdcall SetCurrentDirectoryW(wstr) @ stub SetDaylightFlag diff -Nru wine-staging-1.9.6/dlls/kernel32/Makefile.in wine-staging-1.9.7~ubuntu15.04.1/dlls/kernel32/Makefile.in --- wine-staging-1.9.6/dlls/kernel32/Makefile.in 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/kernel32/Makefile.in 2016-04-04 18:06:32.000000000 +0000 @@ -3,7 +3,7 @@ IMPORTLIB = kernel32 IMPORTS = winecrt0 ntdll EXTRALIBS = $(COREFOUNDATION_LIBS) $(POLL_LIBS) -EXTRADLLFLAGS = -nodefaultlibs -Wb,-F,KERNEL32.dll -Wl,--image-base,0x7b800000 +EXTRADLLFLAGS = -nodefaultlibs -Wb,-F,KERNEL32.dll -Wl,--image-base,0x7b400000 C_SRCS = \ actctx.c \ diff -Nru wine-staging-1.9.6/dlls/kernel32/module.c wine-staging-1.9.7~ubuntu15.04.1/dlls/kernel32/module.c --- wine-staging-1.9.6/dlls/kernel32/module.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/kernel32/module.c 2016-04-04 18:06:32.000000000 +0000 @@ -948,7 +948,10 @@ if (nts != STATUS_SUCCESS) { hModule = 0; - SetLastError( RtlNtStatusToDosError( nts ) ); + if (nts == STATUS_DLL_NOT_FOUND && (GetVersion() & 0x80000000)) + SetLastError( ERROR_DLL_NOT_FOUND ); + else + SetLastError( RtlNtStatusToDosError( nts ) ); } done: HeapFree( GetProcessHeap(), 0, load_path ); diff -Nru wine-staging-1.9.6/dlls/kernel32/tests/file.c wine-staging-1.9.7~ubuntu15.04.1/dlls/kernel32/tests/file.c --- wine-staging-1.9.6/dlls/kernel32/tests/file.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/kernel32/tests/file.c 2016-04-04 18:06:32.000000000 +0000 @@ -3361,6 +3361,11 @@ "wrong error %u\n", GetLastError() ); ok( r == FALSE, "should return false\n"); + r = GetOverlappedResult( 0, &ov, &result, TRUE ); + ok( r == TRUE, "should return TRUE\n" ); + ok( result == 0xabcd, "wrong result %u\n", result ); + ok( ov.Internal == STATUS_PENDING, "expected STATUS_PENDING, got %08lx\n", ov.Internal ); + ResetEvent( ov.hEvent ); SetLastError( 0xb00 ); diff -Nru wine-staging-1.9.6/dlls/kernel32/tests/virtual.c wine-staging-1.9.7~ubuntu15.04.1/dlls/kernel32/tests/virtual.c --- wine-staging-1.9.6/dlls/kernel32/tests/virtual.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/kernel32/tests/virtual.c 2016-04-04 18:06:32.000000000 +0000 @@ -1808,7 +1808,7 @@ #ifdef __i386__ -static DWORD num_guard_page_calls; +static LONG num_guard_page_calls; static DWORD guard_page_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTRATION_RECORD *frame, CONTEXT *context, EXCEPTION_REGISTRATION_RECORD **dispatcher ) @@ -1820,7 +1820,7 @@ ok( rec->ExceptionCode == STATUS_GUARD_PAGE_VIOLATION, "ExceptionCode is %08x instead of %08x\n", rec->ExceptionCode, STATUS_GUARD_PAGE_VIOLATION ); - num_guard_page_calls++; + InterlockedIncrement( &num_guard_page_calls ); *(int *)rec->ExceptionInformation[1] += 0x100; return ExceptionContinueExecution; @@ -1909,8 +1909,8 @@ frame.Prev = pNtCurrentTeb()->Tib.ExceptionList; pNtCurrentTeb()->Tib.ExceptionList = &frame; - num_guard_page_calls = 0; - old_value = *value; /* exception handler increments value by 0x100 */ + InterlockedExchange( &num_guard_page_calls, 0 ); + InterlockedExchange( &old_value, *value ); /* exception handler increments value by 0x100 */ *value = 2; ok( old_value == 0x101, "memory block contains wrong value, expected 0x101, got 0x%x\n", old_value ); ok( num_guard_page_calls == 1, "expected one callback of guard page handler, got %d calls\n", num_guard_page_calls ); @@ -1931,7 +1931,7 @@ frame.Prev = pNtCurrentTeb()->Tib.ExceptionList; pNtCurrentTeb()->Tib.ExceptionList = &frame; - num_guard_page_calls = 0; + InterlockedExchange( &num_guard_page_calls, 0 ); old_value = *(value + 1); ok( old_value == 0x102, "memory block contains wrong value, expected 0x102, got 0x%x\n", old_value ); ok( *value == 2, "memory block contains wrong value, expected 2, got 0x%x\n", *value ); @@ -1985,7 +1985,7 @@ frame.Prev = pNtCurrentTeb()->Tib.ExceptionList; pNtCurrentTeb()->Tib.ExceptionList = &frame; - num_guard_page_calls = 0; + InterlockedExchange( &num_guard_page_calls, 0 ); *value = 1; *(value + 1) = 2; ok( num_guard_page_calls == 1, "expected one callback of guard page handler, got %d calls\n", num_guard_page_calls ); @@ -2006,7 +2006,7 @@ frame.Prev = pNtCurrentTeb()->Tib.ExceptionList; pNtCurrentTeb()->Tib.ExceptionList = &frame; - num_guard_page_calls = 0; + InterlockedExchange( &num_guard_page_calls, 0 ); old_value = *(value + 1); /* doesn't trigger write watch */ ok( old_value == 0x102, "memory block contains wrong value, expected 0x102, got 0x%x\n", old_value ); ok( *value == 1, "memory block contains wrong value, expected 1, got 0x%x\n", *value ); @@ -2132,7 +2132,7 @@ VirtualFree( call_on_stack, 0, MEM_RELEASE ); } -DWORD num_execute_fault_calls; +static LONG num_execute_fault_calls; static DWORD execute_fault_seh_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTRATION_RECORD *frame, CONTEXT *context, EXCEPTION_REGISTRATION_RECORD **dispatcher ) @@ -2157,7 +2157,7 @@ ok( rec->ExceptionInformation[0] == err, "ExceptionInformation[0] is %d instead of %d\n", (DWORD)rec->ExceptionInformation[0], err ); - num_guard_page_calls++; + InterlockedIncrement( &num_guard_page_calls ); } else if (rec->ExceptionCode == STATUS_ACCESS_VIOLATION) { @@ -2172,7 +2172,7 @@ ok( success, "VirtualProtect failed %u\n", GetLastError() ); ok( old_prot == PAGE_READWRITE, "wrong old prot %x\n", old_prot ); - num_execute_fault_calls++; + InterlockedIncrement( &num_execute_fault_calls ); } return ExceptionContinueExecution; @@ -2193,7 +2193,7 @@ "ExceptionCode is %08x instead of STATUS_ACCESS_VIOLATION\n", rec->ExceptionCode ); if (rec->ExceptionCode == STATUS_ACCESS_VIOLATION) - num_execute_fault_calls++; + InterlockedIncrement( &num_execute_fault_calls ); if (rec->ExceptionInformation[0] == EXCEPTION_READ_FAULT) return EXCEPTION_CONTINUE_SEARCH; @@ -2214,7 +2214,8 @@ frame.Prev = pNtCurrentTeb()->Tib.ExceptionList; pNtCurrentTeb()->Tib.ExceptionList = &frame; - num_guard_page_calls = num_execute_fault_calls = 0; + InterlockedExchange( &num_guard_page_calls, 0 ); + InterlockedExchange( &num_execute_fault_calls, 0 ); ret = SendMessageA( hWnd, uMsg, wParam, lParam ); pNtCurrentTeb()->Tib.ExceptionList = frame.Prev; @@ -2231,7 +2232,8 @@ frame.Prev = pNtCurrentTeb()->Tib.ExceptionList; pNtCurrentTeb()->Tib.ExceptionList = &frame; - num_guard_page_calls = num_execute_fault_calls = 0; + InterlockedExchange( &num_guard_page_calls, 0 ); + InterlockedExchange( &num_execute_fault_calls, 0 ); ret = code( arg ); pNtCurrentTeb()->Tib.ExceptionList = frame.Prev; diff -Nru wine-staging-1.9.6/dlls/kernelbase/kernelbase.spec wine-staging-1.9.7~ubuntu15.04.1/dlls/kernelbase/kernelbase.spec --- wine-staging-1.9.6/dlls/kernelbase/kernelbase.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/kernelbase/kernelbase.spec 2016-04-04 18:06:32.000000000 +0000 @@ -0,0 +1,631 @@ +@ stub AccessCheck +@ stub AccessCheckAndAuditAlarmW +@ stub AccessCheckByType +@ stub AccessCheckByTypeAndAuditAlarmW +@ stub AccessCheckByTypeResultList +@ stub AccessCheckByTypeResultListAndAuditAlarmByHandleW +@ stub AccessCheckByTypeResultListAndAuditAlarmW +@ stdcall AcquireSRWLockExclusive(ptr) kernel32.AcquireSRWLockExclusive +@ stdcall AcquireSRWLockShared(ptr) kernel32.AcquireSRWLockShared +@ stub AddAccessAllowedAce +@ stub AddAccessAllowedAceEx +@ stub AddAccessAllowedObjectAce +@ stub AddAccessDeniedAce +@ stub AddAccessDeniedAceEx +@ stub AddAccessDeniedObjectAce +@ stub AddAce +@ stub AddAuditAccessAce +@ stub AddAuditAccessAceEx +@ stub AddAuditAccessObjectAce +@ stub AddDllDirectory +@ stub AddMandatoryAce +@ stub AdjustTokenGroups +@ stub AdjustTokenPrivileges +@ stub AllocateAndInitializeSid +@ stub AllocateLocallyUniqueId +@ stub AreAllAccessesGranted +@ stub AreAnyAccessesGranted +@ stdcall AreFileApisANSI() kernel32.AreFileApisANSI +@ stub BaseDllFreeResourceId +@ stub BaseDllMapResourceIdW +@ stub BaseGetProcessDllPath +@ stub BaseGetProcessExePath +@ stub BaseInvalidateDllSearchPathCache +@ stub BaseInvalidateProcessSearchPathCache +@ stub BaseReleaseProcessDllPath +@ stub BaseReleaseProcessExePath +@ stdcall Beep(long long) kernel32.Beep +@ stub BemCopyReference +@ stub BemCreateContractFrom +@ stub BemCreateReference +@ stub BemFreeContract +@ stub BemFreeReference +@ stdcall CallbackMayRunLong(ptr) kernel32.CallbackMayRunLong +@ stdcall CancelIoEx(long ptr) kernel32.CancelIoEx +@ stub CancelThreadpoolIo +@ stdcall CancelWaitableTimer(long) kernel32.CancelWaitableTimer +@ stdcall ChangeTimerQueueTimer(ptr ptr long long) kernel32.ChangeTimerQueueTimer +@ stub CheckGroupPolicyEnabled +@ stub CheckTokenMembership +@ stdcall CloseHandle(long) kernel32.CloseHandle +@ stdcall CloseThreadpool(ptr) kernel32.CloseThreadpool +@ stdcall CloseThreadpoolCleanupGroup(ptr) kernel32.CloseThreadpoolCleanupGroup +@ stdcall CloseThreadpoolCleanupGroupMembers(ptr long ptr) kernel32.CloseThreadpoolCleanupGroupMembers +@ stub CloseThreadpoolIo +@ stdcall CloseThreadpoolTimer(ptr) kernel32.CloseThreadpoolTimer +@ stdcall CloseThreadpoolWait(ptr) kernel32.CloseThreadpoolWait +@ stdcall CloseThreadpoolWork(ptr) kernel32.CloseThreadpoolWork +@ stdcall CompareFileTime(ptr ptr) kernel32.CompareFileTime +@ stdcall CompareStringA(long long str long str long) kernel32.CompareStringA +@ stdcall CompareStringEx(wstr long wstr long wstr long ptr ptr long) kernel32.CompareStringEx +@ stdcall CompareStringOrdinal(wstr long wstr long long) kernel32.CompareStringOrdinal +@ stdcall CompareStringW(long long wstr long wstr long) kernel32.CompareStringW +@ stdcall ConnectNamedPipe(long ptr) kernel32.ConnectNamedPipe +@ stdcall ConvertDefaultLocale(long) kernel32.ConvertDefaultLocale +@ stub ConvertToAutoInheritPrivateObjectSecurity +@ stub CopySid +@ stdcall CreateDirectoryA(str ptr) kernel32.CreateDirectoryA +@ stdcall CreateDirectoryW(wstr ptr) kernel32.CreateDirectoryW +@ stdcall CreateEventA(ptr long long str) kernel32.CreateEventA +@ stdcall CreateEventExA(ptr str long long) kernel32.CreateEventExA +@ stdcall CreateEventExW(ptr wstr long long) kernel32.CreateEventExW +@ stdcall CreateEventW(ptr long long wstr) kernel32.CreateEventW +@ stdcall CreateFileA(str long long ptr long long long) kernel32.CreateFileA +@ stub CreateFileMappingNumaW +@ stdcall CreateFileMappingW(long ptr long long long wstr) kernel32.CreateFileMappingW +@ stdcall CreateFileW(wstr long long ptr long long long) kernel32.CreateFileW +@ stdcall CreateIoCompletionPort(long long long long) kernel32.CreateIoCompletionPort +@ stdcall CreateMutexA(ptr long str) kernel32.CreateMutexA +@ stdcall CreateMutexExA(ptr str long long) kernel32.CreateMutexExA +@ stdcall CreateMutexExW(ptr wstr long long) kernel32.CreateMutexExW +@ stdcall CreateMutexW(ptr long wstr) kernel32.CreateMutexW +@ stdcall CreateNamedPipeW(wstr long long long long long long ptr) kernel32.CreateNamedPipeW +@ stdcall CreatePipe(ptr ptr ptr long) kernel32.CreatePipe +@ stub CreatePrivateObjectSecurity +@ stub CreatePrivateObjectSecurityEx +@ stub CreatePrivateObjectSecurityWithMultipleInheritance +@ stdcall CreateRemoteThread(long ptr long ptr long long ptr) kernel32.CreateRemoteThread +@ stub CreateRemoteThreadEx +@ stub CreateRestrictedToken +@ stdcall CreateSemaphoreExW(ptr long long wstr long long) kernel32.CreateSemaphoreExW +@ stdcall CreateThread(ptr long ptr long long ptr) kernel32.CreateThread +@ stdcall CreateThreadpool(ptr) kernel32.CreateThreadpool +@ stdcall CreateThreadpoolCleanupGroup() kernel32.CreateThreadpoolCleanupGroup +@ stub CreateThreadpoolIo +@ stdcall CreateThreadpoolTimer(ptr ptr ptr) kernel32.CreateThreadpoolTimer +@ stdcall CreateThreadpoolWait(ptr ptr ptr) kernel32.CreateThreadpoolWait +@ stdcall CreateThreadpoolWork(ptr ptr ptr) kernel32.CreateThreadpoolWork +@ stdcall CreateTimerQueue() kernel32.CreateTimerQueue +@ stdcall CreateTimerQueueTimer(ptr long ptr ptr long long long) kernel32.CreateTimerQueueTimer +@ stdcall CreateWaitableTimerExW(ptr wstr long long) kernel32.CreateWaitableTimerExW +@ stub CreateWellKnownSid +@ stdcall DebugBreak() kernel32.DebugBreak +@ stdcall DecodePointer(ptr) kernel32.DecodePointer +@ stub DecodeSystemPointer +@ stdcall DefineDosDeviceW(long wstr wstr) kernel32.DefineDosDeviceW +@ stub DeleteAce +@ stdcall DeleteCriticalSection(ptr) kernel32.DeleteCriticalSection +@ stdcall DeleteFileA(str) kernel32.DeleteFileA +@ stdcall DeleteFileW(wstr) kernel32.DeleteFileW +@ stub DeleteProcThreadAttributeList +@ stdcall DeleteTimerQueueEx(long long) kernel32.DeleteTimerQueueEx +@ stdcall DeleteTimerQueueTimer(long long long) kernel32.DeleteTimerQueueTimer +@ stdcall DeleteVolumeMountPointW(wstr) kernel32.DeleteVolumeMountPointW +@ stub DestroyPrivateObjectSecurity +@ stdcall DeviceIoControl(long long ptr long ptr long ptr ptr) kernel32.DeviceIoControl +@ stdcall DisableThreadLibraryCalls(long) kernel32.DisableThreadLibraryCalls +@ stdcall DisassociateCurrentThreadFromCallback(ptr) kernel32.DisassociateCurrentThreadFromCallback +@ stdcall DisconnectNamedPipe(long) kernel32.DisconnectNamedPipe +@ stdcall DuplicateHandle(long long long ptr long long long) kernel32.DuplicateHandle +@ stub DuplicateToken +@ stub DuplicateTokenEx +@ stdcall EncodePointer(ptr) kernel32.EncodePointer +@ stub EncodeSystemPointer +@ stdcall EnterCriticalSection(ptr) kernel32.EnterCriticalSection +@ stdcall EnumCalendarInfoExEx(ptr wstr long wstr long long) kernel32.EnumCalendarInfoExEx +@ stdcall EnumCalendarInfoExW(ptr long long long) kernel32.EnumCalendarInfoExW +@ stdcall EnumCalendarInfoW(ptr long long long) kernel32.EnumCalendarInfoW +@ stdcall EnumDateFormatsExEx(ptr wstr long long) kernel32.EnumDateFormatsExEx +@ stdcall EnumDateFormatsExW(ptr long long) kernel32.EnumDateFormatsExW +@ stdcall EnumDateFormatsW(ptr long long) kernel32.EnumDateFormatsW +@ stdcall EnumLanguageGroupLocalesW(ptr long long ptr) kernel32.EnumLanguageGroupLocalesW +@ stdcall EnumSystemCodePagesW(ptr long) kernel32.EnumSystemCodePagesW +@ stdcall EnumSystemLanguageGroupsW(ptr long ptr) kernel32.EnumSystemLanguageGroupsW +@ stdcall EnumSystemLocalesA(ptr long) kernel32.EnumSystemLocalesA +@ stdcall EnumSystemLocalesEx(ptr long long ptr) kernel32.EnumSystemLocalesEx +@ stdcall EnumSystemLocalesW(ptr long) kernel32.EnumSystemLocalesW +@ stdcall EnumTimeFormatsEx(ptr wstr long long) kernel32.EnumTimeFormatsEx +@ stdcall EnumTimeFormatsW(ptr long long) kernel32.EnumTimeFormatsW +@ stdcall EnumUILanguagesW(ptr long long) kernel32.EnumUILanguagesW +@ stub EqualDomainSid +@ stub EqualPrefixSid +@ stub EqualSid +@ stdcall ExitProcess(long) kernel32.ExitProcess +@ stdcall ExitThread(long) kernel32.ExitThread +@ stdcall ExpandEnvironmentStringsA(str ptr long) kernel32.ExpandEnvironmentStringsA +@ stdcall ExpandEnvironmentStringsW(wstr ptr long) kernel32.ExpandEnvironmentStringsW +@ stdcall FatalAppExitA(long str) kernel32.FatalAppExitA +@ stdcall FatalAppExitW(long wstr) kernel32.FatalAppExitW +@ stdcall FileTimeToLocalFileTime(ptr ptr) kernel32.FileTimeToLocalFileTime +@ stdcall FileTimeToSystemTime(ptr ptr) kernel32.FileTimeToSystemTime +@ stdcall FindClose(long) kernel32.FindClose +@ stdcall FindCloseChangeNotification(long) kernel32.FindCloseChangeNotification +@ stdcall FindFirstChangeNotificationA(str long long) kernel32.FindFirstChangeNotificationA +@ stdcall FindFirstChangeNotificationW(wstr long long) kernel32.FindFirstChangeNotificationW +@ stdcall FindFirstFileA(str ptr) kernel32.FindFirstFileA +@ stdcall FindFirstFileExA(str long ptr long ptr long) kernel32.FindFirstFileExA +@ stdcall FindFirstFileExW(wstr long ptr long ptr long) kernel32.FindFirstFileExW +@ stdcall FindFirstFileW(wstr ptr) kernel32.FindFirstFileW +@ stub FindFirstFreeAce +@ stdcall FindFirstVolumeW(ptr long) kernel32.FindFirstVolumeW +@ stub FindNLSString +@ stub FindNLSStringEx +@ stdcall FindNextChangeNotification(long) kernel32.FindNextChangeNotification +@ stdcall FindNextFileA(long ptr) kernel32.FindNextFileA +@ stdcall FindNextFileW(long ptr) kernel32.FindNextFileW +@ stdcall FindNextVolumeW(long ptr long) kernel32.FindNextVolumeW +@ stdcall FindResourceExW(long wstr wstr long) kernel32.FindResourceExW +@ stub FindStringOrdinal +@ stdcall FindVolumeClose(ptr) kernel32.FindVolumeClose +@ stdcall FlsAlloc(ptr) kernel32.FlsAlloc +@ stdcall FlsFree(long) kernel32.FlsFree +@ stdcall FlsGetValue(long) kernel32.FlsGetValue +@ stdcall FlsSetValue(long ptr) kernel32.FlsSetValue +@ stdcall FlushFileBuffers(long) kernel32.FlushFileBuffers +@ stdcall FlushProcessWriteBuffers() kernel32.FlushProcessWriteBuffers +@ stdcall FlushViewOfFile(ptr long) kernel32.FlushViewOfFile +@ stdcall FoldStringW(long wstr long ptr long) kernel32.FoldStringW +@ stdcall FormatMessageA(long ptr long long ptr long ptr) kernel32.FormatMessageA +@ stdcall FormatMessageW(long ptr long long ptr long ptr) kernel32.FormatMessageW +@ stdcall FreeEnvironmentStringsA(ptr) kernel32.FreeEnvironmentStringsA +@ stdcall FreeEnvironmentStringsW(ptr) kernel32.FreeEnvironmentStringsW +@ stdcall FreeLibrary(long) kernel32.FreeLibrary +@ stdcall FreeLibraryAndExitThread(long long) kernel32.FreeLibraryAndExitThread +@ stdcall FreeLibraryWhenCallbackReturns(ptr ptr) kernel32.FreeLibraryWhenCallbackReturns +@ stdcall FreeResource(long) kernel32.FreeResource +@ stub FreeSid +@ stdcall GetACP() kernel32.GetACP +@ stub GetAce +@ stub GetAclInformation +@ stub GetCPFileNameFromRegistry +@ stub GetCPHashNode +@ stdcall GetCPInfo(long ptr) kernel32.GetCPInfo +@ stdcall GetCPInfoExW(long long ptr) kernel32.GetCPInfoExW +@ stub GetCalendar +@ stdcall GetCalendarInfoEx(wstr long ptr long ptr long ptr) kernel32.GetCalendarInfoEx +@ stdcall GetCalendarInfoW(long long long ptr long ptr) kernel32.GetCalendarInfoW +@ stdcall GetCommandLineA() kernel32.GetCommandLineA +@ stdcall GetCommandLineW() kernel32.GetCommandLineW +@ stdcall GetComputerNameExA(long ptr ptr) kernel32.GetComputerNameExA +@ stdcall GetComputerNameExW(long ptr ptr) kernel32.GetComputerNameExW +@ stub GetCurrencyFormatEx +@ stdcall GetCurrencyFormatW(long long str ptr str long) kernel32.GetCurrencyFormatW +@ stdcall GetCurrentDirectoryA(long ptr) kernel32.GetCurrentDirectoryA +@ stdcall GetCurrentDirectoryW(long ptr) kernel32.GetCurrentDirectoryW +@ stdcall -norelay GetCurrentProcess() kernel32.GetCurrentProcess +@ stdcall -norelay GetCurrentProcessId() kernel32.GetCurrentProcessId +@ stdcall -norelay GetCurrentThread() kernel32.GetCurrentThread +@ stdcall -norelay GetCurrentThreadId() kernel32.GetCurrentThreadId +@ stdcall GetDiskFreeSpaceA(str ptr ptr ptr ptr) kernel32.GetDiskFreeSpaceA +@ stdcall GetDiskFreeSpaceExA(str ptr ptr ptr) kernel32.GetDiskFreeSpaceExA +@ stdcall GetDiskFreeSpaceExW(wstr ptr ptr ptr) kernel32.GetDiskFreeSpaceExW +@ stdcall GetDiskFreeSpaceW(wstr ptr ptr ptr ptr) kernel32.GetDiskFreeSpaceW +@ stdcall GetDriveTypeA(str) kernel32.GetDriveTypeA +@ stdcall GetDriveTypeW(wstr) kernel32.GetDriveTypeW +@ stdcall GetDynamicTimeZoneInformation(ptr) kernel32.GetDynamicTimeZoneInformation +@ stdcall GetEnvironmentStrings() kernel32.GetEnvironmentStrings +@ stdcall GetEnvironmentStringsA() kernel32.GetEnvironmentStringsA +@ stdcall GetEnvironmentStringsW() kernel32.GetEnvironmentStringsW +@ stdcall GetEnvironmentVariableA(str ptr long) kernel32.GetEnvironmentVariableA +@ stdcall GetEnvironmentVariableW(wstr ptr long) kernel32.GetEnvironmentVariableW +@ stub GetEraNameCountedString +@ stdcall GetErrorMode() kernel32.GetErrorMode +@ stdcall GetExitCodeProcess(long ptr) kernel32.GetExitCodeProcess +@ stdcall GetExitCodeThread(long ptr) kernel32.GetExitCodeThread +@ stub GetFallbackDisplayName +@ stdcall GetFileAttributesA(str) kernel32.GetFileAttributesA +@ stdcall GetFileAttributesExA(str long ptr) kernel32.GetFileAttributesExA +@ stdcall GetFileAttributesExW(wstr long ptr) kernel32.GetFileAttributesExW +@ stdcall GetFileAttributesW(wstr) kernel32.GetFileAttributesW +@ stdcall GetFileInformationByHandle(long ptr) kernel32.GetFileInformationByHandle +@ stdcall GetFileMUIInfo(long wstr ptr ptr) kernel32.GetFileMUIInfo +@ stdcall GetFileMUIPath(long wstr wstr ptr ptr ptr ptr) kernel32.GetFileMUIPath +@ stub GetFileSecurityW +@ stdcall GetFileSize(long ptr) kernel32.GetFileSize +@ stdcall GetFileSizeEx(long ptr) kernel32.GetFileSizeEx +@ stdcall GetFileTime(long ptr ptr ptr) kernel32.GetFileTime +@ stdcall GetFileType(long) kernel32.GetFileType +@ stub GetFinalPathNameByHandleA +@ stub GetFinalPathNameByHandleW +@ stdcall GetFullPathNameA(str long ptr ptr) kernel32.GetFullPathNameA +@ stdcall GetFullPathNameW(wstr long ptr ptr) kernel32.GetFullPathNameW +@ stdcall GetHandleInformation(long ptr) kernel32.GetHandleInformation +@ stub GetKernelObjectSecurity +@ stdcall GetLastError() kernel32.GetLastError +@ stub GetLengthSid +@ stdcall GetLocalTime(ptr) kernel32.GetLocalTime +@ stdcall GetLocaleInfoA(long long ptr long) kernel32.GetLocaleInfoA +@ stdcall GetLocaleInfoEx(wstr long ptr long) kernel32.GetLocaleInfoEx +@ stub GetLocaleInfoHelper +@ stdcall GetLocaleInfoW(long long ptr long) kernel32.GetLocaleInfoW +@ stdcall GetLogicalDriveStringsW(long ptr) kernel32.GetLogicalDriveStringsW +@ stdcall GetLogicalDrives() kernel32.GetLogicalDrives +@ stdcall GetLogicalProcessorInformation(ptr ptr) kernel32.GetLogicalProcessorInformation +@ stdcall GetLogicalProcessorInformationEx(long ptr ptr) kernel32.GetLogicalProcessorInformationEx +@ stdcall GetLongPathNameA(str long long) kernel32.GetLongPathNameA +@ stdcall GetLongPathNameW(wstr long long) kernel32.GetLongPathNameW +@ stdcall GetModuleFileNameA(long ptr long) kernel32.GetModuleFileNameA +@ stdcall GetModuleFileNameW(long ptr long) kernel32.GetModuleFileNameW +@ stdcall GetModuleHandleA(str) kernel32.GetModuleHandleA +@ stdcall GetModuleHandleExA(long ptr ptr) kernel32.GetModuleHandleExA +@ stdcall GetModuleHandleExW(long ptr ptr) kernel32.GetModuleHandleExW +@ stdcall GetModuleHandleW(wstr) kernel32.GetModuleHandleW +@ stub GetNLSVersion +@ stub GetNLSVersionEx +@ stub GetNamedLocaleHashNode +@ stub GetNamedPipeAttribute +@ stub GetNamedPipeClientComputerNameW +@ stub GetNumberFormatEx +@ stdcall GetNumberFormatW(long long wstr ptr ptr long) kernel32.GetNumberFormatW +@ stdcall GetOEMCP() kernel32.GetOEMCP +@ stdcall GetOverlappedResult(long ptr ptr long) kernel32.GetOverlappedResult +@ stdcall GetPriorityClass(long) kernel32.GetPriorityClass +@ stub GetPrivateObjectSecurity +@ stdcall GetProcAddress(long str) kernel32.GetProcAddress +@ stdcall -norelay GetProcessHeap() kernel32.GetProcessHeap +@ stdcall GetProcessHeaps(long ptr) kernel32.GetProcessHeaps +@ stdcall GetProcessId(long) kernel32.GetProcessId +@ stdcall GetProcessIdOfThread(long) kernel32.GetProcessIdOfThread +@ stub GetProcessPreferredUILanguages +@ stdcall GetProcessTimes(long ptr ptr ptr ptr) kernel32.GetProcessTimes +@ stdcall GetProcessVersion(long) kernel32.GetProcessVersion +@ stub GetPtrCalData +@ stub GetPtrCalDataArray +@ stdcall GetQueuedCompletionStatus(long ptr ptr ptr long) kernel32.GetQueuedCompletionStatus +@ stub GetQueuedCompletionStatusEx +@ stub GetSecurityDescriptorControl +@ stub GetSecurityDescriptorDacl +@ stub GetSecurityDescriptorGroup +@ stub GetSecurityDescriptorLength +@ stub GetSecurityDescriptorOwner +@ stub GetSecurityDescriptorRMControl +@ stub GetSecurityDescriptorSacl +@ stdcall GetShortPathNameW(wstr ptr long) kernel32.GetShortPathNameW +@ stub GetSidIdentifierAuthority +@ stub GetSidLengthRequired +@ stub GetSidSubAuthority +@ stub GetSidSubAuthorityCount +@ stdcall GetStartupInfoW(ptr) kernel32.GetStartupInfoW +@ stdcall GetStdHandle(long) kernel32.GetStdHandle +@ stub GetStringTableEntry +@ stdcall GetStringTypeA(long long str long ptr) kernel32.GetStringTypeA +@ stdcall GetStringTypeExW(long long wstr long ptr) kernel32.GetStringTypeExW +@ stdcall GetStringTypeW(long wstr long ptr) kernel32.GetStringTypeW +@ stdcall GetSystemDefaultLCID() kernel32.GetSystemDefaultLCID +@ stdcall GetSystemDefaultLangID() kernel32.GetSystemDefaultLangID +@ stdcall GetSystemDefaultLocaleName(ptr long) kernel32.GetSystemDefaultLocaleName +@ stdcall GetSystemDefaultUILanguage() kernel32.GetSystemDefaultUILanguage +@ stdcall GetSystemDirectoryA(ptr long) kernel32.GetSystemDirectoryA +@ stdcall GetSystemDirectoryW(ptr long) kernel32.GetSystemDirectoryW +@ stdcall GetSystemInfo(ptr) kernel32.GetSystemInfo +@ stdcall GetSystemPreferredUILanguages(long ptr ptr ptr) kernel32.GetSystemPreferredUILanguages +@ stdcall GetSystemTime(ptr) kernel32.GetSystemTime +@ stdcall GetSystemTimeAdjustment(ptr ptr ptr) kernel32.GetSystemTimeAdjustment +@ stdcall GetSystemTimeAsFileTime(ptr) kernel32.GetSystemTimeAsFileTime +@ stdcall GetSystemWindowsDirectoryA(ptr long) kernel32.GetSystemWindowsDirectoryA +@ stdcall GetSystemWindowsDirectoryW(ptr long) kernel32.GetSystemWindowsDirectoryW +@ stdcall GetTempFileNameW(wstr wstr long ptr) kernel32.GetTempFileNameW +@ stdcall GetThreadId(ptr) kernel32.GetThreadId +@ stdcall GetThreadLocale() kernel32.GetThreadLocale +@ stdcall GetThreadPreferredUILanguages(long ptr ptr ptr) kernel32.GetThreadPreferredUILanguages +@ stdcall GetThreadPriority(long) kernel32.GetThreadPriority +@ stdcall GetThreadPriorityBoost(long ptr) kernel32.GetThreadPriorityBoost +@ stdcall GetThreadUILanguage() kernel32.GetThreadUILanguage +@ stdcall GetTickCount() kernel32.GetTickCount +@ stdcall -ret64 GetTickCount64() kernel32.GetTickCount64 +@ stdcall GetTimeZoneInformation(ptr) kernel32.GetTimeZoneInformation +@ stdcall GetTimeZoneInformationForYear(long ptr ptr) kernel32.GetTimeZoneInformationForYear +@ stub GetTokenInformation +@ stub GetUILanguageInfo +@ stdcall GetUserDefaultLCID() kernel32.GetUserDefaultLCID +@ stdcall GetUserDefaultLangID() kernel32.GetUserDefaultLangID +@ stdcall GetUserDefaultLocaleName(ptr long) kernel32.GetUserDefaultLocaleName +@ stdcall GetUserDefaultUILanguage() kernel32.GetUserDefaultUILanguage +@ stub GetUserInfo +@ stub GetUserInfoWord +@ stdcall GetUserPreferredUILanguages(long ptr ptr ptr) kernel32.GetUserPreferredUILanguages +@ stdcall GetVersion() kernel32.GetVersion +@ stdcall GetVersionExA(ptr) kernel32.GetVersionExA +@ stdcall GetVersionExW(ptr) kernel32.GetVersionExW +@ stub GetVolumeInformationByHandleW +@ stdcall GetVolumeInformationW(wstr ptr long ptr ptr ptr ptr long) kernel32.GetVolumeInformationW +@ stdcall GetVolumePathNameW(wstr ptr long) kernel32.GetVolumePathNameW +@ stub GetWindowsAccountDomainSid +@ stdcall GetWindowsDirectoryA(ptr long) kernel32.GetWindowsDirectoryA +@ stdcall GetWindowsDirectoryW(ptr long) kernel32.GetWindowsDirectoryW +@ stdcall GlobalAlloc(long long) kernel32.GlobalAlloc +@ stdcall GlobalFree(long) kernel32.GlobalFree +@ stdcall GlobalMemoryStatusEx(ptr) kernel32.GlobalMemoryStatusEx +@ stdcall HeapAlloc(long long long) kernel32.HeapAlloc +@ stdcall HeapCompact(long long) kernel32.HeapCompact +@ stdcall HeapCreate(long long long) kernel32.HeapCreate +@ stdcall HeapDestroy(long) kernel32.HeapDestroy +@ stdcall HeapFree(long long ptr) kernel32.HeapFree +@ stdcall HeapLock(long) kernel32.HeapLock +@ stdcall HeapQueryInformation(long long ptr long ptr) kernel32.HeapQueryInformation +@ stdcall HeapReAlloc(long long ptr long) kernel32.HeapReAlloc +@ stdcall HeapSetInformation(ptr long ptr long) kernel32.HeapSetInformation +@ stdcall HeapSize(long long ptr) kernel32.HeapSize +@ stub HeapSummary +@ stdcall HeapUnlock(long) kernel32.HeapUnlock +@ stdcall HeapValidate(long long ptr) kernel32.HeapValidate +@ stdcall HeapWalk(long ptr) kernel32.HeapWalk +@ stub ImpersonateAnonymousToken +@ stub ImpersonateLoggedOnUser +@ stub ImpersonateNamedPipeClient +@ stub ImpersonateSelf +@ stub InitializeAcl +@ stdcall InitializeCriticalSection(ptr) kernel32.InitializeCriticalSection +@ stdcall InitializeCriticalSectionAndSpinCount(ptr long) kernel32.InitializeCriticalSectionAndSpinCount +@ stdcall InitializeCriticalSectionEx(ptr long long) kernel32.InitializeCriticalSectionEx +@ stub InitializeProcThreadAttributeList +@ stdcall InitializeSListHead(ptr) kernel32.InitializeSListHead +@ stdcall InitializeSRWLock(ptr) kernel32.InitializeSRWLock +@ stub InitializeSecurityDescriptor +@ stub InitializeSid +@ stdcall InterlockedFlushSList(ptr) kernel32.InterlockedFlushSList +@ stdcall InterlockedPopEntrySList(ptr) kernel32.InterlockedPopEntrySList +@ stdcall InterlockedPushEntrySList(ptr ptr) kernel32.InterlockedPushEntrySList +@ stdcall -norelay InterlockedPushListSList(ptr ptr ptr long) kernel32.InterlockedPushListSList +@ stub InternalLcidToName +@ stub Internal_EnumCalendarInfo +@ stub Internal_EnumDateFormats +@ stub Internal_EnumLanguageGroupLocales +@ stub Internal_EnumSystemCodePages +@ stub Internal_EnumSystemLanguageGroups +@ stub Internal_EnumSystemLocales +@ stub Internal_EnumTimeFormats +@ stub Internal_EnumUILanguages +@ stub InvalidateTzSpecificCache +@ stdcall IsDBCSLeadByte(long) kernel32.IsDBCSLeadByte +@ stdcall IsDBCSLeadByteEx(long long) kernel32.IsDBCSLeadByteEx +@ stdcall IsDebuggerPresent() kernel32.IsDebuggerPresent +@ stub IsNLSDefinedString +@ stdcall IsProcessInJob(long long ptr) kernel32.IsProcessInJob +@ stdcall IsThreadpoolTimerSet(ptr) kernel32.IsThreadpoolTimerSet +@ stub IsTokenRestricted +@ stub IsValidAcl +@ stdcall IsValidCodePage(long) kernel32.IsValidCodePage +@ stdcall IsValidLanguageGroup(long long) kernel32.IsValidLanguageGroup +@ stdcall IsValidLocale(long long) kernel32.IsValidLocale +@ stdcall IsValidLocaleName(wstr) kernel32.IsValidLocaleName +@ stub IsValidRelativeSecurityDescriptor +@ stub IsValidSecurityDescriptor +@ stub IsValidSid +@ stub IsWellKnownSid +@ stdcall IsWow64Process(ptr ptr) kernel32.IsWow64Process +@ stub KernelBaseGetGlobalData +@ stdcall LCIDToLocaleName(long ptr long long) kernel32.LCIDToLocaleName +@ stdcall LCMapStringA(long long str long ptr long) kernel32.LCMapStringA +@ stdcall LCMapStringEx(wstr long wstr long ptr long ptr ptr long) kernel32.LCMapStringEx +@ stdcall LCMapStringW(long long wstr long ptr long) kernel32.LCMapStringW +@ stdcall LeaveCriticalSection(ptr) kernel32.LeaveCriticalSection +@ stdcall LeaveCriticalSectionWhenCallbackReturns(ptr ptr) kernel32.LeaveCriticalSectionWhenCallbackReturns +@ stdcall LoadLibraryExA( str long long) kernel32.LoadLibraryExA +@ stdcall LoadLibraryExW(wstr long long) kernel32.LoadLibraryExW +@ stdcall LoadResource(long long) kernel32.LoadResource +@ stub LoadStringA +@ stub LoadStringBaseExW +@ stub LoadStringByReference +@ stub LoadStringW +@ stdcall LocalAlloc(long long) kernel32.LocalAlloc +@ stdcall LocalFileTimeToFileTime(ptr ptr) kernel32.LocalFileTimeToFileTime +@ stdcall LocalFree(long) kernel32.LocalFree +@ stdcall LocalLock(long) kernel32.LocalLock +@ stdcall LocalReAlloc(long long long) kernel32.LocalReAlloc +@ stdcall LocalUnlock(long) kernel32.LocalUnlock +@ stdcall LocaleNameToLCID(wstr long) kernel32.LocaleNameToLCID +@ stdcall LockFile(long long long long long) kernel32.LockFile +@ stdcall LockFileEx(long long long long long ptr) kernel32.LockFileEx +@ stdcall LockResource(long) kernel32.LockResource +@ stub MakeAbsoluteSD +@ stub MakeAbsoluteSD2 +@ stub MakeSelfRelativeSD +@ stub MapGenericMask +@ stdcall MapViewOfFile(long long long long long) kernel32.MapViewOfFile +@ stdcall MapViewOfFileEx(long long long long long ptr) kernel32.MapViewOfFileEx +@ stub MapViewOfFileExNuma +@ stdcall MultiByteToWideChar(long long str long ptr long) kernel32.MultiByteToWideChar +@ stdcall NeedCurrentDirectoryForExePathA(str) kernel32.NeedCurrentDirectoryForExePathA +@ stdcall NeedCurrentDirectoryForExePathW(wstr) kernel32.NeedCurrentDirectoryForExePathW +@ stub NlsCheckPolicy +@ stub NlsDispatchAnsiEnumProc +@ stub NlsEventDataDescCreate +@ stub NlsGetACPFromLocale +@ stub NlsGetCacheUpdateCount +@ stub NlsIsUserDefaultLocale +@ stub NlsUpdateLocale +@ stub NlsUpdateSystemLocale +@ stub NlsValidateLocale +@ stub NlsWriteEtwEvent +@ stub NotifyMountMgr +@ stub NotifyRedirectedStringChange +@ stub ObjectCloseAuditAlarmW +@ stub ObjectDeleteAuditAlarmW +@ stub ObjectOpenAuditAlarmW +@ stub ObjectPrivilegeAuditAlarmW +@ stdcall OpenEventA(long long str) kernel32.OpenEventA +@ stdcall OpenEventW(long long wstr) kernel32.OpenEventW +@ stdcall OpenFileMappingW(long long wstr) kernel32.OpenFileMappingW +@ stdcall OpenMutexW(long long wstr) kernel32.OpenMutexW +@ stdcall OpenProcess(long long long) kernel32.OpenProcess +@ stub OpenProcessToken +@ stub OpenRegKey +@ stdcall OpenSemaphoreW(long long wstr) kernel32.OpenSemaphoreW +@ stdcall OpenThread(long long long) kernel32.OpenThread +@ stub OpenThreadToken +@ stdcall OpenWaitableTimerW(long long wstr) kernel32.OpenWaitableTimerW +@ stdcall OutputDebugStringA(str) kernel32.OutputDebugStringA +@ stdcall OutputDebugStringW(wstr) kernel32.OutputDebugStringW +@ stdcall PeekNamedPipe(long ptr long ptr ptr ptr) kernel32.PeekNamedPipe +@ stdcall PostQueuedCompletionStatus(long long ptr ptr) kernel32.PostQueuedCompletionStatus +@ stub PrivilegeCheck +@ stub PrivilegedServiceAuditAlarmW +@ stdcall ProcessIdToSessionId(long ptr) kernel32.ProcessIdToSessionId +@ stdcall PulseEvent(long) kernel32.PulseEvent +@ stdcall QueryDepthSList(ptr) kernel32.QueryDepthSList +@ stdcall QueryDosDeviceW(wstr ptr long) kernel32.QueryDosDeviceW +@ stdcall QueryPerformanceCounter(ptr) kernel32.QueryPerformanceCounter +@ stdcall QueryPerformanceFrequency(ptr) kernel32.QueryPerformanceFrequency +@ stub QueryProcessAffinityUpdateMode +@ stub QuerySecurityAccessMask +@ stub QueryThreadpoolStackInformation +@ stdcall QueueUserAPC(ptr long long) kernel32.QueueUserAPC +@ stdcall RaiseException(long long long ptr) kernel32.RaiseException +@ stdcall ReadFile(long ptr long ptr ptr) kernel32.ReadFile +@ stdcall ReadFileEx(long ptr long ptr ptr) kernel32.ReadFileEx +@ stdcall ReadFileScatter(long ptr long ptr ptr) kernel32.ReadFileScatter +@ stdcall ReadProcessMemory(long ptr ptr long ptr) kernel32.ReadProcessMemory +@ stdcall RegisterWaitForSingleObjectEx(long ptr ptr long long) kernel32.RegisterWaitForSingleObjectEx +@ stdcall ReleaseMutex(long) kernel32.ReleaseMutex +@ stdcall ReleaseMutexWhenCallbackReturns(ptr long) kernel32.ReleaseMutexWhenCallbackReturns +@ stdcall ReleaseSRWLockExclusive(ptr) kernel32.ReleaseSRWLockExclusive +@ stdcall ReleaseSRWLockShared(ptr) kernel32.ReleaseSRWLockShared +@ stdcall ReleaseSemaphore(long long ptr) kernel32.ReleaseSemaphore +@ stdcall ReleaseSemaphoreWhenCallbackReturns(ptr long long) kernel32.ReleaseSemaphoreWhenCallbackReturns +@ stdcall RemoveDirectoryA(str) kernel32.RemoveDirectoryA +@ stdcall RemoveDirectoryW(wstr) kernel32.RemoveDirectoryW +@ stub RemoveDllDirectory +@ stdcall ResetEvent(long) kernel32.ResetEvent +@ stub ResolveLocaleName +@ stdcall ResumeThread(long) kernel32.ResumeThread +@ stub RevertToSelf +@ stdcall SearchPathW(wstr wstr wstr long ptr ptr) kernel32.SearchPathW +@ stub SetAclInformation +@ stdcall SetCalendarInfoW(long long long wstr) kernel32.SetCalendarInfoW +@ stdcall SetCriticalSectionSpinCount(ptr long) kernel32.SetCriticalSectionSpinCount +@ stdcall SetCurrentDirectoryA(str) kernel32.SetCurrentDirectoryA +@ stdcall SetCurrentDirectoryW(wstr) kernel32.SetCurrentDirectoryW +@ stub SetDefaultDllDirectories +@ stdcall SetEndOfFile(long) kernel32.SetEndOfFile +@ stub SetEnvironmentStringsW +@ stdcall SetEnvironmentVariableA(str str) kernel32.SetEnvironmentVariableA +@ stdcall SetEnvironmentVariableW(wstr wstr) kernel32.SetEnvironmentVariableW +@ stdcall SetErrorMode(long) kernel32.SetErrorMode +@ stdcall SetEvent(long) kernel32.SetEvent +@ stdcall SetEventWhenCallbackReturns(ptr long) kernel32.SetEventWhenCallbackReturns +@ stdcall SetFileApisToANSI() kernel32.SetFileApisToANSI +@ stdcall SetFileApisToOEM() kernel32.SetFileApisToOEM +@ stdcall SetFileAttributesA(str long) kernel32.SetFileAttributesA +@ stdcall SetFileAttributesW(wstr long) kernel32.SetFileAttributesW +@ stdcall SetFileInformationByHandle(long long ptr long) kernel32.SetFileInformationByHandle +@ stdcall SetFilePointer(long long ptr long) kernel32.SetFilePointer +@ stdcall SetFilePointerEx(long int64 ptr long) kernel32.SetFilePointerEx +@ stub SetFileSecurityW +@ stdcall SetFileTime(long ptr ptr ptr) kernel32.SetFileTime +@ stdcall SetFileValidData(ptr int64) kernel32.SetFileValidData +@ stdcall SetHandleCount(long) kernel32.SetHandleCount +@ stdcall SetHandleInformation(long long long) kernel32.SetHandleInformation +@ stub SetKernelObjectSecurity +@ stdcall SetLastError(long) kernel32.SetLastError +@ stdcall SetLocalTime(ptr) kernel32.SetLocalTime +@ stdcall SetLocaleInfoW(long long wstr) kernel32.SetLocaleInfoW +@ stdcall SetNamedPipeHandleState(long ptr ptr ptr) kernel32.SetNamedPipeHandleState +@ stdcall SetPriorityClass(long long) kernel32.SetPriorityClass +@ stub SetPrivateObjectSecurity +@ stub SetPrivateObjectSecurityEx +@ stub SetProcessAffinityUpdateMode +@ stdcall SetProcessShutdownParameters(long long) kernel32.SetProcessShutdownParameters +@ stub SetSecurityAccessMask +@ stub SetSecurityDescriptorControl +@ stub SetSecurityDescriptorDacl +@ stub SetSecurityDescriptorGroup +@ stub SetSecurityDescriptorOwner +@ stub SetSecurityDescriptorRMControl +@ stub SetSecurityDescriptorSacl +@ stdcall SetStdHandle(long long) kernel32.SetStdHandle +@ stub SetStdHandleEx +@ stdcall SetThreadLocale(long) kernel32.SetThreadLocale +@ stdcall SetThreadPriority(long long) kernel32.SetThreadPriority +@ stdcall SetThreadPriorityBoost(long long) kernel32.SetThreadPriorityBoost +@ stdcall SetThreadStackGuarantee(ptr) kernel32.SetThreadStackGuarantee +@ stub SetThreadToken +@ stub SetThreadpoolStackInformation +@ stdcall SetThreadpoolThreadMaximum(ptr long) kernel32.SetThreadpoolThreadMaximum +@ stdcall SetThreadpoolThreadMinimum(ptr long) kernel32.SetThreadpoolThreadMinimum +@ stdcall SetThreadpoolTimer(ptr ptr long long) kernel32.SetThreadpoolTimer +@ stdcall SetThreadpoolWait(ptr long ptr) kernel32.SetThreadpoolWait +@ stub SetTokenInformation +@ stdcall SetWaitableTimer(long ptr long ptr ptr long) kernel32.SetWaitableTimer +@ stdcall SetWaitableTimerEx(long ptr long ptr ptr ptr long) kernel32.SetWaitableTimerEx +@ stdcall SizeofResource(long long) kernel32.SizeofResource +@ stdcall Sleep(long) kernel32.Sleep +@ stdcall SleepEx(long long) kernel32.SleepEx +@ stub SpecialMBToWC +@ stub StartThreadpoolIo +@ stdcall SubmitThreadpoolWork(ptr) kernel32.SubmitThreadpoolWork +@ stdcall SuspendThread(long) kernel32.SuspendThread +@ stdcall SwitchToThread() kernel32.SwitchToThread +@ stdcall SystemTimeToFileTime(ptr ptr) kernel32.SystemTimeToFileTime +@ stdcall SystemTimeToTzSpecificLocalTime(ptr ptr ptr) kernel32.SystemTimeToTzSpecificLocalTime +@ stub SystemTimeToTzSpecificLocalTimeEx +@ stdcall TerminateProcess(long long) kernel32.TerminateProcess +@ stdcall TerminateThread(long long) kernel32.TerminateThread +@ stdcall TlsAlloc() kernel32.TlsAlloc +@ stdcall TlsFree(long) kernel32.TlsFree +@ stdcall TlsGetValue(long) kernel32.TlsGetValue +@ stdcall TlsSetValue(long ptr) kernel32.TlsSetValue +@ stdcall TransactNamedPipe(long ptr long ptr long ptr ptr) kernel32.TransactNamedPipe +@ stdcall TryAcquireSRWLockExclusive(ptr) kernel32.TryAcquireSRWLockExclusive +@ stdcall TryAcquireSRWLockShared(ptr) kernel32.TryAcquireSRWLockShared +@ stdcall TryEnterCriticalSection(ptr) kernel32.TryEnterCriticalSection +@ stdcall TrySubmitThreadpoolCallback(ptr ptr ptr) kernel32.TrySubmitThreadpoolCallback +@ stdcall TzSpecificLocalTimeToSystemTime(ptr ptr ptr) kernel32.TzSpecificLocalTimeToSystemTime +@ stub TzSpecificLocalTimeToSystemTimeEx +@ stdcall UnlockFile(long long long long long) kernel32.UnlockFile +@ stdcall UnlockFileEx(long long long long ptr) kernel32.UnlockFileEx +@ stdcall UnmapViewOfFile(ptr) kernel32.UnmapViewOfFile +@ stdcall UnregisterWaitEx(long long) kernel32.UnregisterWaitEx +@ stub UpdateProcThreadAttribute +@ stdcall VerLanguageNameA(long str long) kernel32.VerLanguageNameA +@ stdcall VerLanguageNameW(long wstr long) kernel32.VerLanguageNameW +@ stdcall VirtualAlloc(ptr long long long) kernel32.VirtualAlloc +@ stdcall VirtualAllocEx(long ptr long long long) kernel32.VirtualAllocEx +@ stub VirtualAllocExNuma +@ stdcall VirtualFree(ptr long long) kernel32.VirtualFree +@ stdcall VirtualFreeEx(long ptr long long) kernel32.VirtualFreeEx +@ stdcall VirtualProtect(ptr long long ptr) kernel32.VirtualProtect +@ stdcall VirtualProtectEx(long ptr long long ptr) kernel32.VirtualProtectEx +@ stdcall VirtualQuery(ptr ptr long) kernel32.VirtualQuery +@ stdcall VirtualQueryEx(long ptr ptr long) kernel32.VirtualQueryEx +@ stdcall WaitForMultipleObjectsEx(long ptr long long long) kernel32.WaitForMultipleObjectsEx +@ stdcall WaitForSingleObject(long long) kernel32.WaitForSingleObject +@ stdcall WaitForSingleObjectEx(long long long) kernel32.WaitForSingleObjectEx +@ stub WaitForThreadpoolIoCallbacks +@ stdcall WaitForThreadpoolTimerCallbacks(ptr long) kernel32.WaitForThreadpoolTimerCallbacks +@ stdcall WaitForThreadpoolWaitCallbacks(ptr long) kernel32.WaitForThreadpoolWaitCallbacks +@ stdcall WaitForThreadpoolWorkCallbacks(ptr long) kernel32.WaitForThreadpoolWorkCallbacks +@ stdcall WaitNamedPipeW(wstr long) kernel32.WaitNamedPipeW +@ stdcall WideCharToMultiByte(long long wstr long ptr long ptr ptr) kernel32.WideCharToMultiByte +@ stdcall Wow64DisableWow64FsRedirection(ptr) kernel32.Wow64DisableWow64FsRedirection +@ stdcall Wow64RevertWow64FsRedirection(ptr) kernel32.Wow64RevertWow64FsRedirection +@ stdcall WriteFile(long ptr long ptr ptr) kernel32.WriteFile +@ stdcall WriteFileEx(long ptr long ptr ptr) kernel32.WriteFileEx +@ stdcall WriteFileGather(long ptr long ptr ptr) kernel32.WriteFileGather +@ stdcall WriteProcessMemory(long ptr ptr long ptr) kernel32.WriteProcessMemory +@ stdcall -arch=x86_64 -private __C_specific_handler(ptr long ptr ptr) kernel32.__C_specific_handler +@ stdcall -arch=arm,x86_64 -private -norelay __chkstk() kernel32.__chkstk +@ stub __misaligned_access +@ stdcall -arch=x86_64 -private _local_unwind(ptr ptr) kernel32._local_unwind +@ stdcall lstrcmp(str str) kernel32.lstrcmp +@ stdcall lstrcmpA(str str) kernel32.lstrcmpA +@ stdcall lstrcmpW(wstr wstr) kernel32.lstrcmpW +@ stdcall lstrcmpi(str str) kernel32.lstrcmpi +@ stdcall lstrcmpiA(str str) kernel32.lstrcmpiA +@ stdcall lstrcmpiW(wstr wstr) kernel32.lstrcmpiW +@ stdcall lstrcpyn(ptr str long) kernel32.lstrcpyn +@ stdcall lstrcpynA(ptr str long) kernel32.lstrcpynA +@ stdcall lstrcpynW(ptr wstr long) kernel32.lstrcpynW +@ stdcall lstrlen(str) kernel32.lstrlen +@ stdcall lstrlenA(str) kernel32.lstrlenA +@ stdcall lstrlenW(wstr) kernel32.lstrlenW diff -Nru wine-staging-1.9.6/dlls/kernelbase/Makefile.in wine-staging-1.9.7~ubuntu15.04.1/dlls/kernelbase/Makefile.in --- wine-staging-1.9.6/dlls/kernelbase/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/kernelbase/Makefile.in 2016-04-04 18:06:32.000000000 +0000 @@ -0,0 +1 @@ +MODULE = kernelbase.dll diff -Nru wine-staging-1.9.6/dlls/mgmtapi/mgmtapi.c wine-staging-1.9.7~ubuntu15.04.1/dlls/mgmtapi/mgmtapi.c --- wine-staging-1.9.6/dlls/mgmtapi/mgmtapi.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/mgmtapi/mgmtapi.c 2016-04-04 18:06:32.000000000 +0000 @@ -37,3 +37,10 @@ } return TRUE; } + +BOOL WINAPI SnmpMgrTrapListen(HANDLE *available) +{ + FIXME("stub: %p\n", available); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} diff -Nru wine-staging-1.9.6/dlls/mgmtapi/mgmtapi.spec wine-staging-1.9.7~ubuntu15.04.1/dlls/mgmtapi/mgmtapi.spec --- wine-staging-1.9.6/dlls/mgmtapi/mgmtapi.spec 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/mgmtapi/mgmtapi.spec 2016-04-04 18:06:32.000000000 +0000 @@ -6,4 +6,4 @@ @ stub SnmpMgrOpen @ stub SnmpMgrRequest @ stub SnmpMgrStrToOid -@ stub SnmpMgrTrapListen +@ stdcall SnmpMgrTrapListen(ptr) diff -Nru wine-staging-1.9.6/dlls/mscoree/metahost.c wine-staging-1.9.7~ubuntu15.04.1/dlls/mscoree/metahost.c --- wine-staging-1.9.6/dlls/mscoree/metahost.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/mscoree/metahost.c 2016-04-04 18:06:32.000000000 +0000 @@ -100,6 +100,7 @@ MonoObject* (CDECL *mono_runtime_invoke)(MonoMethod *method, void *obj, void **params, MonoObject **exc); void (CDECL *mono_runtime_object_init)(MonoObject *this_obj); void (CDECL *mono_runtime_quit)(void); +static void (CDECL *mono_set_crash_chaining)(BOOL chain_signals); static void (CDECL *mono_set_dirs)(const char *assembly_dir, const char *config_dir); static void (CDECL *mono_set_verbose_level)(DWORD level); MonoString* (CDECL *mono_string_new)(MonoDomain *domain, const char *str); @@ -126,6 +127,10 @@ return mono_image_open(fname, status); } +static void CDECL set_crash_chaining_dummy(BOOL crash_chaining) +{ +} + static void CDECL set_print_handler_dummy(MonoPrintCallback callback) { } @@ -217,6 +222,7 @@ } while (0); LOAD_OPT_MONO_FUNCTION(mono_image_open_from_module_handle, image_open_module_handle_dummy); + LOAD_OPT_MONO_FUNCTION(mono_set_crash_chaining, set_crash_chaining_dummy); LOAD_OPT_MONO_FUNCTION(mono_trace_set_print_handler, set_print_handler_dummy); LOAD_OPT_MONO_FUNCTION(mono_trace_set_printerr_handler, set_print_handler_dummy); @@ -224,6 +230,8 @@ mono_profiler_install(NULL, mono_shutdown_callback_fn); + mono_set_crash_chaining(TRUE); + mono_trace_set_print_handler(mono_print_handler_fn); mono_trace_set_printerr_handler(mono_print_handler_fn); diff -Nru wine-staging-1.9.6/dlls/msctf/context.c wine-staging-1.9.7~ubuntu15.04.1/dlls/msctf/context.c --- wine-staging-1.9.6/dlls/msctf/context.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/msctf/context.c 2016-04-04 18:06:32.000000000 +0000 @@ -65,6 +65,8 @@ /* const ITfMouseTrackerVtbl *MouseTrackerVtbl; */ /* const ITfQueryEmbeddedVtbl *QueryEmbeddedVtbl; */ ITfSourceSingle ITfSourceSingle_iface; + ITextStoreACPSink ITextStoreACPSink_iface; + ITextStoreACPServices ITextStoreACPServices_iface; LONG refCount; BOOL connected; @@ -79,7 +81,6 @@ ITextStoreACP *pITextStoreACP; ITfContextOwnerCompositionSink *pITfContextOwnerCompositionSink; - ITextStoreACPSink *pITextStoreACPSink; ITfEditSession* currentEditSession; /* kept as separate lists to reduce unnecessary iterations */ @@ -96,17 +97,6 @@ Context *pOwningContext; } EditCookie; -typedef struct tagTextStoreACPSink { - ITextStoreACPSink ITextStoreACPSink_iface; - /* const ITextStoreACPServicesVtbl *TextStoreACPServicesVtbl; */ - LONG refCount; - - Context *pContext; -} TextStoreACPSink; - - -static HRESULT TextStoreACPSink_Constructor(ITextStoreACPSink **ppOut, Context *pContext); - static inline Context *impl_from_ITfContext(ITfContext *iface) { return CONTAINING_RECORD(iface, Context, ITfContext_iface); @@ -127,9 +117,14 @@ return CONTAINING_RECORD(iface, Context, ITfSourceSingle_iface); } -static inline TextStoreACPSink *impl_from_ITextStoreACPSink(ITextStoreACPSink *iface) +static inline Context *impl_from_ITextStoreACPSink(ITextStoreACPSink *iface) { - return CONTAINING_RECORD(iface, TextStoreACPSink, ITextStoreACPSink_iface); + return CONTAINING_RECORD(iface, Context, ITextStoreACPSink_iface); +} + +static inline Context *impl_from_ITextStoreACPServices(ITextStoreACPServices *iface) +{ + return CONTAINING_RECORD(iface, Context, ITextStoreACPServices_iface); } static void free_sink(ContextSink *sink) @@ -144,14 +139,11 @@ EditCookie *cookie; TRACE("destroying %p\n", This); - if (This->pITextStoreACPSink) - { - ITextStoreACP_UnadviseSink(This->pITextStoreACP, (IUnknown*)This->pITextStoreACPSink); - ITextStoreACPSink_Release(This->pITextStoreACPSink); - } - if (This->pITextStoreACP) + { + ITextStoreACP_UnadviseSink(This->pITextStoreACP, (IUnknown*)&This->ITextStoreACPSink_iface); ITextStoreACP_Release(This->pITextStoreACP); + } if (This->pITfContextOwnerCompositionSink) ITfContextOwnerCompositionSink_Release(This->pITfContextOwnerCompositionSink); @@ -791,114 +783,22 @@ SourceSingle_UnadviseSingleSink, }; -HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfDocumentMgr *mgr, ITfContext **ppOut, TfEditCookie *pecTextStore) -{ - Context *This; - EditCookie *cookie; - - This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(Context)); - if (This == NULL) - return E_OUTOFMEMORY; - - cookie = HeapAlloc(GetProcessHeap(),0,sizeof(EditCookie)); - if (cookie == NULL) - { - HeapFree(GetProcessHeap(),0,This); - return E_OUTOFMEMORY; - } - - TRACE("(%p) %x %p %p %p\n",This, tidOwner, punk, ppOut, pecTextStore); - - This->ITfContext_iface.lpVtbl= &ContextVtbl; - This->ITfSource_iface.lpVtbl = &ContextSourceVtbl; - This->ITfInsertAtSelection_iface.lpVtbl = &InsertAtSelectionVtbl; - This->ITfSourceSingle_iface.lpVtbl = &ContextSourceSingleVtbl; - This->refCount = 1; - This->tidOwner = tidOwner; - This->connected = FALSE; - This->manager = mgr; - - CompartmentMgr_Constructor((IUnknown*)&This->ITfContext_iface, &IID_IUnknown, (IUnknown**)&This->CompartmentMgr); - - cookie->lockType = TF_ES_READ; - cookie->pOwningContext = This; - - if (punk) - { - IUnknown_QueryInterface(punk, &IID_ITextStoreACP, - (LPVOID*)&This->pITextStoreACP); - - IUnknown_QueryInterface(punk, &IID_ITfContextOwnerCompositionSink, - (LPVOID*)&This->pITfContextOwnerCompositionSink); - - if (!This->pITextStoreACP && !This->pITfContextOwnerCompositionSink) - FIXME("Unhandled pUnk\n"); - } - - This->defaultCookie = generate_Cookie(COOKIE_MAGIC_EDITCOOKIE,cookie); - *pecTextStore = This->defaultCookie; - - list_init(&This->pContextKeyEventSink); - list_init(&This->pEditTransactionSink); - list_init(&This->pStatusSink); - list_init(&This->pTextEditSink); - list_init(&This->pTextLayoutSink); - - *ppOut = &This->ITfContext_iface; - TRACE("returning %p\n", *ppOut); - - return S_OK; -} - -HRESULT Context_Initialize(ITfContext *iface, ITfDocumentMgr *manager) -{ - Context *This = impl_from_ITfContext(iface); - - if (This->pITextStoreACP) - { - if (SUCCEEDED(TextStoreACPSink_Constructor(&This->pITextStoreACPSink, This))) - ITextStoreACP_AdviseSink(This->pITextStoreACP, &IID_ITextStoreACPSink, - (IUnknown*)This->pITextStoreACPSink, TS_AS_ALL_SINKS); - } - This->connected = TRUE; - This->manager = manager; - return S_OK; -} - -HRESULT Context_Uninitialize(ITfContext *iface) -{ - Context *This = impl_from_ITfContext(iface); - - if (This->pITextStoreACPSink) - { - ITextStoreACP_UnadviseSink(This->pITextStoreACP, (IUnknown*)This->pITextStoreACPSink); - if (ITextStoreACPSink_Release(This->pITextStoreACPSink) == 0) - This->pITextStoreACPSink = NULL; - } - This->connected = FALSE; - This->manager = NULL; - return S_OK; -} - /************************************************************************** * ITextStoreACPSink **************************************************************************/ -static void TextStoreACPSink_Destructor(TextStoreACPSink *This) -{ - TRACE("destroying %p\n", This); - HeapFree(GetProcessHeap(),0,This); -} - static HRESULT WINAPI TextStoreACPSink_QueryInterface(ITextStoreACPSink *iface, REFIID iid, LPVOID *ppvOut) { - TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface); + Context *This = impl_from_ITextStoreACPSink(iface); + *ppvOut = NULL; if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITextStoreACPSink)) { *ppvOut = &This->ITextStoreACPSink_iface; } + else if (IsEqualIID(iid, &IID_ITextStoreACPServices)) + *ppvOut = &This->ITextStoreACPServices_iface; if (*ppvOut) { @@ -912,19 +812,14 @@ static ULONG WINAPI TextStoreACPSink_AddRef(ITextStoreACPSink *iface) { - TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface); - return InterlockedIncrement(&This->refCount); + Context *This = impl_from_ITextStoreACPSink(iface); + return ITfContext_AddRef(&This->ITfContext_iface); } static ULONG WINAPI TextStoreACPSink_Release(ITextStoreACPSink *iface) { - TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface); - ULONG ret; - - ret = InterlockedDecrement(&This->refCount); - if (ret == 0) - TextStoreACPSink_Destructor(This); - return ret; + Context *This = impl_from_ITextStoreACPSink(iface); + return ITfContext_Release(&This->ITfContext_iface); } /***************************************************** @@ -934,14 +829,14 @@ static HRESULT WINAPI TextStoreACPSink_OnTextChange(ITextStoreACPSink *iface, DWORD dwFlags, const TS_TEXTCHANGE *pChange) { - TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface); + Context *This = impl_from_ITextStoreACPSink(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } static HRESULT WINAPI TextStoreACPSink_OnSelectionChange(ITextStoreACPSink *iface) { - TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface); + Context *This = impl_from_ITextStoreACPSink(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -949,7 +844,7 @@ static HRESULT WINAPI TextStoreACPSink_OnLayoutChange(ITextStoreACPSink *iface, TsLayoutCode lcode, TsViewCookie vcView) { - TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface); + Context *This = impl_from_ITextStoreACPSink(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -957,27 +852,21 @@ static HRESULT WINAPI TextStoreACPSink_OnStatusChange(ITextStoreACPSink *iface, DWORD dwFlags) { - TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface); + Context *This = impl_from_ITextStoreACPSink(iface); HRESULT hr, hrSession; TRACE("(%p) %x\n",This, dwFlags); - if (!This->pContext) - { - ERR("No context?\n"); - return E_FAIL; - } - - if (!This->pContext->pITextStoreACP) + if (!This->pITextStoreACP) { FIXME("Context does not have a ITextStoreACP\n"); return E_NOTIMPL; } - hr = ITextStoreACP_RequestLock(This->pContext->pITextStoreACP, TS_LF_READ, &hrSession); + hr = ITextStoreACP_RequestLock(This->pITextStoreACP, TS_LF_READ, &hrSession); if(SUCCEEDED(hr) && SUCCEEDED(hrSession)) - This->pContext->documentStatus.dwDynamicFlags = dwFlags; + This->documentStatus.dwDynamicFlags = dwFlags; return S_OK; } @@ -985,7 +874,7 @@ static HRESULT WINAPI TextStoreACPSink_OnAttrsChange(ITextStoreACPSink *iface, LONG acpStart, LONG acpEnd, ULONG cAttrs, const TS_ATTRID *paAttrs) { - TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface); + Context *This = impl_from_ITextStoreACPSink(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -993,7 +882,7 @@ static HRESULT WINAPI TextStoreACPSink_OnLockGranted(ITextStoreACPSink *iface, DWORD dwLockFlags) { - TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface); + Context *This = impl_from_ITextStoreACPSink(iface); HRESULT hr; EditCookie *cookie,*sinkcookie; TfEditCookie ec; @@ -1001,13 +890,7 @@ TRACE("(%p) %x\n",This, dwLockFlags); - if (!This->pContext) - { - ERR("OnLockGranted called without a context\n"); - return E_FAIL; - } - - if (!This->pContext->currentEditSession) + if (!This->currentEditSession) { FIXME("OnLockGranted called for something other than an EditSession\n"); return S_OK; @@ -1025,32 +908,32 @@ } cookie->lockType = dwLockFlags; - cookie->pOwningContext = This->pContext; + cookie->pOwningContext = This; ec = generate_Cookie(COOKIE_MAGIC_EDITCOOKIE, cookie); - hr = ITfEditSession_DoEditSession(This->pContext->currentEditSession, ec); + hr = ITfEditSession_DoEditSession(This->currentEditSession, ec); if ((dwLockFlags&TS_LF_READWRITE) == TS_LF_READWRITE) { TfEditCookie sc; sinkcookie->lockType = TS_LF_READ; - sinkcookie->pOwningContext = This->pContext; + sinkcookie->pOwningContext = This; sc = generate_Cookie(COOKIE_MAGIC_EDITCOOKIE, sinkcookie); /*TODO: implement ITfEditRecord */ - LIST_FOR_EACH(cursor, &This->pContext->pTextEditSink) + LIST_FOR_EACH(cursor, &This->pTextEditSink) { ContextSink* sink = LIST_ENTRY(cursor,ContextSink,entry); ITfTextEditSink_OnEndEdit(sink->interfaces.pITfTextEditSink, - (ITfContext*) &This->pContext, sc, NULL); + (ITfContext*) &This->ITfContext_iface, sc, NULL); } sinkcookie = remove_Cookie(sc); } HeapFree(GetProcessHeap(),0,sinkcookie); - ITfEditSession_Release(This->pContext->currentEditSession); - This->pContext->currentEditSession = NULL; + ITfEditSession_Release(This->currentEditSession); + This->currentEditSession = NULL; /* Edit Cookie is only valid during the edit session */ cookie = remove_Cookie(ec); @@ -1061,14 +944,14 @@ static HRESULT WINAPI TextStoreACPSink_OnStartEditTransaction(ITextStoreACPSink *iface) { - TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface); + Context *This = impl_from_ITextStoreACPSink(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } static HRESULT WINAPI TextStoreACPSink_OnEndEditTransaction(ITextStoreACPSink *iface) { - TextStoreACPSink *This = impl_from_ITextStoreACPSink(iface); + Context *This = impl_from_ITextStoreACPSink(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } @@ -1088,20 +971,154 @@ TextStoreACPSink_OnEndEditTransaction }; -static HRESULT TextStoreACPSink_Constructor(ITextStoreACPSink **ppOut, Context *pContext) +static HRESULT WINAPI TextStoreACPServices_QueryInterface(ITextStoreACPServices *iface, REFIID riid, void **obj) +{ + Context *This = impl_from_ITextStoreACPServices(iface); + return ITextStoreACPSink_QueryInterface(&This->ITextStoreACPSink_iface, riid, obj); +} + +static ULONG WINAPI TextStoreACPServices_AddRef(ITextStoreACPServices *iface) +{ + Context *This = impl_from_ITextStoreACPServices(iface); + return ITextStoreACPSink_AddRef(&This->ITextStoreACPSink_iface); +} + +static ULONG WINAPI TextStoreACPServices_Release(ITextStoreACPServices *iface) +{ + Context *This = impl_from_ITextStoreACPServices(iface); + return ITextStoreACPSink_Release(&This->ITextStoreACPSink_iface); +} + +static HRESULT WINAPI TextStoreACPServices_Serialize(ITextStoreACPServices *iface, ITfProperty *prop, ITfRange *range, + TF_PERSISTENT_PROPERTY_HEADER_ACP *header, IStream *stream) +{ + Context *This = impl_from_ITextStoreACPServices(iface); + + FIXME("stub: %p %p %p %p %p\n", This, prop, range, header, stream); + + return E_NOTIMPL; +} + +static HRESULT WINAPI TextStoreACPServices_Unserialize(ITextStoreACPServices *iface, ITfProperty *prop, + const TF_PERSISTENT_PROPERTY_HEADER_ACP *header, IStream *stream, ITfPersistentPropertyLoaderACP *loader) +{ + Context *This = impl_from_ITextStoreACPServices(iface); + + FIXME("stub: %p %p %p %p %p\n", This, prop, header, stream, loader); + + return E_NOTIMPL; +} + +static HRESULT WINAPI TextStoreACPServices_ForceLoadProperty(ITextStoreACPServices *iface, ITfProperty *prop) +{ + Context *This = impl_from_ITextStoreACPServices(iface); + + FIXME("stub: %p %p\n", This, prop); + + return E_NOTIMPL; +} + +static HRESULT WINAPI TextStoreACPServices_CreateRange(ITextStoreACPServices *iface, + LONG start, LONG end, ITfRangeACP **range) +{ + Context *This = impl_from_ITextStoreACPServices(iface); + + FIXME("stub: %p %d %d %p\n", This, start, end, range); + + return S_OK; +} + +static const ITextStoreACPServicesVtbl TextStoreACPServicesVtbl = +{ + TextStoreACPServices_QueryInterface, + TextStoreACPServices_AddRef, + TextStoreACPServices_Release, + TextStoreACPServices_Serialize, + TextStoreACPServices_Unserialize, + TextStoreACPServices_ForceLoadProperty, + TextStoreACPServices_CreateRange +}; + +HRESULT Context_Constructor(TfClientId tidOwner, IUnknown *punk, ITfDocumentMgr *mgr, ITfContext **ppOut, TfEditCookie *pecTextStore) { - TextStoreACPSink *This; + Context *This; + EditCookie *cookie; - This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(TextStoreACPSink)); + This = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(Context)); if (This == NULL) return E_OUTOFMEMORY; - This->ITextStoreACPSink_iface.lpVtbl= &TextStoreACPSinkVtbl; + cookie = HeapAlloc(GetProcessHeap(),0,sizeof(EditCookie)); + if (cookie == NULL) + { + HeapFree(GetProcessHeap(),0,This); + return E_OUTOFMEMORY; + } + + TRACE("(%p) %x %p %p %p\n",This, tidOwner, punk, ppOut, pecTextStore); + + This->ITfContext_iface.lpVtbl= &ContextVtbl; + This->ITfSource_iface.lpVtbl = &ContextSourceVtbl; + This->ITfInsertAtSelection_iface.lpVtbl = &InsertAtSelectionVtbl; + This->ITfSourceSingle_iface.lpVtbl = &ContextSourceSingleVtbl; + This->ITextStoreACPSink_iface.lpVtbl = &TextStoreACPSinkVtbl; + This->ITextStoreACPServices_iface.lpVtbl = &TextStoreACPServicesVtbl; This->refCount = 1; + This->tidOwner = tidOwner; + This->connected = FALSE; + This->manager = mgr; + + CompartmentMgr_Constructor((IUnknown*)&This->ITfContext_iface, &IID_IUnknown, (IUnknown**)&This->CompartmentMgr); + + cookie->lockType = TF_ES_READ; + cookie->pOwningContext = This; + + if (punk) + { + IUnknown_QueryInterface(punk, &IID_ITextStoreACP, + (LPVOID*)&This->pITextStoreACP); + + IUnknown_QueryInterface(punk, &IID_ITfContextOwnerCompositionSink, + (LPVOID*)&This->pITfContextOwnerCompositionSink); + + if (!This->pITextStoreACP && !This->pITfContextOwnerCompositionSink) + FIXME("Unhandled pUnk\n"); + } + + This->defaultCookie = generate_Cookie(COOKIE_MAGIC_EDITCOOKIE,cookie); + *pecTextStore = This->defaultCookie; - This->pContext = pContext; + list_init(&This->pContextKeyEventSink); + list_init(&This->pEditTransactionSink); + list_init(&This->pStatusSink); + list_init(&This->pTextEditSink); + list_init(&This->pTextLayoutSink); - *ppOut = &This->ITextStoreACPSink_iface; + *ppOut = &This->ITfContext_iface; TRACE("returning %p\n", *ppOut); + + return S_OK; +} + +HRESULT Context_Initialize(ITfContext *iface, ITfDocumentMgr *manager) +{ + Context *This = impl_from_ITfContext(iface); + + if (This->pITextStoreACP) + ITextStoreACP_AdviseSink(This->pITextStoreACP, &IID_ITextStoreACPSink, + (IUnknown*)&This->ITextStoreACPSink_iface, TS_AS_ALL_SINKS); + This->connected = TRUE; + This->manager = manager; + return S_OK; +} + +HRESULT Context_Uninitialize(ITfContext *iface) +{ + Context *This = impl_from_ITfContext(iface); + + if (This->pITextStoreACP) + ITextStoreACP_UnadviseSink(This->pITextStoreACP, (IUnknown*)&This->ITextStoreACPSink_iface); + This->connected = FALSE; + This->manager = NULL; return S_OK; } diff -Nru wine-staging-1.9.6/dlls/msctf/tests/inputprocessor.c wine-staging-1.9.7~ubuntu15.04.1/dlls/msctf/tests/inputprocessor.c --- wine-staging-1.9.6/dlls/msctf/tests/inputprocessor.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/msctf/tests/inputprocessor.c 2016-04-04 18:06:32.000000000 +0000 @@ -226,12 +226,18 @@ static HRESULT WINAPI TextStoreACP_AdviseSink(ITextStoreACP *iface, REFIID riid, IUnknown *punk, DWORD dwMask) { + ITextStoreACPServices *services; HRESULT hr; sink_fire_ok(&test_ACP_AdviseSink,"TextStoreACP_AdviseSink"); - hr = IUnknown_QueryInterface(punk, &IID_ITextStoreACPSink,(LPVOID*)(&ACPSink)); + hr = IUnknown_QueryInterface(punk, &IID_ITextStoreACPSink, (void**)&ACPSink); ok(SUCCEEDED(hr),"Unable to QueryInterface on sink\n"); + + hr = ITextStoreACPSink_QueryInterface(ACPSink, &IID_ITextStoreACPServices, (void**)&services); + ok(hr == S_OK, "got 0x%08x\n", hr); + ITextStoreACPServices_Release(services); + return S_OK; } @@ -1421,13 +1427,16 @@ ok(cid == cid2, "Second activate client ID does not match\n"); hr = ITfThreadMgr_QueryInterface(g_tm, &IID_ITfThreadMgrEx, (void **)&tmex); - ok(SUCCEEDED(hr), "Unable to acquire ITfThreadMgrEx interface\n"); - - hr = ITfThreadMgrEx_ActivateEx(tmex, &cid2, 0); - ok(SUCCEEDED(hr), "Failed to Activate\n"); - ok(cid == cid2, "ActivateEx client ID does not match\n"); + if (hr == S_OK) + { + hr = ITfThreadMgrEx_ActivateEx(tmex, &cid2, 0); + ok(SUCCEEDED(hr), "Failed to Activate\n"); + ok(cid == cid2, "ActivateEx client ID does not match\n"); - ITfThreadMgrEx_Release(tmex); + ITfThreadMgrEx_Release(tmex); + } + else + win_skip("ITfThreadMgrEx is not supported\n"); hr = ITfThreadMgr_Deactivate(g_tm); ok(SUCCEEDED(hr), "Failed to Deactivate\n"); diff -Nru wine-staging-1.9.6/dlls/mshtml/htmlattr.c wine-staging-1.9.7~ubuntu15.04.1/dlls/mshtml/htmlattr.c --- wine-staging-1.9.6/dlls/mshtml/htmlattr.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/mshtml/htmlattr.c 2016-04-04 18:06:32.000000000 +0000 @@ -169,7 +169,7 @@ if(!This->elem) return VariantCopy(p, &This->value); - return get_elem_attr_value_by_dispid(This->elem, This->dispid, 0, p); + return get_elem_attr_value_by_dispid(This->elem, This->dispid, p); } static HRESULT WINAPI HTMLDOMAttribute_get_specified(IHTMLDOMAttribute *iface, VARIANT_BOOL *p) @@ -310,12 +310,13 @@ TRACE("(%p)->(%p)\n", This, p); - if(!This->elem) { - FIXME("NULL This->elem\n"); - return E_UNEXPECTED; - } - - hres = get_elem_attr_value_by_dispid(This->elem, This->dispid, ATTRFLAG_ASSTRING, &val); + V_VT(&val) = VT_EMPTY; + if(This->elem) + hres = get_elem_attr_value_by_dispid(This->elem, This->dispid, &val); + else + hres = VariantCopy(&val, &This->value); + if(SUCCEEDED(hres)) + hres = attr_value_to_string(&val); if(FAILED(hres)) return hres; @@ -346,8 +347,11 @@ static HRESULT WINAPI HTMLDOMAttribute2_get_parentNode(IHTMLDOMAttribute2 *iface, IHTMLDOMNode **p) { HTMLDOMAttribute *This = impl_from_IHTMLDOMAttribute2(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + *p = NULL; + return S_OK; } static HRESULT WINAPI HTMLDOMAttribute2_get_childNodes(IHTMLDOMAttribute2 *iface, IDispatch **p) @@ -487,6 +491,11 @@ HTMLDOMAttribute_iface_tids }; +HTMLDOMAttribute *unsafe_impl_from_IHTMLDOMAttribute(IHTMLDOMAttribute *iface) +{ + return iface->lpVtbl == &HTMLDOMAttributeVtbl ? impl_from_IHTMLDOMAttribute(iface) : NULL; +} + HRESULT HTMLDOMAttribute_Create(const WCHAR *name, HTMLElement *elem, DISPID dispid, HTMLDOMAttribute **attr) { HTMLAttributeCollection *col; diff -Nru wine-staging-1.9.6/dlls/mshtml/htmlbody.c wine-staging-1.9.7~ubuntu15.04.1/dlls/mshtml/htmlbody.c --- wine-staging-1.9.6/dlls/mshtml/htmlbody.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/mshtml/htmlbody.c 2016-04-04 18:06:32.000000000 +0000 @@ -25,6 +25,7 @@ #include "winbase.h" #include "winuser.h" #include "ole2.h" +#include "mshtmdid.h" #include "wine/debug.h" @@ -838,6 +839,16 @@ return TRUE; } +static BOOL HTMLBodyElement_is_settable(HTMLDOMNode *iface, DISPID dispid) +{ + switch(dispid) { + case DISPID_IHTMLELEMENT_OUTERTEXT: + return FALSE; + default: + return TRUE; + } +} + static const cpc_entry_t HTMLBodyElement_cpc[] = { {&DIID_HTMLTextContainerEvents}, {&IID_IPropertyNotifySink}, @@ -863,7 +874,8 @@ NULL, HTMLBodyElement_traverse, HTMLBodyElement_unlink, - HTMLBodyElement_is_text_edit + HTMLBodyElement_is_text_edit, + HTMLBodyElement_is_settable }; static const tid_t HTMLBodyElement_iface_tids[] = { diff -Nru wine-staging-1.9.6/dlls/mshtml/htmlcomment.c wine-staging-1.9.7~ubuntu15.04.1/dlls/mshtml/htmlcomment.c --- wine-staging-1.9.6/dlls/mshtml/htmlcomment.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/mshtml/htmlcomment.c 2016-04-04 18:06:32.000000000 +0000 @@ -169,7 +169,7 @@ HTMLElement_destructor(&This->element.node); } -HRESULT HTMLCommentElement_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret) +static HRESULT HTMLCommentElement_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret) { HTMLCommentElement *This = impl_from_HTMLDOMNode(iface); HTMLElement *new_elem; diff -Nru wine-staging-1.9.6/dlls/mshtml/htmlelem.c wine-staging-1.9.7~ubuntu15.04.1/dlls/mshtml/htmlelem.c --- wine-staging-1.9.6/dlls/mshtml/htmlelem.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/mshtml/htmlelem.c 2016-04-04 18:06:32.000000000 +0000 @@ -46,6 +46,7 @@ static const WCHAR formW[] = {'F','O','R','M',0}; static const WCHAR frameW[] = {'F','R','A','M','E',0}; static const WCHAR headW[] = {'H','E','A','D',0}; +static const WCHAR htmlW[] = {'H','T','M','L',0}; static const WCHAR iframeW[] = {'I','F','R','A','M','E',0}; static const WCHAR imgW[] = {'I','M','G',0}; static const WCHAR inputW[] = {'I','N','P','U','T',0}; @@ -63,6 +64,10 @@ static const WCHAR title_tagW[]= {'T','I','T','L','E',0}; static const WCHAR trW[] = {'T','R',0}; +#define ATTRFLAG_CASESENSITIVE 0x0001 +#define ATTRFLAG_ASSTRING 0x0002 +#define ATTRFLAG_EXPANDURL 0x0004 + typedef struct { const WCHAR *name; HRESULT (*constructor)(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**); @@ -77,6 +82,7 @@ {formW, HTMLFormElement_Create}, {frameW, HTMLFrameElement_Create}, {headW, HTMLHeadElement_Create}, + {htmlW, HTMLHtmlElement_Create}, {iframeW, HTMLIFrame_Create}, {imgW, HTMLImgElement_Create}, {inputW, HTMLInputElement_Create}, @@ -608,14 +614,27 @@ wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); } +static HRESULT set_elem_attr_value_by_dispid(HTMLElement *elem, DISPID dispid, VARIANT *v) +{ + DISPID propput_dispid = DISPID_PROPERTYPUT; + DISPPARAMS dp = {v, &propput_dispid, 1, 1}; + EXCEPINFO ei; + + if(dispid == DISPID_IHTMLELEMENT_STYLE) { + TRACE("Ignoring call on style attribute\n"); + return S_OK; + } + + return IDispatchEx_InvokeEx(&elem->node.event_target.dispex.IDispatchEx_iface, dispid, + LOCALE_SYSTEM_DEFAULT, DISPATCH_PROPERTYPUT, &dp, NULL, &ei, NULL); +} + static HRESULT WINAPI HTMLElement_setAttribute(IHTMLElement *iface, BSTR strAttributeName, VARIANT AttributeValue, LONG lFlags) { HTMLElement *This = impl_from_IHTMLElement(iface); + DISPID dispid; HRESULT hres; - DISPID dispid, dispidNamed = DISPID_PROPERTYPUT; - DISPPARAMS dispParams; - EXCEPINFO excep; TRACE("(%p)->(%s %s %08x)\n", This, debugstr_w(strAttributeName), debugstr_variant(&AttributeValue), lFlags); @@ -624,53 +643,42 @@ if(FAILED(hres)) return hres; - if(dispid == DISPID_IHTMLELEMENT_STYLE) { - TRACE("Ignoring call on style attribute\n"); - return S_OK; - } - - dispParams.cArgs = 1; - dispParams.cNamedArgs = 1; - dispParams.rgdispidNamedArgs = &dispidNamed; - dispParams.rgvarg = &AttributeValue; - - return IDispatchEx_InvokeEx(&This->node.event_target.dispex.IDispatchEx_iface, dispid, - LOCALE_SYSTEM_DEFAULT, DISPATCH_PROPERTYPUT, &dispParams, NULL, &excep, NULL); + return set_elem_attr_value_by_dispid(This, dispid, &AttributeValue); } -HRESULT get_elem_attr_value_by_dispid(HTMLElement *elem, DISPID dispid, DWORD flags, VARIANT *ret) +HRESULT get_elem_attr_value_by_dispid(HTMLElement *elem, DISPID dispid, VARIANT *ret) { DISPPARAMS dispParams = {NULL, NULL, 0, 0}; EXCEPINFO excep; + + return IDispatchEx_InvokeEx(&elem->node.event_target.dispex.IDispatchEx_iface, dispid, LOCALE_SYSTEM_DEFAULT, + DISPATCH_PROPERTYGET, &dispParams, ret, &excep, NULL); +} + +HRESULT attr_value_to_string(VARIANT *v) +{ HRESULT hres; static const WCHAR nullW[] = {'n','u','l','l',0}; - hres = IDispatchEx_InvokeEx(&elem->node.event_target.dispex.IDispatchEx_iface, dispid, LOCALE_SYSTEM_DEFAULT, - DISPATCH_PROPERTYGET, &dispParams, ret, &excep, NULL); - if(FAILED(hres)) - return hres; - - if(flags & ATTRFLAG_ASSTRING) { - switch(V_VT(ret)) { - case VT_BSTR: - break; - case VT_NULL: - V_BSTR(ret) = SysAllocString(nullW); - if(!V_BSTR(ret)) - return E_OUTOFMEMORY; - V_VT(ret) = VT_BSTR; - break; - case VT_DISPATCH: - IDispatch_Release(V_DISPATCH(ret)); - V_VT(ret) = VT_BSTR; - V_BSTR(ret) = SysAllocString(NULL); - break; - default: - hres = VariantChangeType(ret, ret, 0, VT_BSTR); - if(FAILED(hres)) - return hres; - } + switch(V_VT(v)) { + case VT_BSTR: + break; + case VT_NULL: + V_BSTR(v) = SysAllocString(nullW); + if(!V_BSTR(v)) + return E_OUTOFMEMORY; + V_VT(v) = VT_BSTR; + break; + case VT_DISPATCH: + IDispatch_Release(V_DISPATCH(v)); + V_VT(v) = VT_BSTR; + V_BSTR(v) = SysAllocString(NULL); + break; + default: + hres = VariantChangeType(v, v, 0, VT_BSTR); + if(FAILED(hres)) + return hres; } return S_OK; @@ -700,7 +708,10 @@ return hres; } - return get_elem_attr_value_by_dispid(This, dispid, lFlags, AttributeValue); + hres = get_elem_attr_value_by_dispid(This, dispid, AttributeValue); + if(SUCCEEDED(hres) && (lFlags & ATTRFLAG_ASSTRING)) + hres = attr_value_to_string(AttributeValue); + return hres; } static HRESULT WINAPI HTMLElement_removeAttribute(IHTMLElement *iface, BSTR strAttributeName, @@ -1543,15 +1554,61 @@ static HRESULT WINAPI HTMLElement_put_outerText(IHTMLElement *iface, BSTR v) { HTMLElement *This = impl_from_IHTMLElement(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; + nsIDOMText *text_node; + nsIDOMRange *range; + nsAString nsstr; + nsresult nsres; + + TRACE("(%p)->(%s)\n", This, debugstr_w(v)); + + if(This->node.vtbl->is_settable && !This->node.vtbl->is_settable(&This->node, DISPID_IHTMLELEMENT_OUTERTEXT)) { + WARN("Called on element that does not support setting the property.\n"); + return 0x800a0258; /* undocumented error code */ + } + + if(!This->node.doc->nsdoc) { + FIXME("NULL nsdoc\n"); + return E_FAIL; + } + + nsAString_InitDepend(&nsstr, v); + nsres = nsIDOMHTMLDocument_CreateTextNode(This->node.doc->nsdoc, &nsstr, &text_node); + nsAString_Finish(&nsstr); + if(NS_FAILED(nsres)) { + ERR("CreateTextNode failed\n"); + return E_FAIL; + } + + nsres = nsIDOMHTMLDocument_CreateRange(This->node.doc->nsdoc, &range); + if(NS_SUCCEEDED(nsres)) { + nsres = nsIDOMRange_SelectNode(range, This->node.nsnode); + if(NS_SUCCEEDED(nsres)) + nsres = nsIDOMRange_DeleteContents(range); + if(NS_SUCCEEDED(nsres)) + nsres = nsIDOMRange_InsertNode(range, (nsIDOMNode*)text_node); + if(NS_SUCCEEDED(nsres)) + nsres = nsIDOMRange_SelectNodeContents(range, This->node.nsnode); + if(NS_SUCCEEDED(nsres)) + nsres = nsIDOMRange_DeleteContents(range); + nsIDOMRange_Release(range); + } + nsIDOMText_Release(text_node); + if(NS_FAILED(nsres)) { + ERR("failed to set text: %08x\n", nsres); + return E_FAIL; + } + + return S_OK; } static HRESULT WINAPI HTMLElement_get_outerText(IHTMLElement *iface, BSTR *p) { HTMLElement *This = impl_from_IHTMLElement(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + /* getter is the same as innerText */ + return IHTMLElement_get_innerText(&This->IHTMLElement_iface, p); } static HRESULT insert_adjacent_node(HTMLElement *This, const WCHAR *where, nsIDOMNode *nsnode, HTMLDOMNode **ret_node) @@ -3711,8 +3768,68 @@ IHTMLDOMAttribute **ppretAttribute) { HTMLElement *This = impl_from_IHTMLElement4(iface); - FIXME("(%p)->(%p %p)\n", This, pattr, ppretAttribute); - return E_NOTIMPL; + HTMLDOMAttribute *attr, *iter, *replace = NULL; + HTMLAttributeCollection *attrs; + DISPID dispid; + HRESULT hres; + + TRACE("(%p)->(%p %p)\n", This, pattr, ppretAttribute); + + attr = unsafe_impl_from_IHTMLDOMAttribute(pattr); + if(!attr) + return E_INVALIDARG; + + if(attr->elem) { + WARN("Tried to set already attached attribute.\n"); + return E_INVALIDARG; + } + + hres = IDispatchEx_GetDispID(&This->node.event_target.dispex.IDispatchEx_iface, + attr->name, fdexNameCaseInsensitive|fdexNameEnsure, &dispid); + if(FAILED(hres)) + return hres; + + hres = HTMLElement_get_attr_col(&This->node, &attrs); + if(FAILED(hres)) + return hres; + + LIST_FOR_EACH_ENTRY(iter, &attrs->attrs, HTMLDOMAttribute, entry) { + if(iter->dispid == dispid) { + replace = iter; + break; + } + } + + if(replace) { + hres = get_elem_attr_value_by_dispid(This, dispid, &replace->value); + if(FAILED(hres)) { + WARN("could not get attr value: %08x\n", hres); + V_VT(&replace->value) = VT_EMPTY; + } + if(!replace->name) { + replace->name = attr->name; + attr->name = NULL; + } + list_add_head(&replace->entry, &attr->entry); + list_remove(&replace->entry); + replace->elem = NULL; + }else { + list_add_tail(&attrs->attrs, &attr->entry); + } + + IHTMLDOMAttribute_AddRef(&attr->IHTMLDOMAttribute_iface); + attr->elem = This; + attr->dispid = dispid; + + IHTMLAttributeCollection_Release(&attrs->IHTMLAttributeCollection_iface); + + hres = set_elem_attr_value_by_dispid(This, dispid, &attr->value); + if(FAILED(hres)) + WARN("Could not set attribute value: %08x\n", hres); + VariantClear(&attr->value); + + *ppretAttribute = replace ? &replace->IHTMLDOMAttribute_iface : NULL; + return S_OK; } static HRESULT WINAPI HTMLElement4_removeAttributeNode(IHTMLElement4 *iface, IHTMLDOMAttribute *pattr, diff -Nru wine-staging-1.9.6/dlls/mshtml/htmlhead.c wine-staging-1.9.7~ubuntu15.04.1/dlls/mshtml/htmlhead.c --- wine-staging-1.9.6/dlls/mshtml/htmlhead.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/mshtml/htmlhead.c 2016-04-04 18:06:32.000000000 +0000 @@ -24,6 +24,7 @@ #include "winbase.h" #include "winuser.h" #include "ole2.h" +#include "mshtmdid.h" #include "wine/debug.h" @@ -188,6 +189,189 @@ *elem = &ret->element; return S_OK; +} + +typedef struct { + HTMLElement element; + + IHTMLHtmlElement IHTMLHtmlElement_iface; +} HTMLHtmlElement; + +static inline HTMLHtmlElement *impl_from_IHTMLHtmlElement(IHTMLHtmlElement *iface) +{ + return CONTAINING_RECORD(iface, HTMLHtmlElement, IHTMLHtmlElement_iface); +} + +static HRESULT WINAPI HTMLHtmlElement_QueryInterface(IHTMLHtmlElement *iface, + REFIID riid, void **ppv) +{ + HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface); + + return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv); +} + +static ULONG WINAPI HTMLHtmlElement_AddRef(IHTMLHtmlElement *iface) +{ + HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface); + + return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface); +} + +static ULONG WINAPI HTMLHtmlElement_Release(IHTMLHtmlElement *iface) +{ + HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface); + + return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface); +} + +static HRESULT WINAPI HTMLHtmlElement_GetTypeInfoCount(IHTMLHtmlElement *iface, UINT *pctinfo) +{ + HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface); + + return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo); +} + +static HRESULT WINAPI HTMLHtmlElement_GetTypeInfo(IHTMLHtmlElement *iface, UINT iTInfo, + LCID lcid, ITypeInfo **ppTInfo) +{ + HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface); + + return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid, + ppTInfo); +} + +static HRESULT WINAPI HTMLHtmlElement_GetIDsOfNames(IHTMLHtmlElement *iface, REFIID riid, + LPOLESTR *rgszNames, UINT cNames, + LCID lcid, DISPID *rgDispId) +{ + HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface); + + return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames, + cNames, lcid, rgDispId); +} + +static HRESULT WINAPI HTMLHtmlElement_Invoke(IHTMLHtmlElement *iface, DISPID dispIdMember, + REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, + VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface); + + return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid, + lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); +} + +static HRESULT WINAPI HTMLHtmlElement_put_version(IHTMLHtmlElement *iface, BSTR v) +{ + HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLHtmlElement_get_version(IHTMLHtmlElement *iface, BSTR *p) +{ + HTMLHtmlElement *This = impl_from_IHTMLHtmlElement(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static const IHTMLHtmlElementVtbl HTMLHtmlElementVtbl = { + HTMLHtmlElement_QueryInterface, + HTMLHtmlElement_AddRef, + HTMLHtmlElement_Release, + HTMLHtmlElement_GetTypeInfoCount, + HTMLHtmlElement_GetTypeInfo, + HTMLHtmlElement_GetIDsOfNames, + HTMLHtmlElement_Invoke, + HTMLHtmlElement_put_version, + HTMLHtmlElement_get_version +}; + +static inline HTMLHtmlElement *HTMLHtmlElement_from_HTMLDOMNode(HTMLDOMNode *iface) +{ + return CONTAINING_RECORD(iface, HTMLHtmlElement, element.node); +} + +static HRESULT HTMLHtmlElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) +{ + HTMLHtmlElement *This = HTMLHtmlElement_from_HTMLDOMNode(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv); + + if(IsEqualGUID(&IID_IHTMLHtmlElement, riid)) + *ppv = &This->IHTMLHtmlElement_iface; + else + return HTMLElement_QI(&This->element.node, riid, ppv); + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static void HTMLHtmlElement_destructor(HTMLDOMNode *iface) +{ + HTMLHtmlElement *This = HTMLHtmlElement_from_HTMLDOMNode(iface); + + HTMLElement_destructor(&This->element.node); +} + +static BOOL HTMLHtmlElement_is_settable(HTMLDOMNode *iface, DISPID dispid) +{ + switch(dispid) { + case DISPID_IHTMLELEMENT_OUTERTEXT: + return FALSE; + default: + return TRUE; + } +} + +static const NodeImplVtbl HTMLHtmlElementImplVtbl = { + HTMLHtmlElement_QI, + HTMLHtmlElement_destructor, + HTMLElement_cpc, + HTMLElement_clone, + HTMLElement_handle_event, + HTMLElement_get_attr_col, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + HTMLHtmlElement_is_settable +}; + +static const tid_t HTMLHtmlElement_iface_tids[] = { + HTMLELEMENT_TIDS, + IHTMLHtmlElement_tid, + 0 +}; +static dispex_static_data_t HTMLHtmlElement_dispex = { + NULL, + DispHTMLHtmlElement_tid, + NULL, + HTMLHtmlElement_iface_tids +}; + +HRESULT HTMLHtmlElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem) +{ + HTMLHtmlElement *ret; + + ret = heap_alloc_zero(sizeof(*ret)); + if(!ret) + return E_OUTOFMEMORY; + + ret->IHTMLHtmlElement_iface.lpVtbl = &HTMLHtmlElementVtbl; + ret->element.node.vtbl = &HTMLHtmlElementImplVtbl; + + HTMLElement_Init(&ret->element, doc, nselem, &HTMLHtmlElement_dispex); + + *elem = &ret->element; + return S_OK; } typedef struct { diff -Nru wine-staging-1.9.6/dlls/mshtml/htmlstyle.c wine-staging-1.9.7~ubuntu15.04.1/dlls/mshtml/htmlstyle.c --- wine-staging-1.9.6/dlls/mshtml/htmlstyle.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/mshtml/htmlstyle.c 2016-04-04 18:06:32.000000000 +0000 @@ -396,7 +396,7 @@ return ret; } -HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, const WCHAR *value, DWORD flags) +static HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, const WCHAR *value, DWORD flags) { nsAString str_name, str_value, str_empty; LPWSTR val = NULL; @@ -461,7 +461,7 @@ } } -HRESULT set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *value, DWORD flags) +static HRESULT set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *value, DWORD flags) { const WCHAR *val; WCHAR buf[14]; diff -Nru wine-staging-1.9.6/dlls/mshtml/htmlstyle.h wine-staging-1.9.7~ubuntu15.04.1/dlls/mshtml/htmlstyle.h --- wine-staging-1.9.6/dlls/mshtml/htmlstyle.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/mshtml/htmlstyle.h 2016-04-04 18:06:32.000000000 +0000 @@ -124,9 +124,7 @@ HRESULT HTMLStyle_Create(HTMLElement*,HTMLStyle**) DECLSPEC_HIDDEN; HRESULT get_nsstyle_attr(nsIDOMCSSStyleDeclaration*,styleid_t,BSTR*,DWORD) DECLSPEC_HIDDEN; -HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration*,styleid_t,LPCWSTR,DWORD) DECLSPEC_HIDDEN; -HRESULT set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *value, DWORD flags) DECLSPEC_HIDDEN; HRESULT get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *p, DWORD flags) DECLSPEC_HIDDEN; HRESULT get_elem_style(HTMLElement*,styleid_t,BSTR*) DECLSPEC_HIDDEN; diff -Nru wine-staging-1.9.6/dlls/mshtml/mshtml_private.h wine-staging-1.9.7~ubuntu15.04.1/dlls/mshtml/mshtml_private.h --- wine-staging-1.9.6/dlls/mshtml/mshtml_private.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/mshtml/mshtml_private.h 2016-04-04 18:06:32.000000000 +0000 @@ -94,6 +94,7 @@ XDIID(DispHTMLGenericElement) \ XDIID(DispHTMLFrameElement) \ XDIID(DispHTMLHeadElement) \ + XDIID(DispHTMLHtmlElement) \ XDIID(DispHTMLHistory) \ XDIID(DispHTMLIFrame) \ XDIID(DispHTMLImg) \ @@ -162,6 +163,7 @@ XIID(IHTMLFrameElement3) \ XIID(IHTMLGenericElement) \ XIID(IHTMLHeadElement) \ + XIID(IHTMLHtmlElement) \ XIID(IHTMLIFrameElement) \ XIID(IHTMLIFrameElement2) \ XIID(IHTMLIFrameElement3) \ @@ -677,6 +679,7 @@ void (*traverse)(HTMLDOMNode*,nsCycleCollectionTraversalCallback*); void (*unlink)(HTMLDOMNode*); BOOL (*is_text_edit)(HTMLDOMNode*); + BOOL (*is_settable)(HTMLDOMNode*,DISPID); } NodeImplVtbl; struct HTMLDOMNode { @@ -943,15 +946,18 @@ LONG ref; - /* name and value are valid only for detached attributes (when elem == NULL). */ - WCHAR *name; + /* value is valid only for detached attributes (when elem == NULL). */ VARIANT value; + /* name must be valid for detached attributes */ + WCHAR *name; HTMLElement *elem; DISPID dispid; struct list entry; } HTMLDOMAttribute; +HTMLDOMAttribute *unsafe_impl_from_IHTMLDOMAttribute(IHTMLDOMAttribute*) DECLSPEC_HIDDEN; + HRESULT HTMLDOMAttribute_Create(const WCHAR*,HTMLElement*,DISPID,HTMLDOMAttribute**) DECLSPEC_HIDDEN; HRESULT HTMLElement_Create(HTMLDocumentNode*,nsIDOMNode*,BOOL,HTMLElement**) DECLSPEC_HIDDEN; @@ -964,6 +970,7 @@ HRESULT HTMLFormElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN; HRESULT HTMLFrameElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN; HRESULT HTMLHeadElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN; +HRESULT HTMLHtmlElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN; HRESULT HTMLIFrame_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN; HRESULT HTMLStyleElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN; HRESULT HTMLImgElement_Create(HTMLDocumentNode*,nsIDOMHTMLElement*,HTMLElement**) DECLSPEC_HIDDEN; @@ -1016,11 +1023,8 @@ IHTMLElementCollection *create_collection_from_nodelist(HTMLDocumentNode*,nsIDOMNodeList*) DECLSPEC_HIDDEN; IHTMLElementCollection *create_collection_from_htmlcol(HTMLDocumentNode*,nsIDOMHTMLCollection*) DECLSPEC_HIDDEN; -#define ATTRFLAG_CASESENSITIVE 0x0001 -#define ATTRFLAG_ASSTRING 0x0002 -#define ATTRFLAG_EXPANDURL 0x0004 - -HRESULT get_elem_attr_value_by_dispid(HTMLElement*,DISPID,DWORD,VARIANT*) DECLSPEC_HIDDEN; +HRESULT attr_value_to_string(VARIANT*) DECLSPEC_HIDDEN; +HRESULT get_elem_attr_value_by_dispid(HTMLElement*,DISPID,VARIANT*) DECLSPEC_HIDDEN; HRESULT get_elem_source_index(HTMLElement*,LONG*) DECLSPEC_HIDDEN; nsresult get_elem_attr_value(nsIDOMHTMLElement*,const WCHAR*,nsAString*,const PRUnichar**) DECLSPEC_HIDDEN; diff -Nru wine-staging-1.9.6/dlls/mshtml/tests/dom.c wine-staging-1.9.7~ubuntu15.04.1/dlls/mshtml/tests/dom.c --- wine-staging-1.9.6/dlls/mshtml/tests/dom.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/mshtml/tests/dom.c 2016-04-04 18:06:32.000000000 +0000 @@ -328,6 +328,13 @@ NULL }; +static const IID * const html_iids[] = { + ELEM_IFACES, + &IID_IHTMLHtmlElement, + &IID_IConnectionPointContainer, + NULL +}; + static const IID * const head_iids[] = { ELEM_IFACES, &IID_IHTMLHeadElement, @@ -449,7 +456,7 @@ static const elem_type_info_t elem_type_infos[] = { {"", none_iids, NULL}, - {"HTML", elem_iids, NULL}, + {"HTML", html_iids, &DIID_DispHTMLHtmlElement}, {"HEAD", head_iids, &DIID_DispHTMLHeadElement}, {"TITLE", title_iids, &DIID_DispHTMLTitleElement}, {"BODY", body_iids, &DIID_DispHTMLBody}, @@ -1903,6 +1910,22 @@ SysFreeString(text); } +#define create_attr(a,b) _create_attr(__LINE__,a,b) +static IHTMLDOMAttribute *_create_attr(unsigned line, IUnknown *unk, const char *name) +{ + IHTMLDocument5 *doc = _get_htmldoc5_iface(line, unk); + BSTR str = a2bstr("Test"); + IHTMLDOMAttribute *attr; + HRESULT hres; + + hres = IHTMLDocument5_createAttribute(doc, str, &attr); + ok_(__FILE__,line)(hres == S_OK, "createAttribute dailed: %08x\n", hres); + SysFreeString(str); + IHTMLDocument5_Release(doc); + + return attr; +} + #define test_attr_specified(a,b) _test_attr_specified(__LINE__,a,b) static void _test_attr_specified(unsigned line, IHTMLDOMAttribute *attr, VARIANT_BOOL expected) { @@ -2788,6 +2811,44 @@ } +#define test_elem_outertext(e,t) _test_elem_outertext(__LINE__,e,t) +static void _test_elem_outertext(unsigned line, IHTMLElement *elem, const char *extext) +{ + BSTR text = NULL; + HRESULT hres; + + hres = IHTMLElement_get_outerText(elem, &text); + ok_(__FILE__,line) (hres == S_OK, "get_outerText failed: %08x\n", hres); + if(extext) + ok_(__FILE__,line) (!strcmp_wa(text, extext), "get_outerText returned %s expected %s\n", + wine_dbgstr_w(text), extext); + else + ok_(__FILE__,line) (!text, "get_outerText returned %s expected NULL\n", wine_dbgstr_w(text)); + SysFreeString(text); +} + +#define test_elem_set_outertext(e,t) _test_elem_set_outertext(__LINE__,e,t) +static void _test_elem_set_outertext(unsigned line, IHTMLElement *elem, const char *text) +{ + BSTR str = a2bstr(text); + HRESULT hres; + + hres = IHTMLElement_put_outerText(elem, str); + ok_(__FILE__,line) (hres == S_OK, "put_outerText failed: %08x\n", hres); + SysFreeString(str); +} + +#define test_elem_set_outertext_fail(a) _test_elem_set_outertext_fail(__LINE__,a) +static void _test_elem_set_outertext_fail(unsigned line, IHTMLElement *elem) +{ + BSTR str = a2bstr("test"); + HRESULT hres; + + hres = IHTMLElement_put_outerText(elem, str); + ok_(__FILE__,line) (hres == 0x800a0258, "put_outerText failed: %08x\n", hres); + SysFreeString(str); +} + #define test_elem_innerhtml(e,t) _test_elem_innerhtml(__LINE__,e,t) static void _test_elem_innerhtml(unsigned line, IUnknown *unk, const char *inner_html) { @@ -3386,6 +3447,19 @@ SysFreeString(str); } +#define test_attr_parent(a) _test_attr_parent(__LINE__,a) +static void _test_attr_parent(unsigned line, IHTMLDOMAttribute *attr) +{ + IHTMLDOMAttribute2 *attr2 = _get_attr2_iface(line, (IUnknown*)attr); + IHTMLDOMNode *parent = (void*)0xdeadbeef; + HRESULT hres; + + hres = IHTMLDOMAttribute2_get_parentNode(attr2, &parent); + ok_(__FILE__,line)(hres == S_OK, "get_parentNode failed: %08x\n", hres); + ok_(__FILE__,line)(!parent, "parent != NULL\n"); + IHTMLDOMAttribute2_Release(attr2); +} + static void test_attr_collection_disp(IDispatch *disp) { IDispatchEx *dispex; @@ -6286,6 +6360,7 @@ test_node_name((IUnknown*)elem, "HTML"); test_elem_tag((IUnknown*)elem, "HTML"); + test_elem_set_outertext_fail(elem); doc_node = get_doc_node(doc); owner_doc = get_owner_doc((IUnknown*)elem); @@ -6698,6 +6773,8 @@ test_body_funs(body); IHTMLBodyElement_Release(body); + test_elem_set_outertext_fail(elem); + test_elem_istextedit(elem, VARIANT_TRUE); hres = IHTMLElement_get_style(elem, &style); @@ -8493,10 +8570,12 @@ IHTMLWindow2_Release(window); } -static void test_attr(IHTMLElement *elem) +static void test_attr(IHTMLDocument2 *doc, IHTMLElement *elem) { - IHTMLDOMAttribute *attr, *attr2; + IHTMLDOMAttribute *attr, *attr2, *attr3; + IHTMLElement4 *elem4; VARIANT v; + HRESULT hres; get_elem_attr_node((IUnknown*)elem, "noattr", FALSE); @@ -8506,6 +8585,7 @@ test_ifaces((IUnknown*)attr, attr_iids); test_no_iface((IUnknown*)attr, &IID_IHTMLDOMNode); test_attr_specified(attr, VARIANT_TRUE); + test_attr_parent(attr); attr2 = get_elem_attr_node((IUnknown*)elem, "id", TRUE); ok(iface_cmp((IUnknown*)attr, (IUnknown*)attr2), "attr != attr2\n"); @@ -8575,6 +8655,89 @@ test_attr_specified(attr, VARIANT_FALSE); test_attr_expando(attr, VARIANT_FALSE); IHTMLDOMAttribute_Release(attr); + + /* Test created, detached attribute. */ + attr = create_attr((IUnknown*)doc, "Test"); + + test_disp((IUnknown*)attr, &DIID_DispHTMLDOMAttribute, "[object]"); + test_ifaces((IUnknown*)attr, attr_iids); + test_no_iface((IUnknown*)attr, &IID_IHTMLDOMNode); + + test_attr_node_name(attr, "Test"); + test_attr_expando(attr, VARIANT_FALSE); + + get_attr_node_value(attr, &v, VT_EMPTY); + + V_VT(&v) = VT_I4; + V_I4(&v) = 1; + put_attr_node_value(attr, v); + + get_attr_node_value(attr, &v, VT_I4); + ok(V_I4(&v) == 1, "nodeValue = %d\n", V_I4(&v)); + test_attr_value(attr, "1"); + + V_VT(&v) = VT_EMPTY; + put_attr_node_value(attr, v); + get_attr_node_value(attr, &v, VT_EMPTY); + + V_VT(&v) = VT_BSTR; + V_BSTR(&v) = a2bstr("testing"); + put_attr_node_value(attr, v); + SysFreeString(V_BSTR(&v)); + test_attr_value(attr, "testing"); + + elem4 = get_elem4_iface((IUnknown*)elem); + + hres = IHTMLElement4_setAttributeNode(elem4, attr, &attr2); + ok(hres == S_OK, "setAttributeNode failed: %08x\n", hres); + ok(!attr2, "attr2 != NULL\n"); + + test_elem_attr(elem, "Test", "testing"); + put_attr_value(attr, "new value"); + test_elem_attr(elem, "Test", "new value"); + + attr2 = get_elem_attr_node((IUnknown*)elem, "Test", TRUE); + ok(iface_cmp((IUnknown*)attr2, (IUnknown*)attr), "attr2 != attr\n"); + IHTMLDOMAttribute_Release(attr2); + + attr3 = create_attr((IUnknown*)doc, "Test"); + put_attr_value(attr3, "replace test"); + + hres = IHTMLElement4_setAttributeNode(elem4, attr3, &attr2); + ok(hres == S_OK, "setAttributeNode failed: %08x\n", hres); + ok(iface_cmp((IUnknown*)attr2, (IUnknown*)attr), "attr2 != attr\n"); + IHTMLDOMAttribute_Release(attr2); + + test_elem_attr(elem, "Test", "replace test"); + test_attr_value(attr, "new value"); + test_attr_value(attr3, "replace test"); + + attr2 = get_elem_attr_node((IUnknown*)elem, "Test", TRUE); + ok(iface_cmp((IUnknown*)attr2, (IUnknown*)attr3), "attr2 != attr3\n"); + IHTMLDOMAttribute_Release(attr2); + + put_attr_value(attr, "new value2"); + test_elem_attr(elem, "Test", "replace test"); + test_attr_value(attr, "new value2"); + test_attr_value(attr3, "replace test"); + + put_attr_value(attr3, "new replace value"); + test_elem_attr(elem, "Test", "new replace value"); + test_attr_value(attr, "new value2"); + test_attr_value(attr3, "new replace value"); + + /* Attached attributes cause errors. */ + hres = IHTMLElement4_setAttributeNode(elem4, attr3, &attr2); + ok(hres == E_INVALIDARG, "setAttributeNode failed: %08x, expected E_INVALIDARG\n", hres); + IHTMLDOMAttribute_Release(attr3); + + attr2 = get_elem_attr_node((IUnknown*)elem, "id", TRUE); + hres = IHTMLElement4_setAttributeNode(elem4, attr2, &attr3); + ok(hres == E_INVALIDARG, "setAttributeNode failed: %08x, expected E_INVALIDARG\n", hres); + IHTMLDOMAttribute_Release(attr2); + + IHTMLElement4_Release(elem4); + IHTMLDOMAttribute_Release(attr); } static void test_blocked(IHTMLDocument2 *doc, IHTMLElement *outer_elem) @@ -8796,7 +8959,19 @@ IHTMLElement_Release(elem2); } - test_attr(div); + test_elem_set_innerhtml((IUnknown*)div, "
test
"); + elem = get_elem_by_id(doc, "elemid", TRUE); + if(elem) { + test_elem_outertext(elem, "test"); + test_elem_set_outertext(elem, "outer text"); + test_elem_outertext(elem, NULL); + test_elem_all((IUnknown*)div, NULL, 0); + elem2 = test_elem_get_parent((IUnknown*)elem); + ok(!elem2, "parent != NULL\n"); + IHTMLElement_Release(elem); + } + + test_attr(doc, div); test_blocked(doc, div); test_elem_names(doc); @@ -8807,7 +8982,6 @@ { IHTMLElement *elem, *body, *elem2; IHTMLDOMNode *node, *node2, *node3, *comment; - IHTMLDOMAttribute *attr; IHTMLDocument5 *doc5; IDispatch *disp; VARIANT var; @@ -8911,36 +9085,6 @@ IHTMLDOMNode_Release(comment); } - str = a2bstr("Test"); - hres = IHTMLDocument5_createAttribute(doc5, str, &attr); - ok(hres == S_OK, "createAttribute dailed: %08x\n", hres); - SysFreeString(str); - if(SUCCEEDED(hres)) { - VARIANT v; - - test_disp((IUnknown*)attr, &DIID_DispHTMLDOMAttribute, "[object]"); - test_ifaces((IUnknown*)attr, attr_iids); - test_no_iface((IUnknown*)attr, &IID_IHTMLDOMNode); - - test_attr_node_name(attr, "Test"); - test_attr_expando(attr, VARIANT_FALSE); - - get_attr_node_value(attr, &v, VT_EMPTY); - - V_VT(&v) = VT_I4; - V_I4(&v) = 1; - put_attr_node_value(attr, v); - - get_attr_node_value(attr, &v, VT_I4); - ok(V_I4(&v) == 1, "nodeValue = %d\n", V_I4(&v)); - - V_VT(&v) = VT_EMPTY; - put_attr_node_value(attr, v); - get_attr_node_value(attr, &v, VT_EMPTY); - - IHTMLDOMAttribute_Release(attr); - } - IHTMLDocument5_Release(doc5); } diff -Nru wine-staging-1.9.6/dlls/mshtml/tests/xmlhttprequest.c wine-staging-1.9.7~ubuntu15.04.1/dlls/mshtml/tests/xmlhttprequest.c --- wine-staging-1.9.6/dlls/mshtml/tests/xmlhttprequest.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/mshtml/tests/xmlhttprequest.c 2016-04-04 18:06:32.000000000 +0000 @@ -386,6 +386,7 @@ struct HEADER_TYPE { const char *key; const char *value; + BOOL skip_all_headers; }; static void create_xmlhttprequest(IHTMLDocument2 *doc) @@ -450,6 +451,9 @@ SysFreeString(key); SysFreeString(text); + if(expect[i].skip_all_headers) + continue; + strcpy(buf, expect[i].key); strcat(buf, ": "); strcat(buf, expect[i].value); @@ -562,7 +566,7 @@ ok(broken(supported == (INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA)) || supported == (INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA | INTERFACE_USES_SECURITY_MANAGER) /* msxml3 SP8+ */, "Expected supported: (INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA | INTERFACE_USES_SECURITY_MANAGER), got %08x\n", supported); - ok(enabled == (INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA | INTERFACE_USES_SECURITY_MANAGER), + ok(enabled == ((INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA | INTERFACE_USES_SECURITY_MANAGER) & supported), "Expected enabled: (INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA | INTERFACE_USES_SECURITY_MANAGER), got 0x%08x\n", enabled); IObjectSafety_Release(safety); @@ -581,8 +585,7 @@ LONG val; HRESULT hres; static const struct HEADER_TYPE expect_headers[] = { - {"Server", "Apache"}, - {"Accept-Ranges", "bytes"}, + {"Accept-Ranges", "bytes", TRUE}, {"Content-Length", "51"}, {"Content-Type", "application/xml"} }; diff -Nru wine-staging-1.9.6/dlls/mshtml/txtrange.c wine-staging-1.9.7~ubuntu15.04.1/dlls/mshtml/txtrange.c --- wine-staging-1.9.6/dlls/mshtml/txtrange.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/mshtml/txtrange.c 2016-04-04 18:06:32.000000000 +0000 @@ -535,7 +535,7 @@ if (!wstrbuf_init(&buf)) return E_OUTOFMEMORY; wstrbuf_append_node_rec(&buf, node->nsnode); - if(buf.buf) { + if(buf.buf && *buf.buf) { *ret = SysAllocString(buf.buf); if(!*ret) hres = E_OUTOFMEMORY; diff -Nru wine-staging-1.9.6/dlls/msvcirt/msvcirt.c wine-staging-1.9.7~ubuntu15.04.1/dlls/msvcirt/msvcirt.c --- wine-staging-1.9.6/dlls/msvcirt/msvcirt.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/msvcirt/msvcirt.c 2016-04-04 18:06:32.000000000 +0000 @@ -1383,7 +1383,7 @@ TRACE("(%p %d %d %d)\n", this, offset, dir, mode); - if (dir < SEEKDIR_beg || dir > SEEKDIR_end || !(mode & (OPENMODE_in|OPENMODE_out))) + if ((unsigned int)dir > SEEKDIR_end || !(mode & (OPENMODE_in|OPENMODE_out))) return EOF; /* read buffer */ if (mode & OPENMODE_in) { diff -Nru wine-staging-1.9.6/dlls/msvcp110/msvcp110.spec wine-staging-1.9.7~ubuntu15.04.1/dlls/msvcp110/msvcp110.spec --- wine-staging-1.9.6/dlls/msvcp110/msvcp110.spec 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/msvcp110/msvcp110.spec 2016-04-04 18:06:32.000000000 +0000 @@ -3818,7 +3818,7 @@ @ stub _Lock_shared_ptr_spin_lock @ cdecl _Mbrtowc(ptr ptr long ptr ptr) @ stub _Mtx_clear_owner -@ stub _Mtx_current_owns +@ cdecl _Mtx_current_owns(ptr) @ cdecl _Mtx_destroy(ptr) @ cdecl _Mtx_getconcrtcs(ptr) @ cdecl _Mtx_init(ptr long) diff -Nru wine-staging-1.9.6/dlls/msvcp120/msvcp120.spec wine-staging-1.9.7~ubuntu15.04.1/dlls/msvcp120/msvcp120.spec --- wine-staging-1.9.6/dlls/msvcp120/msvcp120.spec 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/msvcp120/msvcp120.spec 2016-04-04 18:06:32.000000000 +0000 @@ -3763,7 +3763,7 @@ @ stub _Lock_shared_ptr_spin_lock @ cdecl _Mbrtowc(ptr ptr long ptr ptr) @ stub _Mtx_clear_owner -@ stub _Mtx_current_owns +@ cdecl _Mtx_current_owns(ptr) @ cdecl _Mtx_destroy(ptr) @ cdecl _Mtx_getconcrtcs(ptr) @ cdecl _Mtx_init(ptr long) diff -Nru wine-staging-1.9.6/dlls/msvcp120_app/msvcp120_app.spec wine-staging-1.9.7~ubuntu15.04.1/dlls/msvcp120_app/msvcp120_app.spec --- wine-staging-1.9.6/dlls/msvcp120_app/msvcp120_app.spec 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/msvcp120_app/msvcp120_app.spec 2016-04-04 18:06:32.000000000 +0000 @@ -3763,7 +3763,7 @@ @ stub _Lock_shared_ptr_spin_lock @ cdecl _Mbrtowc(ptr ptr long ptr ptr) msvcp120._Mbrtowc @ stub _Mtx_clear_owner -@ stub _Mtx_current_owns +@ cdecl _Mtx_current_owns(ptr) msvcp120._Mtx_current_owns @ cdecl _Mtx_destroy(ptr) msvcp120._Mtx_destroy @ cdecl _Mtx_getconcrtcs(ptr) msvcp120._Mtx_getconcrtcs @ cdecl _Mtx_init(ptr long) msvcp120._Mtx_init diff -Nru wine-staging-1.9.6/dlls/msvcp90/misc.c wine-staging-1.9.7~ubuntu15.04.1/dlls/msvcp90/misc.c --- wine-staging-1.9.6/dlls/msvcp90/misc.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/msvcp90/misc.c 2016-04-04 18:06:32.000000000 +0000 @@ -487,6 +487,11 @@ MSVCRT_operator_delete(*mtx); } +int __cdecl _Mtx_current_owns(_Mtx_t *mtx) +{ + return (*mtx)->thread_id == GetCurrentThreadId(); +} + int __cdecl _Mtx_lock(_Mtx_t *mtx) { if((*mtx)->thread_id != GetCurrentThreadId()) { diff -Nru wine-staging-1.9.6/dlls/msvcr120/msvcr120.spec wine-staging-1.9.7~ubuntu15.04.1/dlls/msvcr120/msvcr120.spec --- wine-staging-1.9.6/dlls/msvcr120/msvcr120.spec 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/msvcr120/msvcr120.spec 2016-04-04 18:06:32.000000000 +0000 @@ -2018,9 +2018,9 @@ @ cdecl asctime_s(ptr long ptr) MSVCRT_asctime_s @ cdecl asin(double) MSVCRT_asin @ cdecl -arch=arm,x86_64 asinf(float) MSVCRT_asinf -@ stub asinh -@ stub asinhf -@ stub asinhl +@ cdecl asinh(double double) MSVCR120_asinh +@ cdecl asinhf(float float) MSVCR120_asinhf +@ cdecl asinhl(double double) MSVCR120_asinhl @ cdecl atan(double) MSVCRT_atan @ cdecl -arch=arm,x86_64 atanf(float) MSVCRT_atanf @ cdecl atan2(double double) MSVCRT_atan2 diff -Nru wine-staging-1.9.6/dlls/msvcr120_app/msvcr120_app.spec wine-staging-1.9.7~ubuntu15.04.1/dlls/msvcr120_app/msvcr120_app.spec --- wine-staging-1.9.6/dlls/msvcr120_app/msvcr120_app.spec 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/msvcr120_app/msvcr120_app.spec 2016-04-04 18:06:32.000000000 +0000 @@ -1684,9 +1684,9 @@ @ cdecl asctime_s(ptr long ptr) msvcr120.asctime_s @ cdecl asin(double) msvcr120.asin @ cdecl -arch=arm,x86_64 asinf(float) msvcr120.asinf -@ stub asinh -@ stub asinhf -@ stub asinhl +@ cdecl asinh(double double) msvcr120.asinh +@ cdecl asinhf(float float) msvcr120.asinhf +@ cdecl asinhl(double double) msvcr120.asinhl @ cdecl atan(double) msvcr120.atan @ cdecl -arch=arm,x86_64 atanf(float) msvcr120.atanf @ cdecl atan2(double double) msvcr120.atan2 diff -Nru wine-staging-1.9.6/dlls/msvcrt/except_i386.c wine-staging-1.9.7~ubuntu15.04.1/dlls/msvcrt/except_i386.c --- wine-staging-1.9.6/dlls/msvcrt/except_i386.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/msvcrt/except_i386.c 2016-04-04 18:06:32.000000000 +0000 @@ -412,6 +412,7 @@ struct catch_func_nested_frame nested_frame; int trylevel = frame->trylevel; DWORD save_esp = ((DWORD*)frame)[-1]; + thread_data_t *data; for (i = 0; i < descr->tryblock_count; i++) { @@ -446,22 +447,26 @@ TRACE("found catch(...) block\n"); } + __CxxRegisterExceptionObject(&rec, &nested_frame.frame_info); + /* unwind the stack */ RtlUnwind( catch_frame ? catch_frame : &frame->frame, 0, rec, 0 ); cxx_local_unwind( frame, descr, tryblock->start_level ); frame->trylevel = tryblock->end_level + 1; + data = msvcrt_get_thread_data(); + nested_frame.frame_info.rec = data->exc_record; + data->exc_record = rec; + /* call the catch block */ TRACE( "calling catch block %p addr %p ebp %p\n", catchblock, catchblock->handler, &frame->ebp ); /* setup an exception block for nested exceptions */ - nested_frame.frame.Handler = catch_function_nested_handler; nested_frame.cxx_frame = frame; nested_frame.descr = descr; nested_frame.trylevel = nested_trylevel + 1; - __CxxRegisterExceptionObject(&rec, &nested_frame.frame_info); __wine_push_frame( &nested_frame.frame ); addr = call_ebp_func( catchblock->handler, &frame->ebp ); diff -Nru wine-staging-1.9.6/dlls/msvcrt/except_x86_64.c wine-staging-1.9.7~ubuntu15.04.1/dlls/msvcrt/except_x86_64.c --- wine-staging-1.9.6/dlls/msvcrt/except_x86_64.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/msvcrt/except_x86_64.c 2016-04-04 18:06:32.000000000 +0000 @@ -61,6 +61,468 @@ ULONG ScopeIndex; } DISPATCHER_CONTEXT; +typedef struct +{ + int prev; + UINT handler; +} unwind_info; + +typedef struct +{ + UINT flags; + UINT type_info; + int offset; + UINT handler; + UINT frame; +} catchblock_info; +#define TYPE_FLAG_CONST 1 +#define TYPE_FLAG_VOLATILE 2 +#define TYPE_FLAG_REFERENCE 8 + +typedef struct +{ + int start_level; + int end_level; + int catch_level; + int catchblock_count; + UINT catchblock; +} tryblock_info; + +typedef struct +{ + int ip; + int state; +} ipmap_info; + +typedef struct __cxx_function_descr +{ + UINT magic; + UINT unwind_count; + UINT unwind_table; + UINT tryblock_count; + UINT tryblock; + UINT ipmap_count; + UINT ipmap; + UINT unwind_help; + UINT expect_list; + UINT flags; +} cxx_function_descr; + +static inline void* rva_to_ptr(UINT rva, ULONG64 base) +{ + return rva ? (void*)(base+rva) : NULL; +} + +static inline void dump_type(UINT type_rva, ULONG64 base) +{ + const cxx_type_info *type = rva_to_ptr(type_rva, base); + + TRACE("flags %x type %x %s offsets %d,%d,%d size %d copy ctor %x(%p)\n", + type->flags, type->type_info, dbgstr_type_info(rva_to_ptr(type->type_info, base)), + type->offsets.this_offset, type->offsets.vbase_descr, type->offsets.vbase_offset, + type->size, type->copy_ctor, rva_to_ptr(type->copy_ctor, base)); +} + +static void dump_exception_type(const cxx_exception_type *type, ULONG64 base) +{ + const cxx_type_info_table *type_info_table = rva_to_ptr(type->type_info_table, base); + UINT i; + + TRACE("flags %x destr %x(%p) handler %x(%p) type info %x(%p)\n", + type->flags, type->destructor, rva_to_ptr(type->destructor, base), + type->custom_handler, rva_to_ptr(type->custom_handler, base), + type->type_info_table, type_info_table); + for (i = 0; i < type_info_table->count; i++) + { + TRACE(" %d: ", i); + dump_type(type_info_table->info[i], base); + } +} + +static void dump_function_descr(const cxx_function_descr *descr, ULONG64 image_base) +{ + unwind_info *unwind_table = rva_to_ptr(descr->unwind_table, image_base); + tryblock_info *tryblock = rva_to_ptr(descr->tryblock, image_base); + ipmap_info *ipmap = rva_to_ptr(descr->ipmap, image_base); + UINT i, j; + + TRACE("magic %x\n", descr->magic); + TRACE("unwind table: %x(%p) %d\n", descr->unwind_table, unwind_table, descr->unwind_count); + for (i=0; iunwind_count; i++) + { + TRACE(" %d: prev %d func %x(%p)\n", i, unwind_table[i].prev, + unwind_table[i].handler, rva_to_ptr(unwind_table[i].handler, image_base)); + } + TRACE("try table: %x(%p) %d\n", descr->tryblock, tryblock, descr->tryblock_count); + for (i=0; itryblock_count; i++) + { + catchblock_info *catchblock = rva_to_ptr(tryblock[i].catchblock, image_base); + + TRACE(" %d: start %d end %d catchlevel %d catch %x(%p) %d\n", i, + tryblock[i].start_level, tryblock[i].end_level, + tryblock[i].catch_level, tryblock[i].catchblock, + catchblock, tryblock[i].catchblock_count); + for (j=0; jipmap, ipmap, descr->ipmap_count); + for (i=0; iipmap_count; i++) + { + TRACE(" %d: ip %x state %d\n", i, ipmap[i].ip, ipmap[i].state); + } + TRACE("unwind_help %d\n", descr->unwind_help); + if (descr->magic <= CXX_FRAME_MAGIC_VC6) return; + TRACE("expect list: %x\n", descr->expect_list); + if (descr->magic <= CXX_FRAME_MAGIC_VC7) return; + TRACE("flags: %08x\n", descr->flags); +} + +static inline int ip_to_state(ipmap_info *ipmap, UINT count, int ip) +{ + UINT low = 0, high = count-1, med; + + while (low < high) { + med = low + (high-low)/2; + + if (ipmap[med].ip <= ip && ipmap[med+1].ip > ip) + { + low = med; + break; + } + if (ipmap[med].ip < ip) low = med+1; + else high = med-1; + } + + TRACE("%x -> %d\n", ip, ipmap[low].state); + return ipmap[low].state; +} + +/* check if the exception type is caught by a given catch block, and return the type that matched */ +static const cxx_type_info *find_caught_type(cxx_exception_type *exc_type, ULONG64 exc_base, + const type_info *catch_ti, UINT catch_flags) +{ + const cxx_type_info_table *type_info_table = rva_to_ptr(exc_type->type_info_table, exc_base); + UINT i; + + for (i = 0; i < type_info_table->count; i++) + { + const cxx_type_info *type = rva_to_ptr(type_info_table->info[i], exc_base); + const type_info *ti = rva_to_ptr(type->type_info, exc_base); + + if (!catch_ti) return type; /* catch(...) matches any type */ + if (catch_ti != ti) + { + if (strcmp( catch_ti->mangled, ti->mangled )) continue; + } + /* type is the same, now check the flags */ + if ((exc_type->flags & TYPE_FLAG_CONST) && + !(catch_flags & TYPE_FLAG_CONST)) continue; + if ((exc_type->flags & TYPE_FLAG_VOLATILE) && + !(catch_flags & TYPE_FLAG_VOLATILE)) continue; + return type; /* it matched */ + } + return NULL; +} + +static inline void copy_exception(void *object, ULONG64 frame, + DISPATCHER_CONTEXT *dispatch, + const catchblock_info *catchblock, + const cxx_type_info *type) +{ + const type_info *catch_ti = rva_to_ptr(catchblock->type_info, dispatch->ImageBase); + void **dest = rva_to_ptr(catchblock->offset, frame); + + if (!catch_ti || !catch_ti->mangled[0]) return; + if (!catchblock->offset) return; + + if (catchblock->flags & TYPE_FLAG_REFERENCE) + { + *dest = get_this_pointer(&type->offsets, object); + } + else if (type->flags & CLASS_IS_SIMPLE_TYPE) + { + memmove(dest, object, type->size); + /* if it is a pointer, adjust it */ + if (type->size == sizeof(void*)) *dest = get_this_pointer(&type->offsets, *dest); + } + else /* copy the object */ + { + if (type->copy_ctor) + { + if (type->flags & CLASS_HAS_VIRTUAL_BASE_CLASS) + { + void (__cdecl *copy_ctor)(void*, void*, int) = + rva_to_ptr(type->copy_ctor, dispatch->ImageBase); + copy_ctor(dest, get_this_pointer(&type->offsets, object), 1); + } + else + { + void (__cdecl *copy_ctor)(void*, void*) = + rva_to_ptr(type->copy_ctor, dispatch->ImageBase); + copy_ctor(dest, get_this_pointer(&type->offsets, object)); + } + } + else + memmove(dest, get_this_pointer(&type->offsets,object), type->size); + } +} + +static void cxx_local_unwind(ULONG64 frame, DISPATCHER_CONTEXT *dispatch, + const cxx_function_descr *descr, int last_level) +{ + const unwind_info *unwind_table = rva_to_ptr(descr->unwind_table, dispatch->ImageBase); + void (__cdecl *handler)(ULONG64 unk, ULONG64 rbp); + int *unwind_help = rva_to_ptr(descr->unwind_help, frame); + int trylevel; + + if (unwind_help[0] == -2) + { + trylevel = ip_to_state(rva_to_ptr(descr->ipmap, dispatch->ImageBase), + descr->ipmap_count, dispatch->ControlPc-dispatch->ImageBase); + } + else + { + trylevel = unwind_help[0]; + } + + TRACE("current level: %d, last level: %d\n", trylevel, last_level); + while (trylevel != last_level) + { + if (trylevel<0 || trylevel>=descr->unwind_count) + { + ERR("invalid trylevel %d\n", trylevel); + MSVCRT_terminate(); + } + handler = rva_to_ptr(unwind_table[trylevel].handler, dispatch->ImageBase); + if (handler) + { + TRACE("handler: %p\n", handler); + handler(0, frame); + } + trylevel = unwind_table[trylevel].prev; + } + unwind_help[0] = last_level; +} + +static inline void* WINAPI call_catch_block(EXCEPTION_RECORD *rec) +{ + ULONG64 frame = rec->ExceptionInformation[1]; + const cxx_function_descr *descr = (void*)rec->ExceptionInformation[2]; + EXCEPTION_RECORD *prev_rec = (void*)rec->ExceptionInformation[4]; + void* (__cdecl *handler)(ULONG64 unk, ULONG64 rbp) = (void*)rec->ExceptionInformation[5]; + int *unwind_help = rva_to_ptr(descr->unwind_help, frame); + cxx_frame_info frame_info; + void *ret_addr; + + TRACE("calling handler %p\n", handler); + + /* FIXME: native does local_unwind here in case of exception rethrow */ + __CxxRegisterExceptionObject(&prev_rec, &frame_info); + ret_addr = handler(0, frame); + __CxxUnregisterExceptionObject(&frame_info, FALSE); + unwind_help[0] = -2; + unwind_help[1] = -1; + return ret_addr; +} + +static inline void find_catch_block(EXCEPTION_RECORD *rec, ULONG64 frame, + DISPATCHER_CONTEXT *dispatch, + const cxx_function_descr *descr, + cxx_exception_type *info) +{ + ULONG64 exc_base = (rec->NumberParameters == 4 ? rec->ExceptionInformation[3] : 0); + int trylevel = ip_to_state(rva_to_ptr(descr->ipmap, dispatch->ImageBase), + descr->ipmap_count, dispatch->ControlPc-dispatch->ImageBase); + EXCEPTION_RECORD catch_record; + CONTEXT context; + UINT i, j; + ULONG64 orig_frame = frame, throw_base; + DWORD throw_func_off; + void *throw_func; + INT *unwind_help; + + /* update orig_frame if it's a nested exception */ + throw_func_off = RtlLookupFunctionEntry(dispatch->ControlPc, &throw_base, NULL)->BeginAddress; + throw_func = rva_to_ptr(throw_func_off, throw_base); + TRACE("reconstructed handler pointer: %p\n", throw_func); + for (i=descr->tryblock_count; i>0; i--) + { + const tryblock_info *tryblock = rva_to_ptr(descr->tryblock, dispatch->ImageBase); + tryblock = &tryblock[i-1]; + + if (trylevel>tryblock->end_level && trylevel<=tryblock->catch_level) + { + for (j=0; jcatchblock_count; j++) + { + /* TODO: is it possible to have the same handler for multiple catch blocks? */ + const catchblock_info *catchblock = rva_to_ptr(tryblock->catchblock, dispatch->ImageBase); + catchblock = &catchblock[j]; + + if (rva_to_ptr(catchblock->handler, dispatch->ImageBase) == throw_func) + { + TRACE("nested exception detected\n"); + orig_frame = *(ULONG64*)rva_to_ptr(catchblock->frame, frame); + TRACE("setting orig_frame to %lx\n", orig_frame); + } + } + } + } + + unwind_help = rva_to_ptr(descr->unwind_help, orig_frame); + unwind_help[0] = trylevel; + TRACE("current trylevel: %d, last catch block: %d\n", trylevel, unwind_help[1]); + + for (i=0; itryblock_count; i++) + { + const tryblock_info *tryblock = rva_to_ptr(descr->tryblock, dispatch->ImageBase); + tryblock = &tryblock[i]; + + if (unwind_help[1] != -1) + { + if (unwind_help[1] < tryblock->start_level) continue; + if (unwind_help[1] > tryblock->end_level) continue; + } + + if (trylevel < tryblock->start_level) continue; + if (trylevel > tryblock->end_level) continue; + + /* got a try block */ + for (j=0; jcatchblock_count; j++) + { + const catchblock_info *catchblock = rva_to_ptr(tryblock->catchblock, dispatch->ImageBase); + catchblock = &catchblock[j]; + + if (info) + { + const cxx_type_info *type = find_caught_type(info, exc_base, + rva_to_ptr(catchblock->type_info, dispatch->ImageBase), + catchblock->flags); + if (!type) continue; + + TRACE("matched type %p in tryblock %d catchblock %d\n", type, i, j); + + /* copy the exception to its destination on the stack */ + copy_exception((void*)rec->ExceptionInformation[1], + orig_frame, dispatch, catchblock, type); + } + else + { + /* no CXX_EXCEPTION only proceed with a catch(...) block*/ + if (catchblock->type_info) + continue; + TRACE("found catch(...) block\n"); + } + + unwind_help[1] = tryblock->end_level+1; + + /* unwind stack and call catch */ + memset(&catch_record, 0, sizeof(catch_record)); + catch_record.ExceptionCode = STATUS_UNWIND_CONSOLIDATE; + catch_record.ExceptionFlags = EXCEPTION_NONCONTINUABLE; + catch_record.NumberParameters = 6; + catch_record.ExceptionInformation[0] = (ULONG_PTR)call_catch_block; + catch_record.ExceptionInformation[1] = orig_frame; + catch_record.ExceptionInformation[2] = (ULONG_PTR)descr; + catch_record.ExceptionInformation[3] = tryblock->start_level; + catch_record.ExceptionInformation[4] = (ULONG_PTR)rec; + catch_record.ExceptionInformation[5] = + (ULONG_PTR)rva_to_ptr(catchblock->handler, dispatch->ImageBase); + RtlUnwindEx((void*)orig_frame, 0, &catch_record, NULL, &context, NULL); + } + } + + TRACE("no matching catch block found\n"); +} + +static DWORD cxx_frame_handler(EXCEPTION_RECORD *rec, ULONG64 frame, + CONTEXT *context, DISPATCHER_CONTEXT *dispatch, + const cxx_function_descr *descr) +{ + cxx_exception_type *exc_type; + + if (descr->magicmagic>CXX_FRAME_MAGIC_VC8) + { + FIXME("unhandled frame magic %x\n", descr->magic); + return ExceptionContinueSearch; + } + + if (rec->ExceptionFlags & (EH_UNWINDING|EH_EXIT_UNWIND)) + { + if (rec->ExceptionCode==STATUS_UNWIND_CONSOLIDATE && rec->NumberParameters==6 && + rec->ExceptionInformation[0]==(ULONG_PTR)call_catch_block) + { + ULONG64 orig_frame = rec->ExceptionInformation[1]; + const cxx_function_descr *descr = (void*)rec->ExceptionInformation[2]; + int end_level = rec->ExceptionInformation[3]; + frame_info *cur; + + cxx_local_unwind(orig_frame, dispatch, descr, end_level); + + /* FIXME: we should only unregister frames registered by call_catch_block here */ + for (cur = msvcrt_get_thread_data()->frame_info_head; cur; cur = cur->next) + { + if ((ULONG64)cur > frame) + __CxxUnregisterExceptionObject((cxx_frame_info*)cur, FALSE); + } + return ExceptionContinueSearch; + } + + cxx_local_unwind(frame, dispatch, descr, -1); + return ExceptionContinueSearch; + } + if (!descr->tryblock_count) return ExceptionContinueSearch; + + if (rec->ExceptionCode == CXX_EXCEPTION && + rec->ExceptionInformation[1] == 0 && rec->ExceptionInformation[2] == 0) + { + *rec = *msvcrt_get_thread_data()->exc_record; + rec->ExceptionFlags &= ~EH_UNWINDING; + if (TRACE_ON(seh)) { + TRACE("detect rethrow: exception code: %x\n", rec->ExceptionCode); + if (rec->ExceptionCode == CXX_EXCEPTION) + TRACE("re-propage: obj: %lx, type: %lx\n", + rec->ExceptionInformation[1], rec->ExceptionInformation[2]); + } + } + + if (rec->ExceptionCode == CXX_EXCEPTION) + { + exc_type = (cxx_exception_type *)rec->ExceptionInformation[2]; + + if (TRACE_ON(seh)) + { + TRACE("handling C++ exception rec %p frame %lx descr %p\n", rec, frame, descr); + dump_exception_type(exc_type, rec->ExceptionInformation[3]); + dump_function_descr(descr, dispatch->ImageBase); + } + } + else + { + thread_data_t *data = msvcrt_get_thread_data(); + + exc_type = NULL; + TRACE("handling C exception code %x rec %p frame %lx descr %p\n", + rec->ExceptionCode, rec, frame, descr); + + if (data->se_translator) { + EXCEPTION_POINTERS except_ptrs; + + except_ptrs.ExceptionRecord = rec; + except_ptrs.ContextRecord = context; + data->se_translator(rec->ExceptionCode, &except_ptrs); + } + } + + find_catch_block(rec, frame, dispatch, descr, exc_type); + return ExceptionContinueSearch; +} + /********************************************************************* * __CxxExceptionFilter (MSVCRT.@) */ @@ -77,8 +539,9 @@ EXCEPTION_DISPOSITION CDECL __CxxFrameHandler( EXCEPTION_RECORD *rec, ULONG64 frame, CONTEXT *context, DISPATCHER_CONTEXT *dispatch ) { - FIXME( "%p %lx %p %p: not implemented\n", rec, frame, context, dispatch ); - return ExceptionContinueSearch; + TRACE( "%p %lx %p %p\n", rec, frame, context, dispatch ); + return cxx_frame_handler( rec, frame, context, dispatch, + rva_to_ptr(*(UINT*)dispatch->HandlerData, dispatch->ImageBase) ); } @@ -106,7 +569,7 @@ rec = ptrs->ExceptionRecord; if (rec->ExceptionCode == CXX_EXCEPTION && - rec->NumberParameters == 3 && + rec->NumberParameters == 4 && rec->ExceptionInformation[0] == CXX_FRAME_MAGIC_VC6 && rec->ExceptionInformation[2]) { diff -Nru wine-staging-1.9.6/dlls/msvcrt/math.c wine-staging-1.9.7~ubuntu15.04.1/dlls/msvcrt/math.c --- wine-staging-1.9.6/dlls/msvcrt/math.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/msvcrt/math.c 2016-04-04 18:06:32.000000000 +0000 @@ -2743,3 +2743,37 @@ return signbit(x) ? x : y; return xdata = heap_alloc(initial_len); if (!buffer->data) return E_OUTOFMEMORY; @@ -281,121 +276,202 @@ return S_OK; } -static HRESULT alloc_output_buffer(xml_encoding encoding, output_buffer **buffer) +static HRESULT init_output_buffer(xml_encoding encoding, output_buffer *buffer) { - output_buffer *ret; HRESULT hr; - ret = heap_alloc(sizeof(*ret)); - if (!ret) return E_OUTOFMEMORY; - - hr = get_code_page(encoding, &ret->code_page); - if (hr != S_OK) { - heap_free(ret); + hr = get_code_page(encoding, &buffer->code_page); + if (hr != S_OK) return hr; - } - hr = init_encoded_buffer(&ret->utf16); - if (hr != S_OK) { - heap_free(ret); + hr = init_encoded_buffer(&buffer->encoded); + if (hr != S_OK) return hr; - } - /* currently we always create a default output buffer that is UTF-16 only, - but it's possible to allocate with specific encoding too */ - if (encoding != XmlEncoding_UTF16) { - hr = init_encoded_buffer(&ret->encoded); - if (hr != S_OK) { - free_encoded_buffer(&ret->utf16); - heap_free(ret); - return hr; - } - } - else - memset(&ret->encoded, 0, sizeof(ret->encoded)); - - *buffer = ret; + list_init(&buffer->blocks); + buffer->utf16_total = 0; return S_OK; } static void free_output_buffer(output_buffer *buffer) { + encoded_buffer *cur, *cur2; + free_encoded_buffer(&buffer->encoded); - free_encoded_buffer(&buffer->utf16); - heap_free(buffer); -} -static void grow_buffer(encoded_buffer *buffer, int length) -{ - /* grow if needed, plus 4 bytes to be sure null terminator will fit in */ - if (buffer->allocated < buffer->written + length + 4) + LIST_FOR_EACH_ENTRY_SAFE(cur, cur2, &buffer->blocks, encoded_buffer, entry) { - int grown_size = max(2*buffer->allocated, buffer->allocated + length); - buffer->data = heap_realloc(buffer->data, grown_size); - buffer->allocated = grown_size; + list_remove(&cur->entry); + free_encoded_buffer(cur); + heap_free(cur); } } -static HRESULT write_output_buffer_mode(output_buffer *buffer, output_mode mode, const WCHAR *data, int len) +static HRESULT write_output_buffer(mxwriter *writer, const WCHAR *data, int len) { - int length; - char *ptr; + output_buffer *buffer = &writer->buffer; + encoded_buffer *buff; + unsigned int written; + int src_len; + + if (!len || !*data) + return S_OK; + + src_len = len == -1 ? strlenW(data) : len; + if (writer->dest) + { + buff = &buffer->encoded; - if (mode & (OutputBuffer_Encoded | OutputBuffer_Both)) { - if (buffer->code_page != ~0) + if (buffer->code_page == ~0) { - length = WideCharToMultiByte(buffer->code_page, 0, data, len, NULL, 0, NULL, NULL); - grow_buffer(&buffer->encoded, length); - ptr = buffer->encoded.data + buffer->encoded.written; - length = WideCharToMultiByte(buffer->code_page, 0, data, len, ptr, length, NULL, NULL); - buffer->encoded.written += len == -1 ? length-1 : length; + unsigned int avail = buff->allocated - buff->written; + + src_len *= sizeof(WCHAR); + written = min(avail, src_len); + + /* fill internal buffer first */ + if (avail) + { + memcpy(buff->data + buff->written, data, written); + data += written / sizeof(WCHAR); + buff->written += written; + avail -= written; + src_len -= written; + } + + if (!avail) + { + IStream_Write(writer->dest, buff->data, buff->written, &written); + buff->written = 0; + if (src_len >= buff->allocated) + IStream_Write(writer->dest, data, src_len, &written); + else if (src_len) + { + memcpy(buff->data, data, src_len); + buff->written += src_len; + } + } + } + else + { + unsigned int avail = buff->allocated - buff->written; + int length; + + length = WideCharToMultiByte(buffer->code_page, 0, data, src_len, NULL, 0, NULL, NULL); + if (avail >= length) + { + length = WideCharToMultiByte(buffer->code_page, 0, data, src_len, buff->data + buff->written, length, NULL, NULL); + buff->written += length; + } + else + { + /* drain what we go so far */ + if (buff->written) + { + IStream_Write(writer->dest, buff->data, buff->written, &written); + buff->written = 0; + avail = buff->allocated; + } + + if (avail >= length) + { + length = WideCharToMultiByte(buffer->code_page, 0, data, src_len, buff->data + buff->written, length, NULL, NULL); + buff->written += length; + } + else + { + char *mb; + + /* if current chunk is larger than total buffer size, convert it at once using temporary allocated buffer */ + mb = heap_alloc(length); + if (!mb) + return E_OUTOFMEMORY; + + length = WideCharToMultiByte(buffer->code_page, 0, data, src_len, mb, length, NULL, NULL); + IStream_Write(writer->dest, mb, length, &written); + heap_free(mb); + } + } } } + /* When writer has no output set we have to accumulate everything to return it later in a form of BSTR. + To achieve that: - if (mode & (OutputBuffer_Native | OutputBuffer_Both)) { - /* WCHAR data just copied */ - length = len == -1 ? strlenW(data) : len; - if (length) + - fill a buffer already allocated as part of output buffer; + - when current buffer is full, allocate another one and switch to it; buffers themselves never grow, + but are linked together, with head pointing to first allocated buffer after initial one got filled; + - later during get_output() contents are concatenated by copying one after another to destination BSTR buffer, + that's returned to the client. */ + else + { + /* select last used block */ + if (list_empty(&buffer->blocks)) + buff = &buffer->encoded; + else + buff = LIST_ENTRY(list_tail(&buffer->blocks), encoded_buffer, entry); + + src_len *= sizeof(WCHAR); + while (src_len) { - length *= sizeof(WCHAR); + unsigned int avail = buff->allocated - buff->written; + unsigned int written = min(avail, src_len); - grow_buffer(&buffer->utf16, length); - ptr = buffer->utf16.data + buffer->utf16.written; + if (avail) + { + memcpy(buff->data + buff->written, data, written); + buff->written += written; + buffer->utf16_total += written; + src_len -= written; + } + + /* alloc new block if needed and retry */ + if (src_len) + { + encoded_buffer *next = heap_alloc(sizeof(*next)); + HRESULT hr; - memcpy(ptr, data, length); - buffer->utf16.written += length; - ptr += length; - /* null termination */ - memset(ptr, 0, sizeof(WCHAR)); + if (FAILED(hr = init_encoded_buffer(next))) { + heap_free(next); + return hr; + } + + list_add_tail(&buffer->blocks, &next->entry); + buff = next; + } } } return S_OK; } -static HRESULT write_output_buffer(output_buffer *buffer, const WCHAR *data, int len) +static HRESULT write_output_buffer_quoted(mxwriter *writer, const WCHAR *data, int len) { - return write_output_buffer_mode(buffer, OutputBuffer_Both, data, len); -} - -static HRESULT write_output_buffer_quoted(output_buffer *buffer, const WCHAR *data, int len) -{ - write_output_buffer(buffer, quotW, 1); - write_output_buffer(buffer, data, len); - write_output_buffer(buffer, quotW, 1); + write_output_buffer(writer, quotW, 1); + write_output_buffer(writer, data, len); + write_output_buffer(writer, quotW, 1); return S_OK; } /* frees buffer data, reallocates with a default lengths */ -static void close_output_buffer(mxwriter *This) +static void close_output_buffer(mxwriter *writer) { - heap_free(This->buffer->utf16.data); - heap_free(This->buffer->encoded.data); - init_encoded_buffer(&This->buffer->utf16); - init_encoded_buffer(&This->buffer->encoded); - get_code_page(This->xml_enc, &This->buffer->code_page); + encoded_buffer *cur, *cur2; + + heap_free(writer->buffer.encoded.data); + + LIST_FOR_EACH_ENTRY_SAFE(cur, cur2, &writer->buffer.blocks, encoded_buffer, entry) + { + list_remove(&cur->entry); + free_encoded_buffer(cur); + heap_free(cur); + } + + init_encoded_buffer(&writer->buffer.encoded); + get_code_page(writer->xml_enc, &writer->buffer.code_page); + writer->buffer.utf16_total = 0; + list_init(&writer->buffer.blocks); } /* Escapes special characters like: @@ -470,7 +546,7 @@ return ret; } -static void write_prolog_buffer(mxwriter *This) +static void write_prolog_buffer(mxwriter *writer) { static const WCHAR versionW[] = {'<','?','x','m','l',' ','v','e','r','s','i','o','n','='}; static const WCHAR encodingW[] = {' ','e','n','c','o','d','i','n','g','=','\"'}; @@ -479,99 +555,83 @@ static const WCHAR noW[] = {'n','o','\"','?','>'}; /* version */ - write_output_buffer(This->buffer, versionW, sizeof(versionW)/sizeof(WCHAR)); - write_output_buffer_quoted(This->buffer, This->version, -1); + write_output_buffer(writer, versionW, sizeof(versionW)/sizeof(WCHAR)); + write_output_buffer_quoted(writer, writer->version, -1); /* encoding */ - write_output_buffer(This->buffer, encodingW, sizeof(encodingW)/sizeof(WCHAR)); + write_output_buffer(writer, encodingW, sizeof(encodingW)/sizeof(WCHAR)); - /* always write UTF-16 to WCHAR buffer */ - write_output_buffer_mode(This->buffer, OutputBuffer_Native, utf16W, sizeof(utf16W)/sizeof(WCHAR) - 1); - write_output_buffer_mode(This->buffer, OutputBuffer_Encoded, This->encoding, -1); - write_output_buffer(This->buffer, quotW, 1); + if (writer->dest) + write_output_buffer(writer, writer->encoding, -1); + else + write_output_buffer(writer, utf16W, sizeof(utf16W)/sizeof(WCHAR) - 1); + write_output_buffer(writer, quotW, 1); /* standalone */ - write_output_buffer(This->buffer, standaloneW, sizeof(standaloneW)/sizeof(WCHAR)); - if (This->props[MXWriter_Standalone] == VARIANT_TRUE) - write_output_buffer(This->buffer, yesW, sizeof(yesW)/sizeof(WCHAR)); + write_output_buffer(writer, standaloneW, sizeof(standaloneW)/sizeof(WCHAR)); + if (writer->props[MXWriter_Standalone] == VARIANT_TRUE) + write_output_buffer(writer, yesW, sizeof(yesW)/sizeof(WCHAR)); else - write_output_buffer(This->buffer, noW, sizeof(noW)/sizeof(WCHAR)); + write_output_buffer(writer, noW, sizeof(noW)/sizeof(WCHAR)); - write_output_buffer(This->buffer, crlfW, sizeof(crlfW)/sizeof(WCHAR)); - This->newline = TRUE; + write_output_buffer(writer, crlfW, sizeof(crlfW)/sizeof(WCHAR)); + writer->newline = TRUE; } /* Attempts to the write data from the mxwriter's buffer to * the destination stream (if there is one). */ -static HRESULT write_data_to_stream(mxwriter *This) +static HRESULT write_data_to_stream(mxwriter *writer) { - encoded_buffer *buffer; + encoded_buffer *buffer = &writer->buffer.encoded; ULONG written = 0; - HRESULT hr; - if (!This->dest) + if (!writer->dest) return S_OK; - if (This->xml_enc != XmlEncoding_UTF16) - buffer = &This->buffer->encoded; + if (buffer->written == 0) + { + if (writer->xml_enc == XmlEncoding_UTF8) + IStream_Write(writer->dest, buffer->data, 0, &written); + } else - buffer = &This->buffer->utf16; - - if (This->dest_written > buffer->written) { - ERR("Failed sanity check! Not sure what to do... (%d > %d)\n", This->dest_written, buffer->written); - return E_FAIL; - } else if (This->dest_written == buffer->written && This->xml_enc != XmlEncoding_UTF8) - /* Windows seems to make an empty write call when the encoding is UTF-8 and - * all the data has been written to the stream. It doesn't seem make this call - * for any other encodings. - */ - return S_OK; - - /* Write the current content from the output buffer into 'dest'. - * TODO: Check what Windows does if the IStream doesn't write all of - * the data we give it at once. - */ - hr = IStream_Write(This->dest, buffer->data+This->dest_written, - buffer->written-This->dest_written, &written); - if (FAILED(hr)) { - WARN("Failed to write data to IStream (0x%08x)\n", hr); - return hr; + { + IStream_Write(writer->dest, buffer->data, buffer->written, &written); + buffer->written = 0; } - This->dest_written += written; - return hr; + return S_OK; } /* Newly added element start tag left unclosed cause for empty elements we have to close it differently. */ -static void close_element_starttag(const mxwriter *This) +static void close_element_starttag(mxwriter *writer) { static const WCHAR gtW[] = {'>'}; - if (!This->element) return; - write_output_buffer(This->buffer, gtW, 1); + if (!writer->element) return; + write_output_buffer(writer, gtW, 1); } -static void write_node_indent(mxwriter *This) +static void write_node_indent(mxwriter *writer) { static const WCHAR tabW[] = {'\t'}; - int indent = This->indent; + int indent = writer->indent; - if (!This->props[MXWriter_Indent] || This->text) + if (!writer->props[MXWriter_Indent] || writer->text) { - This->text = FALSE; + writer->text = FALSE; return; } /* This is to workaround PI output logic that always puts newline chars, document prolog PI does that too. */ - if (!This->newline) - write_output_buffer(This->buffer, crlfW, sizeof(crlfW)/sizeof(WCHAR)); + if (!writer->newline) + write_output_buffer(writer, crlfW, sizeof(crlfW)/sizeof(WCHAR)); while (indent--) - write_output_buffer(This->buffer, tabW, 1); + write_output_buffer(writer, tabW, 1); - This->newline = FALSE; - This->text = FALSE; + writer->newline = FALSE; + writer->text = FALSE; } static inline void writer_inc_indent(mxwriter *This) @@ -610,7 +670,6 @@ static inline void reset_output_buffer(mxwriter *This) { close_output_buffer(This); - This->dest_written = 0; } static HRESULT writer_set_property(mxwriter *writer, mxwriter_prop property, VARIANT_BOOL value) @@ -772,7 +831,7 @@ { /* Windows flushes the buffer when the interface is destroyed. */ flush_output_buffer(This); - free_output_buffer(This->buffer); + free_output_buffer(&This->buffer); if (This->dest) IStream_Release(This->dest); SysFreeString(This->version); @@ -876,22 +935,43 @@ if (!dest) return E_POINTER; - if (!This->dest) + if (This->dest) { - HRESULT hr = flush_output_buffer(This); + /* we only support IStream output so far */ + V_VT(dest) = VT_UNKNOWN; + V_UNKNOWN(dest) = (IUnknown*)This->dest; + IStream_AddRef(This->dest); + } + else + { + encoded_buffer *buff; + char *dest_ptr; + HRESULT hr; + + hr = flush_output_buffer(This); if (FAILED(hr)) return hr; V_VT(dest) = VT_BSTR; - V_BSTR(dest) = SysAllocString((WCHAR*)This->buffer->utf16.data); + V_BSTR(dest) = SysAllocStringLen(NULL, This->buffer.utf16_total / sizeof(WCHAR)); + if (!V_BSTR(dest)) + return E_OUTOFMEMORY; - return S_OK; - } + dest_ptr = (char*)V_BSTR(dest); + buff = &This->buffer.encoded; + + if (buff->written) + { + memcpy(dest_ptr, buff->data, buff->written); + dest_ptr += buff->written; + } - /* we only support IStream output so far */ - V_VT(dest) = VT_UNKNOWN; - V_UNKNOWN(dest) = (IUnknown*)This->dest; - IStream_AddRef(This->dest); + LIST_FOR_EACH_ENTRY(buff, &This->buffer.blocks, encoded_buffer, entry) + { + memcpy(dest_ptr, buff->data, buff->written); + dest_ptr += buff->written; + } + } return S_OK; } @@ -1177,18 +1257,18 @@ static const WCHAR eqW[] = {'='}; /* space separator in front of every attribute */ - write_output_buffer(writer->buffer, spaceW, 1); - write_output_buffer(writer->buffer, qname, qname_len); - write_output_buffer(writer->buffer, eqW, 1); + write_output_buffer(writer, spaceW, 1); + write_output_buffer(writer, qname, qname_len); + write_output_buffer(writer, eqW, 1); if (escape) { WCHAR *escaped = get_escaped_string(value, EscapeValue, &value_len); - write_output_buffer_quoted(writer->buffer, escaped, value_len); + write_output_buffer_quoted(writer, escaped, value_len); heap_free(escaped); } else - write_output_buffer_quoted(writer->buffer, value, value_len); + write_output_buffer_quoted(writer, value, value_len); } static void mxwriter_write_starttag(mxwriter *writer, const WCHAR *qname, int len) @@ -1200,8 +1280,8 @@ write_node_indent(writer); - write_output_buffer(writer->buffer, ltW, 1); - write_output_buffer(writer->buffer, qname ? qname : emptyW, qname ? len : 0); + write_output_buffer(writer, ltW, 1); + write_output_buffer(writer, qname ? qname : emptyW, qname ? len : 0); writer_inc_indent(writer); } @@ -1278,7 +1358,7 @@ if (This->element) { static const WCHAR closeW[] = {'/','>'}; - write_output_buffer(This->buffer, closeW, 2); + write_output_buffer(This, closeW, 2); } else { @@ -1286,9 +1366,9 @@ static const WCHAR gtW[] = {'>'}; write_node_indent(This); - write_output_buffer(This->buffer, closetagW, 2); - write_output_buffer(This->buffer, QName, nQName); - write_output_buffer(This->buffer, gtW, 1); + write_output_buffer(This, closetagW, 2); + write_output_buffer(This, QName, nQName); + write_output_buffer(This, gtW, 1); } set_element_name(This, NULL, 0); @@ -1316,14 +1396,14 @@ if (nchars) { if (This->cdata || This->props[MXWriter_DisableEscaping] == VARIANT_TRUE) - write_output_buffer(This->buffer, chars, nchars); + write_output_buffer(This, chars, nchars); else { int len = nchars; WCHAR *escaped; escaped = get_escaped_string(chars, EscapeText, &len); - write_output_buffer(This->buffer, escaped, len); + write_output_buffer(This, escaped, len); heap_free(escaped); } } @@ -1342,7 +1422,7 @@ if (!chars) return E_INVALIDARG; - write_output_buffer(This->buffer, chars, nchars); + write_output_buffer(This, chars, nchars); return S_OK; } @@ -1363,18 +1443,18 @@ if (!target) return E_INVALIDARG; write_node_indent(This); - write_output_buffer(This->buffer, openpiW, sizeof(openpiW)/sizeof(WCHAR)); + write_output_buffer(This, openpiW, sizeof(openpiW)/sizeof(WCHAR)); if (*target) - write_output_buffer(This->buffer, target, ntarget); + write_output_buffer(This, target, ntarget); if (data && *data && ndata) { - write_output_buffer(This->buffer, spaceW, 1); - write_output_buffer(This->buffer, data, ndata); + write_output_buffer(This, spaceW, 1); + write_output_buffer(This, data, ndata); } - write_output_buffer(This->buffer, closepiW, sizeof(closepiW)/sizeof(WCHAR)); + write_output_buffer(This, closepiW, sizeof(closepiW)/sizeof(WCHAR)); This->newline = TRUE; return S_OK; @@ -1442,42 +1522,42 @@ if (!name) return E_INVALIDARG; - write_output_buffer(This->buffer, doctypeW, sizeof(doctypeW)/sizeof(WCHAR)); + write_output_buffer(This, doctypeW, sizeof(doctypeW)/sizeof(WCHAR)); if (*name) { - write_output_buffer(This->buffer, name, name_len); - write_output_buffer(This->buffer, spaceW, 1); + write_output_buffer(This, name, name_len); + write_output_buffer(This, spaceW, 1); } if (publicId) { static const WCHAR publicW[] = {'P','U','B','L','I','C',' '}; - write_output_buffer(This->buffer, publicW, sizeof(publicW)/sizeof(WCHAR)); - write_output_buffer_quoted(This->buffer, publicId, publicId_len); + write_output_buffer(This, publicW, sizeof(publicW)/sizeof(WCHAR)); + write_output_buffer_quoted(This, publicId, publicId_len); if (!systemId) return E_INVALIDARG; if (*publicId) - write_output_buffer(This->buffer, spaceW, 1); + write_output_buffer(This, spaceW, 1); - write_output_buffer_quoted(This->buffer, systemId, systemId_len); + write_output_buffer_quoted(This, systemId, systemId_len); if (*systemId) - write_output_buffer(This->buffer, spaceW, 1); + write_output_buffer(This, spaceW, 1); } else if (systemId) { static const WCHAR systemW[] = {'S','Y','S','T','E','M',' '}; - write_output_buffer(This->buffer, systemW, sizeof(systemW)/sizeof(WCHAR)); - write_output_buffer_quoted(This->buffer, systemId, systemId_len); + write_output_buffer(This, systemW, sizeof(systemW)/sizeof(WCHAR)); + write_output_buffer_quoted(This, systemId, systemId_len); if (*systemId) - write_output_buffer(This->buffer, spaceW, 1); + write_output_buffer(This, spaceW, 1); } - write_output_buffer(This->buffer, openintW, sizeof(openintW)/sizeof(WCHAR)); + write_output_buffer(This, openintW, sizeof(openintW)/sizeof(WCHAR)); return S_OK; } @@ -1489,7 +1569,7 @@ TRACE("(%p)\n", This); - write_output_buffer(This->buffer, closedtdW, sizeof(closedtdW)/sizeof(WCHAR)); + write_output_buffer(This, closedtdW, sizeof(closedtdW)/sizeof(WCHAR)); return S_OK; } @@ -1516,7 +1596,7 @@ TRACE("(%p)\n", This); write_node_indent(This); - write_output_buffer(This->buffer, scdataW, sizeof(scdataW)/sizeof(WCHAR)); + write_output_buffer(This, scdataW, sizeof(scdataW)/sizeof(WCHAR)); This->cdata = TRUE; return S_OK; @@ -1529,7 +1609,7 @@ TRACE("(%p)\n", This); - write_output_buffer(This->buffer, ecdataW, sizeof(ecdataW)/sizeof(WCHAR)); + write_output_buffer(This, ecdataW, sizeof(ecdataW)/sizeof(WCHAR)); This->cdata = FALSE; return S_OK; @@ -1548,10 +1628,10 @@ close_element_starttag(This); write_node_indent(This); - write_output_buffer(This->buffer, copenW, sizeof(copenW)/sizeof(WCHAR)); + write_output_buffer(This, copenW, sizeof(copenW)/sizeof(WCHAR)); if (nchars) - write_output_buffer(This->buffer, chars, nchars); - write_output_buffer(This->buffer, ccloseW, sizeof(ccloseW)/sizeof(WCHAR)); + write_output_buffer(This, chars, nchars); + write_output_buffer(This, ccloseW, sizeof(ccloseW)/sizeof(WCHAR)); return S_OK; } @@ -1601,14 +1681,14 @@ if (!name || !model) return E_INVALIDARG; - write_output_buffer(This->buffer, elementW, sizeof(elementW)/sizeof(WCHAR)); + write_output_buffer(This, elementW, sizeof(elementW)/sizeof(WCHAR)); if (n_name) { - write_output_buffer(This->buffer, name, n_name); - write_output_buffer(This->buffer, spaceW, sizeof(spaceW)/sizeof(WCHAR)); + write_output_buffer(This, name, n_name); + write_output_buffer(This, spaceW, sizeof(spaceW)/sizeof(WCHAR)); } if (n_model) - write_output_buffer(This->buffer, model, n_model); - write_output_buffer(This->buffer, closetagW, sizeof(closetagW)/sizeof(WCHAR)); + write_output_buffer(This, model, n_model); + write_output_buffer(This, closetagW, sizeof(closetagW)/sizeof(WCHAR)); return S_OK; } @@ -1626,31 +1706,31 @@ debugstr_wn(attr, n_attr), n_attr, debugstr_wn(type, n_type), n_type, debugstr_wn(Default, n_default), n_default, debugstr_wn(value, n_value), n_value); - write_output_buffer(This->buffer, attlistW, sizeof(attlistW)/sizeof(WCHAR)); + write_output_buffer(This, attlistW, sizeof(attlistW)/sizeof(WCHAR)); if (n_element) { - write_output_buffer(This->buffer, element, n_element); - write_output_buffer(This->buffer, spaceW, sizeof(spaceW)/sizeof(WCHAR)); + write_output_buffer(This, element, n_element); + write_output_buffer(This, spaceW, sizeof(spaceW)/sizeof(WCHAR)); } if (n_attr) { - write_output_buffer(This->buffer, attr, n_attr); - write_output_buffer(This->buffer, spaceW, sizeof(spaceW)/sizeof(WCHAR)); + write_output_buffer(This, attr, n_attr); + write_output_buffer(This, spaceW, sizeof(spaceW)/sizeof(WCHAR)); } if (n_type) { - write_output_buffer(This->buffer, type, n_type); - write_output_buffer(This->buffer, spaceW, sizeof(spaceW)/sizeof(WCHAR)); + write_output_buffer(This, type, n_type); + write_output_buffer(This, spaceW, sizeof(spaceW)/sizeof(WCHAR)); } if (n_default) { - write_output_buffer(This->buffer, Default, n_default); - write_output_buffer(This->buffer, spaceW, sizeof(spaceW)/sizeof(WCHAR)); + write_output_buffer(This, Default, n_default); + write_output_buffer(This, spaceW, sizeof(spaceW)/sizeof(WCHAR)); } if (n_value) - write_output_buffer_quoted(This->buffer, value, n_value); + write_output_buffer_quoted(This, value, n_value); - write_output_buffer(This->buffer, closetagW, sizeof(closetagW)/sizeof(WCHAR)); + write_output_buffer(This, closetagW, sizeof(closetagW)/sizeof(WCHAR)); return S_OK; } @@ -1665,16 +1745,16 @@ if (!name || !value) return E_INVALIDARG; - write_output_buffer(This->buffer, entityW, sizeof(entityW)/sizeof(WCHAR)); + write_output_buffer(This, entityW, sizeof(entityW)/sizeof(WCHAR)); if (n_name) { - write_output_buffer(This->buffer, name, n_name); - write_output_buffer(This->buffer, spaceW, sizeof(spaceW)/sizeof(WCHAR)); + write_output_buffer(This, name, n_name); + write_output_buffer(This, spaceW, sizeof(spaceW)/sizeof(WCHAR)); } if (n_value) - write_output_buffer_quoted(This->buffer, value, n_value); + write_output_buffer_quoted(This, value, n_value); - write_output_buffer(This->buffer, closetagW, sizeof(closetagW)/sizeof(WCHAR)); + write_output_buffer(This, closetagW, sizeof(closetagW)/sizeof(WCHAR)); return S_OK; } @@ -1690,30 +1770,28 @@ TRACE("(%p)->(%s:%d %s:%d %s:%d)\n", This, debugstr_wn(name, n_name), n_name, debugstr_wn(publicId, n_publicId), n_publicId, debugstr_wn(systemId, n_systemId), n_systemId); - if (!name) return E_INVALIDARG; - if (publicId && !systemId) return E_INVALIDARG; - if (!publicId && !systemId) return E_INVALIDARG; + if (!name || !systemId) return E_INVALIDARG; - write_output_buffer(This->buffer, entityW, sizeof(entityW)/sizeof(WCHAR)); + write_output_buffer(This, entityW, sizeof(entityW)/sizeof(WCHAR)); if (n_name) { - write_output_buffer(This->buffer, name, n_name); - write_output_buffer(This->buffer, spaceW, sizeof(spaceW)/sizeof(WCHAR)); + write_output_buffer(This, name, n_name); + write_output_buffer(This, spaceW, sizeof(spaceW)/sizeof(WCHAR)); } if (publicId) { - write_output_buffer(This->buffer, publicW, sizeof(publicW)/sizeof(WCHAR)); - write_output_buffer_quoted(This->buffer, publicId, n_publicId); - write_output_buffer(This->buffer, spaceW, sizeof(spaceW)/sizeof(WCHAR)); - write_output_buffer_quoted(This->buffer, systemId, n_systemId); + write_output_buffer(This, publicW, sizeof(publicW)/sizeof(WCHAR)); + write_output_buffer_quoted(This, publicId, n_publicId); + write_output_buffer(This, spaceW, sizeof(spaceW)/sizeof(WCHAR)); + write_output_buffer_quoted(This, systemId, n_systemId); } else { - write_output_buffer(This->buffer, systemW, sizeof(systemW)/sizeof(WCHAR)); - write_output_buffer_quoted(This->buffer, systemId, n_systemId); + write_output_buffer(This, systemW, sizeof(systemW)/sizeof(WCHAR)); + write_output_buffer_quoted(This, systemId, n_systemId); } - write_output_buffer(This->buffer, closetagW, sizeof(closetagW)/sizeof(WCHAR)); + write_output_buffer(This, closetagW, sizeof(closetagW)/sizeof(WCHAR)); return S_OK; } @@ -2520,9 +2598,8 @@ This->newline = FALSE; This->dest = NULL; - This->dest_written = 0; - hr = alloc_output_buffer(This->xml_enc, &This->buffer); + hr = init_output_buffer(This->xml_enc, &This->buffer); if (hr != S_OK) { SysFreeString(This->encoding); SysFreeString(This->version); diff -Nru wine-staging-1.9.6/dlls/msxml3/tests/saxreader.c wine-staging-1.9.7~ubuntu15.04.1/dlls/msxml3/tests/saxreader.c --- wine-staging-1.9.6/dlls/msxml3/tests/saxreader.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/msxml3/tests/saxreader.c 2016-04-04 18:06:32.000000000 +0000 @@ -3305,7 +3305,6 @@ pos2.QuadPart = 0; hr = IStream_Seek(stream, pos, STREAM_SEEK_CUR, &pos2); EXPECT_HR(hr, S_OK); -todo_wine ok(pos2.QuadPart != 0, "unexpected stream beginning\n"); hr = IMXWriter_get_output(writer, NULL); @@ -4146,7 +4145,6 @@ V_UNKNOWN(&dest) = (IUnknown*)&mxstream; hr = IMXWriter_put_output(writer, dest); ok(hr == S_OK, "put_output failed with %08x on test %d\n", hr, current_stream_test_index); - VariantClear(&dest); hr = IMXWriter_put_byteOrderMark(writer, test->bom); ok(hr == S_OK, "put_byteOrderMark failed with %08x on test %d\n", hr, current_stream_test_index); @@ -4996,11 +4994,22 @@ _bstr_("sysid"), strlen("sysid")); ok(hr == S_OK, "got 0x%08x\n", hr); + hr = ISAXDeclHandler_externalEntityDecl(decl, _bstr_("name"), strlen("name"), NULL, 0, _bstr_("sysid"), strlen("sysid")); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ISAXDeclHandler_externalEntityDecl(decl, _bstr_("name"), strlen("name"), _bstr_("pubid"), strlen("pubid"), + NULL, 0); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + V_VT(&dest) = VT_EMPTY; hr = IMXWriter_get_output(writer, &dest); ok(hr == S_OK, "got 0x%08x\n", hr); ok(V_VT(&dest) == VT_BSTR, "got %d\n", V_VT(&dest)); - ok(!lstrcmpW(_bstr_("\r\n"), V_BSTR(&dest)), "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest))); + ok(!lstrcmpW(_bstr_( + "\r\n" + "\r\n"), + V_BSTR(&dest)), "got wrong content %s\n", wine_dbgstr_w(V_BSTR(&dest))); + VariantClear(&dest); ISAXContentHandler_Release(content); @@ -5582,7 +5591,7 @@ if(FAILED(hr)) { - skip("Failed to create SAXXMLReader instance\n"); + win_skip("Failed to create SAXXMLReader instance\n"); CoUninitialize(); return; } @@ -5632,7 +5641,7 @@ test_mxattr_dispex(); } else - skip("SAXAttributes not supported\n"); + win_skip("SAXAttributes not supported\n"); CoUninitialize(); } diff -Nru wine-staging-1.9.6/dlls/msxml3/tests/xmldoc.c wine-staging-1.9.7~ubuntu15.04.1/dlls/msxml3/tests/xmldoc.c --- wine-staging-1.9.6/dlls/msxml3/tests/xmldoc.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/msxml3/tests/xmldoc.c 2016-04-04 18:06:32.000000000 +0000 @@ -515,7 +515,7 @@ &IID_IXMLDocument, (LPVOID*)&doc); if (FAILED(hr)) { - skip("Failed to create XMLDocument instance\n"); + win_skip("Failed to create XMLDocument instance\n"); return FALSE; } diff -Nru wine-staging-1.9.6/dlls/ntdll/signal_arm64.c wine-staging-1.9.7~ubuntu15.04.1/dlls/ntdll/signal_arm64.c --- wine-staging-1.9.6/dlls/ntdll/signal_arm64.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/ntdll/signal_arm64.c 2016-04-04 18:06:32.000000000 +0000 @@ -732,7 +732,7 @@ */ int CDECL __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh) { - if (sig > sizeof(handlers) / sizeof(handlers[0])) return -1; + if (sig >= sizeof(handlers) / sizeof(handlers[0])) return -1; if (handlers[sig] != NULL) return -2; handlers[sig] = wsh; return 0; diff -Nru wine-staging-1.9.6/dlls/ntdll/signal_arm.c wine-staging-1.9.7~ubuntu15.04.1/dlls/ntdll/signal_arm.c --- wine-staging-1.9.6/dlls/ntdll/signal_arm.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/ntdll/signal_arm.c 2016-04-04 18:06:32.000000000 +0000 @@ -860,7 +860,7 @@ */ int CDECL __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh) { - if (sig > sizeof(handlers) / sizeof(handlers[0])) return -1; + if (sig >= sizeof(handlers) / sizeof(handlers[0])) return -1; if (handlers[sig] != NULL) return -2; handlers[sig] = wsh; return 0; diff -Nru wine-staging-1.9.6/dlls/ntdll/signal_powerpc.c wine-staging-1.9.7~ubuntu15.04.1/dlls/ntdll/signal_powerpc.c --- wine-staging-1.9.6/dlls/ntdll/signal_powerpc.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/ntdll/signal_powerpc.c 2016-04-04 18:06:32.000000000 +0000 @@ -940,7 +940,7 @@ */ int CDECL __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh) { - if (sig > sizeof(handlers) / sizeof(handlers[0])) return -1; + if (sig >= sizeof(handlers) / sizeof(handlers[0])) return -1; if (handlers[sig] != NULL) return -2; handlers[sig] = wsh; return 0; diff -Nru wine-staging-1.9.6/dlls/ntdll/signal_x86_64.c wine-staging-1.9.7~ubuntu15.04.1/dlls/ntdll/signal_x86_64.c --- wine-staging-1.9.6/dlls/ntdll/signal_x86_64.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/ntdll/signal_x86_64.c 2016-04-04 18:06:32.000000000 +0000 @@ -2762,7 +2762,7 @@ */ int CDECL __wine_set_signal_handler(unsigned int sig, wine_signal_handler wsh) { - if (sig > sizeof(handlers) / sizeof(handlers[0])) return -1; + if (sig >= sizeof(handlers) / sizeof(handlers[0])) return -1; if (handlers[sig] != NULL) return -2; handlers[sig] = wsh; return 0; diff -Nru wine-staging-1.9.6/dlls/ntdll/tests/threadpool.c wine-staging-1.9.7~ubuntu15.04.1/dlls/ntdll/tests/threadpool.c --- wine-staging-1.9.6/dlls/ntdll/tests/threadpool.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/ntdll/tests/threadpool.c 2016-04-04 18:06:32.000000000 +0000 @@ -477,6 +477,7 @@ static void test_tp_simple(void) { TP_CALLBACK_ENVIRON environment; + TP_CALLBACK_ENVIRON_V3 environment3; TP_CLEANUP_GROUP *group; HANDLE semaphore; NTSTATUS status; @@ -511,6 +512,17 @@ ok(!status, "TpSimpleTryPost failed with status %x\n", status); result = WaitForSingleObject(semaphore, 1000); ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + + /* test with environment version 3 */ + memset(&environment3, 0, sizeof(environment3)); + environment3.Version = 3; + environment3.Pool = pool; + environment3.CallbackPriority = TP_CALLBACK_PRIORITY_NORMAL; + environment3.Size = sizeof(environment3); + status = pTpSimpleTryPost(simple_cb, semaphore, (TP_CALLBACK_ENVIRON *)&environment3); + ok(!status, "TpSimpleTryPost failed with status %x\n", status); + result = WaitForSingleObject(semaphore, 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); /* test with invalid version number */ memset(&environment, 0, sizeof(environment)); diff -Nru wine-staging-1.9.6/dlls/ntdll/threadpool.c wine-staging-1.9.7~ubuntu15.04.1/dlls/ntdll/threadpool.c --- wine-staging-1.9.6/dlls/ntdll/threadpool.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/ntdll/threadpool.c 2016-04-04 18:06:32.000000000 +0000 @@ -1845,7 +1845,7 @@ if (environment) { - if (environment->Version != 1) + if (environment->Version != 1 && environment->Version != 3) FIXME( "unsupported environment version %u\n", environment->Version ); object->group = impl_from_TP_CLEANUP_GROUP( environment->CleanupGroup ); diff -Nru wine-staging-1.9.6/dlls/ntdll/virtual.c wine-staging-1.9.7~ubuntu15.04.1/dlls/ntdll/virtual.c --- wine-staging-1.9.6/dlls/ntdll/virtual.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/ntdll/virtual.c 2016-04-04 18:06:32.000000000 +0000 @@ -1279,7 +1279,7 @@ error: if (view) delete_view( view ); server_leave_uninterrupted_section( &csVirtual, &sigset ); - if (dup_mapping) NtClose( dup_mapping ); + if (dup_mapping) close_handle( dup_mapping ); return status; } @@ -2640,7 +2640,7 @@ res = map_image( handle, unix_handle, base, size, mask, header_size, shared_fd, dup_mapping, map_vprot, addr_ptr ); if (shared_needs_close) close( shared_fd ); - NtClose( shared_file ); + close_handle( shared_file ); } else { @@ -2708,7 +2708,7 @@ server_leave_uninterrupted_section( &csVirtual, &sigset ); done: - if (dup_mapping) NtClose( dup_mapping ); + if (dup_mapping) close_handle( dup_mapping ); if (needs_close) close( unix_handle ); return res; } diff -Nru wine-staging-1.9.6/dlls/ole32/compobj.c wine-staging-1.9.7~ubuntu15.04.1/dlls/ole32/compobj.c --- wine-staging-1.9.6/dlls/ole32/compobj.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/ole32/compobj.c 2016-04-04 18:06:32.000000000 +0000 @@ -3203,14 +3203,14 @@ return hres; } -static void init_multi_qi(DWORD count, MULTI_QI *mqi) +static void init_multi_qi(DWORD count, MULTI_QI *mqi, HRESULT hr) { ULONG i; for (i = 0; i < count; i++) { mqi[i].pItf = NULL; - mqi[i].hr = E_NOINTERFACE; + mqi[i].hr = hr; } } @@ -3266,7 +3266,7 @@ if (pServerInfo) FIXME("() non-NULL pServerInfo not supported!\n"); - init_multi_qi(cmq, pResults); + init_multi_qi(cmq, pResults, E_NOINTERFACE); hres = CoGetTreatAsClass(rclsid, &clsid); if(FAILED(hres)) @@ -3350,7 +3350,7 @@ if (server_info) FIXME("() non-NULL server_info not supported\n"); - init_multi_qi(count, results); + init_multi_qi(count, results, E_NOINTERFACE); /* optionally get CLSID from a file */ if (!rclsid) @@ -3372,20 +3372,30 @@ (void**)&unk); if (hr != S_OK) - return hr; + { + init_multi_qi(count, results, hr); + return hr; + } /* init from file */ hr = IUnknown_QueryInterface(unk, &IID_IPersistFile, (void**)&pf); if (FAILED(hr)) - ERR("failed to get IPersistFile\n"); - - if (pf) { - IPersistFile_Load(pf, filename, grfmode); - IPersistFile_Release(pf); + init_multi_qi(count, results, hr); + IUnknown_Release(unk); + return hr; } - return return_multi_qi(unk, count, results, FALSE); + hr = IPersistFile_Load(pf, filename, grfmode); + IPersistFile_Release(pf); + if (SUCCEEDED(hr)) + return return_multi_qi(unk, count, results, FALSE); + else + { + init_multi_qi(count, results, hr); + IUnknown_Release(unk); + return hr; + } } /*********************************************************************** @@ -3412,7 +3422,7 @@ if (server_info) FIXME("() non-NULL server_info not supported\n"); - init_multi_qi(count, results); + init_multi_qi(count, results, E_NOINTERFACE); /* optionally get CLSID from a file */ if (!rclsid) diff -Nru wine-staging-1.9.6/dlls/ole32/compositemoniker.c wine-staging-1.9.7~ubuntu15.04.1/dlls/ole32/compositemoniker.c --- wine-staging-1.9.6/dlls/ole32/compositemoniker.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/ole32/compositemoniker.c 2016-04-04 18:06:32.000000000 +0000 @@ -1803,7 +1803,7 @@ LPVOID tab_moniker = This->tabMoniker; This->tabSize+=BLOCK_TAB_SIZE; - This->tabMoniker=HeapReAlloc(GetProcessHeap(),0,This->tabMoniker,This->tabSize*sizeof(IMoniker)); + This->tabMoniker=HeapReAlloc(GetProcessHeap(),0,This->tabMoniker,This->tabSize*sizeof(This->tabMoniker[0])); if (This->tabMoniker==NULL){ HeapFree(GetProcessHeap(), 0, tab_moniker); diff -Nru wine-staging-1.9.6/dlls/ole32/datacache.c wine-staging-1.9.7~ubuntu15.04.1/dlls/ole32/datacache.c --- wine-staging-1.9.6/dlls/ole32/datacache.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/ole32/datacache.c 2016-04-04 18:06:32.000000000 +0000 @@ -2464,7 +2464,7 @@ * IUnknown pointer can be returned to the outside. */ if ( pUnkOuter && !IsEqualIID(&IID_IUnknown, riid) ) - return CLASS_E_NOAGGREGATION; + return E_INVALIDARG; /* * Try to construct a new instance of the class. diff -Nru wine-staging-1.9.6/dlls/ole32/tests/compobj.c wine-staging-1.9.7~ubuntu15.04.1/dlls/ole32/tests/compobj.c --- wine-staging-1.9.6/dlls/ole32/tests/compobj.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/ole32/tests/compobj.c 2016-04-04 18:06:32.000000000 +0000 @@ -95,6 +95,7 @@ static const GUID IID_TestPS = { 0x66666666, 0x8888, 0x7777, { 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55 } }; DEFINE_GUID(CLSID_InProcFreeMarshaler, 0x0000033a,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(CLSID_testclsid, 0xacd014c7,0x9535,0x4fac,0x8b,0x53,0xa4,0x8c,0xa7,0xf4,0xd7,0x26); static const WCHAR stdfont[] = {'S','t','d','F','o','n','t',0}; static const WCHAR wszNonExistent[] = {'N','o','n','E','x','i','s','t','e','n','t',0}; @@ -2966,7 +2967,6 @@ CoUninitialize(); } - static HRESULT WINAPI testspy_QI(IMallocSpy *iface, REFIID riid, void **obj) { if (IsEqualIID(riid, &IID_IMallocSpy) || IsEqualIID(riid, &IID_IUnknown)) @@ -3261,6 +3261,255 @@ ok(hr == S_OK, "got 0x%08x\n", hr); } +static HRESULT g_persistfile_qi_ret; +static HRESULT g_persistfile_load_ret; +static HRESULT WINAPI testinstance_QI(IPersistFile *iface, REFIID riid, void **obj) +{ + if (IsEqualIID(riid, &IID_IUnknown)) { + *obj = iface; + IUnknown_AddRef(iface); + return S_OK; + } + + if (IsEqualIID(riid, &IID_IPersistFile)) { + if (SUCCEEDED(g_persistfile_qi_ret)) { + *obj = iface; + IUnknown_AddRef(iface); + } + else + *obj = NULL; + return g_persistfile_qi_ret; + } + + ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid)); + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI testinstance_AddRef(IPersistFile *iface) +{ + return 2; +} + +static ULONG WINAPI testinstance_Release(IPersistFile *iface) +{ + return 1; +} + +static HRESULT WINAPI testinstance_GetClassID(IPersistFile *iface, CLSID *clsid) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI testinstance_IsDirty(IPersistFile *iface) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI testinstance_Load(IPersistFile *iface, LPCOLESTR filename, DWORD mode) +{ + return g_persistfile_load_ret; +} + +static HRESULT WINAPI testinstance_Save(IPersistFile *iface, LPCOLESTR filename, BOOL remember) +{ + return E_NOTIMPL; +} + +static HRESULT WINAPI testinstance_SaveCompleted(IPersistFile *iface, LPCOLESTR filename) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI testinstance_GetCurFile(IPersistFile *iface, LPOLESTR *filename) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static const IPersistFileVtbl testpersistfilevtbl = { + testinstance_QI, + testinstance_AddRef, + testinstance_Release, + testinstance_GetClassID, + testinstance_IsDirty, + testinstance_Load, + testinstance_Save, + testinstance_SaveCompleted, + testinstance_GetCurFile +}; + +static IPersistFile testpersistfile = { &testpersistfilevtbl }; + +static HRESULT WINAPI getinstance_cf_QI(IClassFactory *iface, REFIID riid, void **obj) +{ + if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory)) { + *obj = iface; + IClassFactory_AddRef(iface); + return S_OK; + } + + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI getinstance_cf_AddRef(IClassFactory *iface) +{ + return 2; +} + +static ULONG WINAPI getinstance_cf_Release(IClassFactory *iface) +{ + return 1; +} + +static HRESULT WINAPI getinstance_cf_CreateInstance(IClassFactory *iface, IUnknown *outer, + REFIID riid, void **obj) +{ + if (IsEqualIID(riid, &IID_IUnknown)) { + *obj = &testpersistfile; + return S_OK; + } + + ok(0, "unexpected call, riid %s\n", wine_dbgstr_guid(riid)); + *obj = NULL; + return E_NOTIMPL; +} + +static HRESULT WINAPI getinstance_cf_LockServer(IClassFactory *iface, BOOL lock) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static const IClassFactoryVtbl getinstance_cf_vtbl = { + getinstance_cf_QI, + getinstance_cf_AddRef, + getinstance_cf_Release, + getinstance_cf_CreateInstance, + getinstance_cf_LockServer +}; + +static IClassFactory getinstance_cf = { &getinstance_cf_vtbl }; + +static void test_CoGetInstanceFromFile(void) +{ + static const WCHAR filenameW[] = {'d','u','m','m','y','p','a','t','h',0}; + CLSID *clsid = (CLSID*)&CLSID_testclsid; + MULTI_QI mqi[2]; + DWORD cookie; + HRESULT hr; + + hr = pCoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + ok(hr == S_OK, "got 0x%08x\n", hr); + + /* CLSID is not specified, file does not exist */ + mqi[0].pIID = &IID_IUnknown; + mqi[0].pItf = NULL; + mqi[0].hr = E_NOTIMPL; + hr = CoGetInstanceFromFile(NULL, NULL, NULL, CLSCTX_INPROC_SERVER, STGM_READ, (OLECHAR*)filenameW, 1, mqi); +todo_wine + ok(hr == MK_E_CANTOPENFILE, "got 0x%08x\n", hr); + ok(mqi[0].pItf == NULL, "got %p\n", mqi[0].pItf); + ok(mqi[0].hr == E_NOINTERFACE, "got 0x%08x\n", mqi[0].hr); + + /* class is not available */ + mqi[0].pIID = &IID_IUnknown; + mqi[0].pItf = NULL; + mqi[0].hr = E_NOTIMPL; + hr = CoGetInstanceFromFile(NULL, clsid, NULL, CLSCTX_INPROC_SERVER, STGM_READ, (OLECHAR*)filenameW, 1, mqi); + ok(hr == REGDB_E_CLASSNOTREG, "got 0x%08x\n", hr); + ok(mqi[0].pItf == NULL, "got %p\n", mqi[0].pItf); + ok(mqi[0].hr == REGDB_E_CLASSNOTREG, "got 0x%08x\n", mqi[0].hr); + + hr = CoRegisterClassObject(clsid, (IUnknown*)&getinstance_cf, CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, + &cookie); + ok(hr == S_OK, "got 0x%08x\n", hr); + + mqi[0].pIID = &IID_IUnknown; + mqi[0].pItf = (void*)0xdeadbeef; + mqi[0].hr = S_OK; + hr = CoGetInstanceFromFile(NULL, clsid, NULL, CLSCTX_INPROC_SERVER, STGM_READ, (OLECHAR*)filenameW, 1, mqi); +todo_wine { + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(mqi[0].pItf == (void*)0xdeadbeef, "got %p\n", mqi[0].pItf); +} + ok(mqi[0].hr == S_OK, "got 0x%08x\n", mqi[0].hr); + + mqi[0].pIID = &IID_IUnknown; + mqi[0].pItf = (void*)0xdeadbeef; + mqi[0].hr = E_NOTIMPL; + hr = CoGetInstanceFromFile(NULL, clsid, NULL, CLSCTX_INPROC_SERVER, STGM_READ, (OLECHAR*)filenameW, 1, mqi); +todo_wine { + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(mqi[0].pItf == (void*)0xdeadbeef, "got %p\n", mqi[0].pItf); + ok(mqi[0].hr == E_NOTIMPL, "got 0x%08x\n", mqi[0].hr); +} + mqi[0].pIID = &IID_IUnknown; + mqi[0].pItf = NULL; + mqi[0].hr = E_NOTIMPL; + hr = CoGetInstanceFromFile(NULL, clsid, NULL, CLSCTX_INPROC_SERVER, STGM_READ, (OLECHAR*)filenameW, 1, mqi); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(mqi[0].pItf != NULL, "got %p\n", mqi[0].pItf); + ok(mqi[0].hr == S_OK, "got 0x%08x\n", mqi[0].hr); + + mqi[0].pIID = &IID_IUnknown; + mqi[0].pItf = NULL; + mqi[0].hr = S_OK; + hr = CoGetInstanceFromFile(NULL, clsid, NULL, CLSCTX_INPROC_SERVER, STGM_READ, (OLECHAR*)filenameW, 1, mqi); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(mqi[0].pItf != NULL, "got %p\n", mqi[0].pItf); + ok(mqi[0].hr == S_OK, "got 0x%08x\n", mqi[0].hr); + + mqi[0].pIID = &IID_IUnknown; + mqi[0].pItf = NULL; + mqi[0].hr = S_OK; + g_persistfile_qi_ret = S_FALSE; + hr = CoGetInstanceFromFile(NULL, clsid, NULL, CLSCTX_INPROC_SERVER, STGM_READ, (OLECHAR*)filenameW, 1, mqi); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(mqi[0].pItf != NULL, "got %p\n", mqi[0].pItf); + ok(mqi[0].hr == S_OK, "got 0x%08x\n", mqi[0].hr); + g_persistfile_qi_ret = S_OK; + + mqi[0].pIID = &IID_IUnknown; + mqi[0].pItf = NULL; + mqi[0].hr = S_OK; + mqi[1].pIID = &IID_IUnknown; + mqi[1].pItf = NULL; + mqi[1].hr = S_OK; + g_persistfile_qi_ret = 0x8000efef; + hr = CoGetInstanceFromFile(NULL, clsid, NULL, CLSCTX_INPROC_SERVER, STGM_READ, (OLECHAR*)filenameW, 2, mqi); + ok(hr == 0x8000efef, "got 0x%08x\n", hr); + ok(mqi[0].pItf == NULL, "got %p\n", mqi[0].pItf); + ok(mqi[0].hr == 0x8000efef, "got 0x%08x\n", mqi[0].hr); + ok(mqi[1].pItf == NULL, "got %p\n", mqi[1].pItf); + ok(mqi[1].hr == 0x8000efef, "got 0x%08x\n", mqi[1].hr); + g_persistfile_qi_ret = S_OK; + + mqi[0].pIID = &IID_IUnknown; + mqi[0].pItf = NULL; + mqi[0].hr = S_OK; + mqi[1].pIID = &IID_IUnknown; + mqi[1].pItf = NULL; + mqi[1].hr = S_OK; + g_persistfile_load_ret = 0x8000fefe; + hr = CoGetInstanceFromFile(NULL, clsid, NULL, CLSCTX_INPROC_SERVER, STGM_READ, (OLECHAR*)filenameW, 2, mqi); + ok(hr == 0x8000fefe, "got 0x%08x\n", hr); + ok(mqi[0].pItf == NULL, "got %p\n", mqi[0].pItf); + ok(mqi[0].hr == 0x8000fefe, "got 0x%08x\n", mqi[0].hr); + ok(mqi[1].pItf == NULL, "got %p\n", mqi[1].pItf); + ok(mqi[1].hr == 0x8000fefe, "got 0x%08x\n", mqi[1].hr); + g_persistfile_load_ret = S_OK; + + hr = CoRevokeClassObject(cookie); + ok(hr == S_OK, "got 0x%08x\n", hr); + + CoUninitialize(); +} + static void init_funcs(void) { HMODULE hOle32 = GetModuleHandleA("ole32"); @@ -3331,4 +3580,5 @@ test_IMallocSpy(); test_CoGetCurrentLogicalThreadId(); test_IInitializeSpy(); + test_CoGetInstanceFromFile(); } diff -Nru wine-staging-1.9.6/dlls/ole32/tests/ole2.c wine-staging-1.9.7~ubuntu15.04.1/dlls/ole32/tests/ole2.c --- wine-staging-1.9.6/dlls/ole32/tests/ole2.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/ole32/tests/ole2.c 2016-04-04 18:06:32.000000000 +0000 @@ -1598,7 +1598,6 @@ /* requested is not IUnknown */ hr = CreateDataCache(&unknown, &CLSID_NULL, &IID_IOleCache2, (void**)&pOleCache); -todo_wine ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); hr = CreateDataCache(&unknown, &CLSID_NULL, &IID_IUnknown, (void**)&unk); diff -Nru wine-staging-1.9.6/dlls/oleaut32/oleaut32.spec wine-staging-1.9.7~ubuntu15.04.1/dlls/oleaut32/oleaut32.spec --- wine-staging-1.9.6/dlls/oleaut32/oleaut32.spec 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/oleaut32/oleaut32.spec 2016-04-04 18:06:32.000000000 +0000 @@ -390,7 +390,7 @@ 419 stdcall OleCreatePictureIndirect(ptr ptr long ptr) 420 stdcall OleCreateFontIndirect(ptr ptr ptr) 421 stdcall OleTranslateColor(long long long) -422 stub OleLoadPictureFile +422 stdcall OleLoadPictureFile(int128 ptr) 423 stdcall OleSavePictureFile(ptr wstr) 424 stdcall OleLoadPicturePath(wstr ptr long long ptr ptr) 425 stdcall VarUI4FromI8(int64 ptr) diff -Nru wine-staging-1.9.6/dlls/oleaut32/olepicture.c wine-staging-1.9.7~ubuntu15.04.1/dlls/oleaut32/olepicture.c --- wine-staging-1.9.6/dlls/oleaut32/olepicture.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/oleaut32/olepicture.c 2016-04-04 18:06:32.000000000 +0000 @@ -2316,6 +2316,15 @@ } /*********************************************************************** + * OleLoadPictureFile (OLEAUT32.422) + */ +HRESULT WINAPI OleLoadPictureFile(VARIANT file, LPDISPATCH *picture) +{ + FIXME("(%s %p): stub\n", wine_dbgstr_variant(&file), picture); + return E_NOTIMPL; +} + +/*********************************************************************** * OleSavePictureFile (OLEAUT32.423) */ HRESULT WINAPI OleSavePictureFile(IDispatch *picture, BSTR filename) diff -Nru wine-staging-1.9.6/dlls/oleaut32/tests/typelib.c wine-staging-1.9.7~ubuntu15.04.1/dlls/oleaut32/tests/typelib.c --- wine-staging-1.9.6/dlls/oleaut32/tests/typelib.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/oleaut32/tests/typelib.c 2016-04-04 18:06:32.000000000 +0000 @@ -5710,19 +5710,23 @@ hr = LoadRegTypeLib(&LIBID_TestTypelib, 1, 7, LOCALE_NEUTRAL, &tl); ok(hr == TYPE_E_LIBNOTREGISTERED, "got 0x%08x\n", hr); + tl = NULL; 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); + if (tl) + { + 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); + 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); + ITypeLib_ReleaseTLibAttr(tl, attr); + ITypeLib_Release(tl); + } DeleteFileA("test_actctx_tlb.tlb"); DeleteFileA("test_actctx_tlb2.tlb"); diff -Nru wine-staging-1.9.6/dlls/quartz/acmwrapper.c wine-staging-1.9.7~ubuntu15.04.1/dlls/quartz/acmwrapper.c --- wine-staging-1.9.6/dlls/quartz/acmwrapper.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/quartz/acmwrapper.c 2016-04-04 18:06:32.000000000 +0000 @@ -55,7 +55,7 @@ static inline ACMWrapperImpl *impl_from_TransformFilter( TransformFilter *iface ) { - return CONTAINING_RECORD(iface, ACMWrapperImpl, tf.filter); + return CONTAINING_RECORD(iface, ACMWrapperImpl, tf); } static HRESULT WINAPI ACMWrapper_Receive(TransformFilter *tf, IMediaSample *pSample) diff -Nru wine-staging-1.9.6/dlls/quartz/avidec.c wine-staging-1.9.7~ubuntu15.04.1/dlls/quartz/avidec.c --- wine-staging-1.9.6/dlls/quartz/avidec.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/quartz/avidec.c 2016-04-04 18:06:32.000000000 +0000 @@ -54,7 +54,7 @@ static inline AVIDecImpl *impl_from_TransformFilter( TransformFilter *iface ) { - return CONTAINING_RECORD(iface, AVIDecImpl, tf.filter); + return CONTAINING_RECORD(iface, AVIDecImpl, tf); } static HRESULT WINAPI AVIDec_StartStreaming(TransformFilter* pTransformFilter) diff -Nru wine-staging-1.9.6/dlls/riched20/caret.c wine-staging-1.9.7~ubuntu15.04.1/dlls/riched20/caret.c --- wine-staging-1.9.6/dlls/riched20/caret.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/riched20/caret.c 2016-04-04 18:06:32.000000000 +0000 @@ -216,9 +216,8 @@ } -static void -ME_GetCursorCoordinates(ME_TextEditor *editor, ME_Cursor *pCursor, - int *x, int *y, int *height) +void ME_GetCursorCoordinates(ME_TextEditor *editor, ME_Cursor *pCursor, + int *x, int *y, int *height) { ME_DisplayItem *row; ME_DisplayItem *run = pCursor->pRun; diff -Nru wine-staging-1.9.6/dlls/riched20/editor.h wine-staging-1.9.7~ubuntu15.04.1/dlls/riched20/editor.h --- wine-staging-1.9.6/dlls/riched20/editor.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/riched20/editor.h 2016-04-04 18:06:32.000000000 +0000 @@ -192,6 +192,7 @@ int ME_GetTextLength(ME_TextEditor *editor) DECLSPEC_HIDDEN; int ME_GetTextLengthEx(ME_TextEditor *editor, const GETTEXTLENGTHEX *how) DECLSPEC_HIDDEN; ME_Style *ME_GetSelectionInsertStyle(ME_TextEditor *editor) DECLSPEC_HIDDEN; +void ME_GetCursorCoordinates(ME_TextEditor *editor, ME_Cursor *pCursor, int *x, int *y, int *height) DECLSPEC_HIDDEN; /* context.c */ void ME_InitContext(ME_Context *c, ME_TextEditor *editor, HDC hDC) DECLSPEC_HIDDEN; diff -Nru wine-staging-1.9.6/dlls/riched20/richole.c wine-staging-1.9.7~ubuntu15.04.1/dlls/riched20/richole.c --- wine-staging-1.9.6/dlls/riched20/richole.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/riched20/richole.c 2016-04-04 18:06:32.000000000 +0000 @@ -2428,13 +2428,29 @@ static HRESULT WINAPI ITextRange_fnScrollIntoView(ITextRange *me, LONG value) { ITextRangeImpl *This = impl_from_ITextRange(me); + ME_TextEditor *editor; + ME_Cursor cursor; + int x, y, height; - FIXME("(%p)->(%d): stub\n", This, value); + TRACE("(%p)->(%d)\n", This, value); if (!This->child.reole) return CO_E_RELEASED; - return E_NOTIMPL; + editor = This->child.reole->editor; + + switch (value) + { + case tomStart: + ME_CursorFromCharOfs(editor, This->start, &cursor); + ME_GetCursorCoordinates(editor, &cursor, &x, &y, &height); + break; + default: + FIXME("bStart value %d not handled\n", value); + return E_NOTIMPL; + } + ME_ScrollAbs(editor, x, y); + return S_OK; } static HRESULT WINAPI ITextRange_fnGetEmbeddedObject(ITextRange *me, IUnknown **ppv) diff -Nru wine-staging-1.9.6/dlls/riched20/tests/richole.c wine-staging-1.9.7~ubuntu15.04.1/dlls/riched20/tests/richole.c --- wine-staging-1.9.6/dlls/riched20/tests/richole.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/riched20/tests/richole.c 2016-04-04 18:06:32.000000000 +0000 @@ -53,6 +53,7 @@ HWND hwnd = CreateWindowA(lpClassName, NULL, dwStyle | WS_POPUP | WS_HSCROLL | WS_VSCROLL | WS_VISIBLE, 0, 0, 200, 60, parent, NULL, hmoduleRichEdit, NULL); + ok(hwnd != NULL, "class: %s, error: %d\n", lpClassName, (int) GetLastError()); return hwnd; } @@ -761,6 +762,65 @@ ITextRange_Release(txtRge); } +/* Helper function for testing ITextRange_ScrollIntoView */ +static void check_range(HWND w, ITextDocument* doc, int first, int lim, + LONG bStart, int expected_nonzero) +{ + SCROLLINFO si; + ITextRange *txtRge = NULL; + HRESULT hres; + + si.cbSize = sizeof(SCROLLINFO); + si.fMask = SIF_POS | SIF_RANGE; + + hres = ITextDocument_Range(doc, first, lim, &txtRge); + ok(hres == S_OK, "got 0x%08x\n", hres); + hres = ITextRange_ScrollIntoView(txtRge, bStart); + ok(hres == S_OK, "got 0x%08x\n", hres); + GetScrollInfo(w, SB_VERT, &si); + if (expected_nonzero) { + ok(si.nPos != 0, + "Scrollbar at 0, should be >0. (TextRange %d-%d, scroll range %d-%d.)\n", + first, lim, si.nMin, si.nMax); + } else { + ok(si.nPos == 0, + "Scrollbar at %d, should be 0. (TextRange %d-%d, scroll range %d-%d.)\n", + si.nPos, first, lim, si.nMin, si.nMax); + } +} + +static void test_ITextRange_ScrollIntoView(void) +{ + HWND w; + IRichEditOle *reOle = NULL; + ITextDocument *txtDoc = NULL; + ITextRange *txtRge = NULL; + HRESULT hres; + static const CHAR test_text1[] = "1\n2\n3\n4\n5\n6\n7\n8\n9\n10"; + + create_interfaces(&w, &reOle, &txtDoc, NULL); + SendMessageA(w, WM_SETTEXT, 0, (LPARAM)test_text1); + + /* Scroll to the top. */ + check_range(w, txtDoc, 0, 1, tomStart, 0); + + /* Scroll to the bottom. */ + check_range(w, txtDoc, 19, 20, tomStart, 1); + + /* Back up to the top. */ + check_range(w, txtDoc, 0, 1, tomStart, 0); + + /* Large range */ + check_range(w, txtDoc, 0, 20, tomStart, 0); + + hres = ITextDocument_Range(txtDoc, 0, 0, &txtRge); + ok(hres == S_OK, "got 0x%08x\n", hres); + release_interfaces(&w, &reOle, &txtDoc, NULL); + hres = ITextRange_ScrollIntoView(txtRge, tomStart); + ok(hres == CO_E_RELEASED, "got 0x%08x\n", hres); + ITextRange_Release(txtRge); +} + static void test_ITextSelection_GetChar(void) { HWND w; @@ -3352,6 +3412,7 @@ test_ITextSelection_Collapse(); test_ITextDocument_Range(); test_ITextRange_GetChar(); + test_ITextRange_ScrollIntoView(); test_ITextRange_GetStart_GetEnd(); test_ITextRange_GetDuplicate(); test_ITextRange_Collapse(); diff -Nru wine-staging-1.9.6/dlls/secur32/schannel_gnutls.c wine-staging-1.9.7~ubuntu15.04.1/dlls/secur32/schannel_gnutls.c --- wine-staging-1.9.6/dlls/secur32/schannel_gnutls.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/secur32/schannel_gnutls.c 2016-04-04 18:06:32.000000000 +0000 @@ -160,7 +160,7 @@ BOOL schan_imp_create_session(schan_imp_session *session, schan_credentials *cred) { gnutls_session_t *s = (gnutls_session_t*)session; - char priority[64] = "NORMAL", *p; + char priority[128] = "NORMAL:%LATEST_RECORD_VERSION", *p; unsigned i; int err = pgnutls_init(s, cred->credential_use == SECPKG_CRED_INBOUND ? GNUTLS_SERVER : GNUTLS_CLIENT); diff -Nru wine-staging-1.9.6/dlls/setupapi/devinst.c wine-staging-1.9.7~ubuntu15.04.1/dlls/setupapi/devinst.c --- wine-staging-1.9.6/dlls/setupapi/devinst.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/setupapi/devinst.c 2016-04-04 18:06:32.000000000 +0000 @@ -3712,6 +3712,19 @@ return TRUE; } +/*********************************************************************** + * SetupDiSetDeviceInstallParamsW (SETUPAPI.@) + */ +BOOL WINAPI SetupDiSetDeviceInstallParamsW( + HDEVINFO DeviceInfoSet, + PSP_DEVINFO_DATA DeviceInfoData, + PSP_DEVINSTALL_PARAMS_W DeviceInstallParams) +{ + FIXME("(%p, %p, %p) stub\n", DeviceInfoSet, DeviceInfoData, DeviceInstallParams); + + return TRUE; +} + static HKEY SETUPDI_OpenDevKey(struct DeviceInfo *devInfo, REGSAM samDesired) { HKEY enumKey, key = INVALID_HANDLE_VALUE; diff -Nru wine-staging-1.9.6/dlls/setupapi/setupapi.spec wine-staging-1.9.7~ubuntu15.04.1/dlls/setupapi/setupapi.spec --- wine-staging-1.9.6/dlls/setupapi/setupapi.spec 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/setupapi/setupapi.spec 2016-04-04 18:06:32.000000000 +0000 @@ -387,7 +387,7 @@ @ stdcall SetupDiSetClassInstallParamsA(ptr ptr ptr long) @ stdcall SetupDiSetClassInstallParamsW(ptr ptr ptr long) @ stdcall SetupDiSetDeviceInstallParamsA(ptr ptr ptr) -@ stub SetupDiSetDeviceInstallParamsW +@ stdcall SetupDiSetDeviceInstallParamsW(ptr ptr ptr) @ stdcall SetupDiSetDeviceRegistryPropertyA(ptr ptr long ptr ptr) @ stdcall SetupDiSetDeviceRegistryPropertyW(ptr ptr long ptr ptr) @ stub SetupDiSetDriverInstallParamsA diff -Nru wine-staging-1.9.6/dlls/sfc/sfc_main.c wine-staging-1.9.7~ubuntu15.04.1/dlls/sfc/sfc_main.c --- wine-staging-1.9.6/dlls/sfc/sfc_main.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/sfc/sfc_main.c 2016-04-04 18:06:32.000000000 +0000 @@ -52,9 +52,3 @@ } return TRUE; } - -DWORD WINAPI SFC_3(DWORD unknown) -{ - FIXME("%x\n", unknown); - return 0; -} diff -Nru wine-staging-1.9.6/dlls/sfc/sfc.spec wine-staging-1.9.7~ubuntu15.04.1/dlls/sfc/sfc.spec --- wine-staging-1.9.6/dlls/sfc/sfc.spec 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/sfc/sfc.spec 2016-04-04 18:06:32.000000000 +0000 @@ -1,12 +1,15 @@ -1 stub @ -2 stub @ -3 stdcall @(long) SFC_3 -4 stub @ -5 stub @ -6 stub @ -7 stub @ -8 stub @ -9 stub @ +1 stub @ # sfc_os.SfcInitProt +2 stub @ # sfc_os.SfcTerminateWatcherThread +3 stdcall @(long) sfc_os.SfcConnectToServer +4 stub @ # sfc_os.SfcClose +5 stub @ # sfc_os.SfcFileException +6 stub @ # sfc_os.SfcInitiateScan +7 stub @ # sfc_os.SfcInstallProtectedFiles +8 stub @ # sfc_os.SfpInstallCatalog +9 stub @ # SfpDeleteCatalog +@ stub SRSetRestorePoint +@ stub SRSetRestorePointA +@ stub SRSetRestorePointW @ stdcall SfcGetNextProtectedFile(long ptr) sfc_os.SfcGetNextProtectedFile @ stdcall SfcIsFileProtected(ptr wstr) sfc_os.SfcIsFileProtected @ stdcall SfcIsKeyProtected(long wstr long) sfc_os.SfcIsKeyProtected diff -Nru wine-staging-1.9.6/dlls/sfc_os/sfc_os.c wine-staging-1.9.7~ubuntu15.04.1/dlls/sfc_os/sfc_os.c --- wine-staging-1.9.6/dlls/sfc_os/sfc_os.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/sfc_os/sfc_os.c 2016-04-04 18:06:32.000000000 +0000 @@ -132,3 +132,9 @@ SetLastError(ERROR_FILE_NOT_FOUND); return FALSE; } + +DWORD WINAPI SfcConnectToServer(DWORD unknown) +{ + FIXME("%x\n", unknown); + return 0; +} diff -Nru wine-staging-1.9.6/dlls/sfc_os/sfc_os.spec wine-staging-1.9.7~ubuntu15.04.1/dlls/sfc_os/sfc_os.spec --- wine-staging-1.9.6/dlls/sfc_os/sfc_os.spec 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/sfc_os/sfc_os.spec 2016-04-04 18:06:32.000000000 +0000 @@ -1,3 +1,18 @@ +@ stub BeginFileMapEnumeration +@ stub CloseFileMapEnumeration +@ stub GetNextFileMapContent +@ stub SRSetRestorePointA +@ stub SRSetRestorePointW +@ stub SfcClose +@ stdcall SfcConnectToServer(long) +@ stub SfcFileException @ stdcall SfcGetNextProtectedFile(long ptr) +@ stub SfcInitProt +@ stub SfcInitiateScan +@ stub SfcInstallProtectedFiles @ stdcall SfcIsFileProtected(ptr wstr) @ stdcall SfcIsKeyProtected(long wstr long) +@ stub SfcTerminateWatcherThread +@ stub SfpDeleteCatalog +@ stub SfpInstallCatalog +@ stub SfpVerifyFile diff -Nru wine-staging-1.9.6/dlls/shell32/assoc.c wine-staging-1.9.7~ubuntu15.04.1/dlls/shell32/assoc.c --- wine-staging-1.9.6/dlls/shell32/assoc.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/shell32/assoc.c 2016-04-04 18:06:32.000000000 +0000 @@ -88,6 +88,8 @@ return CONTAINING_RECORD(iface, struct enumassochandlers, IEnumAssocHandlers_iface); } +static HRESULT ASSOC_GetValue(HKEY hkey, const WCHAR *name, void **data, DWORD *data_size); + /************************************************************************** * IQueryAssociations_QueryInterface * @@ -196,10 +198,16 @@ FIXME("unsupported flags: %x\n", cfFlags); RegCloseKey(This->hkeySource); - RegCloseKey(This->hkeyProgID); + if (This->hkeySource != This->hkeyProgID) + RegCloseKey(This->hkeyProgID); This->hkeySource = This->hkeyProgID = NULL; + + /* If the process of initializing hkeyProgID fails, just return S_OK. That's what Windows does. */ if (pszAssoc != NULL) { + WCHAR *progId; + HRESULT hr; + ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, pszAssoc, 0, @@ -207,22 +215,51 @@ &This->hkeySource); if (ret) return S_OK; - /* if this is not a prog id */ - if ((*pszAssoc == '.') || (*pszAssoc == '{')) + /* if this is a progid */ + if (*pszAssoc != '.' && *pszAssoc != '{') { - RegOpenKeyExW(This->hkeySource, - szProgID, - 0, - KEY_READ, - &This->hkeyProgID); - } - else This->hkeyProgID = This->hkeySource; + return S_OK; + } + + /* if it's not a progid, it's a file extension or clsid */ + if (*pszAssoc == '.') + { + /* for a file extension, the progid is the default value */ + hr = ASSOC_GetValue(This->hkeySource, NULL, (void**)&progId, NULL); + if (FAILED(hr)) + return S_OK; + } + else /* if (*pszAssoc == '{') */ + { + HKEY progIdKey; + /* for a clsid, the progid is the default value of the ProgID subkey */ + ret = RegOpenKeyExW(This->hkeySource, + szProgID, + 0, + KEY_READ, + &progIdKey); + if (ret != ERROR_SUCCESS) + return S_OK; + hr = ASSOC_GetValue(progIdKey, NULL, (void**)&progId, NULL); + if (FAILED(hr)) + return S_OK; + RegCloseKey(progIdKey); + } + + /* open the actual progid key, the one with the shell subkey */ + ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, + progId, + 0, + KEY_READ, + &This->hkeyProgID); + HeapFree(GetProcessHeap(), 0, progId); + return S_OK; } else if (hkeyProgid != NULL) { - This->hkeyProgID = hkeyProgid; + This->hkeySource = This->hkeyProgID = hkeyProgid; return S_OK; } else @@ -507,33 +544,15 @@ case ASSOCSTR_FRIENDLYDOCNAME: { - WCHAR *pszFileType; - DWORD ret; - DWORD size; + WCHAR *docName; - hr = ASSOC_GetValue(This->hkeySource, NULL, (void**)&pszFileType, NULL); - if (FAILED(hr)) - return hr; - size = 0; - ret = RegGetValueW(HKEY_CLASSES_ROOT, pszFileType, NULL, RRF_RT_REG_SZ, NULL, NULL, &size); - if (ret == ERROR_SUCCESS) - { - WCHAR *docName = HeapAlloc(GetProcessHeap(), 0, size); - if (docName) - { - ret = RegGetValueW(HKEY_CLASSES_ROOT, pszFileType, NULL, RRF_RT_REG_SZ, NULL, docName, &size); - if (ret == ERROR_SUCCESS) - hr = ASSOC_ReturnString(flags, pszOut, pcchOut, docName, strlenW(docName) + 1); - else - hr = HRESULT_FROM_WIN32(ret); - HeapFree(GetProcessHeap(), 0, docName); - } - else - hr = E_OUTOFMEMORY; + hr = ASSOC_GetValue(This->hkeyProgID, NULL, (void**)&docName, NULL); + if (FAILED(hr)) { + /* hKeyProgID is NULL or there is no default value, so fail */ + return HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION); } - else - hr = HRESULT_FROM_WIN32(ret); - HeapFree(GetProcessHeap(), 0, pszFileType); + hr = ASSOC_ReturnString(flags, pszOut, pcchOut, docName, strlenW(docName) + 1); + HeapFree(GetProcessHeap(), 0, docName); return hr; } @@ -623,41 +642,33 @@ case ASSOCSTR_DEFAULTICON: { static const WCHAR DefaultIconW[] = {'D','e','f','a','u','l','t','I','c','o','n',0}; - WCHAR *pszFileType; + static const WCHAR documentIcon[] = {'s','h','e','l','l','3','2','.','d','l','l',',','0',0}; DWORD ret; DWORD size; - HKEY hkeyFile; - hr = ASSOC_GetValue(This->hkeySource, NULL, (void**)&pszFileType, NULL); - if (FAILED(hr)) - return hr; - ret = RegOpenKeyExW(HKEY_CLASSES_ROOT, pszFileType, 0, KEY_READ, &hkeyFile); + size = 0; + ret = RegGetValueW(This->hkeyProgID, DefaultIconW, NULL, RRF_RT_REG_SZ, NULL, NULL, &size); if (ret == ERROR_SUCCESS) { - size = 0; - ret = RegGetValueW(hkeyFile, DefaultIconW, NULL, RRF_RT_REG_SZ, NULL, NULL, &size); - if (ret == ERROR_SUCCESS) + WCHAR *icon = HeapAlloc(GetProcessHeap(), 0, size); + if (icon) { - WCHAR *icon = HeapAlloc(GetProcessHeap(), 0, size); - if (icon) - { - ret = RegGetValueW(hkeyFile, DefaultIconW, NULL, RRF_RT_REG_SZ, NULL, icon, &size); - if (ret == ERROR_SUCCESS) - hr = ASSOC_ReturnString(flags, pszOut, pcchOut, icon, strlenW(icon) + 1); - else - hr = HRESULT_FROM_WIN32(ret); - HeapFree(GetProcessHeap(), 0, icon); - } + ret = RegGetValueW(This->hkeyProgID, DefaultIconW, NULL, RRF_RT_REG_SZ, NULL, icon, &size); + if (ret == ERROR_SUCCESS) + hr = ASSOC_ReturnString(flags, pszOut, pcchOut, icon, strlenW(icon) + 1); else - hr = E_OUTOFMEMORY; + hr = HRESULT_FROM_WIN32(ret); + HeapFree(GetProcessHeap(), 0, icon); } else - hr = HRESULT_FROM_WIN32(ret); - RegCloseKey(hkeyFile); + hr = E_OUTOFMEMORY; + } else { + /* there is no DefaultIcon subkey or hkeyProgID is NULL, so return the default document icon */ + if (This->hkeyProgID == NULL) + hr = ASSOC_ReturnString(flags, pszOut, pcchOut, documentIcon, strlenW(documentIcon) + 1); + else + return HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION); } - else - hr = HRESULT_FROM_WIN32(ret); - HeapFree(GetProcessHeap(), 0, pszFileType); return hr; } case ASSOCSTR_SHELLEXTENSION: diff -Nru wine-staging-1.9.6/dlls/shell32/shlexec.c wine-staging-1.9.7~ubuntu15.04.1/dlls/shell32/shlexec.c --- wine-staging-1.9.6/dlls/shell32/shlexec.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/shell32/shlexec.c 2016-04-04 18:06:32.000000000 +0000 @@ -1087,6 +1087,7 @@ { UINT_PTR retval = SE_ERR_NOASSOC; WCHAR old_dir[1024]; + WCHAR res[MAX_PATH]; TRACE("File %s, Dir %s\n", debugstr_w(lpFile), debugstr_w(lpDirectory)); @@ -1100,7 +1101,10 @@ SetCurrentDirectoryW(lpDirectory); } - retval = SHELL_FindExecutable(lpDirectory, lpFile, wszOpen, lpResult, MAX_PATH, NULL, NULL, NULL, NULL); + retval = SHELL_FindExecutable(lpDirectory, lpFile, wszOpen, res, MAX_PATH, NULL, NULL, NULL, NULL); + + if (retval > 32) + strcpyW(lpResult, res); TRACE("returning %s\n", debugstr_w(lpResult)); if (lpDirectory) diff -Nru wine-staging-1.9.6/dlls/shell32/tests/assoc.c wine-staging-1.9.7~ubuntu15.04.1/dlls/shell32/tests/assoc.c --- wine-staging-1.9.6/dlls/shell32/tests/assoc.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/shell32/tests/assoc.c 2016-04-04 18:06:32.000000000 +0000 @@ -100,14 +100,79 @@ { NULL } }; +static void getstring_test(LPCWSTR assocName, HKEY progIdKey, ASSOCSTR str, LPCWSTR expected_string, int line_num) +{ + IQueryAssociations *assoc; + HRESULT hr; + WCHAR *buffer; + DWORD len; + + hr = CoCreateInstance(&CLSID_QueryAssociations, NULL, CLSCTX_INPROC_SERVER, &IID_IQueryAssociations, (void*)&assoc); + ok(hr == S_OK, "line %d: failed to create IQueryAssociations, 0x%x\n", line_num, hr); + hr = IQueryAssociations_Init(assoc, 0, assocName, progIdKey, NULL); + ok(hr == S_OK, "line %d: IQueryAssociations::Init failed, 0x%x\n", line_num, hr); + + hr = IQueryAssociations_GetString(assoc, 0, str, NULL, NULL, &len); + if (hr != S_FALSE) { + if (expected_string) { + ok(SUCCEEDED(hr), "line %d: GetString returned 0x%x, expected success\n", line_num, hr); + } else { + ok(FAILED(hr), "line %d: GetString returned 0x%x, expected failure\n", line_num, hr); + } + } + + buffer = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + ok(buffer != NULL, "line %d: out of memory\n", line_num); + hr = IQueryAssociations_GetString(assoc, 0, str, NULL, buffer, &len); + + if (expected_string) { + ok(lstrcmpW(buffer, expected_string) == 0, "line %d: GetString returned %s, expected %s\n", line_num, + wine_dbgstr_w(buffer), wine_dbgstr_w(expected_string)); + } +} + static void test_IQueryAssociations_GetString(void) { + static WCHAR test_extensionW[] = {'.','t','e','s','t',0}; + static WCHAR test_progidW[] = {'t','e','s','t','f','i','l','e',0}; + static WCHAR DefaultIconW[] = {'D','e','f','a','u','l','t','I','c','o','n',0}; + /* folder.ico, why not */ + static WCHAR test_iconW[] = {'s','h','e','l','l','3','2','.','d','l','l',',','1',0}; + HKEY test_extension_key; + HKEY test_progid_key; + HKEY test_defaulticon_key; + LRESULT r; + struct assoc_getstring_test *ptr = getstring_tests; IQueryAssociations *assoc; HRESULT hr; DWORD len; int i = 0; + r = RegCreateKeyExW(HKEY_CLASSES_ROOT, test_extensionW, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &test_extension_key, NULL); + ok(r == ERROR_SUCCESS, "RegCreateKeyExW(HKCR, \".test\") failed: 0x%lx\n", r); + r = RegSetValueExW(test_extension_key, NULL, 0, REG_SZ, (PBYTE)test_progidW, sizeof(test_progidW)); + ok(r == ERROR_SUCCESS, "RegSetValueExW(HKCR\\.test, NULL, \"testfile\") failed: 0x%lx\n", r); + + /* adding progid key with no information shuld fail to return information */ + r = RegCreateKeyExW(HKEY_CLASSES_ROOT, test_progidW, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &test_progid_key, NULL); + ok(r == ERROR_SUCCESS, "RegCreateKeyExW(HKCR, \"testfile\") failed: 0x%lx\n", r); + getstring_test(test_extensionW, NULL, ASSOCSTR_DEFAULTICON, NULL, __LINE__); + getstring_test(test_progidW, NULL, ASSOCSTR_DEFAULTICON, NULL, __LINE__); + getstring_test(NULL, test_progid_key, ASSOCSTR_DEFAULTICON, NULL, __LINE__); + + /* adding information to the progid should return that information */ + r = RegCreateKeyExW(test_progid_key, DefaultIconW, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &test_defaulticon_key, NULL); + ok(r == ERROR_SUCCESS, "RegCreateKeyExW(HKCR\\testfile\\DefaultIcon) failed: 0x%lx\n", r); + r = RegSetValueExW(test_defaulticon_key, NULL, 0, REG_SZ, (PBYTE)test_iconW, sizeof(test_iconW)); + ok(r == ERROR_SUCCESS, "RegSetValueExW(HKCR\\testfile\\DefaultIcon, NULL, \"folder.ico\") failed: 0x%lx\n", r); + getstring_test(test_extensionW, NULL, ASSOCSTR_DEFAULTICON, test_iconW, __LINE__); + getstring_test(test_progidW, NULL, ASSOCSTR_DEFAULTICON, test_iconW, __LINE__); + getstring_test(NULL, test_progid_key, ASSOCSTR_DEFAULTICON, test_iconW, __LINE__); + + RegDeleteKeyW(HKEY_CLASSES_ROOT, test_extensionW); + RegDeleteKeyW(HKEY_CLASSES_ROOT, test_progidW); + hr = CoCreateInstance(&CLSID_QueryAssociations, NULL, CLSCTX_INPROC_SERVER, &IID_IQueryAssociations, (void*)&assoc); ok(hr == S_OK, "failed to create object, 0x%x\n", hr); diff -Nru wine-staging-1.9.6/dlls/shell32/tests/shlexec.c wine-staging-1.9.7~ubuntu15.04.1/dlls/shell32/tests/shlexec.c --- wine-staging-1.9.6/dlls/shell32/tests/shlexec.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/shell32/tests/shlexec.c 2016-04-04 18:06:32.000000000 +0000 @@ -365,7 +365,7 @@ #define okShell okShell_(__FILE__, __LINE__) static char assoc_desc[2048]; -void reset_association_description(void) +static void reset_association_description(void) { *assoc_desc = '\0'; } @@ -1016,6 +1016,7 @@ "%s\\test_shortcut_exe.lnk", "%s\\test file.shl", "%s\\test file.shlfoo", + "%s\\test file.sha", "%s\\test file.sfe", "%s\\test file.shlproto", "%s\\masked file.shlexec", @@ -1066,6 +1067,8 @@ {"notaverb", "%s\\test file.shlexec", 0x10, SE_ERR_NOASSOC}, + {"averb", "%s\\test file.sha", 0x10, 33}, + /* Test file masked due to space */ {NULL, "%s\\masked file.shlexec", 0x0, 33}, /* Test if quoting prevents the masking */ @@ -1774,6 +1777,14 @@ sprintf(filename, "%s\\test file.shlexec", tmpdir); okChildPath("argvA4", filename); } + + sprintf(filename, "\"%s\\test file.sha\"", tmpdir); + rc=shell_execute(NULL, filename, NULL, NULL); + todo_wine okShell(rc > 32, "failed: rc=%ld err=%u\n", rc, GetLastError()); + okChildInt("argcA", 5); + todo_wine okChildString("argvA3", "averb"); + sprintf(filename, "%s\\test file.sha", tmpdir); + todo_wine okChildPath("argvA4", filename); } typedef struct @@ -1818,6 +1829,9 @@ /* Test shortcuts vs. URLs */ {"file://///", "%s\\test_shortcut_shlexec.lnk", 0, 0x1d}, + /* Confuse things by mixing protocols */ + {"file://", "shlproto://foo/bar", USE_COLON, 0}, + {NULL, NULL, 0, 0} }; @@ -1937,10 +1951,15 @@ /* Check default verb detection */ rc = shell_execute(NULL, "shlpaverb://foo/bar", NULL, NULL); - todo_wine ok(rc > 32, "%s failed: rc=%lu\n", shell_call, rc); - okChildInt("argcA", 5); - todo_wine okChildString("argvA3", "PAVerb"); - todo_wine okChildString("argvA4", "shlpaverb://foo/bar"); + todo_wine ok(rc > 32 || /* XP+IE7 - Win10 */ + broken(rc == SE_ERR_NOASSOC), /* XP+IE6 */ + "%s failed: rc=%lu\n", shell_call, rc); + if (rc > 32) + { + okChildInt("argcA", 5); + todo_wine okChildString("argvA3", "PAVerb"); + todo_wine okChildString("argvA4", "shlpaverb://foo/bar"); + } /* But alternative verbs are a recent feature! */ rc = shell_execute("averb", "shlproto://foo/bar", NULL, NULL); @@ -1989,10 +2008,6 @@ todo_wine ok(rc == SE_ERR_FNF, "%s returned %lu\n", shell_call, rc); SetEnvironmentVariableA("urlprefix", NULL); - /* Try to confuse ShellExecute() by mixing protocols */ - rc = shell_execute(NULL, "file://shlproto://foo/bar", NULL, NULL); - ok(rc == SE_ERR_FNF || rc == SE_ERR_PNF, "%s returned %lu\n", shell_call, rc); - delete_test_class("fakeproto"); delete_test_class("shlpaverb"); } @@ -2803,6 +2818,9 @@ create_test_verb("shlexec.shlexec", "UpperL", 0, "UpperL %L"); create_test_verb("shlexec.shlexec", "QuotedUpperL", 0, "QuotedUpperL \"%L\""); + create_test_association(".sha"); + create_test_verb("shlexec.sha", "averb", 0, "AVerb \"%1\""); + create_test_class("shlproto", TRUE); create_test_verb("shlproto", "open", 0, "URL \"%1\""); create_test_verb("shlproto", "averb", 0, "AVerb \"%1\""); @@ -2831,6 +2849,8 @@ /* Delete the test association */ delete_test_association(".shlexec"); + delete_test_association(".sha"); + delete_test_class("shlproto"); CloseHandle(hEvent); diff -Nru wine-staging-1.9.6/dlls/t2embed/main.c wine-staging-1.9.7~ubuntu15.04.1/dlls/t2embed/main.c --- wine-staging-1.9.6/dlls/t2embed/main.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/t2embed/main.c 2016-04-04 18:06:32.000000000 +0000 @@ -24,6 +24,7 @@ #include "windef.h" #include "winbase.h" +#include "wingdi.h" #include "t2embapi.h" #include "wine/debug.h" @@ -73,9 +74,30 @@ LONG WINAPI TTGetEmbeddingType(HDC hDC, ULONG *status) { - FIXME("(%p %p) stub\n", hDC, status); - if (status) *status = EMBED_NOEMBEDDING; - return E_API_NOTIMPL; + OUTLINETEXTMETRICW otm; + + TRACE("(%p %p)\n", hDC, status); + + if (!hDC) + return E_HDCINVALID; + + otm.otmSize = sizeof(otm); + if (!GetOutlineTextMetricsW(hDC, otm.otmSize, &otm)) + return E_NOTATRUETYPEFONT; + + if (!status) + return E_PERMISSIONSINVALID; + + if (otm.otmfsType == LICENSE_INSTALLABLE) + *status = EMBED_INSTALLABLE; + else if (otm.otmfsType & LICENSE_NOEMBEDDING) + *status = EMBED_NOEMBEDDING; + else if (otm.otmfsType & LICENSE_PREVIEWPRINT) + *status = EMBED_PREVIEWPRINT; + else if (otm.otmfsType & LICENSE_EDITABLE) + *status = EMBED_EDITABLE; + + return E_NONE; } LONG WINAPI TTIsEmbeddingEnabled(HDC hDC, BOOL *enabled) diff -Nru wine-staging-1.9.6/dlls/t2embed/Makefile.in wine-staging-1.9.7~ubuntu15.04.1/dlls/t2embed/Makefile.in --- wine-staging-1.9.6/dlls/t2embed/Makefile.in 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/t2embed/Makefile.in 2016-04-04 18:06:32.000000000 +0000 @@ -1,4 +1,6 @@ MODULE = t2embed.dll +IMPORTLIB = t2embed +IMPORTS = gdi32 C_SRCS = \ main.c diff -Nru wine-staging-1.9.6/dlls/t2embed/tests/Makefile.in wine-staging-1.9.7~ubuntu15.04.1/dlls/t2embed/tests/Makefile.in --- wine-staging-1.9.6/dlls/t2embed/tests/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/t2embed/tests/Makefile.in 2016-04-04 18:06:32.000000000 +0000 @@ -0,0 +1,5 @@ +TESTDLL = t2embed.dll +IMPORTS = gdi32 t2embed + +C_SRCS = \ + t2embed.c diff -Nru wine-staging-1.9.6/dlls/t2embed/tests/t2embed.c wine-staging-1.9.7~ubuntu15.04.1/dlls/t2embed/tests/t2embed.c --- wine-staging-1.9.6/dlls/t2embed/tests/t2embed.c 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/t2embed/tests/t2embed.c 2016-04-04 18:06:32.000000000 +0000 @@ -0,0 +1,82 @@ +/* + * Copyright 2016 Nikolay Sivov 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 "windef.h" +#include "wingdi.h" +#include "t2embapi.h" +#include "wine/test.h" + +static void test_TTGetEmbeddingType(void) +{ + HFONT hfont, old_font; + LOGFONTA logfont; + ULONG status; + LONG ret; + HDC hdc; + + ret = TTGetEmbeddingType(NULL, NULL); + ok(ret == E_HDCINVALID, "got %d\n", ret); + + status = 0xdeadbeef; + ret = TTGetEmbeddingType(NULL, &status); + ok(ret == E_HDCINVALID, "got %#x\n", ret); + ok(status == 0xdeadbeef, "got %u\n", status); + + status = 0xdeadbeef; + ret = TTGetEmbeddingType((HDC)0xdeadbeef, &status); + ok(ret == E_NOTATRUETYPEFONT || broken(ret == E_ERRORACCESSINGFONTDATA) /* xp, vista */, "got %#x\n", ret); + ok(status == 0xdeadbeef, "got %u\n", status); + + hdc = CreateCompatibleDC(0); + + ret = TTGetEmbeddingType(hdc, NULL); + ok(ret == E_NOTATRUETYPEFONT, "got %#x\n", ret); + + status = 0xdeadbeef; + ret = TTGetEmbeddingType(hdc, &status); + ok(ret == E_NOTATRUETYPEFONT, "got %#x\n", ret); + ok(status == 0xdeadbeef, "got %u\n", status); + + memset(&logfont, 0, sizeof(logfont)); + logfont.lfHeight = 12; + logfont.lfWeight = FW_NORMAL; + strcpy(logfont.lfFaceName, "Tahoma"); + hfont = CreateFontIndirectA(&logfont); + ok(hfont != NULL, "got %p\n", hfont); + + old_font = SelectObject(hdc, hfont); + + status = 0; + ret = TTGetEmbeddingType(hdc, &status); + ok(ret == E_NONE, "got %#x\n", ret); + ok(status != 0, "got %u\n", status); + + ret = TTGetEmbeddingType(hdc, NULL); + ok(ret == E_PERMISSIONSINVALID, "got %#x\n", ret); + + SelectObject(hdc, old_font); + DeleteObject(hfont); + DeleteDC(hdc); +} + +START_TEST(t2embed) +{ + test_TTGetEmbeddingType(); +} diff -Nru wine-staging-1.9.6/dlls/ucrtbase/ucrtbase.spec wine-staging-1.9.7~ubuntu15.04.1/dlls/ucrtbase/ucrtbase.spec --- wine-staging-1.9.6/dlls/ucrtbase/ucrtbase.spec 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/ucrtbase/ucrtbase.spec 2016-04-04 18:06:32.000000000 +0000 @@ -2160,9 +2160,9 @@ @ cdecl asctime_s(ptr long ptr) MSVCRT_asctime_s @ cdecl asin(double) MSVCRT_asin @ cdecl -arch=arm,x86_64 asinf(float) MSVCRT_asinf -@ stub asinh -@ stub asinhf -@ stub asinhl +@ cdecl asinh(double double) MSVCR120_asinh +@ cdecl asinhf(float float) MSVCR120_asinhf +@ cdecl asinhl(double double) MSVCR120_asinhl @ cdecl atan(double) MSVCRT_atan @ cdecl atan2(double double) MSVCRT_atan2 @ cdecl -arch=arm,x86_64 atan2f(float float) MSVCRT_atan2f @@ -2339,7 +2339,7 @@ @ stub gets_s @ cdecl getwc(ptr) MSVCRT_getwc @ cdecl getwchar() MSVCRT_getwchar -@ stub hypot +@ cdecl hypot(double double) _hypot @ stub ilogb @ stub ilogbf @ stub ilogbl diff -Nru wine-staging-1.9.6/dlls/user32/cursoricon.c wine-staging-1.9.7~ubuntu15.04.1/dlls/user32/cursoricon.c --- wine-staging-1.9.6/dlls/user32/cursoricon.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/user32/cursoricon.c 2016-04-04 18:06:32.000000000 +0000 @@ -397,12 +397,12 @@ */ static BOOL is_dib_monochrome( const BITMAPINFO* info ) { - if (info->bmiHeader.biBitCount != 1) return FALSE; - if (info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER)) { const RGBTRIPLE *rgb = ((const BITMAPCOREINFO*)info)->bmciColors; + if (((const BITMAPCOREINFO*)info)->bmciHeader.bcBitCount != 1) return FALSE; + /* Check if the first color is black */ if ((rgb->rgbtRed == 0) && (rgb->rgbtGreen == 0) && (rgb->rgbtBlue == 0)) { @@ -418,6 +418,8 @@ { const RGBQUAD *rgb = info->bmiColors; + if (info->bmiHeader.biBitCount != 1) return FALSE; + /* Check if the first color is black */ if ((rgb->rgbRed == 0) && (rgb->rgbGreen == 0) && (rgb->rgbBlue == 0) && (rgb->rgbReserved == 0)) @@ -676,10 +678,19 @@ return FALSE; entry = &filedir->idEntries[n]; info = (const BITMAPINFOHEADER *)((const char *)dir + entry->dwDIBOffset); - if ((const char *)(info + 1) - (const char *)dir > size) return FALSE; + if (info->biSize != sizeof(BITMAPCOREHEADER)) + { + if ((const char *)(info + 1) - (const char *)dir > size) return FALSE; + *bits = info->biBitCount; + } + else + { + const BITMAPCOREHEADER *coreinfo = (const BITMAPCOREHEADER *)((const char *)dir + entry->dwDIBOffset); + if ((const char *)(coreinfo + 1) - (const char *)dir > size) return FALSE; + *bits = coreinfo->bcBitCount; + } *width = entry->bWidth; *height = entry->bHeight; - *bits = info->biBitCount; return TRUE; } @@ -805,6 +816,9 @@ BOOL do_stretch; HICON hObj = 0; HDC hdc = 0; + LONG bmi_width, bmi_height; + WORD bpp; + DWORD compr; /* Check bitmap header */ @@ -828,9 +842,10 @@ } size = bitmap_info_size( bmi, DIB_RGB_COLORS ); - color_size = get_dib_image_size( bmi->bmiHeader.biWidth, bmi->bmiHeader.biHeight / 2, - bmi->bmiHeader.biBitCount ); - mask_size = get_dib_image_size( bmi->bmiHeader.biWidth, bmi->bmiHeader.biHeight / 2, 1 ); + DIB_GetBitmapInfo(&bmi->bmiHeader, &bmi_width, &bmi_height, &bpp, &compr); + color_size = get_dib_image_size( bmi_width, bmi_height / 2, + bpp ); + mask_size = get_dib_image_size( bmi_width, bmi_height / 2, 1 ); if (size > maxsize || color_size > maxsize - size) { WARN( "truncated file %u < %u+%u+%u\n", maxsize, size, color_size, mask_size ); @@ -845,11 +860,11 @@ } else { - if (!width) width = bmi->bmiHeader.biWidth; - if (!height) height = bmi->bmiHeader.biHeight/2; + if (!width) width = bmi_width; + if (!height) height = bmi_height/2; } - do_stretch = (bmi->bmiHeader.biHeight/2 != height) || - (bmi->bmiHeader.biWidth != width); + do_stretch = (bmi_height/2 != height) || + (bmi_width != width); /* Scale the hotspot */ if (bIcon) @@ -859,8 +874,8 @@ } else if (do_stretch) { - hotspot.x = (hotspot.x * width) / bmi->bmiHeader.biWidth; - hotspot.y = (hotspot.y * height) / (bmi->bmiHeader.biHeight / 2); + hotspot.x = (hotspot.x * width) / bmi_width; + hotspot.y = (hotspot.y * height) / (bmi_height / 2); } if (!screen_dc) screen_dc = CreateDCW( DISPLAYW, NULL, NULL, NULL ); @@ -871,7 +886,11 @@ if (!(hdc = CreateCompatibleDC( 0 ))) goto done; memcpy( bmi_copy, bmi, size ); - bmi_copy->bmiHeader.biHeight /= 2; + if (bmi_copy->bmiHeader.biSize != sizeof(BITMAPCOREHEADER)) + bmi_copy->bmiHeader.biHeight /= 2; + else + ((BITMAPCOREINFO *)bmi_copy)->bmciHeader.bcHeight /= 2; + bmi_height /= 2; color_bits = (const char*)bmi + size; mask_bits = (const char*)color_bits + color_size; @@ -885,7 +904,7 @@ /* copy color data into second half of mask bitmap */ SelectObject( hdc, mask ); StretchDIBits( hdc, 0, height, width, height, - 0, 0, bmi_copy->bmiHeader.biWidth, bmi_copy->bmiHeader.biHeight, + 0, 0, bmi_width, bmi_height, color_bits, bmi_copy, DIB_RGB_COLORS, SRCCOPY ); } else @@ -899,18 +918,18 @@ } SelectObject( hdc, color ); StretchDIBits( hdc, 0, 0, width, height, - 0, 0, bmi_copy->bmiHeader.biWidth, bmi_copy->bmiHeader.biHeight, + 0, 0, bmi_width, bmi_height, color_bits, bmi_copy, DIB_RGB_COLORS, SRCCOPY ); if (bmi_has_alpha( bmi_copy, color_bits )) alpha = create_alpha_bitmap( color, bmi_copy, color_bits ); /* convert info to monochrome to copy the mask */ - bmi_copy->bmiHeader.biBitCount = 1; if (bmi_copy->bmiHeader.biSize != sizeof(BITMAPCOREHEADER)) { RGBQUAD *rgb = bmi_copy->bmiColors; + bmi_copy->bmiHeader.biBitCount = 1; bmi_copy->bmiHeader.biClrUsed = bmi_copy->bmiHeader.biClrImportant = 2; rgb[0].rgbBlue = rgb[0].rgbGreen = rgb[0].rgbRed = 0x00; rgb[1].rgbBlue = rgb[1].rgbGreen = rgb[1].rgbRed = 0xff; @@ -920,6 +939,7 @@ { RGBTRIPLE *rgb = (RGBTRIPLE *)(((BITMAPCOREHEADER *)bmi_copy) + 1); + ((BITMAPCOREINFO *)bmi_copy)->bmciHeader.bcBitCount = 1; rgb[0].rgbtBlue = rgb[0].rgbtGreen = rgb[0].rgbtRed = 0x00; rgb[1].rgbtBlue = rgb[1].rgbtGreen = rgb[1].rgbtRed = 0xff; } @@ -929,7 +949,7 @@ { SelectObject( hdc, mask ); StretchDIBits( hdc, 0, 0, width, height, - 0, 0, bmi_copy->bmiHeader.biWidth, bmi_copy->bmiHeader.biHeight, + 0, 0, bmi_width, bmi_height, mask_bits, bmi_copy, DIB_RGB_COLORS, SRCCOPY ); } ret = TRUE; diff -Nru wine-staging-1.9.6/dlls/user32/lstr.c wine-staging-1.9.7~ubuntu15.04.1/dlls/user32/lstr.c --- wine-staging-1.9.6/dlls/user32/lstr.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/user32/lstr.c 2016-04-04 18:06:32.000000000 +0000 @@ -31,11 +31,11 @@ #include "windef.h" #include "winbase.h" +#include "winnls.h" #include "winuser.h" #include "winerror.h" #include "wine/exception.h" -#include "wine/unicode.h" /*********************************************************************** @@ -175,7 +175,7 @@ */ BOOL WINAPI CharToOemW( LPCWSTR s, LPSTR d ) { - return CharToOemBuffW( s, d, strlenW( s ) + 1 ); + return CharToOemBuffW( s, d, lstrlenW( s ) + 1 ); } @@ -280,20 +280,38 @@ /*********************************************************************** * CharLowerW (USER32.@) */ -LPWSTR WINAPI CharLowerW(LPWSTR x) +LPWSTR WINAPI CharLowerW( LPWSTR str ) { - if (!IS_INTRESOURCE(x)) return strlwrW(x); - else return (LPWSTR)((UINT_PTR)tolowerW(LOWORD(x))); + if (!IS_INTRESOURCE( str )) + { + CharLowerBuffW( str, lstrlenW( str )); + return str; + } + else + { + WCHAR ch = LOWORD( str ); + CharLowerBuffW( &ch, 1 ); + return (LPWSTR)(UINT_PTR)ch; + } } /*********************************************************************** * CharUpperW (USER32.@) */ -LPWSTR WINAPI CharUpperW(LPWSTR x) +LPWSTR WINAPI CharUpperW( LPWSTR str ) { - if (!IS_INTRESOURCE(x)) return struprW(x); - else return (LPWSTR)((UINT_PTR)toupperW(LOWORD(x))); + if (!IS_INTRESOURCE( str )) + { + CharUpperBuffW( str, lstrlenW( str )); + return str; + } + else + { + WCHAR ch = LOWORD( str ); + CharUpperBuffW( &ch, 1 ); + return (LPWSTR)(UINT_PTR)ch; + } } @@ -327,10 +345,8 @@ */ DWORD WINAPI CharLowerBuffW( LPWSTR str, DWORD len ) { - DWORD ret = len; if (!str) return 0; /* YES */ - for (; len; len--, str++) *str = tolowerW(*str); - return ret; + return LCMapStringW( LOCALE_USER_DEFAULT, LCMAP_LOWERCASE, str, len, str, len ); } @@ -364,10 +380,8 @@ */ DWORD WINAPI CharUpperBuffW( LPWSTR str, DWORD len ) { - DWORD ret = len; if (!str) return 0; /* YES */ - for (; len; len--, str++) *str = toupperW(*str); - return ret; + return LCMapStringW( LOCALE_USER_DEFAULT, LCMAP_UPPERCASE, str, len, str, len ); } @@ -386,9 +400,10 @@ /*********************************************************************** * IsCharLowerW (USER32.@) */ -BOOL WINAPI IsCharLowerW(WCHAR x) +BOOL WINAPI IsCharLowerW( WCHAR ch ) { - return (get_char_typeW(x) & C1_LOWER) != 0; + WORD type; + return GetStringTypeW( CT_CTYPE1, &ch, 1, &type ) && (type & C1_LOWER); } @@ -407,9 +422,10 @@ /*********************************************************************** * IsCharUpperW (USER32.@) */ -BOOL WINAPI IsCharUpperW(WCHAR x) +BOOL WINAPI IsCharUpperW( WCHAR ch ) { - return (get_char_typeW(x) & C1_UPPER) != 0; + WORD type; + return GetStringTypeW( CT_CTYPE1, &ch, 1, &type ) && (type & C1_UPPER); } @@ -428,9 +444,10 @@ /*********************************************************************** * IsCharAlphaNumericW (USER32.@) */ -BOOL WINAPI IsCharAlphaNumericW(WCHAR x) +BOOL WINAPI IsCharAlphaNumericW( WCHAR ch ) { - return (get_char_typeW(x) & (C1_ALPHA|C1_DIGIT)) != 0; + WORD type; + return GetStringTypeW( CT_CTYPE1, &ch, 1, &type ) && (type & (C1_ALPHA|C1_DIGIT)); } @@ -449,7 +466,8 @@ /*********************************************************************** * IsCharAlphaW (USER32.@) */ -BOOL WINAPI IsCharAlphaW(WCHAR x) +BOOL WINAPI IsCharAlphaW( WCHAR ch ) { - return (get_char_typeW(x) & C1_ALPHA) != 0; + WORD type; + return GetStringTypeW( CT_CTYPE1, &ch, 1, &type ) && (type & C1_ALPHA); } diff -Nru wine-staging-1.9.6/dlls/user32/misc.c wine-staging-1.9.7~ubuntu15.04.1/dlls/user32/misc.c --- wine-staging-1.9.6/dlls/user32/misc.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/user32/misc.c 2016-04-04 18:06:32.000000000 +0000 @@ -20,6 +20,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" + #include #include "windef.h" @@ -466,11 +468,48 @@ return ret; } +#ifdef __i386__ +/* Some apps pass a non-stdcall callback to EnumDisplayMonitors, + * so we need a small assembly wrapper to call it. + * MJ's Help Diagnostic expects that %ecx contains the address to the rect. + */ +struct enumdisplaymonitors_lparam +{ + MONITORENUMPROC proc; + LPARAM lparam; +}; + +extern BOOL CALLBACK enumdisplaymonitors_callback_wrapper(HMONITOR monitor, HDC hdc, LPRECT rect, LPARAM lparam); +__ASM_STDCALL_FUNC( enumdisplaymonitors_callback_wrapper, 16, + "pushl %ebp\n\t" + __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t") + __ASM_CFI(".cfi_rel_offset %ebp,0\n\t") + "movl %esp,%ebp\n\t" + __ASM_CFI(".cfi_def_cfa_register %ebp\n\t") + "subl $8,%esp\n\t" + "movl 20(%ebp),%eax\n\t" /* struct enumdisplaymonitors_lparam *orig = (struct enumdisplaymonitors_lparam*)lparam */ + "pushl 4(%eax)\n\t" /* push orig->lparam */ + "pushl 16(%ebp)\n\t" + "pushl 12(%ebp)\n\t" + "pushl 8(%ebp)\n\t" + "movl 16(%ebp),%ecx\n\t" + "call *(%eax)\n\t" /* call orig->proc */ + "leave\n\t" + __ASM_CFI(".cfi_def_cfa %esp,4\n\t") + __ASM_CFI(".cfi_same_value %ebp\n\t") + "ret $16" ) +#endif /* __i386__ */ + /*********************************************************************** * EnumDisplayMonitors (USER32.@) */ BOOL WINAPI EnumDisplayMonitors( HDC hdc, LPRECT rect, MONITORENUMPROC proc, LPARAM lp ) { +#ifdef __i386__ + struct enumdisplaymonitors_lparam orig = { proc, lp }; + proc = enumdisplaymonitors_callback_wrapper; + lp = (LPARAM)&orig; +#endif return USER_Driver->pEnumDisplayMonitors( hdc, rect, proc, lp ); } diff -Nru wine-staging-1.9.6/dlls/user32/scroll.c wine-staging-1.9.7~ubuntu15.04.1/dlls/user32/scroll.c --- wine-staging-1.9.6/dlls/user32/scroll.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/user32/scroll.c 2016-04-04 18:06:32.000000000 +0000 @@ -2039,7 +2039,7 @@ nBar = SB_HORZ; } else - bFineWithMe = TRUE; + bFineWithMe = nBar != SB_CTL; if (!(infoPtr = SCROLL_GetInternalInfo( hwnd, nBar, TRUE ))) return FALSE; if (bFineWithMe && infoPtr->flags == flags) return FALSE; diff -Nru wine-staging-1.9.6/dlls/user32/sysparams.c wine-staging-1.9.7~ubuntu15.04.1/dlls/user32/sysparams.c --- wine-staging-1.9.6/dlls/user32/sysparams.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/user32/sysparams.c 2016-04-04 18:06:32.000000000 +0000 @@ -2904,3 +2904,12 @@ return TRUE; } + +/*********************************************************************** + * IsProcessDPIAware (USER32.@) + */ +BOOL WINAPI IsProcessDPIAware(void) +{ + FIXME( "stub!\n"); + return FALSE; +} diff -Nru wine-staging-1.9.6/dlls/user32/tests/cursoricon.c wine-staging-1.9.7~ubuntu15.04.1/dlls/user32/tests/cursoricon.c --- wine-staging-1.9.6/dlls/user32/tests/cursoricon.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/user32/tests/cursoricon.c 2016-04-04 18:06:32.000000000 +0000 @@ -2484,6 +2484,121 @@ ok(cursor2 != cursor, "cursor == %p, cursor2 == %p\n", cursor, cursor2); } +static void test_monochrome_icon(void) +{ + HANDLE handle; + BOOL ret; + DWORD bytes_written; + CURSORICONFILEDIR *icon_data; + CURSORICONFILEDIRENTRY *icon_entry; + BITMAPINFO *bitmap_info; + BITMAPCOREINFO *core_info; + ICONINFO icon_info; + ULONG icon_size; + BOOL monochrome, use_core_info; + + icon_data = HeapAlloc(GetProcessHeap(), 0, sizeof(CURSORICONFILEDIR) + sizeof(BITMAPINFOHEADER) + + 2 * sizeof(RGBQUAD) + sizeof(ULONG)); + + for (monochrome = FALSE; monochrome <= TRUE; monochrome++) + for (use_core_info = FALSE; use_core_info <= TRUE; use_core_info++) + { + trace("%s, %s\n", + monochrome ? "monochrome" : "colored", + use_core_info ? "core info" : "bitmap info"); + + icon_size = sizeof(CURSORICONFILEDIR) + + (use_core_info ? sizeof(BITMAPCOREHEADER) : sizeof(BITMAPINFOHEADER)) + + /* 2 * sizeof(RGBTRIPLE) + padding comes out the same */ + 2 * sizeof(RGBQUAD) + + sizeof(ULONG); + ZeroMemory(icon_data, icon_size); + icon_data->idReserved = 0; + icon_data->idType = 1; + icon_data->idCount = 1; + + icon_entry = icon_data->idEntries; + icon_entry->bWidth = 1; + icon_entry->bHeight = 1; + icon_entry->bColorCount = 0; + icon_entry->bReserved = 0; + icon_entry->xHotspot = 0; + icon_entry->yHotspot = 0; + icon_entry->dwDIBSize = icon_size - sizeof(CURSORICONFILEDIR); + icon_entry->dwDIBOffset = sizeof(CURSORICONFILEDIR); + + if (use_core_info) + { + core_info = (BITMAPCOREINFO *) ((BYTE *) icon_data + icon_entry->dwDIBOffset); + core_info->bmciHeader.bcSize = sizeof(BITMAPCOREHEADER); + core_info->bmciHeader.bcWidth = 1; + core_info->bmciHeader.bcHeight = 2; + core_info->bmciHeader.bcPlanes = 1; + core_info->bmciHeader.bcBitCount = 1; + core_info->bmciColors[0].rgbtBlue = monochrome ? 0x00 : 0xff; + core_info->bmciColors[0].rgbtGreen = 0x00; + core_info->bmciColors[0].rgbtRed = 0x00; + core_info->bmciColors[1].rgbtBlue = 0xff; + core_info->bmciColors[1].rgbtGreen = 0xff; + core_info->bmciColors[1].rgbtRed = 0xff; + } + else + { + bitmap_info = (BITMAPINFO *) ((BYTE *) icon_data + icon_entry->dwDIBOffset); + bitmap_info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bitmap_info->bmiHeader.biWidth = 1; + bitmap_info->bmiHeader.biHeight = 2; + bitmap_info->bmiHeader.biPlanes = 1; + bitmap_info->bmiHeader.biBitCount = 1; + bitmap_info->bmiHeader.biSizeImage = 0; /* Uncompressed bitmap. */ + bitmap_info->bmiColors[0].rgbBlue = monochrome ? 0x00 : 0xff; + bitmap_info->bmiColors[0].rgbGreen = 0x00; + bitmap_info->bmiColors[0].rgbRed = 0x00; + bitmap_info->bmiColors[1].rgbBlue = 0xff; + bitmap_info->bmiColors[1].rgbGreen = 0xff; + bitmap_info->bmiColors[1].rgbRed = 0xff; + } + + handle = CreateFileA("icon.ico", GENERIC_WRITE, 0, NULL, CREATE_NEW, + FILE_ATTRIBUTE_NORMAL, NULL); + ok(handle != INVALID_HANDLE_VALUE, "CreateFileA failed. %u\n", GetLastError()); + ret = WriteFile(handle, icon_data, icon_size, &bytes_written, NULL); + ok(ret && bytes_written == icon_size, "icon.ico created improperly.\n"); + CloseHandle(handle); + + handle = LoadImageA(NULL, "icon.ico", IMAGE_ICON, 0, 0, LR_LOADFROMFILE); + ok(handle != NULL, "LoadImage() failed with %u.\n", GetLastError()); + if (handle == NULL) + { + skip("Icon failed to load: %s, %s\n", + monochrome ? "monochrome" : "colored", + use_core_info ? "core info" : "bitmap info"); + DeleteFileA("icon.ico"); + continue; + } + + ret = GetIconInfo(handle, &icon_info); + ok(ret, "GetIconInfo() failed with %u.\n", GetLastError()); + if (ret) + { + ok(icon_info.fIcon == TRUE, "fIcon is %u.\n", icon_info.fIcon); + ok(icon_info.xHotspot == 0, "xHotspot is %u.\n", icon_info.xHotspot); + ok(icon_info.yHotspot == 0, "yHotspot is %u.\n", icon_info.yHotspot); + if (monochrome) + ok(icon_info.hbmColor == NULL, "Got hbmColor %p!\n", icon_info.hbmColor); + else + ok(icon_info.hbmColor != NULL, "No hbmColor!\n"); + ok(icon_info.hbmMask != NULL, "No hbmMask!\n"); + } + + ret = DestroyIcon(handle); + ok(ret, "DestroyIcon() failed with %u.\n", GetLastError()); + DeleteFileA("icon.ico"); + } + + HeapFree(GetProcessHeap(), 0, icon_data); +} + START_TEST(cursoricon) { pGetCursorInfo = (void *)GetProcAddress( GetModuleHandleA("user32.dll"), "GetCursorInfo" ); @@ -2522,6 +2637,7 @@ test_SetCursor(); test_ShowCursor(); test_DestroyCursor(); + test_monochrome_icon(); do_parent(); test_child_process(); finish_child_process(); diff -Nru wine-staging-1.9.6/dlls/user32/tests/scroll.c wine-staging-1.9.7~ubuntu15.04.1/dlls/user32/tests/scroll.c --- wine-staging-1.9.6/dlls/user32/tests/scroll.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/user32/tests/scroll.c 2016-04-04 18:06:32.000000000 +0000 @@ -114,6 +114,15 @@ ok( ret, "The scrollbar should be enabled.\n" ); ok( IsWindowEnabled( hScroll ), "The scrollbar window should be enabled.\n" ); + /* disable window, try to reenable */ + ret = EnableWindow( hScroll, FALSE ); + ok( !ret, "got %d\n", ret ); + ok( !IsWindowEnabled( hScroll ), "The scrollbar window should be disabled.\n" ); + + ret = EnableScrollBar( hScroll, SB_CTL, ESB_ENABLE_BOTH ); + ok( ret, "got %d\n", ret ); + ok( IsWindowEnabled( hScroll ), "The scrollbar window should be disabled.\n" ); + DestroyWindow(hScroll); DestroyWindow(mainwnd); } @@ -539,7 +548,7 @@ EnableScrollBar(hScroll, SB_CTL, ESB_DISABLE_BOTH); ret = IsWindowEnabled(hScroll); - ok(!ret, "scroll bar disabled\n"); + ok(!ret, "scroll bar enabled\n"); memset(&si, 0, sizeof(si)); si.cbSize = sizeof(si); @@ -551,9 +560,10 @@ memset(&si, 0, sizeof(si)); si.cbSize = sizeof(si); ret = IsWindowEnabled(hScroll); - ok(!ret, "scroll bar disabled\n"); + ok(!ret, "scroll bar enabled\n"); si.fMask = SIF_POS|SIF_RANGE|SIF_PAGE|SIF_DISABLENOSCROLL; si.nMax = 100; + si.nMin = 10; si.nPos = 0; si.nPage = 100; SetScrollInfo(hScroll, SB_CTL, &si, TRUE); @@ -564,6 +574,18 @@ ret = GetScrollInfo(hScroll, SB_CTL, &si); ok(ret, "got %d\n", ret); + EnableScrollBar(hScroll, SB_CTL, ESB_ENABLE_BOTH); + ok(IsWindowEnabled(hScroll), "expected enabled scrollbar\n"); + + si.fMask = SIF_POS|SIF_RANGE|SIF_PAGE|SIF_DISABLENOSCROLL; + si.nMax = 10; + si.nMin = 100; + si.nPos = 0; + si.nPage = 100; + SetScrollInfo(hScroll, SB_CTL, &si, TRUE); + ret = IsWindowEnabled(hScroll); + ok(ret, "scroll bar disabled\n"); + DestroyWindow(hScroll); DestroyWindow(mainwnd); } diff -Nru wine-staging-1.9.6/dlls/user32/user32.spec wine-staging-1.9.7~ubuntu15.04.1/dlls/user32/user32.spec --- wine-staging-1.9.6/dlls/user32/user32.spec 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/user32/user32.spec 2016-04-04 18:06:32.000000000 +0000 @@ -446,6 +446,7 @@ # @ stub IsHungThread @ stdcall IsIconic(long) @ stdcall IsMenu(long) +@ stdcall IsProcessDPIAware() @ stdcall IsRectEmpty(ptr) # @ stub IsServerSideWindow @ stdcall IsTouchWindow(long ptr) diff -Nru wine-staging-1.9.6/dlls/webservices/reader.c wine-staging-1.9.7~ubuntu15.04.1/dlls/webservices/reader.c --- wine-staging-1.9.6/dlls/webservices/reader.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/webservices/reader.c 2016-04-04 18:06:32.000000000 +0000 @@ -176,6 +176,12 @@ return HeapReAlloc( heap->handle, 0, ptr, size ); } +static void *ws_realloc_zero( WS_HEAP *handle, void *ptr, SIZE_T size ) +{ + struct heap *heap = (struct heap *)handle; + return HeapReAlloc( heap->handle, HEAP_ZERO_MEMORY, ptr, size ); +} + void ws_free( WS_HEAP *handle, void *ptr ) { struct heap *heap = (struct heap *)handle; @@ -303,7 +309,7 @@ void free_node( struct node *node ) { if (!node) return; - switch (node->hdr.node.nodeType) + switch (node_type( node )) { case WS_XML_NODE_TYPE_ELEMENT: { @@ -337,7 +343,7 @@ break; default: - ERR( "unhandled type %u\n", node->hdr.node.nodeType ); + ERR( "unhandled type %u\n", node_type( node ) ); break; } heap_free( node ); @@ -464,6 +470,15 @@ } } +static void free_reader( struct reader *reader ) +{ + if (!reader) return; + destroy_nodes( reader->root ); + clear_prefixes( reader->prefixes, reader->nb_prefixes ); + heap_free( reader->prefixes ); + heap_free( reader ); +} + static HRESULT set_prefix( struct prefix *prefix, const WS_XML_STRING *str, const WS_XML_STRING *ns ) { if (str) @@ -608,14 +623,14 @@ hr = set_reader_prop( reader, properties[i].id, properties[i].value, properties[i].valueSize ); if (hr != S_OK) { - heap_free( reader ); + free_reader( reader ); return hr; } } if ((hr = read_init_state( reader )) != S_OK) { - heap_free( reader ); + free_reader( reader ); return hr; } @@ -631,12 +646,7 @@ struct reader *reader = (struct reader *)handle; TRACE( "%p\n", handle ); - - if (!reader) return; - destroy_nodes( reader->root ); - clear_prefixes( reader->prefixes, reader->nb_prefixes ); - heap_free( reader->prefixes ); - heap_free( reader ); + free_reader( reader ); } /************************************************************************** @@ -1113,12 +1123,12 @@ for (parent = reader->current; parent; parent = parent->parent) { - if (parent->hdr.node.nodeType == WS_XML_NODE_TYPE_BOF) + if (node_type( parent ) == WS_XML_NODE_TYPE_BOF) { if (!localname) return parent; return NULL; } - else if (parent->hdr.node.nodeType == WS_XML_NODE_TYPE_ELEMENT) + else if (node_type( parent ) == WS_XML_NODE_TYPE_ELEMENT) { if (!localname) return parent; @@ -1536,7 +1546,7 @@ if (!(ptr = list_head( &reader->root->children ))) return FALSE; node = LIST_ENTRY( ptr, struct node, entry ); - if (node->hdr.node.nodeType == WS_XML_NODE_TYPE_ELEMENT) + if (node_type( node ) == WS_XML_NODE_TYPE_ELEMENT) { reader->current = node; return TRUE; @@ -1544,7 +1554,7 @@ while ((ptr = list_next( &reader->root->children, &node->entry ))) { struct node *next = LIST_ENTRY( ptr, struct node, entry ); - if (next->hdr.node.nodeType == WS_XML_NODE_TYPE_ELEMENT) + if (node_type( next ) == WS_XML_NODE_TYPE_ELEMENT) { reader->current = next; return TRUE; @@ -1562,7 +1572,7 @@ while ((ptr = list_next( &node->parent->children, &node->entry ))) { struct node *next = LIST_ENTRY( ptr, struct node, entry ); - if (next->hdr.node.nodeType == WS_XML_NODE_TYPE_ELEMENT) + if (node_type( next ) == WS_XML_NODE_TYPE_ELEMENT) { reader->current = next; return TRUE; @@ -1580,7 +1590,7 @@ while ((ptr = list_prev( &node->parent->children, &node->entry ))) { struct node *prev = LIST_ENTRY( ptr, struct node, entry ); - if (prev->hdr.node.nodeType == WS_XML_NODE_TYPE_ELEMENT) + if (node_type( prev ) == WS_XML_NODE_TYPE_ELEMENT) { reader->current = prev; return TRUE; @@ -1597,7 +1607,7 @@ if (!(ptr = list_head( &reader->current->children ))) return FALSE; node = LIST_ENTRY( ptr, struct node, entry ); - if (node->hdr.node.nodeType == WS_XML_NODE_TYPE_ELEMENT) + if (node_type( node ) == WS_XML_NODE_TYPE_ELEMENT) { reader->current = node; return TRUE; @@ -1605,7 +1615,7 @@ while ((ptr = list_next( &reader->current->children, &node->entry ))) { struct node *next = LIST_ENTRY( ptr, struct node, entry ); - if (next->hdr.node.nodeType == WS_XML_NODE_TYPE_ELEMENT) + if (node_type( next ) == WS_XML_NODE_TYPE_ELEMENT) { reader->current = next; return TRUE; @@ -1620,12 +1630,12 @@ struct list *ptr; struct node *node = reader->current; - if (node->hdr.node.nodeType != WS_XML_NODE_TYPE_ELEMENT) return FALSE; + if (node_type( node ) != WS_XML_NODE_TYPE_ELEMENT) return FALSE; if ((ptr = list_tail( &node->children ))) { struct node *tail = LIST_ENTRY( ptr, struct node, entry ); - if (tail->hdr.node.nodeType == WS_XML_NODE_TYPE_END_ELEMENT) + if (node_type( tail ) == WS_XML_NODE_TYPE_END_ELEMENT) { reader->current = tail; return TRUE; @@ -1638,8 +1648,8 @@ { struct node *parent = reader->current->parent; - if (parent && (parent->hdr.node.nodeType == WS_XML_NODE_TYPE_ELEMENT || - parent->hdr.node.nodeType == WS_XML_NODE_TYPE_BOF)) + if (parent && (node_type( parent ) == WS_XML_NODE_TYPE_ELEMENT || + node_type( parent ) == WS_XML_NODE_TYPE_BOF)) { reader->current = parent; return TRUE; @@ -1901,7 +1911,7 @@ { WS_XML_TEXT_NODE *text; - if (reader->current->hdr.node.nodeType != WS_XML_NODE_TYPE_TEXT) + if (node_type( reader->current ) != WS_XML_NODE_TYPE_TEXT) return WS_E_INVALID_FORMAT; text = (WS_XML_TEXT_NODE *)&reader->current->hdr.node; @@ -1919,7 +1929,7 @@ WS_XML_ELEMENT_NODE *elem = &reader->current->hdr; WS_XML_ATTRIBUTE *attr; - if (reader->current->hdr.node.nodeType != WS_XML_NODE_TYPE_ELEMENT) + if (node_type( reader->current ) != WS_XML_NODE_TYPE_ELEMENT) return WS_E_INVALID_FORMAT; attr = elem->attributes[index]; @@ -1973,7 +1983,7 @@ if (!reader || !localname || !ns || !index) return E_INVALIDARG; - if (reader->current->hdr.node.nodeType != WS_XML_NODE_TYPE_ELEMENT) + if (node_type( reader->current ) != WS_XML_NODE_TYPE_ELEMENT) return WS_E_INVALID_OPERATION; if (!find_attribute( reader, localname, ns, index )) @@ -1987,21 +1997,35 @@ static HRESULT read_get_text( struct reader *reader, WS_TYPE_MAPPING mapping, const WS_XML_STRING *localname, const WS_XML_STRING *ns, - WS_XML_UTF8_TEXT **ret ) + WS_XML_UTF8_TEXT **ret, BOOL *found ) { switch (mapping) { case WS_ATTRIBUTE_TYPE_MAPPING: { ULONG index; - if (!find_attribute( reader, localname, ns, &index )) return WS_E_INVALID_FORMAT; + if (!(*found = find_attribute( reader, localname, ns, &index ))) return S_OK; return read_get_attribute_text( reader, index, ret ); } case WS_ELEMENT_TYPE_MAPPING: case WS_ELEMENT_CONTENT_TYPE_MAPPING: - /* FIXME: verify localname and ns */ - return read_get_node_text( reader, ret ); + { + HRESULT hr; + *found = TRUE; + if (localname) + { + const WS_XML_ELEMENT_NODE *elem = &reader->current->hdr; + if (WsXmlStringEquals( localname, elem->localName, NULL ) != S_OK || + WsXmlStringEquals( ns, elem->ns, NULL ) != S_OK) + { + *found = FALSE; + return S_OK; + } + if ((hr = read_startelement( reader )) != S_OK) return hr; + } + return read_get_node_text( reader, ret ); + } default: FIXME( "mapping %u not supported\n", mapping ); return E_NOTIMPL; @@ -2010,318 +2034,723 @@ static HRESULT read_type_bool( struct reader *reader, WS_TYPE_MAPPING mapping, const WS_XML_STRING *localname, const WS_XML_STRING *ns, - const WS_BOOL_DESCRIPTION *desc, BOOL *ret ) + const WS_BOOL_DESCRIPTION *desc, WS_READ_OPTION option, + WS_HEAP *heap, void *ret, ULONG size ) { WS_XML_UTF8_TEXT *utf8; HRESULT hr; - ULONG len; + BOOL found, val = FALSE; if (desc) { FIXME( "description not supported\n" ); return E_NOTIMPL; } - if ((hr = read_get_text( reader, mapping, localname, ns, &utf8 )) != S_OK) return hr; - len = utf8->value.length; + if ((hr = read_get_text( reader, mapping, localname, ns, &utf8, &found )) != S_OK) return hr; + if (found) + { + ULONG len = utf8->value.length; + if (len == 4 && !memcmp( utf8->value.bytes, "true", 4 )) val = TRUE; + else if (len == 1 && !memcmp( utf8->value.bytes, "1", 1 )) val = TRUE; + else if (len == 5 && !memcmp( utf8->value.bytes, "false", 5 )) val = FALSE; + else if (len == 1 && !memcmp( utf8->value.bytes, "0", 1 )) val = FALSE; + else return WS_E_INVALID_FORMAT; + } - 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; + switch (option) + { + case WS_READ_REQUIRED_VALUE: + if (!found) return WS_E_INVALID_FORMAT; + if (size != sizeof(BOOL)) return E_INVALIDARG; + *(BOOL *)ret = val; + break; + + case WS_READ_REQUIRED_POINTER: + if (!found) return WS_E_INVALID_FORMAT; + /* fall through */ + + case WS_READ_OPTIONAL_POINTER: + { + BOOL *heap_val = NULL; + if (size != sizeof(heap_val)) return E_INVALIDARG; + if (found) + { + if (!(heap_val = ws_alloc( heap, sizeof(*heap_val) ))) return WS_E_QUOTA_EXCEEDED; + *heap_val = val; + } + *(BOOL **)ret = heap_val; + break; + } + default: + FIXME( "read option %u not supported\n", option ); + return E_NOTIMPL; + } return S_OK; } static HRESULT read_type_int8( struct reader *reader, WS_TYPE_MAPPING mapping, const WS_XML_STRING *localname, const WS_XML_STRING *ns, - const WS_INT8_DESCRIPTION *desc, INT8 *ret ) + const WS_INT8_DESCRIPTION *desc, WS_READ_OPTION option, + WS_HEAP *heap, void *ret, ULONG size ) { WS_XML_UTF8_TEXT *utf8; HRESULT hr; INT64 val; + BOOL found; if (desc) { FIXME( "description not supported\n" ); return E_NOTIMPL; } - if ((hr = read_get_text( reader, mapping, localname, ns, &utf8 )) != S_OK) return hr; - - if ((hr = str_to_int64( utf8->value.bytes, utf8->value.length, MIN_INT8, MAX_INT8, &val )) != S_OK) + if ((hr = read_get_text( reader, mapping, localname, ns, &utf8, &found )) != S_OK) return hr; + if (found && (hr = str_to_int64( utf8->value.bytes, utf8->value.length, MIN_INT8, MAX_INT8, &val )) != S_OK) return hr; - *ret = val; + switch (option) + { + case WS_READ_REQUIRED_VALUE: + if (!found) return WS_E_INVALID_FORMAT; + if (size != sizeof(INT8)) return E_INVALIDARG; + *(INT8 *)ret = val; + break; + + case WS_READ_REQUIRED_POINTER: + if (!found) return WS_E_INVALID_FORMAT; + /* fall through */ + + case WS_READ_OPTIONAL_POINTER: + { + INT8 *heap_val = NULL; + if (size != sizeof(heap_val)) return E_INVALIDARG; + if (found) + { + if (!(heap_val = ws_alloc( heap, sizeof(*heap_val) ))) return WS_E_QUOTA_EXCEEDED; + *heap_val = val; + } + *(INT8 **)ret = heap_val; + break; + } + default: + FIXME( "read option %u not supported\n", option ); + return E_NOTIMPL; + } + return S_OK; } static HRESULT read_type_int16( struct reader *reader, WS_TYPE_MAPPING mapping, const WS_XML_STRING *localname, const WS_XML_STRING *ns, - const WS_INT16_DESCRIPTION *desc, INT16 *ret ) + const WS_INT16_DESCRIPTION *desc, WS_READ_OPTION option, + WS_HEAP *heap, void *ret, ULONG size ) { WS_XML_UTF8_TEXT *utf8; HRESULT hr; INT64 val; + BOOL found; if (desc) { FIXME( "description not supported\n" ); return E_NOTIMPL; } - if ((hr = read_get_text( reader, mapping, localname, ns, &utf8 )) != S_OK) return hr; - - if ((hr = str_to_int64( utf8->value.bytes, utf8->value.length, MIN_INT16, MAX_INT16, &val )) != S_OK) + if ((hr = read_get_text( reader, mapping, localname, ns, &utf8, &found )) != S_OK) return hr; + if (found && (hr = str_to_int64( utf8->value.bytes, utf8->value.length, MIN_INT16, MAX_INT16, &val )) != S_OK) return hr; - *ret = val; + switch (option) + { + case WS_READ_REQUIRED_VALUE: + if (!found) return WS_E_INVALID_FORMAT; + if (size != sizeof(INT16)) return E_INVALIDARG; + *(INT16 *)ret = val; + break; + + case WS_READ_REQUIRED_POINTER: + if (!found) return WS_E_INVALID_FORMAT; + /* fall through */ + + case WS_READ_OPTIONAL_POINTER: + { + INT16 *heap_val = NULL; + if (size != sizeof(heap_val)) return E_INVALIDARG; + if (found) + { + if (!(heap_val = ws_alloc( heap, sizeof(*heap_val) ))) return WS_E_QUOTA_EXCEEDED; + *heap_val = val; + } + *(INT16 **)ret = heap_val; + break; + } + default: + FIXME( "read option %u not supported\n", option ); + return E_NOTIMPL; + } + return S_OK; } static HRESULT read_type_int32( struct reader *reader, WS_TYPE_MAPPING mapping, const WS_XML_STRING *localname, const WS_XML_STRING *ns, - const WS_INT32_DESCRIPTION *desc, INT32 *ret ) + const WS_INT32_DESCRIPTION *desc, WS_READ_OPTION option, + WS_HEAP *heap, void *ret, ULONG size ) { WS_XML_UTF8_TEXT *utf8; HRESULT hr; INT64 val; + BOOL found; if (desc) { FIXME( "description not supported\n" ); return E_NOTIMPL; } - if ((hr = read_get_text( reader, mapping, localname, ns, &utf8 )) != S_OK) return hr; - - if ((hr = str_to_int64( utf8->value.bytes, utf8->value.length, MIN_INT32, MAX_INT32, &val )) != S_OK) + if ((hr = read_get_text( reader, mapping, localname, ns, &utf8, &found )) != S_OK) return hr; + if (found && (hr = str_to_int64( utf8->value.bytes, utf8->value.length, MIN_INT32, MAX_INT32, &val )) != S_OK) return hr; - *ret = val; + switch (option) + { + case WS_READ_REQUIRED_VALUE: + if (!found) return WS_E_INVALID_FORMAT; + if (size != sizeof(INT32)) return E_INVALIDARG; + *(INT32 *)ret = val; + break; + + case WS_READ_REQUIRED_POINTER: + if (!found) return WS_E_INVALID_FORMAT; + /* fall through */ + + case WS_READ_OPTIONAL_POINTER: + { + INT32 *heap_val = NULL; + if (size != sizeof(heap_val)) return E_INVALIDARG; + if (found) + { + if (!(heap_val = ws_alloc( heap, sizeof(*heap_val) ))) return WS_E_QUOTA_EXCEEDED; + *heap_val = val; + } + *(INT32 **)ret = heap_val; + break; + } + default: + FIXME( "read option %u not supported\n", option ); + return E_NOTIMPL; + } + return S_OK; } static HRESULT read_type_int64( struct reader *reader, WS_TYPE_MAPPING mapping, const WS_XML_STRING *localname, const WS_XML_STRING *ns, - const WS_INT64_DESCRIPTION *desc, INT64 *ret ) + const WS_INT64_DESCRIPTION *desc, WS_READ_OPTION option, + WS_HEAP *heap, void *ret, ULONG size ) { WS_XML_UTF8_TEXT *utf8; HRESULT hr; INT64 val; + BOOL found; if (desc) { FIXME( "description not supported\n" ); return E_NOTIMPL; } - if ((hr = read_get_text( reader, mapping, localname, ns, &utf8 )) != S_OK) return hr; - - if ((hr = str_to_int64( utf8->value.bytes, utf8->value.length, MIN_INT64, MAX_INT64, &val )) != S_OK) + if ((hr = read_get_text( reader, mapping, localname, ns, &utf8, &found )) != S_OK) return hr; + if (found && (hr = str_to_int64( utf8->value.bytes, utf8->value.length, MIN_INT64, MAX_INT64, &val )) != S_OK) return hr; - *ret = val; + switch (option) + { + case WS_READ_REQUIRED_VALUE: + if (!found) return WS_E_INVALID_FORMAT; + if (size != sizeof(INT64)) return E_INVALIDARG; + *(INT64 *)ret = val; + break; + + case WS_READ_REQUIRED_POINTER: + if (!found) return WS_E_INVALID_FORMAT; + /* fall through */ + + case WS_READ_OPTIONAL_POINTER: + { + INT64 *heap_val = NULL; + if (size != sizeof(heap_val)) return E_INVALIDARG; + if (found) + { + if (!(heap_val = ws_alloc( heap, sizeof(*heap_val) ))) return WS_E_QUOTA_EXCEEDED; + *heap_val = val; + } + *(INT64 **)ret = heap_val; + break; + } + default: + FIXME( "read option %u not supported\n", option ); + return E_NOTIMPL; + } + return S_OK; } static HRESULT read_type_uint8( struct reader *reader, WS_TYPE_MAPPING mapping, const WS_XML_STRING *localname, const WS_XML_STRING *ns, - const WS_UINT8_DESCRIPTION *desc, UINT8 *ret ) + const WS_UINT8_DESCRIPTION *desc, WS_READ_OPTION option, + WS_HEAP *heap, void *ret, ULONG size ) { WS_XML_UTF8_TEXT *utf8; HRESULT hr; UINT64 val; + BOOL found; if (desc) { FIXME( "description not supported\n" ); return E_NOTIMPL; } - if ((hr = read_get_text( reader, mapping, localname, ns, &utf8 )) != S_OK) return hr; - - if ((hr = str_to_uint64( utf8->value.bytes, utf8->value.length, MAX_UINT8, &val )) != S_OK) + if ((hr = read_get_text( reader, mapping, localname, ns, &utf8, &found )) != S_OK) return hr; + if (found && (hr = str_to_uint64( utf8->value.bytes, utf8->value.length, MAX_UINT8, &val )) != S_OK) return hr; - *ret = val; + switch (option) + { + case WS_READ_REQUIRED_VALUE: + if (!found) return WS_E_INVALID_FORMAT; + if (size != sizeof(UINT8)) return E_INVALIDARG; + *(UINT8 *)ret = val; + break; + + case WS_READ_REQUIRED_POINTER: + if (!found) return WS_E_INVALID_FORMAT; + /* fall through */ + + case WS_READ_OPTIONAL_POINTER: + { + UINT8 *heap_val = NULL; + if (size != sizeof(heap_val)) return E_INVALIDARG; + if (found) + { + if (!(heap_val = ws_alloc( heap, sizeof(*heap_val) ))) return WS_E_QUOTA_EXCEEDED; + *heap_val = val; + } + *(UINT8 **)ret = heap_val; + break; + } + default: + FIXME( "read option %u not supported\n", option ); + return E_NOTIMPL; + } + return S_OK; } static HRESULT read_type_uint16( struct reader *reader, WS_TYPE_MAPPING mapping, const WS_XML_STRING *localname, const WS_XML_STRING *ns, - const WS_UINT16_DESCRIPTION *desc, UINT16 *ret ) + const WS_UINT16_DESCRIPTION *desc, WS_READ_OPTION option, + WS_HEAP *heap, void *ret, ULONG size ) { WS_XML_UTF8_TEXT *utf8; HRESULT hr; UINT64 val; + BOOL found; if (desc) { FIXME( "description not supported\n" ); return E_NOTIMPL; } - if ((hr = read_get_text( reader, mapping, localname, ns, &utf8 )) != S_OK) return hr; - - if ((hr = str_to_uint64( utf8->value.bytes, utf8->value.length, MAX_UINT16, &val )) != S_OK) + if ((hr = read_get_text( reader, mapping, localname, ns, &utf8, &found )) != S_OK) return hr; + if (found && (hr = str_to_uint64( utf8->value.bytes, utf8->value.length, MAX_UINT16, &val )) != S_OK) return hr; - *ret = val; + switch (option) + { + case WS_READ_REQUIRED_VALUE: + if (!found) return WS_E_INVALID_FORMAT; + if (size != sizeof(UINT16)) return E_INVALIDARG; + *(UINT16 *)ret = val; + break; + + case WS_READ_REQUIRED_POINTER: + if (!found) return WS_E_INVALID_FORMAT; + /* fall through */ + + case WS_READ_OPTIONAL_POINTER: + { + UINT16 *heap_val = NULL; + if (size != sizeof(heap_val)) return E_INVALIDARG; + if (found) + { + if (!(heap_val = ws_alloc( heap, sizeof(*heap_val) ))) return WS_E_QUOTA_EXCEEDED; + *heap_val = val; + } + *(UINT16 **)ret = heap_val; + break; + } + default: + FIXME( "read option %u not supported\n", option ); + return E_NOTIMPL; + } + return S_OK; } static HRESULT read_type_uint32( struct reader *reader, WS_TYPE_MAPPING mapping, const WS_XML_STRING *localname, const WS_XML_STRING *ns, - const WS_UINT32_DESCRIPTION *desc, UINT32 *ret ) + const WS_UINT32_DESCRIPTION *desc, WS_READ_OPTION option, + WS_HEAP *heap, void *ret, ULONG size ) { WS_XML_UTF8_TEXT *utf8; HRESULT hr; UINT64 val; + BOOL found; if (desc) { FIXME( "description not supported\n" ); return E_NOTIMPL; } - if ((hr = read_get_text( reader, mapping, localname, ns, &utf8 )) != S_OK) return hr; - - if ((hr = str_to_uint64( utf8->value.bytes, utf8->value.length, MAX_UINT32, &val )) != S_OK) + if ((hr = read_get_text( reader, mapping, localname, ns, &utf8, &found )) != S_OK) return hr; + if (found && (hr = str_to_uint64( utf8->value.bytes, utf8->value.length, MAX_UINT32, &val )) != S_OK) return hr; - *ret = val; + switch (option) + { + case WS_READ_REQUIRED_VALUE: + if (!found) return WS_E_INVALID_FORMAT; + if (size != sizeof(UINT32)) return E_INVALIDARG; + *(UINT32 *)ret = val; + break; + + case WS_READ_REQUIRED_POINTER: + if (!found) return WS_E_INVALID_FORMAT; + /* fall through */ + + case WS_READ_OPTIONAL_POINTER: + { + UINT32 *heap_val = NULL; + if (size != sizeof(heap_val)) return E_INVALIDARG; + if (found) + { + if (!(heap_val = ws_alloc( heap, sizeof(*heap_val) ))) return WS_E_QUOTA_EXCEEDED; + *heap_val = val; + } + *(UINT32 **)ret = heap_val; + break; + } + default: + FIXME( "read option %u not supported\n", option ); + return E_NOTIMPL; + } + return S_OK; } static HRESULT read_type_uint64( struct reader *reader, WS_TYPE_MAPPING mapping, const WS_XML_STRING *localname, const WS_XML_STRING *ns, - const WS_UINT64_DESCRIPTION *desc, UINT64 *ret ) + const WS_UINT64_DESCRIPTION *desc, WS_READ_OPTION option, + WS_HEAP *heap, void *ret, ULONG size ) { WS_XML_UTF8_TEXT *utf8; HRESULT hr; UINT64 val; + BOOL found; if (desc) { FIXME( "description not supported\n" ); return E_NOTIMPL; } - if ((hr = read_get_text( reader, mapping, localname, ns, &utf8 )) != S_OK) return hr; - - if ((hr = str_to_uint64( utf8->value.bytes, utf8->value.length, MAX_UINT64, &val )) != S_OK) + if ((hr = read_get_text( reader, mapping, localname, ns, &utf8, &found )) != S_OK) return hr; + if (found && (hr = str_to_uint64( utf8->value.bytes, utf8->value.length, MAX_UINT64, &val )) != S_OK) return hr; - *ret = val; + switch (option) + { + case WS_READ_REQUIRED_VALUE: + if (!found) return WS_E_INVALID_FORMAT; + if (size != sizeof(UINT64)) return E_INVALIDARG; + *(UINT64 *)ret = val; + break; + + case WS_READ_REQUIRED_POINTER: + if (!found) return WS_E_INVALID_FORMAT; + /* fall through */ + + case WS_READ_OPTIONAL_POINTER: + { + UINT64 *heap_val = NULL; + if (size != sizeof(heap_val)) return E_INVALIDARG; + if (found) + { + if (!(heap_val = ws_alloc( heap, sizeof(*heap_val) ))) return WS_E_QUOTA_EXCEEDED; + *heap_val = val; + } + *(UINT64 **)ret = heap_val; + break; + } + default: + FIXME( "read option %u not supported\n", option ); + return E_NOTIMPL; + } + return S_OK; } static HRESULT read_type_wsz( struct reader *reader, WS_TYPE_MAPPING mapping, const WS_XML_STRING *localname, const WS_XML_STRING *ns, - const WS_WSZ_DESCRIPTION *desc, WS_HEAP *heap, WCHAR **ret ) + const WS_WSZ_DESCRIPTION *desc, WS_READ_OPTION option, + WS_HEAP *heap, WCHAR **ret, ULONG size ) { WS_XML_UTF8_TEXT *utf8; HRESULT hr; - WCHAR *str; + WCHAR *str = NULL; + BOOL found; if (desc) { FIXME( "description not supported\n" ); return E_NOTIMPL; } - if ((hr = read_get_text( reader, mapping, localname, ns, &utf8 )) != S_OK) return hr; + if ((hr = read_get_text( reader, mapping, localname, ns, &utf8, &found )) != S_OK) return hr; + if (found && !(str = xmltext_to_widechar( heap, &utf8->text ))) return WS_E_QUOTA_EXCEEDED; + + switch (option) + { + case WS_READ_REQUIRED_POINTER: + if (!found) return WS_E_INVALID_FORMAT; + /* fall through */ + + case WS_READ_OPTIONAL_POINTER: + if (size != sizeof(str)) return E_INVALIDARG; + *ret = str; + break; + + default: + FIXME( "read option %u not supported\n", option ); + return E_NOTIMPL; + } - 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_XML_STRING *localname, - const WS_XML_STRING *ns, const WS_STRUCT_DESCRIPTION *, WS_HEAP *, - void ** ); +static ULONG get_type_size( WS_TYPE type, const WS_STRUCT_DESCRIPTION *desc ) +{ + switch (type) + { + case WS_INT8_TYPE: + case WS_UINT8_TYPE: + return sizeof(INT8); + + case WS_INT16_TYPE: + case WS_UINT16_TYPE: + return sizeof(INT16); + + case WS_BOOL_TYPE: + case WS_INT32_TYPE: + case WS_UINT32_TYPE: + return sizeof(INT32); + + case WS_INT64_TYPE: + case WS_UINT64_TYPE: + return sizeof(INT64); + + case WS_WSZ_TYPE: + return sizeof(WCHAR *); + + case WS_STRUCT_TYPE: + return desc->size; + + default: + ERR( "unhandled type %u\n", type ); + return 0; + } +} + +static HRESULT read_type( struct reader *, WS_TYPE_MAPPING, WS_TYPE, const WS_XML_STRING *, + const WS_XML_STRING *, const void *, WS_READ_OPTION, WS_HEAP *, + void *, ULONG ); -static HRESULT read_type_struct_field( struct reader *reader, const WS_FIELD_DESCRIPTION *desc, - WS_HEAP *heap, char *buf ) +static HRESULT read_type_repeating_element( struct reader *reader, const WS_FIELD_DESCRIPTION *desc, + WS_READ_OPTION option, WS_HEAP *heap, void **ret, + ULONG size, ULONG *count ) { - char *ptr = buf + desc->offset; - WS_TYPE_MAPPING mapping; HRESULT hr; + ULONG item_size, nb_items = 0, nb_allocated = 1, offset = 0; + char *buf; + + if (desc->itemRange) + FIXME( "ignoring range (%u-%u)\n", desc->itemRange->minItemCount, desc->itemRange->maxItemCount ); + + /* wrapper element */ + if (desc->localName && ((hr = read_node( reader )) != S_OK)) return hr; - if (desc->options && desc->options != WS_FIELD_POINTER && - desc->options != WS_FIELD_OPTIONAL && - desc->options != (WS_FIELD_POINTER | WS_FIELD_OPTIONAL)) + item_size = get_type_size( desc->type, desc->typeDescription ); + if (!(buf = ws_alloc_zero( heap, item_size ))) return WS_E_QUOTA_EXCEEDED; + for (;;) { - FIXME( "options 0x%x not supported\n", desc->options ); - return E_NOTIMPL; + if (nb_items >= nb_allocated) + { + if (!(buf = ws_realloc_zero( heap, buf, nb_allocated * 2 * item_size ))) + return WS_E_QUOTA_EXCEEDED; + nb_allocated *= 2; + } + hr = read_type( reader, WS_ELEMENT_TYPE_MAPPING, desc->type, desc->itemLocalName, desc->itemNs, + desc->typeDescription, WS_READ_REQUIRED_VALUE, heap, buf + offset, item_size ); + if (hr == WS_E_INVALID_FORMAT) break; + if (hr != S_OK) + { + ws_free( heap, buf ); + return hr; + } + if ((hr = read_node( reader )) != S_OK) + { + ws_free( heap, buf ); + return hr; + } + offset += item_size; + nb_items++; } - switch (desc->mapping) + if (desc->localName && ((hr = read_node( reader )) != S_OK)) return hr; + + if (!nb_items) { - case WS_ATTRIBUTE_FIELD_MAPPING: - mapping = WS_ATTRIBUTE_TYPE_MAPPING; - break; + ws_free( heap, buf ); + buf = NULL; + } - case WS_ELEMENT_FIELD_MAPPING: - mapping = WS_ELEMENT_TYPE_MAPPING; + switch (option) + { + case WS_READ_REQUIRED_POINTER: + if (!nb_items) return WS_E_INVALID_FORMAT; + /* fall through */ + + case WS_READ_OPTIONAL_POINTER: + if (size < sizeof(void *)) return E_INVALIDARG; + *ret = buf; break; default: - FIXME( "unhandled field mapping %u\n", desc->mapping ); + FIXME( "read option %u not supported\n", option ); return E_NOTIMPL; } - switch (desc->type) + *count = nb_items; + return S_OK; +} + +static HRESULT read_type_text( struct reader *reader, const WS_FIELD_DESCRIPTION *desc, + WS_READ_OPTION option, WS_HEAP *heap, void *ret, ULONG size ) +{ + HRESULT hr; + BOOL found; + + if ((hr = read_to_startelement( reader, &found )) != S_OK) return S_OK; + if (!found) return WS_E_INVALID_FORMAT; + if ((hr = read_node( reader )) != S_OK) return hr; + + return read_type( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, desc->type, NULL, NULL, + desc->typeDescription, option, heap, ret, size ); +} + +static WS_READ_OPTION map_field_options( WS_TYPE type, ULONG options ) +{ + if (options & !(WS_FIELD_POINTER | WS_FIELD_OPTIONAL)) { - case WS_STRUCT_TYPE: - hr = read_type_struct( reader, mapping, desc->localName, desc->ns, desc->typeDescription, heap, (void **)ptr ); - break; + FIXME( "options %08x not supported\n", options ); + return 0; + } + switch (type) + { case WS_BOOL_TYPE: - hr = read_type_bool( reader, mapping, desc->localName, desc->ns, desc->typeDescription, (BOOL *)ptr ); - break; - case WS_INT8_TYPE: - hr = read_type_int8( reader, mapping, desc->localName, desc->ns, desc->typeDescription, (INT8 *)ptr ); - break; - case WS_INT16_TYPE: - hr = read_type_int16( reader, mapping, desc->localName, desc->ns, desc->typeDescription, (INT16 *)ptr ); - break; - case WS_INT32_TYPE: - hr = read_type_int32( reader, mapping, desc->localName, desc->ns, desc->typeDescription, (INT32 *)ptr ); - break; - case WS_INT64_TYPE: - hr = read_type_int64( reader, mapping, desc->localName, desc->ns, desc->typeDescription, (INT64 *)ptr ); - break; - case WS_UINT8_TYPE: - hr = read_type_uint8( reader, mapping, desc->localName, desc->ns, desc->typeDescription, (UINT8 *)ptr ); - break; - case WS_UINT16_TYPE: - hr = read_type_uint16( reader, mapping, desc->localName, desc->ns, desc->typeDescription, (UINT16 *)ptr ); - break; - case WS_UINT32_TYPE: - hr = read_type_uint32( reader, mapping, desc->localName, desc->ns, desc->typeDescription, (UINT32 *)ptr ); + case WS_UINT64_TYPE: + return WS_READ_REQUIRED_VALUE; + + case WS_WSZ_TYPE: + case WS_STRUCT_TYPE: + return WS_READ_REQUIRED_POINTER; + + default: + FIXME( "unhandled type %u\n", type ); + return 0; + } +} + +static HRESULT read_type_struct_field( struct reader *reader, const WS_FIELD_DESCRIPTION *desc, + WS_HEAP *heap, char *buf, ULONG size ) +{ + char *ptr = buf + desc->offset; + WS_READ_OPTION option; + HRESULT hr; + + if (!(option = map_field_options( desc->type, desc->options ))) return E_INVALIDARG; + + switch (desc->mapping) + { + case WS_ATTRIBUTE_FIELD_MAPPING: + hr = read_type( reader, WS_ATTRIBUTE_TYPE_MAPPING, desc->type, desc->localName, desc->ns, + desc->typeDescription, option, heap, ptr, size ); break; - case WS_UINT64_TYPE: - hr = read_type_uint64( reader, mapping, desc->localName, desc->ns, desc->typeDescription, (UINT64 *)ptr ); + case WS_ELEMENT_FIELD_MAPPING: + hr = read_type( reader, WS_ELEMENT_TYPE_MAPPING, desc->type, desc->localName, desc->ns, + desc->typeDescription, option, heap, ptr, size ); break; - case WS_WSZ_TYPE: - hr = read_type_wsz( reader, mapping, desc->localName, desc->ns, desc->typeDescription, heap, (WCHAR **)ptr ); + case WS_REPEATING_ELEMENT_FIELD_MAPPING: + { + ULONG count; + hr = read_type_repeating_element( reader, desc, option, heap, (void **)ptr, size, &count ); + if (hr == S_OK) *(ULONG *)(ptr + desc->countOffset) = count; + break; + } + case WS_TEXT_FIELD_MAPPING: + hr = read_type_text( reader, desc, option, heap, ptr, size ); break; default: - FIXME( "type %u not implemented\n", desc->type ); + FIXME( "unhandled field mapping %u\n", desc->mapping ); return E_NOTIMPL; } + + if (hr == WS_E_INVALID_FORMAT && desc->options & WS_FIELD_OPTIONAL) + { + switch (option) + { + case WS_READ_REQUIRED_VALUE: + if (desc->defaultValue) memcpy( ptr, desc->defaultValue->value, desc->defaultValue->valueSize ); + else memset( ptr, 0, size ); + return S_OK; + + case WS_READ_REQUIRED_POINTER: + *(void **)ptr = NULL; + return S_OK; + + default: + ERR( "unhandled option %u\n", option ); + return E_NOTIMPL; + } + } + return hr; } static HRESULT read_type_struct( struct reader *reader, WS_TYPE_MAPPING mapping, const WS_XML_STRING *localname, const WS_XML_STRING *ns, - const WS_STRUCT_DESCRIPTION *desc, WS_HEAP *heap, void **ret ) + const WS_STRUCT_DESCRIPTION *desc, WS_READ_OPTION option, + WS_HEAP *heap, void *ret, ULONG size ) { - ULONG i; + ULONG i, field_size; HRESULT hr; char *buf; @@ -2329,185 +2758,203 @@ if (desc->structOptions) { - FIXME( "struct options 0x%x not supported\n", desc->structOptions ); + FIXME( "struct options %08x not supported\n", desc->structOptions ); return E_NOTIMPL; } - switch (mapping) + switch (option) { - case WS_ELEMENT_TYPE_MAPPING: - if ((hr = read_to_startelement( reader, NULL )) != S_OK) return hr; + case WS_READ_REQUIRED_POINTER: + case WS_READ_OPTIONAL_POINTER: + if (size < sizeof(void *)) return E_INVALIDARG; + if (!(buf = ws_alloc_zero( heap, desc->size ))) return WS_E_QUOTA_EXCEEDED; 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; + case WS_READ_REQUIRED_VALUE: + if (size != desc->size) return E_INVALIDARG; + buf = ret; break; default: - FIXME( "unhandled mapping %u\n", mapping ); + FIXME( "unhandled read option %u\n", option ); 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) + field_size = get_field_size( desc, i ); + if ((hr = read_type_struct_field( reader, desc->fields[i], heap, buf, field_size )) != S_OK) + break; + } + + switch (option) + { + case WS_READ_REQUIRED_POINTER: + if (hr != S_OK) { ws_free( heap, buf ); return hr; } + *(char **)ret = buf; + return S_OK; + + case WS_READ_OPTIONAL_POINTER: + if (hr != S_OK) + { + ws_free( heap, buf ); + buf = NULL; + } + *(char **)ret = buf; + return S_OK; + + case WS_READ_REQUIRED_VALUE: + return hr; + + default: + ERR( "unhandled read option %u\n", option ); + return E_NOTIMPL; } +} - switch (mapping) +static BOOL is_empty_text_node( const struct node *node ) +{ + const WS_XML_TEXT_NODE *text = (const WS_XML_TEXT_NODE *)node; + const WS_XML_UTF8_TEXT *utf8; + ULONG i; + + if (node_type( node ) != WS_XML_NODE_TYPE_TEXT) return FALSE; + if (text->text->textType != WS_XML_TEXT_TYPE_UTF8) { - case WS_ELEMENT_TYPE_MAPPING: - if ((hr = read_startelement( reader )) != S_OK) return hr; - if ((hr = read_node( reader )) != S_OK) return hr; - break; + ERR( "unhandled text type %u\n", text->text->textType ); + return FALSE; + } + utf8 = (const WS_XML_UTF8_TEXT *)text->text; + for (i = 0; i < utf8->value.length; i++) if (!read_isspace( utf8->value.bytes[i] )) return FALSE; + return TRUE; +} - 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; +static HRESULT read_type_next_node( struct reader *reader, const WS_XML_STRING *localname, + const WS_XML_STRING *ns ) +{ + const WS_XML_ELEMENT_NODE *elem; + WS_XML_NODE_TYPE type; + HRESULT hr; + BOOL found; - default: break; + if (!localname) return S_OK; /* assume reader is already correctly positioned */ + if ((hr = read_to_startelement( reader, &found ) != S_OK)) return hr; + if (!found) return WS_E_INVALID_FORMAT; + + elem = &reader->current->hdr; + if (WsXmlStringEquals( localname, elem->localName, NULL ) == S_OK && + WsXmlStringEquals( ns, elem->ns, NULL ) == S_OK) return S_OK; + + for (;;) + { + if ((hr = read_node( reader ) != S_OK)) return hr; + type = node_type( reader->current ); + if (type == WS_XML_NODE_TYPE_COMMENT || + (type == WS_XML_NODE_TYPE_TEXT && is_empty_text_node( reader->current ))) continue; + break; } - *ret = buf; return S_OK; } static HRESULT read_type( struct reader *reader, WS_TYPE_MAPPING mapping, WS_TYPE type, + const WS_XML_STRING *localname, const WS_XML_STRING *ns, const void *desc, WS_READ_OPTION option, WS_HEAP *heap, void *value, ULONG size ) { + HRESULT hr; + + switch (mapping) + { + case WS_ELEMENT_TYPE_MAPPING: + case WS_ELEMENT_CONTENT_TYPE_MAPPING: + if ((hr = read_type_next_node( reader, localname, ns )) != S_OK) return hr; + break; + + case WS_ATTRIBUTE_TYPE_MAPPING: + break; + + default: + FIXME( "unhandled mapping %u\n", mapping ); + return E_NOTIMPL; + } + switch (type) { case WS_STRUCT_TYPE: - { - void **ptr = value; - if (option != WS_READ_REQUIRED_POINTER || size != sizeof(*ptr)) - return E_INVALIDARG; + if ((hr = read_type_struct( reader, mapping, localname, ns, desc, option, heap, value, size )) != S_OK) + return hr; + break; - return read_type_struct( reader, mapping, NULL, NULL, 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, NULL, NULL, desc, ptr ); - } + if ((hr = read_type_bool( reader, mapping, localname, ns, desc, option, heap, value, size )) != S_OK) + return hr; + break; + 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, NULL, NULL, desc, ptr ); - } + if ((hr = read_type_int8( reader, mapping, localname, ns, desc, option, heap, value, size )) != S_OK) + return hr; + break; + 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, NULL, NULL, desc, ptr ); - } + if ((hr = read_type_int16( reader, mapping, localname, ns, desc, option, heap, value, size )) != S_OK) + return hr; + break; + 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, NULL, NULL, desc, ptr ); - } + if ((hr = read_type_int32( reader, mapping, localname, ns, desc, option, heap, value, size )) != S_OK) + return hr; + break; + 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, NULL, NULL, desc, ptr ); - } + if ((hr = read_type_int64( reader, mapping, localname, ns, desc, option, heap, value, size )) != S_OK) + return hr; + break; + 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, NULL, NULL, desc, ptr ); - } + if ((hr = read_type_uint8( reader, mapping, localname, ns, desc, option, heap, value, size )) != S_OK) + return hr; + break; + 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, NULL, NULL, desc, ptr ); - } + if ((hr = read_type_uint16( reader, mapping, localname, ns, desc, option, heap, value, size )) != S_OK) + return hr; + break; + 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, NULL, NULL, desc, ptr ); - } + if ((hr = read_type_uint32( reader, mapping, localname, ns, desc, option, heap, value, size )) != S_OK) + return hr; + break; + 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, NULL, NULL, desc, ptr ); - } + if ((hr = read_type_uint64( reader, mapping, localname, ns, desc, option, heap, value, size )) != S_OK) + return hr; + break; + 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, NULL, NULL, desc, heap, ptr ); - } + if ((hr = read_type_wsz( reader, mapping, localname, ns, desc, option, heap, value, size )) != S_OK) + return hr; + break; + default: FIXME( "type %u not supported\n", type ); return E_NOTIMPL; } + + switch (mapping) + { + case WS_ELEMENT_TYPE_MAPPING: + case WS_ELEMENT_CONTENT_TYPE_MAPPING: + return read_node( reader ); + + case WS_ATTRIBUTE_TYPE_MAPPING: + default: + return S_OK; + } } /************************************************************************** @@ -2518,6 +2965,7 @@ ULONG size, WS_ERROR *error ) { struct reader *reader = (struct reader *)handle; + HRESULT hr; TRACE( "%p %u %u %p %u %p %p %u %p\n", handle, mapping, type, desc, option, heap, value, size, error ); @@ -2525,7 +2973,12 @@ if (!reader || !value) return E_INVALIDARG; - return read_type( reader, mapping, type, desc, option, heap, value, size ); + if ((hr = read_type( reader, mapping, type, NULL, NULL, desc, option, heap, value, size )) != S_OK) + return hr; + + if ((hr = read_node( reader )) != S_OK) return hr; + if (!read_end_of_data( reader )) return WS_E_INVALID_FORMAT; + return S_OK; } /************************************************************************** diff -Nru wine-staging-1.9.6/dlls/webservices/tests/reader.c wine-staging-1.9.7~ubuntu15.04.1/dlls/webservices/tests/reader.c --- wine-staging-1.9.6/dlls/webservices/tests/reader.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/webservices/tests/reader.c 2016-04-04 18:06:32.000000000 +0000 @@ -64,6 +64,19 @@ static const char data10[] = ""; +static const char data11[] = + "" + "" + "" + "" + ""; + +static const char data12[] = + "" + "1" + "2" + ""; + static void test_WsCreateError(void) { HRESULT hr; @@ -2446,6 +2459,268 @@ WsFreeReader( reader ); } +static void test_text_field_mapping(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]; + 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" ); + + 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 = NULL; + hr = WsReadType( reader, WS_ELEMENT_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" ); + ok( test->str != NULL, "str not set\n" ); + ok( !lstrcmpW( test->str, testW ), "got %s\n", wine_dbgstr_w(test->str) ); + + WsFreeReader( reader ); + WsFreeHeap( heap ); +} + +static void test_complex_struct_type(void) +{ + static const WCHAR timestampW[] = + {'2','0','1','5','-','0','9','-','0','3','T','1','8',':','4','7',':','5','4',0}; + HRESULT hr; + WS_ERROR *error; + WS_ERROR_PROPERTY prop; + WS_XML_READER *reader; + WS_HEAP *heap; + WS_STRUCT_DESCRIPTION s, s2; + WS_FIELD_DESCRIPTION f, f2, *fields[1], *fields2[1]; + WS_XML_STRING str_officeconfig = {12, (BYTE *)"OfficeConfig"}; + WS_XML_STRING str_services = {8, (BYTE *)"services"}; + WS_XML_STRING str_generationtime = {14, (BYTE *)"GenerationTime"}; + WS_XML_STRING ns = {39, (BYTE *)"urn:schemas-microsoft-com:office:office"}; + LANGID langid = MAKELANGID( LANG_ENGLISH, SUBLANG_DEFAULT ); + const WS_XML_NODE *node; + const WS_XML_ELEMENT_NODE *elem; + struct services + { + WCHAR *generationtime; + }; + struct officeconfig + { + struct services *services; + } *test; + + prop.id = WS_ERROR_PROPERTY_LANGID; + prop.value = &langid; + prop.valueSize = sizeof(langid); + hr = WsCreateError( &prop, 1, &error ); + ok( hr == S_OK, "got %08x\n", hr ); + + 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 ); + + /* element content type mapping */ + prepare_struct_type_test( reader, data11 ); + + hr = WsReadToStartElement( reader, NULL, NULL, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + elem = (const WS_XML_ELEMENT_NODE *)node; + ok( elem->node.nodeType == WS_XML_NODE_TYPE_ELEMENT, "got %u\n", elem->node.nodeType ); + ok( elem->localName->length == 12, "got %u\n", elem->localName->length ); + ok( !memcmp( elem->localName->bytes, "OfficeConfig", 12 ), "wrong data\n" ); + + hr = WsReadStartElement( reader, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + elem = (const WS_XML_ELEMENT_NODE *)node; + ok( elem->node.nodeType == WS_XML_NODE_TYPE_ELEMENT, "got %u\n", elem->node.nodeType ); + ok( elem->localName->length == 8, "got %u\n", elem->localName->length ); + ok( !memcmp( elem->localName->bytes, "services", 8 ), "wrong data\n" ); + + memset( &f2, 0, sizeof(f2) ); + f2.mapping = WS_ATTRIBUTE_FIELD_MAPPING; + f2.localName = &str_generationtime; + f2.ns = &ns; + f2.type = WS_WSZ_TYPE; + f2.options = WS_FIELD_OPTIONAL; + fields2[0] = &f2; + + memset( &s2, 0, sizeof(s2) ); + s2.size = sizeof(*test->services); + s2.alignment = TYPE_ALIGNMENT(struct services); + s2.fields = fields2; + s2.fieldCount = 1; + s2.typeLocalName = &str_services; + s2.typeNs = &ns; + + memset( &f, 0, sizeof(f) ); + f.mapping = WS_ELEMENT_FIELD_MAPPING; + f.localName = &str_services; + f.ns = &ns; + f.type = WS_STRUCT_TYPE; + f.typeDescription = &s2; + f.options = WS_FIELD_POINTER; + fields[0] = &f; + + memset( &s, 0, sizeof(s) ); + s.size = sizeof(*test); + s.alignment = TYPE_ALIGNMENT(struct officeconfig); + s.fields = fields; + s.fieldCount = 1; + s.typeLocalName = &str_officeconfig; + s.typeNs = &ns; + + test = NULL; + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_STRUCT_TYPE, &s, + WS_READ_REQUIRED_POINTER, heap, &test, sizeof(test), error ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( test != NULL, "test not set\n" ); + ok( !lstrcmpW( test->services->generationtime, timestampW ), "wrong data\n" ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( node->nodeType == WS_XML_NODE_TYPE_END_ELEMENT, "got %u\n", node->nodeType ); + + hr = WsReadEndElement( reader, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + 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 ); + + hr = WsReadEndElement( reader, NULL ); + ok( hr == WS_E_INVALID_FORMAT, "got %08x\n", hr ); + + /* element type mapping */ + prepare_struct_type_test( reader, data11 ); + + hr = WsReadToStartElement( reader, NULL, NULL, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + elem = (const WS_XML_ELEMENT_NODE *)node; + ok( elem->node.nodeType == WS_XML_NODE_TYPE_ELEMENT, "got %u\n", elem->node.nodeType ); + ok( elem->localName->length == 12, "got %u\n", elem->localName->length ); + ok( !memcmp( elem->localName->bytes, "OfficeConfig", 12 ), "wrong data\n" ); + + test = NULL; + hr = WsReadType( reader, WS_ELEMENT_TYPE_MAPPING, WS_STRUCT_TYPE, &s, + WS_READ_REQUIRED_POINTER, heap, &test, sizeof(test), error ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( test != NULL, "test not set\n" ); + if (test) ok( !lstrcmpW( test->services->generationtime, timestampW ), "wrong data\n" ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + todo_wine ok( node->nodeType == WS_XML_NODE_TYPE_EOF, "got %u\n", node->nodeType ); + + WsFreeReader( reader ); + WsFreeHeap( heap ); + WsFreeError( error ); +} + +static void test_repeating_element(void) +{ + WS_XML_STRING str_services = {8, (BYTE *)"services"}; + WS_XML_STRING str_service = {7, (BYTE *)"service"}; + WS_XML_STRING str_id = {2, (BYTE *)"id"}; + WS_XML_STRING str_ns = {0, NULL}; + HRESULT hr; + WS_XML_READER *reader; + WS_HEAP *heap; + WS_STRUCT_DESCRIPTION s, s2; + WS_FIELD_DESCRIPTION f, f2, *fields[1], *fields2[1]; + struct service + { + UINT32 id; + }; + struct services + { + struct service *service; + ULONG service_count; + } *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, data12 ); + + memset( &f2, 0, sizeof(f2) ); + f2.mapping = WS_ELEMENT_FIELD_MAPPING; + f2.localName = &str_id; + f2.ns = &str_ns; + f2.type = WS_UINT32_TYPE; + fields2[0] = &f2; + + memset( &s2, 0, sizeof(s2) ); + s2.size = sizeof(struct service); + s2.alignment = TYPE_ALIGNMENT(struct service); + s2.fields = fields2; + s2.fieldCount = 1; + s2.typeLocalName = &str_service; + + memset( &f, 0, sizeof(f) ); + f.mapping = WS_REPEATING_ELEMENT_FIELD_MAPPING; + f.countOffset = FIELD_OFFSET(struct services, service_count); + f.type = WS_STRUCT_TYPE; + f.typeDescription = &s2; + f.itemLocalName = &str_service; + f.itemNs = &str_ns; + fields[0] = &f; + + memset( &s, 0, sizeof(s) ); + s.size = sizeof(struct services); + s.alignment = TYPE_ALIGNMENT(struct services); + s.fields = fields; + s.fieldCount = 1; + s.typeLocalName = &str_services; + + test = NULL; + hr = WsReadType( reader, WS_ELEMENT_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" ); + ok( test->service != NULL, "service not set\n" ); + ok( test->service_count == 2, "got %u\n", test->service_count ); + ok( test->service[0].id == 1, "got %u\n", test->service[0].id ); + ok( test->service[1].id == 2, "got %u\n", test->service[1].id ); + + WsFreeReader( reader ); + WsFreeHeap( heap ); +} + START_TEST(reader) { test_WsCreateError(); @@ -2467,4 +2742,7 @@ test_cdata(); test_WsFindAttribute(); test_WsGetNamespaceFromPrefix(); + test_text_field_mapping(); + test_complex_struct_type(); + test_repeating_element(); } diff -Nru wine-staging-1.9.6/dlls/webservices/webservices_private.h wine-staging-1.9.7~ubuntu15.04.1/dlls/webservices/webservices_private.h --- wine-staging-1.9.6/dlls/webservices/webservices_private.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/webservices/webservices_private.h 2016-04-04 18:06:32.000000000 +0000 @@ -32,6 +32,7 @@ WS_XML_UTF8_TEXT *alloc_utf8_text( const unsigned char *, ULONG ) DECLSPEC_HIDDEN; HRESULT append_attribute( WS_XML_ELEMENT_NODE *, WS_XML_ATTRIBUTE * ) DECLSPEC_HIDDEN; void free_attribute( WS_XML_ATTRIBUTE * ) DECLSPEC_HIDDEN; +ULONG get_field_size( const WS_STRUCT_DESCRIPTION *, ULONG ) DECLSPEC_HIDDEN; struct node { @@ -45,6 +46,11 @@ void free_node( struct node * ) DECLSPEC_HIDDEN; void destroy_nodes( struct node * ) DECLSPEC_HIDDEN; +static inline WS_XML_NODE_TYPE node_type( const struct node *node ) +{ + return node->hdr.node.nodeType; +} + static inline void *heap_alloc( SIZE_T size ) { return HeapAlloc( GetProcessHeap(), 0, size ); diff -Nru wine-staging-1.9.6/dlls/webservices/writer.c wine-staging-1.9.7~ubuntu15.04.1/dlls/webservices/writer.c --- wine-staging-1.9.6/dlls/webservices/writer.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/webservices/writer.c 2016-04-04 18:06:32.000000000 +0000 @@ -601,8 +601,8 @@ { struct node *node = writer->current; - if (node->hdr.node.nodeType == WS_XML_NODE_TYPE_ELEMENT) return node; - if (node->parent->hdr.node.nodeType == WS_XML_NODE_TYPE_ELEMENT) return node->parent; + if (node_type( node ) == WS_XML_NODE_TYPE_ELEMENT) return node; + if (node_type( node->parent ) == WS_XML_NODE_TYPE_ELEMENT) return node->parent; return NULL; } @@ -894,15 +894,15 @@ const WS_XML_STRING *localname, const WS_XML_STRING *ns ) { struct node *node; - WS_XML_ELEMENT_NODE *elem, *current = &writer->current->hdr; + WS_XML_ELEMENT_NODE *elem; 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 (!prefix && node_type( writer->current ) == WS_XML_NODE_TYPE_ELEMENT) + prefix = writer->current->hdr.prefix; if (!(node = alloc_node( WS_XML_NODE_TYPE_ELEMENT ))) return E_OUTOFMEMORY; elem = &node->hdr; @@ -1378,7 +1378,7 @@ return S_OK; } -static ULONG get_field_size( const WS_STRUCT_DESCRIPTION *desc, ULONG index ) +ULONG get_field_size( const WS_STRUCT_DESCRIPTION *desc, ULONG index ) { if (index < desc->fieldCount - 1) return desc->fields[index + 1]->offset - desc->fields[index]->offset; return desc->size - desc->fields[index]->offset; diff -Nru wine-staging-1.9.6/dlls/winecoreaudio.drv/mmdevdrv.c wine-staging-1.9.7~ubuntu15.04.1/dlls/winecoreaudio.drv/mmdevdrv.c --- wine-staging-1.9.6/dlls/winecoreaudio.drv/mmdevdrv.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/winecoreaudio.drv/mmdevdrv.c 2016-04-04 18:06:32.000000000 +0000 @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -1233,6 +1234,8 @@ AudioStreamBasicDescription desc; UInt32 size; Float64 rate; + fenv_t fenv; + BOOL fenv_stored = TRUE; hr = ca_get_audiodesc(&desc, fmt); if(FAILED(hr)) @@ -1262,7 +1265,17 @@ return osstatus_to_hresult(sc); } + /* AudioConverterNew requires divide-by-zero SSE exceptions to be masked */ + if(feholdexcept(&fenv)){ + WARN("Failed to store fenv state\n"); + fenv_stored = FALSE; + } + sc = AudioConverterNew(dev_desc, &desc, converter); + + if(fenv_stored && fesetenv(&fenv)) + WARN("Failed to restore fenv state\n"); + if(sc != noErr){ WARN("Couldn't create audio converter: %x\n", (int)sc); return osstatus_to_hresult(sc); diff -Nru wine-staging-1.9.6/dlls/wined3d/arb_program_shader.c wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/arb_program_shader.c --- wine-staging-1.9.6/dlls/wined3d/arb_program_shader.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/arb_program_shader.c 2016-04-04 18:06:32.000000000 +0000 @@ -79,9 +79,9 @@ static const char *arb_get_helper_value(enum wined3d_shader_type shader, enum arb_helper_value value) { - if (shader == WINED3D_SHADER_TYPE_GEOMETRY) + if (shader != WINED3D_SHADER_TYPE_VERTEX && shader != WINED3D_SHADER_TYPE_PIXEL) { - ERR("Geometry shaders are unsupported\n"); + ERR("Unsupported shader type '%s'.\n.", debug_shader_type(shader)); return "bad"; } @@ -109,7 +109,7 @@ case ARB_VS_REL_OFFSET: return "rel_addr_const.y"; } } - FIXME("Unmanaged %s shader helper constant requested: %u\n", + FIXME("Unmanaged %s shader helper constant requested: %u.\n", shader == WINED3D_SHADER_TYPE_PIXEL ? "pixel" : "vertex", value); switch (value) { @@ -4832,7 +4832,9 @@ context->shader_update_mask = (1u << WINED3D_SHADER_TYPE_PIXEL) | (1u << WINED3D_SHADER_TYPE_VERTEX) - | (1u << WINED3D_SHADER_TYPE_GEOMETRY); + | (1u << WINED3D_SHADER_TYPE_GEOMETRY) + | (1u << WINED3D_SHADER_TYPE_HULL) + | (1u << WINED3D_SHADER_TYPE_DOMAIN); } /* Context activation is done by the caller. */ @@ -5120,6 +5122,8 @@ caps->vs_uniform_count = 0; } + caps->hs_version = 0; + caps->ds_version = 0; caps->gs_version = 0; if (gl_info->supported[ARB_FRAGMENT_PROGRAM]) @@ -5212,153 +5216,166 @@ 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_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_DSX_COARSE */ NULL, - /* WINED3DSIH_DSX_FINE */ NULL, - /* WINED3DSIH_DSY */ shader_hw_dsy, - /* WINED3DSIH_DSY_COARSE */ NULL, - /* WINED3DSIH_DSY_FINE */ NULL, - /* 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_LD_STRUCTURED */ 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, + /* 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_HS_FORK_PHASE_INSTANCE_COUNT */ NULL, + /* WINED3DSIH_DCL_HS_MAX_TESSFACTOR */ NULL, + /* WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER */ NULL, + /* WINED3DSIH_DCL_INPUT */ NULL, + /* WINED3DSIH_DCL_INPUT_CONTROL_POINT_COUNT */ 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_CONTROL_POINT_COUNT */ NULL, + /* WINED3DSIH_DCL_OUTPUT_SIV */ NULL, + /* WINED3DSIH_DCL_OUTPUT_TOPOLOGY */ shader_hw_nop, + /* WINED3DSIH_DCL_RESOURCE_STRUCTURED */ NULL, + /* WINED3DSIH_DCL_SAMPLER */ NULL, + /* WINED3DSIH_DCL_TEMPS */ NULL, + /* WINED3DSIH_DCL_TESSELLATOR_DOMAIN */ NULL, + /* WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE */ NULL, + /* WINED3DSIH_DCL_TESSELLATOR_PARTITIONING */ NULL, + /* WINED3DSIH_DCL_UAV_TYPED */ 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_DSX_COARSE */ NULL, + /* WINED3DSIH_DSX_FINE */ NULL, + /* WINED3DSIH_DSY */ shader_hw_dsy, + /* WINED3DSIH_DSY_COARSE */ NULL, + /* WINED3DSIH_DSY_FINE */ NULL, + /* 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_HS_DECLS */ NULL, + /* WINED3DSIH_HS_FORK_PHASE */ 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_LD2DMS */ NULL, + /* WINED3DSIH_LD_STRUCTURED */ 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_STORE_UAV_TYPED */ 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, @@ -7868,6 +7885,7 @@ struct wined3d_surface *dst_surface, const RECT *dst_rect_in, const struct wined3d_color_key *color_key) { + unsigned int dst_sub_resource_idx = surface_get_sub_resource_idx(dst_surface); struct wined3d_texture *src_texture = src_surface->container; struct wined3d_texture *dst_texture = dst_surface->container; struct wined3d_context *context; @@ -7880,7 +7898,8 @@ /* Now load the surface */ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO - && (src_surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_DRAWABLE)) + && (surface_get_sub_resource(src_surface)->locations + & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_DRAWABLE)) == WINED3D_LOCATION_DRAWABLE && !wined3d_resource_is_offscreen(&src_texture->resource)) { @@ -7891,8 +7910,8 @@ * rectangle instead. */ surface_load_fb_texture(src_surface, FALSE, context); - src_rect.top = src_surface->resource.height - src_rect.top; - src_rect.bottom = src_surface->resource.height - src_rect.bottom; + src_rect.top = wined3d_texture_get_level_height(src_texture, src_surface->texture_level) - src_rect.top; + src_rect.bottom = wined3d_texture_get_level_height(src_texture, src_surface->texture_level) - src_rect.bottom; } else wined3d_texture_load(src_texture, context, FALSE); @@ -7924,8 +7943,8 @@ context_release(context); - surface_validate_location(dst_surface, dst_texture->resource.draw_binding); - surface_invalidate_location(dst_surface, ~dst_texture->resource.draw_binding); + wined3d_texture_validate_location(dst_texture, dst_sub_resource_idx, dst_texture->resource.draw_binding); + wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~dst_texture->resource.draw_binding); } static HRESULT arbfp_blit_color_fill(struct wined3d_device *device, struct wined3d_rendertarget_view *view, diff -Nru wine-staging-1.9.6/dlls/wined3d/buffer.c wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/buffer.c --- wine-staging-1.9.6/dlls/wined3d/buffer.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/buffer.c 2016-04-04 18:06:32.000000000 +0000 @@ -42,12 +42,12 @@ #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) +static void buffer_invalidate_bo_range(struct wined3d_buffer *buffer, unsigned int offset, unsigned int size) { - if (!offset && !size) + if (!offset && (!size || size == buffer->resource.size)) goto invalidate_all; - if (offset > buffer->resource.size || offset + size > buffer->resource.size) + if (offset > buffer->resource.size || size > buffer->resource.size - offset) { WARN("Invalid range specified, invalidating entire buffer.\n"); goto invalidate_all; @@ -100,6 +100,17 @@ return FALSE; } +/* Context activation is done by the caller. */ +static void buffer_bind(struct wined3d_buffer *buffer, struct wined3d_context *context) +{ + const struct wined3d_gl_info *gl_info = context->gl_info; + + if (buffer->buffer_type_hint == GL_ELEMENT_ARRAY_BUFFER) + context_invalidate_state(context, STATE_INDEXBUFFER); + + GL_EXTCALL(glBindBuffer(buffer->buffer_type_hint, buffer->buffer_object)); +} + /* Context activation is done by the caller */ static void delete_gl_buffer(struct wined3d_buffer *This, const struct wined3d_gl_info *gl_info) { @@ -148,9 +159,7 @@ goto fail; } - if (This->buffer_type_hint == GL_ELEMENT_ARRAY_BUFFER_ARB) - context_invalidate_state(context, STATE_INDEXBUFFER); - GL_EXTCALL(glBindBuffer(This->buffer_type_hint, This->buffer_object)); + buffer_bind(This, context); error = gl_info->gl_ops.gl.p_glGetError(); if (error != GL_NO_ERROR) { @@ -486,25 +495,23 @@ } /* Context activation is done by the caller. */ -BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *context) +BYTE *buffer_get_sysmem(struct wined3d_buffer *buffer, struct wined3d_context *context) { const struct wined3d_gl_info *gl_info = context->gl_info; /* Heap_memory exists if the buffer is double buffered or has no buffer object at all. */ - if (This->resource.heap_memory) - return This->resource.heap_memory; + if (buffer->resource.heap_memory) + return buffer->resource.heap_memory; - if (!wined3d_resource_allocate_sysmem(&This->resource)) + if (!wined3d_resource_allocate_sysmem(&buffer->resource)) ERR("Failed to allocate system memory.\n"); - if (This->buffer_type_hint == GL_ELEMENT_ARRAY_BUFFER_ARB) - context_invalidate_state(context, STATE_INDEXBUFFER); - - GL_EXTCALL(glBindBuffer(This->buffer_type_hint, This->buffer_object)); - GL_EXTCALL(glGetBufferSubData(This->buffer_type_hint, 0, This->resource.size, This->resource.heap_memory)); - This->flags |= WINED3D_BUFFER_DOUBLEBUFFER; + buffer_bind(buffer, context); + GL_EXTCALL(glGetBufferSubData(buffer->buffer_type_hint, 0, buffer->resource.size, buffer->resource.heap_memory)); + checkGLcall("buffer download"); + buffer->flags |= WINED3D_BUFFER_DOUBLEBUFFER; - return This->resource.heap_memory; + return buffer->resource.heap_memory; } static void buffer_unload(struct wined3d_resource *resource) @@ -977,9 +984,7 @@ context = context_acquire(device, NULL); gl_info = context->gl_info; - if (buffer->buffer_type_hint == GL_ELEMENT_ARRAY_BUFFER_ARB) - context_invalidate_state(context, STATE_INDEXBUFFER); - GL_EXTCALL(glBindBuffer(buffer->buffer_type_hint, buffer->buffer_object)); + buffer_bind(buffer, context); if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) { @@ -1076,9 +1081,7 @@ context = context_acquire(device, NULL); gl_info = context->gl_info; - if (buffer->buffer_type_hint == GL_ELEMENT_ARRAY_BUFFER_ARB) - context_invalidate_state(context, STATE_INDEXBUFFER); - GL_EXTCALL(glBindBuffer(buffer->buffer_type_hint, buffer->buffer_object)); + buffer_bind(buffer, context); if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) { @@ -1113,6 +1116,82 @@ } } +HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_offset, + struct wined3d_buffer *src_buffer, unsigned int src_offset, unsigned int size) +{ + BYTE *dst_buffer_mem, *src_buffer_mem, *dst_ptr, *src_ptr; + struct wined3d_bo_address dst_bo_address, src_bo_address; + const struct wined3d_gl_info *gl_info; + struct wined3d_context *context; + struct wined3d_device *device; + HRESULT hr; + + device = dst_buffer->resource.device; + + context = context_acquire(device, NULL); + gl_info = context->gl_info; + + buffer_get_memory(dst_buffer, context, &dst_bo_address); + buffer_get_memory(src_buffer, context, &src_bo_address); + + dst_buffer_mem = dst_buffer->resource.heap_memory; + src_buffer_mem = src_buffer->resource.heap_memory; + + if (!dst_buffer_mem && !src_buffer_mem) + { + if (gl_info->supported[ARB_COPY_BUFFER]) + { + GL_EXTCALL(glBindBuffer(GL_COPY_READ_BUFFER, src_bo_address.buffer_object)); + GL_EXTCALL(glBindBuffer(GL_COPY_WRITE_BUFFER, dst_bo_address.buffer_object)); + GL_EXTCALL(glCopyBufferSubData(GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, src_offset, dst_offset, size)); + checkGLcall("direct buffer copy"); + } + else + { + if (FAILED(hr = wined3d_buffer_map(dst_buffer, dst_offset, size, &dst_ptr, 0))) + { + WARN("Failed to map dst_buffer, hr %#x.\n", hr); + context_release(context); + return WINED3DERR_INVALIDCALL; + } + if (FAILED(hr = wined3d_buffer_map(src_buffer, src_offset, size, &src_ptr, WINED3D_MAP_READONLY))) + { + WARN("Failed to map src_buffer, hr %#x.\n", hr); + wined3d_buffer_unmap(dst_buffer); + context_release(context); + return WINED3DERR_INVALIDCALL; + } + + memcpy(dst_ptr, src_ptr, size); + + wined3d_buffer_unmap(src_buffer); + wined3d_buffer_unmap(dst_buffer); + } + } + else if (dst_buffer_mem && !src_buffer_mem) + { + buffer_bind(src_buffer, context); + GL_EXTCALL(glGetBufferSubData(src_buffer->buffer_type_hint, src_offset, size, dst_buffer_mem + dst_offset)); + checkGLcall("buffer download"); + } + else if (!dst_buffer_mem && src_buffer_mem) + { + buffer_bind(dst_buffer, context); + GL_EXTCALL(glBufferSubData(dst_buffer->buffer_type_hint, dst_offset, size, src_buffer_mem + src_offset)); + checkGLcall("buffer upload"); + } + else + { + memcpy(dst_buffer_mem + dst_offset, src_buffer_mem + src_offset, size); + } + + if (dst_buffer_mem) + buffer_invalidate_bo_range(dst_buffer, dst_offset, size); + + context_release(context); + return WINED3D_OK; +} + HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer, const struct wined3d_box *box, const void *data) { diff -Nru wine-staging-1.9.6/dlls/wined3d/context.c wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/context.c --- wine-staging-1.9.6/dlls/wined3d/context.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/context.c 2016-04-04 18:06:32.000000000 +0000 @@ -335,9 +335,15 @@ return buffer ? (1u << 31) | buffer : 0; } -static inline DWORD context_generate_rt_mask_from_surface(const struct wined3d_surface *target) +static inline DWORD context_generate_rt_mask_from_resource(struct wined3d_resource *resource) { - return (1u << 31) | surface_get_gl_buffer(target); + if (resource->type != WINED3D_RTYPE_TEXTURE_2D) + { + FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(resource->type)); + return 0; + } + + return (1u << 31) | wined3d_texture_get_gl_buffer(wined3d_texture_from_resource(resource)); } static inline void context_set_fbo_key_for_surface(const struct wined3d_context *context, @@ -474,8 +480,10 @@ if (depth_stencil && render_targets[0]) { - if (depth_stencil->resource.width < render_targets[0]->resource.width || - depth_stencil->resource.height < render_targets[0]->resource.height) + if (wined3d_texture_get_level_width(depth_stencil->container, depth_stencil->texture_level) + < wined3d_texture_get_level_width(render_targets[0]->container, render_targets[0]->texture_level) + || wined3d_texture_get_level_height(depth_stencil->container, depth_stencil->texture_level) + < wined3d_texture_get_level_height(render_targets[0]->container, render_targets[0]->texture_level)) { WARN("Depth stencil is smaller than the primary color buffer, disabling\n"); depth_stencil = NULL; @@ -846,22 +854,26 @@ void context_resource_released(const struct wined3d_device *device, struct wined3d_resource *resource, enum wined3d_resource_type type) { + struct wined3d_texture *texture; UINT i; - struct wined3d_surface *surface; if (!device->d3d_initialized) return; switch (type) { - case WINED3D_RTYPE_SURFACE: - surface = surface_from_resource(resource); + case WINED3D_RTYPE_TEXTURE_2D: + case WINED3D_RTYPE_TEXTURE_3D: + texture = wined3d_texture_from_resource(resource); for (i = 0; i < device->context_count; ++i) { struct wined3d_context *context = device->contexts[i]; - if (context->current_rt == surface) - context->current_rt = NULL; + if (context->current_rt.texture == texture) + { + context->current_rt.texture = NULL; + context->current_rt.sub_resource_idx = 0; + } } break; @@ -1312,7 +1324,8 @@ * A to avoid breaking caller code. */ void context_restore(struct wined3d_context *context, struct wined3d_surface *restore) { - if (context->current_rt != restore) + if (context->current_rt.texture != restore->container + || context->current_rt.sub_resource_idx != surface_get_sub_resource_idx(restore)) { context_release(context); context = context_acquire(restore->container->resource.device, restore); @@ -1559,7 +1572,7 @@ } struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, - struct wined3d_surface *target, const struct wined3d_format *ds_format) + struct wined3d_texture *target, const struct wined3d_format *ds_format) { struct wined3d_device *device = swapchain->device; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; @@ -1659,7 +1672,7 @@ } } - color_format = target->container->resource.format; + color_format = target->resource.format; /* In case of ORM_BACKBUFFER, make sure to request an alpha component for * X4R4G4B4/X8R8G8B8 as we might need it for the backbuffer. */ @@ -1771,10 +1784,11 @@ } ret->swapchain = swapchain; - ret->current_rt = target; + ret->current_rt.texture = target; + ret->current_rt.sub_resource_idx = 0; ret->tid = GetCurrentThreadId(); - ret->render_offscreen = wined3d_resource_is_offscreen(&target->container->resource); + ret->render_offscreen = wined3d_resource_is_offscreen(&target->resource); ret->draw_buffers_mask = context_generate_rt_mask(GL_BACK); ret->valid = 1; @@ -1858,21 +1872,18 @@ TRACE("Setting up the screen\n"); - gl_info->gl_ops.gl.p_glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE); - checkGLcall("glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE);"); - - gl_info->gl_ops.gl.p_glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT); - checkGLcall("glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);"); - - gl_info->gl_ops.gl.p_glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR); - checkGLcall("glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);"); + if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) + { + gl_info->gl_ops.gl.p_glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE); + checkGLcall("glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE);"); - gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ALIGNMENT, device->surface_alignment); - checkGLcall("glPixelStorei(GL_PACK_ALIGNMENT, device->surface_alignment);"); - gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - checkGLcall("glPixelStorei(GL_UNPACK_ALIGNMENT, device->surface_alignment);"); + gl_info->gl_ops.gl.p_glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT); + checkGLcall("glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);"); - if (!gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) + gl_info->gl_ops.gl.p_glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR); + checkGLcall("glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);"); + } + else { GLuint vao; @@ -1881,6 +1892,11 @@ checkGLcall("creating VAO"); } + gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ALIGNMENT, device->surface_alignment); + checkGLcall("glPixelStorei(GL_PACK_ALIGNMENT, device->surface_alignment);"); + gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + checkGLcall("glPixelStorei(GL_UNPACK_ALIGNMENT, device->surface_alignment);"); + if (gl_info->supported[ARB_VERTEX_BLEND]) { /* Direct3D always uses n-1 weights for n world matrices and uses @@ -1944,7 +1960,9 @@ device->shader_backend->shader_init_context_state(ret); ret->shader_update_mask = (1u << WINED3D_SHADER_TYPE_PIXEL) | (1u << WINED3D_SHADER_TYPE_VERTEX) - | (1u << WINED3D_SHADER_TYPE_GEOMETRY); + | (1u << WINED3D_SHADER_TYPE_GEOMETRY) + | (1u << WINED3D_SHADER_TYPE_HULL) + | (1u << WINED3D_SHADER_TYPE_DOMAIN); /* If this happens to be the first context for the device, dummy textures * are not created yet. In that case, they will be created (and bound) by @@ -2023,9 +2041,10 @@ static void context_get_rt_size(const struct wined3d_context *context, SIZE *size) { - const struct wined3d_surface *rt = context->current_rt; + const struct wined3d_texture *rt = context->current_rt.texture; + unsigned int level; - if (rt->container->swapchain && rt->container->swapchain->front_buffer == rt->container) + if (rt->swapchain && rt->swapchain->front_buffer == rt) { RECT window_size; @@ -2036,8 +2055,9 @@ return; } - size->cx = rt->resource.width; - size->cy = rt->resource.height; + level = context->current_rt.sub_resource_idx % rt->level_count; + size->cx = wined3d_texture_get_level_width(rt, level); + size->cy = wined3d_texture_get_level_height(rt, level); } /***************************************************************************** @@ -2404,7 +2424,8 @@ const struct wined3d_rendertarget_view *depth_stencil) { /* Onscreen surfaces are always in a swapchain */ - struct wined3d_swapchain *swapchain = context->current_rt->container->swapchain; + struct wined3d_swapchain *swapchain = context->current_rt.texture->swapchain; + struct wined3d_surface *surface; if (context->render_offscreen || !depth_stencil) return; if (match_depth_stencil_format(swapchain->ds_format, depth_stencil->format)) return; @@ -2415,7 +2436,8 @@ 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 */ - surface_load_location(context->current_rt, context, WINED3D_LOCATION_TEXTURE_RGB); + surface = context->current_rt.texture->sub_resources[context->current_rt.sub_resource_idx].u.surface; + surface_load_location(surface, context, WINED3D_LOCATION_TEXTURE_RGB); swapchain->render_to_fbo = TRUE; swapchain_update_draw_bindings(swapchain); context_set_render_offscreen(context, TRUE); @@ -2437,12 +2459,12 @@ } } -static DWORD context_generate_rt_mask_no_fbo(const struct wined3d_context *context, const struct wined3d_surface *rt) +static DWORD context_generate_rt_mask_no_fbo(const struct wined3d_context *context, struct wined3d_texture *rt) { - if (!rt || rt->container->resource.format->id == WINED3DFMT_NULL) + if (!rt || rt->resource.format->id == WINED3DFMT_NULL) return 0; - else if (rt->container->swapchain) - return context_generate_rt_mask_from_surface(rt); + else if (rt->swapchain) + return context_generate_rt_mask_from_resource(&rt->resource); else return context_generate_rt_mask(context_get_offscreen_gl_buffer(context)); } @@ -2450,7 +2472,8 @@ /* Context activation is done by the caller. */ void context_apply_blit_state(struct wined3d_context *context, const struct wined3d_device *device) { - struct wined3d_surface *rt = context->current_rt; + struct wined3d_texture *rt = context->current_rt.texture; + struct wined3d_surface *surface; DWORD rt_mask, *cur_mask; if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) @@ -2459,10 +2482,11 @@ if (context->render_offscreen) { - wined3d_texture_load(rt->container, context, FALSE); + wined3d_texture_load(rt, context, FALSE); - context_apply_fbo_state_blit(context, GL_FRAMEBUFFER, rt, NULL, rt->container->resource.draw_binding); - if (rt->container->resource.format->id != WINED3DFMT_NULL) + surface = rt->sub_resources[context->current_rt.sub_resource_idx].u.surface; + context_apply_fbo_state_blit(context, GL_FRAMEBUFFER, surface, NULL, rt->resource.draw_binding); + if (rt->resource.format->id != WINED3DFMT_NULL) rt_mask = 1; else rt_mask = 0; @@ -2471,7 +2495,7 @@ { context->current_fbo = NULL; context_bind_fbo(context, GL_FRAMEBUFFER, 0); - rt_mask = context_generate_rt_mask_from_surface(rt); + rt_mask = context_generate_rt_mask_from_resource(&rt->resource); } } else @@ -2555,7 +2579,7 @@ { context_apply_fbo_state(context, GL_FRAMEBUFFER, NULL, NULL, WINED3D_LOCATION_DRAWABLE, WINED3D_LOCATION_DRAWABLE); - rt_mask = context_generate_rt_mask_from_surface(wined3d_rendertarget_view_get_surface(rts[0])); + rt_mask = context_generate_rt_mask_from_resource(rts[0]->resource); } /* If the framebuffer is not the device's fb the device's fb has to be reapplied @@ -2566,7 +2590,7 @@ else { rt_mask = context_generate_rt_mask_no_fbo(context, - rt_count ? wined3d_rendertarget_view_get_surface(rts[0]) : NULL); + rt_count ? wined3d_rendertarget_view_get_surface(rts[0])->container : NULL); } } else if (wined3d_settings.offscreen_rendering_mode == ORM_FBO @@ -2581,7 +2605,7 @@ else { rt_mask = context_generate_rt_mask_no_fbo(context, - rt_count ? wined3d_rendertarget_view_get_surface(rts[0]) : NULL); + rt_count ? wined3d_rendertarget_view_get_surface(rts[0])->container : NULL); } cur_mask = context->current_fbo ? &context->current_fbo->rt_mask : &context->draw_buffers_mask; @@ -2631,9 +2655,9 @@ unsigned int i; if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) - return context_generate_rt_mask_no_fbo(context, wined3d_rendertarget_view_get_surface(rts[0])); + return context_generate_rt_mask_no_fbo(context, wined3d_rendertarget_view_get_surface(rts[0])->container); else if (!context->render_offscreen) - return context_generate_rt_mask_from_surface(wined3d_rendertarget_view_get_surface(rts[0])); + return context_generate_rt_mask_from_resource(rts[0]->resource); rt_mask = ps ? ps->reg_maps.rt_mask : 1; rt_mask &= context->d3d_info->valid_rt_mask; @@ -2675,7 +2699,7 @@ } context_apply_fbo_state(context, GL_FRAMEBUFFER, context->blit_targets, wined3d_rendertarget_view_get_surface(fb->depth_stencil), - fb->render_targets[0]->resource->draw_binding, + fb->render_targets[0] ? fb->render_targets[0]->resource->draw_binding : 0, fb->depth_stencil ? fb->depth_stencil->resource->draw_binding : 0); } } @@ -3410,34 +3434,38 @@ return TRUE; } -static void context_setup_target(struct wined3d_context *context, struct wined3d_surface *target) +static void context_setup_target(struct wined3d_context *context, + struct wined3d_texture *texture, unsigned int sub_resource_idx) { BOOL old_render_offscreen = context->render_offscreen, render_offscreen; - render_offscreen = wined3d_resource_is_offscreen(&target->container->resource); - if (context->current_rt == target && render_offscreen == old_render_offscreen) return; + render_offscreen = wined3d_resource_is_offscreen(&texture->resource); + if (context->current_rt.texture == texture + && context->current_rt.sub_resource_idx == sub_resource_idx + && render_offscreen == old_render_offscreen) + return; /* To compensate the lack of format switching with some offscreen rendering methods and on onscreen buffers * the alpha blend state changes with different render target formats. */ - if (!context->current_rt) + if (!context->current_rt.texture) { context_invalidate_state(context, STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE)); } else { - const struct wined3d_format *old = context->current_rt->container->resource.format; - const struct wined3d_format *new = target->container->resource.format; + const struct wined3d_format *old = context->current_rt.texture->resource.format; + const struct wined3d_format *new = texture->resource.format; if (old->id != new->id) { /* Disable blending when the alpha mask has changed and when a format doesn't support blending. */ if ((old->alpha_size && !new->alpha_size) || (!old->alpha_size && new->alpha_size) - || !(target->container->resource.format_flags & WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING)) + || !(texture->resource.format_flags & WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING)) context_invalidate_state(context, STATE_RENDER(WINED3D_RS_ALPHABLENDENABLE)); /* Update sRGB writing when switching between formats that do/do not support sRGB writing */ - if ((context->current_rt->container->resource.format_flags & WINED3DFMT_FLAG_SRGB_WRITE) - != (target->container->resource.format_flags & WINED3DFMT_FLAG_SRGB_WRITE)) + if ((context->current_rt.texture->resource.format_flags & WINED3DFMT_FLAG_SRGB_WRITE) + != (texture->resource.format_flags & WINED3DFMT_FLAG_SRGB_WRITE)) context_invalidate_state(context, STATE_RENDER(WINED3D_RS_SRGBWRITEENABLE)); } @@ -3449,25 +3477,30 @@ * has to be called with the old rendertarget active, otherwise a * wrong drawable is read. */ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO - && old_render_offscreen && context->current_rt != target) + && old_render_offscreen && (context->current_rt.texture != texture + || context->current_rt.sub_resource_idx != sub_resource_idx)) { - struct wined3d_texture *texture = context->current_rt->container; + unsigned int prev_sub_resource_idx = context->current_rt.sub_resource_idx; + struct wined3d_texture *prev_texture = context->current_rt.texture; /* Read the back buffer of the old drawable into the destination texture. */ - if (texture->texture_srgb.name) - wined3d_texture_load(texture, context, TRUE); - wined3d_texture_load(texture, context, FALSE); - surface_invalidate_location(context->current_rt, WINED3D_LOCATION_DRAWABLE); + if (prev_texture->texture_srgb.name) + wined3d_texture_load(prev_texture, context, TRUE); + wined3d_texture_load(prev_texture, context, FALSE); + wined3d_texture_invalidate_location(prev_texture, prev_sub_resource_idx, WINED3D_LOCATION_DRAWABLE); } } - context->current_rt = target; + context->current_rt.texture = texture; + context->current_rt.sub_resource_idx = sub_resource_idx; context_set_render_offscreen(context, render_offscreen); } struct wined3d_context *context_acquire(const struct wined3d_device *device, struct wined3d_surface *target) { struct wined3d_context *current_context = context_get_current(); + struct wined3d_texture *target_texture; + unsigned int target_sub_resource_idx; struct wined3d_context *context; TRACE("device %p, target %p.\n", device, target); @@ -3475,33 +3508,41 @@ if (current_context && current_context->destroyed) current_context = NULL; - if (!target) + if (target) + { + target_texture = target->container; + target_sub_resource_idx = surface_get_sub_resource_idx(target); + } + else { if (current_context - && current_context->current_rt + && current_context->current_rt.texture && current_context->swapchain->device == device) { - target = current_context->current_rt; + target_texture = current_context->current_rt.texture; + target_sub_resource_idx = current_context->current_rt.sub_resource_idx; } else { struct wined3d_swapchain *swapchain = device->swapchains[0]; + if (swapchain->back_buffers) - target = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)); + target_texture = swapchain->back_buffers[0]; else - target = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); + target_texture = swapchain->front_buffer; + target_sub_resource_idx = 0; } } - if (current_context && current_context->current_rt == target) + if (current_context && current_context->current_rt.texture == target_texture) { context = current_context; } - else if (target->container->swapchain) + else if (target_texture->swapchain) { TRACE("Rendering onscreen.\n"); - context = swapchain_get_context(target->container->swapchain); + context = swapchain_get_context(target_texture->swapchain); } else { @@ -3517,7 +3558,7 @@ context_enter(context); context_update_window(context); - context_setup_target(context, target); + context_setup_target(context, target_texture, target_sub_resource_idx); if (!context->valid) return context; if (context != current_context) diff -Nru wine-staging-1.9.6/dlls/wined3d/cs.c wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/cs.c --- wine-staging-1.9.6/dlls/wined3d/cs.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/cs.c 2016-04-04 18:06:32.000000000 +0000 @@ -59,20 +59,20 @@ enum wined3d_cs_op opcode; HWND dst_window_override; struct wined3d_swapchain *swapchain; - const RECT *src_rect; - const RECT *dst_rect; + RECT src_rect; + RECT dst_rect; DWORD flags; }; struct wined3d_cs_clear { enum wined3d_cs_op opcode; - DWORD rect_count; - const RECT *rects; DWORD flags; - const struct wined3d_color *color; + struct wined3d_color color; float depth; DWORD stencil; + unsigned int rect_count; + RECT rects[1]; }; struct wined3d_cs_draw @@ -95,13 +95,13 @@ struct wined3d_cs_set_viewport { enum wined3d_cs_op opcode; - const struct wined3d_viewport *viewport; + struct wined3d_viewport viewport; }; struct wined3d_cs_set_scissor_rect { enum wined3d_cs_op opcode; - const RECT *rect; + RECT rect; }; struct wined3d_cs_set_rendertarget_view @@ -229,14 +229,14 @@ { enum wined3d_cs_op opcode; enum wined3d_transform_state state; - const struct wined3d_matrix *matrix; + struct wined3d_matrix matrix; }; struct wined3d_cs_set_clip_plane { enum wined3d_cs_op opcode; UINT plane_idx; - const struct wined3d_vec4 *plane; + struct wined3d_vec4 plane; }; struct wined3d_cs_set_material @@ -258,7 +258,7 @@ swapchain = op->swapchain; wined3d_swapchain_set_window(swapchain, op->dst_window_override); - swapchain->swapchain_ops->swapchain_present(swapchain, op->src_rect, op->dst_rect, op->flags); + swapchain->swapchain_ops->swapchain_present(swapchain, &op->src_rect, &op->dst_rect, op->flags); } void wined3d_cs_emit_present(struct wined3d_cs *cs, struct wined3d_swapchain *swapchain, @@ -270,8 +270,8 @@ op->opcode = WINED3D_CS_OP_PRESENT; op->dst_window_override = dst_window_override; op->swapchain = swapchain; - op->src_rect = src_rect; - op->dst_rect = dst_rect; + op->src_rect = *src_rect; + op->dst_rect = *dst_rect; op->flags = flags; cs->ops->submit(cs); @@ -287,7 +287,7 @@ wined3d_get_draw_rect(&device->state, &draw_rect); device_clear_render_targets(device, device->adapter->gl_info.limits.buffers, &device->fb, op->rect_count, op->rects, &draw_rect, op->flags, - op->color, op->depth, op->stencil); + &op->color, op->depth, op->stencil); } void wined3d_cs_emit_clear(struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, @@ -295,14 +295,14 @@ { struct wined3d_cs_clear *op; - op = cs->ops->require_space(cs, sizeof(*op)); + op = cs->ops->require_space(cs, FIELD_OFFSET(struct wined3d_cs_clear, rects[rect_count])); op->opcode = WINED3D_CS_OP_CLEAR; - op->rect_count = rect_count; - op->rects = rects; op->flags = flags; - op->color = color; + op->color = *color; op->depth = depth; op->stencil = stencil; + op->rect_count = rect_count; + memcpy(op->rects, rects, sizeof(*rects) * rect_count); cs->ops->submit(cs); } @@ -355,7 +355,7 @@ { const struct wined3d_cs_set_viewport *op = data; - cs->state.viewport = *op->viewport; + cs->state.viewport = op->viewport; device_invalidate_state(cs->device, STATE_VIEWPORT); } @@ -365,7 +365,7 @@ op = cs->ops->require_space(cs, sizeof(*op)); op->opcode = WINED3D_CS_OP_SET_VIEWPORT; - op->viewport = viewport; + op->viewport = *viewport; cs->ops->submit(cs); } @@ -374,7 +374,7 @@ { const struct wined3d_cs_set_scissor_rect *op = data; - cs->state.scissor_rect = *op->rect; + cs->state.scissor_rect = op->rect; device_invalidate_state(cs->device, STATE_SCISSORRECT); } @@ -384,7 +384,7 @@ op = cs->ops->require_space(cs, sizeof(*op)); op->opcode = WINED3D_CS_OP_SET_SCISSOR_RECT; - op->rect = rect; + op->rect = *rect; cs->ops->submit(cs); } @@ -634,6 +634,7 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) { + const struct wined3d_gl_info *gl_info = &cs->device->adapter->gl_info; const struct wined3d_d3d_info *d3d_info = &cs->device->adapter->d3d_info; const struct wined3d_cs_set_texture *op = data; struct wined3d_texture *prev; @@ -653,7 +654,8 @@ op->texture->sampler = op->stage; if (!prev || op->texture->target != prev->target - || !is_same_fixup(new_format->color_fixup, old_format->color_fixup) + || (!is_same_fixup(new_format->color_fixup, old_format->color_fixup) + && !(can_use_texture_swizzle(gl_info, new_format) && can_use_texture_swizzle(gl_info, old_format))) || (new_fmt_flags & WINED3DFMT_FLAG_SHADOW) != (old_fmt_flags & WINED3DFMT_FLAG_SHADOW)) device_invalidate_state(cs->device, STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL)); @@ -854,7 +856,7 @@ { const struct wined3d_cs_set_transform *op = data; - cs->state.transforms[op->state] = *op->matrix; + cs->state.transforms[op->state] = op->matrix; if (op->state < WINED3D_TS_WORLD_MATRIX(cs->device->adapter->d3d_info.limits.ffp_vertex_blend_matrices)) device_invalidate_state(cs->device, STATE_TRANSFORM(op->state)); } @@ -867,7 +869,7 @@ op = cs->ops->require_space(cs, sizeof(*op)); op->opcode = WINED3D_CS_OP_SET_TRANSFORM; op->state = state; - op->matrix = matrix; + op->matrix = *matrix; cs->ops->submit(cs); } @@ -876,7 +878,7 @@ { const struct wined3d_cs_set_clip_plane *op = data; - cs->state.clip_planes[op->plane_idx] = *op->plane; + cs->state.clip_planes[op->plane_idx] = op->plane; device_invalidate_state(cs->device, STATE_CLIPPLANE(op->plane_idx)); } @@ -887,7 +889,7 @@ op = cs->ops->require_space(cs, sizeof(*op)); op->opcode = WINED3D_CS_OP_SET_CLIP_PLANE; op->plane_idx = plane_idx; - op->plane = plane; + op->plane = *plane; cs->ops->submit(cs); } diff -Nru wine-staging-1.9.6/dlls/wined3d/device.c wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/device.c --- wine-staging-1.9.6/dlls/wined3d/device.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/device.c 2016-04-04 18:06:32.000000000 +0000 @@ -216,16 +216,16 @@ static BOOL is_full_clear(const struct wined3d_surface *target, const RECT *draw_rect, const RECT *clear_rect) { + unsigned int height = wined3d_texture_get_level_height(target->container, target->texture_level); + unsigned int width = wined3d_texture_get_level_width(target->container, target->texture_level); + /* partial draw rect */ - if (draw_rect->left || draw_rect->top - || draw_rect->right < target->resource.width - || draw_rect->bottom < target->resource.height) + if (draw_rect->left || draw_rect->top || draw_rect->right < width || draw_rect->bottom < height) return FALSE; /* partial clear rect */ if (clear_rect && (clear_rect->left > 0 || clear_rect->top > 0 - || clear_rect->right < target->resource.width - || clear_rect->bottom < target->resource.height)) + || clear_rect->right < width || clear_rect->bottom < height)) return FALSE; return TRUE; @@ -234,17 +234,20 @@ static void prepare_ds_clear(struct wined3d_surface *ds, struct wined3d_context *context, DWORD location, const RECT *draw_rect, UINT rect_count, const RECT *clear_rect, RECT *out_rect) { + struct wined3d_texture_sub_resource *sub_resource = surface_get_sub_resource(ds); RECT current_rect, r; - if (ds->locations & WINED3D_LOCATION_DISCARDED) + if (sub_resource->locations & WINED3D_LOCATION_DISCARDED) { /* Depth buffer was discarded, make it entirely current in its new location since * there is no other place where we would get data anyway. */ - SetRect(out_rect, 0, 0, ds->resource.width, ds->resource.height); + SetRect(out_rect, 0, 0, + wined3d_texture_get_level_width(ds->container, ds->texture_level), + wined3d_texture_get_level_height(ds->container, ds->texture_level)); return; } - if (ds->locations & location) + if (sub_resource->locations & location) SetRect(¤t_rect, 0, 0, ds->ds_current_size.cx, ds->ds_current_size.cy); @@ -396,13 +399,20 @@ for (i = 0; i < rt_count; ++i) { struct wined3d_rendertarget_view *rtv = fb->render_targets[i]; - struct wined3d_surface *rt = wined3d_rendertarget_view_get_surface(rtv); + struct wined3d_texture *texture; + + if (!rtv) + continue; - if (rt) + if (rtv->resource->type == WINED3D_RTYPE_BUFFER) { - surface_validate_location(rt, rtv->resource->draw_binding); - surface_invalidate_location(rt, ~rtv->resource->draw_binding); + FIXME("Not supported on buffer resources.\n"); + continue; } + + texture = wined3d_texture_from_resource(rtv->resource); + wined3d_texture_validate_location(texture, rtv->sub_resource_idx, rtv->resource->draw_binding); + wined3d_texture_invalidate_location(texture, rtv->sub_resource_idx, ~rtv->resource->draw_binding); } if (!gl_info->supported[ARB_FRAMEBUFFER_SRGB] && needs_srgb_write(context, &device->state, fb)) @@ -655,7 +665,7 @@ 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 = device->logo_texture->sub_resources[0].u.surface; surface_color_fill(surface, &rect, &c); } @@ -1015,8 +1025,7 @@ 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, swapchain->front_buffer->sub_resources[0].u.surface); create_dummy_textures(device, context); create_default_sampler(device); @@ -3544,9 +3553,9 @@ return WINED3DERR_INVALIDCALL; } - if (src_texture->sub_resources[src_level].resource->width != dst_texture->resource.width - || src_texture->sub_resources[src_level].resource->height != dst_texture->resource.height - || src_texture->sub_resources[src_level].resource->depth != dst_texture->resource.depth) + if (wined3d_texture_get_level_width(src_texture, src_level) != dst_texture->resource.width + || wined3d_texture_get_level_height(src_texture, src_level) != dst_texture->resource.height + || wined3d_texture_get_level_depth(src_texture, src_level) != dst_texture->resource.depth) { WARN("Source and destination dimensions do not match.\n"); return WINED3DERR_INVALIDCALL; @@ -3567,7 +3576,7 @@ data.buffer_object = 0; data.addr = src.data; wined3d_volume_upload_data(dst_texture->sub_resources[i].u.volume, context, &data); - wined3d_volume_invalidate_location(dst_texture->sub_resources[i].u.volume, ~WINED3D_LOCATION_TEXTURE_RGB); + wined3d_texture_invalidate_location(dst_texture, i, ~WINED3D_LOCATION_TEXTURE_RGB); if (FAILED(hr = wined3d_resource_unmap(&src_texture->resource, src_level + i))) goto done; @@ -3657,10 +3666,8 @@ { for (j = 0; j < level_count; ++j) { - src_surface = surface_from_resource(wined3d_texture_get_sub_resource(src_texture, - i * src_levels + j + src_skip_levels)); - dst_surface = surface_from_resource(wined3d_texture_get_sub_resource(dst_texture, - i * dst_levels + j)); + src_surface = src_texture->sub_resources[i * src_levels + j + src_skip_levels].u.surface; + dst_surface = dst_texture->sub_resources[i * dst_levels + j].u.surface; if (FAILED(hr = surface_upload_from_surface(dst_surface, NULL, src_surface, NULL))) { WARN("Failed to update surface, hr %#x.\n", hr); @@ -3825,10 +3832,9 @@ void CDECL wined3d_device_copy_resource(struct wined3d_device *device, struct wined3d_resource *dst_resource, struct wined3d_resource *src_resource) { - struct wined3d_surface *dst_surface, *src_surface; struct wined3d_texture *dst_texture, *src_texture; RECT dst_rect, src_rect; - unsigned int i, count; + unsigned int i, j; HRESULT hr; TRACE("device %p, dst_resource %p, src_resource %p.\n", device, dst_resource, src_resource); @@ -3865,6 +3871,15 @@ return; } + if (dst_resource->type == WINED3D_RTYPE_BUFFER) + { + if (FAILED(hr = wined3d_buffer_copy(buffer_from_resource(dst_resource), 0, + buffer_from_resource(src_resource), 0, + dst_resource->size))) + ERR("Failed to copy buffer, hr %#x.\n", hr); + return; + } + if (dst_resource->type != WINED3D_RTYPE_TEXTURE_2D) { FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(dst_resource->type)); @@ -3883,17 +3898,22 @@ return; } - count = dst_texture->layer_count * dst_texture->level_count; - for (i = 0; i < count; ++i) + for (i = 0; i < dst_texture->level_count; ++i) { - 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)); - - 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); + SetRect(&dst_rect, 0, 0, + wined3d_texture_get_level_width(dst_texture, i), + wined3d_texture_get_level_height(dst_texture, i)); + SetRect(&src_rect, 0, 0, + wined3d_texture_get_level_width(src_texture, i), + wined3d_texture_get_level_height(dst_texture, i)); + for (j = 0; j < dst_texture->layer_count; ++j) + { + unsigned int idx = j * dst_texture->level_count + i; + + if (FAILED(hr = wined3d_texture_blt(dst_texture, idx, &dst_rect, + src_texture, idx, &src_rect, 0, NULL, WINED3D_TEXF_POINT))) + ERR("Failed to blit, sub-resource %u, hr %#x.\n", idx, hr); + } } } @@ -3902,9 +3922,7 @@ unsigned int dst_y, unsigned int dst_z, struct wined3d_resource *src_resource, unsigned int src_sub_resource_idx, const struct wined3d_box *src_box) { - struct wined3d_surface *dst_surface, *src_surface; struct wined3d_texture *dst_texture, *src_texture; - struct wined3d_resource *tmp; RECT dst_rect, src_rect; HRESULT hr; @@ -3913,6 +3931,14 @@ device, dst_resource, dst_sub_resource_idx, dst_x, dst_y, dst_z, src_resource, src_sub_resource_idx, debug_box(src_box)); + if (src_box && (src_box->left >= src_box->right + || src_box->top >= src_box->bottom + || src_box->front >= src_box->back)) + { + WARN("Invalid box %s specified.\n", debug_box(src_box)); + return WINED3DERR_INVALIDCALL; + } + if (src_resource == dst_resource && src_sub_resource_idx == dst_sub_resource_idx) { WARN("Source and destination are the same sub-resource.\n"); @@ -3935,47 +3961,72 @@ return WINED3DERR_INVALIDCALL; } - if (dst_resource->type != WINED3D_RTYPE_TEXTURE_2D) + if (dst_resource->type == WINED3D_RTYPE_BUFFER) { - FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(dst_resource->type)); - return WINED3DERR_INVALIDCALL; + unsigned int src_offset, size; + + if (dst_sub_resource_idx) + { + WARN("Invalid dst_sub_resource_idx %u.\n", dst_sub_resource_idx); + return WINED3DERR_INVALIDCALL; + } + if (src_sub_resource_idx) + { + WARN("Invalid src_sub_resource_idx %u.\n", src_sub_resource_idx); + return WINED3DERR_INVALIDCALL; + } + + if (src_box) + { + src_offset = src_box->left; + size = src_box->right - src_box->left; + } + else + { + src_offset = 0; + size = src_resource->size; + } + + if (src_offset > src_resource->size + || size > src_resource->size - src_offset + || dst_x > dst_resource->size + || size > dst_resource->size - dst_x) + { + WARN("Invalid range specified, dst_offset %u, src_offset %u, size %u.\n", + dst_x, src_offset, size); + return WINED3DERR_INVALIDCALL; + } + + return wined3d_buffer_copy(buffer_from_resource(dst_resource), dst_x, + buffer_from_resource(src_resource), src_offset, size); } - dst_texture = wined3d_texture_from_resource(dst_resource); - if (!(tmp = wined3d_texture_get_sub_resource(dst_texture, dst_sub_resource_idx))) + if (dst_resource->type != WINED3D_RTYPE_TEXTURE_2D) { - WARN("Invalid dst_sub_resource_idx %u.\n", dst_sub_resource_idx); + FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(dst_resource->type)); return WINED3DERR_INVALIDCALL; } - dst_surface = surface_from_resource(tmp); + dst_texture = wined3d_texture_from_resource(dst_resource); src_texture = wined3d_texture_from_resource(src_resource); - if (!(tmp = wined3d_texture_get_sub_resource(src_texture, src_sub_resource_idx))) - { - WARN("Invalid src_sub_resource_idx %u.\n", src_sub_resource_idx); - return WINED3DERR_INVALIDCALL; - } - src_surface = surface_from_resource(tmp); if (src_box) { - if (src_box->front >= src_box->back) - { - WARN("Invalid box %s specified.\n", debug_box(src_box)); - return WINED3DERR_INVALIDCALL; - } - SetRect(&src_rect, src_box->left, src_box->top, src_box->right, src_box->bottom); } else { - SetRect(&src_rect, 0, 0, src_surface->resource.width, src_surface->resource.height); + unsigned int level = src_sub_resource_idx % src_texture->level_count; + + SetRect(&src_rect, 0, 0, wined3d_texture_get_level_width(src_texture, level), + wined3d_texture_get_level_height(src_texture, level)); } SetRect(&dst_rect, dst_x, dst_y, dst_x + (src_rect.right - src_rect.left), 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))) + if (FAILED(hr = wined3d_texture_blt(dst_texture, dst_sub_resource_idx, &dst_rect, + src_texture, src_sub_resource_idx, &src_rect, 0, NULL, WINED3D_TEXF_POINT))) WARN("Failed to blit, hr %#x.\n", hr); return hr; @@ -4072,8 +4123,8 @@ context_release(context); - surface_validate_location(surface, WINED3D_LOCATION_TEXTURE_RGB); - surface_invalidate_location(surface, ~WINED3D_LOCATION_TEXTURE_RGB); + wined3d_texture_validate_location(texture, sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB); + wined3d_texture_invalidate_location(texture, sub_resource_idx, ~WINED3D_LOCATION_TEXTURE_RGB); } HRESULT CDECL wined3d_device_clear_rendertarget_view(struct wined3d_device *device, @@ -4507,7 +4558,7 @@ static HRESULT create_primary_opengl_context(struct wined3d_device *device, struct wined3d_swapchain *swapchain) { struct wined3d_context *context; - struct wined3d_surface *target; + struct wined3d_texture *target; HRESULT hr; if (FAILED(hr = device->shader_backend->shader_alloc_private(device, @@ -4534,9 +4585,7 @@ 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)); + target = swapchain->back_buffers ? swapchain->back_buffers[0] : swapchain->front_buffer; if (!(context = context_create(swapchain, target, swapchain->ds_format))) { WARN("Failed to create context.\n"); @@ -4927,37 +4976,24 @@ void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) { enum wined3d_resource_type type = resource->type; + struct wined3d_rendertarget_view *rtv; unsigned int i; TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type)); context_resource_released(device, resource, type); - switch (type) + for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) { - case WINED3D_RTYPE_SURFACE: - { - struct wined3d_surface *surface = surface_from_resource(resource); - - if (!device->d3d_initialized) break; - - for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) - { - if (wined3d_rendertarget_view_get_surface(device->fb.render_targets[i]) == surface) - { - ERR("Surface %p is still in use as render target %u.\n", surface, i); - device->fb.render_targets[i] = NULL; - } - } + if ((rtv = device->fb.render_targets[i]) && rtv->resource == resource) + ERR("Resource %p is still in use as render target %u.\n", resource, i); + } - if (wined3d_rendertarget_view_get_surface(device->fb.depth_stencil) == surface) - { - ERR("Surface %p is still in use as depth/stencil buffer.\n", surface); - device->fb.depth_stencil = NULL; - } - } - break; + if ((rtv = device->fb.depth_stencil) && rtv->resource == resource) + ERR("Resource %p is still in use as depth/stencil buffer.\n", resource); + switch (type) + { case WINED3D_RTYPE_TEXTURE_2D: case WINED3D_RTYPE_TEXTURE_3D: for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i) diff -Nru wine-staging-1.9.6/dlls/wined3d/directx.c wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/directx.c --- wine-staging-1.9.6/dlls/wined3d/directx.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/directx.c 2016-04-04 18:06:32.000000000 +0000 @@ -109,6 +109,7 @@ /* ARB */ {"GL_ARB_blend_func_extended", ARB_BLEND_FUNC_EXTENDED }, {"GL_ARB_color_buffer_float", ARB_COLOR_BUFFER_FLOAT }, + {"GL_ARB_copy_buffer", ARB_COPY_BUFFER }, {"GL_ARB_debug_output", ARB_DEBUG_OUTPUT }, {"GL_ARB_depth_buffer_float", ARB_DEPTH_BUFFER_FLOAT }, {"GL_ARB_depth_texture", ARB_DEPTH_TEXTURE }, @@ -155,6 +156,7 @@ {"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_texture_swizzle", ARB_TEXTURE_SWIZZLE }, {"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 }, @@ -1149,7 +1151,7 @@ {DRIVER_AMD_R300, DRIVER_MODEL_NT5X, "ati2dvag.dll", 14, 10, 6764}, {DRIVER_AMD_R600, DRIVER_MODEL_NT5X, "ati2dvag.dll", 17, 10, 1280}, {DRIVER_AMD_R300, DRIVER_MODEL_NT6X, "atiumdag.dll", 14, 10, 741 }, - {DRIVER_AMD_R600, DRIVER_MODEL_NT6X, "atiumdag.dll", 17, 10, 1280 }, + {DRIVER_AMD_R600, DRIVER_MODEL_NT6X, "atiumdag.dll", 17, 10, 1280}, /* Intel * The drivers are unified but not all versions support all GPUs. At some point the 2k/xp @@ -1281,8 +1283,14 @@ {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX770, "NVIDIA GeForce GTX 770", DRIVER_NVIDIA_GEFORCE8, 2048}, {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX780, "NVIDIA GeForce GTX 780", DRIVER_NVIDIA_GEFORCE8, 3072}, {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX780TI, "NVIDIA GeForce GTX 780 Ti", DRIVER_NVIDIA_GEFORCE8, 3072}, + {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX860M, "NVIDIA GeForce GTX 860M", DRIVER_NVIDIA_GEFORCE8, 2048}, + {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX950, "NVIDIA GeForce GTX 950", DRIVER_NVIDIA_GEFORCE8, 2048}, + {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX950M, "NVIDIA GeForce GTX 950M", DRIVER_NVIDIA_GEFORCE8, 4096}, + {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX960, "NVIDIA GeForce GTX 960", DRIVER_NVIDIA_GEFORCE8, 4096}, + {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX960M, "NVIDIA GeForce GTX 960M", DRIVER_NVIDIA_GEFORCE8, 2048}, {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX970, "NVIDIA GeForce GTX 970", DRIVER_NVIDIA_GEFORCE8, 4096}, {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX970M, "NVIDIA GeForce GTX 970M", DRIVER_NVIDIA_GEFORCE8, 3072}, + {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX980, "NVIDIA GeForce GTX 980", DRIVER_NVIDIA_GEFORCE8, 4096}, /* AMD cards */ {HW_VENDOR_AMD, CARD_AMD_RAGE_128PRO, "ATI Rage Fury", DRIVER_AMD_RAGE_128PRO, 16 }, @@ -1508,6 +1516,11 @@ } break; + case 10: + driver_os_version = 10; + driver_model = DRIVER_MODEL_NT6X; + break; + default: FIXME("Unhandled OS version %u.%u, reporting 2000/XP.\n", os_version.dwMajorVersion, os_version.dwMinorVersion); @@ -1528,8 +1541,7 @@ * In order to avoid this application bug we limit the amount of video memory * to LONG_MAX for older Windows versions. */ - if (os_version.dwMajorVersion <= 5 && os_version.dwMinorVersion <= 2 - && driver_info->vram_bytes > LONG_MAX) + if (driver_model < DRIVER_MODEL_NT6X && driver_info->vram_bytes > LONG_MAX) { TRACE("Limiting amount of video memory to %#lx bytes for OS version older than Vista.\n", LONG_MAX); driver_info->vram_bytes = LONG_MAX; @@ -1727,8 +1739,14 @@ cards_nvidia_binary[] = { /* Direct 3D 11 */ + {"GTX 980", CARD_NVIDIA_GEFORCE_GTX980}, /* GeForce 900 - highend */ {"GTX 970M", CARD_NVIDIA_GEFORCE_GTX970M}, /* GeForce 900 - highend mobile*/ {"GTX 970", CARD_NVIDIA_GEFORCE_GTX970}, /* GeForce 900 - highend */ + {"GTX 960M", CARD_NVIDIA_GEFORCE_GTX960M}, /* GeForce 900 - midend high mobile */ + {"GTX 960", CARD_NVIDIA_GEFORCE_GTX960}, /* GeForce 900 - midend high */ + {"GTX 950M", CARD_NVIDIA_GEFORCE_GTX950M}, /* GeForce 900 - midend mobile */ + {"GTX 950", CARD_NVIDIA_GEFORCE_GTX950}, /* GeForce 900 - midend */ + {"GTX 860M", CARD_NVIDIA_GEFORCE_GTX860M}, /* GeForce 800 - mobile */ {"GTX 780 Ti", CARD_NVIDIA_GEFORCE_GTX780TI}, /* Geforce 700 - highend */ {"GTX 780", CARD_NVIDIA_GEFORCE_GTX780}, /* Geforce 700 - highend */ {"GTX 770M", CARD_NVIDIA_GEFORCE_GTX770M}, /* Geforce 700 - midend high mobile */ @@ -2491,6 +2509,8 @@ USE_GL_FUNC(glGetFragDataIndex) /* GL_ARB_color_buffer_float */ USE_GL_FUNC(glClampColorARB) + /* GL_ARB_copy_buffer */ + USE_GL_FUNC(glCopyBufferSubData) /* GL_ARB_debug_output */ USE_GL_FUNC(glDebugMessageCallbackARB) USE_GL_FUNC(glDebugMessageControlARB) @@ -3444,6 +3464,7 @@ * EXT_framebuffer_multisample and EXT_packed_depth_stencil * are integrated into ARB_framebuffer_object. */ + {ARB_COPY_BUFFER, MAKEDWORD_VERSION(3, 1)}, {ARB_DRAW_INSTANCED, MAKEDWORD_VERSION(3, 1)}, {ARB_UNIFORM_BUFFER_OBJECT, MAKEDWORD_VERSION(3, 1)}, {EXT_TEXTURE_SNORM, MAKEDWORD_VERSION(3, 1)}, @@ -3462,6 +3483,7 @@ {ARB_SAMPLER_OBJECTS, MAKEDWORD_VERSION(3, 3)}, {ARB_SHADER_BIT_ENCODING, MAKEDWORD_VERSION(3, 3)}, {ARB_TEXTURE_RGB10_A2UI, MAKEDWORD_VERSION(3, 3)}, + {ARB_TEXTURE_SWIZZLE, MAKEDWORD_VERSION(3, 3)}, {ARB_TIMER_QUERY, MAKEDWORD_VERSION(3, 3)}, {ARB_ES2_COMPATIBILITY, MAKEDWORD_VERSION(4, 1)}, @@ -3591,6 +3613,11 @@ if (gl_version >= MAKEDWORD_VERSION(4, 3)) gl_info->supported[WINED3D_GL_VERSION_4_3] = TRUE; + /* All the points are actually point sprites in core contexts, the APIs from + * ARB_point_sprite are not supported anymore. */ + if (!gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) + gl_info->supported[ARB_POINT_SPRITE] = FALSE; + if (gl_info->supported[APPLE_FENCE]) { /* GL_NV_fence and GL_APPLE_fence provide the same functionality basically. @@ -3749,6 +3776,8 @@ adapter->shader_backend->shader_get_caps(gl_info, &shader_caps); adapter->d3d_info.vs_clipping = shader_caps.wined3d_caps & WINED3D_SHADER_CAP_VS_CLIPPING; adapter->d3d_info.limits.vs_version = shader_caps.vs_version; + adapter->d3d_info.limits.hs_version = shader_caps.hs_version; + adapter->d3d_info.limits.ds_version = shader_caps.ds_version; adapter->d3d_info.limits.gs_version = shader_caps.gs_version; adapter->d3d_info.limits.ps_version = shader_caps.ps_version; adapter->d3d_info.limits.vs_uniform_count = shader_caps.vs_uniform_count; diff -Nru wine-staging-1.9.6/dlls/wined3d/drawprim.c wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/drawprim.c --- wine-staging-1.9.6/dlls/wined3d/drawprim.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/drawprim.c 2016-04-04 18:06:32.000000000 +0000 @@ -625,7 +625,8 @@ if (state->render_states[WINED3D_RS_COLORWRITEENABLE]) { surface_load_location(target, context, rtv->resource->draw_binding); - surface_invalidate_location(target, ~rtv->resource->draw_binding); + wined3d_texture_invalidate_location(target->container, + rtv->sub_resource_idx, ~rtv->resource->draw_binding); } else { @@ -652,7 +653,7 @@ if (!context->render_offscreen && ds != device->onscreen_depth_stencil) device_switch_onscreen_ds(device, context, ds); - if (ds->locations & location) + if (surface_get_sub_resource(ds)->locations & location) SetRect(¤t_rect, 0, 0, ds->ds_current_size.cx, ds->ds_current_size.cy); else SetRectEmpty(¤t_rect); diff -Nru wine-staging-1.9.6/dlls/wined3d/glsl_shader.c wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/glsl_shader.c --- wine-staging-1.9.6/dlls/wined3d/glsl_shader.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/glsl_shader.c 2016-04-04 18:06:32.000000000 +0000 @@ -45,11 +45,10 @@ WINE_DECLARE_DEBUG_CHANNEL(winediag); #define WINED3D_GLSL_SAMPLE_PROJECTED 0x01 -#define WINED3D_GLSL_SAMPLE_NPOT 0x02 -#define WINED3D_GLSL_SAMPLE_LOD 0x04 -#define WINED3D_GLSL_SAMPLE_GRAD 0x08 -#define WINED3D_GLSL_SAMPLE_LOAD 0x10 -#define WINED3D_GLSL_SAMPLE_OFFSET 0x20 +#define WINED3D_GLSL_SAMPLE_LOD 0x02 +#define WINED3D_GLSL_SAMPLE_GRAD 0x04 +#define WINED3D_GLSL_SAMPLE_LOAD 0x08 +#define WINED3D_GLSL_SAMPLE_OFFSET 0x10 struct glsl_dst_param { @@ -271,6 +270,8 @@ { #define WINED3D_TO_STR(u) case u: return #u WINED3D_TO_STR(GL_VERTEX_SHADER); + WINED3D_TO_STR(GL_TESS_CONTROL_SHADER); + WINED3D_TO_STR(GL_TESS_EVALUATION_SHADER); WINED3D_TO_STR(GL_GEOMETRY_SHADER); WINED3D_TO_STR(GL_FRAGMENT_SHADER); #undef WINED3D_TO_STR @@ -286,6 +287,12 @@ case WINED3D_SHADER_TYPE_VERTEX: return "vs"; + case WINED3D_SHADER_TYPE_HULL: + return "hs"; + + case WINED3D_SHADER_TYPE_DOMAIN: + return "ds"; + case WINED3D_SHADER_TYPE_GEOMETRY: return "gs"; @@ -1430,16 +1437,16 @@ if (update_mask & WINED3D_SHADER_CONST_PS_Y_CORR) { - float correction_params[] = + const struct wined3d_vec4 correction_params = { - /* position is window relative, not viewport relative */ - context->render_offscreen ? 0.0f : (float)context->current_rt->resource.height, + /* Position is relative to the framebuffer, not the viewport. */ + context->render_offscreen ? 0.0f : (float)state->fb->render_targets[0]->height, context->render_offscreen ? 1.0f : -1.0f, 0.0f, 0.0f, }; - GL_EXTCALL(glUniform4fv(prog->ps.ycorrection_location, 1, correction_params)); + GL_EXTCALL(glUniform4fv(prog->ps.ycorrection_location, 1, &correction_params.x)); } if (update_mask & WINED3D_SHADER_CONST_PS_NP2_FIXUP) @@ -1571,6 +1578,11 @@ return gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]; } +static const char *get_attribute_keyword(const struct wined3d_gl_info *gl_info) +{ + return needs_legacy_glsl_syntax(gl_info) ? "attribute" : "in"; +} + static void PRINTF_ATTR(4, 5) declare_in_varying(const struct wined3d_gl_info *gl_info, struct wined3d_string_buffer *buffer, BOOL flat, const char *format, ...) { @@ -1611,6 +1623,11 @@ } } +static const char *get_fragment_output(const struct wined3d_gl_info *gl_info) +{ + return needs_legacy_glsl_syntax(gl_info) ? "gl_FragData" : "ps_out"; +} + static BOOL glsl_is_color_reg_read(const struct wined3d_shader *shader, unsigned int idx) { const struct wined3d_shader_signature *input_signature = &shader->input_signature; @@ -1640,6 +1657,17 @@ return FALSE; } +static BOOL glsl_is_shadow_sampler(const struct wined3d_shader *shader, + const struct ps_compile_args *ps_args, unsigned int resource_idx, unsigned int sampler_idx) +{ + const struct wined3d_shader_version *version = &shader->reg_maps.shader_version; + + if (version->major >= 4) + return shader->reg_maps.sampler_comparison_mode & (1u << sampler_idx); + else + return version->type == WINED3D_SHADER_TYPE_PIXEL && (ps_args->shadow & (1u << resource_idx)); +} + /** Generate the variable & register declarations for the GLSL output target */ static void shader_generate_glsl_declarations(const struct wined3d_context *context, struct wined3d_string_buffer *buffer, const struct wined3d_shader *shader, @@ -1788,7 +1816,7 @@ break; } - shadow_sampler = version->type == WINED3D_SHADER_TYPE_PIXEL && (ps_args->shadow & (1u << entry->sampler_idx)); + shadow_sampler = glsl_is_shadow_sampler(shader, ps_args, entry->resource_idx, entry->sampler_idx); switch (reg_maps->resource_info[entry->resource_idx].type) { case WINED3D_SHADER_RESOURCE_TEXTURE_1D: @@ -1884,11 +1912,12 @@ for (i = 0; i < shader->input_signature.element_count; ++i) { const struct wined3d_shader_signature_element *e = &shader->input_signature.elements[i]; - if (e->sysval_semantic == WINED3D_SV_INSTANCEID) + if (e->sysval_semantic == WINED3D_SV_INSTANCE_ID) shader_addline(buffer, "vec4 %s_in%u = vec4(intBitsToFloat(gl_InstanceID), 0.0, 0.0, 0.0);\n", prefix, e->register_idx); else - shader_addline(buffer, "attribute vec4 %s_in%u;\n", prefix, e->register_idx); + shader_addline(buffer, "%s vec4 %s_in%u;\n", + get_attribute_keyword(gl_info), prefix, e->register_idx); } if (vs_args->point_size && !vs_args->per_vertex_point_size) @@ -1989,6 +2018,9 @@ shader_addline(buffer, "vec4 vpos;\n"); } + if (!needs_legacy_glsl_syntax(gl_info)) + shader_addline(buffer, "out vec4 ps_out[%u];\n", gl_info->limits.buffers); + if (shader->limits->constant_float + extra_constants_needed >= gl_info->limits.glsl_ps_float_constants) FIXME("Insufficient uniforms to run this shader.\n"); } @@ -2307,7 +2339,7 @@ WARN("Write to render target %u, only %d supported.\n", reg->idx[0].offset, gl_info->limits.buffers); - sprintf(register_name, "gl_FragData[%u]", reg->idx[0].offset); + sprintf(register_name, "%s[%u]", get_fragment_output(gl_info), reg->idx[0].offset); break; case WINED3DSPR_RASTOUT: @@ -2652,7 +2684,7 @@ } static void shader_glsl_get_sample_function(const struct wined3d_shader_context *ctx, - DWORD resource_idx, DWORD flags, struct glsl_sample_function *sample_function) + DWORD resource_idx, DWORD sampler_idx, DWORD flags, struct glsl_sample_function *sample_function) { static const struct { @@ -2676,10 +2708,11 @@ struct shader_glsl_ctx_priv *priv = ctx->backend_data; enum wined3d_shader_resource_type resource_type = ctx->reg_maps->resource_info[resource_idx].type; const struct wined3d_gl_info *gl_info = ctx->gl_info; - BOOL shadow = ctx->reg_maps->shader_version.type == WINED3D_SHADER_TYPE_PIXEL - && (priv->cur_ps_args->shadow & (1u << resource_idx)); + BOOL shadow = glsl_is_shadow_sampler(ctx->shader, priv->cur_ps_args, resource_idx, sampler_idx); BOOL projected = flags & WINED3D_GLSL_SAMPLE_PROJECTED; - BOOL texrect = flags & WINED3D_GLSL_SAMPLE_NPOT && gl_info->supported[ARB_TEXTURE_RECTANGLE]; + BOOL texrect = ctx->reg_maps->shader_version.type == WINED3D_SHADER_TYPE_PIXEL + && priv->cur_ps_args->np2_fixup & (1u << resource_idx) + && gl_info->supported[ARB_TEXTURE_RECTANGLE]; BOOL lod = flags & WINED3D_GLSL_SAMPLE_LOD; BOOL grad = flags & WINED3D_GLSL_SAMPLE_GRAD; BOOL offset = flags & WINED3D_GLSL_SAMPLE_OFFSET; @@ -2873,9 +2906,8 @@ shader_glsl_swizzle_to_str(swizzle, FALSE, ins->dst[0].write_mask, dst_swizzle); - /* FIXME: We currently don't support fixups for vertex shaders or anything - * above SM3. Note that for SM4+ the sampler index doesn't have to match - * the resource index. */ + /* If ARB_texture_swizzle is supported we don't need to do anything here. + * We actually rely on it for vertex shaders and SM4+. */ if (version->type == WINED3D_SHADER_TYPE_PIXEL && version->major < 4) { const struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data; @@ -4213,10 +4245,7 @@ } } - if (priv->cur_ps_args->np2_fixup & (1u << resource_idx)) - sample_flags |= WINED3D_GLSL_SAMPLE_NPOT; - - shader_glsl_get_sample_function(ins->ctx, resource_idx, sample_flags, &sample_function); + shader_glsl_get_sample_function(ins->ctx, resource_idx, resource_idx, sample_flags, &sample_function); mask |= sample_function.coord_mask; sample_function.coord_mask = mask; @@ -4254,11 +4283,9 @@ { const struct wined3d_gl_info *gl_info = ins->ctx->gl_info; struct glsl_src_param coord_param, dx_param, dy_param; - DWORD sample_flags = WINED3D_GLSL_SAMPLE_GRAD; struct glsl_sample_function sample_function; DWORD sampler_idx; DWORD swizzle = ins->src[1].swizzle; - const struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data; if (!gl_info->supported[ARB_SHADER_TEXTURE_LOD] && !gl_info->supported[EXT_GPU_SHADER4]) { @@ -4268,10 +4295,8 @@ } sampler_idx = ins->src[1].reg.idx[0].offset; - if (priv->cur_ps_args->np2_fixup & (1u << sampler_idx)) - sample_flags |= WINED3D_GLSL_SAMPLE_NPOT; - shader_glsl_get_sample_function(ins->ctx, sampler_idx, sample_flags, &sample_function); + shader_glsl_get_sample_function(ins->ctx, sampler_idx, sampler_idx, WINED3D_GLSL_SAMPLE_GRAD, &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[2], sample_function.coord_mask, &dx_param); shader_glsl_add_src_param(ins, &ins->src[3], sample_function.coord_mask, &dy_param); @@ -4285,18 +4310,13 @@ { const struct wined3d_gl_info *gl_info = ins->ctx->gl_info; struct glsl_src_param coord_param, lod_param; - DWORD sample_flags = WINED3D_GLSL_SAMPLE_LOD; struct glsl_sample_function sample_function; DWORD sampler_idx; DWORD swizzle = ins->src[1].swizzle; - const struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data; sampler_idx = ins->src[1].reg.idx[0].offset; - if (ins->ctx->reg_maps->shader_version.type == WINED3D_SHADER_TYPE_PIXEL - && priv->cur_ps_args->np2_fixup & (1u << sampler_idx)) - sample_flags |= WINED3D_GLSL_SAMPLE_NPOT; - shader_glsl_get_sample_function(ins->ctx, sampler_idx, sample_flags, &sample_function); + shader_glsl_get_sample_function(ins->ctx, sampler_idx, sampler_idx, WINED3D_GLSL_SAMPLE_LOD, &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); @@ -4405,19 +4425,21 @@ /* FIXME: The current implementation does not handle multisample textures correctly. */ static void shader_glsl_ld(const struct wined3d_shader_instruction *ins) { + unsigned int resource_idx, sampler_idx, sampler_bind_idx; struct glsl_src_param coord_param, lod_param; struct glsl_sample_function sample_function; - unsigned int sampler_bind_idx; DWORD flags = WINED3D_GLSL_SAMPLE_LOAD; if (wined3d_shader_instruction_has_texel_offset(ins)) flags |= WINED3D_GLSL_SAMPLE_OFFSET; - shader_glsl_get_sample_function(ins->ctx, ins->src[1].reg.idx[0].offset, flags, &sample_function); + resource_idx = ins->src[1].reg.idx[0].offset; + sampler_idx = WINED3D_SAMPLER_DEFAULT; + + shader_glsl_get_sample_function(ins->ctx, resource_idx, sampler_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[0], WINED3DSP_WRITEMASK_3, &lod_param); - sampler_bind_idx = shader_glsl_find_sampler(&ins->ctx->reg_maps->sampler_map, - ins->src[1].reg.idx[0].offset, WINED3D_SAMPLER_DEFAULT); + 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, NULL, NULL, lod_param.param_str, &ins->texel_offset, "%s", coord_param.param_str); shader_glsl_release_sample_function(ins->ctx, &sample_function); @@ -4441,7 +4463,7 @@ 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, resource_idx, flags, &sample_function); + shader_glsl_get_sample_function(ins->ctx, resource_idx, sampler_idx, flags, &sample_function); shader_glsl_add_src_param(ins, &ins->src[0], sample_function.coord_mask, &coord_param); switch (ins->handler_idx) @@ -4473,6 +4495,38 @@ shader_glsl_release_sample_function(ins->ctx, &sample_function); } +static void shader_glsl_sample_c(const struct wined3d_shader_instruction *ins) +{ + unsigned int resource_idx, sampler_idx, sampler_bind_idx; + struct glsl_src_param coord_param, compare_param; + struct glsl_sample_function sample_function; + const char *lod_param = NULL; + DWORD flags = 0; + UINT coord_size; + + if (ins->handler_idx == WINED3DSIH_SAMPLE_C_LZ) + { + lod_param = "0"; + flags |= WINED3D_GLSL_SAMPLE_LOD; + } + + if (wined3d_shader_instruction_has_texel_offset(ins)) + flags |= WINED3D_GLSL_SAMPLE_OFFSET; + + 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, resource_idx, sampler_idx, flags, &sample_function); + coord_size = shader_glsl_get_write_mask_size(sample_function.coord_mask); + shader_glsl_add_src_param(ins, &ins->src[0], sample_function.coord_mask >> 1, &coord_param); + shader_glsl_add_src_param(ins, &ins->src[3], WINED3DSP_WRITEMASK_0, &compare_param); + 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, WINED3DSP_NOSWIZZLE, + NULL, NULL, lod_param, &ins->texel_offset, "vec%u(%s, %s)", + coord_size, coord_param.param_str, compare_param.param_str); + shader_glsl_release_sample_function(ins->ctx, &sample_function); +} + static void shader_glsl_texcoord(const struct wined3d_shader_instruction *ins) { /* FIXME: Make this work for more than just 2D textures */ @@ -4533,7 +4587,7 @@ * * It is a dependent read - not valid with conditional NP2 textures */ - shader_glsl_get_sample_function(ins->ctx, sampler_idx, 0, &sample_function); + shader_glsl_get_sample_function(ins->ctx, sampler_idx, sampler_idx, 0, &sample_function); mask_size = shader_glsl_get_write_mask_size(sample_function.coord_mask); switch(mask_size) @@ -4655,7 +4709,7 @@ shader_glsl_add_src_param(ins, &ins->src[0], src_mask, &src0_param); shader_addline(buffer, "tmp0.y = dot(T%u.xyz, %s);\n", reg, src0_param.param_str); - shader_glsl_get_sample_function(ins->ctx, reg, 0, &sample_function); + shader_glsl_get_sample_function(ins->ctx, reg, reg, 0, &sample_function); /* Sample the texture using the calculated coordinates */ shader_glsl_gen_sample_code(ins, reg, &sample_function, WINED3DSP_NOSWIZZLE, NULL, NULL, NULL, NULL, "tmp0.xy"); @@ -4676,7 +4730,7 @@ shader_addline(ins->ctx->buffer, "tmp0.z = dot(T%u.xyz, %s);\n", reg, src0_param.param_str); /* Dependent read, not valid with conditional NP2 */ - shader_glsl_get_sample_function(ins->ctx, reg, 0, &sample_function); + shader_glsl_get_sample_function(ins->ctx, reg, reg, 0, &sample_function); /* Sample the texture using the calculated coordinates */ shader_glsl_gen_sample_code(ins, reg, &sample_function, WINED3DSP_NOSWIZZLE, NULL, NULL, NULL, NULL, "tmp0.xyz"); @@ -4726,7 +4780,7 @@ shader_addline(buffer, "tmp0.xyz = -reflect((%s), normalize(tmp0.xyz));\n", src1_param.param_str); /* Dependent read, not valid with conditional NP2 */ - shader_glsl_get_sample_function(ins->ctx, reg, 0, &sample_function); + shader_glsl_get_sample_function(ins->ctx, reg, reg, 0, &sample_function); shader_glsl_write_mask_to_str(sample_function.coord_mask, coord_mask); /* Sample the texture */ @@ -4760,7 +4814,7 @@ shader_addline(buffer, "tmp0.xyz = -reflect(tmp1.xyz, normalize(tmp0.xyz));\n"); /* Dependent read, not valid with conditional NP2 */ - shader_glsl_get_sample_function(ins->ctx, reg, 0, &sample_function); + shader_glsl_get_sample_function(ins->ctx, reg, reg, 0, &sample_function); shader_glsl_write_mask_to_str(sample_function.coord_mask, coord_mask); /* Sample the texture using the calculated coordinates */ @@ -4790,7 +4844,7 @@ & WINED3D_PSARGS_TEXTRANSFORM_MASK; /* Dependent read, not valid with conditional NP2 */ - shader_glsl_get_sample_function(ins->ctx, sampler_idx, 0, &sample_function); + shader_glsl_get_sample_function(ins->ctx, sampler_idx, sampler_idx, 0, &sample_function); mask = sample_function.coord_mask; shader_glsl_write_mask_to_str(mask, coord_mask); @@ -4865,7 +4919,7 @@ shader_glsl_add_src_param(ins, &ins->src[0], WINED3DSP_WRITEMASK_ALL, &src0_param); - shader_glsl_get_sample_function(ins->ctx, sampler_idx, 0, &sample_function); + shader_glsl_get_sample_function(ins->ctx, sampler_idx, sampler_idx, 0, &sample_function); shader_glsl_gen_sample_code(ins, sampler_idx, &sample_function, WINED3DSP_NOSWIZZLE, NULL, NULL, NULL, NULL, "%s.wx", src0_param.reg_name); shader_glsl_release_sample_function(ins->ctx, &sample_function); @@ -4881,7 +4935,7 @@ shader_glsl_add_src_param(ins, &ins->src[0], WINED3DSP_WRITEMASK_ALL, &src0_param); - shader_glsl_get_sample_function(ins->ctx, sampler_idx, 0, &sample_function); + shader_glsl_get_sample_function(ins->ctx, sampler_idx, sampler_idx, 0, &sample_function); shader_glsl_gen_sample_code(ins, sampler_idx, &sample_function, WINED3DSP_NOSWIZZLE, NULL, NULL, NULL, NULL, "%s.yz", src0_param.reg_name); shader_glsl_release_sample_function(ins->ctx, &sample_function); @@ -4896,7 +4950,7 @@ struct glsl_src_param src0_param; /* Dependent read, not valid with conditional NP2 */ - shader_glsl_get_sample_function(ins->ctx, sampler_idx, 0, &sample_function); + shader_glsl_get_sample_function(ins->ctx, sampler_idx, sampler_idx, 0, &sample_function); shader_glsl_add_src_param(ins, &ins->src[0], sample_function.coord_mask, &src0_param); shader_glsl_gen_sample_code(ins, sampler_idx, &sample_function, WINED3DSP_NOSWIZZLE, NULL, NULL, NULL, NULL, @@ -5351,18 +5405,24 @@ return ret; } -static void shader_glsl_generate_srgb_write_correction(struct wined3d_string_buffer *buffer) +static void shader_glsl_generate_srgb_write_correction(struct wined3d_string_buffer *buffer, + const struct wined3d_gl_info *gl_info) { - shader_addline(buffer, "tmp0.xyz = pow(gl_FragData[0].xyz, vec3(srgb_const0.x));\n"); + const char *output = get_fragment_output(gl_info); + + shader_addline(buffer, "tmp0.xyz = pow(%s[0].xyz, vec3(srgb_const0.x));\n", output); shader_addline(buffer, "tmp0.xyz = tmp0.xyz * vec3(srgb_const0.y) - vec3(srgb_const0.z);\n"); - shader_addline(buffer, "tmp1.xyz = gl_FragData[0].xyz * vec3(srgb_const0.w);\n"); - shader_addline(buffer, "bvec3 srgb_compare = lessThan(gl_FragData[0].xyz, vec3(srgb_const1.x));\n"); - shader_addline(buffer, "gl_FragData[0].xyz = mix(tmp0.xyz, tmp1.xyz, vec3(srgb_compare));\n"); - shader_addline(buffer, "gl_FragData[0] = clamp(gl_FragData[0], 0.0, 1.0);\n"); + shader_addline(buffer, "tmp1.xyz = %s[0].xyz * vec3(srgb_const0.w);\n", output); + shader_addline(buffer, "bvec3 srgb_compare = lessThan(%s[0].xyz, vec3(srgb_const1.x));\n", output); + shader_addline(buffer, "%s[0].xyz = mix(tmp0.xyz, tmp1.xyz, vec3(srgb_compare));\n", output); + shader_addline(buffer, "%s[0] = clamp(%s[0], 0.0, 1.0);\n", output, output); } -static void shader_glsl_generate_fog_code(struct wined3d_string_buffer *buffer, enum wined3d_ffp_ps_fog_mode mode) +static void shader_glsl_generate_fog_code(struct wined3d_string_buffer *buffer, + const struct wined3d_gl_info *gl_info, enum wined3d_ffp_ps_fog_mode mode) { + const char *output = get_fragment_output(gl_info); + switch (mode) { case WINED3D_FFP_PS_FOG_OFF: @@ -5386,8 +5446,8 @@ return; } - shader_addline(buffer, "gl_FragData[0].xyz = mix(ffp_fog.color.xyz, gl_FragData[0].xyz," - " clamp(fog, 0.0, 1.0));\n"); + shader_addline(buffer, "%s[0].xyz = mix(ffp_fog.color.xyz, %s[0].xyz, clamp(fog, 0.0, 1.0));\n", + output, output); } /* Context activation is done by the caller. */ @@ -5471,17 +5531,14 @@ /* Pixel shaders < 2.0 place the resulting color in R0 implicitly */ if (reg_maps->shader_version.major < 2) - { - /* Some older cards like GeforceFX ones don't support multiple buffers, so also not gl_FragData */ - shader_addline(buffer, "gl_FragData[0] = R0;\n"); - } + shader_addline(buffer, "%s[0] = R0;\n", get_fragment_output(gl_info)); if (args->srgb_correction) - shader_glsl_generate_srgb_write_correction(buffer); + shader_glsl_generate_srgb_write_correction(buffer, gl_info); /* SM < 3 does not replace the fog stage. */ if (reg_maps->shader_version.major < 3) - shader_glsl_generate_fog_code(buffer, args->fog); + shader_glsl_generate_fog_code(buffer, gl_info, args->fog); shader_addline(buffer, "}\n"); @@ -6023,7 +6080,7 @@ { const char *type = i < ARRAY_SIZE(attrib_info) ? attrib_info[i].type : "vec4"; - shader_addline(buffer, "attribute %s vs_in%u;\n", type, i); + shader_addline(buffer, "%s %s vs_in%u;\n", get_attribute_keyword(gl_info), type, i); } shader_addline(buffer, "\n"); @@ -6096,10 +6153,9 @@ for (i = 0; i < MAX_TEXTURES; ++i) { unsigned int coord_idx = settings->texgen[i] & 0x0000ffff; - if ((settings->texgen[i] & 0xffff0000) == WINED3DTSS_TCI_PASSTHRU) - { + if ((settings->texgen[i] & 0xffff0000) == WINED3DTSS_TCI_PASSTHRU + && settings->texcoords & (1u << i)) shader_addline(buffer, "vec4 ffp_attrib_texcoord%u = vs_in%u;\n", i, coord_idx + WINED3D_FFP_TEXCOORD0); - } } shader_addline(buffer, "ffp_attrib_blendweight[%u] = 1.0;\n", settings->vertexblends); @@ -6148,6 +6204,11 @@ shader_addline(buffer, "gl_FrontColor = ffp_varying_diffuse;\n"); shader_addline(buffer, "gl_FrontSecondaryColor = ffp_varying_specular;\n"); } + else + { + shader_addline(buffer, "ffp_varying_diffuse = clamp(ffp_varying_diffuse, 0.0, 1.0);\n"); + shader_addline(buffer, "ffp_varying_specular = clamp(ffp_varying_specular, 0.0, 1.0);\n"); + } for (i = 0; i < MAX_TEXTURES; ++i) { @@ -6565,6 +6626,9 @@ if (gl_info->supported[ARB_TEXTURE_RECTANGLE]) shader_addline(buffer, "#extension GL_ARB_texture_rectangle : enable\n"); + if (!needs_legacy_glsl_syntax(gl_info)) + shader_addline(buffer, "out vec4 ps_out[1];\n"); + shader_addline(buffer, "vec4 tmp0, tmp1;\n"); shader_addline(buffer, "vec4 ret;\n"); if (tempreg_used || settings->sRGB_write) @@ -6881,12 +6945,13 @@ } } - shader_addline(buffer, "gl_FragData[0] = ffp_varying_specular * specular_enable + ret;\n"); + shader_addline(buffer, "%s[0] = ffp_varying_specular * specular_enable + ret;\n", + get_fragment_output(gl_info)); if (settings->sRGB_write) - shader_glsl_generate_srgb_write_correction(buffer); + shader_glsl_generate_srgb_write_correction(buffer, gl_info); - shader_glsl_generate_fog_code(buffer, settings->fog); + shader_glsl_generate_fog_code(buffer, gl_info, settings->fog); shader_addline(buffer, "}\n"); @@ -7308,14 +7373,24 @@ pshader ? min(pshader->limits->constant_float, gl_info->limits.glsl_ps_float_constants) : 0); checkGLcall("Find glsl program uniform locations"); - if (pshader && pshader->reg_maps.shader_version.major >= 3 - && pshader->u.ps.declared_in_count > vec4_varyings(3, gl_info)) + if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) { - TRACE("Shader %d needs vertex color clamping disabled.\n", program_id); - entry->vs.vertex_color_clamp = GL_FALSE; + if (pshader && pshader->reg_maps.shader_version.major >= 3 + && pshader->u.ps.declared_in_count > vec4_varyings(3, gl_info)) + { + TRACE("Shader %d needs vertex color clamping disabled.\n", program_id); + entry->vs.vertex_color_clamp = GL_FALSE; + } + else + { + entry->vs.vertex_color_clamp = GL_FIXED_ONLY_ARB; + } } else { + /* With core profile we never change vertex_color_clamp from + * GL_FIXED_ONLY_MODE (which is also the initial value) so we never call + * glClampColorARB(). */ entry->vs.vertex_color_clamp = GL_FIXED_ONLY_ARB; } @@ -7605,7 +7680,9 @@ ctx_data->glsl_program = NULL; context->shader_update_mask = (1u << WINED3D_SHADER_TYPE_PIXEL) | (1u << WINED3D_SHADER_TYPE_VERTEX) - | (1u << WINED3D_SHADER_TYPE_GEOMETRY); + | (1u << WINED3D_SHADER_TYPE_GEOMETRY) + | (1u << WINED3D_SHADER_TYPE_HULL) + | (1u << WINED3D_SHADER_TYPE_DOMAIN); } /* Context activation is done by the caller. */ @@ -7621,7 +7698,7 @@ priv->vertex_pipe->vp_enable(gl_info, FALSE); priv->fragment_pipe->enable_extension(gl_info, FALSE); - if (gl_info->supported[ARB_COLOR_BUFFER_FLOAT]) + if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT] && gl_info->supported[ARB_COLOR_BUFFER_FLOAT]) { GL_EXTCALL(glClampColorARB(GL_CLAMP_VERTEX_COLOR_ARB, GL_FIXED_ONLY_ARB)); checkGLcall("glClampColorARB"); @@ -7991,7 +8068,8 @@ if (gl_info->glsl_version >= MAKEDWORD_VERSION(4, 30) && gl_info->supported[WINED3D_GL_VERSION_4_3]) shader_model = 5; else if (gl_info->glsl_version >= MAKEDWORD_VERSION(1, 50) && gl_info->supported[WINED3D_GL_VERSION_3_2] - && gl_info->supported[ARB_SHADER_BIT_ENCODING] && gl_info->supported[ARB_SAMPLER_OBJECTS]) + && gl_info->supported[ARB_SHADER_BIT_ENCODING] && gl_info->supported[ARB_SAMPLER_OBJECTS] + && gl_info->supported[ARB_TEXTURE_SWIZZLE]) shader_model = 4; /* ARB_shader_texture_lod or EXT_gpu_shader4 is required for the SM3 * texldd and texldl instructions. */ @@ -8002,6 +8080,8 @@ TRACE("Shader model %u.\n", shader_model); caps->vs_version = min(wined3d_settings.max_sm_vs, shader_model); + caps->hs_version = min(wined3d_settings.max_sm_hs, shader_model); + caps->ds_version = min(wined3d_settings.max_sm_ds, shader_model); caps->gs_version = min(wined3d_settings.max_sm_gs, shader_model); caps->ps_version = min(wined3d_settings.max_sm_ps, shader_model); @@ -8054,153 +8134,166 @@ 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_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_DSX_COARSE */ NULL, - /* WINED3DSIH_DSX_FINE */ NULL, - /* WINED3DSIH_DSY */ shader_glsl_map2gl, - /* WINED3DSIH_DSY_COARSE */ NULL, - /* WINED3DSIH_DSY_FINE */ NULL, - /* 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_LD_STRUCTURED */ NULL, - /* 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, + /* 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_HS_FORK_PHASE_INSTANCE_COUNT */ NULL, + /* WINED3DSIH_DCL_HS_MAX_TESSFACTOR */ NULL, + /* WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER */ NULL, + /* WINED3DSIH_DCL_INPUT */ shader_glsl_nop, + /* WINED3DSIH_DCL_INPUT_CONTROL_POINT_COUNT */ NULL, + /* 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_CONTROL_POINT_COUNT */ NULL, + /* WINED3DSIH_DCL_OUTPUT_SIV */ shader_glsl_nop, + /* WINED3DSIH_DCL_OUTPUT_TOPOLOGY */ shader_glsl_nop, + /* WINED3DSIH_DCL_RESOURCE_STRUCTURED */ NULL, + /* WINED3DSIH_DCL_SAMPLER */ shader_glsl_nop, + /* WINED3DSIH_DCL_TEMPS */ shader_glsl_nop, + /* WINED3DSIH_DCL_TESSELLATOR_DOMAIN */ NULL, + /* WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE */ NULL, + /* WINED3DSIH_DCL_TESSELLATOR_PARTITIONING */ NULL, + /* WINED3DSIH_DCL_UAV_TYPED */ NULL, + /* 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_DSX_COARSE */ NULL, + /* WINED3DSIH_DSX_FINE */ NULL, + /* WINED3DSIH_DSY */ shader_glsl_map2gl, + /* WINED3DSIH_DSY_COARSE */ NULL, + /* WINED3DSIH_DSY_FINE */ NULL, + /* 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_HS_DECLS */ shader_glsl_nop, + /* WINED3DSIH_HS_FORK_PHASE */ NULL, + /* 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_LD2DMS */ NULL, + /* WINED3DSIH_LD_STRUCTURED */ NULL, + /* 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 */ shader_glsl_sample_c, + /* WINED3DSIH_SAMPLE_C_LZ */ shader_glsl_sample_c, + /* 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_STORE_UAV_TYPED */ NULL, + /* 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) { @@ -8502,6 +8595,15 @@ context->constant_update_mask |= WINED3D_SHADER_CONST_VS_POINTSIZE; } +static void glsl_vertex_pointsprite_core(struct wined3d_context *context, + const struct wined3d_state *state, DWORD state_id) +{ + static unsigned int once; + + if (state->gl_primitive_type == GL_POINTS && !state->render_states[WINED3D_RS_POINTSPRITEENABLE] && !once++) + FIXME("Non-point sprite points not supported in core profile.\n"); +} + static void glsl_vertex_pipe_shademode(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { @@ -8610,7 +8712,8 @@ {STATE_RENDER(WINED3D_RS_POINTSIZE), {STATE_RENDER(WINED3D_RS_POINTSIZE_MIN), NULL }, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_POINTSIZE_MIN), {STATE_RENDER(WINED3D_RS_POINTSIZE_MIN), glsl_vertex_pipe_pointsize}, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_POINTSPRITEENABLE), {STATE_RENDER(WINED3D_RS_POINTSPRITEENABLE), state_pointsprite }, ARB_POINT_SPRITE }, - {STATE_RENDER(WINED3D_RS_POINTSPRITEENABLE), {STATE_RENDER(WINED3D_RS_POINTSPRITEENABLE), state_pointsprite_w }, WINED3D_GL_EXT_NONE }, + {STATE_RENDER(WINED3D_RS_POINTSPRITEENABLE), {STATE_RENDER(WINED3D_RS_POINTSPRITEENABLE), state_pointsprite_w }, WINED3D_GL_LEGACY_CONTEXT }, + {STATE_RENDER(WINED3D_RS_POINTSPRITEENABLE), {STATE_RENDER(WINED3D_RS_POINTSPRITEENABLE), glsl_vertex_pointsprite_core}, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_POINTSCALEENABLE), {STATE_RENDER(WINED3D_RS_POINTSCALEENABLE), glsl_vertex_pipe_pointscale}, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_POINTSCALE_A), {STATE_RENDER(WINED3D_RS_POINTSCALEENABLE), NULL }, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_POINTSCALE_B), {STATE_RENDER(WINED3D_RS_POINTSCALEENABLE), NULL }, WINED3D_GL_EXT_NONE }, @@ -8976,6 +9079,7 @@ {STATE_RENDER(WINED3D_RS_FOGCOLOR), {STATE_RENDER(WINED3D_RS_FOGCOLOR), glsl_fragment_pipe_fogparams }, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_FOGDENSITY), {STATE_RENDER(WINED3D_RS_FOGDENSITY), glsl_fragment_pipe_fogparams }, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_POINTSPRITEENABLE), {STATE_RENDER(WINED3D_RS_POINTSPRITEENABLE), glsl_fragment_pipe_shader }, ARB_POINT_SPRITE }, + {STATE_RENDER(WINED3D_RS_POINTSPRITEENABLE), {STATE_RENDER(WINED3D_RS_POINTSPRITEENABLE), glsl_fragment_pipe_shader }, WINED3D_GL_VERSION_2_0}, {STATE_TEXTURESTAGE(0,WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), {STATE_TEXTURESTAGE(0, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), glsl_fragment_pipe_tex_transform }, WINED3D_GL_EXT_NONE }, {STATE_TEXTURESTAGE(1,WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), {STATE_TEXTURESTAGE(1, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), glsl_fragment_pipe_tex_transform }, WINED3D_GL_EXT_NONE }, {STATE_TEXTURESTAGE(2,WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), {STATE_TEXTURESTAGE(2, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), glsl_fragment_pipe_tex_transform }, WINED3D_GL_EXT_NONE }, diff -Nru wine-staging-1.9.6/dlls/wined3d/query.c wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/query.c --- wine-staging-1.9.6/dlls/wined3d/query.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/query.c 2016-04-04 18:06:32.000000000 +0000 @@ -58,7 +58,7 @@ return WINED3D_EVENT_QUERY_WRONG_THREAD; } - context = context_acquire(device, query->context->current_rt); + context = context_acquire(device, context_get_rt_surface(query->context)); gl_info = context->gl_info; if (gl_info->supported[ARB_SYNC]) @@ -132,7 +132,7 @@ return WINED3D_EVENT_QUERY_WRONG_THREAD; } - context = context_acquire(device, query->context->current_rt); + context = context_acquire(device, context_get_rt_surface(query->context)); if (gl_info->supported[ARB_SYNC]) { @@ -192,7 +192,7 @@ } else { - context = context_acquire(device, query->context->current_rt); + context = context_acquire(device, context_get_rt_surface(query->context)); } } else @@ -348,7 +348,7 @@ return S_OK; } - context = context_acquire(query->device, oq->context->current_rt); + context = context_acquire(device, context_get_rt_surface(oq->context)); GL_EXTCALL(glGetQueryObjectuiv(oq->id, GL_QUERY_RESULT_AVAILABLE, &available)); checkGLcall("glGetQueryObjectuiv(GL_QUERY_RESULT_AVAILABLE)"); @@ -490,7 +490,7 @@ } else { - context = context_acquire(query->device, oq->context->current_rt); + context = context_acquire(device, context_get_rt_surface(oq->context)); GL_EXTCALL(glEndQuery(GL_SAMPLES_PASSED)); checkGLcall("glEndQuery()"); @@ -522,7 +522,7 @@ } else { - context = context_acquire(query->device, oq->context->current_rt); + context = context_acquire(device, context_get_rt_surface(oq->context)); GL_EXTCALL(glEndQuery(GL_SAMPLES_PASSED)); checkGLcall("glEndQuery()"); @@ -578,7 +578,7 @@ return S_OK; } - context = context_acquire(query->device, tq->context->current_rt); + context = context_acquire(device, context_get_rt_surface(tq->context)); GL_EXTCALL(glGetQueryObjectuiv(tq->id, GL_QUERY_RESULT_AVAILABLE, &available)); checkGLcall("glGetQueryObjectuiv(GL_QUERY_RESULT_AVAILABLE)"); diff -Nru wine-staging-1.9.6/dlls/wined3d/shader.c wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/shader.c --- wine-staging-1.9.6/dlls/wined3d/shader.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/shader.c 2016-04-04 18:06:32.000000000 +0000 @@ -40,153 +40,166 @@ 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_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_DSX_COARSE */ "deriv_rtx_coarse", - /* WINED3DSIH_DSX_FINE */ "deriv_rtx_fine", - /* WINED3DSIH_DSY */ "dsy", - /* WINED3DSIH_DSY_COARSE */ "deriv_rty_coarse", - /* WINED3DSIH_DSY_FINE */ "deriv_rty_fine", - /* 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_LD_STRUCTURED */ "ld_structured", - /* 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", + /* 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_HS_FORK_PHASE_INSTANCE_COUNT */ "dcl_hs_fork_phase_instance_count", + /* WINED3DSIH_DCL_HS_MAX_TESSFACTOR */ "dcl_hs_max_tessfactor", + /* WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER */ "dcl_immediateConstantBuffer", + /* WINED3DSIH_DCL_INPUT */ "dcl_input", + /* WINED3DSIH_DCL_INPUT_CONTROL_POINT_COUNT */ "dcl_input_control_point_count", + /* 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_CONTROL_POINT_COUNT */ "dcl_output_control_point_count", + /* WINED3DSIH_DCL_OUTPUT_SIV */ "dcl_output_siv", + /* WINED3DSIH_DCL_OUTPUT_TOPOLOGY */ "dcl_outputTopology", + /* WINED3DSIH_DCL_RESOURCE_STRUCTURED */ "dcl_resource_structured", + /* WINED3DSIH_DCL_SAMPLER */ "dcl_sampler", + /* WINED3DSIH_DCL_TEMPS */ "dcl_temps", + /* WINED3DSIH_DCL_TESSELLATOR_DOMAIN */ "dcl_tessellator_domain", + /* WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE */ "dcl_tessellator_output_primitive", + /* WINED3DSIH_DCL_TESSELLATOR_PARTITIONING */ "dcl_tessellator_partitioning", + /* WINED3DSIH_DCL_UAV_TYPED */ "dcl_uav_typed", + /* 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_DSX_COARSE */ "deriv_rtx_coarse", + /* WINED3DSIH_DSX_FINE */ "deriv_rtx_fine", + /* WINED3DSIH_DSY */ "dsy", + /* WINED3DSIH_DSY_COARSE */ "deriv_rty_coarse", + /* WINED3DSIH_DSY_FINE */ "deriv_rty_fine", + /* 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_HS_DECLS */ "hs_decls", + /* WINED3DSIH_HS_FORK_PHASE */ "hs_fork_phase", + /* 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_LD2DMS */ "ld2dms", + /* WINED3DSIH_LD_STRUCTURED */ "ld_structured", + /* 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_STORE_UAV_TYPED */ "store_uav_typed", + /* 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[] = @@ -214,11 +227,23 @@ } 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"}, + {WINED3D_SV_POSITION, "SV_Position"}, + {WINED3D_SV_INSTANCE_ID, "SV_InstanceID"}, + {WINED3D_SV_PRIMITIVE_ID, "SV_PrimitiveID"}, + {WINED3D_SV_IS_FRONT_FACE, "SV_IsFrontFace"}, + {WINED3D_SV_SAMPLE_INDEX, "SV_SampleIndex"}, + {WINED3D_SV_QUAD_U0_TESS_FACTOR, "finalQuadUeq0EdgeTessFactor"}, + {WINED3D_SV_QUAD_V0_TESS_FACTOR, "finalQuadVeq0EdgeTessFactor"}, + {WINED3D_SV_QUAD_U1_TESS_FACTOR, "finalQuadUeq1EdgeTessFactor"}, + {WINED3D_SV_QUAD_V1_TESS_FACTOR, "finalQuadVeq1EdgeTessFactor"}, + {WINED3D_SV_QUAD_U_INNER_TESS_FACTOR, "finalQuadUInsideTessFactor"}, + {WINED3D_SV_QUAD_V_INNER_TESS_FACTOR, "finalQuadVInsideTessFactor"}, + {WINED3D_SV_TRIANGLE_U_TESS_FACTOR, "finalTriUeq0EdgeTessFactor"}, + {WINED3D_SV_TRIANGLE_V_TESS_FACTOR, "finalTriVeq0EdgeTessFactor"}, + {WINED3D_SV_TRIANGLE_W_TESS_FACTOR, "finalTriWeq0EdgeTessFactor"}, + {WINED3D_SV_TRIANGLE_INNER_TESS_FACTOR, "finalTriInsideTessFactor"}, + {WINED3D_SV_LINE_DETAIL_TESS_FACTOR, "finalLineDetailTessFactor"}, + {WINED3D_SV_LINE_DENSITY_TESS_FACTOR, "finalLineDensityTessFactor"}, }; static void shader_dump_src_param(struct wined3d_string_buffer *buffer, @@ -293,10 +318,12 @@ case WINED3D_SM4_PS: case WINED3D_SM4_VS: case WINED3D_SM4_GS: + case WINED3D_SM5_HS: + case WINED3D_SM5_DS: return &sm4_shader_frontend; default: - FIXME("Unrecognised version token %#x\n", version_token); + FIXME("Unrecognised version token %#x.\n", version_token); return NULL; } } @@ -495,6 +522,16 @@ {WINED3D_SHADER_VERSION(5, 0), WINED3D_SHADER_VERSION(5, 0), {16, 0, 0, 0, 32, 0}}, {0} }, + hs_limits[] = + { + /* min_version, max_version, sampler, constant_int, constant_float, constant_bool, packed_output, packet_input */ + {WINED3D_SHADER_VERSION(5, 0), WINED3D_SHADER_VERSION(5, 0), {16, 0, 0, 0, 32, 32}}, + }, + ds_limits[] = + { + /* min_version, max_version, sampler, constant_int, constant_float, constant_bool, packed_output, packet_input */ + {WINED3D_SHADER_VERSION(5, 0), WINED3D_SHADER_VERSION(5, 0), {16, 0, 0, 0, 32, 32}}, + }, gs_limits[] = { /* min_version, max_version, sampler, constant_int, constant_float, constant_bool, packed_output, packed_input */ @@ -526,6 +563,12 @@ case WINED3D_SHADER_TYPE_VERTEX: limits_array = vs_limits; break; + case WINED3D_SHADER_TYPE_HULL: + limits_array = hs_limits; + break; + case WINED3D_SHADER_TYPE_DOMAIN: + limits_array = ds_limits; + break; case WINED3D_SHADER_TYPE_GEOMETRY: limits_array = gs_limits; break; @@ -869,6 +912,11 @@ FIXME("Invalid instruction %#x for shader type %#x.\n", ins.handler_idx, shader_version.type); } + else if (ins.handler_idx == WINED3DSIH_DCL_SAMPLER) + { + if (ins.flags & WINED3DSI_SAMPLER_COMPARISON_MODE) + reg_maps->sampler_comparison_mode |= (1u << ins.declaration.dst.reg.idx[0].offset); + } else if (ins.handler_idx == WINED3DSIH_DCL_VERTICES_OUT) { if (shader_version.type == WINED3D_SHADER_TYPE_GEOMETRY) @@ -1261,6 +1309,72 @@ shader_addline(buffer, "unknown_flags(%#x)", global_flags); } +static void shader_dump_tessellator_domain(struct wined3d_string_buffer *buffer, + enum wined3d_tessellator_domain domain) +{ + switch (domain) + { + case WINED3D_TESSELLATOR_DOMAIN_LINE: + shader_addline(buffer, "line"); + break; + case WINED3D_TESSELLATOR_DOMAIN_TRIANGLE: + shader_addline(buffer, "triangle"); + break; + case WINED3D_TESSELLATOR_DOMAIN_QUAD: + shader_addline(buffer, "quad"); + break; + default: + shader_addline(buffer, "unknown_tessellator_domain(%#x)", domain); + break; + } +} + +static void shader_dump_tessellator_output_primitive(struct wined3d_string_buffer *buffer, + enum wined3d_tessellator_output_primitive output_primitive) +{ + switch (output_primitive) + { + case WINED3D_TESSELLATOR_OUTPUT_POINT: + shader_addline(buffer, "point"); + break; + case WINED3D_TESSELLATOR_OUTPUT_LINE: + shader_addline(buffer, "line"); + break; + case WINED3D_TESSELLATOR_OUTPUT_TRIANGLE_CW: + shader_addline(buffer, "triangle_cw"); + break; + case WINED3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW: + shader_addline(buffer, "triangle_ccw"); + break; + default: + shader_addline(buffer, "unknown_tessellator_output_primitive(%#x)", output_primitive); + break; + } +} + +static void shader_dump_tessellator_partitioning(struct wined3d_string_buffer *buffer, + enum wined3d_tessellator_partitioning partitioning) +{ + switch (partitioning) + { + case WINED3D_TESSELLATOR_PARTITIONING_INTEGER: + shader_addline(buffer, "integer"); + break; + case WINED3D_TESSELLATOR_PARTITIONING_POW2: + shader_addline(buffer, "pow2"); + break; + case WINED3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD: + shader_addline(buffer, "fractional_odd"); + break; + case WINED3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN: + shader_addline(buffer, "fractional_even"); + break; + default: + shader_addline(buffer, "unknown_tessellator_partitioning(%#x)", partitioning); + break; + } +} + static void shader_dump_sysval_semantic(struct wined3d_string_buffer *buffer, enum wined3d_sysval_semantic semantic) { unsigned int i; @@ -1303,9 +1417,12 @@ break; } } - else if (semantic->reg.reg.type == WINED3DSPR_RESOURCE) + else if (semantic->reg.reg.type == WINED3DSPR_RESOURCE || semantic->reg.reg.type == WINED3DSPR_UAV) { - shader_addline(buffer, "_resource_"); + if (semantic->reg.reg.type == WINED3DSPR_RESOURCE) + shader_addline(buffer, "_resource_"); + else + shader_addline(buffer, "_uav_"); switch (semantic->resource_type) { case WINED3D_SHADER_RESOURCE_BUFFER: @@ -1565,6 +1682,14 @@ shader_addline(buffer, "t"); break; + case WINED3DSPR_UAV: + shader_addline(buffer, "u"); + break; + + case WINED3DSPR_FORKINSTID: + shader_addline(buffer, "vForkInstanceId"); + break; + default: shader_addline(buffer, "", reg->type); break; @@ -1918,6 +2043,14 @@ type_prefix = "vs"; break; + case WINED3D_SHADER_TYPE_HULL: + type_prefix = "hs"; + break; + + case WINED3D_SHADER_TYPE_DOMAIN: + type_prefix = "ds"; + break; + case WINED3D_SHADER_TYPE_GEOMETRY: type_prefix = "gs"; break; @@ -1946,7 +2079,7 @@ continue; } - if (ins.handler_idx == WINED3DSIH_DCL) + if (ins.handler_idx == WINED3DSIH_DCL || ins.handler_idx == WINED3DSIH_DCL_UAV_TYPED) { shader_dump_decl_usage(&buffer, &ins.declaration.semantic, &shader_version); shader_dump_ins_modifiers(&buffer, &ins.declaration.semantic.reg); @@ -1965,6 +2098,11 @@ shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]); shader_dump_global_flags(&buffer, ins.flags); } + else if (ins.handler_idx == WINED3DSIH_DCL_HS_MAX_TESSFACTOR) + { + shader_addline(&buffer, "%s %.8e", shader_opcode_names[ins.handler_idx], + ins.declaration.max_tessellation_factor); + } else if (ins.handler_idx == WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER) { shader_addline(&buffer, "%s {\n", shader_opcode_names[ins.handler_idx]); @@ -2016,6 +2154,12 @@ shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]); shader_dump_primitive_type(&buffer, ins.declaration.primitive_type); } + else if (ins.handler_idx == WINED3DSIH_DCL_RESOURCE_STRUCTURED) + { + shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]); + shader_dump_dst_param(&buffer, &ins.declaration.structured_resource.reg, &shader_version); + shader_addline(&buffer, ", %u", ins.declaration.structured_resource.byte_stride); + } else if (ins.handler_idx == WINED3DSIH_DCL_SAMPLER) { shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]); @@ -2024,10 +2168,28 @@ shader_addline(&buffer, ", comparisonMode"); } else if (ins.handler_idx == WINED3DSIH_DCL_TEMPS - || ins.handler_idx == WINED3DSIH_DCL_VERTICES_OUT) + || ins.handler_idx == WINED3DSIH_DCL_VERTICES_OUT + || ins.handler_idx == WINED3DSIH_DCL_HS_FORK_PHASE_INSTANCE_COUNT + || ins.handler_idx == WINED3DSIH_DCL_INPUT_CONTROL_POINT_COUNT + || ins.handler_idx == WINED3DSIH_DCL_OUTPUT_CONTROL_POINT_COUNT) { shader_addline(&buffer, "%s %u", shader_opcode_names[ins.handler_idx], ins.declaration.count); } + else if (ins.handler_idx == WINED3DSIH_DCL_TESSELLATOR_DOMAIN) + { + shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]); + shader_dump_tessellator_domain(&buffer, ins.declaration.tessellator_domain); + } + else if (ins.handler_idx == WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE) + { + shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]); + shader_dump_tessellator_output_primitive(&buffer, ins.declaration.tessellator_output_primitive); + } + else if (ins.handler_idx == WINED3DSIH_DCL_TESSELLATOR_PARTITIONING) + { + shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]); + shader_dump_tessellator_partitioning(&buffer, ins.declaration.tessellator_partitioning); + } else if (ins.handler_idx == WINED3DSIH_DEF) { shader_addline(&buffer, "def c%u = %.8e, %.8e, %.8e, %.8e", shader_get_float_offset(ins.dst[0].reg.type, @@ -2187,7 +2349,9 @@ context->shader_update_mask = (1u << WINED3D_SHADER_TYPE_PIXEL) | (1u << WINED3D_SHADER_TYPE_VERTEX) - | (1u << WINED3D_SHADER_TYPE_GEOMETRY); + | (1u << WINED3D_SHADER_TYPE_GEOMETRY) + | (1u << WINED3D_SHADER_TYPE_HULL) + | (1u << WINED3D_SHADER_TYPE_DOMAIN); } static HRESULT shader_none_alloc(struct wined3d_device *device, const struct wined3d_vertex_pipe_ops *vertex_pipe, @@ -2245,6 +2409,8 @@ { /* Set the shader caps to 0 for the none shader backend */ caps->vs_version = 0; + caps->hs_version = 0; + caps->ds_version = 0; caps->gs_version = 0; caps->ps_version = 0; caps->vs_uniform_count = 0; @@ -2345,6 +2511,12 @@ case WINED3D_SHADER_TYPE_VERTEX: backend_version = d3d_info->limits.vs_version; break; + case WINED3D_SHADER_TYPE_HULL: + backend_version = d3d_info->limits.hs_version; + break; + case WINED3D_SHADER_TYPE_DOMAIN: + backend_version = d3d_info->limits.ds_version; + break; case WINED3D_SHADER_TYPE_GEOMETRY: backend_version = d3d_info->limits.gs_version; break; @@ -2618,7 +2790,7 @@ return hr; } -static HRESULT vertexshader_init(struct wined3d_shader *shader, struct wined3d_device *device, +static HRESULT vertex_shader_init(struct wined3d_shader *shader, struct wined3d_device *device, const struct wined3d_shader_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops) { struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps; @@ -2647,7 +2819,33 @@ return WINED3D_OK; } -static HRESULT geometryshader_init(struct wined3d_shader *shader, struct wined3d_device *device, +static HRESULT domain_shader_init(struct wined3d_shader *shader, struct wined3d_device *device, + const struct wined3d_shader_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops) +{ + HRESULT hr; + + if (FAILED(hr = shader_init(shader, device, desc, 0, WINED3D_SHADER_TYPE_DOMAIN, parent, parent_ops))) + return hr; + + shader->load_local_constsF = shader->lconst_inf_or_nan; + + return WINED3D_OK; +} + +static HRESULT hull_shader_init(struct wined3d_shader *shader, struct wined3d_device *device, + const struct wined3d_shader_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops) +{ + HRESULT hr; + + if (FAILED(hr = shader_init(shader, device, desc, 0, WINED3D_SHADER_TYPE_HULL, parent, parent_ops))) + return hr; + + shader->load_local_constsF = shader->lconst_inf_or_nan; + + return WINED3D_OK; +} + +static HRESULT geometry_shader_init(struct wined3d_shader *shader, struct wined3d_device *device, const struct wined3d_shader_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops) { HRESULT hr; @@ -2781,7 +2979,10 @@ args->color_fixup[i] = COLOR_FIXUP_IDENTITY; continue; } - args->color_fixup[i] = texture->resource.format->color_fixup; + if (can_use_texture_swizzle(gl_info, texture->resource.format)) + args->color_fixup[i] = COLOR_FIXUP_IDENTITY; + else + args->color_fixup[i] = texture->resource.format->color_fixup; if (texture->resource.format_flags & WINED3DFMT_FLAG_SHADOW) args->shadow |= 1u << i; @@ -2790,6 +2991,11 @@ if (!(texture->flags & WINED3D_TEXTURE_POW2_MAT_IDENT)) args->np2_fixup |= (1u << i); } + + /* In SM4+ we use dcl_sampler in order to determine if we should use shadow sampler. */ + if (shader->reg_maps.shader_version.major >= 4) + args->shadow = 0; + if (shader->reg_maps.shader_version.major >= 3) { if (position_transformed) @@ -2870,7 +3076,7 @@ args->flatshading = state->render_states[WINED3D_RS_SHADEMODE] == WINED3D_SHADE_FLAT; } -static HRESULT pixelshader_init(struct wined3d_shader *shader, struct wined3d_device *device, +static HRESULT pixel_shader_init(struct wined3d_shader *shader, struct wined3d_device *device, const struct wined3d_shader_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops) { const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; @@ -2957,6 +3163,31 @@ } } +HRESULT CDECL wined3d_shader_create_ds(struct wined3d_device *device, const struct wined3d_shader_desc *desc, + void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader) +{ + struct wined3d_shader *object; + HRESULT hr; + + TRACE("device %p, desc %p, parent %p, parent_ops %p, shader %p.\n", + device, desc, parent, parent_ops, shader); + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + if (FAILED(hr = domain_shader_init(object, device, desc, parent, parent_ops))) + { + WARN("Failed to initialize domain shader, hr %#x.\n", hr); + HeapFree(GetProcessHeap(), 0, object); + return hr; + } + + TRACE("Created domain shader %p.\n", object); + *shader = object; + + return WINED3D_OK; +} + HRESULT CDECL wined3d_shader_create_gs(struct wined3d_device *device, const struct wined3d_shader_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader) { @@ -2970,7 +3201,7 @@ if (!object) return E_OUTOFMEMORY; - if (FAILED(hr = geometryshader_init(object, device, desc, parent, parent_ops))) + if (FAILED(hr = geometry_shader_init(object, device, desc, parent, parent_ops))) { WARN("Failed to initialize geometry shader, hr %#x.\n", hr); HeapFree(GetProcessHeap(), 0, object); @@ -2983,6 +3214,31 @@ return WINED3D_OK; } +HRESULT CDECL wined3d_shader_create_hs(struct wined3d_device *device, const struct wined3d_shader_desc *desc, + void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader) +{ + struct wined3d_shader *object; + HRESULT hr; + + TRACE("device %p, desc %p, parent %p, parent_ops %p, shader %p.\n", + device, desc, parent, parent_ops, shader); + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + if (FAILED(hr = hull_shader_init(object, device, desc, parent, parent_ops))) + { + WARN("Failed to initialize hull shader, hr %#x.\n", hr); + HeapFree(GetProcessHeap(), 0, object); + return hr; + } + + TRACE("Created hull shader %p.\n", object); + *shader = object; + + return WINED3D_OK; +} + HRESULT CDECL wined3d_shader_create_ps(struct wined3d_device *device, const struct wined3d_shader_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader) { @@ -2996,7 +3252,7 @@ if (!object) return E_OUTOFMEMORY; - if (FAILED(hr = pixelshader_init(object, device, desc, parent, parent_ops))) + if (FAILED(hr = pixel_shader_init(object, device, desc, parent, parent_ops))) { WARN("Failed to initialize pixel shader, hr %#x.\n", hr); HeapFree(GetProcessHeap(), 0, object); @@ -3022,7 +3278,7 @@ if (!object) return E_OUTOFMEMORY; - if (FAILED(hr = vertexshader_init(object, device, desc, parent, parent_ops))) + if (FAILED(hr = vertex_shader_init(object, device, desc, parent, parent_ops))) { WARN("Failed to initialize vertex shader, hr %#x.\n", hr); HeapFree(GetProcessHeap(), 0, object); diff -Nru wine-staging-1.9.6/dlls/wined3d/shader_sm4.c wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/shader_sm4.c --- wine-staging-1.9.6/dlls/wined3d/shader_sm4.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/shader_sm4.c 2016-04-04 18:06:32.000000000 +0000 @@ -61,6 +61,12 @@ #define WINED3D_SM4_GLOBAL_FLAGS_SHIFT 11 #define WINED3D_SM4_GLOBAL_FLAGS_MASK (0xffu << WINED3D_SM4_GLOBAL_FLAGS_SHIFT) +#define WINED3D_SM5_CONTROL_POINT_COUNT_SHIFT 11 +#define WINED3D_SM5_CONTROL_POINT_COUNT_MASK (0xffu << WINED3D_SM5_CONTROL_POINT_COUNT_SHIFT) + +#define WINED3D_SM5_TESSELLATOR_SHIFT 11 +#define WINED3D_SM5_TESSELLATOR_MASK (0xfu << WINED3D_SM5_TESSELLATOR_SHIFT) + #define WINED3D_SM4_OPCODE_MASK 0xff #define WINED3D_SM4_REGISTER_MODIFIER (0x1u << 31) @@ -75,7 +81,7 @@ #define WINED3D_SM4_REGISTER_ORDER_MASK (0x3u << WINED3D_SM4_REGISTER_ORDER_SHIFT) #define WINED3D_SM4_REGISTER_TYPE_SHIFT 12 -#define WINED3D_SM4_REGISTER_TYPE_MASK (0xfu << WINED3D_SM4_REGISTER_TYPE_SHIFT) +#define WINED3D_SM4_REGISTER_TYPE_MASK (0xffu << WINED3D_SM4_REGISTER_TYPE_SHIFT) #define WINED3D_SM4_SWIZZLE_TYPE_SHIFT 2 #define WINED3D_SM4_SWIZZLE_TYPE_MASK (0x3u << WINED3D_SM4_SWIZZLE_TYPE_SHIFT) @@ -99,110 +105,125 @@ enum wined3d_sm4_opcode { - WINED3D_SM4_OP_ADD = 0x00, - WINED3D_SM4_OP_AND = 0x01, - WINED3D_SM4_OP_BREAK = 0x02, - WINED3D_SM4_OP_BREAKC = 0x03, - WINED3D_SM4_OP_CUT = 0x09, - WINED3D_SM4_OP_DERIV_RTX = 0x0b, - WINED3D_SM4_OP_DERIV_RTY = 0x0c, - WINED3D_SM4_OP_DISCARD = 0x0d, - WINED3D_SM4_OP_DIV = 0x0e, - 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, - WINED3D_SM4_OP_EQ = 0x18, - WINED3D_SM4_OP_EXP = 0x19, - WINED3D_SM4_OP_FRC = 0x1a, - WINED3D_SM4_OP_FTOI = 0x1b, - WINED3D_SM4_OP_FTOU = 0x1c, - WINED3D_SM4_OP_GE = 0x1d, - WINED3D_SM4_OP_IADD = 0x1e, - WINED3D_SM4_OP_IF = 0x1f, - WINED3D_SM4_OP_IEQ = 0x20, - WINED3D_SM4_OP_IGE = 0x21, - WINED3D_SM4_OP_ILT = 0x22, - WINED3D_SM4_OP_IMAD = 0x23, - WINED3D_SM4_OP_IMAX = 0x24, - WINED3D_SM4_OP_IMIN = 0x25, - WINED3D_SM4_OP_IMUL = 0x26, - WINED3D_SM4_OP_INE = 0x27, - WINED3D_SM4_OP_INEG = 0x28, - WINED3D_SM4_OP_ISHL = 0x29, - WINED3D_SM4_OP_ITOF = 0x2b, - WINED3D_SM4_OP_LD = 0x2d, - WINED3D_SM4_OP_LOG = 0x2f, - WINED3D_SM4_OP_LOOP = 0x30, - WINED3D_SM4_OP_LT = 0x31, - 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, - WINED3D_SM4_OP_UGE = 0x50, - WINED3D_SM4_OP_USHR = 0x55, - WINED3D_SM4_OP_UTOF = 0x56, - 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, - WINED3D_SM5_OP_DERIV_RTX_COARSE = 0x7a, - WINED3D_SM5_OP_DERIV_RTX_FINE = 0x7b, - WINED3D_SM5_OP_DERIV_RTY_COARSE = 0x7c, - WINED3D_SM5_OP_DERIV_RTY_FINE = 0x7d, - WINED3D_SM5_OP_LD_STRUCTURED = 0xa7, + WINED3D_SM4_OP_ADD = 0x00, + WINED3D_SM4_OP_AND = 0x01, + WINED3D_SM4_OP_BREAK = 0x02, + WINED3D_SM4_OP_BREAKC = 0x03, + WINED3D_SM4_OP_CUT = 0x09, + WINED3D_SM4_OP_DERIV_RTX = 0x0b, + WINED3D_SM4_OP_DERIV_RTY = 0x0c, + WINED3D_SM4_OP_DISCARD = 0x0d, + WINED3D_SM4_OP_DIV = 0x0e, + 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, + WINED3D_SM4_OP_EQ = 0x18, + WINED3D_SM4_OP_EXP = 0x19, + WINED3D_SM4_OP_FRC = 0x1a, + WINED3D_SM4_OP_FTOI = 0x1b, + WINED3D_SM4_OP_FTOU = 0x1c, + WINED3D_SM4_OP_GE = 0x1d, + WINED3D_SM4_OP_IADD = 0x1e, + WINED3D_SM4_OP_IF = 0x1f, + WINED3D_SM4_OP_IEQ = 0x20, + WINED3D_SM4_OP_IGE = 0x21, + WINED3D_SM4_OP_ILT = 0x22, + WINED3D_SM4_OP_IMAD = 0x23, + WINED3D_SM4_OP_IMAX = 0x24, + WINED3D_SM4_OP_IMIN = 0x25, + WINED3D_SM4_OP_IMUL = 0x26, + WINED3D_SM4_OP_INE = 0x27, + WINED3D_SM4_OP_INEG = 0x28, + WINED3D_SM4_OP_ISHL = 0x29, + WINED3D_SM4_OP_ITOF = 0x2b, + WINED3D_SM4_OP_LD = 0x2d, + WINED3D_SM4_OP_LD2DMS = 0x2e, + WINED3D_SM4_OP_LOG = 0x2f, + WINED3D_SM4_OP_LOOP = 0x30, + WINED3D_SM4_OP_LT = 0x31, + 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, + WINED3D_SM4_OP_UGE = 0x50, + WINED3D_SM4_OP_USHR = 0x55, + WINED3D_SM4_OP_UTOF = 0x56, + 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, + WINED3D_SM5_OP_HS_DECLS = 0x71, + WINED3D_SM5_OP_HS_FORK_PHASE = 0x73, + WINED3D_SM5_OP_DERIV_RTX_COARSE = 0x7a, + WINED3D_SM5_OP_DERIV_RTX_FINE = 0x7b, + WINED3D_SM5_OP_DERIV_RTY_COARSE = 0x7c, + WINED3D_SM5_OP_DERIV_RTY_FINE = 0x7d, + WINED3D_SM5_OP_DCL_INPUT_CONTROL_POINT_COUNT = 0x93, + WINED3D_SM5_OP_DCL_OUTPUT_CONTROL_POINT_COUNT = 0x94, + WINED3D_SM5_OP_DCL_TESSELLATOR_DOMAIN = 0x95, + WINED3D_SM5_OP_DCL_TESSELLATOR_PARTITIONING = 0x96, + WINED3D_SM5_OP_DCL_TESSELLATOR_OUTPUT_PRIMITIVE = 0x97, + WINED3D_SM5_OP_DCL_HS_MAX_TESSFACTOR = 0x98, + WINED3D_SM5_OP_DCL_HS_FORK_PHASE_INSTANCE_COUNT = 0x99, + WINED3D_SM5_OP_DCL_UAV_TYPED = 0x9c, + WINED3D_SM5_OP_DCL_RESOURCE_STRUCTURED = 0xa2, + WINED3D_SM5_OP_STORE_UAV_TYPED = 0xa4, + WINED3D_SM5_OP_LD_STRUCTURED = 0xa7, }; 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_IMMCONSTBUFFER = 0x9, - 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, + WINED3D_SM5_RT_FORK_INSTANCE_ID = 0x17, + WINED3D_SM5_RT_UAV = 0x1e, }; enum wined3d_sm4_output_primitive_type @@ -294,124 +315,9 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER handler_idx; const char *dst_info; const char *src_info; -}; - -/* - * F -> WINED3D_DATA_FLOAT - * I -> WINED3D_DATA_INT - * R -> WINED3D_DATA_RESOURCE - * S -> WINED3D_DATA_SAMPLER - * U -> WINED3D_DATA_UINT - */ -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_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, "", ""}, - {WINED3D_SM5_OP_DERIV_RTX_COARSE, WINED3DSIH_DSX_COARSE, "F", "F"}, - {WINED3D_SM5_OP_DERIV_RTX_FINE, WINED3DSIH_DSX_FINE, "F", "F"}, - {WINED3D_SM5_OP_DERIV_RTY_COARSE, WINED3DSIH_DSY_COARSE, "F", "F"}, - {WINED3D_SM5_OP_DERIV_RTY_FINE, WINED3DSIH_DSY_FINE, "F", "F"}, - {WINED3D_SM5_OP_LD_STRUCTURED, WINED3DSIH_LD_STRUCTURED, "U", "UUR"}, -}; - -static const enum wined3d_shader_register_type register_type_table[] = -{ - /* WINED3D_SM4_RT_TEMP */ WINED3DSPR_TEMP, - /* WINED3D_SM4_RT_INPUT */ WINED3DSPR_INPUT, - /* WINED3D_SM4_RT_OUTPUT */ WINED3DSPR_OUTPUT, - /* UNKNOWN */ 0, - /* WINED3D_SM4_RT_IMMCONST */ WINED3DSPR_IMMCONST, - /* UNKNOWN */ 0, - /* WINED3D_SM4_RT_SAMPLER */ WINED3DSPR_SAMPLER, - /* WINED3D_SM4_RT_RESOURCE */ WINED3DSPR_RESOURCE, - /* WINED3D_SM4_RT_CONSTBUFFER */ WINED3DSPR_CONSTBUFFER, - /* WINED3D_SM4_RT_IMMCONSTBUFFER */ WINED3DSPR_IMMCONSTBUFFER, - /* UNKNOWN */ 0, - /* WINED3D_SM4_RT_PRIMID */ WINED3DSPR_PRIMID, - /* WINED3D_SM4_RT_DEPTHOUT */ WINED3DSPR_DEPTHOUT, - /* WINED3D_SM4_RT_NULL */ WINED3DSPR_NULL, + void (*read_opcode_func)(struct wined3d_shader_instruction *ins, + DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, + struct wined3d_sm4_data *priv); }; static const enum wined3d_primitive_type output_primitive_type_table[] = @@ -462,6 +368,398 @@ static BOOL shader_sm4_read_src_param(struct wined3d_sm4_data *priv, const DWORD **ptr, enum wined3d_data_type data_type, struct wined3d_shader_src_param *src_param); +static BOOL shader_sm4_read_dst_param(struct wined3d_sm4_data *priv, const DWORD **ptr, + enum wined3d_data_type data_type, struct wined3d_shader_dst_param *dst_param); + +static void shader_sm4_read_shader_data(struct wined3d_shader_instruction *ins, + DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, + struct wined3d_sm4_data *priv) +{ + enum wined3d_sm4_shader_data_type type; + unsigned int icb_size; + + 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; + } + + ++tokens; + icb_size = token_count - 1; + if (icb_size % 4 || icb_size > MAX_IMMEDIATE_CONSTANT_BUFFER_SIZE) + { + FIXME("Unexpected immediate constant buffer size %u.\n", icb_size); + ins->handler_idx = WINED3DSIH_TABLE_SIZE; + return; + } + + priv->icb.element_count = icb_size; + memcpy(priv->icb.data, tokens, sizeof(*tokens) * icb_size); + ins->declaration.icb = &priv->icb; +} + +static void shader_sm4_read_dcl_resource(struct wined3d_shader_instruction *ins, + DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, + struct wined3d_sm4_data *priv) +{ + enum wined3d_sm4_resource_type resource_type; + enum wined3d_sm4_data_type data_type; + enum wined3d_data_type reg_data_type; + DWORD components; + + resource_type = (opcode_token & WINED3D_SM4_RESOURCE_TYPE_MASK) >> WINED3D_SM4_RESOURCE_TYPE_SHIFT; + if (!resource_type || (resource_type >= ARRAY_SIZE(resource_type_table))) + { + FIXME("Unhandled resource type %#x.\n", resource_type); + ins->declaration.semantic.resource_type = WINED3D_SHADER_RESOURCE_NONE; + } + else + { + ins->declaration.semantic.resource_type = resource_type_table[resource_type]; + } + reg_data_type = opcode == WINED3D_SM4_OP_DCL_RESOURCE ? WINED3D_DATA_RESOURCE : WINED3D_DATA_UAV; + shader_sm4_read_dst_param(priv, &tokens, reg_data_type, &ins->declaration.semantic.reg); + + components = *tokens++; + if ((components & 0xfff0) != (components & 0xf) * 0x1110) + FIXME("Components (%#x) have different data types.\n", components); + data_type = components & 0xf; + + if (!data_type || (data_type >= ARRAY_SIZE(data_type_table))) + { + FIXME("Unhandled data type %#x.\n", data_type); + ins->declaration.semantic.resource_data_type = WINED3D_DATA_FLOAT; + } + else + { + ins->declaration.semantic.resource_data_type = data_type_table[data_type]; + } +} + +static void shader_sm4_read_dcl_constant_buffer(struct wined3d_shader_instruction *ins, + DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, + struct wined3d_sm4_data *priv) +{ + shader_sm4_read_src_param(priv, &tokens, WINED3D_DATA_FLOAT, &ins->declaration.src); + if (opcode_token & WINED3D_SM4_INDEX_TYPE_MASK) + ins->flags |= WINED3DSI_INDEXED_DYNAMIC; +} + +static void shader_sm4_read_dcl_sampler(struct wined3d_shader_instruction *ins, + DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, + struct wined3d_sm4_data *priv) +{ + 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, &tokens, WINED3D_DATA_SAMPLER, &ins->declaration.dst); +} + +static void shader_sm4_read_dcl_output_topology(struct wined3d_shader_instruction *ins, + DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, + struct wined3d_sm4_data *priv) +{ + enum wined3d_sm4_output_primitive_type primitive_type; + + primitive_type = (opcode_token & WINED3D_SM4_PRIMITIVE_TYPE_MASK) >> WINED3D_SM4_PRIMITIVE_TYPE_SHIFT; + if (primitive_type >= sizeof(output_primitive_type_table) / sizeof(*output_primitive_type_table)) + { + FIXME("Unhandled output primitive type %#x.\n", primitive_type); + ins->declaration.primitive_type = WINED3D_PT_UNDEFINED; + } + else + { + ins->declaration.primitive_type = output_primitive_type_table[primitive_type]; + } +} + +static void shader_sm4_read_dcl_input_primitive(struct wined3d_shader_instruction *ins, + DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, + struct wined3d_sm4_data *priv) +{ + enum wined3d_sm4_input_primitive_type primitive_type; + + primitive_type = (opcode_token & WINED3D_SM4_PRIMITIVE_TYPE_MASK) >> WINED3D_SM4_PRIMITIVE_TYPE_SHIFT; + if (primitive_type >= sizeof(input_primitive_type_table) / sizeof(*input_primitive_type_table)) + { + FIXME("Unhandled input primitive type %#x.\n", primitive_type); + ins->declaration.primitive_type = WINED3D_PT_UNDEFINED; + } + else + { + ins->declaration.primitive_type = input_primitive_type_table[primitive_type]; + } +} + +static void shader_sm4_read_declaration_count(struct wined3d_shader_instruction *ins, + DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, + struct wined3d_sm4_data *priv) +{ + ins->declaration.count = *tokens; +} + +static void shader_sm4_read_declaration_dst(struct wined3d_shader_instruction *ins, + DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, + struct wined3d_sm4_data *priv) +{ + shader_sm4_read_dst_param(priv, &tokens, WINED3D_DATA_FLOAT, &ins->declaration.dst); +} + +static void shader_sm4_read_declaration_register_semantic(struct wined3d_shader_instruction *ins, + DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, + struct wined3d_sm4_data *priv) +{ + shader_sm4_read_dst_param(priv, &tokens, WINED3D_DATA_FLOAT, &ins->declaration.register_semantic.reg); + ins->declaration.register_semantic.sysval_semantic = *tokens; +} + +static void shader_sm4_read_dcl_input_ps(struct wined3d_shader_instruction *ins, + DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, + struct wined3d_sm4_data *priv) +{ + ins->flags = (opcode_token & WINED3D_SM4_INTERPOLATION_MODE_MASK) >> WINED3D_SM4_INTERPOLATION_MODE_SHIFT; + shader_sm4_read_dst_param(priv, &tokens, WINED3D_DATA_FLOAT, &ins->declaration.dst); +} + +static void shader_sm4_read_dcl_input_ps_siv(struct wined3d_shader_instruction *ins, + DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, + struct wined3d_sm4_data *priv) +{ + ins->flags = (opcode_token & WINED3D_SM4_INTERPOLATION_MODE_MASK) >> WINED3D_SM4_INTERPOLATION_MODE_SHIFT; + shader_sm4_read_dst_param(priv, &tokens, WINED3D_DATA_FLOAT, &ins->declaration.register_semantic.reg); + ins->declaration.register_semantic.sysval_semantic = *tokens; +} + +static void shader_sm4_read_dcl_global_flags(struct wined3d_shader_instruction *ins, + DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, + struct wined3d_sm4_data *priv) +{ + ins->flags = (opcode_token & WINED3D_SM4_GLOBAL_FLAGS_MASK) >> WINED3D_SM4_GLOBAL_FLAGS_SHIFT; +} + +static void shader_sm5_read_control_point_count(struct wined3d_shader_instruction *ins, + DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, + struct wined3d_sm4_data *priv) +{ + ins->declaration.count = (opcode_token & WINED3D_SM5_CONTROL_POINT_COUNT_MASK) + >> WINED3D_SM5_CONTROL_POINT_COUNT_SHIFT; +} + +static void shader_sm5_read_dcl_tessellator_domain(struct wined3d_shader_instruction *ins, + DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, + struct wined3d_sm4_data *priv) +{ + ins->declaration.tessellator_domain = (opcode_token & WINED3D_SM5_TESSELLATOR_MASK) + >> WINED3D_SM5_TESSELLATOR_SHIFT; +} + +static void shader_sm5_read_dcl_tessellator_partitioning(struct wined3d_shader_instruction *ins, + DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, + struct wined3d_sm4_data *priv) +{ + ins->declaration.tessellator_partitioning = (opcode_token & WINED3D_SM5_TESSELLATOR_MASK) + >> WINED3D_SM5_TESSELLATOR_SHIFT; +} + +static void shader_sm5_read_dcl_tessellator_output_primitive(struct wined3d_shader_instruction *ins, + DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, + struct wined3d_sm4_data *priv) +{ + ins->declaration.tessellator_output_primitive = (opcode_token & WINED3D_SM5_TESSELLATOR_MASK) + >> WINED3D_SM5_TESSELLATOR_SHIFT; +} + +static void shader_sm5_read_dcl_hs_max_tessfactor(struct wined3d_shader_instruction *ins, + DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, + struct wined3d_sm4_data *priv) +{ + ins->declaration.max_tessellation_factor = *(float *)tokens; +} + +static void shader_sm5_read_dcl_resource_structured(struct wined3d_shader_instruction *ins, + DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, + struct wined3d_sm4_data *priv) +{ + shader_sm4_read_dst_param(priv, &tokens, WINED3D_DATA_RESOURCE, &ins->declaration.structured_resource.reg); + ins->declaration.structured_resource.byte_stride = *tokens; +} + +/* + * f -> WINED3D_DATA_FLOAT + * i -> WINED3D_DATA_INT + * u -> WINED3D_DATA_UINT + * R -> WINED3D_DATA_RESOURCE + * S -> WINED3D_DATA_SAMPLER + * U -> WINED3D_DATA_UAV + */ +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_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_LD2DMS, WINED3DSIH_LD2DMS, "u", "iRi"}, + {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, "", "", + shader_sm4_read_shader_data}, + {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", "", + shader_sm4_read_dcl_resource}, + {WINED3D_SM4_OP_DCL_CONSTANT_BUFFER, WINED3DSIH_DCL_CONSTANT_BUFFER, "", "", + shader_sm4_read_dcl_constant_buffer}, + {WINED3D_SM4_OP_DCL_SAMPLER, WINED3DSIH_DCL_SAMPLER, "", "", + shader_sm4_read_dcl_sampler}, + {WINED3D_SM4_OP_DCL_OUTPUT_TOPOLOGY, WINED3DSIH_DCL_OUTPUT_TOPOLOGY, "", "", + shader_sm4_read_dcl_output_topology}, + {WINED3D_SM4_OP_DCL_INPUT_PRIMITIVE, WINED3DSIH_DCL_INPUT_PRIMITIVE, "", "", + shader_sm4_read_dcl_input_primitive}, + {WINED3D_SM4_OP_DCL_VERTICES_OUT, WINED3DSIH_DCL_VERTICES_OUT, "", "", + shader_sm4_read_declaration_count}, + {WINED3D_SM4_OP_DCL_INPUT, WINED3DSIH_DCL_INPUT, "", "", + shader_sm4_read_declaration_dst}, + {WINED3D_SM4_OP_DCL_INPUT_SGV, WINED3DSIH_DCL_INPUT_SGV, "", "", + shader_sm4_read_declaration_register_semantic}, + {WINED3D_SM4_OP_DCL_INPUT_SIV, WINED3DSIH_DCL_INPUT_SIV, "", "", + shader_sm4_read_declaration_register_semantic}, + {WINED3D_SM4_OP_DCL_INPUT_PS, WINED3DSIH_DCL_INPUT_PS, "", "", + shader_sm4_read_dcl_input_ps}, + {WINED3D_SM4_OP_DCL_INPUT_PS_SGV, WINED3DSIH_DCL_INPUT_PS_SGV, "", "", + shader_sm4_read_declaration_register_semantic}, + {WINED3D_SM4_OP_DCL_INPUT_PS_SIV, WINED3DSIH_DCL_INPUT_PS_SIV, "", "", + shader_sm4_read_dcl_input_ps_siv}, + {WINED3D_SM4_OP_DCL_OUTPUT, WINED3DSIH_DCL_OUTPUT, "", "", + shader_sm4_read_declaration_dst}, + {WINED3D_SM4_OP_DCL_OUTPUT_SIV, WINED3DSIH_DCL_OUTPUT_SIV, "", "", + shader_sm4_read_declaration_register_semantic}, + {WINED3D_SM4_OP_DCL_TEMPS, WINED3DSIH_DCL_TEMPS, "", "", + shader_sm4_read_declaration_count}, + {WINED3D_SM4_OP_DCL_GLOBAL_FLAGS, WINED3DSIH_DCL_GLOBAL_FLAGS, "", "", + shader_sm4_read_dcl_global_flags}, + {WINED3D_SM5_OP_HS_DECLS, WINED3DSIH_HS_DECLS, "", ""}, + {WINED3D_SM5_OP_HS_FORK_PHASE, WINED3DSIH_HS_FORK_PHASE, "", ""}, + {WINED3D_SM5_OP_DERIV_RTX_COARSE, WINED3DSIH_DSX_COARSE, "f", "f"}, + {WINED3D_SM5_OP_DERIV_RTX_FINE, WINED3DSIH_DSX_FINE, "f", "f"}, + {WINED3D_SM5_OP_DERIV_RTY_COARSE, WINED3DSIH_DSY_COARSE, "f", "f"}, + {WINED3D_SM5_OP_DERIV_RTY_FINE, WINED3DSIH_DSY_FINE, "f", "f"}, + {WINED3D_SM5_OP_DCL_INPUT_CONTROL_POINT_COUNT, WINED3DSIH_DCL_INPUT_CONTROL_POINT_COUNT, "", "", + shader_sm5_read_control_point_count}, + {WINED3D_SM5_OP_DCL_OUTPUT_CONTROL_POINT_COUNT, WINED3DSIH_DCL_OUTPUT_CONTROL_POINT_COUNT, "", "", + shader_sm5_read_control_point_count}, + {WINED3D_SM5_OP_DCL_TESSELLATOR_DOMAIN, WINED3DSIH_DCL_TESSELLATOR_DOMAIN, "", "", + shader_sm5_read_dcl_tessellator_domain}, + {WINED3D_SM5_OP_DCL_TESSELLATOR_PARTITIONING, WINED3DSIH_DCL_TESSELLATOR_PARTITIONING, "", "", + shader_sm5_read_dcl_tessellator_partitioning}, + {WINED3D_SM5_OP_DCL_TESSELLATOR_OUTPUT_PRIMITIVE, WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE, "", "", + shader_sm5_read_dcl_tessellator_output_primitive}, + {WINED3D_SM5_OP_DCL_HS_MAX_TESSFACTOR, WINED3DSIH_DCL_HS_MAX_TESSFACTOR, "", "", + shader_sm5_read_dcl_hs_max_tessfactor}, + {WINED3D_SM5_OP_DCL_HS_FORK_PHASE_INSTANCE_COUNT, WINED3DSIH_DCL_HS_FORK_PHASE_INSTANCE_COUNT, "", "", + shader_sm4_read_declaration_count}, + {WINED3D_SM5_OP_DCL_UAV_TYPED, WINED3DSIH_DCL_UAV_TYPED, "", "", + shader_sm4_read_dcl_resource}, + {WINED3D_SM5_OP_DCL_RESOURCE_STRUCTURED, WINED3DSIH_DCL_RESOURCE_STRUCTURED, "", "", + shader_sm5_read_dcl_resource_structured}, + {WINED3D_SM5_OP_STORE_UAV_TYPED, WINED3DSIH_STORE_UAV_TYPED, "", "Uif"}, + {WINED3D_SM5_OP_LD_STRUCTURED, WINED3DSIH_LD_STRUCTURED, "u", "uuR"}, +}; + +static const enum wined3d_shader_register_type register_type_table[] = +{ + /* WINED3D_SM4_RT_TEMP */ WINED3DSPR_TEMP, + /* WINED3D_SM4_RT_INPUT */ WINED3DSPR_INPUT, + /* WINED3D_SM4_RT_OUTPUT */ WINED3DSPR_OUTPUT, + /* UNKNOWN */ 0, + /* WINED3D_SM4_RT_IMMCONST */ WINED3DSPR_IMMCONST, + /* UNKNOWN */ 0, + /* WINED3D_SM4_RT_SAMPLER */ WINED3DSPR_SAMPLER, + /* WINED3D_SM4_RT_RESOURCE */ WINED3DSPR_RESOURCE, + /* WINED3D_SM4_RT_CONSTBUFFER */ WINED3DSPR_CONSTBUFFER, + /* WINED3D_SM4_RT_IMMCONSTBUFFER */ WINED3DSPR_IMMCONSTBUFFER, + /* UNKNOWN */ 0, + /* WINED3D_SM4_RT_PRIMID */ WINED3DSPR_PRIMID, + /* WINED3D_SM4_RT_DEPTHOUT */ WINED3DSPR_DEPTHOUT, + /* WINED3D_SM4_RT_NULL */ WINED3DSPR_NULL, + /* UNKNOWN */ 0, + /* UNKNOWN */ 0, + /* UNKNOWN */ 0, + /* UNKNOWN */ 0, + /* UNKNOWN */ 0, + /* UNKNOWN */ 0, + /* UNKNOWN */ 0, + /* UNKNOWN */ 0, + /* UNKNOWN */ 0, + /* WINED3D_SM5_RT_FORK_INSTANCE_ID */ WINED3DSPR_FORKINSTID, + /* UNKNOWN */ 0, + /* UNKNOWN */ 0, + /* UNKNOWN */ 0, + /* UNKNOWN */ 0, + /* UNKNOWN */ 0, + /* UNKNOWN */ 0, + /* WINED3D_SM5_RT_UAV */ WINED3DSPR_UAV, +}; static const struct wined3d_sm4_opcode_info *get_opcode_info(enum wined3d_sm4_opcode opcode) { @@ -504,16 +802,18 @@ { switch (t) { - case 'F': + case 'f': return WINED3D_DATA_FLOAT; - case 'I': + case 'i': return WINED3D_DATA_INT; + case 'u': + return WINED3D_DATA_UINT; case 'R': return WINED3D_DATA_RESOURCE; case 'S': return WINED3D_DATA_SAMPLER; case 'U': - return WINED3D_DATA_UINT; + return WINED3D_DATA_UAV; default: ERR("Invalid data type '%c'.\n", t); return WINED3D_DATA_FLOAT; @@ -594,9 +894,9 @@ priv->end = *ptr; version_token = *(*ptr)++; - TRACE("version: 0x%08x\n", version_token); + TRACE("Version: 0x%08x.\n", version_token); - TRACE("token count: %u\n", **ptr); + TRACE("Token count: %u.\n", **ptr); priv->end += *(*ptr)++; switch (version_token >> 16) @@ -613,8 +913,16 @@ priv->shader_version.type = WINED3D_SHADER_TYPE_GEOMETRY; break; + case WINED3D_SM5_HS: + priv->shader_version.type = WINED3D_SHADER_TYPE_HULL; + break; + + case WINED3D_SM5_DS: + priv->shader_version.type = WINED3D_SHADER_TYPE_DOMAIN; + break; + default: - FIXME("Unrecognized shader type %#x\n", version_token >> 16); + FIXME("Unrecognized shader type %#x.\n", version_token >> 16); } priv->shader_version.major = WINED3D_SM4_VERSION_MAJOR(version_token); priv->shader_version.minor = WINED3D_SM4_VERSION_MINOR(version_token); @@ -832,8 +1140,8 @@ const struct wined3d_sm4_opcode_info *opcode_info; struct wined3d_sm4_data *priv = data; DWORD opcode_token, opcode; + unsigned int i, len; const DWORD *p; - UINT i, len; list_move_head(&priv->src_free, &priv->src); @@ -907,140 +1215,9 @@ } } - 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; - DWORD components; - - resource_type = (opcode_token & WINED3D_SM4_RESOURCE_TYPE_MASK) >> WINED3D_SM4_RESOURCE_TYPE_SHIFT; - if (!resource_type || (resource_type >= ARRAY_SIZE(resource_type_table))) - { - FIXME("Unhandled resource type %#x.\n", resource_type); - ins->declaration.semantic.resource_type = WINED3D_SHADER_RESOURCE_NONE; - } - else - { - ins->declaration.semantic.resource_type = resource_type_table[resource_type]; - } - shader_sm4_read_dst_param(priv, &p, WINED3D_DATA_RESOURCE, &ins->declaration.semantic.reg); - - components = *p++; - if ((components & 0xfff0) != (components & 0xf) * 0x1110) - FIXME("Components (%#x) have different data types.\n", components); - data_type = components & 0xf; - - if (!data_type || (data_type >= ARRAY_SIZE(data_type_table))) - { - FIXME("Unhandled data type %#x.\n", data_type); - ins->declaration.semantic.resource_data_type = WINED3D_DATA_FLOAT; - } - else - { - ins->declaration.semantic.resource_data_type = data_type_table[data_type]; - } - } - else if (opcode == WINED3D_SM4_OP_DCL_CONSTANT_BUFFER) - { - shader_sm4_read_src_param(priv, &p, WINED3D_DATA_FLOAT, &ins->declaration.src); - 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; - - primitive_type = (opcode_token & WINED3D_SM4_PRIMITIVE_TYPE_MASK) >> WINED3D_SM4_PRIMITIVE_TYPE_SHIFT; - if (primitive_type >= sizeof(output_primitive_type_table) / sizeof(*output_primitive_type_table)) - { - FIXME("Unhandled output primitive type %#x.\n", primitive_type); - ins->declaration.primitive_type = WINED3D_PT_UNDEFINED; - } - else - { - ins->declaration.primitive_type = output_primitive_type_table[primitive_type]; - } - } - else if (opcode == WINED3D_SM4_OP_DCL_INPUT_PRIMITIVE) - { - enum wined3d_sm4_input_primitive_type primitive_type; - - primitive_type = (opcode_token & WINED3D_SM4_PRIMITIVE_TYPE_MASK) >> WINED3D_SM4_PRIMITIVE_TYPE_SHIFT; - if (primitive_type >= sizeof(input_primitive_type_table) / sizeof(*input_primitive_type_table)) - { - FIXME("Unhandled input primitive type %#x.\n", primitive_type); - ins->declaration.primitive_type = WINED3D_PT_UNDEFINED; - } - else - { - ins->declaration.primitive_type = input_primitive_type_table[primitive_type]; - } - } - 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) + if (opcode_info->read_opcode_func) { - ins->flags = (opcode_token & WINED3D_SM4_GLOBAL_FLAGS_MASK) >> WINED3D_SM4_GLOBAL_FLAGS_SHIFT; + opcode_info->read_opcode_func(ins, opcode, opcode_token, p, len, priv); } else { diff -Nru wine-staging-1.9.6/dlls/wined3d/state.c wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/state.c --- wine-staging-1.9.6/dlls/wined3d/state.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/state.c 2016-04-04 18:06:32.000000000 +0000 @@ -367,11 +367,20 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - const struct wined3d_format *rt_format = state->fb->render_targets[0]->format; - unsigned int rt_fmt_flags = state->fb->render_targets[0]->format_flags; const struct wined3d_gl_info *gl_info = context->gl_info; - GLenum srcBlend, dstBlend; + const struct wined3d_format *rt_format; enum wined3d_blend d3d_blend; + GLenum srcBlend, dstBlend; + unsigned int rt_fmt_flags; + + if (!state->fb->render_targets[0]) + { + gl_info->gl_ops.gl.p_glDisable(GL_BLEND); + return; + } + + rt_format = state->fb->render_targets[0]->format; + rt_fmt_flags = state->fb->render_targets[0]->format_flags; /* According to the red book, GL_LINE_SMOOTH needs GL_BLEND with specific * blending parameters to work. */ @@ -1346,6 +1355,14 @@ } } +static void state_linepattern_w(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) +{ + static unsigned int once; + + if (!once++) + FIXME("Setting line patterns is not supported in OpenGL core contexts.\n"); +} + static void state_normalize(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { const struct wined3d_gl_info *gl_info = context->gl_info; @@ -4544,31 +4561,40 @@ static void viewport_miscpart(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { + const struct wined3d_rendertarget_view *depth_stencil = state->fb->depth_stencil; const struct wined3d_rendertarget_view *target = state->fb->render_targets[0]; const struct wined3d_gl_info *gl_info = context->gl_info; struct wined3d_viewport vp = state->viewport; + unsigned int width, height; - if (vp.width > target->width) - vp.width = target->width; - if (vp.height > target->height) - vp.height = target->height; + if (target) + { + if (vp.width > target->width) + vp.width = target->width; + if (vp.height > target->height) + vp.height = target->height; + + surface_get_drawable_size(wined3d_rendertarget_view_get_surface(target), context, &width, &height); + } + else if (depth_stencil) + { + width = depth_stencil->width; + height = depth_stencil->height; + } + else + { + FIXME("No attachments draw calls not supported.\n"); + return; + } gl_info->gl_ops.gl.p_glDepthRange(vp.min_z, vp.max_z); checkGLcall("glDepthRange"); /* Note: GL requires lower left, DirectX supplies upper left. This is * reversed when using offscreen rendering. */ if (context->render_offscreen) - { gl_info->gl_ops.gl.p_glViewport(vp.x, vp.y, vp.width, vp.height); - } else - { - UINT width, height; - - surface_get_drawable_size(wined3d_rendertarget_view_get_surface(target), context, &width, &height); - gl_info->gl_ops.gl.p_glViewport(vp.x, (height - (vp.y + vp.height)), - vp.width, vp.height); - } + gl_info->gl_ops.gl.p_glViewport(vp.x, (height - (vp.y + vp.height)), vp.width, vp.height); checkGLcall("glViewport"); } @@ -4941,7 +4967,8 @@ { STATE_RENDER(WINED3D_RS_WRAPU), { STATE_RENDER(WINED3D_RS_WRAPU), state_wrapu }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_WRAPV), { STATE_RENDER(WINED3D_RS_WRAPV), state_wrapv }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_FILLMODE), { STATE_RENDER(WINED3D_RS_FILLMODE), state_fillmode }, WINED3D_GL_EXT_NONE }, - { STATE_RENDER(WINED3D_RS_LINEPATTERN), { STATE_RENDER(WINED3D_RS_LINEPATTERN), state_linepattern }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_LINEPATTERN), { STATE_RENDER(WINED3D_RS_LINEPATTERN), state_linepattern }, WINED3D_GL_LEGACY_CONTEXT }, + { STATE_RENDER(WINED3D_RS_LINEPATTERN), { STATE_RENDER(WINED3D_RS_LINEPATTERN), state_linepattern_w }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_MONOENABLE), { STATE_RENDER(WINED3D_RS_MONOENABLE), state_monoenable }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_ROP2), { STATE_RENDER(WINED3D_RS_ROP2), state_rop2 }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_PLANEMASK), { STATE_RENDER(WINED3D_RS_PLANEMASK), state_planemask }, WINED3D_GL_EXT_NONE }, diff -Nru wine-staging-1.9.6/dlls/wined3d/surface.c wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/surface.c --- wine-staging-1.9.6/dlls/wined3d/surface.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/surface.c 2016-04-04 18:06:32.000000000 +0000 @@ -30,9 +30,8 @@ #include "wine/port.h" #include "wined3d_private.h" -WINE_DEFAULT_DEBUG_CHANNEL(d3d_surface); +WINE_DEFAULT_DEBUG_CHANNEL(d3d); WINE_DECLARE_DEBUG_CHANNEL(d3d_perf); -WINE_DECLARE_DEBUG_CHANNEL(d3d); #define MAXLOCKCOUNT 50 /* After this amount of locks do not free the sysmem copy. */ @@ -40,11 +39,6 @@ WINED3D_LOCATION_SYSMEM | WINED3D_LOCATION_USER_MEMORY | WINED3D_LOCATION_DIB | WINED3D_LOCATION_BUFFER; -static unsigned int surface_get_sub_resource_idx(const struct wined3d_surface *surface) -{ - return surface->texture_layer * surface->container->level_count + surface->texture_level; -} - void wined3d_surface_cleanup(struct wined3d_surface *surface) { struct wined3d_surface *overlay, *cur; @@ -113,8 +107,8 @@ /* The drawable size of an onscreen drawable is the surface size. * (Actually: The window size, but the surface is created in window * size.) */ - *width = context->current_rt->resource.width; - *height = context->current_rt->resource.height; + *width = context->current_rt.texture->resource.width; + *height = context->current_rt.texture->resource.height; } else if (wined3d_settings.offscreen_rendering_mode == ORM_BACKBUFFER) { @@ -128,10 +122,13 @@ } else { + struct wined3d_surface *rt; + /* The drawable size of an FBO target is the OpenGL texture size, * which is the power of two size. */ - *width = context->current_rt->pow2Width; - *height = context->current_rt->pow2Height; + rt = context->current_rt.texture->sub_resources[context->current_rt.sub_resource_idx].u.surface; + *width = rt->pow2Width; + *height = rt->pow2Height; } } @@ -457,39 +454,6 @@ return WINED3D_OK; } -static void surface_get_memory(const struct wined3d_surface *surface, struct wined3d_bo_address *data, - DWORD location) -{ - if (location & WINED3D_LOCATION_BUFFER) - { - data->addr = NULL; - data->buffer_object = surface->container->sub_resources[surface_get_sub_resource_idx(surface)].buffer_object; - return; - } - if (location & WINED3D_LOCATION_USER_MEMORY) - { - data->addr = surface->container->user_memory; - data->buffer_object = 0; - return; - } - if (location & WINED3D_LOCATION_DIB) - { - data->addr = surface->dib.bitmap_data; - data->buffer_object = 0; - return; - } - if (location & WINED3D_LOCATION_SYSMEM) - { - data->addr = surface->resource.heap_memory; - data->buffer_object = 0; - return; - } - - ERR("Unexpected locations %s.\n", wined3d_debug_location(location)); - data->addr = NULL; - data->buffer_object = 0; -} - static void surface_prepare_system_memory(struct wined3d_surface *surface) { TRACE("surface %p.\n", surface); @@ -502,12 +466,13 @@ if (!wined3d_resource_allocate_sysmem(&surface->resource)) ERR("Failed to allocate system memory.\n"); - if (surface->locations & WINED3D_LOCATION_SYSMEM) + if (surface_get_sub_resource(surface)->locations & WINED3D_LOCATION_SYSMEM) ERR("Surface without system memory has WINED3D_LOCATION_SYSMEM set.\n"); } static void surface_evict_sysmem(struct wined3d_surface *surface) { + unsigned int sub_resource_idx = surface_get_sub_resource_idx(surface); struct wined3d_texture *texture = surface->container; if (surface->resource.map_count || texture->download_count > MAXLOCKCOUNT @@ -515,79 +480,7 @@ return; wined3d_resource_free_sysmem(&surface->resource); - surface_invalidate_location(surface, WINED3D_LOCATION_SYSMEM); -} - -static HRESULT surface_private_setup(struct wined3d_surface *surface) -{ - /* TODO: Check against the maximum texture sizes supported by the video card. */ - struct wined3d_texture *texture = surface->container; - const struct wined3d_gl_info *gl_info = &texture->resource.device->adapter->gl_info; - unsigned int pow2Width, pow2Height; - - TRACE("surface %p.\n", surface); - - /* Non-power2 support */ - if (gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO] || gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT] - || gl_info->supported[ARB_TEXTURE_RECTANGLE]) - { - pow2Width = surface->resource.width; - pow2Height = surface->resource.height; - } - else - { - /* Find the nearest pow2 match */ - pow2Width = pow2Height = 1; - while (pow2Width < surface->resource.width) - pow2Width <<= 1; - while (pow2Height < surface->resource.height) - pow2Height <<= 1; - } - surface->pow2Width = pow2Width; - surface->pow2Height = pow2Height; - - if (pow2Width > surface->resource.width || pow2Height > surface->resource.height) - { - /* TODO: Add support for non power two compressed textures. */ - if (texture->resource.format_flags & (WINED3DFMT_FLAG_COMPRESSED | WINED3DFMT_FLAG_HEIGHT_SCALE)) - { - FIXME("(%p) Compressed or height scaled non-power-two textures are not supported w(%d) h(%d)\n", - surface, surface->resource.width, surface->resource.height); - return WINED3DERR_NOTAVAILABLE; - } - } - - if ((surface->pow2Width > gl_info->limits.texture_size || surface->pow2Height > gl_info->limits.texture_size) - && (texture->resource.usage & WINED3DUSAGE_TEXTURE)) - { - /* One of three options: - * 1: Do the same as we do with NPOT and scale the texture, (any - * texture ops would require the texture to be scaled which is - * potentially slow) - * 2: Set the texture to the maximum size (bad idea). - * 3: WARN and return WINED3DERR_NOTAVAILABLE; - * 4: Create the surface, but allow it to be used only for DirectDraw - * Blts. Some apps (e.g. Swat 3) create textures with a Height of - * 16 and a Width > 3000 and blt 16x16 letter areas from them to - * the render target. */ - if (texture->resource.pool == WINED3D_POOL_DEFAULT || texture->resource.pool == WINED3D_POOL_MANAGED) - { - WARN("Unable to allocate a surface which exceeds the maximum OpenGL texture size.\n"); - return WINED3DERR_NOTAVAILABLE; - } - - /* We should never use this surface in combination with OpenGL! */ - TRACE("Creating an oversized surface: %ux%u.\n", - surface->pow2Width, surface->pow2Height); - } - - if (texture->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) - surface->locations = WINED3D_LOCATION_DISCARDED; - - if (wined3d_texture_use_pbo(texture, gl_info)) - surface->resource.map_binding = WINED3D_LOCATION_BUFFER; - - return WINED3D_OK; + wined3d_texture_invalidate_location(texture, sub_resource_idx, WINED3D_LOCATION_SYSMEM); } static BOOL surface_is_full_rect(const struct wined3d_surface *surface, const RECT *r) @@ -752,11 +645,11 @@ else if (dst_location == WINED3D_LOCATION_DRAWABLE) required_rt = dst_surface; else required_rt = NULL; - if (required_rt && required_rt != old_ctx->current_rt) - { - restore_rt = old_ctx->current_rt; + restore_rt = context_get_rt_surface(old_ctx); + if (restore_rt != required_rt) context = context_acquire(device, required_rt); - } + else + restore_rt = NULL; if (!context->valid) { @@ -770,7 +663,7 @@ if (src_location == WINED3D_LOCATION_DRAWABLE) { TRACE("Source surface %p is onscreen.\n", src_surface); - buffer = surface_get_gl_buffer(src_surface); + buffer = wined3d_texture_get_gl_buffer(src_surface->container); surface_translate_drawable_coords(src_surface, context->win_handle, &src_rect); } else @@ -787,7 +680,7 @@ if (dst_location == WINED3D_LOCATION_DRAWABLE) { TRACE("Destination surface %p is onscreen.\n", dst_surface); - buffer = surface_get_gl_buffer(dst_surface); + buffer = wined3d_texture_get_gl_buffer(dst_surface->container); surface_translate_drawable_coords(dst_surface, context->win_handle, &dst_rect); } else @@ -974,6 +867,8 @@ static void surface_unload(struct wined3d_resource *resource) { struct wined3d_surface *surface = surface_from_resource(resource); + unsigned int sub_resource_idx = surface_get_sub_resource_idx(surface); + struct wined3d_texture *texture = surface->container; struct wined3d_renderbuffer_entry *entry, *entry2; struct wined3d_device *device = resource->device; const struct wined3d_gl_info *gl_info; @@ -997,21 +892,21 @@ * and all flags get lost */ if (resource->usage & WINED3DUSAGE_DEPTHSTENCIL) { - surface_validate_location(surface, WINED3D_LOCATION_DISCARDED); - surface_invalidate_location(surface, ~WINED3D_LOCATION_DISCARDED); + wined3d_texture_validate_location(texture, sub_resource_idx, WINED3D_LOCATION_DISCARDED); + wined3d_texture_invalidate_location(texture, sub_resource_idx, ~WINED3D_LOCATION_DISCARDED); } else { surface_prepare_system_memory(surface); memset(surface->resource.heap_memory, 0, surface->resource.size); - surface_validate_location(surface, WINED3D_LOCATION_SYSMEM); - surface_invalidate_location(surface, ~WINED3D_LOCATION_SYSMEM); + wined3d_texture_validate_location(texture, sub_resource_idx, WINED3D_LOCATION_SYSMEM); + wined3d_texture_invalidate_location(texture, sub_resource_idx, ~WINED3D_LOCATION_SYSMEM); } } else { surface_load_location(surface, context, surface->resource.map_binding); - surface_invalidate_location(surface, ~surface->resource.map_binding); + wined3d_texture_invalidate_location(texture, sub_resource_idx, ~surface->resource.map_binding); } /* Destroy fbo render buffers. This is needed for implicit render targets, for @@ -1068,51 +963,6 @@ surface_resource_sub_resource_unmap, }; -static const struct wined3d_surface_ops surface_ops = -{ - surface_private_setup, -}; - -/***************************************************************************** - * Initializes the GDI surface, aka creates the DIB section we render to - * The DIB section creation is done by calling GetDC, which will create the - * section and releasing the dc to allow the app to use it. The dib section - * will stay until the surface is released - * - * GDI surfaces do not need to be a power of 2 in size, so the pow2 sizes - * are set to the real sizes to save memory. The NONPOW2 flag is unset to - * avoid confusion in the shared surface code. - * - * Returns: - * WINED3D_OK on success - * The return values of called methods on failure - * - *****************************************************************************/ -static HRESULT gdi_surface_private_setup(struct wined3d_surface *surface) -{ - HRESULT hr; - - TRACE("surface %p.\n", surface); - - /* Sysmem textures have memory already allocated - release it, - * this avoids an unnecessary memcpy. */ - hr = surface_create_dib_section(surface); - if (FAILED(hr)) - return hr; - surface->resource.map_binding = WINED3D_LOCATION_DIB; - - /* We don't mind the nonpow2 stuff in GDI. */ - surface->pow2Width = surface->resource.width; - surface->pow2Height = surface->resource.height; - - return WINED3D_OK; -} - -static const struct wined3d_surface_ops gdi_surface_ops = -{ - gdi_surface_private_setup, -}; - /* This call just downloads data, the caller is responsible for binding the * correct texture. */ /* Context activation is done by the caller. */ @@ -1130,7 +980,7 @@ return; } - surface_get_memory(surface, &data, dst_location); + wined3d_texture_get_memory(texture, surface_get_sub_resource_idx(surface), &data, dst_location); if (texture->resource.format_flags & WINED3DFMT_FLAG_COMPRESSED) { @@ -1385,6 +1235,8 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point, struct wined3d_surface *src_surface, const RECT *src_rect) { + unsigned int src_sub_resource_idx = surface_get_sub_resource_idx(src_surface); + unsigned int dst_sub_resource_idx = surface_get_sub_resource_idx(dst_surface); struct wined3d_texture *src_texture = src_surface->container; struct wined3d_texture *dst_texture = dst_surface->container; unsigned int src_row_pitch, src_slice_pitch; @@ -1480,7 +1332,8 @@ surface_load_location(dst_surface, context, WINED3D_LOCATION_TEXTURE_RGB); wined3d_texture_bind_and_dirtify(dst_texture, context, FALSE); - surface_get_memory(src_surface, &data, src_surface->locations); + wined3d_texture_get_memory(src_texture, src_sub_resource_idx, &data, + src_texture->sub_resources[src_sub_resource_idx].locations); wined3d_texture_get_pitch(src_texture, src_surface->texture_level, &src_row_pitch, &src_slice_pitch); wined3d_surface_upload_data(dst_surface, gl_info, src_format, src_rect, @@ -1488,8 +1341,8 @@ context_release(context); - surface_validate_location(dst_surface, WINED3D_LOCATION_TEXTURE_RGB); - surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB); + wined3d_texture_validate_location(dst_texture, dst_sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB); + wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~WINED3D_LOCATION_TEXTURE_RGB); return WINED3D_OK; } @@ -1561,38 +1414,6 @@ checkGLcall("set_compatible_renderbuffer"); } -GLenum surface_get_gl_buffer(const struct wined3d_surface *surface) -{ - const struct wined3d_swapchain *swapchain = surface->container->swapchain; - - TRACE("surface %p.\n", surface); - - if (!swapchain) - { - ERR("Surface %p is not on a swapchain.\n", surface); - return GL_NONE; - } - - if (swapchain->back_buffers && swapchain->back_buffers[0] == surface->container) - { - if (swapchain->render_to_fbo) - { - TRACE("Returning GL_COLOR_ATTACHMENT0\n"); - return GL_COLOR_ATTACHMENT0; - } - TRACE("Returning GL_BACK\n"); - return GL_BACK; - } - else if (surface->container == swapchain->front_buffer) - { - TRACE("Returning GL_FRONT\n"); - return GL_FRONT; - } - - FIXME("Higher back buffer, returning GL_BACK\n"); - return GL_BACK; -} - /* Context activation is done by the caller. */ void surface_load(struct wined3d_surface *surface, struct wined3d_context *context, BOOL srgb) { @@ -1603,7 +1424,7 @@ if (surface->container->resource.pool == WINED3D_POOL_SCRATCH) ERR("Not supported on scratch surfaces.\n"); - if (surface->locations & location) + if (surface_get_sub_resource(surface)->locations & location) { TRACE("surface is already in texture\n"); return; @@ -1992,7 +1813,9 @@ static void read_from_framebuffer(struct wined3d_surface *surface, struct wined3d_context *old_ctx, DWORD dst_location) { - struct wined3d_device *device = surface->resource.device; + unsigned int sub_resource_idx = surface_get_sub_resource_idx(surface); + struct wined3d_texture *texture = surface->container; + struct wined3d_device *device = texture->resource.device; const struct wined3d_gl_info *gl_info; struct wined3d_context *context = old_ctx; struct wined3d_surface *restore_rt = NULL; @@ -2003,13 +1826,13 @@ BOOL srcIsUpsideDown; struct wined3d_bo_address data; - surface_get_memory(surface, &data, dst_location); + wined3d_texture_get_memory(texture, sub_resource_idx, &data, dst_location); - if (surface != old_ctx->current_rt) - { - restore_rt = old_ctx->current_rt; + restore_rt = context_get_rt_surface(old_ctx); + if (restore_rt != surface) context = context_acquire(device, surface); - } + else + restore_rt = NULL; context_apply_blit_state(context, device); gl_info = context->gl_info; @@ -2018,7 +1841,7 @@ * There is no need to keep track of the current read buffer or reset it, every part of the code * that reads sets the read buffer as desired. */ - if (wined3d_resource_is_offscreen(&surface->container->resource)) + if (wined3d_resource_is_offscreen(&texture->resource)) { /* Mapping the primary render target which is not on a swapchain. * Read from the back buffer. */ @@ -2029,7 +1852,7 @@ else { /* Onscreen surfaces are always part of a swapchain */ - GLenum buffer = surface_get_gl_buffer(surface); + GLenum buffer = wined3d_texture_get_gl_buffer(texture); TRACE("Mapping %#x buffer.\n", buffer); gl_info->gl_ops.gl.p_glReadBuffer(buffer); checkGLcall("glReadBuffer"); @@ -2042,16 +1865,16 @@ checkGLcall("glBindBuffer"); } - wined3d_texture_get_pitch(surface->container, surface->texture_level, &row_pitch, &slice_pitch); + wined3d_texture_get_pitch(texture, surface->texture_level, &row_pitch, &slice_pitch); /* Setup pixel store pack state -- to glReadPixels into the correct place */ - gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ROW_LENGTH, row_pitch / surface->resource.format->byte_count); + gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ROW_LENGTH, row_pitch / texture->resource.format->byte_count); checkGLcall("glPixelStorei"); gl_info->gl_ops.gl.p_glReadPixels(0, 0, surface->resource.width, surface->resource.height, - surface->resource.format->glFormat, - surface->resource.format->glType, data.addr); + texture->resource.format->glFormat, + texture->resource.format->glType, data.addr); checkGLcall("glReadPixels"); /* Reset previous pixel store pack state */ @@ -2109,29 +1932,30 @@ * switch to a different context and restore the original one before return. */ void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb, struct wined3d_context *old_ctx) { - struct wined3d_device *device = surface->resource.device; + struct wined3d_texture *texture = surface->container; + struct wined3d_device *device = texture->resource.device; const struct wined3d_gl_info *gl_info; struct wined3d_context *context = old_ctx; struct wined3d_surface *restore_rt = NULL; - if (old_ctx->current_rt != surface) - { - restore_rt = old_ctx->current_rt; + restore_rt = context_get_rt_surface(old_ctx); + if (restore_rt != surface) context = context_acquire(device, surface); - } + else + restore_rt = NULL; gl_info = context->gl_info; device_invalidate_state(device, STATE_FRAMEBUFFER); - wined3d_texture_prepare_texture(surface->container, context, srgb); - wined3d_texture_bind_and_dirtify(surface->container, context, srgb); + wined3d_texture_prepare_texture(texture, context, srgb); + wined3d_texture_bind_and_dirtify(texture, context, srgb); TRACE("Reading back offscreen render target %p.\n", surface); - if (wined3d_resource_is_offscreen(&surface->container->resource)) + if (wined3d_resource_is_offscreen(&texture->resource)) gl_info->gl_ops.gl.p_glReadBuffer(context_get_offscreen_gl_buffer(context)); else - gl_info->gl_ops.gl.p_glReadBuffer(surface_get_gl_buffer(surface)); + gl_info->gl_ops.gl.p_glReadBuffer(wined3d_texture_get_gl_buffer(texture)); checkGLcall("glReadBuffer"); gl_info->gl_ops.gl.p_glCopyTexSubImage2D(surface->texture_target, surface->texture_level, @@ -2144,6 +1968,9 @@ static void surface_prepare_rb(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, BOOL multisample) { + struct wined3d_texture *texture = surface->container; + const struct wined3d_format *format = texture->resource.format; + if (multisample) { DWORD samples; @@ -2160,16 +1987,15 @@ /* 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) + if (texture->resource.multisample_type == WINED3D_MULTISAMPLE_NON_MASKABLE) { - 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++) + if (texture->resource.multisample_quality == count++) break; } } @@ -2177,13 +2003,13 @@ } else { - samples = surface->resource.multisample_type; + samples = texture->resource.multisample_type; } gl_info->fbo_ops.glGenRenderbuffers(1, &surface->rb_multisample); gl_info->fbo_ops.glBindRenderbuffer(GL_RENDERBUFFER, surface->rb_multisample); gl_info->fbo_ops.glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples, - surface->resource.format->glInternal, surface->pow2Width, surface->pow2Height); + format->glInternal, surface->pow2Width, surface->pow2Height); checkGLcall("glRenderbufferStorageMultisample()"); TRACE("Created multisample rb %u.\n", surface->rb_multisample); } @@ -2194,7 +2020,7 @@ gl_info->fbo_ops.glGenRenderbuffers(1, &surface->rb_resolved); gl_info->fbo_ops.glBindRenderbuffer(GL_RENDERBUFFER, surface->rb_resolved); - gl_info->fbo_ops.glRenderbufferStorage(GL_RENDERBUFFER, surface->resource.format->glInternal, + gl_info->fbo_ops.glRenderbufferStorage(GL_RENDERBUFFER, format->glInternal, surface->pow2Width, surface->pow2Height); checkGLcall("glRenderbufferStorage()"); TRACE("Created resolved rb %u.\n", surface->rb_resolved); @@ -2206,7 +2032,10 @@ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struct wined3d_surface *src_surface, const RECT *src_rect, const RECT *dst_rect_in, enum wined3d_texture_filter_type filter) { - struct wined3d_device *device = dst_surface->resource.device; + unsigned int dst_sub_resource_idx = surface_get_sub_resource_idx(dst_surface); + struct wined3d_texture *src_texture = src_surface->container; + struct wined3d_texture *dst_texture = dst_surface->container; + struct wined3d_device *device = dst_texture->resource.device; const struct wined3d_gl_info *gl_info; float xrel, yrel; struct wined3d_context *context; @@ -2226,11 +2055,11 @@ context = context_acquire(device, src_surface); gl_info = context->gl_info; context_apply_blit_state(context, device); - wined3d_texture_load(dst_surface->container, context, FALSE); + wined3d_texture_load(dst_texture, context, FALSE); /* Bind the target texture */ - context_bind_texture(context, dst_surface->container->target, dst_surface->container->texture_rgb.name); - if (wined3d_resource_is_offscreen(&src_surface->container->resource)) + context_bind_texture(context, dst_texture->target, dst_texture->texture_rgb.name); + if (wined3d_resource_is_offscreen(&src_texture->resource)) { TRACE("Reading from an offscreen target\n"); upsidedown = !upsidedown; @@ -2238,7 +2067,7 @@ } else { - gl_info->gl_ops.gl.p_glReadBuffer(surface_get_gl_buffer(src_surface)); + gl_info->gl_ops.gl.p_glReadBuffer(wined3d_texture_get_gl_buffer(src_texture)); } checkGLcall("glReadBuffer"); @@ -2307,15 +2136,18 @@ /* The texture is now most up to date - If the surface is a render target * and has a drawable, this path is never entered. */ - surface_validate_location(dst_surface, WINED3D_LOCATION_TEXTURE_RGB); - surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB); + wined3d_texture_validate_location(dst_texture, dst_sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB); + wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~WINED3D_LOCATION_TEXTURE_RGB); } /* Uses the hardware to stretch and flip the image */ static void fb_copy_to_texture_hwstretch(struct wined3d_surface *dst_surface, struct wined3d_surface *src_surface, const RECT *src_rect, const RECT *dst_rect_in, enum wined3d_texture_filter_type filter) { - struct wined3d_device *device = dst_surface->resource.device; + unsigned int dst_sub_resource_idx = surface_get_sub_resource_idx(dst_surface); + struct wined3d_texture *src_texture = src_surface->container; + struct wined3d_texture *dst_texture = dst_surface->container; + struct wined3d_device *device = dst_texture->resource.device; GLuint src, backup = 0; float left, right, top, bottom; /* Texture coordinates */ UINT fbwidth = src_surface->resource.width; @@ -2335,16 +2167,16 @@ context = context_acquire(device, src_surface); gl_info = context->gl_info; context_apply_blit_state(context, device); - wined3d_texture_load(dst_surface->container, context, FALSE); + wined3d_texture_load(dst_texture, context, FALSE); offscreen_buffer = context_get_offscreen_gl_buffer(context); - src_offscreen = wined3d_resource_is_offscreen(&src_surface->container->resource); + src_offscreen = wined3d_resource_is_offscreen(&src_texture->resource); noBackBufferBackup = src_offscreen && wined3d_settings.offscreen_rendering_mode == ORM_FBO; - if (!noBackBufferBackup && !src_surface->container->texture_rgb.name) + if (!noBackBufferBackup && !src_texture->texture_rgb.name) { /* Get it a description */ - wined3d_texture_load(src_surface->container, context, FALSE); + wined3d_texture_load(src_texture, context, FALSE); } /* Try to use an aux buffer for drawing the rectangle. This way it doesn't need restoring. @@ -2374,12 +2206,12 @@ * we are reading from the back buffer, the backup can be used as source texture */ texture_target = src_surface->texture_target; - context_bind_texture(context, texture_target, src_surface->container->texture_rgb.name); + context_bind_texture(context, texture_target, src_texture->texture_rgb.name); gl_info->gl_ops.gl.p_glEnable(texture_target); checkGLcall("glEnable(texture_target)"); /* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */ - src_surface->locations &= ~WINED3D_LOCATION_TEXTURE_RGB; + surface_get_sub_resource(src_surface)->locations &= ~WINED3D_LOCATION_TEXTURE_RGB; } /* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag @@ -2400,7 +2232,7 @@ } else { - gl_info->gl_ops.gl.p_glReadBuffer(surface_get_gl_buffer(src_surface)); + gl_info->gl_ops.gl.p_glReadBuffer(wined3d_texture_get_gl_buffer(src_texture)); } /* TODO: Only back up the part that will be overwritten */ @@ -2415,10 +2247,9 @@ wined3d_gl_min_mip_filter(filter, WINED3D_TEXF_NONE)); checkGLcall("glTexParameteri"); - if (!src_surface->container->swapchain - || src_surface->container == src_surface->container->swapchain->back_buffers[0]) + if (!src_texture->swapchain || src_texture == src_texture->swapchain->back_buffers[0]) { - src = backup ? backup : src_surface->container->texture_rgb.name; + src = backup ? backup : src_texture->texture_rgb.name; } else { @@ -2468,7 +2299,7 @@ bottom = src_surface->resource.height - src_rect->top; } - if (src_surface->container->flags & WINED3D_TEXTURE_NORMALIZED_COORDS) + if (src_texture->flags & WINED3D_TEXTURE_NORMALIZED_COORDS) { left /= src_surface->pow2Width; right /= src_surface->pow2Width; @@ -2510,7 +2341,7 @@ } /* Now read the stretched and upside down image into the destination texture */ - context_bind_texture(context, texture_target, dst_surface->container->texture_rgb.name); + context_bind_texture(context, texture_target, dst_texture->texture_rgb.name); gl_info->gl_ops.gl.p_glCopyTexSubImage2D(texture_target, 0, dst_rect.left, dst_rect.top, /* xoffset, yoffset */ @@ -2539,7 +2370,7 @@ gl_info->gl_ops.gl.p_glEnable(src_surface->texture_target); texture_target = src_surface->texture_target; } - context_bind_texture(context, src_surface->texture_target, src_surface->container->texture_rgb.name); + context_bind_texture(context, src_surface->texture_target, src_texture->texture_rgb.name); } gl_info->gl_ops.gl.p_glBegin(GL_QUADS); @@ -2565,7 +2396,7 @@ checkGLcall("glDisable(texture_target)"); /* Cleanup */ - if (src != src_surface->container->texture_rgb.name && src != backup) + if (src != src_texture->texture_rgb.name && src != backup) { gl_info->gl_ops.gl.p_glDeleteTextures(1, &src); checkGLcall("glDeleteTextures(1, &src)"); @@ -2583,8 +2414,8 @@ /* The texture is now most up to date - If the surface is a render target * and has a drawable, this path is never entered. */ - surface_validate_location(dst_surface, WINED3D_LOCATION_TEXTURE_RGB); - surface_invalidate_location(dst_surface, ~WINED3D_LOCATION_TEXTURE_RGB); + wined3d_texture_validate_location(dst_texture, dst_sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB); + wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~WINED3D_LOCATION_TEXTURE_RGB); } /* Front buffer coordinates are always full screen coordinates, but our GL @@ -2622,6 +2453,8 @@ struct wined3d_surface *src_surface, const RECT *src_rect_in, struct wined3d_surface *dst_surface, const RECT *dst_rect_in) { + struct wined3d_texture *src_texture = src_surface->container; + struct wined3d_texture *dst_texture = dst_surface->container; const struct wined3d_gl_info *gl_info; struct wined3d_context *context = old_ctx; struct wined3d_surface *restore_rt = NULL; @@ -2630,24 +2463,23 @@ src_rect = *src_rect_in; dst_rect = *dst_rect_in; - - if (old_ctx->current_rt != dst_surface) - { - restore_rt = old_ctx->current_rt; + restore_rt = context_get_rt_surface(old_ctx); + if (restore_rt != dst_surface) context = context_acquire(device, dst_surface); - } + else + restore_rt = NULL; gl_info = context->gl_info; /* Make sure the surface is up-to-date. This should probably use * surface_load_location() and worry about the destination surface too, * unless we're overwriting it completely. */ - wined3d_texture_load(src_surface->container, context, FALSE); + wined3d_texture_load(src_texture, context, FALSE); /* Activate the destination context, set it up for blitting */ context_apply_blit_state(context, device); - if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) + if (!wined3d_resource_is_offscreen(&dst_texture->resource)) surface_translate_drawable_coords(dst_surface, context->win_handle, &dst_rect); device->blitter->set_shader(device->blit_priv, context, src_surface, NULL); @@ -2660,9 +2492,9 @@ /* For P8 surfaces, the alpha component contains the palette index. * Which means that the colorkey is one of the palette entries. In * other cases pixels that should be masked away have alpha set to 0. */ - if (src_surface->resource.format->id == WINED3DFMT_P8_UINT) + if (src_texture->resource.format->id == WINED3DFMT_P8_UINT) gl_info->gl_ops.gl.p_glAlphaFunc(GL_NOTEQUAL, - (float)src_surface->container->async.src_blt_color_key.color_space_low_value / 255.0f); + (float)src_texture->async.src_blt_color_key.color_space_low_value / 255.0f); else gl_info->gl_ops.gl.p_glAlphaFunc(GL_NOTEQUAL, 0.0f); checkGLcall("glAlphaFunc"); @@ -2685,8 +2517,7 @@ device->blitter->unset_shader(context->gl_info); if (wined3d_settings.strict_draw_ordering - || (dst_surface->container->swapchain - && dst_surface->container->swapchain->front_buffer == dst_surface->container)) + || (dst_texture->swapchain && dst_texture->swapchain->front_buffer == dst_texture)) gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ if (restore_rt) @@ -2730,35 +2561,39 @@ struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter) { - struct wined3d_device *device = dst_surface->resource.device; + struct wined3d_texture *dst_texture = dst_surface->container; + struct wined3d_device *device = dst_texture->resource.device; const struct wined3d_surface *rt = wined3d_rendertarget_view_get_surface(device->fb.render_targets[0]); struct wined3d_swapchain *src_swapchain, *dst_swapchain; + struct wined3d_texture *src_texture; 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)); /* Get the swapchain. One of the surfaces has to be a primary surface */ - if (dst_surface->resource.pool == WINED3D_POOL_SYSTEM_MEM) + if (dst_texture->resource.pool == WINED3D_POOL_SYSTEM_MEM) { WARN("Destination is in sysmem, rejecting gl blt\n"); return WINED3DERR_INVALIDCALL; } - dst_swapchain = dst_surface->container->swapchain; + dst_swapchain = dst_texture->swapchain; if (src_surface) { - if (src_surface->resource.pool == WINED3D_POOL_SYSTEM_MEM) + src_texture = src_surface->container; + if (src_texture->resource.pool == WINED3D_POOL_SYSTEM_MEM) { WARN("Src is in sysmem, rejecting gl blt\n"); return WINED3DERR_INVALIDCALL; } - src_swapchain = src_surface->container->swapchain; + src_swapchain = src_texture->swapchain; } else { + src_texture = NULL; src_swapchain = NULL; } @@ -2807,8 +2642,8 @@ BOOL stretchx; /* P8 read back is not implemented */ - if (src_surface->resource.format->id == WINED3DFMT_P8_UINT - || dst_surface->resource.format->id == WINED3DFMT_P8_UINT) + if (src_texture->resource.format->id == WINED3DFMT_P8_UINT + || dst_texture->resource.format->id == WINED3DFMT_P8_UINT) { TRACE("P8 read back not supported by frame buffer to texture blit\n"); return WINED3DERR_INVALIDCALL; @@ -2862,7 +2697,7 @@ static void surface_depth_blt(const struct wined3d_surface *surface, struct wined3d_context *context, GLuint texture, GLint x, GLint y, GLsizei w, GLsizei h, GLenum target) { - struct wined3d_device *device = surface->resource.device; + struct wined3d_device *device = surface->container->resource.device; const struct wined3d_gl_info *gl_info = context->gl_info; GLint compare_mode = GL_NONE; struct blt_info info; @@ -2921,22 +2756,27 @@ void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) { + struct wined3d_texture_sub_resource *sub_resource; + TRACE("surface %p, new location %#x, w %u, h %u.\n", surface, location, w, h); - if (((surface->locations & WINED3D_LOCATION_TEXTURE_RGB) && !(location & WINED3D_LOCATION_TEXTURE_RGB)) - || (!(surface->locations & WINED3D_LOCATION_TEXTURE_RGB) && (location & WINED3D_LOCATION_TEXTURE_RGB))) + sub_resource = surface_get_sub_resource(surface); + if (((sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB) && !(location & WINED3D_LOCATION_TEXTURE_RGB)) + || (!(sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB) + && (location & WINED3D_LOCATION_TEXTURE_RGB))) wined3d_texture_set_dirty(surface->container); surface->ds_current_size.cx = w; surface->ds_current_size.cy = h; - surface->locations = location; + sub_resource->locations = location; } /* Context activation is done by the caller. */ static void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) { + struct wined3d_texture *texture = surface->container; + struct wined3d_device *device = texture->resource.device; const struct wined3d_gl_info *gl_info = context->gl_info; - struct wined3d_device *device = surface->resource.device; GLsizei w, h; TRACE("surface %p, context %p, new location %#x.\n", surface, context, location); @@ -2944,7 +2784,7 @@ /* TODO: Make this work for modes other than FBO */ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return; - if (!(surface->locations & location)) + if (!(surface_get_sub_resource(surface)->locations & location)) { w = surface->ds_current_size.cx; h = surface->ds_current_size.cy; @@ -3033,7 +2873,7 @@ context_apply_fbo_state_blit(context, GL_FRAMEBUFFER, surface_from_resource(wined3d_texture_get_sub_resource(context->swapchain->front_buffer, 0)), NULL, WINED3D_LOCATION_DRAWABLE); - surface_depth_blt(surface, context, surface->container->texture_rgb.name, + surface_depth_blt(surface, context, texture->texture_rgb.name, 0, surface->pow2Height - h, w, h, surface->texture_target); checkGLcall("depth_blt"); @@ -3048,25 +2888,6 @@ } } -void surface_validate_location(struct wined3d_surface *surface, DWORD location) -{ - TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); - - surface->locations |= location; -} - -void surface_invalidate_location(struct wined3d_surface *surface, DWORD location) -{ - TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); - - if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) - wined3d_texture_set_dirty(surface->container); - surface->locations &= ~location; - - if (!surface->locations) - ERR("Surface %p does not have any up to date location.\n", surface); -} - static DWORD resource_access_from_location(DWORD location) { switch (location) @@ -3092,14 +2913,17 @@ static void surface_copy_simple_location(struct wined3d_surface *surface, DWORD location) { - struct wined3d_device *device = surface->resource.device; + unsigned int sub_resource_idx = surface_get_sub_resource_idx(surface); + struct wined3d_texture *texture = surface->container; + struct wined3d_device *device = texture->resource.device; struct wined3d_context *context; const struct wined3d_gl_info *gl_info; struct wined3d_bo_address dst, src; UINT size = surface->resource.size; - surface_get_memory(surface, &dst, location); - surface_get_memory(surface, &src, surface->locations); + wined3d_texture_get_memory(texture, sub_resource_idx, &dst, location); + wined3d_texture_get_memory(texture, sub_resource_idx, &src, + texture->sub_resources[sub_resource_idx].locations); if (dst.buffer_object) { @@ -3131,49 +2955,52 @@ struct wined3d_context *context, DWORD dst_location) { const struct wined3d_gl_info *gl_info = context->gl_info; + struct wined3d_texture_sub_resource *sub_resource; wined3d_surface_prepare(surface, context, dst_location); - if (surface->locations & surface_simple_locations) + sub_resource = surface_get_sub_resource(surface); + if (sub_resource->locations & surface_simple_locations) { surface_copy_simple_location(surface, dst_location); return; } - if (surface->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)) + if (sub_resource->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)) surface_load_location(surface, context, WINED3D_LOCATION_TEXTURE_RGB); /* Download the surface to system memory. */ - if (surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) + if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) { struct wined3d_texture *texture = surface->container; wined3d_texture_bind_and_dirtify(texture, context, - !(surface->locations & WINED3D_LOCATION_TEXTURE_RGB)); + !(sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)); surface_download_data(surface, gl_info, dst_location); ++texture->download_count; return; } - if (surface->locations & WINED3D_LOCATION_DRAWABLE) + if (sub_resource->locations & WINED3D_LOCATION_DRAWABLE) { read_from_framebuffer(surface, context, dst_location); return; } FIXME("Can't load surface %p with location flags %s into sysmem.\n", - surface, wined3d_debug_location(surface->locations)); + surface, wined3d_debug_location(sub_resource->locations)); } /* Context activation is done by the caller. */ static HRESULT surface_load_drawable(struct wined3d_surface *surface, struct wined3d_context *context) { + struct wined3d_texture *texture = surface->container; RECT r; if (wined3d_settings.offscreen_rendering_mode == ORM_FBO - && wined3d_resource_is_offscreen(&surface->container->resource)) + && wined3d_resource_is_offscreen(&texture->resource)) { ERR("Trying to load offscreen surface into WINED3D_LOCATION_DRAWABLE.\n"); return WINED3DERR_INVALIDCALL; @@ -3181,7 +3008,7 @@ surface_get_rect(surface, NULL, &r); surface_load_location(surface, context, WINED3D_LOCATION_TEXTURE_RGB); - surface_blt_to_drawable(surface->resource.device, context, + surface_blt_to_drawable(texture->resource.device, context, WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); return WINED3D_OK; @@ -3192,29 +3019,32 @@ { unsigned int width, src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch; const RECT src_rect = {0, 0, surface->resource.width, surface->resource.height}; + unsigned int sub_resource_idx = surface_get_sub_resource_idx(surface); const struct wined3d_gl_info *gl_info = context->gl_info; - struct wined3d_device *device = surface->resource.device; - const struct wined3d_color_key_conversion *conversion; struct wined3d_texture *texture = surface->container; + struct wined3d_device *device = texture->resource.device; + const struct wined3d_color_key_conversion *conversion; + struct wined3d_texture_sub_resource *sub_resource; struct wined3d_bo_address data; struct wined3d_format format; POINT dst_point = {0, 0}; BYTE *mem = NULL; + sub_resource = surface_get_sub_resource(surface); if (wined3d_settings.offscreen_rendering_mode != ORM_FBO && wined3d_resource_is_offscreen(&texture->resource) - && (surface->locations & WINED3D_LOCATION_DRAWABLE)) + && (sub_resource->locations & WINED3D_LOCATION_DRAWABLE)) { surface_load_fb_texture(surface, srgb, context); return WINED3D_OK; } - if (surface->locations & (WINED3D_LOCATION_TEXTURE_SRGB | WINED3D_LOCATION_TEXTURE_RGB) - && (surface->container->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB) + if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_SRGB | WINED3D_LOCATION_TEXTURE_RGB) + && (texture->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, - NULL, surface->resource.usage, surface->resource.pool, surface->resource.format)) + NULL, texture->resource.usage, texture->resource.pool, texture->resource.format, + NULL, texture->resource.usage, texture->resource.pool, texture->resource.format)) { if (srgb) surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_RGB, @@ -3226,13 +3056,13 @@ return WINED3D_OK; } - if (surface->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED) - && (!srgb || (surface->container->resource.format_flags & WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB)) + if (sub_resource->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED) + && (!srgb || (texture->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, - NULL, surface->resource.usage, surface->resource.pool, surface->resource.format)) + NULL, texture->resource.usage, texture->resource.pool, texture->resource.format, + NULL, texture->resource.usage, texture->resource.pool, texture->resource.format)) { - DWORD src_location = surface->locations & WINED3D_LOCATION_RB_RESOLVED ? + DWORD src_location = sub_resource->locations & WINED3D_LOCATION_RB_RESOLVED ? 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}; @@ -3247,7 +3077,7 @@ if (srgb) { - if ((surface->locations & (WINED3D_LOCATION_TEXTURE_RGB | surface->resource.map_binding)) + if ((sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | surface->resource.map_binding)) == WINED3D_LOCATION_TEXTURE_RGB) { /* Performance warning... */ @@ -3257,7 +3087,7 @@ } else { - if ((surface->locations & (WINED3D_LOCATION_TEXTURE_SRGB | surface->resource.map_binding)) + if ((sub_resource->locations & (WINED3D_LOCATION_TEXTURE_SRGB | surface->resource.map_binding)) == WINED3D_LOCATION_TEXTURE_SRGB) { /* Performance warning... */ @@ -3266,7 +3096,7 @@ } } - if (!(surface->locations & surface_simple_locations)) + if (!(sub_resource->locations & surface_simple_locations)) { WARN("Trying to load a texture from sysmem, but no simple location is valid.\n"); /* Lets hope we get it from somewhere... */ @@ -3286,8 +3116,7 @@ /* 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) - && texture->sub_resources[surface_get_sub_resource_idx(surface)].buffer_object) + if ((format.convert || conversion) && texture->sub_resources[sub_resource_idx].buffer_object) { TRACE("Removing the pbo attached to surface %p.\n", surface); @@ -3297,10 +3126,10 @@ surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; surface_load_location(surface, context, surface->resource.map_binding); - wined3d_texture_remove_buffer_object(texture, surface_get_sub_resource_idx(surface), gl_info); + wined3d_texture_remove_buffer_object(texture, sub_resource_idx, gl_info); } - surface_get_memory(surface, &data, surface->locations); + wined3d_texture_get_memory(texture, sub_resource_idx, &data, sub_resource->locations); if (format.convert) { /* This code is entered for texture formats which need a fixup. */ @@ -3356,29 +3185,34 @@ DWORD dst_location) { const RECT rect = {0, 0, surface->resource.width, surface->resource.height}; + DWORD locations = surface_get_sub_resource(surface)->locations; DWORD src_location; - if (surface->locations & WINED3D_LOCATION_RB_MULTISAMPLE) + if (locations & WINED3D_LOCATION_RB_MULTISAMPLE) src_location = WINED3D_LOCATION_RB_MULTISAMPLE; - else if (surface->locations & WINED3D_LOCATION_RB_RESOLVED) + else if (locations & WINED3D_LOCATION_RB_RESOLVED) src_location = WINED3D_LOCATION_RB_RESOLVED; - else if (surface->locations & WINED3D_LOCATION_TEXTURE_SRGB) + else if (locations & WINED3D_LOCATION_TEXTURE_SRGB) src_location = WINED3D_LOCATION_TEXTURE_SRGB; else /* surface_blt_fbo will load the source location if necessary. */ src_location = WINED3D_LOCATION_TEXTURE_RGB; - surface_blt_fbo(surface->resource.device, context, WINED3D_TEXF_POINT, + surface_blt_fbo(surface->container->resource.device, context, WINED3D_TEXF_POINT, surface, src_location, &rect, surface, dst_location, &rect); } /* Context activation is done by the caller. Context may be NULL in ddraw-only mode. */ HRESULT surface_load_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) { + unsigned int sub_resource_idx = surface_get_sub_resource_idx(surface); + struct wined3d_texture *texture = surface->container; + struct wined3d_texture_sub_resource *sub_resource; HRESULT hr; TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); - if (surface->locations & location && (!(surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) + sub_resource = &texture->sub_resources[sub_resource_idx]; + if (sub_resource->locations & location && (!(texture->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) || (surface->ds_current_size.cx == surface->resource.width && surface->ds_current_size.cy == surface->resource.height))) { @@ -3386,41 +3220,41 @@ return WINED3D_OK; } - if (WARN_ON(d3d_surface)) + if (WARN_ON(d3d)) { DWORD required_access = resource_access_from_location(location); - if ((surface->resource.access_flags & required_access) != required_access) + if ((texture->resource.access_flags & required_access) != required_access) WARN("Operation requires %#x access, but surface only has %#x.\n", - required_access, surface->resource.access_flags); + required_access, texture->resource.access_flags); } - if (surface->locations & WINED3D_LOCATION_DISCARDED) + if (sub_resource->locations & WINED3D_LOCATION_DISCARDED) { TRACE("Surface previously discarded, nothing to do.\n"); wined3d_surface_prepare(surface, context, location); - surface_validate_location(surface, location); - surface_invalidate_location(surface, WINED3D_LOCATION_DISCARDED); + wined3d_texture_validate_location(texture, sub_resource_idx, location); + wined3d_texture_invalidate_location(texture, sub_resource_idx, WINED3D_LOCATION_DISCARDED); goto done; } - if (!surface->locations) + if (!sub_resource->locations) { ERR("Surface %p does not have any up to date location.\n", surface); - surface_validate_location(surface, WINED3D_LOCATION_DISCARDED); + wined3d_texture_validate_location(texture, sub_resource_idx, WINED3D_LOCATION_DISCARDED); return surface_load_location(surface, context, location); } - if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) + if (texture->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) { - if ((location == WINED3D_LOCATION_TEXTURE_RGB && surface->locations & WINED3D_LOCATION_DRAWABLE) - || (location == WINED3D_LOCATION_DRAWABLE && surface->locations & WINED3D_LOCATION_TEXTURE_RGB)) + if ((location == WINED3D_LOCATION_TEXTURE_RGB && sub_resource->locations & WINED3D_LOCATION_DRAWABLE) + || (location == WINED3D_LOCATION_DRAWABLE && sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB)) { surface_load_ds_location(surface, context, location); goto done; } FIXME("Unimplemented copy from %s to %s for depth/stencil buffers.\n", - wined3d_debug_location(surface->locations), wined3d_debug_location(location)); + wined3d_debug_location(sub_resource->locations), wined3d_debug_location(location)); return WINED3DERR_INVALIDCALL; } @@ -3456,15 +3290,15 @@ } done: - surface_validate_location(surface, location); + wined3d_texture_validate_location(texture, sub_resource_idx, location); - if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) + if (texture->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) { surface->ds_current_size.cx = surface->resource.width; surface->ds_current_size.cy = surface->resource.height; } - if (location != WINED3D_LOCATION_SYSMEM && (surface->locations & WINED3D_LOCATION_SYSMEM)) + if (location != WINED3D_LOCATION_SYSMEM && (sub_resource->locations & WINED3D_LOCATION_SYSMEM)) surface_evict_sysmem(surface); return WINED3D_OK; @@ -3524,7 +3358,7 @@ } case WINED3D_BLIT_OP_COLOR_BLIT: case WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST: - if (TRACE_ON(d3d_surface) && TRACE_ON(d3d)) + if (TRACE_ON(d3d)) { TRACE("Checking support for fixup:\n"); dump_color_fixup_desc(src_format->color_fixup); @@ -3600,15 +3434,18 @@ struct wined3d_surface *dst_surface, const RECT *dst_rect, const struct wined3d_color_key *color_key) { + unsigned int dst_sub_resource_idx = surface_get_sub_resource_idx(dst_surface); + struct wined3d_texture *dst_texture = dst_surface->container; + struct wined3d_texture *src_texture = src_surface->container; struct wined3d_context *context; /* Blit from offscreen surface to render target */ - struct wined3d_color_key old_blt_key = src_surface->container->async.src_blt_color_key; - DWORD old_color_key_flags = src_surface->container->async.color_key_flags; + struct wined3d_color_key old_blt_key = src_texture->async.src_blt_color_key; + DWORD old_color_key_flags = src_texture->async.color_key_flags; TRACE("Blt from surface %p to rendertarget %p\n", src_surface, dst_surface); - wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, color_key); + wined3d_texture_set_color_key(src_texture, WINED3D_CKEY_SRC_BLT, color_key); context = context_acquire(device, dst_surface); @@ -3624,11 +3461,11 @@ context_release(context); /* Restore the color key parameters */ - wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, + wined3d_texture_set_color_key(src_texture, WINED3D_CKEY_SRC_BLT, (old_color_key_flags & WINED3D_CKEY_SRC_BLT) ? &old_blt_key : NULL); - surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding); - surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); + wined3d_texture_validate_location(dst_texture, dst_sub_resource_idx, dst_texture->resource.draw_binding); + wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~dst_texture->resource.draw_binding); } const struct blit_shader ffp_blit = { @@ -4252,10 +4089,8 @@ } error: - if (flags && FIXME_ON(d3d_surface)) - { - FIXME("\tUnsupported flags: %#x.\n", flags); - } + if (flags) + FIXME(" Unsupported flags %#x.\n", flags); release: wined3d_resource_unmap(&dst_texture->resource, dst_sub_resource_idx); @@ -4313,6 +4148,7 @@ { struct wined3d_box dst_box = {dst_rect->left, dst_rect->top, dst_rect->right, dst_rect->bottom, 0, 1}; struct wined3d_box src_box = {src_rect->left, src_rect->top, src_rect->right, src_rect->bottom, 0, 1}; + unsigned int dst_sub_resource_idx = surface_get_sub_resource_idx(dst_surface); struct wined3d_texture *dst_texture = dst_surface->container; struct wined3d_device *device = dst_texture->resource.device; struct wined3d_swapchain *src_swapchain, *dst_swapchain; @@ -4483,12 +4319,16 @@ } else { + struct wined3d_texture_sub_resource *src_sub_resource, *dst_sub_resource; const struct blit_shader *blitter; + dst_sub_resource = surface_get_sub_resource(dst_surface); + src_sub_resource = src_surface ? surface_get_sub_resource(src_surface) : NULL; + /* In principle this would apply to depth blits as well, but we don't * implement those in the CPU blitter at the moment. */ - if ((dst_surface->locations & dst_surface->resource.map_binding) - && (!src_surface || (src_surface->locations & src_surface->resource.map_binding))) + if ((dst_sub_resource->locations & dst_surface->resource.map_binding) + && (!src_surface || (src_sub_resource->locations & src_surface->resource.map_binding))) { if (scale) TRACE("Not doing sysmem blit because of scaling.\n"); @@ -4532,8 +4372,8 @@ { blit_op = WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST; } - else if ((src_surface->locations & WINED3D_LOCATION_SYSMEM) - && !(dst_surface->locations & WINED3D_LOCATION_SYSMEM)) + else if ((src_sub_resource->locations & WINED3D_LOCATION_SYSMEM) + && !(dst_sub_resource->locations & WINED3D_LOCATION_SYSMEM)) { /* Upload */ if (scale) @@ -4592,8 +4432,10 @@ dst_surface, dst_texture->resource.draw_binding, dst_rect); context_release(context); - surface_validate_location(dst_surface, dst_texture->resource.draw_binding); - surface_invalidate_location(dst_surface, ~dst_texture->resource.draw_binding); + wined3d_texture_validate_location(dst_texture, dst_sub_resource_idx, + dst_texture->resource.draw_binding); + wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, + ~dst_texture->resource.draw_binding); return WINED3D_OK; } @@ -4623,6 +4465,7 @@ HRESULT wined3d_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) { + unsigned int sub_resource_idx = layer * container->level_count + level; 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); @@ -4631,6 +4474,25 @@ unsigned int resource_size; HRESULT hr; + if (container->flags & WINED3D_TEXTURE_COND_NP2_EMULATED) + { + unsigned int pow2_width = 1, pow2_height = 1; + + /* Find the nearest pow2 match. */ + while (pow2_width < desc->width) + pow2_width <<= 1; + while (pow2_height < desc->height) + pow2_height <<= 1; + + surface->pow2Width = pow2_width; + surface->pow2Height = pow2_height; + } + else + { + surface->pow2Width = desc->width; + surface->pow2Height = desc->height; + } + /* Quick lockable sanity check. * TODO: remove this after surfaces, usage and lockability have been debugged properly * this function is too deep to need to care about things like this. @@ -4666,11 +4528,6 @@ if (!resource_size) return WINED3DERR_INVALIDCALL; - if (device->wined3d->flags & WINED3D_NO3D) - surface->surface_ops = &gdi_surface_ops; - else - surface->surface_ops = &surface_ops; - if (FAILED(hr = resource_init(&surface->resource, device, WINED3D_RTYPE_SURFACE, format, desc->multisample_type, multisample_quality, desc->usage, desc->pool, desc->width, desc->height, 1, resource_size, NULL, &wined3d_null_parent_ops, &surface_resource_ops))) @@ -4680,7 +4537,10 @@ } surface->container = container; - surface_validate_location(surface, WINED3D_LOCATION_SYSMEM); + surface->texture_target = target; + surface->texture_level = level; + surface->texture_layer = layer; + list_init(&surface->renderbuffers); list_init(&surface->overlays); @@ -4690,30 +4550,31 @@ if (lockable || desc->format == WINED3DFMT_D16_LOCKABLE) surface->resource.access_flags |= WINED3D_RESOURCE_ACCESS_CPU; - surface->texture_target = target; - surface->texture_level = level; - surface->texture_layer = layer; + wined3d_texture_validate_location(container, sub_resource_idx, WINED3D_LOCATION_SYSMEM); + if (container->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) + container->sub_resources[sub_resource_idx].locations = WINED3D_LOCATION_DISCARDED; - /* Call the private setup routine */ - if (FAILED(hr = surface->surface_ops->surface_private_setup(surface))) - { - ERR("Private setup failed, hr %#x.\n", hr); - wined3d_surface_cleanup(surface); - return hr; - } + if (wined3d_texture_use_pbo(container, gl_info)) + surface->resource.map_binding = WINED3D_LOCATION_BUFFER; /* Similar to lockable rendertargets above, creating the DIB section * during surface initialization prevents the sysmem pointer from changing * after a wined3d_texture_get_dc() call. */ - if ((desc->usage & WINED3DUSAGE_OWNDC) && !surface->hDC - && SUCCEEDED(surface_create_dib_section(surface))) + if ((desc->usage & WINED3DUSAGE_OWNDC) || (device->wined3d->flags & WINED3D_NO3D)) + { + if (FAILED(hr = surface_create_dib_section(surface))) + { + wined3d_surface_cleanup(surface); + return hr; + } surface->resource.map_binding = WINED3D_LOCATION_DIB; + } if (surface->resource.map_binding == WINED3D_LOCATION_DIB) { wined3d_resource_free_sysmem(&surface->resource); - surface_validate_location(surface, WINED3D_LOCATION_DIB); - surface_invalidate_location(surface, WINED3D_LOCATION_SYSMEM); + wined3d_texture_validate_location(container, sub_resource_idx, WINED3D_LOCATION_DIB); + wined3d_texture_invalidate_location(container, sub_resource_idx, WINED3D_LOCATION_SYSMEM); } return hr; diff -Nru wine-staging-1.9.6/dlls/wined3d/swapchain.c wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/swapchain.c --- wine-staging-1.9.6/dlls/wined3d/swapchain.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/swapchain.c 2016-04-04 18:06:32.000000000 +0000 @@ -172,19 +172,11 @@ HRESULT CDECL wined3d_swapchain_get_front_buffer_data(const struct wined3d_swapchain *swapchain, struct wined3d_texture *dst_texture, unsigned int sub_resource_idx) { - struct wined3d_surface *src_surface, *dst_surface; - struct wined3d_resource *sub_resource; RECT src_rect, dst_rect; TRACE("swapchain %p, dst_texture %p, sub_resource_idx %u.\n", swapchain, dst_texture, sub_resource_idx); - if (!(sub_resource = wined3d_texture_get_sub_resource(dst_texture, sub_resource_idx)) || - sub_resource->type != WINED3D_RTYPE_SURFACE) - return WINED3DERR_INVALIDCALL; - - dst_surface = surface_from_resource(sub_resource); - src_surface = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); - SetRect(&src_rect, 0, 0, src_surface->resource.width, src_surface->resource.height); + SetRect(&src_rect, 0, 0, swapchain->front_buffer->resource.width, swapchain->front_buffer->resource.height); dst_rect = src_rect; if (swapchain->desc.windowed) @@ -194,7 +186,8 @@ wine_dbgstr_rect(&dst_rect)); } - return wined3d_surface_blt(dst_surface, &dst_rect, src_surface, &src_rect, 0, NULL, WINED3D_TEXF_POINT); + return wined3d_texture_blt(dst_texture, sub_resource_idx, &dst_rect, + swapchain->front_buffer, 0, &src_rect, 0, NULL, WINED3D_TEXF_POINT); } struct wined3d_texture * CDECL wined3d_swapchain_get_back_buffer(const struct wined3d_swapchain *swapchain, @@ -302,8 +295,9 @@ static void swapchain_blit(const struct wined3d_swapchain *swapchain, struct wined3d_context *context, const RECT *src_rect, const RECT *dst_rect) { - struct wined3d_surface *backbuffer = surface_from_resource( - wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)); + struct wined3d_texture *texture = swapchain->back_buffers[0]; + struct wined3d_surface *back_buffer = texture->sub_resources[0].u.surface; + struct wined3d_surface *front_buffer = swapchain->front_buffer->sub_resources[0].u.surface; UINT src_w = src_rect->right - src_rect->left; UINT src_h = src_rect->bottom - src_rect->top; GLenum gl_filter; @@ -322,23 +316,21 @@ GetClientRect(swapchain->win_handle, &win_rect); win_h = win_rect.bottom - win_rect.top; - if (gl_info->fbo_ops.glBlitFramebuffer && is_identity_fixup(backbuffer->resource.format->color_fixup)) + if (gl_info->fbo_ops.glBlitFramebuffer && is_identity_fixup(texture->resource.format->color_fixup)) { DWORD location = WINED3D_LOCATION_TEXTURE_RGB; - if (backbuffer->resource.multisample_type) + if (texture->resource.multisample_type) { location = WINED3D_LOCATION_RB_RESOLVED; - surface_load_location(backbuffer, context, location); + surface_load_location(back_buffer, context, location); } - context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, backbuffer, NULL, location); + context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, back_buffer, NULL, location); gl_info->gl_ops.gl.p_glReadBuffer(GL_COLOR_ATTACHMENT0); context_check_fbo_status(context, GL_READ_FRAMEBUFFER); - context_apply_fbo_state_blit(context, GL_DRAW_FRAMEBUFFER, - surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)), - NULL, WINED3D_LOCATION_DRAWABLE); + context_apply_fbo_state_blit(context, GL_DRAW_FRAMEBUFFER, front_buffer, NULL, WINED3D_LOCATION_DRAWABLE); context_set_draw_buffer(context, GL_BACK); context_invalidate_state(context, STATE_FRAMEBUFFER); @@ -366,30 +358,28 @@ float tex_right = src_rect->right; float tex_bottom = src_rect->bottom; - context2 = context_acquire(device, backbuffer); + context2 = context_acquire(device, back_buffer); context_apply_blit_state(context2, device); - if (backbuffer->container->flags & WINED3D_TEXTURE_NORMALIZED_COORDS) + if (back_buffer->container->flags & WINED3D_TEXTURE_NORMALIZED_COORDS) { - tex_left /= backbuffer->pow2Width; - tex_right /= backbuffer->pow2Width; - tex_top /= backbuffer->pow2Height; - tex_bottom /= backbuffer->pow2Height; + tex_left /= back_buffer->pow2Width; + tex_right /= back_buffer->pow2Width; + tex_top /= back_buffer->pow2Height; + tex_bottom /= back_buffer->pow2Height; } - if (is_complex_fixup(backbuffer->resource.format->color_fixup)) + if (is_complex_fixup(texture->resource.format->color_fixup)) gl_filter = GL_NEAREST; - context_apply_fbo_state_blit(context2, GL_FRAMEBUFFER, - surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)), - NULL, WINED3D_LOCATION_DRAWABLE); - context_bind_texture(context2, backbuffer->texture_target, backbuffer->container->texture_rgb.name); + context_apply_fbo_state_blit(context2, GL_FRAMEBUFFER, front_buffer, NULL, WINED3D_LOCATION_DRAWABLE); + context_bind_texture(context2, back_buffer->texture_target, texture->texture_rgb.name); /* Set up the texture. The surface is not in a wined3d_texture * container, so there are no D3D texture settings to dirtify. */ - device->blitter->set_shader(device->blit_priv, context2, backbuffer, NULL); - gl_info->gl_ops.gl.p_glTexParameteri(backbuffer->texture_target, GL_TEXTURE_MIN_FILTER, gl_filter); - gl_info->gl_ops.gl.p_glTexParameteri(backbuffer->texture_target, GL_TEXTURE_MAG_FILTER, gl_filter); + device->blitter->set_shader(device->blit_priv, context2, back_buffer, NULL); + gl_info->gl_ops.gl.p_glTexParameteri(back_buffer->texture_target, GL_TEXTURE_MIN_FILTER, gl_filter); + gl_info->gl_ops.gl.p_glTexParameteri(back_buffer->texture_target, GL_TEXTURE_MAG_FILTER, gl_filter); context_set_draw_buffer(context, GL_BACK); @@ -439,6 +429,8 @@ /* Context activation is done by the caller. */ static void wined3d_swapchain_rotate(struct wined3d_swapchain *swapchain, struct wined3d_context *context) { + struct wined3d_texture_sub_resource *sub_resource; + struct wined3d_texture *texture, *texture_prev; struct gl_texture tex0; GLuint rb0; DWORD locations0; @@ -449,34 +441,38 @@ if (swapchain->desc.backbuffer_count < 2 || !swapchain->render_to_fbo) return; - surface_prev = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)); + texture_prev = swapchain->back_buffers[0]; + surface_prev = texture_prev->sub_resources[0].u.surface; /* Back buffer 0 is already in the draw binding. */ - tex0 = swapchain->back_buffers[0]->texture_rgb; + tex0 = texture_prev->texture_rgb; rb0 = surface_prev->rb_multisample; - locations0 = surface_prev->locations; + locations0 = texture_prev->sub_resources[0].locations; for (i = 1; i < swapchain->desc.backbuffer_count; ++i) { - surface = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[i], 0)); + texture = swapchain->back_buffers[i]; + sub_resource = &texture->sub_resources[0]; + surface = sub_resource->u.surface; - if (!(surface->locations & supported_locations)) - surface_load_location(surface, context, swapchain->back_buffers[i]->resource.draw_binding); + if (!(sub_resource->locations & supported_locations)) + surface_load_location(surface, context, texture->resource.draw_binding); - swapchain->back_buffers[i - 1]->texture_rgb = swapchain->back_buffers[i]->texture_rgb; + texture_prev->texture_rgb = texture->texture_rgb; surface_prev->rb_multisample = surface->rb_multisample; - surface_validate_location(surface_prev, surface->locations & supported_locations); - surface_invalidate_location(surface_prev, ~(surface->locations & supported_locations)); + wined3d_texture_validate_location(texture_prev, 0, sub_resource->locations & supported_locations); + wined3d_texture_invalidate_location(texture_prev, 0, ~(sub_resource->locations & supported_locations)); + texture_prev = texture; surface_prev = surface; } - swapchain->back_buffers[i - 1]->texture_rgb = tex0; + texture_prev->texture_rgb = tex0; surface_prev->rb_multisample = rb0; - surface_validate_location(surface_prev, locations0 & supported_locations); - surface_invalidate_location(surface_prev, ~(locations0 & supported_locations)); + wined3d_texture_validate_location(texture_prev, 0, locations0 & supported_locations); + wined3d_texture_invalidate_location(texture_prev, 0, ~(locations0 & supported_locations)); device_invalidate_state(swapchain->device, STATE_FRAMEBUFFER); } @@ -484,12 +480,11 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, const RECT *src_rect, const RECT *dst_rect, DWORD flags) { - struct wined3d_surface *back_buffer = surface_from_resource( - wined3d_texture_get_sub_resource(swapchain->back_buffers[0], 0)); + struct wined3d_surface *back_buffer = swapchain->back_buffers[0]->sub_resources[0].u.surface; const struct wined3d_fb_state *fb = &swapchain->device->fb; const struct wined3d_gl_info *gl_info; + struct wined3d_texture *logo_texture; struct wined3d_context *context; - struct wined3d_surface *front; BOOL render_to_fbo; context = context_acquire(swapchain->device, back_buffer); @@ -502,23 +497,19 @@ gl_info = context->gl_info; - if (swapchain->device->logo_texture) + if ((logo_texture = swapchain->device->logo_texture)) { - struct wined3d_surface *src_surface = surface_from_resource( - wined3d_texture_get_sub_resource(swapchain->device->logo_texture, 0)); - RECT rect = {0, 0, src_surface->resource.width, src_surface->resource.height}; + RECT rect = {0, 0, logo_texture->resource.width, logo_texture->resource.height}; /* Blit the logo into the upper left corner of the drawable. */ - wined3d_surface_blt(back_buffer, &rect, src_surface, &rect, + wined3d_texture_blt(swapchain->back_buffers[0], 0, &rect, logo_texture, 0, &rect, WINED3D_BLT_ALPHA_TEST, 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 = + RECT dst_rect = { swapchain->device->xScreenSpace - swapchain->device->xHotSpot, swapchain->device->yScreenSpace - swapchain->device->yHotSpot, @@ -531,14 +522,17 @@ 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}; + const RECT clip_rect = {0, 0, + swapchain->back_buffers[0]->resource.width, + swapchain->back_buffers[0]->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, + MapWindowPoints(NULL, swapchain->win_handle, (POINT *)&dst_rect, 2); + if (wined3d_clip_blit(&clip_rect, &dst_rect, &src_rect)) + wined3d_texture_blt(swapchain->back_buffers[0], 0, &dst_rect, + swapchain->device->cursor_texture, 0, &src_rect, WINED3D_BLT_ALPHA_TEST, NULL, WINED3D_TEXF_POINT); } @@ -563,7 +557,7 @@ if (!swapchain->render_to_fbo && render_to_fbo && wined3d_settings.offscreen_rendering_mode == ORM_FBO) { surface_load_location(back_buffer, context, WINED3D_LOCATION_TEXTURE_RGB); - surface_invalidate_location(back_buffer, WINED3D_LOCATION_DRAWABLE); + wined3d_texture_invalidate_location(back_buffer->container, 0, WINED3D_LOCATION_DRAWABLE); swapchain->render_to_fbo = TRUE; swapchain_update_draw_bindings(swapchain); } @@ -607,10 +601,8 @@ } } - front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); - - surface_validate_location(front, WINED3D_LOCATION_DRAWABLE); - surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE); + wined3d_texture_validate_location(swapchain->front_buffer, 0, WINED3D_LOCATION_DRAWABLE); + wined3d_texture_invalidate_location(swapchain->front_buffer, 0, ~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. * If the swapeffect is COPY, the content remains the same. @@ -667,7 +659,7 @@ TRACE("swapchain %p.\n", swapchain); - front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); + front = swapchain->front_buffer->sub_resources[0].u.surface; if (swapchain->palette) wined3d_palette_apply_to_dc(swapchain->palette, front->hDC); @@ -835,7 +827,6 @@ { const struct wined3d_adapter *adapter = device->adapter; struct wined3d_resource_desc texture_desc; - struct wined3d_surface *front_buffer; BOOL displaymode_set = FALSE; RECT client_rect; HWND window; @@ -919,11 +910,10 @@ } wined3d_texture_set_swapchain(swapchain->front_buffer, swapchain); - front_buffer = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); if (!(device->wined3d->flags & WINED3D_NO3D)) { - surface_validate_location(front_buffer, WINED3D_LOCATION_DRAWABLE); - surface_invalidate_location(front_buffer, ~WINED3D_LOCATION_DRAWABLE); + wined3d_texture_validate_location(swapchain->front_buffer, 0, WINED3D_LOCATION_DRAWABLE); + wined3d_texture_invalidate_location(swapchain->front_buffer, 0, ~WINED3D_LOCATION_DRAWABLE); } /* MSDN says we're only allowed a single fullscreen swapchain per device, @@ -983,7 +973,7 @@ 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); + swapchain->context[0] = context_create(swapchain, 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])); @@ -1145,9 +1135,7 @@ TRACE("Creating a new context for swapchain %p, thread %u.\n", swapchain, GetCurrentThreadId()); - if (!(ctx = context_create(swapchain, - surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)), - swapchain->ds_format))) + if (!(ctx = context_create(swapchain, swapchain->front_buffer, swapchain->ds_format))) { ERR("Failed to create a new context for the swapchain\n"); return NULL; diff -Nru wine-staging-1.9.6/dlls/wined3d/texture.c wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/texture.c --- wine-staging-1.9.6/dlls/wined3d/texture.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/texture.c 2016-04-04 18:06:32.000000000 +0000 @@ -24,7 +24,7 @@ #include "wine/port.h" #include "wined3d_private.h" -WINE_DEFAULT_DEBUG_CHANNEL(d3d_texture); +WINE_DEFAULT_DEBUG_CHANNEL(d3d); WINE_DECLARE_DEBUG_CHANNEL(d3d_perf); WINE_DECLARE_DEBUG_CHANNEL(winediag); @@ -37,6 +37,117 @@ && !(texture->flags & (WINED3D_TEXTURE_PIN_SYSMEM | WINED3D_TEXTURE_COND_NP2_EMULATED)); } +GLenum wined3d_texture_get_gl_buffer(const struct wined3d_texture *texture) +{ + const struct wined3d_swapchain *swapchain = texture->swapchain; + + TRACE("texture %p.\n", texture); + + if (!swapchain) + { + ERR("Texture %p is not part of a swapchain.\n", texture); + return GL_NONE; + } + + if (swapchain->back_buffers && swapchain->back_buffers[0] == texture) + { + if (swapchain->render_to_fbo) + { + TRACE("Returning GL_COLOR_ATTACHMENT0.\n"); + return GL_COLOR_ATTACHMENT0; + } + TRACE("Returning GL_BACK.\n"); + return GL_BACK; + } + else if (texture == swapchain->front_buffer) + { + TRACE("Returning GL_FRONT.\n"); + return GL_FRONT; + } + + FIXME("Higher back buffer, returning GL_BACK.\n"); + return GL_BACK; +} + +void wined3d_texture_validate_location(struct wined3d_texture *texture, + unsigned int sub_resource_idx, DWORD location) +{ + struct wined3d_texture_sub_resource *sub_resource; + + TRACE("texture %p, sub_resource_idx %u, location %s.\n", + texture, sub_resource_idx, wined3d_debug_location(location)); + + sub_resource = &texture->sub_resources[sub_resource_idx]; + sub_resource->locations |= location; + + TRACE("New locations flags are %s.\n", wined3d_debug_location(sub_resource->locations)); +} + +void wined3d_texture_invalidate_location(struct wined3d_texture *texture, + unsigned int sub_resource_idx, DWORD location) +{ + struct wined3d_texture_sub_resource *sub_resource; + + TRACE("texture %p, sub_resource_idx %u, location %s.\n", + texture, sub_resource_idx, wined3d_debug_location(location)); + + if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) + wined3d_texture_set_dirty(texture); + + sub_resource = &texture->sub_resources[sub_resource_idx]; + sub_resource->locations &= ~location; + + TRACE("New locations flags are %s.\n", wined3d_debug_location(sub_resource->locations)); + + if (!sub_resource->locations) + ERR("Sub-resource %u of texture %p does not have any up to date location.\n", + sub_resource_idx, texture); +} + +void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int sub_resource_idx, + struct wined3d_bo_address *data, DWORD locations) +{ + struct wined3d_texture_sub_resource *sub_resource; + + TRACE("texture %p, sub_resource_idx %u, data %p, locations %s.\n", + texture, sub_resource_idx, data, wined3d_debug_location(locations)); + + sub_resource = &texture->sub_resources[sub_resource_idx]; + if (locations & WINED3D_LOCATION_BUFFER) + { + data->addr = NULL; + data->buffer_object = sub_resource->buffer_object; + return; + } + if (locations & WINED3D_LOCATION_USER_MEMORY) + { + data->addr = texture->user_memory; + data->buffer_object = 0; + return; + } + if (locations & WINED3D_LOCATION_DIB) + { + if (texture->resource.type == WINED3D_RTYPE_TEXTURE_2D) + { + data->addr = sub_resource->u.surface->dib.bitmap_data; + data->buffer_object = 0; + return; + } + ERR("Invalid location WINED3D_LOCATION_DIB for resource type %s.\n", + debug_d3dresourcetype(texture->resource.type)); + } + if (locations & WINED3D_LOCATION_SYSMEM) + { + data->addr = sub_resource->resource->heap_memory; + data->buffer_object = 0; + return; + } + + ERR("Unexpected locations %s.\n", wined3d_debug_location(locations)); + data->addr = NULL; + data->buffer_object = 0; +} + 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 flags, struct wined3d_device *device, void *parent, const struct wined3d_parent_ops *parent_ops, @@ -79,7 +190,7 @@ texture->level_count = level_count; 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; + texture->flags |= WINED3D_TEXTURE_POW2_MAT_IDENT | WINED3D_TEXTURE_NORMALIZED_COORDS; if (flags & WINED3D_TEXTURE_CREATE_PIN_SYSMEM) texture->flags |= WINED3D_TEXTURE_PIN_SYSMEM; @@ -95,8 +206,7 @@ buffer_object = &texture->sub_resources[sub_resource_idx].buffer_object; GL_EXTCALL(glDeleteBuffers(1, buffer_object)); checkGLcall("glDeleteBuffers"); - texture->texture_ops->texture_sub_resource_invalidate_location( - texture->sub_resources[sub_resource_idx].resource, WINED3D_LOCATION_BUFFER); + wined3d_texture_invalidate_location(texture, sub_resource_idx, WINED3D_LOCATION_BUFFER); *buffer_object = 0; TRACE("Deleted buffer object %u for texture %p, sub-resource %u.\n", @@ -187,6 +297,8 @@ struct wined3d_context *context, BOOL srgb) { const struct wined3d_gl_info *gl_info = context->gl_info; + const struct wined3d_format *format = texture->resource.format; + const struct color_fixup_desc fixup = format->color_fixup; struct gl_texture *gl_tex; GLenum target; @@ -298,6 +410,31 @@ gl_info->gl_ops.gl.p_glTexParameteri(target, GL_DEPTH_TEXTURE_MODE_ARB, GL_INTENSITY); checkGLcall("glTexParameteri(GL_DEPTH_TEXTURE_MODE_ARB, GL_INTENSITY)"); } + + if (!is_identity_fixup(fixup) && can_use_texture_swizzle(gl_info, format)) + { + static const GLenum swizzle_source[] = + { + GL_ZERO, /* CHANNEL_SOURCE_ZERO */ + GL_ONE, /* CHANNEL_SOURCE_ONE */ + GL_RED, /* CHANNEL_SOURCE_X */ + GL_GREEN, /* CHANNEL_SOURCE_Y */ + GL_BLUE, /* CHANNEL_SOURCE_Z */ + GL_ALPHA, /* CHANNEL_SOURCE_W */ + }; + struct + { + GLint x, y, z, w; + } + swizzle; + + swizzle.x = swizzle_source[fixup.x_source]; + swizzle.y = swizzle_source[fixup.y_source]; + swizzle.z = swizzle_source[fixup.z_source]; + swizzle.w = swizzle_source[fixup.w_source]; + gl_info->gl_ops.gl.p_glTexParameteriv(target, GL_TEXTURE_SWIZZLE_RGBA, &swizzle.x); + checkGLcall("glTexParameteriv(GL_TEXTURE_SWIZZLE_RGBA)"); + } } /* Context activation is done by the caller. */ @@ -511,8 +648,7 @@ if (!texture->texture_ops->texture_load_location(texture, i, context, sub_resource->map_binding)) ERR("Failed to load location %s.\n", wined3d_debug_location(sub_resource->map_binding)); else - texture->texture_ops->texture_sub_resource_invalidate_location(sub_resource, - ~sub_resource->map_binding); + wined3d_texture_invalidate_location(texture, i, ~sub_resource->map_binding); } texture->async.gl_color_key = texture->async.src_blt_color_key; @@ -676,6 +812,7 @@ const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct wined3d_format *format = wined3d_get_format(gl_info, format_id); UINT resource_size = wined3d_format_calculate_size(format, device->surface_alignment, width, height, 1); + struct wined3d_texture_sub_resource *sub_resource; struct wined3d_surface *surface; DWORD valid_location = 0; BOOL create_dib = FALSE; @@ -712,8 +849,9 @@ return WINED3DERR_INVALIDCALL; } - surface = texture->sub_resources[0].u.surface; - if (surface->resource.map_count || (surface->flags & SFLAG_DCINUSE)) + sub_resource = &texture->sub_resources[0]; + surface = sub_resource->u.surface; + if (sub_resource->resource->map_count || (surface->flags & SFLAG_DCINUSE)) { WARN("Surface is mapped or the DC is in use.\n"); return WINED3DERR_INVALIDCALL; @@ -733,7 +871,7 @@ create_dib = TRUE; } - wined3d_resource_free_sysmem(&surface->resource); + wined3d_resource_free_sysmem(sub_resource->resource); if ((texture->row_pitch = pitch)) texture->slice_pitch = height * pitch; @@ -748,12 +886,12 @@ texture->resource.width = width; texture->resource.height = height; - surface->resource.format = format; - surface->resource.multisample_type = multisample_type; - surface->resource.multisample_quality = multisample_quality; - surface->resource.width = width; - surface->resource.height = height; - surface->resource.size = texture->slice_pitch; + sub_resource->resource->format = format; + sub_resource->resource->multisample_type = multisample_type; + sub_resource->resource->multisample_quality = multisample_quality; + sub_resource->resource->width = width; + sub_resource->resource->height = height; + sub_resource->resource->size = texture->slice_pitch; if (((width & (width - 1)) || (height & (height - 1))) && !gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO] && !gl_info->supported[ARB_TEXTURE_RECTANGLE] && !gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT]) @@ -772,11 +910,11 @@ surface->pow2Height = height; } - surface->locations = 0; + sub_resource->locations = 0; if ((texture->user_memory = mem)) { - surface->resource.map_binding = WINED3D_LOCATION_USER_MEMORY; + sub_resource->resource->map_binding = WINED3D_LOCATION_USER_MEMORY; valid_location = WINED3D_LOCATION_USER_MEMORY; } else if (create_dib && SUCCEEDED(surface_create_dib_section(surface))) @@ -793,10 +931,10 @@ * If the surface didn't use PBOs previously but could now, don't * change it - whatever made us not use PBOs might come back, e.g. * color keys. */ - if (surface->resource.map_binding == WINED3D_LOCATION_BUFFER && !wined3d_texture_use_pbo(texture, gl_info)) - surface->resource.map_binding = surface->dib.DIBsection ? WINED3D_LOCATION_DIB : WINED3D_LOCATION_SYSMEM; + if (sub_resource->resource->map_binding == WINED3D_LOCATION_BUFFER && !wined3d_texture_use_pbo(texture, gl_info)) + sub_resource->resource->map_binding = surface->dib.DIBsection ? WINED3D_LOCATION_DIB : WINED3D_LOCATION_SYSMEM; - surface_validate_location(surface, valid_location); + wined3d_texture_validate_location(texture, 0, valid_location); return WINED3D_OK; } @@ -822,6 +960,21 @@ *buffer_object, texture, sub_resource_idx); } +static void wined3d_texture_force_reload(struct wined3d_texture *texture) +{ + unsigned int sub_count = texture->level_count * texture->layer_count; + unsigned int i; + + texture->flags &= ~(WINED3D_TEXTURE_RGB_ALLOCATED | WINED3D_TEXTURE_SRGB_ALLOCATED + | WINED3D_TEXTURE_CONVERTED); + texture->async.flags &= ~WINED3D_TEXTURE_ASYNC_COLOR_KEY; + for (i = 0; i < sub_count; ++i) + { + wined3d_texture_invalidate_location(texture, i, + WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB); + } +} + void wined3d_texture_prepare_texture(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) { DWORD alloc_flag = srgb ? WINED3D_TEXTURE_SRGB_ALLOCATED : WINED3D_TEXTURE_RGB_ALLOCATED; @@ -844,21 +997,6 @@ texture->flags |= alloc_flag; } -void wined3d_texture_force_reload(struct wined3d_texture *texture) -{ - unsigned int sub_count = texture->level_count * texture->layer_count; - unsigned int i; - - texture->flags &= ~(WINED3D_TEXTURE_RGB_ALLOCATED | WINED3D_TEXTURE_SRGB_ALLOCATED - | WINED3D_TEXTURE_CONVERTED); - texture->async.flags &= ~WINED3D_TEXTURE_ASYNC_COLOR_KEY; - for (i = 0; i < sub_count; ++i) - { - texture->texture_ops->texture_sub_resource_invalidate_location(texture->sub_resources[i].resource, - WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB); - } -} - void CDECL wined3d_texture_generate_mipmaps(struct wined3d_texture *texture) { /* TODO: Implement filters using GL_SGI_generate_mipmaps. */ @@ -907,7 +1045,7 @@ context_release(context); return E_OUTOFMEMORY; } - texture->texture_ops->texture_sub_resource_invalidate_location(sub_resource, ~sub_resource->map_binding); + wined3d_texture_invalidate_location(texture, sub_resource_idx, ~sub_resource->map_binding); context_release(context); return WINED3D_OK; @@ -939,8 +1077,8 @@ struct wined3d_resource *sub_resource = texture->sub_resources[i].resource; texture->texture_ops->texture_sub_resource_upload_data(sub_resource, context, &data[i]); - texture->texture_ops->texture_sub_resource_validate_location(sub_resource, WINED3D_LOCATION_TEXTURE_RGB); - texture->texture_ops->texture_sub_resource_invalidate_location(sub_resource, ~WINED3D_LOCATION_TEXTURE_RGB); + wined3d_texture_validate_location(texture, i, WINED3D_LOCATION_TEXTURE_RGB); + wined3d_texture_invalidate_location(texture, i, ~WINED3D_LOCATION_TEXTURE_RGB); } context_release(context); @@ -954,20 +1092,6 @@ surface_load(surface_from_resource(sub_resource), context, srgb); } -static void texture2d_sub_resource_invalidate_location(struct wined3d_resource *sub_resource, DWORD location) -{ - struct wined3d_surface *surface = surface_from_resource(sub_resource); - - surface_invalidate_location(surface, location); -} - -static void texture2d_sub_resource_validate_location(struct wined3d_resource *sub_resource, DWORD location) -{ - struct wined3d_surface *surface = surface_from_resource(sub_resource); - - surface_validate_location(surface, location); -} - static void texture2d_sub_resource_upload_data(struct wined3d_resource *sub_resource, const struct wined3d_context *context, const struct wined3d_sub_resource_data *data) { @@ -1079,8 +1203,6 @@ static const struct wined3d_texture_ops texture2d_ops = { texture2d_sub_resource_load, - texture2d_sub_resource_invalidate_location, - texture2d_sub_resource_validate_location, texture2d_sub_resource_upload_data, texture2d_load_location, texture2d_prepare_location, @@ -1137,6 +1259,7 @@ struct wined3d_context *context = NULL; struct wined3d_resource *sub_resource; struct wined3d_texture *texture; + struct wined3d_bo_address data; unsigned int texture_level; BYTE *base_memory; BOOL ret; @@ -1192,7 +1315,7 @@ wined3d_debug_location(sub_resource->map_binding)); if ((ret = texture->texture_ops->texture_prepare_location(texture, sub_resource_idx, context, sub_resource->map_binding))) - texture->texture_ops->texture_sub_resource_validate_location(sub_resource, sub_resource->map_binding); + wined3d_texture_validate_location(texture, sub_resource_idx, sub_resource->map_binding); } else { @@ -1210,50 +1333,33 @@ } if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) - texture->texture_ops->texture_sub_resource_invalidate_location(sub_resource, ~sub_resource->map_binding); + wined3d_texture_invalidate_location(texture, sub_resource_idx, ~sub_resource->map_binding); - switch (sub_resource->map_binding) + wined3d_texture_get_memory(texture, sub_resource_idx, &data, sub_resource->map_binding); + if (!data.buffer_object) { - case WINED3D_LOCATION_SYSMEM: - base_memory = sub_resource->heap_memory; - break; - - case WINED3D_LOCATION_USER_MEMORY: - base_memory = texture->user_memory; - break; - - case WINED3D_LOCATION_DIB: - if (resource->type != WINED3D_RTYPE_TEXTURE_2D) - ERR("Invalid map binding %#x for resource type %#x.\n", - sub_resource->map_binding, resource->type); - base_memory = texture->sub_resources[sub_resource_idx].u.surface->dib.bitmap_data; - break; - - case WINED3D_LOCATION_BUFFER: - GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, - texture->sub_resources[sub_resource_idx].buffer_object)); - - if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) - { - GLbitfield map_flags = wined3d_resource_gl_map_flags(flags); - map_flags &= ~GL_MAP_FLUSH_EXPLICIT_BIT; - base_memory = GL_EXTCALL(glMapBufferRange(GL_PIXEL_UNPACK_BUFFER, - 0, sub_resource->size, map_flags)); - } - else - { - GLenum access = wined3d_resource_gl_legacy_map_flags(flags); - base_memory = GL_EXTCALL(glMapBuffer(GL_PIXEL_UNPACK_BUFFER, access)); - } + base_memory = data.addr; + } + else + { + GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, data.buffer_object)); - GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); - checkGLcall("Map PBO"); - break; + if (gl_info->supported[ARB_MAP_BUFFER_RANGE]) + { + GLbitfield map_flags = wined3d_resource_gl_map_flags(flags); + map_flags &= ~GL_MAP_FLUSH_EXPLICIT_BIT; + base_memory = GL_EXTCALL(glMapBufferRange(GL_PIXEL_UNPACK_BUFFER, + (INT_PTR)data.addr, sub_resource->size, map_flags)); + } + else + { + GLenum access = wined3d_resource_gl_legacy_map_flags(flags); + base_memory = GL_EXTCALL(glMapBuffer(GL_PIXEL_UNPACK_BUFFER, access)); + base_memory += (INT_PTR)data.addr; + } - default: - ERR("Unexpected map binding %s.\n", wined3d_debug_location(sub_resource->map_binding)); - base_memory = NULL; - break; + GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0)); + checkGLcall("Map PBO"); } if (context) @@ -1361,7 +1467,8 @@ { struct wined3d_surface *surface = texture->sub_resources[sub_resource_idx].u.surface; - if (!(surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_TEXTURE_RGB))) + if (!(surface_get_sub_resource(surface)->locations + & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_TEXTURE_RGB))) texture->swapchain->swapchain_ops->swapchain_frontbuffer_updated(texture->swapchain); } else if (resource->format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)) @@ -1403,39 +1510,70 @@ return WINED3DERR_INVALIDCALL; } - /* Non-power2 support. */ - if (gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO]) - { - pow2_width = desc->width; - pow2_height = desc->height; - } - else + pow2_width = desc->width; + pow2_height = desc->height; + if (((desc->width & (desc->width - 1)) || (desc->height & (desc->height - 1))) + && !gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO]) { - /* Find the nearest pow2 match. */ - pow2_width = pow2_height = 1; - while (pow2_width < desc->width) - pow2_width <<= 1; - while (pow2_height < desc->height) - pow2_height <<= 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("Attempted to create a mipmapped/cube NPOT texture without unconditional NPOT support.\n"); + return WINED3DERR_INVALIDCALL; + } + + WARN("Creating a scratch mipmapped/cube NPOT texture despite lack of HW support.\n"); + } + texture->flags |= WINED3D_TEXTURE_COND_NP2; - if (pow2_width != desc->width || pow2_height != desc->height) + if (!gl_info->supported[ARB_TEXTURE_RECTANGLE] && !gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT]) { - /* level_count == 0 returns an error as well */ - if (level_count != 1 || desc->usage & WINED3DUSAGE_LEGACY_CUBEMAP) + const struct wined3d_format *format = wined3d_get_format(gl_info, desc->format); + + /* TODO: Add support for non-power-of-two compressed textures. */ + if (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] + & (WINED3DFMT_FLAG_COMPRESSED | WINED3DFMT_FLAG_HEIGHT_SCALE)) { - if (desc->pool == WINED3D_POOL_SCRATCH) - { - WARN("Creating a scratch mipmapped/cube NPOT texture despite lack of HW support.\n"); - } - else - { - WARN("Attempted to create a mipmapped/cube NPOT texture without unconditional NPOT support.\n"); - return WINED3DERR_INVALIDCALL; - } + FIXME("Compressed or height scaled non-power-of-two (%ux%u) textures are not supported.\n", + desc->width, desc->height); + return WINED3DERR_NOTAVAILABLE; } + + /* Find the nearest pow2 match. */ + pow2_width = pow2_height = 1; + while (pow2_width < desc->width) + pow2_width <<= 1; + while (pow2_height < desc->height) + pow2_height <<= 1; + texture->flags |= WINED3D_TEXTURE_COND_NP2_EMULATED; } } + if ((pow2_width > gl_info->limits.texture_size || pow2_height > gl_info->limits.texture_size) + && (desc->usage & WINED3DUSAGE_TEXTURE)) + { + /* One of four options: + * 1: Do the same as we do with NPOT and scale the texture. (Any + * texture ops would require the texture to be scaled which is + * potentially slow.) + * 2: Set the texture to the maximum size (bad idea). + * 3: WARN and return WINED3DERR_NOTAVAILABLE. + * 4: Create the surface, but allow it to be used only for DirectDraw + * Blts. Some apps (e.g. Swat 3) create textures with a height of + * 16 and a width > 3000 and blt 16x16 letter areas from them to + * the render target. */ + if (desc->pool == WINED3D_POOL_DEFAULT || desc->pool == WINED3D_POOL_MANAGED) + { + WARN("Dimensions (%ux%u) exceed the maximum texture size.\n", pow2_width, pow2_height); + return WINED3DERR_NOTAVAILABLE; + } + + /* We should never use this surface in combination with OpenGL. */ + TRACE("Creating an oversized (%ux%u) surface.\n", pow2_width, pow2_height); + } + /* Calculate levels for mip mapping. */ if (desc->usage & WINED3DUSAGE_AUTOGENMIPMAP) { @@ -1464,40 +1602,30 @@ { texture->pow2_matrix[0] = (float)desc->width; texture->pow2_matrix[5] = (float)desc->height; - texture->pow2_matrix[10] = 1.0f; - texture->pow2_matrix[15] = 1.0f; - texture->target = GL_TEXTURE_RECTANGLE_ARB; - texture->flags |= WINED3D_TEXTURE_COND_NP2; texture->flags &= ~(WINED3D_TEXTURE_POW2_MAT_IDENT | WINED3D_TEXTURE_NORMALIZED_COORDS); + texture->target = GL_TEXTURE_RECTANGLE_ARB; } else { - 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) + if (texture->flags & WINED3D_TEXTURE_COND_NP2_EMULATED) { - texture->pow2_matrix[0] = 1.0f; - texture->pow2_matrix[5] = 1.0f; + texture->pow2_matrix[0] = (((float)desc->width) / ((float)pow2_width)); + texture->pow2_matrix[5] = (((float)desc->height) / ((float)pow2_height)); + texture->flags &= ~WINED3D_TEXTURE_POW2_MAT_IDENT; } - else if (gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT]) + else { texture->pow2_matrix[0] = 1.0f; texture->pow2_matrix[5] = 1.0f; - texture->flags |= WINED3D_TEXTURE_COND_NP2; } + if (desc->usage & WINED3DUSAGE_LEGACY_CUBEMAP) + texture->target = GL_TEXTURE_CUBE_MAP_ARB; else - { - texture->pow2_matrix[0] = (((float)desc->width) / ((float)pow2_width)); - texture->pow2_matrix[5] = (((float)desc->height) / ((float)pow2_height)); - texture->flags &= ~WINED3D_TEXTURE_POW2_MAT_IDENT; - texture->flags |= WINED3D_TEXTURE_COND_NP2_EMULATED; - } - texture->pow2_matrix[10] = 1.0f; - texture->pow2_matrix[15] = 1.0f; + texture->target = GL_TEXTURE_2D; } - TRACE("xf(%f) yf(%f)\n", texture->pow2_matrix[0], texture->pow2_matrix[5]); + texture->pow2_matrix[10] = 1.0f; + texture->pow2_matrix[15] = 1.0f; + TRACE("x scale %.8e, y scale %.8e.\n", texture->pow2_matrix[0], texture->pow2_matrix[5]); if (!(surfaces = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*surfaces) * level_count * layer_count))) { @@ -1566,20 +1694,6 @@ wined3d_volume_load(volume_from_resource(sub_resource), context, srgb); } -static void texture3d_sub_resource_invalidate_location(struct wined3d_resource *sub_resource, DWORD location) -{ - struct wined3d_volume *volume = volume_from_resource(sub_resource); - - wined3d_volume_invalidate_location(volume, location); -} - -static void texture3d_sub_resource_validate_location(struct wined3d_resource *sub_resource, DWORD location) -{ - struct wined3d_volume *volume = volume_from_resource(sub_resource); - - wined3d_volume_validate_location(volume, location); -} - static void texture3d_sub_resource_upload_data(struct wined3d_resource *sub_resource, const struct wined3d_context *context, const struct wined3d_sub_resource_data *data) { @@ -1652,8 +1766,6 @@ static const struct wined3d_texture_ops texture3d_ops = { texture3d_sub_resource_load, - texture3d_sub_resource_invalidate_location, - texture3d_sub_resource_validate_location, texture3d_sub_resource_upload_data, texture3d_load_location, texture3d_prepare_location, @@ -2158,7 +2270,7 @@ } surface_load_location(surface, context, WINED3D_LOCATION_DIB); - surface_invalidate_location(surface, ~WINED3D_LOCATION_DIB); + wined3d_texture_invalidate_location(texture, sub_resource_idx, ~WINED3D_LOCATION_DIB); if (context) context_release(context); @@ -2221,7 +2333,7 @@ context = context_acquire(device, NULL); surface_load_location(surface, context, surface->resource.map_binding); - surface_invalidate_location(surface, WINED3D_LOCATION_DIB); + wined3d_texture_invalidate_location(texture, sub_resource_idx, WINED3D_LOCATION_DIB); if (context) context_release(context); } diff -Nru wine-staging-1.9.6/dlls/wined3d/utils.c wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/utils.c --- wine-staging-1.9.6/dlls/wined3d/utils.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/utils.c 2016-04-04 18:06:32.000000000 +0000 @@ -995,30 +995,46 @@ * Macs, so probably the endianness differs. This could be tested as soon as we have a Windows and MacOS on a big * endian machine */ + {WINED3DFMT_UYVY, GL_RG8, GL_RG8, 0, + GL_RG, GL_UNSIGNED_BYTE, 0, + WINED3DFMT_FLAG_FILTERING, + ARB_TEXTURE_RG, NULL}, {WINED3DFMT_UYVY, GL_LUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 0, WINED3DFMT_FLAG_FILTERING, - WINED3D_GL_EXT_NONE, NULL}, + WINED3D_GL_LEGACY_CONTEXT, NULL}, {WINED3DFMT_UYVY, GL_RGB, GL_RGB, 0, GL_YCBCR_422_APPLE, GL_UNSIGNED_SHORT_8_8_APPLE, 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_FILTERING, APPLE_YCBCR_422, NULL}, + {WINED3DFMT_YUY2, GL_RG8, GL_RG8, 0, + GL_RG, GL_UNSIGNED_BYTE, 0, + WINED3DFMT_FLAG_FILTERING, + ARB_TEXTURE_RG, NULL}, {WINED3DFMT_YUY2, GL_LUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 0, WINED3DFMT_FLAG_FILTERING, - WINED3D_GL_EXT_NONE, NULL}, + WINED3D_GL_LEGACY_CONTEXT, NULL}, {WINED3DFMT_YUY2, GL_RGB, GL_RGB, 0, GL_YCBCR_422_APPLE, GL_UNSIGNED_SHORT_8_8_REV_APPLE, 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_FILTERING, APPLE_YCBCR_422, NULL}, + {WINED3DFMT_YV12, GL_R8, GL_R8, 0, + GL_RED, GL_UNSIGNED_BYTE, 0, + WINED3DFMT_FLAG_FILTERING, + ARB_TEXTURE_RG, NULL}, {WINED3DFMT_YV12, GL_ALPHA, GL_ALPHA, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0, WINED3DFMT_FLAG_FILTERING, - WINED3D_GL_EXT_NONE, NULL}, + WINED3D_GL_LEGACY_CONTEXT, NULL}, + {WINED3DFMT_NV12, GL_R8, GL_R8, 0, + GL_RED, GL_UNSIGNED_BYTE, 0, + WINED3DFMT_FLAG_FILTERING, + ARB_TEXTURE_RG, NULL}, {WINED3DFMT_NV12, GL_ALPHA, GL_ALPHA, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0, WINED3DFMT_FLAG_FILTERING, - WINED3D_GL_EXT_NONE, NULL}, + WINED3D_GL_LEGACY_CONTEXT, NULL}, {WINED3DFMT_DXT1, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING @@ -1121,10 +1137,14 @@ WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_RENDERTARGET, EXT_PACKED_FLOAT}, /* Palettized formats */ + {WINED3DFMT_P8_UINT, GL_R8, GL_R8, 0, + GL_RED, GL_UNSIGNED_BYTE, 0, + 0, + ARB_TEXTURE_RG, NULL}, {WINED3DFMT_P8_UINT, GL_ALPHA8, GL_ALPHA8, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0, 0, - 0, NULL}, + WINED3D_GL_LEGACY_CONTEXT, NULL}, /* Standard ARGB formats */ {WINED3DFMT_B8G8R8_UNORM, GL_RGB8, GL_RGB8, 0, GL_BGR, GL_UNSIGNED_BYTE, 0, @@ -1174,10 +1194,14 @@ WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_VTF, ARB_TEXTURE_RG, NULL}, + {WINED3DFMT_A8_UNORM, GL_R8, GL_R8, 0, + GL_RED, GL_UNSIGNED_BYTE, 0, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + ARB_TEXTURE_RG, NULL}, {WINED3DFMT_A8_UNORM, GL_ALPHA8, GL_ALPHA8, 0, GL_ALPHA, GL_UNSIGNED_BYTE, 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, - WINED3D_GL_EXT_NONE, NULL}, + WINED3D_GL_LEGACY_CONTEXT, NULL}, {WINED3DFMT_B4G4R4X4_UNORM, GL_RGB4, GL_RGB4, 0, GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV, 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, @@ -1242,16 +1266,37 @@ GL_LUMINANCE, GL_UNSIGNED_BYTE, 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_SRGB_READ, - WINED3D_GL_EXT_NONE, NULL}, + WINED3D_GL_LEGACY_CONTEXT, NULL}, + {WINED3DFMT_L8_UNORM, GL_R8, GL_R8, 0, + GL_RED, GL_UNSIGNED_BYTE, 0, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING + | WINED3DFMT_FLAG_RENDERTARGET, + ARB_TEXTURE_RG, NULL}, + {WINED3DFMT_L8A8_UNORM, GL_RG8, GL_RG8, 0, + GL_RG, GL_UNSIGNED_BYTE, 0, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + ARB_TEXTURE_RG, NULL}, {WINED3DFMT_L8A8_UNORM, GL_LUMINANCE8_ALPHA8, GL_SLUMINANCE8_ALPHA8_EXT, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_SRGB_READ, - WINED3D_GL_EXT_NONE, NULL}, + WINED3D_GL_LEGACY_CONTEXT, NULL}, + {WINED3DFMT_L4A4_UNORM, GL_RG8, GL_RG8, 0, + GL_RG, GL_UNSIGNED_BYTE, 2, + WINED3DFMT_FLAG_FILTERING, + ARB_TEXTURE_RG, convert_l4a4_unorm}, {WINED3DFMT_L4A4_UNORM, GL_LUMINANCE4_ALPHA4, GL_LUMINANCE4_ALPHA4, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 2, WINED3DFMT_FLAG_FILTERING, - WINED3D_GL_EXT_NONE, convert_l4a4_unorm}, + WINED3D_GL_LEGACY_CONTEXT, convert_l4a4_unorm}, + {WINED3DFMT_L16_UNORM, GL_R16, GL_R16, 0, + GL_RED, GL_UNSIGNED_SHORT, 0, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + ARB_TEXTURE_RG, NULL}, + {WINED3DFMT_L16_UNORM, GL_LUMINANCE16, GL_LUMINANCE16, 0, + GL_LUMINANCE, GL_UNSIGNED_SHORT, 0, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, + WINED3D_GL_LEGACY_CONTEXT, NULL}, /* Bump mapping stuff */ {WINED3DFMT_R8G8_SNORM, GL_RGB8, GL_RGB8, 0, GL_BGR, GL_UNSIGNED_BYTE, 3, @@ -1397,10 +1442,6 @@ WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_SHADOW, ARB_DEPTH_TEXTURE, NULL}, - {WINED3DFMT_L16_UNORM, GL_LUMINANCE16, GL_LUMINANCE16, 0, - GL_LUMINANCE, GL_UNSIGNED_SHORT, 0, - WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, - WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_D32_FLOAT, GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT32F, 0, GL_DEPTH_COMPONENT, GL_FLOAT, 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_SHADOW, @@ -2878,11 +2919,30 @@ if (!gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) { + idx = get_format_idx(WINED3DFMT_A8_UNORM); + gl_info->formats[idx].color_fixup = create_color_fixup_desc( + 0, CHANNEL_SOURCE_ZERO, 0, CHANNEL_SOURCE_ZERO, 0, CHANNEL_SOURCE_ZERO, 0, CHANNEL_SOURCE_X); + idx = get_format_idx(WINED3DFMT_L8A8_UNORM); + gl_info->formats[idx].color_fixup = create_color_fixup_desc( + 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_Y); + idx = get_format_idx(WINED3DFMT_L4A4_UNORM); + gl_info->formats[idx].color_fixup = create_color_fixup_desc( + 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_Y); + idx = get_format_idx(WINED3DFMT_L16_UNORM); + gl_info->formats[idx].color_fixup = create_color_fixup_desc( + 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_ONE); idx = get_format_idx(WINED3DFMT_INTZ); gl_info->formats[idx].color_fixup = create_color_fixup_desc( 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_X); } + if (gl_info->supported[ARB_TEXTURE_RG]) + { + idx = get_format_idx(WINED3DFMT_L8_UNORM); + gl_info->formats[idx].color_fixup = create_color_fixup_desc( + 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_ONE); + } + if (gl_info->supported[ARB_FRAGMENT_PROGRAM]) { idx = get_format_idx(WINED3DFMT_P8_UINT); @@ -3894,7 +3954,7 @@ } } -static const char *debug_shader_type(enum wined3d_shader_type type) +const char *debug_shader_type(enum wined3d_shader_type type) { switch(type) { @@ -3902,6 +3962,8 @@ WINED3D_TO_STR(WINED3D_SHADER_TYPE_PIXEL); WINED3D_TO_STR(WINED3D_SHADER_TYPE_VERTEX); WINED3D_TO_STR(WINED3D_SHADER_TYPE_GEOMETRY); + WINED3D_TO_STR(WINED3D_SHADER_TYPE_HULL); + WINED3D_TO_STR(WINED3D_SHADER_TYPE_DOMAIN); #undef WINED3D_TO_STR default: FIXME("Unrecognized shader type %#x.\n", type); @@ -4785,7 +4847,10 @@ if ((texture = state->textures[i])) { - settings->op[i].color_fixup = texture->resource.format->color_fixup; + if (can_use_texture_swizzle(gl_info, texture->resource.format)) + settings->op[i].color_fixup = COLOR_FIXUP_IDENTITY; + else + settings->op[i].color_fixup = texture->resource.format->color_fixup; if (ignore_textype) { settings->op[i].tex_type = WINED3D_GL_RES_TYPE_TEX_1D; diff -Nru wine-staging-1.9.6/dlls/wined3d/view.c wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/view.c --- wine-staging-1.9.6/dlls/wined3d/view.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/view.c 2016-04-04 18:06:32.000000000 +0000 @@ -60,18 +60,16 @@ void * CDECL wined3d_rendertarget_view_get_sub_resource_parent(const struct wined3d_rendertarget_view *view) { - struct wined3d_resource *sub_resource; + struct wined3d_texture *texture; TRACE("view %p.\n", view); if (view->resource->type == WINED3D_RTYPE_BUFFER) return wined3d_buffer_get_parent(buffer_from_resource(view->resource)); - if (!(sub_resource = wined3d_texture_get_sub_resource(wined3d_texture_from_resource(view->resource), - view->sub_resource_idx))) - return NULL; + texture = wined3d_texture_from_resource(view->resource); - return wined3d_resource_get_parent(sub_resource); + return wined3d_resource_get_parent(texture->sub_resources[view->sub_resource_idx].resource); } void CDECL wined3d_rendertarget_view_set_parent(struct wined3d_rendertarget_view *view, void *parent) @@ -88,15 +86,13 @@ return view->resource; } -static void wined3d_rendertarget_view_init(struct wined3d_rendertarget_view *view, +static HRESULT wined3d_rendertarget_view_init(struct wined3d_rendertarget_view *view, const struct wined3d_rendertarget_view_desc *desc, struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops) { const struct wined3d_gl_info *gl_info = &resource->device->adapter->gl_info; view->refcount = 1; - view->resource = resource; - wined3d_resource_incref(resource); view->parent = parent; view->parent_ops = parent_ops; @@ -113,16 +109,20 @@ else { struct wined3d_texture *texture = wined3d_texture_from_resource(resource); - struct wined3d_resource *sub_resource; + if (desc->u.texture.level_idx >= texture->level_count + || desc->u.texture.layer_idx >= texture->layer_count + || desc->u.texture.layer_count > texture->layer_count - desc->u.texture.layer_idx) + return WINED3DERR_INVALIDCALL; view->sub_resource_idx = desc->u.texture.layer_idx * texture->level_count + desc->u.texture.level_idx; - sub_resource = wined3d_texture_get_sub_resource(texture, view->sub_resource_idx); - view->buffer_offset = 0; - view->width = sub_resource->width; - view->height = sub_resource->height; + view->width = wined3d_texture_get_level_width(texture, desc->u.texture.level_idx); + view->height = wined3d_texture_get_level_height(texture, desc->u.texture.level_idx); view->depth = desc->u.texture.layer_count; } + wined3d_resource_incref(view->resource = resource); + + return WINED3D_OK; } HRESULT CDECL wined3d_rendertarget_view_create(const struct wined3d_rendertarget_view_desc *desc, @@ -130,6 +130,7 @@ struct wined3d_rendertarget_view **view) { struct wined3d_rendertarget_view *object; + HRESULT hr; TRACE("desc %p, resource %p, parent %p, parent_ops %p, view %p.\n", desc, resource, parent, parent_ops, view); @@ -137,12 +138,17 @@ if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) return E_OUTOFMEMORY; - wined3d_rendertarget_view_init(object, desc, resource, parent, parent_ops); + if (FAILED(hr = wined3d_rendertarget_view_init(object, desc, resource, parent, parent_ops))) + { + HeapFree(GetProcessHeap(), 0, object); + WARN("Failed to initialise view, hr %#x.\n", hr); + return hr; + } TRACE("Created render target view %p.\n", object); *view = object; - return WINED3D_OK; + return hr; } HRESULT CDECL wined3d_rendertarget_view_create_from_sub_resource(struct wined3d_texture *texture, diff -Nru wine-staging-1.9.6/dlls/wined3d/volume.c wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/volume.c --- wine-staging-1.9.6/dlls/wined3d/volume.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/volume.c 2016-04-04 18:06:32.000000000 +0000 @@ -24,7 +24,7 @@ #include "wine/port.h" #include "wined3d_private.h" -WINE_DEFAULT_DEBUG_CHANNEL(d3d_surface); +WINE_DEFAULT_DEBUG_CHANNEL(d3d); WINE_DECLARE_DEBUG_CHANNEL(d3d_perf); static BOOL volume_prepare_system_memory(struct wined3d_volume *volume) @@ -77,7 +77,8 @@ const struct wined3d_const_bo_address *data) { const struct wined3d_gl_info *gl_info = context->gl_info; - const struct wined3d_format *format = volume->resource.format; + struct wined3d_texture *texture = volume->container; + const struct wined3d_format *format = texture->resource.format; UINT width = volume->resource.width; UINT height = volume->resource.height; UINT depth = volume->resource.depth; @@ -95,13 +96,13 @@ if (data->buffer_object) ERR("Loading a converted volume from a PBO.\n"); - if (volume->container->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) + if (texture->resource.format_flags & WINED3DFMT_FLAG_BLOCKS) ERR("Converting a block-based format.\n"); dst_row_pitch = width * format->conv_byte_count; dst_slice_pitch = dst_row_pitch * height; - wined3d_texture_get_pitch(volume->container, volume->texture_level, &src_row_pitch, &src_slice_pitch); + wined3d_texture_get_pitch(texture, volume->texture_level, &src_row_pitch, &src_slice_pitch); converted_mem = HeapAlloc(GetProcessHeap(), 0, dst_slice_pitch * depth); format->convert(data->addr, converted_mem, src_row_pitch, src_slice_pitch, @@ -129,30 +130,12 @@ HeapFree(GetProcessHeap(), 0, converted_mem); } -void wined3d_volume_validate_location(struct wined3d_volume *volume, DWORD location) -{ - TRACE("Volume %p, setting %s.\n", volume, wined3d_debug_location(location)); - volume->locations |= location; - TRACE("new location flags are %s.\n", wined3d_debug_location(volume->locations)); -} - -void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location) -{ - TRACE("Volume %p, clearing %s.\n", volume, wined3d_debug_location(location)); - - if (location & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) - wined3d_texture_set_dirty(volume->container); - volume->locations &= ~location; - - TRACE("new location flags are %s.\n", wined3d_debug_location(volume->locations)); -} - /* Context activation is done by the caller. */ static void wined3d_volume_download_data(struct wined3d_volume *volume, const struct wined3d_context *context, const struct wined3d_bo_address *data) { + const struct wined3d_format *format = volume->container->resource.format; const struct wined3d_gl_info *gl_info = context->gl_info; - const struct wined3d_format *format = volume->resource.format; if (format->convert) { @@ -182,7 +165,7 @@ static void wined3d_volume_evict_sysmem(struct wined3d_volume *volume) { wined3d_resource_free_sysmem(&volume->resource); - wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_SYSMEM); + wined3d_texture_invalidate_location(volume->container, volume->texture_level, WINED3D_LOCATION_SYSMEM); } static DWORD volume_access_from_location(DWORD location) @@ -251,31 +234,35 @@ struct wined3d_context *context, DWORD location) { DWORD required_access = volume_access_from_location(location); + unsigned int sub_resource_idx = volume->texture_level; struct wined3d_texture *texture = volume->container; + struct wined3d_texture_sub_resource *sub_resource; + sub_resource = &texture->sub_resources[sub_resource_idx]; TRACE("Volume %p, loading %s, have %s.\n", volume, wined3d_debug_location(location), - wined3d_debug_location(volume->locations)); + wined3d_debug_location(sub_resource->locations)); - if ((volume->locations & location) == location) + if ((sub_resource->locations & location) == location) { TRACE("Location(s) already up to date.\n"); return TRUE; } - if ((volume->resource.access_flags & required_access) != required_access) + if ((texture->resource.access_flags & required_access) != required_access) { ERR("Operation requires %#x access, but volume only has %#x.\n", - required_access, volume->resource.access_flags); + required_access, texture->resource.access_flags); return FALSE; } if (!wined3d_volume_prepare_location(volume, context, location)) return FALSE; - if (volume->locations & WINED3D_LOCATION_DISCARDED) + if (sub_resource->locations & WINED3D_LOCATION_DISCARDED) { TRACE("Volume previously discarded, nothing to do.\n"); - wined3d_volume_invalidate_location(volume, WINED3D_LOCATION_DISCARDED); + wined3d_texture_validate_location(texture, sub_resource_idx, location); + wined3d_texture_invalidate_location(texture, sub_resource_idx, WINED3D_LOCATION_DISCARDED); goto done; } @@ -283,45 +270,41 @@ { case WINED3D_LOCATION_TEXTURE_RGB: case WINED3D_LOCATION_TEXTURE_SRGB: - if (volume->locations & WINED3D_LOCATION_SYSMEM) + if (sub_resource->locations & WINED3D_LOCATION_SYSMEM) { struct wined3d_const_bo_address data = {0, volume->resource.heap_memory}; wined3d_texture_bind_and_dirtify(texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB); wined3d_volume_upload_data(volume, context, &data); } - else if (volume->locations & WINED3D_LOCATION_BUFFER) + else if (sub_resource->locations & WINED3D_LOCATION_BUFFER) { - struct wined3d_const_bo_address data = - { - texture->sub_resources[volume->texture_level].buffer_object, - NULL - }; + struct wined3d_const_bo_address data = {sub_resource->buffer_object, NULL}; wined3d_texture_bind_and_dirtify(texture, context, location == WINED3D_LOCATION_TEXTURE_SRGB); wined3d_volume_upload_data(volume, context, &data); } - else if (volume->locations & WINED3D_LOCATION_TEXTURE_RGB) + else if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB) { wined3d_volume_srgb_transfer(volume, context, TRUE); } - else if (volume->locations & WINED3D_LOCATION_TEXTURE_SRGB) + else if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_SRGB) { wined3d_volume_srgb_transfer(volume, context, FALSE); } else { - FIXME("Implement texture loading from %s.\n", wined3d_debug_location(volume->locations)); + FIXME("Implement texture loading from %s.\n", wined3d_debug_location(sub_resource->locations)); return FALSE; } break; case WINED3D_LOCATION_SYSMEM: - if (volume->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) + if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) { struct wined3d_bo_address data = {0, volume->resource.heap_memory}; - if (volume->locations & WINED3D_LOCATION_TEXTURE_RGB) + if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB) wined3d_texture_bind_and_dirtify(texture, context, FALSE); else wined3d_texture_bind_and_dirtify(texture, context, TRUE); @@ -332,21 +315,17 @@ else { FIXME("Implement WINED3D_LOCATION_SYSMEM loading from %s.\n", - wined3d_debug_location(volume->locations)); + wined3d_debug_location(sub_resource->locations)); return FALSE; } break; case WINED3D_LOCATION_BUFFER: - if (volume->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) + if (sub_resource->locations & (WINED3D_LOCATION_TEXTURE_RGB | WINED3D_LOCATION_TEXTURE_SRGB)) { - struct wined3d_bo_address data = - { - texture->sub_resources[volume->texture_level].buffer_object, - NULL - }; + struct wined3d_bo_address data = {sub_resource->buffer_object, NULL}; - if (volume->locations & WINED3D_LOCATION_TEXTURE_RGB) + if (sub_resource->locations & WINED3D_LOCATION_TEXTURE_RGB) wined3d_texture_bind_and_dirtify(texture, context, FALSE); else wined3d_texture_bind_and_dirtify(texture, context, TRUE); @@ -356,19 +335,19 @@ else { FIXME("Implement WINED3D_LOCATION_BUFFER loading from %s.\n", - wined3d_debug_location(volume->locations)); + wined3d_debug_location(sub_resource->locations)); return FALSE; } break; default: FIXME("Implement %s loading from %s.\n", wined3d_debug_location(location), - wined3d_debug_location(volume->locations)); + wined3d_debug_location(sub_resource->locations)); return FALSE; } done: - wined3d_volume_validate_location(volume, location); + wined3d_texture_validate_location(texture, sub_resource_idx, location); if (location != WINED3D_LOCATION_SYSMEM && wined3d_volume_can_evict(volume)) wined3d_volume_evict_sysmem(volume); @@ -394,10 +373,11 @@ static void volume_unload(struct wined3d_resource *resource) { struct wined3d_volume *volume = volume_from_resource(resource); - struct wined3d_device *device = volume->resource.device; + struct wined3d_texture *texture = volume->container; + struct wined3d_device *device = texture->resource.device; struct wined3d_context *context; - if (volume->resource.pool == WINED3D_POOL_DEFAULT) + if (texture->resource.pool == WINED3D_POOL_DEFAULT) ERR("Unloading DEFAULT pool volume.\n"); TRACE("texture %p.\n", resource); @@ -405,13 +385,13 @@ context = context_acquire(device, NULL); if (wined3d_volume_load_location(volume, context, WINED3D_LOCATION_SYSMEM)) { - wined3d_volume_invalidate_location(volume, ~WINED3D_LOCATION_SYSMEM); + wined3d_texture_invalidate_location(texture, volume->texture_level, ~WINED3D_LOCATION_SYSMEM); } else { ERR("Out of memory when unloading volume %p.\n", volume); - wined3d_volume_validate_location(volume, WINED3D_LOCATION_DISCARDED); - wined3d_volume_invalidate_location(volume, ~WINED3D_LOCATION_DISCARDED); + wined3d_texture_validate_location(texture, volume->texture_level, WINED3D_LOCATION_DISCARDED); + wined3d_texture_invalidate_location(texture, volume->texture_level, ~WINED3D_LOCATION_DISCARDED); } context_release(context); @@ -487,7 +467,7 @@ } volume->texture_level = level; - volume->locations = WINED3D_LOCATION_DISCARDED; + container->sub_resources[level].locations = WINED3D_LOCATION_DISCARDED; if (wined3d_texture_use_pbo(container, gl_info)) { diff -Nru wine-staging-1.9.6/dlls/wined3d/wined3d_gl.h wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/wined3d_gl.h --- wine-staging-1.9.6/dlls/wined3d/wined3d_gl.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/wined3d_gl.h 2016-04-04 18:06:32.000000000 +0000 @@ -45,6 +45,7 @@ /* ARB */ ARB_BLEND_FUNC_EXTENDED, ARB_COLOR_BUFFER_FLOAT, + ARB_COPY_BUFFER, ARB_DEBUG_OUTPUT, ARB_DEPTH_BUFFER_FLOAT, ARB_DEPTH_TEXTURE, @@ -91,6 +92,7 @@ ARB_TEXTURE_RECTANGLE, ARB_TEXTURE_RG, ARB_TEXTURE_RGB10_A2UI, + ARB_TEXTURE_SWIZZLE, ARB_TIMER_QUERY, ARB_UNIFORM_BUFFER_OBJECT, ARB_VERTEX_ARRAY_BGRA, diff -Nru wine-staging-1.9.6/dlls/wined3d/wined3d_main.c wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/wined3d_main.c --- wine-staging-1.9.6/dlls/wined3d/wined3d_main.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/wined3d_main.c 2016-04-04 18:06:32.000000000 +0000 @@ -85,6 +85,8 @@ TRUE, /* Don't try to render onscreen by default. */ FALSE, /* Don't range check relative addressing indices in float constants. */ ~0U, /* No VS shader model limit by default. */ + ~0U, /* No HS shader model limit by default. */ + ~0U, /* No DS shader model limit by default. */ ~0U, /* No GS shader model limit by default. */ ~0U, /* No PS shader model limit by default. */ FALSE, /* 3D support enabled by default. */ @@ -315,6 +317,10 @@ } if (!get_config_key_dword(hkey, appkey, "MaxShaderModelVS", &wined3d_settings.max_sm_vs)) TRACE("Limiting VS shader model to %u.\n", wined3d_settings.max_sm_vs); + if (!get_config_key_dword(hkey, appkey, "MaxShaderModelHS", &wined3d_settings.max_sm_hs)) + TRACE("Limiting HS shader model to %u.\n", wined3d_settings.max_sm_hs); + if (!get_config_key_dword(hkey, appkey, "MaxShaderModelDS", &wined3d_settings.max_sm_ds)) + TRACE("Limiting DS shader model to %u.\n", wined3d_settings.max_sm_ds); if (!get_config_key_dword(hkey, appkey, "MaxShaderModelGS", &wined3d_settings.max_sm_gs)) TRACE("Limiting GS shader model to %u.\n", wined3d_settings.max_sm_gs); if (!get_config_key_dword(hkey, appkey, "MaxShaderModelPS", &wined3d_settings.max_sm_ps)) diff -Nru wine-staging-1.9.6/dlls/wined3d/wined3d_private.h wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/wined3d_private.h --- wine-staging-1.9.6/dlls/wined3d/wined3d_private.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/wined3d_private.h 2016-04-04 18:06:32.000000000 +0000 @@ -293,6 +293,8 @@ BOOL always_offscreen; BOOL check_float_constants; unsigned int max_sm_vs; + unsigned int max_sm_hs; + unsigned int max_sm_ds; unsigned int max_sm_gs; unsigned int max_sm_ps; BOOL no_3d; @@ -365,6 +367,8 @@ WINED3DSPR_PRIMID, WINED3DSPR_NULL, WINED3DSPR_RESOURCE, + WINED3DSPR_UAV, + WINED3DSPR_FORKINSTID, }; enum wined3d_data_type @@ -373,6 +377,7 @@ WINED3D_DATA_INT, WINED3D_DATA_RESOURCE, WINED3D_DATA_SAMPLER, + WINED3D_DATA_UAV, WINED3D_DATA_UINT, WINED3D_DATA_UNORM, WINED3D_DATA_SNORM, @@ -435,6 +440,29 @@ WINED3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS = 0x8, }; +enum wined3d_tessellator_domain +{ + WINED3D_TESSELLATOR_DOMAIN_LINE = 1, + WINED3D_TESSELLATOR_DOMAIN_TRIANGLE = 2, + WINED3D_TESSELLATOR_DOMAIN_QUAD = 3, +}; + +enum wined3d_tessellator_output_primitive +{ + WINED3D_TESSELLATOR_OUTPUT_POINT = 1, + WINED3D_TESSELLATOR_OUTPUT_LINE = 2, + WINED3D_TESSELLATOR_OUTPUT_TRIANGLE_CW = 3, + WINED3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW = 4, +}; + +enum wined3d_tessellator_partitioning +{ + WINED3D_TESSELLATOR_PARTITIONING_INTEGER = 1, + WINED3D_TESSELLATOR_PARTITIONING_POW2 = 2, + WINED3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD = 3, + WINED3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN = 4, +}; + /* Undocumented opcode control to identify projective texture lookups in ps 2.0 and later */ #define WINED3DSI_TEXLD_PROJECT 0x1 #define WINED3DSI_TEXLD_BIAS 0x2 @@ -458,6 +486,8 @@ #define WINED3D_SM4_PS 0x0000u #define WINED3D_SM4_VS 0x0001u #define WINED3D_SM4_GS 0x0002u +#define WINED3D_SM5_HS 0x0003u +#define WINED3D_SM5_DS 0x0004u /* Shader version tokens, and shader end tokens */ #define WINED3DPS_VERSION(major, minor) ((WINED3D_SM1_PS << 16) | ((major) << 8) | (minor)) @@ -508,8 +538,11 @@ WINED3DSIH_DCL, WINED3DSIH_DCL_CONSTANT_BUFFER, WINED3DSIH_DCL_GLOBAL_FLAGS, + WINED3DSIH_DCL_HS_FORK_PHASE_INSTANCE_COUNT, + WINED3DSIH_DCL_HS_MAX_TESSFACTOR, WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER, WINED3DSIH_DCL_INPUT, + WINED3DSIH_DCL_INPUT_CONTROL_POINT_COUNT, WINED3DSIH_DCL_INPUT_PRIMITIVE, WINED3DSIH_DCL_INPUT_PS, WINED3DSIH_DCL_INPUT_PS_SGV, @@ -517,10 +550,16 @@ WINED3DSIH_DCL_INPUT_SGV, WINED3DSIH_DCL_INPUT_SIV, WINED3DSIH_DCL_OUTPUT, + WINED3DSIH_DCL_OUTPUT_CONTROL_POINT_COUNT, WINED3DSIH_DCL_OUTPUT_SIV, WINED3DSIH_DCL_OUTPUT_TOPOLOGY, + WINED3DSIH_DCL_RESOURCE_STRUCTURED, WINED3DSIH_DCL_SAMPLER, WINED3DSIH_DCL_TEMPS, + WINED3DSIH_DCL_TESSELLATOR_DOMAIN, + WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE, + WINED3DSIH_DCL_TESSELLATOR_PARTITIONING, + WINED3DSIH_DCL_UAV_TYPED, WINED3DSIH_DCL_VERTICES_OUT, WINED3DSIH_DEF, WINED3DSIH_DEFB, @@ -549,6 +588,8 @@ WINED3DSIH_FTOI, WINED3DSIH_FTOU, WINED3DSIH_GE, + WINED3DSIH_HS_DECLS, + WINED3DSIH_HS_FORK_PHASE, WINED3DSIH_IADD, WINED3DSIH_IEQ, WINED3DSIH_IF, @@ -565,6 +606,7 @@ WINED3DSIH_ITOF, WINED3DSIH_LABEL, WINED3DSIH_LD, + WINED3DSIH_LD2DMS, WINED3DSIH_LD_STRUCTURED, WINED3DSIH_LIT, WINED3DSIH_LOG, @@ -611,6 +653,7 @@ WINED3DSIH_SINCOS, WINED3DSIH_SLT, WINED3DSIH_SQRT, + WINED3DSIH_STORE_UAV_TYPED, WINED3DSIH_SUB, WINED3DSIH_TEX, WINED3DSIH_TEXBEM, @@ -647,6 +690,8 @@ WINED3D_SHADER_TYPE_PIXEL, WINED3D_SHADER_TYPE_VERTEX, WINED3D_SHADER_TYPE_GEOMETRY, + WINED3D_SHADER_TYPE_HULL, + WINED3D_SHADER_TYPE_DOMAIN, WINED3D_SHADER_TYPE_COUNT, }; @@ -711,6 +756,7 @@ struct wined3d_shader_resource_info resource_info[max(MAX_FRAGMENT_SAMPLERS, MAX_VERTEX_SAMPLERS)]; struct wined3d_shader_sampler_map sampler_map; + DWORD sampler_comparison_mode; BYTE bumpmat; /* MAX_TEXTURES, 8 */ BYTE luminanceparams; /* MAX_TEXTURES, 8 */ @@ -807,6 +853,12 @@ enum wined3d_sysval_semantic sysval_semantic; }; +struct wined3d_shader_structured_resource +{ + struct wined3d_shader_dst_param reg; + unsigned int byte_stride; +}; + struct wined3d_shader_texel_offset { signed char u, v, w; @@ -833,6 +885,11 @@ struct wined3d_shader_src_param src; UINT count; const struct wined3d_shader_immediate_constant_buffer *icb; + struct wined3d_shader_structured_resource structured_resource; + enum wined3d_tessellator_domain tessellator_domain; + enum wined3d_tessellator_output_primitive tessellator_output_primitive; + enum wined3d_tessellator_partitioning tessellator_partitioning; + float max_tessellation_factor; } declaration; }; @@ -873,9 +930,11 @@ struct shader_caps { - UINT vs_version; - UINT gs_version; - UINT ps_version; + unsigned int vs_version; + unsigned int hs_version; + unsigned int ds_version; + unsigned int gs_version; + unsigned int ps_version; DWORD vs_uniform_count; DWORD ps_uniform_count; @@ -1260,7 +1319,11 @@ DWORD isStateDirty[STATE_HIGHEST / (sizeof(DWORD) * CHAR_BIT) + 1]; /* Bitmap to find out quickly if a state is dirty */ struct wined3d_swapchain *swapchain; - struct wined3d_surface *current_rt; + struct + { + struct wined3d_texture *texture; + unsigned int sub_resource_idx; + } current_rt; DWORD tid; /* Thread ID which owns this context at the moment */ /* Stores some information about the context state for optimization */ @@ -1514,7 +1577,7 @@ unsigned int unit) DECLSPEC_HIDDEN; void context_bind_texture(struct wined3d_context *context, GLenum target, GLuint name) DECLSPEC_HIDDEN; void context_check_fbo_status(const struct wined3d_context *context, GLenum target) DECLSPEC_HIDDEN; -struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, struct wined3d_surface *target, +struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, struct wined3d_texture *target, const struct wined3d_format *ds_format) DECLSPEC_HIDDEN; HGLRC context_create_wgl_attribs(const struct wined3d_gl_info *gl_info, HDC hdc, HGLRC share_ctx) DECLSPEC_HIDDEN; void context_destroy(struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN; @@ -1716,8 +1779,14 @@ CARD_NVIDIA_GEFORCE_GTX770 = 0x1184, CARD_NVIDIA_GEFORCE_GTX780 = 0x1004, CARD_NVIDIA_GEFORCE_GTX780TI = 0x100a, + CARD_NVIDIA_GEFORCE_GTX860M = 0x1392, /* Other PCI ID 0x119a */ + CARD_NVIDIA_GEFORCE_GTX950 = 0x1402, + CARD_NVIDIA_GEFORCE_GTX950M = 0x139a, + CARD_NVIDIA_GEFORCE_GTX960 = 0x1401, + CARD_NVIDIA_GEFORCE_GTX960M = 0x139b, CARD_NVIDIA_GEFORCE_GTX970 = 0x13c2, CARD_NVIDIA_GEFORCE_GTX970M = 0x13d8, + CARD_NVIDIA_GEFORCE_GTX980 = 0x13c0, CARD_VMWARE_SVGA3D = 0x0405, @@ -1860,7 +1929,7 @@ struct wined3d_d3d_limits { - UINT vs_version, gs_version, ps_version; + unsigned int vs_version, hs_version, ds_version, gs_version, ps_version; DWORD vs_uniform_count; DWORD ps_uniform_count; UINT varying_count; @@ -2337,8 +2406,6 @@ { void (*texture_sub_resource_load)(struct wined3d_resource *sub_resource, struct wined3d_context *context, BOOL srgb); - void (*texture_sub_resource_invalidate_location)(struct wined3d_resource *sub_resource, DWORD location); - void (*texture_sub_resource_validate_location)(struct wined3d_resource *sub_resource, DWORD location); void (*texture_sub_resource_upload_data)(struct wined3d_resource *sub_resource, const struct wined3d_context *context, const struct wined3d_sub_resource_data *data); BOOL (*texture_load_location)(struct wined3d_texture *texture, unsigned int sub_resource_idx, @@ -2398,7 +2465,7 @@ DWORD color_key_flags; } async; - struct + struct wined3d_texture_sub_resource { struct wined3d_resource *resource; union @@ -2407,6 +2474,7 @@ struct wined3d_volume *volume; } u; + DWORD locations; GLuint buffer_object; } sub_resources[1]; }; @@ -2448,9 +2516,13 @@ struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; BOOL wined3d_texture_check_block_align(const struct wined3d_texture *texture, unsigned int level, const struct wined3d_box *box) DECLSPEC_HIDDEN; -void wined3d_texture_force_reload(struct wined3d_texture *texture) DECLSPEC_HIDDEN; +GLenum wined3d_texture_get_gl_buffer(const struct wined3d_texture *texture) DECLSPEC_HIDDEN; +void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int sub_resource_idx, + struct wined3d_bo_address *data, DWORD locations) DECLSPEC_HIDDEN; struct wined3d_resource *wined3d_texture_get_sub_resource(const struct wined3d_texture *texture, UINT sub_resource_idx) DECLSPEC_HIDDEN; +void wined3d_texture_invalidate_location(struct wined3d_texture *texture, + unsigned int sub_resource_idx, DWORD location) DECLSPEC_HIDDEN; void wined3d_texture_load(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; void wined3d_texture_prepare_buffer_object(struct wined3d_texture *texture, @@ -2464,6 +2536,8 @@ struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN; BOOL wined3d_texture_use_pbo(const struct wined3d_texture *texture, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; +void wined3d_texture_validate_location(struct wined3d_texture *texture, + unsigned int sub_resource_idx, DWORD location) DECLSPEC_HIDDEN; #define WINED3D_LOCATION_DISCARDED 0x00000001 #define WINED3D_LOCATION_SYSMEM 0x00000002 @@ -2483,7 +2557,6 @@ struct wined3d_resource resource; struct wined3d_texture *container; - DWORD locations; GLint texture_level; }; @@ -2502,7 +2575,6 @@ struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; BOOL wined3d_volume_prepare_location(struct wined3d_volume *volume, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; -void wined3d_volume_validate_location(struct wined3d_volume *volume, DWORD location) 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; @@ -2544,17 +2616,10 @@ } key; }; -struct wined3d_surface_ops -{ - HRESULT (*surface_private_setup)(struct wined3d_surface *surface); -}; - struct wined3d_surface { struct wined3d_resource resource; - const struct wined3d_surface_ops *surface_ops; struct wined3d_texture *container; - DWORD locations; DWORD flags; @@ -2593,6 +2658,16 @@ && context->d3d_info->wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL; } +static inline unsigned int surface_get_sub_resource_idx(const struct wined3d_surface *surface) +{ + return surface->texture_layer * surface->container->level_count + surface->texture_level; +} + +static inline struct wined3d_texture_sub_resource *surface_get_sub_resource(struct wined3d_surface *surface) +{ + return &surface->container->sub_resources[surface_get_sub_resource_idx(surface)]; +} + static inline GLuint surface_get_texture_name(const struct wined3d_surface *surface, const struct wined3d_context *context, BOOL srgb) { @@ -2607,13 +2682,11 @@ 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; HRESULT wined3d_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) DECLSPEC_HIDDEN; -void surface_invalidate_location(struct wined3d_surface *surface, DWORD location) DECLSPEC_HIDDEN; void surface_load(struct wined3d_surface *surface, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb, struct wined3d_context *context) DECLSPEC_HIDDEN; @@ -2629,7 +2702,6 @@ void surface_translate_drawable_coords(const struct wined3d_surface *surface, HWND window, RECT *rect) 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; -void surface_validate_location(struct wined3d_surface *surface, DWORD location) 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; @@ -2895,10 +2967,12 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *context, struct wined3d_bo_address *data) DECLSPEC_HIDDEN; -BYTE *buffer_get_sysmem(struct wined3d_buffer *This, struct wined3d_context *context) DECLSPEC_HIDDEN; +BYTE *buffer_get_sysmem(struct wined3d_buffer *buffer, 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_mark_used(struct wined3d_buffer *buffer) DECLSPEC_HIDDEN; +HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_offset, + struct wined3d_buffer *src_buffer, unsigned int src_offset, unsigned int size) DECLSPEC_HIDDEN; HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer, const struct wined3d_box *box, const void *data) DECLSPEC_HIDDEN; @@ -2923,17 +2997,14 @@ static inline struct wined3d_surface *wined3d_rendertarget_view_get_surface( const struct wined3d_rendertarget_view *view) { - struct wined3d_resource *resource; struct wined3d_texture *texture; if (!view || view->resource->type != WINED3D_RTYPE_TEXTURE_2D) return NULL; texture = wined3d_texture_from_resource(view->resource); - if (!(resource = wined3d_texture_get_sub_resource(texture, view->sub_resource_idx))) - return NULL; - return surface_from_resource(resource); + return texture->sub_resources[view->sub_resource_idx].u.surface; } struct wined3d_shader_resource_view @@ -3016,6 +3087,7 @@ const char *debug_fbostatus(GLenum status) DECLSPEC_HIDDEN; const char *debug_glerror(GLenum error) DECLSPEC_HIDDEN; const char *debug_d3dtop(enum wined3d_texture_op d3dtop) DECLSPEC_HIDDEN; +const char *debug_shader_type(enum wined3d_shader_type shader_type) DECLSPEC_HIDDEN; void dump_color_fixup_desc(struct color_fixup_desc fixup) DECLSPEC_HIDDEN; BOOL is_invalid_op(const struct wined3d_state *state, int stage, @@ -3432,7 +3504,22 @@ { return (!(context->d3d_info->wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL) || state->render_states[WINED3D_RS_SRGBWRITEENABLE]) - && fb->render_targets[0]->format_flags & WINED3DFMT_FLAG_SRGB_WRITE; + && fb->render_targets[0] && fb->render_targets[0]->format_flags & WINED3DFMT_FLAG_SRGB_WRITE; +} + +static inline BOOL can_use_texture_swizzle(const struct wined3d_gl_info *gl_info, const struct wined3d_format *format) +{ + return gl_info->supported[ARB_TEXTURE_SWIZZLE] && !is_complex_fixup(format->color_fixup) + && !is_scaling_fixup(format->color_fixup); +} + +static inline struct wined3d_surface *context_get_rt_surface(const struct wined3d_context *context) +{ + struct wined3d_texture *texture = context->current_rt.texture; + + if (!texture) + return NULL; + return texture->sub_resources[context->current_rt.sub_resource_idx].u.surface; } /* The WNDCLASS-Name for the fake window which we use to retrieve the GL capabilities */ diff -Nru wine-staging-1.9.6/dlls/wined3d/wined3d.spec wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/wined3d.spec --- wine-staging-1.9.6/dlls/wined3d/wined3d.spec 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/wined3d/wined3d.spec 2016-04-04 18:06:32.000000000 +0000 @@ -200,7 +200,9 @@ @ cdecl wined3d_sampler_get_parent(ptr) @ cdecl wined3d_sampler_incref(ptr) +@ cdecl wined3d_shader_create_ds(ptr ptr ptr ptr ptr) @ cdecl wined3d_shader_create_gs(ptr ptr ptr ptr ptr) +@ cdecl wined3d_shader_create_hs(ptr ptr ptr ptr ptr) @ cdecl wined3d_shader_create_ps(ptr ptr ptr ptr ptr) @ cdecl wined3d_shader_create_vs(ptr ptr ptr ptr ptr) @ cdecl wined3d_shader_decref(ptr) diff -Nru wine-staging-1.9.6/dlls/wineqtdecoder/qtsplitter.c wine-staging-1.9.7~ubuntu15.04.1/dlls/wineqtdecoder/qtsplitter.c --- wine-staging-1.9.6/dlls/wineqtdecoder/qtsplitter.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/wineqtdecoder/qtsplitter.c 2016-04-04 18:06:32.000000000 +0000 @@ -250,7 +250,7 @@ QTSplitter *This; static const WCHAR wcsInputPinName[] = {'I','n','p','u','t',' ','P','i','n',0}; - EnterMovies(); + EnterMoviesOnThread(0); RegisterWineDataHandler(); @@ -324,7 +324,7 @@ if (This->aSession) MovieAudioExtractionEnd(This->aSession); - ExitMovies(); + ExitMoviesOnThread(); LeaveCriticalSection(&This->csReceive); if (This->loaderThread) diff -Nru wine-staging-1.9.6/dlls/winscard/winscard.c wine-staging-1.9.7~ubuntu15.04.1/dlls/winscard/winscard.c --- wine-staging-1.9.6/dlls/winscard/winscard.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/winscard/winscard.c 2016-04-04 18:06:32.000000000 +0000 @@ -129,3 +129,15 @@ { FIXME("stub\n"); } + +LONG WINAPI SCardListReadersA(SCARDCONTEXT context, const CHAR *groups, CHAR *readers, DWORD *buflen) +{ + FIXME("(%lx, %s, %p, %p) stub\n", context, debugstr_a(groups), readers, buflen); + return SCARD_E_NO_READERS_AVAILABLE; +} + +LONG WINAPI SCardListReadersW(SCARDCONTEXT context, const WCHAR *groups, WCHAR *readers, DWORD *buflen) +{ + FIXME("(%lx, %s, %p, %p) stub\n", context, debugstr_w(groups), readers, buflen); + return SCARD_E_NO_READERS_AVAILABLE; +} diff -Nru wine-staging-1.9.6/dlls/winscard/winscard.spec wine-staging-1.9.7~ubuntu15.04.1/dlls/winscard/winscard.spec --- wine-staging-1.9.6/dlls/winscard/winscard.spec 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/winscard/winscard.spec 2016-04-04 18:06:32.000000000 +0000 @@ -40,8 +40,8 @@ @ stub SCardListInterfacesW @ stub SCardListReaderGroupsA @ stub SCardListReaderGroupsW -@ stub SCardListReadersA -@ stub SCardListReadersW +@ stdcall SCardListReadersA(long str ptr ptr) +@ stdcall SCardListReadersW(long wstr ptr ptr) @ stub SCardLocateCardsA @ stub SCardLocateCardsByATRA @ stub SCardLocateCardsByATRW diff -Nru wine-staging-1.9.6/dlls/xmllite/tests/Makefile.in wine-staging-1.9.7~ubuntu15.04.1/dlls/xmllite/tests/Makefile.in --- wine-staging-1.9.6/dlls/xmllite/tests/Makefile.in 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/xmllite/tests/Makefile.in 2016-04-04 18:06:32.000000000 +0000 @@ -1,5 +1,5 @@ TESTDLL = xmllite.dll -IMPORTS = ole32 +IMPORTS = xmllite ole32 C_SRCS = \ reader.c \ diff -Nru wine-staging-1.9.6/dlls/xmllite/tests/reader.c wine-staging-1.9.7~ubuntu15.04.1/dlls/xmllite/tests/reader.c --- wine-staging-1.9.6/dlls/xmllite/tests/reader.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/xmllite/tests/reader.c 2016-04-04 18:06:32.000000000 +0000 @@ -33,14 +33,6 @@ DEFINE_GUID(IID_IXmlReaderInput, 0x0b3ccc9b, 0x9214, 0x428b, 0xa2, 0xae, 0xef, 0x3a, 0xa8, 0x71, 0xaf, 0xda); -static HRESULT (WINAPI *pCreateXmlReader)(REFIID riid, void **ppvObject, IMalloc *pMalloc); -static HRESULT (WINAPI *pCreateXmlReaderInputWithEncodingName)(IUnknown *stream, - IMalloc *pMalloc, - LPCWSTR encoding, - BOOL hint, - LPCWSTR base_uri, - IXmlReaderInput **ppInput); - static WCHAR *a2w(const char *str) { int len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0); @@ -367,25 +359,6 @@ teststream_Write }; -static BOOL init_pointers(void) -{ - /* don't free module here, it's to be unloaded on exit */ - HMODULE mod = LoadLibraryA("xmllite.dll"); - - if (!mod) - { - win_skip("xmllite library not available\n"); - return FALSE; - } - -#define MAKEFUNC(f) if (!(p##f = (void*)GetProcAddress(mod, #f))) return FALSE; - MAKEFUNC(CreateXmlReader); - MAKEFUNC(CreateXmlReaderInputWithEncodingName); -#undef MAKEFUNC - - return TRUE; -} - static HRESULT WINAPI resolver_QI(IXmlResolver *iface, REFIID riid, void **obj) { ok(0, "unexpected call, riid %s\n", wine_dbgstr_guid(riid)); @@ -440,11 +413,11 @@ /* crashes native */ if (0) { - pCreateXmlReader(&IID_IXmlReader, NULL, NULL); - pCreateXmlReader(NULL, (void**)&reader, NULL); + CreateXmlReader(&IID_IXmlReader, NULL, NULL); + CreateXmlReader(NULL, (void**)&reader, NULL); } - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); test_read_state(reader, XmlReadState_Closed, -1, FALSE); @@ -517,9 +490,9 @@ HRESULT hr; LONG ref; - hr = pCreateXmlReaderInputWithEncodingName(NULL, NULL, NULL, FALSE, NULL, NULL); + hr = CreateXmlReaderInputWithEncodingName(NULL, NULL, NULL, FALSE, NULL, NULL); ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr); - hr = pCreateXmlReaderInputWithEncodingName(NULL, NULL, NULL, FALSE, NULL, &reader_input); + hr = CreateXmlReaderInputWithEncodingName(NULL, NULL, NULL, FALSE, NULL, &reader_input); ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr); hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); @@ -528,7 +501,7 @@ ref = IStream_AddRef(stream); ok(ref == 2, "Expected 2, got %d\n", ref); IStream_Release(stream); - hr = pCreateXmlReaderInputWithEncodingName((IUnknown*)stream, NULL, NULL, FALSE, NULL, &reader_input); + hr = CreateXmlReaderInputWithEncodingName((IUnknown*)stream, NULL, NULL, FALSE, NULL, &reader_input); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); hr = IUnknown_QueryInterface(reader_input, &IID_IStream, (void**)&stream2); @@ -543,7 +516,7 @@ IStream_Release(stream); /* try ::SetInput() with valid IXmlReaderInput */ - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ref = IUnknown_AddRef(reader_input); @@ -609,7 +582,7 @@ ref = IUnknown_AddRef(input); ok(ref == 2, "Expected 2, got %d\n", ref); IUnknown_Release(input); - hr = pCreateXmlReaderInputWithEncodingName(input, NULL, NULL, FALSE, NULL, &reader_input); + hr = CreateXmlReaderInputWithEncodingName(input, NULL, NULL, FALSE, NULL, &reader_input); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); ok_iids(&input_iids, empty_seq, NULL, FALSE); /* IXmlReaderInput stores stream interface as IUnknown */ @@ -617,7 +590,7 @@ ok(ref == 3, "Expected 3, got %d\n", ref); IUnknown_Release(input); - hr = pCreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); input_iids.count = 0; @@ -648,7 +621,7 @@ ok_iids(&input_iids, setinput_readerinput, NULL, FALSE); /* another reader */ - hr = pCreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader2, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader2, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); /* resolving from IXmlReaderInput to IStream/ISequentialStream is done at @@ -671,7 +644,7 @@ XmlNodeType nodetype; HRESULT hr; - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); /* invalid arguments */ @@ -711,7 +684,7 @@ BOOL ret; const WCHAR *val; - hr = pCreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (LPVOID*)&reader, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); /* position methods with Null args */ @@ -932,7 +905,7 @@ IXmlReader *reader; HRESULT hr; - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "S_OK, got %08x\n", hr); while (test->xml) @@ -1014,7 +987,7 @@ IXmlReader *reader; HRESULT hr; - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "S_OK, got %08x\n", hr); while (test->xml) @@ -1130,7 +1103,7 @@ HRESULT hr; int i; - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "S_OK, got %08x\n", hr); stream = create_stream_on_data(test->xml, strlen(test->xml)+1); @@ -1179,7 +1152,7 @@ UINT len, count; HRESULT hr; - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "S_OK, got %08x\n", hr); hr = IXmlReader_SetProperty(reader, XmlReaderProperty_DtdProcessing, DtdProcessing_Parse); @@ -1272,7 +1245,7 @@ UINT depth; HRESULT hr; - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "S_OK, got %08x\n", hr); while (test->xml) @@ -1403,7 +1376,7 @@ HRESULT hr; int c; - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "S_OK, got 0x%08x\n", hr); hr = IXmlReader_SetInput(reader, (IUnknown*)&teststream); @@ -1441,7 +1414,7 @@ HRESULT hr; UINT c; - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "S_OK, got %08x\n", hr); stream = create_stream_on_data(testA, sizeof(testA)); @@ -1496,7 +1469,7 @@ IXmlReader *reader; HRESULT hr; - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "S_OK, got %08x\n", hr); while (test->xml) @@ -1589,7 +1562,7 @@ IXmlReader *reader; HRESULT hr; - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "S_OK, got %08x\n", hr); while (test->xml) @@ -1687,7 +1660,7 @@ IXmlReader *reader; HRESULT hr; - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "S_OK, got %08x\n", hr); while (test->xml) @@ -1745,7 +1718,7 @@ IXmlReader *reader; HRESULT hr; - hr = pCreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); + hr = CreateXmlReader(&IID_IXmlReader, (void**)&reader, NULL); ok(hr == S_OK, "S_OK, got %08x\n", hr); while (test->xml) @@ -1814,9 +1787,6 @@ START_TEST(reader) { - if (!init_pointers()) - return; - test_reader_create(); test_readerinput(); test_reader_state(); diff -Nru wine-staging-1.9.6/dlls/xmllite/tests/writer.c wine-staging-1.9.7~ubuntu15.04.1/dlls/xmllite/tests/writer.c --- wine-staging-1.9.6/dlls/xmllite/tests/writer.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/xmllite/tests/writer.c 2016-04-04 18:06:32.000000000 +0000 @@ -31,15 +31,116 @@ #include "initguid.h" DEFINE_GUID(IID_IXmlWriterOutput, 0xc1131708, 0x0f59, 0x477f, 0x93, 0x59, 0x7d, 0x33, 0x24, 0x51, 0xbc, 0x1a); -static HRESULT (WINAPI *pCreateXmlWriter)(REFIID riid, void **ppvObject, IMalloc *pMalloc); -static HRESULT (WINAPI *pCreateXmlWriterOutputWithEncodingName)(IUnknown *stream, - IMalloc *imalloc, - LPCWSTR encoding_name, - IXmlWriterOutput **output); -static HRESULT (WINAPI *pCreateXmlWriterOutputWithEncodingCodePage)(IUnknown *stream, - IMalloc *imalloc, - UINT codepage, - IXmlWriterOutput **output); +static void check_output(IStream *stream, const char *expected, int line) +{ + HGLOBAL hglobal; + int len = strlen(expected), size; + char *ptr; + HRESULT hr; + + hr = GetHGlobalFromStream(stream, &hglobal); + ok_(__FILE__, line)(hr == S_OK, "got 0x%08x\n", hr); + + size = GlobalSize(hglobal); + ptr = GlobalLock(hglobal); + if (size != len) + { + ok_(__FILE__, line)(0, "data size mismatch, expected %u, got %u\n", len, size); + ok_(__FILE__, line)(0, "got %s, expected %s\n", ptr, expected); + } + else + ok_(__FILE__, line)(!strncmp(ptr, expected, len), "got %s, expected %s\n", ptr, expected); + GlobalUnlock(hglobal); +} +#define CHECK_OUTPUT(stream, expected) check_output(stream, expected, __LINE__) + +/* used to test all Write* methods for consistent error state */ +static void check_writer_state(IXmlWriter *writer, HRESULT exp_hr) +{ + static const WCHAR aW[] = {'a',0}; + HRESULT hr; + + /* FIXME: add WriteAttributes */ + + hr = IXmlWriter_WriteAttributeString(writer, NULL, aW, NULL, aW); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteCData(writer, aW); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteCharEntity(writer, aW[0]); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteChars(writer, aW, 1); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteComment(writer, aW); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + /* FIXME: add WriteDocType */ + + hr = IXmlWriter_WriteElementString(writer, NULL, aW, NULL, aW); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteEndDocument(writer); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteEndElement(writer); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteEntityRef(writer, aW); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteFullEndElement(writer); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteName(writer, aW); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteNmToken(writer, aW); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + /* FIXME: add WriteNode */ + /* FIXME: add WriteNodeShallow */ + + hr = IXmlWriter_WriteProcessingInstruction(writer, aW, aW); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteQualifiedName(writer, aW, NULL); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteRaw(writer, aW); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteRawChars(writer, aW, 1); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + hr = IXmlWriter_WriteString(writer, aW); + ok(hr == exp_hr, "got 0x%08x, expected 0x%08x\n", hr, exp_hr); + + /* FIXME: add WriteSurrogateCharEntity */ + /* FIXME: add WriteWhitespace */ +} + +static IStream *writer_set_output(IXmlWriter *writer) +{ + IStream *stream; + HRESULT hr; + + hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_SetOutput(writer, (IUnknown*)stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + + return stream; +} static HRESULT WINAPI testoutput_QueryInterface(IUnknown *iface, REFIID riid, void **obj) { @@ -127,11 +228,11 @@ /* crashes native */ if (0) { - pCreateXmlWriter(&IID_IXmlWriter, NULL, NULL); - pCreateXmlWriter(NULL, (void**)&writer, NULL); + CreateXmlWriter(&IID_IXmlWriter, NULL, NULL); + CreateXmlWriter(NULL, (void**)&writer, NULL); } - hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); /* check default properties values */ @@ -158,26 +259,6 @@ IXmlWriter_Release(writer); } -static BOOL init_pointers(void) -{ - /* don't free module here, it's to be unloaded on exit */ - HMODULE mod = LoadLibraryA("xmllite.dll"); - - if (!mod) - { - win_skip("xmllite library not available\n"); - return FALSE; - } - -#define MAKEFUNC(f) if (!(p##f = (void*)GetProcAddress(mod, #f))) return FALSE; - MAKEFUNC(CreateXmlWriter); - MAKEFUNC(CreateXmlWriterOutputWithEncodingName); - MAKEFUNC(CreateXmlWriterOutputWithEncodingCodePage); -#undef MAKEFUNC - - return TRUE; -} - static void test_writeroutput(void) { static const WCHAR utf16W[] = {'u','t','f','-','1','6',0}; @@ -186,11 +267,11 @@ HRESULT hr; output = NULL; - hr = pCreateXmlWriterOutputWithEncodingName(&testoutput, NULL, NULL, &output); + hr = CreateXmlWriterOutputWithEncodingName(&testoutput, NULL, NULL, &output); ok(hr == S_OK, "got %08x\n", hr); IUnknown_Release(output); - hr = pCreateXmlWriterOutputWithEncodingName(&testoutput, NULL, utf16W, &output); + hr = CreateXmlWriterOutputWithEncodingName(&testoutput, NULL, utf16W, &output); ok(hr == S_OK, "got %08x\n", hr); unk = NULL; hr = IUnknown_QueryInterface(output, &IID_IXmlWriterOutput, (void**)&unk); @@ -200,11 +281,11 @@ IUnknown_Release(output); output = NULL; - hr = pCreateXmlWriterOutputWithEncodingCodePage(&testoutput, NULL, ~0u, &output); + hr = CreateXmlWriterOutputWithEncodingCodePage(&testoutput, NULL, ~0u, &output); ok(hr == S_OK, "got %08x\n", hr); IUnknown_Release(output); - hr = pCreateXmlWriterOutputWithEncodingCodePage(&testoutput, NULL, CP_UTF8, &output); + hr = CreateXmlWriterOutputWithEncodingCodePage(&testoutput, NULL, CP_UTF8, &output); ok(hr == S_OK, "got %08x\n", hr); unk = NULL; hr = IUnknown_QueryInterface(output, &IID_IXmlWriterOutput, (void**)&unk); @@ -221,12 +302,10 @@ static const WCHAR versionW[] = {'v','e','r','s','i','o','n','=','"','1','.','0','"',0}; static const WCHAR xmlW[] = {'x','m','l',0}; IXmlWriter *writer; - HGLOBAL hglobal; IStream *stream; HRESULT hr; - char *ptr; - hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); /* output not set */ @@ -239,11 +318,7 @@ hr = IXmlWriter_Flush(writer); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = IXmlWriter_SetOutput(writer, (IUnknown*)stream); - ok(hr == S_OK, "got 0x%08x\n", hr); + stream = writer_set_output(writer); /* nothing written yet */ hr = IXmlWriter_Flush(writer); @@ -255,12 +330,7 @@ hr = IXmlWriter_Flush(writer); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = GetHGlobalFromStream(stream, &hglobal); - ok(hr == S_OK, "got 0x%08x\n", hr); - - ptr = GlobalLock(hglobal); - ok(!strncmp(ptr, fullprolog, strlen(fullprolog)), "got %s, expected %s\n", ptr, fullprolog); - GlobalUnlock(hglobal); + CHECK_OUTPUT(stream, fullprolog); /* one more time */ hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes); @@ -268,11 +338,7 @@ IStream_Release(stream); /* now add PI manually, and try to start a document */ - hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = IXmlWriter_SetOutput(writer, (IUnknown*)stream); - ok(hr == S_OK, "got 0x%08x\n", hr); + stream = writer_set_output(writer); hr = IXmlWriter_WriteProcessingInstruction(writer, xmlW, versionW); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -290,12 +356,7 @@ hr = IXmlWriter_Flush(writer); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = GetHGlobalFromStream(stream, &hglobal); - ok(hr == S_OK, "got 0x%08x\n", hr); - - ptr = GlobalLock(hglobal); - ok(!strncmp(ptr, prologversion, strlen(prologversion)), "got %s\n", ptr); - GlobalUnlock(hglobal); + CHECK_OUTPUT(stream, prologversion); IStream_Release(stream); IXmlWriter_Release(writer); @@ -306,7 +367,7 @@ IXmlWriter *writer; HRESULT hr; - hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); hr = IXmlWriter_SetOutput(writer, (IUnknown*)&teststream); @@ -342,14 +403,10 @@ HRESULT hr; char *ptr; - hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); - hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = IXmlWriter_SetOutput(writer, (IUnknown*)stream); - ok(hr == S_OK, "got 0x%08x\n", hr); + stream = writer_set_output(writer); hr = IXmlWriter_SetProperty(writer, XmlWriterProperty_OmitXmlDeclaration, TRUE); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -374,11 +431,7 @@ IStream_Release(stream); /* now add PI manually, and try to start a document */ - hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = IXmlWriter_SetOutput(writer, (IUnknown*)stream); - ok(hr == S_OK, "got 0x%08x\n", hr); + stream = writer_set_output(writer); hr = IXmlWriter_WriteProcessingInstruction(writer, xmlW, versionW); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -386,12 +439,7 @@ hr = IXmlWriter_Flush(writer); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = GetHGlobalFromStream(stream, &hglobal); - ok(hr == S_OK, "got 0x%08x\n", hr); - - ptr = GlobalLock(hglobal); - ok(!strncmp(ptr, prologversion, strlen(prologversion)), "got %s\n", ptr); - GlobalUnlock(hglobal); + CHECK_OUTPUT(stream, prologversion); hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -399,9 +447,7 @@ hr = IXmlWriter_Flush(writer); ok(hr == S_OK, "got 0x%08x\n", hr); - ptr = GlobalLock(hglobal); - ok(!strncmp(ptr, prologversion, strlen(prologversion)), "got %s\n", ptr); - GlobalUnlock(hglobal); + CHECK_OUTPUT(stream, prologversion); hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes); ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); @@ -409,9 +455,7 @@ hr = IXmlWriter_Flush(writer); ok(hr == S_OK, "got 0x%08x\n", hr); - ptr = GlobalLock(hglobal); - ok(!strncmp(ptr, prologversion, strlen(prologversion)), "got %s\n", ptr); - GlobalUnlock(hglobal); + CHECK_OUTPUT(stream, prologversion); /* another attempt to add 'xml' PI */ hr = IXmlWriter_WriteProcessingInstruction(writer, xmlW, versionW); @@ -440,10 +484,10 @@ hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = pCreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output); + hr = CreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output); ok(hr == S_OK, "got %08x\n", hr); - hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); hr = IXmlWriter_SetProperty(writer, XmlWriterProperty_OmitXmlDeclaration, TRUE); @@ -473,7 +517,7 @@ hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = pCreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output); + hr = CreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output); ok(hr == S_OK, "got %08x\n", hr); hr = IXmlWriter_SetOutput(writer, output); @@ -499,7 +543,7 @@ hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = pCreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output); + hr = CreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output); ok(hr == S_OK, "got %08x\n", hr); hr = IXmlWriter_SetOutput(writer, output); @@ -525,7 +569,7 @@ hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = pCreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output); + hr = CreateXmlWriterOutputWithEncodingName((IUnknown*)stream, NULL, utf16W, &output); ok(hr == S_OK, "got %08x\n", hr); hr = IXmlWriter_SetOutput(writer, output); @@ -556,23 +600,17 @@ static const char *str = "value"; static const WCHAR aW[] = {'a',0}; static const WCHAR bW[] = {'b',0}; - char *ptr; IXmlWriter *writer; IStream *stream; - HGLOBAL hglobal; HRESULT hr; - hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL); ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr); - hr = IXmlWriter_SetOutput(writer, (IUnknown*)stream); - ok(hr == S_OK, "got 0x%08x\n", hr); + stream = writer_set_output(writer); hr = IXmlWriter_WriteStartElement(writer, aW, NULL, NULL); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); @@ -586,18 +624,13 @@ hr = IXmlWriter_WriteStartElement(writer, NULL, aW, NULL); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = GetHGlobalFromStream(stream, &hglobal); - ok(hr == S_OK, "got 0x%08x\n", hr); - hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes); ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); hr = IXmlWriter_Flush(writer); ok(hr == S_OK, "got 0x%08x\n", hr); - ptr = GlobalLock(hglobal); - ok(!strncmp(ptr, "", 12), "got %s\n", ptr); - GlobalUnlock(hglobal); + CHECK_OUTPUT(stream, ""); IXmlWriter_Release(writer); IStream_Release(stream); @@ -699,17 +712,13 @@ HRESULT hr; char *ptr; - hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); - ok(hr == S_OK, "got 0x%08x\n", hr); - - hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); hr = IXmlWriter_WriteEndDocument(writer); ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr); - hr = IXmlWriter_SetOutput(writer, (IUnknown*)stream); - ok(hr == S_OK, "got 0x%08x\n", hr); + stream = writer_set_output(writer); /* WriteEndDocument resets it to initial state */ hr = IXmlWriter_WriteEndDocument(writer); @@ -746,10 +755,7 @@ hr = IXmlWriter_Flush(writer); ok(hr == S_OK, "got 0x%08x\n", hr); - ptr = GlobalLock(hglobal); - ok(ptr != NULL, "got %p\n", ptr); - ok(!strncmp(ptr, "", 12), "got %s\n", ptr); - GlobalUnlock(hglobal); + CHECK_OUTPUT(stream, ""); IXmlWriter_Release(writer); IStream_Release(stream); @@ -762,14 +768,9 @@ static const WCHAR bW[] = {'b',0}; IXmlWriter *writer; IStream *stream; - HGLOBAL hglobal; HRESULT hr; - char *ptr; - - hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); - ok(hr == S_OK, "got 0x%08x\n", hr); - hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); hr = IXmlWriter_SetProperty(writer, XmlWriterProperty_OmitXmlDeclaration, TRUE); @@ -778,8 +779,7 @@ hr = IXmlWriter_WriteComment(writer, aW); ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr); - hr = IXmlWriter_SetOutput(writer, (IUnknown*)stream); - ok(hr == S_OK, "got 0x%08x\n", hr); + stream = writer_set_output(writer); hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Omit); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -802,13 +802,7 @@ hr = IXmlWriter_Flush(writer); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = GetHGlobalFromStream(stream, &hglobal); - ok(hr == S_OK, "got 0x%08x\n", hr); - - ptr = GlobalLock(hglobal); - ok(ptr != NULL, "got %p\n", ptr); - ok(!strncmp(ptr, "", 37), "got %s\n", ptr); - GlobalUnlock(hglobal); + CHECK_OUTPUT(stream, ""); IXmlWriter_Release(writer); IStream_Release(stream); @@ -822,14 +816,9 @@ static const WCHAR bW[] = {'b',0}; IXmlWriter *writer; IStream *stream; - HGLOBAL hglobal; HRESULT hr; - char *ptr; - - hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); - ok(hr == S_OK, "got 0x%08x\n", hr); - hr = pCreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); hr = IXmlWriter_SetProperty(writer, XmlWriterProperty_OmitXmlDeclaration, TRUE); @@ -838,8 +827,7 @@ hr = IXmlWriter_WriteCData(writer, aW); ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr); - hr = IXmlWriter_SetOutput(writer, (IUnknown*)stream); - ok(hr == S_OK, "got 0x%08x\n", hr); + stream = writer_set_output(writer); hr = IXmlWriter_WriteStartElement(writer, NULL, bW, NULL); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -859,33 +847,169 @@ hr = IXmlWriter_Flush(writer); ok(hr == S_OK, "got 0x%08x\n", hr); - hr = GetHGlobalFromStream(stream, &hglobal); - ok(hr == S_OK, "got 0x%08x\n", hr); - - ptr = GlobalLock(hglobal); - ok(ptr != NULL, "got %p\n", ptr); - - ok(!strncmp(ptr, + CHECK_OUTPUT(stream, "" "" "" "" "]]>" "" - "b]]>", 84), "got %s\n", ptr); + "b]]>"); - GlobalUnlock(hglobal); + IXmlWriter_Release(writer); + IStream_Release(stream); +} + +static void test_WriteRaw(void) +{ + static const WCHAR rawW[] = {'a','<',':',0}; + static const WCHAR aW[] = {'a',0}; + IXmlWriter *writer; + IStream *stream; + HRESULT hr; + + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + + hr = IXmlWriter_WriteRaw(writer, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteRaw(writer, rawW); + ok(hr == E_UNEXPECTED, "got 0x%08x\n", hr); + + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteRaw(writer, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteRaw(writer, rawW); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteRaw(writer, rawW); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteComment(writer, rawW); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteRaw(writer, rawW); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteElementString(writer, NULL, aW, NULL, aW); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteStartDocument(writer, XmlStandalone_Yes); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteComment(writer, rawW); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteEndDocument(writer); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + hr = IXmlWriter_WriteRaw(writer, rawW); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + hr = IXmlWriter_Flush(writer); + ok(hr == S_OK, "got 0x%08x\n", hr); + + CHECK_OUTPUT(stream, "a<:a<:a<:a"); IXmlWriter_Release(writer); IStream_Release(stream); } -START_TEST(writer) +static void test_writer_state(void) { - if (!init_pointers()) - return; + static const WCHAR aW[] = {'a',0}; + IXmlWriter *writer; + IStream *stream; + HRESULT hr; + + hr = CreateXmlWriter(&IID_IXmlWriter, (void**)&writer, NULL); + ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); + + /* initial state */ + check_writer_state(writer, E_UNEXPECTED); + + /* set output and call 'wrong' method, WriteEndElement */ + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteEndElement(writer); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + check_writer_state(writer, WR_E_INVALIDACTION); + IStream_Release(stream); + + /* WriteAttributeString */ + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteAttributeString(writer, NULL, aW, NULL, aW); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + check_writer_state(writer, WR_E_INVALIDACTION); + IStream_Release(stream); + + /* WriteEndDocument */ + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteEndDocument(writer); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + check_writer_state(writer, WR_E_INVALIDACTION); + IStream_Release(stream); + + /* WriteFullEndElement */ + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteFullEndElement(writer); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + check_writer_state(writer, WR_E_INVALIDACTION); + IStream_Release(stream); + + /* WriteCData */ + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteCData(writer, aW); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + check_writer_state(writer, WR_E_INVALIDACTION); + IStream_Release(stream); + + /* WriteName */ + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteName(writer, aW); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + check_writer_state(writer, WR_E_INVALIDACTION); + IStream_Release(stream); + + /* WriteNmToken */ + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteNmToken(writer, aW); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + check_writer_state(writer, WR_E_INVALIDACTION); + IStream_Release(stream); + + /* WriteString */ + stream = writer_set_output(writer); + + hr = IXmlWriter_WriteString(writer, aW); + ok(hr == WR_E_INVALIDACTION, "got 0x%08x\n", hr); + + check_writer_state(writer, WR_E_INVALIDACTION); + IStream_Release(stream); + + IXmlWriter_Release(writer); +} + +START_TEST(writer) +{ test_writer_create(); + test_writer_state(); test_writeroutput(); test_writestartdocument(); test_writestartelement(); @@ -896,4 +1020,5 @@ test_writeenddocument(); test_WriteComment(); test_WriteCData(); + test_WriteRaw(); } diff -Nru wine-staging-1.9.6/dlls/xmllite/writer.c wine-staging-1.9.7~ubuntu15.04.1/dlls/xmllite/writer.c --- wine-staging-1.9.6/dlls/xmllite/writer.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/dlls/xmllite/writer.c 2016-04-04 18:06:32.000000000 +0000 @@ -372,6 +372,40 @@ return S_OK; } +static HRESULT write_xmldecl(xmlwriter *writer, XmlStandalone standalone) +{ + static const WCHAR versionW[] = {'<','?','x','m','l',' ','v','e','r','s','i','o','n','=','"','1','.','0','"'}; + static const WCHAR encodingW[] = {' ','e','n','c','o','d','i','n','g','='}; + + write_encoding_bom(writer); + writer->state = XmlWriterState_DocStarted; + if (writer->omitxmldecl) return S_OK; + + /* version */ + write_output_buffer(writer->output, versionW, ARRAY_SIZE(versionW)); + + /* encoding */ + write_output_buffer(writer->output, encodingW, ARRAY_SIZE(encodingW)); + write_output_buffer_quoted(writer->output, get_encoding_name(writer->output->encoding), -1); + + /* standalone */ + if (standalone == XmlStandalone_Omit) + write_output_buffer(writer->output, closepiW, ARRAY_SIZE(closepiW)); + else { + static const WCHAR standaloneW[] = {' ','s','t','a','n','d','a','l','o','n','e','=','\"'}; + static const WCHAR yesW[] = {'y','e','s','\"','?','>'}; + static const WCHAR noW[] = {'n','o','\"','?','>'}; + + write_output_buffer(writer->output, standaloneW, ARRAY_SIZE(standaloneW)); + if (standalone == XmlStandalone_Yes) + write_output_buffer(writer->output, yesW, ARRAY_SIZE(yesW)); + else + write_output_buffer(writer->output, noW, ARRAY_SIZE(noW)); + } + + return S_OK; +} + static HRESULT writer_close_starttag(xmlwriter *writer) { HRESULT hr; @@ -553,6 +587,18 @@ FIXME("%p %s %s %s %s\n", This, wine_dbgstr_w(pwszPrefix), wine_dbgstr_w(pwszLocalName), wine_dbgstr_w(pwszNamespaceUri), wine_dbgstr_w(pwszValue)); + switch (This->state) + { + case XmlWriterState_Initial: + return E_UNEXPECTED; + case XmlWriterState_Ready: + case XmlWriterState_DocClosed: + This->state = XmlWriterState_DocClosed; + return WR_E_INVALIDACTION; + default: + ; + } + return E_NOTIMPL; } @@ -580,7 +626,9 @@ case XmlWriterState_ElemStarted: writer_close_starttag(This); break; + case XmlWriterState_Ready: case XmlWriterState_DocClosed: + This->state = XmlWriterState_DocClosed; return WR_E_INVALIDACTION; default: ; @@ -610,8 +658,22 @@ return S_OK; } -static HRESULT WINAPI xmlwriter_WriteCharEntity(IXmlWriter *iface, WCHAR wch) +static HRESULT WINAPI xmlwriter_WriteCharEntity(IXmlWriter *iface, WCHAR ch) { + xmlwriter *This = impl_from_IXmlWriter(iface); + + FIXME("%p %x\n", This, ch); + + switch (This->state) + { + case XmlWriterState_Initial: + return E_UNEXPECTED; + case XmlWriterState_DocClosed: + return WR_E_INVALIDACTION; + default: + ; + } + return E_NOTIMPL; } @@ -621,6 +683,16 @@ FIXME("%p %s %d\n", This, wine_dbgstr_w(pwch), cwch); + switch (This->state) + { + case XmlWriterState_Initial: + return E_UNEXPECTED; + case XmlWriterState_DocClosed: + return WR_E_INVALIDACTION; + default: + ; + } + return E_NOTIMPL; } @@ -695,10 +767,13 @@ case XmlWriterState_ElemStarted: writer_close_starttag(This); break; - case XmlWriterState_DocClosed: - return WR_E_INVALIDACTION; + case XmlWriterState_Ready: + case XmlWriterState_DocStarted: + case XmlWriterState_PIDocStarted: + break; default: - ; + This->state = XmlWriterState_DocClosed; + return WR_E_INVALIDACTION; } write_encoding_bom(This); @@ -720,28 +795,21 @@ static HRESULT WINAPI xmlwriter_WriteEndDocument(IXmlWriter *iface) { xmlwriter *This = impl_from_IXmlWriter(iface); - HRESULT hr = S_OK; TRACE("%p\n", This); switch (This->state) { case XmlWriterState_Initial: - hr = E_UNEXPECTED; - break; + return E_UNEXPECTED; case XmlWriterState_Ready: case XmlWriterState_DocClosed: - hr = WR_E_INVALIDACTION; - break; + This->state = XmlWriterState_DocClosed; + return WR_E_INVALIDACTION; default: ; } - if (FAILED(hr)) { - This->state = XmlWriterState_DocClosed; - return hr; - } - /* empty element stack */ while (IXmlWriter_WriteEndElement(iface) == S_OK) ; @@ -757,6 +825,18 @@ TRACE("%p\n", This); + switch (This->state) + { + case XmlWriterState_Initial: + return E_UNEXPECTED; + case XmlWriterState_Ready: + case XmlWriterState_DocClosed: + This->state = XmlWriterState_DocClosed; + return WR_E_INVALIDACTION; + default: + ; + } + element = pop_element(This); if (!element) return WR_E_INVALIDACTION; @@ -782,6 +862,16 @@ FIXME("%p %s\n", This, wine_dbgstr_w(pwszName)); + switch (This->state) + { + case XmlWriterState_Initial: + return E_UNEXPECTED; + case XmlWriterState_DocClosed: + return WR_E_INVALIDACTION; + default: + ; + } + return E_NOTIMPL; } @@ -792,6 +882,18 @@ TRACE("%p\n", This); + switch (This->state) + { + case XmlWriterState_Initial: + return E_UNEXPECTED; + case XmlWriterState_Ready: + case XmlWriterState_DocClosed: + This->state = XmlWriterState_DocClosed; + return WR_E_INVALIDACTION; + default: + ; + } + element = pop_element(This); if (!element) return WR_E_INVALIDACTION; @@ -811,6 +913,18 @@ FIXME("%p %s\n", This, wine_dbgstr_w(pwszName)); + switch (This->state) + { + case XmlWriterState_Initial: + return E_UNEXPECTED; + case XmlWriterState_Ready: + case XmlWriterState_DocClosed: + This->state = XmlWriterState_DocClosed; + return WR_E_INVALIDACTION; + default: + ; + } + return E_NOTIMPL; } @@ -820,6 +934,18 @@ FIXME("%p %s\n", This, wine_dbgstr_w(pwszNmToken)); + switch (This->state) + { + case XmlWriterState_Initial: + return E_UNEXPECTED; + case XmlWriterState_Ready: + case XmlWriterState_DocClosed: + This->state = XmlWriterState_DocClosed; + return WR_E_INVALIDACTION; + default: + ; + } + return E_NOTIMPL; } @@ -887,16 +1013,45 @@ FIXME("%p %s %s\n", This, wine_dbgstr_w(pwszLocalName), wine_dbgstr_w(pwszNamespaceUri)); + switch (This->state) + { + case XmlWriterState_Initial: + return E_UNEXPECTED; + case XmlWriterState_DocClosed: + return WR_E_INVALIDACTION; + default: + ; + } + return E_NOTIMPL; } -static HRESULT WINAPI xmlwriter_WriteRaw(IXmlWriter *iface, LPCWSTR pwszData) +static HRESULT WINAPI xmlwriter_WriteRaw(IXmlWriter *iface, LPCWSTR data) { xmlwriter *This = impl_from_IXmlWriter(iface); - FIXME("%p %s\n", This, wine_dbgstr_w(pwszData)); + TRACE("%p %s\n", This, debugstr_w(data)); - return E_NOTIMPL; + if (!data) + return S_OK; + + switch (This->state) + { + case XmlWriterState_Initial: + return E_UNEXPECTED; + case XmlWriterState_Ready: + write_xmldecl(This, XmlStandalone_Omit); + /* fallthrough */ + case XmlWriterState_DocStarted: + case XmlWriterState_PIDocStarted: + break; + default: + This->state = XmlWriterState_DocClosed; + return WR_E_INVALIDACTION; + } + + write_output_buffer(This->output, data, -1); + return S_OK; } static HRESULT WINAPI xmlwriter_WriteRawChars(IXmlWriter *iface, const WCHAR *pwch, UINT cwch) @@ -905,13 +1060,21 @@ FIXME("%p %s %d\n", This, wine_dbgstr_w(pwch), cwch); + switch (This->state) + { + case XmlWriterState_Initial: + return E_UNEXPECTED; + case XmlWriterState_DocClosed: + return WR_E_INVALIDACTION; + default: + ; + } + return E_NOTIMPL; } static HRESULT WINAPI xmlwriter_WriteStartDocument(IXmlWriter *iface, XmlStandalone standalone) { - static const WCHAR versionW[] = {'<','?','x','m','l',' ','v','e','r','s','i','o','n','=','"','1','.','0','"'}; - static const WCHAR encodingW[] = {' ','e','n','c','o','d','i','n','g','='}; xmlwriter *This = impl_from_IXmlWriter(iface); TRACE("(%p)->(%d)\n", This, standalone); @@ -923,41 +1086,14 @@ case XmlWriterState_PIDocStarted: This->state = XmlWriterState_DocStarted; return S_OK; - case XmlWriterState_DocStarted: - case XmlWriterState_ElemStarted: - case XmlWriterState_DocClosed: - return WR_E_INVALIDACTION; + case XmlWriterState_Ready: + break; default: - ; - } - - write_encoding_bom(This); - This->state = XmlWriterState_DocStarted; - if (This->omitxmldecl) return S_OK; - - /* version */ - write_output_buffer(This->output, versionW, ARRAY_SIZE(versionW)); - - /* encoding */ - write_output_buffer(This->output, encodingW, ARRAY_SIZE(encodingW)); - write_output_buffer_quoted(This->output, get_encoding_name(This->output->encoding), -1); - - /* standalone */ - if (standalone == XmlStandalone_Omit) - write_output_buffer(This->output, closepiW, ARRAY_SIZE(closepiW)); - else { - static const WCHAR standaloneW[] = {' ','s','t','a','n','d','a','l','o','n','e','=','\"'}; - static const WCHAR yesW[] = {'y','e','s','\"','?','>'}; - static const WCHAR noW[] = {'n','o','\"','?','>'}; - - write_output_buffer(This->output, standaloneW, ARRAY_SIZE(standaloneW)); - if (standalone == XmlStandalone_Yes) - write_output_buffer(This->output, yesW, ARRAY_SIZE(yesW)); - else - write_output_buffer(This->output, noW, ARRAY_SIZE(noW)); + This->state = XmlWriterState_DocClosed; + return WR_E_INVALIDACTION; } - return S_OK; + return write_xmldecl(This, standalone); } static HRESULT WINAPI xmlwriter_WriteStartElement(IXmlWriter *iface, LPCWSTR prefix, LPCWSTR local_name, LPCWSTR uri) @@ -967,6 +1103,9 @@ TRACE("(%p)->(%s %s %s)\n", This, wine_dbgstr_w(prefix), wine_dbgstr_w(local_name), wine_dbgstr_w(uri)); + if (!local_name) + return E_INVALIDARG; + switch (This->state) { case XmlWriterState_Initial: @@ -977,9 +1116,6 @@ ; } - if (!local_name) - return E_INVALIDARG; - /* close pending element */ if (This->starttagopen) write_output_buffer(This->output, gtW, ARRAY_SIZE(gtW)); @@ -1006,6 +1142,18 @@ FIXME("%p %s\n", This, wine_dbgstr_w(pwszText)); + switch (This->state) + { + case XmlWriterState_Initial: + return E_UNEXPECTED; + case XmlWriterState_Ready: + case XmlWriterState_DocClosed: + This->state = XmlWriterState_DocClosed; + return WR_E_INVALIDACTION; + default: + ; + } + return E_NOTIMPL; } diff -Nru wine-staging-1.9.6/include/bcrypt.h wine-staging-1.9.7~ubuntu15.04.1/include/bcrypt.h --- wine-staging-1.9.6/include/bcrypt.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/include/bcrypt.h 2016-04-04 18:06:32.000000000 +0000 @@ -92,6 +92,7 @@ NTSTATUS WINAPI BCryptGenRandom(BCRYPT_ALG_HANDLE, PUCHAR, ULONG, ULONG); NTSTATUS WINAPI BCryptGetFipsAlgorithmMode(BOOLEAN *); NTSTATUS WINAPI BCryptGetProperty(BCRYPT_HANDLE, LPCWSTR, PUCHAR, ULONG, ULONG *, ULONG); +NTSTATUS WINAPI BCryptHash(BCRYPT_ALG_HANDLE, PUCHAR, ULONG, PUCHAR, ULONG, PUCHAR, ULONG); NTSTATUS WINAPI BCryptHashData(BCRYPT_HASH_HANDLE, PUCHAR, ULONG, ULONG); NTSTATUS WINAPI BCryptOpenAlgorithmProvider(BCRYPT_ALG_HANDLE *, LPCWSTR, LPCWSTR, ULONG); diff -Nru wine-staging-1.9.6/include/config.h.in wine-staging-1.9.7~ubuntu15.04.1/include/config.h.in --- wine-staging-1.9.6/include/config.h.in 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/include/config.h.in 2016-04-04 18:06:32.000000000 +0000 @@ -32,6 +32,12 @@ /* Define to 1 if you have the `asctime_r' function. */ #undef HAVE_ASCTIME_R +/* Define to 1 if you have the `asinh' function. */ +#undef HAVE_ASINH + +/* Define to 1 if you have the `asinhf' function. */ +#undef HAVE_ASINHF + /* Define to 1 if you have the header file. */ #undef HAVE_ASM_TYPES_H diff -Nru wine-staging-1.9.6/include/d2d1.idl wine-staging-1.9.7~ubuntu15.04.1/include/d2d1.idl --- wine-staging-1.9.6/include/d2d1.idl 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/include/d2d1.idl 2016-04-04 18:06:32.000000000 +0000 @@ -1160,7 +1160,7 @@ { HRESULT BindDC( [in] const HDC dc, - [in] const RECT rect + [in] const RECT *rect ); } diff -Nru wine-staging-1.9.6/include/d3d10effect.h wine-staging-1.9.7~ubuntu15.04.1/include/d3d10effect.h --- wine-staging-1.9.6/include/d3d10effect.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/include/d3d10effect.h 2016-04-04 18:06:32.000000000 +0000 @@ -832,6 +832,8 @@ ID3D10Blob **effect, ID3D10Blob **errors); HRESULT WINAPI D3D10CreateEffectFromMemory(void *data, SIZE_T data_size, UINT flags, ID3D10Device *device, ID3D10EffectPool *effect_pool, ID3D10Effect **effect); +HRESULT WINAPI D3D10CreateEffectPoolFromMemory(void *data, SIZE_T data_size, UINT fx_flags, + ID3D10Device *device, ID3D10EffectPool **effect_pool); HRESULT WINAPI D3D10CreateStateBlock(ID3D10Device *device, D3D10_STATE_BLOCK_MASK *mask, ID3D10StateBlock **stateblock); diff -Nru wine-staging-1.9.6/include/d3drm.h wine-staging-1.9.7~ubuntu15.04.1/include/d3drm.h --- wine-staging-1.9.6/include/d3drm.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/include/d3drm.h 2016-04-04 18:06:32.000000000 +0000 @@ -110,7 +110,7 @@ #define IDirect3DRM_AddRef(p) (p)->lpVtbl->AddRef(p) #define IDirect3DRM_Release(p) (p)->lpVtbl->Release(p) /*** IDirect3DRM methods ***/ -#define IDirect3DRM_CreateObject(p,a,b,c,d) (p)->lpVtbl->CreateObject(p,a,b,d) +#define IDirect3DRM_CreateObject(p,a,b,c,d) (p)->lpVtbl->CreateObject(p,a,b,c,d) #define IDirect3DRM_CreateFrame(p,a,b) (p)->lpVtbl->CreateFrame(p,a,b) #define IDirect3DRM_CreateMesh(p,a) (p)->lpVtbl->CreateMesh(p,a) #define IDirect3DRM_CreateMeshBuilder(p,a) (p)->lpVtbl->CreateMeshBuilder(p,a) @@ -148,7 +148,7 @@ #define IDirect3DRM_AddRef(p) (p)->AddRef() #define IDirect3DRM_Release(p) (p)->Release() /*** IDirect3DRM methods ***/ -#define IDirect3DRM_CreateObject(p,a,b,c,d) (p)->CreateObject(a,b,d) +#define IDirect3DRM_CreateObject(p,a,b,c,d) (p)->CreateObject(a,b,c,d) #define IDirect3DRM_CreateFrame(p,a,b) (p)->CreateFrame(a,b) #define IDirect3DRM_CreateMesh(p,a) (p)->CreateMesh(a) #define IDirect3DRM_CreateMeshBuilder(p,a) (p)->CreateMeshBuilder(a) @@ -251,7 +251,7 @@ #define IDirect3DRM2_AddRef(p) (p)->lpVtbl->AddRef(p) #define IDirect3DRM2_Release(p) (p)->lpVtbl->Release(p) /*** IDirect3DRM2 methods ***/ -#define IDirect3DRM2_CreateObject(p,a,b,c,d) (p)->lpVtbl->CreateObject(p,a,b,d) +#define IDirect3DRM2_CreateObject(p,a,b,c,d) (p)->lpVtbl->CreateObject(p,a,b,c,d) #define IDirect3DRM2_CreateFrame(p,a,b) (p)->lpVtbl->CreateFrame(p,a,b) #define IDirect3DRM2_CreateMesh(p,a) (p)->lpVtbl->CreateMesh(p,a) #define IDirect3DRM2_CreateMeshBuilder(p,a) (p)->lpVtbl->CreateMeshBuilder(p,a) @@ -290,7 +290,7 @@ #define IDirect3DRM2_AddRef(p) (p)->AddRef() #define IDirect3DRM2_Release(p) (p)->Release() /*** IDirect3DRM2 methods ***/ -#define IDirect3DRM2_CreateObject(p,a,b,c,d) (p)->CreateObject(a,b,d) +#define IDirect3DRM2_CreateObject(p,a,b,c,d) (p)->CreateObject(a,b,c,d) #define IDirect3DRM2_CreateFrame(p,a,b) (p)->CreateFrame(a,b) #define IDirect3DRM2_CreateMesh(p,a) (p)->CreateMesh(a) #define IDirect3DRM2_CreateMeshBuilder(p,a) (p)->CreateMeshBuilder(a) @@ -399,7 +399,7 @@ #define IDirect3DRM3_AddRef(p) (p)->lpVtbl->AddRef(p) #define IDirect3DRM3_Release(p) (p)->lpVtbl->Release(p) /*** IDirect3DRM3 methods ***/ -#define IDirect3DRM3_CreateObject(p,a,b,c,d) (p)->lpVtbl->CreateObject(p,a,b,d) +#define IDirect3DRM3_CreateObject(p,a,b,c,d) (p)->lpVtbl->CreateObject(p,a,b,c,d) #define IDirect3DRM3_CreateFrame(p,a,b) (p)->lpVtbl->CreateFrame(p,a,b) #define IDirect3DRM3_CreateMesh(p,a) (p)->lpVtbl->CreateMesh(p,a) #define IDirect3DRM3_CreateMeshBuilder(p,a) (p)->lpVtbl->CreateMeshBuilder(p,a) @@ -443,7 +443,7 @@ #define IDirect3DRM3_AddRef(p) (p)->AddRef() #define IDirect3DRM3_Release(p) (p)->Release() /*** IDirect3DRM3 methods ***/ -#define IDirect3DRM3_CreateObject(p,a,b,c,d) (p)->CreateObject(a,b,d) +#define IDirect3DRM3_CreateObject(p,a,b,c,d) (p)->CreateObject(a,b,c,d) #define IDirect3DRM3_CreateFrame(p,a,b) (p)->CreateFrame(a,b) #define IDirect3DRM3_CreateMesh(p,a) (p)->CreateMesh(a) #define IDirect3DRM3_CreateMeshBuilder(p,a) (p)->CreateMeshBuilder(a) diff -Nru wine-staging-1.9.6/include/d3dx10.h wine-staging-1.9.7~ubuntu15.04.1/include/d3dx10.h --- wine-staging-1.9.6/include/d3dx10.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/include/d3dx10.h 2016-04-04 18:06:32.000000000 +0000 @@ -29,5 +29,6 @@ #include "d3d10.h" #include "d3dx10core.h" #include "d3dx10async.h" +#include "d3dx10tex.h" #endif diff -Nru wine-staging-1.9.6/include/d3dx10tex.h wine-staging-1.9.7~ubuntu15.04.1/include/d3dx10tex.h --- wine-staging-1.9.6/include/d3dx10tex.h 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/include/d3dx10tex.h 2016-04-04 18:06:32.000000000 +0000 @@ -0,0 +1,95 @@ +/* + * Copyright 2016 Alistair Leslie-Hughes + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __D3DX10TEX_H__ +#define __D3DX10TEX_H__ + +typedef enum D3DX10_IMAGE_FILE_FORMAT +{ + D3DX10_IFF_BMP = 0, + D3DX10_IFF_JPG = 1, + D3DX10_IFF_PNG = 3, + D3DX10_IFF_DDS = 4, + D3DX10_IFF_TIFF = 10, + D3DX10_IFF_GIF = 11, + D3DX10_IFF_WMP = 12, + D3DX10_IFF_FORCE_DWORD = 0x7fffffff +} D3DX10_IMAGE_FILE_FORMAT; + +typedef struct D3DX10_IMAGE_INFO +{ + UINT Width; + UINT Height; + UINT Depth; + UINT ArraySize; + UINT MipLevels; + UINT MiscFlags; + DXGI_FORMAT Format; + D3D10_RESOURCE_DIMENSION ResourceDimension; + D3DX10_IMAGE_FILE_FORMAT ImageFileFormat; +} D3DX10_IMAGE_INFO; + +typedef struct D3DX10_IMAGE_LOAD_INFO +{ + UINT Width; + UINT Height; + UINT Depth; + UINT FirstMipLevel; + UINT MipLevels; + D3D10_USAGE Usage; + UINT BindFlags; + UINT CpuAccessFlags; + UINT MiscFlags; + DXGI_FORMAT Format; + UINT Filter; + UINT MipFilter; + D3DX10_IMAGE_INFO *pSrcInfo; + +#ifdef __cplusplus + D3DX10_IMAGE_LOAD_INFO() + { + Width = D3DX10_DEFAULT; + Height = D3DX10_DEFAULT; + Depth = D3DX10_DEFAULT; + FirstMipLevel = D3DX10_DEFAULT; + MipLevels = D3DX10_DEFAULT; + Usage = (D3D10_USAGE)D3DX10_DEFAULT; + BindFlags = D3DX10_DEFAULT; + CpuAccessFlags = D3DX10_DEFAULT; + MiscFlags = D3DX10_DEFAULT; + Format = DXGI_FORMAT_FROM_FILE; + Filter = D3DX10_DEFAULT; + MipFilter = D3DX10_DEFAULT; + pSrcInfo = NULL; + } +#endif +} D3DX10_IMAGE_LOAD_INFO; + +#ifdef __cplusplus +extern "C" { +#endif + +HRESULT WINAPI D3DX10CreateTextureFromMemory(ID3D10Device *device, const void *src_data, SIZE_T src_data_size, + D3DX10_IMAGE_LOAD_INFO *loadinfo, ID3DX10ThreadPump *pump, ID3D10Resource **texture, HRESULT *hresult); + + +#ifdef __cplusplus +} +#endif + +#endif diff -Nru wine-staging-1.9.6/include/dbghelp.h wine-staging-1.9.7~ubuntu15.04.1/include/dbghelp.h --- wine-staging-1.9.6/include/dbghelp.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/include/dbghelp.h 2016-04-04 18:06:32.000000000 +0000 @@ -957,7 +957,7 @@ ULONG SizeOfStruct; ULONG TypeIndex; ULONG64 Reserved[2]; - ULONG info; /* sdk states info, while MSDN says it's Index... */ + ULONG Index; ULONG Size; ULONG64 ModBase; ULONG Flags; diff -Nru wine-staging-1.9.6/include/dwmapi.h wine-staging-1.9.7~ubuntu15.04.1/include/dwmapi.h --- wine-staging-1.9.6/include/dwmapi.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/include/dwmapi.h 2016-04-04 18:06:32.000000000 +0000 @@ -37,6 +37,12 @@ typedef ULONGLONG DWM_FRAME_COUNT; typedef ULONGLONG QPC_TIME; +typedef enum _DWM_SOURCE_FRAME_SAMPLING { + DWM_SOURCE_FRAME_SAMPLING_POINT, + DWM_SOURCE_FRAME_SAMPLING_COVERAGE, + DWM_SOURCE_FRAME_SAMPLING_LAST +} DWM_SOURCE_FRAME_SAMPLING; + typedef struct _UNSIGNED_RATIO { UINT32 uiNumerator; UINT32 uiDenominator; @@ -117,6 +123,17 @@ BOOL fSourceClientAreaOnly; } DWM_THUMBNAIL_PROPERTIES, *PDWM_THUMBNAIL_PROPERTIES; +typedef struct _DWM_PRESENT_PARAMETERS { + UINT32 cbSize; + BOOL fQueue; + DWM_FRAME_COUNT cRefreshStart; + UINT cBuffer; + BOOL fUseSourceRate; + UNSIGNED_RATIO rateSource; + UINT cRefreshesPerFrame; + DWM_SOURCE_FRAME_SAMPLING eSampling; +} DWM_PRESENT_PARAMETERS; + #include DWMAPI DwmDefWindowProc(HWND, UINT, WPARAM, LPARAM, LRESULT*); @@ -129,6 +146,7 @@ DWMAPI DwmInvalidateIconicBitmaps(HWND); DWMAPI DwmIsCompositionEnabled(BOOL*); DWMAPI DwmRegisterThumbnail(HWND, HWND, PHTHUMBNAIL); +DWMAPI DwmSetPresentParameters(HWND, DWM_PRESENT_PARAMETERS *); DWMAPI DwmSetWindowAttribute(HWND, DWORD, LPCVOID, DWORD); DWMAPI DwmUnregisterThumbnail(HTHUMBNAIL); DWMAPI DwmUpdateThumbnailProperties(HTHUMBNAIL, const DWM_THUMBNAIL_PROPERTIES *); diff -Nru wine-staging-1.9.6/include/dxgi.idl wine-staging-1.9.7~ubuntu15.04.1/include/dxgi.idl --- wine-staging-1.9.6/include/dxgi.idl 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/include/dxgi.idl 2016-04-04 18:06:32.000000000 +0000 @@ -227,6 +227,22 @@ [ object, local, + uuid(4ae63092-6327-4c1b-80ae-bfe12ea32b86) +] +interface IDXGISurface1 : IDXGISurface +{ + HRESULT GetDC( + [in] BOOL discard, + [out] HDC *hdc + ); + HRESULT ReleaseDC( + [in] RECT *dirty_rect + ); +} + +[ + object, + local, uuid(ae02eedb-c735-4690-8d52-5a8dc20213aa) ] interface IDXGIOutput : IDXGIObject diff -Nru wine-staging-1.9.6/include/fontsub.h wine-staging-1.9.7~ubuntu15.04.1/include/fontsub.h --- wine-staging-1.9.6/include/fontsub.h 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/include/fontsub.h 2016-04-04 18:06:32.000000000 +0000 @@ -0,0 +1,42 @@ +/* + * Copyright 2016 Nikolay Sivov 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 + */ + +#ifndef __WINE_FONTSUB_H +#define __WINE_FONTSUB_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void *(__cdecl *CFP_ALLOCPROC)(size_t); +typedef void *(__cdecl *CFP_REALLOCPROC)(void *, size_t); +typedef void (__cdecl *CFP_FREEPROC)(void *); + +ULONG __cdecl CreateFontPackage(const unsigned char *src, const ULONG src_len, unsigned char **dest, + ULONG *dest_len, ULONG *written, const unsigned short flags, const unsigned short face_index, + const unsigned short format, const unsigned short lang, const unsigned short platform, + const unsigned short encoding, const unsigned short *keep_list, const unsigned short keep_len, + CFP_ALLOCPROC allocproc, CFP_REALLOCPROC reallocproc, CFP_FREEPROC freeproc, void *reserved); + +#define ERR_GENERIC 1000 + +#ifdef __cplusplus +} +#endif + +#endif diff -Nru wine-staging-1.9.6/include/htiface.idl wine-staging-1.9.7~ubuntu15.04.1/include/htiface.idl --- wine-staging-1.9.6/include/htiface.idl 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/include/htiface.idl 2016-04-04 18:06:32.000000000 +0000 @@ -65,6 +65,24 @@ HRESULT SetFrameSrc([in] LPCWSTR pszFrameSrc); HRESULT GetFrameSrc([out] LPWSTR *ppszFrameSrc); + HRESULT GetFramesContainer([out] IOleContainer **ppContainer); + HRESULT SetFrameOptions([in] DWORD dwFlags); + HRESULT GetFrameOptions([out] DWORD *pdwFlags); + + HRESULT SetFrameMargins( + [in] DWORD dwWidth, + [in] DWORD dwHeight); + + HRESULT GetFrameMargins( + [out] DWORD *pdwWidth, + [out] DWORD *pdwHeight); + + HRESULT RemoteNavigate( + [in] ULONG cLength, + [in, size_is(cLength)] ULONG *pulData); + + HRESULT OnChildFrameActivate([in] IUnknown *pUnkChildFrame); + HRESULT OnChildFrameDeactivate([in] IUnknown *pUnkChildFrame); } /***************************************************************************** diff -Nru wine-staging-1.9.6/include/Makefile.in wine-staging-1.9.7~ubuntu15.04.1/include/Makefile.in --- wine-staging-1.9.6/include/Makefile.in 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/include/Makefile.in 2016-04-04 18:06:32.000000000 +0000 @@ -137,6 +137,7 @@ servprov.idl \ sesprp.idl \ shdeprecated.idl \ + shimgdata.idl \ shldisp.idl \ shobjidl.idl \ shtypes.idl \ @@ -252,6 +253,7 @@ d3dvec.inl \ d3dx10.h \ d3dx10async.h \ + d3dx10tex.h \ d3dx9.h \ d3dx9anim.h \ d3dx9core.h \ @@ -354,6 +356,7 @@ fdi.h \ fileapi.h \ fltdefs.h \ + fontsub.h \ gdiplus.h \ gdipluscolor.h \ gdipluscolormatrix.h \ diff -Nru wine-staging-1.9.6/include/msctf.idl wine-staging-1.9.7~ubuntu15.04.1/include/msctf.idl --- wine-staging-1.9.6/include/msctf.idl 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/include/msctf.idl 2016-04-04 18:06:32.000000000 +0000 @@ -97,6 +97,8 @@ interface IEnumTfLanguageProfiles; interface ITfCompositionView; interface ITfKeyEventSink; +interface ITfPersistentPropertyLoaderACP; +interface ITfRangeACP; cpp_quote("#if 0") typedef [uuid(4f5d560f-5ab5-4dde-8c4d-404592857ab0)] UINT_PTR HKL; @@ -351,6 +353,34 @@ } [ + object, + uuid(aa80e901-2021-11d2-93e0-0060b067b86e), + pointer_default(unique) +] +interface ITextStoreACPServices : IUnknown +{ + HRESULT Serialize( + [in] ITfProperty *prop, + [in] ITfRange *range, + [out] TF_PERSISTENT_PROPERTY_HEADER_ACP *header, + [in] IStream *stream); + + HRESULT Unserialize( + [in] ITfProperty *prop, + [in] const TF_PERSISTENT_PROPERTY_HEADER_ACP *header, + [in] IStream *stream, + [in] ITfPersistentPropertyLoaderACP *loader); + + HRESULT ForceLoadProperty( + [in] ITfProperty *prop); + + HRESULT CreateRange( + [in] LONG start, + [in] LONG end, + [out] ITfRangeACP **range); +} + +[ object, uuid(aa80e7fd-2021-11d2-93e0-0060b067b86e), pointer_default(unique) diff -Nru wine-staging-1.9.6/include/mshtmdid.h wine-staging-1.9.7~ubuntu15.04.1/include/mshtmdid.h --- wine-staging-1.9.6/include/mshtmdid.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/include/mshtmdid.h 2016-04-04 18:06:32.000000000 +0000 @@ -2684,6 +2684,9 @@ /* IHTMLSelectElement4 */ #define DISPID_IHTMLSELECTELEMENT4_NAMEDITEM DISPID_COLLECTION+6 +/* IHTMLHtmlElement */ +#define DISPID_IHTMLHTMLELEMENT_VERSION DISPID_HEDELEMS+1 + /* IHTMLHeadElement */ #define DISPID_IHTMLHEADELEMENT_PROFILE DISPID_HEDELEMS+1 @@ -2990,6 +2993,10 @@ /* IHTMLScriptElement3 */ #define DISPID_IHTMLSCRIPTELEMENT3_IE8_SRC DISPID_IE8_SCRIPT +/* IHTMLDivElement */ +#define DISPID_IHTMLDIVELEMENT_ALIGN STDPROPID_XOBJ_BLOCKALIGN +#define DISPID_IHTMLDIVELEMENT_NOWRAP DISPID_A_NOWRAP + /* IHTMLObjectElement */ #define DISPID_IHTMLOBJECTELEMENT_OBJECT DISPID_OBJECT+1 #define DISPID_IHTMLOBJECTELEMENT_CLASSID DISPID_OBJECT+2 diff -Nru wine-staging-1.9.6/include/mshtml.idl wine-staging-1.9.7~ubuntu15.04.1/include/mshtml.idl --- wine-staging-1.9.6/include/mshtml.idl 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/include/mshtml.idl 2016-04-04 18:06:32.000000000 +0000 @@ -10724,6 +10724,24 @@ } /***************************************************************************** + * IHTMLHtmlElement interface + */ +[ + odl, + oleautomation, + dual, + uuid(3050f81c-98b5-11cf-bb82-00aa00bdce0b) +] +interface IHTMLHtmlElement : IDispatch +{ + [propput, id(DISPID_IHTMLHTMLELEMENT_VERSION), displaybind, bindable] + HRESULT version([in] BSTR v); + + [propget, id(DISPID_IHTMLHTMLELEMENT_VERSION), displaybind, bindable] + HRESULT version([out, retval] BSTR *p); +} + +/***************************************************************************** * IHTMLHeadElement interface */ [ @@ -10856,6 +10874,26 @@ } /***************************************************************************** + * DispHTMLHtmlElement interface + */ +[ + hidden, + uuid(3050f560-98b5-11cf-bb82-00aa00bdce0b) +] +dispinterface DispHTMLHtmlElement +{ +properties: +methods: + WINE_HTMLELEMENT_DISPINTERFACE_DECL; + + [propput, id(DISPID_IHTMLHTMLELEMENT_VERSION), displaybind, bindable] + void version(BSTR v); + + [propget, id(DISPID_IHTMLHTMLELEMENT_VERSION), displaybind, bindable] + BSTR version(); +} + +/***************************************************************************** * DispHTMLHeadElement interface */ [ @@ -17803,6 +17841,56 @@ } /***************************************************************************** + * IHTMLDivElement interface + */ +[ + odl, + oleautomation, + dual, + uuid(3050f200-98b5-11cf-bb82-00aa00bdce0b) +] +interface IHTMLDivElement : IDispatch +{ + [propput, id(DISPID_IHTMLDIVELEMENT_ALIGN), displaybind, bindable] + HRESULT align([in] BSTR v); + + [propget, id(DISPID_IHTMLDIVELEMENT_ALIGN), displaybind, bindable] + HRESULT align([out, retval] BSTR *p); + + [propput, id(DISPID_IHTMLDIVELEMENT_NOWRAP), displaybind, bindable] + HRESULT noWrap([in] VARIANT_BOOL v); + + [propget, id(DISPID_IHTMLDIVELEMENT_NOWRAP), displaybind, bindable] + HRESULT noWrap([out, retval] VARIANT_BOOL *p); +} + +/***************************************************************************** + * DispHTMLDivElement dispinterface + */ +[ + hidden, + uuid(3050f50c-98b5-11cf-bb82-00aa00bdce0b) +] +dispinterface DispHTMLDivElement +{ +properties: +methods: + WINE_HTMLELEMENT_DISPINTERFACE_DECL; + + [propput, id(DISPID_IHTMLDIVELEMENT_ALIGN), displaybind, bindable] + void align(BSTR v); + + [propget, id(DISPID_IHTMLDIVELEMENT_ALIGN), displaybind, bindable] + BSTR align(); + + [propput, id(DISPID_IHTMLDIVELEMENT_NOWRAP), displaybind, bindable] + void noWrap(VARIANT_BOOL v); + + [propget, id(DISPID_IHTMLDIVELEMENT_NOWRAP), displaybind, bindable] + VARIANT_BOOL noWrap(); +} + +/***************************************************************************** * IHTMLParamElement interface */ [ diff -Nru wine-staging-1.9.6/include/shimgdata.idl wine-staging-1.9.7~ubuntu15.04.1/include/shimgdata.idl --- wine-staging-1.9.6/include/shimgdata.idl 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/include/shimgdata.idl 2016-04-04 18:06:32.000000000 +0000 @@ -0,0 +1,93 @@ +/* + * Copyright 2016 Nikolay Sivov 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 + */ + +import "unknwn.idl"; +import "propidl.idl"; + +cpp_quote("#ifndef _GDIPLUSPIXELFORMATS_H") +typedef DWORD PixelFormat; +cpp_quote("#endif") + +cpp_quote("#ifndef _GDIPLUSENUMS_H") +typedef DWORD InterpolationMode; +cpp_quote("#endif") + +cpp_quote("#ifndef _GDIPLUSHEADERS_H") +typedef BYTE EncoderParameters; +typedef BYTE Image; +cpp_quote("#endif") + +[ + object, + uuid(53fb8e58-50c0-4003-b4aa-0c8df28e7f3a) +] +interface IShellImageDataAbort : IUnknown +{ + HRESULT QueryAbort(); +} + +[ + object, + local, + uuid(bfdeec12-8040-4403-a5ea-9e07dafcf530) +] +interface IShellImageData : IUnknown +{ + HRESULT Decode([in] DWORD flags, [in] ULONG cx_desired, [in] ULONG cy_desired); + HRESULT Draw([in] HDC hdc, [in] RECT *dest, [in] RECT *src); + HRESULT NextFrame(); + HRESULT NextPage(); + HRESULT PrevPage(); + HRESULT IsTransparent(); + HRESULT IsAnimated(); + HRESULT IsVector(); + HRESULT IsMultipage(); + HRESULT IsEditable(); + HRESULT IsPrintable(); + HRESULT IsDecoded(); + HRESULT GetCurrentPage([out] ULONG *page); + HRESULT GetPageCount([out] ULONG *count); + HRESULT SelectPage([in] ULONG page); + HRESULT GetSize([out] SIZE *size); + HRESULT GetRawDataFormat([out] GUID *format); + HRESULT GetPixelFormat([out] PixelFormat *format); + HRESULT GetDelay([out] DWORD *delay); + HRESULT GetProperties([in] DWORD mode, [out] IPropertySetStorage **props); + HRESULT Rotate([in] DWORD angle); + HRESULT Scale([in] ULONG cx, [in] ULONG cy, [in] InterpolationMode mode); + HRESULT DiscardEdit(); + HRESULT SetEncoderParams([in] IPropertyBag *params); + HRESULT DisplayName([size_is(count), in, out] LPWSTR name, UINT count); + HRESULT GetResolution([out] ULONG *res_x, [out] ULONG *res_y); + HRESULT GetEncoderParams([in] GUID *format, [out] EncoderParameters **params); + HRESULT RegisterAbort([in] IShellImageDataAbort *abort, [out] IShellImageDataAbort **prev); + HRESULT CloneFrame([out] Image **frame); + HRESULT ReplaceFrame([in] Image *frame); +} + +[ + object, + uuid(9be8ed5c-edab-4d75-90f3-bd5bdbb21c82) +] +interface IShellImageDataFactory : IUnknown +{ + HRESULT CreateIShellImageData([out] IShellImageData **data); + HRESULT CreateImageFromFile([in] LPCWSTR path, [out] IShellImageData **data); + HRESULT CreateImageFromStream([in] IStream *stream, [out] IShellImageData **data); + HRESULT GetDataFormatFromPath([in] LPCWSTR path, [out] GUID *format); +} diff -Nru wine-staging-1.9.6/include/t2embapi.h wine-staging-1.9.7~ubuntu15.04.1/include/t2embapi.h --- wine-staging-1.9.6/include/t2embapi.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/include/t2embapi.h 2016-04-04 18:06:32.000000000 +0000 @@ -39,6 +39,10 @@ /* Possible return values. */ #define E_NONE __MSABI_LONG(0x0000) #define E_API_NOTIMPL __MSABI_LONG(0x0001) +#define E_HDCINVALID __MSABI_LONG(0x0006) +#define E_NOTATRUETYPEFONT __MSABI_LONG(0x000a) +#define E_ERRORACCESSINGFONTDATA __MSABI_LONG(0x000c) +#define E_PERMISSIONSINVALID __MSABI_LONG(0x0117) typedef ULONG (WINAPIV * READEMBEDPROC)(void*,void*,ULONG); typedef ULONG (WINAPIV * WRITEEMBEDPROC)(void*,void*,ULONG); diff -Nru wine-staging-1.9.6/include/wincon.h wine-staging-1.9.7~ubuntu15.04.1/include/wincon.h --- wine-staging-1.9.6/include/wincon.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/include/wincon.h 2016-04-04 18:06:32.000000000 +0000 @@ -125,6 +125,9 @@ UINT FontWeight; WCHAR FaceName[LF_FACESIZE]; } CONSOLE_FONT_INFOEX,*LPCONSOLE_FONT_INFOEX; + +WINBASEAPI BOOL WINAPI GetCurrentConsoleFontEx(HANDLE,BOOL,LPCONSOLE_FONT_INFOEX); +WINBASEAPI BOOL WINAPI SetCurrentConsoleFontEx(HANDLE,BOOL,LPCONSOLE_FONT_INFOEX); #endif typedef struct tagCONSOLE_HISTORY_INFO @@ -347,7 +350,6 @@ #define GetConsoleTitle WINELIB_NAME_AW(GetConsoleTitle) WINBASEAPI HWND WINAPI GetConsoleWindow(void); WINBASEAPI BOOL WINAPI GetCurrentConsoleFont(HANDLE,BOOL,LPCONSOLE_FONT_INFO); -WINBASEAPI BOOL WINAPI GetCurrentConsoleFontEx(HANDLE,BOOL,LPCONSOLE_FONT_INFOEX); WINBASEAPI BOOL WINAPI GetNumberOfConsoleInputEvents( HANDLE,LPDWORD); WINBASEAPI BOOL WINAPI GetNumberOfConsoleMouseButtons(LPDWORD); WINBASEAPI BOOL WINAPI PeekConsoleInputA( HANDLE,PINPUT_RECORD,DWORD,LPDWORD); @@ -385,7 +387,6 @@ WINBASEAPI BOOL WINAPI SetConsoleTitleW(LPCWSTR); #define SetConsoleTitle WINELIB_NAME_AW(SetConsoleTitle) WINBASEAPI BOOL WINAPI SetConsoleWindowInfo( HANDLE,BOOL,LPSMALL_RECT); -WINBASEAPI BOOL WINAPI SetCurrentConsoleFontEx(HANDLE,BOOL,LPCONSOLE_FONT_INFOEX); WINBASEAPI BOOL WINAPI WriteConsoleA(HANDLE,const void *,DWORD,LPDWORD,void *); WINBASEAPI BOOL WINAPI WriteConsoleW(HANDLE,const void *,DWORD,LPDWORD,void *); #define WriteConsole WINELIB_NAME_AW(WriteConsole) diff -Nru wine-staging-1.9.6/include/wine/wined3d.h wine-staging-1.9.7~ubuntu15.04.1/include/wine/wined3d.h --- wine-staging-1.9.6/include/wine/wined3d.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/include/wine/wined3d.h 2016-04-04 18:06:32.000000000 +0000 @@ -747,11 +747,23 @@ 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_POSITION = 1, + WINED3D_SV_PRIMITIVE_ID = 7, + WINED3D_SV_INSTANCE_ID = 8, + WINED3D_SV_IS_FRONT_FACE = 9, + WINED3D_SV_SAMPLE_INDEX = 10, + WINED3D_SV_QUAD_U0_TESS_FACTOR = 11, + WINED3D_SV_QUAD_V0_TESS_FACTOR = 12, + WINED3D_SV_QUAD_U1_TESS_FACTOR = 13, + WINED3D_SV_QUAD_V1_TESS_FACTOR = 14, + WINED3D_SV_QUAD_U_INNER_TESS_FACTOR = 15, + WINED3D_SV_QUAD_V_INNER_TESS_FACTOR = 16, + WINED3D_SV_TRIANGLE_U_TESS_FACTOR = 17, + WINED3D_SV_TRIANGLE_V_TESS_FACTOR = 18, + WINED3D_SV_TRIANGLE_W_TESS_FACTOR = 19, + WINED3D_SV_TRIANGLE_INNER_TESS_FACTOR = 20, + WINED3D_SV_LINE_DETAIL_TESS_FACTOR = 21, + WINED3D_SV_LINE_DENSITY_TESS_FACTOR = 22, }; enum wined3d_scanline_ordering @@ -2373,8 +2385,12 @@ void * __cdecl wined3d_sampler_get_parent(const struct wined3d_sampler *sampler); ULONG __cdecl wined3d_sampler_incref(struct wined3d_sampler *sampler); +HRESULT __cdecl wined3d_shader_create_ds(struct wined3d_device *device, const struct wined3d_shader_desc *desc, + void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader); HRESULT __cdecl wined3d_shader_create_gs(struct wined3d_device *device, const struct wined3d_shader_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader); +HRESULT __cdecl wined3d_shader_create_hs(struct wined3d_device *device, const struct wined3d_shader_desc *desc, + void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader); HRESULT __cdecl wined3d_shader_create_ps(struct wined3d_device *device, const struct wined3d_shader_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader); HRESULT __cdecl wined3d_shader_create_vs(struct wined3d_device *device, const struct wined3d_shader_desc *desc, diff -Nru wine-staging-1.9.6/include/wingdi.h wine-staging-1.9.7~ubuntu15.04.1/include/wingdi.h --- wine-staging-1.9.6/include/wingdi.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/include/wingdi.h 2016-04-04 18:06:32.000000000 +0000 @@ -895,7 +895,7 @@ #define PAN_FAMILYTYPE_INDEX 0 #define PAN_SERIFSTYLE_INDEX 1 -#define PAN_WEIGTH_INDEX 2 +#define PAN_WEIGHT_INDEX 2 #define PAN_PROPORTION_INDEX 3 #define PAN_CONTRAST_INDEX 4 #define PAN_STROKEVARIATION_INDEX 5 diff -Nru wine-staging-1.9.6/include/winnt.h wine-staging-1.9.7~ubuntu15.04.1/include/winnt.h --- wine-staging-1.9.6/include/winnt.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/include/winnt.h 2016-04-04 18:06:32.000000000 +0000 @@ -5936,6 +5936,29 @@ } u; } TP_CALLBACK_ENVIRON_V1; +typedef struct _TP_CALLBACK_ENVIRON_V3 +{ + TP_VERSION Version; + PTP_POOL Pool; + PTP_CLEANUP_GROUP CleanupGroup; + PTP_CLEANUP_GROUP_CANCEL_CALLBACK CleanupGroupCancelCallback; + PVOID RaceDll; + struct _ACTIVATION_CONTEXT *ActivationContext; + PTP_SIMPLE_CALLBACK FinalizationCallback; + union + { + DWORD Flags; + struct + { + DWORD LongFunction:1; + DWORD Persistent:1; + DWORD Private:30; + } s; + } u; + TP_CALLBACK_PRIORITY CallbackPriority; + DWORD Size; +} TP_CALLBACK_ENVIRON_V3; + typedef struct _TP_WORK TP_WORK, *PTP_WORK; typedef struct _TP_TIMER TP_TIMER, *PTP_TIMER; diff -Nru wine-staging-1.9.6/include/winscard.h wine-staging-1.9.7~ubuntu15.04.1/include/winscard.h --- wine-staging-1.9.6/include/winscard.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/include/winscard.h 2016-04-04 18:06:32.000000000 +0000 @@ -120,8 +120,8 @@ LONG WINAPI SCardListInterfacesA(SCARDCONTEXT,LPCSTR,LPGUID,LPDWORD); LONG WINAPI SCardListInterfacesW(SCARDCONTEXT,LPCWSTR,LPGUID,LPDWORD); #define SCardListInterfaces WINELIB_NAME_AW(SCardListInterfaces) -LONG WINAPI SCardListReadersA(SCARDCONTEXT,LPCSTR,LPSTR,LPDWORD); -LONG WINAPI SCardListReadersW(SCARDCONTEXT,LPCWSTR,LPWSTR,LPDWORD); +LONG WINAPI SCardListReadersA(SCARDCONTEXT,const CHAR *,CHAR *,DWORD *); +LONG WINAPI SCardListReadersW(SCARDCONTEXT,const WCHAR *,WCHAR *,DWORD *); #define SCardListReaders WINELIB_NAME_AW(SCardListReaders) LONG WINAPI SCardListReaderGroupsA(SCARDCONTEXT,LPSTR,LPDWORD); LONG WINAPI SCardListReaderGroupsW(SCARDCONTEXT,LPWSTR,LPDWORD); diff -Nru wine-staging-1.9.6/include/xmllite.idl wine-staging-1.9.7~ubuntu15.04.1/include/xmllite.idl --- wine-staging-1.9.6/include/xmllite.idl 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/include/xmllite.idl 2016-04-04 18:06:32.000000000 +0000 @@ -300,3 +300,5 @@ cpp_quote("typedef IUnknown IXmlWriterOutput;") cpp_quote("STDAPI CreateXmlWriterOutputWithEncodingName(IUnknown *stream, IMalloc *pMalloc,") cpp_quote(" LPCWSTR encoding, IXmlWriterOutput **output);") +cpp_quote("STDAPI CreateXmlWriterOutputWithEncodingCodePage(IUnknown *stream, IMalloc *pMalloc,") +cpp_quote(" UINT codepage, IXmlWriterOutput **output);") diff -Nru wine-staging-1.9.6/patches/advapi32-RegNotifyChangeKeyValue/0001-advapi32-Fix-return-value-of-RegNotifyChangeKeyValue.patch wine-staging-1.9.7~ubuntu15.04.1/patches/advapi32-RegNotifyChangeKeyValue/0001-advapi32-Fix-return-value-of-RegNotifyChangeKeyValue.patch --- wine-staging-1.9.6/patches/advapi32-RegNotifyChangeKeyValue/0001-advapi32-Fix-return-value-of-RegNotifyChangeKeyValue.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/advapi32-RegNotifyChangeKeyValue/0001-advapi32-Fix-return-value-of-RegNotifyChangeKeyValue.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,74 @@ +From 63e3d8fa86ea5bb6dd9154754d57b680b00533ad Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Thu, 24 Mar 2016 02:42:22 +0100 +Subject: advapi32: Fix return value of RegNotifyChangeKeyValue for pending + events. + +Also remove handling for STATUS_TIMEOUT. Is it ever returned? +--- + dlls/advapi32/registry.c | 2 +- + dlls/advapi32/tests/registry.c | 28 ++++++++++++++++++++++++++++ + 2 files changed, 29 insertions(+), 1 deletion(-) + +diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c +index 7992384..4b3d852 100644 +--- a/dlls/advapi32/registry.c ++++ b/dlls/advapi32/registry.c +@@ -2760,7 +2760,7 @@ LSTATUS WINAPI RegNotifyChangeKeyValue( HKEY hkey, BOOL fWatchSubTree, + fdwNotifyFilter, fWatchSubTree, NULL, 0, + fAsync); + +- if (status && status != STATUS_TIMEOUT) ++ if (status && status != STATUS_PENDING) + return RtlNtStatusToDosError( status ); + + return ERROR_SUCCESS; +diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c +index f877b36..82f5015 100644 +--- a/dlls/advapi32/tests/registry.c ++++ b/dlls/advapi32/tests/registry.c +@@ -3452,6 +3452,33 @@ static void test_RegOpenCurrentUser(void) + RegCloseKey(key); + } + ++static void test_RegNotifyChangeKeyValue(void) ++{ ++ HKEY key, subkey; ++ HANDLE event; ++ DWORD dwret; ++ LONG ret; ++ ++ event = CreateEventW(NULL, FALSE, TRUE, NULL); ++ ok(event != NULL, "CreateEvent failed, error %u\n", GetLastError()); ++ ret = RegCreateKeyA(hkey_main, "TestKey", &key); ++ ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret); ++ ++ ret = RegNotifyChangeKeyValue(key, TRUE, REG_NOTIFY_CHANGE_NAME, event, TRUE); ++ ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret); ++ dwret = WaitForSingleObject(event, 0); ++ ok(dwret == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %u\n", dwret); ++ ++ ret = RegCreateKeyA(key, "SubKey", &subkey); ++ ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret); ++ dwret = WaitForSingleObject(event, 0); ++ ok(dwret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", dwret); ++ ++ RegDeleteKeyA(key, ""); ++ RegCloseKey(key); ++ CloseHandle(event); ++} ++ + START_TEST(registry) + { + /* Load pointers for functions that are not available in all Windows versions */ +@@ -3486,6 +3513,7 @@ START_TEST(registry) + test_delete_value(); + test_delete_key_value(); + test_RegOpenCurrentUser(); ++ test_RegNotifyChangeKeyValue(); + + /* cleanup */ + delete_key( hkey_main ); +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/advapi32-RegNotifyChangeKeyValue/definition wine-staging-1.9.7~ubuntu15.04.1/patches/advapi32-RegNotifyChangeKeyValue/definition --- wine-staging-1.9.6/patches/advapi32-RegNotifyChangeKeyValue/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/advapi32-RegNotifyChangeKeyValue/definition 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [39863] Fix return value of RegNotifyChangeKeyValue for pending events diff -Nru wine-staging-1.9.6/patches/api-ms-win-Stub_DLLs/0001-kernelbase-Add-dll-and-add-stub-for-QuirkIsEnabled.patch wine-staging-1.9.7~ubuntu15.04.1/patches/api-ms-win-Stub_DLLs/0001-kernelbase-Add-dll-and-add-stub-for-QuirkIsEnabled.patch --- wine-staging-1.9.6/patches/api-ms-win-Stub_DLLs/0001-kernelbase-Add-dll-and-add-stub-for-QuirkIsEnabled.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/api-ms-win-Stub_DLLs/0001-kernelbase-Add-dll-and-add-stub-for-QuirkIsEnabled.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,78 +1,76 @@ -From a86ba3ecb3dc441272294eb8e06baf06228f3ed4 Mon Sep 17 00:00:00 2001 +From 613105807eab97c1dfb68dc5497c007d8d92d417 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. --- - configure.ac | 1 + - dlls/kernelbase/Makefile.in | 4 + - dlls/kernelbase/kernelbase.spec | 1726 +++++++++++++++++++++++++++++++++++++++ - dlls/kernelbase/misc.c | 37 + + dlls/kernelbase/Makefile.in | 3 + + dlls/kernelbase/kernelbase.spec | 1309 +++++++++++++++++++++++++++++++++++---- + dlls/kernelbase/misc.c | 37 ++ dlls/shlwapi/shlwapi.spec | 2 +- - tools/make_specfiles | 7 + - 6 files changed, 1776 insertions(+), 1 deletion(-) - create mode 100644 dlls/kernelbase/Makefile.in - create mode 100644 dlls/kernelbase/kernelbase.spec + tools/make_specfiles | 8 +- + 5 files changed, 1250 insertions(+), 109 deletions(-) create mode 100644 dlls/kernelbase/misc.c -diff --git a/configure.ac b/configure.ac -index 9e0dcd9..8c3171c 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3006,6 +3006,7 @@ WINE_CONFIG_TEST(dlls/jscript/tests) - WINE_CONFIG_DLL(jsproxy,,[implib]) - WINE_CONFIG_DLL(kernel32,,[clean,implib]) - WINE_CONFIG_TEST(dlls/kernel32/tests) -+WINE_CONFIG_DLL(kernelbase) - WINE_CONFIG_DLL(keyboard.drv16,enable_win16) - WINE_CONFIG_DLL(krnl386.exe16,enable_win16,[implib],[kernel]) - WINE_CONFIG_DLL(ksuser) diff --git a/dlls/kernelbase/Makefile.in b/dlls/kernelbase/Makefile.in -new file mode 100644 -index 0000000..2beb34b ---- /dev/null +index b9caed0..2beb34b 100644 +--- a/dlls/kernelbase/Makefile.in +++ b/dlls/kernelbase/Makefile.in -@@ -0,0 +1,4 @@ -+MODULE = kernelbase.dll +@@ -1 +1,4 @@ + MODULE = kernelbase.dll + +C_SRCS = \ + misc.c diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec -new file mode 100644 -index 0000000..d85e5b1 ---- /dev/null +index b9e95ca..8fdb80d 100644 +--- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec -@@ -0,0 +1,1726 @@ +@@ -1,53 +1,131 @@ +-@ stub AccessCheck +-@ stub AccessCheckAndAuditAlarmW +-@ stub AccessCheckByType +# On Windows 10 kernelbase contains the implementation and kernel32 is redirected +# but this breaks some old applications which can't handle redirections. + -+@ stub PackageSidFromProductId -+@ stub GetCPHashNode -+@ stub GetNamedLocaleHashNode -+@ stdcall -norelay InterlockedPushListSList(ptr ptr ptr long) kernel32.InterlockedPushListSList -+@ stub InternalLcidToName +@ stdcall AccessCheck(ptr long long ptr ptr ptr ptr ptr) advapi32.AccessCheck +@ stdcall AccessCheckAndAuditAlarmW(wstr ptr wstr wstr ptr long ptr long ptr ptr ptr) advapi32.AccessCheckAndAuditAlarmW +@ stdcall AccessCheckByType(ptr ptr long long ptr long ptr ptr ptr ptr ptr) advapi32.AccessCheckByType -+@ stub AccessCheckByTypeAndAuditAlarmW -+@ stub AccessCheckByTypeResultList -+@ stub AccessCheckByTypeResultListAndAuditAlarmByHandleW -+@ stub AccessCheckByTypeResultListAndAuditAlarmW -+@ stdcall AcquireSRWLockExclusive(ptr) kernel32.AcquireSRWLockExclusive -+@ stdcall AcquireSRWLockShared(ptr) kernel32.AcquireSRWLockShared + @ stub AccessCheckByTypeAndAuditAlarmW + @ stub AccessCheckByTypeResultList + @ stub AccessCheckByTypeResultListAndAuditAlarmByHandleW + @ stub AccessCheckByTypeResultListAndAuditAlarmW + @ stdcall AcquireSRWLockExclusive(ptr) kernel32.AcquireSRWLockExclusive + @ stdcall AcquireSRWLockShared(ptr) kernel32.AcquireSRWLockShared +-@ stub AddAccessAllowedAce +-@ stub AddAccessAllowedAceEx +-@ stub AddAccessAllowedObjectAce +-@ stub AddAccessDeniedAce +-@ stub AddAccessDeniedAceEx +-@ stub AddAccessDeniedObjectAce +-@ stub AddAce +-@ stub AddAuditAccessAce +-@ stub AddAuditAccessAceEx +-@ stub AddAuditAccessObjectAce +@ stub AcquireStateLock +@ stdcall ActivateActCtx(ptr ptr) kernel32.ActivateActCtx +@ stdcall AddAccessAllowedAce(ptr long long ptr) advapi32.AddAccessAllowedAce +@ stdcall AddAccessAllowedAceEx(ptr long long long ptr) advapi32.AddAccessAllowedAceEx -+@ stub AddAccessAllowedObjectAce ++@ stdcall AddAccessAllowedObjectAce(ptr long long long ptr ptr ptr) advapi32.AddAccessAllowedObjectAce +@ stdcall AddAccessDeniedAce(ptr long long ptr) advapi32.AddAccessDeniedAce +@ stdcall AddAccessDeniedAceEx(ptr long long long ptr) advapi32.AddAccessDeniedAceEx -+@ stub AddAccessDeniedObjectAce ++@ stdcall AddAccessDeniedObjectAce(ptr long long long ptr ptr ptr) advapi32.AddAccessDeniedObjectAce +@ stdcall AddAce(ptr long long ptr long) advapi32.AddAce +@ stdcall AddAuditAccessAce(ptr long long ptr long long) advapi32.AddAuditAccessAce +@ stdcall AddAuditAccessAceEx(ptr long long long ptr long long) advapi32.AddAuditAccessAceEx -+@ stub AddAuditAccessObjectAce -+@ stub AddDllDirectory ++@ stdcall AddAuditAccessObjectAce(ptr long long long ptr ptr ptr long long) advapi32.AddAuditAccessObjectAce + @ stub AddDllDirectory +-@ stub AddMandatoryAce +-@ stub AdjustTokenGroups +-@ stub AdjustTokenPrivileges +-@ stub AllocateAndInitializeSid +-@ stub AllocateLocallyUniqueId +-@ stub AreAllAccessesGranted +-@ stub AreAnyAccessesGranted +@ stdcall AddMandatoryAce(ptr long long long ptr) advapi32.AddMandatoryAce +@ stdcall AddRefActCtx(ptr) kernel32.AddRefActCtx +@ stub AddResourceAttributeAce @@ -109,15 +107,21 @@ +@ stub ApplicationUserModelIdFromProductId +@ stdcall AreAllAccessesGranted(long long) advapi32.AreAllAccessesGranted +@ stdcall AreAnyAccessesGranted(long long) advapi32.AreAnyAccessesGranted -+@ stdcall AreFileApisANSI() kernel32.AreFileApisANSI + @ stdcall AreFileApisANSI() kernel32.AreFileApisANSI +@ stub AreThereVisibleLogoffScriptsInternal +@ stub AreThereVisibleShutdownScriptsInternal +@ stdcall AttachConsole(long) kernel32.AttachConsole +@ stub BaseCheckAppcompatCache +@ stub BaseCheckAppcompatCacheEx +@ stub BaseCleanupAppcompatCacheSupport -+@ stub BaseDllFreeResourceId -+@ stub BaseDllMapResourceIdW + @ stub BaseDllFreeResourceId + @ stub BaseDllMapResourceIdW +-@ stub BaseGetProcessDllPath +-@ stub BaseGetProcessExePath +-@ stub BaseInvalidateDllSearchPathCache +-@ stub BaseInvalidateProcessSearchPathCache +-@ stub BaseReleaseProcessDllPath +-@ stub BaseReleaseProcessExePath +@ stub BaseDumpAppcompatCache +@ stub BaseFlushAppcompatCache +@ stub BaseFormatObjectAttributes @@ -132,17 +136,22 @@ +@ stub BasepCopyFileCallback +@ stub BasepCopyFileExW +@ stub BasepNotifyTrackingService -+@ stdcall Beep(long long) kernel32.Beep + @ stdcall Beep(long long) kernel32.Beep +-@ stub BemCopyReference +-@ stub BemCreateContractFrom +-@ stub BemCreateReference +-@ stub BemFreeContract +-@ stub BemFreeReference +@ stub CLOSE_LOCAL_HANDLE_INTERNAL -+@ stdcall CallbackMayRunLong(ptr) kernel32.CallbackMayRunLong + @ stdcall CallbackMayRunLong(ptr) kernel32.CallbackMayRunLong +@ stub CalloutOnFiberStack +@ stdcall CancelIo(long) kernel32.CancelIo -+@ stdcall CancelIoEx(long ptr) kernel32.CancelIoEx + @ stdcall CancelIoEx(long ptr) kernel32.CancelIoEx +@ stdcall CancelSynchronousIo(long) kernel32.CancelSynchronousIo -+@ stub CancelThreadpoolIo -+@ stdcall CancelWaitableTimer(long) kernel32.CancelWaitableTimer + @ stub CancelThreadpoolIo + @ stdcall CancelWaitableTimer(long) kernel32.CancelWaitableTimer +@ stub CeipIsOptedIn -+@ stdcall ChangeTimerQueueTimer(ptr ptr long long) kernel32.ChangeTimerQueueTimer + @ stdcall ChangeTimerQueueTimer(ptr ptr long long) kernel32.ChangeTimerQueueTimer +@ stdcall CharLowerA(str) user32.CharLowerA +@ stdcall CharLowerBuffA(str long) user32.CharLowerBuffA +@ stdcall CharLowerBuffW(wstr long) user32.CharLowerBuffW @@ -157,7 +166,8 @@ +@ stdcall CharUpperBuffA(str long) user32.CharUpperBuffA +@ stdcall CharUpperBuffW(wstr long) user32.CharUpperBuffW +@ stdcall CharUpperW(wstr) user32.CharUpperW -+@ stub CheckGroupPolicyEnabled + @ stub CheckGroupPolicyEnabled +-@ stub CheckTokenMembership +@ stub CheckIfStateChangeNotificationExists +@ stdcall CheckRemoteDebuggerPresent(long ptr) kernel32.CheckRemoteDebuggerPresent +@ stub CheckTokenCapability @@ -168,7 +178,7 @@ +@ stdcall ClearCommBreak(long) kernel32.ClearCommBreak +@ stdcall ClearCommError(long ptr ptr) kernel32.ClearCommError +@ stub CloseGlobalizationUserSettingsKey -+@ stdcall CloseHandle(long) kernel32.CloseHandle + @ stdcall CloseHandle(long) kernel32.CloseHandle +@ stub ClosePackageInfo +@ stub ClosePrivateNamespace +@ stub CloseState @@ -176,23 +186,25 @@ +@ stub CloseStateChangeNotification +@ stub CloseStateContainer +@ stub CloseStateLock -+@ stdcall CloseThreadpool(ptr) kernel32.CloseThreadpool -+@ stdcall CloseThreadpoolCleanupGroup(ptr) kernel32.CloseThreadpoolCleanupGroup -+@ stdcall CloseThreadpoolCleanupGroupMembers(ptr long ptr) kernel32.CloseThreadpoolCleanupGroupMembers -+@ stub CloseThreadpoolIo -+@ stdcall CloseThreadpoolTimer(ptr) kernel32.CloseThreadpoolTimer -+@ stdcall CloseThreadpoolWait(ptr) kernel32.CloseThreadpoolWait -+@ stdcall CloseThreadpoolWork(ptr) kernel32.CloseThreadpoolWork + @ stdcall CloseThreadpool(ptr) kernel32.CloseThreadpool + @ stdcall CloseThreadpoolCleanupGroup(ptr) kernel32.CloseThreadpoolCleanupGroup + @ stdcall CloseThreadpoolCleanupGroupMembers(ptr long ptr) kernel32.CloseThreadpoolCleanupGroupMembers +@@ -55,39 +133,75 @@ + @ stdcall CloseThreadpoolTimer(ptr) kernel32.CloseThreadpoolTimer + @ stdcall CloseThreadpoolWait(ptr) kernel32.CloseThreadpoolWait + @ stdcall CloseThreadpoolWork(ptr) kernel32.CloseThreadpoolWork +@ stub CommitStateAtom -+@ stdcall CompareFileTime(ptr ptr) kernel32.CompareFileTime + @ stdcall CompareFileTime(ptr ptr) kernel32.CompareFileTime +@ stub CompareObjectHandles -+@ stdcall CompareStringA(long long str long str long) kernel32.CompareStringA -+@ stdcall CompareStringEx(wstr long wstr long wstr long ptr ptr long) kernel32.CompareStringEx -+@ stdcall CompareStringOrdinal(wstr long wstr long long) kernel32.CompareStringOrdinal -+@ stdcall CompareStringW(long long wstr long wstr long) kernel32.CompareStringW -+@ stdcall ConnectNamedPipe(long ptr) kernel32.ConnectNamedPipe + @ stdcall CompareStringA(long long str long str long) kernel32.CompareStringA + @ stdcall CompareStringEx(wstr long wstr long wstr long ptr ptr long) kernel32.CompareStringEx + @ stdcall CompareStringOrdinal(wstr long wstr long long) kernel32.CompareStringOrdinal + @ stdcall CompareStringW(long long wstr long wstr long) kernel32.CompareStringW + @ stdcall ConnectNamedPipe(long ptr) kernel32.ConnectNamedPipe +@ stdcall ContinueDebugEvent(long long long) kernel32.ContinueDebugEvent -+@ stdcall ConvertDefaultLocale(long) kernel32.ConvertDefaultLocale + @ stdcall ConvertDefaultLocale(long) kernel32.ConvertDefaultLocale +-@ stub ConvertToAutoInheritPrivateObjectSecurity +-@ stub CopySid +@ stdcall ConvertFiberToThread() kernel32.ConvertFiberToThread +@ stdcall ConvertThreadToFiber(ptr) kernel32.ConvertThreadToFiber +@ stdcall ConvertThreadToFiberEx(ptr long) kernel32.ConvertThreadToFiberEx @@ -206,34 +218,37 @@ +@ stub CreateAppContainerToken +@ stub CreateBoundaryDescriptorW +@ stdcall CreateConsoleScreenBuffer(long long ptr long ptr) kernel32.CreateConsoleScreenBuffer -+@ stdcall CreateDirectoryA(str ptr) kernel32.CreateDirectoryA + @ stdcall CreateDirectoryA(str ptr) kernel32.CreateDirectoryA +@ stdcall CreateDirectoryExW(wstr wstr ptr) kernel32.CreateDirectoryExW -+@ stdcall CreateDirectoryW(wstr ptr) kernel32.CreateDirectoryW -+@ stdcall CreateEventA(ptr long long str) kernel32.CreateEventA -+@ stdcall CreateEventExA(ptr str long long) kernel32.CreateEventExA -+@ stdcall CreateEventExW(ptr wstr long long) kernel32.CreateEventExW -+@ stdcall CreateEventW(ptr long long wstr) kernel32.CreateEventW + @ stdcall CreateDirectoryW(wstr ptr) kernel32.CreateDirectoryW + @ stdcall CreateEventA(ptr long long str) kernel32.CreateEventA + @ stdcall CreateEventExA(ptr str long long) kernel32.CreateEventExA + @ stdcall CreateEventExW(ptr wstr long long) kernel32.CreateEventExW + @ stdcall CreateEventW(ptr long long wstr) kernel32.CreateEventW +@ stdcall CreateFiber(long ptr ptr) kernel32.CreateFiber +@ stdcall CreateFiberEx(long long long ptr ptr) kernel32.CreateFiberEx +@ stdcall CreateFile2(wstr long long long ptr) kernel32.CreateFile2 -+@ stdcall CreateFileA(str long long ptr long long long) kernel32.CreateFileA + @ stdcall CreateFileA(str long long ptr long long long) kernel32.CreateFileA +@ stub CreateFileMappingFromApp -+@ stub CreateFileMappingNumaW -+@ stdcall CreateFileMappingW(long ptr long long long wstr) kernel32.CreateFileMappingW -+@ stdcall CreateFileW(wstr long long ptr long long long) kernel32.CreateFileW + @ stub CreateFileMappingNumaW + @ stdcall CreateFileMappingW(long ptr long long long wstr) kernel32.CreateFileMappingW + @ stdcall CreateFileW(wstr long long ptr long long long) kernel32.CreateFileW +@ stdcall CreateHardLinkA(str str ptr) kernel32.CreateHardLinkA +@ stdcall CreateHardLinkW(wstr wstr ptr) kernel32.CreateHardLinkW -+@ stdcall CreateIoCompletionPort(long long long long) kernel32.CreateIoCompletionPort + @ stdcall CreateIoCompletionPort(long long long long) kernel32.CreateIoCompletionPort +@ stdcall CreateMemoryResourceNotification(long) kernel32.CreateMemoryResourceNotification -+@ stdcall CreateMutexA(ptr long str) kernel32.CreateMutexA -+@ stdcall CreateMutexExA(ptr str long long) kernel32.CreateMutexExA -+@ stdcall CreateMutexExW(ptr wstr long long) kernel32.CreateMutexExW -+@ stdcall CreateMutexW(ptr long wstr) kernel32.CreateMutexW -+@ stdcall CreateNamedPipeW(wstr long long long long long long ptr) kernel32.CreateNamedPipeW -+@ stdcall CreatePipe(ptr ptr ptr long) kernel32.CreatePipe + @ stdcall CreateMutexA(ptr long str) kernel32.CreateMutexA + @ stdcall CreateMutexExA(ptr str long long) kernel32.CreateMutexExA + @ stdcall CreateMutexExW(ptr wstr long long) kernel32.CreateMutexExW + @ stdcall CreateMutexW(ptr long wstr) kernel32.CreateMutexW + @ stdcall CreateNamedPipeW(wstr long long long long long long ptr) kernel32.CreateNamedPipeW + @ stdcall CreatePipe(ptr ptr ptr long) kernel32.CreatePipe +-@ stub CreatePrivateObjectSecurity +-@ stub CreatePrivateObjectSecurityEx +-@ stub CreatePrivateObjectSecurityWithMultipleInheritance +@ stub CreatePrivateNamespaceW +@ stdcall CreatePrivateObjectSecurity(ptr ptr ptr long long ptr) advapi32.CreatePrivateObjectSecurity -+@ stub CreatePrivateObjectSecurityEx ++@ stdcall CreatePrivateObjectSecurityEx(ptr ptr ptr ptr long long long ptr) advapi32.CreatePrivateObjectSecurityEx +@ stdcall CreatePrivateObjectSecurityWithMultipleInheritance(ptr ptr ptr ptr long long long long ptr) advapi32.CreatePrivateObjectSecurityWithMultipleInheritance +@ stdcall CreateProcessA(str str ptr ptr long long ptr str ptr ptr) kernel32.CreateProcessA +@ stdcall CreateProcessAsUserA(long str str ptr ptr long long ptr str ptr ptr) advapi32.CreateProcessAsUserA @@ -241,10 +256,11 @@ +@ stub CreateProcessInternalA +@ stub CreateProcessInternalW +@ stdcall CreateProcessW(wstr wstr ptr ptr long long ptr wstr ptr ptr) kernel32.CreateProcessW -+@ stdcall CreateRemoteThread(long ptr long ptr long long ptr) kernel32.CreateRemoteThread -+@ stub CreateRemoteThreadEx + @ stdcall CreateRemoteThread(long ptr long ptr long long ptr) kernel32.CreateRemoteThread + @ stub CreateRemoteThreadEx +-@ stub CreateRestrictedToken +@ stdcall CreateRestrictedToken(long long long ptr long ptr long ptr ptr) advapi32.CreateRestrictedToken -+@ stdcall CreateSemaphoreExW(ptr long long wstr long long) kernel32.CreateSemaphoreExW + @ stdcall CreateSemaphoreExW(ptr long long wstr long long) kernel32.CreateSemaphoreExW +@ stdcall CreateSemaphoreW(ptr long long wstr) kernel32.CreateSemaphoreW +@ stub CreateStateAtom +@ stub CreateStateChangeNotification @@ -252,50 +268,50 @@ +@ stub CreateStateLock +@ stub CreateStateSubcontainer +@ stdcall CreateSymbolicLinkW(wstr wstr long) kernel32.CreateSymbolicLinkW -+@ stdcall CreateThread(ptr long ptr long long ptr) kernel32.CreateThread -+@ stdcall CreateThreadpool(ptr) kernel32.CreateThreadpool -+@ stdcall CreateThreadpoolCleanupGroup() kernel32.CreateThreadpoolCleanupGroup -+@ stub CreateThreadpoolIo -+@ stdcall CreateThreadpoolTimer(ptr ptr ptr) kernel32.CreateThreadpoolTimer -+@ stdcall CreateThreadpoolWait(ptr ptr ptr) kernel32.CreateThreadpoolWait -+@ stdcall CreateThreadpoolWork(ptr ptr ptr) kernel32.CreateThreadpoolWork -+@ stdcall CreateTimerQueue() kernel32.CreateTimerQueue -+@ stdcall CreateTimerQueueTimer(ptr long ptr ptr long long long) kernel32.CreateTimerQueueTimer -+@ stdcall CreateWaitableTimerExW(ptr wstr long long) kernel32.CreateWaitableTimerExW + @ stdcall CreateThread(ptr long ptr long long ptr) kernel32.CreateThread + @ stdcall CreateThreadpool(ptr) kernel32.CreateThreadpool + @ stdcall CreateThreadpoolCleanupGroup() kernel32.CreateThreadpoolCleanupGroup +@@ -98,38 +212,86 @@ + @ stdcall CreateTimerQueue() kernel32.CreateTimerQueue + @ stdcall CreateTimerQueueTimer(ptr long ptr ptr long long long) kernel32.CreateTimerQueueTimer + @ stdcall CreateWaitableTimerExW(ptr wstr long long) kernel32.CreateWaitableTimerExW +-@ stub CreateWellKnownSid +@ stdcall CreateWaitableTimerW(ptr long wstr) kernel32.CreateWaitableTimerW +@ stdcall CreateWellKnownSid(long ptr ptr ptr) advapi32.CreateWellKnownSid +@ stub CtrlRoutine +@ stdcall DeactivateActCtx(long ptr) kernel32.DeactivateActCtx +@ stdcall DebugActiveProcess(long) kernel32.DebugActiveProcess +@ stdcall DebugActiveProcessStop(long) kernel32.DebugActiveProcessStop -+@ stdcall DebugBreak() kernel32.DebugBreak -+@ stdcall DecodePointer(ptr) kernel32.DecodePointer + @ stdcall DebugBreak() kernel32.DebugBreak + @ stdcall DecodePointer(ptr) kernel32.DecodePointer +@ stub DecodeRemotePointer -+@ stub DecodeSystemPointer -+@ stdcall DefineDosDeviceW(long wstr wstr) kernel32.DefineDosDeviceW + @ stub DecodeSystemPointer + @ stdcall DefineDosDeviceW(long wstr wstr) kernel32.DefineDosDeviceW +-@ stub DeleteAce +@ stdcall DelayLoadFailureHook(str str) kernel32.DelayLoadFailureHook +@ stub DelayLoadFailureHookLookup +@ stdcall DeleteAce(ptr long) advapi32.DeleteAce +@ stub DeleteBoundaryDescriptor -+@ stdcall DeleteCriticalSection(ptr) kernel32.DeleteCriticalSection + @ stdcall DeleteCriticalSection(ptr) kernel32.DeleteCriticalSection +@ stdcall DeleteFiber(ptr) kernel32.DeleteFiber -+@ stdcall DeleteFileA(str) kernel32.DeleteFileA -+@ stdcall DeleteFileW(wstr) kernel32.DeleteFileW -+@ stub DeleteProcThreadAttributeList + @ stdcall DeleteFileA(str) kernel32.DeleteFileA + @ stdcall DeleteFileW(wstr) kernel32.DeleteFileW + @ stub DeleteProcThreadAttributeList +@ stub DeleteStateAtomValue +@ stub DeleteStateContainer +@ stub DeleteStateContainerValue +@ stub DeleteSynchronizationBarrier -+@ stdcall DeleteTimerQueueEx(long long) kernel32.DeleteTimerQueueEx -+@ stdcall DeleteTimerQueueTimer(long long long) kernel32.DeleteTimerQueueTimer -+@ stdcall DeleteVolumeMountPointW(wstr) kernel32.DeleteVolumeMountPointW + @ stdcall DeleteTimerQueueEx(long long) kernel32.DeleteTimerQueueEx + @ stdcall DeleteTimerQueueTimer(long long long) kernel32.DeleteTimerQueueTimer + @ stdcall DeleteVolumeMountPointW(wstr) kernel32.DeleteVolumeMountPointW +-@ stub DestroyPrivateObjectSecurity +@ stdcall DestroyPrivateObjectSecurity(ptr) advapi32.DestroyPrivateObjectSecurity -+@ stdcall DeviceIoControl(long long ptr long ptr long ptr ptr) kernel32.DeviceIoControl + @ stdcall DeviceIoControl(long long ptr long ptr long ptr ptr) kernel32.DeviceIoControl +@ stub DisablePredefinedHandleTableInternal -+@ stdcall DisableThreadLibraryCalls(long) kernel32.DisableThreadLibraryCalls -+@ stdcall DisassociateCurrentThreadFromCallback(ptr) kernel32.DisassociateCurrentThreadFromCallback + @ stdcall DisableThreadLibraryCalls(long) kernel32.DisableThreadLibraryCalls + @ stdcall DisassociateCurrentThreadFromCallback(ptr) kernel32.DisassociateCurrentThreadFromCallback +@ stub DiscardVirtualMemory -+@ stdcall DisconnectNamedPipe(long) kernel32.DisconnectNamedPipe + @ stdcall DisconnectNamedPipe(long) kernel32.DisconnectNamedPipe +@ stub DnsHostnameToComputerNameExW +@ stub DsBindWithSpnExW +@ stub DsCrackNamesW @@ -308,26 +324,28 @@ +@ stub DsReadNgcKeyW +@ stub DsUnBindW +@ stub DsWriteNgcKeyW -+@ stdcall DuplicateHandle(long long long ptr long long long) kernel32.DuplicateHandle + @ stdcall DuplicateHandle(long long long ptr long long long) kernel32.DuplicateHandle +-@ stub DuplicateToken +-@ stub DuplicateTokenEx +@ stub DuplicateStateContainerHandle +@ stdcall DuplicateToken(long long ptr) advapi32.DuplicateToken +@ stdcall DuplicateTokenEx(long long ptr long long ptr) advapi32.DuplicateTokenEx +@ stub EmptyWorkingSet -+@ stdcall EncodePointer(ptr) kernel32.EncodePointer + @ stdcall EncodePointer(ptr) kernel32.EncodePointer +@ stub EncodeRemotePointer -+@ stub EncodeSystemPointer + @ stub EncodeSystemPointer +@ stub EnterCriticalPolicySectionInternal -+@ stdcall EnterCriticalSection(ptr) kernel32.EnterCriticalSection + @ stdcall EnterCriticalSection(ptr) kernel32.EnterCriticalSection +@ stub EnterSynchronizationBarrier -+@ stdcall EnumCalendarInfoExEx(ptr wstr long wstr long long) kernel32.EnumCalendarInfoExEx -+@ stdcall EnumCalendarInfoExW(ptr long long long) kernel32.EnumCalendarInfoExW -+@ stdcall EnumCalendarInfoW(ptr long long long) kernel32.EnumCalendarInfoW -+@ stdcall EnumDateFormatsExEx(ptr wstr long long) kernel32.EnumDateFormatsExEx -+@ stdcall EnumDateFormatsExW(ptr long long) kernel32.EnumDateFormatsExW -+@ stdcall EnumDateFormatsW(ptr long long) kernel32.EnumDateFormatsW + @ stdcall EnumCalendarInfoExEx(ptr wstr long wstr long long) kernel32.EnumCalendarInfoExEx + @ stdcall EnumCalendarInfoExW(ptr long long long) kernel32.EnumCalendarInfoExW + @ stdcall EnumCalendarInfoW(ptr long long long) kernel32.EnumCalendarInfoW + @ stdcall EnumDateFormatsExEx(ptr wstr long long) kernel32.EnumDateFormatsExEx + @ stdcall EnumDateFormatsExW(ptr long long) kernel32.EnumDateFormatsExW + @ stdcall EnumDateFormatsW(ptr long long) kernel32.EnumDateFormatsW +@ stub EnumDeviceDrivers +@ stub EnumDynamicTimeZoneInformation -+@ stdcall EnumLanguageGroupLocalesW(ptr long long ptr) kernel32.EnumLanguageGroupLocalesW + @ stdcall EnumLanguageGroupLocalesW(ptr long long ptr) kernel32.EnumLanguageGroupLocalesW +@ stub EnumPageFilesA +@ stub EnumPageFilesW +@ stub EnumProcessModules @@ -339,19 +357,21 @@ +@ stub EnumResourceNamesExW +@ stub EnumResourceTypesExA +@ stub EnumResourceTypesExW -+@ stdcall EnumSystemCodePagesW(ptr long) kernel32.EnumSystemCodePagesW + @ stdcall EnumSystemCodePagesW(ptr long) kernel32.EnumSystemCodePagesW +@ stub EnumSystemFirmwareTables +@ stdcall EnumSystemGeoID(long long ptr) kernel32.EnumSystemGeoID -+@ stdcall EnumSystemLanguageGroupsW(ptr long ptr) kernel32.EnumSystemLanguageGroupsW -+@ stdcall EnumSystemLocalesA(ptr long) kernel32.EnumSystemLocalesA -+@ stdcall EnumSystemLocalesEx(ptr long long ptr) kernel32.EnumSystemLocalesEx -+@ stdcall EnumSystemLocalesW(ptr long) kernel32.EnumSystemLocalesW -+@ stdcall EnumTimeFormatsEx(ptr wstr long long) kernel32.EnumTimeFormatsEx -+@ stdcall EnumTimeFormatsW(ptr long long) kernel32.EnumTimeFormatsW -+@ stdcall EnumUILanguagesW(ptr long long) kernel32.EnumUILanguagesW + @ stdcall EnumSystemLanguageGroupsW(ptr long ptr) kernel32.EnumSystemLanguageGroupsW + @ stdcall EnumSystemLocalesA(ptr long) kernel32.EnumSystemLocalesA + @ stdcall EnumSystemLocalesEx(ptr long long ptr) kernel32.EnumSystemLocalesEx +@@ -137,9 +299,22 @@ + @ stdcall EnumTimeFormatsEx(ptr wstr long long) kernel32.EnumTimeFormatsEx + @ stdcall EnumTimeFormatsW(ptr long long) kernel32.EnumTimeFormatsW + @ stdcall EnumUILanguagesW(ptr long long) kernel32.EnumUILanguagesW +@ stub EnumerateStateAtomValues +@ stub EnumerateStateContainerItems -+@ stub EqualDomainSid + @ stub EqualDomainSid +-@ stub EqualPrefixSid +-@ stub EqualSid +@ stdcall EqualPrefixSid(ptr ptr) advapi32.EqualPrefixSid +@ stdcall EqualSid(ptr ptr) advapi32.EqualSid +@ stdcall EscapeCommFunction(long long) kernel32.EscapeCommFunction @@ -365,72 +385,75 @@ +@ stub EventWriteEx +@ stub EventWriteString +@ stub EventWriteTransfer -+@ stdcall ExitProcess(long) kernel32.ExitProcess -+@ stdcall ExitThread(long) kernel32.ExitThread -+@ stdcall ExpandEnvironmentStringsA(str ptr long) kernel32.ExpandEnvironmentStringsA -+@ stdcall ExpandEnvironmentStringsW(wstr ptr long) kernel32.ExpandEnvironmentStringsW -+@ stdcall FatalAppExitA(long str) kernel32.FatalAppExitA -+@ stdcall FatalAppExitW(long wstr) kernel32.FatalAppExitW -+@ stdcall FileTimeToLocalFileTime(ptr ptr) kernel32.FileTimeToLocalFileTime -+@ stdcall FileTimeToSystemTime(ptr ptr) kernel32.FileTimeToSystemTime + @ stdcall ExitProcess(long) kernel32.ExitProcess + @ stdcall ExitThread(long) kernel32.ExitThread + @ stdcall ExpandEnvironmentStringsA(str ptr long) kernel32.ExpandEnvironmentStringsA +@@ -148,6 +323,11 @@ + @ stdcall FatalAppExitW(long wstr) kernel32.FatalAppExitW + @ stdcall FileTimeToLocalFileTime(ptr ptr) kernel32.FileTimeToLocalFileTime + @ stdcall FileTimeToSystemTime(ptr ptr) kernel32.FileTimeToSystemTime +@ stdcall FillConsoleOutputAttribute(long long long long ptr) kernel32.FillConsoleOutputAttribute +@ stdcall FillConsoleOutputCharacterA(long long long long ptr) kernel32.FillConsoleOutputCharacterA +@ stdcall FillConsoleOutputCharacterW(long long long long ptr) kernel32.FillConsoleOutputCharacterW +@ stdcall FindActCtxSectionGuid(long ptr long ptr ptr) kernel32.FindActCtxSectionGuid +@ stdcall FindActCtxSectionStringW(long ptr long wstr ptr) kernel32.FindActCtxSectionStringW -+@ stdcall FindClose(long) kernel32.FindClose -+@ stdcall FindCloseChangeNotification(long) kernel32.FindCloseChangeNotification -+@ stdcall FindFirstChangeNotificationA(str long long) kernel32.FindFirstChangeNotificationA -+@ stdcall FindFirstChangeNotificationW(wstr long long) kernel32.FindFirstChangeNotificationW -+@ stdcall FindFirstFileA(str ptr) kernel32.FindFirstFileA -+@ stdcall FindFirstFileExA(str long ptr long ptr long) kernel32.FindFirstFileExA -+@ stdcall FindFirstFileExW(wstr long ptr long ptr long) kernel32.FindFirstFileExW + @ stdcall FindClose(long) kernel32.FindClose + @ stdcall FindCloseChangeNotification(long) kernel32.FindCloseChangeNotification + @ stdcall FindFirstChangeNotificationA(str long long) kernel32.FindFirstChangeNotificationA +@@ -155,64 +335,141 @@ + @ stdcall FindFirstFileA(str ptr) kernel32.FindFirstFileA + @ stdcall FindFirstFileExA(str long ptr long ptr long) kernel32.FindFirstFileExA + @ stdcall FindFirstFileExW(wstr long ptr long ptr long) kernel32.FindFirstFileExW +@ stub FindFirstFileNameW -+@ stdcall FindFirstFileW(wstr ptr) kernel32.FindFirstFileW + @ stdcall FindFirstFileW(wstr ptr) kernel32.FindFirstFileW +-@ stub FindFirstFreeAce +@ stdcall FindFirstFreeAce(ptr ptr) advapi32.FindFirstFreeAce +@ stub FindFirstStreamW -+@ stdcall FindFirstVolumeW(ptr long) kernel32.FindFirstVolumeW -+@ stub FindNLSString -+@ stub FindNLSStringEx -+@ stdcall FindNextChangeNotification(long) kernel32.FindNextChangeNotification -+@ stdcall FindNextFileA(long ptr) kernel32.FindNextFileA + @ stdcall FindFirstVolumeW(ptr long) kernel32.FindFirstVolumeW + @ stub FindNLSString + @ stub FindNLSStringEx + @ stdcall FindNextChangeNotification(long) kernel32.FindNextChangeNotification + @ stdcall FindNextFileA(long ptr) kernel32.FindNextFileA +@ stub FindNextFileNameW -+@ stdcall FindNextFileW(long ptr) kernel32.FindNextFileW + @ stdcall FindNextFileW(long ptr) kernel32.FindNextFileW +@ stub FindNextStreamW -+@ stdcall FindNextVolumeW(long ptr long) kernel32.FindNextVolumeW + @ stdcall FindNextVolumeW(long ptr long) kernel32.FindNextVolumeW +@ stub FindPackagesByPackageFamily -+@ stdcall FindResourceExW(long wstr wstr long) kernel32.FindResourceExW + @ stdcall FindResourceExW(long wstr wstr long) kernel32.FindResourceExW +@ stdcall FindResourceW(long wstr wstr) kernel32.FindResourceW -+@ stub FindStringOrdinal -+@ stdcall FindVolumeClose(ptr) kernel32.FindVolumeClose -+@ stdcall FlsAlloc(ptr) kernel32.FlsAlloc -+@ stdcall FlsFree(long) kernel32.FlsFree -+@ stdcall FlsGetValue(long) kernel32.FlsGetValue -+@ stdcall FlsSetValue(long ptr) kernel32.FlsSetValue + @ stub FindStringOrdinal + @ stdcall FindVolumeClose(ptr) kernel32.FindVolumeClose + @ stdcall FlsAlloc(ptr) kernel32.FlsAlloc + @ stdcall FlsFree(long) kernel32.FlsFree + @ stdcall FlsGetValue(long) kernel32.FlsGetValue + @ stdcall FlsSetValue(long ptr) kernel32.FlsSetValue +@ stdcall FlushConsoleInputBuffer(long) kernel32.FlushConsoleInputBuffer -+@ stdcall FlushFileBuffers(long) kernel32.FlushFileBuffers + @ stdcall FlushFileBuffers(long) kernel32.FlushFileBuffers +@ stdcall FlushInstructionCache(long long long) kernel32.FlushInstructionCache -+@ stdcall FlushProcessWriteBuffers() kernel32.FlushProcessWriteBuffers -+@ stdcall FlushViewOfFile(ptr long) kernel32.FlushViewOfFile -+@ stdcall FoldStringW(long wstr long ptr long) kernel32.FoldStringW + @ stdcall FlushProcessWriteBuffers() kernel32.FlushProcessWriteBuffers + @ stdcall FlushViewOfFile(ptr long) kernel32.FlushViewOfFile + @ stdcall FoldStringW(long wstr long ptr long) kernel32.FoldStringW +@ stub ForceSyncFgPolicyInternal +@ stub FormatApplicationUserModelId -+@ stdcall FormatMessageA(long ptr long long ptr long ptr) kernel32.FormatMessageA -+@ stdcall FormatMessageW(long ptr long long ptr long ptr) kernel32.FormatMessageW + @ stdcall FormatMessageA(long ptr long long ptr long ptr) kernel32.FormatMessageA + @ stdcall FormatMessageW(long ptr long long ptr long ptr) kernel32.FormatMessageW +@ stdcall FreeConsole() kernel32.FreeConsole -+@ stdcall FreeEnvironmentStringsA(ptr) kernel32.FreeEnvironmentStringsA -+@ stdcall FreeEnvironmentStringsW(ptr) kernel32.FreeEnvironmentStringsW + @ stdcall FreeEnvironmentStringsA(ptr) kernel32.FreeEnvironmentStringsA + @ stdcall FreeEnvironmentStringsW(ptr) kernel32.FreeEnvironmentStringsW +@ stub FreeGPOListInternalA +@ stub FreeGPOListInternalW -+@ stdcall FreeLibrary(long) kernel32.FreeLibrary -+@ stdcall FreeLibraryAndExitThread(long long) kernel32.FreeLibraryAndExitThread -+@ stdcall FreeLibraryWhenCallbackReturns(ptr ptr) kernel32.FreeLibraryWhenCallbackReturns -+@ stdcall FreeResource(long) kernel32.FreeResource + @ stdcall FreeLibrary(long) kernel32.FreeLibrary + @ stdcall FreeLibraryAndExitThread(long long) kernel32.FreeLibraryAndExitThread + @ stdcall FreeLibraryWhenCallbackReturns(ptr ptr) kernel32.FreeLibraryWhenCallbackReturns + @ stdcall FreeResource(long) kernel32.FreeResource +-@ stub FreeSid +@ stdcall FreeSid(ptr) advapi32.FreeSid +@ stdcall FreeUserPhysicalPages(long ptr ptr) kernel32.FreeUserPhysicalPages +@ stdcall GenerateConsoleCtrlEvent(long long) kernel32.GenerateConsoleCtrlEvent +@ stub GenerateGPNotificationInternal -+@ stdcall GetACP() kernel32.GetACP + @ stdcall GetACP() kernel32.GetACP +-@ stub GetAce +-@ stub GetAclInformation +@ stdcall GetAcceptLanguagesA(ptr ptr) shlwapi.GetAcceptLanguagesA +@ stdcall GetAcceptLanguagesW(ptr ptr) shlwapi.GetAcceptLanguagesW +@ stdcall GetAce(ptr long ptr) advapi32.GetAce @@ -447,25 +470,26 @@ +@ stub GetApplicationUserModelIdFromToken +@ stub GetAppliedGPOListInternalA +@ stub GetAppliedGPOListInternalW -+@ stub GetCPFileNameFromRegistry -+@ stdcall GetCPInfo(long ptr) kernel32.GetCPInfo -+@ stdcall GetCPInfoExW(long long ptr) kernel32.GetCPInfoExW + @ stub GetCPFileNameFromRegistry + @ stub GetCPHashNode + @ stdcall GetCPInfo(long ptr) kernel32.GetCPInfo + @ stdcall GetCPInfoExW(long long ptr) kernel32.GetCPInfoExW +@ stub GetCachedSigningLevel -+@ stub GetCalendar -+@ stdcall GetCalendarInfoEx(wstr long ptr long ptr long ptr) kernel32.GetCalendarInfoEx -+@ stdcall GetCalendarInfoW(long long long ptr long ptr) kernel32.GetCalendarInfoW + @ stub GetCalendar + @ stdcall GetCalendarInfoEx(wstr long ptr long ptr long ptr) kernel32.GetCalendarInfoEx + @ stdcall GetCalendarInfoW(long long long ptr long ptr) kernel32.GetCalendarInfoW +@ stdcall GetCommConfig(long ptr long) kernel32.GetCommConfig +@ stdcall GetCommMask(long ptr) kernel32.GetCommMask +@ stdcall GetCommModemStatus(long ptr) kernel32.GetCommModemStatus +@ stdcall GetCommProperties(long ptr) kernel32.GetCommProperties +@ stdcall GetCommState(long ptr) kernel32.GetCommState +@ stdcall GetCommTimeouts(long ptr) kernel32.GetCommTimeouts -+@ stdcall GetCommandLineA() kernel32.GetCommandLineA -+@ stdcall GetCommandLineW() kernel32.GetCommandLineW + @ stdcall GetCommandLineA() kernel32.GetCommandLineA + @ stdcall GetCommandLineW() kernel32.GetCommandLineW +@ stdcall GetCompressedFileSizeA(long ptr) kernel32.GetCompressedFileSizeA +@ stdcall GetCompressedFileSizeW(long ptr) kernel32.GetCompressedFileSizeW -+@ stdcall GetComputerNameExA(long ptr ptr) kernel32.GetComputerNameExA -+@ stdcall GetComputerNameExW(long ptr ptr) kernel32.GetComputerNameExW + @ stdcall GetComputerNameExA(long ptr ptr) kernel32.GetComputerNameExA + @ stdcall GetComputerNameExW(long ptr ptr) kernel32.GetComputerNameExW +@ stdcall GetConsoleCP() kernel32.GetConsoleCP +@ stdcall GetConsoleCursorInfo(long ptr) kernel32.GetConsoleCursorInfo +@ stdcall GetConsoleInputExeNameA(long ptr) kernel32.GetConsoleInputExeNameA @@ -475,12 +499,12 @@ +@ stdcall GetConsoleScreenBufferInfo(long ptr) kernel32.GetConsoleScreenBufferInfo +@ stdcall GetConsoleScreenBufferInfoEx(long ptr) kernel32.GetConsoleScreenBufferInfoEx +@ stdcall GetConsoleTitleW(ptr long) kernel32.GetConsoleTitleW -+@ stub GetCurrencyFormatEx -+@ stdcall GetCurrencyFormatW(long long str ptr str long) kernel32.GetCurrencyFormatW + @ stub GetCurrencyFormatEx + @ stdcall GetCurrencyFormatW(long long str ptr str long) kernel32.GetCurrencyFormatW +@ stdcall GetCurrentActCtx(ptr) kernel32.GetCurrentActCtx +@ stub GetCurrentApplicationUserModelId -+@ stdcall GetCurrentDirectoryA(long ptr) kernel32.GetCurrentDirectoryA -+@ stdcall GetCurrentDirectoryW(long ptr) kernel32.GetCurrentDirectoryW + @ stdcall GetCurrentDirectoryA(long ptr) kernel32.GetCurrentDirectoryA + @ stdcall GetCurrentDirectoryW(long ptr) kernel32.GetCurrentDirectoryW +@ stub GetCurrentPackageApplicationContext +@ stub GetCurrentPackageApplicationResourcesContext +@ stub GetCurrentPackageContext @@ -491,13 +515,13 @@ +@ stub GetCurrentPackagePath +@ stub GetCurrentPackageResourcesContext +@ stub GetCurrentPackageSecurityContext -+@ stdcall -norelay GetCurrentProcess() kernel32.GetCurrentProcess -+@ stdcall -norelay GetCurrentProcessId() kernel32.GetCurrentProcessId + @ stdcall -norelay GetCurrentProcess() kernel32.GetCurrentProcess + @ stdcall -norelay GetCurrentProcessId() kernel32.GetCurrentProcessId +@ stdcall GetCurrentProcessorNumber() kernel32.GetCurrentProcessorNumber +@ stdcall GetCurrentProcessorNumberEx(ptr) kernel32.GetCurrentProcessorNumberEx +@ stub GetCurrentTargetPlatformContext -+@ stdcall -norelay GetCurrentThread() kernel32.GetCurrentThread -+@ stdcall -norelay GetCurrentThreadId() kernel32.GetCurrentThreadId + @ stdcall -norelay GetCurrentThread() kernel32.GetCurrentThread + @ stdcall -norelay GetCurrentThreadId() kernel32.GetCurrentThreadId +@ stub GetCurrentThreadStackLimits +@ stdcall GetDateFormatA(long long ptr str ptr long) kernel32.GetDateFormatA +@ stdcall GetDateFormatEx(wstr long ptr wstr ptr long wstr) kernel32.GetDateFormatEx @@ -506,42 +530,35 @@ +@ stub GetDeviceDriverBaseNameW +@ stub GetDeviceDriverFileNameA +@ stub GetDeviceDriverFileNameW -+@ stdcall GetDiskFreeSpaceA(str ptr ptr ptr ptr) kernel32.GetDiskFreeSpaceA -+@ stdcall GetDiskFreeSpaceExA(str ptr ptr ptr) kernel32.GetDiskFreeSpaceExA -+@ stdcall GetDiskFreeSpaceExW(wstr ptr ptr ptr) kernel32.GetDiskFreeSpaceExW -+@ stdcall GetDiskFreeSpaceW(wstr ptr ptr ptr ptr) kernel32.GetDiskFreeSpaceW -+@ stdcall GetDriveTypeA(str) kernel32.GetDriveTypeA -+@ stdcall GetDriveTypeW(wstr) kernel32.GetDriveTypeW + @ stdcall GetDiskFreeSpaceA(str ptr ptr ptr ptr) kernel32.GetDiskFreeSpaceA + @ stdcall GetDiskFreeSpaceExA(str ptr ptr ptr) kernel32.GetDiskFreeSpaceExA + @ stdcall GetDiskFreeSpaceExW(wstr ptr ptr ptr) kernel32.GetDiskFreeSpaceExW + @ stdcall GetDiskFreeSpaceW(wstr ptr ptr ptr ptr) kernel32.GetDiskFreeSpaceW + @ stdcall GetDriveTypeA(str) kernel32.GetDriveTypeA + @ stdcall GetDriveTypeW(wstr) kernel32.GetDriveTypeW +@ stub GetDurationFormatEx -+@ stdcall GetDynamicTimeZoneInformation(ptr) kernel32.GetDynamicTimeZoneInformation + @ stdcall GetDynamicTimeZoneInformation(ptr) kernel32.GetDynamicTimeZoneInformation +@ stub GetDynamicTimeZoneInformationEffectiveYears +@ stub GetEffectivePackageStatusForUser +@ stub GetEightBitStringToUnicodeSizeRoutine +@ stub GetEightBitStringToUnicodeStringRoutine +@ stub GetEnabledXStateFeatures -+@ stdcall GetEnvironmentStrings() kernel32.GetEnvironmentStrings -+@ stdcall GetEnvironmentStringsA() kernel32.GetEnvironmentStringsA -+@ stdcall GetEnvironmentStringsW() kernel32.GetEnvironmentStringsW -+@ stdcall GetEnvironmentVariableA(str ptr long) kernel32.GetEnvironmentVariableA -+@ stdcall GetEnvironmentVariableW(wstr ptr long) kernel32.GetEnvironmentVariableW -+@ stub GetEraNameCountedString -+@ stdcall GetErrorMode() kernel32.GetErrorMode -+@ stdcall GetExitCodeProcess(long ptr) kernel32.GetExitCodeProcess -+@ stdcall GetExitCodeThread(long ptr) kernel32.GetExitCodeThread -+@ stub GetFallbackDisplayName -+@ stdcall GetFileAttributesA(str) kernel32.GetFileAttributesA -+@ stdcall GetFileAttributesExA(str long ptr) kernel32.GetFileAttributesExA -+@ stdcall GetFileAttributesExW(wstr long ptr) kernel32.GetFileAttributesExW -+@ stdcall GetFileAttributesW(wstr) kernel32.GetFileAttributesW -+@ stdcall GetFileInformationByHandle(long ptr) kernel32.GetFileInformationByHandle + @ stdcall GetEnvironmentStrings() kernel32.GetEnvironmentStrings + @ stdcall GetEnvironmentStringsA() kernel32.GetEnvironmentStringsA + @ stdcall GetEnvironmentStringsW() kernel32.GetEnvironmentStringsW +@@ -228,21 +485,38 @@ + @ stdcall GetFileAttributesExW(wstr long ptr) kernel32.GetFileAttributesExW + @ stdcall GetFileAttributesW(wstr) kernel32.GetFileAttributesW + @ stdcall GetFileInformationByHandle(long ptr) kernel32.GetFileInformationByHandle +@ stdcall GetFileInformationByHandleEx(long long ptr long) kernel32.GetFileInformationByHandleEx -+@ stdcall GetFileMUIInfo(long wstr ptr ptr) kernel32.GetFileMUIInfo -+@ stdcall GetFileMUIPath(long wstr wstr ptr ptr ptr ptr) kernel32.GetFileMUIPath + @ stdcall GetFileMUIInfo(long wstr ptr ptr) kernel32.GetFileMUIInfo + @ stdcall GetFileMUIPath(long wstr wstr ptr ptr ptr ptr) kernel32.GetFileMUIPath +-@ stub GetFileSecurityW +@ stdcall GetFileSecurityW(wstr long ptr long ptr) advapi32.GetFileSecurityW -+@ stdcall GetFileSize(long ptr) kernel32.GetFileSize -+@ stdcall GetFileSizeEx(long ptr) kernel32.GetFileSizeEx -+@ stdcall GetFileTime(long ptr ptr ptr) kernel32.GetFileTime -+@ stdcall GetFileType(long) kernel32.GetFileType + @ stdcall GetFileSize(long ptr) kernel32.GetFileSize + @ stdcall GetFileSizeEx(long ptr) kernel32.GetFileSizeEx + @ stdcall GetFileTime(long ptr ptr ptr) kernel32.GetFileTime + @ stdcall GetFileType(long) kernel32.GetFileType +@ stub GetFileVersionInfoA +@ stub GetFileVersionInfoByHandle +@ stub GetFileVersionInfoExA @@ -551,63 +568,62 @@ +@ stub GetFileVersionInfoSizeExW +@ stub GetFileVersionInfoSizeW +@ stub GetFileVersionInfoW -+@ stdcall GetFinalPathNameByHandleA(long ptr long long) kernel32.GetFinalPathNameByHandleA -+@ stdcall GetFinalPathNameByHandleW(long ptr long long) kernel32.GetFinalPathNameByHandleW -+@ stdcall GetFullPathNameA(str long ptr ptr) kernel32.GetFullPathNameA -+@ stdcall GetFullPathNameW(wstr long ptr ptr) kernel32.GetFullPathNameW + @ stdcall GetFinalPathNameByHandleA(long ptr long long) kernel32.GetFinalPathNameByHandleA + @ stdcall GetFinalPathNameByHandleW(long ptr long long) kernel32.GetFinalPathNameByHandleW + @ stdcall GetFullPathNameA(str long ptr ptr) kernel32.GetFullPathNameA + @ stdcall GetFullPathNameW(wstr long ptr ptr) kernel32.GetFullPathNameW +@ stub GetGPOListInternalA +@ stub GetGPOListInternalW +@ stdcall GetGeoInfoW(long long ptr long long) kernel32.GetGeoInfoW -+@ stdcall GetHandleInformation(long ptr) kernel32.GetHandleInformation + @ stdcall GetHandleInformation(long ptr) kernel32.GetHandleInformation +-@ stub GetKernelObjectSecurity +@ stub GetHivePath +@ stub GetIntegratedDisplaySize +@ stdcall GetKernelObjectSecurity(long long ptr long ptr) advapi32.GetKernelObjectSecurity +@ stub GetLargePageMinimum +@ stdcall GetLargestConsoleWindowSize(long) kernel32.GetLargestConsoleWindowSize -+@ stdcall GetLastError() kernel32.GetLastError + @ stdcall GetLastError() kernel32.GetLastError +-@ stub GetLengthSid +@ stdcall GetLengthSid(ptr) advapi32.GetLengthSid -+@ stdcall GetLocalTime(ptr) kernel32.GetLocalTime -+@ stdcall GetLocaleInfoA(long long ptr long) kernel32.GetLocaleInfoA -+@ stdcall GetLocaleInfoEx(wstr long ptr long) kernel32.GetLocaleInfoEx -+@ stub GetLocaleInfoHelper -+@ stdcall GetLocaleInfoW(long long ptr long) kernel32.GetLocaleInfoW -+@ stdcall GetLogicalDriveStringsW(long ptr) kernel32.GetLogicalDriveStringsW -+@ stdcall GetLogicalDrives() kernel32.GetLogicalDrives -+@ stdcall GetLogicalProcessorInformation(ptr ptr) kernel32.GetLogicalProcessorInformation -+@ stdcall GetLogicalProcessorInformationEx(long ptr ptr) kernel32.GetLogicalProcessorInformationEx -+@ stdcall GetLongPathNameA(str long long) kernel32.GetLongPathNameA -+@ stdcall GetLongPathNameW(wstr long long) kernel32.GetLongPathNameW + @ stdcall GetLocalTime(ptr) kernel32.GetLocalTime + @ stdcall GetLocaleInfoA(long long ptr long) kernel32.GetLocaleInfoA + @ stdcall GetLocaleInfoEx(wstr long ptr long) kernel32.GetLocaleInfoEx +@@ -254,98 +528,221 @@ + @ stdcall GetLogicalProcessorInformationEx(long ptr ptr) kernel32.GetLogicalProcessorInformationEx + @ stdcall GetLongPathNameA(str long long) kernel32.GetLongPathNameA + @ stdcall GetLongPathNameW(wstr long long) kernel32.GetLongPathNameW +@ stub GetMappedFileNameA +@ stub GetMappedFileNameW +@ stub GetMemoryErrorHandlingCapabilities +@ stub GetModuleBaseNameA +@ stub GetModuleBaseNameW -+@ stdcall GetModuleFileNameA(long ptr long) kernel32.GetModuleFileNameA + @ stdcall GetModuleFileNameA(long ptr long) kernel32.GetModuleFileNameA +@ stub GetModuleFileNameExA +@ stub GetModuleFileNameExW -+@ stdcall GetModuleFileNameW(long ptr long) kernel32.GetModuleFileNameW -+@ stdcall GetModuleHandleA(str) kernel32.GetModuleHandleA -+@ stdcall GetModuleHandleExA(long ptr ptr) kernel32.GetModuleHandleExA -+@ stdcall GetModuleHandleExW(long ptr ptr) kernel32.GetModuleHandleExW -+@ stdcall GetModuleHandleW(wstr) kernel32.GetModuleHandleW + @ stdcall GetModuleFileNameW(long ptr long) kernel32.GetModuleFileNameW + @ stdcall GetModuleHandleA(str) kernel32.GetModuleHandleA + @ stdcall GetModuleHandleExA(long ptr ptr) kernel32.GetModuleHandleExA + @ stdcall GetModuleHandleExW(long ptr ptr) kernel32.GetModuleHandleExW + @ stdcall GetModuleHandleW(wstr) kernel32.GetModuleHandleW +@ stub GetModuleInformation -+@ stub GetNLSVersion -+@ stub GetNLSVersionEx -+@ stub GetNamedPipeAttribute -+@ stub GetNamedPipeClientComputerNameW + @ stub GetNLSVersion + @ stub GetNLSVersionEx + @ stub GetNamedLocaleHashNode + @ stub GetNamedPipeAttribute + @ stub GetNamedPipeClientComputerNameW +@ stdcall GetNamedPipeHandleStateW(long ptr ptr ptr ptr wstr long) kernel32.GetNamedPipeHandleStateW +@ stdcall GetNamedPipeInfo(long ptr ptr ptr ptr) kernel32.GetNamedPipeInfo +@ stdcall GetNativeSystemInfo(ptr) kernel32.GetNativeSystemInfo +@ stub GetNextFgPolicyRefreshInfoInternal +@ stdcall GetNumaHighestNodeNumber(ptr) kernel32.GetNumaHighestNodeNumber +@ stub GetNumaNodeProcessorMaskEx -+@ stub GetNumberFormatEx -+@ stdcall GetNumberFormatW(long long wstr ptr ptr long) kernel32.GetNumberFormatW + @ stub GetNumberFormatEx + @ stdcall GetNumberFormatW(long long wstr ptr ptr long) kernel32.GetNumberFormatW +@ stdcall GetNumberOfConsoleInputEvents(long ptr) kernel32.GetNumberOfConsoleInputEvents -+@ stdcall GetOEMCP() kernel32.GetOEMCP + @ stdcall GetOEMCP() kernel32.GetOEMCP +@ stub GetOsManufacturingMode +@ stub GetOsSafeBootMode -+@ stdcall GetOverlappedResult(long ptr ptr long) kernel32.GetOverlappedResult + @ stdcall GetOverlappedResult(long ptr ptr long) kernel32.GetOverlappedResult +@ stub GetOverlappedResultEx +@ stub GetPackageApplicationContext +@ stub GetPackageApplicationIds @@ -640,36 +656,42 @@ +@ stub GetPerformanceInfo +@ stdcall GetPhysicallyInstalledSystemMemory(ptr) kernel32.GetPhysicallyInstalledSystemMemory +@ stub GetPreviousFgPolicyRefreshInfoInternal -+@ stdcall GetPriorityClass(long) kernel32.GetPriorityClass + @ stdcall GetPriorityClass(long) kernel32.GetPriorityClass +-@ stub GetPrivateObjectSecurity +@ stdcall GetPrivateObjectSecurity(ptr long ptr long ptr) advapi32.GetPrivateObjectSecurity -+@ stdcall GetProcAddress(long str) kernel32.GetProcAddress + @ stdcall GetProcAddress(long str) kernel32.GetProcAddress +@ stub GetProcAddressForCaller +@ stub GetProcessDefaultCpuSets +@ stub GetProcessGroupAffinity +@ stdcall GetProcessHandleCount(long ptr) kernel32.GetProcessHandleCount -+@ stdcall -norelay GetProcessHeap() kernel32.GetProcessHeap -+@ stdcall GetProcessHeaps(long ptr) kernel32.GetProcessHeaps -+@ stdcall GetProcessId(long) kernel32.GetProcessId -+@ stdcall GetProcessIdOfThread(long) kernel32.GetProcessIdOfThread + @ stdcall -norelay GetProcessHeap() kernel32.GetProcessHeap + @ stdcall GetProcessHeaps(long ptr) kernel32.GetProcessHeaps + @ stdcall GetProcessId(long) kernel32.GetProcessId + @ stdcall GetProcessIdOfThread(long) kernel32.GetProcessIdOfThread +@ stub GetProcessImageFileNameA +@ stub GetProcessImageFileNameW +@ stub GetProcessInformation +@ stub GetProcessMemoryInfo +@ stub GetProcessMitigationPolicy -+@ stub GetProcessPreferredUILanguages + @ stub GetProcessPreferredUILanguages +@ stdcall GetProcessPriorityBoost(long ptr) kernel32.GetProcessPriorityBoost +@ stdcall GetProcessShutdownParameters(ptr ptr) kernel32.GetProcessShutdownParameters -+@ stdcall GetProcessTimes(long ptr ptr ptr ptr) kernel32.GetProcessTimes -+@ stdcall GetProcessVersion(long) kernel32.GetProcessVersion + @ stdcall GetProcessTimes(long ptr ptr ptr ptr) kernel32.GetProcessTimes + @ stdcall GetProcessVersion(long) kernel32.GetProcessVersion +@ stub GetProcessWorkingSetSizeEx +@ stub GetProcessorSystemCycleTime +@ stdcall GetProductInfo(long long long long ptr) kernel32.GetProductInfo -+@ stub GetPtrCalData -+@ stub GetPtrCalDataArray + @ stub GetPtrCalData + @ stub GetPtrCalDataArray +@ stub GetPublisherCacheFolder +@ stub GetPublisherRootFolder -+@ stdcall GetQueuedCompletionStatus(long ptr ptr ptr long) kernel32.GetQueuedCompletionStatus -+@ stub GetQueuedCompletionStatusEx + @ stdcall GetQueuedCompletionStatus(long ptr ptr ptr long) kernel32.GetQueuedCompletionStatus + @ stub GetQueuedCompletionStatusEx +-@ stub GetSecurityDescriptorControl +-@ stub GetSecurityDescriptorDacl +-@ stub GetSecurityDescriptorGroup +-@ stub GetSecurityDescriptorLength +-@ stub GetSecurityDescriptorOwner +@ stub GetRegistryExtensionFlags +@ stub GetRoamingLastObservedChangeTime +@ stdcall GetSecurityDescriptorControl(ptr ptr ptr) advapi32.GetSecurityDescriptorControl @@ -677,134 +699,139 @@ +@ stdcall GetSecurityDescriptorGroup(ptr ptr ptr) advapi32.GetSecurityDescriptorGroup +@ stdcall GetSecurityDescriptorLength(ptr) advapi32.GetSecurityDescriptorLength +@ stdcall GetSecurityDescriptorOwner(ptr ptr ptr) advapi32.GetSecurityDescriptorOwner -+@ stub GetSecurityDescriptorRMControl + @ stub GetSecurityDescriptorRMControl +-@ stub GetSecurityDescriptorSacl +@ stdcall GetSecurityDescriptorSacl(ptr ptr ptr ptr) advapi32.GetSecurityDescriptorSacl +@ stub GetSerializedAtomBytes +@ stub GetSharedLocalFolder -+@ stdcall GetShortPathNameW(wstr ptr long) kernel32.GetShortPathNameW + @ stdcall GetShortPathNameW(wstr ptr long) kernel32.GetShortPathNameW +-@ stub GetSidIdentifierAuthority +-@ stub GetSidLengthRequired +-@ stub GetSidSubAuthority +-@ stub GetSidSubAuthorityCount +@ stdcall GetSidIdentifierAuthority(ptr) advapi32.GetSidIdentifierAuthority +@ stdcall GetSidLengthRequired(long) advapi32.GetSidLengthRequired +@ stdcall GetSidSubAuthority(ptr long) advapi32.GetSidSubAuthority +@ stdcall GetSidSubAuthorityCount(ptr) advapi32.GetSidSubAuthorityCount +@ stub GetStagedPackageOrigin +@ stub GetStagedPackagePathByFullName -+@ stdcall GetStartupInfoW(ptr) kernel32.GetStartupInfoW + @ stdcall GetStartupInfoW(ptr) kernel32.GetStartupInfoW +@ stub GetStateContainerDepth +@ stub GetStateFolder +@ stub GetStateRootFolder +@ stub GetStateRootFolderBase +@ stub GetStateSettingsFolder +@ stub GetStateVersion -+@ stdcall GetStdHandle(long) kernel32.GetStdHandle + @ stdcall GetStdHandle(long) kernel32.GetStdHandle +@ stub GetStringScripts -+@ stub GetStringTableEntry -+@ stdcall GetStringTypeA(long long str long ptr) kernel32.GetStringTypeA -+@ stdcall GetStringTypeExW(long long wstr long ptr) kernel32.GetStringTypeExW -+@ stdcall GetStringTypeW(long wstr long ptr) kernel32.GetStringTypeW + @ stub GetStringTableEntry + @ stdcall GetStringTypeA(long long str long ptr) kernel32.GetStringTypeA + @ stdcall GetStringTypeExW(long long wstr long ptr) kernel32.GetStringTypeExW + @ stdcall GetStringTypeW(long wstr long ptr) kernel32.GetStringTypeW +@ stub GetSystemAppDataFolder +@ stub GetSystemAppDataKey +@ stub GetSystemCpuSetInformation -+@ stdcall GetSystemDefaultLCID() kernel32.GetSystemDefaultLCID -+@ stdcall GetSystemDefaultLangID() kernel32.GetSystemDefaultLangID -+@ stdcall GetSystemDefaultLocaleName(ptr long) kernel32.GetSystemDefaultLocaleName -+@ stdcall GetSystemDefaultUILanguage() kernel32.GetSystemDefaultUILanguage -+@ stdcall GetSystemDirectoryA(ptr long) kernel32.GetSystemDirectoryA -+@ stdcall GetSystemDirectoryW(ptr long) kernel32.GetSystemDirectoryW + @ stdcall GetSystemDefaultLCID() kernel32.GetSystemDefaultLCID + @ stdcall GetSystemDefaultLangID() kernel32.GetSystemDefaultLangID + @ stdcall GetSystemDefaultLocaleName(ptr long) kernel32.GetSystemDefaultLocaleName + @ stdcall GetSystemDefaultUILanguage() kernel32.GetSystemDefaultUILanguage + @ stdcall GetSystemDirectoryA(ptr long) kernel32.GetSystemDirectoryA + @ stdcall GetSystemDirectoryW(ptr long) kernel32.GetSystemDirectoryW +@ stdcall GetSystemFileCacheSize(ptr ptr ptr) kernel32.GetSystemFileCacheSize +@ stdcall GetSystemFirmwareTable(long long ptr long) kernel32.GetSystemFirmwareTable -+@ stdcall GetSystemInfo(ptr) kernel32.GetSystemInfo + @ stdcall GetSystemInfo(ptr) kernel32.GetSystemInfo +@ stub GetSystemMetadataPath +@ stub GetSystemMetadataPathForPackage +@ stub GetSystemMetadataPathForPackageFamily -+@ stdcall GetSystemPreferredUILanguages(long ptr ptr ptr) kernel32.GetSystemPreferredUILanguages + @ stdcall GetSystemPreferredUILanguages(long ptr ptr ptr) kernel32.GetSystemPreferredUILanguages +@ stub GetSystemStateRootFolder -+@ stdcall GetSystemTime(ptr) kernel32.GetSystemTime -+@ stdcall GetSystemTimeAdjustment(ptr ptr ptr) kernel32.GetSystemTimeAdjustment -+@ stdcall GetSystemTimeAsFileTime(ptr) kernel32.GetSystemTimeAsFileTime + @ stdcall GetSystemTime(ptr) kernel32.GetSystemTime + @ stdcall GetSystemTimeAdjustment(ptr ptr ptr) kernel32.GetSystemTimeAdjustment + @ stdcall GetSystemTimeAsFileTime(ptr) kernel32.GetSystemTimeAsFileTime +@ stdcall GetSystemTimePreciseAsFileTime(ptr) kernel32.GetSystemTimePreciseAsFileTime +@ stdcall GetSystemTimes(ptr ptr ptr) kernel32.GetSystemTimes -+@ stdcall GetSystemWindowsDirectoryA(ptr long) kernel32.GetSystemWindowsDirectoryA -+@ stdcall GetSystemWindowsDirectoryW(ptr long) kernel32.GetSystemWindowsDirectoryW + @ stdcall GetSystemWindowsDirectoryA(ptr long) kernel32.GetSystemWindowsDirectoryA + @ stdcall GetSystemWindowsDirectoryW(ptr long) kernel32.GetSystemWindowsDirectoryW +@ stdcall GetSystemWow64DirectoryA(ptr long) kernel32.GetSystemWow64DirectoryA +@ stdcall GetSystemWow64DirectoryW(ptr long) kernel32.GetSystemWow64DirectoryW +@ stub GetTargetPlatformContext +@ stdcall GetTempFileNameA(str str long ptr) kernel32.GetTempFileNameA -+@ stdcall GetTempFileNameW(wstr wstr long ptr) kernel32.GetTempFileNameW + @ stdcall GetTempFileNameW(wstr wstr long ptr) kernel32.GetTempFileNameW +@ stdcall GetTempPathA(long ptr) kernel32.GetTempPathA +@ stdcall GetTempPathW(long ptr) kernel32.GetTempPathW +@ stdcall GetThreadContext(long ptr) kernel32.GetThreadContext +@ stdcall GetThreadErrorMode() kernel32.GetThreadErrorMode +@ stdcall GetThreadGroupAffinity(long ptr) kernel32.GetThreadGroupAffinity +@ stdcall GetThreadIOPendingFlag(long ptr) kernel32.GetThreadIOPendingFlag -+@ stdcall GetThreadId(ptr) kernel32.GetThreadId + @ stdcall GetThreadId(ptr) kernel32.GetThreadId +@ stub GetThreadIdealProcessorEx +@ stub GetThreadInformation -+@ stdcall GetThreadLocale() kernel32.GetThreadLocale -+@ stdcall GetThreadPreferredUILanguages(long ptr ptr ptr) kernel32.GetThreadPreferredUILanguages -+@ stdcall GetThreadPriority(long) kernel32.GetThreadPriority -+@ stdcall GetThreadPriorityBoost(long ptr) kernel32.GetThreadPriorityBoost + @ stdcall GetThreadLocale() kernel32.GetThreadLocale + @ stdcall GetThreadPreferredUILanguages(long ptr ptr ptr) kernel32.GetThreadPreferredUILanguages + @ stdcall GetThreadPriority(long) kernel32.GetThreadPriority + @ stdcall GetThreadPriorityBoost(long ptr) kernel32.GetThreadPriorityBoost +@ stub GetThreadSelectedCpuSets +@ stdcall GetThreadTimes(long ptr ptr ptr ptr) kernel32.GetThreadTimes -+@ stdcall GetThreadUILanguage() kernel32.GetThreadUILanguage -+@ stdcall -ret64 GetTickCount64() kernel32.GetTickCount64 -+@ stdcall GetTickCount() kernel32.GetTickCount + @ stdcall GetThreadUILanguage() kernel32.GetThreadUILanguage + @ stdcall GetTickCount() kernel32.GetTickCount + @ stdcall -ret64 GetTickCount64() kernel32.GetTickCount64 +@ stdcall GetTimeFormatA(long long ptr str ptr long) kernel32.GetTimeFormatA +@ 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 -+@ stdcall GetTimeZoneInformationForYear(long ptr ptr) kernel32.GetTimeZoneInformationForYear + @ stdcall GetTimeZoneInformation(ptr) kernel32.GetTimeZoneInformation + @ stdcall GetTimeZoneInformationForYear(long ptr ptr) kernel32.GetTimeZoneInformationForYear +-@ stub GetTokenInformation +@ stdcall GetTokenInformation(long long ptr long ptr) advapi32.GetTokenInformation +@ stdcall GetTraceEnableFlags(int64) advapi32.GetTraceEnableFlags +@ stdcall GetTraceEnableLevel(int64) advapi32.GetTraceEnableLevel +@ stdcall -ret64 GetTraceLoggerHandle(ptr) advapi32.GetTraceLoggerHandle -+@ stub GetUILanguageInfo + @ stub GetUILanguageInfo +@ stub GetUnicodeStringToEightBitSizeRoutine +@ stub GetUnicodeStringToEightBitStringRoutine -+@ stdcall GetUserDefaultLCID() kernel32.GetUserDefaultLCID -+@ stdcall GetUserDefaultLangID() kernel32.GetUserDefaultLangID -+@ stdcall GetUserDefaultLocaleName(ptr long) kernel32.GetUserDefaultLocaleName -+@ stdcall GetUserDefaultUILanguage() kernel32.GetUserDefaultUILanguage + @ stdcall GetUserDefaultLCID() kernel32.GetUserDefaultLCID + @ stdcall GetUserDefaultLangID() kernel32.GetUserDefaultLangID + @ stdcall GetUserDefaultLocaleName(ptr long) kernel32.GetUserDefaultLocaleName + @ stdcall GetUserDefaultUILanguage() kernel32.GetUserDefaultUILanguage +@ stdcall GetUserGeoID(long) kernel32.GetUserGeoID -+@ stub GetUserInfo -+@ stub GetUserInfoWord + @ stub GetUserInfo + @ stub GetUserInfoWord +@ stub GetUserOverrideString +@ stub GetUserOverrideWord -+@ stdcall GetUserPreferredUILanguages(long ptr ptr ptr) kernel32.GetUserPreferredUILanguages -+@ stdcall GetVersion() kernel32.GetVersion -+@ stdcall GetVersionExA(ptr) kernel32.GetVersionExA -+@ stdcall GetVersionExW(ptr) kernel32.GetVersionExW + @ stdcall GetUserPreferredUILanguages(long ptr ptr ptr) kernel32.GetUserPreferredUILanguages + @ stdcall GetVersion() kernel32.GetVersion + @ stdcall GetVersionExA(ptr) kernel32.GetVersionExA + @ stdcall GetVersionExW(ptr) kernel32.GetVersionExW +@ stdcall GetVolumeInformationA(str ptr long ptr ptr ptr ptr long) kernel32.GetVolumeInformationA -+@ stub GetVolumeInformationByHandleW -+@ stdcall GetVolumeInformationW(wstr ptr long ptr ptr ptr ptr long) kernel32.GetVolumeInformationW + @ stub GetVolumeInformationByHandleW + @ stdcall GetVolumeInformationW(wstr ptr long ptr ptr ptr ptr long) kernel32.GetVolumeInformationW +@ stdcall GetVolumeNameForVolumeMountPointW(wstr ptr long) kernel32.GetVolumeNameForVolumeMountPointW -+@ stdcall GetVolumePathNameW(wstr ptr long) kernel32.GetVolumePathNameW + @ stdcall GetVolumePathNameW(wstr ptr long) kernel32.GetVolumePathNameW +-@ stub GetWindowsAccountDomainSid +@ stdcall GetVolumePathNamesForVolumeNameW(wstr ptr long ptr) kernel32.GetVolumePathNamesForVolumeNameW +@ stdcall GetWindowsAccountDomainSid(ptr ptr ptr) advapi32.GetWindowsAccountDomainSid -+@ stdcall GetWindowsDirectoryA(ptr long) kernel32.GetWindowsDirectoryA -+@ stdcall GetWindowsDirectoryW(ptr long) kernel32.GetWindowsDirectoryW + @ stdcall GetWindowsDirectoryA(ptr long) kernel32.GetWindowsDirectoryA + @ stdcall GetWindowsDirectoryW(ptr long) kernel32.GetWindowsDirectoryW +@ stdcall GetWriteWatch(long ptr long ptr ptr ptr) kernel32.GetWriteWatch +@ stub GetWsChanges +@ stub GetWsChangesEx +@ stub GetXStateFeaturesMask -+@ stdcall GlobalAlloc(long long) kernel32.GlobalAlloc -+@ stdcall GlobalFree(long) kernel32.GlobalFree -+@ stdcall GlobalMemoryStatusEx(ptr) kernel32.GlobalMemoryStatusEx + @ stdcall GlobalAlloc(long long) kernel32.GlobalAlloc + @ stdcall GlobalFree(long) kernel32.GlobalFree + @ stdcall GlobalMemoryStatusEx(ptr) kernel32.GlobalMemoryStatusEx +@ stub HasPolicyForegroundProcessingCompletedInternal +@ stdcall HashData(ptr long ptr long) shlwapi.HashData -+@ stdcall HeapAlloc(long long long) kernel32.HeapAlloc -+@ stdcall HeapCompact(long long) kernel32.HeapCompact -+@ stdcall HeapCreate(long long long) kernel32.HeapCreate -+@ stdcall HeapDestroy(long) kernel32.HeapDestroy -+@ stdcall HeapFree(long long ptr) kernel32.HeapFree -+@ stdcall HeapLock(long) kernel32.HeapLock -+@ stdcall HeapQueryInformation(long long ptr long ptr) kernel32.HeapQueryInformation -+@ stdcall HeapReAlloc(long long ptr long) kernel32.HeapReAlloc -+@ stdcall HeapSetInformation(ptr long ptr long) kernel32.HeapSetInformation -+@ stdcall HeapSize(long long ptr) kernel32.HeapSize -+@ stub HeapSummary -+@ stdcall HeapUnlock(long) kernel32.HeapUnlock -+@ stdcall HeapValidate(long long ptr) kernel32.HeapValidate -+@ stdcall HeapWalk(long ptr) kernel32.HeapWalk + @ stdcall HeapAlloc(long long long) kernel32.HeapAlloc + @ stdcall HeapCompact(long long) kernel32.HeapCompact + @ stdcall HeapCreate(long long long) kernel32.HeapCreate +@@ -360,23 +757,43 @@ + @ stdcall HeapUnlock(long) kernel32.HeapUnlock + @ stdcall HeapValidate(long long ptr) kernel32.HeapValidate + @ stdcall HeapWalk(long ptr) kernel32.HeapWalk +-@ stub ImpersonateAnonymousToken +-@ stub ImpersonateLoggedOnUser +-@ stub ImpersonateNamedPipeClient +-@ stub ImpersonateSelf +-@ stub InitializeAcl +@ stdcall IdnToAscii(long wstr long ptr long) kernel32.IdnToAscii +@ stdcall IdnToNameprepUnicode(long wstr long ptr long) kernel32.IdnToNameprepUnicode +@ stdcall IdnToUnicode(long wstr long ptr long) kernel32.IdnToUnicode @@ -820,35 +847,38 @@ +@ stdcall InitializeAcl(ptr long long) advapi32.InitializeAcl +@ stdcall InitializeConditionVariable(ptr) kernel32.InitializeConditionVariable +@ stub InitializeContext -+@ stdcall InitializeCriticalSection(ptr) kernel32.InitializeCriticalSection -+@ stdcall InitializeCriticalSectionAndSpinCount(ptr long) kernel32.InitializeCriticalSectionAndSpinCount -+@ stdcall InitializeCriticalSectionEx(ptr long long) kernel32.InitializeCriticalSectionEx -+@ stub InitializeProcThreadAttributeList + @ stdcall InitializeCriticalSection(ptr) kernel32.InitializeCriticalSection + @ stdcall InitializeCriticalSectionAndSpinCount(ptr long) kernel32.InitializeCriticalSectionAndSpinCount + @ stdcall InitializeCriticalSectionEx(ptr long long) kernel32.InitializeCriticalSectionEx + @ stub InitializeProcThreadAttributeList +@ stub InitializeProcessForWsWatch -+@ stdcall InitializeSListHead(ptr) kernel32.InitializeSListHead -+@ stdcall InitializeSRWLock(ptr) kernel32.InitializeSRWLock + @ stdcall InitializeSListHead(ptr) kernel32.InitializeSListHead + @ stdcall InitializeSRWLock(ptr) kernel32.InitializeSRWLock +-@ stub InitializeSecurityDescriptor +-@ stub InitializeSid +@ stdcall InitializeSecurityDescriptor(ptr long) advapi32.InitializeSecurityDescriptor +@ stdcall InitializeSid(ptr ptr long) advapi32.InitializeSid +@ stub InitializeSynchronizationBarrier +@ stub InstallELAMCertificateInfo -+@ stdcall -arch=i386 -ret64 InterlockedCompareExchange64(ptr int64 int64) kernel32.InterlockedCompareExchange64 +@ stdcall -arch=i386 InterlockedCompareExchange(ptr long long) kernel32.InterlockedCompareExchange ++@ stdcall -arch=i386 -ret64 InterlockedCompareExchange64(ptr int64 int64) kernel32.InterlockedCompareExchange64 +@ stdcall -arch=i386 InterlockedDecrement(ptr) kernel32.InterlockedDecrement +@ stdcall -arch=i386 InterlockedExchange(ptr long) kernel32.InterlockedExchange +@ stdcall -arch=i386 InterlockedExchangeAdd(ptr long ) kernel32.InterlockedExchangeAdd -+@ stdcall InterlockedFlushSList(ptr) kernel32.InterlockedFlushSList + @ stdcall InterlockedFlushSList(ptr) kernel32.InterlockedFlushSList +@ stdcall -arch=i386 InterlockedIncrement(ptr) kernel32.InterlockedIncrement -+@ stdcall InterlockedPopEntrySList(ptr) kernel32.InterlockedPopEntrySList -+@ stdcall InterlockedPushEntrySList(ptr ptr) kernel32.InterlockedPushEntrySList + @ stdcall InterlockedPopEntrySList(ptr) kernel32.InterlockedPopEntrySList + @ stdcall InterlockedPushEntrySList(ptr ptr) kernel32.InterlockedPushEntrySList + @ stdcall -norelay InterlockedPushListSList(ptr ptr ptr long) kernel32.InterlockedPushListSList +@ stdcall InterlockedPushListSListEx(ptr ptr ptr long) kernel32.InterlockedPushListSListEx -+@ stub Internal_EnumCalendarInfo -+@ stub Internal_EnumDateFormats -+@ stub Internal_EnumLanguageGroupLocales -+@ stub Internal_EnumSystemCodePages -+@ stub Internal_EnumSystemLanguageGroups -+@ stub Internal_EnumSystemLocales -+@ stub Internal_EnumTimeFormats -+@ stub Internal_EnumUILanguages + @ stub InternalLcidToName + @ stub Internal_EnumCalendarInfo + @ stub Internal_EnumDateFormats +@@ -386,38 +803,101 @@ + @ stub Internal_EnumSystemLocales + @ stub Internal_EnumTimeFormats + @ stub Internal_EnumUILanguages +-@ stub InvalidateTzSpecificCache +@ stub InternetTimeFromSystemTimeA +@ stub InternetTimeFromSystemTimeW +@ stub InternetTimeToSystemTimeA @@ -869,35 +899,40 @@ +@ stdcall IsCharUpperA(long) user32.IsCharUpperA +@ stdcall IsCharUpperW(long) user32.IsCharUpperW +@ stdcall IsCharXDigitW(long) shlwapi.IsCharXDigitW -+@ stdcall IsDBCSLeadByte(long) kernel32.IsDBCSLeadByte -+@ stdcall IsDBCSLeadByteEx(long long) kernel32.IsDBCSLeadByteEx -+@ stdcall IsDebuggerPresent() kernel32.IsDebuggerPresent + @ stdcall IsDBCSLeadByte(long) kernel32.IsDBCSLeadByte + @ stdcall IsDBCSLeadByteEx(long long) kernel32.IsDBCSLeadByteEx + @ stdcall IsDebuggerPresent() kernel32.IsDebuggerPresent +@ stub IsDeveloperModeEnabled +@ stub IsDeveloperModePolicyApplied +@ stdcall IsInternetESCEnabled() shlwapi.IsInternetESCEnabled -+@ stub IsNLSDefinedString + @ stub IsNLSDefinedString +@ stdcall IsNormalizedString(long wstr long) kernel32.IsNormalizedString +@ stub IsProcessCritical -+@ stdcall IsProcessInJob(long long ptr) kernel32.IsProcessInJob + @ stdcall IsProcessInJob(long long ptr) kernel32.IsProcessInJob +@ stdcall IsProcessorFeaturePresent(long) kernel32.IsProcessorFeaturePresent +@ stub IsSideloadingEnabled +@ stub IsSideloadingPolicyApplied +@ stub IsSyncForegroundPolicyRefresh +@ stdcall IsThreadAFiber() kernel32.IsThreadAFiber -+@ stdcall IsThreadpoolTimerSet(ptr) kernel32.IsThreadpoolTimerSet + @ stdcall IsThreadpoolTimerSet(ptr) kernel32.IsThreadpoolTimerSet +-@ stub IsTokenRestricted +-@ stub IsValidAcl +@ stub IsTimeZoneRedirectionEnabled +@ stdcall IsTokenRestricted(long) advapi32.IsTokenRestricted +@ stdcall IsValidAcl(ptr) advapi32.IsValidAcl -+@ stdcall IsValidCodePage(long) kernel32.IsValidCodePage -+@ stdcall IsValidLanguageGroup(long long) kernel32.IsValidLanguageGroup -+@ stdcall IsValidLocale(long long) kernel32.IsValidLocale -+@ stdcall IsValidLocaleName(wstr) kernel32.IsValidLocaleName + @ stdcall IsValidCodePage(long) kernel32.IsValidCodePage + @ stdcall IsValidLanguageGroup(long long) kernel32.IsValidLanguageGroup + @ stdcall IsValidLocale(long long) kernel32.IsValidLocale + @ stdcall IsValidLocaleName(wstr) kernel32.IsValidLocaleName +@ stub IsValidNLSVersion -+@ stub IsValidRelativeSecurityDescriptor + @ stub IsValidRelativeSecurityDescriptor +-@ stub IsValidSecurityDescriptor +-@ stub IsValidSid +-@ stub IsWellKnownSid +@ stdcall IsValidSecurityDescriptor(ptr) advapi32.IsValidSecurityDescriptor +@ stdcall IsValidSid(ptr) advapi32.IsValidSid +@ stdcall IsWellKnownSid(ptr long) advapi32.IsWellKnownSid -+@ stdcall IsWow64Process(ptr ptr) kernel32.IsWow64Process + @ stdcall IsWow64Process(ptr ptr) kernel32.IsWow64Process +@ stdcall K32EmptyWorkingSet(long) kernel32.K32EmptyWorkingSet +@ stdcall K32EnumDeviceDrivers(ptr long ptr) kernel32.K32EnumDeviceDrivers +@ stdcall K32EnumPageFilesA(ptr ptr) kernel32.K32EnumPageFilesA @@ -925,97 +960,103 @@ +@ stdcall K32InitializeProcessForWsWatch(long) kernel32.K32InitializeProcessForWsWatch +@ stdcall K32QueryWorkingSet(long ptr long) kernel32.K32QueryWorkingSet +@ stdcall K32QueryWorkingSetEx(long ptr long) kernel32.K32QueryWorkingSetEx -+@ stub KernelBaseGetGlobalData -+@ stdcall LCIDToLocaleName(long ptr long long) kernel32.LCIDToLocaleName -+@ stdcall LCMapStringA(long long str long ptr long) kernel32.LCMapStringA -+@ stdcall LCMapStringEx(wstr long wstr long ptr long ptr ptr long) kernel32.LCMapStringEx -+@ stdcall LCMapStringW(long long wstr long ptr long) kernel32.LCMapStringW + @ stub KernelBaseGetGlobalData + @ stdcall LCIDToLocaleName(long ptr long long) kernel32.LCIDToLocaleName + @ stdcall LCMapStringA(long long str long ptr long) kernel32.LCMapStringA + @ stdcall LCMapStringEx(wstr long wstr long ptr long ptr ptr long) kernel32.LCMapStringEx + @ stdcall LCMapStringW(long long wstr long ptr long) kernel32.LCMapStringW +@ stub LeaveCriticalPolicySectionInternal -+@ stdcall LeaveCriticalSection(ptr) kernel32.LeaveCriticalSection -+@ stdcall LeaveCriticalSectionWhenCallbackReturns(ptr ptr) kernel32.LeaveCriticalSectionWhenCallbackReturns + @ stdcall LeaveCriticalSection(ptr) kernel32.LeaveCriticalSection + @ stdcall LeaveCriticalSectionWhenCallbackReturns(ptr ptr) kernel32.LeaveCriticalSectionWhenCallbackReturns +@ stub LoadAppInitDlls +@ stdcall LoadLibraryA(str) kernel32.LoadLibraryA -+@ stdcall LoadLibraryExA( str long long) kernel32.LoadLibraryExA -+@ stdcall LoadLibraryExW(wstr long long) kernel32.LoadLibraryExW + @ stdcall LoadLibraryExA( str long long) kernel32.LoadLibraryExA + @ stdcall LoadLibraryExW(wstr long long) kernel32.LoadLibraryExW +@ stdcall LoadLibraryW(wstr) kernel32.LoadLibraryW +@ stub LoadPackagedLibrary -+@ stdcall LoadResource(long long) kernel32.LoadResource + @ stdcall LoadResource(long long) kernel32.LoadResource +-@ stub LoadStringA +@ stdcall LoadStringA(long long ptr long) user32.LoadStringA -+@ stub LoadStringBaseExW -+@ stub LoadStringByReference + @ stub LoadStringBaseExW + @ stub LoadStringByReference +-@ stub LoadStringW +@ stdcall LoadStringW(long long ptr long) user32.LoadStringW -+@ stdcall LocalAlloc(long long) kernel32.LocalAlloc -+@ stdcall LocalFileTimeToFileTime(ptr ptr) kernel32.LocalFileTimeToFileTime -+@ stdcall LocalFree(long) kernel32.LocalFree -+@ stdcall LocalLock(long) kernel32.LocalLock -+@ stdcall LocalReAlloc(long long long) kernel32.LocalReAlloc -+@ stdcall LocalUnlock(long) kernel32.LocalUnlock -+@ stdcall LocaleNameToLCID(wstr long) kernel32.LocaleNameToLCID + @ stdcall LocalAlloc(long long) kernel32.LocalAlloc + @ stdcall LocalFileTimeToFileTime(ptr ptr) kernel32.LocalFileTimeToFileTime + @ stdcall LocalFree(long) kernel32.LocalFree +@@ -425,17 +905,27 @@ + @ stdcall LocalReAlloc(long long long) kernel32.LocalReAlloc + @ stdcall LocalUnlock(long) kernel32.LocalUnlock + @ stdcall LocaleNameToLCID(wstr long) kernel32.LocaleNameToLCID +@ stub LocateXStateFeature -+@ stdcall LockFile(long long long long long) kernel32.LockFile -+@ stdcall LockFileEx(long long long long long ptr) kernel32.LockFileEx -+@ stdcall LockResource(long) kernel32.LockResource -+@ stub MakeAbsoluteSD2 + @ stdcall LockFile(long long long long long) kernel32.LockFile + @ stdcall LockFileEx(long long long long long ptr) kernel32.LockFileEx + @ stdcall LockResource(long) kernel32.LockResource +-@ stub MakeAbsoluteSD +@ stdcall MakeAbsoluteSD(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) advapi32.MakeAbsoluteSD + @ stub MakeAbsoluteSD2 +-@ stub MakeSelfRelativeSD +-@ stub MapGenericMask +@ stdcall MakeSelfRelativeSD(ptr ptr ptr) advapi32.MakeSelfRelativeSD +@ stdcall MapGenericMask(ptr ptr) advapi32.MapGenericMask +@ stub MapPredefinedHandleInternal +@ stub MapUserPhysicalPages -+@ stdcall MapViewOfFile(long long long long long) kernel32.MapViewOfFile -+@ stdcall MapViewOfFileEx(long long long long long ptr) kernel32.MapViewOfFileEx -+@ stub MapViewOfFileExNuma + @ stdcall MapViewOfFile(long long long long long) kernel32.MapViewOfFile + @ stdcall MapViewOfFileEx(long long long long long ptr) kernel32.MapViewOfFileEx + @ stub MapViewOfFileExNuma +@ stub MapViewOfFileFromApp +@ stdcall MoveFileExW(wstr wstr long) kernel32.MoveFileExW +@ stub MoveFileWithProgressTransactedW +@ stdcall MoveFileWithProgressW(wstr wstr ptr ptr long) kernel32.MoveFileWithProgressW +@ stdcall MulDiv(long long long) kernel32.MulDiv -+@ stdcall MultiByteToWideChar(long long str long ptr long) kernel32.MultiByteToWideChar + @ stdcall MultiByteToWideChar(long long str long ptr long) kernel32.MultiByteToWideChar +@ stub NamedPipeEventEnum +@ stub NamedPipeEventSelect -+@ stdcall NeedCurrentDirectoryForExePathA(str) kernel32.NeedCurrentDirectoryForExePathA -+@ stdcall NeedCurrentDirectoryForExePathW(wstr) kernel32.NeedCurrentDirectoryForExePathW -+@ stub NlsCheckPolicy -+@ stub NlsDispatchAnsiEnumProc -+@ stub NlsEventDataDescCreate -+@ stub NlsGetACPFromLocale -+@ stub NlsGetCacheUpdateCount -+@ stub NlsIsUserDefaultLocale -+@ stub NlsUpdateLocale -+@ stub NlsUpdateSystemLocale -+@ stub NlsValidateLocale -+@ stub NlsWriteEtwEvent + @ stdcall NeedCurrentDirectoryForExePathA(str) kernel32.NeedCurrentDirectoryForExePathA + @ stdcall NeedCurrentDirectoryForExePathW(wstr) kernel32.NeedCurrentDirectoryForExePathW + @ stub NlsCheckPolicy +@@ -448,65 +938,453 @@ + @ stub NlsUpdateSystemLocale + @ stub NlsValidateLocale + @ stub NlsWriteEtwEvent +@ stdcall NormalizeString(long wstr long ptr long) kernel32.NormalizeString -+@ stub NotifyMountMgr -+@ stub NotifyRedirectedStringChange + @ stub NotifyMountMgr + @ stub NotifyRedirectedStringChange +-@ stub ObjectCloseAuditAlarmW +-@ stub ObjectDeleteAuditAlarmW +-@ stub ObjectOpenAuditAlarmW +-@ stub ObjectPrivilegeAuditAlarmW +@ stdcall ObjectCloseAuditAlarmW(wstr ptr long) advapi32.ObjectCloseAuditAlarmW +@ stdcall ObjectDeleteAuditAlarmW(wstr ptr long) advapi32.ObjectDeleteAuditAlarmW +@ stdcall ObjectOpenAuditAlarmW(wstr ptr wstr wstr ptr long long long ptr long long ptr) advapi32.ObjectOpenAuditAlarmW +@ stdcall ObjectPrivilegeAuditAlarmW(wstr ptr long long ptr long) advapi32.ObjectPrivilegeAuditAlarmW +@ stub OfferVirtualMemory -+@ stdcall OpenEventA(long long str) kernel32.OpenEventA -+@ stdcall OpenEventW(long long wstr) kernel32.OpenEventW + @ stdcall OpenEventA(long long str) kernel32.OpenEventA + @ stdcall OpenEventW(long long wstr) kernel32.OpenEventW +@ stdcall OpenFileById(long ptr long long ptr long) kernel32.OpenFileById +@ stub OpenFileMappingFromApp -+@ stdcall OpenFileMappingW(long long wstr) kernel32.OpenFileMappingW + @ stdcall OpenFileMappingW(long long wstr) kernel32.OpenFileMappingW +@ stub OpenGlobalizationUserSettingsKey -+@ stdcall OpenMutexW(long long wstr) kernel32.OpenMutexW + @ stdcall OpenMutexW(long long wstr) kernel32.OpenMutexW +@ stub OpenPackageInfoByFullName +@ stub OpenPackageInfoByFullNameForUser +@ stub OpenPrivateNamespaceW -+@ stdcall OpenProcess(long long long) kernel32.OpenProcess + @ stdcall OpenProcess(long long long) kernel32.OpenProcess +-@ stub OpenProcessToken +@ stdcall OpenProcessToken(long long ptr) advapi32.OpenProcessToken -+@ stub OpenRegKey -+@ stdcall OpenSemaphoreW(long long wstr) kernel32.OpenSemaphoreW + @ stub OpenRegKey + @ stdcall OpenSemaphoreW(long long wstr) kernel32.OpenSemaphoreW +@ stub OpenState +@ stub OpenStateAtom +@ stub OpenStateExplicit +@ stub OpenStateExplicitForUserSid +@ stub OpenStateExplicitForUserSidString -+@ stdcall OpenThread(long long long) kernel32.OpenThread + @ stdcall OpenThread(long long long) kernel32.OpenThread +-@ stub OpenThreadToken +@ stdcall OpenThreadToken(long long long ptr) advapi32.OpenThreadToken -+@ stdcall OpenWaitableTimerW(long long wstr) kernel32.OpenWaitableTimerW -+@ stdcall OutputDebugStringA(str) kernel32.OutputDebugStringA -+@ stdcall OutputDebugStringW(wstr) kernel32.OutputDebugStringW + @ stdcall OpenWaitableTimerW(long long wstr) kernel32.OpenWaitableTimerW + @ stdcall OutputDebugStringA(str) kernel32.OutputDebugStringA + @ stdcall OutputDebugStringW(wstr) kernel32.OutputDebugStringW +@ stub OverrideRoamingDataModificationTimesInRange +@ stub PackageFamilyNameFromFullName +@ stub PackageFamilyNameFromId @@ -1027,6 +1068,7 @@ +@ stub PackageNameAndPublisherIdFromFamilyName +@ stub PackageRelativeApplicationIdFromProductId +@ stub PackageSidFromFamilyName ++@ stub PackageSidFromProductId +@ stub ParseApplicationUserModelId +@ stdcall ParseURLA(str ptr) shlwapi.ParseURLA +@ stdcall ParseURLW(wstr ptr) shlwapi.ParseURLW @@ -1154,7 +1196,7 @@ +@ stub PcwSetQueryItemUserData +@ stdcall PeekConsoleInputA(ptr ptr long ptr) kernel32.PeekConsoleInputA +@ stdcall PeekConsoleInputW(ptr ptr long ptr) kernel32.PeekConsoleInputW -+@ stdcall PeekNamedPipe(long ptr long ptr ptr ptr) kernel32.PeekNamedPipe + @ stdcall PeekNamedPipe(long ptr long ptr ptr ptr) kernel32.PeekNamedPipe +@ stub PerfCreateInstance +@ stub PerfDecrementULongCounterValue +@ stub PerfDecrementULongLongCounterValue @@ -1170,12 +1212,14 @@ +@ stub PerfStartProviderEx +@ stub PerfStopProvider +@ stub PoolPerAppKeyStateInternal -+@ stdcall PostQueuedCompletionStatus(long long ptr ptr) kernel32.PostQueuedCompletionStatus + @ stdcall PostQueuedCompletionStatus(long long ptr ptr) kernel32.PostQueuedCompletionStatus +-@ stub PrivilegeCheck +-@ stub PrivilegedServiceAuditAlarmW +@ stub PrefetchVirtualMemory +@ stub PrivCopyFileExW +@ stdcall PrivilegeCheck(ptr ptr ptr) advapi32.PrivilegeCheck +@ stdcall PrivilegedServiceAuditAlarmW(wstr wstr long ptr long) advapi32.PrivilegedServiceAuditAlarmW -+@ stdcall ProcessIdToSessionId(long ptr) kernel32.ProcessIdToSessionId + @ stdcall ProcessIdToSessionId(long ptr) kernel32.ProcessIdToSessionId +@ stub ProductIdFromPackageFamilyName +@ stub PsmCreateKey +@ stub PsmCreateKeyWithDynamicId @@ -1199,13 +1243,13 @@ +@ stub PssWalkMarkerSetPosition +@ stub PssWalkSnapshot +@ stub PublishStateChangeNotification -+@ stdcall PulseEvent(long) kernel32.PulseEvent + @ stdcall PulseEvent(long) kernel32.PulseEvent +@ stdcall PurgeComm(long long) kernel32.PurgeComm +@ stdcall QISearch(long long long long) shlwapi.QISearch +@ stub QueryActCtxSettingsW +@ stdcall QueryActCtxW(long ptr ptr long ptr long ptr) kernel32.QueryActCtxW -+@ stdcall QueryDepthSList(ptr) kernel32.QueryDepthSList -+@ stdcall QueryDosDeviceW(wstr ptr long) kernel32.QueryDosDeviceW + @ stdcall QueryDepthSList(ptr) kernel32.QueryDepthSList + @ stdcall QueryDosDeviceW(wstr ptr long) kernel32.QueryDosDeviceW +@ stdcall QueryFullProcessImageNameA(ptr long ptr ptr) kernel32.QueryFullProcessImageNameA +@ stdcall QueryFullProcessImageNameW(ptr long ptr ptr) kernel32.QueryFullProcessImageNameW +@ stub QueryIdleProcessorCycleTime @@ -1214,33 +1258,33 @@ +@ stub QueryInterruptTimePrecise +@ stdcall QueryMemoryResourceNotification(ptr ptr) kernel32.QueryMemoryResourceNotification +@ stub QueryOptionalDelayLoadedAPI -+@ stdcall QueryPerformanceCounter(ptr) kernel32.QueryPerformanceCounter -+@ stdcall QueryPerformanceFrequency(ptr) kernel32.QueryPerformanceFrequency -+@ stub QueryProcessAffinityUpdateMode + @ stdcall QueryPerformanceCounter(ptr) kernel32.QueryPerformanceCounter + @ stdcall QueryPerformanceFrequency(ptr) kernel32.QueryPerformanceFrequency + @ stub QueryProcessAffinityUpdateMode +@ stub QueryProcessCycleTime +@ stub QueryProtectedPolicy -+@ stub QuerySecurityAccessMask + @ stub QuerySecurityAccessMask +@ stub QueryStateAtomValueInfo +@ stub QueryStateContainerItemInfo +@ stdcall QueryThreadCycleTime(long ptr) kernel32.QueryThreadCycleTime -+@ stub QueryThreadpoolStackInformation + @ stub QueryThreadpoolStackInformation +@ stdcall QueryUnbiasedInterruptTime(ptr) kernel32.QueryUnbiasedInterruptTime +@ stub QueryUnbiasedInterruptTimePrecise +@ stub QueryWorkingSet +@ stub QueryWorkingSetEx -+@ stdcall QueueUserAPC(ptr long long) kernel32.QueueUserAPC + @ stdcall QueueUserAPC(ptr long long) kernel32.QueueUserAPC +@ stdcall QueueUserWorkItem(ptr ptr long) kernel32.QueueUserWorkItem -+@ stub QuirkGetData2 +@ stub QuirkGetData ++@ stub QuirkGetData2 ++@ stdcall QuirkIsEnabled(ptr) +@ stub QuirkIsEnabled2 +@ stub QuirkIsEnabled3 -+@ stdcall QuirkIsEnabled(ptr) ++@ stub QuirkIsEnabledForPackage +@ stub QuirkIsEnabledForPackage2 +@ stub QuirkIsEnabledForPackage3 +@ stub QuirkIsEnabledForPackage4 -+@ stub QuirkIsEnabledForPackage +@ stub QuirkIsEnabledForProcess -+@ stdcall RaiseException(long long long ptr) kernel32.RaiseException + @ stdcall RaiseException(long long long ptr) kernel32.RaiseException +@ stub RaiseFailFastException +@ stub ReOpenFile +@ stdcall ReadConsoleA(long ptr long ptr ptr) kernel32.ReadConsoleA @@ -1255,10 +1299,10 @@ +@ stdcall ReadConsoleOutputW(long ptr long long ptr) kernel32.ReadConsoleOutputW +@ stdcall ReadConsoleW(long ptr long ptr ptr) kernel32.ReadConsoleW +@ stdcall ReadDirectoryChangesW(long ptr long long long ptr ptr ptr) kernel32.ReadDirectoryChangesW -+@ stdcall ReadFile(long ptr long ptr ptr) kernel32.ReadFile -+@ stdcall ReadFileEx(long ptr long ptr ptr) kernel32.ReadFileEx -+@ stdcall ReadFileScatter(long ptr long ptr ptr) kernel32.ReadFileScatter -+@ stdcall ReadProcessMemory(long ptr ptr long ptr) kernel32.ReadProcessMemory + @ stdcall ReadFile(long ptr long ptr ptr) kernel32.ReadFile + @ stdcall ReadFileEx(long ptr long ptr ptr) kernel32.ReadFileEx + @ stdcall ReadFileScatter(long ptr long ptr ptr) kernel32.ReadFileScatter + @ stdcall ReadProcessMemory(long ptr ptr long ptr) kernel32.ReadProcessMemory +@ stub ReadStateAtomValue +@ stub ReadStateContainerValue +@ stub ReclaimVirtualMemory @@ -1330,33 +1374,34 @@ +@ stub RegisterStateChangeNotification +@ stub RegisterStateLock +@ stdcall RegisterTraceGuidsW(ptr ptr ptr long ptr wstr wstr ptr) advapi32.RegisterTraceGuidsW -+@ stdcall RegisterWaitForSingleObjectEx(long ptr ptr long long) kernel32.RegisterWaitForSingleObjectEx + @ stdcall RegisterWaitForSingleObjectEx(long ptr ptr long long) kernel32.RegisterWaitForSingleObjectEx +@ stdcall ReleaseActCtx(ptr) kernel32.ReleaseActCtx -+@ stdcall ReleaseMutex(long) kernel32.ReleaseMutex -+@ stdcall ReleaseMutexWhenCallbackReturns(ptr long) kernel32.ReleaseMutexWhenCallbackReturns -+@ stdcall ReleaseSRWLockExclusive(ptr) kernel32.ReleaseSRWLockExclusive -+@ stdcall ReleaseSRWLockShared(ptr) kernel32.ReleaseSRWLockShared -+@ stdcall ReleaseSemaphore(long long ptr) kernel32.ReleaseSemaphore -+@ stdcall ReleaseSemaphoreWhenCallbackReturns(ptr long long) kernel32.ReleaseSemaphoreWhenCallbackReturns + @ stdcall ReleaseMutex(long) kernel32.ReleaseMutex + @ stdcall ReleaseMutexWhenCallbackReturns(ptr long) kernel32.ReleaseMutexWhenCallbackReturns + @ stdcall ReleaseSRWLockExclusive(ptr) kernel32.ReleaseSRWLockExclusive + @ stdcall ReleaseSRWLockShared(ptr) kernel32.ReleaseSRWLockShared + @ stdcall ReleaseSemaphore(long long ptr) kernel32.ReleaseSemaphore + @ stdcall ReleaseSemaphoreWhenCallbackReturns(ptr long long) kernel32.ReleaseSemaphoreWhenCallbackReturns +@ stub ReleaseStateLock +@ stub RemapPredefinedHandleInternal -+@ stdcall RemoveDirectoryA(str) kernel32.RemoveDirectoryA -+@ stdcall RemoveDirectoryW(wstr) kernel32.RemoveDirectoryW -+@ stub RemoveDllDirectory + @ stdcall RemoveDirectoryA(str) kernel32.RemoveDirectoryA + @ stdcall RemoveDirectoryW(wstr) kernel32.RemoveDirectoryW + @ stub RemoveDllDirectory +@ stub RemovePackageStatus +@ stub RemovePackageStatusForUser +@ stdcall RemoveVectoredContinueHandler(ptr) kernel32.RemoveVectoredContinueHandler +@ stdcall RemoveVectoredExceptionHandler(ptr) kernel32.RemoveVectoredExceptionHandler +@ stub ReplaceFileExInternal +@ stdcall ReplaceFileW(wstr wstr wstr long ptr ptr) kernel32.ReplaceFileW -+@ stdcall ResetEvent(long) kernel32.ResetEvent + @ stdcall ResetEvent(long) kernel32.ResetEvent +@ stub ResetState +@ stdcall ResetWriteWatch(ptr long) kernel32.ResetWriteWatch +@ stdcall ResolveDelayLoadedAPI(ptr ptr ptr ptr ptr long) kernel32.ResolveDelayLoadedAPI +@ stub ResolveDelayLoadsFromDll -+@ stub ResolveLocaleName + @ stub ResolveLocaleName +@ stdcall RestoreLastError(long) kernel32.RestoreLastError -+@ stdcall ResumeThread(long) kernel32.ResumeThread + @ stdcall ResumeThread(long) kernel32.ResumeThread +-@ stub RevertToSelf +@ stdcall RevertToSelf() advapi32.RevertToSelf +@ stub RsopLoggingEnabledInternal +@ stub SHCoCreateInstance @@ -1395,10 +1440,11 @@ +@ stdcall ScrollConsoleScreenBufferA(long ptr ptr ptr ptr) kernel32.ScrollConsoleScreenBufferA +@ stdcall ScrollConsoleScreenBufferW(long ptr ptr ptr ptr) kernel32.ScrollConsoleScreenBufferW +@ stdcall SearchPathA(str str str long ptr ptr) kernel32.SearchPathA -+@ stdcall SearchPathW(wstr wstr wstr long ptr ptr) kernel32.SearchPathW + @ stdcall SearchPathW(wstr wstr wstr long ptr ptr) kernel32.SearchPathW +-@ stub SetAclInformation +@ stdcall SetAclInformation(ptr ptr long long) advapi32.SetAclInformation +@ stub SetCachedSigningLevel -+@ stdcall SetCalendarInfoW(long long long wstr) kernel32.SetCalendarInfoW + @ stdcall SetCalendarInfoW(long long long wstr) kernel32.SetCalendarInfoW +@ stub SetClientDynamicTimeZoneInformation +@ stub SetClientTimeZoneInformation +@ stdcall SetCommBreak(long) kernel32.SetCommBreak @@ -1425,64 +1471,67 @@ +@ stdcall SetConsoleTextAttribute(long long) kernel32.SetConsoleTextAttribute +@ stdcall SetConsoleTitleW(wstr) kernel32.SetConsoleTitleW +@ stdcall SetConsoleWindowInfo(long long ptr) kernel32.SetConsoleWindowInfo -+@ stdcall SetCriticalSectionSpinCount(ptr long) kernel32.SetCriticalSectionSpinCount -+@ stdcall SetCurrentDirectoryA(str) kernel32.SetCurrentDirectoryA -+@ stdcall SetCurrentDirectoryW(wstr) kernel32.SetCurrentDirectoryW -+@ stub SetDefaultDllDirectories + @ stdcall SetCriticalSectionSpinCount(ptr long) kernel32.SetCriticalSectionSpinCount + @ stdcall SetCurrentDirectoryA(str) kernel32.SetCurrentDirectoryA + @ stdcall SetCurrentDirectoryW(wstr) kernel32.SetCurrentDirectoryW + @ stub SetDefaultDllDirectories +@ stub SetDynamicTimeZoneInformation -+@ stdcall SetEndOfFile(long) kernel32.SetEndOfFile -+@ stub SetEnvironmentStringsW -+@ stdcall SetEnvironmentVariableA(str str) kernel32.SetEnvironmentVariableA -+@ stdcall SetEnvironmentVariableW(wstr wstr) kernel32.SetEnvironmentVariableW -+@ stdcall SetErrorMode(long) kernel32.SetErrorMode -+@ stdcall SetEvent(long) kernel32.SetEvent -+@ stdcall SetEventWhenCallbackReturns(ptr long) kernel32.SetEventWhenCallbackReturns -+@ stdcall SetFileApisToANSI() kernel32.SetFileApisToANSI -+@ stdcall SetFileApisToOEM() kernel32.SetFileApisToOEM -+@ stdcall SetFileAttributesA(str long) kernel32.SetFileAttributesA -+@ stdcall SetFileAttributesW(wstr long) kernel32.SetFileAttributesW -+@ stdcall SetFileInformationByHandle(long long ptr long) kernel32.SetFileInformationByHandle + @ stdcall SetEndOfFile(long) kernel32.SetEndOfFile + @ stub SetEnvironmentStringsW + @ stdcall SetEnvironmentVariableA(str str) kernel32.SetEnvironmentVariableA +@@ -519,85 +1397,257 @@ + @ stdcall SetFileAttributesA(str long) kernel32.SetFileAttributesA + @ stdcall SetFileAttributesW(wstr long) kernel32.SetFileAttributesW + @ stdcall SetFileInformationByHandle(long long ptr long) kernel32.SetFileInformationByHandle +@ stub SetFileIoOverlappedRange -+@ stdcall SetFilePointer(long long ptr long) kernel32.SetFilePointer -+@ stdcall SetFilePointerEx(long int64 ptr long) kernel32.SetFilePointerEx + @ stdcall SetFilePointer(long long ptr long) kernel32.SetFilePointer + @ stdcall SetFilePointerEx(long int64 ptr long) kernel32.SetFilePointerEx +-@ stub SetFileSecurityW +@ stdcall SetFileSecurityW(wstr long ptr) advapi32.SetFileSecurityW -+@ stdcall SetFileTime(long ptr ptr ptr) kernel32.SetFileTime -+@ stdcall SetFileValidData(ptr int64) kernel32.SetFileValidData -+@ stdcall SetHandleCount(long) kernel32.SetHandleCount -+@ stdcall SetHandleInformation(long long long) kernel32.SetHandleInformation + @ stdcall SetFileTime(long ptr ptr ptr) kernel32.SetFileTime + @ stdcall SetFileValidData(ptr int64) kernel32.SetFileValidData + @ stdcall SetHandleCount(long) kernel32.SetHandleCount + @ stdcall SetHandleInformation(long long long) kernel32.SetHandleInformation +-@ stub SetKernelObjectSecurity +@ stub SetIsDeveloperModeEnabled +@ stub SetIsSideloadingEnabled +@ stdcall SetKernelObjectSecurity(long long ptr) advapi32.SetKernelObjectSecurity +@ stub SetLastConsoleEventActive -+@ stdcall SetLastError(long) kernel32.SetLastError -+@ stdcall SetLocalTime(ptr) kernel32.SetLocalTime -+@ stdcall SetLocaleInfoW(long long wstr) kernel32.SetLocaleInfoW -+@ stdcall SetNamedPipeHandleState(long ptr ptr ptr) kernel32.SetNamedPipeHandleState -+@ stdcall SetPriorityClass(long long) kernel32.SetPriorityClass + @ stdcall SetLastError(long) kernel32.SetLastError + @ stdcall SetLocalTime(ptr) kernel32.SetLocalTime + @ stdcall SetLocaleInfoW(long long wstr) kernel32.SetLocaleInfoW + @ stdcall SetNamedPipeHandleState(long ptr ptr ptr) kernel32.SetNamedPipeHandleState + @ stdcall SetPriorityClass(long long) kernel32.SetPriorityClass +-@ stub SetPrivateObjectSecurity +@ stdcall SetPrivateObjectSecurity(long ptr ptr ptr long) advapi32.SetPrivateObjectSecurity -+@ stub SetPrivateObjectSecurityEx -+@ stub SetProcessAffinityUpdateMode + @ stub SetPrivateObjectSecurityEx + @ stub SetProcessAffinityUpdateMode +@ stub SetProcessDefaultCpuSets +@ stub SetProcessGroupAffinity +@ stub SetProcessInformation +@ stub SetProcessMitigationPolicy +@ stub SetProcessPreferredUILanguages +@ stdcall SetProcessPriorityBoost(long long) kernel32.SetProcessPriorityBoost -+@ stdcall SetProcessShutdownParameters(long long) kernel32.SetProcessShutdownParameters + @ stdcall SetProcessShutdownParameters(long long) kernel32.SetProcessShutdownParameters +@ stub SetProcessValidCallTargets +@ stub SetProcessWorkingSetSizeEx +@ stub SetProtectedPolicy +@ stub SetRoamingLastObservedChangeTime -+@ stub SetSecurityAccessMask + @ stub SetSecurityAccessMask +-@ stub SetSecurityDescriptorControl +-@ stub SetSecurityDescriptorDacl +-@ stub SetSecurityDescriptorGroup +-@ stub SetSecurityDescriptorOwner +@ stdcall SetSecurityDescriptorControl(ptr long long) advapi32.SetSecurityDescriptorControl +@ stdcall SetSecurityDescriptorDacl(ptr long ptr long) advapi32.SetSecurityDescriptorDacl +@ stdcall SetSecurityDescriptorGroup(ptr ptr long) advapi32.SetSecurityDescriptorGroup +@ stdcall SetSecurityDescriptorOwner(ptr ptr long) advapi32.SetSecurityDescriptorOwner -+@ stub SetSecurityDescriptorRMControl + @ stub SetSecurityDescriptorRMControl +-@ stub SetSecurityDescriptorSacl +@ stdcall SetSecurityDescriptorSacl(ptr long ptr long) advapi32.SetSecurityDescriptorSacl +@ stub SetStateVersion -+@ stdcall SetStdHandle(long long) kernel32.SetStdHandle -+@ stub SetStdHandleEx + @ stdcall SetStdHandle(long long) kernel32.SetStdHandle + @ stub SetStdHandleEx +@ stdcall SetSystemFileCacheSize(long long long) kernel32.SetSystemFileCacheSize +@ stdcall SetSystemTime(ptr) kernel32.SetSystemTime +@ stdcall SetSystemTimeAdjustment(long long) kernel32.SetSystemTimeAdjustment @@ -1492,38 +1541,40 @@ +@ stdcall SetThreadIdealProcessor(long long) kernel32.SetThreadIdealProcessor +@ stub SetThreadIdealProcessorEx +@ stub SetThreadInformation -+@ stdcall SetThreadLocale(long) kernel32.SetThreadLocale + @ stdcall SetThreadLocale(long) kernel32.SetThreadLocale +@ stdcall SetThreadPreferredUILanguages(long ptr ptr) kernel32.SetThreadPreferredUILanguages -+@ stdcall SetThreadPriority(long long) kernel32.SetThreadPriority -+@ stdcall SetThreadPriorityBoost(long long) kernel32.SetThreadPriorityBoost + @ stdcall SetThreadPriority(long long) kernel32.SetThreadPriority + @ stdcall SetThreadPriorityBoost(long long) kernel32.SetThreadPriorityBoost +@ stub SetThreadSelectedCpuSets -+@ stdcall SetThreadStackGuarantee(ptr) kernel32.SetThreadStackGuarantee + @ stdcall SetThreadStackGuarantee(ptr) kernel32.SetThreadStackGuarantee +-@ stub SetThreadToken +@ stdcall SetThreadToken(ptr ptr) advapi32.SetThreadToken +@ stdcall SetThreadUILanguage(long) kernel32.SetThreadUILanguage -+@ stub SetThreadpoolStackInformation -+@ stdcall SetThreadpoolThreadMaximum(ptr long) kernel32.SetThreadpoolThreadMaximum -+@ stdcall SetThreadpoolThreadMinimum(ptr long) kernel32.SetThreadpoolThreadMinimum -+@ stdcall SetThreadpoolTimer(ptr ptr long long) kernel32.SetThreadpoolTimer + @ stub SetThreadpoolStackInformation + @ stdcall SetThreadpoolThreadMaximum(ptr long) kernel32.SetThreadpoolThreadMaximum + @ stdcall SetThreadpoolThreadMinimum(ptr long) kernel32.SetThreadpoolThreadMinimum + @ stdcall SetThreadpoolTimer(ptr ptr long long) kernel32.SetThreadpoolTimer +@ stub SetThreadpoolTimerEx -+@ stdcall SetThreadpoolWait(ptr long ptr) kernel32.SetThreadpoolWait + @ stdcall SetThreadpoolWait(ptr long ptr) kernel32.SetThreadpoolWait +-@ stub SetTokenInformation +@ stub SetThreadpoolWaitEx +@ stdcall SetTimeZoneInformation(ptr) kernel32.SetTimeZoneInformation +@ stdcall SetTokenInformation(long long ptr long) advapi32.SetTokenInformation +@ stdcall SetUnhandledExceptionFilter(ptr) kernel32.SetUnhandledExceptionFilter +@ stdcall SetUserGeoID(long) kernel32.SetUserGeoID -+@ stdcall SetWaitableTimer(long ptr long ptr ptr long) kernel32.SetWaitableTimer -+@ stdcall SetWaitableTimerEx(long ptr long ptr ptr ptr long) kernel32.SetWaitableTimerEx + @ stdcall SetWaitableTimer(long ptr long ptr ptr long) kernel32.SetWaitableTimer + @ stdcall SetWaitableTimerEx(long ptr long ptr ptr ptr long) kernel32.SetWaitableTimerEx +@ stub SetXStateFeaturesMask +@ stdcall SetupComm(long long long) kernel32.SetupComm +@ stub SharedLocalIsEnabled +@ stdcall SignalObjectAndWait(long long long long) kernel32.SignalObjectAndWait -+@ stdcall SizeofResource(long long) kernel32.SizeofResource -+@ stdcall Sleep(long) kernel32.Sleep + @ stdcall SizeofResource(long long) kernel32.SizeofResource + @ stdcall Sleep(long) kernel32.Sleep +@ stdcall SleepConditionVariableCS(ptr ptr long) kernel32.SleepConditionVariableCS +@ stdcall SleepConditionVariableSRW(ptr ptr long long) kernel32.SleepConditionVariableSRW -+@ stdcall SleepEx(long long) kernel32.SleepEx -+@ stub SpecialMBToWC -+@ stub StartThreadpoolIo + @ stdcall SleepEx(long long) kernel32.SleepEx + @ stub SpecialMBToWC + @ stub StartThreadpoolIo +@ stub StmAlignSize +@ stub StmAllocateFlat +@ stub StmCoalesceChunks @@ -1592,47 +1643,47 @@ +@ stdcall StrToIntW(wstr) shlwapi.StrToIntW +@ stdcall StrTrimA(str str) shlwapi.StrTrimA +@ stdcall StrTrimW(wstr wstr) shlwapi.StrTrimW -+@ stdcall SubmitThreadpoolWork(ptr) kernel32.SubmitThreadpoolWork + @ stdcall SubmitThreadpoolWork(ptr) kernel32.SubmitThreadpoolWork +@ stub SubscribeStateChangeNotification -+@ stdcall SuspendThread(long) kernel32.SuspendThread + @ stdcall SuspendThread(long) kernel32.SuspendThread +@ stdcall SwitchToFiber(ptr) kernel32.SwitchToFiber -+@ stdcall SwitchToThread() kernel32.SwitchToThread -+@ stdcall SystemTimeToFileTime(ptr ptr) kernel32.SystemTimeToFileTime -+@ stdcall SystemTimeToTzSpecificLocalTime(ptr ptr ptr) kernel32.SystemTimeToTzSpecificLocalTime -+@ stub SystemTimeToTzSpecificLocalTimeEx -+@ stdcall TerminateProcess(long long) kernel32.TerminateProcess + @ stdcall SwitchToThread() kernel32.SwitchToThread + @ stdcall SystemTimeToFileTime(ptr ptr) kernel32.SystemTimeToFileTime + @ stdcall SystemTimeToTzSpecificLocalTime(ptr ptr ptr) kernel32.SystemTimeToTzSpecificLocalTime + @ stub SystemTimeToTzSpecificLocalTimeEx + @ stdcall TerminateProcess(long long) kernel32.TerminateProcess +@ stub TerminateProcessOnMemoryExhaustion -+@ stdcall TerminateThread(long long) kernel32.TerminateThread -+@ stdcall TlsAlloc() kernel32.TlsAlloc -+@ stdcall TlsFree(long) kernel32.TlsFree -+@ stdcall TlsGetValue(long) kernel32.TlsGetValue -+@ stdcall TlsSetValue(long ptr) kernel32.TlsSetValue + @ stdcall TerminateThread(long long) kernel32.TerminateThread + @ stdcall TlsAlloc() kernel32.TlsAlloc + @ stdcall TlsFree(long) kernel32.TlsFree + @ stdcall TlsGetValue(long) kernel32.TlsGetValue + @ stdcall TlsSetValue(long ptr) kernel32.TlsSetValue +@ stdcall TraceEvent(int64 ptr) advapi32.TraceEvent +@ varargs TraceMessage(int64 long ptr long) advapi32.TraceMessage +@ stdcall TraceMessageVa(int64 long ptr long ptr) advapi32.TraceMessageVa -+@ stdcall TransactNamedPipe(long ptr long ptr long ptr ptr) kernel32.TransactNamedPipe + @ stdcall TransactNamedPipe(long ptr long ptr long ptr ptr) kernel32.TransactNamedPipe +@ stdcall TransmitCommChar(long long) kernel32.TransmitCommChar -+@ stdcall TryAcquireSRWLockExclusive(ptr) kernel32.TryAcquireSRWLockExclusive -+@ stdcall TryAcquireSRWLockShared(ptr) kernel32.TryAcquireSRWLockShared -+@ stdcall TryEnterCriticalSection(ptr) kernel32.TryEnterCriticalSection -+@ stdcall TrySubmitThreadpoolCallback(ptr ptr ptr) kernel32.TrySubmitThreadpoolCallback -+@ stdcall TzSpecificLocalTimeToSystemTime(ptr ptr ptr) kernel32.TzSpecificLocalTimeToSystemTime -+@ stub TzSpecificLocalTimeToSystemTimeEx + @ stdcall TryAcquireSRWLockExclusive(ptr) kernel32.TryAcquireSRWLockExclusive + @ stdcall TryAcquireSRWLockShared(ptr) kernel32.TryAcquireSRWLockShared + @ stdcall TryEnterCriticalSection(ptr) kernel32.TryEnterCriticalSection + @ stdcall TrySubmitThreadpoolCallback(ptr ptr ptr) kernel32.TrySubmitThreadpoolCallback + @ stdcall TzSpecificLocalTimeToSystemTime(ptr ptr ptr) kernel32.TzSpecificLocalTimeToSystemTime + @ stub TzSpecificLocalTimeToSystemTimeEx +@ stdcall UnhandledExceptionFilter(ptr) kernel32.UnhandledExceptionFilter -+@ stdcall UnlockFile(long long long long long) kernel32.UnlockFile -+@ stdcall UnlockFileEx(long long long long ptr) kernel32.UnlockFileEx -+@ stdcall UnmapViewOfFile(ptr) kernel32.UnmapViewOfFile + @ stdcall UnlockFile(long long long long long) kernel32.UnlockFile + @ stdcall UnlockFileEx(long long long long ptr) kernel32.UnlockFileEx + @ stdcall UnmapViewOfFile(ptr) kernel32.UnmapViewOfFile +@ stub UnmapViewOfFileEx +@ stub UnregisterBadMemoryNotification +@ stub UnregisterGPNotificationInternal +@ stub UnregisterStateChangeNotification +@ stub UnregisterStateLock +@ stdcall UnregisterTraceGuids(int64) advapi32.UnregisterTraceGuids -+@ stdcall UnregisterWaitEx(long long) kernel32.UnregisterWaitEx + @ stdcall UnregisterWaitEx(long long) kernel32.UnregisterWaitEx +@ stub UnsubscribeStateChangeNotification +@ stub UpdatePackageStatus +@ stub UpdatePackageStatusForUser -+@ stub UpdateProcThreadAttribute + @ stub UpdateProcThreadAttribute +@ stdcall UrlApplySchemeA(str ptr ptr long) shlwapi.UrlApplySchemeA +@ stdcall UrlApplySchemeW(wstr ptr ptr long) shlwapi.UrlApplySchemeW +@ stdcall UrlCanonicalizeA(str ptr ptr long) shlwapi.UrlCanonicalizeA @@ -1662,8 +1713,8 @@ +@ stdcall UrlUnescapeW(wstr ptr ptr long) shlwapi.UrlUnescapeW +@ stub VerFindFileA +@ stub VerFindFileW -+@ stdcall VerLanguageNameA(long str long) kernel32.VerLanguageNameA -+@ stdcall VerLanguageNameW(long wstr long) kernel32.VerLanguageNameW + @ stdcall VerLanguageNameA(long str long) kernel32.VerLanguageNameA + @ stdcall VerLanguageNameW(long wstr long) kernel32.VerLanguageNameW +@ stub VerQueryValueA +@ stub VerQueryValueW +@ stdcall -ret64 VerSetConditionMask(long long long long) kernel32.VerSetConditionMask @@ -1673,18 +1724,18 @@ +@ stub VerifyPackageId +@ stub VerifyPackageRelativeApplicationId +@ stub VerifyScripts -+@ stdcall VirtualAlloc(ptr long long long) kernel32.VirtualAlloc -+@ stdcall VirtualAllocEx(long ptr long long long) kernel32.VirtualAllocEx -+@ stub VirtualAllocExNuma + @ stdcall VirtualAlloc(ptr long long long) kernel32.VirtualAlloc + @ stdcall VirtualAllocEx(long ptr long long long) kernel32.VirtualAllocEx + @ stub VirtualAllocExNuma +@ stub VirtualAllocFromApp -+@ stdcall VirtualFree(ptr long long) kernel32.VirtualFree -+@ stdcall VirtualFreeEx(long ptr long long) kernel32.VirtualFreeEx + @ stdcall VirtualFree(ptr long long) kernel32.VirtualFree + @ stdcall VirtualFreeEx(long ptr long long) kernel32.VirtualFreeEx +@ stdcall VirtualLock(ptr long) kernel32.VirtualLock -+@ stdcall VirtualProtect(ptr long long ptr) kernel32.VirtualProtect -+@ stdcall VirtualProtectEx(long ptr long long ptr) kernel32.VirtualProtectEx + @ stdcall VirtualProtect(ptr long long ptr) kernel32.VirtualProtect + @ stdcall VirtualProtectEx(long ptr long long ptr) kernel32.VirtualProtectEx +@ stub VirtualProtectFromApp -+@ stdcall VirtualQuery(ptr ptr long) kernel32.VirtualQuery -+@ stdcall VirtualQueryEx(long ptr ptr long) kernel32.VirtualQueryEx + @ stdcall VirtualQuery(ptr ptr long) kernel32.VirtualQuery + @ stdcall VirtualQueryEx(long ptr ptr long) kernel32.VirtualQueryEx +@ stdcall VirtualUnlock(ptr long) kernel32.VirtualUnlock +@ stub WTSGetServiceSessionId +@ stub WTSIsServerContainer @@ -1693,15 +1744,15 @@ +@ stub WaitForDebugEventEx +@ stub WaitForMachinePolicyForegroundProcessingInternal +@ stdcall WaitForMultipleObjects(long ptr long long) kernel32.WaitForMultipleObjects -+@ stdcall WaitForMultipleObjectsEx(long ptr long long long) kernel32.WaitForMultipleObjectsEx -+@ stdcall WaitForSingleObject(long long) kernel32.WaitForSingleObject -+@ stdcall WaitForSingleObjectEx(long long long) kernel32.WaitForSingleObjectEx -+@ stub WaitForThreadpoolIoCallbacks -+@ stdcall WaitForThreadpoolTimerCallbacks(ptr long) kernel32.WaitForThreadpoolTimerCallbacks -+@ stdcall WaitForThreadpoolWaitCallbacks(ptr long) kernel32.WaitForThreadpoolWaitCallbacks -+@ stdcall WaitForThreadpoolWorkCallbacks(ptr long) kernel32.WaitForThreadpoolWorkCallbacks + @ stdcall WaitForMultipleObjectsEx(long ptr long long long) kernel32.WaitForMultipleObjectsEx + @ stdcall WaitForSingleObject(long long) kernel32.WaitForSingleObject + @ stdcall WaitForSingleObjectEx(long long long) kernel32.WaitForSingleObjectEx +@@ -605,18 +1655,61 @@ + @ stdcall WaitForThreadpoolTimerCallbacks(ptr long) kernel32.WaitForThreadpoolTimerCallbacks + @ stdcall WaitForThreadpoolWaitCallbacks(ptr long) kernel32.WaitForThreadpoolWaitCallbacks + @ stdcall WaitForThreadpoolWorkCallbacks(ptr long) kernel32.WaitForThreadpoolWorkCallbacks +@ stub WaitForUserPolicyForegroundProcessingInternal -+@ stdcall WaitNamedPipeW(wstr long) kernel32.WaitNamedPipeW + @ stdcall WaitNamedPipeW(wstr long) kernel32.WaitNamedPipeW +@ stub WaitOnAddress +@ stdcall WakeAllConditionVariable(ptr) kernel32.WakeAllConditionVariable +@ stub WakeByAddressAll @@ -1717,9 +1768,9 @@ +@ stub WerUnregisterRuntimeExceptionModule +@ stub WerpNotifyLoadStringResource +@ stub WerpNotifyUseStringResource -+@ stdcall WideCharToMultiByte(long long wstr long ptr long ptr ptr) kernel32.WideCharToMultiByte -+@ stdcall Wow64DisableWow64FsRedirection(ptr) kernel32.Wow64DisableWow64FsRedirection -+@ stdcall Wow64RevertWow64FsRedirection(ptr) kernel32.Wow64RevertWow64FsRedirection + @ stdcall WideCharToMultiByte(long long wstr long ptr long ptr ptr) kernel32.WideCharToMultiByte + @ stdcall Wow64DisableWow64FsRedirection(ptr) kernel32.Wow64DisableWow64FsRedirection + @ stdcall Wow64RevertWow64FsRedirection(ptr) kernel32.Wow64RevertWow64FsRedirection +@ stdcall WriteConsoleA(long ptr long ptr ptr) kernel32.WriteConsoleA +@ stdcall WriteConsoleInputA(long ptr long ptr) kernel32.WriteConsoleInputA +@ stdcall WriteConsoleInputW(long ptr long ptr) kernel32.WriteConsoleInputW @@ -1729,10 +1780,14 @@ +@ stdcall WriteConsoleOutputCharacterW(long ptr long long ptr) kernel32.WriteConsoleOutputCharacterW +@ stdcall WriteConsoleOutputW(long ptr long long ptr) kernel32.WriteConsoleOutputW +@ stdcall WriteConsoleW(long ptr long ptr ptr) kernel32.WriteConsoleW -+@ stdcall WriteFile(long ptr long ptr ptr) kernel32.WriteFile -+@ stdcall WriteFileEx(long ptr long ptr ptr) kernel32.WriteFileEx -+@ stdcall WriteFileGather(long ptr long ptr ptr) kernel32.WriteFileGather -+@ stdcall WriteProcessMemory(long ptr ptr long ptr) kernel32.WriteProcessMemory + @ stdcall WriteFile(long ptr long ptr ptr) kernel32.WriteFile + @ stdcall WriteFileEx(long ptr long ptr ptr) kernel32.WriteFileEx + @ stdcall WriteFileGather(long ptr long ptr ptr) kernel32.WriteFileGather + @ stdcall WriteProcessMemory(long ptr ptr long ptr) kernel32.WriteProcessMemory +-@ stdcall -arch=x86_64 -private __C_specific_handler(ptr long ptr ptr) kernel32.__C_specific_handler +-@ stdcall -arch=arm,x86_64 -private -norelay __chkstk() kernel32.__chkstk +-@ stub __misaligned_access +-@ stdcall -arch=x86_64 -private _local_unwind(ptr ptr) kernel32._local_unwind +@ stub WriteStateAtomValue +@ stub WriteStateContainerValue +@ stdcall ZombifyActCtx(ptr) kernel32.ZombifyActCtx @@ -1755,18 +1810,13 @@ +@ stub exit +@ stub hgets +@ stub hwprintf -+@ stdcall lstrcmp(str str) kernel32.lstrcmp -+@ stdcall lstrcmpA(str str) kernel32.lstrcmpA -+@ stdcall lstrcmpW(wstr wstr) kernel32.lstrcmpW -+@ stdcall lstrcmpi(str str) kernel32.lstrcmpi -+@ stdcall lstrcmpiA(str str) kernel32.lstrcmpiA -+@ stdcall lstrcmpiW(wstr wstr) kernel32.lstrcmpiW -+@ stdcall lstrcpyn(ptr str long) kernel32.lstrcpyn -+@ stdcall lstrcpynA(ptr str long) kernel32.lstrcpynA -+@ stdcall lstrcpynW(ptr wstr long) kernel32.lstrcpynW -+@ stdcall lstrlen(str) kernel32.lstrlen -+@ stdcall lstrlenA(str) kernel32.lstrlenA -+@ stdcall lstrlenW(wstr) kernel32.lstrlenW + @ stdcall lstrcmp(str str) kernel32.lstrcmp + @ stdcall lstrcmpA(str str) kernel32.lstrcmpA + @ stdcall lstrcmpW(wstr wstr) kernel32.lstrcmpW +@@ -629,3 +1722,5 @@ + @ stdcall lstrlen(str) kernel32.lstrlen + @ stdcall lstrlenA(str) kernel32.lstrlenA + @ stdcall lstrlenW(wstr) kernel32.lstrlenW +@ stub time +@ stub wprintf diff --git a/dlls/kernelbase/misc.c b/dlls/kernelbase/misc.c @@ -1826,10 +1876,18 @@ 422 stdcall -noname SHGlobalCounterCreateNamedA(str long) 423 stdcall -noname SHGlobalCounterCreateNamedW(wstr long) diff --git a/tools/make_specfiles b/tools/make_specfiles -index 223af079..77be0c3 100755 +index b0a7b0a..43d12c3 100755 --- a/tools/make_specfiles +++ b/tools/make_specfiles -@@ -228,6 +228,13 @@ my @dll_groups = +@@ -214,7 +214,6 @@ my @dll_groups = + "api-ms-win-core-wow64-l1-1-0", + "api-ms-win-core-xstate-l2-1-0", + "api-ms-win-core-errorhandling-l1-1-2", +- "kernelbase", + ], + [ + "kernel32", +@@ -231,6 +230,13 @@ my @dll_groups = "api-ms-win-core-processthreads-l1-1-1", ], [ diff -Nru wine-staging-1.9.6/patches/api-ms-win-Stub_DLLs/0020-ext-ms-win-rtcore-ntuser-sysparams-l1-1-0-Add-dll.patch wine-staging-1.9.7~ubuntu15.04.1/patches/api-ms-win-Stub_DLLs/0020-ext-ms-win-rtcore-ntuser-sysparams-l1-1-0-Add-dll.patch --- wine-staging-1.9.6/patches/api-ms-win-Stub_DLLs/0020-ext-ms-win-rtcore-ntuser-sysparams-l1-1-0-Add-dll.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/api-ms-win-Stub_DLLs/0020-ext-ms-win-rtcore-ntuser-sysparams-l1-1-0-Add-dll.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,4 +1,4 @@ -From 1ab24ab7e6d2ef9915e7881bc36853edfc52d1ee Mon Sep 17 00:00:00 2001 +From 3a4e938b07407fd58a3a554cc8cbdb2d0b09a3d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sat, 23 Jan 2016 21:10:37 +0100 Subject: ext-ms-win-rtcore-ntuser-sysparams-l1-1-0: Add dll. @@ -33,12 +33,12 @@ +MODULE = ext-ms-win-rtcore-ntuser-sysparams-l1-1-0.dll diff --git a/dlls/ext-ms-win-rtcore-ntuser-sysparams-l1-1-0/ext-ms-win-rtcore-ntuser-sysparams-l1-1-0.spec b/dlls/ext-ms-win-rtcore-ntuser-sysparams-l1-1-0/ext-ms-win-rtcore-ntuser-sysparams-l1-1-0.spec new file mode 100644 -index 0000000..9d2af72 +index 0000000..374b961 --- /dev/null +++ b/dlls/ext-ms-win-rtcore-ntuser-sysparams-l1-1-0/ext-ms-win-rtcore-ntuser-sysparams-l1-1-0.spec @@ -0,0 +1,20 @@ +@ stdcall ChangeDisplaySettingsExW(wstr ptr long long ptr) user32.ChangeDisplaySettingsExW -+@ stub DisplayConfigGetDeviceInfo ++@ stdcall DisplayConfigGetDeviceInfo(ptr) user32.DisplayConfigGetDeviceInfo +@ stub DisplayConfigSetDeviceInfo +@ stdcall EnumDisplayDevicesW(ptr long ptr long) user32.EnumDisplayDevicesW +@ stdcall EnumDisplayMonitors(long ptr ptr long) user32.EnumDisplayMonitors @@ -52,16 +52,16 @@ +@ stdcall MonitorFromPoint(int64 long) user32.MonitorFromPoint +@ stdcall MonitorFromRect(ptr long) user32.MonitorFromRect +@ stdcall MonitorFromWindow(long long) user32.MonitorFromWindow -+@ stub QueryDisplayConfig ++@ stdcall QueryDisplayConfig(long ptr ptr ptr ptr ptr) user32.QueryDisplayConfig +@ stdcall SetProcessDPIAware() user32.SetProcessDPIAware +@ stdcall SetSysColors(long ptr ptr) user32.SetSysColors +@ stdcall SystemParametersInfoA(long long ptr long) user32.SystemParametersInfoA +@ stdcall SystemParametersInfoW(long long ptr long) user32.SystemParametersInfoW diff --git a/tools/make_specfiles b/tools/make_specfiles -index f482264..b364446 100755 +index bbf2b5e..c1c1860 100755 --- a/tools/make_specfiles +++ b/tools/make_specfiles -@@ -278,6 +278,7 @@ my @dll_groups = +@@ -281,6 +281,7 @@ my @dll_groups = "api-ms-win-rtcore-ntuser-window-l1-1-0", "ext-ms-win-ntuser-mouse-l1-1-0", "ext-ms-win-rtcore-ntuser-syscolors-l1-1-0", @@ -70,5 +70,5 @@ [ "version", -- -2.6.4 +2.7.1 diff -Nru wine-staging-1.9.6/patches/api-ms-win-Stub_DLLs/0024-kernelbase-Add-stub-for-QuirkIsEnabled3.patch wine-staging-1.9.7~ubuntu15.04.1/patches/api-ms-win-Stub_DLLs/0024-kernelbase-Add-stub-for-QuirkIsEnabled3.patch --- wine-staging-1.9.6/patches/api-ms-win-Stub_DLLs/0024-kernelbase-Add-stub-for-QuirkIsEnabled3.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/api-ms-win-Stub_DLLs/0024-kernelbase-Add-stub-for-QuirkIsEnabled3.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,4 +1,4 @@ -From d1cb153363aec82f8b7c5dbb0f382880e01fc2d4 Mon Sep 17 00:00:00 2001 +From d0688788458f243ccef2c337d7ab8f59ead75a3b 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. @@ -23,16 +23,16 @@ @ stub QuirkIsEnabledForPackage2 @ stub QuirkIsEnabledForProcess diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec -index 83fff3e..dbba3cc 100644 +index 8fdb80d..c0b2594 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec -@@ -1188,7 +1188,7 @@ +@@ -1189,7 +1189,7 @@ @ stub QuirkGetData2 - @ stub QuirkGetData + @ stdcall QuirkIsEnabled(ptr) @ stub QuirkIsEnabled2 -@ stub QuirkIsEnabled3 +@ stdcall QuirkIsEnabled3(ptr ptr) - @ stdcall QuirkIsEnabled(ptr) + @ stub QuirkIsEnabledForPackage @ stub QuirkIsEnabledForPackage2 @ stub QuirkIsEnabledForPackage3 diff --git a/dlls/kernelbase/misc.c b/dlls/kernelbase/misc.c @@ -54,5 +54,5 @@ + return FALSE; +} -- -2.7.0 +2.7.1 diff -Nru wine-staging-1.9.6/patches/Compiler_Warnings/0002-dsound-Avoid-implicit-cast-of-interface-pointer.patch wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0002-dsound-Avoid-implicit-cast-of-interface-pointer.patch --- wine-staging-1.9.6/patches/Compiler_Warnings/0002-dsound-Avoid-implicit-cast-of-interface-pointer.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0002-dsound-Avoid-implicit-cast-of-interface-pointer.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,26 @@ +From de9dbd542143b13741886c3e4b9f96ffcbfaa432 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Wed, 16 Mar 2016 05:46:33 +0100 +Subject: dsound: Avoid implicit cast of interface pointer. + +Signed-off-by: Sebastian Lackner +--- + dlls/dsound/primary.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c +index 3f8a478..6f280f8 100644 +--- a/dlls/dsound/primary.c ++++ b/dlls/dsound/primary.c +@@ -626,7 +626,7 @@ out: + static inline IDirectSoundBufferImpl *impl_from_IDirectSoundBuffer(IDirectSoundBuffer *iface) + { + /* IDirectSoundBuffer and IDirectSoundBuffer8 use the same iface. */ +- return CONTAINING_RECORD(iface, IDirectSoundBufferImpl, IDirectSoundBuffer8_iface); ++ return CONTAINING_RECORD((IDirectSoundBuffer8 *)iface, IDirectSoundBufferImpl, IDirectSoundBuffer8_iface); + } + + /* This sets this format for the primary buffer only */ +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/Compiler_Warnings/0003-amstream-Avoid-implicit-cast-of-interface-pointer.patch wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0003-amstream-Avoid-implicit-cast-of-interface-pointer.patch --- wine-staging-1.9.6/patches/Compiler_Warnings/0003-amstream-Avoid-implicit-cast-of-interface-pointer.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0003-amstream-Avoid-implicit-cast-of-interface-pointer.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,25 @@ +From 83d96cdd81553544c79527c2aed329e96938af64 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 22 Mar 2016 21:54:01 +0100 +Subject: amstream: Avoid implicit cast of interface pointer. + +--- + dlls/amstream/mediastreamfilter.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/amstream/mediastreamfilter.c b/dlls/amstream/mediastreamfilter.c +index d0c6714..3f0397a 100644 +--- a/dlls/amstream/mediastreamfilter.c ++++ b/dlls/amstream/mediastreamfilter.c +@@ -70,7 +70,7 @@ typedef struct { + + static inline IMediaStreamFilterImpl *impl_from_IMediaStreamFilter(IMediaStreamFilter *iface) + { +- return CONTAINING_RECORD(iface, IMediaStreamFilterImpl, filter); ++ return CONTAINING_RECORD((IBaseFilter *)iface, IMediaStreamFilterImpl, filter.IBaseFilter_iface); + } + + static HRESULT WINAPI BasePinImpl_CheckMediaType(BasePin *This, const AM_MEDIA_TYPE *pmt) +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/Compiler_Warnings/0004-d2d1-Avoid-implicit-cast-of-interface-pointer.patch wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0004-d2d1-Avoid-implicit-cast-of-interface-pointer.patch --- wine-staging-1.9.6/patches/Compiler_Warnings/0004-d2d1-Avoid-implicit-cast-of-interface-pointer.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0004-d2d1-Avoid-implicit-cast-of-interface-pointer.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,75 @@ +From 929eaf5dcdca040cd82141ad5ddfdcbc6c5f4a03 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 22 Mar 2016 21:54:26 +0100 +Subject: d2d1: Avoid implicit cast of interface pointer. + +--- + dlls/d2d1/brush.c | 6 +++--- + dlls/d2d1/geometry.c | 6 +++--- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/dlls/d2d1/brush.c b/dlls/d2d1/brush.c +index aa92318..19b0993 100644 +--- a/dlls/d2d1/brush.c ++++ b/dlls/d2d1/brush.c +@@ -181,7 +181,7 @@ static void d2d_brush_init(struct d2d_brush *brush, ID2D1Factory *factory, + + static inline struct d2d_brush *impl_from_ID2D1SolidColorBrush(ID2D1SolidColorBrush *iface) + { +- return CONTAINING_RECORD(iface, struct d2d_brush, ID2D1Brush_iface); ++ return CONTAINING_RECORD((ID2D1Brush *)iface, struct d2d_brush, ID2D1Brush_iface); + } + + static HRESULT STDMETHODCALLTYPE d2d_solid_color_brush_QueryInterface(ID2D1SolidColorBrush *iface, +@@ -318,7 +318,7 @@ void d2d_solid_color_brush_init(struct d2d_brush *brush, ID2D1Factory *factory, + + static inline struct d2d_brush *impl_from_ID2D1LinearGradientBrush(ID2D1LinearGradientBrush *iface) + { +- return CONTAINING_RECORD(iface, struct d2d_brush, ID2D1Brush_iface); ++ return CONTAINING_RECORD((ID2D1Brush *)iface, struct d2d_brush, ID2D1Brush_iface); + } + + static HRESULT STDMETHODCALLTYPE d2d_linear_gradient_brush_QueryInterface(ID2D1LinearGradientBrush *iface, +@@ -476,7 +476,7 @@ void d2d_linear_gradient_brush_init(struct d2d_brush *brush, ID2D1Factory *facto + + static inline struct d2d_brush *impl_from_ID2D1BitmapBrush(ID2D1BitmapBrush *iface) + { +- return CONTAINING_RECORD(iface, struct d2d_brush, ID2D1Brush_iface); ++ return CONTAINING_RECORD((ID2D1Brush *)iface, struct d2d_brush, ID2D1Brush_iface); + } + + static HRESULT STDMETHODCALLTYPE d2d_bitmap_brush_QueryInterface(ID2D1BitmapBrush *iface, +diff --git a/dlls/d2d1/geometry.c b/dlls/d2d1/geometry.c +index 9fa1783..125c610 100644 +--- a/dlls/d2d1/geometry.c ++++ b/dlls/d2d1/geometry.c +@@ -2022,7 +2022,7 @@ static const struct ID2D1GeometrySinkVtbl d2d_geometry_sink_vtbl = + + static inline struct d2d_geometry *impl_from_ID2D1PathGeometry(ID2D1PathGeometry *iface) + { +- return CONTAINING_RECORD(iface, struct d2d_geometry, ID2D1Geometry_iface); ++ return CONTAINING_RECORD((ID2D1Geometry *)iface, struct d2d_geometry, ID2D1Geometry_iface); + } + + static HRESULT STDMETHODCALLTYPE d2d_path_geometry_QueryInterface(ID2D1PathGeometry *iface, REFIID iid, void **out) +@@ -2283,7 +2283,7 @@ void d2d_path_geometry_init(struct d2d_geometry *geometry, ID2D1Factory *factory + + static inline struct d2d_geometry *impl_from_ID2D1RectangleGeometry(ID2D1RectangleGeometry *iface) + { +- return CONTAINING_RECORD(iface, struct d2d_geometry, ID2D1Geometry_iface); ++ return CONTAINING_RECORD((ID2D1Geometry *)iface, struct d2d_geometry, ID2D1Geometry_iface); + } + + static HRESULT STDMETHODCALLTYPE d2d_rectangle_geometry_QueryInterface(ID2D1RectangleGeometry *iface, +@@ -2531,7 +2531,7 @@ HRESULT d2d_rectangle_geometry_init(struct d2d_geometry *geometry, ID2D1Factory + + static inline struct d2d_geometry *impl_from_ID2D1TransformedGeometry(ID2D1TransformedGeometry *iface) + { +- return CONTAINING_RECORD(iface, struct d2d_geometry, ID2D1Geometry_iface); ++ return CONTAINING_RECORD((ID2D1Geometry *)iface, struct d2d_geometry, ID2D1Geometry_iface); + } + + static HRESULT STDMETHODCALLTYPE d2d_transformed_geometry_QueryInterface(ID2D1TransformedGeometry *iface, +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/Compiler_Warnings/0005-d3d11-Avoid-implicit-cast-of-interface-pointer.patch wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0005-d3d11-Avoid-implicit-cast-of-interface-pointer.patch --- wine-staging-1.9.6/patches/Compiler_Warnings/0005-d3d11-Avoid-implicit-cast-of-interface-pointer.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0005-d3d11-Avoid-implicit-cast-of-interface-pointer.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,23 @@ +From 71e593294e868bafa0b0b45c2694d7c0dceb0d64 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 22 Mar 2016 21:54:48 +0100 +Subject: d3d11: Avoid implicit cast of interface pointer. + +--- + dlls/d3d11/view.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/d3d11/view.c b/dlls/d3d11/view.c +index 1d9b766..78fc1ad 100644 +--- a/dlls/d3d11/view.c ++++ b/dlls/d3d11/view.c +@@ -1559,5 +1559,5 @@ struct d3d_shader_resource_view *unsafe_impl_from_ID3D10ShaderResourceView(ID3D1 + if (!iface) + return NULL; + assert(iface->lpVtbl == (ID3D10ShaderResourceViewVtbl *)&d3d10_shader_resource_view_vtbl); +- return CONTAINING_RECORD(iface, struct d3d_shader_resource_view, ID3D10ShaderResourceView1_iface); ++ return CONTAINING_RECORD((ID3D10ShaderResourceView1 *)iface, struct d3d_shader_resource_view, ID3D10ShaderResourceView1_iface); + } +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/Compiler_Warnings/0006-d3d8-Avoid-implicit-cast-of-interface-pointer.patch wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0006-d3d8-Avoid-implicit-cast-of-interface-pointer.patch --- wine-staging-1.9.6/patches/Compiler_Warnings/0006-d3d8-Avoid-implicit-cast-of-interface-pointer.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0006-d3d8-Avoid-implicit-cast-of-interface-pointer.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,37 @@ +From 0913c58ca5a15868fa72c883d46db1f0038a2e22 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 22 Mar 2016 21:55:00 +0100 +Subject: d3d8: Avoid implicit cast of interface pointer. + +--- + dlls/d3d8/texture.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/dlls/d3d8/texture.c b/dlls/d3d8/texture.c +index 7ed79a5..62463ba 100644 +--- a/dlls/d3d8/texture.c ++++ b/dlls/d3d8/texture.c +@@ -23,17 +23,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d8); + + static inline struct d3d8_texture *impl_from_IDirect3DTexture8(IDirect3DTexture8 *iface) + { +- return CONTAINING_RECORD(iface, struct d3d8_texture, IDirect3DBaseTexture8_iface); ++ return CONTAINING_RECORD((IDirect3DBaseTexture8 *)iface, struct d3d8_texture, IDirect3DBaseTexture8_iface); + } + + static inline struct d3d8_texture *impl_from_IDirect3DCubeTexture8(IDirect3DCubeTexture8 *iface) + { +- return CONTAINING_RECORD(iface, struct d3d8_texture, IDirect3DBaseTexture8_iface); ++ return CONTAINING_RECORD((IDirect3DBaseTexture8 *)iface, struct d3d8_texture, IDirect3DBaseTexture8_iface); + } + + static inline struct d3d8_texture *impl_from_IDirect3DVolumeTexture8(IDirect3DVolumeTexture8 *iface) + { +- return CONTAINING_RECORD(iface, struct d3d8_texture, IDirect3DBaseTexture8_iface); ++ return CONTAINING_RECORD((IDirect3DBaseTexture8 *)iface, struct d3d8_texture, IDirect3DBaseTexture8_iface); + } + + static HRESULT WINAPI d3d8_texture_2d_QueryInterface(IDirect3DTexture8 *iface, REFIID riid, void **out) +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/Compiler_Warnings/0007-d3d9-Avoid-implicit-cast-of-interface-pointer.patch wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0007-d3d9-Avoid-implicit-cast-of-interface-pointer.patch --- wine-staging-1.9.6/patches/Compiler_Warnings/0007-d3d9-Avoid-implicit-cast-of-interface-pointer.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0007-d3d9-Avoid-implicit-cast-of-interface-pointer.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,37 @@ +From cd3c63b259a711abf4e6e06f975e47f82b5b3e1b Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 22 Mar 2016 21:55:12 +0100 +Subject: d3d9: Avoid implicit cast of interface pointer. + +--- + dlls/d3d9/texture.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/dlls/d3d9/texture.c b/dlls/d3d9/texture.c +index 07bd83e..4e50093 100644 +--- a/dlls/d3d9/texture.c ++++ b/dlls/d3d9/texture.c +@@ -25,17 +25,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d9); + + static inline struct d3d9_texture *impl_from_IDirect3DTexture9(IDirect3DTexture9 *iface) + { +- return CONTAINING_RECORD(iface, struct d3d9_texture, IDirect3DBaseTexture9_iface); ++ return CONTAINING_RECORD((IDirect3DBaseTexture9 *)iface, struct d3d9_texture, IDirect3DBaseTexture9_iface); + } + + static inline struct d3d9_texture *impl_from_IDirect3DCubeTexture9(IDirect3DCubeTexture9 *iface) + { +- return CONTAINING_RECORD(iface, struct d3d9_texture, IDirect3DBaseTexture9_iface); ++ return CONTAINING_RECORD((IDirect3DBaseTexture9 *)iface, struct d3d9_texture, IDirect3DBaseTexture9_iface); + } + + static inline struct d3d9_texture *impl_from_IDirect3DVolumeTexture9(IDirect3DVolumeTexture9 *iface) + { +- return CONTAINING_RECORD(iface, struct d3d9_texture, IDirect3DBaseTexture9_iface); ++ return CONTAINING_RECORD((IDirect3DBaseTexture9 *)iface, struct d3d9_texture, IDirect3DBaseTexture9_iface); + } + + static HRESULT WINAPI d3d9_texture_2d_QueryInterface(IDirect3DTexture9 *iface, REFIID riid, void **out) +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/Compiler_Warnings/0008-ddraw-Avoid-implicit-cast-of-interface-pointer.patch wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0008-ddraw-Avoid-implicit-cast-of-interface-pointer.patch --- wine-staging-1.9.6/patches/Compiler_Warnings/0008-ddraw-Avoid-implicit-cast-of-interface-pointer.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0008-ddraw-Avoid-implicit-cast-of-interface-pointer.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,34 @@ +From ff2e84fd4c6c12b5e9e6c9d793b71159295b1e01 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 22 Mar 2016 21:58:30 +0100 +Subject: ddraw: Avoid implicit cast of interface pointer. + +--- + dlls/ddraw/viewport.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dlls/ddraw/viewport.c b/dlls/ddraw/viewport.c +index 5ebc41e..4f61d10 100644 +--- a/dlls/ddraw/viewport.c ++++ b/dlls/ddraw/viewport.c +@@ -1121,7 +1121,7 @@ struct d3d_viewport *unsafe_impl_from_IDirect3DViewport2(IDirect3DViewport2 *ifa + /* IDirect3DViewport and IDirect3DViewport3 use the same iface. */ + if (!iface) return NULL; + assert(iface->lpVtbl == (IDirect3DViewport2Vtbl *)&d3d_viewport_vtbl); +- return CONTAINING_RECORD(iface, struct d3d_viewport, IDirect3DViewport3_iface); ++ return CONTAINING_RECORD((IDirect3DViewport3 *)iface, struct d3d_viewport, IDirect3DViewport3_iface); + } + + struct d3d_viewport *unsafe_impl_from_IDirect3DViewport(IDirect3DViewport *iface) +@@ -1129,7 +1129,7 @@ struct d3d_viewport *unsafe_impl_from_IDirect3DViewport(IDirect3DViewport *iface + /* IDirect3DViewport and IDirect3DViewport3 use the same iface. */ + if (!iface) return NULL; + assert(iface->lpVtbl == (IDirect3DViewportVtbl *)&d3d_viewport_vtbl); +- return CONTAINING_RECORD(iface, struct d3d_viewport, IDirect3DViewport3_iface); ++ return CONTAINING_RECORD((IDirect3DViewport3 *)iface, struct d3d_viewport, IDirect3DViewport3_iface); + } + + void d3d_viewport_init(struct d3d_viewport *viewport, struct ddraw *ddraw) +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/Compiler_Warnings/0009-dwrite-Avoid-implicit-cast-of-interface-pointer.patch wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0009-dwrite-Avoid-implicit-cast-of-interface-pointer.patch --- wine-staging-1.9.6/patches/Compiler_Warnings/0009-dwrite-Avoid-implicit-cast-of-interface-pointer.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0009-dwrite-Avoid-implicit-cast-of-interface-pointer.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,25 @@ +From 869fbc7190eb77e027be4bcd98d938198189c3dd Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 22 Mar 2016 21:58:40 +0100 +Subject: dwrite: Avoid implicit cast of interface pointer. + +--- + dlls/dwrite/layout.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c +index 38b5e32..24f4abc 100644 +--- a/dlls/dwrite/layout.c ++++ b/dlls/dwrite/layout.c +@@ -5115,7 +5115,7 @@ static const IDWriteTextFormat2Vtbl dwritetextformatvtbl = { + static struct dwrite_textformat *unsafe_impl_from_IDWriteTextFormat(IDWriteTextFormat *iface) + { + return (iface->lpVtbl == (IDWriteTextFormatVtbl*)&dwritetextformatvtbl) ? +- CONTAINING_RECORD(iface, struct dwrite_textformat, IDWriteTextFormat2_iface) : NULL; ++ CONTAINING_RECORD((IDWriteTextFormat2 *)iface, struct dwrite_textformat, IDWriteTextFormat2_iface) : NULL; + } + + HRESULT create_textformat(const WCHAR *family_name, IDWriteFontCollection *collection, DWRITE_FONT_WEIGHT weight, DWRITE_FONT_STYLE style, +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/Compiler_Warnings/0010-msxml3-Avoid-implicit-cast-of-interface-pointer.patch wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0010-msxml3-Avoid-implicit-cast-of-interface-pointer.patch --- wine-staging-1.9.6/patches/Compiler_Warnings/0010-msxml3-Avoid-implicit-cast-of-interface-pointer.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0010-msxml3-Avoid-implicit-cast-of-interface-pointer.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,25 @@ +From 665373effeadbf44f75dd15b6ea27ebec0fd7190 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 22 Mar 2016 22:28:09 +0100 +Subject: msxml3: Avoid implicit cast of interface pointer. + +--- + dlls/msxml3/schema.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/msxml3/schema.c b/dlls/msxml3/schema.c +index f92130a..03d24b2 100644 +--- a/dlls/msxml3/schema.c ++++ b/dlls/msxml3/schema.c +@@ -809,7 +809,7 @@ static inline schema_cache* impl_from_IXMLDOMSchemaCollection2(IXMLDOMSchemaColl + + static inline schema_cache* impl_from_IXMLDOMSchemaCollection(IXMLDOMSchemaCollection* iface) + { +- return CONTAINING_RECORD(iface, schema_cache, IXMLDOMSchemaCollection2_iface); ++ return CONTAINING_RECORD((IXMLDOMSchemaCollection2 *)iface, schema_cache, IXMLDOMSchemaCollection2_iface); + } + + static inline schema_cache* unsafe_impl_from_IXMLDOMSchemaCollection(IXMLDOMSchemaCollection *iface) +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/Compiler_Warnings/0011-oleaut32-Avoid-implicit-cast-of-interface-pointer.patch wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0011-oleaut32-Avoid-implicit-cast-of-interface-pointer.patch --- wine-staging-1.9.6/patches/Compiler_Warnings/0011-oleaut32-Avoid-implicit-cast-of-interface-pointer.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0011-oleaut32-Avoid-implicit-cast-of-interface-pointer.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,25 @@ +From 60ab37cc3ba6cb771fccc187ea87b669ac83dc80 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 22 Mar 2016 22:28:23 +0100 +Subject: oleaut32: Avoid implicit cast of interface pointer. + +--- + dlls/oleaut32/oleaut.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/oleaut32/oleaut.c b/dlls/oleaut32/oleaut.c +index 742e63f..8dae150 100644 +--- a/dlls/oleaut32/oleaut.c ++++ b/dlls/oleaut32/oleaut.c +@@ -117,7 +117,7 @@ static inline size_t bstr_alloc_size(size_t size) + + static inline bstr_t *bstr_from_str(BSTR str) + { +- return CONTAINING_RECORD(str, bstr_t, u.str); ++ return CONTAINING_RECORD((void *)str, bstr_t, u.str); + } + + static inline bstr_cache_entry_t *get_cache_entry_from_idx(unsigned cache_idx) +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/Compiler_Warnings/0012-rpcrt4-Avoid-implicit-cast-of-interface-pointer.patch wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0012-rpcrt4-Avoid-implicit-cast-of-interface-pointer.patch --- wine-staging-1.9.6/patches/Compiler_Warnings/0012-rpcrt4-Avoid-implicit-cast-of-interface-pointer.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0012-rpcrt4-Avoid-implicit-cast-of-interface-pointer.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,25 @@ +From e35d665256d08ebccee30361867ba57f790d519f Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 22 Mar 2016 23:01:32 +0100 +Subject: rpcrt4: Avoid implicit cast of interface pointer. + +--- + dlls/rpcrt4/cstub.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/rpcrt4/cstub.c b/dlls/rpcrt4/cstub.c +index 838ed03..992c235 100644 +--- a/dlls/rpcrt4/cstub.c ++++ b/dlls/rpcrt4/cstub.c +@@ -59,7 +59,7 @@ typedef struct + + static inline cstdstubbuffer_delegating_t *impl_from_delegating( IRpcStubBuffer *iface ) + { +- return CONTAINING_RECORD(iface, cstdstubbuffer_delegating_t, stub_buffer); ++ return CONTAINING_RECORD((void *)iface, cstdstubbuffer_delegating_t, stub_buffer); + } + + HRESULT CStdStubBuffer_Construct(REFIID riid, +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/Compiler_Warnings/0013-vbscript-Avoid-implicit-cast-of-interface-pointer.patch wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0013-vbscript-Avoid-implicit-cast-of-interface-pointer.patch --- wine-staging-1.9.6/patches/Compiler_Warnings/0013-vbscript-Avoid-implicit-cast-of-interface-pointer.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0013-vbscript-Avoid-implicit-cast-of-interface-pointer.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,25 @@ +From 1806798cf9b186d2c788f5a94074d0d6fa426f9e Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 22 Mar 2016 23:01:48 +0100 +Subject: vbscript: Avoid implicit cast of interface pointer. + +--- + dlls/vbscript/vbdisp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dlls/vbscript/vbdisp.c b/dlls/vbscript/vbdisp.c +index 9c0c4c1..daed7ec 100644 +--- a/dlls/vbscript/vbdisp.c ++++ b/dlls/vbscript/vbdisp.c +@@ -555,7 +555,7 @@ static IDispatchExVtbl DispatchExVtbl = { + static inline vbdisp_t *unsafe_impl_from_IDispatch(IDispatch *iface) + { + return iface->lpVtbl == (IDispatchVtbl*)&DispatchExVtbl +- ? CONTAINING_RECORD(iface, vbdisp_t, IDispatchEx_iface) ++ ? CONTAINING_RECORD((IDispatchEx *)iface, vbdisp_t, IDispatchEx_iface) + : NULL; + } + +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/Compiler_Warnings/0014-include-Check-element-type-in-CONTAINING_RECORD-and-.patch wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0014-include-Check-element-type-in-CONTAINING_RECORD-and-.patch --- wine-staging-1.9.6/patches/Compiler_Warnings/0014-include-Check-element-type-in-CONTAINING_RECORD-and-.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/Compiler_Warnings/0014-include-Check-element-type-in-CONTAINING_RECORD-and-.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,76 @@ +From 59f0bb786dc3ec4e77cb43ea4410743ecd317bbf Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 22 Mar 2016 23:08:30 +0100 +Subject: include: Check element type in CONTAINING_RECORD and similar macros. + +--- + include/wine/list.h | 10 ++++++++-- + include/wine/rbtree.h | 10 ++++++++-- + include/winnt.h | 10 ++++++++-- + 3 files changed, 24 insertions(+), 6 deletions(-) + +diff --git a/include/wine/list.h b/include/wine/list.h +index b4d681f..287ad39 100644 +--- a/include/wine/list.h ++++ b/include/wine/list.h +@@ -228,7 +228,13 @@ static inline void list_move_head( struct list *dst, struct list *src ) + + /* get pointer to object containing list element */ + #undef LIST_ENTRY +-#define LIST_ENTRY(elem, type, field) \ +- ((type *)((char *)(elem) - offsetof(type, field))) ++#ifdef __GNUC__ ++# define LIST_ENTRY(elem, type, field) ({ \ ++ const typeof(((type *)0)->field) *__ptr = (elem); \ ++ (type *)((char *)__ptr - offsetof(type, field)); }) ++#else ++# define LIST_ENTRY(elem, type, field) \ ++ ((type *)((char *)(elem) - offsetof(type, field))) ++#endif + + #endif /* __WINE_SERVER_LIST_H */ +diff --git a/include/wine/rbtree.h b/include/wine/rbtree.h +index 13452d9..554d239 100644 +--- a/include/wine/rbtree.h ++++ b/include/wine/rbtree.h +@@ -22,8 +22,14 @@ + #ifndef __WINE_WINE_RBTREE_H + #define __WINE_WINE_RBTREE_H + +-#define WINE_RB_ENTRY_VALUE(element, type, field) \ +- ((type *)((char *)(element) - offsetof(type, field))) ++#ifdef __GNUC__ ++# define WINE_RB_ENTRY_VALUE(element, type, field) ({ \ ++ const typeof(((type *)0)->field) *__ptr = (element); \ ++ (type *)((char *)__ptr - offsetof(type, field)); }) ++#else ++# define WINE_RB_ENTRY_VALUE(element, type, field) \ ++ ((type *)((char *)(element) - offsetof(type, field))) ++#endif + + struct wine_rb_entry + { +diff --git a/include/winnt.h b/include/winnt.h +index 559a719..4a711f4 100644 +--- a/include/winnt.h ++++ b/include/winnt.h +@@ -753,8 +753,14 @@ typedef struct _MEMORY_BASIC_INFORMATION + + #define FIELD_OFFSET(type, field) ((LONG)offsetof(type, field)) + +-#define CONTAINING_RECORD(address, type, field) \ +- ((type *)((PCHAR)(address) - offsetof(type, field))) ++#ifdef __GNUC__ ++# define CONTAINING_RECORD(address, type, field) ({ \ ++ const typeof(((type *)0)->field) *__ptr = (address); \ ++ (type *)((PCHAR)__ptr - offsetof(type, field)); }) ++#else ++# define CONTAINING_RECORD(address, type, field) \ ++ ((type *)((PCHAR)(address) - offsetof(type, field))) ++#endif + + /* Types */ + +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/d3dx9_33-Share_Source/0001-d3dx9_33-Share-the-source-with-d3dx9_36.patch wine-staging-1.9.7~ubuntu15.04.1/patches/d3dx9_33-Share_Source/0001-d3dx9_33-Share-the-source-with-d3dx9_36.patch --- wine-staging-1.9.6/patches/d3dx9_33-Share_Source/0001-d3dx9_33-Share-the-source-with-d3dx9_36.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/d3dx9_33-Share_Source/0001-d3dx9_33-Share-the-source-with-d3dx9_36.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,20 +1,20 @@ -From 756f4d6d55f13e5112213562d13db7f33adbdf7f Mon Sep 17 00:00:00 2001 +From 1b67c1863bd891d9949d0e391306135519e722b5 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 13 Jul 2015 20:38:04 +1000 Subject: d3dx9_33: Share the source with d3dx9_36 --- - dlls/d3dx9_33/Makefile.in | 21 +- + dlls/d3dx9_33/Makefile.in | 22 +- dlls/d3dx9_33/d3dx9_33.spec | 667 +++++++++++++++++++++--------------------- dlls/d3dx9_33/d3dx9_33_main.c | 19 ++ tools/make_specfiles | 1 - - 4 files changed, 372 insertions(+), 336 deletions(-) + 4 files changed, 373 insertions(+), 336 deletions(-) diff --git a/dlls/d3dx9_33/Makefile.in b/dlls/d3dx9_33/Makefile.in -index 0934eab..7b0151d 100644 +index 0934eab..1106d11 100644 --- a/dlls/d3dx9_33/Makefile.in +++ b/dlls/d3dx9_33/Makefile.in -@@ -1,7 +1,24 @@ +@@ -1,7 +1,25 @@ MODULE = d3dx9_33.dll -IMPORTS = d3d9 +IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 wined3d @@ -30,6 +30,7 @@ + line.c \ + math.c \ + mesh.c \ ++ preshader.c \ + render.c \ + shader.c \ + skin.c \ @@ -749,7 +750,7 @@ + return 900; +} diff --git a/tools/make_specfiles b/tools/make_specfiles -index 16db908..9367107 100755 +index b0a7b0a..75be4b3 100755 --- a/tools/make_specfiles +++ b/tools/make_specfiles @@ -83,7 +83,6 @@ my @dll_groups = @@ -761,5 +762,5 @@ "d3dx9_31", "d3dx9_30", -- -2.6.4 +2.7.1 diff -Nru wine-staging-1.9.6/patches/d3dx9_36-Dummy_Skininfo/0001-d3dx9_36-Return-dummy-skininfo-interface-in-D3DXLoad.patch wine-staging-1.9.7~ubuntu15.04.1/patches/d3dx9_36-Dummy_Skininfo/0001-d3dx9_36-Return-dummy-skininfo-interface-in-D3DXLoad.patch --- wine-staging-1.9.6/patches/d3dx9_36-Dummy_Skininfo/0001-d3dx9_36-Return-dummy-skininfo-interface-in-D3DXLoad.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/d3dx9_36-Dummy_Skininfo/0001-d3dx9_36-Return-dummy-skininfo-interface-in-D3DXLoad.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,31 +1,31 @@ -From 95b6016b7cfb62a70ec9bbcc39117f68259aa93b Mon Sep 17 00:00:00 2001 +From 7aca17433be04df15990308c3a081feb2f3a97f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Tue, 28 Jul 2015 17:26:09 +0200 Subject: d3dx9_36: Return dummy skininfo interface in D3DXLoadSkinMeshFromXof when skin information is unavailable. --- - dlls/d3dx9_36/d3dx9_private.h | 2 ++ - dlls/d3dx9_36/mesh.c | 7 +++++++ - dlls/d3dx9_36/skin.c | 22 +++++++++++++++++++++- + dlls/d3dx9_36/d3dx9_private.h | 2 ++ + dlls/d3dx9_36/mesh.c | 7 +++++++ + dlls/d3dx9_36/skin.c | 22 +++++++++++++++++++++- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/dlls/d3dx9_36/d3dx9_private.h b/dlls/d3dx9_36/d3dx9_private.h -index 79f3b76..b6707f6 100644 +index 5ba93ac..f4cdabc 100644 --- a/dlls/d3dx9_36/d3dx9_private.h +++ b/dlls/d3dx9_36/d3dx9_private.h -@@ -110,4 +110,6 @@ const char *debug_d3dxparameter_registerset(D3DXREGISTER_SET r) DECLSPEC_HIDDEN; - void set_number(void *outdata, D3DXPARAMETER_TYPE outtype, - const void *indata, D3DXPARAMETER_TYPE intype) DECLSPEC_HIDDEN; +@@ -144,4 +144,6 @@ HRESULT d3dx_create_param_eval(struct d3dx9_base_effect *base_effect, void *byte + unsigned int byte_code_size, D3DXPARAMETER_TYPE type, struct d3dx_param_eval **peval) DECLSPEC_HIDDEN; + void d3dx_free_param_eval(struct d3dx_param_eval *peval) DECLSPEC_HIDDEN; +HRESULT create_dummy_skin(ID3DXSkinInfo **iface) DECLSPEC_HIDDEN; + #endif /* __WINE_D3DX9_PRIVATE_H */ diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c -index 4aeac26..3cd85a3 100644 +index 3204ea7..61dd203 100644 --- a/dlls/d3dx9_36/mesh.c +++ b/dlls/d3dx9_36/mesh.c -@@ -3334,6 +3334,13 @@ static HRESULT parse_mesh(ID3DXFileData *filedata, struct mesh_data *mesh_data, +@@ -3332,6 +3332,13 @@ static HRESULT parse_mesh(ID3DXFileData *filedata, struct mesh_data *mesh_data, goto end; } @@ -40,10 +40,10 @@ end: diff --git a/dlls/d3dx9_36/skin.c b/dlls/d3dx9_36/skin.c -index 9b93af6..3d68829 100644 +index f197d33..bed4b9f 100644 --- a/dlls/d3dx9_36/skin.c +++ b/dlls/d3dx9_36/skin.c -@@ -92,7 +92,7 @@ static ULONG WINAPI d3dx9_skin_info_Release(ID3DXSkinInfo *iface) +@@ -94,7 +94,7 @@ static ULONG WINAPI d3dx9_skin_info_Release(ID3DXSkinInfo *iface) HeapFree(GetProcessHeap(), 0, skin->bones[i].vertices); HeapFree(GetProcessHeap(), 0, skin->bones[i].weights); } @@ -52,7 +52,7 @@ HeapFree(GetProcessHeap(), 0, skin); } -@@ -493,3 +493,23 @@ HRESULT WINAPI D3DXCreateSkinInfoFVF(DWORD num_vertices, DWORD fvf, DWORD num_bo +@@ -495,3 +495,23 @@ HRESULT WINAPI D3DXCreateSkinInfoFVF(DWORD num_vertices, DWORD fvf, DWORD num_bo return D3DXCreateSkinInfo(num_vertices, declaration, num_bones, skin_info); } @@ -77,5 +77,5 @@ + return D3D_OK; +} -- -2.4.5 +2.7.1 diff -Nru wine-staging-1.9.6/patches/d3dx9_36-FindNextValidTechnique/0001-d3dx9_36-Implement-ID3DXEffect_FindNextValidTechniqu.patch wine-staging-1.9.7~ubuntu15.04.1/patches/d3dx9_36-FindNextValidTechnique/0001-d3dx9_36-Implement-ID3DXEffect_FindNextValidTechniqu.patch --- wine-staging-1.9.6/patches/d3dx9_36-FindNextValidTechnique/0001-d3dx9_36-Implement-ID3DXEffect_FindNextValidTechniqu.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/d3dx9_36-FindNextValidTechnique/0001-d3dx9_36-Implement-ID3DXEffect_FindNextValidTechniqu.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,4 +1,4 @@ -From 000f06385dc49a3f2ddc1d866013e7632a6e0370 Mon Sep 17 00:00:00 2001 +From 66ea1296b0b3493271a7611bfa56b0d74b34b16c Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Fri, 19 Dec 2014 22:31:46 +0100 Subject: d3dx9_36: Implement ID3DXEffect_FindNextValidTechnique + add tests. @@ -9,10 +9,10 @@ 2 files changed, 91 insertions(+), 3 deletions(-) diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c -index 4be6e4b..ecd1b74 100644 +index a210bb3..2fbc1cb 100644 --- a/dlls/d3dx9_36/effect.c +++ b/dlls/d3dx9_36/effect.c -@@ -3471,13 +3471,41 @@ static HRESULT WINAPI ID3DXEffectImpl_ValidateTechnique(ID3DXEffect* iface, D3DX +@@ -3483,13 +3483,41 @@ static HRESULT WINAPI ID3DXEffectImpl_ValidateTechnique(ID3DXEffect* iface, D3DX return D3D_OK; } @@ -58,11 +58,11 @@ static BOOL WINAPI ID3DXEffectImpl_IsParameterUsed(ID3DXEffect* iface, D3DXHANDLE parameter, D3DXHANDLE technique) diff --git a/dlls/d3dx9_36/tests/effect.c b/dlls/d3dx9_36/tests/effect.c -index de7d1e9..f34b1f8 100644 +index c388e7d..8653e0e 100644 --- a/dlls/d3dx9_36/tests/effect.c +++ b/dlls/d3dx9_36/tests/effect.c -@@ -2972,6 +2972,65 @@ static void test_effect_states(IDirect3DDevice9 *device) - ok(value == 3, "Got result %u, expected %u.\n", value, 1); +@@ -3886,6 +3886,65 @@ static void test_effect_preshader(IDirect3DDevice9 *device) + effect->lpVtbl->Release(effect); } +/* @@ -127,10 +127,10 @@ START_TEST(effect) { HWND wnd; -@@ -3011,6 +3070,7 @@ START_TEST(effect) - test_effect_variable_names(device); +@@ -3927,6 +3986,7 @@ START_TEST(effect) test_effect_compilation_errors(device); test_effect_states(device); + test_effect_preshader(device); + test_effect_technique_validation(device); count = IDirect3DDevice9_Release(device); diff -Nru wine-staging-1.9.6/patches/ddraw-Device_Caps/0003-ddraw-Set-ddsOldCaps-correctly-in-ddraw7_GetCaps.patch wine-staging-1.9.7~ubuntu15.04.1/patches/ddraw-Device_Caps/0003-ddraw-Set-ddsOldCaps-correctly-in-ddraw7_GetCaps.patch --- wine-staging-1.9.6/patches/ddraw-Device_Caps/0003-ddraw-Set-ddsOldCaps-correctly-in-ddraw7_GetCaps.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/ddraw-Device_Caps/0003-ddraw-Set-ddsOldCaps-correctly-in-ddraw7_GetCaps.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,4 +1,4 @@ -From 481804163415517f2dd6f8e7f8d739791b17aba5 Mon Sep 17 00:00:00 2001 +From 868ce47167682925bef4e2e7662064ac45d0abc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Fri, 4 Mar 2016 22:22:42 +0100 Subject: ddraw: Set ddsOldCaps correctly in ddraw7_GetCaps. @@ -25,10 +25,10 @@ if(DriverCaps) diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c -index 1e1a2ff..c2f0b78 100644 +index 02eb9c9..e48307b 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c -@@ -8497,6 +8497,31 @@ done: +@@ -8573,6 +8573,31 @@ static void test_blt(void) DestroyWindow(window); } @@ -60,17 +60,17 @@ START_TEST(ddraw1) { IDirectDraw *ddraw; -@@ -8573,4 +8598,5 @@ START_TEST(ddraw1) - test_yv12_overlay(); +@@ -8650,4 +8675,5 @@ START_TEST(ddraw1) test_offscreen_overlay(); test_overlay_rect(); + test_blt(); + test_caps(); } diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c -index 75bdc84..03ca99c 100644 +index ee3508f..719b8ef 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c -@@ -9604,6 +9604,31 @@ done: +@@ -9680,6 +9680,31 @@ static void test_blt(void) DestroyWindow(window); } @@ -102,17 +102,17 @@ START_TEST(ddraw2) { IDirectDraw2 *ddraw; -@@ -9687,4 +9712,5 @@ START_TEST(ddraw2) - test_yv12_overlay(); +@@ -9764,4 +9789,5 @@ START_TEST(ddraw2) test_offscreen_overlay(); test_overlay_rect(); + test_blt(); + test_caps(); } diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c -index a092787..2e6564a 100644 +index 1bb2969..1b8367c 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c -@@ -10775,6 +10775,31 @@ done: +@@ -10956,6 +10956,31 @@ static void test_color_clamping(void) DestroyWindow(window); } @@ -144,17 +144,17 @@ START_TEST(ddraw4) { IDirectDraw4 *ddraw; -@@ -10865,4 +10890,5 @@ START_TEST(ddraw4) - test_yv12_overlay(); - test_offscreen_overlay(); +@@ -11048,4 +11073,5 @@ START_TEST(ddraw4) test_overlay_rect(); + test_blt(); + test_color_clamping(); + test_caps(); } diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c -index 1509be7..46330e5 100644 +index 29de0aa..0d2f00d 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c -@@ -11066,6 +11066,31 @@ done: +@@ -11240,6 +11240,31 @@ static void test_color_clamping(void) DestroyWindow(window); } @@ -186,10 +186,10 @@ START_TEST(ddraw7) { HMODULE module = GetModuleHandleA("ddraw.dll"); -@@ -11167,4 +11192,5 @@ START_TEST(ddraw7) - test_yv12_overlay(); - test_offscreen_overlay(); +@@ -11343,4 +11368,5 @@ START_TEST(ddraw7) test_overlay_rect(); + test_blt(); + test_color_clamping(); + test_caps(); } -- diff -Nru wine-staging-1.9.6/patches/dinput-DIPROP_USERNAME/0001-dinput-Implement-device-property-DIPROP_USERNAME.patch wine-staging-1.9.7~ubuntu15.04.1/patches/dinput-DIPROP_USERNAME/0001-dinput-Implement-device-property-DIPROP_USERNAME.patch --- wine-staging-1.9.6/patches/dinput-DIPROP_USERNAME/0001-dinput-Implement-device-property-DIPROP_USERNAME.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/dinput-DIPROP_USERNAME/0001-dinput-Implement-device-property-DIPROP_USERNAME.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,177 +0,0 @@ -From 4eb926239cec9c6dfa489056bb30d698039926a1 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Bernhard=20=C3=9Cbelacker?= -Date: Tue, 24 Nov 2015 21:13:50 +0100 -Subject: dinput: Implement device property DIPROP_USERNAME. - -https://bugs.winehq.org/show_bug.cgi?id=39667 - -Probably same issue as in https://bugs.winehq.org/show_bug.cgi?id=12432 . -(Attached backtrace seems equal.) - -Steps to reproduce: -- start launcher -- "Configure Controller" -- leave dialog with "Cancel" -- crash - -MotoGP 3 demo launcher uses ConfigureDevices for the key mapping. -This seems because the result of a GetProperty(DIPROP_USERNAME) is used -without checking. ---- - dlls/dinput/device.c | 39 +++++++++++++++++++++++++++++++++++++++ - dlls/dinput/device_private.h | 1 + - dlls/dinput8/tests/device.c | 29 +++++++++++++++++++++++++++-- - 3 files changed, 67 insertions(+), 2 deletions(-) - -diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c -index e525f01..41fb2c4 100644 ---- a/dlls/dinput/device.c -+++ b/dlls/dinput/device.c -@@ -778,11 +778,13 @@ HRESULT _build_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, - - HRESULT _set_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags, LPCDIDATAFORMAT df) - { -+ static const WCHAR emptyW[] = { 0 }; - IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W(iface); - DIDATAFORMAT data_format; - DIOBJECTDATAFORMAT *obj_df = NULL; - DIPROPDWORD dp; - DIPROPRANGE dpr; -+ DIPROPSTRING dps; - WCHAR username[MAX_PATH]; - DWORD username_size = MAX_PATH; - int i, action = 0, num_actions = 0; -@@ -863,6 +865,13 @@ HRESULT _set_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, L - else - lstrcpynW(username, lpszUserName, MAX_PATH); - -+ dps.diph.dwSize = sizeof(dps); -+ dps.diph.dwHeaderSize = sizeof(DIPROPHEADER); -+ dps.diph.dwObj = 0; -+ dps.diph.dwHow = DIPH_DEVICE; -+ lstrcpynW(dps.wsz, (dwFlags & DIDSAM_NOUSER) ? emptyW : username, sizeof(dps.wsz)/sizeof(WCHAR)); -+ IDirectInputDevice8_SetProperty(iface, DIPROP_USERNAME, &dps.diph); -+ - /* Save the settings to disk */ - save_mapping_settings(iface, lpdiaf, username); - -@@ -1100,6 +1109,9 @@ ULONG WINAPI IDirectInputDevice2WImpl_Release(LPDIRECTINPUTDEVICE8W iface) - /* Free action mapping */ - HeapFree(GetProcessHeap(), 0, This->action_map); - -+ /* Free username */ -+ HeapFree(GetProcessHeap(), 0, This->username); -+ - EnterCriticalSection( &This->dinput->crit ); - list_remove( &This->entry ); - LeaveCriticalSection( &This->dinput->crit ); -@@ -1251,6 +1263,17 @@ HRESULT WINAPI IDirectInputDevice2WImpl_GetProperty(LPDIRECTINPUTDEVICE8W iface, - TRACE("buffersize = %d\n", pd->dwData); - break; - } -+ case (DWORD_PTR) DIPROP_USERNAME: -+ { -+ LPDIPROPSTRING ps = (LPDIPROPSTRING)pdiph; -+ -+ if (pdiph->dwSize != sizeof(DIPROPSTRING)) return DIERR_INVALIDPARAM; -+ -+ ps->wsz[0] = 0; -+ if (This->username) -+ lstrcpynW(ps->wsz, This->username, sizeof(ps->wsz)/sizeof(WCHAR)); -+ break; -+ } - case (DWORD_PTR) DIPROP_VIDPID: - FIXME("DIPROP_VIDPID not implemented\n"); - return DIERR_UNSUPPORTED; -@@ -1324,6 +1347,22 @@ HRESULT WINAPI IDirectInputDevice2WImpl_SetProperty( - LeaveCriticalSection(&This->crit); - break; - } -+ case (DWORD_PTR) DIPROP_USERNAME: -+ { -+ LPCDIPROPSTRING ps = (LPCDIPROPSTRING)pdiph; -+ -+ if (pdiph->dwSize != sizeof(DIPROPSTRING)) return DIERR_INVALIDPARAM; -+ -+ if (!This->username) -+ This->username = HeapAlloc(GetProcessHeap(), 0, sizeof(ps->wsz)); -+ if (!This->username) -+ return DIERR_OUTOFMEMORY; -+ -+ This->username[0] = 0; -+ if (ps->wsz) -+ lstrcpynW(This->username, ps->wsz, sizeof(ps->wsz)/sizeof(WCHAR)); -+ break; -+ } - default: - WARN("Unknown property %s\n", debugstr_guid(rguid)); - return DIERR_UNSUPPORTED; -diff --git a/dlls/dinput/device_private.h b/dlls/dinput/device_private.h -index 52bbec4..44fa46a 100644 ---- a/dlls/dinput/device_private.h -+++ b/dlls/dinput/device_private.h -@@ -81,6 +81,7 @@ struct IDirectInputDeviceImpl - /* Action mapping */ - int num_actions; /* number of actions mapped */ - ActionMap *action_map; /* array of mappings */ -+ WCHAR *username; /* set by 'SetActionMap' */ - }; - - extern BOOL get_app_key(HKEY*, HKEY*) DECLSPEC_HIDDEN; -diff --git a/dlls/dinput8/tests/device.c b/dlls/dinput8/tests/device.c -index 6495559..b5e27ad 100644 ---- a/dlls/dinput8/tests/device.c -+++ b/dlls/dinput8/tests/device.c -@@ -223,8 +223,8 @@ static BOOL CALLBACK enumeration_callback(const DIDEVICEINSTANCEA *lpddi, IDirec - dps.wsz[0] = '\0'; - - hr = IDirectInputDevice_GetProperty(lpdid, DIPROP_USERNAME, &dps.diph); -- todo_wine ok (SUCCEEDED(hr), "GetProperty failed hr=%08x\n", hr); -- todo_wine ok (!lstrcmpW(usernameW, dps.wsz), "Username not set correctly expected=%s, got=%s\n", wine_dbgstr_wn(usernameW, -1), wine_dbgstr_wn(dps.wsz, -1)); -+ ok (SUCCEEDED(hr), "GetProperty failed hr=%08x\n", hr); -+ ok (!lstrcmpW(usernameW, dps.wsz), "Username not set correctly expected=%s, got=%s\n", wine_dbgstr_wn(usernameW, -1), wine_dbgstr_wn(dps.wsz, -1)); - - /* Test buffer size */ - memset(&dp, 0, sizeof(dp)); -@@ -275,6 +275,7 @@ static void test_action_mapping(void) - HINSTANCE hinst = GetModuleHandleA(NULL); - IDirectInput8A *pDI = NULL; - DIACTIONFORMATA af; -+ DIPROPSTRING dps; - struct enum_data data = {pDI, &af, NULL, NULL, NULL, 0}; - HWND hwnd; - -@@ -342,6 +343,30 @@ static void test_action_mapping(void) - - af.dwDataSize = 4 * sizeof(actionMapping) / sizeof(actionMapping[0]); - af.dwNumActions = sizeof(actionMapping) / sizeof(actionMapping[0]); -+ -+ /* test DIDSAM_NOUSER */ -+ dps.diph.dwSize = sizeof(dps); -+ dps.diph.dwHeaderSize = sizeof(DIPROPHEADER); -+ dps.diph.dwObj = 0; -+ dps.diph.dwHow = DIPH_DEVICE; -+ dps.wsz[0] = '\0'; -+ -+ hr = IDirectInputDevice_GetProperty(data.keyboard, DIPROP_USERNAME, &dps.diph); -+ ok (SUCCEEDED(hr), "GetProperty failed hr=%08x\n", hr); -+ ok (dps.wsz[0] != 0, "Expected any username, got=%s\n", wine_dbgstr_wn(dps.wsz, -1)); -+ -+ hr = IDirectInputDevice8_SetActionMap(data.keyboard, data.lpdiaf, NULL, DIDSAM_NOUSER); -+ ok (SUCCEEDED(hr), "SetActionMap failed hr=%08x\n", hr); -+ -+ dps.diph.dwSize = sizeof(dps); -+ dps.diph.dwHeaderSize = sizeof(DIPROPHEADER); -+ dps.diph.dwObj = 0; -+ dps.diph.dwHow = DIPH_DEVICE; -+ dps.wsz[0] = '\0'; -+ -+ hr = IDirectInputDevice_GetProperty(data.keyboard, DIPROP_USERNAME, &dps.diph); -+ ok (SUCCEEDED(hr), "GetProperty failed hr=%08x\n", hr); -+ ok (dps.wsz[0] == 0, "Expected empty username, got=%s\n", wine_dbgstr_wn(dps.wsz, -1)); - } - - if (data.mouse != NULL) --- -2.6.2 - diff -Nru wine-staging-1.9.6/patches/dinput-DIPROP_USERNAME/definition wine-staging-1.9.7~ubuntu15.04.1/patches/dinput-DIPROP_USERNAME/definition --- wine-staging-1.9.6/patches/dinput-DIPROP_USERNAME/definition 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/dinput-DIPROP_USERNAME/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: [39667] Implement dinput device property DIPROP_USERNAME diff -Nru wine-staging-1.9.6/patches/fsutil-Stub_Program/0001-fsutil-Add-fsutil-program-with-support-for-creating-.patch wine-staging-1.9.7~ubuntu15.04.1/patches/fsutil-Stub_Program/0001-fsutil-Add-fsutil-program-with-support-for-creating-.patch --- wine-staging-1.9.6/patches/fsutil-Stub_Program/0001-fsutil-Add-fsutil-program-with-support-for-creating-.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/fsutil-Stub_Program/0001-fsutil-Add-fsutil-program-with-support-for-creating-.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,274 @@ +From fe2b318c4d9cee458cc4db4d41c028a8b783282d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Fri, 1 Apr 2016 01:29:51 +0200 +Subject: fsutil: Add fsutil program with support for creating hard links. + +--- + configure.ac | 1 + + programs/fsutil/Makefile.in | 8 +++ + programs/fsutil/fsutil.rc | 34 ++++++++++ + programs/fsutil/main.c | 151 ++++++++++++++++++++++++++++++++++++++++++++ + programs/fsutil/resources.h | 25 ++++++++ + 5 files changed, 219 insertions(+) + create mode 100644 programs/fsutil/Makefile.in + create mode 100644 programs/fsutil/fsutil.rc + create mode 100644 programs/fsutil/main.c + create mode 100644 programs/fsutil/resources.h + +diff --git a/configure.ac b/configure.ac +index 20478df..8cd1f4a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3459,6 +3459,7 @@ WINE_CONFIG_PROGRAM(expand,,[install]) + WINE_CONFIG_PROGRAM(explorer,,[clean,install]) + WINE_CONFIG_PROGRAM(extrac32,,[install]) + WINE_CONFIG_PROGRAM(findstr,,[install]) ++WINE_CONFIG_PROGRAM(fsutil,,[clean,install]) + WINE_CONFIG_PROGRAM(hh,,[install]) + WINE_CONFIG_PROGRAM(hostname,,[clean,install]) + WINE_CONFIG_PROGRAM(icacls,,[install]) +diff --git a/programs/fsutil/Makefile.in b/programs/fsutil/Makefile.in +new file mode 100644 +index 0000000..7433695 +--- /dev/null ++++ b/programs/fsutil/Makefile.in +@@ -0,0 +1,8 @@ ++MODULE = fsutil.exe ++APPMODE = -mconsole -municode ++IMPORTS = user32 ++ ++C_SRCS = \ ++ main.c ++ ++RC_SRCS = fsutil.rc +diff --git a/programs/fsutil/fsutil.rc b/programs/fsutil/fsutil.rc +new file mode 100644 +index 0000000..593f817 +--- /dev/null ++++ b/programs/fsutil/fsutil.rc +@@ -0,0 +1,34 @@ ++/* ++ * FSUTIL.EXE - Wine-compatible fsutil program ++ * ++ * 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 "resources.h" ++ ++#pragma makedep po ++ ++LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT ++ ++STRINGTABLE ++{ ++ STRING_USAGE, "---- Commands Supported ----\n\nhardlink Hardlink management\n\n" ++ STRING_UNSUPPORTED_CMD, "%1 is an unsupported command\n" ++ STRING_UNSUPPORTED_PARAM, "%1 is an unsupported parameter\n" ++ STRING_HARDLINK_USAGE, "---- Hardlink - Commands Supported ----\n\ncreate Create a hardlink.\n\n" ++ STRING_HARDLINK_CREATE_USAGE, "Syntax: fsutil hardlink create old new\n\n" ++} +diff --git a/programs/fsutil/main.c b/programs/fsutil/main.c +new file mode 100644 +index 0000000..ff58dd4 +--- /dev/null ++++ b/programs/fsutil/main.c +@@ -0,0 +1,151 @@ ++/* ++ * 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 ++#include ++#include ++ ++#include "resources.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(fsutil); ++ ++static void output_write(const WCHAR *str, DWORD wlen) ++{ ++ DWORD count, ret; ++ ++ ret = WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), str, wlen, &count, NULL); ++ if (!ret) ++ { ++ DWORD len; ++ char *msgA; ++ ++ /* On Windows WriteConsoleW() fails if the output is redirected. So fall ++ * back to WriteFile(), assuming the console encoding is still the right ++ * one in that case. ++ */ ++ len = WideCharToMultiByte(GetConsoleOutputCP(), 0, str, wlen, NULL, 0, NULL, NULL); ++ msgA = HeapAlloc(GetProcessHeap(), 0, len * sizeof(char)); ++ if (!msgA) return; ++ ++ WideCharToMultiByte(GetConsoleOutputCP(), 0, str, wlen, msgA, len, NULL, NULL); ++ WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), msgA, len, &count, FALSE); ++ HeapFree(GetProcessHeap(), 0, msgA); ++ } ++} ++ ++static int output_vprintf(const WCHAR* fmt, __ms_va_list va_args) ++{ ++ WCHAR str[8192]; ++ int len; ++ ++ SetLastError(NO_ERROR); ++ len = FormatMessageW(FORMAT_MESSAGE_FROM_STRING, fmt, 0, 0, str, ++ sizeof(str)/sizeof(*str), &va_args); ++ if (len == 0 && GetLastError() != NO_ERROR) ++ WINE_FIXME("Could not format string: le=%u, fmt=%s\n", GetLastError(), wine_dbgstr_w(fmt)); ++ else ++ output_write(str, len); ++ return 0; ++} ++ ++static int __cdecl output_string(int msg, ...) ++{ ++ WCHAR fmt[8192]; ++ __ms_va_list arguments; ++ ++ LoadStringW(GetModuleHandleW(NULL), msg, fmt, sizeof(fmt)/sizeof(fmt[0])); ++ __ms_va_start(arguments, msg); ++ output_vprintf(fmt, arguments); ++ __ms_va_end(arguments); ++ return 0; ++} ++ ++static BOOL output_error_string(DWORD error) ++{ ++ LPWSTR pBuffer; ++ if (FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | ++ FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ALLOCATE_BUFFER, ++ NULL, error, 0, (LPWSTR)&pBuffer, 0, NULL)) ++ { ++ output_write(pBuffer, lstrlenW(pBuffer)); ++ LocalFree(pBuffer); ++ return TRUE; ++ } ++ return FALSE; ++} ++ ++static int create_hardlink(int argc, WCHAR *argv[]) ++{ ++ if (argc != 5) ++ { ++ output_string(STRING_HARDLINK_CREATE_USAGE); ++ return 1; ++ } ++ ++ if (CreateHardLinkW(argv[3], argv[4], NULL)) ++ return 0; ++ ++ output_error_string(GetLastError()); ++ return 1; ++} ++ ++static int hardlink(int argc, WCHAR *argv[]) ++{ ++ static const WCHAR createW[]={'c','r','e','a','t','e',0}; ++ int ret; ++ ++ if (argc > 2) ++ { ++ if (!strcmpiW(argv[2], createW)) ++ return create_hardlink(argc, argv); ++ else ++ { ++ FIXME("unsupported parameter %s\n", debugstr_w(argv[2])); ++ output_string(STRING_UNSUPPORTED_PARAM, argv[2]); ++ ret = 1; ++ } ++ } ++ ++ output_string(STRING_HARDLINK_USAGE); ++ return ret; ++} ++ ++int wmain(int argc, WCHAR *argv[]) ++{ ++ static const WCHAR hardlinkW[]={'h','a','r','d','l','i','n','k',0}; ++ int i, ret = 0; ++ ++ for (i = 0; i < argc; i++) ++ WINE_TRACE(" %s", wine_dbgstr_w(argv[i])); ++ WINE_TRACE("\n"); ++ ++ if (argc > 1) ++ { ++ if (!strcmpiW(argv[1], hardlinkW)) ++ return hardlink(argc, argv); ++ else ++ { ++ FIXME("unsupported command %s\n", debugstr_w(argv[1])); ++ output_string(STRING_UNSUPPORTED_CMD, argv[1]); ++ ret = 1; ++ } ++ } ++ ++ output_string(STRING_USAGE); ++ return ret; ++} +diff --git a/programs/fsutil/resources.h b/programs/fsutil/resources.h +new file mode 100644 +index 0000000..b85826a +--- /dev/null ++++ b/programs/fsutil/resources.h +@@ -0,0 +1,25 @@ ++/* ++ * 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 ++ ++#define STRING_USAGE 101 ++#define STRING_UNSUPPORTED_CMD 102 ++#define STRING_UNSUPPORTED_PARAM 103 ++#define STRING_HARDLINK_USAGE 104 ++#define STRING_HARDLINK_CREATE_USAGE 105 +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/fsutil-Stub_Program/definition wine-staging-1.9.7~ubuntu15.04.1/patches/fsutil-Stub_Program/definition --- wine-staging-1.9.6/patches/fsutil-Stub_Program/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/fsutil-Stub_Program/definition 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [22749] Add stub for fsutil.exe hardlink command diff -Nru wine-staging-1.9.6/patches/kernel32-CreateFileA/0001-kernel32-Check-for-invalid-filename-pointers-in-Crea.patch wine-staging-1.9.7~ubuntu15.04.1/patches/kernel32-CreateFileA/0001-kernel32-Check-for-invalid-filename-pointers-in-Crea.patch --- wine-staging-1.9.6/patches/kernel32-CreateFileA/0001-kernel32-Check-for-invalid-filename-pointers-in-Crea.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/kernel32-CreateFileA/0001-kernel32-Check-for-invalid-filename-pointers-in-Crea.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -From db905292a144241f781c451d1e72f8992abbf97a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Wed, 2 Mar 2016 04:24:35 +0100 -Subject: kernel32: Check for invalid filename pointers in CreateFileA in Win - 9X mode. - -The demo version of Test Drive 5 loops through a list of filenames and opens -them using CreateFileA. The stop condition is not correct and the game reads -past the end of the array and therefore passes several invalid pointers to -the CreateFileA API. Windows 98 catches those invalid pointers and the game -can load sucessfully. This commit adds the same behavior when setting the -Windows version to 9X. ---- - dlls/kernel32/file.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c -index b6dba6a..750a8ac 100644 ---- a/dlls/kernel32/file.c -+++ b/dlls/kernel32/file.c -@@ -1629,6 +1629,7 @@ HANDLE WINAPI CreateFileA( LPCSTR filename, DWORD access, DWORD sharing, - { - WCHAR *nameW; - -+ if ((GetVersion() & 0x80000000) && IsBadStringPtrA(filename, -1)) return INVALID_HANDLE_VALUE; - if (!(nameW = FILE_name_AtoW( filename, FALSE ))) return INVALID_HANDLE_VALUE; - return CreateFileW( nameW, access, sharing, sa, creation, attributes, template ); - } --- -2.7.1 - diff -Nru wine-staging-1.9.6/patches/kernel32-CreateFileA/definition wine-staging-1.9.7~ubuntu15.04.1/patches/kernel32-CreateFileA/definition --- wine-staging-1.9.6/patches/kernel32-CreateFileA/definition 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/kernel32-CreateFileA/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: Check for invalid filename pointers in CreateFileA in Win 9x mode diff -Nru wine-staging-1.9.6/patches/kernel32-ERROR_DLL_NOT_FOUND/0001-kernel32-Set-ERROR_DLL_NOT_FOUND-as-error-code-for-W.patch wine-staging-1.9.7~ubuntu15.04.1/patches/kernel32-ERROR_DLL_NOT_FOUND/0001-kernel32-Set-ERROR_DLL_NOT_FOUND-as-error-code-for-W.patch --- wine-staging-1.9.6/patches/kernel32-ERROR_DLL_NOT_FOUND/0001-kernel32-Set-ERROR_DLL_NOT_FOUND-as-error-code-for-W.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/kernel32-ERROR_DLL_NOT_FOUND/0001-kernel32-Set-ERROR_DLL_NOT_FOUND-as-error-code-for-W.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -From 9d075c0f5c958becf8fe661b8c2877115501f044 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Tue, 1 Mar 2016 20:11:57 +0100 -Subject: kernel32: Set ERROR_DLL_NOT_FOUND as error code for Win 9X instead of - ERROR_MOD_NOT_FOUND. - ---- - dlls/kernel32/module.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/dlls/kernel32/module.c b/dlls/kernel32/module.c -index dac66c1..badfe1d 100644 ---- a/dlls/kernel32/module.c -+++ b/dlls/kernel32/module.c -@@ -948,7 +948,10 @@ static HMODULE load_library( const UNICODE_STRING *libname, DWORD flags ) - if (nts != STATUS_SUCCESS) - { - hModule = 0; -- SetLastError( RtlNtStatusToDosError( nts ) ); -+ if (nts == STATUS_DLL_NOT_FOUND && (GetVersion() & 0x80000000)) -+ SetLastError( ERROR_DLL_NOT_FOUND ); -+ else -+ SetLastError( RtlNtStatusToDosError( nts ) ); - } - done: - HeapFree( GetProcessHeap(), 0, load_path ); --- -2.7.1 - diff -Nru wine-staging-1.9.6/patches/kernel32-ERROR_DLL_NOT_FOUND/definition wine-staging-1.9.7~ubuntu15.04.1/patches/kernel32-ERROR_DLL_NOT_FOUND/definition --- wine-staging-1.9.6/patches/kernel32-ERROR_DLL_NOT_FOUND/definition 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/kernel32-ERROR_DLL_NOT_FOUND/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: Set ERROR_DLL_NOT_FOUND as error code for Win 9X instead of ERROR_MOD_NOT_FOUND in load_library diff -Nru wine-staging-1.9.6/patches/kernel32-FreeUserPhysicalPages/0001-kernel32-add-FreeUserPhysicalPages-stub-try-2.patch wine-staging-1.9.7~ubuntu15.04.1/patches/kernel32-FreeUserPhysicalPages/0001-kernel32-add-FreeUserPhysicalPages-stub-try-2.patch --- wine-staging-1.9.6/patches/kernel32-FreeUserPhysicalPages/0001-kernel32-add-FreeUserPhysicalPages-stub-try-2.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/kernel32-FreeUserPhysicalPages/0001-kernel32-add-FreeUserPhysicalPages-stub-try-2.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,4 +1,4 @@ -From 0aab8389ccbaf7c89a37112faef790ef45b0b15f Mon Sep 17 00:00:00 2001 +From 2fc1bd4a187ffa5e4166174f4295623340b73564 Mon Sep 17 00:00:00 2001 From: Austin English Date: Tue, 3 Nov 2015 11:03:54 -0600 Subject: kernel32: add FreeUserPhysicalPages stub (try 2) @@ -7,15 +7,29 @@ Signed-off-by: Austin English --- - dlls/kernel32/heap.c | 7 +++++++ - dlls/kernel32/kernel32.spec | 4 ++-- - 2 files changed, 9 insertions(+), 2 deletions(-) + .../api-ms-win-core-memory-l1-1-2.spec | 4 ++-- + dlls/kernel32/heap.c | 7 +++++++ + dlls/kernel32/kernel32.spec | 4 ++-- + 3 files changed, 11 insertions(+), 4 deletions(-) +diff --git a/dlls/api-ms-win-core-memory-l1-1-2/api-ms-win-core-memory-l1-1-2.spec b/dlls/api-ms-win-core-memory-l1-1-2/api-ms-win-core-memory-l1-1-2.spec +index cf10c20..2ad54b7 100644 +--- a/dlls/api-ms-win-core-memory-l1-1-2/api-ms-win-core-memory-l1-1-2.spec ++++ b/dlls/api-ms-win-core-memory-l1-1-2/api-ms-win-core-memory-l1-1-2.spec +@@ -1,6 +1,6 @@ +-@ stdcall AllocateUserPhysicalPages(ptr ptr ptr) kernel32.AllocateUserPhysicalPages ++@ stdcall AllocateUserPhysicalPages(long ptr ptr) kernel32.AllocateUserPhysicalPages + @ stub AllocateUserPhysicalPagesNuma +-@ stub FreeUserPhysicalPages ++@ stdcall FreeUserPhysicalPages(long ptr ptr) kernel32.FreeUserPhysicalPages + @ stub GetMemoryErrorHandlingCapabilities + @ stub MapUserPhysicalPages + @ stub RegisterBadMemoryNotification diff --git a/dlls/kernel32/heap.c b/dlls/kernel32/heap.c -index 0c05de6..e86b292 100644 +index eeed785..af2503c 100644 --- a/dlls/kernel32/heap.c +++ b/dlls/kernel32/heap.c -@@ -1490,3 +1490,10 @@ BOOL WINAPI AllocateUserPhysicalPages(HANDLE process, ULONG_PTR *pages, ULONG_PT +@@ -1491,3 +1491,10 @@ BOOL WINAPI AllocateUserPhysicalPages(HANDLE process, ULONG_PTR *pages, ULONG_PT SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; } @@ -27,7 +41,7 @@ + return FALSE; +} diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec -index ff67e54..d4e1d01 100644 +index d606d9b..48c58cd 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -154,7 +154,7 @@ @@ -49,5 +63,5 @@ @ stdcall GenerateConsoleCtrlEvent(long long) @ stdcall -i386 -private Get16DLLAddress(long str) krnl386.exe16.Get16DLLAddress -- -2.6.2 +2.7.1 diff -Nru wine-staging-1.9.6/patches/kernel32-GetFinalPathNameByHandle/0001-kernel32-Implement-GetFinalPathNameByHandle.patch wine-staging-1.9.7~ubuntu15.04.1/patches/kernel32-GetFinalPathNameByHandle/0001-kernel32-Implement-GetFinalPathNameByHandle.patch --- wine-staging-1.9.6/patches/kernel32-GetFinalPathNameByHandle/0001-kernel32-Implement-GetFinalPathNameByHandle.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/kernel32-GetFinalPathNameByHandle/0001-kernel32-Implement-GetFinalPathNameByHandle.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,4 +1,4 @@ -From afd33fadd45f1073ac0b8734d7003ba46b5d1269 Mon Sep 17 00:00:00 2001 +From 7a4c38b61ea0192792a6b90a264f0353767f56bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Tue, 12 Aug 2014 20:24:14 +0200 Subject: kernel32: Implement GetFinalPathNameByHandle. @@ -6,9 +6,11 @@ --- .../api-ms-win-core-file-l1-1-0.spec | 4 +- .../api-ms-win-core-file-l1-2-0.spec | 4 +- + .../api-ms-win-core-file-l1-2-1.spec | 4 +- dlls/kernel32/file.c | 182 +++++++++++++++++++++ dlls/kernel32/kernel32.spec | 4 +- - 4 files changed, 188 insertions(+), 6 deletions(-) + dlls/kernelbase/kernelbase.spec | 4 +- + 6 files changed, 192 insertions(+), 10 deletions(-) diff --git a/dlls/api-ms-win-core-file-l1-1-0/api-ms-win-core-file-l1-1-0.spec b/dlls/api-ms-win-core-file-l1-1-0/api-ms-win-core-file-l1-1-0.spec index 9e5b809..61e8038 100644 @@ -40,11 +42,26 @@ @ stdcall GetFullPathNameA(str long ptr ptr) kernel32.GetFullPathNameA @ stdcall GetFullPathNameW(wstr long ptr ptr) kernel32.GetFullPathNameW @ stdcall GetLogicalDriveStringsW(long ptr) kernel32.GetLogicalDriveStringsW +diff --git a/dlls/api-ms-win-core-file-l1-2-1/api-ms-win-core-file-l1-2-1.spec b/dlls/api-ms-win-core-file-l1-2-1/api-ms-win-core-file-l1-2-1.spec +index c7691a4..a9acd8d 100644 +--- a/dlls/api-ms-win-core-file-l1-2-1/api-ms-win-core-file-l1-2-1.spec ++++ b/dlls/api-ms-win-core-file-l1-2-1/api-ms-win-core-file-l1-2-1.spec +@@ -41,8 +41,8 @@ + @ stdcall GetFileSizeEx(long ptr) kernel32.GetFileSizeEx + @ stdcall GetFileTime(long ptr ptr ptr) kernel32.GetFileTime + @ stdcall GetFileType(long) kernel32.GetFileType +-@ stub GetFinalPathNameByHandleA +-@ stub GetFinalPathNameByHandleW ++@ stdcall GetFinalPathNameByHandleA(long ptr long long) kernel32.GetFinalPathNameByHandleA ++@ stdcall GetFinalPathNameByHandleW(long ptr long long) kernel32.GetFinalPathNameByHandleW + @ stdcall GetFullPathNameA(str long ptr ptr) kernel32.GetFullPathNameA + @ stdcall GetFullPathNameW(wstr long ptr ptr) kernel32.GetFullPathNameW + @ stdcall GetLogicalDriveStringsW(long ptr) kernel32.GetLogicalDriveStringsW diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c -index 006db1c..b3cc8c3 100644 +index b6dba6a..690baa3 100644 --- a/dlls/kernel32/file.c +++ b/dlls/kernel32/file.c -@@ -2829,3 +2829,185 @@ DWORD WINAPI K32GetDeviceDriverFileNameW(void *image_base, LPWSTR file_name, DWO +@@ -2909,3 +2909,185 @@ DWORD WINAPI K32GetDeviceDriverFileNameW(void *image_base, LPWSTR file_name, DWO return 0; } @@ -232,7 +249,7 @@ +} \ No newline at end of file diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec -index bb72041..b7bead0 100644 +index d606d9b..64759ca 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -682,8 +682,8 @@ @@ -246,6 +263,21 @@ @ stdcall GetFirmwareEnvironmentVariableA(str str ptr long) @ stdcall GetFirmwareEnvironmentVariableW(wstr wstr ptr long) @ stdcall GetFullPathNameA(str long ptr ptr) +diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec +index c06ecd9..b9e95ca 100644 +--- a/dlls/kernelbase/kernelbase.spec ++++ b/dlls/kernelbase/kernelbase.spec +@@ -235,8 +235,8 @@ + @ stdcall GetFileSizeEx(long ptr) kernel32.GetFileSizeEx + @ stdcall GetFileTime(long ptr ptr ptr) kernel32.GetFileTime + @ stdcall GetFileType(long) kernel32.GetFileType +-@ stub GetFinalPathNameByHandleA +-@ stub GetFinalPathNameByHandleW ++@ stdcall GetFinalPathNameByHandleA(long ptr long long) kernel32.GetFinalPathNameByHandleA ++@ stdcall GetFinalPathNameByHandleW(long ptr long long) kernel32.GetFinalPathNameByHandleW + @ stdcall GetFullPathNameA(str long ptr ptr) kernel32.GetFullPathNameA + @ stdcall GetFullPathNameW(wstr long ptr ptr) kernel32.GetFullPathNameW + @ stdcall GetHandleInformation(long ptr) kernel32.GetHandleInformation -- -2.4.0 +2.7.1 diff -Nru wine-staging-1.9.6/patches/kernel32-GetOverlappedResult/0001-kernel32-Fix-handling-of-GetOverlappedResult-when-st.patch wine-staging-1.9.7~ubuntu15.04.1/patches/kernel32-GetOverlappedResult/0001-kernel32-Fix-handling-of-GetOverlappedResult-when-st.patch --- wine-staging-1.9.6/patches/kernel32-GetOverlappedResult/0001-kernel32-Fix-handling-of-GetOverlappedResult-when-st.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/kernel32-GetOverlappedResult/0001-kernel32-Fix-handling-of-GetOverlappedResult-when-st.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -From d424317603a8ddce1475af26071374642edba457 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sun, 13 Mar 2016 07:25:01 +0100 -Subject: kernel32: Fix handling of GetOverlappedResult when status remains - STATUS_PENDING. -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Spotted by Michael Müller. ---- - dlls/kernel32/file.c | 2 ++ - dlls/kernel32/tests/file.c | 5 +++++ - 2 files changed, 7 insertions(+) - -diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c -index b6dba6a..a518e08 100644 ---- a/dlls/kernel32/file.c -+++ b/dlls/kernel32/file.c -@@ -625,7 +625,9 @@ BOOL WINAPI GetOverlappedResult(HANDLE hFile, LPOVERLAPPED lpOverlapped, - if (WaitForSingleObject( lpOverlapped->hEvent ? lpOverlapped->hEvent : hFile, - INFINITE ) == WAIT_FAILED) - return FALSE; -+ - status = lpOverlapped->Internal; -+ if (status == STATUS_PENDING) status = STATUS_SUCCESS; - } - - *lpTransferred = lpOverlapped->InternalHigh; -diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c -index 8353c21..a066692 100644 ---- a/dlls/kernel32/tests/file.c -+++ b/dlls/kernel32/tests/file.c -@@ -3361,6 +3361,11 @@ static void test_overlapped(void) - "wrong error %u\n", GetLastError() ); - ok( r == FALSE, "should return false\n"); - -+ r = GetOverlappedResult( 0, &ov, &result, TRUE ); -+ ok( r == TRUE, "should return TRUE\n" ); -+ ok( result == 0xabcd, "wrong result %u\n", result ); -+ ok( ov.Internal == STATUS_PENDING, "expected STATUS_PENDING, got %08lx\n", ov.Internal ); -+ - ResetEvent( ov.hEvent ); - - SetLastError( 0xb00 ); --- -2.7.1 - diff -Nru wine-staging-1.9.6/patches/kernel32-GetOverlappedResult/definition wine-staging-1.9.7~ubuntu15.04.1/patches/kernel32-GetOverlappedResult/definition --- wine-staging-1.9.6/patches/kernel32-GetOverlappedResult/definition 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/kernel32-GetOverlappedResult/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: Fix handling of GetOverlappedResult when status remains STATUS_PENDING diff -Nru wine-staging-1.9.6/patches/makefiles-Revert_libwine_Import/definition wine-staging-1.9.7~ubuntu15.04.1/patches/makefiles-Revert_libwine_Import/definition --- wine-staging-1.9.6/patches/makefiles-Revert_libwine_Import/definition 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/makefiles-Revert_libwine_Import/definition 2016-04-04 18:23:50.000000000 +0000 @@ -1 +1,3 @@ -Fixes: Revert commit to import libwine only for Windows builds +Fixes: [!40355] Revert commit to import libwine only for Windows builds +# Fixed with 8f567028123cd7a3c8180f9ad2c867add34795e3? +Disabled: true diff -Nru wine-staging-1.9.6/patches/mfplat-MFTRegister/0005-include-mfidl.idl-Add-IMFMediaSession-interface-and-.patch wine-staging-1.9.7~ubuntu15.04.1/patches/mfplat-MFTRegister/0005-include-mfidl.idl-Add-IMFMediaSession-interface-and-.patch --- wine-staging-1.9.6/patches/mfplat-MFTRegister/0005-include-mfidl.idl-Add-IMFMediaSession-interface-and-.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/mfplat-MFTRegister/0005-include-mfidl.idl-Add-IMFMediaSession-interface-and-.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,158 @@ +From 105c927a195f2412e9eacaf07e6f904f7aa8f3a7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 26 Mar 2016 04:20:03 +0100 +Subject: include/mfidl.idl: Add IMFMediaSession interface and dependencies. + +--- + include/Makefile.in | 1 + + include/mfidl.idl | 126 ++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 127 insertions(+) + create mode 100644 include/mfidl.idl + +diff --git a/include/Makefile.in b/include/Makefile.in +index 8283616..2a9650d 100644 +--- a/include/Makefile.in ++++ b/include/Makefile.in +@@ -85,6 +85,7 @@ IDL_SRCS = \ + inspectable.idl \ + mediaobj.idl \ + metahost.idl \ ++ mfidl.idl \ + mfobjects.idl \ + mimeinfo.idl \ + mimeole.idl \ +diff --git a/include/mfidl.idl b/include/mfidl.idl +new file mode 100644 +index 0000000..3431260 +--- /dev/null ++++ b/include/mfidl.idl +@@ -0,0 +1,126 @@ ++/* ++ * 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 ++ */ ++ ++import "mfobjects.idl"; ++ ++typedef unsigned __int64 TOPOID; ++typedef LONGLONG MFTIME; ++ ++typedef enum MF_TOPOLOGY_TYPE ++{ ++ MF_TOPOLOGY_OUTPUT_NODE, ++ MF_TOPOLOGY_SOURCESTREAM_NODE, ++ MF_TOPOLOGY_TRANSFORM_NODE, ++ MF_TOPOLOGY_TEE_NODE, ++ MF_TOPOLOGY_MAX = 0xffffffff ++} MF_TOPOLOGY_TYPE; ++ ++typedef enum _MFCLOCK_STATE ++{ ++ MFCLOCK_STATE_INVALID, ++ MFCLOCK_STATE_RUNNING, ++ MFCLOCK_STATE_STOPPED, ++ MFCLOCK_STATE_PAUSED ++} MFCLOCK_STATE; ++ ++typedef struct _MFCLOCK_PROPERTIES ++{ ++ unsigned __int64 qwCorrelationRate; ++ GUID guidClockId; ++ DWORD dwClockFlags; ++ unsigned __int64 qwClockFrequency; ++ DWORD dwClockTolerance; ++ DWORD dwClockJitter; ++} MFCLOCK_PROPERTIES; ++ ++[ ++ object, ++ uuid(2eb1e945-18b8-4139-9b1a-d5d584818530), ++] ++interface IMFClock : IUnknown ++{ ++ HRESULT GetClockCharacteristics([out] DWORD *characteristics); ++ HRESULT GetCorrelatedTime([in] DWORD reserved, [out] LONGLONG *clock_time, [out] MFTIME *system_time); ++ HRESULT GetContinuityKey([out] DWORD *key); ++ HRESULT GetState([in] DWORD reserved, [out] MFCLOCK_STATE *state); ++ HRESULT GetProperties([out] MFCLOCK_PROPERTIES *props); ++} ++ ++[ ++ object, ++ uuid(83cf873a-f6da-4bc8-823f-bacfd55dc430), ++] ++interface IMFTopologyNode : IMFAttributes ++{ ++ HRESULT SetObject([in] IUnknown *object); ++ HRESULT GetObject([out] IUnknown **object); ++ HRESULT GetNodeType([out] MF_TOPOLOGY_TYPE *type); ++ HRESULT GetTopoNodeID([out] TOPOID *id); ++ HRESULT SetTopoNodeID([in] TOPOID id); ++ HRESULT GetInputCount([out] DWORD *count); ++ HRESULT GetOutputCount([out] DWORD *count); ++ [local] HRESULT ConnectOutput([in] DWORD output_index, [in] IMFTopologyNode *node, [in] DWORD input_index); ++ [local] HRESULT DisconnectOutput([in] DWORD index); ++ HRESULT GetInput([in] DWORD input_index, [out] IMFTopologyNode **node, [out] DWORD *output_index); ++ HRESULT GetOutput([in] DWORD output_index, [out] IMFTopologyNode **node, [out] DWORD *input_index); ++ [local] HRESULT SetOutputPrefType([in] DWORD index, [in] IMFMediaType *type); ++ [local] HRESULT GetOutputPrefType([in] DWORD output_index, [out] IMFMediaType **type); ++ [call_as(GetOutputPrefType)] HRESULT RemoteGetOutputPrefType([in] DWORD index, [out] DWORD *length, ++ [out, size_is(, *length)] BYTE **data); ++ [local] HRESULT SetInputPrefType([in] DWORD index, [in] IMFMediaType *type); ++ [local] HRESULT GetInputPrefType([in] DWORD index, [out] IMFMediaType **type); ++ [call_as(GetInputPrefType)] HRESULT RemoteGetInputPrefType([in] DWORD index, [out] DWORD *length, ++ [out, size_is(, *length)] BYTE **data); ++ HRESULT CloneFrom([in] IMFTopologyNode *node); ++} ++ ++[ ++ object, ++ uuid(83cf873a-f6da-4bc8-823f-bacfd55dc433), ++] ++interface IMFTopology : IMFAttributes ++{ ++ HRESULT GetTopologyID([out] TOPOID *id); ++ [local] HRESULT AddNode([in] IMFTopologyNode *node); ++ [local] HRESULT RemoveNode([in] IMFTopologyNode *node); ++ HRESULT GetNodeCount([out] WORD *nodes); ++ HRESULT GetNode([in] WORD index, [out] IMFTopologyNode **node); ++ [local] HRESULT Clear(); ++ HRESULT CloneFrom([in] IMFTopology *topology); ++ HRESULT GetNodeByID([in] TOPOID id, [out] IMFTopologyNode **node); ++ HRESULT GetSourceNodeCollection([out] IMFCollection **collection); ++ HRESULT GetOutputNodeCollection([out] IMFCollection **collection); ++} ++ ++[ ++ object, ++ uuid(90377834-21d0-4dee-8214-ba2e3e6c1127), ++] ++interface IMFMediaSession : IMFMediaEventGenerator ++{ ++ HRESULT SetTopology([in] DWORD flags, [in] IMFTopology *topology); ++ HRESULT ClearTopologies(); ++ HRESULT Start([in, unique] const GUID *format, [in, unique] const PROPVARIANT *start); ++ HRESULT Pause(); ++ HRESULT Stop(); ++ HRESULT Close(); ++ HRESULT Shutdown(); ++ HRESULT GetClock([out] IMFClock **clock); ++ HRESULT GetSessionCapabilities([out] DWORD *caps); ++ HRESULT GetFullTopology([in] DWORD flags, [in] TOPOID id, [out] IMFTopology **topology); ++} +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/mfplat-MFTRegister/0006-mf-Add-stub-for-MFCreateMediaSession.patch wine-staging-1.9.7~ubuntu15.04.1/patches/mfplat-MFTRegister/0006-mf-Add-stub-for-MFCreateMediaSession.patch --- wine-staging-1.9.6/patches/mfplat-MFTRegister/0006-mf-Add-stub-for-MFCreateMediaSession.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/mfplat-MFTRegister/0006-mf-Add-stub-for-MFCreateMediaSession.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,52 @@ +From e10972fe82b97754ac4fcce78adb52e629b753f8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 26 Mar 2016 04:22:16 +0100 +Subject: mf: Add stub for MFCreateMediaSession. + +--- + dlls/mf/main.c | 15 +++++++++++++++ + dlls/mf/mf.spec | 2 +- + 2 files changed, 16 insertions(+), 1 deletion(-) + +diff --git a/dlls/mf/main.c b/dlls/mf/main.c +index 1b223ad..86f2774 100644 +--- a/dlls/mf/main.c ++++ b/dlls/mf/main.c +@@ -21,6 +21,21 @@ + + #include "windef.h" + #include "winbase.h" ++#include "wine/debug.h" ++ ++#include "mfidl.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(mf); ++ ++/*********************************************************************** ++ * MFCreateMediaSession (mf.@) ++ */ ++HRESULT WINAPI MFCreateMediaSession(IMFAttributes *configuration, IMFMediaSession **ms) ++{ ++ FIXME("(%p, %p): stub\n", configuration, ms); ++ ++ return E_NOTIMPL; ++} + + BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) + { +diff --git a/dlls/mf/mf.spec b/dlls/mf/mf.spec +index 10b682a..546a697 100644 +--- a/dlls/mf/mf.spec ++++ b/dlls/mf/mf.spec +@@ -39,7 +39,7 @@ + @ stub MFCreateMP3MediaSink + @ stub MFCreateMPEG4MediaSink + @ stub MFCreateMediaProcessor +-@ stub MFCreateMediaSession ++@ stdcall MFCreateMediaSession(ptr ptr) + @ stub MFCreateNSCByteStreamPlugin + @ stub MFCreateNetSchemePlugin + @ stub MFCreatePMPHost +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/mfplat-MFTRegister/0007-include-rpcndr.h-Fix-definition-of-EXTERN_GUID.patch wine-staging-1.9.7~ubuntu15.04.1/patches/mfplat-MFTRegister/0007-include-rpcndr.h-Fix-definition-of-EXTERN_GUID.patch --- wine-staging-1.9.6/patches/mfplat-MFTRegister/0007-include-rpcndr.h-Fix-definition-of-EXTERN_GUID.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/mfplat-MFTRegister/0007-include-rpcndr.h-Fix-definition-of-EXTERN_GUID.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,27 @@ +From 322b917bad2ab43eb5181a429f1360ce9aca384b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 26 Mar 2016 06:03:56 +0100 +Subject: include/rpcndr.h: Fix definition of EXTERN_GUID. + +--- + include/rpcndr.h | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/include/rpcndr.h b/include/rpcndr.h +index f795566..9029950 100644 +--- a/include/rpcndr.h ++++ b/include/rpcndr.h +@@ -45,9 +45,7 @@ extern "C" { + { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } + #else + #define EXTERN_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ +- const GUID DECLSPEC_SELECTANY name DECLSPEC_HIDDEN; \ +- const GUID DECLSPEC_SELECTANY name = \ +- { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } ++ EXTERN_C const GUID name + #endif + #endif + +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/mfplat-MFTRegister/0008-mf-Implement-IMFMediaSession-stub-interface.patch wine-staging-1.9.7~ubuntu15.04.1/patches/mfplat-MFTRegister/0008-mf-Implement-IMFMediaSession-stub-interface.patch --- wine-staging-1.9.6/patches/mfplat-MFTRegister/0008-mf-Implement-IMFMediaSession-stub-interface.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/mfplat-MFTRegister/0008-mf-Implement-IMFMediaSession-stub-interface.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,312 @@ +From 5aba6883ef5c0566d489f04b912adbeccf2e2a57 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 26 Mar 2016 06:05:20 +0100 +Subject: mf: Implement IMFMediaSession stub interface. + +--- + dlls/mf/Makefile.in | 3 +- + dlls/mf/main.c | 5 +- + dlls/mf/mf_private.h | 28 +++++++ + dlls/mf/session.c | 221 +++++++++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 254 insertions(+), 3 deletions(-) + create mode 100644 dlls/mf/mf_private.h + create mode 100644 dlls/mf/session.c + +diff --git a/dlls/mf/Makefile.in b/dlls/mf/Makefile.in +index d7fdb61..01e5fbf 100644 +--- a/dlls/mf/Makefile.in ++++ b/dlls/mf/Makefile.in +@@ -1,4 +1,5 @@ + MODULE = mf.dll + + C_SRCS = \ +- main.c ++ main.c \ ++ session.c +diff --git a/dlls/mf/main.c b/dlls/mf/main.c +index 86f2774..702618f 100644 +--- a/dlls/mf/main.c ++++ b/dlls/mf/main.c +@@ -23,7 +23,8 @@ + #include "winbase.h" + #include "wine/debug.h" + +-#include "mfidl.h" ++#include "initguid.h" ++#include "mf_private.h" + + WINE_DEFAULT_DEBUG_CHANNEL(mf); + +@@ -34,7 +35,7 @@ HRESULT WINAPI MFCreateMediaSession(IMFAttributes *configuration, IMFMediaSessio + { + FIXME("(%p, %p): stub\n", configuration, ms); + +- return E_NOTIMPL; ++ return create_session(ms); + } + + BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) +diff --git a/dlls/mf/mf_private.h b/dlls/mf/mf_private.h +new file mode 100644 +index 0000000..36c05e7 +--- /dev/null ++++ b/dlls/mf/mf_private.h +@@ -0,0 +1,28 @@ ++/* ++ * Copyright (C) 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 ++ */ ++ ++#ifndef __WINE_MF_MF_PRIVATE_H ++#define __WINE_MF_MF_PRIVATE_H ++ ++#include "windef.h" ++#include "winbase.h" ++#include "mfidl.h" ++ ++HRESULT create_session(IMFMediaSession **iface); ++ ++#endif /* __WINE_MF_MF_PRIVATE_H */ +diff --git a/dlls/mf/session.c b/dlls/mf/session.c +new file mode 100644 +index 0000000..931e53a +--- /dev/null ++++ b/dlls/mf/session.c +@@ -0,0 +1,221 @@ ++/* ++ * Copyright (C) 2016 Michael Müller ++ * ++ * iface 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. ++ * ++ * iface 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 "windef.h" ++#include "winbase.h" ++#include "wine/debug.h" ++#include "wine/unicode.h" ++ ++#define COBJMACROS ++#include "mf_private.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(mf); ++ ++struct media_session ++{ ++ IMFMediaSession IMFMediaSession_iface; ++ LONG ref; ++}; ++ ++static inline struct media_session *impl_from_IMFMediaSession(IMFMediaSession *iface) ++{ ++ return CONTAINING_RECORD(iface, struct media_session, IMFMediaSession_iface); ++} ++ ++static HRESULT WINAPI session_QueryInterface(IMFMediaSession *iface, REFIID riid, void **ppvObject) ++{ ++ struct media_session *This = impl_from_IMFMediaSession(iface); ++ ++ TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject); ++ ++ if (IsEqualGUID(riid, &IID_IUnknown) || ++ IsEqualGUID(riid, &IID_IMFMediaEventGenerator) || ++ IsEqualGUID(riid, &IID_IMFMediaSession)) ++ { ++ *ppvObject = iface; ++ } ++ else ++ { ++ TRACE("Unsupported interface %s\n", debugstr_guid(riid)); ++ *ppvObject = NULL; ++ return E_NOINTERFACE; ++ } ++ ++ IMFMediaSession_AddRef(iface); ++ return S_OK; ++} ++ ++static ULONG WINAPI session_AddRef(IMFMediaSession *iface) ++{ ++ struct media_session *This = impl_from_IMFMediaSession(iface); ++ ULONG ref = InterlockedIncrement(&This->ref); ++ ++ TRACE("(%p)->(%d)\n", This, ref); ++ ++ return ref; ++} ++ ++static ULONG WINAPI session_Release(IMFMediaSession *iface) ++{ ++ struct media_session *This = impl_from_IMFMediaSession(iface); ++ ULONG ref = InterlockedDecrement(&This->ref); ++ ++ TRACE("(%p)->(%d)\n", This, ref); ++ ++ if (!ref) ++ { ++ HeapFree(GetProcessHeap(), 0, This); ++ } ++ ++ return ref; ++} ++ ++static HRESULT WINAPI session_GetEvent(IMFMediaSession *iface, DWORD flags, IMFMediaEvent **event) ++{ ++ FIXME("(%p, %d, %p): stub", iface, flags, event); ++ ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI session_BeginGetEvent(IMFMediaSession *iface, IMFAsyncCallback *callback, IUnknown *unk_state) ++{ ++ FIXME("(%p, %p, %p): stub", iface, callback, unk_state); ++ ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI session_EndGetEvent(IMFMediaSession *iface, IMFAsyncResult *result, IMFMediaEvent **event) ++{ ++ FIXME("(%p, %p, %p): stub", iface, result, event); ++ ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI session_QueueEvent(IMFMediaSession *iface, MediaEventType met, REFGUID extended_type, HRESULT status, const PROPVARIANT *value) ++{ ++ FIXME("(%p, %d, %s, %x, %p): stub", iface, met, wine_dbgstr_guid(extended_type), status, value); ++ ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI session_SetTopology(IMFMediaSession *iface, DWORD flags, IMFTopology *topology) ++{ ++ FIXME("(%p, %d, %p): stub", iface, flags, topology); ++ ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI session_ClearTopologies(IMFMediaSession *iface) ++{ ++ FIXME("(%p): stub", iface); ++ ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI session_Start(IMFMediaSession *iface, const GUID *format, const PROPVARIANT *start) ++{ ++ FIXME("(%p, %s, %p): stub", iface, wine_dbgstr_guid(format), start); ++ ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI session_Pause(IMFMediaSession *iface) ++{ ++ FIXME("(%p): stub", iface); ++ ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI session_Stop(IMFMediaSession *iface) ++{ ++ FIXME("(%p): stub", iface); ++ ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI session_Close(IMFMediaSession *iface) ++{ ++ FIXME("(%p): stub", iface); ++ ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI session_Shutdown(IMFMediaSession *iface) ++{ ++ FIXME("(%p): stub", iface); ++ ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI session_GetClock(IMFMediaSession *iface, IMFClock **clock) ++{ ++ FIXME("(%p, %p): stub", iface, clock); ++ ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI session_GetSessionCapabilities(IMFMediaSession *iface, DWORD *caps) ++{ ++ FIXME("(%p, %p): stub", iface, caps); ++ ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI session_GetFullTopology(IMFMediaSession *iface, DWORD flags, TOPOID id, IMFTopology **topology) ++{ ++ FIXME("(%p, %d, %s, %p): stub", iface, flags, wine_dbgstr_longlong(id), topology); ++ ++ return E_NOTIMPL; ++} ++ ++static const IMFMediaSessionVtbl sessionVtbl = ++{ ++ session_QueryInterface, ++ session_AddRef, ++ session_Release, ++ session_GetEvent, ++ session_BeginGetEvent, ++ session_EndGetEvent, ++ session_QueueEvent, ++ session_SetTopology, ++ session_ClearTopologies, ++ session_Start, ++ session_Pause, ++ session_Stop, ++ session_Close, ++ session_Shutdown, ++ session_GetClock, ++ session_GetSessionCapabilities, ++ session_GetFullTopology ++}; ++ ++HRESULT create_session(IMFMediaSession **iface) ++{ ++ struct media_session *This; ++ ++ This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*This)); ++ if (!This) return E_OUTOFMEMORY; ++ ++ This->IMFMediaSession_iface.lpVtbl = &sessionVtbl; ++ This->ref = 1; ++ ++ *iface = &This->IMFMediaSession_iface; ++ return S_OK; ++} +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/mfplat-MFTRegister/0009-mfplat-Add-stub-for-MFCreateSourceResolver.patch wine-staging-1.9.7~ubuntu15.04.1/patches/mfplat-MFTRegister/0009-mfplat-Add-stub-for-MFCreateSourceResolver.patch --- wine-staging-1.9.6/patches/mfplat-MFTRegister/0009-mfplat-Add-stub-for-MFCreateSourceResolver.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/mfplat-MFTRegister/0009-mfplat-Add-stub-for-MFCreateSourceResolver.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,122 @@ +From 167ad8ca49542661a75697874f1375bd6a93ca74 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 26 Mar 2016 14:31:03 +0100 +Subject: mfplat: Add stub for MFCreateSourceResolver. + +--- + dlls/mf/mf.spec | 2 +- + dlls/mfplat/main.c | 11 +++++++++++ + dlls/mfplat/mfplat.spec | 2 +- + include/mfidl.idl | 40 ++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 53 insertions(+), 2 deletions(-) + +diff --git a/dlls/mf/mf.spec b/dlls/mf/mf.spec +index 546a697..f70538e 100644 +--- a/dlls/mf/mf.spec ++++ b/dlls/mf/mf.spec +@@ -57,7 +57,7 @@ + @ stub MFCreateSequencerSource + @ stub MFCreateSequencerSourceRemoteStream + @ stub MFCreateSimpleTypeHandler +-@ stub MFCreateSourceResolver ++@ stdcall MFCreateSourceResolver(ptr) mfplat.MFCreateSourceResolver + @ stub MFCreateStandardQualityManager + @ stub MFCreateTopoLoader + @ stub MFCreateTopology +diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c +index 3d029d8..7daeded 100644 +--- a/dlls/mfplat/main.c ++++ b/dlls/mfplat/main.c +@@ -30,6 +30,7 @@ + #include "initguid.h" + #include "mfapi.h" + #include "mferror.h" ++#include "mfidl.h" + + #include "wine/debug.h" + #include "wine/unicode.h" +@@ -522,3 +523,13 @@ HRESULT WINAPI MFGetPluginControl(IMFPluginControl **ret) + *ret = &plugin_control; + return S_OK; + } ++ ++/*********************************************************************** ++ * MFCreateSourceResolver (mfplat.@) ++ */ ++HRESULT WINAPI MFCreateSourceResolver(IMFSourceResolver **source_resolver) ++{ ++ FIXME("(%p): stub\n", source_resolver); ++ ++ return E_NOTIMPL; ++} +diff --git a/dlls/mfplat/mfplat.spec b/dlls/mfplat/mfplat.spec +index cb16e8c..e1ef001 100644 +--- a/dlls/mfplat/mfplat.spec ++++ b/dlls/mfplat/mfplat.spec +@@ -58,7 +58,7 @@ + @ stub MFCreateSample + @ stub MFCreateSocket + @ stub MFCreateSocketListener +-@ stub MFCreateSourceResolver ++@ stdcall MFCreateSourceResolver(ptr) + @ stub MFCreateStreamDescriptor + @ stub MFCreateSystemTimeSource + @ stub MFCreateSystemUnderlyingClock +diff --git a/include/mfidl.idl b/include/mfidl.idl +index 3431260..a99b02e 100644 +--- a/include/mfidl.idl ++++ b/include/mfidl.idl +@@ -48,6 +48,13 @@ typedef struct _MFCLOCK_PROPERTIES + DWORD dwClockJitter; + } MFCLOCK_PROPERTIES; + ++typedef enum MF_OBJECT_TYPE ++{ ++ MF_OBJECT_MEDIASOURCE, ++ MF_OBJECT_BYTESTREAM, ++ MF_OBJECT_INVALID ++} MF_OBJECT_TYPE; ++ + [ + object, + uuid(2eb1e945-18b8-4139-9b1a-d5d584818530), +@@ -124,3 +131,36 @@ interface IMFMediaSession : IMFMediaEventGenerator + HRESULT GetSessionCapabilities([out] DWORD *caps); + HRESULT GetFullTopology([in] DWORD flags, [in] TOPOID id, [out] IMFTopology **topology); + } ++ ++[ ++ object, ++ uuid(fbe5a32d-a497-4b61-bb85-97b1a848a6e3), ++] ++interface IMFSourceResolver : IUnknown ++{ ++ [local] HRESULT CreateObjectFromURL([in] const WCHAR *url, [in] DWORD flags, [in] IPropertyStore *props, ++ [out] MF_OBJECT_TYPE *type, [out] IUnknown **object); ++ [local] HRESULT CreateObjectFromByteStream([in] IMFByteStream *stream, [in] const WCHAR *url, ++ [in] DWORD flags, [in] IPropertyStore *props, ++ [out] MF_OBJECT_TYPE *type, [out] IUnknown **object); ++ [local] HRESULT BeginCreateObjectFromURL([in] const WCHAR *url, [in] DWORD flags, ++ [in] IPropertyStore *props, [out] IUnknown **cancel_cookie, ++ [in] IMFAsyncCallback *callback, [in] IUnknown *unk_state); ++ [call_as(BeginCreateObjectFromURL)] HRESULT RemoteBeginCreateObjectFromURL([in, string] const WCHAR *url, ++ [in] DWORD flags, [in] IPropertyStore *props, [in] IMFRemoteAsyncCallback *callback); ++ [local] HRESULT EndCreateObjectFromURL([in] IMFAsyncResult *result, [out] MF_OBJECT_TYPE *type, ++ [out] IUnknown **object); ++ [call_as(EndCreateObjectFromURL)] HRESULT RemoteEndCreateObjectFromURL([in] IUnknown *result, ++ [out] MF_OBJECT_TYPE *type, [out] IUnknown **object); ++ [local] HRESULT BeginCreateObjectFromByteStream([in] IMFByteStream *stream, [in] const WCHAR *url, ++ [in] DWORD flags, [in] IPropertyStore *props, [out] IUnknown **cancel_cookie, ++ [in] IMFAsyncCallback *callback, [in] IUnknown *unk_state); ++ [call_as(BeginCreateObjectFromByteStream)] HRESULT RemoteBeginCreateObjectFromByteStream( ++ [in] IMFByteStream *stream, [in, unique] const WCHAR *url, [in] DWORD flags, ++ [in, unique] IPropertyStore *props, [in] IMFRemoteAsyncCallback *callback); ++ [local] HRESULT EndCreateObjectFromByteStream([in] IMFAsyncResult *result, [out] MF_OBJECT_TYPE *type, ++ [out] IUnknown **object); ++ [call_as(EndCreateObjectFromByteStream)] HRESULT RemoteEndCreateObjectFromByteStream([in] IUnknown *result, ++ [out] MF_OBJECT_TYPE *type, [out] IUnknown **object); ++ [local] HRESULT CancelObjectCreation([in] IUnknown *cancel_cookie); ++} +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/mfplat-MFTRegister/definition wine-staging-1.9.7~ubuntu15.04.1/patches/mfplat-MFTRegister/definition --- wine-staging-1.9.6/patches/mfplat-MFTRegister/definition 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/mfplat-MFTRegister/definition 2016-04-04 18:23:50.000000000 +0000 @@ -1,3 +1,5 @@ Fixes: [37811] Add implementation for mfplat.MFTRegister Fixes: [39309] Add implementation for mfplat.MFTEnum +Fixes: [39367] Return stub interface from mf.MFCreateMediaSession + Category: stable diff -Nru wine-staging-1.9.6/patches/mmsystem.dll16-MIDIHDR_Refcount/0001-mmsystem.dll16-Refcount-midihdr-to-work-around-buggy.patch wine-staging-1.9.7~ubuntu15.04.1/patches/mmsystem.dll16-MIDIHDR_Refcount/0001-mmsystem.dll16-Refcount-midihdr-to-work-around-buggy.patch --- wine-staging-1.9.6/patches/mmsystem.dll16-MIDIHDR_Refcount/0001-mmsystem.dll16-Refcount-midihdr-to-work-around-buggy.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/mmsystem.dll16-MIDIHDR_Refcount/0001-mmsystem.dll16-Refcount-midihdr-to-work-around-buggy.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,4 +1,4 @@ -From 777db4a5e0c6058253b471640c9ae6dbf0e159da Mon Sep 17 00:00:00 2001 +From eda32948987d81c0df777fbe997b2ce8eaa4cbd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Fri, 26 Feb 2016 03:54:28 +0100 Subject: mmsystem.dll16: Refcount midihdr to work around buggy application @@ -9,7 +9,7 @@ 1 file changed, 73 insertions(+), 48 deletions(-) diff --git a/dlls/mmsystem.dll16/message16.c b/dlls/mmsystem.dll16/message16.c -index 012d3dc..e0df741 100644 +index 012d3dc..26e47b2 100644 --- a/dlls/mmsystem.dll16/message16.c +++ b/dlls/mmsystem.dll16/message16.c @@ -33,6 +33,13 @@ @@ -33,7 +33,7 @@ - LPMIDIHDR mh32 = (LPMIDIHDR)(*dwParam1); - SEGPTR segmh16 = *(SEGPTR*)((LPSTR)mh32 - sizeof(LPMIDIHDR)); - LPMIDIHDR16 mh16 = MapSL(segmh16); -+ struct mihdrWrap *mh32 = CONTAINING_RECORD(*dwParam1, struct mihdrWrap, hdr); ++ struct mihdrWrap *mh32 = CONTAINING_RECORD((MIDIHDR *)*dwParam1, struct mihdrWrap, hdr); + SEGPTR segmh16 = mh32->mh16; + LPMIDIHDR16 mh16 = MapSL(segmh16); @@ -129,7 +129,7 @@ { - LPMIDIHDR mh32 = (LPMIDIHDR)(*lpParam1); - LPMIDIHDR16 mh16 = MapSL(*(SEGPTR*)((LPSTR)mh32 - sizeof(LPMIDIHDR))); -+ struct mihdrWrap *mh32 = CONTAINING_RECORD(*lpParam1, struct mihdrWrap, hdr); ++ struct mihdrWrap *mh32 = CONTAINING_RECORD((MIDIHDR *)*lpParam1, struct mihdrWrap, hdr); + LPMIDIHDR16 mh16; - assert((MIDIHDR*)mh16->lpNext == mh32); @@ -168,7 +168,7 @@ - LPMIDIHDR mh32 = (LPMIDIHDR)(*dwParam1); - SEGPTR segmh16 = *(SEGPTR*)((LPSTR)mh32 - sizeof(LPMIDIHDR)); - LPMIDIHDR16 mh16 = MapSL(segmh16); -+ struct mihdrWrap *mh32 = CONTAINING_RECORD(*dwParam1, struct mihdrWrap, hdr); ++ struct mihdrWrap *mh32 = CONTAINING_RECORD((MIDIHDR *)*dwParam1, struct mihdrWrap, hdr); + SEGPTR segmh16 = mh32->mh16; + LPMIDIHDR16 mh16 = MapSL(segmh16); diff -Nru wine-staging-1.9.6/patches/mmsystem.dll16-MIDIHDR_Refcount/0002-mmsystem.dll16-Translate-MidiIn-messages.patch wine-staging-1.9.7~ubuntu15.04.1/patches/mmsystem.dll16-MIDIHDR_Refcount/0002-mmsystem.dll16-Translate-MidiIn-messages.patch --- wine-staging-1.9.6/patches/mmsystem.dll16-MIDIHDR_Refcount/0002-mmsystem.dll16-Translate-MidiIn-messages.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/mmsystem.dll16-MIDIHDR_Refcount/0002-mmsystem.dll16-Translate-MidiIn-messages.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,4 +1,4 @@ -From 23a789f7364648c706fc14a5558de028016f7b42 Mon Sep 17 00:00:00 2001 +From e741e408304cd80852ec392fe491f1cde403e283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Fri, 26 Feb 2016 04:04:12 +0100 Subject: mmsystem.dll16: Translate MidiIn messages. @@ -8,7 +8,7 @@ 1 file changed, 126 insertions(+), 2 deletions(-) diff --git a/dlls/mmsystem.dll16/message16.c b/dlls/mmsystem.dll16/message16.c -index e0df741..f7125da 100644 +index 26e47b2..05a1995 100644 --- a/dlls/mmsystem.dll16/message16.c +++ b/dlls/mmsystem.dll16/message16.c @@ -95,7 +95,78 @@ static void MMSYSTDRV_Mixer_MapCB(DWORD uMsg, DWORD_PTR* dwUser @@ -124,7 +124,7 @@ + case MIDM_PREPARE: + case MIDM_UNPREPARE: + { -+ struct mihdrWrap *mh32 = CONTAINING_RECORD(*lpParam1, struct mihdrWrap, hdr); ++ struct mihdrWrap *mh32 = CONTAINING_RECORD((MIDIHDR *)*lpParam1, struct mihdrWrap, hdr); + LPMIDIHDR16 mh16; + + if (mh32->mh16) diff -Nru wine-staging-1.9.6/patches/msvfw32-ICGetDisplayFormat/0001-msvfw32-Try-different-formarts-in-ICGetDisplayFormat.patch wine-staging-1.9.7~ubuntu15.04.1/patches/msvfw32-ICGetDisplayFormat/0001-msvfw32-Try-different-formarts-in-ICGetDisplayFormat.patch --- wine-staging-1.9.6/patches/msvfw32-ICGetDisplayFormat/0001-msvfw32-Try-different-formarts-in-ICGetDisplayFormat.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/msvfw32-ICGetDisplayFormat/0001-msvfw32-Try-different-formarts-in-ICGetDisplayFormat.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,384 @@ +From 396e4a11fbc0773d9519e84ff0d77c3ff3ec6efc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Thu, 31 Mar 2016 00:58:04 +0200 +Subject: msvfw32: Try different formarts in ICGetDisplayFormat. + +--- + dlls/msvfw32/msvideo_main.c | 88 ++++++++++++---- + dlls/msvfw32/tests/msvfw.c | 240 ++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 307 insertions(+), 21 deletions(-) + +diff --git a/dlls/msvfw32/msvideo_main.c b/dlls/msvfw32/msvideo_main.c +index 4f1a2bf..28f405e 100644 +--- a/dlls/msvfw32/msvideo_main.c ++++ b/dlls/msvfw32/msvideo_main.c +@@ -719,24 +719,79 @@ HIC VFWAPI ICGetDisplayFormat( + HIC hic,LPBITMAPINFOHEADER lpbiIn,LPBITMAPINFOHEADER lpbiOut, + INT depth,INT dx,INT dy) + { +- HIC tmphic = hic; ++ static const struct ++ { ++ int depth; ++ int compression; ++ } ++ try_depths[] = ++ { ++ { 8, BI_RGB}, ++ {16, BI_RGB}, ++ {16, BI_BITFIELDS}, ++ {24, BI_RGB}, ++ {32, BI_RGB}, ++ }; + +- TRACE("(%p,%p,%p,%d,%d,%d)!\n",hic,lpbiIn,lpbiOut,depth,dx,dy); ++ int screen_depth, i; ++ BOOL found = FALSE; ++ HIC tmphic; ++ HDC hdc; + +- if (!tmphic) { +- tmphic=ICLocate(ICTYPE_VIDEO,0,lpbiIn,NULL,ICMODE_DECOMPRESS); +- if (!tmphic) +- return tmphic; +- } +- if ((dy == lpbiIn->biHeight) && (dx == lpbiIn->biWidth)) +- dy = dx = 0; /* no resize needed */ ++ TRACE("(%p,%p,%p,%d,%d,%d)!\n", hic, lpbiIn, lpbiOut, depth, dx, dy); ++ ++ tmphic = hic ? hic : ICLocate(ICTYPE_VIDEO, 0, lpbiIn, NULL, ICMODE_DECOMPRESS); ++ if (!tmphic) return tmphic; ++ ++ hdc = GetDC(0); ++ screen_depth = GetDeviceCaps(hdc, BITSPIXEL) * GetDeviceCaps(hdc, PLANES); ++ ReleaseDC(0, hdc); ++ ++ if (!dx) dx = lpbiIn->biWidth; ++ if (!dy) dy = lpbiIn->biHeight; ++ if (!depth) depth = screen_depth; + + /* Can we decompress it ? */ +- if (ICDecompressQuery(tmphic,lpbiIn,NULL) != 0) ++ if (ICDecompressQuery(tmphic, lpbiIn, NULL) != ICERR_OK) + goto errout; /* no, sorry */ + + ICSendMessage(tmphic, ICM_DECOMPRESS_GET_FORMAT, (DWORD_PTR)lpbiIn, (DWORD_PTR)lpbiOut); + ++ lpbiOut->biSize = sizeof(BITMAPINFOHEADER); ++ lpbiOut->biWidth = dx; ++ lpbiOut->biHeight = dy; ++ lpbiOut->biPlanes = 1; ++ lpbiOut->biSizeImage = 0; ++ ++ for (i = 0; i < sizeof(try_depths) / sizeof(try_depths[0]); i++) ++ { ++ if (!found && try_depths[i].depth != depth) ++ continue; ++ ++ found = TRUE; ++ lpbiOut->biBitCount = try_depths[i].depth; ++ lpbiOut->biCompression = try_depths[i].compression; ++ ++ if (ICDecompressQuery(tmphic, lpbiIn, lpbiOut) == ICERR_OK) ++ goto success; ++ } ++ ++ if (!found) ++ { ++ lpbiOut->biBitCount = depth; ++ lpbiOut->biCompression = BI_RGB; ++ if (ICDecompressQuery(tmphic, lpbiIn, lpbiOut) == ICERR_OK) ++ goto success; ++ ++ lpbiOut->biBitCount = screen_depth; ++ lpbiOut->biCompression = BI_RGB; ++ if (ICDecompressQuery(tmphic, lpbiIn, lpbiOut) == ICERR_OK) ++ goto success; ++ } ++ ++ if (ICSendMessage(tmphic, ICM_DECOMPRESS_GET_FORMAT, (DWORD_PTR)lpbiIn, (DWORD_PTR)lpbiOut)) ++ goto errout; ++ + if (lpbiOut->biCompression != 0) { + FIXME("Ooch, how come decompressor outputs compressed data (%d)??\n", + lpbiOut->biCompression); +@@ -746,20 +801,11 @@ HIC VFWAPI ICGetDisplayFormat( + lpbiOut->biSize); + lpbiOut->biSize = sizeof(*lpbiOut); + } +- if (!depth) { +- HDC hdc; +- +- hdc = GetDC(0); +- depth = GetDeviceCaps(hdc,BITSPIXEL)*GetDeviceCaps(hdc,PLANES); +- ReleaseDC(0,hdc); +- if (depth==15) depth = 16; +- if (depth<8) depth = 8; +- } +- if (lpbiIn->biBitCount == 8) +- depth = 8; + ++success: + TRACE("=> %p\n", tmphic); + return tmphic; ++ + errout: + if (hic!=tmphic) + ICClose(tmphic); +diff --git a/dlls/msvfw32/tests/msvfw.c b/dlls/msvfw32/tests/msvfw.c +index 125cac5..7fd4c43 100644 +--- a/dlls/msvfw32/tests/msvfw.c ++++ b/dlls/msvfw32/tests/msvfw.c +@@ -285,9 +285,249 @@ static void test_ICSeqCompress(void) + ok(err == ICERR_BADHANDLE, "Expected -8, got %d\n", err); + } + ++struct msg_result ++{ ++ int msg_index; ++ UINT msg; ++ BOOL output_format; ++ int width; ++ int height; ++ int bits; ++ int compression; ++ LRESULT result; ++ BOOL todo; ++}; ++ ++static struct msg_result expected_msgs[] = ++{ ++ /* Wine bug - shouldn't be called */ ++ { 0, DRV_LOAD, FALSE, 0, 0, 0, 0, TRUE, TRUE}, ++ { 0, DRV_ENABLE, FALSE, 0, 0, 0, 0, 0, TRUE}, ++ ++ { 0, DRV_OPEN, FALSE, 0, 0, 0, 0, 0xdeadbeef, FALSE}, ++ ++ /* test 1 */ ++ { 1, ICM_DECOMPRESS_QUERY, FALSE, 0, 0, 0, 0, ICERR_OK, FALSE}, ++ { 2, ICM_DECOMPRESS_GET_FORMAT, TRUE, 320, 240, 16, BI_RGB, ICERR_BADFORMAT, FALSE}, ++ { 3, ICM_DECOMPRESS_QUERY, TRUE, 640, 480, 8, BI_RGB, ICERR_BADFORMAT, FALSE}, ++ { 4, ICM_DECOMPRESS_QUERY, TRUE, 640, 480, 16, BI_RGB, ICERR_BADFORMAT, FALSE}, ++ { 5, ICM_DECOMPRESS_QUERY, TRUE, 640, 480, 16, BI_BITFIELDS, ICERR_BADFORMAT, FALSE}, ++ { 6, ICM_DECOMPRESS_QUERY, TRUE, 640, 480, 24, BI_RGB, ICERR_BADFORMAT, FALSE}, ++ { 7, ICM_DECOMPRESS_QUERY, TRUE, 640, 480, 32, BI_RGB, ICERR_BADFORMAT, FALSE}, ++ { 8, ICM_DECOMPRESS_GET_FORMAT, TRUE, 640, 480, 32, BI_RGB, ICERR_OK, FALSE}, ++ ++ /* test 2 */ ++ { 9, ICM_DECOMPRESS_QUERY, FALSE, 0, 0, 0, 0, ICERR_OK, FALSE}, ++ {10, ICM_DECOMPRESS_GET_FORMAT, TRUE, 320, 240, 16, BI_RGB, ICERR_BADFORMAT, FALSE}, ++ {11, ICM_DECOMPRESS_QUERY, TRUE, 640, 480, 8, BI_RGB, ICERR_BADFORMAT, FALSE}, ++ {12, ICM_DECOMPRESS_QUERY, TRUE, 640, 480, 16, BI_RGB, ICERR_OK, FALSE}, ++ ++ /* test 3 */ ++ {13, ICM_DECOMPRESS_QUERY, FALSE, 0, 0, 0, 0, ICERR_OK, FALSE}, ++ {14, ICM_DECOMPRESS_GET_FORMAT, TRUE, 320, 240, 16, BI_RGB, ICERR_OK, FALSE}, ++ {15, ICM_DECOMPRESS_QUERY, TRUE, 640, 480, 8, BI_RGB, ICERR_BADFORMAT, FALSE}, ++ {16, ICM_DECOMPRESS_QUERY, TRUE, 640, 480, 16, BI_RGB, ICERR_OK, FALSE}, ++ ++ /* test 4 */ ++ {17, ICM_DECOMPRESS_QUERY, FALSE, 0, 0, 0, 0, ICERR_OK, FALSE}, ++ {18, ICM_DECOMPRESS_GET_FORMAT, TRUE, 320, 240, 16, BI_RGB, ICERR_BADFORMAT, FALSE}, ++ {19, ICM_DECOMPRESS_QUERY, TRUE, 640, 480, 24, BI_RGB, ICERR_BADFORMAT, FALSE}, ++ {20, ICM_DECOMPRESS_QUERY, TRUE, 640, 480, 32, BI_RGB, ICERR_BADFORMAT, FALSE}, ++ {21, ICM_DECOMPRESS_GET_FORMAT, TRUE, 640, 480, 32, BI_RGB, ICERR_OK, FALSE}, ++ ++ /* test 5 */ ++ {22, ICM_DECOMPRESS_QUERY, FALSE, 0, 0, 0, 0, ICERR_OK, FALSE}, ++ {23, ICM_DECOMPRESS_GET_FORMAT, TRUE, 320, 240, 16, BI_RGB, ICERR_OK, FALSE}, ++ {24, ICM_DECOMPRESS_QUERY, TRUE, 640, 480, 32, BI_RGB, ICERR_OK, FALSE}, ++ ++ /* test 6 */ ++ {25, ICM_DECOMPRESS_QUERY, FALSE, 0, 0, 0, 0, ICERR_OK, FALSE}, ++ {26, ICM_DECOMPRESS_GET_FORMAT, TRUE, 320, 240, 16, BI_RGB, ICERR_OK, FALSE}, ++ {27, ICM_DECOMPRESS_QUERY, TRUE, 640, 480, 32, BI_RGB, ICERR_OK, FALSE}, ++ ++ /* test 7 */ ++ {28, ICM_DECOMPRESS_QUERY, FALSE, 0, 0, 0, 0, ICERR_OK, FALSE}, ++ {29, ICM_DECOMPRESS_GET_FORMAT, TRUE, 320, 240, 16, BI_RGB, ICERR_OK, FALSE}, ++ {30, ICM_DECOMPRESS_QUERY, TRUE, 640, 480, 9, BI_RGB, ICERR_BADFORMAT, FALSE}, ++ {31, ICM_DECOMPRESS_QUERY, TRUE, 640, 480, 32, BI_RGB, ICERR_BADFORMAT, FALSE}, ++ {32, ICM_DECOMPRESS_GET_FORMAT, TRUE, 640, 480, 32, BI_RGB, ICERR_OK, FALSE}, ++ ++ /* test 8 */ ++ {33, ICM_DECOMPRESS_QUERY, FALSE, 0, 0, 0, 0, ICERR_OK, FALSE}, ++ {34, ICM_DECOMPRESS_GET_FORMAT, TRUE, 320, 240, 16, BI_RGB, ICERR_OK, FALSE}, ++ {35, ICM_DECOMPRESS_QUERY, TRUE, 800, 600, 32, BI_RGB, ICERR_OK, FALSE}, ++ ++ /* Wine bug - shouldn't be called */ ++ {36, DRV_DISABLE, FALSE, 0, 0, 0, 0, ICERR_OK, TRUE}, ++ {36, DRV_FREE, FALSE, 0, 0, 0, 0, ICERR_OK, TRUE}, ++}; ++ ++static int msg_index = 0; ++ ++static struct msg_result *get_expected_msg(UINT msg) ++{ ++ int i = 0; ++ for(; i < sizeof(expected_msgs) / sizeof(expected_msgs[0]); i++) ++ { ++ if (expected_msgs[i].msg_index == msg_index && expected_msgs[i].msg == msg) ++ return &expected_msgs[i]; ++ } ++ return NULL; ++} ++ ++LRESULT WINAPI driver_proc_test(DWORD_PTR dwDriverId, HDRVR hdrvr, UINT msg, ++ LPARAM lParam1, LPARAM lParam2) ++{ ++ struct msg_result *expected = get_expected_msg(msg); ++ LRESULT res = expected ? expected->result : ICERR_UNSUPPORTED; ++ ++ if (msg == DRV_CLOSE) ++ return ICERR_OK; ++ ++ if (!expected) ++ { ++ ok(0, "unexpected message: %04x %ld %ld at msg index %d\n", ++ msg, lParam1, lParam2, msg_index); ++ return ICERR_UNSUPPORTED; ++ } ++ else if (expected->todo) ++ { ++ todo_wine ok(0, "unexpected message: %04x %ld %ld at msg index %d\n", ++ msg, lParam1, lParam2, msg_index); ++ return res; ++ } ++ ++ switch (msg) ++ { ++ case ICM_DECOMPRESS_QUERY: ++ { ++ BITMAPINFOHEADER *out = (BITMAPINFOHEADER *)lParam2; ++ ++ if (!lParam2) ++ { ++ trace("query -> without format\n"); ++ ok(!expected->output_format, "Expected no output format pointer\n"); ++ break; ++ } ++ ++ ok(expected->output_format, "Expected output format pointer\n"); ++ ok(out->biWidth == expected->width, ++ "Expected width %d, got %d\n", expected->width, out->biWidth); ++ ok(out->biHeight == expected->height, ++ "Expected height %d, got %d\n", expected->height, out->biHeight); ++ ok(out->biBitCount == expected->bits, ++ "Expected biBitCount %d, got %d\n", expected->bits, out->biBitCount); ++ ok(out->biCompression == expected->compression, ++ "Expected compression %d, got %d\n", expected->compression, out->biCompression); ++ ++ trace("query -> width: %d, height: %d, bit: %d, compression: %d\n", ++ out->biWidth, out->biHeight, out->biBitCount, out->biCompression); ++ break; ++ } ++ ++ case ICM_DECOMPRESS_GET_FORMAT: ++ { ++ BITMAPINFOHEADER *out = (BITMAPINFOHEADER *)lParam2; ++ ++ if (!lParam2) ++ { ++ trace("format -> without format\n"); ++ ok(!expected->output_format, "Expected no output format pointer\n"); ++ break; ++ } ++ ++ ok(expected->output_format, "Expected output format pointer\n"); ++ ok(out->biWidth == expected->width, ++ "Expected width %d, got %d\n", expected->width, out->biWidth); ++ ok(out->biHeight == expected->height, ++ "Expected height %d, got %d\n", expected->height, out->biHeight); ++ ok(out->biBitCount == expected->bits, ++ "Expected biBitCount %d, got %d\n", expected->bits, out->biBitCount); ++ ok(out->biCompression == expected->compression, ++ "Expected compression %d, got %d\n", expected->compression, out->biCompression); ++ ++ trace("format -> width: %d, height: %d, bit: %d, compression: %d\n", ++ out->biWidth, out->biHeight, out->biBitCount, out->biCompression); ++ ++ out->biBitCount = 64; ++ break; ++ } ++ } ++ ++ msg_index++; ++ return res; ++} ++ ++ ++void test_ICGetDisplayFormat(void) ++{ ++ static const struct ++ { ++ int bits_wanted; ++ int bits_expected; ++ int dx; ++ int width_expected; ++ int dy; ++ int height_expected; ++ int msg_index; ++ } ++ tests[] = ++ { ++ { 8, 64, 0, 640, 0, 480, 9}, ++ { 8, 16, 0, 640, 0, 480, 13}, ++ { 8, 16, 0, 640, 0, 480, 17}, ++ {24, 64, 0, 640, 0, 480, 22}, ++ {32, 32, 0, 640, 0, 480, 25}, ++ { 0, 32, 0, 640, 0, 480, 28}, ++ { 9, 64, 0, 640, 0, 480, 33}, ++ {32, 32, 800, 800, 600, 600, 36}, ++ }; ++ ++ HIC ic, ic2; ++ BITMAPINFOHEADER in; ++ BITMAPINFOHEADER out; ++ int i; ++ ++ ic = ICOpenFunction(ICTYPE_VIDEO, 0xdeadbeef, ICMODE_DECOMPRESS, driver_proc_test); ++ ok(!!ic, "Opening driver failed\n"); ++ ++ for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) ++ { ++ memset(&in, 0, sizeof(in)); ++ memset(&out, 0, sizeof(out)); ++ ++ in.biSize = sizeof(in); ++ in.biWidth = 640; ++ in.biHeight = 480; ++ in.biPlanes = 1; ++ in.biBitCount = 32; ++ in.biCompression = BI_PNG; ++ in.biSizeImage = 1024; ++ ++ out.biBitCount = 16; ++ out.biWidth = 320; ++ out.biHeight = 240; ++ ++ ic2 = ICGetDisplayFormat(ic, &in, &out, tests[i].bits_wanted, tests[i].dx, tests[i].dy); ++ ok(!!ic2, "Expected ICGetDisplayFormat to succeeded\n"); ++ ++ ok(out.biBitCount == tests[i].bits_expected, ++ "Expected biBitCount %d, got %d\n", tests[i].bits_expected, out.biBitCount); ++ ok(out.biWidth == tests[i].width_expected, ++ "Expected biWidth %d, got %d\n", tests[i].width_expected, out.biWidth); ++ ok(out.biHeight == tests[i].height_expected, ++ "Expected biHeight %d, got %d\n", tests[i].height_expected, out.biHeight); ++ ok(msg_index == tests[i].msg_index, ++ "Expected msg_index %d, got %d\n", tests[i].msg_index, msg_index); ++ } ++ ++ ICClose(ic); ++} ++ + START_TEST(msvfw) + { + test_OpenCase(); + test_Locate(); + test_ICSeqCompress(); ++ test_ICGetDisplayFormat(); + } +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/msvfw32-ICGetDisplayFormat/0002-msvfw32-Add-test-for-negative-width-height-values-pa.patch wine-staging-1.9.7~ubuntu15.04.1/patches/msvfw32-ICGetDisplayFormat/0002-msvfw32-Add-test-for-negative-width-height-values-pa.patch --- wine-staging-1.9.6/patches/msvfw32-ICGetDisplayFormat/0002-msvfw32-Add-test-for-negative-width-height-values-pa.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/msvfw32-ICGetDisplayFormat/0002-msvfw32-Add-test-for-negative-width-height-values-pa.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,64 @@ +From 37a47ad2b8a776a15d1e0431c0e1c1924884fbe1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Thu, 31 Mar 2016 17:17:20 +0200 +Subject: msvfw32: Add test for negative width/height values passed to + ICGetDisplayFormat. + +--- + dlls/msvfw32/msvideo_main.c | 4 ++-- + dlls/msvfw32/tests/msvfw.c | 16 ++++++++++++++-- + 2 files changed, 16 insertions(+), 4 deletions(-) + +diff --git a/dlls/msvfw32/msvideo_main.c b/dlls/msvfw32/msvideo_main.c +index 28f405e..41bd234 100644 +--- a/dlls/msvfw32/msvideo_main.c ++++ b/dlls/msvfw32/msvideo_main.c +@@ -747,8 +747,8 @@ HIC VFWAPI ICGetDisplayFormat( + screen_depth = GetDeviceCaps(hdc, BITSPIXEL) * GetDeviceCaps(hdc, PLANES); + ReleaseDC(0, hdc); + +- if (!dx) dx = lpbiIn->biWidth; +- if (!dy) dy = lpbiIn->biHeight; ++ if (dx <= 0) dx = lpbiIn->biWidth; ++ if (dy <= 0) dy = lpbiIn->biHeight; + if (!depth) depth = screen_depth; + + /* Can we decompress it ? */ +diff --git a/dlls/msvfw32/tests/msvfw.c b/dlls/msvfw32/tests/msvfw.c +index 7fd4c43..36dec1d 100644 +--- a/dlls/msvfw32/tests/msvfw.c ++++ b/dlls/msvfw32/tests/msvfw.c +@@ -357,9 +357,19 @@ static struct msg_result expected_msgs[] = + {34, ICM_DECOMPRESS_GET_FORMAT, TRUE, 320, 240, 16, BI_RGB, ICERR_OK, FALSE}, + {35, ICM_DECOMPRESS_QUERY, TRUE, 800, 600, 32, BI_RGB, ICERR_OK, FALSE}, + ++ /* test 9 */ ++ {36, ICM_DECOMPRESS_QUERY, FALSE, 0, 0, 0, 0, ICERR_OK, FALSE}, ++ {37, ICM_DECOMPRESS_GET_FORMAT, TRUE, 320, 240, 16, BI_RGB, ICERR_OK, FALSE}, ++ {38, ICM_DECOMPRESS_QUERY, TRUE, 640, 480, 32, BI_RGB, ICERR_OK, FALSE}, ++ ++ /* test 10 */ ++ {39, ICM_DECOMPRESS_QUERY, FALSE, 0, 0, 0, 0, ICERR_OK, FALSE}, ++ {40, ICM_DECOMPRESS_GET_FORMAT, TRUE, 320, 240, 16, BI_RGB, ICERR_OK, FALSE}, ++ {41, ICM_DECOMPRESS_QUERY, TRUE, 640, 480, 32, BI_RGB, ICERR_OK, FALSE}, ++ + /* Wine bug - shouldn't be called */ +- {36, DRV_DISABLE, FALSE, 0, 0, 0, 0, ICERR_OK, TRUE}, +- {36, DRV_FREE, FALSE, 0, 0, 0, 0, ICERR_OK, TRUE}, ++ {42, DRV_DISABLE, FALSE, 0, 0, 0, 0, ICERR_OK, TRUE}, ++ {42, DRV_FREE, FALSE, 0, 0, 0, 0, ICERR_OK, TRUE}, + }; + + static int msg_index = 0; +@@ -481,6 +491,8 @@ void test_ICGetDisplayFormat(void) + { 0, 32, 0, 640, 0, 480, 28}, + { 9, 64, 0, 640, 0, 480, 33}, + {32, 32, 800, 800, 600, 600, 36}, ++ {32, 32, -1, 640, -1, 480, 39}, ++ {32, 32, -90, 640, -60, 480, 42}, + }; + + HIC ic, ic2; +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/msvfw32-ICGetDisplayFormat/0003-msvfw32-Set-biSizeImage-correctly-in-ICGetDisplayFor.patch wine-staging-1.9.7~ubuntu15.04.1/patches/msvfw32-ICGetDisplayFormat/0003-msvfw32-Set-biSizeImage-correctly-in-ICGetDisplayFor.patch --- wine-staging-1.9.6/patches/msvfw32-ICGetDisplayFormat/0003-msvfw32-Set-biSizeImage-correctly-in-ICGetDisplayFor.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/msvfw32-ICGetDisplayFormat/0003-msvfw32-Set-biSizeImage-correctly-in-ICGetDisplayFor.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,95 @@ +From cd04ddddb9d9fcf5011b49320682fefb0b7a28c1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 2 Apr 2016 16:13:44 +0200 +Subject: msvfw32: Set biSizeImage correctly in ICGetDisplayFormat. + +--- + dlls/msvfw32/msvideo_main.c | 4 +++- + dlls/msvfw32/tests/msvfw.c | 15 +++++++++++---- + 2 files changed, 14 insertions(+), 5 deletions(-) + +diff --git a/dlls/msvfw32/msvideo_main.c b/dlls/msvfw32/msvideo_main.c +index 41bd234..6f91859 100644 +--- a/dlls/msvfw32/msvideo_main.c ++++ b/dlls/msvfw32/msvideo_main.c +@@ -761,7 +761,6 @@ HIC VFWAPI ICGetDisplayFormat( + lpbiOut->biWidth = dx; + lpbiOut->biHeight = dy; + lpbiOut->biPlanes = 1; +- lpbiOut->biSizeImage = 0; + + for (i = 0; i < sizeof(try_depths) / sizeof(try_depths[0]); i++) + { +@@ -771,6 +770,7 @@ HIC VFWAPI ICGetDisplayFormat( + found = TRUE; + lpbiOut->biBitCount = try_depths[i].depth; + lpbiOut->biCompression = try_depths[i].compression; ++ lpbiOut->biSizeImage = dx * dy * lpbiOut->biBitCount / 8; + + if (ICDecompressQuery(tmphic, lpbiIn, lpbiOut) == ICERR_OK) + goto success; +@@ -780,11 +780,13 @@ HIC VFWAPI ICGetDisplayFormat( + { + lpbiOut->biBitCount = depth; + lpbiOut->biCompression = BI_RGB; ++ lpbiOut->biSizeImage = (dx * dy * depth) / 8; + if (ICDecompressQuery(tmphic, lpbiIn, lpbiOut) == ICERR_OK) + goto success; + + lpbiOut->biBitCount = screen_depth; + lpbiOut->biCompression = BI_RGB; ++ lpbiOut->biSizeImage = dx * dy * screen_depth / 8; + if (ICDecompressQuery(tmphic, lpbiIn, lpbiOut) == ICERR_OK) + goto success; + } +diff --git a/dlls/msvfw32/tests/msvfw.c b/dlls/msvfw32/tests/msvfw.c +index 36dec1d..252aba2 100644 +--- a/dlls/msvfw32/tests/msvfw.c ++++ b/dlls/msvfw32/tests/msvfw.c +@@ -429,9 +429,12 @@ LRESULT WINAPI driver_proc_test(DWORD_PTR dwDriverId, HDRVR hdrvr, UINT msg, + "Expected biBitCount %d, got %d\n", expected->bits, out->biBitCount); + ok(out->biCompression == expected->compression, + "Expected compression %d, got %d\n", expected->compression, out->biCompression); ++ ok(out->biSizeImage == (out->biWidth * out->biHeight * out->biBitCount) / 8, ++ "Expected biSizeImage %d, got %d\n", (out->biWidth * out->biHeight * out->biBitCount) / 8, ++ out->biSizeImage); + +- trace("query -> width: %d, height: %d, bit: %d, compression: %d\n", +- out->biWidth, out->biHeight, out->biBitCount, out->biCompression); ++ trace("query -> width: %d, height: %d, bit: %d, compression: %d, size: %d\n", ++ out->biWidth, out->biHeight, out->biBitCount, out->biCompression, out->biSizeImage); + break; + } + +@@ -456,8 +459,8 @@ LRESULT WINAPI driver_proc_test(DWORD_PTR dwDriverId, HDRVR hdrvr, UINT msg, + ok(out->biCompression == expected->compression, + "Expected compression %d, got %d\n", expected->compression, out->biCompression); + +- trace("format -> width: %d, height: %d, bit: %d, compression: %d\n", +- out->biWidth, out->biHeight, out->biBitCount, out->biCompression); ++ trace("format -> width: %d, height: %d, bit: %d, compression: %d, size: %d\n", ++ out->biWidth, out->biHeight, out->biBitCount, out->biCompression, out->biSizeImage); + + out->biBitCount = 64; + break; +@@ -498,6 +501,7 @@ void test_ICGetDisplayFormat(void) + HIC ic, ic2; + BITMAPINFOHEADER in; + BITMAPINFOHEADER out; ++ int real_depth; + int i; + + ic = ICOpenFunction(ICTYPE_VIDEO, 0xdeadbeef, ICMODE_DECOMPRESS, driver_proc_test); +@@ -529,6 +533,9 @@ void test_ICGetDisplayFormat(void) + "Expected biWidth %d, got %d\n", tests[i].width_expected, out.biWidth); + ok(out.biHeight == tests[i].height_expected, + "Expected biHeight %d, got %d\n", tests[i].height_expected, out.biHeight); ++ real_depth = (out.biBitCount > 32) ? 4 : out.biBitCount / 8; ++ ok(out.biSizeImage == out.biWidth * out.biHeight * real_depth, ++ "Expected biSizeImage %d, got %d\n", out.biWidth * out.biHeight * real_depth, out.biSizeImage); + ok(msg_index == tests[i].msg_index, + "Expected msg_index %d, got %d\n", tests[i].msg_index, msg_index); + } +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/msvfw32-ICGetDisplayFormat/definition wine-staging-1.9.7~ubuntu15.04.1/patches/msvfw32-ICGetDisplayFormat/definition --- wine-staging-1.9.6/patches/msvfw32-ICGetDisplayFormat/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/msvfw32-ICGetDisplayFormat/definition 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,2 @@ +Fixes: [23175] Fix implementation of ICGetDisplayFormat +Fixes: [25180] Fix rendering of Clonk Endeavour's intro video diff -Nru wine-staging-1.9.6/patches/msvidc32-Convert_Bitness/0001-msvidc32-Add-support-for-converting-16-bit-depth-to-.patch wine-staging-1.9.7~ubuntu15.04.1/patches/msvidc32-Convert_Bitness/0001-msvidc32-Add-support-for-converting-16-bit-depth-to-.patch --- wine-staging-1.9.6/patches/msvidc32-Convert_Bitness/0001-msvidc32-Add-support-for-converting-16-bit-depth-to-.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/msvidc32-Convert_Bitness/0001-msvidc32-Add-support-for-converting-16-bit-depth-to-.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,190 @@ +From ef25f64580a12fba30413f34c1a9c72e31089e29 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 2 Apr 2016 22:15:37 +0200 +Subject: msvidc32: Add support for converting 16 bit depth to 24 bit. + +--- + dlls/msvfw32/tests/msvfw.c | 5 +++ + dlls/msvidc32/msvideo1.c | 91 ++++++++++++++++++++++++++++++++++++++++------ + 2 files changed, 84 insertions(+), 12 deletions(-) + +diff --git a/dlls/msvfw32/tests/msvfw.c b/dlls/msvfw32/tests/msvfw.c +index 125cac5..66956aa 100644 +--- a/dlls/msvfw32/tests/msvfw.c ++++ b/dlls/msvfw32/tests/msvfw.c +@@ -202,6 +202,11 @@ static void test_Locate(void) + todo_wine ok(err == ICERR_OK, "Query MSVC->RGB16 height<0: %d\n", err); + bo.biHeight = -bo.biHeight; + ++ bo.biBitCount = 24; ++ err = ICDecompressQuery(h, &bi, &bo); ++ ok(err == ICERR_OK, "Query MSVC 16->24: %d\n", err); ++ bo.biBitCount = 16; ++ + bi.biCompression = mmioFOURCC('m','s','v','c'); + err = ICDecompressQuery(h, &bi, &bo); + ok(err == ICERR_BADFORMAT, "Query msvc->RGB16: %d\n", err); +diff --git a/dlls/msvidc32/msvideo1.c b/dlls/msvidc32/msvideo1.c +index b3faaf6..ab7cc3e 100644 +--- a/dlls/msvidc32/msvideo1.c ++++ b/dlls/msvidc32/msvideo1.c +@@ -67,7 +67,7 @@ typedef BYTE uint8_t; + + typedef struct Msvideo1Context { + DWORD dwMagic; +- BOOL mode_8bit; /* if it's not 8-bit, it's 16-bit */ ++ int depth; + } Msvideo1Context; + + static void +@@ -327,8 +327,15 @@ CRAM_DecompressQuery( Msvideo1Context *info, LPBITMAPINFO in, LPBITMAPINFO out ) + TRACE("out->bpp = %d\n", out->bmiHeader.biBitCount ); + TRACE("out->height = %d\n", out->bmiHeader.biHeight ); + TRACE("out->width = %d\n", out->bmiHeader.biWidth ); +- if(( in->bmiHeader.biBitCount != out->bmiHeader.biBitCount ) || +- ( in->bmiHeader.biPlanes != out->bmiHeader.biPlanes ) || ++ ++ if ((in->bmiHeader.biBitCount != out->bmiHeader.biBitCount) && ++ (in->bmiHeader.biBitCount != 16 || out->bmiHeader.biBitCount != 24)) ++ { ++ TRACE("incompatible depth requested\n"); ++ return ICERR_BADFORMAT; ++ } ++ ++ if(( in->bmiHeader.biPlanes != out->bmiHeader.biPlanes ) || + ( in->bmiHeader.biHeight != out->bmiHeader.biHeight ) || + ( in->bmiHeader.biWidth != out->bmiHeader.biWidth )) + { +@@ -376,21 +383,52 @@ static LRESULT CRAM_DecompressBegin( Msvideo1Context *info, LPBITMAPINFO in, LPB + + TRACE("bitmap is %d bpp\n", in->bmiHeader.biBitCount); + if( in->bmiHeader.biBitCount == 8 ) +- info->mode_8bit = TRUE; ++ info->depth = 8; + else if( in->bmiHeader.biBitCount == 16 ) +- info->mode_8bit = FALSE; ++ info->depth = 16; + else + { +- info->mode_8bit = FALSE; ++ info->depth = 0; + FIXME("Unsupported output format %i\n", in->bmiHeader.biBitCount); + } + + return ICERR_OK; + } + ++static void convert_depth(char *input, int depth_in, char *output, BITMAPINFOHEADER *out_hdr) ++{ ++ int x, y; ++ ++ if (depth_in == 16 && out_hdr->biBitCount == 24) ++ { ++ static const unsigned char convert_5to8[] = ++ { ++ 0x00, 0x08, 0x10, 0x19, 0x21, 0x29, 0x31, 0x3a, ++ 0x42, 0x4a, 0x52, 0x5a, 0x63, 0x6b, 0x73, 0x7b, ++ 0x84, 0x8c, 0x94, 0x9c, 0xa5, 0xad, 0xb5, 0xbd, ++ 0xc5, 0xce, 0xd6, 0xde, 0xe6, 0xef, 0xf7, 0xff, ++ }; ++ ++ WORD *src = (WORD *)input; ++ for (y = 0; y < out_hdr->biHeight; y++) ++ { ++ for (x = 0; x < out_hdr->biWidth; x++) ++ { ++ WORD pixel = *src++; ++ *output++ = convert_5to8[(pixel & 0x7c00u) >> 10]; ++ *output++ = convert_5to8[(pixel & 0x03e0u) >> 5]; ++ *output++ = convert_5to8[(pixel & 0x001fu)]; ++ } ++ } ++ } ++ else ++ FIXME("Conversion from %d to %d bit unimplemented\n", depth_in, out_hdr->biBitCount); ++} ++ + static LRESULT CRAM_Decompress( Msvideo1Context *info, ICDECOMPRESS *icd, DWORD size ) + { + LONG width, height, stride, sz; ++ void *output; + + TRACE("ICM_DECOMPRESS %p %p %d\n", info, icd, size); + +@@ -404,15 +442,29 @@ static LRESULT CRAM_Decompress( Msvideo1Context *info, ICDECOMPRESS *icd, DWORD + stride = width; /* in bytes or 16bit words */ + sz = icd->lpbiInput->biSizeImage; + +- if (info->mode_8bit) ++ output = icd->lpOutput; ++ ++ if (icd->lpbiOutput->biBitCount != info->depth) ++ { ++ output = HeapAlloc(GetProcessHeap(), 0, icd->lpbiOutput->biWidth * icd->lpbiOutput->biHeight * info->depth / 8); ++ if (!output) return ICERR_MEMORY; ++ } ++ ++ if (info->depth == 8) + { + msvideo1_decode_8bit( width, height, icd->lpInput, sz, +- icd->lpOutput, stride); ++ output, stride ); + } + else + { + msvideo1_decode_16bit( width, height, icd->lpInput, sz, +- icd->lpOutput, stride); ++ output, stride ); ++ } ++ ++ if (icd->lpbiOutput->biBitCount != info->depth) ++ { ++ convert_depth(output, info->depth, icd->lpOutput, icd->lpbiOutput); ++ HeapFree(GetProcessHeap(), 0, output); + } + + return ICERR_OK; +@@ -421,6 +473,7 @@ static LRESULT CRAM_Decompress( Msvideo1Context *info, ICDECOMPRESS *icd, DWORD + static LRESULT CRAM_DecompressEx( Msvideo1Context *info, ICDECOMPRESSEX *icd, DWORD size ) + { + LONG width, height, stride, sz; ++ void *output; + + TRACE("ICM_DECOMPRESSEX %p %p %d\n", info, icd, size); + +@@ -434,15 +487,29 @@ static LRESULT CRAM_DecompressEx( Msvideo1Context *info, ICDECOMPRESSEX *icd, DW + stride = width; + sz = icd->lpbiSrc->biSizeImage; + +- if (info->mode_8bit) ++ output = icd->lpDst; ++ ++ if (icd->lpbiDst->biBitCount != info->depth) ++ { ++ output = HeapAlloc(GetProcessHeap(), 0, icd->lpbiDst->biWidth * icd->lpbiDst->biHeight * info->depth / 8); ++ if (!output) return ICERR_MEMORY; ++ } ++ ++ if (info->depth == 8) + { + msvideo1_decode_8bit( width, height, icd->lpSrc, sz, +- icd->lpDst, stride); ++ output, stride ); + } + else + { + msvideo1_decode_16bit( width, height, icd->lpSrc, sz, +- icd->lpDst, stride); ++ output, stride ); ++ } ++ ++ if (icd->lpbiDst->biBitCount != info->depth) ++ { ++ convert_depth(output, info->depth, icd->lpDst, icd->lpbiDst); ++ HeapFree(GetProcessHeap(), 0, output); + } + + return ICERR_OK; +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/msvidc32-Convert_Bitness/definition wine-staging-1.9.7~ubuntu15.04.1/patches/msvidc32-Convert_Bitness/definition --- wine-staging-1.9.6/patches/msvidc32-Convert_Bitness/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/msvidc32-Convert_Bitness/definition 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [14695] Implement support for converting 16 bit depth to 24 bit in msvidc32 diff -Nru wine-staging-1.9.6/patches/ntdll-Junction_Points/0003-ntdll-Add-support-for-deleting-junction-points.patch wine-staging-1.9.7~ubuntu15.04.1/patches/ntdll-Junction_Points/0003-ntdll-Add-support-for-deleting-junction-points.patch --- wine-staging-1.9.6/patches/ntdll-Junction_Points/0003-ntdll-Add-support-for-deleting-junction-points.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/ntdll-Junction_Points/0003-ntdll-Add-support-for-deleting-junction-points.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,19 +1,19 @@ -From 295b74af626b2870ff5f6923d7138f0c0ccb7346 Mon Sep 17 00:00:00 2001 +From 63d7c7a66fcf9a64547dcedc7297153b4232368d Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Thu, 16 Jan 2014 21:00:21 -0700 Subject: ntdll: Add support for deleting junction points. --- dlls/ntdll/file.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ - dlls/ntdll/tests/file.c | 23 ++++++++++++++++++++++ + dlls/ntdll/tests/file.c | 22 +++++++++++++++++++++ include/ntifs.h | 11 +++++++++++ - 3 files changed, 85 insertions(+) + 3 files changed, 84 insertions(+) diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c -index 6e73547..7abbc89 100644 +index 85f037a..70ed339 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c -@@ -1781,6 +1781,41 @@ cleanup: +@@ -1778,6 +1778,41 @@ cleanup: } @@ -55,7 +55,7 @@ /************************************************************************** * NtFsControlFile [NTDLL.@] * ZwFsControlFile [NTDLL.@] -@@ -1936,6 +1971,22 @@ NTSTATUS WINAPI SYSCALL(NtFsControlFile)(HANDLE handle, HANDLE event, PIO_APC_RO +@@ -1933,6 +1968,22 @@ NTSTATUS WINAPI SYSCALL(NtFsControlFile)(HANDLE handle, HANDLE event, PIO_APC_RO status = STATUS_SUCCESS; break; @@ -79,10 +79,10 @@ { REPARSE_DATA_BUFFER *buffer = (REPARSE_DATA_BUFFER *)out_buffer; diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c -index e07e6a8..b9aa665 100644 +index 070f6ed..c21691f 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c -@@ -4298,12 +4298,15 @@ static void test_junction_points(void) +@@ -4265,12 +4265,15 @@ static void test_junction_points(void) static const WCHAR junctionW[] = {'\\','j','u','n','c','t','i','o','n',0}; WCHAR path[MAX_PATH], junction_path[MAX_PATH], target_path[MAX_PATH]; static const WCHAR targetW[] = {'\\','t','a','r','g','e','t',0}; @@ -98,7 +98,7 @@ UNICODE_STRING nameW; HANDLE hJunction; WCHAR *dest; -@@ -4351,6 +4354,8 @@ static void test_junction_points(void) +@@ -4318,6 +4321,8 @@ static void test_junction_points(void) win_skip("Failed to open junction point directory handle (0x%x).\n", GetLastError()); goto cleanup; } @@ -107,7 +107,7 @@ buffer_len = build_reparse_buffer(nameW.Buffer, &buffer); bret = DeviceIoControl(hJunction, FSCTL_SET_REPARSE_POINT, (LPVOID)buffer, buffer_len, NULL, 0, &dwret, 0); ok(bret, "Failed to create junction point! (0x%x)\n", GetLastError()); -@@ -4365,6 +4370,24 @@ static void test_junction_points(void) +@@ -4332,6 +4337,23 @@ static void test_junction_points(void) ok(bret, "Failed to read junction point!\n"); ok((memcmp(dest, nameW.Buffer, string_len) == 0), "Junction point destination does not match ('%s' != '%s')!\n", wine_dbgstr_w(dest), wine_dbgstr_w(nameW.Buffer)); @@ -127,8 +127,7 @@ + ok(dwret == STATUS_SUCCESS, "Failed to get junction point folder's attributes (0x%x).\n", dwret); + /* conversion bug: we see 0x1c9c380deadbee6 on Wine */ + todo_wine ok(old_attrib.LastAccessTime.QuadPart == new_attrib.LastAccessTime.QuadPart, -+ "Junction point folder's access time does not match (0x%llx != 0x%llx).\n", -+ new_attrib.LastAccessTime.QuadPart, old_attrib.LastAccessTime.QuadPart); ++ "Junction point folder's access time does not match.\n"); CloseHandle(hJunction); cleanup: @@ -155,5 +154,5 @@ #endif /* __WINE_NTIFS_H */ -- -2.6.1 +2.7.1 diff -Nru wine-staging-1.9.6/patches/ntdll-Junction_Points/0005-kernel32-ntdll-Add-support-for-deleting-junction-poi.patch wine-staging-1.9.7~ubuntu15.04.1/patches/ntdll-Junction_Points/0005-kernel32-ntdll-Add-support-for-deleting-junction-poi.patch --- wine-staging-1.9.6/patches/ntdll-Junction_Points/0005-kernel32-ntdll-Add-support-for-deleting-junction-poi.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/ntdll-Junction_Points/0005-kernel32-ntdll-Add-support-for-deleting-junction-poi.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,4 +1,4 @@ -From b36e62b1765283f503c2ef42b10a139955949c86 Mon Sep 17 00:00:00 2001 +From 63ede7d3be89603d63c228072c6c3fe7a50ea3e8 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Thu, 16 Jan 2014 21:02:11 -0700 Subject: kernel32,ntdll: Add support for deleting junction points with @@ -10,10 +10,10 @@ 2 files changed, 47 insertions(+), 8 deletions(-) diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c -index 22d21c5..63901d2 100644 +index 5847a84..58a4c38 100644 --- a/dlls/kernel32/path.c +++ b/dlls/kernel32/path.c -@@ -1583,6 +1583,7 @@ BOOL WINAPI CreateDirectoryExW( LPCWSTR template, LPCWSTR path, LPSECURITY_ATTRI +@@ -1630,6 +1630,7 @@ BOOL WINAPI CreateDirectoryExW( LPCWSTR template, LPCWSTR path, LPSECURITY_ATTRI */ BOOL WINAPI RemoveDirectoryW( LPCWSTR path ) { @@ -21,7 +21,7 @@ OBJECT_ATTRIBUTES attr; UNICODE_STRING nt_name; ANSI_STRING unix_name; -@@ -1616,15 +1617,21 @@ BOOL WINAPI RemoveDirectoryW( LPCWSTR path ) +@@ -1663,15 +1664,21 @@ BOOL WINAPI RemoveDirectoryW( LPCWSTR path ) } status = wine_nt_to_unix_file_name( &nt_name, &unix_name, FILE_OPEN, FALSE ); @@ -51,10 +51,10 @@ return ret; } diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c -index 965ca62..acc9197 100644 +index 174d48a..f7b7d48 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c -@@ -2714,7 +2714,7 @@ static void test_junction_points(void) +@@ -4271,7 +4271,7 @@ static void test_junction_points(void) REPARSE_GUID_DATA_BUFFER guid_buffer; static const WCHAR dotW[] = {'.',0}; REPARSE_DATA_BUFFER *buffer = NULL; @@ -63,8 +63,8 @@ INT buffer_len, string_len; IO_STATUS_BLOCK iosb; UNICODE_STRING nameW; -@@ -2805,6 +2805,38 @@ static void test_junction_points(void) - new_attrib.LastAccessTime.QuadPart, old_attrib.LastAccessTime.QuadPart); +@@ -4361,6 +4361,38 @@ static void test_junction_points(void) + "Junction point folder's access time does not match.\n"); CloseHandle(hJunction); + /* Check deleting a junction point as if it were a directory */ @@ -103,5 +103,5 @@ /* Cleanup */ pRtlFreeUnicodeString( &nameW ); -- -1.9.1 +2.7.1 diff -Nru wine-staging-1.9.6/patches/ntdll-Junction_Points/0006-kernel32-Advertise-junction-point-support.patch wine-staging-1.9.7~ubuntu15.04.1/patches/ntdll-Junction_Points/0006-kernel32-Advertise-junction-point-support.patch --- wine-staging-1.9.6/patches/ntdll-Junction_Points/0006-kernel32-Advertise-junction-point-support.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/ntdll-Junction_Points/0006-kernel32-Advertise-junction-point-support.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,15 +1,15 @@ -From 7af8c509b8c528f70077743c4127f2ce0acd8315 Mon Sep 17 00:00:00 2001 +From 7f97bca6c4153b373afbc621916d339d44e9241d Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Thu, 16 Jan 2014 21:03:47 -0700 Subject: kernel32: Advertise junction point support. --- - dlls/kernel32/volume.c | 3 ++- - dlls/ntdll/tests/file.c | 7 +++---- - 2 files changed, 5 insertions(+), 5 deletions(-) + dlls/kernel32/volume.c | 3 ++- + dlls/ntdll/tests/file.c | 5 ++--- + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c -index d396764..0fb0aef 100644 +index 4f01c99..4f11e09 100644 --- a/dlls/kernel32/volume.c +++ b/dlls/kernel32/volume.c @@ -854,7 +854,8 @@ fill_fs_info: /* now fill in the information that depends on the file system ty @@ -23,23 +23,21 @@ } ret = TRUE; diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c -index acc9197..3112081 100644 +index f7b7d48..3091283 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c -@@ -2799,10 +2799,9 @@ static void test_junction_points(void) +@@ -4356,9 +4356,8 @@ static void test_junction_points(void) memset(&new_attrib, 0x00, sizeof(new_attrib)); dwret = NtQueryInformationFile(hJunction, &iosb, &new_attrib, sizeof(new_attrib), FileBasicInformation); ok(dwret == STATUS_SUCCESS, "Failed to get junction point folder's attributes (0x%x).\n", dwret); - /* conversion bug: we see 0x1c9c380deadbee6 on Wine */ - todo_wine ok(old_attrib.LastAccessTime.QuadPart == new_attrib.LastAccessTime.QuadPart, -- "Junction point folder's access time does not match (0x%llx != 0x%llx).\n", -- new_attrib.LastAccessTime.QuadPart, old_attrib.LastAccessTime.QuadPart); +- "Junction point folder's access time does not match.\n"); + ok(old_attrib.LastAccessTime.QuadPart == new_attrib.LastAccessTime.QuadPart, -+ "Junction point folder's access time does not match (0x%llx != 0x%llx).\n", -+ new_attrib.LastAccessTime.QuadPart, old_attrib.LastAccessTime.QuadPart); ++ "Junction point folder's access time does not match.\n"); CloseHandle(hJunction); /* Check deleting a junction point as if it were a directory */ -- -1.7.9.5 +2.7.1 diff -Nru wine-staging-1.9.6/patches/ntdll-RtlIpStringToAddress_Tests/0004-ntdll-tests-Add-tests-for-RtlIpv6AddressToString-and.patch wine-staging-1.9.7~ubuntu15.04.1/patches/ntdll-RtlIpStringToAddress_Tests/0004-ntdll-tests-Add-tests-for-RtlIpv6AddressToString-and.patch --- wine-staging-1.9.6/patches/ntdll-RtlIpStringToAddress_Tests/0004-ntdll-tests-Add-tests-for-RtlIpv6AddressToString-and.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/ntdll-RtlIpStringToAddress_Tests/0004-ntdll-tests-Add-tests-for-RtlIpv6AddressToString-and.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,4 +1,4 @@ -From 569439573a4b64588331359269f90a32f0d93b9c Mon Sep 17 00:00:00 2001 +From 5f505a4a315272fd39a30d73fbfb59526b07be22 Mon Sep 17 00:00:00 2001 From: Mark Jansen Date: Mon, 6 Apr 2015 00:48:33 +0200 Subject: ntdll/tests: Add tests for RtlIpv6AddressToString and @@ -9,10 +9,10 @@ 1 file changed, 246 insertions(+) diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c -index 6d41589..37f74b5 100644 +index b0facba..e443ec2 100644 --- a/dlls/ntdll/tests/rtl.c +++ b/dlls/ntdll/tests/rtl.c -@@ -91,6 +91,8 @@ static CHAR * (WINAPI *pRtlIpv4AddressToStringA)(const IN_ADDR *, LPSTR); +@@ -94,6 +94,8 @@ static CHAR * (WINAPI *pRtlIpv4AddressToStringA)(const IN_ADDR *, LPSTR); static NTSTATUS (WINAPI *pRtlIpv4AddressToStringExA)(const IN_ADDR *, USHORT, LPSTR, PULONG); static NTSTATUS (WINAPI *pRtlIpv4StringToAddressA)(PCSTR, BOOLEAN, PCSTR *, IN_ADDR *); static NTSTATUS (WINAPI *pRtlIpv4StringToAddressExA)(PCSTR, BOOLEAN, IN_ADDR *, PUSHORT); @@ -21,7 +21,7 @@ static NTSTATUS (WINAPI *pRtlIpv6StringToAddressA)(PCSTR, PCSTR *, struct in6_addr *); static NTSTATUS (WINAPI *pRtlIpv6StringToAddressW)(PCWSTR, PCWSTR *, struct in6_addr *); static NTSTATUS (WINAPI *pRtlIpv6StringToAddressExA)(PCSTR, struct in6_addr *, PULONG, PUSHORT); -@@ -148,6 +150,8 @@ static void InitFunctionPtrs(void) +@@ -155,6 +157,8 @@ static void InitFunctionPtrs(void) pRtlIpv4AddressToStringExA = (void *)GetProcAddress(hntdll, "RtlIpv4AddressToStringExA"); pRtlIpv4StringToAddressA = (void *)GetProcAddress(hntdll, "RtlIpv4StringToAddressA"); pRtlIpv4StringToAddressExA = (void *)GetProcAddress(hntdll, "RtlIpv4StringToAddressExA"); @@ -30,7 +30,7 @@ pRtlIpv6StringToAddressA = (void *)GetProcAddress(hntdll, "RtlIpv6StringToAddressA"); pRtlIpv6StringToAddressW = (void *)GetProcAddress(hntdll, "RtlIpv6StringToAddressW"); pRtlIpv6StringToAddressExA = (void *)GetProcAddress(hntdll, "RtlIpv6StringToAddressExA"); -@@ -1924,6 +1928,246 @@ static void init_ip6(IN6_ADDR* addr, const int src[8]) +@@ -1729,6 +1733,246 @@ static void init_ip6(IN6_ADDR* addr, const int src[8]) } } @@ -270,14 +270,14 @@ + + ok(res == STATUS_SUCCESS, "[validate] res = 0x%08x, expected STATUS_SUCCESS\n", res); + ok(len == (strlen(tests[i].address) + 1) && !strcmp(buffer, tests[i].address), -+ "got len %d with '%s' (expected %d with '%s')\n", len, buffer, strlen(tests[i].address), tests[i].address); ++ "got len %d with '%s' (expected %d with '%s')\n", len, buffer, (int)strlen(tests[i].address), tests[i].address); + } +} + static void compare_RtlIpv6StringToAddressW(PCSTR name_a, int terminator_offset_a, const struct in6_addr *addr_a, NTSTATUS res_a) { -@@ -3173,6 +3417,8 @@ START_TEST(rtl) +@@ -3009,6 +3253,8 @@ START_TEST(rtl) test_RtlIpv4AddressToStringEx(); test_RtlIpv4StringToAddress(); test_RtlIpv4StringToAddressEx(); @@ -287,5 +287,5 @@ test_RtlIpv6StringToAddressEx(); test_LdrAddRefDll(); -- -2.3.5 +2.7.1 diff -Nru wine-staging-1.9.6/patches/ntdll-Stack_Guard_Pages/0001-ntdll-Handle-stack-guard-pages-on-x86_64.patch wine-staging-1.9.7~ubuntu15.04.1/patches/ntdll-Stack_Guard_Pages/0001-ntdll-Handle-stack-guard-pages-on-x86_64.patch --- wine-staging-1.9.6/patches/ntdll-Stack_Guard_Pages/0001-ntdll-Handle-stack-guard-pages-on-x86_64.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/ntdll-Stack_Guard_Pages/0001-ntdll-Handle-stack-guard-pages-on-x86_64.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,45 @@ +From d1f1c77ffb5eef8e440a9ba8a192cafde327227f Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sat, 26 Mar 2016 22:26:43 +0100 +Subject: ntdll: Handle stack guard pages on x86_64. + +--- + dlls/ntdll/signal_x86_64.c | 20 +++++++++++++++++++- + 1 file changed, 19 insertions(+), 1 deletion(-) + +diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c +index 1e88df3..e00132e 100644 +--- a/dlls/ntdll/signal_x86_64.c ++++ b/dlls/ntdll/signal_x86_64.c +@@ -2587,9 +2587,27 @@ static inline BOOL handle_interrupt( unsigned int interrupt, EXCEPTION_RECORD *r + */ + static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext ) + { +- EXCEPTION_RECORD *rec = setup_exception( sigcontext, raise_segv_exception ); ++ EXCEPTION_RECORD *rec; + ucontext_t *ucontext = sigcontext; + ++ /* check for page fault inside the thread stack */ ++ if (TRAP_sig(ucontext) == TRAP_x86_PAGEFLT && ++ (char *)siginfo->si_addr >= (char *)NtCurrentTeb()->DeallocationStack && ++ (char *)siginfo->si_addr < (char *)NtCurrentTeb()->Tib.StackBase && ++ virtual_handle_stack_fault( siginfo->si_addr )) ++ { ++ /* check if this was the last guard page */ ++ if ((char *)siginfo->si_addr < (char *)NtCurrentTeb()->DeallocationStack + 2*4096) ++ { ++ rec = setup_exception( sigcontext, raise_segv_exception ); ++ rec->ExceptionCode = EXCEPTION_STACK_OVERFLOW; ++ } ++ return; ++ } ++ ++ rec = setup_exception( sigcontext, raise_segv_exception ); ++ if (rec->ExceptionCode == EXCEPTION_STACK_OVERFLOW) return; ++ + switch(TRAP_sig(ucontext)) + { + case TRAP_x86_OFLOW: /* Overflow exception */ +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/ntdll-Stack_Guard_Pages/definition wine-staging-1.9.7~ubuntu15.04.1/patches/ntdll-Stack_Guard_Pages/definition --- wine-staging-1.9.6/patches/ntdll-Stack_Guard_Pages/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/ntdll-Stack_Guard_Pages/definition 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1 @@ +Fixes: Handle stack guard pages on x86_64 diff -Nru wine-staging-1.9.6/patches/ntdll-Syscall_Wrappers/0006-ntdll-Use-close_handle-instead-of-NtClose-for-intern.patch wine-staging-1.9.7~ubuntu15.04.1/patches/ntdll-Syscall_Wrappers/0006-ntdll-Use-close_handle-instead-of-NtClose-for-intern.patch --- wine-staging-1.9.6/patches/ntdll-Syscall_Wrappers/0006-ntdll-Use-close_handle-instead-of-NtClose-for-intern.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/ntdll-Syscall_Wrappers/0006-ntdll-Use-close_handle-instead-of-NtClose-for-intern.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -From a3e9e92ee5c436b3704b505ae4ea4cc076526b0e Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sat, 31 Oct 2015 02:41:47 +0100 -Subject: ntdll: Use close_handle instead of NtClose for internal memory - management functions. - ---- - dlls/ntdll/virtual.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c -index f30d94a..54c4cf4 100644 ---- a/dlls/ntdll/virtual.c -+++ b/dlls/ntdll/virtual.c -@@ -1279,7 +1279,7 @@ static NTSTATUS map_image( HANDLE hmapping, int fd, char *base, SIZE_T total_siz - error: - if (view) delete_view( view ); - server_leave_uninterrupted_section( &csVirtual, &sigset ); -- if (dup_mapping) NtClose( dup_mapping ); -+ if (dup_mapping) close_handle( dup_mapping ); - return status; - } - -@@ -2663,7 +2663,7 @@ NTSTATUS WINAPI SYSCALL(NtMapViewOfSection)( HANDLE handle, HANDLE process, PVOI - res = map_image( handle, unix_handle, base, size, mask, header_size, - shared_fd, dup_mapping, map_vprot, addr_ptr ); - if (shared_needs_close) close( shared_fd ); -- NtClose( shared_file ); -+ close_handle( shared_file ); - } - else - { -@@ -2731,7 +2731,7 @@ NTSTATUS WINAPI SYSCALL(NtMapViewOfSection)( HANDLE handle, HANDLE process, PVOI - server_leave_uninterrupted_section( &csVirtual, &sigset ); - - done: -- if (dup_mapping) NtClose( dup_mapping ); -+ if (dup_mapping) close_handle( dup_mapping ); - if (needs_close) close( unix_handle ); - return res; - } --- -2.6.1 - diff -Nru wine-staging-1.9.6/patches/ntoskrnl-Stubs/0013-ntoskrnl.exe-Add-IoGetDeviceAttachmentBaseRef-stub.patch wine-staging-1.9.7~ubuntu15.04.1/patches/ntoskrnl-Stubs/0013-ntoskrnl.exe-Add-IoGetDeviceAttachmentBaseRef-stub.patch --- wine-staging-1.9.6/patches/ntoskrnl-Stubs/0013-ntoskrnl.exe-Add-IoGetDeviceAttachmentBaseRef-stub.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/ntoskrnl-Stubs/0013-ntoskrnl.exe-Add-IoGetDeviceAttachmentBaseRef-stub.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,47 @@ +From a6a3dee1aaa6276cd845043835dbd52098e5579a Mon Sep 17 00:00:00 2001 +From: Jarkko Korpi +Date: Sat, 19 Mar 2016 21:54:19 +0200 +Subject: ntoskrnl.exe: Add IoGetDeviceAttachmentBaseRef stub. + +--- + dlls/ntoskrnl.exe/ntoskrnl.c | 10 ++++++++++ + dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +- + 2 files changed, 11 insertions(+), 1 deletion(-) + +diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c +index 3bee2bf..9232ba6 100644 +--- a/dlls/ntoskrnl.exe/ntoskrnl.c ++++ b/dlls/ntoskrnl.exe/ntoskrnl.c +@@ -993,6 +993,16 @@ NTSTATUS WINAPI IoDeleteSymbolicLink( UNICODE_STRING *name ) + + + /*********************************************************************** ++ * IoGetDeviceAttachmentBaseRef (NTOSKRNL.EXE.@) ++ */ ++PDEVICE_OBJECT WINAPI IoGetDeviceAttachmentBaseRef( PDEVICE_OBJECT device ) ++{ ++ FIXME( "(%p): stub\n", device ); ++ return NULL; ++} ++ ++ ++/*********************************************************************** + * IoGetDeviceInterfaces (NTOSKRNL.EXE.@) + */ + NTSTATUS WINAPI IoGetDeviceInterfaces( const GUID *InterfaceClassGuid, +diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +index 1414c53..c567b14 100644 +--- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec ++++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +@@ -379,7 +379,7 @@ + @ stub IoGetBootDiskInformation + @ stdcall IoGetConfigurationInformation() + @ stdcall IoGetCurrentProcess() +-@ stub IoGetDeviceAttachmentBaseRef ++@ stdcall IoGetDeviceAttachmentBaseRef(ptr) + @ stub IoGetDeviceInterfaceAlias + @ stdcall IoGetDeviceInterfaces(ptr ptr long ptr) + @ stdcall IoGetDeviceObjectPointer(ptr long ptr ptr) +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/ntoskrnl-Stubs/definition wine-staging-1.9.7~ubuntu15.04.1/patches/ntoskrnl-Stubs/definition --- wine-staging-1.9.6/patches/ntoskrnl-Stubs/definition 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/ntoskrnl-Stubs/definition 2016-04-04 18:23:50.000000000 +0000 @@ -10,3 +10,4 @@ Fixes: Add stub for ntoskrnl.Mm{Map,Unmap}LockedPages Fixes: Implement ntoskrnl.KeInitializeMutex Fixes: Add stub for ntoskrnl.PsRemoveLoadImageNotifyRoutine +Fixes: Add stub for ntoskrnl.IoGetDeviceAttachmentBaseRef diff -Nru wine-staging-1.9.6/patches/nvencodeapi-Video_Encoder/0001-nvencodeapi-First-implementation.patch wine-staging-1.9.7~ubuntu15.04.1/patches/nvencodeapi-Video_Encoder/0001-nvencodeapi-First-implementation.patch --- wine-staging-1.9.6/patches/nvencodeapi-Video_Encoder/0001-nvencodeapi-First-implementation.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/nvencodeapi-Video_Encoder/0001-nvencodeapi-First-implementation.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,4 +1,4 @@ -From e8580b7171ce93196fd703d6ed36387f133f8a85 Mon Sep 17 00:00:00 2001 +From 0822239b97314c586a3830968d755da6d0f27496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sun, 8 Feb 2015 06:10:26 +0100 Subject: nvencodeapi: First implementation. @@ -45,7 +45,7 @@ + nvencodeapi.c diff --git a/dlls/nvencodeapi/nvencodeapi.c b/dlls/nvencodeapi/nvencodeapi.c new file mode 100644 -index 0000000..7a0f531 +index 0000000..91a33fd --- /dev/null +++ b/dlls/nvencodeapi/nvencodeapi.c @@ -0,0 +1,370 @@ @@ -287,7 +287,7 @@ + +static NVENCSTATUS WINAPI NvEncInvalidateRefFrames(void *encoder, uint64_t invalidRefFrameTimeStamp) +{ -+ TRACE("(%p, %llu)\n", encoder, invalidRefFrameTimeStamp); ++ TRACE("(%p, %s)\n", encoder, wine_dbgstr_longlong(invalidRefFrameTimeStamp)); + return origFunctions.nvEncInvalidateRefFrames(encoder, invalidRefFrameTimeStamp); +} + @@ -445,10 +445,10 @@ @@ -0,0 +1 @@ +@ stdcall NvEncodeAPICreateInstance(ptr) diff --git a/include/Makefile.in b/include/Makefile.in -index 72443e8..bc9148d 100644 +index a0232cd..464b0e2 100644 --- a/include/Makefile.in +++ b/include/Makefile.in -@@ -482,6 +482,7 @@ SRCDIR_INCLUDES = \ +@@ -514,6 +514,7 @@ HEADER_SRCS = \ ntstatus.h \ nvapi.h \ nvcuvid.h \ @@ -744,5 +744,5 @@ + +#endif /* __WINE_NVENCODEAPI_H */ -- -2.2.2 +2.7.1 diff -Nru wine-staging-1.9.6/patches/oleaut32-OleLoadPictureFile/0001-oleaut32-Do-not-reimplement-OleLoadPicture-in-OleLoa.patch wine-staging-1.9.7~ubuntu15.04.1/patches/oleaut32-OleLoadPictureFile/0001-oleaut32-Do-not-reimplement-OleLoadPicture-in-OleLoa.patch --- wine-staging-1.9.6/patches/oleaut32-OleLoadPictureFile/0001-oleaut32-Do-not-reimplement-OleLoadPicture-in-OleLoa.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/oleaut32-OleLoadPictureFile/0001-oleaut32-Do-not-reimplement-OleLoadPicture-in-OleLoa.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,68 @@ +From 1d3c7baaddc652049995ffc1fbb41e3950dcd8dc Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Sun, 27 Mar 2016 12:30:00 +0800 +Subject: oleaut32: Do not reimplement OleLoadPicture in OleLoadPicturePath. + +punkCaller is ignored by StdPicture ClassFactory implementation anyway. +--- + dlls/oleaut32/olepicture.c | 27 +-------------------------- + 1 file changed, 1 insertion(+), 26 deletions(-) + +diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c +index 44157de..285afba 100644 +--- a/dlls/oleaut32/olepicture.c ++++ b/dlls/oleaut32/olepicture.c +@@ -2332,16 +2332,13 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller, + LPVOID *ppvRet ) + { + static const WCHAR file[] = { 'f','i','l','e',':',0 }; +- IPicture *ipicture; + HANDLE hFile; + DWORD dwFileSize; + HGLOBAL hGlobal = NULL; + DWORD dwBytesRead; + IStream *stream; + BOOL bRead; +- IPersistStream *pStream; + HRESULT hRes; +- HRESULT init_res; + WCHAR *file_candidate; + WCHAR path_buf[MAX_PATH]; + +@@ -2418,32 +2415,10 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller, + return hRes; + } + +- init_res = CoInitialize(NULL); +- +- hRes = CoCreateInstance(&CLSID_StdPicture, punkCaller, CLSCTX_INPROC_SERVER, +- &IID_IPicture, (LPVOID*)&ipicture); +- if (SUCCEEDED(hRes)) { +- hRes = IPicture_QueryInterface(ipicture, &IID_IPersistStream, (LPVOID*)&pStream); +- +- if (SUCCEEDED(hRes)) { +- hRes = IPersistStream_Load(pStream, stream); +- +- if (SUCCEEDED(hRes)) { +- hRes = IPicture_QueryInterface(ipicture, riid, ppvRet); +- +- if (FAILED(hRes)) +- ERR("Failed to get interface %s from IPicture.\n", debugstr_guid(riid)); +- } +- IPersistStream_Release(pStream); +- } +- IPicture_Release(ipicture); +- } ++ hRes = OleLoadPicture(stream, 0, FALSE, riid, ppvRet); + + IStream_Release(stream); + +- if (SUCCEEDED(init_res)) +- CoUninitialize(); +- + return hRes; + } + +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/oleaut32-OleLoadPictureFile/0002-oleaut32-Factor-out-stream-creation-from-OleLoadPict.patch wine-staging-1.9.7~ubuntu15.04.1/patches/oleaut32-OleLoadPictureFile/0002-oleaut32-Factor-out-stream-creation-from-OleLoadPict.patch --- wine-staging-1.9.6/patches/oleaut32-OleLoadPictureFile/0002-oleaut32-Factor-out-stream-creation-from-OleLoadPict.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/oleaut32-OleLoadPictureFile/0002-oleaut32-Factor-out-stream-creation-from-OleLoadPict.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,114 @@ +From 5032303d405720a099c0279127148d2d6e278b7b Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Sun, 27 Mar 2016 16:26:47 +0800 +Subject: oleaut32: Factor out stream creation from OleLoadPicturePath. + +--- + dlls/oleaut32/olepicture.c | 75 +++++++++++++++++++++++++--------------------- + 1 file changed, 41 insertions(+), 34 deletions(-) + +diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c +index eeb3269..765711d 100644 +--- a/dlls/oleaut32/olepicture.c ++++ b/dlls/oleaut32/olepicture.c +@@ -2324,6 +2324,45 @@ HRESULT WINAPI OleLoadPictureFile(VARIANT file, LPDISPATCH *picture) + return E_NOTIMPL; + } + ++static HRESULT create_stream(const WCHAR *filename, IStream **stream) ++{ ++ HANDLE hFile; ++ DWORD dwFileSize; ++ HGLOBAL hGlobal = NULL; ++ DWORD dwBytesRead; ++ HRESULT hr = S_OK; ++ ++ hFile = CreateFileW(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); ++ if (hFile == INVALID_HANDLE_VALUE) ++ return HRESULT_FROM_WIN32(GetLastError()); ++ ++ dwFileSize = GetFileSize(hFile, NULL); ++ if (dwFileSize != INVALID_FILE_SIZE) ++ { ++ hGlobal = GlobalAlloc(GMEM_FIXED, dwFileSize); ++ if (!hGlobal) ++ hr = E_OUTOFMEMORY; ++ else ++ { ++ if (!ReadFile(hFile, hGlobal, dwFileSize, &dwBytesRead, NULL)) ++ { ++ GlobalFree(hGlobal); ++ hr = HRESULT_FROM_WIN32(GetLastError()); ++ } ++ } ++ } ++ ++ CloseHandle(hFile); ++ ++ if (FAILED(hr)) return hr; ++ ++ hr = CreateStreamOnHGlobal(hGlobal, TRUE, stream); ++ if (FAILED(hr)) ++ GlobalFree(hGlobal); ++ ++ return hr; ++} ++ + /*********************************************************************** + * OleSavePictureFile (OLEAUT32.423) + */ +@@ -2341,12 +2380,7 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller, + LPVOID *ppvRet ) + { + static const WCHAR file[] = { 'f','i','l','e',':',0 }; +- HANDLE hFile; +- DWORD dwFileSize; +- HGLOBAL hGlobal = NULL; +- DWORD dwBytesRead; + IStream *stream; +- BOOL bRead; + HRESULT hRes; + WCHAR *file_candidate; + WCHAR path_buf[MAX_PATH]; +@@ -2375,36 +2409,9 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller, + + /* Handle candidate DOS paths separately. */ + if (file_candidate[1] == ':') { +- hFile = CreateFileW(file_candidate, GENERIC_READ, 0, NULL, OPEN_EXISTING, +- 0, NULL); +- if (hFile == INVALID_HANDLE_VALUE) +- return INET_E_RESOURCE_NOT_FOUND; +- +- dwFileSize = GetFileSize(hFile, NULL); +- if (dwFileSize != INVALID_FILE_SIZE ) +- { +- hGlobal = GlobalAlloc(GMEM_FIXED,dwFileSize); +- if ( hGlobal) +- { +- bRead = ReadFile(hFile, hGlobal, dwFileSize, &dwBytesRead, NULL) && dwBytesRead == dwFileSize; +- if (!bRead) +- { +- GlobalFree(hGlobal); +- hGlobal = 0; +- } +- } +- } +- CloseHandle(hFile); +- +- if (!hGlobal) ++ hRes = create_stream(file_candidate, &stream); ++ if (FAILED(hRes)) + return INET_E_RESOURCE_NOT_FOUND; +- +- hRes = CreateStreamOnHGlobal(hGlobal, TRUE, &stream); +- if (FAILED(hRes)) +- { +- GlobalFree(hGlobal); +- return hRes; +- } + } else { + IMoniker *pmnk; + IBindCtx *pbc; +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/oleaut32-OleLoadPictureFile/0003-oleaut32-Implement-OleLoadPictureFile.patch wine-staging-1.9.7~ubuntu15.04.1/patches/oleaut32-OleLoadPictureFile/0003-oleaut32-Implement-OleLoadPictureFile.patch --- wine-staging-1.9.6/patches/oleaut32-OleLoadPictureFile/0003-oleaut32-Implement-OleLoadPictureFile.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/oleaut32-OleLoadPictureFile/0003-oleaut32-Implement-OleLoadPictureFile.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,172 @@ +From c5cb6a3fabbc59568fcd0794473b94ea61127a85 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Sun, 27 Mar 2016 16:28:33 +0800 +Subject: oleaut32: Implement OleLoadPictureFile. (v2) + +--- + dlls/oleaut32/olepicture.c | 36 ++++++++++++++++++++------- + dlls/oleaut32/tests/olepicture.c | 53 ++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 80 insertions(+), 9 deletions(-) + +diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c +index 765711d..29a091f 100644 +--- a/dlls/oleaut32/olepicture.c ++++ b/dlls/oleaut32/olepicture.c +@@ -2315,15 +2315,6 @@ HRESULT WINAPI OleLoadPictureEx( LPSTREAM lpstream, LONG lSize, BOOL fRunmode, + return hr; + } + +-/*********************************************************************** +- * OleLoadPictureFile (OLEAUT32.422) +- */ +-HRESULT WINAPI OleLoadPictureFile(VARIANT file, LPDISPATCH *picture) +-{ +- FIXME("(%s %p): stub\n", wine_dbgstr_variant(&file), picture); +- return E_NOTIMPL; +-} +- + static HRESULT create_stream(const WCHAR *filename, IStream **stream) + { + HANDLE hFile; +@@ -2364,6 +2355,33 @@ static HRESULT create_stream(const WCHAR *filename, IStream **stream) + } + + /*********************************************************************** ++ * OleLoadPictureFile (OLEAUT32.422) ++ */ ++HRESULT WINAPI OleLoadPictureFile(VARIANT filename, IDispatch **picture) ++{ ++ IStream *stream; ++ HRESULT hr; ++ ++ TRACE("(%s,%p)\n", wine_dbgstr_variant(&filename), picture); ++ ++ if (V_VT(&filename) != VT_BSTR) ++ return CTL_E_FILENOTFOUND; ++ ++ hr = create_stream(V_BSTR(&filename), &stream); ++ if (hr != S_OK) ++ { ++ if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) ++ return CTL_E_FILENOTFOUND; ++ ++ return CTL_E_PATHFILEACCESSERROR; ++ } ++ ++ hr = OleLoadPicture(stream, 0, FALSE, &IID_IDispatch, (void **)picture); ++ IStream_Release(stream); ++ return hr; ++} ++ ++/*********************************************************************** + * OleSavePictureFile (OLEAUT32.423) + */ + HRESULT WINAPI OleSavePictureFile(IDispatch *picture, BSTR filename) +diff --git a/dlls/oleaut32/tests/olepicture.c b/dlls/oleaut32/tests/olepicture.c +index 0903298..46cb185 100644 +--- a/dlls/oleaut32/tests/olepicture.c ++++ b/dlls/oleaut32/tests/olepicture.c +@@ -850,6 +850,7 @@ static void test_OleLoadPicturePath(void) + HANDLE file; + DWORD size; + WCHAR *ptr; ++ VARIANT var; + + const struct + { +@@ -916,6 +917,14 @@ static void test_OleLoadPicturePath(void) + if (pic) + IPicture_Release(pic); + ++ VariantInit(&var); ++ V_VT(&var) = VT_BSTR; ++ V_BSTR(&var) = SysAllocString(temp_fileW + 8); ++ hres = OleLoadPictureFile(var, (IDispatch **)&pic); ++ ok(hres == S_OK, "OleLoadPictureFile error %#x\n", hres); ++ IPicture_Release(pic); ++ VariantClear(&var); ++ + /* Try a DOS path with tacked on "file:". */ + hres = OleLoadPicturePath(temp_fileW, NULL, 0, 0, &IID_IPicture, (void **)&pic); + ok(hres == S_OK || +@@ -924,6 +933,13 @@ static void test_OleLoadPicturePath(void) + if (pic) + IPicture_Release(pic); + ++ VariantInit(&var); ++ V_VT(&var) = VT_BSTR; ++ V_BSTR(&var) = SysAllocString(temp_fileW); ++ hres = OleLoadPictureFile(var, (IDispatch **)&pic); ++ ok(hres == CTL_E_PATHFILEACCESSERROR, "wrong error %#x\n", hres); ++ VariantClear(&var); ++ + DeleteFileA(temp_file); + + /* Try with a nonexistent file. */ +@@ -933,12 +949,26 @@ static void test_OleLoadPicturePath(void) + broken(hres == E_FAIL), /*Win2k */ + "Expected OleLoadPicturePath to return INET_E_RESOURCE_NOT_FOUND, got 0x%08x\n", hres); + ++ VariantInit(&var); ++ V_VT(&var) = VT_BSTR; ++ V_BSTR(&var) = SysAllocString(temp_fileW + 8); ++ hres = OleLoadPictureFile(var, (IDispatch **)&pic); ++ ok(hres == CTL_E_FILENOTFOUND, "wrong error %#x\n", hres); ++ VariantClear(&var); ++ + hres = OleLoadPicturePath(temp_fileW, NULL, 0, 0, &IID_IPicture, (void **)&pic); + ok(hres == INET_E_RESOURCE_NOT_FOUND || /* XP+ */ + broken(hres == E_UNEXPECTED) || /* NT4 */ + broken(hres == E_FAIL), /* Win2k */ + "Expected OleLoadPicturePath to return INET_E_RESOURCE_NOT_FOUND, got 0x%08x\n", hres); + ++ VariantInit(&var); ++ V_VT(&var) = VT_BSTR; ++ V_BSTR(&var) = SysAllocString(temp_fileW); ++ hres = OleLoadPictureFile(var, (IDispatch **)&pic); ++ ok(hres == CTL_E_PATHFILEACCESSERROR, "wrong error %#x\n", hres); ++ VariantClear(&var); ++ + file = CreateFileA(temp_file, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, NULL); + WriteFile(file, bmpimage, sizeof(bmpimage), &size, NULL); +@@ -960,6 +990,13 @@ static void test_OleLoadPicturePath(void) + if (pic) + IPicture_Release(pic); + ++ VariantInit(&var); ++ V_VT(&var) = VT_BSTR; ++ V_BSTR(&var) = SysAllocString(temp_fileW); ++ hres = OleLoadPictureFile(var, (IDispatch **)&pic); ++ ok(hres == CTL_E_PATHFILEACCESSERROR, "wrong error %#x\n", hres); ++ VariantClear(&var); ++ + DeleteFileA(temp_file); + + /* Try with a nonexistent file. */ +@@ -968,6 +1005,22 @@ static void test_OleLoadPicturePath(void) + broken(hres == E_UNEXPECTED) || /* NT4 */ + broken(hres == E_FAIL), /* Win2k */ + "Expected OleLoadPicturePath to return INET_E_RESOURCE_NOT_FOUND, got 0x%08x\n", hres); ++ ++ VariantInit(&var); ++ V_VT(&var) = VT_BSTR; ++ V_BSTR(&var) = SysAllocString(temp_fileW); ++ hres = OleLoadPictureFile(var, (IDispatch **)&pic); ++ ok(hres == CTL_E_PATHFILEACCESSERROR, "wrong error %#x\n", hres); ++ VariantClear(&var); ++ ++ VariantInit(&var); ++ V_VT(&var) = VT_INT; ++ V_INT(&var) = 762; ++ hres = OleLoadPictureFile(var, (IDispatch **)&pic); ++ ok(hres == CTL_E_FILENOTFOUND, "wrong error %#x\n", hres); ++ ++if (0) /* crashes under Windows */ ++ hres = OleLoadPictureFile(var, NULL); + } + + static void test_himetric(void) +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/oleaut32-OleLoadPictureFile/definition wine-staging-1.9.7~ubuntu15.04.1/patches/oleaut32-OleLoadPictureFile/definition --- wine-staging-1.9.6/patches/oleaut32-OleLoadPictureFile/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/oleaut32-OleLoadPictureFile/definition 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1 @@ +Fixes: Implement oleaut32.OleLoadPictureFile diff -Nru wine-staging-1.9.6/patches/patchinstall.sh wine-staging-1.9.7~ubuntu15.04.1/patches/patchinstall.sh --- wine-staging-1.9.6/patches/patchinstall.sh 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/patchinstall.sh 2016-04-04 18:23:50.000000000 +0000 @@ -51,13 +51,13 @@ # Get the upstream commit sha upstream_commit() { - echo "6bc0ce26a853b51f11958545bfa5570bdcb1cf01" + echo "442e60b7e4c010e6622d524f47a2dd0d26ba19d4" } # Show version information version() { - echo "Wine Staging 1.9.6" + echo "Wine Staging 1.9.7" echo "Copyright (C) 2014-2016 the Wine Staging project authors." echo "" echo "Patchset to be applied on upstream Wine:" @@ -86,6 +86,7 @@ enable_Pipelight="$1" enable_Staging="$1" enable_advapi32_LsaLookupSids="$1" + enable_advapi32_RegNotifyChangeKeyValue="$1" enable_advapi32_SetSecurityInfo="$1" enable_amstream_GetMultiMediaStream="$1" enable_api_ms_win_Stub_DLLs="$1" @@ -132,7 +133,6 @@ enable_ddraw_Rendering_Targets="$1" enable_ddraw_Write_Vtable="$1" enable_ddraw_d3d_execute_buffer="$1" - enable_dinput_DIPROP_USERNAME="$1" enable_dinput_Initialize="$1" enable_dsound_DSCAPS_CERTIFIED="$1" enable_dsound_EAX="$1" @@ -146,6 +146,7 @@ enable_dxva2_Video_Decoder="$1" enable_explorer_Video_Registry_Key="$1" enable_fonts_Missing_Fonts="$1" + enable_fsutil_Stub_Program="$1" enable_gdi32_Lazy_Font_Initialization="$1" enable_gdi32_MultiMonitor="$1" enable_gdi32_Path_Metafile="$1" @@ -164,14 +165,11 @@ enable_iphlpapi_TCP_Table="$1" enable_kernel32_COMSPEC="$1" enable_kernel32_CopyFileEx="$1" - enable_kernel32_CreateFileA="$1" enable_kernel32_Cwd_Startup_Info="$1" - enable_kernel32_ERROR_DLL_NOT_FOUND="$1" enable_kernel32_FindFirstFile="$1" enable_kernel32_FreeUserPhysicalPages="$1" enable_kernel32_GetCurrentPackageFamilyName="$1" enable_kernel32_GetFinalPathNameByHandle="$1" - enable_kernel32_GetOverlappedResult="$1" enable_kernel32_LocaleNameToLCID="$1" enable_kernel32_Named_Pipe="$1" enable_kernel32_NeedCurrentDirectoryForExePath="$1" @@ -186,7 +184,6 @@ enable_libs_Debug_Channel="$1" enable_libs_Unicode_Collation="$1" enable_makedep_PARENTSPEC="$1" - enable_makefiles_Revert_libwine_Import="$1" enable_mfplat_MFTRegister="$1" enable_mmsystem_dll16_MIDIHDR_Refcount="$1" enable_mountmgr_DosDevices="$1" @@ -197,6 +194,8 @@ enable_msidb_Implementation="$1" enable_msvcr120__SetWinRTOutOfMemoryExceptionCallback="$1" enable_msvcrt_Math_Precision="$1" + enable_msvfw32_ICGetDisplayFormat="$1" + enable_msvidc32_Convert_Bitness="$1" enable_ntdll_APC_Performance="$1" enable_ntdll_APC_Start_Process="$1" enable_ntdll_Activation_Context="$1" @@ -232,6 +231,7 @@ enable_ntdll_RtlIpStringToAddress_Tests="$1" enable_ntdll_RtlQueryPackageIdentity="$1" enable_ntdll_Serial_Port_Detection="$1" + enable_ntdll_Stack_Guard_Pages="$1" enable_ntdll_Status_Mapping="$1" enable_ntdll_Syscall_Wrappers="$1" enable_ntdll_SystemInterruptInformation="$1" @@ -255,6 +255,7 @@ enable_ole32_HGLOBALStream="$1" enable_oleaut32_CreateTypeLib="$1" enable_oleaut32_OLEPictureImpl_SaveAsFile="$1" + enable_oleaut32_OleLoadPictureFile="$1" enable_oleaut32_TKIND_COCLASS="$1" enable_oleaut32_x86_64_Marshaller="$1" enable_openal32_EFX_Extension="$1" @@ -291,10 +292,10 @@ enable_setupapi_DiskSpaceList="$1" enable_setupapi_Display_Device="$1" enable_setupapi_HSPFILEQ_Check_Type="$1" - enable_setupapi_SetupDiSetDeviceInstallParamsW="$1" enable_setupapi_SetupPromptForDisk="$1" enable_sfc_SfcGetNextProtectedFile="$1" enable_shdocvw_ParseURLFromOutsideSource_Tests="$1" + enable_shell32_Context_Menu="$1" enable_shell32_Default_Path="$1" enable_shell32_File_Property_Dialog="$1" enable_shell32_FolderItems_Stub_Iface="$1" @@ -314,16 +315,20 @@ enable_shell32_UNIXFS_get_unix_path="$1" enable_shell32_UnixFS="$1" enable_shlwapi_AssocGetPerceivedType="$1" + enable_shlwapi_IStream_fnRead="$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_user_exe16_CONTAINING_RECORD="$1" enable_user_exe16_DlgDirList="$1" enable_user32_DeferWindowPos="$1" + enable_user32_Dialog_Owner="$1" enable_user32_Dialog_Paint_Event="$1" enable_user32_DrawTextExW="$1" + enable_user32_FlashWindowEx="$1" enable_user32_GetSystemMetrics="$1" enable_user32_Invalidate_Key_State="$1" enable_user32_ListBox_Size="$1" @@ -345,7 +350,9 @@ enable_wbemdisp_ISWbemSecurity="$1" enable_widl_SLTG_Typelib_Support="$1" enable_windowscodecs_32bppGrayFloat="$1" + enable_windowscodecs_IMILBitmapSource="$1" enable_windowscodecs_WICCreateBitmapFromSection="$1" + enable_wine_inf_Directory_ContextMenuHandlers="$1" enable_wine_inf_Dummy_CA_Certificate="$1" enable_wine_inf_Performance="$1" enable_wine_inf_ProfileList_UserSID="$1" @@ -370,7 +377,7 @@ enable_winex11_CandidateWindowPos="$1" enable_winex11_Clipboard_HTML="$1" enable_winex11_DefaultDisplayFrequency="$1" - enable_winex11_MONITORENUMPROC="$1" + enable_winex11_Desktop_Resolution="$1" enable_winex11_Window_Groups="$1" enable_winex11_Window_Style="$1" enable_winex11_XEMBED="$1" @@ -383,9 +390,9 @@ enable_wininet_ParseX509EncodedCertificateForListBoxEntry="$1" enable_winmm_Delay_Import_Depends="$1" enable_winmm_mciSendCommandA="$1" - enable_winscard_SCardListReaders="$1" enable_winspool_drv_SetPrinterW="$1" enable_winsta_WinStationEnumerateW="$1" + enable_wintrust_WinVerifyTrust="$1" enable_wpcap_Dynamic_Linking="$1" enable_wpcap_Several_Fixes="$1" enable_ws2_32_APC_Performance="$1" @@ -428,6 +435,9 @@ advapi32-LsaLookupSids) enable_advapi32_LsaLookupSids="$2" ;; + advapi32-RegNotifyChangeKeyValue) + enable_advapi32_RegNotifyChangeKeyValue="$2" + ;; advapi32-SetSecurityInfo) enable_advapi32_SetSecurityInfo="$2" ;; @@ -569,9 +579,6 @@ ddraw-d3d_execute_buffer) enable_ddraw_d3d_execute_buffer="$2" ;; - dinput-DIPROP_USERNAME) - enable_dinput_DIPROP_USERNAME="$2" - ;; dinput-Initialize) enable_dinput_Initialize="$2" ;; @@ -611,6 +618,9 @@ fonts-Missing_Fonts) enable_fonts_Missing_Fonts="$2" ;; + fsutil-Stub_Program) + enable_fsutil_Stub_Program="$2" + ;; gdi32-Lazy_Font_Initialization) enable_gdi32_Lazy_Font_Initialization="$2" ;; @@ -665,15 +675,9 @@ kernel32-CopyFileEx) enable_kernel32_CopyFileEx="$2" ;; - kernel32-CreateFileA) - enable_kernel32_CreateFileA="$2" - ;; kernel32-Cwd_Startup_Info) enable_kernel32_Cwd_Startup_Info="$2" ;; - kernel32-ERROR_DLL_NOT_FOUND) - enable_kernel32_ERROR_DLL_NOT_FOUND="$2" - ;; kernel32-FindFirstFile) enable_kernel32_FindFirstFile="$2" ;; @@ -686,9 +690,6 @@ kernel32-GetFinalPathNameByHandle) enable_kernel32_GetFinalPathNameByHandle="$2" ;; - kernel32-GetOverlappedResult) - enable_kernel32_GetOverlappedResult="$2" - ;; kernel32-LocaleNameToLCID) enable_kernel32_LocaleNameToLCID="$2" ;; @@ -731,9 +732,6 @@ makedep-PARENTSPEC) enable_makedep_PARENTSPEC="$2" ;; - makefiles-Revert_libwine_Import) - enable_makefiles_Revert_libwine_Import="$2" - ;; mfplat-MFTRegister) enable_mfplat_MFTRegister="$2" ;; @@ -764,6 +762,12 @@ msvcrt-Math_Precision) enable_msvcrt_Math_Precision="$2" ;; + msvfw32-ICGetDisplayFormat) + enable_msvfw32_ICGetDisplayFormat="$2" + ;; + msvidc32-Convert_Bitness) + enable_msvidc32_Convert_Bitness="$2" + ;; ntdll-APC_Performance) enable_ntdll_APC_Performance="$2" ;; @@ -869,6 +873,9 @@ ntdll-Serial_Port_Detection) enable_ntdll_Serial_Port_Detection="$2" ;; + ntdll-Stack_Guard_Pages) + enable_ntdll_Stack_Guard_Pages="$2" + ;; ntdll-Status_Mapping) enable_ntdll_Status_Mapping="$2" ;; @@ -938,6 +945,9 @@ oleaut32-OLEPictureImpl_SaveAsFile) enable_oleaut32_OLEPictureImpl_SaveAsFile="$2" ;; + oleaut32-OleLoadPictureFile) + enable_oleaut32_OleLoadPictureFile="$2" + ;; oleaut32-TKIND_COCLASS) enable_oleaut32_TKIND_COCLASS="$2" ;; @@ -1046,9 +1056,6 @@ setupapi-HSPFILEQ_Check_Type) enable_setupapi_HSPFILEQ_Check_Type="$2" ;; - setupapi-SetupDiSetDeviceInstallParamsW) - enable_setupapi_SetupDiSetDeviceInstallParamsW="$2" - ;; setupapi-SetupPromptForDisk) enable_setupapi_SetupPromptForDisk="$2" ;; @@ -1058,6 +1065,9 @@ shdocvw-ParseURLFromOutsideSource_Tests) enable_shdocvw_ParseURLFromOutsideSource_Tests="$2" ;; + shell32-Context_Menu) + enable_shell32_Context_Menu="$2" + ;; shell32-Default_Path) enable_shell32_Default_Path="$2" ;; @@ -1115,6 +1125,9 @@ shlwapi-AssocGetPerceivedType) enable_shlwapi_AssocGetPerceivedType="$2" ;; + shlwapi-IStream_fnRead) + enable_shlwapi_IStream_fnRead="$2" + ;; shlwapi-SHMapHandle) enable_shlwapi_SHMapHandle="$2" ;; @@ -1133,18 +1146,27 @@ ucrtbase-Functions) enable_ucrtbase_Functions="$2" ;; + user.exe16-CONTAINING_RECORD) + enable_user_exe16_CONTAINING_RECORD="$2" + ;; user.exe16-DlgDirList) enable_user_exe16_DlgDirList="$2" ;; user32-DeferWindowPos) enable_user32_DeferWindowPos="$2" ;; + user32-Dialog_Owner) + enable_user32_Dialog_Owner="$2" + ;; user32-Dialog_Paint_Event) enable_user32_Dialog_Paint_Event="$2" ;; user32-DrawTextExW) enable_user32_DrawTextExW="$2" ;; + user32-FlashWindowEx) + enable_user32_FlashWindowEx="$2" + ;; user32-GetSystemMetrics) enable_user32_GetSystemMetrics="$2" ;; @@ -1208,9 +1230,15 @@ windowscodecs-32bppGrayFloat) enable_windowscodecs_32bppGrayFloat="$2" ;; + windowscodecs-IMILBitmapSource) + enable_windowscodecs_IMILBitmapSource="$2" + ;; windowscodecs-WICCreateBitmapFromSection) enable_windowscodecs_WICCreateBitmapFromSection="$2" ;; + wine.inf-Directory_ContextMenuHandlers) + enable_wine_inf_Directory_ContextMenuHandlers="$2" + ;; wine.inf-Dummy_CA_Certificate) enable_wine_inf_Dummy_CA_Certificate="$2" ;; @@ -1283,8 +1311,8 @@ winex11-DefaultDisplayFrequency) enable_winex11_DefaultDisplayFrequency="$2" ;; - winex11-MONITORENUMPROC) - enable_winex11_MONITORENUMPROC="$2" + winex11-Desktop_Resolution) + enable_winex11_Desktop_Resolution="$2" ;; winex11-Window_Groups) enable_winex11_Window_Groups="$2" @@ -1322,15 +1350,15 @@ winmm-mciSendCommandA) enable_winmm_mciSendCommandA="$2" ;; - winscard-SCardListReaders) - enable_winscard_SCardListReaders="$2" - ;; winspool.drv-SetPrinterW) enable_winspool_drv_SetPrinterW="$2" ;; winsta-WinStationEnumerateW) enable_winsta_WinStationEnumerateW="$2" ;; + wintrust-WinVerifyTrust) + enable_wintrust_WinVerifyTrust="$2" + ;; wpcap-Dynamic_Linking) enable_wpcap_Dynamic_Linking="$2" ;; @@ -1852,9 +1880,6 @@ if test "$enable_server_CreateProcess_ACLs" -gt 1; then abort "Patchset server-CreateProcess_ACLs disabled, but category-stable depends on that." fi - if test "$enable_setupapi_SetupDiSetDeviceInstallParamsW" -gt 1; then - abort "Patchset setupapi-SetupDiSetDeviceInstallParamsW disabled, but category-stable depends on that." - fi if test "$enable_shell32_RunDLL_CallEntry16" -gt 1; then abort "Patchset shell32-RunDLL_CallEntry16 disabled, but category-stable depends on that." fi @@ -1952,7 +1977,6 @@ enable_opengl32_Revert_Disable_Ext=1 enable_server_ClipCursor=1 enable_server_CreateProcess_ACLs=1 - enable_setupapi_SetupDiSetDeviceInstallParamsW=1 enable_shell32_RunDLL_CallEntry16=1 enable_shell32_SHFileOperation_Win9x=1 enable_user32_DrawTextExW=1 @@ -2374,13 +2398,42 @@ # Patchset Compiler_Warnings # | # | Modified files: -# | * dlls/d3d9/tests/visual.c, dlls/netapi32/netapi32.c, dlls/winealsa.drv/mmdevdrv.c, dlls/wined3d/glsl_shader.c, +# | * dlls/amstream/mediastreamfilter.c, dlls/d2d1/brush.c, dlls/d2d1/geometry.c, dlls/d3d11/view.c, dlls/d3d8/texture.c, +# | dlls/d3d9/tests/visual.c, dlls/d3d9/texture.c, dlls/ddraw/viewport.c, dlls/dsound/primary.c, dlls/dwrite/layout.c, +# | dlls/msxml3/schema.c, dlls/netapi32/netapi32.c, dlls/oleaut32/oleaut.c, dlls/rpcrt4/cstub.c, dlls/vbscript/vbdisp.c, +# | dlls/winealsa.drv/mmdevdrv.c, dlls/wined3d/glsl_shader.c, include/wine/list.h, include/wine/rbtree.h, include/winnt.h, # | tools/makedep.c # | if test "$enable_Compiler_Warnings" -eq 1; then patch_apply Compiler_Warnings/0001-Appease-the-blessed-version-of-gcc-4.5-when-Werror-i.patch + patch_apply Compiler_Warnings/0002-dsound-Avoid-implicit-cast-of-interface-pointer.patch + patch_apply Compiler_Warnings/0003-amstream-Avoid-implicit-cast-of-interface-pointer.patch + patch_apply Compiler_Warnings/0004-d2d1-Avoid-implicit-cast-of-interface-pointer.patch + patch_apply Compiler_Warnings/0005-d3d11-Avoid-implicit-cast-of-interface-pointer.patch + patch_apply Compiler_Warnings/0006-d3d8-Avoid-implicit-cast-of-interface-pointer.patch + patch_apply Compiler_Warnings/0007-d3d9-Avoid-implicit-cast-of-interface-pointer.patch + patch_apply Compiler_Warnings/0008-ddraw-Avoid-implicit-cast-of-interface-pointer.patch + patch_apply Compiler_Warnings/0009-dwrite-Avoid-implicit-cast-of-interface-pointer.patch + patch_apply Compiler_Warnings/0010-msxml3-Avoid-implicit-cast-of-interface-pointer.patch + patch_apply Compiler_Warnings/0011-oleaut32-Avoid-implicit-cast-of-interface-pointer.patch + patch_apply Compiler_Warnings/0012-rpcrt4-Avoid-implicit-cast-of-interface-pointer.patch + patch_apply Compiler_Warnings/0013-vbscript-Avoid-implicit-cast-of-interface-pointer.patch + patch_apply Compiler_Warnings/0014-include-Check-element-type-in-CONTAINING_RECORD-and-.patch ( echo '+ { "Erich E. Hoover", "Appease the blessed version of gcc (4.5) when -Werror is enabled.", 1 },'; + echo '+ { "Sebastian Lackner", "dsound: Avoid implicit cast of interface pointer.", 1 },'; + echo '+ { "Sebastian Lackner", "amstream: Avoid implicit cast of interface pointer.", 1 },'; + echo '+ { "Sebastian Lackner", "d2d1: Avoid implicit cast of interface pointer.", 1 },'; + echo '+ { "Sebastian Lackner", "d3d11: Avoid implicit cast of interface pointer.", 1 },'; + echo '+ { "Sebastian Lackner", "d3d8: Avoid implicit cast of interface pointer.", 1 },'; + echo '+ { "Sebastian Lackner", "d3d9: Avoid implicit cast of interface pointer.", 1 },'; + echo '+ { "Sebastian Lackner", "ddraw: Avoid implicit cast of interface pointer.", 1 },'; + echo '+ { "Sebastian Lackner", "dwrite: Avoid implicit cast of interface pointer.", 1 },'; + echo '+ { "Sebastian Lackner", "msxml3: Avoid implicit cast of interface pointer.", 1 },'; + echo '+ { "Sebastian Lackner", "oleaut32: Avoid implicit cast of interface pointer.", 1 },'; + echo '+ { "Sebastian Lackner", "rpcrt4: Avoid implicit cast of interface pointer.", 1 },'; + echo '+ { "Sebastian Lackner", "vbscript: Avoid implicit cast of interface pointer.", 1 },'; + echo '+ { "Sebastian Lackner", "include: Check element type in CONTAINING_RECORD and similar macros.", 1 },'; ) >> "$patchlist" fi @@ -2501,6 +2554,21 @@ ) >> "$patchlist" fi +# Patchset advapi32-RegNotifyChangeKeyValue +# | +# | This patchset fixes the following Wine bugs: +# | * [#39863] Fix return value of RegNotifyChangeKeyValue for pending events +# | +# | Modified files: +# | * dlls/advapi32/registry.c, dlls/advapi32/tests/registry.c +# | +if test "$enable_advapi32_RegNotifyChangeKeyValue" -eq 1; then + patch_apply advapi32-RegNotifyChangeKeyValue/0001-advapi32-Fix-return-value-of-RegNotifyChangeKeyValue.patch + ( + echo '+ { "Sebastian Lackner", "advapi32: Fix return value of RegNotifyChangeKeyValue for pending events.", 1 },'; + ) >> "$patchlist" +fi + # Patchset advapi32-SetSecurityInfo # | # | This patchset fixes the following Wine bugs: @@ -2571,7 +2639,7 @@ # | * [#39543] Add stub kernel32.FreeUserPhysicalPages # | # | Modified files: -# | * dlls/kernel32/heap.c, dlls/kernel32/kernel32.spec +# | * dlls/api-ms-win-core-memory-l1-1-2/api-ms-win-core-memory-l1-1-2.spec, dlls/kernel32/heap.c, dlls/kernel32/kernel32.spec # | if test "$enable_kernel32_FreeUserPhysicalPages" -eq 1; then patch_apply kernel32-FreeUserPhysicalPages/0001-kernel32-add-FreeUserPhysicalPages-stub-try-2.patch @@ -2599,7 +2667,8 @@ # | # | Modified files: # | * dlls/api-ms-win-core-file-l1-1-0/api-ms-win-core-file-l1-1-0.spec, dlls/api-ms-win-core-file-l1-2-0/api-ms-win-core- -# | file-l1-2-0.spec, dlls/kernel32/file.c, dlls/kernel32/kernel32.spec +# | file-l1-2-0.spec, dlls/api-ms-win-core-file-l1-2-1/api-ms-win-core-file-l1-2-1.spec, dlls/kernel32/file.c, +# | dlls/kernel32/kernel32.spec, dlls/kernelbase/kernelbase.spec # | if test "$enable_kernel32_GetFinalPathNameByHandle" -eq 1; then patch_apply kernel32-GetFinalPathNameByHandle/0001-kernel32-Implement-GetFinalPathNameByHandle.patch @@ -3375,21 +3444,6 @@ ) >> "$patchlist" fi -# Patchset dinput-DIPROP_USERNAME -# | -# | This patchset fixes the following Wine bugs: -# | * [#39667] Implement dinput device property DIPROP_USERNAME -# | -# | Modified files: -# | * dlls/dinput/device.c, dlls/dinput/device_private.h, dlls/dinput8/tests/device.c -# | -if test "$enable_dinput_DIPROP_USERNAME" -eq 1; then - patch_apply dinput-DIPROP_USERNAME/0001-dinput-Implement-device-property-DIPROP_USERNAME.patch - ( - echo '+ { "Bernhard Übelacker", "dinput: Implement device property DIPROP_USERNAME.", 1 },'; - ) >> "$patchlist" -fi - # Patchset dinput-Initialize # | # | This patchset fixes the following Wine bugs: @@ -3672,6 +3726,22 @@ ) >> "$patchlist" fi +# Patchset fsutil-Stub_Program +# | +# | This patchset fixes the following Wine bugs: +# | * [#22749] Add stub for fsutil.exe hardlink command +# | +# | Modified files: +# | * configure.ac, programs/fsutil/Makefile.in, programs/fsutil/fsutil.rc, programs/fsutil/main.c, +# | programs/fsutil/resources.h +# | +if test "$enable_fsutil_Stub_Program" -eq 1; then + patch_apply fsutil-Stub_Program/0001-fsutil-Add-fsutil-program-with-support-for-creating-.patch + ( + echo '+ { "Michael Müller", "fsutil: Add fsutil program with support for creating hard links.", 1 },'; + ) >> "$patchlist" +fi + # Patchset gdi32-Lazy_Font_Initialization # | # | Modified files: @@ -4001,18 +4071,6 @@ ) >> "$patchlist" fi -# Patchset kernel32-CreateFileA -# | -# | Modified files: -# | * dlls/kernel32/file.c -# | -if test "$enable_kernel32_CreateFileA" -eq 1; then - patch_apply kernel32-CreateFileA/0001-kernel32-Check-for-invalid-filename-pointers-in-Crea.patch - ( - echo '+ { "Michael Müller", "kernel32: Check for invalid filename pointers in CreateFileA in Win 9X mode.", 1 },'; - ) >> "$patchlist" -fi - # Patchset kernel32-Cwd_Startup_Info # | # | Modified files: @@ -4025,18 +4083,6 @@ ) >> "$patchlist" fi -# Patchset kernel32-ERROR_DLL_NOT_FOUND -# | -# | Modified files: -# | * dlls/kernel32/module.c -# | -if test "$enable_kernel32_ERROR_DLL_NOT_FOUND" -eq 1; then - patch_apply kernel32-ERROR_DLL_NOT_FOUND/0001-kernel32-Set-ERROR_DLL_NOT_FOUND-as-error-code-for-W.patch - ( - echo '+ { "Michael Müller", "kernel32: Set ERROR_DLL_NOT_FOUND as error code for Win 9X instead of ERROR_MOD_NOT_FOUND.", 1 },'; - ) >> "$patchlist" -fi - # Patchset kernel32-FindFirstFile # | # | This patchset fixes the following Wine bugs: @@ -4054,18 +4100,6 @@ ) >> "$patchlist" fi -# Patchset kernel32-GetOverlappedResult -# | -# | Modified files: -# | * dlls/kernel32/file.c, dlls/kernel32/tests/file.c -# | -if test "$enable_kernel32_GetOverlappedResult" -eq 1; then - patch_apply kernel32-GetOverlappedResult/0001-kernel32-Fix-handling-of-GetOverlappedResult-when-st.patch - ( - echo '+ { "Sebastian Lackner", "kernel32: Fix handling of GetOverlappedResult when status remains STATUS_PENDING.", 1 },'; - ) >> "$patchlist" -fi - # Patchset kernel32-LocaleNameToLCID # | # | This patchset fixes the following Wine bugs: @@ -4360,38 +4394,38 @@ ) >> "$patchlist" fi -# Patchset makefiles-Revert_libwine_Import -# | -# | Modified files: -# | * tools/makedep.c -# | -if test "$enable_makefiles_Revert_libwine_Import" -eq 1; then - patch_apply makefiles-Revert_libwine_Import/0001-Revert-makefiles-Explicitly-import-libwine-only-for-.patch - ( - echo '+ { "Erich E. Hoover", "Revert \"makefiles: Explicitly import libwine only for Windows builds.\".", 1 },'; - ) >> "$patchlist" -fi - # Patchset mfplat-MFTRegister # | # | This patchset fixes the following Wine bugs: # | * [#37811] Add implementation for mfplat.MFTRegister # | * [#39309] Add implementation for mfplat.MFTEnum +# | * [#39367] Return stub interface from mf.MFCreateMediaSession # | # | Modified files: -# | * configure.ac, dlls/mfplat/Makefile.in, dlls/mfplat/main.c, dlls/mfplat/mfplat.spec, dlls/mfplat/tests/Makefile.in, -# | dlls/mfplat/tests/mfplat.c, loader/wine.inf.in +# | * configure.ac, dlls/mf/Makefile.in, dlls/mf/main.c, dlls/mf/mf.spec, dlls/mf/mf_private.h, dlls/mf/session.c, +# | dlls/mfplat/Makefile.in, dlls/mfplat/main.c, dlls/mfplat/mfplat.spec, dlls/mfplat/tests/Makefile.in, +# | dlls/mfplat/tests/mfplat.c, include/Makefile.in, include/mfidl.idl, include/rpcndr.h, loader/wine.inf.in # | if test "$enable_mfplat_MFTRegister" -eq 1; then patch_apply mfplat-MFTRegister/0001-mfplat-Implement-MFTRegister.patch patch_apply mfplat-MFTRegister/0002-mfplat-Implement-MFTUnregister.patch patch_apply mfplat-MFTRegister/0003-mfplat-Implement-MFTEnum.patch patch_apply mfplat-MFTRegister/0004-mfplat-tests-Add-tests.patch + patch_apply mfplat-MFTRegister/0005-include-mfidl.idl-Add-IMFMediaSession-interface-and-.patch + patch_apply mfplat-MFTRegister/0006-mf-Add-stub-for-MFCreateMediaSession.patch + patch_apply mfplat-MFTRegister/0007-include-rpcndr.h-Fix-definition-of-EXTERN_GUID.patch + patch_apply mfplat-MFTRegister/0008-mf-Implement-IMFMediaSession-stub-interface.patch + patch_apply mfplat-MFTRegister/0009-mfplat-Add-stub-for-MFCreateSourceResolver.patch ( echo '+ { "Michael Müller", "mfplat: Implement MFTRegister.", 2 },'; echo '+ { "Michael Müller", "mfplat: Implement MFTUnregister.", 1 },'; echo '+ { "Michael Müller", "mfplat: Implement MFTEnum.", 1 },'; echo '+ { "Michael Müller", "mfplat/tests: Add tests.", 1 },'; + echo '+ { "Michael Müller", "include/mfidl.idl: Add IMFMediaSession interface and dependencies.", 1 },'; + echo '+ { "Michael Müller", "mf: Add stub for MFCreateMediaSession.", 1 },'; + echo '+ { "Michael Müller", "include/rpcndr.h: Fix definition of EXTERN_GUID.", 1 },'; + echo '+ { "Michael Müller", "mf: Implement IMFMediaSession stub interface.", 1 },'; + echo '+ { "Michael Müller", "mfplat: Add stub for MFCreateSourceResolver.", 1 },'; ) >> "$patchlist" fi @@ -4548,6 +4582,41 @@ ) >> "$patchlist" fi +# Patchset msvfw32-ICGetDisplayFormat +# | +# | This patchset fixes the following Wine bugs: +# | * [#23175] Fix implementation of ICGetDisplayFormat +# | * [#25180] Fix rendering of Clonk Endeavour's intro video +# | +# | Modified files: +# | * dlls/msvfw32/msvideo_main.c, dlls/msvfw32/tests/msvfw.c +# | +if test "$enable_msvfw32_ICGetDisplayFormat" -eq 1; then + patch_apply msvfw32-ICGetDisplayFormat/0001-msvfw32-Try-different-formarts-in-ICGetDisplayFormat.patch + patch_apply msvfw32-ICGetDisplayFormat/0002-msvfw32-Add-test-for-negative-width-height-values-pa.patch + patch_apply msvfw32-ICGetDisplayFormat/0003-msvfw32-Set-biSizeImage-correctly-in-ICGetDisplayFor.patch + ( + echo '+ { "Michael Müller", "msvfw32: Try different formarts in ICGetDisplayFormat.", 1 },'; + echo '+ { "Michael Müller", "msvfw32: Add test for negative width/height values passed to ICGetDisplayFormat.", 1 },'; + echo '+ { "Michael Müller", "msvfw32: Set biSizeImage correctly in ICGetDisplayFormat.", 1 },'; + ) >> "$patchlist" +fi + +# Patchset msvidc32-Convert_Bitness +# | +# | This patchset fixes the following Wine bugs: +# | * [#14695] Implement support for converting 16 bit depth to 24 bit in msvidc32 +# | +# | Modified files: +# | * dlls/msvfw32/tests/msvfw.c, dlls/msvidc32/msvideo1.c +# | +if test "$enable_msvidc32_Convert_Bitness" -eq 1; then + patch_apply msvidc32-Convert_Bitness/0001-msvidc32-Add-support-for-converting-16-bit-depth-to-.patch + ( + echo '+ { "Michael Müller", "msvidc32: Add support for converting 16 bit depth to 24 bit.", 1 },'; + ) >> "$patchlist" +fi + # Patchset ntdll-APC_Performance # | # | Modified files: @@ -4652,14 +4721,12 @@ patch_apply ntdll-Syscall_Wrappers/0003-ntdll-APCs-should-call-the-implementation-instead-of.patch patch_apply ntdll-Syscall_Wrappers/0004-ntdll-Syscalls-should-not-call-Nt-Ex-thunk-wrappers.patch patch_apply ntdll-Syscall_Wrappers/0005-ntdll-Run-directory-initialization-function-early-du.patch - patch_apply ntdll-Syscall_Wrappers/0006-ntdll-Use-close_handle-instead-of-NtClose-for-intern.patch ( echo '+ { "Sebastian Lackner", "winegcc: Pass '\''-read_only_relocs suppress'\'' to the linker on OSX.", 1 },'; echo '+ { "Sebastian Lackner", "ntdll: Use wrapper functions for syscalls.", 1 },'; echo '+ { "Sebastian Lackner", "ntdll: APCs should call the implementation instead of the syscall thunk.", 1 },'; echo '+ { "Sebastian Lackner", "ntdll: Syscalls should not call Nt*Ex thunk wrappers.", 1 },'; echo '+ { "Sebastian Lackner", "ntdll: Run directory initialization function early during the process startup.", 1 },'; - echo '+ { "Sebastian Lackner", "ntdll: Use close_handle instead of NtClose for internal memory management functions.", 1 },'; ) >> "$patchlist" fi @@ -5102,6 +5169,18 @@ ) >> "$patchlist" fi +# Patchset ntdll-Stack_Guard_Pages +# | +# | Modified files: +# | * dlls/ntdll/signal_x86_64.c +# | +if test "$enable_ntdll_Stack_Guard_Pages" -eq 1; then + patch_apply ntdll-Stack_Guard_Pages/0001-ntdll-Handle-stack-guard-pages-on-x86_64.patch + ( + echo '+ { "Sebastian Lackner", "ntdll: Handle stack guard pages on x86_64.", 1 },'; + ) >> "$patchlist" +fi + # Patchset ntdll-Status_Mapping # | # | Modified files: @@ -5356,6 +5435,7 @@ patch_apply ntoskrnl-Stubs/0010-ntoskrnl.exe-Implement-MmMapLockedPages-and-MmUnmapL.patch patch_apply ntoskrnl-Stubs/0011-ntoskrnl.exe-Implement-KeInitializeMutex.patch patch_apply ntoskrnl-Stubs/0012-ntoskrnl.exe-Add-stub-for-PsRemoveLoadImageNotifyRou.patch + patch_apply ntoskrnl-Stubs/0013-ntoskrnl.exe-Add-IoGetDeviceAttachmentBaseRef-stub.patch ( echo '+ { "Austin English", "ntoskrnl.exe: Add KeWaitForMultipleObjects stub.", 1 },'; echo '+ { "Alexander Morozov", "ntoskrnl.exe: Add stub for IoGetAttachedDeviceReference.", 1 },'; @@ -5369,6 +5449,7 @@ echo '+ { "Christian Costa", "ntoskrnl.exe: Implement MmMapLockedPages and MmUnmapLockedPages.", 1 },'; echo '+ { "Alexander Morozov", "ntoskrnl.exe: Implement KeInitializeMutex.", 1 },'; echo '+ { "Michael Müller", "ntoskrnl.exe: Add stub for PsRemoveLoadImageNotifyRoutine.", 1 },'; + echo '+ { "Jarkko Korpi", "ntoskrnl.exe: Add IoGetDeviceAttachmentBaseRef stub.", 1 },'; ) >> "$patchlist" fi @@ -5549,6 +5630,22 @@ ) >> "$patchlist" fi +# Patchset oleaut32-OleLoadPictureFile +# | +# | Modified files: +# | * dlls/oleaut32/olepicture.c, dlls/oleaut32/tests/olepicture.c +# | +if test "$enable_oleaut32_OleLoadPictureFile" -eq 1; then + patch_apply oleaut32-OleLoadPictureFile/0001-oleaut32-Do-not-reimplement-OleLoadPicture-in-OleLoa.patch + patch_apply oleaut32-OleLoadPictureFile/0002-oleaut32-Factor-out-stream-creation-from-OleLoadPict.patch + patch_apply oleaut32-OleLoadPictureFile/0003-oleaut32-Implement-OleLoadPictureFile.patch + ( + echo '+ { "Dmitry Timoshkov", "oleaut32: Do not reimplement OleLoadPicture in OleLoadPicturePath.", 1 },'; + echo '+ { "Dmitry Timoshkov", "oleaut32: Factor out stream creation from OleLoadPicturePath.", 1 },'; + echo '+ { "Dmitry Timoshkov", "oleaut32: Implement OleLoadPictureFile.", 2 },'; + ) >> "$patchlist" +fi + # Patchset oleaut32-TKIND_COCLASS # | # | This patchset fixes the following Wine bugs: @@ -5707,8 +5804,8 @@ patch_apply reg-Implement_Query/0001-reg-Query-all-values-and-subkeys-in-a-specified-key.patch patch_apply reg-Implement_Query/0002-reg-Add-support-for-querying-the-registry-with-the-v.patch ( - echo '+ { "Hugh McMaster", "reg: Query all values and subkeys in a specified key.", 1 },'; - echo '+ { "Hugh McMaster", "reg: Add support for querying the registry with the /v and /ve switches.", 1 },'; + echo '+ { "Hugh McMaster", "reg: Query all values and subkeys in a specified key.", 2 },'; + echo '+ { "Hugh McMaster", "reg: Add support for querying the registry with the /v and /ve switches.", 2 },'; ) >> "$patchlist" fi @@ -6075,21 +6172,6 @@ ) >> "$patchlist" fi -# Patchset setupapi-SetupDiSetDeviceInstallParamsW -# | -# | This patchset fixes the following Wine bugs: -# | * [#29903] Add stub for setupapi.SetupDiSetDeviceInstallParamsW -# | -# | Modified files: -# | * dlls/setupapi/devinst.c, dlls/setupapi/setupapi.spec -# | -if test "$enable_setupapi_SetupDiSetDeviceInstallParamsW" -eq 1; then - patch_apply setupapi-SetupDiSetDeviceInstallParamsW/0001-setupapi-add-SetupDiSetDeviceInstallParamsW-stub.patch - ( - echo '+ { "Austin English", "setupapi: Add SetupDiSetDeviceInstallParamsW stub.", 1 },'; - ) >> "$patchlist" -fi - # Patchset setupapi-SetupPromptForDisk # | # | This patchset fixes the following Wine bugs: @@ -6131,6 +6213,39 @@ ) >> "$patchlist" fi +# Patchset shell32-Context_Menu +# | +# | This patchset fixes the following Wine bugs: +# | * [#34319] Add support for Paste in context menu +# | * [#34322] Fix implementation of Cut file operation +# | * [#34321] Fix Cut/Copy/Paste keyboard shortcuts in Total Commander +# | +# | Modified files: +# | * dlls/shell32/clipboard.c, dlls/shell32/dataobject.c, dlls/shell32/recyclebin.c, dlls/shell32/shell32.rc, +# | dlls/shell32/shell32_main.h, dlls/shell32/shellfolder.h, dlls/shell32/shfldr_fs.c, dlls/shell32/shfldr_unixfs.c, +# | dlls/shell32/shlview.c, dlls/shell32/shlview_cmenu.c +# | +if test "$enable_shell32_Context_Menu" -eq 1; then + patch_apply shell32-Context_Menu/0001-shell32-Fix-copying-of-files-when-using-a-context-me.patch + patch_apply shell32-Context_Menu/0002-shell32-Set-return-value-correctly-in-DoPaste.patch + patch_apply shell32-Context_Menu/0003-shell32-Implement-insert-paste-for-item-context-menu.patch + patch_apply shell32-Context_Menu/0004-shell32-Correctly-interpret-result-of-SHFileOperatio.patch + patch_apply shell32-Context_Menu/0005-shell32-Add-support-for-setting-getting-PREFERREDDRO.patch + patch_apply shell32-Context_Menu/0006-shell32-Add-parameter-to-ISFHelper-DeleteItems-to-al.patch + patch_apply shell32-Context_Menu/0007-shell32-Remove-source-files-when-using-cut-in-the-co.patch + patch_apply shell32-Context_Menu/0008-shell32-Recognize-cut-copy-paste-string-verbs-in-ite.patch + ( + echo '+ { "Michael Müller", "shell32: Fix copying of files when using a context menu.", 1 },'; + echo '+ { "Michael Müller", "shell32: Set return value correctly in DoPaste.", 1 },'; + echo '+ { "Michael Müller", "shell32: Implement insert/paste for item context menus.", 1 },'; + echo '+ { "Michael Müller", "shell32: Correctly interpret result of SHFileOperation in UNIXFS copy and delete.", 1 },'; + echo '+ { "Michael Müller", "shell32: Add support for setting/getting PREFERREDDROPEFFECT in IDataObject.", 1 },'; + echo '+ { "Michael Müller", "shell32: Add parameter to ISFHelper::DeleteItems to allow deleting files without confirmation.", 1 },'; + echo '+ { "Michael Müller", "shell32: Remove source files when using cut in the context menu.", 1 },'; + echo '+ { "Michael Müller", "shell32: Recognize cut/copy/paste string verbs in item menu context menu.", 1 },'; + ) >> "$patchlist" +fi + # Patchset shell32-Default_Path # | # | This patchset fixes the following Wine bugs: @@ -6419,6 +6534,18 @@ ) >> "$patchlist" fi +# Patchset shlwapi-IStream_fnRead +# | +# | Modified files: +# | * dlls/shlwapi/istream.c, dlls/shlwapi/tests/istream.c +# | +if test "$enable_shlwapi_IStream_fnRead" -eq 1; then + patch_apply shlwapi-IStream_fnRead/0001-shlwapi-Fix-IStream-Read-return-value-for-partial-re.patch + ( + echo '+ { "Dmitry Timoshkov", "shlwapi: Fix IStream::Read() return value for partial reads.", 1 },'; + ) >> "$patchlist" +fi + # Patchset shlwapi-SHMapHandle # | # | Modified files: @@ -6571,6 +6698,18 @@ ) >> "$patchlist" fi +# Patchset user.exe16-CONTAINING_RECORD +# | +# | Modified files: +# | * dlls/user.exe16/user.c +# | +if test "$enable_user_exe16_CONTAINING_RECORD" -eq 1; then + patch_apply user.exe16-CONTAINING_RECORD/0001-user.exe16-Don-t-open-code-CONTAINING_RECORD.patch + ( + echo '+ { "Sebastian Lackner", "user.exe16: Don'\''t open code CONTAINING_RECORD.", 1 },'; + ) >> "$patchlist" +fi + # Patchset user.exe16-DlgDirList # | # | This patchset fixes the following Wine bugs: @@ -6601,6 +6740,28 @@ ) >> "$patchlist" fi +# Patchset user32-Dialog_Owner +# | +# | This patchset fixes the following Wine bugs: +# | * [#40282] Enable the correct dialog owner in DIALOG_DoDialogBox +# | +# | Modified files: +# | * dlls/user.exe16/dialog.c, dlls/user.exe16/user_private.h, dlls/user32/controls.h, dlls/user32/dialog.c, +# | dlls/user32/tests/win.c +# | +if test "$enable_user32_Dialog_Owner" -eq 1; then + patch_apply user32-Dialog_Owner/0001-user32-tests-Add-some-tests-for-dialog-owner-disable.patch + patch_apply user32-Dialog_Owner/0002-user32-Enable-the-specified-dialog-owner.patch + patch_apply user32-Dialog_Owner/0003-user32-Enable-correct-dialog-owner.patch + patch_apply user32-Dialog_Owner/0004-user32-Unconditionally-enable-dialog-owner.patch + ( + echo '+ { "Dmitry Timoshkov", "user32/tests: Add some tests for dialog owner disabled state.", 3 },'; + echo '+ { "Dmitry Timoshkov", "user32: Enable the specified dialog owner.", 1 },'; + echo '+ { "Dmitry Timoshkov", "user32: Enable correct dialog owner.", 1 },'; + echo '+ { "Dmitry Timoshkov", "user32: Unconditionally enable dialog owner.", 1 },'; + ) >> "$patchlist" +fi + # Patchset user32-Dialog_Paint_Event # | # | This patchset fixes the following Wine bugs: @@ -6631,6 +6792,18 @@ ) >> "$patchlist" fi +# Patchset user32-FlashWindowEx +# | +# | Modified files: +# | * dlls/user32/win.c +# | +if test "$enable_user32_FlashWindowEx" -eq 1; then + patch_apply user32-FlashWindowEx/0001-user32-Avoid-dereferencing-NULL-pointer-in-a-trace.patch + ( + echo '+ { "Dmitry Timoshkov", "user32: Avoid dereferencing NULL pointer in a trace.", 1 },'; + ) >> "$patchlist" +fi + # Patchset user32-GetSystemMetrics # | # | This patchset fixes the following Wine bugs: @@ -6915,9 +7088,13 @@ if test "$enable_vulkan_Vulkan_Implementation" -eq 1; then patch_apply vulkan-Vulkan_Implementation/0001-vulkan-Initial-implementation.patch patch_apply vulkan-Vulkan_Implementation/0002-vulkan-Implement-vkGetPhysicalDeviceWin32Presentatio.patch + patch_apply vulkan-Vulkan_Implementation/0003-vulkan-Use-binary-search-to-lookup-function-in-is_nu.patch + patch_apply vulkan-Vulkan_Implementation/0004-vulkan-Try-to-load-libvulkan.so.1.patch ( echo '+ { "Sebastian Lackner", "vulkan: Initial implementation.", 2 },'; echo '+ { "Michael Müller", "vulkan: Implement vkGetPhysicalDeviceWin32PresentationSupportKHR.", 1 },'; + echo '+ { "Sebastian Lackner", "vulkan: Use binary search to lookup function in is_null_func.", 1 },'; + echo '+ { "Michael Müller", "vulkan: Try to load libvulkan.so.1.", 1 },'; ) >> "$patchlist" fi @@ -6954,6 +7131,23 @@ ) >> "$patchlist" fi +# Patchset windowscodecs-IMILBitmapSource +# | +# | This patchset fixes the following Wine bugs: +# | * [#34764] Improve compatibility of IMILBitmapSource interface +# | +# | Modified files: +# | * dlls/windowscodecs/bitmap.c, dlls/windowscodecs/scaler.c, dlls/windowscodecs/wincodecs_private.h +# | +if test "$enable_windowscodecs_IMILBitmapSource" -eq 1; then + patch_apply windowscodecs-IMILBitmapSource/0001-windowscodecs-Improve-compatibility-of-IMILBitmapSou.patch + patch_apply windowscodecs-IMILBitmapSource/0002-windowscodecs-Add-support-for-IMILBitmapScaler-inter.patch + ( + echo '+ { "Dmitry Timoshkov", "windowscodecs: Improve compatibility of IMILBitmapSource interface.", 3 },'; + echo '+ { "Dmitry Timoshkov", "windowscodecs: Add support for IMILBitmapScaler interface.", 2 },'; + ) >> "$patchlist" +fi + # Patchset windowscodecs-WICCreateBitmapFromSection # | # | This patchset fixes the following Wine bugs: @@ -6970,6 +7164,21 @@ ) >> "$patchlist" fi +# Patchset wine.inf-Directory_ContextMenuHandlers +# | +# | This patchset fixes the following Wine bugs: +# | * [#29523] Add 'New' context menu handler entry for directories +# | +# | Modified files: +# | * loader/wine.inf.in +# | +if test "$enable_wine_inf_Directory_ContextMenuHandlers" -eq 1; then + patch_apply wine.inf-Directory_ContextMenuHandlers/0001-wine.inf-Add-New-context-menu-handler-entry-for-dire.patch + ( + echo '+ { "Michael Müller", "wine.inf: Add '\''New'\'' context menu handler entry for directories.", 1 },'; + ) >> "$patchlist" +fi + # Patchset wine.inf-Dummy_CA_Certificate # | # | Modified files: @@ -7298,18 +7507,18 @@ ) >> "$patchlist" fi -# Patchset winex11-MONITORENUMPROC +# Patchset winex11-Desktop_Resolution # | # | This patchset fixes the following Wine bugs: -# | * [#24421] Use assembler wrapper to call MONITORENUMPROC callback +# | * [#32979] Allow 320x240 as supported resolution in desktop mode # | # | Modified files: -# | * dlls/winex11.drv/xinerama.c +# | * dlls/winex11.drv/desktop.c # | -if test "$enable_winex11_MONITORENUMPROC" -eq 1; then - patch_apply winex11-MONITORENUMPROC/0001-winex11.drv-Use-assembler-wrapper-to-call-MONITORENU.patch +if test "$enable_winex11_Desktop_Resolution" -eq 1; then + patch_apply winex11-Desktop_Resolution/0001-winex11-Add-320x240-as-supported-resolution-in-deskt.patch ( - echo '+ { "Sebastian Lackner", "winex11.drv: Use assembler wrapper to call MONITORENUMPROC callback.", 1 },'; + echo '+ { "Michael Müller", "winex11: Add 320x240 as supported resolution in desktop mode.", 1 },'; ) >> "$patchlist" fi @@ -7492,21 +7701,6 @@ ) >> "$patchlist" fi -# Patchset winscard-SCardListReaders -# | -# | This patchset fixes the following Wine bugs: -# | * [#26978] Add stub for winscard.SCardListReadersA/W -# | -# | Modified files: -# | * dlls/winscard/winscard.c, dlls/winscard/winscard.spec -# | -if test "$enable_winscard_SCardListReaders" -eq 1; then - patch_apply winscard-SCardListReaders/0001-winscard-add-stubs-for-SCardListReadersA-W.patch - ( - echo '+ { "Austin English", "winscard: Add stubs for SCardListReadersA/W.", 1 },'; - ) >> "$patchlist" -fi - # Patchset winspool.drv-SetPrinterW # | # | This patchset fixes the following Wine bugs: @@ -7537,6 +7731,22 @@ ) >> "$patchlist" fi +# Patchset wintrust-WinVerifyTrust +# | +# | Modified files: +# | * dlls/wintrust/softpub.c, dlls/wintrust/tests/softpub.c +# | +if test "$enable_wintrust_WinVerifyTrust" -eq 1; then + patch_apply wintrust-WinVerifyTrust/0001-wintrust-tests-Add-tests-for-WinVerifyTrust.-v2.patch + patch_apply wintrust-WinVerifyTrust/0002-wintrust-tests-Add-some-additional-tests.patch + patch_apply wintrust-WinVerifyTrust/0003-wintrust-Verify-image-hash-in-WinVerifyTrust.patch + ( + echo '+ { "Mark Jansen", "wintrust/tests: Add tests for WinVerifyTrust.", 2 },'; + echo '+ { "Sebastian Lackner", "wintrust/tests: Add some additional tests.", 1 },'; + echo '+ { "Mark Jansen", "wintrust: Verify image hash in WinVerifyTrust.", 1 },'; + ) >> "$patchlist" +fi + # Patchset wpcap-Several_Fixes # | # | Modified files: diff -Nru wine-staging-1.9.6/patches/reg-Implement_Query/0001-reg-Query-all-values-and-subkeys-in-a-specified-key.patch wine-staging-1.9.7~ubuntu15.04.1/patches/reg-Implement_Query/0001-reg-Query-all-values-and-subkeys-in-a-specified-key.patch --- wine-staging-1.9.6/patches/reg-Implement_Query/0001-reg-Query-all-values-and-subkeys-in-a-specified-key.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/reg-Implement_Query/0001-reg-Query-all-values-and-subkeys-in-a-specified-key.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,20 +1,20 @@ -From 52a65aa581b8bdcc972efcb8f8a9320481124812 Mon Sep 17 00:00:00 2001 +From 47f219c26491fdffccf4b74e319daf80baf06de6 Mon Sep 17 00:00:00 2001 From: Hugh McMaster Date: Thu, 17 Mar 2016 16:10:25 +1100 -Subject: reg: Query all values and subkeys in a specified key +Subject: reg: Query all values and subkeys in a specified key (v2) Displays all values and subkeys in a specified key. Recursion is supported. Signed-off-by: Hugh McMaster --- - programs/reg/reg.c | 294 +++++++++++++++++++++++++++++++++++++++++++++++++++-- - 1 file changed, 286 insertions(+), 8 deletions(-) + programs/reg/reg.c | 298 +++++++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 291 insertions(+), 7 deletions(-) diff --git a/programs/reg/reg.c b/programs/reg/reg.c -index 9dbce32..75c5292 100644 +index b2066e0..ab04ee9 100644 --- a/programs/reg/reg.c +++ b/programs/reg/reg.c -@@ -546,14 +546,292 @@ static int reg_delete(WCHAR *key_name, WCHAR *value_name, BOOL value_empty, +@@ -536,14 +536,298 @@ static int reg_delete(WCHAR *key_name, WCHAR *value_name, BOOL value_empty, return 0; } @@ -22,8 +22,7 @@ - BOOL subkey) +static WCHAR *reg_data_to_wchar(DWORD type, const BYTE *src, DWORD size_bytes) { -+ WCHAR *buffer = NULL, *ptr = NULL; -+ WCHAR hex_fmt[] = {'%','0','2','x',0}; ++ WCHAR *buffer = NULL; + int i; + + switch (type) @@ -35,24 +34,31 @@ + strcpyW(buffer, (WCHAR *)src); + break; + case REG_BINARY: ++ { ++ WCHAR *ptr; ++ WCHAR fmt[] = {'%','0','2','x',0}; ++ + buffer = HeapAlloc(GetProcessHeap(), 0, (size_bytes * 2 + 1) * sizeof(WCHAR)); + ptr = buffer; + for (i = 0; i < size_bytes; i++) -+ ptr += sprintfW(ptr, hex_fmt, src[i]); ++ ptr += sprintfW(ptr, fmt, src[i]); + break; ++ } + case REG_DWORD: + /* case REG_DWORD_LITTLE_ENDIAN: */ + case REG_DWORD_BIG_ENDIAN: + { ++ DWORD value = 0; + const int zero_x_dword = 10; -+ WCHAR zero_x[] = {'0','x',0}; -+ -+ buffer = HeapAlloc(GetProcessHeap(), 0, (zero_x_dword + 1) * sizeof(WCHAR)); -+ strcpyW(buffer, zero_x); -+ ptr = buffer + 2; ++ WCHAR fmt[] = {'0','x','%','x',0}; + + for (i = size_bytes; i-- > 0;) -+ ptr += sprintfW(ptr, hex_fmt, src[i]); ++ { ++ value <<= 8; ++ value |= src[i]; ++ } ++ buffer = HeapAlloc(GetProcessHeap(), 0, (zero_x_dword + 1) * sizeof(WCHAR)); ++ sprintfW(buffer, fmt, value);; + break; + } + case REG_MULTI_SZ: @@ -102,7 +108,6 @@ + if (type == type_rels[i].type) + return type_rels[i].name; + } -+ + return NULL; +} + @@ -127,12 +132,12 @@ + output_string(newlineW); +} + -+static WCHAR *build_subkey_path(WCHAR *path, WCHAR *subkey_name, DWORD len) ++static WCHAR *build_subkey_path(WCHAR *path, DWORD path_len, WCHAR *subkey_name, DWORD subkey_len) +{ + WCHAR *subkey_path; + WCHAR fmt[] = {'%','s','\\','%','s',0}; + -+ subkey_path = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR)); ++ subkey_path = HeapAlloc(GetProcessHeap(), 0, (path_len + subkey_len + 2) * sizeof(WCHAR)); + if (!subkey_path) + { + ERR("Failed to allocate memory for subkey_path\n"); @@ -142,13 +147,13 @@ + return subkey_path; +} + -+static int query_all(HKEY key, WCHAR *path, DWORD path_len, BOOL recurse) ++static int query_all(HKEY key, WCHAR *path, BOOL recurse) +{ + LONG rc; -+ DWORD num_subkeys, max_subkey_len, subkey_len, subkey_path_len; ++ DWORD num_subkeys, max_subkey_len, subkey_len; + DWORD num_values, max_value_len, value_len; + DWORD max_data_bytes, data_size; -+ DWORD type; ++ DWORD type, path_len; + WCHAR *value_name, *subkey_name, *subkey_path; + WCHAR fmt[] = {'%','1','\n',0}; + WCHAR fmt_path[] = {'%','1','\\','%','2','\n',0}; @@ -166,8 +171,6 @@ + } + + max_value_len++; -+ max_subkey_len++; -+ + value_name = HeapAlloc(GetProcessHeap(), 0, max_value_len * sizeof(WCHAR)); + if (!value_name) + { @@ -200,6 +203,7 @@ + if (num_values || recurse) + output_string(newlineW); + ++ max_subkey_len++; + subkey_name = HeapAlloc(GetProcessHeap(), 0, max_subkey_len * sizeof(WCHAR)); + if (!subkey_name) + { @@ -207,6 +211,8 @@ + return 1; + } + ++ path_len = strlenW(path); ++ + for (i = 0; i < num_subkeys; i++) + { + subkey_len = max_subkey_len; @@ -215,10 +221,9 @@ + { + if (recurse) + { -+ subkey_path_len = path_len + subkey_len + 1; -+ subkey_path = build_subkey_path(path, subkey_name, subkey_path_len); ++ subkey_path = build_subkey_path(path, path_len, subkey_name, subkey_len); + RegOpenKeyExW(key, subkey_name, 0, KEY_READ, &subkey); -+ query_all(subkey, subkey_path, subkey_path_len, recurse); ++ query_all(subkey, subkey_path, recurse); + RegCloseKey(subkey); + HeapFree(GetProcessHeap(), 0, subkey_path); + } @@ -226,13 +231,16 @@ + } + } + ++ if (num_subkeys && !recurse) ++ output_string(newlineW); ++ + HeapFree(GetProcessHeap(), 0, subkey_name); + return 0; +} + +static WCHAR *get_long_path(HKEY root, WCHAR *path) +{ -+ int i, len; ++ DWORD i, len; + WCHAR *long_path; + WCHAR fmt[] = {'%','s','\\','%','s',0}; + @@ -262,10 +270,8 @@ + WCHAR *p, *path; + HKEY root, key; static const WCHAR stubW[] = {'S','T','U','B',' ','Q','U','E','R','Y',' ', -- '-',' ','%','1',' ','%','2',' ','%','3','!','d','!',' ','%','4','!','d','!','\n',0}; + '-',' ','%','1',' ','%','2',' ','%','3','!','d','!',' ','%','4','!','d','!','\n',0}; - output_string(stubW, key_name, value_name, value_empty, subkey); -+ '-',' ','%','1',' ','%','2',' ','%','3','!','d','!',' ','%','4','!','d','!','\n',0}; -+ DWORD path_len; + int ret; + + if (!sane_path(key_name)) @@ -294,7 +300,6 @@ + } + + path = get_long_path(root, p); -+ path_len = strlenW(path); + + if (value_name || value_empty) + { @@ -302,7 +307,7 @@ + return 1; + } + -+ ret = query_all(key, path, path_len, recurse); ++ ret = query_all(key, path, recurse); + + HeapFree(GetProcessHeap(), 0, path); + RegCloseKey(key); @@ -312,7 +317,7 @@ } int wmain(int argc, WCHAR *argvW[]) -@@ -677,7 +955,7 @@ int wmain(int argc, WCHAR *argvW[]) +@@ -667,7 +951,7 @@ int wmain(int argc, WCHAR *argvW[]) else if (!lstrcmpiW(argvW[1], queryW)) { WCHAR *key_name, *value_name = NULL; @@ -321,7 +326,7 @@ if (argc < 3) { -@@ -705,9 +983,9 @@ int wmain(int argc, WCHAR *argvW[]) +@@ -695,9 +979,9 @@ int wmain(int argc, WCHAR *argvW[]) else if (!lstrcmpiW(argvW[i], slashVEW)) value_empty = TRUE; else if (!lstrcmpiW(argvW[i], slashSW)) diff -Nru wine-staging-1.9.6/patches/reg-Implement_Query/0002-reg-Add-support-for-querying-the-registry-with-the-v.patch wine-staging-1.9.7~ubuntu15.04.1/patches/reg-Implement_Query/0002-reg-Add-support-for-querying-the-registry-with-the-v.patch --- wine-staging-1.9.6/patches/reg-Implement_Query/0002-reg-Add-support-for-querying-the-registry-with-the-v.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/reg-Implement_Query/0002-reg-Add-support-for-querying-the-registry-with-the-v.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,8 +1,8 @@ -From bf459e7bcaca10acae3f07756d4e63812e7da0c0 Mon Sep 17 00:00:00 2001 +From 26a2b604e32ae517aed24313ddba4eaccd4e1e23 Mon Sep 17 00:00:00 2001 From: Hugh McMaster -Date: Fri, 18 Mar 2016 15:50:31 +1100 +Date: Sun, 27 Mar 2016 22:19:17 +1100 Subject: reg: Add support for querying the registry with the /v and /ve - switches + switches (v2) Recursion is supported. @@ -12,21 +12,21 @@ 1 file changed, 80 insertions(+), 8 deletions(-) diff --git a/programs/reg/reg.c b/programs/reg/reg.c -index 75c5292..3722841 100644 +index ab04ee9..8dd7e50 100644 --- a/programs/reg/reg.c +++ b/programs/reg/reg.c -@@ -756,6 +756,83 @@ static int query_all(HKEY key, WCHAR *path, DWORD path_len, BOOL recurse) +@@ -754,6 +754,83 @@ static int query_all(HKEY key, WCHAR *path, BOOL recurse) return 0; } +static int num_values_found = 0; + -+static int query_value(HKEY key, WCHAR *value_name, WCHAR *path, DWORD path_len, BOOL recurse) ++static int query_value(HKEY key, WCHAR *value_name, WCHAR *path, BOOL recurse) +{ + LONG rc; -+ DWORD num_subkeys, max_subkey_len, subkey_len, subkey_path_len; ++ DWORD num_subkeys, max_subkey_len, subkey_len; + DWORD max_data_bytes, data_size; -+ DWORD type; ++ DWORD type, path_len; + BYTE *data; + WCHAR fmt[] = {'%','1','\n',0}; + WCHAR newlineW[] = {'\n',0}; @@ -42,8 +42,6 @@ + return 1; + } + -+ max_subkey_len++; -+ + data = HeapAlloc(GetProcessHeap(), 0, max_data_bytes); + if (!data) + { @@ -70,6 +68,7 @@ + return 0; + } + ++ max_subkey_len++; + subkey_name = HeapAlloc(GetProcessHeap(), 0, max_subkey_len * sizeof(WCHAR)); + if (!subkey_name) + { @@ -77,16 +76,17 @@ + return 1; + } + ++ path_len = strlenW(path); ++ + for (i = 0; i < num_subkeys; i++) + { + subkey_len = max_subkey_len; + rc = RegEnumKeyExW(key, i, subkey_name, &subkey_len, NULL, NULL, NULL, NULL); + if (rc == ERROR_SUCCESS) + { -+ subkey_path_len = path_len + subkey_len + 1; -+ subkey_path = build_subkey_path(path, subkey_name, subkey_path_len); ++ subkey_path = build_subkey_path(path, path_len, subkey_name, subkey_len); + RegOpenKeyExW(key, subkey_name, 0, KEY_READ, &subkey); -+ query_value(subkey, value_name, subkey_path, subkey_path_len, recurse); ++ query_value(subkey, value_name, subkey_path, recurse); + RegCloseKey(subkey); + HeapFree(GetProcessHeap(), 0, subkey_path); + } @@ -98,18 +98,18 @@ + static WCHAR *get_long_path(HKEY root, WCHAR *path) { - int i, len; -@@ -787,8 +864,6 @@ static int reg_query(WCHAR *key_name, WCHAR *value_name, BOOL value_empty, BOOL + DWORD i, len; +@@ -785,8 +862,6 @@ static int reg_query(WCHAR *key_name, WCHAR *value_name, BOOL value_empty, BOOL { WCHAR *p, *path; HKEY root, key; - static const WCHAR stubW[] = {'S','T','U','B',' ','Q','U','E','R','Y',' ', -- '-',' ','%','1',' ','%','2',' ','%','3','!','d','!',' ','%','4','!','d','!','\n',0}; - DWORD path_len; +- '-',' ','%','1',' ','%','2',' ','%','3','!','d','!',' ','%','4','!','d','!','\n',0}; int ret; -@@ -821,12 +896,9 @@ static int reg_query(WCHAR *key_name, WCHAR *value_name, BOOL value_empty, BOOL - path_len = strlenW(path); + if (!sane_path(key_name)) +@@ -817,12 +892,9 @@ static int reg_query(WCHAR *key_name, WCHAR *value_name, BOOL value_empty, BOOL + path = get_long_path(root, p); if (value_name || value_empty) - { @@ -117,10 +117,10 @@ - return 1; - } - -- ret = query_all(key, path, path_len, recurse); -+ ret = query_value(key, value_name, path, path_len, recurse); +- ret = query_all(key, path, recurse); ++ ret = query_value(key, value_name, path, recurse); + else -+ ret = query_all(key, path, path_len, recurse); ++ ret = query_all(key, path, recurse); HeapFree(GetProcessHeap(), 0, path); RegCloseKey(key); diff -Nru wine-staging-1.9.6/patches/riched20-IText_Interface/0001-riched20-Implement-IText-Selection-Range-Set-Start-E.patch wine-staging-1.9.7~ubuntu15.04.1/patches/riched20-IText_Interface/0001-riched20-Implement-IText-Selection-Range-Set-Start-E.patch --- wine-staging-1.9.6/patches/riched20-IText_Interface/0001-riched20-Implement-IText-Selection-Range-Set-Start-E.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/riched20-IText_Interface/0001-riched20-Implement-IText-Selection-Range-Set-Start-E.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,4 +1,4 @@ -From eb8033132c15abb87c53f2e8b52c6fb6622f333b Mon Sep 17 00:00:00 2001 +From 3d02c5ffcad36616c63a8814fe98f9b531fce27a Mon Sep 17 00:00:00 2001 From: Jactry Zeng Date: Fri, 8 Aug 2014 21:32:57 +0800 Subject: riched20: Implement IText{Selection, Range}::Set{Start, End}. @@ -8,10 +8,10 @@ 1 file changed, 135 insertions(+) diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c -index fd4d9e8..3be6320 100644 +index 6da3ce3..8047f4b 100644 --- a/dlls/riched20/tests/richole.c +++ b/dlls/riched20/tests/richole.c -@@ -3251,6 +3251,137 @@ static void test_ITextSelection_GetDuplicate(void) +@@ -3397,6 +3397,137 @@ static void test_Expand(void) ITextRange_Release(range); } @@ -149,7 +149,7 @@ START_TEST(richole) { /* Must explicitly LoadLibrary(). The test has no references to functions in -@@ -3263,11 +3394,15 @@ START_TEST(richole) +@@ -3409,12 +3540,16 @@ START_TEST(richole) test_GetText(); test_ITextSelection_GetChar(); test_ITextSelection_GetStart_GetEnd(); @@ -158,6 +158,7 @@ test_ITextSelection_Collapse(); test_ITextDocument_Range(); test_ITextRange_GetChar(); + test_ITextRange_ScrollIntoView(); test_ITextRange_GetStart_GetEnd(); test_ITextRange_GetDuplicate(); + test_ITextRange_SetStart(); @@ -166,5 +167,5 @@ test_GetClientSite(); test_IOleWindow_GetWindow(); -- -2.4.2 +2.7.1 diff -Nru wine-staging-1.9.6/patches/riched20-IText_Interface/0002-riched20-Stub-for-ITextFont-interface-and-implement-.patch wine-staging-1.9.7~ubuntu15.04.1/patches/riched20-IText_Interface/0002-riched20-Stub-for-ITextFont-interface-and-implement-.patch --- wine-staging-1.9.6/patches/riched20-IText_Interface/0002-riched20-Stub-for-ITextFont-interface-and-implement-.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/riched20-IText_Interface/0002-riched20-Stub-for-ITextFont-interface-and-implement-.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,4 +1,4 @@ -From fb297f3423e913e7c25e433a0257a12970666d57 Mon Sep 17 00:00:00 2001 +From c1711e301579aa2469cad8b0d3ba5567edc4611b Mon Sep 17 00:00:00 2001 From: Jactry Zeng Date: Mon, 11 Aug 2014 13:51:55 +0800 Subject: riched20: Stub for ITextFont interface and implement @@ -10,10 +10,10 @@ 2 files changed, 113 insertions(+) diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c -index d39bce7..64809cc 100644 +index 1013e67..9e7d853 100644 --- a/dlls/riched20/richole.c +++ b/dlls/riched20/richole.c -@@ -2544,6 +2544,10 @@ static HRESULT WINAPI TextFont_SetDuplicate(ITextFont *iface, ITextFont *pFont) +@@ -2654,6 +2654,10 @@ static HRESULT WINAPI TextFont_SetDuplicate(ITextFont *iface, ITextFont *pFont) { ITextFontImpl *This = impl_from_ITextFont(iface); FIXME("(%p)->(%p): stub\n", This, pFont); @@ -24,7 +24,7 @@ return E_NOTIMPL; } -@@ -2551,6 +2555,10 @@ static HRESULT WINAPI TextFont_CanChange(ITextFont *iface, LONG *ret) +@@ -2661,6 +2665,10 @@ static HRESULT WINAPI TextFont_CanChange(ITextFont *iface, LONG *ret) { ITextFontImpl *This = impl_from_ITextFont(iface); FIXME("(%p)->(%p): stub\n", This, ret); @@ -35,7 +35,7 @@ return E_NOTIMPL; } -@@ -2558,6 +2566,10 @@ static HRESULT WINAPI TextFont_IsEqual(ITextFont *iface, ITextFont *font, LONG * +@@ -2668,6 +2676,10 @@ static HRESULT WINAPI TextFont_IsEqual(ITextFont *iface, ITextFont *font, LONG * { ITextFontImpl *This = impl_from_ITextFont(iface); FIXME("(%p)->(%p %p): stub\n", This, font, ret); @@ -46,7 +46,7 @@ return E_NOTIMPL; } -@@ -2731,6 +2743,10 @@ static HRESULT WINAPI TextFont_GetStyle(ITextFont *iface, LONG *value) +@@ -2841,6 +2853,10 @@ static HRESULT WINAPI TextFont_GetStyle(ITextFont *iface, LONG *value) { ITextFontImpl *This = impl_from_ITextFont(iface); FIXME("(%p)->(%p): stub\n", This, value); @@ -57,7 +57,7 @@ return E_NOTIMPL; } -@@ -2738,6 +2754,10 @@ static HRESULT WINAPI TextFont_SetStyle(ITextFont *iface, LONG value) +@@ -2848,6 +2864,10 @@ static HRESULT WINAPI TextFont_SetStyle(ITextFont *iface, LONG value) { ITextFontImpl *This = impl_from_ITextFont(iface); FIXME("(%p)->(%d): stub\n", This, value); @@ -69,10 +69,10 @@ } diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c -index 3be6320..5f8e1cc 100644 +index 8047f4b..851ae9a 100644 --- a/dlls/riched20/tests/richole.c +++ b/dlls/riched20/tests/richole.c -@@ -3382,6 +3382,97 @@ static void test_ITextSelection_SetEnd(void) +@@ -3528,6 +3528,97 @@ static void test_ITextSelection_SetEnd(void) release_interfaces(&w, &reOle, &txtDoc, &txtSel); } @@ -170,15 +170,15 @@ START_TEST(richole) { /* Must explicitly LoadLibrary(). The test has no references to functions in -@@ -3397,6 +3488,7 @@ START_TEST(richole) +@@ -3543,6 +3634,7 @@ START_TEST(richole) test_ITextSelection_SetStart(); test_ITextSelection_SetEnd(); test_ITextSelection_Collapse(); + test_ITextSelection_GetFont(); test_ITextDocument_Range(); test_ITextRange_GetChar(); - test_ITextRange_GetStart_GetEnd(); -@@ -3404,6 +3496,7 @@ START_TEST(richole) + test_ITextRange_ScrollIntoView(); +@@ -3551,6 +3643,7 @@ START_TEST(richole) test_ITextRange_SetStart(); test_ITextRange_SetEnd(); test_ITextRange_Collapse(); @@ -187,5 +187,5 @@ test_IOleWindow_GetWindow(); test_IOleInPlaceSite_GetWindow(); -- -2.4.2 +2.7.1 diff -Nru wine-staging-1.9.6/patches/riched20-IText_Interface/0009-riched20-Implement-ITextSelection-GetStoryLength.patch wine-staging-1.9.7~ubuntu15.04.1/patches/riched20-IText_Interface/0009-riched20-Implement-ITextSelection-GetStoryLength.patch --- wine-staging-1.9.6/patches/riched20-IText_Interface/0009-riched20-Implement-ITextSelection-GetStoryLength.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/riched20-IText_Interface/0009-riched20-Implement-ITextSelection-GetStoryLength.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,4 +1,4 @@ -From 56bf18bcf782cea24efa378eb3ec58b171083e71 Mon Sep 17 00:00:00 2001 +From e5dad19d1dbab38b6a6c31bd23fe7dac278e6d1a Mon Sep 17 00:00:00 2001 From: Jactry Zeng Date: Mon, 18 Aug 2014 14:47:14 +0800 Subject: riched20: Implement ITextSelection::GetStoryLength. @@ -8,10 +8,10 @@ 1 file changed, 30 insertions(+) diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c -index 55d27d4..854ec09 100644 +index c7d6299..38a8f80 100644 --- a/dlls/riched20/tests/richole.c +++ b/dlls/riched20/tests/richole.c -@@ -3667,6 +3667,35 @@ static void test_ITextRange_GetStoryLength(void) +@@ -3813,6 +3813,35 @@ static void test_ITextRange_GetStoryLength(void) release_interfaces(&w, &reOle, &txtDoc, NULL); } @@ -47,14 +47,14 @@ START_TEST(richole) { /* Must explicitly LoadLibrary(). The test has no references to functions in -@@ -3683,6 +3712,7 @@ START_TEST(richole) +@@ -3829,6 +3858,7 @@ START_TEST(richole) test_ITextSelection_SetEnd(); test_ITextSelection_Collapse(); test_ITextSelection_GetFont(); + test_ITextSelection_GetStoryLength(); test_ITextDocument_Range(); test_ITextRange_GetChar(); - test_ITextRange_GetStart_GetEnd(); + test_ITextRange_ScrollIntoView(); -- -2.4.2 +2.7.1 diff -Nru wine-staging-1.9.6/patches/setupapi-DiskSpaceList/0002-setupapi-Implement-SetupAddToDiskSpaceList.patch wine-staging-1.9.7~ubuntu15.04.1/patches/setupapi-DiskSpaceList/0002-setupapi-Implement-SetupAddToDiskSpaceList.patch --- wine-staging-1.9.6/patches/setupapi-DiskSpaceList/0002-setupapi-Implement-SetupAddToDiskSpaceList.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/setupapi-DiskSpaceList/0002-setupapi-Implement-SetupAddToDiskSpaceList.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,4 +1,4 @@ -From 675e85075039dca812bdfeb5e353d45d9da6cac3 Mon Sep 17 00:00:00 2001 +From cdef6edd147384d61717cd37a83c7864db4e53dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Thu, 3 Mar 2016 05:02:21 +0100 Subject: setupapi: Implement SetupAddToDiskSpaceList. @@ -9,7 +9,7 @@ 2 files changed, 285 insertions(+), 11 deletions(-) diff --git a/dlls/setupapi/diskspace.c b/dlls/setupapi/diskspace.c -index 7c33542..0e589fa 100644 +index 7c33542..f945b99 100644 --- a/dlls/setupapi/diskspace.c +++ b/dlls/setupapi/diskspace.c @@ -49,7 +49,21 @@ struct space_list @@ -55,8 +55,8 @@ + BOOL ret = FALSE; + DWORD size; + -+ TRACE("(%p, %s, %llu, %u, %p, %u)\n", diskspace, debugstr_w(targetfile), filesize, -+ operation, reserved1, reserved2); ++ TRACE("(%p, %s, %s, %u, %p, %u)\n", diskspace, debugstr_w(targetfile), ++ wine_dbgstr_longlong(filesize), operation, reserved1, reserved2); + + if (!targetfile) + return TRUE; diff -Nru wine-staging-1.9.6/patches/setupapi-SetupDiSetDeviceInstallParamsW/0001-setupapi-add-SetupDiSetDeviceInstallParamsW-stub.patch wine-staging-1.9.7~ubuntu15.04.1/patches/setupapi-SetupDiSetDeviceInstallParamsW/0001-setupapi-add-SetupDiSetDeviceInstallParamsW-stub.patch --- wine-staging-1.9.6/patches/setupapi-SetupDiSetDeviceInstallParamsW/0001-setupapi-add-SetupDiSetDeviceInstallParamsW-stub.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/setupapi-SetupDiSetDeviceInstallParamsW/0001-setupapi-add-SetupDiSetDeviceInstallParamsW-stub.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -From b56da992c9fe09059e922603182063bbb21ccbd1 Mon Sep 17 00:00:00 2001 -From: Austin English -Date: Fri, 3 Apr 2015 17:06:51 -0500 -Subject: setupapi: add SetupDiSetDeviceInstallParamsW stub. - -Fixes https://bugs.winehq.org/show_bug.cgi?id=38347 ---- - dlls/setupapi/devinst.c | 13 +++++++++++++ - dlls/setupapi/setupapi.spec | 2 +- - 2 files changed, 14 insertions(+), 1 deletion(-) - -diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c -index 966af75..eaaa40e 100644 ---- a/dlls/setupapi/devinst.c -+++ b/dlls/setupapi/devinst.c -@@ -3710,6 +3710,19 @@ BOOL WINAPI SetupDiSetDeviceInstallParamsA( - return TRUE; - } - -+/*********************************************************************** -+ * SetupDiSetDeviceInstallParamsW (SETUPAPI.@) -+ */ -+BOOL WINAPI SetupDiSetDeviceInstallParamsW( -+ HDEVINFO DeviceInfoSet, -+ PSP_DEVINFO_DATA DeviceInfoData, -+ PSP_DEVINSTALL_PARAMS_W DeviceInstallParams) -+{ -+ FIXME("(%p, %p, %p) stub\n", DeviceInfoSet, DeviceInfoData, DeviceInstallParams); -+ -+ return TRUE; -+} -+ - static HKEY SETUPDI_OpenDevKey(struct DeviceInfo *devInfo, REGSAM samDesired) - { - HKEY enumKey, key = INVALID_HANDLE_VALUE; -diff --git a/dlls/setupapi/setupapi.spec b/dlls/setupapi/setupapi.spec -index c1dbed5..c8e7677 100644 ---- a/dlls/setupapi/setupapi.spec -+++ b/dlls/setupapi/setupapi.spec -@@ -386,7 +386,7 @@ - @ stdcall SetupDiSetClassInstallParamsA(ptr ptr ptr long) - @ stdcall SetupDiSetClassInstallParamsW(ptr ptr ptr long) - @ stdcall SetupDiSetDeviceInstallParamsA(ptr ptr ptr) --@ stub SetupDiSetDeviceInstallParamsW -+@ stdcall SetupDiSetDeviceInstallParamsW(ptr ptr ptr) - @ stdcall SetupDiSetDeviceRegistryPropertyA(ptr ptr long ptr ptr) - @ stdcall SetupDiSetDeviceRegistryPropertyW(ptr ptr long ptr ptr) - @ stub SetupDiSetDriverInstallParamsA --- -2.3.5 - diff -Nru wine-staging-1.9.6/patches/setupapi-SetupDiSetDeviceInstallParamsW/definition wine-staging-1.9.7~ubuntu15.04.1/patches/setupapi-SetupDiSetDeviceInstallParamsW/definition --- wine-staging-1.9.6/patches/setupapi-SetupDiSetDeviceInstallParamsW/definition 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/setupapi-SetupDiSetDeviceInstallParamsW/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -Fixes: [29903] Add stub for setupapi.SetupDiSetDeviceInstallParamsW -Category: stable diff -Nru wine-staging-1.9.6/patches/shell32-Context_Menu/0001-shell32-Fix-copying-of-files-when-using-a-context-me.patch wine-staging-1.9.7~ubuntu15.04.1/patches/shell32-Context_Menu/0001-shell32-Fix-copying-of-files-when-using-a-context-me.patch --- wine-staging-1.9.6/patches/shell32-Context_Menu/0001-shell32-Fix-copying-of-files-when-using-a-context-me.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/shell32-Context_Menu/0001-shell32-Fix-copying-of-files-when-using-a-context-me.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,30 @@ +From 9175a389d86cc231e7e8158360402feb7c5b269e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 2 Apr 2016 00:22:30 +0200 +Subject: shell32: Fix copying of files when using a context menu. + +--- + dlls/shell32/shlview_cmenu.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/dlls/shell32/shlview_cmenu.c b/dlls/shell32/shlview_cmenu.c +index 099f5bc..552b809 100644 +--- a/dlls/shell32/shlview_cmenu.c ++++ b/dlls/shell32/shlview_cmenu.c +@@ -739,6 +739,13 @@ static BOOL DoPaste(ContextMenu *This) + + apidl = _ILCopyCidaToaPidl(&pidl, lpcida); + ++ /* ++ * In case source is a file we need to remove the last component ++ * to obtain a IShellFolder of the parent. ++ */ ++ if (_ILIsValue(pidl)) ++ ILRemoveLastID(pidl); ++ + /* bind to the source shellfolder */ + SHGetDesktopFolder(&psfDesktop); + if(psfDesktop) +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/shell32-Context_Menu/0002-shell32-Set-return-value-correctly-in-DoPaste.patch wine-staging-1.9.7~ubuntu15.04.1/patches/shell32-Context_Menu/0002-shell32-Set-return-value-correctly-in-DoPaste.patch --- wine-staging-1.9.6/patches/shell32-Context_Menu/0002-shell32-Set-return-value-correctly-in-DoPaste.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/shell32-Context_Menu/0002-shell32-Set-return-value-correctly-in-DoPaste.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,26 @@ +From 7f13fd37d55efe4cc20c4c3eb1c79d3c8ef0040d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 2 Apr 2016 01:21:34 +0200 +Subject: shell32: Set return value correctly in DoPaste. + +--- + dlls/shell32/shlview_cmenu.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/dlls/shell32/shlview_cmenu.c b/dlls/shell32/shlview_cmenu.c +index 552b809..7ce6cd9 100644 +--- a/dlls/shell32/shlview_cmenu.c ++++ b/dlls/shell32/shlview_cmenu.c +@@ -764,7 +764,8 @@ static BOOL DoPaste(ContextMenu *This) + /* do the copy/move */ + if (psfhlpdst && psfhlpsrc) + { +- ISFHelper_CopyItems(psfhlpdst, psfFrom, lpcida->cidl, (LPCITEMIDLIST*)apidl); ++ if (SUCCEEDED(ISFHelper_CopyItems(psfhlpdst, psfFrom, lpcida->cidl, (LPCITEMIDLIST*)apidl))) ++ bSuccess = TRUE; + /* FIXME handle move + ISFHelper_DeleteItems(psfhlpsrc, lpcida->cidl, apidl); + */ +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/shell32-Context_Menu/0003-shell32-Implement-insert-paste-for-item-context-menu.patch wine-staging-1.9.7~ubuntu15.04.1/patches/shell32-Context_Menu/0003-shell32-Implement-insert-paste-for-item-context-menu.patch --- wine-staging-1.9.6/patches/shell32-Context_Menu/0003-shell32-Implement-insert-paste-for-item-context-menu.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/shell32-Context_Menu/0003-shell32-Implement-insert-paste-for-item-context-menu.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,165 @@ +From f378913d8cb2e40abb4e24d4bfaf0cbe7ea8134a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 2 Apr 2016 01:39:40 +0200 +Subject: shell32: Implement insert/paste for item context menus. + +--- + dlls/shell32/shell32.rc | 1 + + dlls/shell32/shlview_cmenu.c | 68 +++++++++++++++++++++++++++++++++++++++----- + 2 files changed, 62 insertions(+), 7 deletions(-) + +diff --git a/dlls/shell32/shell32.rc b/dlls/shell32/shell32.rc +index bfba962..4f2015b 100644 +--- a/dlls/shell32/shell32.rc ++++ b/dlls/shell32/shell32.rc +@@ -99,6 +99,7 @@ BEGIN + MENUITEM SEPARATOR + MENUITEM "C&ut", FCIDM_SHVIEW_CUT + MENUITEM "&Copy", FCIDM_SHVIEW_COPY ++ MENUITEM "&Paste", FCIDM_SHVIEW_INSERT + MENUITEM SEPARATOR + MENUITEM "Create &Link", FCIDM_SHVIEW_CREATELINK + MENUITEM "&Delete", FCIDM_SHVIEW_DELETE +diff --git a/dlls/shell32/shlview_cmenu.c b/dlls/shell32/shlview_cmenu.c +index 7ce6cd9..d972922 100644 +--- a/dlls/shell32/shlview_cmenu.c ++++ b/dlls/shell32/shlview_cmenu.c +@@ -59,6 +59,8 @@ typedef struct + BOOL desktop; + } ContextMenu; + ++static BOOL DoPaste(ContextMenu *This); ++ + static inline ContextMenu *impl_from_IContextMenu3(IContextMenu3 *iface) + { + return CONTAINING_RECORD(iface, ContextMenu, IContextMenu3_iface); +@@ -123,6 +125,30 @@ static ULONG WINAPI ContextMenu_Release(IContextMenu3 *iface) + return ref; + } + ++static BOOL CheckClipboard(void) ++{ ++ IDataObject *pda; ++ BOOL ret = FALSE; ++ ++ if (SUCCEEDED(OleGetClipboard(&pda))) ++ { ++ STGMEDIUM medium; ++ FORMATETC formatetc; ++ ++ /* Set the FORMATETC structure*/ ++ InitFormatEtc(formatetc, RegisterClipboardFormatW(CFSTR_SHELLIDLISTW), TYMED_HGLOBAL); ++ ++ /* Get the pidls from IDataObject */ ++ if (SUCCEEDED(IDataObject_GetData(pda, &formatetc, &medium))) ++ { ++ ReleaseStgMedium(&medium); ++ ret = TRUE; ++ } ++ IDataObject_Release(pda); ++ } ++ return ret; ++} ++ + static HRESULT WINAPI ItemMenu_QueryContextMenu( + IContextMenu3 *iface, + HMENU hmenu, +@@ -133,6 +159,7 @@ static HRESULT WINAPI ItemMenu_QueryContextMenu( + { + ContextMenu *This = impl_from_IContextMenu3(iface); + INT uIDMax; ++ DWORD attr = SFGAO_CANRENAME; + + TRACE("(%p)->(%p %d 0x%x 0x%x 0x%x )\n", This, hmenu, indexMenu, idCmdFirst, idCmdLast, uFlags); + +@@ -169,6 +196,9 @@ static HRESULT WINAPI ItemMenu_QueryContextMenu( + + SetMenuDefaultItem(hmenu, 0, MF_BYPOSITION); + ++ if (This->apidl && This->cidl == 1) ++ IShellFolder_GetAttributesOf(This->parent, 1, (LPCITEMIDLIST*)This->apidl, &attr); ++ + if(uFlags & ~CMF_CANRENAME) + RemoveMenu(hmenu, FCIDM_SHVIEW_RENAME, MF_BYCOMMAND); + else +@@ -179,16 +209,14 @@ static HRESULT WINAPI ItemMenu_QueryContextMenu( + if (!This->apidl || This->cidl > 1) + enable |= MFS_DISABLED; + else +- { +- DWORD attr = SFGAO_CANRENAME; +- +- IShellFolder_GetAttributesOf(This->parent, 1, (LPCITEMIDLIST*)This->apidl, &attr); + enable |= (attr & SFGAO_CANRENAME) ? MFS_ENABLED : MFS_DISABLED; +- } + + EnableMenuItem(hmenu, FCIDM_SHVIEW_RENAME, enable); + } + ++ if ((attr & (SFGAO_FILESYSTEM|SFGAO_FOLDER)) != (SFGAO_FILESYSTEM|SFGAO_FOLDER) || !CheckClipboard()) ++ RemoveMenu(hmenu, FCIDM_SHVIEW_INSERT + idCmdFirst, MF_BYCOMMAND); ++ + return MAKE_HRESULT(SEVERITY_SUCCESS, 0, uIDMax-idCmdFirst); + } + return MAKE_HRESULT(SEVERITY_SUCCESS, 0, 0); +@@ -447,6 +475,10 @@ static HRESULT WINAPI ItemMenu_InvokeCommand( + TRACE("Verb FCIDM_SHVIEW_CUT\n"); + DoCopyOrCut(This, lpcmi->hwnd, TRUE); + break; ++ case FCIDM_SHVIEW_INSERT: ++ TRACE("Verb FCIDM_SHVIEW_INSERT\n"); ++ DoPaste(This); ++ break; + case FCIDM_SHVIEW_PROPERTIES: + TRACE("Verb FCIDM_SHVIEW_PROPERTIES\n"); + DoOpenProperties(This, lpcmi->hwnd); +@@ -510,6 +542,10 @@ static HRESULT WINAPI ItemMenu_GetCommandString( + strcpy(lpszName, "copy"); + hr = S_OK; + break; ++ case FCIDM_SHVIEW_INSERT: ++ strcpy(lpszName, "paste"); ++ hr = S_OK; ++ break; + case FCIDM_SHVIEW_CREATELINK: + strcpy(lpszName, "link"); + hr = S_OK; +@@ -550,6 +586,10 @@ static HRESULT WINAPI ItemMenu_GetCommandString( + MultiByteToWideChar(CP_ACP, 0, "copy", -1, (LPWSTR)lpszName, uMaxNameLen); + hr = S_OK; + break; ++ case FCIDM_SHVIEW_INSERT: ++ MultiByteToWideChar(CP_ACP, 0, "paste", -1, (LPWSTR)lpszName, uMaxNameLen); ++ hr = S_OK; ++ break; + case FCIDM_SHVIEW_CREATELINK: + MultiByteToWideChar(CP_ACP, 0, "link", -1, (LPWSTR)lpszName, uMaxNameLen); + hr = S_OK; +@@ -757,8 +797,22 @@ static BOOL DoPaste(ContextMenu *This) + if (psfFrom) + { + /* get source and destination shellfolder */ +- ISFHelper *psfhlpdst, *psfhlpsrc; +- IShellFolder_QueryInterface(This->parent, &IID_ISFHelper, (void**)&psfhlpdst); ++ ISFHelper *psfhlpdst = NULL, *psfhlpsrc = NULL; ++ ++ /* when using an item context menu we first need to bind to the selected folder */ ++ if (This->apidl) ++ { ++ IShellFolder *folder; ++ ++ if (SUCCEEDED(IShellFolder_BindToObject(This->parent, This->apidl[0], NULL, &IID_IShellFolder, (LPVOID*)&folder))) ++ { ++ IShellFolder_QueryInterface(folder, &IID_ISFHelper, (void**)&psfhlpdst); ++ IShellFolder_Release(folder); ++ } ++ } ++ else ++ IShellFolder_QueryInterface(This->parent, &IID_ISFHelper, (void**)&psfhlpdst); ++ + IShellFolder_QueryInterface(psfFrom, &IID_ISFHelper, (void**)&psfhlpsrc); + + /* do the copy/move */ +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/shell32-Context_Menu/0004-shell32-Correctly-interpret-result-of-SHFileOperatio.patch wine-staging-1.9.7~ubuntu15.04.1/patches/shell32-Context_Menu/0004-shell32-Correctly-interpret-result-of-SHFileOperatio.patch --- wine-staging-1.9.6/patches/shell32-Context_Menu/0004-shell32-Correctly-interpret-result-of-SHFileOperatio.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/shell32-Context_Menu/0004-shell32-Correctly-interpret-result-of-SHFileOperatio.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,35 @@ +From 540ec171b1ad3d84c2087f616151103e4a4593df Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 2 Apr 2016 03:47:48 +0200 +Subject: shell32: Correctly interpret result of SHFileOperation in UNIXFS copy + and delete. + +--- + dlls/shell32/shfldr_unixfs.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dlls/shell32/shfldr_unixfs.c b/dlls/shell32/shfldr_unixfs.c +index be1ba81..17998f2 100644 +--- a/dlls/shell32/shfldr_unixfs.c ++++ b/dlls/shell32/shfldr_unixfs.c +@@ -847,7 +847,7 @@ static HRESULT UNIXFS_copy(LPCWSTR pwszDosSrc, LPCWSTR pwszDosDst) + op.pFrom = pwszSrc; + op.pTo = pwszDst; + op.fFlags = FOF_ALLOWUNDO; +- if (!SHFileOperationW(&op)) ++ if (SHFileOperationW(&op)) + { + WARN("SHFileOperationW failed\n"); + res = E_FAIL; +@@ -1981,7 +1981,7 @@ static HRESULT UNIXFS_delete_with_shfileop(UnixFolder *This, UINT cidl, const LP + op.wFunc = FO_DELETE; + op.pFrom = wszPathsList; + op.fFlags = FOF_ALLOWUNDO; +- if (!SHFileOperationW(&op)) ++ if (SHFileOperationW(&op)) + { + WARN("SHFileOperationW failed\n"); + ret = E_FAIL; +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/shell32-Context_Menu/0005-shell32-Add-support-for-setting-getting-PREFERREDDRO.patch wine-staging-1.9.7~ubuntu15.04.1/patches/shell32-Context_Menu/0005-shell32-Add-support-for-setting-getting-PREFERREDDRO.patch --- wine-staging-1.9.6/patches/shell32-Context_Menu/0005-shell32-Add-support-for-setting-getting-PREFERREDDRO.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/shell32-Context_Menu/0005-shell32-Add-support-for-setting-getting-PREFERREDDRO.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,159 @@ +From 9540fdc5b1668e4b575ce00539454b8ac66457a0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 2 Apr 2016 04:15:02 +0200 +Subject: shell32: Add support for setting/getting PREFERREDDROPEFFECT in + IDataObject. + +--- + dlls/shell32/clipboard.c | 40 ++++++++++++++++++++++++++++++++++++++++ + dlls/shell32/dataobject.c | 24 +++++++++++++++++++++--- + dlls/shell32/shell32_main.h | 2 ++ + 3 files changed, 63 insertions(+), 3 deletions(-) + +diff --git a/dlls/shell32/clipboard.c b/dlls/shell32/clipboard.c +index 82df534..9c6f284 100644 +--- a/dlls/shell32/clipboard.c ++++ b/dlls/shell32/clipboard.c +@@ -38,6 +38,8 @@ + #include + #include + ++#define NONAMELESSUNION ++ + #include "windef.h" + #include "winbase.h" + #include "winreg.h" +@@ -214,3 +216,41 @@ HGLOBAL RenderFILENAMEW (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl) + + return hGlobal; + } ++ ++HGLOBAL RenderPREFERREDDROPEFFECT (DWORD value) ++{ ++ DWORD *pEffect; ++ HGLOBAL hGlobal; ++ ++ TRACE("(%d)\n", value); ++ ++ hGlobal = GlobalAlloc(GHND|GMEM_SHARE, sizeof(DWORD)); ++ if(!hGlobal) return hGlobal; ++ ++ pEffect = GlobalLock(hGlobal); ++ if (pEffect) ++ { ++ *pEffect = value; ++ GlobalUnlock(hGlobal); ++ } ++ ++ return hGlobal; ++} ++ ++HRESULT GetPREFERREDDROPEFFECT (STGMEDIUM *pmedium, DWORD *value) ++{ ++ DWORD *pEffect; ++ BOOL result = E_OUTOFMEMORY; ++ ++ TRACE("(%p, %p)\n", pmedium, value); ++ ++ pEffect = GlobalLock(pmedium->u.hGlobal); ++ if (pEffect) ++ { ++ *value = *pEffect; ++ result = S_OK; ++ GlobalUnlock(pmedium->u.hGlobal); ++ } ++ ++ return result; ++} +diff --git a/dlls/shell32/dataobject.c b/dlls/shell32/dataobject.c +index cc7b63e..5a18a1a 100644 +--- a/dlls/shell32/dataobject.c ++++ b/dlls/shell32/dataobject.c +@@ -197,7 +197,7 @@ LPENUMFORMATETC IEnumFORMATETC_Constructor(UINT cfmt, const FORMATETC afmt[]) + */ + + /* number of supported formats */ +-#define MAX_FORMATS 4 ++#define MAX_FORMATS 5 + + typedef struct + { +@@ -209,12 +209,13 @@ typedef struct + LPITEMIDLIST pidl; + LPITEMIDLIST * apidl; + UINT cidl; ++ DWORD dropEffect; + + FORMATETC pFormatEtc[MAX_FORMATS]; + UINT cfShellIDList; + UINT cfFileNameA; + UINT cfFileNameW; +- ++ UINT cfDropEffect; + } IDataObjectImpl; + + static inline IDataObjectImpl *impl_from_IDataObject(IDataObject *iface) +@@ -314,6 +315,10 @@ static HRESULT WINAPI IDataObject_fnGetData(IDataObject *iface, LPFORMATETC pfor + if (This->cidl < 1) return(E_UNEXPECTED); + pmedium->u.hGlobal = RenderFILENAMEW(This->pidl, This->apidl, This->cidl); + } ++ else if (pformatetcIn->cfFormat == This->cfDropEffect) ++ { ++ pmedium->u.hGlobal = RenderPREFERREDDROPEFFECT(This->dropEffect); ++ } + else + { + FIXME("-- expected clipformat not implemented\n"); +@@ -368,7 +373,17 @@ static HRESULT WINAPI IDataObject_fnGetCanonicalFormatEtc(IDataObject *iface, LP + static HRESULT WINAPI IDataObject_fnSetData(IDataObject *iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease) + { + IDataObjectImpl *This = impl_from_IDataObject(iface); +- FIXME("(%p)->()\n", This); ++ ++ FIXME("(%p)->(%p, %p, %u): semi-stub\n", This, pformatetc, pmedium, fRelease); ++ ++ if (pformatetc->cfFormat == This->cfDropEffect) ++ { ++ if (pmedium->tymed == TYMED_HGLOBAL) ++ return GetPREFERREDDROPEFFECT(pmedium, &This->dropEffect); ++ else ++ return DV_E_TYMED; ++ } ++ + return E_NOTIMPL; + } + +@@ -441,14 +456,17 @@ IDataObject* IDataObject_Constructor(HWND hwndOwner, + dto->pidl = ILClone(pMyPidl); + dto->apidl = _ILCopyaPidl(apidl, cidl); + dto->cidl = cidl; ++ dto->dropEffect = 0; + + dto->cfShellIDList = RegisterClipboardFormatW(CFSTR_SHELLIDLISTW); + dto->cfFileNameA = RegisterClipboardFormatA(CFSTR_FILENAMEA); + dto->cfFileNameW = RegisterClipboardFormatW(CFSTR_FILENAMEW); ++ dto->cfDropEffect = RegisterClipboardFormatW(CFSTR_PREFERREDDROPEFFECTW); + InitFormatEtc(dto->pFormatEtc[0], dto->cfShellIDList, TYMED_HGLOBAL); + InitFormatEtc(dto->pFormatEtc[1], CF_HDROP, TYMED_HGLOBAL); + InitFormatEtc(dto->pFormatEtc[2], dto->cfFileNameA, TYMED_HGLOBAL); + InitFormatEtc(dto->pFormatEtc[3], dto->cfFileNameW, TYMED_HGLOBAL); ++ InitFormatEtc(dto->pFormatEtc[4], dto->cfDropEffect, TYMED_HGLOBAL); + } + + TRACE("(%p)->(apidl=%p cidl=%u)\n",dto, apidl, cidl); +diff --git a/dlls/shell32/shell32_main.h b/dlls/shell32/shell32_main.h +index 492f79f..29822b7 100644 +--- a/dlls/shell32/shell32_main.h ++++ b/dlls/shell32/shell32_main.h +@@ -130,6 +130,8 @@ HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl) DECL + HGLOBAL RenderSHELLIDLIST (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl) DECLSPEC_HIDDEN; + HGLOBAL RenderFILENAMEA (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl) DECLSPEC_HIDDEN; + HGLOBAL RenderFILENAMEW (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl) DECLSPEC_HIDDEN; ++HGLOBAL RenderPREFERREDDROPEFFECT (DWORD value); ++HRESULT GetPREFERREDDROPEFFECT (STGMEDIUM *pmedium, DWORD *value); + + /* Change Notification */ + void InitChangeNotifications(void) DECLSPEC_HIDDEN; +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/shell32-Context_Menu/0006-shell32-Add-parameter-to-ISFHelper-DeleteItems-to-al.patch wine-staging-1.9.7~ubuntu15.04.1/patches/shell32-Context_Menu/0006-shell32-Add-parameter-to-ISFHelper-DeleteItems-to-al.patch --- wine-staging-1.9.6/patches/shell32-Context_Menu/0006-shell32-Add-parameter-to-ISFHelper-DeleteItems-to-al.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/shell32-Context_Menu/0006-shell32-Add-parameter-to-ISFHelper-DeleteItems-to-al.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,152 @@ +From 60a000e4b5c59b93db1ea24566ad4d7eeea9408b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 2 Apr 2016 04:17:19 +0200 +Subject: shell32: Add parameter to ISFHelper::DeleteItems to allow deleting + files without confirmation. + +--- + dlls/shell32/recyclebin.c | 6 +++--- + dlls/shell32/shellfolder.h | 4 ++-- + dlls/shell32/shfldr_fs.c | 3 ++- + dlls/shell32/shfldr_unixfs.c | 7 ++++--- + dlls/shell32/shlview.c | 2 +- + dlls/shell32/shlview_cmenu.c | 2 +- + 6 files changed, 13 insertions(+), 11 deletions(-) + +diff --git a/dlls/shell32/recyclebin.c b/dlls/shell32/recyclebin.c +index 28098af..f890d97 100644 +--- a/dlls/shell32/recyclebin.c ++++ b/dlls/shell32/recyclebin.c +@@ -182,7 +182,7 @@ static void DoErase(RecycleBinMenu *This) + ISFHelper *helper; + IShellFolder2_QueryInterface(This->folder,&IID_ISFHelper,(void**)&helper); + if(helper) +- ISFHelper_DeleteItems(helper,This->cidl,(LPCITEMIDLIST*)This->apidl); ++ ISFHelper_DeleteItems(helper, This->cidl, (LPCITEMIDLIST *)This->apidl, TRUE); + } + + static void DoRestore(RecycleBinMenu *This) +@@ -824,10 +824,10 @@ static HRESULT erase_items(HWND parent,const LPCITEMIDLIST * apidl, UINT cidl, B + } + + static HRESULT WINAPI RecycleBin_DeleteItems(ISFHelper * iface, UINT cidl, +- LPCITEMIDLIST * apidl) ++ LPCITEMIDLIST * apidl, BOOL confirm) + { + TRACE("(%p,%u,%p)\n",iface,cidl,apidl); +- return erase_items(GetActiveWindow(),apidl,cidl,TRUE); ++ return erase_items(GetActiveWindow(), apidl, cidl, confirm); + } + + static HRESULT WINAPI RecycleBin_CopyItems(ISFHelper * iface, +diff --git a/dlls/shell32/shellfolder.h b/dlls/shell32/shellfolder.h +index 942e0e7..b8083a2 100644 +--- a/dlls/shell32/shellfolder.h ++++ b/dlls/shell32/shellfolder.h +@@ -48,7 +48,7 @@ DECLARE_INTERFACE_(ISFHelper,IUnknown) + /*** ISFHelper methods ***/ + STDMETHOD(GetUniqueName)(THIS_ LPWSTR lpName, UINT uLen) PURE; + STDMETHOD(AddFolder)(THIS_ HWND hwnd, LPCWSTR lpName, LPITEMIDLIST * ppidlOut) PURE; +- STDMETHOD(DeleteItems)(THIS_ UINT cidl, LPCITEMIDLIST * apidl) PURE; ++ STDMETHOD(DeleteItems)(THIS_ UINT cidl, LPCITEMIDLIST *apidl, BOOL confirm) PURE; + STDMETHOD(CopyItems)(THIS_ IShellFolder * pSFFrom, UINT cidl, LPCITEMIDLIST * apidl) PURE; + }; + #undef INTERFACE +@@ -61,7 +61,7 @@ DECLARE_INTERFACE_(ISFHelper,IUnknown) + /*** ISFHelper methods ***/ + #define ISFHelper_GetUniqueName(p,a,b) (p)->lpVtbl->GetUniqueName(p,a,b) + #define ISFHelper_AddFolder(p,a,b,c) (p)->lpVtbl->AddFolder(p,a,b,c) +-#define ISFHelper_DeleteItems(p,a,b) (p)->lpVtbl->DeleteItems(p,a,b) ++#define ISFHelper_DeleteItems(p,a,b,c) (p)->lpVtbl->DeleteItems(p,a,b,c) + #define ISFHelper_CopyItems(p,a,b,c) (p)->lpVtbl->CopyItems(p,a,b,c) + #endif + +diff --git a/dlls/shell32/shfldr_fs.c b/dlls/shell32/shfldr_fs.c +index d8bcb4c..3d88fbd 100644 +--- a/dlls/shell32/shfldr_fs.c ++++ b/dlls/shell32/shfldr_fs.c +@@ -1230,7 +1230,7 @@ static WCHAR *build_paths_list(LPCWSTR wszBasePath, int cidl, const LPCITEMIDLIS + * deletes items in folder + */ + static HRESULT WINAPI +-ISFHelper_fnDeleteItems (ISFHelper * iface, UINT cidl, LPCITEMIDLIST * apidl) ++ISFHelper_fnDeleteItems (ISFHelper *iface, UINT cidl, LPCITEMIDLIST *apidl, BOOL confirm) + { + IGenericSFImpl *This = impl_from_ISFHelper(iface); + UINT i; +@@ -1255,6 +1255,7 @@ ISFHelper_fnDeleteItems (ISFHelper * iface, UINT cidl, LPCITEMIDLIST * apidl) + op.wFunc = FO_DELETE; + op.pFrom = wszPathsList; + op.fFlags = FOF_ALLOWUNDO; ++ if (!confirm) op.fFlags |= FOF_NOCONFIRMATION; + if (SHFileOperationW(&op)) + { + WARN("SHFileOperation failed\n"); +diff --git a/dlls/shell32/shfldr_unixfs.c b/dlls/shell32/shfldr_unixfs.c +index 17998f2..d558efb 100644 +--- a/dlls/shell32/shfldr_unixfs.c ++++ b/dlls/shell32/shfldr_unixfs.c +@@ -1939,7 +1939,7 @@ static HRESULT WINAPI SFHelper_AddFolder(ISFHelper* iface, HWND hwnd, LPCWSTR pw + * be converted, S_FALSE is returned. In such situation DeleteItems will try to delete + * the files using syscalls + */ +-static HRESULT UNIXFS_delete_with_shfileop(UnixFolder *This, UINT cidl, const LPCITEMIDLIST *apidl) ++static HRESULT UNIXFS_delete_with_shfileop(UnixFolder *This, UINT cidl, const LPCITEMIDLIST *apidl, BOOL confirm) + { + char szAbsolute[FILENAME_MAX], *pszRelative; + LPWSTR wszPathsList, wszListPos; +@@ -1981,6 +1981,7 @@ static HRESULT UNIXFS_delete_with_shfileop(UnixFolder *This, UINT cidl, const LP + op.wFunc = FO_DELETE; + op.pFrom = wszPathsList; + op.fFlags = FOF_ALLOWUNDO; ++ if (!confirm) op.fFlags |= FOF_NOCONFIRMATION; + if (SHFileOperationW(&op)) + { + WARN("SHFileOperationW failed\n"); +@@ -2019,7 +2020,7 @@ static HRESULT UNIXFS_delete_with_syscalls(UnixFolder *This, UINT cidl, const LP + return S_OK; + } + +-static HRESULT WINAPI SFHelper_DeleteItems(ISFHelper* iface, UINT cidl, LPCITEMIDLIST* apidl) ++static HRESULT WINAPI SFHelper_DeleteItems(ISFHelper *iface, UINT cidl, LPCITEMIDLIST *apidl, BOOL confirm) + { + UnixFolder *This = impl_from_ISFHelper(iface); + char szAbsolute[FILENAME_MAX], *pszRelative; +@@ -2030,7 +2031,7 @@ static HRESULT WINAPI SFHelper_DeleteItems(ISFHelper* iface, UINT cidl, LPCITEMI + + TRACE("(%p)->(%d %p)\n", This, cidl, apidl); + +- hr = UNIXFS_delete_with_shfileop(This, cidl, apidl); ++ hr = UNIXFS_delete_with_shfileop(This, cidl, apidl, confirm); + if (hr == S_FALSE) + hr = UNIXFS_delete_with_syscalls(This, cidl, apidl); + +diff --git a/dlls/shell32/shlview.c b/dlls/shell32/shlview.c +index b763468..1770e6f 100644 +--- a/dlls/shell32/shlview.c ++++ b/dlls/shell32/shlview.c +@@ -1579,7 +1579,7 @@ static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpn + } + + /* perform the item deletion */ +- ISFHelper_DeleteItems(psfhlp, i, (LPCITEMIDLIST*)pItems); ++ ISFHelper_DeleteItems(psfhlp, i, (LPCITEMIDLIST *)pItems, TRUE); + ISFHelper_Release(psfhlp); + + /* free pidl array memory */ +diff --git a/dlls/shell32/shlview_cmenu.c b/dlls/shell32/shlview_cmenu.c +index d972922..494d95b 100644 +--- a/dlls/shell32/shlview_cmenu.c ++++ b/dlls/shell32/shlview_cmenu.c +@@ -275,7 +275,7 @@ static void DoDelete(ContextMenu *This) + IShellFolder_QueryInterface(This->parent, &IID_ISFHelper, (void**)&helper); + if (helper) + { +- ISFHelper_DeleteItems(helper, This->cidl, (LPCITEMIDLIST*)This->apidl); ++ ISFHelper_DeleteItems(helper, This->cidl, (LPCITEMIDLIST *)This->apidl, TRUE); + ISFHelper_Release(helper); + } + } +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/shell32-Context_Menu/0007-shell32-Remove-source-files-when-using-cut-in-the-co.patch wine-staging-1.9.7~ubuntu15.04.1/patches/shell32-Context_Menu/0007-shell32-Remove-source-files-when-using-cut-in-the-co.patch --- wine-staging-1.9.6/patches/shell32-Context_Menu/0007-shell32-Remove-source-files-when-using-cut-in-the-co.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/shell32-Context_Menu/0007-shell32-Remove-source-files-when-using-cut-in-the-co.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,113 @@ +From c6df9e2fd8f92597a728935e67a6ac6c3bc1223c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 2 Apr 2016 04:22:07 +0200 +Subject: shell32: Remove source files when using cut in the context menu. + +--- + dlls/shell32/shlview_cmenu.c | 75 +++++++++++++++++++++++++++++++++++++++++--- + 1 file changed, 71 insertions(+), 4 deletions(-) + +diff --git a/dlls/shell32/shlview_cmenu.c b/dlls/shell32/shlview_cmenu.c +index 494d95b..c32a4e8 100644 +--- a/dlls/shell32/shlview_cmenu.c ++++ b/dlls/shell32/shlview_cmenu.c +@@ -281,6 +281,64 @@ static void DoDelete(ContextMenu *This) + } + + /************************************************************************** ++ * SetDropEffect ++ * ++ * Set the drop effect in a IDataObject object ++ */ ++static void SetDropEffect(IDataObject *dataobject, DWORD value) ++{ ++ FORMATETC formatetc; ++ STGMEDIUM medium; ++ DWORD *effect; ++ ++ InitFormatEtc(formatetc, RegisterClipboardFormatW(CFSTR_PREFERREDDROPEFFECTW), TYMED_HGLOBAL); ++ ++ medium.tymed = TYMED_HGLOBAL; ++ medium.pUnkForRelease = NULL; ++ medium.u.hGlobal = GlobalAlloc(GHND|GMEM_SHARE, sizeof(DWORD)); ++ if (!medium.u.hGlobal) return; ++ ++ effect = GlobalLock(medium.u.hGlobal); ++ if (!effect) ++ { ++ ReleaseStgMedium(&medium); ++ return; ++ } ++ *effect = value; ++ GlobalUnlock(effect); ++ ++ IDataObject_SetData(dataobject, &formatetc, &medium, FALSE); ++ ReleaseStgMedium(&medium); ++} ++ ++/************************************************************************** ++ * GetDropEffect ++ * ++ * Get the drop effect from a IDataObject object ++ */ ++static void GetDropEffect(IDataObject *dataobject, DWORD *value) ++{ ++ FORMATETC formatetc; ++ STGMEDIUM medium; ++ DWORD *effect; ++ ++ *value = DROPEFFECT_NONE; ++ ++ InitFormatEtc(formatetc, RegisterClipboardFormatW(CFSTR_PREFERREDDROPEFFECTW), TYMED_HGLOBAL); ++ ++ if (SUCCEEDED(IDataObject_GetData(dataobject, &formatetc, &medium))) ++ { ++ effect = GlobalLock(medium.u.hGlobal); ++ if (effect) ++ { ++ *value = *effect; ++ GlobalUnlock(effect); ++ } ++ ReleaseStgMedium(&medium); ++ } ++} ++ ++/************************************************************************** + * DoCopyOrCut + * + * copies the currently selected items into the clipboard +@@ -293,6 +351,7 @@ static void DoCopyOrCut(ContextMenu *This, HWND hwnd, BOOL cut) + + if (SUCCEEDED(IShellFolder_GetUIObjectOf(This->parent, hwnd, This->cidl, (LPCITEMIDLIST*)This->apidl, &IID_IDataObject, 0, (void**)&dataobject))) + { ++ SetDropEffect(dataobject, cut ? DROPEFFECT_MOVE : DROPEFFECT_COPY); + OleSetClipboard(dataobject); + IDataObject_Release(dataobject); + } +@@ -818,11 +877,19 @@ static BOOL DoPaste(ContextMenu *This) + /* do the copy/move */ + if (psfhlpdst && psfhlpsrc) + { ++ DWORD dropEffect; ++ GetDropEffect(pda, &dropEffect); ++ + if (SUCCEEDED(ISFHelper_CopyItems(psfhlpdst, psfFrom, lpcida->cidl, (LPCITEMIDLIST*)apidl))) +- bSuccess = TRUE; +- /* FIXME handle move +- ISFHelper_DeleteItems(psfhlpsrc, lpcida->cidl, apidl); +- */ ++ { ++ if (dropEffect == DROPEFFECT_MOVE) ++ { ++ if (SUCCEEDED(ISFHelper_DeleteItems(psfhlpsrc, lpcida->cidl, (LPCITEMIDLIST*)apidl, FALSE))) ++ bSuccess = TRUE; ++ } ++ else ++ bSuccess = TRUE; ++ } + } + if(psfhlpdst) ISFHelper_Release(psfhlpdst); + if(psfhlpsrc) ISFHelper_Release(psfhlpsrc); +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/shell32-Context_Menu/0008-shell32-Recognize-cut-copy-paste-string-verbs-in-ite.patch wine-staging-1.9.7~ubuntu15.04.1/patches/shell32-Context_Menu/0008-shell32-Recognize-cut-copy-paste-string-verbs-in-ite.patch --- wine-staging-1.9.6/patches/shell32-Context_Menu/0008-shell32-Recognize-cut-copy-paste-string-verbs-in-ite.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/shell32-Context_Menu/0008-shell32-Recognize-cut-copy-paste-string-verbs-in-ite.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,30 @@ +From 47c24300c6530de5dfe32f352ef839e62ebbd520 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 2 Apr 2016 04:41:56 +0200 +Subject: shell32: Recognize cut/copy/paste string verbs in item menu context + menu. + +--- + dlls/shell32/shlview_cmenu.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/dlls/shell32/shlview_cmenu.c b/dlls/shell32/shlview_cmenu.c +index c32a4e8..cfe88d5 100644 +--- a/dlls/shell32/shlview_cmenu.c ++++ b/dlls/shell32/shlview_cmenu.c +@@ -554,6 +554,12 @@ static HRESULT WINAPI ItemMenu_InvokeCommand( + DoDelete(This); + else if (strcmp(lpcmi->lpVerb,"properties")==0) + DoOpenProperties(This, lpcmi->hwnd); ++ else if (strcmp(lpcmi->lpVerb,"cut")==0) ++ DoCopyOrCut(This, lpcmi->hwnd, TRUE); ++ else if (strcmp(lpcmi->lpVerb,"copy")==0) ++ DoCopyOrCut(This, lpcmi->hwnd, FALSE); ++ else if (strcmp(lpcmi->lpVerb,"paste")==0) ++ DoPaste(This); + else { + FIXME("Unhandled string verb %s\n",debugstr_a(lpcmi->lpVerb)); + return E_FAIL; +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/shell32-Context_Menu/definition wine-staging-1.9.7~ubuntu15.04.1/patches/shell32-Context_Menu/definition --- wine-staging-1.9.6/patches/shell32-Context_Menu/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/shell32-Context_Menu/definition 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,3 @@ +Fixes: [34319] Add support for Paste in context menu +Fixes: [34322] Fix implementation of Cut file operation +Fixes: [34321] Fix Cut/Copy/Paste keyboard shortcuts in Total Commander diff -Nru wine-staging-1.9.6/patches/shlwapi-IStream_fnRead/0001-shlwapi-Fix-IStream-Read-return-value-for-partial-re.patch wine-staging-1.9.7~ubuntu15.04.1/patches/shlwapi-IStream_fnRead/0001-shlwapi-Fix-IStream-Read-return-value-for-partial-re.patch --- wine-staging-1.9.6/patches/shlwapi-IStream_fnRead/0001-shlwapi-Fix-IStream-Read-return-value-for-partial-re.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/shlwapi-IStream_fnRead/0001-shlwapi-Fix-IStream-Read-return-value-for-partial-re.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,56 @@ +From 7c8ff77dc75904e59427b65f18c7c9d97f3831a4 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Sun, 27 Mar 2016 17:29:34 +0800 +Subject: shlwapi: Fix IStream::Read() return value for partial reads. + +--- + dlls/shlwapi/istream.c | 2 +- + dlls/shlwapi/tests/istream.c | 15 ++++++++++++++- + 2 files changed, 15 insertions(+), 2 deletions(-) + +diff --git a/dlls/shlwapi/istream.c b/dlls/shlwapi/istream.c +index e641995..946d2c8 100644 +--- a/dlls/shlwapi/istream.c ++++ b/dlls/shlwapi/istream.c +@@ -130,7 +130,7 @@ static HRESULT WINAPI IStream_fnRead(IStream *iface, void* pv, ULONG cb, ULONG* + } + if (pcbRead) + *pcbRead = dwRead; +- return S_OK; ++ return dwRead == cb ? S_OK : S_FALSE; + } + + /************************************************************************** +diff --git a/dlls/shlwapi/tests/istream.c b/dlls/shlwapi/tests/istream.c +index 48a292a..c9cf62f 100644 +--- a/dlls/shlwapi/tests/istream.c ++++ b/dlls/shlwapi/tests/istream.c +@@ -247,11 +247,24 @@ static void test_stream_read_write(IStream *stream, DWORD mode) + } + else + { +-todo_wine + ok(ret == S_FALSE, "expected S_FALSE, got %#x (access %#x, written %u)\n", ret, mode, written); + ok(count == 0, "expected 0, got %u\n", count); + } + ++ ret = stream->lpVtbl->Seek(stream, start, STREAM_SEEK_SET, NULL); ++ ok(ret == S_OK, "Seek error %#x\n", ret); ++ ++ count = 0xdeadbeaf; ++ ret = stream->lpVtbl->Read(stream, buf, 0, &count); ++ ok(ret == S_OK, "IStream_Read error %#x (access %#x, written %u)\n", ret, mode, written); ++ ok(count == 0, "expected 0, got %u\n", count); ++ ++ count = 0xdeadbeaf; ++ ret = stream->lpVtbl->Read(stream, buf, sizeof(buf), &count); ++ ok(ret == S_FALSE, "expected S_FALSE, got %#x (access %#x, written %u)\n", ret, mode, written); ++ ok(count == written, "expected %u, got %u\n", written, count); ++ if (count) ++ ok(buf[0] == 0x5e && buf[1] == 0xa7, "expected 5ea7, got %02x%02x\n", buf[0], buf[1]); + } + + static void test_SHCreateStreamOnFileA(DWORD mode, DWORD stgm) +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/shlwapi-IStream_fnRead/definition wine-staging-1.9.7~ubuntu15.04.1/patches/shlwapi-IStream_fnRead/definition --- wine-staging-1.9.6/patches/shlwapi-IStream_fnRead/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/shlwapi-IStream_fnRead/definition 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1 @@ +Fixes: Fix IStream::Read() return value for partial reads diff -Nru wine-staging-1.9.6/patches/Staging/0004-loader-Add-commandline-option-check-libs.patch wine-staging-1.9.7~ubuntu15.04.1/patches/Staging/0004-loader-Add-commandline-option-check-libs.patch --- wine-staging-1.9.6/patches/Staging/0004-loader-Add-commandline-option-check-libs.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/Staging/0004-loader-Add-commandline-option-check-libs.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,16 +1,16 @@ -From e71a6c24c41e3d390a81aac1986938a1db71f9e6 Mon Sep 17 00:00:00 2001 +From 41863fd8fdf3a885efa93359a538e4e74258fb30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Wed, 28 May 2014 19:50:51 +0200 Subject: loader: Add commandline option --check-libs. --- include/wine/library.h | 2 + - libs/wine/config.c | 112 +++++++++++++++++++++++++++++++++++++++++++++++++ - libs/wine/loader.c | 36 ++++++++++++++++ + libs/wine/config.c | 124 +++++++++++++++++++++++++++++++++++++++++++++++++ + libs/wine/loader.c | 36 ++++++++++++++ libs/wine/wine.def | 2 + libs/wine/wine.map | 2 + - loader/main.c | 50 +++++++++++++++++++++- - 6 files changed, 203 insertions(+), 1 deletion(-) + loader/main.c | 50 +++++++++++++++++++- + 6 files changed, 215 insertions(+), 1 deletion(-) diff --git a/include/wine/library.h b/include/wine/library.h index fae73fe..7395a11 100644 @@ -33,14 +33,17 @@ extern void *wine_dlsym( void *handle, const char *symbol, char *error, size_t errorsize ); extern int wine_dlclose( void *handle, char *error, size_t errorsize ); diff --git a/libs/wine/config.c b/libs/wine/config.c -index 5262c76..7acf51b 100644 +index 12f4a67..be9f401 100644 --- a/libs/wine/config.c +++ b/libs/wine/config.c -@@ -444,6 +444,118 @@ const char *wine_get_build_dir(void) +@@ -443,6 +443,130 @@ const char *wine_get_build_dir(void) return build_dir; } +const char *wine_libs[] = { ++#ifdef SONAME_LIBCAIRO ++ SONAME_LIBCAIRO, ++#endif +#ifdef SONAME_LIBCAPI20 + SONAME_LIBCAPI20, +#endif @@ -65,9 +68,15 @@ +#ifdef SONAME_LIBGNUTLS + SONAME_LIBGNUTLS, +#endif ++#ifdef SONAME_LIBGOBJECT_2_0 ++ SONAME_LIBGOBJECT_2_0, ++#endif +#ifdef SONAME_LIBGSM + SONAME_LIBGSM, +#endif ++#ifdef SONAME_LIBGTK_3 ++ SONAME_LIBGTK_3, ++#endif +#ifdef SONAME_LIBHAL + SONAME_LIBHAL, +#endif @@ -116,6 +125,9 @@ +#ifdef SONAME_LIBX11 + SONAME_LIBX11, +#endif ++#ifdef SONAME_LIBX11_XCB ++ SONAME_LIBX11_XCB, ++#endif +#ifdef SONAME_LIBXCOMPOSITE + SONAME_LIBXCOMPOSITE, +#endif @@ -156,10 +168,10 @@ const char *wine_get_server_dir(void) { diff --git a/libs/wine/loader.c b/libs/wine/loader.c -index 3591ede..2718857 100644 +index b5b32cc..1453a82 100644 --- a/libs/wine/loader.c +++ b/libs/wine/loader.c -@@ -1043,6 +1043,42 @@ void *wine_dlopen( const char *filename, int flag, char *error, size_t errorsize +@@ -1041,6 +1041,42 @@ void *wine_dlopen( const char *filename, int flag, char *error, size_t errorsize } /*********************************************************************** @@ -243,7 +255,7 @@ wine_get_sortkey; wine_get_ss; diff --git a/loader/main.c b/loader/main.c -index fa0efa2..e96363d 100644 +index 343ea26..44804e1 100644 --- a/loader/main.c +++ b/loader/main.c @@ -36,6 +36,12 @@ @@ -318,5 +330,5 @@ -- -2.3.1 +2.7.1 diff -Nru wine-staging-1.9.6/patches/user32-Dialog_Owner/0001-user32-tests-Add-some-tests-for-dialog-owner-disable.patch wine-staging-1.9.7~ubuntu15.04.1/patches/user32-Dialog_Owner/0001-user32-tests-Add-some-tests-for-dialog-owner-disable.patch --- wine-staging-1.9.6/patches/user32-Dialog_Owner/0001-user32-tests-Add-some-tests-for-dialog-owner-disable.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/user32-Dialog_Owner/0001-user32-tests-Add-some-tests-for-dialog-owner-disable.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,146 @@ +From 42523810c310acb304dd44f3df0087c69989aade Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Wed, 30 Mar 2016 17:44:05 +0800 +Subject: user32/tests: Add some tests for dialog owner disabled state. (v3) + +--- + dlls/user32/tests/win.c | 98 ++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 96 insertions(+), 2 deletions(-) + +diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c +index 957e8a1d..528669e 100644 +--- a/dlls/user32/tests/win.c ++++ b/dlls/user32/tests/win.c +@@ -4258,6 +4258,78 @@ static INT_PTR WINAPI empty_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM + return 0; + } + ++static INT_PTR WINAPI empty_dlg_proc3(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) ++{ ++ if (msg == WM_INITDIALOG) ++ EndDialog(hwnd, 0); ++ ++ return 0; ++} ++ ++struct dialog_param ++{ ++ HWND parent, grand_parent; ++ DLGTEMPLATE *dlg_data; ++}; ++ ++static INT_PTR WINAPI empty_dlg_proc2(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) ++{ ++ if (msg == WM_INITDIALOG) ++ { ++ DWORD style = GetWindowLongA(hwnd, GWL_STYLE); ++ struct dialog_param *param = (struct dialog_param *)lparam; ++ BOOL parent_is_child; ++ HWND disabled_hwnd; ++ ++ parent_is_child = (GetWindowLongA(param->parent, GWL_STYLE) & (WS_POPUP | WS_CHILD)) == WS_CHILD; ++ ++ ok(IsWindowEnabled(hwnd), "wrong state for %p\n", hwnd); ++ if (parent_is_child) ++ { ++ ok(IsWindowEnabled(param->parent), "wrong state for %08x\n", style); ++ disabled_hwnd = param->grand_parent; ++ } ++ else ++ { ++ ok(!IsWindowEnabled(param->parent), "wrong state for %08x\n", style); ++ disabled_hwnd = param->parent; ++ } ++ ++ if (param->grand_parent) ++ { ++ if (parent_is_child) ++ ok(!IsWindowEnabled(param->grand_parent), "wrong state for %08x\n", style); ++ else ++ ok(IsWindowEnabled(param->grand_parent), "wrong state for %08x\n", style); ++ } ++ ++ DialogBoxIndirectParamA(GetModuleHandleA(NULL), param->dlg_data, disabled_hwnd, empty_dlg_proc3, 0); ++ todo_wine_if ((style & (WS_CHILD|WS_POPUP)) == WS_CHILD) ++ ok(IsWindowEnabled(disabled_hwnd), "wrong state for %08x\n", style); ++ ++ ok(IsWindowEnabled(hwnd), "wrong state for %p\n", hwnd); ++ ok(IsWindowEnabled(param->parent), "wrong state for %p\n", param->parent); ++ if (param->grand_parent) ++ todo_wine_if ((style & (WS_CHILD|WS_POPUP)) == WS_CHILD) ++ ok(IsWindowEnabled(param->grand_parent), "wrong state for %p (%08x)\n", param->grand_parent, style); ++ ++ DialogBoxIndirectParamA(GetModuleHandleA(NULL), param->dlg_data, hwnd, empty_dlg_proc3, 0); ++ ok(IsWindowEnabled(hwnd), "wrong state for %p\n", hwnd); ++ ok(IsWindowEnabled(param->parent), "wrong state for %p\n", param->parent); ++ if (param->grand_parent) ++ todo_wine_if ((style & (WS_CHILD|WS_POPUP)) == WS_CHILD) ++ ok(IsWindowEnabled(param->grand_parent), "wrong state for %p (%08x)\n", param->grand_parent, style); ++ ++ param->dlg_data->style |= WS_CHILD; ++ DialogBoxIndirectParamA(GetModuleHandleA(NULL), param->dlg_data, hwnd, empty_dlg_proc3, 0); ++ todo_wine_if (!(style & (WS_CHILD|WS_POPUP))) ++ ok(IsWindowEnabled(hwnd), "wrong state for %p (%08x)\n", hwnd, style); ++ ++ EndDialog(hwnd, 0); ++ } ++ return 0; ++} ++ + static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_out, DWORD ex_style_out) + { + struct +@@ -4269,11 +4341,19 @@ static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_ou + WCHAR caption[1]; + } dlg_data; + DWORD style, ex_style; +- HWND hwnd, parent = 0; ++ HWND hwnd, grand_parent = 0, parent = 0; ++ struct dialog_param param; + + if (style_in & WS_CHILD) +- parent = CreateWindowExA(0, "static", NULL, WS_OVERLAPPEDWINDOW, ++ { ++ grand_parent = CreateWindowExA(0, "static", NULL, WS_OVERLAPPEDWINDOW, + 0, 0, 0, 0, NULL, NULL, NULL, NULL); ++ ok(grand_parent != 0, "grand_parent creation failed\n"); ++ } ++ ++ parent = CreateWindowExA(0, "static", NULL, style_in, ++ 0, 0, 0, 0, grand_parent, NULL, NULL, NULL); ++ ok(parent != 0, "parent creation failed, style %#x\n", style_in); + + dlg_data.dt.style = style_in; + dlg_data.dt.dwExtendedStyle = ex_style_in; +@@ -4297,6 +4377,8 @@ static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_ou + ok(style == (style_out | DS_3DLOOK), "got %#x\n", style); + ok(ex_style == ex_style_out, "expected ex_style %#x, got %#x\n", ex_style_out, ex_style); + ++ ok(IsWindowEnabled(parent), "wrong parent state (dialog style %#x)\n", style_in); ++ + /* try setting the styles explicitly */ + SetWindowLongA(hwnd, GWL_EXSTYLE, ex_style_in); + style = GetWindowLongA(hwnd, GWL_STYLE); +@@ -4330,7 +4412,19 @@ static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_ou + ok(ex_style == ex_style_out, "expected ex_style %#x, got %#x\n", ex_style_out, ex_style); + + DestroyWindow(hwnd); ++ ++ param.parent = parent; ++ param.grand_parent = grand_parent; ++ param.dlg_data = &dlg_data.dt; ++ DialogBoxIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, parent, empty_dlg_proc2, (LPARAM)¶m); ++ ++ ok(IsWindowEnabled(parent), "wrong parent state (dialog style %#x)\n", style_in); ++ if (grand_parent) ++ todo_wine_if ((style & (WS_CHILD|WS_POPUP)) == WS_CHILD) ++ ok(IsWindowEnabled(grand_parent), "wrong grand parent state (dialog style %#x)\n", style_in); ++ + DestroyWindow(parent); ++ DestroyWindow(grand_parent); + } + + static void test_dialog_styles(void) +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/user32-Dialog_Owner/0002-user32-Enable-the-specified-dialog-owner.patch wine-staging-1.9.7~ubuntu15.04.1/patches/user32-Dialog_Owner/0002-user32-Enable-the-specified-dialog-owner.patch --- wine-staging-1.9.6/patches/user32-Dialog_Owner/0002-user32-Enable-the-specified-dialog-owner.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/user32-Dialog_Owner/0002-user32-Enable-the-specified-dialog-owner.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,129 @@ +From 1e8d81841236d710c483dc4133fa90991bcc07d0 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Wed, 30 Mar 2016 17:58:35 +0800 +Subject: user32: Enable the specified dialog owner. + +This patch reverts d75991d80e77ac9d93b85b8369c6fce39bd4fdb2 +and a part of 0d7116b968edae3f5912112bda436df8924911fb. +--- + dlls/user.exe16/dialog.c | 4 ++-- + dlls/user.exe16/user_private.h | 2 +- + dlls/user32/controls.h | 4 ++-- + dlls/user32/dialog.c | 9 ++++----- + dlls/user32/tests/win.c | 1 - + 5 files changed, 9 insertions(+), 11 deletions(-) + +diff --git a/dlls/user.exe16/dialog.c b/dlls/user.exe16/dialog.c +index 766a468..fead42d 100644 +--- a/dlls/user.exe16/dialog.c ++++ b/dlls/user.exe16/dialog.c +@@ -744,7 +744,7 @@ INT16 WINAPI DialogBoxParam16( HINSTANCE16 hInst, LPCSTR template, + { + HWND owner = WIN_Handle32(owner16); + hwnd = DIALOG_CreateIndirect16( hInst, data, owner, dlgProc, param, TRUE ); +- if (hwnd) ret = wow_handlers32.dialog_box_loop( hwnd ); ++ if (hwnd) ret = wow_handlers32.dialog_box_loop( hwnd, owner ); + GlobalUnlock16( hmem ); + } + FreeResource16( hmem ); +@@ -764,7 +764,7 @@ INT16 WINAPI DialogBoxIndirectParam16( HINSTANCE16 hInst, HANDLE16 dlgTemplate, + if (!(ptr = GlobalLock16( dlgTemplate ))) return -1; + hwnd = DIALOG_CreateIndirect16( hInst, ptr, owner, dlgProc, param, TRUE ); + GlobalUnlock16( dlgTemplate ); +- if (hwnd) return wow_handlers32.dialog_box_loop( hwnd ); ++ if (hwnd) return wow_handlers32.dialog_box_loop( hwnd, owner ); + return -1; + } + +diff --git a/dlls/user.exe16/user_private.h b/dlls/user.exe16/user_private.h +index 3d97546..7c91afb 100644 +--- a/dlls/user.exe16/user_private.h ++++ b/dlls/user.exe16/user_private.h +@@ -63,7 +63,7 @@ struct wow_handlers32 + HWND (*get_win_handle)(HWND); + WNDPROC (*alloc_winproc)(WNDPROC,BOOL); + struct tagDIALOGINFO *(*get_dialog_info)(HWND,BOOL); +- INT (*dialog_box_loop)(HWND); ++ INT (*dialog_box_loop)(HWND,HWND); + ULONG_PTR (*get_icon_param)(HICON); + ULONG_PTR (*set_icon_param)(HICON,ULONG_PTR); + }; +diff --git a/dlls/user32/controls.h b/dlls/user32/controls.h +index 542bf39..69bc94c 100644 +--- a/dlls/user32/controls.h ++++ b/dlls/user32/controls.h +@@ -121,7 +121,7 @@ struct wow_handlers32 + HWND (*get_win_handle)(HWND); + WNDPROC (*alloc_winproc)(WNDPROC,BOOL); + struct tagDIALOGINFO *(*get_dialog_info)(HWND,BOOL); +- INT (*dialog_box_loop)(HWND); ++ INT (*dialog_box_loop)(HWND,HWND); + ULONG_PTR (*get_icon_param)(HICON); + ULONG_PTR (*set_icon_param)(HICON,ULONG_PTR); + }; +@@ -244,7 +244,7 @@ typedef struct tagDIALOGINFO + #define DF_OWNERENABLED 0x0002 + + extern DIALOGINFO *DIALOG_get_info( HWND hwnd, BOOL create ) DECLSPEC_HIDDEN; +-extern INT DIALOG_DoDialogBox( HWND hwnd ) DECLSPEC_HIDDEN; ++extern INT DIALOG_DoDialogBox( HWND hwnd, HWND owner ) DECLSPEC_HIDDEN; + + HRGN set_control_clipping( HDC hdc, const RECT *rect ) DECLSPEC_HIDDEN; + +diff --git a/dlls/user32/dialog.c b/dlls/user32/dialog.c +index 3ea426d..a61090d 100644 +--- a/dlls/user32/dialog.c ++++ b/dlls/user32/dialog.c +@@ -769,9 +769,8 @@ HWND WINAPI CreateDialogIndirectParamW( HINSTANCE hInst, LPCDLGTEMPLATEW dlgTemp + /*********************************************************************** + * DIALOG_DoDialogBox + */ +-INT DIALOG_DoDialogBox( HWND hwnd ) ++INT DIALOG_DoDialogBox( HWND hwnd, HWND owner ) + { +- HWND owner = GetWindow( hwnd, GW_OWNER ); + DIALOGINFO * dlgInfo; + MSG msg; + INT retval; +@@ -842,7 +841,7 @@ INT_PTR WINAPI DialogBoxParamA( HINSTANCE hInst, LPCSTR name, + if (!(hrsrc = FindResourceA( hInst, name, (LPSTR)RT_DIALOG ))) return -1; + if (!(ptr = LoadResource(hInst, hrsrc))) return -1; + hwnd = DIALOG_CreateIndirect( hInst, ptr, owner, dlgProc, param, FALSE, TRUE ); +- if (hwnd) return DIALOG_DoDialogBox( hwnd ); ++ if (hwnd) return DIALOG_DoDialogBox( hwnd, owner ); + return 0; + } + +@@ -860,7 +859,7 @@ INT_PTR WINAPI DialogBoxParamW( HINSTANCE hInst, LPCWSTR name, + if (!(hrsrc = FindResourceW( hInst, name, (LPWSTR)RT_DIALOG ))) return -1; + if (!(ptr = LoadResource(hInst, hrsrc))) return -1; + hwnd = DIALOG_CreateIndirect( hInst, ptr, owner, dlgProc, param, TRUE, TRUE ); +- if (hwnd) return DIALOG_DoDialogBox( hwnd ); ++ if (hwnd) return DIALOG_DoDialogBox( hwnd, owner ); + return 0; + } + +@@ -873,7 +872,7 @@ INT_PTR WINAPI DialogBoxIndirectParamAorW( HINSTANCE hInstance, LPCVOID template + LPARAM param, DWORD flags ) + { + HWND hwnd = DIALOG_CreateIndirect( hInstance, template, owner, dlgProc, param, !flags, TRUE ); +- if (hwnd) return DIALOG_DoDialogBox( hwnd ); ++ if (hwnd) return DIALOG_DoDialogBox( hwnd, owner ); + return -1; + } + +diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c +index 528669e..9c0a44a 100644 +--- a/dlls/user32/tests/win.c ++++ b/dlls/user32/tests/win.c +@@ -4322,7 +4322,6 @@ static INT_PTR WINAPI empty_dlg_proc2(HWND hwnd, UINT msg, WPARAM wparam, LPARAM + + param->dlg_data->style |= WS_CHILD; + DialogBoxIndirectParamA(GetModuleHandleA(NULL), param->dlg_data, hwnd, empty_dlg_proc3, 0); +- todo_wine_if (!(style & (WS_CHILD|WS_POPUP))) + ok(IsWindowEnabled(hwnd), "wrong state for %p (%08x)\n", hwnd, style); + + EndDialog(hwnd, 0); +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/user32-Dialog_Owner/0003-user32-Enable-correct-dialog-owner.patch wine-staging-1.9.7~ubuntu15.04.1/patches/user32-Dialog_Owner/0003-user32-Enable-correct-dialog-owner.patch --- wine-staging-1.9.6/patches/user32-Dialog_Owner/0003-user32-Enable-correct-dialog-owner.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/user32-Dialog_Owner/0003-user32-Enable-correct-dialog-owner.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,82 @@ +From c2ad598c5826f3b86111f49bde37e226ca7467fe Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Thu, 31 Mar 2016 11:50:20 +0800 +Subject: user32: Enable correct dialog owner. + +--- + dlls/user32/dialog.c | 32 ++++++++++++++++++++------------ + dlls/user32/tests/win.c | 1 - + 2 files changed, 20 insertions(+), 13 deletions(-) + +diff --git a/dlls/user32/dialog.c b/dlls/user32/dialog.c +index a61090d..d28b840 100644 +--- a/dlls/user32/dialog.c ++++ b/dlls/user32/dialog.c +@@ -434,6 +434,21 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result ) + return (LPCSTR)(((UINT_PTR)p + 3) & ~3); + } + ++static HWND real_owner( HWND owner ) ++{ ++ HWND parent; ++ /* ++ * Owner needs to be top level window. We need to duplicate the logic from server, ++ * because we need to disable it before creating dialog window. ++ */ ++ while ((GetWindowLongW( owner, GWL_STYLE ) & (WS_POPUP|WS_CHILD)) == WS_CHILD) ++ { ++ parent = GetParent( owner ); ++ if (!parent || parent == GetDesktopWindow()) break; ++ owner = parent; ++ } ++ return owner; ++} + + /*********************************************************************** + * DIALOG_CreateIndirect +@@ -586,18 +601,8 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate, + + if (modal && owner) + { +- HWND parent; +- disabled_owner = owner; +- /* +- * Owner needs to be top level window. We need to duplicate the logic from server, +- * because we need to disable it before creating dialog window. +- */ +- while ((GetWindowLongW( disabled_owner, GWL_STYLE ) & (WS_POPUP|WS_CHILD)) == WS_CHILD) +- { +- parent = GetParent( disabled_owner ); +- if (!parent || parent == GetDesktopWindow()) break; +- disabled_owner = parent; +- } ++ disabled_owner = real_owner( owner ); ++ + if (IsWindowEnabled( disabled_owner )) + { + flags |= DF_OWNERENABLED; +@@ -778,6 +783,9 @@ INT DIALOG_DoDialogBox( HWND hwnd, HWND owner ) + + if (!(dlgInfo = DIALOG_get_info( hwnd, FALSE ))) return -1; + ++ if (owner) ++ owner = real_owner( owner ); ++ + bFirstEmpty = TRUE; + if (!(dlgInfo->flags & DF_END)) /* was EndDialog called in WM_INITDIALOG ? */ + { +diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c +index 9c0a44a..5ec370e 100644 +--- a/dlls/user32/tests/win.c ++++ b/dlls/user32/tests/win.c +@@ -4419,7 +4419,6 @@ static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_ou + + ok(IsWindowEnabled(parent), "wrong parent state (dialog style %#x)\n", style_in); + if (grand_parent) +- todo_wine_if ((style & (WS_CHILD|WS_POPUP)) == WS_CHILD) + ok(IsWindowEnabled(grand_parent), "wrong grand parent state (dialog style %#x)\n", style_in); + + DestroyWindow(parent); +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/user32-Dialog_Owner/0004-user32-Unconditionally-enable-dialog-owner.patch wine-staging-1.9.7~ubuntu15.04.1/patches/user32-Dialog_Owner/0004-user32-Unconditionally-enable-dialog-owner.patch --- wine-staging-1.9.6/patches/user32-Dialog_Owner/0004-user32-Unconditionally-enable-dialog-owner.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/user32-Dialog_Owner/0004-user32-Unconditionally-enable-dialog-owner.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,92 @@ +From c47e1ecc0bfdfac833dd9548b0818087bb7bc69d Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Wed, 30 Mar 2016 18:16:54 +0800 +Subject: user32: Unconditionally enable dialog owner. + +--- + dlls/user32/controls.h | 1 - + dlls/user32/dialog.c | 8 ++------ + dlls/user32/tests/win.c | 3 --- + 3 files changed, 2 insertions(+), 10 deletions(-) + +diff --git a/dlls/user32/controls.h b/dlls/user32/controls.h +index 69bc94c..1641645 100644 +--- a/dlls/user32/controls.h ++++ b/dlls/user32/controls.h +@@ -241,7 +241,6 @@ typedef struct tagDIALOGINFO + } DIALOGINFO; + + #define DF_END 0x0001 +-#define DF_OWNERENABLED 0x0002 + + extern DIALOGINFO *DIALOG_get_info( HWND hwnd, BOOL create ) DECLSPEC_HIDDEN; + extern INT DIALOG_DoDialogBox( HWND hwnd, HWND owner ) DECLSPEC_HIDDEN; +diff --git a/dlls/user32/dialog.c b/dlls/user32/dialog.c +index d28b840..1aa954f 100644 +--- a/dlls/user32/dialog.c ++++ b/dlls/user32/dialog.c +@@ -472,7 +472,6 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate, + HWND disabled_owner = NULL; + HMENU hMenu = 0; + HFONT hUserFont = 0; +- UINT flags = 0; + UINT xBaseUnit = LOWORD(units); + UINT yBaseUnit = HIWORD(units); + +@@ -604,10 +603,7 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate, + disabled_owner = real_owner( owner ); + + if (IsWindowEnabled( disabled_owner )) +- { +- flags |= DF_OWNERENABLED; + EnableWindow( disabled_owner, FALSE ); +- } + else + disabled_owner = NULL; + } +@@ -663,7 +659,7 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate, + dlgInfo->hMenu = hMenu; + dlgInfo->xBaseUnit = xBaseUnit; + dlgInfo->yBaseUnit = yBaseUnit; +- dlgInfo->flags = flags; ++ dlgInfo->flags = 0; + + if (template.helpId) SetWindowContextHelpId( hwnd, template.helpId ); + +@@ -829,7 +825,7 @@ INT DIALOG_DoDialogBox( HWND hwnd, HWND owner ) + } + } + } +- if (dlgInfo->flags & DF_OWNERENABLED) EnableWindow( owner, TRUE ); ++ EnableWindow( owner, TRUE ); + retval = dlgInfo->idResult; + DestroyWindow( hwnd ); + return retval; +diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c +index 5ec370e..96d293d 100644 +--- a/dlls/user32/tests/win.c ++++ b/dlls/user32/tests/win.c +@@ -4304,20 +4304,17 @@ static INT_PTR WINAPI empty_dlg_proc2(HWND hwnd, UINT msg, WPARAM wparam, LPARAM + } + + DialogBoxIndirectParamA(GetModuleHandleA(NULL), param->dlg_data, disabled_hwnd, empty_dlg_proc3, 0); +- todo_wine_if ((style & (WS_CHILD|WS_POPUP)) == WS_CHILD) + ok(IsWindowEnabled(disabled_hwnd), "wrong state for %08x\n", style); + + ok(IsWindowEnabled(hwnd), "wrong state for %p\n", hwnd); + ok(IsWindowEnabled(param->parent), "wrong state for %p\n", param->parent); + if (param->grand_parent) +- todo_wine_if ((style & (WS_CHILD|WS_POPUP)) == WS_CHILD) + ok(IsWindowEnabled(param->grand_parent), "wrong state for %p (%08x)\n", param->grand_parent, style); + + DialogBoxIndirectParamA(GetModuleHandleA(NULL), param->dlg_data, hwnd, empty_dlg_proc3, 0); + ok(IsWindowEnabled(hwnd), "wrong state for %p\n", hwnd); + ok(IsWindowEnabled(param->parent), "wrong state for %p\n", param->parent); + if (param->grand_parent) +- todo_wine_if ((style & (WS_CHILD|WS_POPUP)) == WS_CHILD) + ok(IsWindowEnabled(param->grand_parent), "wrong state for %p (%08x)\n", param->grand_parent, style); + + param->dlg_data->style |= WS_CHILD; +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/user32-Dialog_Owner/definition wine-staging-1.9.7~ubuntu15.04.1/patches/user32-Dialog_Owner/definition --- wine-staging-1.9.6/patches/user32-Dialog_Owner/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/user32-Dialog_Owner/definition 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [40282] Enable the correct dialog owner in DIALOG_DoDialogBox diff -Nru wine-staging-1.9.6/patches/user32-FlashWindowEx/0001-user32-Avoid-dereferencing-NULL-pointer-in-a-trace.patch wine-staging-1.9.7~ubuntu15.04.1/patches/user32-FlashWindowEx/0001-user32-Avoid-dereferencing-NULL-pointer-in-a-trace.patch --- wine-staging-1.9.6/patches/user32-FlashWindowEx/0001-user32-Avoid-dereferencing-NULL-pointer-in-a-trace.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/user32-FlashWindowEx/0001-user32-Avoid-dereferencing-NULL-pointer-in-a-trace.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,34 @@ +From 57462a28a49782e3ef8b0efefab99d336b7d67a2 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Thu, 31 Mar 2016 10:09:03 +0800 +Subject: user32: Avoid dereferencing NULL pointer in a trace. + +--- + dlls/user32/win.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dlls/user32/win.c b/dlls/user32/win.c +index 33aedbd..43ab5ed 100644 +--- a/dlls/user32/win.c ++++ b/dlls/user32/win.c +@@ -3472,7 +3472,7 @@ BOOL WINAPI FlashWindowEx( PFLASHWINFO pfinfo ) + { + WND *wndPtr; + +- TRACE( "%p\n", pfinfo->hwnd ); ++ TRACE( "%p\n", pfinfo ); + + if (!pfinfo) + { +@@ -3485,7 +3485,7 @@ BOOL WINAPI FlashWindowEx( PFLASHWINFO pfinfo ) + SetLastError( ERROR_INVALID_PARAMETER ); + return FALSE; + } +- FIXME( "%p - semi-stub\n", pfinfo ); ++ FIXME( "%p - semi-stub\n", pfinfo->hwnd ); + + if (IsIconic( pfinfo->hwnd )) + { +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/user.exe16-CONTAINING_RECORD/0001-user.exe16-Don-t-open-code-CONTAINING_RECORD.patch wine-staging-1.9.7~ubuntu15.04.1/patches/user.exe16-CONTAINING_RECORD/0001-user.exe16-Don-t-open-code-CONTAINING_RECORD.patch --- wine-staging-1.9.6/patches/user.exe16-CONTAINING_RECORD/0001-user.exe16-Don-t-open-code-CONTAINING_RECORD.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/user.exe16-CONTAINING_RECORD/0001-user.exe16-Don-t-open-code-CONTAINING_RECORD.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,28 @@ +From b5e42836311fa14c38917f63e8c18a7cf245344f Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Fri, 25 Mar 2016 23:15:28 +0100 +Subject: user.exe16: Don't open code CONTAINING_RECORD. + +--- + dlls/user.exe16/user.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/dlls/user.exe16/user.c b/dlls/user.exe16/user.c +index aba797d..376c521 100644 +--- a/dlls/user.exe16/user.c ++++ b/dlls/user.exe16/user.c +@@ -87,10 +87,7 @@ static BOOL CALLBACK gray_string_callback( HDC hdc, LPARAM param, INT len ) + /* callback for 16-bit gray string proc with string pointer */ + static BOOL CALLBACK gray_string_callback_ptr( HDC hdc, LPARAM param, INT len ) + { +- const struct gray_string_info *info; +- char *str = (char *)param; +- +- info = (struct gray_string_info *)(str - offsetof( struct gray_string_info, str )); ++ const struct gray_string_info *info = CONTAINING_RECORD( (void *)param, struct gray_string_info, str ); + return gray_string_callback( hdc, (LPARAM)info, len ); + } + +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/vulkan-Vulkan_Implementation/0001-vulkan-Initial-implementation.patch wine-staging-1.9.7~ubuntu15.04.1/patches/vulkan-Vulkan_Implementation/0001-vulkan-Initial-implementation.patch --- wine-staging-1.9.6/patches/vulkan-Vulkan_Implementation/0001-vulkan-Initial-implementation.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/vulkan-Vulkan_Implementation/0001-vulkan-Initial-implementation.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,4 +1,4 @@ -From 714f200adf4d127a5669e41a1245c001b408791f Mon Sep 17 00:00:00 2001 +From b79f80c148b4ce39db9f16dfaf4fa11ae2f0c1ac Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 19 Mar 2016 00:42:10 +0100 Subject: vulkan: Initial implementation. (v2) @@ -9,10 +9,10 @@ dlls/vulkan-1/vulkan-1.spec | 160 + dlls/vulkan/Makefile.in | 8 + dlls/vulkan/vulkan.spec | 160 + - dlls/vulkan/vulkan_main.c | 327 +++ + dlls/vulkan/vulkan_main.c | 328 +++ dlls/vulkan/vulkan_private.h | 3296 +++++++++++++++++++++ dlls/vulkan/vulkan_thunks.c | 6593 ++++++++++++++++++++++++++++++++++++++++++ - 8 files changed, 10561 insertions(+) + 8 files changed, 10562 insertions(+) create mode 100644 dlls/vulkan-1/Makefile.in create mode 100644 dlls/vulkan-1/vulkan-1.spec create mode 100644 dlls/vulkan/Makefile.in @@ -431,10 +431,10 @@ +@ stdcall vkWaitForFences(ptr long ptr long int64) diff --git a/dlls/vulkan/vulkan_main.c b/dlls/vulkan/vulkan_main.c new file mode 100644 -index 0000000..1cc30d1 +index 0000000..b060dc2 --- /dev/null +++ b/dlls/vulkan/vulkan_main.c -@@ -0,0 +1,327 @@ +@@ -0,0 +1,328 @@ +/* + * Vulkan API implementation + * @@ -470,7 +470,6 @@ +#include "vulkan_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(vulkan); -+WINE_DECLARE_DEBUG_CHANNEL(winediag); + +static HINSTANCE vulkan_module; + @@ -479,6 +478,8 @@ +#endif + +#if defined(HAVE_X11_XLIB_H) && defined(SONAME_LIBX11_XCB) ++WINE_DECLARE_DEBUG_CHANNEL(winediag); ++ +static void *libx11_xcb_handle; +static typeof(XGetXCBConnection) *pXGetXCBConnection; + diff -Nru wine-staging-1.9.6/patches/vulkan-Vulkan_Implementation/0002-vulkan-Implement-vkGetPhysicalDeviceWin32Presentatio.patch wine-staging-1.9.7~ubuntu15.04.1/patches/vulkan-Vulkan_Implementation/0002-vulkan-Implement-vkGetPhysicalDeviceWin32Presentatio.patch --- wine-staging-1.9.6/patches/vulkan-Vulkan_Implementation/0002-vulkan-Implement-vkGetPhysicalDeviceWin32Presentatio.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/vulkan-Vulkan_Implementation/0002-vulkan-Implement-vkGetPhysicalDeviceWin32Presentatio.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,4 +1,4 @@ -From 52134024b89df5cbd86192a948631fe4281f6515 Mon Sep 17 00:00:00 2001 +From 91bbda9b333a0c0962193cb7a6837ef5340a2768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sun, 20 Mar 2016 06:47:56 +0100 Subject: vulkan: Implement vkGetPhysicalDeviceWin32PresentationSupportKHR. @@ -10,12 +10,12 @@ 3 files changed, 85 insertions(+), 3 deletions(-) diff --git a/dlls/vulkan/vulkan_main.c b/dlls/vulkan/vulkan_main.c -index 1cc30d1..76a27ec 100644 +index b060dc2..1ede8c8 100644 --- a/dlls/vulkan/vulkan_main.c +++ b/dlls/vulkan/vulkan_main.c -@@ -43,6 +43,9 @@ static Display *display; +@@ -44,6 +44,9 @@ static Display *display; + WINE_DECLARE_DEBUG_CHANNEL(winediag); - #if defined(HAVE_X11_XLIB_H) && defined(SONAME_LIBX11_XCB) static void *libx11_xcb_handle; +static typeof(xcb_get_setup) *pxcb_get_setup; +static typeof(xcb_screen_next) *pxcb_screen_next; @@ -23,7 +23,7 @@ static typeof(XGetXCBConnection) *pXGetXCBConnection; static BOOL init_x11_xcb( void ) -@@ -53,7 +56,11 @@ static BOOL init_x11_xcb( void ) +@@ -54,7 +57,11 @@ static BOOL init_x11_xcb( void ) return FALSE; } @@ -36,7 +36,7 @@ return TRUE; } -@@ -241,14 +248,56 @@ VkResult WINAPI vkCreateWin32SurfaceKHR( VkInstance instance, +@@ -242,14 +249,56 @@ VkResult WINAPI vkCreateWin32SurfaceKHR( VkInstance instance, return res; } diff -Nru wine-staging-1.9.6/patches/vulkan-Vulkan_Implementation/0003-vulkan-Use-binary-search-to-lookup-function-in-is_nu.patch wine-staging-1.9.7~ubuntu15.04.1/patches/vulkan-Vulkan_Implementation/0003-vulkan-Use-binary-search-to-lookup-function-in-is_nu.patch --- wine-staging-1.9.6/patches/vulkan-Vulkan_Implementation/0003-vulkan-Use-binary-search-to-lookup-function-in-is_nu.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/vulkan-Vulkan_Implementation/0003-vulkan-Use-binary-search-to-lookup-function-in-is_nu.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,65 @@ +From ceb7879ae9cd98600f0d1f4005559c1d2dca50a1 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Wed, 23 Mar 2016 01:11:58 +0100 +Subject: vulkan: Use binary search to lookup function in is_null_func. + +--- + dlls/vulkan/vulkan_thunks.c | 25 +++++++++++++++---------- + 1 file changed, 15 insertions(+), 10 deletions(-) + +diff --git a/dlls/vulkan/vulkan_thunks.c b/dlls/vulkan/vulkan_thunks.c +index 8333cb7..4ddb352 100644 +--- a/dlls/vulkan/vulkan_thunks.c ++++ b/dlls/vulkan/vulkan_thunks.c +@@ -6392,15 +6392,17 @@ VkResult WINAPI vkWaitForFences( VkDevice device, uint32_t fenceCount, const VkF + return p_vkWaitForFences( device, fenceCount, pFences, waitAll, timeout ); + } + +-static const struct ++struct function_entry + { + const char *name; + void **host_func; + void *null_func; +-} +-function_table[] = ++}; ++ ++static const struct function_entry function_table[] = + { + #define DEFINE_FUNCTION( f ) { #f, (void **)&p_##f, null_##f }, ++ /* functions must be sorted alphabetically */ + DEFINE_FUNCTION( vkAcquireNextImageKHR ) + DEFINE_FUNCTION( vkAllocateCommandBuffers ) + DEFINE_FUNCTION( vkAllocateDescriptorSets ) +@@ -6594,17 +6596,20 @@ BOOL init_vulkan( void ) + return TRUE; + } + ++static int compare_function_entry( const void *a, const void *b ) ++{ ++ return strcmp( ((struct function_entry *)a)->name, ((struct function_entry *)b)->name ); ++} ++ + BOOL is_null_func( const char *name ) + { +- int i; ++ struct function_entry search = { name, NULL, NULL }; ++ struct function_entry *found; + +- for (i = 0; i < ARRAY_SIZE(function_table); i++) +- { +- if (strcmp( function_table[i].name, name )) continue; +- return (*function_table[i].host_func == function_table[i].null_func); +- } ++ found = bsearch( &search, function_table, ARRAY_SIZE(function_table), ++ sizeof(function_table[0]), compare_function_entry ); + +- return FALSE; ++ return found ? (*found->host_func == found->null_func) : FALSE; + } + + void free_vulkan( void ) +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/vulkan-Vulkan_Implementation/0004-vulkan-Try-to-load-libvulkan.so.1.patch wine-staging-1.9.7~ubuntu15.04.1/patches/vulkan-Vulkan_Implementation/0004-vulkan-Try-to-load-libvulkan.so.1.patch --- wine-staging-1.9.6/patches/vulkan-Vulkan_Implementation/0004-vulkan-Try-to-load-libvulkan.so.1.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/vulkan-Vulkan_Implementation/0004-vulkan-Try-to-load-libvulkan.so.1.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,42 @@ +From e2f13a81be20013376928c02d5405c831452cddb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Fri, 1 Apr 2016 23:58:28 +0200 +Subject: vulkan: Try to load libvulkan.so.1. + +--- + dlls/vulkan/vulkan_thunks.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/dlls/vulkan/vulkan_thunks.c b/dlls/vulkan/vulkan_thunks.c +index acced5e..aea8d64 100644 +--- a/dlls/vulkan/vulkan_thunks.c ++++ b/dlls/vulkan/vulkan_thunks.c +@@ -6572,13 +6572,24 @@ static void *libvulkan_handle; + + BOOL init_vulkan( void ) + { ++ static const char *libname[] = ++ { ++ "libvulkan.so.1", ++ "libvulkan.so", ++ }; + void *ptr; + int i; + + if (!(function_heap = HeapCreate( HEAP_CREATE_ENABLE_EXECUTE, 0, 0 ))) + return FALSE; + +- if (!(libvulkan_handle = wine_dlopen( "libvulkan.so", RTLD_NOW, NULL, 0 ))) ++ for (i = 0; i < ARRAY_SIZE(libname); i++) ++ { ++ libvulkan_handle = wine_dlopen( libname[i], RTLD_NOW, NULL, 0 ); ++ if (libvulkan_handle) break; ++ } ++ ++ if (!libvulkan_handle) + { + ERR_(winediag)( "failed to load libvulkan.so, no support for vulkan\n" ); + HeapDestroy( function_heap ); +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/windowscodecs-IMILBitmapSource/0001-windowscodecs-Improve-compatibility-of-IMILBitmapSou.patch wine-staging-1.9.7~ubuntu15.04.1/patches/windowscodecs-IMILBitmapSource/0001-windowscodecs-Improve-compatibility-of-IMILBitmapSou.patch --- wine-staging-1.9.6/patches/windowscodecs-IMILBitmapSource/0001-windowscodecs-Improve-compatibility-of-IMILBitmapSou.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/windowscodecs-IMILBitmapSource/0001-windowscodecs-Improve-compatibility-of-IMILBitmapSou.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,430 @@ +From 2393324ce158c6e47d7fc3dcaf1266302e96285b Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Tue, 22 Mar 2016 23:46:30 +0800 +Subject: windowscodecs: Improve compatibility of IMILBitmapSource interface. + (v3) + +Based on Focht's investigation. This makes the test application attached +to the bug 34764 work. +--- + dlls/windowscodecs/bitmap.c | 184 ++++++++++++++++++++++++++------- + dlls/windowscodecs/wincodecs_private.h | 58 +++++++++-- + 2 files changed, 197 insertions(+), 45 deletions(-) + +diff --git a/dlls/windowscodecs/bitmap.c b/dlls/windowscodecs/bitmap.c +index 6adaab0..09a5e62 100644 +--- a/dlls/windowscodecs/bitmap.c ++++ b/dlls/windowscodecs/bitmap.c +@@ -135,6 +135,7 @@ static HRESULT WINAPI BitmapLockImpl_QueryInterface(IWICBitmapLock *iface, REFII + } + else + { ++ FIXME("unknown interface %s\n", debugstr_guid(iid)); + *ppv = NULL; + return E_NOINTERFACE; + } +@@ -248,12 +249,14 @@ static HRESULT WINAPI BitmapImpl_QueryInterface(IWICBitmap *iface, REFIID iid, + { + *ppv = &This->IWICBitmap_iface; + } +- else if (IsEqualIID(&IID_IMILBitmapSource, iid)) ++ else if (IsEqualIID(&IID_IMILBitmap, iid) || ++ IsEqualIID(&IID_IMILBitmapSource, iid)) + { + *ppv = &This->IMILBitmapSource_iface; + } + else + { ++ FIXME("unknown interface %s\n", debugstr_guid(iid)); + *ppv = NULL; + return E_NOINTERFACE; + } +@@ -479,13 +482,22 @@ static HRESULT WINAPI IMILBitmapImpl_QueryInterface(IMILBitmapSource *iface, REF + if (!ppv) return E_INVALIDARG; + + if (IsEqualIID(&IID_IUnknown, iid) || ++ IsEqualIID(&IID_IMILBitmap, iid) || + IsEqualIID(&IID_IMILBitmapSource, iid)) + { + IUnknown_AddRef(&This->IMILBitmapSource_iface); + *ppv = &This->IMILBitmapSource_iface; + return S_OK; + } ++ else if (IsEqualIID(&IID_IWICBitmap, iid) || ++ IsEqualIID(&IID_IWICBitmapSource, iid)) ++ { ++ IUnknown_AddRef(&This->IWICBitmap_iface); ++ *ppv = &This->IWICBitmap_iface; ++ return S_OK; ++ } + ++ FIXME("unknown interface %s\n", debugstr_guid(iid)); + *ppv = NULL; + return E_NOINTERFACE; + } +@@ -506,6 +518,7 @@ static HRESULT WINAPI IMILBitmapImpl_GetSize(IMILBitmapSource *iface, + UINT *width, UINT *height) + { + BitmapImpl *This = impl_from_IMILBitmapSource(iface); ++ TRACE("(%p,%p,%p)\n", iface, width, height); + return IWICBitmap_GetSize(&This->IWICBitmap_iface, width, height); + } + +@@ -559,6 +572,7 @@ static HRESULT WINAPI IMILBitmapImpl_GetPixelFormat(IMILBitmapSource *iface, + } + } + ++ TRACE("=> %u\n", *format); + return S_OK; + } + +@@ -566,6 +580,7 @@ static HRESULT WINAPI IMILBitmapImpl_GetResolution(IMILBitmapSource *iface, + double *dpix, double *dpiy) + { + BitmapImpl *This = impl_from_IMILBitmapSource(iface); ++ TRACE("(%p,%p,%p)\n", iface, dpix, dpiy); + return IWICBitmap_GetResolution(&This->IWICBitmap_iface, dpix, dpiy); + } + +@@ -573,6 +588,7 @@ static HRESULT WINAPI IMILBitmapImpl_CopyPalette(IMILBitmapSource *iface, + IWICPalette *palette) + { + BitmapImpl *This = impl_from_IMILBitmapSource(iface); ++ TRACE("(%p,%p)\n", iface, palette); + return IWICBitmap_CopyPalette(&This->IWICBitmap_iface, palette); + } + +@@ -580,10 +596,11 @@ static HRESULT WINAPI IMILBitmapImpl_CopyPixels(IMILBitmapSource *iface, + const WICRect *rc, UINT stride, UINT size, BYTE *buffer) + { + BitmapImpl *This = impl_from_IMILBitmapSource(iface); ++ TRACE("(%p,%p,%u,%u,%p)\n", iface, rc, stride, size, buffer); + return IWICBitmap_CopyPixels(&This->IWICBitmap_iface, rc, stride, size, buffer); + } + +-static HRESULT WINAPI IMILBitmapImpl_UnknownMethod1(IMILBitmapSource *iface, void **ppv) ++static HRESULT WINAPI IMILBitmapImpl_unknown1(IMILBitmapSource *iface, void **ppv) + { + BitmapImpl *This = impl_from_IMILBitmapSource(iface); + +@@ -591,12 +608,46 @@ static HRESULT WINAPI IMILBitmapImpl_UnknownMethod1(IMILBitmapSource *iface, voi + + if (!ppv) return E_INVALIDARG; + +- IUnknown_AddRef(&This->IMILUnknown1_iface); ++ /* reference count is not incremented here */ + *ppv = &This->IMILUnknown1_iface; + + return S_OK; + } + ++static HRESULT WINAPI IMILBitmapImpl_Lock(IMILBitmapSource *iface, const WICRect *rc, DWORD flags, IWICBitmapLock **lock) ++{ ++ BitmapImpl *This = impl_from_IMILBitmapSource(iface); ++ TRACE("(%p,%p,%08x,%p)\n", iface, rc, flags, lock); ++ return IWICBitmap_Lock(&This->IWICBitmap_iface, rc, flags, lock); ++} ++ ++static HRESULT WINAPI IMILBitmapImpl_Unlock(IMILBitmapSource *iface, IWICBitmapLock *lock) ++{ ++ TRACE("(%p,%p)\n", iface, lock); ++ IWICBitmapLock_Release(lock); ++ return S_OK; ++} ++ ++static HRESULT WINAPI IMILBitmapImpl_SetPalette(IMILBitmapSource *iface, IWICPalette *palette) ++{ ++ BitmapImpl *This = impl_from_IMILBitmapSource(iface); ++ TRACE("(%p,%p)\n", iface, palette); ++ return IWICBitmap_SetPalette(&This->IWICBitmap_iface, palette); ++} ++ ++static HRESULT WINAPI IMILBitmapImpl_SetResolution(IMILBitmapSource *iface, double dpix, double dpiy) ++{ ++ BitmapImpl *This = impl_from_IMILBitmapSource(iface); ++ TRACE("(%p,%f,%f)\n", iface, dpix, dpiy); ++ return IWICBitmap_SetResolution(&This->IWICBitmap_iface, dpix, dpiy); ++} ++ ++static HRESULT WINAPI IMILBitmapImpl_AddDirtyRect(IMILBitmapSource *iface, const WICRect *rc) ++{ ++ FIXME("(%p,%p): stub\n", iface, rc); ++ return E_NOTIMPL; ++} ++ + static const IMILBitmapSourceVtbl IMILBitmapImpl_Vtbl = + { + IMILBitmapImpl_QueryInterface, +@@ -607,26 +658,20 @@ static const IMILBitmapSourceVtbl IMILBitmapImpl_Vtbl = + IMILBitmapImpl_GetResolution, + IMILBitmapImpl_CopyPalette, + IMILBitmapImpl_CopyPixels, +- IMILBitmapImpl_UnknownMethod1, ++ IMILBitmapImpl_unknown1, ++ IMILBitmapImpl_Lock, ++ IMILBitmapImpl_Unlock, ++ IMILBitmapImpl_SetPalette, ++ IMILBitmapImpl_SetResolution, ++ IMILBitmapImpl_AddDirtyRect + }; + + static HRESULT WINAPI IMILUnknown1Impl_QueryInterface(IMILUnknown1 *iface, REFIID iid, + void **ppv) + { +- BitmapImpl *This = impl_from_IMILUnknown1(iface); +- +- TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv); +- +- if (!ppv) return E_INVALIDARG; +- +- if (IsEqualIID(&IID_IUnknown, iid)) +- { +- IUnknown_AddRef(&This->IMILUnknown1_iface); +- *ppv = iface; +- return S_OK; +- } +- +- return IWICBitmap_QueryInterface(&This->IWICBitmap_iface, iid, ppv); ++ FIXME("(%p,%s,%p): stub\n", iface, debugstr_guid(iid), ppv); ++ *ppv = NULL; ++ return E_NOINTERFACE; + } + + static ULONG WINAPI IMILUnknown1Impl_AddRef(IMILUnknown1 *iface) +@@ -641,47 +686,108 @@ static ULONG WINAPI IMILUnknown1Impl_Release(IMILUnknown1 *iface) + return IWICBitmap_Release(&This->IWICBitmap_iface); + } + ++DECLSPEC_HIDDEN void WINAPI IMILUnknown1Impl_unknown1(IMILUnknown1 *iface, void *arg) ++{ ++ FIXME("(%p,%p): stub\n", iface, arg); ++} ++ ++static HRESULT WINAPI IMILUnknown1Impl_unknown2(IMILUnknown1 *iface, void *arg1, void *arg2) ++{ ++ FIXME("(%p,%p,%p): stub\n", iface, arg1, arg2); ++ return E_NOTIMPL; ++} ++ ++DECLSPEC_HIDDEN HRESULT WINAPI IMILUnknown1Impl_unknown3(IMILUnknown1 *iface, void *arg) ++{ ++ FIXME("(%p,%p): stub\n", iface, arg); ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI IMILUnknown1Impl_unknown4(IMILUnknown1 *iface, void *arg) ++{ ++ FIXME("(%p,%p): stub\n", iface, arg); ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI IMILUnknown1Impl_unknown5(IMILUnknown1 *iface, void *arg) ++{ ++ FIXME("(%p,%p): stub\n", iface, arg); ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI IMILUnknown1Impl_unknown6(IMILUnknown1 *iface, DWORD64 arg) ++{ ++ FIXME("(%p,%s): stub\n", iface, wine_dbgstr_longlong(arg)); ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI IMILUnknown1Impl_unknown7(IMILUnknown1 *iface, void *arg) ++{ ++ FIXME("(%p,%p): stub\n", iface, arg); ++ return E_NOTIMPL; ++} ++ ++DECLSPEC_HIDDEN HRESULT WINAPI IMILUnknown1Impl_unknown8(IMILUnknown1 *iface) ++{ ++ FIXME("(%p): stub\n", iface); ++ return E_NOTIMPL; ++} ++ ++DEFINE_THISCALL_WRAPPER(IMILUnknown1Impl_unknown1, 8) ++DEFINE_THISCALL_WRAPPER(IMILUnknown1Impl_unknown3, 8) ++DEFINE_THISCALL_WRAPPER(IMILUnknown1Impl_unknown8, 4) ++ + static const IMILUnknown1Vtbl IMILUnknown1Impl_Vtbl = + { + IMILUnknown1Impl_QueryInterface, + IMILUnknown1Impl_AddRef, + IMILUnknown1Impl_Release, ++ THISCALL(IMILUnknown1Impl_unknown1), ++ IMILUnknown1Impl_unknown2, ++ THISCALL(IMILUnknown1Impl_unknown3), ++ IMILUnknown1Impl_unknown4, ++ IMILUnknown1Impl_unknown5, ++ IMILUnknown1Impl_unknown6, ++ IMILUnknown1Impl_unknown7, ++ THISCALL(IMILUnknown1Impl_unknown8) + }; + + static HRESULT WINAPI IMILUnknown2Impl_QueryInterface(IMILUnknown2 *iface, REFIID iid, + void **ppv) + { +- BitmapImpl *This = impl_from_IMILUnknown2(iface); +- +- TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv); +- +- if (!ppv) return E_INVALIDARG; +- +- if (IsEqualIID(&IID_IUnknown, iid)) +- { +- IUnknown_AddRef(&This->IMILUnknown2_iface); +- *ppv = iface; +- return S_OK; +- } +- +- return IWICBitmap_QueryInterface(&This->IWICBitmap_iface, iid, ppv); ++ FIXME("(%p,%s,%p): stub\n", iface, debugstr_guid(iid), ppv); ++ *ppv = NULL; ++ return E_NOINTERFACE; + } + + static ULONG WINAPI IMILUnknown2Impl_AddRef(IMILUnknown2 *iface) + { +- BitmapImpl *This = impl_from_IMILUnknown2(iface); +- return IWICBitmap_AddRef(&This->IWICBitmap_iface); ++ FIXME("(%p): stub\n", iface); ++ return 0; + } + + static ULONG WINAPI IMILUnknown2Impl_Release(IMILUnknown2 *iface) + { +- BitmapImpl *This = impl_from_IMILUnknown2(iface); +- return IWICBitmap_Release(&This->IWICBitmap_iface); ++ FIXME("(%p): stub\n", iface); ++ return 0; + } + +-static HRESULT WINAPI IMILUnknown2Impl_UnknownMethod1(IMILUnknown2 *iface, void *arg1, void *arg2) ++static HRESULT WINAPI IMILUnknown2Impl_unknown1(IMILUnknown2 *iface, void *arg1, void **arg2) + { + FIXME("(%p,%p,%p): stub\n", iface, arg1, arg2); ++ if (arg2) *arg2 = NULL; ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI IMILUnknown2Impl_unknown2(IMILUnknown2 *iface, void *arg1, void *arg2) ++{ ++ FIXME("(%p,%p,%p): stub\n", iface, arg1, arg2); ++ return E_NOTIMPL; ++} ++ ++static HRESULT WINAPI IMILUnknown2Impl_unknown3(IMILUnknown2 *iface, void *arg1) ++{ ++ FIXME("(%p,%p): stub\n", iface, arg1); + return E_NOTIMPL; + } + +@@ -690,7 +796,9 @@ static const IMILUnknown2Vtbl IMILUnknown2Impl_Vtbl = + IMILUnknown2Impl_QueryInterface, + IMILUnknown2Impl_AddRef, + IMILUnknown2Impl_Release, +- IMILUnknown2Impl_UnknownMethod1, ++ IMILUnknown2Impl_unknown1, ++ IMILUnknown2Impl_unknown2, ++ IMILUnknown2Impl_unknown3 + }; + + HRESULT BitmapImpl_Create(UINT uiWidth, UINT uiHeight, +diff --git a/dlls/windowscodecs/wincodecs_private.h b/dlls/windowscodecs/wincodecs_private.h +index f54403c..218228a 100644 +--- a/dlls/windowscodecs/wincodecs_private.h ++++ b/dlls/windowscodecs/wincodecs_private.h +@@ -30,7 +30,13 @@ DEFINE_GUID(GUID_WineContainerFormatTga, 0x0c44fda1,0xa5c5,0x4298,0x96,0x85,0x47 + + DEFINE_GUID(GUID_VendorWine, 0xddf46da1,0x7dc1,0x404e,0x98,0xf2,0xef,0xa4,0x8d,0xfc,0x95,0x0a); + ++DEFINE_GUID(IID_IMILBitmap,0xb1784d3f,0x8115,0x4763,0x13,0xaa,0x32,0xed,0xdb,0x68,0x29,0x4a); + DEFINE_GUID(IID_IMILBitmapSource,0x7543696a,0xbc8d,0x46b0,0x5f,0x81,0x8d,0x95,0x72,0x89,0x72,0xbe); ++DEFINE_GUID(IID_IMILBitmapLock,0xa67b2b53,0x8fa1,0x4155,0x8f,0x64,0x0c,0x24,0x7a,0x8f,0x84,0xcd); ++DEFINE_GUID(IID_IMILBitmapScaler,0xa767b0f0,0x1c8c,0x4aef,0x56,0x8f,0xad,0xf9,0x6d,0xcf,0xd5,0xcb); ++DEFINE_GUID(IID_IMILFormatConverter,0x7e2a746f,0x25c5,0x4851,0xb3,0xaf,0x44,0x3b,0x79,0x63,0x9e,0xc0); ++DEFINE_GUID(IID_IMILPalette,0xca8e206f,0xf22c,0x4af7,0x6f,0xba,0x7b,0xed,0x5e,0xb1,0xc9,0x2f); ++ + #define INTERFACE IMILBitmapSource + DECLARE_INTERFACE_(IMILBitmapSource,IUnknown) + { +@@ -38,16 +44,39 @@ DECLARE_INTERFACE_(IMILBitmapSource,IUnknown) + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID,void **) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; ++ /*** IWICBitmapSource methods ***/ ++ STDMETHOD_(HRESULT,GetSize)(THIS_ UINT *,UINT *) PURE; ++ STDMETHOD_(HRESULT,GetPixelFormat)(THIS_ int *) PURE; ++ STDMETHOD_(HRESULT,GetResolution)(THIS_ double *,double *) PURE; ++ STDMETHOD_(HRESULT,CopyPalette)(THIS_ IWICPalette *) PURE; ++ STDMETHOD_(HRESULT,CopyPixels)(THIS_ const WICRect *,UINT,UINT,BYTE *) PURE; + /*** IMILBitmapSource methods ***/ +- STDMETHOD_(HRESULT,GetSize)(THIS_ UINT *,UINT *); +- STDMETHOD_(HRESULT,GetPixelFormat)(THIS_ int *); +- STDMETHOD_(HRESULT,GetResolution)(THIS_ double *,double *); +- STDMETHOD_(HRESULT,CopyPalette)(THIS_ IWICPalette *); +- STDMETHOD_(HRESULT,CopyPixels)(THIS_ const WICRect *,UINT,UINT,BYTE *); +- STDMETHOD_(HRESULT,UnknownMethod1)(THIS_ void **); ++ STDMETHOD_(HRESULT,unknown1)(THIS_ void **) PURE; ++ STDMETHOD_(HRESULT,Lock)(THIS_ const WICRect *,DWORD,IWICBitmapLock **) PURE; ++ STDMETHOD_(HRESULT,Unlock)(THIS_ IWICBitmapLock *) PURE; ++ STDMETHOD_(HRESULT,SetPalette)(THIS_ IWICPalette *) PURE; ++ STDMETHOD_(HRESULT,SetResolution)(THIS_ double,double) PURE; ++ STDMETHOD_(HRESULT,AddDirtyRect)(THIS_ const WICRect *) PURE; + }; + #undef INTERFACE + ++#ifdef __i386__ /* thiscall functions are i386-specific */ ++ ++#define THISCALL(func) __thiscall_ ## func ++#define DEFINE_THISCALL_WRAPPER(func,args) \ ++ extern typeof(func) THISCALL(func); \ ++ __ASM_STDCALL_FUNC(__thiscall_ ## func, args, \ ++ "popl %eax\n\t" \ ++ "pushl %ecx\n\t" \ ++ "pushl %eax\n\t" \ ++ "jmp " __ASM_NAME(#func) __ASM_STDCALL(args) ) ++#else /* __i386__ */ ++ ++#define THISCALL(func) func ++#define DEFINE_THISCALL_WRAPPER(func,args) /* nothing */ ++ ++#endif /* __i386__ */ ++ + #define INTERFACE IMILUnknown1 + DECLARE_INTERFACE_(IMILUnknown1,IUnknown) + { +@@ -55,6 +84,19 @@ DECLARE_INTERFACE_(IMILUnknown1,IUnknown) + STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID,void **) PURE; + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; ++ /*** thiscall method ***/ ++ STDMETHOD_(void,unknown1)(THIS_ void*) PURE; ++ /*** stdcall ***/ ++ STDMETHOD_(HRESULT,unknown2)(THIS_ void*, void*) PURE; ++ /*** thiscall method ***/ ++ STDMETHOD_(HRESULT,unknown3)(THIS_ void*) PURE; ++ /*** stdcall ***/ ++ STDMETHOD_(HRESULT,unknown4)(THIS_ void*) PURE; ++ STDMETHOD_(HRESULT,unknown5)(THIS_ void*) PURE; ++ STDMETHOD_(HRESULT,unknown6)(THIS_ DWORD64) PURE; ++ STDMETHOD_(HRESULT,unknown7)(THIS_ void*) PURE; ++ /*** thiscall method ***/ ++ STDMETHOD_(HRESULT,unknown8)(THIS) PURE; + }; + #undef INTERFACE + +@@ -66,7 +108,9 @@ DECLARE_INTERFACE_(IMILUnknown2,IUnknown) + STDMETHOD_(ULONG,AddRef)(THIS) PURE; + STDMETHOD_(ULONG,Release)(THIS) PURE; + /*** unknown methods ***/ +- STDMETHOD_(HRESULT,UnknownMethod1)(THIS_ void *, void *) PURE; ++ STDMETHOD_(HRESULT,unknown1)(THIS_ void *,void **) PURE; ++ STDMETHOD_(HRESULT,unknown2)(THIS_ void *,void *) PURE; ++ STDMETHOD_(HRESULT,unknown3)(THIS_ void *) PURE; + }; + #undef INTERFACE + +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/windowscodecs-IMILBitmapSource/0002-windowscodecs-Add-support-for-IMILBitmapScaler-inter.patch wine-staging-1.9.7~ubuntu15.04.1/patches/windowscodecs-IMILBitmapSource/0002-windowscodecs-Add-support-for-IMILBitmapScaler-inter.patch --- wine-staging-1.9.6/patches/windowscodecs-IMILBitmapSource/0002-windowscodecs-Add-support-for-IMILBitmapScaler-inter.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/windowscodecs-IMILBitmapSource/0002-windowscodecs-Add-support-for-IMILBitmapScaler-inter.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,254 @@ +From 1a218a3cd7425d1cab7e11126c86948d38606704 Mon Sep 17 00:00:00 2001 +From: Dmitry Timoshkov +Date: Tue, 22 Mar 2016 23:49:42 +0800 +Subject: windowscodecs: Add support for IMILBitmapScaler interface. (v2) + +This patch makes the GOG downloader work. +--- + dlls/windowscodecs/scaler.c | 169 +++++++++++++++++++++++++++++++++ + dlls/windowscodecs/wincodecs_private.h | 19 ++++ + 2 files changed, 188 insertions(+) + +diff --git a/dlls/windowscodecs/scaler.c b/dlls/windowscodecs/scaler.c +index ebcc790..3801ea5 100644 +--- a/dlls/windowscodecs/scaler.c ++++ b/dlls/windowscodecs/scaler.c +@@ -35,6 +35,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wincodecs); + typedef struct BitmapScaler { + IWICBitmapScaler IWICBitmapScaler_iface; + LONG ref; ++ IMILBitmapScaler IMILBitmapScaler_iface; + IWICBitmapSource *source; + UINT width, height; + UINT src_width, src_height; +@@ -50,6 +51,11 @@ static inline BitmapScaler *impl_from_IWICBitmapScaler(IWICBitmapScaler *iface) + return CONTAINING_RECORD(iface, BitmapScaler, IWICBitmapScaler_iface); + } + ++static inline BitmapScaler *impl_from_IMILBitmapScaler(IMILBitmapScaler *iface) ++{ ++ return CONTAINING_RECORD(iface, BitmapScaler, IMILBitmapScaler_iface); ++} ++ + static HRESULT WINAPI BitmapScaler_QueryInterface(IWICBitmapScaler *iface, REFIID iid, + void **ppv) + { +@@ -64,8 +70,13 @@ static HRESULT WINAPI BitmapScaler_QueryInterface(IWICBitmapScaler *iface, REFII + { + *ppv = &This->IWICBitmapScaler_iface; + } ++ else if (IsEqualIID(&IID_IMILBitmapScaler, iid)) ++ { ++ *ppv = &This->IMILBitmapScaler_iface; ++ } + else + { ++ FIXME("unknown interface %s\n", debugstr_guid(iid)); + *ppv = NULL; + return E_NOINTERFACE; + } +@@ -374,6 +385,163 @@ static const IWICBitmapScalerVtbl BitmapScaler_Vtbl = { + BitmapScaler_Initialize + }; + ++static HRESULT WINAPI IMILBitmapScaler_QueryInterface(IMILBitmapScaler *iface, REFIID iid, ++ void **ppv) ++{ ++ BitmapScaler *This = impl_from_IMILBitmapScaler(iface); ++ ++ TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv); ++ ++ if (!ppv) return E_INVALIDARG; ++ ++ if (IsEqualIID(&IID_IUnknown, iid) || ++ IsEqualIID(&IID_IMILBitmapScaler, iid) || ++ IsEqualIID(&IID_IMILBitmapSource, iid)) ++ { ++ IUnknown_AddRef(&This->IMILBitmapScaler_iface); ++ *ppv = &This->IMILBitmapScaler_iface; ++ return S_OK; ++ } ++ else if (IsEqualIID(&IID_IWICBitmapScaler, iid) || ++ IsEqualIID(&IID_IWICBitmapSource, iid)) ++ { ++ IUnknown_AddRef(&This->IWICBitmapScaler_iface); ++ *ppv = &This->IWICBitmapScaler_iface; ++ return S_OK; ++ } ++ ++ FIXME("unknown interface %s\n", debugstr_guid(iid)); ++ *ppv = NULL; ++ return E_NOINTERFACE; ++} ++ ++static ULONG WINAPI IMILBitmapScaler_AddRef(IMILBitmapScaler *iface) ++{ ++ BitmapScaler *This = impl_from_IMILBitmapScaler(iface); ++ return IWICBitmapScaler_AddRef(&This->IWICBitmapScaler_iface); ++} ++ ++static ULONG WINAPI IMILBitmapScaler_Release(IMILBitmapScaler *iface) ++{ ++ BitmapScaler *This = impl_from_IMILBitmapScaler(iface); ++ return IWICBitmapScaler_Release(&This->IWICBitmapScaler_iface); ++} ++ ++static HRESULT WINAPI IMILBitmapScaler_GetSize(IMILBitmapScaler *iface, ++ UINT *width, UINT *height) ++{ ++ BitmapScaler *This = impl_from_IMILBitmapScaler(iface); ++ ++ TRACE("(%p,%p,%p)\n", iface, width, height); ++ ++ if (!This->source) ++ return WINCODEC_ERR_NOTINITIALIZED; ++ ++ return IWICBitmapScaler_GetSize(&This->IWICBitmapScaler_iface, width, height); ++} ++ ++static HRESULT WINAPI IMILBitmapScaler_GetPixelFormat(IMILBitmapScaler *iface, ++ int *format) ++{ ++ BitmapScaler *This = impl_from_IMILBitmapScaler(iface); ++ IMILBitmapSource *source; ++ HRESULT hr; ++ ++ TRACE("(%p,%p)\n", iface, format); ++ ++ if (!format) return E_INVALIDARG; ++ ++ if (!This->source) ++ return WINCODEC_ERR_NOTINITIALIZED; ++ ++ hr = IWICBitmapSource_QueryInterface(This->source, &IID_IMILBitmapSource, (void **)&source); ++ if (hr == S_OK) ++ { ++ hr = source->lpVtbl->GetPixelFormat(source, format); ++ source->lpVtbl->Release(source); ++ } ++ return hr; ++} ++ ++static HRESULT WINAPI IMILBitmapScaler_GetResolution(IMILBitmapScaler *iface, ++ double *dpix, double *dpiy) ++{ ++ BitmapScaler *This = impl_from_IMILBitmapScaler(iface); ++ ++ TRACE("(%p,%p,%p)\n", iface, dpix, dpiy); ++ ++ if (!This->source) ++ return WINCODEC_ERR_NOTINITIALIZED; ++ ++ return IWICBitmapScaler_GetResolution(&This->IWICBitmapScaler_iface, dpix, dpiy); ++} ++ ++static HRESULT WINAPI IMILBitmapScaler_CopyPalette(IMILBitmapScaler *iface, ++ IWICPalette *palette) ++{ ++ BitmapScaler *This = impl_from_IMILBitmapScaler(iface); ++ ++ TRACE("(%p,%p)\n", iface, palette); ++ ++ if (!This->source) ++ return WINCODEC_ERR_NOTINITIALIZED; ++ ++ return IWICBitmapScaler_CopyPalette(&This->IWICBitmapScaler_iface, palette); ++} ++ ++static HRESULT WINAPI IMILBitmapScaler_CopyPixels(IMILBitmapScaler *iface, ++ const WICRect *rc, UINT stride, UINT size, BYTE *buffer) ++{ ++ BitmapScaler *This = impl_from_IMILBitmapScaler(iface); ++ ++ TRACE("(%p,%p,%u,%u,%p)\n", iface, rc, stride, size, buffer); ++ ++ if (!This->source) ++ return WINCODEC_ERR_NOTINITIALIZED; ++ ++ return IWICBitmapScaler_CopyPixels(&This->IWICBitmapScaler_iface, rc, stride, size, buffer); ++} ++ ++static HRESULT WINAPI IMILBitmapScaler_unknown1(IMILBitmapScaler *iface, void **ppv) ++{ ++ TRACE("(%p,%p)\n", iface, ppv); ++ return E_NOINTERFACE; ++} ++ ++static HRESULT WINAPI IMILBitmapScaler_Initialize(IMILBitmapScaler *iface, ++ IMILBitmapSource *mil_source, UINT width, UINT height, ++ WICBitmapInterpolationMode mode) ++{ ++ BitmapScaler *This = impl_from_IMILBitmapScaler(iface); ++ IWICBitmapSource *wic_source; ++ HRESULT hr; ++ ++ TRACE("(%p,%p,%u,%u,%u)\n", iface, mil_source, width, height, mode); ++ ++ if (!mil_source) return E_INVALIDARG; ++ ++ hr = mil_source->lpVtbl->QueryInterface(mil_source, &IID_IWICBitmapSource, (void **)&wic_source); ++ if (hr == S_OK) ++ { ++ hr = IWICBitmapScaler_Initialize(&This->IWICBitmapScaler_iface, wic_source, width, height, mode); ++ IWICBitmapSource_Release(wic_source); ++ } ++ return hr; ++} ++ ++static const IMILBitmapScalerVtbl IMILBitmapScaler_Vtbl = { ++ IMILBitmapScaler_QueryInterface, ++ IMILBitmapScaler_AddRef, ++ IMILBitmapScaler_Release, ++ IMILBitmapScaler_GetSize, ++ IMILBitmapScaler_GetPixelFormat, ++ IMILBitmapScaler_GetResolution, ++ IMILBitmapScaler_CopyPalette, ++ IMILBitmapScaler_CopyPixels, ++ IMILBitmapScaler_unknown1, ++ IMILBitmapScaler_Initialize ++}; ++ + HRESULT BitmapScaler_Create(IWICBitmapScaler **scaler) + { + BitmapScaler *This; +@@ -382,6 +550,7 @@ HRESULT BitmapScaler_Create(IWICBitmapScaler **scaler) + if (!This) return E_OUTOFMEMORY; + + This->IWICBitmapScaler_iface.lpVtbl = &BitmapScaler_Vtbl; ++ This->IMILBitmapScaler_iface.lpVtbl = &IMILBitmapScaler_Vtbl; + This->ref = 1; + This->source = NULL; + This->width = 0; +diff --git a/dlls/windowscodecs/wincodecs_private.h b/dlls/windowscodecs/wincodecs_private.h +index eda1b7a..2a17fdf 100644 +--- a/dlls/windowscodecs/wincodecs_private.h ++++ b/dlls/windowscodecs/wincodecs_private.h +@@ -60,6 +60,25 @@ DECLARE_INTERFACE_(IMILBitmapSource,IUnknown) + }; + #undef INTERFACE + ++#define INTERFACE IMILBitmapScaler ++DECLARE_INTERFACE_(IMILBitmapScaler,IUnknown) ++{ ++ /*** IUnknown methods ***/ ++ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID,void **) PURE; ++ STDMETHOD_(ULONG,AddRef)(THIS) PURE; ++ STDMETHOD_(ULONG,Release)(THIS) PURE; ++ /*** IWICBitmapSource methods ***/ ++ STDMETHOD_(HRESULT,GetSize)(THIS_ UINT *,UINT *) PURE; ++ STDMETHOD_(HRESULT,GetPixelFormat)(THIS_ int *) PURE; ++ STDMETHOD_(HRESULT,GetResolution)(THIS_ double *,double *) PURE; ++ STDMETHOD_(HRESULT,CopyPalette)(THIS_ IWICPalette *) PURE; ++ STDMETHOD_(HRESULT,CopyPixels)(THIS_ const WICRect *,UINT,UINT,BYTE *) PURE; ++ /*** IMILBitmapScaler methods ***/ ++ STDMETHOD_(HRESULT,unknown1)(THIS_ void **) PURE; ++ STDMETHOD_(HRESULT,Initialize)(THIS_ IMILBitmapSource *,UINT,UINT,WICBitmapInterpolationMode); ++}; ++#undef INTERFACE ++ + #ifdef __i386__ /* thiscall functions are i386-specific */ + + #define THISCALL(func) __thiscall_ ## func +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/windowscodecs-IMILBitmapSource/definition wine-staging-1.9.7~ubuntu15.04.1/patches/windowscodecs-IMILBitmapSource/definition --- wine-staging-1.9.6/patches/windowscodecs-IMILBitmapSource/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/windowscodecs-IMILBitmapSource/definition 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [34764] Improve compatibility of IMILBitmapSource interface diff -Nru wine-staging-1.9.6/patches/winecfg-Staging/0001-winecfg-Add-staging-tab-for-CSMT.patch wine-staging-1.9.7~ubuntu15.04.1/patches/winecfg-Staging/0001-winecfg-Add-staging-tab-for-CSMT.patch --- wine-staging-1.9.6/patches/winecfg-Staging/0001-winecfg-Add-staging-tab-for-CSMT.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/winecfg-Staging/0001-winecfg-Add-staging-tab-for-CSMT.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,4 +1,4 @@ -From 3c9eab9f6e96d05a6e5ca0f82d6b52a07092c526 Mon Sep 17 00:00:00 2001 +From d88860b3dd92769f14c45c92f9640ee4a9e8efe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sun, 14 Dec 2014 20:42:45 +0100 Subject: winecfg: Add staging tab for CSMT. @@ -14,7 +14,7 @@ create mode 100644 programs/winecfg/staging.c diff --git a/programs/winecfg/Makefile.in b/programs/winecfg/Makefile.in -index 4e66e04..1cf7031 100644 +index 7b52a69..c86fdd0 100644 --- a/programs/winecfg/Makefile.in +++ b/programs/winecfg/Makefile.in @@ -11,6 +11,7 @@ C_SRCS = \ @@ -26,10 +26,10 @@ winecfg.c \ x11drvdlg.c diff --git a/programs/winecfg/main.c b/programs/winecfg/main.c -index 6ac5f89..17909dc 100644 +index b8a85fe..de209a9 100644 --- a/programs/winecfg/main.c +++ b/programs/winecfg/main.c -@@ -60,7 +60,7 @@ PropSheetCallback (HWND hWnd, UINT uMsg, LPARAM lParam) +@@ -58,7 +58,7 @@ PropSheetCallback (HWND hWnd, UINT uMsg, LPARAM lParam) return 0; } @@ -38,7 +38,7 @@ static INT_PTR doPropertySheet (HINSTANCE hInstance, HWND hOwner) -@@ -141,6 +141,16 @@ doPropertySheet (HINSTANCE hInstance, HWND hOwner) +@@ -139,6 +139,16 @@ doPropertySheet (HINSTANCE hInstance, HWND hOwner) psp[pg].lParam = 0; pg++; @@ -56,7 +56,7 @@ * Fill out the (General) PROPSHEETPAGE data structure * for the property sheet diff --git a/programs/winecfg/resource.h b/programs/winecfg/resource.h -index fffc4da..7d11050 100644 +index 0c0b038..54c67c2 100644 --- a/programs/winecfg/resource.h +++ b/programs/winecfg/resource.h @@ -45,6 +45,7 @@ @@ -75,8 +75,8 @@ #define IDC_WINVER 1012 #define IDC_DESKTOP_WIDTH 1023 #define IDC_DESKTOP_HEIGHT 1024 -@@ -202,6 +204,9 @@ - #define IDC_SYSPARAMS_MENU_HILIGHT 8430 +@@ -210,6 +212,9 @@ + #define IDC_SYSPARAMS_MENU_HIGHLIGHT 8430 #define IDC_SYSPARAMS_MENUBAR 8431 +/* Staging tab */ @@ -193,7 +193,7 @@ /* Drive management */ diff --git a/programs/winecfg/winecfg.rc b/programs/winecfg/winecfg.rc -index 9f763a7..ad3e842 100644 +index 72c3e1b..dedc039 100644 --- a/programs/winecfg/winecfg.rc +++ b/programs/winecfg/winecfg.rc @@ -39,6 +39,7 @@ BEGIN @@ -204,7 +204,7 @@ IDS_TAB_ABOUT "About" IDS_WINECFG_TITLE "Wine configuration" IDS_WINECFG_TITLE_APP "Wine configuration for %s" -@@ -297,6 +298,15 @@ BEGIN +@@ -308,6 +309,15 @@ BEGIN PUSHBUTTON "B&rowse...",IDC_BROWSE_SFPATH,195,195,50,13,WS_DISABLED END @@ -221,5 +221,5 @@ /* @makedep: winecfg.ico */ -- -2.2.1 +2.7.1 diff -Nru wine-staging-1.9.6/patches/wined3d-DXTn/0001-wined3d-Add-support-for-DXTn-software-decoding-throu.patch wine-staging-1.9.7~ubuntu15.04.1/patches/wined3d-DXTn/0001-wined3d-Add-support-for-DXTn-software-decoding-throu.patch --- wine-staging-1.9.6/patches/wined3d-DXTn/0001-wined3d-Add-support-for-DXTn-software-decoding-throu.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/wined3d-DXTn/0001-wined3d-Add-support-for-DXTn-software-decoding-throu.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,4 +1,4 @@ -From 53359a295730c47e5f0537b6c21dfa84360fb0ef Mon Sep 17 00:00:00 2001 +From b14633555358bcce6ab3dbef2573f19f72a5b2e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sat, 20 Sep 2014 02:48:07 +0200 Subject: wined3d: Add support for DXTn software decoding through libtxc_dxtn. @@ -353,10 +353,10 @@ + wine_dlclose(txc_dxtn_handle, NULL, 0); +} diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index e36e353..6bafee5 100644 +index abbab26..3668c25 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -2234,6 +2234,66 @@ static void convert_yuy2_r5g6b5(const BYTE *src, BYTE *dst, +@@ -1697,6 +1697,66 @@ static void convert_yuy2_r5g6b5(const BYTE *src, BYTE *dst, } } @@ -423,7 +423,7 @@ struct d3dfmt_converter_desc { enum wined3d_format_id from, to; -@@ -2250,6 +2310,20 @@ static const struct d3dfmt_converter_desc converters[] = +@@ -1713,6 +1773,20 @@ static const struct d3dfmt_converter_desc converters[] = {WINED3DFMT_YUY2, WINED3DFMT_B5G6R5_UNORM, convert_yuy2_r5g6b5}, }; @@ -444,7 +444,7 @@ static inline const struct d3dfmt_converter_desc *find_converter(enum wined3d_format_id from, enum wined3d_format_id to) { -@@ -2261,6 +2335,12 @@ static inline const struct d3dfmt_converter_desc *find_converter(enum wined3d_fo +@@ -1724,6 +1798,12 @@ static inline const struct d3dfmt_converter_desc *find_converter(enum wined3d_fo return &converters[i]; } @@ -458,10 +458,10 @@ } diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c -index 0543d97..4270f90 100644 +index d584664..cb55ef8 100644 --- a/dlls/wined3d/wined3d_main.c +++ b/dlls/wined3d/wined3d_main.c -@@ -319,6 +319,8 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) +@@ -333,6 +333,8 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) if (appkey) RegCloseKey( appkey ); if (hkey) RegCloseKey( hkey ); @@ -470,7 +470,7 @@ return TRUE; } -@@ -350,6 +352,9 @@ static BOOL wined3d_dll_destroy(HINSTANCE hInstDLL) +@@ -364,6 +366,9 @@ static BOOL wined3d_dll_destroy(HINSTANCE hInstDLL) DeleteCriticalSection(&wined3d_wndproc_cs); DeleteCriticalSection(&wined3d_cs); @@ -481,11 +481,11 @@ } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index ea47bbf..dc6ce3f 100644 +index 9a7dff4..e14786c 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -3386,6 +3386,19 @@ static inline BOOL needs_srgb_write(const struct wined3d_context *context, - && fb->render_targets[0]->format_flags & WINED3DFMT_FLAG_SRGB_WRITE; +@@ -3483,6 +3483,19 @@ static inline struct wined3d_surface *context_get_rt_surface(const struct wined3 + return texture->sub_resources[context->current_rt.sub_resource_idx].u.surface; } +BOOL wined3d_dxt1_decode(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, @@ -505,5 +505,5 @@ #define WINED3D_OPENGL_WINDOW_CLASS_NAME "WineD3D_OpenGL" -- -2.7.0 +2.7.1 diff -Nru wine-staging-1.9.6/patches/wined3d-DXTn/0002-wined3d-Improve-DXTn-support-and-export-conversion-f.patch wine-staging-1.9.7~ubuntu15.04.1/patches/wined3d-DXTn/0002-wined3d-Improve-DXTn-support-and-export-conversion-f.patch --- wine-staging-1.9.6/patches/wined3d-DXTn/0002-wined3d-Improve-DXTn-support-and-export-conversion-f.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/wined3d-DXTn/0002-wined3d-Improve-DXTn-support-and-export-conversion-f.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,4 +1,4 @@ -From d6cf97906b9728bf21d1e1426055bb57813ce23b Mon Sep 17 00:00:00 2001 +From 31990eb50ee15e12d709efcf1e21d3a9a2c20fb9 Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Tue, 4 Nov 2014 22:41:45 +0100 Subject: wined3d: Improve DXTn support and export conversion functions for @@ -153,10 +153,10 @@ #undef LOAD_FUNCPTR diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 6bafee5..66a6dc7 100644 +index 3668c25..1e9e02c 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -2246,6 +2246,30 @@ static void convert_dxt1_x8r8g8b8(const BYTE *src, BYTE *dst, +@@ -1709,6 +1709,30 @@ static void convert_dxt1_x8r8g8b8(const BYTE *src, BYTE *dst, wined3d_dxt1_decode(src, dst, pitch_in, pitch_out, WINED3DFMT_B8G8R8X8_UNORM, w, h); } @@ -187,7 +187,7 @@ static void convert_a8r8g8b8_dxt1(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h) { -@@ -2312,8 +2336,15 @@ static const struct d3dfmt_converter_desc converters[] = +@@ -1775,8 +1799,15 @@ static const struct d3dfmt_converter_desc converters[] = static const struct d3dfmt_converter_desc dxtn_converters[] = { @@ -204,10 +204,10 @@ {WINED3DFMT_B8G8R8X8_UNORM, WINED3DFMT_DXT1, convert_x8r8g8b8_dxt1}, {WINED3DFMT_B5G5R5A1_UNORM, WINED3DFMT_DXT1, convert_a1r5g5b5_dxt1}, diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec -index 4ec8336..8e0f06d 100644 +index 21cb0db..b7bf46d 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec -@@ -271,3 +271,11 @@ +@@ -269,3 +269,11 @@ @ cdecl wined3d_vertex_declaration_decref(ptr) @ cdecl wined3d_vertex_declaration_get_parent(ptr) @ cdecl wined3d_vertex_declaration_incref(ptr) @@ -220,11 +220,11 @@ +@ cdecl wined3d_dxt5_decode(ptr ptr long long long long long) +@ cdecl wined3d_dxt5_encode(ptr ptr long long long long long) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h -index dc6ce3f..8b2cdb2 100644 +index e14786c..e0696e1 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h -@@ -3386,17 +3386,7 @@ static inline BOOL needs_srgb_write(const struct wined3d_context *context, - && fb->render_targets[0]->format_flags & WINED3DFMT_FLAG_SRGB_WRITE; +@@ -3483,17 +3483,7 @@ static inline struct wined3d_surface *context_get_rt_surface(const struct wined3 + return texture->sub_resources[context->current_rt.sub_resource_idx].u.surface; } -BOOL wined3d_dxt1_decode(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, @@ -242,10 +242,10 @@ /* The WNDCLASS-Name for the fake window which we use to retrieve the GL capabilities */ diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h -index afe28be..7b74ad1 100644 +index cb057ab..baad228 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h -@@ -2587,4 +2587,18 @@ static inline unsigned int wined3d_log2i(unsigned int x) +@@ -2514,4 +2514,18 @@ static inline unsigned int wined3d_log2i(unsigned int x) #endif } @@ -265,5 +265,5 @@ + #endif /* __WINE_WINED3D_H */ -- -2.7.0 +2.7.1 diff -Nru wine-staging-1.9.6/patches/wined3d-Limit_Vram/0001-wined3d-Limit-the-vram-memory-to-LONG_MAX-only-on-32.patch wine-staging-1.9.7~ubuntu15.04.1/patches/wined3d-Limit_Vram/0001-wined3d-Limit-the-vram-memory-to-LONG_MAX-only-on-32.patch --- wine-staging-1.9.6/patches/wined3d-Limit_Vram/0001-wined3d-Limit-the-vram-memory-to-LONG_MAX-only-on-32.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/wined3d-Limit_Vram/0001-wined3d-Limit-the-vram-memory-to-LONG_MAX-only-on-32.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,4 +1,4 @@ -From ce91232e6d3e1dcb7b1571a9dfae76ea7a530757 Mon Sep 17 00:00:00 2001 +From 27719db1f039616a553e64234ec887b5681ae3e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sun, 20 Mar 2016 22:34:03 +0100 Subject: wined3d: Limit the vram memory to LONG_MAX only on 32 bit. @@ -7,24 +7,21 @@ versions of Windows. Windows XP 64 bit uses 5.2 as verison number and is in fact the default version used by Wine. This patch compiles the limitation only on 32 bit and therefore does not affect a default 64 bit wine prefix when using -64 bit software. The original patch also didn't work on Windows 3.1 (3.10), -98 (4.10), ME (4.90) or NT 3.51 (3.51) due to the wrong version compare. +64 bit software. --- - dlls/wined3d/directx.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) + dlls/wined3d/directx.c | 2 ++ + 1 file changed, 2 insertions(+) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c -index da66aac..c2b7583 100644 +index f57f326..06f79ae 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c -@@ -1528,12 +1528,14 @@ static void init_driver_info(struct wined3d_driver_info *driver_info, +@@ -1533,11 +1533,13 @@ static void init_driver_info(struct wined3d_driver_info *driver_info, * In order to avoid this application bug we limit the amount of video memory * to LONG_MAX for older Windows versions. */ -- if (os_version.dwMajorVersion <= 5 && os_version.dwMinorVersion <= 2 +#ifdef __i386__ -+ if ((os_version.dwMajorVersion < 5 || (os_version.dwMajorVersion == 5 && os_version.dwMinorVersion <= 2)) - && driver_info->vram_bytes > LONG_MAX) + if (driver_model < DRIVER_MODEL_NT6X && driver_info->vram_bytes > LONG_MAX) { TRACE("Limiting amount of video memory to %#lx bytes for OS version older than Vista.\n", LONG_MAX); driver_info->vram_bytes = LONG_MAX; diff -Nru wine-staging-1.9.6/patches/wined3d-resource_map/0001-wined3d-Rename-wined3d_resource_-un-map-to-wined3d_r.patch wine-staging-1.9.7~ubuntu15.04.1/patches/wined3d-resource_map/0001-wined3d-Rename-wined3d_resource_-un-map-to-wined3d_r.patch --- wine-staging-1.9.6/patches/wined3d-resource_map/0001-wined3d-Rename-wined3d_resource_-un-map-to-wined3d_r.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/wined3d-resource_map/0001-wined3d-Rename-wined3d_resource_-un-map-to-wined3d_r.patch 2016-04-04 18:23:50.000000000 +0000 @@ -1,4 +1,4 @@ -From c81211b6fa3814abbb6e1aa27a4c3c7913f6cf53 Mon Sep 17 00:00:00 2001 +From 0c9c1b424f62d37107a26397a0c8a29cf985abac 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 @@ -21,10 +21,10 @@ 12 files changed, 44 insertions(+), 44 deletions(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c -index 6ec154f..56fb86d 100644 +index 8a53e89..935b1ee 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c -@@ -267,7 +267,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_Map(ID3D11DeviceContext +@@ -273,7 +273,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_Map(ID3D11DeviceContext wined3d_resource = wined3d_resource_from_d3d11_resource(resource); wined3d_mutex_lock(); @@ -33,7 +33,7 @@ &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 +@@ -294,7 +294,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_Unmap(ID3D11DeviceContext wined3d_resource = wined3d_resource_from_d3d11_resource(resource); wined3d_mutex_lock(); @@ -43,7 +43,7 @@ } diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c -index 11bda45..e24f945 100644 +index c6cdc29..a3f56b8 100644 --- a/dlls/d3d11/texture.c +++ b/dlls/d3d11/texture.c @@ -366,7 +366,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_texture2d_Map(ID3D10Texture2D *iface, UIN @@ -171,10 +171,10 @@ if (hr == WINEDDERR_NOTLOCKED) diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c -index d133e7e..09a3cca 100644 +index 83457fc..7f51a1d 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c -@@ -984,7 +984,7 @@ static HRESULT surface_lock(struct ddraw_surface *surface, +@@ -991,7 +991,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)) @@ -183,7 +183,7 @@ 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 +@@ -1166,7 +1166,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH ddraw_surface7_Unlock(IDirectDrawSurface TRACE("iface %p, rect %s.\n", iface, wine_dbgstr_rect(pRect)); wined3d_mutex_lock(); @@ -227,7 +227,7 @@ if (src_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_MIPMAP) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c -index d032184..c410a47 100644 +index ef8095f..9539e9c 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3570,7 +3570,7 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, @@ -241,14 +241,14 @@ @@ -3579,7 +3579,7 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device, wined3d_volume_upload_data(dst_texture->sub_resources[i].u.volume, context, &data); - wined3d_volume_invalidate_location(dst_texture->sub_resources[i].u.volume, ~WINED3D_LOCATION_TEXTURE_RGB); + wined3d_texture_invalidate_location(dst_texture, i, ~WINED3D_LOCATION_TEXTURE_RGB); - if (FAILED(hr = wined3d_resource_unmap(&src_texture->resource, src_level + i))) + if (FAILED(hr = wined3d_resource_sub_resource_unmap(&src_texture->resource, src_level + i))) goto done; } -@@ -4228,7 +4228,7 @@ static struct wined3d_texture *wined3d_device_create_cursor_texture(struct wined +@@ -4291,7 +4291,7 @@ static struct wined3d_texture *wined3d_device_create_cursor_texture(struct wined struct wined3d_texture *texture; HRESULT hr; @@ -257,7 +257,7 @@ { ERR("Failed to map source texture.\n"); return NULL; -@@ -4251,7 +4251,7 @@ static struct wined3d_texture *wined3d_device_create_cursor_texture(struct wined +@@ -4314,7 +4314,7 @@ static struct wined3d_texture *wined3d_device_create_cursor_texture(struct wined hr = wined3d_texture_create(device, &desc, 1, WINED3D_TEXTURE_CREATE_MAPPABLE, &data, NULL, &wined3d_null_parent_ops, &texture); @@ -266,7 +266,7 @@ if (FAILED(hr)) { ERR("Failed to create cursor texture.\n"); -@@ -4332,7 +4332,7 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device +@@ -4395,7 +4395,7 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device return E_OUTOFMEMORY; memset(mask_bits, 0xff, mask_size); @@ -275,7 +275,7 @@ WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY); cursor_info.fIcon = FALSE; cursor_info.xHotspot = x_hotspot; -@@ -4341,7 +4341,7 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device +@@ -4404,7 +4404,7 @@ HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device cursor_image->resource.height, 1, 1, mask_bits); cursor_info.hbmColor = CreateBitmap(cursor_image->resource.width, cursor_image->resource.height, 1, 32, map_desc.data); @@ -307,10 +307,10 @@ TRACE("resource %p, sub_resource_idx %u.\n", resource, sub_resource_idx); diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c -index 574069b..da8b61c 100644 +index 6d0e147..8b13a2f 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c -@@ -1997,25 +1997,25 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr +@@ -1760,25 +1760,25 @@ static struct wined3d_texture *surface_convert_format(struct wined3d_texture *sr memset(&src_map, 0, sizeof(src_map)); memset(&dst_map, 0, sizeof(dst_map)); @@ -341,7 +341,7 @@ return dst_texture; } -@@ -3893,7 +3893,7 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int +@@ -3669,7 +3669,7 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int if (src_texture == dst_texture && src_sub_resource_idx == dst_sub_resource_idx) { same_sub_resource = TRUE; @@ -350,7 +350,7 @@ src_map = dst_map; src_format = dst_texture->resource.format; dst_format = src_format; -@@ -3918,7 +3918,7 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int +@@ -3694,7 +3694,7 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int src_texture = converted_texture; src_sub_resource_idx = 0; } @@ -359,7 +359,7 @@ src_format = src_texture->resource.format; src_fmt_flags = src_texture->resource.format_flags; } -@@ -3928,7 +3928,7 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int +@@ -3704,7 +3704,7 @@ static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int src_fmt_flags = dst_fmt_flags; } @@ -368,8 +368,8 @@ } bpp = dst_format->byte_count; -@@ -4346,9 +4346,9 @@ error: - } +@@ -4120,9 +4120,9 @@ error: + FIXME(" Unsupported flags %#x.\n", flags); release: - wined3d_resource_unmap(&dst_texture->resource, dst_sub_resource_idx); @@ -381,7 +381,7 @@ wined3d_texture_decref(converted_texture); diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec -index 247e4de..48e2016 100644 +index 21cb0db..cfdc1c6 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -181,10 +181,10 @@ @@ -398,10 +398,10 @@ @ 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 e678c39..f8636a2 100644 +index 9bdd16d..88cddc2 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h -@@ -2347,11 +2347,11 @@ void __cdecl wined3d_resource_get_desc(const struct wined3d_resource *resource, +@@ -2360,11 +2360,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); diff -Nru wine-staging-1.9.6/patches/wine.inf-Directory_ContextMenuHandlers/0001-wine.inf-Add-New-context-menu-handler-entry-for-dire.patch wine-staging-1.9.7~ubuntu15.04.1/patches/wine.inf-Directory_ContextMenuHandlers/0001-wine.inf-Add-New-context-menu-handler-entry-for-dire.patch --- wine-staging-1.9.6/patches/wine.inf-Directory_ContextMenuHandlers/0001-wine.inf-Add-New-context-menu-handler-entry-for-dire.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/wine.inf-Directory_ContextMenuHandlers/0001-wine.inf-Add-New-context-menu-handler-entry-for-dire.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,24 @@ +From 868466d81e1b64dd88e8cbdc7a878202829f452e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Thu, 31 Mar 2016 23:23:09 +0200 +Subject: wine.inf: Add 'New' context menu handler entry for directories. + +--- + loader/wine.inf.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/loader/wine.inf.in b/loader/wine.inf.in +index d22b29b..88b088a 100644 +--- a/loader/wine.inf.in ++++ b/loader/wine.inf.in +@@ -182,6 +182,7 @@ HKCR,chm.file\shell\open\command,,2,"%10%\hh.exe %1" + HKCR,cplfile,,2,"Control Panel Item" + HKCR,cplfile\shell\cplopen,,2,"Open with Control Panel" + HKCR,cplfile\shell\cplopen\command,,2,"rundll32.exe shell32.dll,Control_RunDLL ""%1"",%*" ++HKCR,Directory\Background\shellex\ContextMenuHandlers\New,,16 + HKCR,DirectShow,,16 + HKCR,exefile,,2,"Application" + HKCR,exefile\DefaultIcon,,2,"%1" +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/wine.inf-Directory_ContextMenuHandlers/definition wine-staging-1.9.7~ubuntu15.04.1/patches/wine.inf-Directory_ContextMenuHandlers/definition --- wine-staging-1.9.6/patches/wine.inf-Directory_ContextMenuHandlers/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/wine.inf-Directory_ContextMenuHandlers/definition 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [29523] Add 'New' context menu handler entry for directories diff -Nru wine-staging-1.9.6/patches/winex11-Desktop_Resolution/0001-winex11-Add-320x240-as-supported-resolution-in-deskt.patch wine-staging-1.9.7~ubuntu15.04.1/patches/winex11-Desktop_Resolution/0001-winex11-Add-320x240-as-supported-resolution-in-deskt.patch --- wine-staging-1.9.6/patches/winex11-Desktop_Resolution/0001-winex11-Add-320x240-as-supported-resolution-in-deskt.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/winex11-Desktop_Resolution/0001-winex11-Add-320x240-as-supported-resolution-in-deskt.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,27 @@ +From 268ba3b1b3d37eed28e68ec6a64c568d8de7cde2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Thu, 31 Mar 2016 22:33:14 +0200 +Subject: winex11: Add 320x240 as supported resolution in desktop mode. + +--- + dlls/winex11.drv/desktop.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c +index 72916c8..034d7f3 100644 +--- a/dlls/winex11.drv/desktop.c ++++ b/dlls/winex11.drv/desktop.c +@@ -37,8 +37,8 @@ static unsigned int dd_mode_count; + static unsigned int max_width; + static unsigned int max_height; + +-static const unsigned int widths[] = {320, 400, 512, 640, 800, 1024, 1152, 1280, 1280, 1400, 1600}; +-static const unsigned int heights[] = {200, 300, 384, 480, 600, 768, 864, 960, 1024, 1050, 1200}; ++static const unsigned int widths[] = {320, 320, 400, 512, 640, 800, 1024, 1152, 1280, 1280, 1400, 1600}; ++static const unsigned int heights[] = {200, 240, 300, 384, 480, 600, 768, 864, 960, 1024, 1050, 1200}; + #define NUM_DESKTOP_MODES (sizeof(widths) / sizeof(widths[0])) + + #define _NET_WM_STATE_REMOVE 0 +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/winex11-Desktop_Resolution/definition wine-staging-1.9.7~ubuntu15.04.1/patches/winex11-Desktop_Resolution/definition --- wine-staging-1.9.6/patches/winex11-Desktop_Resolution/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/winex11-Desktop_Resolution/definition 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1 @@ +Fixes: [32979] Allow 320x240 as supported resolution in desktop mode diff -Nru wine-staging-1.9.6/patches/winex11-MONITORENUMPROC/0001-winex11.drv-Use-assembler-wrapper-to-call-MONITORENU.patch wine-staging-1.9.7~ubuntu15.04.1/patches/winex11-MONITORENUMPROC/0001-winex11.drv-Use-assembler-wrapper-to-call-MONITORENU.patch --- wine-staging-1.9.6/patches/winex11-MONITORENUMPROC/0001-winex11.drv-Use-assembler-wrapper-to-call-MONITORENU.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/winex11-MONITORENUMPROC/0001-winex11.drv-Use-assembler-wrapper-to-call-MONITORENU.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -From c02ba27cd7b2a59b3ad636184602077048dce128 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Fri, 12 Feb 2016 00:08:32 +0100 -Subject: winex11.drv: Use assembler wrapper to call MONITORENUMPROC callback. - ---- - dlls/winex11.drv/xinerama.c | 28 ++++++++++++++++++++++++++-- - 1 file changed, 26 insertions(+), 2 deletions(-) - -diff --git a/dlls/winex11.drv/xinerama.c b/dlls/winex11.drv/xinerama.c -index 7e28726..93fb9be 100644 ---- a/dlls/winex11.drv/xinerama.c -+++ b/dlls/winex11.drv/xinerama.c -@@ -243,6 +243,30 @@ BOOL CDECL X11DRV_GetMonitorInfo( HMONITOR handle, LPMONITORINFO info ) - return TRUE; - } - -+#ifdef __i386__ -+/* MJ's Help Diagnostic expects that %ecx contains the address to rect, -+ * so we need a small assembly wrapper to call the proc. */ -+extern BOOL enum_monitor_wrapper( void *callback, HMONITOR monitor, HDC hdc, RECT *rect, LPARAM data ); -+__ASM_GLOBAL_FUNC( enum_monitor_wrapper, -+ "pushl %ebp\n\t" -+ __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t") -+ __ASM_CFI(".cfi_rel_offset %ebp,0\n\t") -+ "movl %esp,%ebp\n\t" -+ __ASM_CFI(".cfi_def_cfa_register %ebp\n\t") -+ "subl $8,%esp\n\t" -+ "pushl 24(%ebp)\n\t" -+ "pushl 20(%ebp)\n\t" -+ "pushl 16(%ebp)\n\t" -+ "pushl 12(%ebp)\n\t" -+ "movl 20(%ebp),%ecx\n\t" -+ "call *8(%ebp)\n\t" -+ "leave\n\t" -+ __ASM_CFI(".cfi_def_cfa %esp,4\n\t") -+ __ASM_CFI(".cfi_same_value %ebp\n\t") -+ "ret" ) -+#else -+#define enum_monitor_wrapper( callback, monitor, hdc, rect, data ) (callback)( (monitor), (hdc), (rect), (data) ) -+#endif - - /*********************************************************************** - * X11DRV_EnumDisplayMonitors (X11DRV.@) -@@ -266,7 +290,7 @@ BOOL CDECL X11DRV_EnumDisplayMonitors( HDC hdc, LPRECT rect, MONITORENUMPROC pro - RECT monrect = monitors[i].rcMonitor; - OffsetRect( &monrect, -origin.x, -origin.y ); - if (IntersectRect( &monrect, &monrect, &limit )) -- if (!proc( index_to_monitor(i), hdc, &monrect, lp )) -+ if (!enum_monitor_wrapper( proc, index_to_monitor(i), hdc, &monrect, lp )) - return FALSE; - } - } -@@ -276,7 +300,7 @@ BOOL CDECL X11DRV_EnumDisplayMonitors( HDC hdc, LPRECT rect, MONITORENUMPROC pro - { - RECT unused; - if (!rect || IntersectRect( &unused, &monitors[i].rcMonitor, rect )) -- if (!proc( index_to_monitor(i), 0, &monitors[i].rcMonitor, lp )) -+ if (!enum_monitor_wrapper( proc, index_to_monitor(i), 0, &monitors[i].rcMonitor, lp )) - return FALSE; - } - } --- -2.7.1 - diff -Nru wine-staging-1.9.6/patches/winex11-MONITORENUMPROC/definition wine-staging-1.9.7~ubuntu15.04.1/patches/winex11-MONITORENUMPROC/definition --- wine-staging-1.9.6/patches/winex11-MONITORENUMPROC/definition 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/winex11-MONITORENUMPROC/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: [24421] Use assembler wrapper to call MONITORENUMPROC callback diff -Nru wine-staging-1.9.6/patches/winscard-SCardListReaders/0001-winscard-add-stubs-for-SCardListReadersA-W.patch wine-staging-1.9.7~ubuntu15.04.1/patches/winscard-SCardListReaders/0001-winscard-add-stubs-for-SCardListReadersA-W.patch --- wine-staging-1.9.6/patches/winscard-SCardListReaders/0001-winscard-add-stubs-for-SCardListReadersA-W.patch 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/winscard-SCardListReaders/0001-winscard-add-stubs-for-SCardListReadersA-W.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -From e0e2272251fbefafd7b5b46838aa37aca293f5e4 Mon Sep 17 00:00:00 2001 -From: Austin English -Date: Sun, 1 May 2011 13:48:32 -0500 -Subject: winscard: add stubs for SCardListReadersA/W - -Fixes http://bugs.winehq.org/show_bug.cgi?id=26978 ---- - dlls/winscard/winscard.c | 12 ++++++++++++ - dlls/winscard/winscard.spec | 4 ++-- - 2 files changed, 14 insertions(+), 2 deletions(-) - -diff --git a/dlls/winscard/winscard.c b/dlls/winscard/winscard.c -index bcf8129..cf7d52d 100644 ---- a/dlls/winscard/winscard.c -+++ b/dlls/winscard/winscard.c -@@ -129,3 +129,15 @@ void WINAPI SCardReleaseStartedEvent(void) - { - FIXME("stub\n"); - } -+ -+LONG WINAPI SCardListReadersA(SCARDCONTEXT context, LPCSTR groups, LPSTR readers, LPDWORD buflen) -+{ -+ FIXME("(%lx, %s, %p, %p) stub\n", context, debugstr_a(groups), readers, buflen); -+ return SCARD_F_INTERNAL_ERROR; -+} -+ -+LONG WINAPI SCardListReadersW(SCARDCONTEXT context, LPCWSTR groups, LPWSTR readers, LPDWORD buflen) -+{ -+ FIXME("(%lx, %s, %p, %p) stub\n", context, debugstr_w(groups), readers, buflen); -+ return SCARD_F_INTERNAL_ERROR; -+} -diff --git a/dlls/winscard/winscard.spec b/dlls/winscard/winscard.spec -index 8ecf988..5fd8903 100644 ---- a/dlls/winscard/winscard.spec -+++ b/dlls/winscard/winscard.spec -@@ -40,8 +40,8 @@ - @ stub SCardListInterfacesW - @ stub SCardListReaderGroupsA - @ stub SCardListReaderGroupsW --@ stub SCardListReadersA --@ stub SCardListReadersW -+@ stdcall SCardListReadersA(long str ptr ptr) -+@ stdcall SCardListReadersW(long wstr ptr ptr) - @ stub SCardLocateCardsA - @ stub SCardLocateCardsByATRA - @ stub SCardLocateCardsByATRW --- -2.4.2 - diff -Nru wine-staging-1.9.6/patches/winscard-SCardListReaders/definition wine-staging-1.9.7~ubuntu15.04.1/patches/winscard-SCardListReaders/definition --- wine-staging-1.9.6/patches/winscard-SCardListReaders/definition 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/winscard-SCardListReaders/definition 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Fixes: [26978] Add stub for winscard.SCardListReadersA/W diff -Nru wine-staging-1.9.6/patches/wintrust-WinVerifyTrust/0001-wintrust-tests-Add-tests-for-WinVerifyTrust.-v2.patch wine-staging-1.9.7~ubuntu15.04.1/patches/wintrust-WinVerifyTrust/0001-wintrust-tests-Add-tests-for-WinVerifyTrust.-v2.patch --- wine-staging-1.9.6/patches/wintrust-WinVerifyTrust/0001-wintrust-tests-Add-tests-for-WinVerifyTrust.-v2.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/wintrust-WinVerifyTrust/0001-wintrust-tests-Add-tests-for-WinVerifyTrust.-v2.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,389 @@ +From f9908b1f5aeb5becfc29dbee476eab52e7b877c2 Mon Sep 17 00:00:00 2001 +From: Mark Jansen +Date: Fri, 4 Mar 2016 20:54:56 +0100 +Subject: wintrust/tests: Add tests for WinVerifyTrust. (v2) + +Includes various improvements by Sebastian Lackner . +--- + dlls/wintrust/tests/softpub.c | 352 ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 352 insertions(+) + +diff --git a/dlls/wintrust/tests/softpub.c b/dlls/wintrust/tests/softpub.c +index 436de47..2b51c30 100644 +--- a/dlls/wintrust/tests/softpub.c ++++ b/dlls/wintrust/tests/softpub.c +@@ -3,6 +3,7 @@ + * + * Copyright 2007,2010 Juan Lang + * Copyright 2010 Andrey Turkin ++ * Copyright 2016 Mark Jansen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public +@@ -869,6 +870,356 @@ static void test_wintrust(void) + ok(r == S_OK, "WinVerifyTrust failed: %08x\n", r); + } + ++/* Self-signed .exe, built with tcc, signed with signtool ++ * (and a certificate generated on a self-signed CA). ++ * ++ * small.c: ++ * int _start() ++ * { ++ * return 0; ++ * } ++ * ++ * tcc -nostdlib small.c ++ * signtool sign /v /f codesign.pfx small.exe ++ */ ++static const BYTE SelfSignedFile32[] = ++{ ++ 0x4D,0x5A,0x90,0x00,0x03,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0xB8,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x0E,0x1F,0xBA,0x0E,0x00,0xB4,0x09,0xCD, ++ 0x21,0xB8,0x01,0x4C,0xCD,0x21,0x54,0x68,0x69,0x73,0x20,0x70,0x72,0x6F,0x67,0x72,0x61,0x6D,0x20,0x63,0x61,0x6E,0x6E,0x6F, ++ 0x74,0x20,0x62,0x65,0x20,0x72,0x75,0x6E,0x20,0x69,0x6E,0x20,0x44,0x4F,0x53,0x20,0x6D,0x6F,0x64,0x65,0x2E,0x0D,0x0D,0x0A, ++ 0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x45,0x00,0x00,0x4C,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0xE0,0x00,0x0F,0x03,0x0B,0x01,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x10,0x00,0x00,0x00,0x02,0x00,0x00, ++ 0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x02,0x00,0x00, ++ 0xE7,0x0C,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x10,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x68,0x05,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2E,0x74,0x65,0x78,0x74,0x00,0x00,0x00, ++ 0x18,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x55,0x89,0xE5,0x81,0xEC,0x00,0x00,0x00,0x00,0x90,0xB8,0x00,0x00,0x00,0x00,0xE9, ++ 0x00,0x00,0x00,0x00,0xC9,0xC3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x68,0x05,0x00,0x00,0x00,0x02,0x02,0x00, ++ /* Start of the signature overlay */ ++ 0x30,0x82,0x05,0x5A,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,0xA0,0x82,0x05,0x4B,0x30,0x82,0x05,0x47,0x02, ++ 0x01,0x01,0x31,0x0B,0x30,0x09,0x06,0x05,0x2B,0x0E,0x03,0x02,0x1A,0x05,0x00,0x30,0x4C,0x06,0x0A,0x2B,0x06,0x01,0x04,0x01, ++ 0x82,0x37,0x02,0x01,0x04,0xA0,0x3E,0x30,0x3C,0x30,0x17,0x06,0x0A,0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x02,0x01,0x0F,0x30, ++ 0x09,0x03,0x01,0x00,0xA0,0x04,0xA2,0x02,0x80,0x00,0x30,0x21,0x30,0x09,0x06,0x05,0x2B,0x0E,0x03,0x02,0x1A,0x05,0x00,0x04, ++ 0x14,0xA0,0x95,0xDE,0xBD,0x1A,0xB7,0x86,0xAF,0x50,0x63,0xD8,0x8F,0x90,0xD5,0x49,0x96,0x4E,0x44,0xF0,0x71,0xA0,0x82,0x03, ++ 0x1D,0x30,0x82,0x03,0x19,0x30,0x82,0x02,0x01,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x96,0x53,0x2C,0xC9,0x23,0x56,0x8A,0x87, ++ 0x42,0x30,0x3E,0xD5,0x8D,0x72,0xD5,0x25,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x30, ++ 0x17,0x31,0x15,0x30,0x13,0x06,0x03,0x55,0x04,0x03,0x13,0x0C,0x54,0x65,0x73,0x74,0x20,0x43,0x41,0x20,0x52,0x6F,0x6F,0x74, ++ 0x30,0x1E,0x17,0x0D,0x31,0x36,0x30,0x33,0x30,0x33,0x32,0x30,0x32,0x37,0x30,0x37,0x5A,0x17,0x0D,0x34,0x39,0x31,0x32,0x33, ++ 0x31,0x32,0x33,0x30,0x30,0x30,0x30,0x5A,0x30,0x17,0x31,0x15,0x30,0x13,0x06,0x03,0x55,0x04,0x03,0x13,0x0C,0x43,0x6F,0x64, ++ 0x65,0x53,0x69,0x67,0x6E,0x54,0x65,0x73,0x74,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, ++ 0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xB2,0xC9,0x91,0x98,0x8C,0xDC, ++ 0x80,0xBC,0x16,0xBF,0xC1,0x04,0x77,0x90,0xC0,0xFD,0x8C,0xBA,0x68,0x26,0xAC,0xB7,0x20,0x68,0x41,0xED,0xC3,0x9C,0x47,0x7C, ++ 0x36,0xC2,0x7B,0xE1,0x5E,0xFD,0xA9,0x99,0xF4,0x29,0x36,0x86,0x93,0x40,0x55,0x53,0x65,0x79,0xBC,0x9F,0x8F,0x6E,0x2B,0x05, ++ 0x84,0xE1,0xFD,0xD2,0xEF,0xEA,0x89,0x8C,0xEC,0xF9,0x55,0xF0,0x2C,0xE5,0xA7,0x29,0xF9,0x7E,0x50,0xDC,0x9C,0xA1,0x23,0xA5, ++ 0xD9,0x78,0xA1,0xE7,0x7C,0xD7,0x04,0x4F,0x11,0xAC,0x9F,0x4A,0x47,0xA1,0x1E,0xD5,0x9E,0xE7,0x5B,0xB5,0x8C,0x9C,0x67,0x7A, ++ 0xD0,0xF8,0x54,0xD1,0x64,0x7F,0x39,0x48,0xB6,0xCF,0x2F,0x26,0x7D,0x7B,0x13,0x2B,0xC2,0x8F,0xA6,0x3F,0x42,0x71,0x95,0x3E, ++ 0x59,0x0F,0x12,0xFA,0xC2,0x70,0x89,0xB7,0xB6,0x10,0x49,0xE0,0x7D,0x4D,0xFC,0x80,0x61,0x53,0x50,0x72,0xFD,0x46,0x35,0x51, ++ 0x36,0xE6,0x06,0xA9,0x4C,0x0D,0x82,0x15,0xF6,0x5D,0xDE,0xD4,0xDB,0xE7,0x82,0x10,0x40,0xA1,0x47,0x68,0x88,0x0C,0x0A,0x80, ++ 0xD1,0xE5,0x9A,0x35,0x28,0x82,0x1F,0x0F,0x80,0x5A,0x6E,0x1D,0x22,0x22,0xB3,0xA7,0xA2,0x9E,0x82,0x2D,0xC0,0x7F,0x5A,0xD0, ++ 0xBA,0xB2,0xCA,0x20,0xE2,0x97,0xE9,0x72,0x41,0xB7,0xD6,0x1A,0x93,0x23,0x97,0xF0,0xA9,0x61,0xD2,0x91,0xBD,0xB6,0x6B,0x95, ++ 0x12,0x67,0x16,0xAC,0x0A,0xB7,0x55,0x02,0x0D,0xA5,0xAD,0x17,0x95,0x77,0xF9,0x96,0x03,0x41,0xD3,0xE1,0x61,0x68,0xBB,0x0A, ++ 0xB5,0xC4,0xEE,0x70,0x40,0x08,0x05,0xC4,0xF1,0x5D,0x02,0x03,0x01,0x00,0x01,0xA3,0x61,0x30,0x5F,0x30,0x13,0x06,0x03,0x55, ++ 0x1D,0x25,0x04,0x0C,0x30,0x0A,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03,0x30,0x48,0x06,0x03,0x55,0x1D,0x01,0x04, ++ 0x41,0x30,0x3F,0x80,0x10,0x35,0x40,0x67,0x8F,0x7D,0x03,0x1B,0x76,0x52,0x62,0x2D,0xF5,0x21,0xF6,0x7C,0xBC,0xA1,0x19,0x30, ++ 0x17,0x31,0x15,0x30,0x13,0x06,0x03,0x55,0x04,0x03,0x13,0x0C,0x54,0x65,0x73,0x74,0x20,0x43,0x41,0x20,0x52,0x6F,0x6F,0x74, ++ 0x82,0x10,0xA0,0x4B,0xEB,0xAC,0xFA,0x08,0xF2,0x8B,0x47,0xD2,0xB3,0x54,0x60,0x6C,0xE6,0x29,0x30,0x0D,0x06,0x09,0x2A,0x86, ++ 0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x5F,0x8C,0x7F,0xDA,0x1D,0x21,0x7A,0x15,0xD8,0x20, ++ 0x04,0x53,0x7F,0x44,0x6D,0x7B,0x57,0xBE,0x7F,0x86,0x77,0x58,0xC4,0xD4,0x80,0xC7,0x2E,0x64,0x9B,0x44,0xC5,0x2D,0x6D,0xDB, ++ 0x35,0x5A,0xFE,0xA4,0xD8,0x66,0x9B,0xF7,0x6E,0xFC,0xEF,0x52,0x7B,0xC5,0x16,0xE6,0xA3,0x7D,0x59,0xB7,0x31,0x28,0xEB,0xB5, ++ 0x45,0xC9,0xB1,0xD1,0x08,0x67,0xC6,0x37,0xE7,0xD7,0x2A,0xE6,0x1F,0xD9,0x6A,0xE5,0x04,0xDF,0x6A,0x9D,0x91,0xFA,0x41,0xBD, ++ 0x2A,0x50,0xEA,0x99,0x24,0xA9,0x0F,0x2B,0x50,0x51,0x5F,0xD9,0x0B,0x89,0x1B,0xCB,0xDB,0x88,0xE8,0xEC,0x87,0xB0,0x16,0xCC, ++ 0x43,0xEE,0x5A,0xBD,0x57,0xE2,0x46,0xA7,0x56,0x54,0x23,0x32,0x8A,0xFB,0x25,0x51,0x39,0x38,0xE6,0x87,0xF5,0x73,0x63,0xD0, ++ 0x5B,0xC7,0x3F,0xFD,0x04,0x75,0x74,0x4C,0x3D,0xB5,0x31,0x22,0x7D,0xF1,0x8D,0xB4,0xE0,0xAA,0xE1,0xFF,0x8F,0xDD,0xB8,0x04, ++ 0x6A,0x31,0xEE,0x30,0x2D,0x6E,0x74,0x0F,0x37,0x71,0x77,0x2B,0xB8,0x9E,0x62,0x47,0x00,0x9C,0xA5,0x82,0x2B,0x9F,0x24,0x67, ++ 0x50,0x86,0x8B,0xC9,0x36,0x81,0xEB,0x44,0xC2,0xF1,0x91,0xA6,0x84,0x75,0x15,0x8F,0x22,0xDE,0xAC,0xB5,0x16,0xE3,0x96,0x74, ++ 0x72,0x2F,0x15,0xD5,0xFB,0x01,0x22,0xC4,0x24,0xEE,0x3D,0xDF,0x9E,0xA9,0x0A,0x5B,0x16,0x21,0xE8,0x4A,0x8C,0x7E,0x3A,0x9C, ++ 0x22,0xA0,0x49,0x60,0x97,0x1B,0x3E,0x2D,0x80,0x91,0xDB,0xF7,0x78,0x38,0x76,0x78,0x0C,0xE3,0xD4,0x27,0x77,0x69,0x96,0xE6, ++ 0x41,0xC7,0x2E,0xE9,0x61,0xD6,0x31,0x82,0x01,0xC4,0x30,0x82,0x01,0xC0,0x02,0x01,0x01,0x30,0x2B,0x30,0x17,0x31,0x15,0x30, ++ 0x13,0x06,0x03,0x55,0x04,0x03,0x13,0x0C,0x54,0x65,0x73,0x74,0x20,0x43,0x41,0x20,0x52,0x6F,0x6F,0x74,0x02,0x10,0x96,0x53, ++ 0x2C,0xC9,0x23,0x56,0x8A,0x87,0x42,0x30,0x3E,0xD5,0x8D,0x72,0xD5,0x25,0x30,0x09,0x06,0x05,0x2B,0x0E,0x03,0x02,0x1A,0x05, ++ 0x00,0xA0,0x70,0x30,0x10,0x06,0x0A,0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x02,0x01,0x0C,0x31,0x02,0x30,0x00,0x30,0x19,0x06, ++ 0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,0x31,0x0C,0x06,0x0A,0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x02,0x01,0x04, ++ 0x30,0x1C,0x06,0x0A,0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x02,0x01,0x0B,0x31,0x0E,0x30,0x0C,0x06,0x0A,0x2B,0x06,0x01,0x04, ++ 0x01,0x82,0x37,0x02,0x01,0x15,0x30,0x23,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,0x31,0x16,0x04,0x14,0x3D, ++ 0x08,0xC8,0xA3,0xEE,0x05,0x1A,0x61,0xD9,0xFE,0x1A,0x63,0xC0,0x8A,0x6E,0x9D,0xF9,0xC3,0x13,0x98,0x30,0x0D,0x06,0x09,0x2A, ++ 0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x04,0x82,0x01,0x00,0x90,0xF9,0xC0,0x7F,0x1D,0x70,0x8C,0x04,0x22,0x82, ++ 0xB6,0x2D,0x48,0xBF,0x30,0x51,0x29,0xF8,0xE3,0x11,0x39,0xE0,0x64,0x23,0x72,0xE2,0x4C,0x09,0x9F,0x39,0xF2,0x6F,0xDD,0xB9, ++ 0x5A,0x3D,0xEF,0xEB,0xBE,0xEC,0x3B,0xE6,0x58,0x4C,0xC9,0x4F,0xED,0xCB,0x6E,0x9D,0x67,0x8E,0x89,0x92,0x40,0x39,0xA2,0x5F, ++ 0xF9,0xEF,0xD3,0xF5,0x24,0x27,0x8D,0xF7,0x3C,0x92,0x66,0x56,0xC8,0x2B,0xEA,0x04,0xA1,0x0E,0xDA,0x89,0x30,0xA7,0x01,0xD8, ++ 0x0B,0xF8,0xFD,0x99,0xB6,0xC0,0x38,0xB0,0x21,0x50,0x3A,0x86,0x01,0xD0,0xF3,0x86,0x72,0xE3,0x5A,0xBB,0x2A,0x6E,0xBD,0xFB, ++ 0x22,0xF9,0x42,0xD3,0x04,0xFE,0x8D,0xD8,0x79,0xD1,0xEE,0x61,0xC6,0x48,0x04,0x99,0x9A,0xA2,0x73,0xE5,0xFB,0x24,0x10,0xD5, ++ 0x6B,0x71,0x80,0x0E,0x09,0xEA,0x85,0x9A,0xBD,0xBB,0xDE,0x99,0x5D,0xA3,0x18,0x4D,0xED,0x20,0x73,0x3E,0x32,0xEF,0x2C,0xAC, ++ 0x5A,0x83,0x87,0x1F,0x7F,0x19,0x61,0x35,0x53,0xC1,0xAA,0x89,0x97,0xB3,0xDD,0x8D,0xA8,0x67,0x5B,0xC2,0xE2,0x09,0xB7,0xDD, ++ 0x6A,0xCB,0xD5,0xBF,0xD6,0x08,0xE2,0x23,0x1A,0x41,0x9D,0xD5,0x6A,0x6B,0x8D,0x3C,0x29,0x1B,0xF1,0x3F,0x4E,0x4A,0x8F,0x29, ++ 0x33,0xF9,0x1C,0x60,0xA0,0x92,0x7E,0x4F,0x35,0xB8,0xDD,0xEB,0xD1,0x68,0x1A,0x9D,0xA2,0xA6,0x97,0x1F,0x5F,0xC6,0x2C,0xFB, ++ 0xCA,0xDF,0xF7,0x95,0x33,0x95,0xD4,0x79,0x5C,0x73,0x87,0x49,0x1F,0x8C,0x6E,0xCE,0x3E,0x6D,0x3D,0x2B,0x6B,0xD7,0x66,0xE9, ++ 0x88,0x6F,0xF2,0x83,0xB9,0x9B,0x00,0x00 ++}; ++ ++static const BYTE SelfSignedFile64[] = ++{ ++ 0x4D,0x5A,0x90,0x00,0x03,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0xB8,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x0E,0x1F,0xBA,0x0E,0x00,0xB4,0x09,0xCD, ++ 0x21,0xB8,0x01,0x4C,0xCD,0x21,0x54,0x68,0x69,0x73,0x20,0x70,0x72,0x6F,0x67,0x72,0x61,0x6D,0x20,0x63,0x61,0x6E,0x6E,0x6F, ++ 0x74,0x20,0x62,0x65,0x20,0x72,0x75,0x6E,0x20,0x69,0x6E,0x20,0x44,0x4F,0x53,0x20,0x6D,0x6F,0x64,0x65,0x2E,0x0D,0x0D,0x0A, ++ 0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x45,0x00,0x00,0x64,0x86,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0xF0,0x00,0x2F,0x02,0x0B,0x02,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x10,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x02,0x00,0x00, ++ 0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x02,0x00,0x00, ++ 0x02,0xB9,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x20,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x68,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2E,0x74,0x65,0x78,0x74,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x10,0x00,0x00, ++ 0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x60, ++ 0x2E,0x70,0x64,0x61,0x74,0x61,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x04,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x55,0x48,0x89,0xE5,0x48,0x81,0xEC,0x00,0x00,0x00,0x00,0xB8,0x00,0x00,0x00,0x00, ++ 0xE9,0x00,0x00,0x00,0x00,0xC9,0xC3,0x00,0x01,0x04,0x02,0x05,0x04,0x03,0x01,0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0B,0x10,0x00,0x00,0x17,0x10,0x00,0x00, ++ 0x18,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ++ /* Start of the signature overlay */ ++ 0x68,0x05,0x00,0x00,0x00,0x02,0x02,0x00,0x30,0x82,0x05,0x5A,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,0xA0, ++ 0x82,0x05,0x4B,0x30,0x82,0x05,0x47,0x02,0x01,0x01,0x31,0x0B,0x30,0x09,0x06,0x05,0x2B,0x0E,0x03,0x02,0x1A,0x05,0x00,0x30, ++ 0x4C,0x06,0x0A,0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x02,0x01,0x04,0xA0,0x3E,0x30,0x3C,0x30,0x17,0x06,0x0A,0x2B,0x06,0x01, ++ 0x04,0x01,0x82,0x37,0x02,0x01,0x0F,0x30,0x09,0x03,0x01,0x00,0xA0,0x04,0xA2,0x02,0x80,0x00,0x30,0x21,0x30,0x09,0x06,0x05, ++ 0x2B,0x0E,0x03,0x02,0x1A,0x05,0x00,0x04,0x14,0xCA,0x7C,0x10,0xFB,0x5A,0x96,0x6D,0x69,0xEF,0x26,0x30,0x1A,0xE9,0xC7,0x22, ++ 0x19,0xEB,0x6E,0x17,0x07,0xA0,0x82,0x03,0x1D,0x30,0x82,0x03,0x19,0x30,0x82,0x02,0x01,0xA0,0x03,0x02,0x01,0x02,0x02,0x10, ++ 0x96,0x53,0x2C,0xC9,0x23,0x56,0x8A,0x87,0x42,0x30,0x3E,0xD5,0x8D,0x72,0xD5,0x25,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86, ++ 0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x30,0x17,0x31,0x15,0x30,0x13,0x06,0x03,0x55,0x04,0x03,0x13,0x0C,0x54,0x65,0x73,0x74, ++ 0x20,0x43,0x41,0x20,0x52,0x6F,0x6F,0x74,0x30,0x1E,0x17,0x0D,0x31,0x36,0x30,0x33,0x30,0x33,0x32,0x30,0x32,0x37,0x30,0x37, ++ 0x5A,0x17,0x0D,0x34,0x39,0x31,0x32,0x33,0x31,0x32,0x33,0x30,0x30,0x30,0x30,0x5A,0x30,0x17,0x31,0x15,0x30,0x13,0x06,0x03, ++ 0x55,0x04,0x03,0x13,0x0C,0x43,0x6F,0x64,0x65,0x53,0x69,0x67,0x6E,0x54,0x65,0x73,0x74,0x30,0x82,0x01,0x22,0x30,0x0D,0x06, ++ 0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01, ++ 0x01,0x00,0xB2,0xC9,0x91,0x98,0x8C,0xDC,0x80,0xBC,0x16,0xBF,0xC1,0x04,0x77,0x90,0xC0,0xFD,0x8C,0xBA,0x68,0x26,0xAC,0xB7, ++ 0x20,0x68,0x41,0xED,0xC3,0x9C,0x47,0x7C,0x36,0xC2,0x7B,0xE1,0x5E,0xFD,0xA9,0x99,0xF4,0x29,0x36,0x86,0x93,0x40,0x55,0x53, ++ 0x65,0x79,0xBC,0x9F,0x8F,0x6E,0x2B,0x05,0x84,0xE1,0xFD,0xD2,0xEF,0xEA,0x89,0x8C,0xEC,0xF9,0x55,0xF0,0x2C,0xE5,0xA7,0x29, ++ 0xF9,0x7E,0x50,0xDC,0x9C,0xA1,0x23,0xA5,0xD9,0x78,0xA1,0xE7,0x7C,0xD7,0x04,0x4F,0x11,0xAC,0x9F,0x4A,0x47,0xA1,0x1E,0xD5, ++ 0x9E,0xE7,0x5B,0xB5,0x8C,0x9C,0x67,0x7A,0xD0,0xF8,0x54,0xD1,0x64,0x7F,0x39,0x48,0xB6,0xCF,0x2F,0x26,0x7D,0x7B,0x13,0x2B, ++ 0xC2,0x8F,0xA6,0x3F,0x42,0x71,0x95,0x3E,0x59,0x0F,0x12,0xFA,0xC2,0x70,0x89,0xB7,0xB6,0x10,0x49,0xE0,0x7D,0x4D,0xFC,0x80, ++ 0x61,0x53,0x50,0x72,0xFD,0x46,0x35,0x51,0x36,0xE6,0x06,0xA9,0x4C,0x0D,0x82,0x15,0xF6,0x5D,0xDE,0xD4,0xDB,0xE7,0x82,0x10, ++ 0x40,0xA1,0x47,0x68,0x88,0x0C,0x0A,0x80,0xD1,0xE5,0x9A,0x35,0x28,0x82,0x1F,0x0F,0x80,0x5A,0x6E,0x1D,0x22,0x22,0xB3,0xA7, ++ 0xA2,0x9E,0x82,0x2D,0xC0,0x7F,0x5A,0xD0,0xBA,0xB2,0xCA,0x20,0xE2,0x97,0xE9,0x72,0x41,0xB7,0xD6,0x1A,0x93,0x23,0x97,0xF0, ++ 0xA9,0x61,0xD2,0x91,0xBD,0xB6,0x6B,0x95,0x12,0x67,0x16,0xAC,0x0A,0xB7,0x55,0x02,0x0D,0xA5,0xAD,0x17,0x95,0x77,0xF9,0x96, ++ 0x03,0x41,0xD3,0xE1,0x61,0x68,0xBB,0x0A,0xB5,0xC4,0xEE,0x70,0x40,0x08,0x05,0xC4,0xF1,0x5D,0x02,0x03,0x01,0x00,0x01,0xA3, ++ 0x61,0x30,0x5F,0x30,0x13,0x06,0x03,0x55,0x1D,0x25,0x04,0x0C,0x30,0x0A,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03, ++ 0x30,0x48,0x06,0x03,0x55,0x1D,0x01,0x04,0x41,0x30,0x3F,0x80,0x10,0x35,0x40,0x67,0x8F,0x7D,0x03,0x1B,0x76,0x52,0x62,0x2D, ++ 0xF5,0x21,0xF6,0x7C,0xBC,0xA1,0x19,0x30,0x17,0x31,0x15,0x30,0x13,0x06,0x03,0x55,0x04,0x03,0x13,0x0C,0x54,0x65,0x73,0x74, ++ 0x20,0x43,0x41,0x20,0x52,0x6F,0x6F,0x74,0x82,0x10,0xA0,0x4B,0xEB,0xAC,0xFA,0x08,0xF2,0x8B,0x47,0xD2,0xB3,0x54,0x60,0x6C, ++ 0xE6,0x29,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x5F,0x8C, ++ 0x7F,0xDA,0x1D,0x21,0x7A,0x15,0xD8,0x20,0x04,0x53,0x7F,0x44,0x6D,0x7B,0x57,0xBE,0x7F,0x86,0x77,0x58,0xC4,0xD4,0x80,0xC7, ++ 0x2E,0x64,0x9B,0x44,0xC5,0x2D,0x6D,0xDB,0x35,0x5A,0xFE,0xA4,0xD8,0x66,0x9B,0xF7,0x6E,0xFC,0xEF,0x52,0x7B,0xC5,0x16,0xE6, ++ 0xA3,0x7D,0x59,0xB7,0x31,0x28,0xEB,0xB5,0x45,0xC9,0xB1,0xD1,0x08,0x67,0xC6,0x37,0xE7,0xD7,0x2A,0xE6,0x1F,0xD9,0x6A,0xE5, ++ 0x04,0xDF,0x6A,0x9D,0x91,0xFA,0x41,0xBD,0x2A,0x50,0xEA,0x99,0x24,0xA9,0x0F,0x2B,0x50,0x51,0x5F,0xD9,0x0B,0x89,0x1B,0xCB, ++ 0xDB,0x88,0xE8,0xEC,0x87,0xB0,0x16,0xCC,0x43,0xEE,0x5A,0xBD,0x57,0xE2,0x46,0xA7,0x56,0x54,0x23,0x32,0x8A,0xFB,0x25,0x51, ++ 0x39,0x38,0xE6,0x87,0xF5,0x73,0x63,0xD0,0x5B,0xC7,0x3F,0xFD,0x04,0x75,0x74,0x4C,0x3D,0xB5,0x31,0x22,0x7D,0xF1,0x8D,0xB4, ++ 0xE0,0xAA,0xE1,0xFF,0x8F,0xDD,0xB8,0x04,0x6A,0x31,0xEE,0x30,0x2D,0x6E,0x74,0x0F,0x37,0x71,0x77,0x2B,0xB8,0x9E,0x62,0x47, ++ 0x00,0x9C,0xA5,0x82,0x2B,0x9F,0x24,0x67,0x50,0x86,0x8B,0xC9,0x36,0x81,0xEB,0x44,0xC2,0xF1,0x91,0xA6,0x84,0x75,0x15,0x8F, ++ 0x22,0xDE,0xAC,0xB5,0x16,0xE3,0x96,0x74,0x72,0x2F,0x15,0xD5,0xFB,0x01,0x22,0xC4,0x24,0xEE,0x3D,0xDF,0x9E,0xA9,0x0A,0x5B, ++ 0x16,0x21,0xE8,0x4A,0x8C,0x7E,0x3A,0x9C,0x22,0xA0,0x49,0x60,0x97,0x1B,0x3E,0x2D,0x80,0x91,0xDB,0xF7,0x78,0x38,0x76,0x78, ++ 0x0C,0xE3,0xD4,0x27,0x77,0x69,0x96,0xE6,0x41,0xC7,0x2E,0xE9,0x61,0xD6,0x31,0x82,0x01,0xC4,0x30,0x82,0x01,0xC0,0x02,0x01, ++ 0x01,0x30,0x2B,0x30,0x17,0x31,0x15,0x30,0x13,0x06,0x03,0x55,0x04,0x03,0x13,0x0C,0x54,0x65,0x73,0x74,0x20,0x43,0x41,0x20, ++ 0x52,0x6F,0x6F,0x74,0x02,0x10,0x96,0x53,0x2C,0xC9,0x23,0x56,0x8A,0x87,0x42,0x30,0x3E,0xD5,0x8D,0x72,0xD5,0x25,0x30,0x09, ++ 0x06,0x05,0x2B,0x0E,0x03,0x02,0x1A,0x05,0x00,0xA0,0x70,0x30,0x10,0x06,0x0A,0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x02,0x01, ++ 0x0C,0x31,0x02,0x30,0x00,0x30,0x19,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,0x31,0x0C,0x06,0x0A,0x2B,0x06, ++ 0x01,0x04,0x01,0x82,0x37,0x02,0x01,0x04,0x30,0x1C,0x06,0x0A,0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x02,0x01,0x0B,0x31,0x0E, ++ 0x30,0x0C,0x06,0x0A,0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x02,0x01,0x15,0x30,0x23,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D, ++ 0x01,0x09,0x04,0x31,0x16,0x04,0x14,0x0C,0xEC,0x76,0xF2,0x3F,0xE4,0x6F,0xEB,0xFF,0x00,0xDA,0x95,0xE7,0x8B,0x64,0xBC,0x55, ++ 0xBA,0xF0,0xEA,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x04,0x82,0x01,0x00,0x05,0x22, ++ 0xD1,0xB3,0x85,0x09,0x46,0x99,0x77,0x69,0xC8,0xD2,0x0C,0xFC,0x8D,0xF4,0x01,0xD4,0x5B,0xF0,0xB4,0x13,0x63,0xAF,0x24,0x0E, ++ 0x6C,0x1B,0x14,0xCF,0xA8,0x9A,0xEC,0x7E,0xF2,0x60,0xED,0x6C,0x39,0x4D,0x7A,0x73,0x9C,0x9F,0x24,0x46,0xE2,0xEA,0xFA,0x70, ++ 0xB4,0xAC,0xFC,0x38,0x90,0xF2,0x4F,0x70,0xCC,0x00,0xD1,0x2B,0xB6,0xFB,0xCD,0x7F,0xFC,0xCB,0x35,0xA9,0xA6,0x76,0x37,0xD6, ++ 0x08,0x82,0x99,0x4C,0x47,0xD7,0x4E,0xB5,0xDE,0xCA,0x4E,0xED,0x71,0x48,0xD4,0x84,0xE1,0x30,0x10,0x33,0x7F,0x84,0xEE,0x2F, ++ 0x44,0x99,0xE4,0x26,0x27,0xB5,0xB8,0xC1,0xA1,0x40,0x6B,0x87,0x04,0x95,0xC3,0xF0,0xFF,0x25,0x97,0xFD,0xDB,0x9C,0x67,0x80, ++ 0x39,0x97,0x72,0x75,0x07,0x92,0xA5,0x08,0x19,0x5B,0xD3,0xC9,0x5E,0xC4,0x7B,0xA9,0x04,0x02,0x63,0xCC,0xC5,0x92,0xF6,0xE9, ++ 0xD6,0xB0,0xA8,0xF9,0xD0,0x9F,0x3F,0xBC,0x86,0x77,0x1E,0x12,0x9A,0x9A,0x9B,0x05,0x77,0x39,0x42,0x01,0xB7,0x23,0xF0,0x78, ++ 0x4F,0x52,0x6D,0x1B,0x9F,0xBA,0x29,0xEC,0x90,0xA9,0x1E,0x1E,0x5C,0xA9,0x28,0xA0,0x0B,0x09,0xDC,0x99,0x82,0xE3,0x34,0xBB, ++ 0x5C,0x66,0x8E,0x54,0x95,0x4B,0x65,0x95,0xCD,0x87,0x72,0x74,0xCD,0x3B,0x5C,0x72,0xBB,0x61,0x6A,0x98,0x44,0x9C,0xB0,0x2A, ++ 0xE7,0xB0,0xA6,0x2B,0xDA,0x47,0x5C,0x75,0x36,0xB5,0x90,0x8E,0x82,0x47,0xCD,0x3F,0x4B,0xD0,0xFB,0x8E,0x17,0x6B,0x40,0x57, ++ 0x9C,0x68,0x1A,0x5D,0x92,0xCD,0xD0,0x5F,0x02,0xA1,0x2C,0xD9,0x56,0x20,0x00,0x00 ++}; ++ ++static void call_winverify(WCHAR *pathW, LONG *status, BOOL hash_only) ++{ ++ static GUID WVTPolicyGUID = WINTRUST_ACTION_GENERIC_VERIFY_V2; ++ WINTRUST_FILE_INFO file_info = { sizeof(file_info), 0 }; ++ WINTRUST_DATA data = { sizeof(data), 0 }; ++ LONG ret; ++ ++ file_info.pcwszFilePath = pathW; ++ ++ data.dwUIChoice = WTD_UI_NONE; ++ data.fdwRevocationChecks = WTD_REVOKE_NONE; ++ data.dwUnionChoice = WTD_CHOICE_FILE; ++ data.pFile = &file_info; ++ data.dwStateAction = WTD_STATEACTION_VERIFY; ++ data.dwProvFlags = hash_only ? WTD_HASH_ONLY_FLAG : 0; ++ *status = WinVerifyTrust(NULL, &WVTPolicyGUID, &data); ++ ++ data.dwStateAction = WTD_STATEACTION_CLOSE; ++ ret = WinVerifyTrust(NULL, &WVTPolicyGUID, &data); ++ ok(ret == S_OK, "WinVerifyTrust failed: %08x\n", ret); ++} ++ ++static void test_wintrust_digest(void) ++{ ++ static const BYTE Dummy[] = { 0x11,0x22,0x33,0x44 }; ++ static const struct ++ { ++ struct { const BYTE *data; DWORD length; } blocks[5]; ++ struct { LONG status; BOOL todo; } t1; ++ struct { LONG status; BOOL todo; } t2; ++ } ++ tests[] = ++ { ++ /* 32-bit tests */ ++ { ++ {{ SelfSignedFile32, sizeof(SelfSignedFile32) }}, ++ { CERT_E_CHAINING, TRUE }, { S_OK, FALSE } ++ }, ++ { ++ {{ SelfSignedFile32, 19 }, ++ { Dummy, sizeof(Dummy) }, ++ { SelfSignedFile32 + 19 + sizeof(Dummy), sizeof(SelfSignedFile32) - 19 - sizeof(Dummy) }}, ++ { TRUST_E_BAD_DIGEST, TRUE }, { TRUST_E_NOSIGNATURE, TRUE } ++ }, ++ { ++ {{ SelfSignedFile32, sizeof(IMAGE_DOS_HEADER) }}, ++ { TRUST_E_SUBJECT_FORM_UNKNOWN, TRUE }, { TRUST_E_NOSIGNATURE, FALSE } ++ }, ++ { ++ {{ SelfSignedFile32, sizeof(IMAGE_DOS_HEADER) + sizeof(IMAGE_NT_HEADERS32) * 2 }}, ++ { TRUST_E_NOSIGNATURE, FALSE }, { TRUST_E_NOSIGNATURE, FALSE } ++ }, ++ ++ /* 64-bit tests */ ++ { ++ {{ SelfSignedFile64, sizeof(SelfSignedFile64) }}, ++ { CERT_E_CHAINING, TRUE }, { S_OK, FALSE } ++ }, ++ { ++ {{ SelfSignedFile64, 19 }, ++ { Dummy, sizeof(Dummy) }, ++ { SelfSignedFile64 + 19 + sizeof(Dummy), sizeof(SelfSignedFile64) - 19 - sizeof(Dummy) }}, ++ { TRUST_E_BAD_DIGEST, TRUE }, { TRUST_E_NOSIGNATURE, TRUE } ++ }, ++ { ++ {{ SelfSignedFile64, sizeof(IMAGE_DOS_HEADER) }}, ++ { TRUST_E_SUBJECT_FORM_UNKNOWN, TRUE }, { TRUST_E_NOSIGNATURE, FALSE } ++ }, ++ { ++ {{ SelfSignedFile64, sizeof(IMAGE_DOS_HEADER) + sizeof(IMAGE_NT_HEADERS64) * 2 }}, ++ { TRUST_E_NOSIGNATURE, FALSE }, { TRUST_E_NOSIGNATURE, FALSE } ++ }, ++ }; ++ WCHAR pathW[MAX_PATH]; ++ DWORD written; ++ HANDLE file; ++ LONG status; ++ BOOL ret; ++ int i, j; ++ ++ for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) ++ { ++ file = create_temp_file(pathW); ++ ok(file != INVALID_HANDLE_VALUE, "failed to create temporary file\n"); ++ ++ for (j = 0; tests[i].blocks[j].data; j++) ++ { ++ ret = WriteFile(file, tests[i].blocks[j].data, tests[i].blocks[j].length, &written, NULL); ++ ok(ret && written == tests[i].blocks[j].length, "WriteFile failed with %u\n", GetLastError()); ++ } ++ ++ CloseHandle(file); ++ ++ call_winverify(pathW, &status, FALSE); ++ todo_wine_if(tests[i].t1.todo) ++ ok(status == tests[i].t1.status, "test %d/1: expected %08x, got %08x\n", i, tests[i].t1.status, status); ++ ++ call_winverify(pathW, &status, TRUE); ++ todo_wine_if(tests[i].t2.todo) ++ ok(status == tests[i].t2.status, "test %d/2: expected %08x, got %08x\n", i, tests[i].t2.status, status); ++ ++ DeleteFileW(pathW); ++ } ++} ++ + static void test_get_known_usages(void) + { + BOOL ret; +@@ -939,5 +1290,6 @@ START_TEST(softpub) + test_provider_funcs(); + test_sip_create_indirect_data(); + test_wintrust(); ++ test_wintrust_digest(); + test_get_known_usages(); + } +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/wintrust-WinVerifyTrust/0002-wintrust-tests-Add-some-additional-tests.patch wine-staging-1.9.7~ubuntu15.04.1/patches/wintrust-WinVerifyTrust/0002-wintrust-tests-Add-some-additional-tests.patch --- wine-staging-1.9.6/patches/wintrust-WinVerifyTrust/0002-wintrust-tests-Add-some-additional-tests.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/wintrust-WinVerifyTrust/0002-wintrust-tests-Add-some-additional-tests.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,50 @@ +From 0563e84a0e506bcbb6cf989d57bf74264cfb5ed7 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sat, 2 Apr 2016 02:50:59 +0200 +Subject: wintrust/tests: Add some additional tests. + +--- + dlls/wintrust/tests/softpub.c | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/dlls/wintrust/tests/softpub.c b/dlls/wintrust/tests/softpub.c +index 2b51c30..a2fa764 100644 +--- a/dlls/wintrust/tests/softpub.c ++++ b/dlls/wintrust/tests/softpub.c +@@ -1154,6 +1154,16 @@ static void test_wintrust_digest(void) + { CERT_E_CHAINING, TRUE }, { S_OK, FALSE } + }, + { ++ {{ SelfSignedFile32, sizeof(SelfSignedFile32) }, ++ { Dummy, sizeof(Dummy) }}, ++ { TRUST_E_NOSIGNATURE, TRUE }, { TRUST_E_NOSIGNATURE, TRUE } ++ }, ++ { ++ {{ Dummy, sizeof(Dummy) }, ++ { SelfSignedFile32 + sizeof(Dummy), sizeof(SelfSignedFile32) - sizeof(Dummy) }}, ++ { TRUST_E_SUBJECT_FORM_UNKNOWN, FALSE }, { TRUST_E_NOSIGNATURE, TRUE } ++ }, ++ { + {{ SelfSignedFile32, 19 }, + { Dummy, sizeof(Dummy) }, + { SelfSignedFile32 + 19 + sizeof(Dummy), sizeof(SelfSignedFile32) - 19 - sizeof(Dummy) }}, +@@ -1174,6 +1184,16 @@ static void test_wintrust_digest(void) + { CERT_E_CHAINING, TRUE }, { S_OK, FALSE } + }, + { ++ {{ SelfSignedFile64, sizeof(SelfSignedFile64) }, ++ { Dummy, sizeof(Dummy) }}, ++ { TRUST_E_NOSIGNATURE, TRUE }, { TRUST_E_NOSIGNATURE, TRUE } ++ }, ++ { ++ {{ Dummy, sizeof(Dummy) }, ++ { SelfSignedFile64 + sizeof(Dummy), sizeof(SelfSignedFile64) - sizeof(Dummy) }}, ++ { TRUST_E_SUBJECT_FORM_UNKNOWN, FALSE }, { TRUST_E_NOSIGNATURE, TRUE } ++ }, ++ { + {{ SelfSignedFile64, 19 }, + { Dummy, sizeof(Dummy) }, + { SelfSignedFile64 + 19 + sizeof(Dummy), sizeof(SelfSignedFile64) - 19 - sizeof(Dummy) }}, +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/wintrust-WinVerifyTrust/0003-wintrust-Verify-image-hash-in-WinVerifyTrust.patch wine-staging-1.9.7~ubuntu15.04.1/patches/wintrust-WinVerifyTrust/0003-wintrust-Verify-image-hash-in-WinVerifyTrust.patch --- wine-staging-1.9.6/patches/wintrust-WinVerifyTrust/0003-wintrust-Verify-image-hash-in-WinVerifyTrust.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/wintrust-WinVerifyTrust/0003-wintrust-Verify-image-hash-in-WinVerifyTrust.patch 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1,254 @@ +From 108397c3d5e227ac2d83740a7f437fa275f1e65d Mon Sep 17 00:00:00 2001 +From: Mark Jansen +Date: Sat, 2 Apr 2016 02:57:47 +0200 +Subject: wintrust: Verify image hash in WinVerifyTrust. + +Includes various improvements by Sebastian Lackner . +--- + dlls/wintrust/softpub.c | 169 ++++++++++++++++++++++++++++++++++++++++++ + dlls/wintrust/tests/softpub.c | 8 +- + 2 files changed, 173 insertions(+), 4 deletions(-) + +diff --git a/dlls/wintrust/softpub.c b/dlls/wintrust/softpub.c +index 4e8582e..bb2fbd4 100644 +--- a/dlls/wintrust/softpub.c ++++ b/dlls/wintrust/softpub.c +@@ -1,5 +1,6 @@ + /* + * Copyright 2007 Juan Lang ++ * Copyright 2016 Mark Jansen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public +@@ -21,6 +22,7 @@ + + #include "windef.h" + #include "winbase.h" ++#include "winternl.h" + #include "wintrust.h" + #include "mssip.h" + #include "softpub.h" +@@ -208,6 +210,170 @@ static DWORD SOFTPUB_GetMessageFromFile(CRYPT_PROVIDER_DATA *data, HANDLE file, + return err; + } + ++/* See https://www.cs.auckland.ac.nz/~pgut001/pubs/authenticode.txt ++ * for details about the hashing. ++ */ ++static BOOL SOFTPUB_HashPEFile(BYTE *file, LARGE_INTEGER *size, HCRYPTHASH hash) ++{ ++ IMAGE_DOS_HEADER *dosheader = (IMAGE_DOS_HEADER *)file; ++ IMAGE_NT_HEADERS *ntheader; ++ IMAGE_DATA_DIRECTORY *security_dir; ++ DWORD *checksum; ++ ++ if (sizeof(dosheader) > size->QuadPart) ++ return FALSE; ++ ++ if (dosheader->e_magic != IMAGE_DOS_SIGNATURE) ++ { ++ ERR("Unrecognized IMAGE_DOS_HEADER magic %04x\n", dosheader->e_magic); ++ return FALSE; ++ } ++ ++ if (dosheader->e_lfanew >= 256 * 1024 * 1024) /* see RtlImageNtHeaderEx */ ++ return FALSE; ++ if (dosheader->e_lfanew + FIELD_OFFSET(IMAGE_NT_HEADERS, OptionalHeader.MajorLinkerVersion) > size->QuadPart) ++ return FALSE; ++ ++ ntheader = (IMAGE_NT_HEADERS *)(file + dosheader->e_lfanew); ++ if (ntheader->Signature != IMAGE_NT_SIGNATURE) ++ { ++ ERR("Unrecognized IMAGE_NT_HEADERS signature %08x\n", ntheader->Signature); ++ return FALSE; ++ } ++ ++ if (ntheader->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC) ++ { ++ IMAGE_NT_HEADERS32 *nt32 = (IMAGE_NT_HEADERS32 *)ntheader; ++ if (dosheader->e_lfanew + sizeof(nt32) > size->QuadPart) ++ return FALSE; ++ ++ checksum = &nt32->OptionalHeader.CheckSum; ++ security_dir = &nt32->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY]; ++ } ++ else if (ntheader->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) ++ { ++ IMAGE_NT_HEADERS64 *nt64 = (IMAGE_NT_HEADERS64 *)ntheader; ++ if (dosheader->e_lfanew + sizeof(nt64) > size->QuadPart) ++ return FALSE; ++ ++ checksum = &nt64->OptionalHeader.CheckSum; ++ security_dir = &nt64->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY]; ++ } ++ else ++ { ++ ERR("Unrecognized OptionalHeader magic %04x\n", ntheader->OptionalHeader.Magic); ++ return FALSE; ++ } ++ ++ if (security_dir->VirtualAddress < (BYTE *)(security_dir + 1) - file) ++ return FALSE; ++ if (security_dir->VirtualAddress > size->QuadPart) ++ return FALSE; ++ if (security_dir->VirtualAddress + security_dir->Size != size->QuadPart) ++ return FALSE; ++ ++ /* Hash until checksum. */ ++ if (!CryptHashData(hash, file, (BYTE *)checksum - file, 0)) ++ return FALSE; ++ ++ /* Hash until the DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY] entry. */ ++ if (!CryptHashData(hash, (BYTE *)(checksum + 1), (BYTE *)security_dir - (BYTE *)(checksum + 1), 0)) ++ return FALSE; ++ ++ /* Hash until the end of the file. */ ++ if (!CryptHashData(hash, (BYTE *)(security_dir + 1), ++ file + security_dir->VirtualAddress - (BYTE *)(security_dir + 1), 0)) ++ return FALSE; ++ ++ return TRUE; ++} ++ ++static DWORD SOFTPUB_VerifyImageHash(CRYPT_PROVIDER_DATA *data, HANDLE file) ++{ ++ SPC_INDIRECT_DATA_CONTENT *indirect = (SPC_INDIRECT_DATA_CONTENT *)data->u.pPDSip->psIndirectData; ++ DWORD err, hash_size, length; ++ BYTE *hash_data, *file_map = NULL; ++ LARGE_INTEGER file_size; ++ BOOL release_prov = FALSE; ++ HCRYPTPROV prov = data->hProv; ++ HCRYPTHASH hash = 0; ++ ALG_ID algID; ++ HANDLE map = NULL; ++ ++ if (((ULONG_PTR)indirect->Data.pszObjId >> 16) == 0 || ++ strcmp(indirect->Data.pszObjId, SPC_PE_IMAGE_DATA_OBJID)) ++ { ++ FIXME("Cannot verify hash for pszObjId=%s\n", debugstr_a(indirect->Data.pszObjId)); ++ return ERROR_SUCCESS; ++ } ++ ++ if (!(algID = CertOIDToAlgId(indirect->DigestAlgorithm.pszObjId))) ++ return TRUST_E_SYSTEM_ERROR; /* FIXME */ ++ ++ if (!prov) ++ { ++ if (!CryptAcquireContextW(&prov, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) ++ return GetLastError(); ++ release_prov = TRUE; ++ } ++ ++ if (!CryptCreateHash(prov, algID, 0, 0, &hash)) ++ { ++ err = GetLastError(); ++ goto done; ++ } ++ ++ if (!GetFileSizeEx(file, &file_size) || ++ !(map = CreateFileMappingW(file, NULL, PAGE_READONLY, 0, 0, NULL)) || ++ !(file_map = MapViewOfFile(map, FILE_MAP_READ, 0, 0, 0))) ++ { ++ err = GetLastError(); ++ goto done; ++ } ++ ++ if (!SOFTPUB_HashPEFile(file_map, &file_size, hash)) ++ { ++ err = TRUST_E_NOSIGNATURE; ++ goto done; ++ } ++ ++ length = sizeof(hash_size); ++ if (!CryptGetHashParam(hash, HP_HASHSIZE, (BYTE *)&hash_size, &length, 0)) ++ { ++ err = GetLastError(); ++ goto done; ++ } ++ ++ if (!(hash_data = data->psPfns->pfnAlloc(hash_size))) ++ { ++ err = ERROR_OUTOFMEMORY; ++ goto done; ++ } ++ ++ if (!CryptGetHashParam(hash, HP_HASHVAL, hash_data, &hash_size, 0)) ++ { ++ err = GetLastError(); ++ data->psPfns->pfnFree(hash_data); ++ goto done; ++ } ++ ++ err = (hash_size == indirect->Digest.cbData && ++ !memcmp(hash_data, indirect->Digest.pbData, hash_size)) ? S_OK : TRUST_E_BAD_DIGEST; ++ data->psPfns->pfnFree(hash_data); ++ ++done: ++ if (file_map) ++ UnmapViewOfFile(file_map); ++ if (map) ++ CloseHandle(map); ++ if (hash) ++ CryptDestroyHash(hash); ++ if (release_prov) ++ CryptReleaseContext(prov, 0); ++ return err; ++} ++ ++ + static DWORD SOFTPUB_CreateStoreFromMessage(CRYPT_PROVIDER_DATA *data) + { + DWORD err = ERROR_SUCCESS; +@@ -371,6 +537,9 @@ static DWORD SOFTPUB_LoadFileMessage(CRYPT_PROVIDER_DATA *data) + if (err) + goto error; + err = SOFTPUB_DecodeInnerContent(data); ++ if (err) ++ goto error; ++ err = SOFTPUB_VerifyImageHash(data, data->pWintrustData->u.pFile->hFile); + + error: + if (err && data->fOpenedFile && data->pWintrustData->u.pFile) +diff --git a/dlls/wintrust/tests/softpub.c b/dlls/wintrust/tests/softpub.c +index a2fa764..526b0eb 100644 +--- a/dlls/wintrust/tests/softpub.c ++++ b/dlls/wintrust/tests/softpub.c +@@ -1156,7 +1156,7 @@ static void test_wintrust_digest(void) + { + {{ SelfSignedFile32, sizeof(SelfSignedFile32) }, + { Dummy, sizeof(Dummy) }}, +- { TRUST_E_NOSIGNATURE, TRUE }, { TRUST_E_NOSIGNATURE, TRUE } ++ { TRUST_E_NOSIGNATURE, FALSE }, { TRUST_E_NOSIGNATURE, FALSE } + }, + { + {{ Dummy, sizeof(Dummy) }, +@@ -1167,7 +1167,7 @@ static void test_wintrust_digest(void) + {{ SelfSignedFile32, 19 }, + { Dummy, sizeof(Dummy) }, + { SelfSignedFile32 + 19 + sizeof(Dummy), sizeof(SelfSignedFile32) - 19 - sizeof(Dummy) }}, +- { TRUST_E_BAD_DIGEST, TRUE }, { TRUST_E_NOSIGNATURE, TRUE } ++ { TRUST_E_BAD_DIGEST, FALSE }, { TRUST_E_NOSIGNATURE, TRUE } + }, + { + {{ SelfSignedFile32, sizeof(IMAGE_DOS_HEADER) }}, +@@ -1186,7 +1186,7 @@ static void test_wintrust_digest(void) + { + {{ SelfSignedFile64, sizeof(SelfSignedFile64) }, + { Dummy, sizeof(Dummy) }}, +- { TRUST_E_NOSIGNATURE, TRUE }, { TRUST_E_NOSIGNATURE, TRUE } ++ { TRUST_E_NOSIGNATURE, FALSE }, { TRUST_E_NOSIGNATURE, FALSE } + }, + { + {{ Dummy, sizeof(Dummy) }, +@@ -1197,7 +1197,7 @@ static void test_wintrust_digest(void) + {{ SelfSignedFile64, 19 }, + { Dummy, sizeof(Dummy) }, + { SelfSignedFile64 + 19 + sizeof(Dummy), sizeof(SelfSignedFile64) - 19 - sizeof(Dummy) }}, +- { TRUST_E_BAD_DIGEST, TRUE }, { TRUST_E_NOSIGNATURE, TRUE } ++ { TRUST_E_BAD_DIGEST, FALSE }, { TRUST_E_NOSIGNATURE, TRUE } + }, + { + {{ SelfSignedFile64, sizeof(IMAGE_DOS_HEADER) }}, +-- +2.7.1 + diff -Nru wine-staging-1.9.6/patches/wintrust-WinVerifyTrust/definition wine-staging-1.9.7~ubuntu15.04.1/patches/wintrust-WinVerifyTrust/definition --- wine-staging-1.9.6/patches/wintrust-WinVerifyTrust/definition 1970-01-01 00:00:00.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/patches/wintrust-WinVerifyTrust/definition 2016-04-04 18:23:50.000000000 +0000 @@ -0,0 +1 @@ +Fixes: Implement image hash verification in WinVerifyTrust diff -Nru wine-staging-1.9.6/programs/cmd/tests/test_builtins.cmd wine-staging-1.9.7~ubuntu15.04.1/programs/cmd/tests/test_builtins.cmd --- wine-staging-1.9.6/programs/cmd/tests/test_builtins.cmd 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/programs/cmd/tests/test_builtins.cmd 2016-04-04 18:06:32.000000000 +0000 @@ -1072,16 +1072,16 @@ echo for /R passed echo --- Complex wildcards unix and windows slash cd .. -echo Windows slashs, valid path +echo Windows slashes, valid path for %%f in (foobar\baz\bazbaz) do echo ASIS: %%f for %%f in (foobar\baz\*) do echo WC : %%f -echo Windows slashs, invalid path +echo Windows slashes, invalid path for %%f in (foobar\jim\bazbaz) do echo ASIS: %%f for %%f in (foobar\jim\*) do echo WC : %%f -echo Unix slashs, valid path +echo Unix slashes, valid path for %%f in (foobar/baz/bazbaz) do echo ASIS: %%f for %%f in (foobar/baz/*) do echo WC : %%f -echo Unix slashs, invalid path +echo Unix slashes, invalid path for %%f in (foobar/jim/bazbaz) do echo ASIS: %%f for %%f in (foobar/jim/*) do echo WC : %%f echo Done diff -Nru wine-staging-1.9.6/programs/cmd/tests/test_builtins.cmd.exp wine-staging-1.9.7~ubuntu15.04.1/programs/cmd/tests/test_builtins.cmd.exp --- wine-staging-1.9.6/programs/cmd/tests/test_builtins.cmd.exp 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/programs/cmd/tests/test_builtins.cmd.exp 2016-04-04 18:06:32.000000000 +0000 @@ -714,15 +714,15 @@ Strip missing wildcards, keep unwildcarded names for /R passed --- Complex wildcards unix and windows slash -Windows slashs, valid path +Windows slashes, valid path ASIS: foobar\baz\bazbaz WC : foobar\baz\bazbaz -Windows slashs, invalid path +Windows slashes, invalid path ASIS: foobar\jim\bazbaz -Unix slashs, valid path +Unix slashes, valid path ASIS: foobar/baz/bazbaz WC : bazbaz -Unix slashs, invalid path +Unix slashes, invalid path ASIS: foobar/jim/bazbaz Done --- for /L diff -Nru wine-staging-1.9.6/programs/reg/reg.c wine-staging-1.9.7~ubuntu15.04.1/programs/reg/reg.c --- wine-staging-1.9.6/programs/reg/reg.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/programs/reg/reg.c 2016-04-04 18:06:32.000000000 +0000 @@ -355,12 +355,7 @@ return 1; p = strchrW(key_name,'\\'); - if (!p) - { - output_message(STRING_INVALID_KEY); - return 1; - } - p++; + if (p) p++; root = path_get_rootkey(key_name); if (!root) @@ -440,12 +435,7 @@ return 1; p = strchrW(key_name,'\\'); - if (!p) - { - output_message(STRING_INVALID_KEY); - return 1; - } - p++; + if (p) p++; root = path_get_rootkey(key_name); if (!root) diff -Nru wine-staging-1.9.6/programs/regedit/listview.c wine-staging-1.9.7~ubuntu15.04.1/programs/regedit/listview.c --- wine-staging-1.9.6/programs/regedit/listview.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/programs/regedit/listview.c 2016-04-04 18:06:32.000000000 +0000 @@ -20,6 +20,7 @@ */ #include +#include #include #include #include @@ -167,14 +168,19 @@ ListView_SetItemTextW(hwndLV, index, 2, g_szValueNotSet); } break; - case REG_DWORD: { + case REG_DWORD: + case REG_DWORD_BIG_ENDIAN: { + DWORD value = *(DWORD*)ValBuf; WCHAR buf[64]; WCHAR format[] = {'0','x','%','0','8','x',' ','(','%','u',')',0}; - wsprintfW(buf, format, *(DWORD*)ValBuf, *(DWORD*)ValBuf); + if (dwValType == REG_DWORD_BIG_ENDIAN) + value = RtlUlongByteSwap(value); + wsprintfW(buf, format, value, value); ListView_SetItemTextW(hwndLV, index, 2, buf); } break; - case REG_BINARY: { + case REG_BINARY: + case REG_NONE: { unsigned int i; LPBYTE pData = ValBuf; LPWSTR strBinary = HeapAlloc(GetProcessHeap(), 0, dwCount * sizeof(WCHAR) * 3 + sizeof(WCHAR)); diff -Nru wine-staging-1.9.6/programs/winecfg/resource.h wine-staging-1.9.7~ubuntu15.04.1/programs/winecfg/resource.h --- wine-staging-1.9.6/programs/winecfg/resource.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/programs/winecfg/resource.h 2016-04-04 18:06:32.000000000 +0000 @@ -200,14 +200,14 @@ #define IDC_SYSPARAMS_INACTIVE_BORDER 8420 #define IDC_SYSPARAMS_BUTTON_SHADOW 8421 #define IDC_SYSPARAMS_GRAY_TEXT 8422 -#define IDC_SYSPARAMS_BUTTON_HILIGHT 8423 +#define IDC_SYSPARAMS_BUTTON_HIGHLIGHT 8423 #define IDC_SYSPARAMS_BUTTON_DARK_SHADOW 8424 #define IDC_SYSPARAMS_BUTTON_LIGHT 8425 #define IDC_SYSPARAMS_BUTTON_ALTERNATE 8426 #define IDC_SYSPARAMS_HOT_TRACKING 8427 #define IDC_SYSPARAMS_ACTIVE_TITLE_GRADIENT 8428 #define IDC_SYSPARAMS_INACTIVE_TITLE_GRADIENT 8429 -#define IDC_SYSPARAMS_MENU_HILIGHT 8430 +#define IDC_SYSPARAMS_MENU_HIGHLIGHT 8430 #define IDC_SYSPARAMS_MENUBAR 8431 /* About tab */ diff -Nru wine-staging-1.9.6/programs/winecfg/theme.c wine-staging-1.9.7~ubuntu15.04.1/programs/winecfg/theme.c --- wine-staging-1.9.6/programs/winecfg/theme.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/programs/winecfg/theme.c 2016-04-04 18:06:32.000000000 +0000 @@ -532,14 +532,14 @@ {-1, COLOR_INACTIVEBORDER, "InactiveBorder" }, /* IDC_SYSPARAMS_INACTIVE_BORDER */ {-1, COLOR_BTNSHADOW, "ButtonShadow" }, /* IDC_SYSPARAMS_BUTTON_SHADOW */ {-1, COLOR_GRAYTEXT, "GrayText" }, /* IDC_SYSPARAMS_GRAY_TEXT */ - {-1, COLOR_BTNHILIGHT, "ButtonHilight" }, /* IDC_SYSPARAMS_BUTTON_HILIGHT */ + {-1, COLOR_BTNHIGHLIGHT, "ButtonHilight" }, /* IDC_SYSPARAMS_BUTTON_HIGHLIGHT */ {-1, COLOR_3DDKSHADOW, "ButtonDkShadow" }, /* IDC_SYSPARAMS_BUTTON_DARK_SHADOW */ {-1, COLOR_3DLIGHT, "ButtonLight" }, /* IDC_SYSPARAMS_BUTTON_LIGHT */ {-1, COLOR_ALTERNATEBTNFACE, "ButtonAlternateFace" }, /* IDC_SYSPARAMS_BUTTON_ALTERNATE */ {-1, COLOR_HOTLIGHT, "HotTrackingColor" }, /* IDC_SYSPARAMS_HOT_TRACKING */ {-1, COLOR_GRADIENTACTIVECAPTION, "GradientActiveTitle" }, /* IDC_SYSPARAMS_ACTIVE_TITLE_GRADIENT */ {-1, COLOR_GRADIENTINACTIVECAPTION, "GradientInactiveTitle" }, /* IDC_SYSPARAMS_INACTIVE_TITLE_GRADIENT */ - {-1, COLOR_MENUHILIGHT, "MenuHilight" }, /* IDC_SYSPARAMS_MENU_HILIGHT */ + {-1, COLOR_MENUHILIGHT, "MenuHilight" }, /* IDC_SYSPARAMS_MENU_HIGHLIGHT */ {-1, COLOR_MENUBAR, "MenuBar" }, /* IDC_SYSPARAMS_MENUBAR */ }; diff -Nru wine-staging-1.9.6/programs/winecfg/winecfg.rc wine-staging-1.9.7~ubuntu15.04.1/programs/winecfg/winecfg.rc --- wine-staging-1.9.6/programs/winecfg/winecfg.rc 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/programs/winecfg/winecfg.rc 2016-04-04 18:06:32.000000000 +0000 @@ -118,14 +118,14 @@ IDC_SYSPARAMS_INACTIVE_BORDER "Inactive Border" IDC_SYSPARAMS_BUTTON_SHADOW "Controls Shadow" IDC_SYSPARAMS_GRAY_TEXT "Gray Text" - IDC_SYSPARAMS_BUTTON_HILIGHT "Controls Highlight" + IDC_SYSPARAMS_BUTTON_HIGHLIGHT "Controls Highlight" IDC_SYSPARAMS_BUTTON_DARK_SHADOW "Controls Dark Shadow" IDC_SYSPARAMS_BUTTON_LIGHT "Controls Light" IDC_SYSPARAMS_BUTTON_ALTERNATE "Controls Alternate Background" IDC_SYSPARAMS_HOT_TRACKING "Hot Tracked Item" IDC_SYSPARAMS_ACTIVE_TITLE_GRADIENT "Active Title Bar Gradient" IDC_SYSPARAMS_INACTIVE_TITLE_GRADIENT "Inactive Title Bar Gradient" - IDC_SYSPARAMS_MENU_HILIGHT "Menu Highlight" + IDC_SYSPARAMS_MENU_HIGHLIGHT "Menu Highlight" IDC_SYSPARAMS_MENUBAR "Menu Bar" END diff -Nru wine-staging-1.9.6/programs/wineconsole/dialog.c wine-staging-1.9.7~ubuntu15.04.1/programs/wineconsole/dialog.c --- wine-staging-1.9.6/programs/wineconsole/dialog.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/programs/wineconsole/dialog.c 2016-04-04 18:06:32.000000000 +0000 @@ -303,7 +303,7 @@ struct dialog_info* di = (struct dialog_info*)lParam; WCUSER_DumpTextMetric(tm, FontType); - if (WCUSER_ValidateFontMetric(di->data, tm, FontType, TRUE)) + if (WCUSER_ValidateFontMetric(di->data, tm, FontType, 0)) { di->nFont++; } @@ -317,7 +317,7 @@ struct dialog_info* di = (struct dialog_info*)lParam; WCUSER_DumpLogFont("DlgFamily: ", lf, FontType); - if (WCUSER_ValidateFont(di->data, lf)) + if (WCUSER_ValidateFont(di->data, lf, 0)) { if (FontType & RASTER_FONTTYPE) { @@ -375,7 +375,7 @@ return 0; } - if (WCUSER_ValidateFontMetric(di->data, tm, FontType, TRUE)) + if (WCUSER_ValidateFontMetric(di->data, tm, FontType, 0)) { int idx = 0; diff -Nru wine-staging-1.9.6/programs/wineconsole/user.c wine-staging-1.9.7~ubuntu15.04.1/programs/wineconsole/user.c --- wine-staging-1.9.6/programs/wineconsole/user.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/programs/wineconsole/user.c 2016-04-04 18:06:32.000000000 +0000 @@ -333,7 +333,7 @@ struct font_chooser { struct inner_data* data; - BOOL check_screen_size; + int pass; BOOL done; }; @@ -343,15 +343,26 @@ * Returns true if the font described in tm is usable as a font for the renderer */ BOOL WCUSER_ValidateFontMetric(const struct inner_data* data, const TEXTMETRICW* tm, - DWORD type, BOOL check_screen_size) + DWORD type, int pass) { - BOOL ret = TRUE; - - if (check_screen_size && (type & RASTER_FONTTYPE)) - ret = (tm->tmMaxCharWidth * data->curcfg.win_width < GetSystemMetrics(SM_CXSCREEN) && - tm->tmHeight * data->curcfg.win_height < GetSystemMetrics(SM_CYSCREEN)); - return ret && !tm->tmItalic && !tm->tmUnderlined && !tm->tmStruckOut && - (tm->tmCharSet == DEFAULT_CHARSET || tm->tmCharSet == g_uiDefaultCharset); + switch (pass) /* we get increasingly lenient in later passes */ + { + case 0: + if (type & RASTER_FONTTYPE) + { + if (tm->tmMaxCharWidth * data->curcfg.win_width >= GetSystemMetrics(SM_CXSCREEN) || + tm->tmHeight * data->curcfg.win_height >= GetSystemMetrics(SM_CYSCREEN)) + return FALSE; + } + /* fall through */ + case 1: + if (tm->tmCharSet != DEFAULT_CHARSET && tm->tmCharSet != g_uiDefaultCharset) return FALSE; + /* fall through */ + case 2: + if (tm->tmItalic || tm->tmUnderlined || tm->tmStruckOut) return FALSE; + break; + } + return TRUE; } /****************************************************************** @@ -359,12 +370,22 @@ * * Returns true if the font family described in lf is usable as a font for the renderer */ -BOOL WCUSER_ValidateFont(const struct inner_data* data, const LOGFONTW* lf) +BOOL WCUSER_ValidateFont(const struct inner_data* data, const LOGFONTW* lf, int pass) { - return (lf->lfPitchAndFamily & 3) == FIXED_PITCH && - /* (lf->lfPitchAndFamily & 0xF0) == FF_MODERN && */ - lf->lfFaceName[0] != '@' && - (lf->lfCharSet == DEFAULT_CHARSET || lf->lfCharSet == g_uiDefaultCharset); + switch (pass) /* we get increasingly lenient in later passes */ + { + case 0: + case 1: + if (lf->lfCharSet != DEFAULT_CHARSET && lf->lfCharSet != g_uiDefaultCharset) return FALSE; + /* fall through */ + case 2: + if ((lf->lfPitchAndFamily & 3) != FIXED_PITCH) return FALSE; + /* fall through */ + case 3: + if (lf->lfFaceName[0] == '@') return FALSE; + break; + } + return TRUE; } /****************************************************************** @@ -379,7 +400,7 @@ struct font_chooser* fc = (struct font_chooser*)lParam; WCUSER_DumpTextMetric(tm, FontType); - if (WCUSER_ValidateFontMetric(fc->data, tm, FontType, fc->check_screen_size)) + if (WCUSER_ValidateFontMetric(fc->data, tm, FontType, fc->pass)) { LOGFONTW mlf = *lf; @@ -417,7 +438,7 @@ struct font_chooser* fc = (struct font_chooser*)lParam; WCUSER_DumpLogFont("InitFamily: ", lf, FontType); - if (WCUSER_ValidateFont(fc->data, lf)) + if (WCUSER_ValidateFont(fc->data, lf, fc->pass)) { EnumFontFamiliesW(PRIVATE(fc->data)->hMemDC, lf->lfFaceName, get_first_font_enum_2, lParam); @@ -537,13 +558,13 @@ /* try to find an acceptable font */ WINE_WARN("Couldn't match the font from registry... trying to find one\n"); fc.data = data; - fc.check_screen_size = TRUE; fc.done = FALSE; - EnumFontFamiliesW(PRIVATE(data)->hMemDC, NULL, get_first_font_enum, (LPARAM)&fc); - if (fc.done) return; - fc.check_screen_size = FALSE; - EnumFontFamiliesW(PRIVATE(data)->hMemDC, NULL, get_first_font_enum, (LPARAM)&fc); - if (!fc.done) WINECON_Fatal("Couldn't find a decent font, aborting\n"); + for (fc.pass = 0; fc.pass <= 4; fc.pass++) + { + EnumFontFamiliesW(PRIVATE(data)->hMemDC, NULL, get_first_font_enum, (LPARAM)&fc); + if (fc.done) return; + } + WINECON_Fatal("Couldn't find a decent font, aborting\n"); } /****************************************************************** diff -Nru wine-staging-1.9.6/programs/wineconsole/winecon_user.h wine-staging-1.9.7~ubuntu15.04.1/programs/wineconsole/winecon_user.h --- wine-staging-1.9.6/programs/wineconsole/winecon_user.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/programs/wineconsole/winecon_user.h 2016-04-04 18:06:32.000000000 +0000 @@ -45,9 +45,9 @@ /* from user.c */ extern const COLORREF WCUSER_ColorMap[16]; extern BOOL WCUSER_GetProperties(struct inner_data*, BOOL); -extern BOOL WCUSER_ValidateFont(const struct inner_data* data, const LOGFONTW* lf); +extern BOOL WCUSER_ValidateFont(const struct inner_data* data, const LOGFONTW* lf, int pass); extern BOOL WCUSER_ValidateFontMetric(const struct inner_data* data, const TEXTMETRICW* tm, - DWORD type, BOOL check_screen_size); + DWORD type, int pass); extern HFONT WCUSER_CopyFont(struct config_data* config, HWND hWnd, const LOGFONTW* lf, LONG* el); extern void WCUSER_FillLogFont(LOGFONTW* lf, const WCHAR* name, diff -Nru wine-staging-1.9.6/programs/winedbg/symbol.c wine-staging-1.9.7~ubuntu15.04.1/programs/winedbg/symbol.c --- wine-staging-1.9.6/programs/winedbg/symbol.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/programs/winedbg/symbol.c 2016-04-04 18:06:32.000000000 +0000 @@ -99,7 +99,7 @@ VARIANT v; type.module = sym->ModBase; - type.id = sym->info; + type.id = sym->Index; if (!types_get_info(&type, TI_GET_VALUE, &v)) { @@ -252,7 +252,7 @@ return TRUE; } sgv->syms[insp].flags = sym->Flags; - sgv->syms[insp].sym_info = sym->info; + sgv->syms[insp].sym_info = sym->Index; sgv->num++; return TRUE; @@ -614,7 +614,7 @@ return dbg_no_line_info; func.module = sym->ModBase; - func.id = sym->info; + func.id = sym->Index; if (symbol_get_debug_start(&func, &start) && lin < start) return dbg_not_on_a_line_number; diff -Nru wine-staging-1.9.6/staging/patchupdate.py wine-staging-1.9.7~ubuntu15.04.1/staging/patchupdate.py --- wine-staging-1.9.6/staging/patchupdate.py 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/staging/patchupdate.py 2016-04-04 18:23:50.000000000 +0000 @@ -314,7 +314,7 @@ """Checks if any patch with given indices affecting filename is a binary patch.""" for i in indices: for patch in all_patches[i].patches: - if patch.modified_file == filename and patch.is_binary(): + if patch.modified_file == filename and patch.is_binary: return True return False diff -Nru wine-staging-1.9.6/staging/patchutils.py wine-staging-1.9.7~ubuntu15.04.1/staging/patchutils.py --- wine-staging-1.9.6/staging/patchutils.py 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/staging/patchutils.py 2016-04-04 18:23:50.000000000 +0000 @@ -19,7 +19,6 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA # -import cStringIO as StringIO import collections import difflib import email.header @@ -29,8 +28,14 @@ import re import shutil import subprocess +import sys import tempfile +try: + from cStringIO import StringIO +except ImportError: + from io import StringIO + _devnull = open(os.devnull, 'wb') class PatchParserError(RuntimeError): @@ -51,16 +56,16 @@ class PatchObject(object): def __init__(self, filename, header): - self.patch_author = header['author'] - self.patch_email = header['email'] - self.patch_subject = header['subject'] - self.patch_revision = header['revision'] if header.has_key('revision') else 1 - self.signed_off_by = header['signedoffby'] if header.has_key('signedoffby') else [] + self.patch_author = header.get('author', None) + self.patch_email = header.get('email', None) + self.patch_subject = header.get('subject', None) + self.patch_revision = header.get('revision', 1) + self.signed_off_by = header.get('signedoffby', []) self.filename = filename self.offset_begin = None self.offset_end = None - self.isbinary = False + self.is_binary = False self.oldname = None self.newname = None @@ -70,9 +75,6 @@ self.newsha1 = None self.newmode = None - def is_binary(self): - return self.isbinary - def read_chunks(self): """Iterates over arbitrary sized chunks of this patch.""" assert self.offset_end >= self.offset_begin @@ -85,13 +87,17 @@ yield buf i -= len(buf) + def read(self): + """Return the full patch as a string.""" + return "".join(chunk for chunk in self.read_chunks()) + class _FileReader(object): def __init__(self, filename, content=None): self.filename = filename self.peeked = None if content is not None: - self.fp = StringIO.StringIO(content) + self.fp = StringIO(content) else: self.fp = open(filename) @@ -133,186 +139,189 @@ tmp, self.peeked = self.peeked, None return tmp[1] -def read_patch(filename, content=None): - """Iterates over all patches contained in a file, and returns PatchObject objects.""" +def _read_single_patch(fp, header, oldname=None, newname=None): + """Internal function to read a single patch from a file.""" - def _read_single_patch(fp, header, oldname=None, newname=None): - """Internal function to read a single patch from a file.""" + patch = PatchObject(fp.filename, header) + patch.offset_begin = fp.tell() + patch.oldname = oldname + patch.newname = newname + + # Skip over initial diff --git header + line = fp.peek() + if line.startswith("diff --git "): + assert fp.read() == line - patch = PatchObject(fp.filename, header) - patch.offset_begin = fp.tell() - patch.oldname = oldname - patch.newname = newname - - # Skip over initial diff --git header + # Read header + while True: line = fp.peek() - if line.startswith("diff --git "): - assert fp.read() == line + if line is None: + break - # Read header - while True: - line = fp.peek() - if line is None: - break + elif line.startswith("--- "): + patch.oldname = line[4:].strip() - elif line.startswith("--- "): - patch.oldname = line[4:].strip() + elif line.startswith("+++ "): + patch.newname = line[4:].strip() - elif line.startswith("+++ "): - patch.newname = line[4:].strip() + elif line.startswith("old mode") or line.startswith("deleted file mode"): + pass # ignore - elif line.startswith("old mode") or line.startswith("deleted file mode"): - pass # ignore + elif line.startswith("new mode "): + patch.newmode = line[9:].strip() - elif line.startswith("new mode "): - patch.newmode = line[9:].strip() + elif line.startswith("new file mode "): + patch.newmode = line[14:].strip() - elif line.startswith("new file mode "): - patch.newmode = line[14:].strip() + elif line.startswith("new mode") or line.startswith("new file mode"): + raise PatchParserError("Unable to parse header line '%s'." % line) - elif line.startswith("new mode") or line.startswith("new file mode"): - raise PatchParserError("Unable to parse header line '%s'." % line) + elif line.startswith("copy from") or line.startswith("copy to"): + raise NotImplementedError("Patch copy header not implemented yet.") - elif line.startswith("copy from") or line.startswith("copy to"): - raise NotImplementedError("Patch copy header not implemented yet.") + elif line.startswith("rename "): + raise NotImplementedError("Patch rename header not implemented yet.") - elif line.startswith("rename "): - raise NotImplementedError("Patch rename header not implemented yet.") + elif line.startswith("similarity index") or line.startswith("dissimilarity index"): + pass # ignore - elif line.startswith("similarity index") or line.startswith("dissimilarity index"): - pass # ignore + elif line.startswith("index "): + r = re.match("^index ([a-fA-F0-9]*)\.\.([a-fA-F0-9]*)", line) + if not r: raise PatchParserError("Unable to parse index header line '%s'." % line) + patch.oldsha1, patch.newsha1 = r.group(1), r.group(2) - elif line.startswith("index "): - r = re.match("^index ([a-fA-F0-9]*)\.\.([a-fA-F0-9]*)", line) - if not r: raise PatchParserError("Unable to parse index header line '%s'." % line) - patch.oldsha1, patch.newsha1 = r.group(1), r.group(2) + else: + break + assert fp.read() == line - else: - break - assert fp.read() == line + if patch.oldname is None or patch.newname is None: + raise PatchParserError("Missing old or new name.") + elif patch.oldname == "/dev/null" and patch.newname == "/dev/null": + raise PatchParserError("Old and new name is /dev/null?") + + if patch.oldname.startswith("a/"): + patch.oldname = patch.oldname[2:] + elif patch.oldname != "/dev/null": + raise PatchParserError("Old name in patch doesn't start with a/.") + + if patch.newname.startswith("b/"): + patch.newname = patch.newname[2:] + elif patch.newname != "/dev/null": + raise PatchParserError("New name in patch doesn't start with b/.") + + if patch.newname != "/dev/null": + patch.modified_file = patch.newname + else: + patch.modified_file = patch.oldname + + # Decide between binary and textual patch + if line is None or line.startswith("diff --git ") or line.startswith("--- "): + if oldname != newname: + raise PatchParserError("Stripped old- and new name doesn't match.") - if patch.oldname is None or patch.newname is None: - raise PatchParserError("Missing old or new name.") - elif patch.oldname == "/dev/null" and patch.newname == "/dev/null": - raise PatchParserError("Old and new name is /dev/null?") - - if patch.oldname.startswith("a/"): - patch.oldname = patch.oldname[2:] - elif patch.oldname != "/dev/null": - raise PatchParserError("Old name in patch doesn't start with a/.") - - if patch.newname.startswith("b/"): - patch.newname = patch.newname[2:] - elif patch.newname != "/dev/null": - raise PatchParserError("New name in patch doesn't start with b/.") + elif line.startswith("@@ -"): + while True: + line = fp.peek() + if line is None or not line.startswith("@@ -"): + break - if patch.newname != "/dev/null": - patch.modified_file = patch.newname - else: - patch.modified_file = patch.oldname + r = re.match("^@@ -(([0-9]+),)?([0-9]+) \+(([0-9]+),)?([0-9]+) @@", line) + if not r: raise PatchParserError("Unable to parse hunk header '%s'." % line) + srcpos = max(int(r.group(2)) - 1, 0) if r.group(2) else 0 + dstpos = max(int(r.group(5)) - 1, 0) if r.group(5) else 0 + srclines, dstlines = int(r.group(3)), int(r.group(6)) + if srclines <= 0 and dstlines <= 0: + raise PatchParserError("Empty hunk doesn't make sense.") + assert fp.read() == line - # Decide between binary and textual patch - if line is None or line.startswith("diff --git ") or line.startswith("--- "): - if oldname != newname: - raise PatchParserError("Stripped old- and new name doesn't match.") + try: + while srclines > 0 or dstlines > 0: + line = fp.read()[0] + if line == " ": + if srclines == 0 or dstlines == 0: + raise PatchParserError("Corrupted patch.") + srclines -= 1 + dstlines -= 1 + elif line == "-": + if srclines == 0: + raise PatchParserError("Corrupted patch.") + srclines -= 1 + elif line == "+": + if dstlines == 0: + raise PatchParserError("Corrupted patch.") + dstlines -= 1 + elif line == "\\": + pass # ignore + else: + raise PatchParserError("Unexpected line in hunk.") + except TypeError: # triggered by None[0] + raise PatchParserError("Truncated patch.") - elif line.startswith("@@ -"): while True: line = fp.peek() - if line is None or not line.startswith("@@ -"): - break - - r = re.match("^@@ -(([0-9]+),)?([0-9]+) \+(([0-9]+),)?([0-9]+) @@", line) - if not r: raise PatchParserError("Unable to parse hunk header '%s'." % line) - srcpos = max(int(r.group(2)) - 1, 0) if r.group(2) else 0 - dstpos = max(int(r.group(5)) - 1, 0) if r.group(5) else 0 - srclines, dstlines = int(r.group(3)), int(r.group(6)) - if srclines <= 0 and dstlines <= 0: - raise PatchParserError("Empty hunk doesn't make sense.") + if line is None or not line.startswith("\\ "): break assert fp.read() == line - try: - while srclines > 0 or dstlines > 0: - line = fp.read()[0] - if line == " ": - if srclines == 0 or dstlines == 0: - raise PatchParserError("Corrupted patch.") - srclines -= 1 - dstlines -= 1 - elif line == "-": - if srclines == 0: - raise PatchParserError("Corrupted patch.") - srclines -= 1 - elif line == "+": - if dstlines == 0: - raise PatchParserError("Corrupted patch.") - dstlines -= 1 - elif line == "\\": - pass # ignore - else: - raise PatchParserError("Unexpected line in hunk.") - except TypeError: # triggered by None[0] - raise PatchParserError("Truncated patch.") - - while True: - line = fp.peek() - if line is None or not line.startswith("\\ "): break - assert fp.read() == line - - elif line.rstrip() == "GIT binary patch": - if patch.oldsha1 is None or patch.newsha1 is None: - raise PatchParserError("Missing index header, sha1 sums required for binary patch.") - elif patch.oldname != patch.newname: - raise PatchParserError("Stripped old- and new name doesn't match for binary patch.") - assert fp.read() == line + elif line.rstrip() == "GIT binary patch": + if patch.oldsha1 is None or patch.newsha1 is None: + raise PatchParserError("Missing index header, sha1 sums required for binary patch.") + elif patch.oldname != patch.newname: + raise PatchParserError("Stripped old- and new name doesn't match for binary patch.") + assert fp.read() == line + + line = fp.read() + if line is None: raise PatchParserError("Unexpected end of file.") + r = re.match("^(literal|delta) ([0-9]+)", line) + if not r: raise NotImplementedError("Only literal/delta patches are supported.") + patch.is_binary = True + # Skip over patch data + while True: line = fp.read() - if line is None: raise PatchParserError("Unexpected end of file.") - r = re.match("^(literal|delta) ([0-9]+)", line) - if not r: raise NotImplementedError("Only literal/delta patches are supported.") - patch.isbinary = True + if line is None or line.strip() == "": + break - # Skip over patch data - while True: - line = fp.read() - if line is None or line.strip() == "": - break + else: + raise PatchParserError("Unknown patch format.") - else: - raise PatchParserError("Unknown patch format.") + patch.offset_end = fp.tell() + return patch - patch.offset_end = fp.tell() - return patch - - def _parse_author(author): +def _parse_author(author): + if sys.version_info[0] > 2: + author = str(email.header.make_header(email.header.decode_header(author))) + else: author = ' '.join([data.decode(format or 'utf-8').encode('utf-8') for \ data, format in email.header.decode_header(author)]) - r = re.match("\"?([^\"]*)\"? <(.*)>", author) - if r is None: raise NotImplementedError("Failed to parse From - header.") - return r.group(1).strip(), r.group(2).strip() - - def _parse_subject(subject): - version = "(v|try|rev|take) *([0-9]+)" - subject = subject.strip() - if subject.endswith("."): subject = subject[:-1] - r = re.match("^\\[PATCH([^]]*)\\](.*)$", subject, re.IGNORECASE) - if r is not None: - subject = r.group(2).strip() - r = re.search(version, r.group(1), re.IGNORECASE) - 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) - if r is not None: return "%s: %s" % (r.group(1), r.group(4)), 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("^(.*)\\(resend\\)$", subject, re.IGNORECASE) - if r is not None: return r.group(1).strip(), 1 - return subject, 1 + r = re.match("\"?([^\"]*)\"? <(.*)>", author) + if r is None: raise NotImplementedError("Failed to parse From - header.") + return r.group(1).strip(), r.group(2).strip() + +def _parse_subject(subject): + version = "(v|try|rev|take) *([0-9]+)" + subject = subject.strip() + if subject.endswith("."): subject = subject[:-1] + r = re.match("^\\[PATCH([^]]*)\\](.*)$", subject, re.IGNORECASE) + if r is not None: + subject = r.group(2).strip() + r = re.search(version, r.group(1), re.IGNORECASE) + 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) + if r is not None: return "%s: %s" % (r.group(1), r.group(4)), 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("^(.*)\\(resend\\)$", subject, re.IGNORECASE) + if r is not None: return r.group(1).strip(), 1 + return subject, 1 + +def read_patch(filename, content=None): + """Iterates over all patches contained in a file, and returns PatchObject objects.""" header = {} with _FileReader(filename, content) as fp: @@ -323,6 +332,7 @@ elif line.startswith("From: "): header['author'], header['email'] = _parse_author(line[6:]) + header.pop('signedoffby', None) assert fp.read() == line elif line.startswith("Subject: "): @@ -338,9 +348,10 @@ subject = re.sub('^([^:]*: *)([a-z])', lambda x: "%s%s" % (x.group(1), x.group(2).upper()), subject, 1) header['subject'], header['revision'] = subject, revision + header.pop('signedoffby', None) elif line.startswith("Signed-off-by: "): - if not header.has_key('signedoffby'): + if 'signedoffby' not in header: header['signedoffby'] = [] header['signedoffby'].append(_parse_author(line[15:])) assert fp.read() == line @@ -362,7 +373,7 @@ def apply_patch(original, patchfile, reverse=False, fuzz=2): """Apply a patch with optional fuzz - uses the commandline 'patch' utility.""" - result = tempfile.NamedTemporaryFile(delete=False) + result = tempfile.NamedTemporaryFile(mode='w+', delete=False) try: # We open the file again to avoid race-conditions with multithreaded reads with open(original.name) as fp: @@ -380,7 +391,7 @@ # Hack - we can't keep the file open while patching ('patch' might rename/replace # the file), so create a new _TemporaryFileWrapper object for the existing path. - return tempfile._TemporaryFileWrapper(file=open(result.name, 'r+b'), \ + return tempfile._TemporaryFileWrapper(file=open(result.name, 'r+'), \ name=result.name, delete=True) except: os.unlink(result.name) @@ -479,7 +490,7 @@ # (4) create another diff to apply the changes on the patched version # - with tempfile.NamedTemporaryFile() as diff: + with tempfile.NamedTemporaryFile(mode='w+') as diff: exitcode = subprocess.call(["diff", "-u", original.name, patched.name], stdout=diff, stderr=_devnull) if exitcode == 0: @@ -506,6 +517,8 @@ line = diff.readline() if line == "": break + if line.startswith("\\ "): + continue # Parse each hunk, and extract the srclines and dstlines. This algorithm is very # similar to _read_single_patch. @@ -630,7 +643,7 @@ diff.close() # Generate resulting file with #ifdefs - with tempfile.NamedTemporaryFile() as intermediate: + with tempfile.NamedTemporaryFile(mode='w+') as intermediate: pos = 0 while len(hunks): @@ -666,7 +679,7 @@ intermediate.flush() # Now we can finally compute the diff between the patched file and our intermediate file - diff = tempfile.NamedTemporaryFile() + diff = tempfile.NamedTemporaryFile(mode='w+') exitcode = subprocess.call(["diff", "-u", patched.name, intermediate.name], stdout=diff, stderr=_devnull) if exitcode != 1: # exitcode 0 cannot (=shouldn't) happen in this situation @@ -683,3 +696,266 @@ # Return the final diff return diff + +if __name__ == "__main__": + import unittest + + # Basic tests for _parse_author() and _parse_subject() + class PatchParserTests(unittest.TestCase): + def test_author(self): + author = _parse_author("Author Name ") + self.assertEqual(author, ("Author Name", "author@email.com")) + + author = _parse_author("=?UTF-8?q?Author=20Name?= ") + self.assertEqual(author, ("Author Name", "author@email.com")) + + def test_subject(self): + subject = _parse_subject("[PATCH v3] component: Subject.") + self.assertEqual(subject, ("component: Subject", 3)) + + subject = _parse_subject("[PATCH] component: Subject (v3).") + self.assertEqual(subject, ("component: Subject", 3)) + + subject = _parse_subject("[PATCH] component: Subject (try 3).") + self.assertEqual(subject, ("component: Subject", 3)) + + subject = _parse_subject("[PATCH] component: Subject (take 3).") + self.assertEqual(subject, ("component: Subject", 3)) + + subject = _parse_subject("[PATCH] component: Subject (rev 3).") + self.assertEqual(subject, ("component: Subject", 3)) + + subject = _parse_subject("[PATCH] component: Subject [v3].") + self.assertEqual(subject, ("component: Subject", 3)) + + subject = _parse_subject("[PATCH] component: Subject, v3.") + self.assertEqual(subject, ("component: Subject", 3)) + + subject = _parse_subject("[PATCH] component: Subject v3.") + self.assertEqual(subject, ("component: Subject", 3)) + + subject = _parse_subject("[PATCH] component: Subject (resend).") + self.assertEqual(subject, ("component: Subject", 1)) + + # Basic tests for read_patch() + class PatchReaderTests(unittest.TestCase): + def test_read(self): + source = ["From be07df750862699f2515c0ac0ceb7a6c25e9458a Mon Sep 17 00:00:00 2001", + "From: =?UTF-8?q?Author=20Name?= ", + "Subject: [PATCH v3] component: Replace arg1 with arg2.", + "", + "Signed-off-by: =?UTF-8?q?Author=20Name?= ", + "Signed-off-by: Other Developer ", + "---", + " test.txt | 2 +-", + " 1 file changed, 1 insertion(+), 1 deletion(-)", + "", + "diff --git a/test.txt b/test.txt", + "index d54375d..0078e66 100644", + "--- a/test.txt", "+++ b/test.txt", + "@@ -1,7 +1,7 @@", + " line1();", " line2();", " line3();", + "-function(arg1);", + "+function(arg2);", + " line5();", " line6();", " line7();", + "-- ", + "2.7.1"] + + expected = ["diff --git a/test.txt b/test.txt", + "index d54375d..0078e66 100644", + "--- a/test.txt", "+++ b/test.txt", + "@@ -1,7 +1,7 @@", + " line1();", " line2();", " line3();", + "-function(arg1);", + "+function(arg2);", + " line5();", " line6();", " line7();"] + + # Test formatted git patch with author and subject + patchfile = tempfile.NamedTemporaryFile(mode='w+') + patchfile.write("\n".join(source + [""])) + patchfile.flush() + + patches = list(read_patch(patchfile.name)) + self.assertEqual(len(patches), 1) + self.assertEqual(patches[0].patch_author, "Author Name") + self.assertEqual(patches[0].patch_email, "author@email.com") + self.assertEqual(patches[0].patch_subject, "component: Replace arg1 with arg2.") + self.assertEqual(patches[0].patch_revision, 3) + self.assertEqual(patches[0].signed_off_by, [("Author Name", "author@email.com"), + ("Other Developer", "other@email.com")]) + self.assertEqual(patches[0].filename, patchfile.name) + self.assertEqual(patches[0].is_binary, False) + self.assertEqual(patches[0].modified_file, "test.txt") + + lines = patches[0].read().rstrip("\n").split("\n") + self.assertEqual(lines, expected) + + # Test with git diff + del source[0:10] + self.assertTrue(source[0].startswith("diff --git")) + patchfile = tempfile.NamedTemporaryFile(mode='w+') + patchfile.write("\n".join(source + [""])) + patchfile.flush() + + patches = list(read_patch(patchfile.name)) + self.assertEqual(len(patches), 1) + self.assertEqual(patches[0].patch_author, None) + self.assertEqual(patches[0].patch_email, None) + self.assertEqual(patches[0].patch_subject, None) + self.assertEqual(patches[0].patch_revision, 1) + self.assertEqual(patches[0].signed_off_by, []) + self.assertEqual(patches[0].filename, patchfile.name) + self.assertEqual(patches[0].is_binary, False) + self.assertEqual(patches[0].modified_file, "test.txt") + + lines = patches[0].read().rstrip("\n").split("\n") + self.assertEqual(lines, expected) + + # Test with unified diff + del source[0:2] + self.assertTrue(source[0].startswith("---")) + patchfile = tempfile.NamedTemporaryFile(mode='w+') + patchfile.write("\n".join(source + [""])) + patchfile.flush() + + patches = list(read_patch(patchfile.name)) + self.assertEqual(len(patches), 1) + self.assertEqual(patches[0].patch_author, None) + self.assertEqual(patches[0].patch_email, None) + self.assertEqual(patches[0].patch_subject, None) + self.assertEqual(patches[0].patch_revision, 1) + self.assertEqual(patches[0].signed_off_by, []) + self.assertEqual(patches[0].filename, patchfile.name) + self.assertEqual(patches[0].is_binary, False) + self.assertEqual(patches[0].modified_file, "test.txt") + + del expected[0:2] + lines = patches[0].read().rstrip("\n").split("\n") + self.assertEqual(lines, expected) + + # Test with StringIO buffer + patches = list(read_patch("unknown.patch", "\n".join(source + [""]))) + self.assertEqual(len(patches), 1) + self.assertEqual(patches[0].patch_author, None) + self.assertEqual(patches[0].patch_email, None) + self.assertEqual(patches[0].patch_subject, None) + self.assertEqual(patches[0].patch_revision, 1) + self.assertEqual(patches[0].signed_off_by, []) + self.assertEqual(patches[0].filename, "unknown.patch") + self.assertEqual(patches[0].is_binary, False) + self.assertEqual(patches[0].modified_file, "test.txt") + + # Basic tests for apply_patch() + class PatchApplyTests(unittest.TestCase): + def test_apply(self): + source = ["line1();", "line2();", "line3();", + "function(arg1);", + "line5();", "line6();", "line7();"] + original = tempfile.NamedTemporaryFile(mode='w+') + original.write("\n".join(source + [""])) + original.flush() + + source = ["@@ -1,7 +1,7 @@", + " line1();", " line2();", " line3();", + "-function(arg1);", + "+function(arg2);", + " line5();", " line6();", " line7();"] + patchfile = tempfile.NamedTemporaryFile(mode='w+') + patchfile.write("\n".join(source + [""])) + patchfile.flush() + + expected = ["line1();", "line2();", "line3();", + "function(arg2);", + "line5();", "line6();", "line7();"] + result = apply_patch(original, patchfile, fuzz=0) + lines = result.read().rstrip("\n").split("\n") + self.assertEqual(lines, expected) + + expected = ["line1();", "line2();", "line3();", + "function(arg1);", + "line5();", "line6();", "line7();"] + result = apply_patch(result, patchfile, reverse=True, fuzz=0) + lines = result.read().rstrip("\n").split("\n") + self.assertEqual(lines, expected) + + # Basic tests for _preprocess_source() + class PreprocessorTests(unittest.TestCase): + def test_preprocessor(self): + source = ["int a; // comment 1", + "int b; // comment 2 \\", + " comment 3 \\", + " comment 4", + "int c; // comment with \"quotes\"", + "int d; // comment with /* c++ comment */", + "int e; /* multi \\", + " line", + " comment */", + "char *x = \"\\\\\";", + "char *y = \"abc\\\"def\";", + "char *z = \"multi\" \\", + " \"line\"", + " \"string\";"] + lines, split = _preprocess_source(source) + self.assertEqual(lines, source) + self.assertEqual(split, set([0, 1, 4, 5, 6, 9, 10, 11, 13, 14])) + + # Basic tests for generate_ifdef_patch() + class GenerateIfdefPatchTests(unittest.TestCase): + def test_ifdefined(self): + source = ["line1();", "line2();", "line3();", + "function(arg1, \\", + " arg2, \\", + " arg3);", + "line5();", "line6();", "line7();"] + source1 = tempfile.NamedTemporaryFile(mode='w+') + source1.write("\n".join(source + [""])) + source1.flush() + + source = ["line1();", "line2();", "line3();", + "function(arg1, \\", + " new_arg2, \\", + " arg3);", + "line5();", "line6();", "line7();"] + source2 = tempfile.NamedTemporaryFile(mode='w+') + source2.write("\n".join(source + [""])) + source2.flush() + + diff = generate_ifdef_patch(source1, source1, "PATCHED") + self.assertEqual(diff, None) + + diff = generate_ifdef_patch(source2, source2, "PATCHED") + self.assertEqual(diff, None) + + expected = ["@@ -1,9 +1,15 @@", + " line1();", " line2();", " line3();", + "+#if defined(PATCHED)", + " function(arg1, \\", + " new_arg2, \\", + " arg3);", + "+#else /* PATCHED */", + "+function(arg1, \\", + "+ arg2, \\", + "+ arg3);", + "+#endif /* PATCHED */", + " line5();", " line6();", " line7();"] + diff = generate_ifdef_patch(source1, source2, "PATCHED") + lines = diff.read().rstrip("\n").split("\n") + self.assertEqual(lines, expected) + + expected = ["@@ -1,9 +1,15 @@", + " line1();", " line2();", " line3();", + "+#if defined(PATCHED)", + " function(arg1, \\", + " arg2, \\", + " arg3);", + "+#else /* PATCHED */", + "+function(arg1, \\", + "+ new_arg2, \\", + "+ arg3);", + "+#endif /* PATCHED */", + " line5();", " line6();", " line7();"] + diff = generate_ifdef_patch(source2, source1, "PATCHED") + lines = diff.read().rstrip("\n").split("\n") + self.assertEqual(lines, expected) + + unittest.main() diff -Nru wine-staging-1.9.6/staging/VERSION wine-staging-1.9.7~ubuntu15.04.1/staging/VERSION --- wine-staging-1.9.6/staging/VERSION 2016-03-22 01:42:26.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/staging/VERSION 2016-04-04 18:23:50.000000000 +0000 @@ -1 +1 @@ -Wine Staging 1.9.6 +Wine Staging 1.9.7 diff -Nru wine-staging-1.9.6/tools/makedep.c wine-staging-1.9.7~ubuntu15.04.1/tools/makedep.c --- wine-staging-1.9.6/tools/makedep.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/tools/makedep.c 2016-04-04 18:06:32.000000000 +0000 @@ -413,10 +413,15 @@ */ static const char *strarray_get_value( const struct strarray *array, const char *name ) { - unsigned int i; + int pos, res, min = 0, max = array->count / 2 - 1; - for (i = 0; i < array->count; i += 2) - if (!strcmp( array->str[i], name )) return array->str[i + 1]; + while (min <= max) + { + pos = (min + max) / 2; + if (!(res = strcmp( array->str[pos * 2], name ))) return array->str[pos * 2 + 1]; + if (res < 0) min = pos + 1; + else max = pos - 1; + } return NULL; } @@ -428,17 +433,25 @@ */ static void strarray_set_value( struct strarray *array, const char *name, const char *value ) { - unsigned int i; + int i, pos, res, min = 0, max = array->count / 2 - 1; - /* redefining a variable replaces the previous value */ - for (i = 0; i < array->count; i += 2) + while (min <= max) { - if (strcmp( array->str[i], name )) continue; - array->str[i + 1] = value; - return; + pos = (min + max) / 2; + if (!(res = strcmp( array->str[pos * 2], name ))) + { + /* redefining a variable replaces the previous value */ + array->str[pos * 2 + 1] = value; + return; + } + if (res < 0) min = pos + 1; + else max = pos - 1; } - strarray_add( array, name ); - strarray_add( array, value ); + strarray_add( array, NULL ); + strarray_add( array, NULL ); + for (i = array->count - 1; i > min * 2 + 1; i--) array->str[i] = array->str[i - 2]; + array->str[min * 2] = name; + array->str[min * 2 + 1] = value; } @@ -641,9 +654,9 @@ /******************************************************************* - * top_dir_path + * top_src_dir_path */ -static char *top_dir_path( const struct makefile *make, const char *path ) +static char *top_src_dir_path( const struct makefile *make, const char *path ) { if (make->top_src_dir) return concat_paths( make->top_src_dir, path ); return top_obj_dir_path( make, path ); @@ -1283,7 +1296,7 @@ char *src_path = root_dir_path( path ); struct file *ret = load_file( src_path ); - if (ret) *filename = top_dir_path( make, path ); + if (ret) *filename = top_src_dir_path( make, path ); free( src_path ); return ret; } @@ -1810,7 +1823,7 @@ if (source->file->flags & FLAG_C_IMPLIB) { if (!make->staticimplib && make->importlib && *dll_ext) - make->staticimplib = strmake( "lib%s.def.a", make->importlib ); + make->staticimplib = strmake( "lib%s.a", make->importlib ); } if (strendswith( source->name, ".po" )) { @@ -1926,16 +1939,17 @@ /******************************************************************* - * has_static_lib + * get_static_lib * - * Check if makefile builds the named static library. + * Check if makefile builds the named static library and return the full lib path. */ -static int has_static_lib( const struct makefile *make, const char *name ) +static const char *get_static_lib( const struct makefile *make, const char *name ) { - if (!make->staticlib) return 0; - if (strncmp( make->staticlib, "lib", 3 )) return 0; - if (strncmp( make->staticlib + 3, name, strlen(name) )) return 0; - return !strcmp( make->staticlib + 3 + strlen(name), ".a" ); + if (!make->staticlib) return NULL; + if (strncmp( make->staticlib, "lib", 3 )) return NULL; + if (strncmp( make->staticlib + 3, name, strlen(name) )) return NULL; + if (strcmp( make->staticlib + 3 + strlen(name), ".a" )) return NULL; + return base_dir_path( make, make->staticlib ); } @@ -1954,7 +1968,8 @@ for (i = 0; i < all_libs.count; i++) { - int found = 0; + const char *lib = NULL; + if (!strncmp( all_libs.str[i], "-l", 2 )) { const char *name = all_libs.str[i] + 2; @@ -1963,17 +1978,17 @@ { const struct makefile *submake = top_makefile->submakes[j]; - if ((found = has_static_lib( submake, name ))) - { - const char *lib = strmake( "%s/lib%s.a", - top_obj_dir_path( make, submake->base_dir ), name ); - strarray_add( deps, lib ); - strarray_add( &ret, lib ); - break; - } + if ((lib = get_static_lib( submake, name ))) break; } } - if (!found) strarray_add( &ret, all_libs.str[i] ); + + if (lib) + { + lib = top_obj_dir_path( make, lib ); + strarray_add( deps, lib ); + strarray_add( &ret, lib ); + } + else strarray_add( &ret, all_libs.str[i] ); } return ret; } @@ -1991,6 +2006,7 @@ for (i = 0; i < imports.count; i++) { const char *name = imports.str[i]; + const char *lib = NULL; for (j = 0; j < top_makefile->subdirs.count; j++) { @@ -1998,24 +2014,25 @@ if (submake->importlib && !strcmp( submake->importlib, name )) { - const char *dir = top_obj_dir_path( make, submake->base_dir ); - const char *ext = cross ? "cross.a" : *dll_ext ? "def" : "a"; - - strarray_add( deps, strmake( "%s/lib%s.%s", dir, name, ext )); - if (!cross && submake->staticimplib) - strarray_add( deps, strmake( "%s/%s", dir, submake->staticimplib )); + if (cross || !*dll_ext || submake->staticimplib) + lib = base_dir_path( submake, strmake( "lib%s.a", name )); + else + strarray_add( deps, top_obj_dir_path( make, + strmake( "%s/lib%s.def", submake->base_dir, name ))); break; } - if (has_static_lib( submake, name )) - { - const char *dir = top_obj_dir_path( make, submake->base_dir ); + if ((lib = get_static_lib( submake, name ))) break; + } - strarray_add( deps, strmake( "%s/lib%s.a", dir, name )); - break; - } + if (lib) + { + if (cross) lib = replace_extension( lib, ".a", ".cross.a" ); + lib = top_obj_dir_path( make, lib ); + strarray_add( deps, lib ); + strarray_add( &ret, lib ); } - strarray_add( &ret, strmake( "-l%s", name )); + else strarray_add( &ret, strmake( "-l%s", name )); } return ret; } @@ -2130,7 +2147,7 @@ output_filenames_obj_dir( make, targets ); output( "\n" ); - install_sh = top_dir_path( make, "tools/install-sh" ); + install_sh = top_src_dir_path( make, "tools/install-sh" ); for (i = 0; i < files.count; i += 2) { const char *file = files.str[i]; @@ -2301,8 +2318,10 @@ if (make->src_dir) strarray_add( &includes, strmake( "-I%s", make->src_dir )); if (make->parent_dir) strarray_add( &includes, strmake( "-I%s", src_dir_path( make, make->parent_dir ))); strarray_add( &includes, strmake( "-I%s", top_obj_dir_path( make, "include" ))); - if (make->top_src_dir) strarray_add( &includes, strmake( "-I%s", top_dir_path( make, "include" ))); - if (make->use_msvcrt) strarray_add( &includes, strmake( "-I%s", top_dir_path( make, "include/msvcrt" ))); + if (make->top_src_dir) + strarray_add( &includes, strmake( "-I%s", top_src_dir_path( make, "include" ))); + if (make->use_msvcrt) + strarray_add( &includes, strmake( "-I%s", top_src_dir_path( make, "include/msvcrt" ))); for (i = 0; i < make->include_paths.count; i++) strarray_add( &includes, strmake( "-I%s", obj_dir_path( make, make->include_paths.str[i] ))); @@ -2510,7 +2529,7 @@ { output( "%s: %s\n", ttf_file, source->filename ); output( "\t%s -script %s %s $@\n", - fontforge, top_dir_path( make, "fonts/genttf.ff" ), source->filename ); + fontforge, top_src_dir_path( make, "fonts/genttf.ff" ), source->filename ); if (!(source->file->flags & FLAG_SFD_FONTS)) output( "all: %s\n", ttf_file ); } if (source->file->flags & FLAG_INSTALL) @@ -2543,7 +2562,7 @@ output( "%s.ico %s.bmp: %s\n", src_dir_path( make, obj ), src_dir_path( make, obj ), source->filename ); output( "\tCONVERT=\"%s\" ICOTOOL=\"%s\" RSVG=\"%s\" %s %s $@\n", convert, icotool, rsvg, - top_dir_path( make, "tools/buildimage" ), source->filename ); + top_src_dir_path( make, "tools/buildimage" ), source->filename ); } } else if (!strcmp( ext, "po" )) /* po file */ @@ -2616,8 +2635,9 @@ strarray_add( &ok_files, strmake( "%s.ok", obj )); output( "%s.ok:\n", obj_dir_path( make, obj )); output( "\t%s $(RUNTESTFLAGS) -T %s -M %s -p %s%s %s && touch $@\n", - top_dir_path( make, "tools/runtest" ), top_obj_dir_path( make, "" ), make->testdll, - replace_extension( make->testdll, ".dll", "_test.exe" ), dll_ext, obj ); + top_src_dir_path( make, "tools/runtest" ), top_obj_dir_path( make, "" ), + make->testdll, replace_extension( make->testdll, ".dll", "_test.exe" ), + dll_ext, obj ); } if (!strcmp( ext, "c" ) && !(source->file->flags & FLAG_GENERATED)) strarray_add( &c2man_files, source->filename ); @@ -2679,6 +2699,8 @@ output_filenames_obj_dir( make, object_files ); output_filenames_obj_dir( make, res_files ); output_filenames( dep_libs ); + output_filename( tools_path( make, "winebuild" )); + output_filename( tools_path( make, "winegcc" )); output( "\n" ); output( "\t%s -o $@", tools_path( make, "winegcc" )); output_filename( strmake( "-B%s", tools_dir_path( make, "winebuild" ))); @@ -2700,7 +2722,7 @@ if (spec_file && make->importlib) { char *importlib_path = obj_dir_path( make, strmake( "lib%s", make->importlib )); - if (*dll_ext) + if (*dll_ext && !implib_objs.count) { strarray_add( &clean_files, strmake( "lib%s.def", make->importlib )); output( "%s.def: %s %s\n", importlib_path, tools_path( make, "winebuild" ), spec_file ); @@ -2711,21 +2733,6 @@ add_install_rule( make, install_rules, make->importlib, strmake( "lib%s.def", make->importlib ), strmake( "d$(dlldir)/lib%s.def", make->importlib )); - if (implib_objs.count) - { - strarray_add( &clean_files, strmake( "lib%s.def.a", make->importlib )); - output( "%s.def.a:", importlib_path ); - output_filenames_obj_dir( make, implib_objs ); - output( "\n" ); - output( "\trm -f $@\n" ); - output( "\t$(AR) $(ARFLAGS) $@" ); - output_filenames_obj_dir( make, implib_objs ); - output( "\n" ); - output( "\t$(RANLIB) $@\n" ); - add_install_rule( make, install_rules, make->importlib, - strmake( "lib%s.def.a", make->importlib ), - strmake( "d$(dlldir)/lib%s.def.a", make->importlib )); - } } else { @@ -2760,33 +2767,33 @@ if (c2man_files.count) { output( "manpages::\n" ); - output( "\t%s -w %s", top_dir_path( make, "tools/c2man.pl" ), spec_file ); - output_filename( strmake( "-R%s", top_dir_path( make, "" ))); - output_filename( strmake( "-I%s", top_dir_path( make, "include" ))); + output( "\t%s -w %s", top_src_dir_path( make, "tools/c2man.pl" ), spec_file ); + output_filename( strmake( "-R%s", top_src_dir_path( make, "" ))); + output_filename( strmake( "-I%s", top_src_dir_path( make, "include" ))); output_filename( strmake( "-o %s/man%s", top_obj_dir_path( make, "documentation" ), man_ext )); output_filenames( c2man_files ); output( "\n" ); output( "htmlpages::\n" ); - output( "\t%s -Th -w %s", top_dir_path( make, "tools/c2man.pl" ), spec_file ); - output_filename( strmake( "-R%s", top_dir_path( make, "" ))); - output_filename( strmake( "-I%s", top_dir_path( make, "include" ))); + output( "\t%s -Th -w %s", top_src_dir_path( make, "tools/c2man.pl" ), spec_file ); + output_filename( strmake( "-R%s", top_src_dir_path( make, "" ))); + output_filename( strmake( "-I%s", top_src_dir_path( make, "include" ))); output_filename( strmake( "-o %s", top_obj_dir_path( make, "documentation/html" ))); output_filenames( c2man_files ); output( "\n" ); output( "sgmlpages::\n" ); - output( "\t%s -Ts -w %s", top_dir_path( make, "tools/c2man.pl" ), spec_file ); - output_filename( strmake( "-R%s", top_dir_path( make, "" ))); - output_filename( strmake( "-I%s", top_dir_path( make, "include" ))); + output( "\t%s -Ts -w %s", top_src_dir_path( make, "tools/c2man.pl" ), spec_file ); + output_filename( strmake( "-R%s", top_src_dir_path( make, "" ))); + output_filename( strmake( "-I%s", top_src_dir_path( make, "include" ))); output_filename( strmake( "-o %s", top_obj_dir_path( make, "documentation/api-guide" ))); output_filenames( c2man_files ); output( "\n" ); output( "xmlpages::\n" ); - output( "\t%s -Tx -w %s", top_dir_path( make, "tools/c2man.pl" ), spec_file ); - output_filename( strmake( "-R%s", top_dir_path( make, "" ))); - output_filename( strmake( "-I%s", top_dir_path( make, "include" ))); + output( "\t%s -Tx -w %s", top_src_dir_path( make, "tools/c2man.pl" ), spec_file ); + output_filename( strmake( "-R%s", top_src_dir_path( make, "" ))); + output_filename( strmake( "-I%s", top_src_dir_path( make, "include" ))); output_filename( strmake( "-o %s", top_obj_dir_path( make, "documentation/api-guide-xml" ))); output_filenames( c2man_files ); @@ -2918,6 +2925,8 @@ output_filenames_obj_dir( make, object_files ); output_filenames_obj_dir( make, res_files ); output_filenames( dep_libs ); + output_filename( tools_path( make, "winebuild" )); + output_filename( tools_path( make, "winegcc" )); output( "\n" ); if (!make->disabled) @@ -2940,6 +2949,8 @@ output_filenames_obj_dir( make, crossobj_files ); output_filenames_obj_dir( make, res_files ); output_filenames( dep_libs ); + output_filename( tools_path( make, "winebuild" )); + output_filename( tools_path( make, "winegcc" )); output( "\n" ); output( "\t%s -o $@ -b %s", tools_path( make, "winegcc" ), crosstarget ); output_filename( strmake( "-B%s", tools_dir_path( make, "winebuild" ))); @@ -3080,8 +3091,8 @@ { const struct makefile *submake = make->submakes[i]; - strarray_add( &makefile_deps, top_dir_path( make, base_dir_path( submake, - strmake ( "%s.in", output_makefile_name )))); + strarray_add( &makefile_deps, top_src_dir_path( make, base_dir_path( submake, + strmake ( "%s.in", output_makefile_name )))); strarray_add( &distclean_files, base_dir_path( submake, output_makefile_name )); if (!make->src_dir) strarray_add( &distclean_files, base_dir_path( submake, ".gitignore" )); if (submake->testdll) strarray_add( &distclean_files, base_dir_path( submake, "testlist.c" )); @@ -3407,7 +3418,7 @@ make->src_dir = concat_paths( make->top_src_dir, make->base_dir ); } strarray_set_value( &make->vars, "top_builddir", top_obj_dir_path( make, "" )); - strarray_set_value( &make->vars, "top_srcdir", top_dir_path( make, "" )); + strarray_set_value( &make->vars, "top_srcdir", top_src_dir_path( make, "" )); strarray_set_value( &make->vars, "srcdir", src_dir_path( make, "" )); make->parent_dir = get_expanded_make_variable( make, "PARENTSRC" ); diff -Nru wine-staging-1.9.6/tools/make_specfiles wine-staging-1.9.7~ubuntu15.04.1/tools/make_specfiles --- wine-staging-1.9.6/tools/make_specfiles 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/tools/make_specfiles 2016-04-04 18:06:32.000000000 +0000 @@ -214,6 +214,7 @@ "api-ms-win-core-wow64-l1-1-0", "api-ms-win-core-xstate-l2-1-0", "api-ms-win-core-errorhandling-l1-1-2", + "kernelbase", ], [ "kernel32", diff -Nru wine-staging-1.9.6/tools/winebuild/build.h wine-staging-1.9.7~ubuntu15.04.1/tools/winebuild/build.h --- wine-staging-1.9.6/tools/winebuild/build.h 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/tools/winebuild/build.h 2016-04-04 18:06:32.000000000 +0000 @@ -116,6 +116,7 @@ char *src_name; /* file name of the source spec file */ char *file_name; /* file name of the dll */ char *dll_name; /* internal name of the dll */ + char *c_name; /* internal name of the dll, as a C-compatible identifier */ char *init_func; /* initialization routine */ char *main_module; /* main Win32 module for Win16 specs */ SPEC_TYPE type; /* type of dll (Win16/Win32) */ @@ -229,10 +230,10 @@ extern char *strupper(char *s); extern int strendswith(const char* str, const char* end); extern char *strmake(const char* fmt, ...) __attribute__((__format__ (__printf__, 1, 2 ))); -extern struct strarray *strarray_fromstring( const char *str, const char *delim ); +extern struct strarray strarray_fromstring( const char *str, const char *delim ); extern void strarray_add( struct strarray *array, ... ); extern void strarray_addv( struct strarray *array, char * const *argv ); -extern void strarray_free( struct strarray *array ); +extern void strarray_addall( struct strarray *array, struct strarray args ); extern DECLSPEC_NORETURN void fatal_error( const char *msg, ... ) __attribute__ ((__format__ (__printf__, 1, 2))); extern DECLSPEC_NORETURN void fatal_perror( const char *msg, ... ) @@ -245,10 +246,10 @@ __attribute__ ((__format__ (__printf__, 1, 2))); extern void output_cfi( const char *format, ... ) __attribute__ ((__format__ (__printf__, 1, 2))); -extern void spawn( struct strarray *array ); -extern struct strarray *find_tool( const char *name, const char * const *names ); -extern struct strarray *get_as_command(void); -extern struct strarray *get_ld_command(void); +extern void spawn( struct strarray array ); +extern struct strarray find_tool( const char *name, const char * const *names ); +extern struct strarray get_as_command(void); +extern struct strarray get_ld_command(void); extern const char *get_nm_command(void); extern void cleanup_tmp_files(void); extern char *get_temp_file_name( const char *prefix, const char *suffix ); @@ -260,7 +261,7 @@ extern void assemble_file( const char *src_file, const char *obj_file ); extern DLLSPEC *alloc_dll_spec(void); extern void free_dll_spec( DLLSPEC *spec ); -extern const char *make_c_identifier( const char *str ); +extern char *make_c_identifier( const char *str ); extern const char *get_stub_name( const ORDDEF *odp, const DLLSPEC *spec ); extern int get_cpu_from_name( const char *name ); extern unsigned int get_alignment(unsigned int align); @@ -284,7 +285,6 @@ extern void resolve_imports( DLLSPEC *spec ); extern int is_undefined( const char *name ); extern int has_imports(void); -extern int has_relays( DLLSPEC *spec ); extern void output_get_pc_thunk(void); extern void output_module( DLLSPEC *spec ); extern void output_stubs( DLLSPEC *spec ); @@ -342,7 +342,6 @@ extern int current_line; extern int UsePIC; -extern int nb_lib_paths; extern int nb_errors; extern int display_warnings; extern int kill_at; @@ -355,14 +354,15 @@ extern char *spec_file_name; extern FILE *output_file; extern const char *output_file_name; -extern char **lib_path; -extern struct strarray *as_command; -extern struct strarray *cc_command; -extern struct strarray *ld_command; -extern struct strarray *nm_command; +extern struct strarray lib_path; +extern struct strarray as_command; +extern struct strarray cc_command; +extern struct strarray ld_command; +extern struct strarray nm_command; extern char *cpu_option; extern char *arch_option; extern int thumb_mode; +extern int needs_get_pc_thunk; #endif /* __WINE_BUILD_H */ diff -Nru wine-staging-1.9.6/tools/winebuild/import.c wine-staging-1.9.7~ubuntu15.04.1/tools/winebuild/import.c --- wine-staging-1.9.6/tools/winebuild/import.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/tools/winebuild/import.c 2016-04-04 18:06:32.000000000 +0000 @@ -35,38 +35,43 @@ # include #endif +#include "wine/list.h" #include "build.h" -struct import +struct import_func { - DLLSPEC *spec; /* description of the imported dll */ - char *full_name; /* full name of the input file */ - dev_t dev; /* device/inode of the input file */ - ino_t ino; - int delay; /* delay or not dll loading ? */ - ORDDEF **exports; /* functions exported from this dll */ - int nb_exports; /* number of exported functions */ - ORDDEF **imports; /* functions we want to import from this dll */ - int nb_imports; /* number of imported functions */ + const char *name; + const char *export_name; + int ordinal; }; -struct name_table +struct import { - char **names; - unsigned int count, size; + struct list entry; /* entry in global dll list */ + char *dll_name; /* exported file name of the dll */ + char *c_name; /* dll name as a C-compatible identifier */ + char *full_name; /* full name of the input file */ + dev_t dev; /* device/inode of the input file */ + ino_t ino; + ORDDEF **exports; /* functions exported from this dll */ + int nb_exports; /* number of exported functions */ + struct import_func *imports; /* functions we want to import from this dll */ + int nb_imports; /* number of imported functions */ + int max_imports; /* size of imports array */ }; -static struct name_table undef_symbols; /* list of undefined symbols */ -static struct name_table extra_ld_symbols; /* list of extra symbols that ld should resolve */ -static struct name_table delayed_imports; /* list of delayed import dlls */ -static struct name_table ext_link_imports; /* list of external symbols to link to */ - -static struct import **dll_imports = NULL; -static int nb_imports = 0; /* number of imported dlls (delayed or not) */ -static int nb_delayed = 0; /* number of delayed dlls */ -static int total_imports = 0; /* total number of imported functions */ -static int total_delayed = 0; /* total number of imported functions in delayed DLLs */ +static struct strarray undef_symbols; /* list of undefined symbols */ +static struct strarray extra_ld_symbols; /* list of extra symbols that ld should resolve */ +static struct strarray delayed_imports; /* list of delayed import dlls */ +static struct strarray ext_link_imports; /* list of external symbols to link to */ + +static struct list dll_imports = LIST_INIT( dll_imports ); +static struct list dll_delayed = LIST_INIT( dll_delayed ); +static struct strarray as_files; + +static const char import_func_prefix[] = "__wine$func$"; +static const char import_ord_prefix[] = "__wine$ord$"; static inline const char *ppc_reg( int reg ) { @@ -93,41 +98,28 @@ odp2->name ? odp2->name : odp2->export_name ); } -/* add a name to a name table */ -static inline void add_name( struct name_table *table, const char *name ) -{ - if (table->count == table->size) - { - table->size += (table->size / 2); - if (table->size < 32) table->size = 32; - table->names = xrealloc( table->names, table->size * sizeof(*table->names) ); - } - table->names[table->count++] = xstrdup( name ); -} - /* remove a name from a name table */ -static inline void remove_name( struct name_table *table, unsigned int idx ) +static inline void remove_name( struct strarray *table, unsigned int idx ) { assert( idx < table->count ); - free( table->names[idx] ); - memmove( table->names + idx, table->names + idx + 1, - (table->count - idx - 1) * sizeof(*table->names) ); + memmove( table->str + idx, table->str + idx + 1, + (table->count - idx - 1) * sizeof(*table->str) ); table->count--; } /* locate a name in a (sorted) list */ -static inline const char *find_name( const char *name, const struct name_table *table ) +static inline const char *find_name( const char *name, const struct strarray *table ) { char **res = NULL; - if (table->count) res = bsearch( &name, table->names, table->count, sizeof(*table->names), name_cmp ); + if (table->count) res = bsearch( &name, table->str, table->count, sizeof(*table->str), name_cmp ); return res ? *res : NULL; } /* sort a name table */ -static inline void sort_names( struct name_table *table ) +static inline void sort_names( struct strarray *table ) { - if (table->count) qsort( table->names, table->count, sizeof(*table->names), name_cmp ); + if (table->count) qsort( table->str, table->count, sizeof(*table->str), name_cmp ); } /* locate an export in a (sorted) export list */ @@ -148,7 +140,8 @@ { free( imp->exports ); free( imp->imports ); - free_dll_spec( imp->spec ); + free( imp->dll_name ); + free( imp->c_name ); free( imp->full_name ); free( imp ); } @@ -160,20 +153,20 @@ for (i = 0; i < delayed_imports.count; i++) { - if (!strcmp( delayed_imports.names[i], name )) return 1; + if (!strcmp( delayed_imports.str[i], name )) return 1; } return 0; } -/* check whether a given dll has already been imported */ -static struct import *is_already_imported( const char *name ) +/* find an imported dll from its name */ +static struct import *find_import_dll( const char *name ) { - int i; + struct import *import; - for (i = 0; i < nb_imports; i++) - { - if (!strcmp( dll_imports[i]->spec->file_name, name )) return dll_imports[i]; - } + LIST_FOR_EACH_ENTRY( import, &dll_imports, struct import, entry ) + if (!strcasecmp( import->dll_name, name )) return import; + LIST_FOR_EACH_ENTRY( import, &dll_delayed, struct import, entry ) + if (!strcasecmp( import->dll_name, name )) return import; return NULL; } @@ -199,47 +192,40 @@ static char *find_library( const char *name ) { char *fullname; - int i; + unsigned int i; - for (i = 0; i < nb_lib_paths; i++) + for (i = 0; i < lib_path.count; i++) { - if ((fullname = try_library_path( lib_path[i], name ))) return fullname; + if ((fullname = try_library_path( lib_path.str[i], name ))) return fullname; } fatal_error( "could not open .def file for %s\n", name ); return NULL; } /* read in the list of exported symbols of an import library */ -static int read_import_lib( struct import *imp ) +static DLLSPEC *read_import_lib( struct import *imp ) { FILE *f; - int i, ret; + int i; struct stat stat; struct import *prev_imp; - DLLSPEC *spec = imp->spec; - int delayed = is_delayed_import( spec->file_name ); + DLLSPEC *spec = alloc_dll_spec(); f = open_input_file( NULL, imp->full_name ); fstat( fileno(f), &stat ); imp->dev = stat.st_dev; imp->ino = stat.st_ino; - ret = parse_def_file( f, spec ); + if (!parse_def_file( f, spec )) exit( 1 ); close_input_file( f ); - if (!ret) return 0; /* check if we already imported that library from a different file */ - if ((prev_imp = is_already_imported( spec->file_name ))) + if ((prev_imp = find_import_dll( spec->file_name ))) { if (prev_imp->dev != imp->dev || prev_imp->ino != imp->ino) fatal_error( "%s and %s have the same export name '%s'\n", prev_imp->full_name, imp->full_name, spec->file_name ); - return 0; /* the same file was already loaded, ignore this one */ - } - - if (delayed) - { - imp->delay = 1; - nb_delayed++; + free_dll_spec( spec ); + return NULL; /* the same file was already loaded, ignore this one */ } if (spec->nb_entry_points) @@ -249,7 +235,7 @@ imp->exports[imp->nb_exports++] = &spec->entry_points[i]; qsort( imp->exports, imp->nb_exports, sizeof(*imp->exports), func_cmp ); } - return 1; + return spec; } /* build the dll exported name from the import lib name or path */ @@ -279,29 +265,28 @@ /* add a dll to the list of imports */ void add_import_dll( const char *name, const char *filename ) { + DLLSPEC *spec; + char *dll_name = get_dll_name( name, filename ); struct import *imp = xmalloc( sizeof(*imp) ); - imp->spec = alloc_dll_spec(); - imp->spec->file_name = get_dll_name( name, filename ); - imp->delay = 0; - imp->imports = NULL; - imp->nb_imports = 0; - imp->exports = NULL; - imp->nb_exports = 0; + memset( imp, 0, sizeof(*imp) ); if (filename) imp->full_name = xstrdup( filename ); else imp->full_name = find_library( name ); - if (read_import_lib( imp )) - { - dll_imports = xrealloc( dll_imports, (nb_imports+1) * sizeof(*dll_imports) ); - dll_imports[nb_imports++] = imp; - } - else + if (!(spec = read_import_lib( imp ))) { free_imports( imp ); - if (nb_errors) exit(1); + return; } + + imp->dll_name = spec->file_name ? spec->file_name : dll_name; + imp->c_name = make_c_identifier( imp->dll_name ); + + if (is_delayed_import( dll_name )) + list_add_tail( &dll_delayed, &imp->entry ); + else + list_add_tail( &dll_imports, &imp->entry ); } /* add a library to the list of delayed imports */ @@ -310,39 +295,75 @@ struct import *imp; char *fullname = get_dll_name( name, NULL ); - add_name( &delayed_imports, fullname ); - if ((imp = is_already_imported( fullname )) && !imp->delay) + strarray_add( &delayed_imports, fullname, NULL ); + if ((imp = find_import_dll( fullname ))) { - imp->delay = 1; - nb_delayed++; + list_remove( &imp->entry ); + list_add_tail( &dll_delayed, &imp->entry ); } - free( fullname ); } -/* remove an imported dll, based on its index in the dll_imports array */ -static void remove_import_dll( int index ) +/* add a symbol to the list of extra symbols that ld must resolve */ +void add_extra_ld_symbol( const char *name ) { - struct import *imp = dll_imports[index]; - - memmove( &dll_imports[index], &dll_imports[index+1], sizeof(imp) * (nb_imports - index - 1) ); - nb_imports--; - if (imp->delay) nb_delayed--; - free_imports( imp ); + strarray_add( &extra_ld_symbols, name, NULL ); } -/* add a symbol to the list of extra symbols that ld must resolve */ -void add_extra_ld_symbol( const char *name ) +/* retrieve an imported dll, adding one if necessary */ +struct import *add_static_import_dll( const char *name ) { - add_name( &extra_ld_symbols, name ); + struct import *import; + char *dll_name = get_dll_name( name, NULL ); + + if ((import = find_import_dll( dll_name ))) return import; + + import = xmalloc( sizeof(*import) ); + memset( import, 0, sizeof(*import) ); + + import->dll_name = dll_name; + import->full_name = xstrdup( dll_name ); + import->c_name = make_c_identifier( dll_name ); + + if (is_delayed_import( dll_name )) + list_add_tail( &dll_delayed, &import->entry ); + else + list_add_tail( &dll_imports, &import->entry ); + return import; } /* add a function to the list of imports from a given dll */ -static void add_import_func( struct import *imp, ORDDEF *func ) +static void add_import_func( struct import *imp, const char *name, const char *export_name, int ordinal ) { - imp->imports = xrealloc( imp->imports, (imp->nb_imports+1) * sizeof(*imp->imports) ); - imp->imports[imp->nb_imports++] = func; - total_imports++; - if (imp->delay) total_delayed++; + if (imp->nb_imports == imp->max_imports) + { + imp->max_imports *= 2; + if (imp->max_imports < 32) imp->max_imports = 32; + imp->imports = xrealloc( imp->imports, imp->max_imports * sizeof(*imp->imports) ); + } + imp->imports[imp->nb_imports].name = name; + imp->imports[imp->nb_imports].export_name = export_name; + imp->imports[imp->nb_imports].ordinal = ordinal; + imp->nb_imports++; +} + +/* add an import for an undefined function of the form __wine$func$ */ +static void add_undef_import( const char *name, int is_ordinal ) +{ + char *p, *dll_name = xstrdup( name ); + int ordinal = 0; + struct import *import; + + if (!(p = strchr( dll_name, '$' ))) return; + *p++ = 0; + while (*p >= '0' && *p <= '9') ordinal = 10 * ordinal + *p++ - '0'; + if (*p != '$') return; + p++; + + import = add_static_import_dll( dll_name ); + if (is_ordinal) + add_import_func( import, NULL, xstrdup( p ), ordinal ); + else + add_import_func( import, xstrdup( p ), NULL, ordinal ); } /* get the default entry point for a given spec file */ @@ -372,14 +393,14 @@ if (!spec->init_func) spec->init_func = xstrdup( get_default_entry_point(spec) ); add_extra_ld_symbol( spec->init_func ); if (has_stubs( spec )) add_extra_ld_symbol( "__wine_spec_unimplemented_stub" ); - if (nb_delayed) add_extra_ld_symbol( "__wine_spec_delay_load" ); + if (delayed_imports.count) add_extra_ld_symbol( "__wine_spec_delay_load" ); } /* check if a given imported dll is not needed, taking forwards into account */ static int check_unused( const struct import* imp, const DLLSPEC *spec ) { int i; - const char *file_name = imp->spec->file_name; + const char *file_name = imp->dll_name; size_t len = strlen( file_name ); const char *p = strchr( file_name, '.' ); if (p && !strcasecmp( p, ".dll" )) len = p - file_name; @@ -398,8 +419,9 @@ /* check if a given forward does exist in one of the imported dlls */ static void check_undefined_forwards( DLLSPEC *spec ) { + struct import *imp; char *link_name, *api_name, *dll_name, *p; - int i, j; + int i; for (i = 0; i < spec->nb_entry_points; i++) { @@ -413,19 +435,14 @@ api_name = p + 1; dll_name = get_dll_name( link_name, NULL ); - for (j = 0; j < nb_imports; j++) + if ((imp = find_import_dll( dll_name ))) { - struct import *imp = dll_imports[j]; - - if (strcasecmp( imp->spec->file_name, dll_name )) continue; if (!find_export( api_name, imp->exports, imp->nb_exports )) warning( "%s:%d: forward '%s' not found in %s\n", - spec->src_name, odp->lineno, odp->link_name, imp->spec->file_name ); - break; + spec->src_name, odp->lineno, odp->link_name, imp->dll_name ); } - if (j == nb_imports) - warning( "%s:%d: forward '%s' not found in the imported dll list\n", - spec->src_name, odp->lineno, odp->link_name ); + else warning( "%s:%d: forward '%s' not found in the imported dll list\n", + spec->src_name, odp->lineno, odp->link_name ); free( link_name ); free( dll_name ); } @@ -453,7 +470,7 @@ if (link_ext_symbols) { odp->flags |= FLAG_EXT_LINK; - add_name( &ext_link_imports, odp->link_name ); + strarray_add( &ext_link_imports, odp->link_name, NULL ); } else error( "%s:%d: function '%s' not defined\n", spec->src_name, odp->lineno, odp->link_name ); @@ -487,7 +504,7 @@ fprintf( f, "\t%s %s\n", get_asm_ptr_keyword(), asm_name(odp->link_name) ); } for (j = 0; j < extra_ld_symbols.count; j++) - fprintf( f, "\t%s %s\n", get_asm_ptr_keyword(), asm_name(extra_ld_symbols.names[j]) ); + fprintf( f, "\t%s %s\n", get_asm_ptr_keyword(), asm_name(extra_ld_symbols.str[j]) ); fclose( f ); obj_file = get_temp_file_name( output_file_name, ".o" ); @@ -500,15 +517,14 @@ static const char *ldcombine_files( DLLSPEC *spec, char **argv ) { char *ld_tmp_file, *undef_file; - struct strarray *args = get_ld_command(); + struct strarray args = get_ld_command(); undef_file = create_undef_symbols_file( spec ); ld_tmp_file = get_temp_file_name( output_file_name, ".o" ); - strarray_add( args, "-r", "-o", ld_tmp_file, undef_file, NULL ); - strarray_addv( args, argv ); + strarray_add( &args, "-r", "-o", ld_tmp_file, undef_file, NULL ); + strarray_addv( &args, argv ); spawn( args ); - strarray_free( args ); return ld_tmp_file; } @@ -544,52 +560,58 @@ while (*p == ' ') p++; if (p[0] == 'U' && p[1] == ' ' && p[2]) p += 2; if (prefix_len && !strncmp( p, name_prefix, prefix_len )) p += prefix_len; - add_name( &undef_symbols, p ); + if (!strncmp( p, import_func_prefix, strlen(import_func_prefix) )) + add_undef_import( p + strlen( import_func_prefix ), 0 ); + else if (!strncmp( p, import_ord_prefix, strlen(import_ord_prefix) )) + add_undef_import( p + strlen( import_ord_prefix ), 1 ); + else strarray_add( &undef_symbols, xstrdup( p ), NULL ); } if ((err = pclose( f ))) warning( "%s failed with status %d\n", cmd, err ); free( cmd ); } -/* resolve the imports for a Win32 module */ -void resolve_imports( DLLSPEC *spec ) +void resolve_dll_imports( DLLSPEC *spec, struct list *list ) { - int i; - unsigned int j, removed; + unsigned int j; + struct import *imp, *next; ORDDEF *odp; - check_undefined_forwards( spec ); - - for (i = 0; i < nb_imports; i++) + LIST_FOR_EACH_ENTRY_SAFE( imp, next, list, struct import, entry ) { - struct import *imp = dll_imports[i]; - - for (j = removed = 0; j < undef_symbols.count; j++) + for (j = 0; j < undef_symbols.count; j++) { - odp = find_export( undef_symbols.names[j], imp->exports, imp->nb_exports ); + odp = find_export( undef_symbols.str[j], imp->exports, imp->nb_exports ); if (odp) { if (odp->flags & FLAG_PRIVATE) continue; if (odp->type != TYPE_STDCALL && odp->type != TYPE_CDECL) warning( "winebuild: Data export '%s' cannot be imported from %s\n", - odp->link_name, imp->spec->file_name ); + odp->link_name, imp->dll_name ); else { - add_import_func( imp, odp ); + add_import_func( imp, (odp->flags & FLAG_NONAME) ? NULL : odp->name, + odp->export_name, odp->ordinal ); remove_name( &undef_symbols, j-- ); - removed++; } } } - if (!removed) + if (!imp->nb_imports) { /* the dll is not used, get rid of it */ if (check_unused( imp, spec )) - warning( "winebuild: %s imported but no symbols used\n", imp->spec->file_name ); - remove_import_dll( i ); - i--; + warning( "winebuild: %s imported but no symbols used\n", imp->dll_name ); + list_remove( &imp->entry ); + free_imports( imp ); } } +} +/* resolve the imports for a Win32 module */ +void resolve_imports( DLLSPEC *spec ) +{ + check_undefined_forwards( spec ); + resolve_dll_imports( spec, &dll_imports ); + resolve_dll_imports( spec, &dll_delayed ); sort_names( &undef_symbols ); check_undefined_exports( spec ); } @@ -603,8 +625,7 @@ /* output the get_pc thunk if needed */ void output_get_pc_thunk(void) { - if (target_cpu != CPU_x86) return; - if (!UsePIC) return; + assert( target_cpu == CPU_x86 ); output( "\n\t.text\n" ); output( "\t.align %d\n", get_alignment(4) ); output( "\t%s\n", func_declaration("__wine_spec_get_pc_thunk_eax") ); @@ -635,6 +656,7 @@ { output( "\tcall %s\n", asm_name("__wine_spec_get_pc_thunk_eax") ); output( "1:\tjmp *%s+%d-1b(%%eax)\n", table, pos ); + needs_get_pc_thunk = 1; } break; case CPU_x86_64: @@ -681,16 +703,16 @@ /* check if we need an import directory */ int has_imports(void) { - return (nb_imports - nb_delayed) > 0; + return !list_empty( &dll_imports ); } /* output the import table of a Win32 module */ static void output_immediate_imports(void) { - int i, j; - const char *dll_name; + int j; + struct import *import; - if (nb_imports == nb_delayed) return; /* no immediate imports */ + if (list_empty( &dll_imports )) return; /* no immediate imports */ /* main import header */ @@ -701,19 +723,18 @@ /* list of dlls */ - for (i = j = 0; i < nb_imports; i++) + j = 0; + LIST_FOR_EACH_ENTRY( import, &dll_imports, struct import, entry ) { - if (dll_imports[i]->delay) continue; - dll_name = make_c_identifier( dll_imports[i]->spec->file_name ); output( "\t.long .L__wine_spec_import_data_names+%d-.L__wine_spec_rva_base\n", /* OriginalFirstThunk */ j * get_ptr_size() ); output( "\t.long 0\n" ); /* TimeDateStamp */ output( "\t.long 0\n" ); /* ForwarderChain */ output( "\t.long .L__wine_spec_import_name_%s-.L__wine_spec_rva_base\n", /* Name */ - dll_name ); + import->c_name ); output( "\t.long .L__wine_spec_import_data_ptrs+%d-.L__wine_spec_rva_base\n", /* FirstThunk */ j * get_ptr_size() ); - j += dll_imports[i]->nb_imports + 1; + j += import->nb_imports + 1; } output( "\t.long 0\n" ); /* OriginalFirstThunk */ output( "\t.long 0\n" ); /* TimeDateStamp */ @@ -723,82 +744,73 @@ output( "\n\t.align %d\n", get_alignment(get_ptr_size()) ); output( ".L__wine_spec_import_data_names:\n" ); - for (i = 0; i < nb_imports; i++) + LIST_FOR_EACH_ENTRY( import, &dll_imports, struct import, entry ) { - if (dll_imports[i]->delay) continue; - dll_name = make_c_identifier( dll_imports[i]->spec->file_name ); - for (j = 0; j < dll_imports[i]->nb_imports; j++) + for (j = 0; j < import->nb_imports; j++) { - ORDDEF *odp = dll_imports[i]->imports[j]; - if (!(odp->flags & FLAG_NONAME)) + struct import_func *func = &import->imports[j]; + if (func->name) output( "\t%s .L__wine_spec_import_data_%s_%s-.L__wine_spec_rva_base\n", - get_asm_ptr_keyword(), dll_name, odp->name ); + get_asm_ptr_keyword(), import->c_name, func->name ); else { if (get_ptr_size() == 8) - output( "\t.quad 0x800000000000%04x\n", odp->ordinal ); + output( "\t.quad 0x800000000000%04x\n", func->ordinal ); else - output( "\t.long 0x8000%04x\n", odp->ordinal ); + output( "\t.long 0x8000%04x\n", func->ordinal ); } } output( "\t%s 0\n", get_asm_ptr_keyword() ); } output( ".L__wine_spec_import_data_ptrs:\n" ); - for (i = 0; i < nb_imports; i++) + LIST_FOR_EACH_ENTRY( import, &dll_imports, struct import, entry ) { - if (dll_imports[i]->delay) continue; - for (j = 0; j < dll_imports[i]->nb_imports; j++) output( "\t%s 0\n", get_asm_ptr_keyword() ); + for (j = 0; j < import->nb_imports; j++) output( "\t%s 0\n", get_asm_ptr_keyword() ); output( "\t%s 0\n", get_asm_ptr_keyword() ); } output( ".L__wine_spec_imports_end:\n" ); - for (i = 0; i < nb_imports; i++) + LIST_FOR_EACH_ENTRY( import, &dll_imports, struct import, entry ) { - if (dll_imports[i]->delay) continue; - dll_name = make_c_identifier( dll_imports[i]->spec->file_name ); - for (j = 0; j < dll_imports[i]->nb_imports; j++) + for (j = 0; j < import->nb_imports; j++) { - ORDDEF *odp = dll_imports[i]->imports[j]; - if (!(odp->flags & FLAG_NONAME)) - { - output( "\t.align %d\n", get_alignment(2) ); - output( ".L__wine_spec_import_data_%s_%s:\n", dll_name, odp->name ); - output( "\t.short %d\n", odp->ordinal ); - output( "\t%s \"%s\"\n", get_asm_string_keyword(), odp->name ); - } + struct import_func *func = &import->imports[j]; + if (!func->name) continue; + output( "\t.align %d\n", get_alignment(2) ); + output( ".L__wine_spec_import_data_%s_%s:\n", import->c_name, func->name ); + output( "\t.short %d\n", func->ordinal ); + output( "\t%s \"%s\"\n", get_asm_string_keyword(), func->name ); } } - for (i = 0; i < nb_imports; i++) + LIST_FOR_EACH_ENTRY( import, &dll_imports, struct import, entry ) { - if (dll_imports[i]->delay) continue; - dll_name = make_c_identifier( dll_imports[i]->spec->file_name ); output( ".L__wine_spec_import_name_%s:\n\t%s \"%s\"\n", - dll_name, get_asm_string_keyword(), dll_imports[i]->spec->file_name ); + import->c_name, get_asm_string_keyword(), import->dll_name ); } } /* output the import thunks of a Win32 module */ static void output_immediate_import_thunks(void) { - int i, j, pos; - int nb_imm = nb_imports - nb_delayed; + int j, pos; + struct import *import; static const char import_thunks[] = "__wine_spec_import_thunks"; - if (!nb_imm) return; + if (list_empty( &dll_imports )) return; output( "\n/* immediate import thunks */\n\n" ); output( "\t.text\n" ); output( "\t.align %d\n", get_alignment(8) ); output( "%s:\n", asm_name(import_thunks)); - for (i = pos = 0; i < nb_imports; i++) + pos = 0; + LIST_FOR_EACH_ENTRY( import, &dll_imports, struct import, entry ) { - if (dll_imports[i]->delay) continue; - for (j = 0; j < dll_imports[i]->nb_imports; j++, pos += get_ptr_size()) + for (j = 0; j < import->nb_imports; j++, pos += get_ptr_size()) { - ORDDEF *odp = dll_imports[i]->imports[j]; - output_import_thunk( odp->name ? odp->name : odp->export_name, + struct import_func *func = &import->imports[j]; + output_import_thunk( func->name ? func->name : func->export_name, ".L__wine_spec_import_data_ptrs", pos ); } pos += get_ptr_size(); @@ -809,9 +821,10 @@ /* output the delayed import table of a Win32 module */ static void output_delayed_imports( const DLLSPEC *spec ) { - int i, j, mod; + int j, mod; + struct import *import; - if (!nb_delayed) return; + if (list_empty( &dll_delayed )) return; output( "\n/* delayed imports */\n\n" ); output( "\t.data\n" ); @@ -820,12 +833,12 @@ /* list of dlls */ - for (i = j = mod = 0; i < nb_imports; i++) + j = mod = 0; + LIST_FOR_EACH_ENTRY( import, &dll_delayed, struct import, entry ) { - if (!dll_imports[i]->delay) continue; output( "\t%s 0\n", get_asm_ptr_keyword() ); /* grAttrs */ - output( "\t%s .L__wine_delay_name_%d\n", /* szName */ - get_asm_ptr_keyword(), i ); + output( "\t%s .L__wine_delay_name_%s\n", /* szName */ + get_asm_ptr_keyword(), import->c_name ); output( "\t%s .L__wine_delay_modules+%d\n", /* phmod */ get_asm_ptr_keyword(), mod * get_ptr_size() ); output( "\t%s .L__wine_delay_IAT+%d\n", /* pIAT */ @@ -835,7 +848,7 @@ output( "\t%s 0\n", get_asm_ptr_keyword() ); /* pBoundIAT */ output( "\t%s 0\n", get_asm_ptr_keyword() ); /* pUnloadIAT */ output( "\t%s 0\n", get_asm_ptr_keyword() ); /* dwTimeStamp */ - j += dll_imports[i]->nb_imports; + j += import->nb_imports; mod++; } output( "\t%s 0\n", get_asm_ptr_keyword() ); /* grAttrs */ @@ -848,56 +861,51 @@ output( "\t%s 0\n", get_asm_ptr_keyword() ); /* dwTimeStamp */ output( "\n.L__wine_delay_IAT:\n" ); - for (i = 0; i < nb_imports; i++) + LIST_FOR_EACH_ENTRY( import, &dll_delayed, struct import, entry ) { - if (!dll_imports[i]->delay) continue; - for (j = 0; j < dll_imports[i]->nb_imports; j++) + for (j = 0; j < import->nb_imports; j++) { - ORDDEF *odp = dll_imports[i]->imports[j]; - const char *name = odp->name ? odp->name : odp->export_name; - output( "\t%s .L__wine_delay_imp_%d_%s\n", - get_asm_ptr_keyword(), i, name ); + struct import_func *func = &import->imports[j]; + const char *name = func->name ? func->name : func->export_name; + output( "\t%s .L__wine_delay_imp_%s_%s\n", + get_asm_ptr_keyword(), import->c_name, name ); } } output( "\n.L__wine_delay_INT:\n" ); - for (i = 0; i < nb_imports; i++) + LIST_FOR_EACH_ENTRY( import, &dll_delayed, struct import, entry ) { - if (!dll_imports[i]->delay) continue; - for (j = 0; j < dll_imports[i]->nb_imports; j++) + for (j = 0; j < import->nb_imports; j++) { - ORDDEF *odp = dll_imports[i]->imports[j]; - if (!odp->name) - output( "\t%s %d\n", get_asm_ptr_keyword(), odp->ordinal ); + struct import_func *func = &import->imports[j]; + if (!func->name) + output( "\t%s %d\n", get_asm_ptr_keyword(), func->ordinal ); else - output( "\t%s .L__wine_delay_data_%d_%s\n", - get_asm_ptr_keyword(), i, odp->name ); + output( "\t%s .L__wine_delay_data_%s_%s\n", + get_asm_ptr_keyword(), import->c_name, func->name ); } } output( "\n.L__wine_delay_modules:\n" ); - for (i = 0; i < nb_imports; i++) + LIST_FOR_EACH_ENTRY( import, &dll_delayed, struct import, entry ) { - if (dll_imports[i]->delay) output( "\t%s 0\n", get_asm_ptr_keyword() ); + output( "\t%s 0\n", get_asm_ptr_keyword() ); } - for (i = 0; i < nb_imports; i++) + LIST_FOR_EACH_ENTRY( import, &dll_delayed, struct import, entry ) { - if (!dll_imports[i]->delay) continue; - output( ".L__wine_delay_name_%d:\n", i ); - output( "\t%s \"%s\"\n", - get_asm_string_keyword(), dll_imports[i]->spec->file_name ); + output( ".L__wine_delay_name_%s:\n", import->c_name ); + output( "\t%s \"%s\"\n", get_asm_string_keyword(), import->dll_name ); } - for (i = 0; i < nb_imports; i++) + LIST_FOR_EACH_ENTRY( import, &dll_delayed, struct import, entry ) { - if (!dll_imports[i]->delay) continue; - for (j = 0; j < dll_imports[i]->nb_imports; j++) + for (j = 0; j < import->nb_imports; j++) { - ORDDEF *odp = dll_imports[i]->imports[j]; - if (!odp->name) continue; - output( ".L__wine_delay_data_%d_%s:\n", i, odp->name ); - output( "\t%s \"%s\"\n", get_asm_string_keyword(), odp->name ); + struct import_func *func = &import->imports[j]; + if (!func->name) continue; + output( ".L__wine_delay_data_%s_%s:\n", import->c_name, func->name ); + output( "\t%s \"%s\"\n", get_asm_string_keyword(), func->name ); } } output_function_size( "__wine_spec_delay_imports" ); @@ -906,11 +914,12 @@ /* output the delayed import thunks of a Win32 module */ static void output_delayed_import_thunks( const DLLSPEC *spec ) { - int i, idx, j, pos, extra_stack_storage = 0; + int idx, j, pos, extra_stack_storage = 0; + struct import *import; static const char delayed_import_loaders[] = "__wine_spec_delayed_import_loaders"; static const char delayed_import_thunks[] = "__wine_spec_delayed_import_thunks"; - if (!nb_delayed) return; + if (list_empty( &dll_delayed )) return; output( "\n/* delayed import thunks */\n\n" ); output( "\t.text\n" ); @@ -1037,15 +1046,15 @@ output_function_size( "__wine_delay_load_asm" ); output( "\n" ); - for (i = idx = 0; i < nb_imports; i++) + idx = 0; + LIST_FOR_EACH_ENTRY( import, &dll_delayed, struct import, entry ) { - if (!dll_imports[i]->delay) continue; - for (j = 0; j < dll_imports[i]->nb_imports; j++) + for (j = 0; j < import->nb_imports; j++) { - ORDDEF *odp = dll_imports[i]->imports[j]; - const char *name = odp->name ? odp->name : odp->export_name; + struct import_func *func = &import->imports[j]; + const char *name = func->name ? func->name : func->export_name; - output( ".L__wine_delay_imp_%d_%s:\n", i, name ); + output( ".L__wine_delay_imp_%s_%s:\n", import->c_name, name ); output_cfi( ".cfi_startproc" ); switch(target_cpu) { @@ -1121,13 +1130,13 @@ output( "\n\t.align %d\n", get_alignment(get_ptr_size()) ); output( "%s:\n", asm_name(delayed_import_thunks)); - for (i = pos = 0; i < nb_imports; i++) + pos = 0; + LIST_FOR_EACH_ENTRY( import, &dll_delayed, struct import, entry ) { - if (!dll_imports[i]->delay) continue; - for (j = 0; j < dll_imports[i]->nb_imports; j++, pos += get_ptr_size()) + for (j = 0; j < import->nb_imports; j++, pos += get_ptr_size()) { - ORDDEF *odp = dll_imports[i]->imports[j]; - output_import_thunk( odp->name ? odp->name : odp->export_name, + struct import_func *func = &import->imports[j]; + output_import_thunk( func->name ? func->name : func->export_name, ".L__wine_delay_IAT", pos ); } } @@ -1146,7 +1155,7 @@ /* get rid of duplicate names */ for (i = 1; i < ext_link_imports.count; i++) { - if (!strcmp( ext_link_imports.names[i-1], ext_link_imports.names[i] )) + if (!strcmp( ext_link_imports.str[i-1], ext_link_imports.str[i] )) remove_name( &ext_link_imports, i-- ); } @@ -1155,7 +1164,7 @@ output( "\t.align %d\n", get_alignment(get_ptr_size()) ); output( ".L__wine_spec_external_links:\n" ); for (i = 0; i < ext_link_imports.count; i++) - output( "\t%s %s\n", get_asm_ptr_keyword(), asm_name(ext_link_imports.names[i]) ); + output( "\t%s %s\n", get_asm_ptr_keyword(), asm_name(ext_link_imports.str[i]) ); output( "\n\t.text\n" ); output( "\t.align %d\n", get_alignment(get_ptr_size()) ); @@ -1163,7 +1172,7 @@ for (i = pos = 0; i < ext_link_imports.count; i++) { - char *buffer = strmake( "__wine_spec_ext_link_%s", ext_link_imports.names[i] ); + char *buffer = strmake( "__wine_spec_ext_link_%s", ext_link_imports.str[i] ); output_import_thunk( buffer, ".L__wine_spec_external_links", pos ); free( buffer ); pos += get_ptr_size(); @@ -1218,6 +1227,7 @@ { output( "\tcall %s\n", asm_name("__wine_spec_get_pc_thunk_eax") ); output( "1:" ); + needs_get_pc_thunk = 1; if (exp_name) { output( "\tleal .L%s_string-1b(%%eax),%%ecx\n", name ); @@ -1320,20 +1330,58 @@ output_immediate_import_thunks(); output_delayed_import_thunks( spec ); output_external_link_imports( spec ); - if (nb_imports || ext_link_imports.count || has_stubs(spec) || has_relays(spec)) - output_get_pc_thunk(); } -/* output an import library for a Win32 module and additional object files */ -void output_import_lib( DLLSPEC *spec, char **argv ) +/* create a new asm temp file */ +static void new_output_as_file( const char *prefix ) { - struct strarray *args; + char *name = get_temp_file_name( prefix, ".s" ); + + if (output_file) fclose( output_file ); + if (!(output_file = fopen( name, "w" ))) + fatal_error( "Unable to create output file '%s'\n", name ); + strarray_add( &as_files, name, NULL ); +} + +/* assemble all the asm files */ +static void assemble_files( const char *prefix ) +{ + unsigned int i; + + if (output_file) fclose( output_file ); + output_file = NULL; + + for (i = 0; i < as_files.count; i++) + { + char *obj = get_temp_file_name( prefix, ".o" ); + assemble_file( as_files.str[i], obj ); + as_files.str[i] = obj; + } +} + +/* build a library from the current asm files and any additional object files in argv */ +static void build_library( const char *output_name, char **argv, int create ) +{ + struct strarray args = find_tool( "ar", NULL ); + struct strarray ranlib = find_tool( "ranlib", NULL ); + + strarray_add( &args, create ? "rc" : "r", output_name, NULL ); + strarray_addall( &args, as_files ); + strarray_addv( &args, argv ); + if (create) unlink( output_name ); + spawn( args ); + + strarray_add( &ranlib, output_name, NULL ); + spawn( ranlib ); +} + +/* create a Windows-style import library */ +static void build_windows_import_lib( DLLSPEC *spec ) +{ + struct strarray args; char *def_file; const char *as_flags, *m_flag; - if (target_platform != PLATFORM_WINDOWS) - fatal_error( "Unix-style import libraries not supported yet\n" ); - def_file = get_temp_file_name( output_file_name, ".def" ); fclose( output_file ); if (!(output_file = fopen( def_file, "w" ))) @@ -1357,19 +1405,85 @@ m_flag = NULL; break; } - strarray_add( args, "-k", "-l", output_file_name, "-d", def_file, NULL ); + strarray_add( &args, "-k", "-l", output_file_name, "-d", def_file, NULL ); if (m_flag) - strarray_add( args, "-m", m_flag, as_flags, NULL ); + strarray_add( &args, "-m", m_flag, as_flags, NULL ); spawn( args ); - strarray_free( args ); +} - if (argv[0]) +/* create a Unix-style import library */ +static void build_unix_import_lib( DLLSPEC *spec ) +{ + static const char valid_chars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789._@"; + int i, total; + const char *name, *prefix; + char *dll_name = xstrdup( spec->file_name ); + + if (strendswith( dll_name, ".dll" )) dll_name[strlen(dll_name) - 4] = 0; + if (strspn( dll_name, valid_chars ) < strlen( dll_name )) + fatal_error( "%s contains invalid characters\n", spec->file_name ); + + /* entry points */ + + for (i = total = 0; i < spec->nb_entry_points; i++) + { + const ORDDEF *odp = &spec->entry_points[i]; + + if (odp->name) name = odp->name; + else if (odp->export_name) name = odp->export_name; + else continue; + + if (odp->flags & FLAG_PRIVATE) continue; + total++; + + /* C++ mangled names cannot be imported */ + if (strpbrk( name, "?@" )) continue; + + switch(odp->type) + { + case TYPE_VARARGS: + case TYPE_CDECL: + case TYPE_STDCALL: + case TYPE_THISCALL: + prefix = (!odp->name || (odp->flags & FLAG_ORDINAL)) ? import_ord_prefix : import_func_prefix; + new_output_as_file( spec->file_name ); + output( "\t.text\n" ); + output( "\n\t.align %d\n", get_alignment( get_ptr_size() )); + output( "\t%s\n", func_declaration( name ) ); + output( "%s\n", asm_globl( name ) ); + output( "\t%s %s%s$%u$%s\n", get_asm_ptr_keyword(), + asm_name( prefix ), dll_name, odp->ordinal, name ); + output_function_size( name ); + break; + + default: + break; + } + } + if (!total) warning( "%s: Import library doesn't export anything\n", spec->file_name ); + + if (!as_files.count) /* create a dummy file to avoid empty import libraries */ + { + new_output_as_file( spec->file_name ); + output( "\t.text\n" ); + } + + assemble_files( spec->file_name ); + free( dll_name ); +} + +/* output an import library for a Win32 module and additional object files */ +void output_import_lib( DLLSPEC *spec, char **argv ) +{ + if (target_platform == PLATFORM_WINDOWS) + { + build_windows_import_lib( spec ); + if (argv[0]) build_library( output_file_name, argv, 0 ); + } + else { - args = find_tool( "ar", NULL ); - strarray_add( args, "rs", output_file_name, NULL ); - strarray_addv( args, argv ); - spawn( args ); - strarray_free( args ); + build_unix_import_lib( spec ); + build_library( output_file_name, argv, 1 ); } output_file_name = NULL; } diff -Nru wine-staging-1.9.6/tools/winebuild/main.c wine-staging-1.9.7~ubuntu15.04.1/tools/winebuild/main.c --- wine-staging-1.9.6/tools/winebuild/main.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/tools/winebuild/main.c 2016-04-04 18:06:32.000000000 +0000 @@ -39,7 +39,6 @@ #include "build.h" int UsePIC = 0; -int nb_lib_paths = 0; int nb_errors = 0; int display_warnings = 0; int kill_at = 0; @@ -75,7 +74,6 @@ #endif char *target_alias = NULL; -char **lib_path = NULL; char *input_file_name = NULL; char *spec_file_name = NULL; @@ -84,10 +82,11 @@ static const char *output_file_source_name; static int fake_module; -struct strarray *as_command = NULL; -struct strarray *cc_command = NULL; -struct strarray *ld_command = NULL; -struct strarray *nm_command = NULL; +struct strarray lib_path = { 0 }; +struct strarray as_command = { 0 }; +struct strarray cc_command = { 0 }; +struct strarray ld_command = { 0 }; +struct strarray nm_command = { 0 }; char *cpu_option = NULL; char *arch_option = NULL; @@ -97,8 +96,7 @@ int thumb_mode = 0; #endif -static int nb_res_files; -static char **res_files; +static struct strarray res_files; /* execution mode */ enum exec_mode_values @@ -160,6 +158,7 @@ spec->dll_name = xstrdup( spec->file_name ); if ((p = strrchr( spec->dll_name, '.' ))) *p = 0; } + spec->c_name = make_c_identifier( spec->dll_name ); } /* set the dll subsystem */ @@ -399,8 +398,7 @@ /* ignored, because cc generates correct code. */ break; case 'L': - lib_path = xrealloc( lib_path, (nb_lib_paths+1) * sizeof(*lib_path) ); - lib_path[nb_lib_paths++] = xstrdup( optarg ); + strarray_add( &lib_path, xstrdup( optarg ), NULL ); break; case 'm': if (!strcmp( optarg, "16" )) spec->type = SPEC_WIN16; @@ -465,8 +463,7 @@ } break; case 'r': - res_files = xrealloc( res_files, (nb_res_files+1) * sizeof(*res_files) ); - res_files[nb_res_files++] = xstrdup( optarg ); + strarray_add( &res_files, xstrdup( optarg ), NULL ); break; case 'u': add_extra_ld_symbol( optarg ); @@ -566,14 +563,14 @@ switch (spec->type) { case SPEC_WIN16: - for (i = 0; i < nb_res_files; i++) load_res16_file( res_files[i], spec ); + for (i = 0; i < res_files.count; i++) load_res16_file( res_files.str[i], spec ); break; case SPEC_WIN32: - for (i = 0; i < nb_res_files; i++) + for (i = 0; i < res_files.count; i++) { - if (!load_res32_file( res_files[i], spec )) - fatal_error( "%s is not a valid Win32 resource file\n", res_files[i] ); + if (!load_res32_file( res_files.str[i], spec )) + fatal_error( "%s is not a valid Win32 resource file\n", res_files.str[i] ); } /* load any resource file found in the remaining arguments */ diff -Nru wine-staging-1.9.6/tools/winebuild/res32.c wine-staging-1.9.7~ubuntu15.04.1/tools/winebuild/res32.c --- wine-staging-1.9.6/tools/winebuild/res32.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/tools/winebuild/res32.c 2016-04-04 18:06:32.000000000 +0000 @@ -625,7 +625,7 @@ char *res_file = NULL; const char *format; int fd; - struct strarray *args; + struct strarray args; if (!spec->nb_resources) fatal_error( "--resources mode needs at least one resource file as input\n" ); if (!output_file_name) fatal_error( "No output file name specified\n" ); @@ -694,11 +694,10 @@ format = NULL; break; } - strarray_add( args, "-i", res_file, "-o", output_file_name, NULL ); + strarray_add( &args, "-i", res_file, "-o", output_file_name, NULL ); if (format) - strarray_add( args, "-F", format, NULL ); + strarray_add( &args, "-F", format, NULL ); spawn( args ); - strarray_free( args ); output_file_name = NULL; /* so we don't try to assemble it */ } diff -Nru wine-staging-1.9.6/tools/winebuild/spec16.c wine-staging-1.9.7~ubuntu15.04.1/tools/winebuild/spec16.c --- wine-staging-1.9.6/tools/winebuild/spec16.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/tools/winebuild/spec16.c 2016-04-04 18:06:32.000000000 +0000 @@ -110,12 +110,10 @@ case TYPE_PASCAL: case TYPE_VARARGS: case TYPE_STUB: - output( "\t.short .L__wine_%s_%u-.L__wine_spec_code_segment\n", - make_c_identifier(spec->dll_name), first + i ); + output( "\t.short .L__wine_%s_%u-.L__wine_spec_code_segment\n", spec->c_name, first + i ); break; case TYPE_VARIABLE: - output( "\t.short .L__wine_%s_%u-.L__wine_spec_data_segment\n", - make_c_identifier(spec->dll_name), first + i ); + output( "\t.short .L__wine_%s_%u-.L__wine_spec_data_segment\n", spec->c_name, first + i ); break; case TYPE_ABS: output( "\t.short 0x%04x /* %s */\n", @@ -358,6 +356,7 @@ { output( "\tcall %s\n", asm_name("__wine_spec_get_pc_thunk_eax") ); output( "1:\tmovl wine_ldt_copy_ptr-1b(%%eax),%%esi\n" ); + needs_get_pc_thunk = 1; } else output( "\tmovl $%s,%%esi\n", asm_name("wine_ldt_copy") ); @@ -601,8 +600,7 @@ output( "\t.short %u\n", spec->heap_size ); /* ne_heap */ output( "\t.short 0\n" ); /* ne_stack */ if (!entry_point) output( "\t.long 0\n" ); /* ne_csip */ - else output( "\t.short .L__wine_%s_0-.L__wine_spec_code_segment,1\n", - make_c_identifier(spec->dll_name) ); + else output( "\t.short .L__wine_%s_0-.L__wine_spec_code_segment,1\n", spec->c_name ); output( "\t.short 0,2\n" ); /* ne_sssp */ output( "\t.short 2\n" ); /* ne_cseg */ output( "\t.short 0\n" ); /* ne_cmod */ @@ -754,7 +752,7 @@ { ORDDEF *odp = spec->ordinals[i]; if (!odp || !is_function( odp )) continue; - output( ".L__wine_%s_%u:\n", make_c_identifier(spec->dll_name), i ); + output( ".L__wine_%s_%u:\n", spec->c_name, i ); output( "\tpushw %%bp\n" ); output( "\tpushl $%s\n", asm_name( odp->type == TYPE_STUB ? get_stub_name( odp, spec ) : odp->link_name )); @@ -770,7 +768,7 @@ { ORDDEF *odp = spec->ordinals[i]; if (!odp || odp->type != TYPE_VARIABLE) continue; - output( ".L__wine_%s_%u:\n", make_c_identifier(spec->dll_name), i ); + output( ".L__wine_%s_%u:\n", spec->c_name, i ); output( "\t.long " ); for (j = 0; j < odp->u.var.n_values-1; j++) output( "0x%08x,", odp->u.var.values[j] ); @@ -817,6 +815,7 @@ resolve_imports( spec16 ); add_16bit_exports( spec32, spec16 ); + needs_get_pc_thunk = 0; output_standard_file_header(); output_module( spec32 ); output_module16( spec16 ); @@ -824,6 +823,7 @@ output_exports( spec32 ); output_imports( spec16 ); if (is_undefined( "__wine_call_from_16" )) output_asm_relays16(); + if (needs_get_pc_thunk) output_get_pc_thunk(); if (spec16->main_module) { output( "\n\t%s\n", get_asm_string_section() ); diff -Nru wine-staging-1.9.6/tools/winebuild/spec32.c wine-staging-1.9.7~ubuntu15.04.1/tools/winebuild/spec32.c --- wine-staging-1.9.6/tools/winebuild/spec32.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/tools/winebuild/spec32.c 2016-04-04 18:06:32.000000000 +0000 @@ -46,6 +46,8 @@ #define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b #define IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107 +int needs_get_pc_thunk = 0; + /* check if entry point needs a relay thunk */ static inline int needs_relay( const ORDDEF *odp ) { @@ -78,7 +80,7 @@ } /* check if dll will output relay thunks */ -int has_relays( DLLSPEC *spec ) +static int has_relays( DLLSPEC *spec ) { int i; @@ -189,6 +191,7 @@ { output( "\tcall %s\n", asm_name("__wine_spec_get_pc_thunk_eax") ); output( "1:\tleal .L__wine_spec_relay_descr-1b(%%eax),%%eax\n" ); + needs_get_pc_thunk = 1; } else output( "\tmovl $.L__wine_spec_relay_descr,%%eax\n" ); output( "\tpushl %%eax\n" ); @@ -616,6 +619,7 @@ */ void BuildSpec32File( DLLSPEC *spec ) { + needs_get_pc_thunk = 0; resolve_imports( spec ); output_standard_file_header(); output_module( spec ); @@ -623,6 +627,7 @@ output_exports( spec ); output_imports( spec ); if (is_undefined( "__wine_call_from_regs" )) output_asm_relays(); + if (needs_get_pc_thunk) output_get_pc_thunk(); output_resources( spec ); output_gnu_stack_note(); } diff -Nru wine-staging-1.9.6/tools/winebuild/utils.c wine-staging-1.9.7~ubuntu15.04.1/tools/winebuild/utils.c --- wine-staging-1.9.6/tools/winebuild/utils.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/tools/winebuild/utils.c 2016-04-04 18:06:32.000000000 +0000 @@ -45,9 +45,8 @@ # define PATH_SEPARATOR ':' #endif -static const char **tmp_files; -static unsigned int nb_tmp_files; -static unsigned int max_tmp_files; +static struct strarray tmp_files; +static struct strarray empty_strarray; static const struct { @@ -75,7 +74,7 @@ void cleanup_tmp_files(void) { unsigned int i; - for (i = 0; i < nb_tmp_files; i++) if (tmp_files[i]) unlink( tmp_files[i] ); + for (i = 0; i < tmp_files.count; i++) if (tmp_files.str[i]) unlink( tmp_files.str[i] ); } @@ -147,23 +146,13 @@ } } -static struct strarray *strarray_init( const char *str ) +static struct strarray strarray_copy( struct strarray src ) { - struct strarray *array = xmalloc( sizeof(*array) ); - array->count = 0; - array->max = 16; - array->str = xmalloc( array->max * sizeof(*array->str) ); - if (str) array->str[array->count++] = str; - return array; -} - -static struct strarray *strarray_copy( const struct strarray *src ) -{ - struct strarray *array = xmalloc( sizeof(*array) ); - array->count = src->count; - array->max = src->max; - array->str = xmalloc( array->max * sizeof(*array->str) ); - memcpy( array->str, src->str, array->count * sizeof(*array->str) ); + struct strarray array; + array.count = src.count; + array.max = src.max; + array.str = xmalloc( array.max * sizeof(*array.str) ); + memcpy( array.str, src.str, array.count * sizeof(*array.str) ); return array; } @@ -172,6 +161,7 @@ if (array->count == array->max) { array->max *= 2; + if (array->max < 16) array->max = 16; array->str = xrealloc( array->str, array->max * sizeof(*array->str) ); } array->str[array->count++] = str; @@ -192,25 +182,26 @@ while (*argv) strarray_add_one( array, *argv++ ); } -struct strarray *strarray_fromstring( const char *str, const char *delim ) +void strarray_addall( struct strarray *array, struct strarray args ) +{ + unsigned int i; + + for (i = 0; i < args.count; i++) strarray_add_one( array, args.str[i] ); +} + +struct strarray strarray_fromstring( const char *str, const char *delim ) { const char *tok; - struct strarray *array = strarray_init( NULL ); - char *buf = strdup( str ); + struct strarray array = empty_strarray; + char *buf = xstrdup( str ); for (tok = strtok( buf, delim ); tok; tok = strtok( NULL, delim )) - strarray_add_one( array, strdup( tok )); + strarray_add_one( &array, strdup( tok )); free( buf ); return array; } -void strarray_free( struct strarray *array ) -{ - free( array->str ); - free( array ); -} - void fatal_error( const char *msg, ... ) { va_list valist; @@ -291,26 +282,26 @@ return ret; } -void spawn( struct strarray *args ) +void spawn( struct strarray args ) { unsigned int i; int status; - strarray_add_one( args, NULL ); + strarray_add_one( &args, NULL ); if (verbose) - for (i = 0; args->str[i]; i++) - fprintf( stderr, "%s%c", args->str[i], args->str[i+1] ? ' ' : '\n' ); + for (i = 0; args.str[i]; i++) + fprintf( stderr, "%s%c", args.str[i], args.str[i+1] ? ' ' : '\n' ); - if ((status = _spawnvp( _P_WAIT, args->str[0], args->str ))) + if ((status = _spawnvp( _P_WAIT, args.str[0], args.str ))) { - if (status > 0) fatal_error( "%s failed with status %u\n", args->str[0], status ); + if (status > 0) fatal_error( "%s failed with status %u\n", args.str[0], status ); else fatal_perror( "winebuild" ); exit( 1 ); } } /* find a build tool in the path, trying the various names */ -struct strarray *find_tool( const char *name, const char * const *names ) +struct strarray find_tool( const char *name, const char * const *names ) { static char **dirs; static unsigned int count, maxlen; @@ -372,7 +363,11 @@ strcat( p, EXEEXT ); if (!stat( file, &st ) && S_ISREG(st.st_mode) && (st.st_mode & 0111)) - return strarray_init( file ); + { + struct strarray ret = empty_strarray; + strarray_add_one( &ret, file ); + return ret; + } } free( file ); names++; @@ -380,22 +375,22 @@ fatal_error( "cannot find the '%s' tool\n", name ); } -struct strarray *get_as_command(void) +struct strarray get_as_command(void) { - struct strarray *args; + struct strarray args; - if (cc_command) + if (cc_command.count) { args = strarray_copy( cc_command ); - strarray_add( args, "-xassembler", "-c", NULL ); + strarray_add( &args, "-xassembler", "-c", NULL ); if (force_pointer_size) - strarray_add_one( args, (force_pointer_size == 8) ? "-m64" : "-m32" ); - if (cpu_option) strarray_add_one( args, strmake("-mcpu=%s", cpu_option) ); - if (arch_option) strarray_add_one( args, strmake("-march=%s", arch_option) ); + strarray_add_one( &args, (force_pointer_size == 8) ? "-m64" : "-m32" ); + if (cpu_option) strarray_add_one( &args, strmake("-mcpu=%s", cpu_option) ); + if (arch_option) strarray_add_one( &args, strmake("-march=%s", arch_option) ); return args; } - if (!as_command) + if (!as_command.count) { static const char * const commands[] = { "gas", "as", NULL }; as_command = find_tool( "as", commands ); @@ -408,31 +403,31 @@ switch (target_platform) { case PLATFORM_APPLE: - strarray_add( args, "-arch", (force_pointer_size == 8) ? "x86_64" : "i386", NULL ); + strarray_add( &args, "-arch", (force_pointer_size == 8) ? "x86_64" : "i386", NULL ); break; default: switch(target_cpu) { case CPU_POWERPC: - strarray_add_one( args, (force_pointer_size == 8) ? "-a64" : "-a32" ); + strarray_add_one( &args, (force_pointer_size == 8) ? "-a64" : "-a32" ); break; default: - strarray_add_one( args, (force_pointer_size == 8) ? "--64" : "--32" ); + strarray_add_one( &args, (force_pointer_size == 8) ? "--64" : "--32" ); break; } break; } } - if (cpu_option) strarray_add_one( args, strmake("-mcpu=%s", cpu_option) ); + if (cpu_option) strarray_add_one( &args, strmake("-mcpu=%s", cpu_option) ); return args; } -struct strarray *get_ld_command(void) +struct strarray get_ld_command(void) { - struct strarray *args; + struct strarray args; - if (!ld_command) + if (!ld_command.count) { static const char * const commands[] = { "ld", "gld", NULL }; ld_command = find_tool( "ld", commands ); @@ -445,19 +440,19 @@ switch (target_platform) { case PLATFORM_APPLE: - strarray_add( args, "-arch", (force_pointer_size == 8) ? "x86_64" : "i386", NULL ); + strarray_add( &args, "-arch", (force_pointer_size == 8) ? "x86_64" : "i386", NULL ); break; case PLATFORM_FREEBSD: - strarray_add( args, "-m", (force_pointer_size == 8) ? "elf_x86_64_fbsd" : "elf_i386_fbsd", NULL ); + strarray_add( &args, "-m", (force_pointer_size == 8) ? "elf_x86_64_fbsd" : "elf_i386_fbsd", NULL ); break; default: switch(target_cpu) { case CPU_POWERPC: - strarray_add( args, "-m", (force_pointer_size == 8) ? "elf64ppc" : "elf32ppc", NULL ); + strarray_add( &args, "-m", (force_pointer_size == 8) ? "elf64ppc" : "elf32ppc", NULL ); break; default: - strarray_add( args, "-m", (force_pointer_size == 8) ? "elf_x86_64" : "elf_i386", NULL ); + strarray_add( &args, "-m", (force_pointer_size == 8) ? "elf_x86_64" : "elf_i386", NULL ); break; } break; @@ -468,14 +463,14 @@ const char *get_nm_command(void) { - if (!nm_command) + if (!nm_command.count) { static const char * const commands[] = { "nm", "gnm", NULL }; nm_command = find_tool( "nm", commands ); } - if (nm_command->count > 1) + if (nm_command.count > 1) fatal_error( "multiple arguments in nm command not supported yet\n" ); - return nm_command->str[0]; + return nm_command.str[0]; } /* get a name for a temp file, automatically cleaned up on exit */ @@ -506,12 +501,7 @@ } close( fd ); - if (nb_tmp_files >= max_tmp_files) - { - max_tmp_files = max( 2 * max_tmp_files, 8 ); - tmp_files = xrealloc( tmp_files, max_tmp_files * sizeof(tmp_files[0]) ); - } - tmp_files[nb_tmp_files++] = name; + strarray_add_one( &tmp_files, name ); return name; } @@ -755,10 +745,9 @@ */ void assemble_file( const char *src_file, const char *obj_file ) { - struct strarray *args = get_as_command(); - strarray_add( args, "-o", obj_file, src_file, NULL ); + struct strarray args = get_as_command(); + strarray_add( &args, "-o", obj_file, src_file, NULL ); spawn( args ); - strarray_free( args ); } @@ -772,32 +761,18 @@ DLLSPEC *spec; spec = xmalloc( sizeof(*spec) ); - spec->file_name = NULL; - spec->dll_name = NULL; - spec->init_func = NULL; - spec->main_module = NULL; + memset( spec, 0, sizeof(*spec) ); spec->type = SPEC_WIN32; spec->base = MAX_ORDINALS; - spec->limit = 0; - spec->stack_size = 0; - spec->heap_size = 0; - spec->nb_entry_points = 0; - spec->alloc_entry_points = 0; - spec->nb_names = 0; - spec->nb_resources = 0; spec->characteristics = IMAGE_FILE_EXECUTABLE_IMAGE; + spec->subsystem = 0; + spec->subsystem_major = 4; + spec->subsystem_minor = 0; if (get_ptr_size() > 4) spec->characteristics |= IMAGE_FILE_LARGE_ADDRESS_AWARE; else spec->characteristics |= IMAGE_FILE_32BIT_MACHINE; spec->dll_characteristics = IMAGE_DLLCHARACTERISTICS_NX_COMPAT; - spec->subsystem = 0; - spec->subsystem_major = 4; - spec->subsystem_minor = 0; - spec->entry_points = NULL; - spec->names = NULL; - spec->ordinals = NULL; - spec->resources = NULL; return spec; } @@ -820,6 +795,7 @@ } free( spec->file_name ); free( spec->dll_name ); + free( spec->c_name ); free( spec->init_func ); free( spec->entry_points ); free( spec->names ); @@ -834,10 +810,9 @@ * * Map a string to a valid C identifier. */ -const char *make_c_identifier( const char *str ) +char *make_c_identifier( const char *str ) { - static char buffer[256]; - char *p; + char *p, buffer[256]; for (p = buffer; *str && p < buffer+sizeof(buffer)-1; p++, str++) { @@ -845,7 +820,7 @@ else *p = '_'; } *p = 0; - return buffer; + return xstrdup( buffer ); } diff -Nru wine-staging-1.9.6/tools/winebuild/winebuild.man.in wine-staging-1.9.7~ubuntu15.04.1/tools/winebuild/winebuild.man.in --- wine-staging-1.9.6/tools/winebuild/winebuild.man.in 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/tools/winebuild/winebuild.man.in 2016-04-04 18:06:32.000000000 +0000 @@ -47,7 +47,7 @@ \fB-E\fR option. This is used when building dlls with a PE (Win32) compiler. .TP .BI \--implib -Build a PE import library from a spec file. The .spec file is +Build a .a import library from a spec file. The .spec file is specified via the \fB-E\fR option. .TP .B \--resources diff -Nru wine-staging-1.9.6/tools/winegcc/winegcc.c wine-staging-1.9.7~ubuntu15.04.1/tools/winegcc/winegcc.c --- wine-staging-1.9.6/tools/winegcc/winegcc.c 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/tools/winegcc/winegcc.c 2016-04-04 18:06:32.000000000 +0000 @@ -958,7 +958,7 @@ strarray_add(link_args, name); break; case 'a': - if (strchr(name, '/')) + if (!opts->lib_suffix && strchr(name, '/')) { /* turn the path back into -Ldir -lfoo options * this makes sure that we use the specified libs even @@ -1135,6 +1135,8 @@ default: if (opts->image_base) { + if (!try_link(opts->prefix, link_args, "-Wl,-z,max-page-size=0x1000")) + strarray_add(link_args, "-Wl,-z,max-page-size=0x1000"); if (!try_link(opts->prefix, link_args, strmake("-Wl,-Ttext-segment=%s", opts->image_base))) strarray_add(link_args, strmake("-Wl,-Ttext-segment=%s", opts->image_base)); else @@ -1462,6 +1464,11 @@ /* don't pass it to the compiler, this generates warnings */ raw_compiler_arg = raw_linker_arg = 0; } + else if (!strcmp(str, "tools/winebuild")) + { + opts.wine_objdir = "."; + raw_compiler_arg = raw_linker_arg = 0; + } if (!opts.prefix) opts.prefix = strarray_alloc(); strarray_add(opts.prefix, str); break; diff -Nru wine-staging-1.9.6/VERSION wine-staging-1.9.7~ubuntu15.04.1/VERSION --- wine-staging-1.9.6/VERSION 2016-03-22 01:24:09.000000000 +0000 +++ wine-staging-1.9.7~ubuntu15.04.1/VERSION 2016-04-04 18:06:32.000000000 +0000 @@ -1 +1 @@ -Wine version 1.9.6 +Wine version 1.9.7