diff -Nru wine1.7-1.7.50/aclocal.m4 wine1.7-1.7.55/aclocal.m4 --- wine1.7-1.7.50/aclocal.m4 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/aclocal.m4 2015-11-13 14:32:40.000000000 +0000 @@ -226,12 +226,12 @@ wine_fn_depend_rules () { wine_fn_append_rule \ -"$ac_dir/Makefile: $srcdir/$ac_dir/Makefile.in $srcdir/Make.vars.in config.status \$(MAKEDEP) - @./config.status --file $ac_dir/Makefile:Make.vars.in:$ac_dir/Makefile.in && \$(MAKEDEP) $ac_dir +"$ac_dir/Makefile: $srcdir/$ac_dir/Makefile.in Makefile \$(MAKEDEP) + \$(MAKEDEP) $ac_dir depend: $ac_dir/depend .PHONY: $ac_dir/depend $ac_dir/depend: \$(MAKEDEP) dummy - @./config.status --file $ac_dir/Makefile:Make.vars.in:$ac_dir/Makefile.in && \$(MAKEDEP) $ac_dir" + \$(MAKEDEP) $ac_dir" } wine_fn_pot_rules () @@ -330,11 +330,9 @@ ac_extraclean="$ac_dir/Makefile" test "$srcdir" = . && ac_extraclean="$ac_extraclean $ac_dir/.gitignore" - wine_fn_append_rule \ -"__clean__: $ac_dir/clean -.PHONY: $ac_dir/clean -$ac_dir/clean: dummy - \$(RM) \$(CLEAN_FILES:%=$ac_dir/%) $ac_clean $ac_extraclean" + wine_fn_depend_rules + wine_fn_clean_rules $ac_clean + wine_fn_pot_rules } wine_fn_config_makefile () @@ -403,6 +401,7 @@ then wine_fn_depend_rules wine_fn_clean_rules $ac_clean + wine_fn_pot_rules else wine_fn_disabled_rules $ac_clean return @@ -421,10 +420,10 @@ then wine_fn_append_rule \ "$ac_dir/install-lib:: $ac_dir - \$(INSTALL_PROGRAM) $ac_dir/$ac_dll$DLLEXT \$(DESTDIR)\$(dlldir)/$DLLPREFIX$ac_dll$DLLEXT + \$(INSTALL_PROGRAM) $ac_dir/$ac_dll$DLLEXT \$(DESTDIR)\$(dlldir)/$ac_dll$DLLEXT \$(INSTALL_DATA) $ac_dir/$ac_dll.fake \$(DESTDIR)\$(fakedlldir)/$ac_dll $ac_dir/uninstall:: - \$(RM) \$(DESTDIR)\$(dlldir)/$DLLPREFIX$ac_dll$DLLEXT \$(DESTDIR)\$(fakedlldir)/$ac_dll" + \$(RM) \$(DESTDIR)\$(dlldir)/$ac_dll$DLLEXT \$(DESTDIR)\$(fakedlldir)/$ac_dll" else wine_fn_append_rule \ "$ac_dir/install-lib:: $ac_dir @@ -551,10 +550,10 @@ then wine_fn_append_rule \ "$ac_dir/install:: $ac_dir - \$(INSTALL_PROGRAM) $ac_dir/$ac_program$DLLEXT \$(DESTDIR)\$(dlldir)/$DLLPREFIX$ac_program$DLLEXT + \$(INSTALL_PROGRAM) $ac_dir/$ac_program$DLLEXT \$(DESTDIR)\$(dlldir)/$ac_program$DLLEXT \$(INSTALL_DATA) $ac_dir/$ac_program.fake \$(DESTDIR)\$(fakedlldir)/$ac_program $ac_dir/uninstall:: - \$(RM) \$(DESTDIR)\$(dlldir)/$DLLPREFIX$ac_program$DLLEXT \$(DESTDIR)\$(fakedlldir)/$ac_program" + \$(RM) \$(DESTDIR)\$(dlldir)/$ac_program$DLLEXT \$(DESTDIR)\$(fakedlldir)/$ac_program" if test -z "$with_wine64" && wine_fn_has_flag installbin then @@ -778,7 +777,7 @@ esac])]) AC_DEFUN([WINE_PRINT_MESSAGES],[ac_save_IFS="$IFS" -if test "x$wine_notices != "x; then +if test "x$wine_notices" != x; then echo >&AS_MESSAGE_FD IFS="|" for msg in $wine_notices; do diff -Nru wine1.7-1.7.50/ANNOUNCE wine1.7-1.7.55/ANNOUNCE --- wine1.7-1.7.50/ANNOUNCE 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/ANNOUNCE 2015-11-13 14:32:40.000000000 +0000 @@ -1,16 +1,17 @@ -The Wine development release 1.7.50 is now available. +The Wine development release 1.7.55 is now available. What's new in this release (see below for details): - - New version of the Gecko engine based on Firefox 40. - - First steps of the Direct3D 11 implementation. - - Better font matching in DirectWrite. - - Support for OpenMP on ARM platforms. + - Pulse audio driver. + - Various fixes for Microsoft Office 2013 support. + - Some more implementation of the Web Services DLL. + - More fixes for the latest C runtime version. + - Improvements to the Makefile generation. - Various bug fixes. The source is available from the following locations: - http://prdownloads.sourceforge.net/wine/wine-1.7.50.tar.bz2 - http://mirrors.ibiblio.org/wine/source/1.7/wine-1.7.50.tar.bz2 + http://dl.winehq.org/wine/source/1.7/wine-1.7.55.tar.bz2 + http://mirrors.ibiblio.org/wine/source/1.7/wine-1.7.55.tar.bz2 Binary packages for various distributions will be available from: @@ -26,342 +27,533 @@ ---------------------------------------------------------------- -Bugs fixed in 1.7.50 (total 39): +Bugs fixed in 1.7.55 (total 76): - 12454 iriver Plus 3 fails to start due to missing msvcirt.dll ?sh_read@filebuf@@2HB export - 23650 PowerPoint 2007 insensitive to changes in screen resolution - 25225 MPLAB IDE v8.60 toolbars getting reorganised every time when the window minimized and restored - 26688 Multiple games crashes on unimplemented function vcomp.dll.omp_init_lock (Risen, Hearts of Iron III demo) - 28444 zenilib 0.4.1.0 applications: crash when attempting to use d3dx9 for rendering - 29081 Drag and Drop: Duplicate entries in winamp playlist window - 29468 not able to click anything on Star Wars Republic Commando launcher - 30397 Multiple applications need support for NtSetInformationFile class FileDispositionInformation (Cygwin installer, Stylizer 5.x Visual CSS editor, Spoon Studio 2011 (ex Xenocode) application sandboxing scheme) - 30399 Multiple games and applications need support for 'NtSetInformationFile' class 'FileRenameInformation' (Spoon Studio 2011 based Stylizer 5.x, Boost.Interprocess based Tera Online, MSYS2 installer) - 31856 TextPad full screen view toggle broken - 31895 The main character is not rendered in Synaesthete - 32531 Microsoft Internet Explorer 10 crashes on unimplemented function KERNEL32.dll.CreateThreadpoolWork (Vista+ API) - 32671 PhotoLine 32 v18.x crashes on startup (missing error handling on creation of multi-profile color transform) - 33430 Santander bank security module crashes during StormFish installation - 36163 valgrind shows an unitialized variable in programs/cmd/tests/batch.c - 36457 Hearts of Iron III Demo and Europa Universalis:Rome crash with unimplemented function vcomp.dll._vcomp_enter_critsect - 37225 QQ 6.3: QQApp.exe Crashes after login - 37478 cmd doesn't handle "else if" correctly in all cases - 38153 Don't work Radmin viewer 3.5 - 38224 AcceptEx detaches the socket from its IO completion port - 38343 Unimplemented function mfplat.dll.MFGetPluginControl - 38435 Xfire 2.0 crashes on unimplemented function fltlib.dll.FilterLoad - 38611 Samsung Smart View 2.0 (.NET 4.x WPF app): text does not render (IDWriteGlyphRunAnalysis is not implemented) - 38698 wineconsole: Altering line InsertMode with the Insert key should not be permanent - 38755 Unable to run "Twitch Bandwidth Test": calling to unimplemented function IPHLPAPI.DLL.SetPerTcpConnectionEStats - 38955 Visual Studio Code installer crashes on startup (parsing of overly long string-format security descriptor causes stack corruption) - 38967 Lotus Approach from Lotus Smartsuite 9.8 crashes on startup (OLE compound document files v3 may contain junk in high part of size) - 38976 Hospital Tycoon crashes after the intro videos with built-in d3dx9_36 - 38977 Tabs are rendered as a rectangle in license text of Quake III Arena demo installer - 38988 .NET applications using System.Decimal to float conversion may return wrong results ('VarR4FromDec' divisor integer overflow) - 39028 Built-in iexplore crashes when opening forum/blog entries on hup.hu (crash in get_frame_by_name("yterr") - 39031 Schein demo needs vcomp110.dll._vcomp_master_begin - 39040 Office 2010 applications enter installation configuration steps then exit - 39058 Schein demo needs vcomp110.dll._vcomp_flush - 39096 Nvidia Physx uninstaller completely removes PATH registry key from 'HKLM\System\CurrentControlSet\Control\Session Manager\Environment' - 39099 Wine's msiexec crashes when invoking Nvidia Physx maintenance tool via 'wine uninstaller -> Modify...' - 39104 [win16] installing application cause "Not Enough Disk Space" MessageBox - 39117 Cross-compilation: Error in zconf.h included from zlib.h included from http.c - 39118 Office 2013 installer fails to start + 8854 Unable to get keyboard / mouse input in multiple games + 9032 Adobe Premiere 6 video playback broken + 10495 Wine should support PulseAudio + 11107 Adobe AIR / Adobe Media Player pre 2 never shows GUI + 12474 Resolume Avenue 3.3.2 - Black video preview windows + 14518 GetTextMetrics on Tahoma font metrics returns an invalid tmInternalLeading + 14894 Cubis Gold 2 crashes on start + 17693 Silkypix 3.0 and DVD-lab PRO 2.x: menus are invisible until clicked + 18442 Google Video/Voice chat plugin installer finishes with error 0x80040509 + 19937 ArcSoft PhotoStudio 5.5 crashes on startup + 23001 Dolphin GC/Wii emulator 2.0 Wiimote plugin needs Bluetooth Control Panel Applet 'bthprops.cpl' + 23575 PowerDVD 10 trial crashes after registration + 24572 Freelancer (Microsoft Games): installer text in custom graphical user interface rendered in black rather than white, making it nearly unreadable + 27061 iNode Client 3.60 exits silently on start up (H3C iNode service install fails, needs 'HKLM\\SYSTEM\\CurrentControlSet\\Control\\ServiceGroupOrder\\List' key with REG_MULTI_SZ 'TDI' value) + 27563 Dungeons and Dragons/Lord of the Rings online: launcher doesn't see COM/ActiveX as supported with builtin mono + 29309 Zynaps remix exits with memory access violation + 29852 Star Trek Birth of the Federation - No Videos (negative height used as request for inverted frame decompressing) + 29899 mapviewoffileex fails under certain condition with PE images + 31534 TOAD for SQLServer 5.0.1.554 fails to install + 32703 MyPhoneExplorer 1.8.4 installer has a non-fatal crash + 32705 VirtualDub: crash when opening video with MPEG-2 plugin (division by zero) + 32839 Endnote X5 crashes on unimplemented function msvcp90.dll.??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z + 32923 Daum Pot Player Media Player crashes + 33001 AXE3 (hex editor) crashes in TREEVIEW_GetItemT on invalid item pointer + 33453 Delphi7 import type library hangs + 33479 Multiple games (Guild Wars 2, Risen 2, Tomb Raider 2013): Raw input is broken + 33563 Imscared shows visual artifacts (green dots and white lines) + 33713 download.com (CNET) download manager gets stuck on step 2 of 4 + 34559 Call to Power II: Scrolling causes mouse and screen to lock + 34845 The Mighty Quest for Epic Loot: "Bloomberg" crash/diag tool complains about dbghelp being too old (v5.x Windows XP vs. v6.x Win Vista/7) + 35677 BBC iPlayer Desktop installer reports 'You need Windows Media Player (9 or above) to install this software.' (builtin 'wmplayer.exe' along with version resource missing) + 35702 FarManager v3 crashes on unimplemented function KERNEL32.dll.SetConsoleKeyShortcuts + 35953 FFXIV: ARR - Launcher requires native winhttp to run. + 36280 valgrind shows a possible leak in gameux/tests/gamestatistics.c + 36291 valgrind shows a leak msctf/tests/inputprocessor.c + 36400 valgrind shows several unitialized values in under crypt32/tests/message.c + 36427 valgrind shows several leaks in dlls/taskschd/tests/scheduler.c + 36450 EnumFontFamilies should report unsubstituted font names + 36508 valgrind shows a couple invalid writes in kernel32/tests/change.c + 36527 Multiple games and applications crash on unimplemented function KERNEL32.dll.AllocateUserPhysicalPages (Microsoft Office 2007 diagnosis service, Eden Eternal) + 36607 valgrind shows two definite leaks in xmllite/tests/reader.c + 37165 Sacred 2 Gold (v2.65.1) fails to start correctly, displays only a black screen in virtual desktop mode + 37729 Picasa 3.9 crashes in setupapi.SetupFindFirstLineW + 37829 Phonostar dradio-Recorder cannot connect to radio streams + 37843 Black Mirror 3 starts minimized + 37932 Evil Genius from GOG crashes unexpectedly + 37956 Photoshop (CS6/CC) 64bit crash when you press "cancel" button + 38097 FreshDiagnose 8.67 'Protected Files' diagnosis wants sfc.dll.SfcGetNextProtectedFile + 38125 MFC CRichEditCtrl does not correctly put text in Center, Right or Left + 38255 Sid Meier's Ace Patrol needs msvcp110.dll._Thrd_current + 38368 AutoPatcher Updater 1.4.x (VB6 app) reports 'Error: Object doesn't support this action' (needs ITextStream::Close method implementation) + 38390 Photoshop 64-bit (CS/CC) crashes when you break the rendering preview. + 38417 [EA] Origin self-updater fails to install updates ('kernel32.DeleteFileW' shall only open the file for delete access as callers might not have read/write rights) + 38444 valgrind shows some definite leaks in dpnet/tests/address.c + 38445 valgrind shows a couple invalid writes in kernel32/tests/fiber.c + 38450 valgrind shows several leaks in shell32/tests/shlfolder.c + 38464 valgrind shows a possible leak in wininet/tests/http.c test_async_HttpSendRequestEx() + 38477 Elevated: Invisible textures since wine-1.7.34-58-gc6232e1 + 38589 Sades 7.1 CH Gaming Headset driver installation fails + 38677 valgrind shows invalid memory use in dlls/kernel32/tests/path.c:test_PathNameA() + 39081 CCleaner needs esent.dll + 39101 Visual Studio Compiler creates invalid interface from a typelib + 39143 Roxio CDRAL 'CDRALW2K.SYS' kernel driver (part of Windows Media 9 Runtime) crashes on unimplemented function ntoskrnl.exe.ExAcquireResourceExclusiveLite during driver unload + 39259 BTHPROPS.DLL and BLUETOOTHAPIS.DLL are unimplemented + 39423 Voobly: 'Game Browser' can't display content due to Wine built-in browser signature blacklisted on www.voobly.com ('win32' feature token must not be included in user agent string) + 39443 Multiple applications fail start File System Filter Manager service due unimplemented function fltmgr.sys.FltInitializePushLock (Kaspersky Anti-Virus) + 39493 GImageX v2.1.1 (gui for ImageX tool from Windows Assessment and Deployment Kit) crashes on unimplemented function wimgapi.dll.WIMRegisterMessageCallback + 39516 Listview tests consistently fail + 39528 Emerge Desktop 6.1.3 crashes on startup (incorrect shdocvw.RunInstallUninstallStubs2 stub signature) + 39529 Data Source initstring parsing is case-sensitive + 39544 Microsoft Office 2007 installer fails with 'ITERATE_Actions Execution halted, action L"ProcessBranding" returned 1603' + 39545 wine build fails without libpulse + 39551 building dlls/atl fails: error: Could not open importlib stdole2.tlb. + 39568 err:dbghelp_msc:pe_load_debug_directory Got a page fault while loading symbols + 39574 iNode 3.6 client needs ndis.sys.NdisInitUnicodeString + 39575 Wine control panel app crashes when encountering builtin applets with unimplemented CPL entry points (bthprops.cpl.CPlApplet) ---------------------------------------------------------------- -Changes since 1.7.49: +Changes since 1.7.54: -Aaryaman Vasishta (14): - d3drm: Change signature of d3drm_device_create. - d3drm: Add helper for destroying device. - d3drm: Implement IDirect3DRM::CreateDeviceFromClipper. - d3drm: Implement IDirect3DRMDevice*::GetDirect3DDevice. - d3drm: Implement IDirect3DRM{2-3}::CreateDeviceFromClipper. - d3drm: Implement IDirect3DRMDevice{2-3}::GetDirect3DDevice2. - d3drm: Implement IDirect3DRM::CreateDeviceFromSurface. - d3drm: Implement IDirect3DRM{2-3}::CreateDeviceFromSurface. - d3drm: Implement IDirect3DRM::CreateDeviceFromD3D. - d3drm: Implement IDirect3DRM{2-3}::CreateDeviceFromD3D. - d3drm: GetDirect3DDevice2 returns D3DRM_OK when IDirect3DDevice2 is not available. - d3drm: Add IDirect3DRMObject to be queried from IDirect3DRMDevice*. - d3drm: Fix IDirect3DRMDevice3_QueryInterface returning incorrect HRESULT on unsupported interfaces. - d3drm/tests: Add QueryInterface tests for IDirect3DRMDevice*. - -Adam Stachowicz (1): - po: Update Polish translation. - -Akihiro Sagawa (3): - usp10/tests: Add tests for control character glyphs. - usp10: Display the blank glyph for some control characters (truetype/opentype). - usp10: Display the blank glyph for some control characters (non truetype/opentype). - -Alex Henrie (1): - mshtml: Use the same click event handler for anchor and area elements. - -Alexandre Julliard (2): - secur32: Avoid ssize_t type that causes printf format warnings. - server: Store modification time as a key comment to avoid losing precision. - -Alistair Leslie-Hughes (4): - d3dcompiler: Add D3DCompileFromFile, D3DCompile2 stubs. - advapi32: Prevent buffer overrun. - include/d3dcommon.idl: Add missing typedefs. - include: Add more WELL_KNOWN_SID_TYPE values. - -Andrew Eikum (3): - xaudio2: Implement IXAudio27::Initialize. - xaudio2: Add stub IXAudio2MasteringVoice implementation. - xaudio2: Stub IXAudio2SourceVoice. - -Andrey Gusev (2): - Assorted spelling and typos fixes. - po: Update Ukrainian translation. - -André Hentschel (11): - comctl32/tests: Add ARM and ARM64 arch strings. - kernel32/tests: Add more ARM and ARM64 arch strings. - user32/tests: Add ARM and ARM64 arch strings. - ntdll: Fix stack alignment on ARM64. - ntdll: Add support for Win 10. - vcomp/tests: Comment out architecture dependent tests (shift count overflow). - vcomp/tests: Add ARM and ARM64 arch strings. - vcomp/tests: Make float test i386 only. - vcomp: Add ARM support. - rpcrt4: Add ARM support. - ntdll/tests: Add ARM64 support for map protection tests. - -Aurimas Fišeras (1): - po: Update Lithuanian translation. - -Bruno Jesus (3): - msvfw32: Make it easier to recognize missing media codecs. - include: Add tcpestats.h. - iphlpapi: Add a stub for SetPerTcpConnectionEStats. - -Carlo Bramini (6): - wmc: Remove redeclaration of optarg and optind. - wrc: Remove redeclaration of optarg and optind. - winecfg: Simplify code by using SetDlgItemInt. - msvcrt: Call SetFilePointer() with correct parameters. - msvcrt: Use MSVCRT_xxx macros instead of the same ones from GLIBC. - msvcrt: SEEK_* macros from GLIBC should be replaced with safer MSVCRT_SEEK_* macros. - -Daniel Lehman (1): - msxml3: Fix crash when merging Text nodes. - -Dmitry Timoshkov (14): - ntdll: Separate image relocation from NtMapViewOfSection. - msi: Avoid using dialog record after free. - advapi32/tests: Fix compilation with PSDK. - advapi32/tests: Add a test to show that PROCESS_QUERY_INFORMATION should implicitly grant PROCESS_QUERY_LIMITED_INFORMATION access. - server: Keep a pointer to parent's fd unix_name in the closed_fd structure. - ntdll: Do not fail to relocate an image if the size of relocation block is 0. - kernel32/tests: Fix compilation with PSDK. - kernel32/tests: Add some tests for PROCESS_QUERY_LIMITED_INFORMATION. - kernel32/tests: Add some tests for THREAD_QUERY_LIMITED_INFORMATION. - advapi32/tests: Add a test to show that THREAD_QUERY_INFORMATION should grant THREAD_QUERY_LIMITED_INFORMATION. - server: Add implicit PROCESS_[QUERY|SET]_LIMITED_INFORMATION access. - server: Add implicit THREAD_[QUERY|SET]_LIMITED_INFORMATION access. - server: For querying process information demand PROCESS_QUERY_LIMITED_INFORMATION access. - server: For querying thread information demand THREAD_QUERY_LIMITED_INFORMATION access. - -Eric Kohl (1): - advapi32: Add some well-known SDDL SID strings. - -Erich Hoover (1): - server: Do not permit FileDispositionInformation to delete a file without write access. - -Gerald Pfeifer (2): - d3dcompiler_43: Define BWRITER_SM1_VS and BWRITER_SM1_PS as unsigned constants. - oleaut32: Use proper unsigned type in EXPECT_I8(high,low). - -Hans Leidekker (9): - wbemprox: Fix evaluation of LIKE queries. - iphlpapi: Set the adapter LUID in GetAdaptersAddresses. - iphlpapi/tests: Fix a couple of test failures. - include: Add missing SSPI declarations. - secur32: Implement a couple of identity helper functions. - credui: Add a partial implementation of SspiPromptForCredentials. - iphlpapi: Use WS_AF_INET instead of AF_INET where appropriate. - iphlpapi: Implement GetIfTable2. - msi: Only remove environment strings that were added on install. - -Henri Verbeet (18): - iphlpapi: Simplify the calculation of "ptr" in CreateSortedAddressPairs(). - d3d10core: Add locking around wined3d calls. - d2d1: Get rid of a FIXME in d2d_solid_color_brush_init(). - d2d1: Get rid of a FIXME in d2d_bitmap_brush_init(). - d2d1: d2d_bitmap_brush_init() can't fail. - d2d1: Get rid of a FIXME in d2d_wic_render_target_init(). - d2d1: Only print a FIXME/WARN for specific properties in d2d_d3d_render_target_init(). - d2d1: Only print a FIXME/WARN for specific properties in d2d_factory_init(). - d2d1: Print a WARN instead of a FIXME for the glyph run description in d2d_text_renderer_DrawGlyphRun(). - d2d1: Only draw if the geometry has any faces in d2d_d3d_render_target_FillGeometry(). - d2d1: Make d2d_geometry_sink_vtbl static const. - wined3d: Also invalidate STATE_SHADER_RESOURCE_BINDING in wined3d_texture_bind_and_dirtify(). - wined3d: Separate loading shader resources and updating their binding points. - d3d10core: Implement d3d10_device_UpdateSubresource(). - d2d1: Implement d2d_bitmap_CopyFromMemory(). - d2d1: Implement d2d_text_renderer_DrawInlineObject(). - d2d1: Properly cleanup in d2d_rectangle_geometry_init() failure paths. - d2d1: Implement d2d_factory_CreateTransformedGeometry(). - -Hugh McMaster (5): - kernel32: Reset insert key toggle when Insert Mode changes. - uninstaller: Add WriteConsoleW support. - uninstaller: Output Unicode program names in CLI mode. - uninstaller: Add WriteFile fallback. - uninstaller: Add help switch and usage information. - -Huw D. M. Davies (3): - ws2_32: Avoid using inet_ntoa() which isn't thread-safe. - gdi32: Add tests for GetFontRealizationInfo, GetFontFileInfo and GetFontFileData. - gdi32/tests: 64-bit GetFontFileInfo may fail with error ERROR_NOACCESS. - -Indrek Altpere (1): - mshtml: Handle nsIDOMWindow_GetFrames returning NULL. - -Iván Matellanes (7): - msvcirt: Allocate a buffer if necessary when a file is opened. - msvcirt: Implement filebuf::setmode. - msvcirt: Implement filebuf::setbuf. - msvcirt: Implement filebuf::sync. - msvcirt: Implement filebuf::overflow. - msvcirt: Implement filebuf::underflow. - msvcirt: Implement filebuf::seekoff. - -Jacek Caban (15): - mshtml: Wine Gecko 2.40 release. - widl: Allow [version] attribute to be used on structs in winrt mode. - widl: Added support for namespaced structs. - windows.foundation.idl: Added struct declarations. - ieframe: Store container IOleCommandTarget in DocHost. - ieframe: Use stored IOleCommandTarget in Exec implementation and get rid of no longer needed exec in IDocHostContainerVtbl. - ieframe: Added support for DownloadBegin and DownloadComplete events. - ieframe: Properly test events when container doesn't support IOleCommandTarget add added more tests. - mshtml: Added IHTMLCurrentStyle3::whiteSpace property implementation. - mshtml: Properly handle request aborted inside OnStartRequest. - ieframe: Don't add about: URLs to travellog. - ieframe: Update back/forward command state in FireNavigateComplete2. - ieframe: Update back/forward navigation state in CMDID_EXPLORER_UPDATEHISTORY handler. - ieframe: Fixed and improved navigation command state tests. - ieframe/tests: Added more test traces to diagnose some test failures. - -Jianqiu Zhang (1): - ntdll/tests: Add basic tests for FileRenameInformation. - -Józef Kucia (9): - d3d10core/tests: Fix copy-paste mistake. - includes: Add D3D11CreateDeviceAndSwapChain declaration to d3d11.idl. - d3d10core: Do not use '\n' in the middle of TRACEs. - d3d10: Do not use '\n' in the middle of TRACE. - dxgi: Remove 'stub!' from TRACE message in dxgi_swapchain_ResizeBuffers(). - d3d11: Add ID3D11Device stub interface. - d3d11: Move d3d10core to d3d11. - d3d11: Implement D3D11CreateDevice. - d3d11: Rename d3d10_device to d3d_device. - -Ken Thomases (1): - winemac: Tell Wine when Cocoa brought a clicked window forward even if it sent the click event. - -Michael Müller (5): - winhttp: Remove unused variable in read_reply(). - imagehlp: Remove unused structure. - winhttp: Raw request headers need to be terminated with double \r\n. - winecfg: Do not overwrite theme each time an item is drawn. - krnl386.exe16: Increase buffer size in GetTempDrive. - -Michael Stefaniuc (2): - qedit: COM cleanup for IEnumMediaTypes of SampleGrabber. - qedit: Simplify/fix the creation of the IEnumMediaTypes. - -Nikolay Sivov (18): - dwrite: Fix font table tag tracing. - dwrite: Use OS/2 table data to set font style, make it preferable. - dwrite: Set font stretch from 'head' table as a fallback. - dwrite: Improve the way font weight is set with both OS/2 and 'head' values. - dwrite: Use better font matching algorithm based on weight/stretch/style triples. - dwrite: Fix family name extraction order. - dwrite: Improve face name extraction. - dwrite/tests: Some tests for target hdc mode/transform. - include: Added IImgCtx definition. - dwrite: Implement outline mode for DrawGlyphRun(). - dwrite: Use aliased outline threshold for GDI target. - dwrite: Implement font style resolution from name strings. - po: Update Russian translation. - dwrite: Implement font stretch resolution. - dwrite: Extract and resolve font weight from name string. - dwrite: Protect from space-only strings when trimming away spaces. - dwrite/tests: Fix layout test failure on Win10. - dwrite/tests: Fix analyzer test failures on Win10. - -Piotr Caban (2): - ntdll: Fix modules order in InInitializationOrderModuleList. - imm32: Use IMM context keyboard layout when possible. - -Qian Hong (1): - ntdll/tests: Add tests for FileLinkInformation class. - -Sebastian Lackner (21): - wininet/tests: Print the correct function name in ok() messages. - ntdll: Move cookie initialization code from memory management to loader. - d3dcompiler: Implement semi-stub for D3DCompile2. - server: Initialize irp->thread immediately after creation of irp_call object. - server: Avoid leaking uninitialized stack memory to applications. - vcomp: Implement stub for _vcomp_flush and add tests. - vcomp: Implement omp_init_lock and omp_destroy_lock. - vcomp: Export omp_init_nest_lock and omp_destroy_nest_lock. - vcomp: Implement OpenMP nested locking functions. - vcomp: Implement OpenMP regular locking functions. - oleaut32: Fix possible integer overflow in VarR4FromDec. - server: Add support for setting file disposition information. - server: Initialize table->handles immediately after creation of atom table. - server: Avoid invalid memory accesses when create_console_output fails. - server: Avoid invalid memory access when create_console_input fails. - include: Add definition for FILE_LINK_INFORMATION struct. - ntdll/tests: Add additional tests for FileRenameInformation. - ntdll: Implement FileRenameInformation support. - server: Implement support for FileLinkInformation class in NtSetInformationFile. - ntdll/tests: Add additional tests for calling NtOpenFile with file object as RootDirectory. - server: Implement open_file_object for rootdir pointing to file object. +Alex Henrie (9): + opengl32: Check the minor version when determining extension support. + winex11: Initialize the length of each side of the color cube to 1. + winex11: Make color cubes as big as possible. + winex11: Avoid double initialization of variables in OpenGL functions. + opengl32: Avoid double initialization of variables in WGL functions. + opengl32: Define the 2D identity matrix once, at the top of the file. + user32: Turn magic values into static constants. + user32: Remove redundant check for buf's existence. + user32: Avoid double initialization. + +Alexandre Julliard (43): + mmdevapi/tests: Avoid %ll printf format. + makefiles: Generate rules for installing headers. + makefiles: Generate rules for installing X template files. + makefiles: Add makedep pragmas in all IDL source files. + configure: Fix the libpulse check for when the library exists but doesn't work. + urlmon/tests: Use the same file as wininet for FTP testing. + configure: Use the correct help string macro. + makefiles: Generate rules for installing IDL headers. + makefiles: Generate rules for installing IDL include files. + makefiles: Get rid of the obsolete IMPLIB_SRCS variable. + makefiles: Generate correct dependencies for included typelib files. + x3daudio1_7: Remove unused debug channel. + widl: Disable a noisy warning. + makefiles: Only set the manpage flag for programs. + makefiles: Get rid of the DLLPREFIX variable. + makefiles: Get rid of the documentation makefile. + makefiles: Remove a no longer necessary library path. + d2d1: Avoid an unsupported makefile variable assignment. + kernel32/tests: Fix some todo tests that succeed or fail depending on the kernel version. + makedep: Don't store install rules in the makefile object. + makedep: Constify the makefile parameter where possible. + makedep: Release extra string storage. + makefiles: Try to remove all include directories on uninstall. + makefiles: Add support in make_makefiles for flags in sfd files. + makefiles: Always build .in files. + makedep: Add a helper function to open a file in the parent's source directory. + makedep: Add a helper function to open a file from the include path. + makedep: Store the include paths without the -I prefix. + makedep: Expand the rm command. + makedep: Always open Makefile.in files from the source directory. + makedep: Fix a typo in the usage message. + makefiles: Group uninstall files in a single command. + makefiles: Generate rules for building libwine. + makefiles: Generate rules for installing libwine. + makefiles: Generate rules for building the libwine import library. + makefiles: Generate makefiles and po rules also for disabled modules. + makefiles: Add support for specifying extra dependencies in libraries and programs. + makefiles: Generate rules for installing wine.inf. + makefiles: Install source directory files from the top-level makefile. + makefiles: Replace the loader makefile rules by variable declarations. + makefiles: Replace the libwine makefile rules by variable declarations. + makefiles: Expand the test resource list through a makefile variable. + makefiles: Remove support for running subdirectory makefiles through config.status. + +Alistair Leslie-Hughes (7): + d3dx9: Don't always fail if an ID3DXAnimationController pointer is passed to D3DXLoadMeshHierarchyFromXInMemory. + oledb32: Support VT_NULL on all conversions. + wininet: Free critical section (Valgrind). + gameux: Fix memory leaks (Valgrind). + hnetcfg: Add Dispatch support to interface INetFwOpenPorts. + odbccp32: Implement SQLGetPrivateProfileStringW/SQLGetPrivateProfileString. + odbccp32: Remove duplicate string. + +Andrew Eikum (10): + xaudio2/tests: Fix memory leaks. + xaudio2: For legacy xaudio2, prefer native version. + shell32: Implement IShellDispatch2::ShellExecute. + mmdevapi/tests: Remove todo_wine on some tests for winepulse. + winepulse: Always mute buffer. + winepulse: In Shared mode, track device position in bytes. + winepulse: Prefer PulseAudio driver. + maintainers: Add myself to a few entries. + winecoreaudio: Handle sysex MIDI messages. + xaudio2_7: Update current buffer position after flushing buffers. + +Andrey Gusev (1): + include: Add d3dx10.h file. + +André Hentschel (2): + dbghelp: Add even more symbol types. + maintainers: Update winemaker section. + +Austin English (20): + kernel32: Add AllocateUserPhysicalPages stub. + kernel32: Add SetConsoleKeyShortcuts stub. + sfc: Add SfcGetNextProtectedFile stub. + fltmgr.sys: Add FltInitializePushLock stub. + wine.inf: Add System\CurrentControlSet\Services\RpcSs registry key. + dbghelp: Version to 6.1.7601.17514. + bthprops.cpl: Add stub dll. + wmplayer: Add stub program. + bluetoothapis: Add stub dll. + ntoskrnl.exe: Add ExAcquireResourceExclusiveLite stub. + ntoskrnl.exe: Add ExDeleteResourceLite stub. + ntoskrnl.exe: Add ExReleaseResourceForThreadLite stub. + wine.inf: Add HKLM\System\CurrentControlSet\Control\ServiceGroupOrder\List registry key. + bthprops.cpl: Comment out CPLApplet from spec file. + ndis.sys: Forward NdisInitUnicodeString to ntdll.RtlInitUnicodeString. + wine.inf: Add Windows Media Player version registry keys. + ntoskrnl.exe: Add a stub for ProbeForRead. + ntoskrnl.exe: Add ExDeleteNPagedLookasideList stub. + ntoskrnl.exe: Add ExDeletePagedLookasideList stub. + combase: Add RoGetActivationFactory stub. + +Bruno Jesus (9): + msvfw32: Derive frame dimension from bitmap info when not available. + msvfw32: Make it clear why a DrawDibBegin call is required. + mcicda: Improve CD drive IOCTL tracing. + iccvid: Implement inverted frame decompressing. + iccvid: Use a separate argument for inverted decompressing. + include: Add definitions related to WSAPoll(). + msrle32/tests: Add uncompressed frame decompressing test. + msrle32: Add support to decompress uncompressed frames. + ws2_32/tests: Add WSAPoll() tests. + +Daniel Lehman (4): + msvcp120: Implement _Thrd_sleep/yield. + msvcp120: Implement _Thrd_current. + msvcp120: Implement _Thrd_create/join. + msvcp120: Implement _Cnd_* functions. + +Dmitry Timoshkov (17): + widl: Avoid warnings when being added dispatch guids already present in a typelib. + ole32: Handle failure of reading directory entry in IEnumSTATSTG::Next. + ole32: Zero out returned stats when IEnumSTATSTG::Next reaches end of enumeration. + ole32/tests: Add the tests to show that IEnumSTATSTG::Next should zero out returned stats when it reaches end of enumeration. + Revert "msi: Correctly parse double quotes in the token value.". + msi: Make sure to reset the 'in_quotes' state in all cases. + ole32/tests: Add some tests for loading and drawing various OLE formats. + ole32: Relax media type check when loading CF_METAFILEPICT format from OLE storage. + ole32: Add more traces to the storage methods. + widl: Avoid adding duplicate type definitions if tag and typedef names are the same. + widl: Attribute uuid() takes precedence over 'hidden'. + widl: Avoid generating duplicate typelib entries for structure tag names. + widl: Attributes of the alias are supposed to replace attributes of a tag in the typelib. + widl: Ignore assignment of a duplicate uuid. + oleaut32/tests: Add a bunch of new tests for typelib generation. + taskschd/tests: Fix memory leaks (Valgrind). + ntdll: Avoid path buffer re-allocation step for common dll name lengths. + +François Gouget (2): + configure: Fix the notices handling in WINE_PRINT_MESSAGES(). + configure: The libtiff pkg-config name is libtiff-4. + +Hans Leidekker (18): + maintainers: Add Web Services, Windows Management Instrumentation and WinHTTP sections. + webservices: Implement WsXmlStringEquals. + include: Add missing Web Services declarations. + webservices: Keep track of the parent-child relationship between nodes. + webservices: Implement WsAlloc. + webservices: Parse self-closing tags. + webservices: Implement WsMoveReader. + webservices: Implement WsWriteStartElement. + webservices: Reset writer state in WsSetOutput and WsSetOutputToBuffer. + webservices: Add support for retrieving the output buffer. + webservices: Implement WsWriteEndElement. + webservices: Avoid writing redundant namespace attributes. + webservices: Implement WsWriteEndStartElement. + webservices/tests: Add tests. + webservices: Implement WsWriteStartAttribute. + webservices: Implement WsWriteEndAttribute. + webservices: Implement WsWriteText. + webservices/tests: Add more tests. + +Henri Verbeet (6): + wined3d: Map glDrawArraysInstanced() to glDrawArraysInstancedARB(). + wined3d: Get rid of getColorBits(). + wined3d: Get rid of getDepthStencilBits(). + wined3d: Disallow stencil size mismatches in wined3d_check_pixel_format_depth() if the format has stencil bits. + wined3d: Always use the same formats in context_create() when "always_offscreen" is enabled. + wined3d: Call wglGetPixelFormat() through the gl_ops table. + +Hugh McMaster (7): + po: Fix some format specifiers in the Turkish translation. + wineconsole: Add if check to determine whether a font attribute has changed. + server: Add console font information. + wineconsole: Pass font size information to wineserver. + kernel32: Implement GetNumberOfConsoleFonts. + kernel32: Implement GetConsoleFontSize. + kernel32/tests: Add tests for GetConsoleFontSize. + +Huw D. M. Davies (6): + user32: Restore the dc's colours after sending WM_DRAWITEM. + gdi32: Take into account the mask's offset. + maintainers: Add a few entries. + riched20: Store the font cache entry rather than the HFONT. + riched20: Release the font cache when changing the default style. + riched20: Maintain a list of styles and reuse them if possible. + +Jacek Caban (24): + dnsapi: Added DnsQueryEx stub. + ole32: Make CoInitializeEx hot patchable. + ntdll: Added NtOpenKeyEx implementation. + ntdll: Fixed argument order in NtNotifyChangeKey. + urlmon: Don't include 'Win32' token in user agent string. + urlmon: Include 'x64' token in user agent string on win64. + ntdll: Return STATUS_PENDING in NtNotifyChangeKey if async notify is performed. + server: Reset event in set_registry_notification. + server: Notify parent key when subkey is created. + ntdll: Added NtNotifyChangeMultipleKeys implementation. + ieframe: Store toolbar handle in InternetEplorer. + ieframe: Disable forward and backward navigation toolbar buttons when they are not usable. + ieframe: Don't use WINAPI in internal functions. + comctl32: Don't use comparisons to FALSE. + ntdll: Added a few registry stubs. + server: Return KeyFullInformation maximal string lengths in bytes. + ntdll: Added KeyCachedInformation key info class implementation. + server: Store all 32 bits of value type. + ole32: Added DECLSPEC_HOTPATCHABLE to a few more functions. + advapi32: Added DECLSPEC_HOTPATCHABLE to CreateProcessAsUser[AW] functions. + kernel32: Added DECLSPEC_HOTPATCHABLE to WinExec function. + oleaut32: Added DECLSPEC_HOTPATCHABLE to a few functions. + advapi32: Use absolute registry paths to create special root keys. + mshtml: Skip travellog notifications for frame navigation. + +Jactry Zeng (3): + riched20: Set pStream->written in ME_StreamOutFlush. + riched20: Make paragraph in make_para independently. + riched20: Implement alignment styles support. + +Julian Rüger (1): + po: Update German translation. + +Józef Kucia (61): + wined3d: Introduce wined3d_resource_map(). + wined3d: Introduce wined3d_resource_unmap(). + wined3d: Set slice pitch in wined3d_map_desc to surface size. + d3d11: Implement d3d11_immediate_context_Map(). + d3d11: Implement d3d11_immediate_context_Unmap(). + d3d11: Add support for mapping 3D textures. + d3d11/tests: Add test for resource mapping. + d3d11: Implement d3d11_immediate_context_RSSetViewports(). + d3d11: Implement d3d11_immediate_context_OMSetRenderTargets(). + d3d11/tests: Port test_il_append_aligned() from d3d10core. + d3d8: Use wined3d_resource_{map, unmap}() instead of wined3d_texture_{map, unmap}(). + d3d9: Use wined3d_resource_{map, unmap}() instead of wined3d_texture_{map, unmap}(). + d3d11: Use wined3d_resource_{map, unmap}() instead of wined3d_texture_{map, unmap}(). + wined3d: Remove wined3d_texture_{map,unmap}(). + d3d11: Implement d3d11_immediate_context_Draw(). + d3d11: Implement d3d11_immediate_context_RSSetScissorRects(). + d3d11: Implement d3d11_immediate_context_RSSetState(). + d3d11/tests: Port test_scissor() from d3d10core. + d3d11: Implement d3d11_immediate_context_OMSetBlendState(). + d3d11/tests: Port test_blend() from d3d10core. + include: Add some missing D3D11 constants. + d3d11: Implement d3d11_immediate_context_PSSetSamplers(). + d3d11: Implement d3d11_immediate_context_PSSetShaderResources(). + d3d11/tests: Port test_texture() from d3d10core. + d3d11: Implement d3d11_immediate_context_PSSetConstantBuffers(). + d3d11/tests: Port test_fragment_coords() from d3d10core. + d3d11: Implement d3d11_immediate_context_UpdateSubresource(). + d3d11/tests: Port test_update_subresource() from d3d10core. + d3d11: Implement d3d11_immediate_context_GSSetConstantBuffers(). + d3d11: Implement d3d11_immediate_context_GSSetShaderResources(). + d3d11: Implement d3d11_immediate_context_IAGetPrimitiveTopology(). + d3d11: Implement d3d11_immediate_context_VSSetConstantBuffers(). + d3d11: Implement d3d11_immediate_context_VSSetShaderResources(). + d3d11: Implement d3d11_immediate_context_VSSetSamplers(). + d3d11: Implement d3d11_immediate_context_GSSetSamplers(). + d3d11: Implement d3d11_immediate_context_RSGetState(). + d3d11: Implement d3d11_immediate_context_IAGetInputLayout(). + d3d11: Implement d3d11_immediate_context_SetPredication(). + d3d11: Implement d3d11_immediate_context_GetPredication(). + d3d11: Implement d3d11_immediate_context_VSGetSamplers(). + d3d11: Implement d3d11_immediate_context_PSGetSamplers(). + d3d10core/tests: Fix typo. + d3d10core/tests: Avoid multiple readbacks of backbuffer texture. + d3d11/tests: Avoid multiple readbacks of backbuffer texture. + d3d11: Implement d3d11_immediate_context_GSGetSamplers(). + d3d11: Implement d3d11_immediate_context_GSGetConstantBuffers(). + d3d11: Implement d3d11_immediate_context_GSGetShader(). + d3d11: Implement d3d11_immediate_context_GSGetShaderResources(). + d3d11: Implement d3d11_immediate_context_VSGetConstantBuffers(). + d3d11: Implement d3d11_immediate_context_VSGetShader(). + d3d11: Implement d3d11_immediate_context_VSGetShaderResources(). + d3d11: Implement d3d11_immediate_context_PSGetShaderResources(). + d3d11: Implement d3d11_immediate_context_PSGetShader(). + d3d11: Implement d3d11_immediate_context_PSGetConstantBuffers(). + d3d11: Implement d3d11_immediate_context_SOSetTargets(). + wined3d: Make offset parameter optional in wined3d_device_get_stream_output(). + d3d11: Implement d3d11_immediate_context_SOGetTargets(). + d3d11: Implement d3d11_immediate_context_IASetIndexBuffer(). + d3d11: Implement d3d11_immediate_context_DrawIndexed(). + d3d11: Implement d3d11_immediate_context_DrawIndexedInstanced(). + d3d11: Implement d3d11_immediate_context_OMGetRenderTargets(). + +Ken Thomases (6): + winemac: Cope with multiple seemingly-identical display modes, only some of which work, by trying them in sequence. + winemac: Use CVDisplayLink to limit window redrawing to the display refresh rate. + winemac: Remove the live-resize display timer. + winemac: Check the window's display link after adding it as a child of another window, which may order it on screen. + winemac: Stop the CVDisplayLink when there are no more changes to flush. + winemac: Fix a crash on versions of OS X prior to 10.9 which don't have the -[NSImage drawInRect:] method. + +Maarten Lankhorst (10): + winepulse: Add initial stub for pulseaudio support. + winepulse: Add format and period probing. + winepulse: Add audioclient. + winepulse: Add IAudioRenderClient and IAudioCaptureClient. + winepulse: Add IAudioClock and IAudioClock2. + winepulse: Add audiostreamvolume. + winepulse: Add session support. + winepulse: Forward winmm functions to winealsa. + winepulse: Fixup IsFormatSupported calls. + winepulse: Add support for IMarshal. + +Marcus Meissner (2): + quartz: Avoid endless loop (Coverity). + d3dx9_36: Remove unneeded vertex_remap variable (Coverity). + +Mark Harmstone (3): + winepulse: Handle stream create failing correctly. + winepulse: Add stub for GetPropValue. + winepulse: Return PKEY_AudioEndpoint_PhysicalSpeakers device prop. + +Martin Storsjo (18): + ucrtbase: Fix the function name in a comment. + ucrtbase: Simplify the snprintf/swprintf tests. + ucrtbase: Add defines for the printf/scanf options constants. + ucrtbase: Handle the swprintf style termination and return values. + msvcrt: Refactor pf_printf to take options as flags instead of as BOOL parameter. + msvcrt: Ignore 'N' as format length modifier for pointers, just like 'F'. + ucrtbase: Implement the new printf corner case behaviour. + msvcrt: Interpret 'I' as size_t size specifier for integer conversions. + ucrtbase: Handle the C99 'z' size_t specifier for integers. + ucrtbase: Handle the _s variant of vsscanf. + makedep: Set use_msvcrt for ucrtbase imports as well. + ucrtbase: Implement _get_stream_buffer_pointers. + vcruntime140: Implement __vcrt_InitializeCriticalSectionEx. + ucrtbase: Implement __std_type_info_compare. + ucrtbase: Add a test for snprintf to a NULL buffer. + msvcrt: Pass on the return value in _callnewh. + msvcrt: Don't lock the heap in operator_new. + ucrtbase: Hook up _seh_filter_exe and _seh_filter_dll. + +Matteo Bruni (12): + wined3d: Cleanup extension check for shader model 4 support. + wined3d: Set default texture units mapping for vertex shader samplers when possible. + wined3d: Avoid going through the texture units mapping when unnecessary. + wined3d: Enforce a stable texture units mapping. + wined3d: Handle WINED3D_SHADE_PHONG the same as WINED3D_SHADE_GOURAUD. + d3d9/tests: Improve the shade mode test. + d3d8/tests: Port test_shademode() to d3d8. + ddraw/tests: Port test_shademode() to ddraw7. + ddraw/tests: Port test_shademode() to ddraw4. + ddraw/tests: Port test_shademode() to ddraw2. + ddraw/tests: Port test_shademode() to ddraw1. + wined3d: Flat shading emulation for core contexts. + +Nikolay Sivov (27): + dwrite: Store transform analysis was created with. + dwrite: Store origin, advances and offsets as vectors for run analysis. + dwrite: Added support for transform in glyph run analysis. + dwrite: When assembling run bitmap combine instead of overwriting. + oledb32: Allow case-insensitive match for Provider keyword. + dwrite: Apply run reading direction to advances and offsets on analysis creation. + dwrite/tests: Simple test to show that run analysis instances are not reused. + comctl32: Protect TVM_GETITEM from invalid item pointers. + kernel32: Simplify EnumDateFormats & EnumDateFormatsEx. + kernel32: Implement EnumDateFormatsExEx(). + hnetcfg: Store port name for INetFwOpenPort. + nls: Added LOCALE_SSHORTTIME locale data. + hnetcfg: Store protocol for INetFwOpenPort. + hnetcfg: Store port number for INetFwOpenPort. + kernel32: GetLocaleInfoA() doesn't support LOCALE_SSHORTTIME. + kernel32: EnumTimeFormatsA() doesn't support TIME_NOSECONDS. + kernel32: Added support for TIME_NOSECONDS, restructured EnumTimeFormats implementation. + kernel32: Implement EnumTimeFormatsEx(). + winemine: Fix loading program state from registry. + mshtml: Make it clear that ATTR_FIX_PX and ATTR_FIX_URL as exclusive (Coverity). + riched20: Fix a memory leak on error path (Coverity). + mshtml: Fix a memory leak (Coverity). + shell32: Return as soon as requested CLSID is located (Coverity). + hnetcfg: Return success from put_Enabled for a port. + dwrite: Remove a couple of dead assignments (Clang). + comctl32/tests: Test more return values (Clang). + dwrite/tests: Remove unused assignment (Clang). + +Piotr Caban (3): + include: Fix CreateSymbolicLink and TryAcquireSRWLockExclusive prototypes. + comctl32/tests: Flush events in listview tests after setting foreground window. + wininet: Create file with correct file name in test_trailing_slash tests. + +Qian Hong (4): + gdi32: Initialize system font link registry. + quartz: Fix crashing when connect to NULL Pin. + quartz/tests: Add NULL pointer tests for IGraphBuilder. + quartz: Fix error code when checking circular connection. + +Ralf Habacker (1): + dbghelp: Fix crash in module_find_cb on trying to parse non image files. + +Riccardo Bortolato (7): + wined3d: Make wined3d_device_copy_sub_resource_region return an error code. + ddraw: Remove unused mipmap_level from ddraw_surface. + wined3d: Call wined3d_texture_decref() instead of wined3d_surface_decref() in wined3d_cs_exec_set_depth_stencil_view(). + wined3d: Call wined3d_texture_{inc, dec}ref() instead of wined3d_surface_{inc, dec}ref() in device_switch_onscreen_ds(). + wined3d: Call wined3d_texture_decref() instead of wined3d_surface_decref() in wined3d_device_uninit_3d(). + wined3d: Call wined3d_texture_decref() instead of wined3d_surface_decref() in wined3d_device_reset(). + wined3d: Call wined3d_texture_decref() instead of wined3d_surface_decref() in swapchain_gl_present(). + +Sebastian Lackner (15): + server: Clear last error when creating object without name. + widl: When adding an interface typedef do check whether it has been already added while resolving the parent interface. + winepulse.drv: Add a missing linebreak to ERR message. + kernel32/tests: Add a test to demonstrate a deadlock by suspending a thread during a system APC. + server: Wake up APC if we fail to allocate a handle in target process. + dinput: Print TRACE at the beginning of SysMouseWImpl_GetDeviceState function. + dinput: Ensure X11 input events are forwarded to wineserver even without message loop. + ntdll: Fix specfile entry for NtCreateKeyTransacted. + include: Add declarations for recently added registry functions. + kernel32/tests: Add some more tests for opening a file with FILE_DELETE_ON_CLOSE. + server: Return STATUS_CANNOT_DELETE when trying to open readonly file with FILE_DELETE_ON_CLOSE. + kernel32: DeleteFile should open the file without read/write permissions. + ntdll/tests: Add tests for multiple registry notifications per key. + server: Only send WM_WINE_CLIPCURSOR for forced clip resets. + ntoskrnl.exe: Add a stub for ProbeForWrite. Stefan Dösinger (2): - wined3d: Use the correct color key in ARBfp color key blits. - wined3d: Use GL_RGB565 if available. + user32: Silently ignore temporary foreground loss. + comctl32: Re-enable the parent before destroying the dialog. -Thomas Faber (1): - qmgr: Do not omit mandatory argument to WriteFile. +Stefan Leichter (1): + wimgapi: Add stub for WIMRegisterMessageCallback. Thomas Faller (1): - cmd: Implement 'echo/'. + kernel32: Fix invalid write. -Vincent Povirk (7): - comdlg32: Add test for IFileDialogEvents::OnOverwrite. - comdlg32: Implement overwrite check in item dialog. - shell32: Use return value from IShellFolder_GetAttributesOf. - shell32: Fix getting parent shell folder when it's the desktop folder. - comdlg32: Implement SetControlItemState for menu controls. - comdlg32: Implement SetControlItemState for combo boxes. - comdlg32: Partially implement IFileDialogCustomize::EnableOpenDropDown. - -YongHao Hu (10): - msvcp110: Add tr2_sys__Stat and tr2_sys__Lstat implementation and test. - msvcp110: Add tr2_sys__File_size_wchar implementation and test. - msvcp110: Add tr2_sys__Equivalent_wchar implementation and test. - msvcp110: Add tr2_sys__Current_get_wchar implementation and test. - msvcp110: Add tr2_sys__Current_set_wchar implementation and test. - msvcp110: Add tr2_sys__Make_dir_wchar implementation and test. - msvcp110: Add tr2_sys__Remove_dir_wchar implementation and test. - msvcp110: Add tr2_sys__Copy_file_wchar implementation and test. - msvcp110: Add tr2_sys__Rename_wchar implementation and test. - msvcp110: Add tr2_sys__Statvfs_wchar implementation and test. - -Zhenbo Li (4): - msxml3: Handle NULL parameter in IXMLDOMElement::get_ownerDocument(). - mshtml: Add IHTMLSelectElement::name property implementation. - mshtml: Add IHTMLSelectElement::form property implementation. - mshtml: Add IHTMLXMLHttpRequest::abort() method implementation. +Vincent Povirk (10): + gdiplus: Skip the EMR_HEADER record when looking for the EMF+ header. + gdiplus/tests: Add tests for metafile headers and image information. + gdiplus: Add initial GdipGetMetafileHeaderFromEmf implementation. + gdiplus: Use reference device to determine created metafile resolution. + gdiplus: Use GdipGetMetafileHeaderFromEmf when opening metafiles. + gdiplus: Return Ok from GdipSetMetafileDownLevelRasterizationLimit. + gdiplus: Placeable is optional in GdipCreateMetafileFromWmf. + comdlg32: Add ES_AUTOHSCROLL style to filename text box. + makedep: Fix install rule for .idl files. + comdlg32: Initially focus filename text box. + +YongHao Hu (1): + msvcp110: Add tr2_sys__Open_dir implementation. -- Alexandre Julliard diff -Nru wine1.7-1.7.50/AUTHORS wine1.7-1.7.55/AUTHORS --- wine1.7-1.7.50/AUTHORS 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/AUTHORS 2015-11-13 14:32:40.000000000 +0000 @@ -131,6 +131,7 @@ Anish Mistry Anssi Hannula Antoine Chavasse +Anton Baskanov Antonio Codazzi Antonio Larrosa Jiménez Apostolos Alexiadis @@ -203,6 +204,7 @@ Caibin Chen Cameron Heide Camillo Lugaresi +Can Taşan Caolan McNamara Carlo Bramini Carlos Lozano @@ -429,6 +431,7 @@ Finlo Boyde Florian Goth Florian Köberle +Florian Pelz Florian Tobias Schandinat Fons Botman Francesco Di Punzio @@ -638,6 +641,7 @@ Jens Collin Jens Hoffmann Jens Nestler +Jens Reyer Jeremiah Flerchinger Jeremy Chin Jeremy Drake @@ -766,6 +770,7 @@ Karol Herbst Karsten Elfenbein Kasper Sandberg +Katarzyna Caban Kees Cook Kees Schoenmakers Keith Bowes @@ -919,6 +924,7 @@ Mathias Kosch Matijn Woudt Matt Chapman +Matt Durgavich Matteo Bruni Matthew Becker Matthew Bloch @@ -948,6 +954,7 @@ Michael Beach Michael Cardenas Michael C. Maggio +Michael Cronenworth Michael Curran Michael Fritscher Michael Gardiner @@ -1189,6 +1196,7 @@ Ričardas Barkauskas Ricardo Filipe Ricardo Massaro +Riccardo Bortolato Riccardo Loti Richard A Lough Richard Bradbrook @@ -1354,6 +1362,7 @@ Thomas Kho Thomas Mertes Thomas Mullaly +Thomas Pointhuber Thomas Sandford Thomas Spear Thomas Weidenmüller diff -Nru wine1.7-1.7.50/configure wine1.7-1.7.55/configure --- wine1.7-1.7.50/configure 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/configure 2015-11-13 14:32:40.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for Wine 1.7.50. +# Generated by GNU Autoconf 2.69 for Wine 1.7.55. # # Report bugs to . # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='Wine' PACKAGE_TARNAME='wine' -PACKAGE_VERSION='1.7.50' -PACKAGE_STRING='Wine 1.7.50' +PACKAGE_VERSION='1.7.55' +PACKAGE_STRING='Wine 1.7.55' PACKAGE_BUGREPORT='wine-devel@winehq.org' PACKAGE_URL='http://www.winehq.org' @@ -624,6 +624,7 @@ ac_subst_vars='LTLIBOBJS LIBOBJS +WINELOADER_INSTALL LINGUAS ALL_VARS_RULES LDAP_LIBS @@ -632,6 +633,7 @@ DL_LIBS TOOLSEXT UNWINDFLAGS +EXCESS_PRECISION_CFLAGS BUILTINFLAG EXTRACFLAGS PROCSTAT_LIBS @@ -653,6 +655,8 @@ ALSA_LIBS GSTREAMER_LIBS GSTREAMER_CFLAGS +PULSE_LIBS +PULSE_CFLAGS GETTEXTPO_LIBS Z_LIBS FREETYPE_LIBS @@ -676,7 +680,7 @@ XSLT_CFLAGS XML2_LIBS XML2_CFLAGS -LIBPCAP +PCAP_LIBS X_EXTRA_LIBS X_LIBS X_PRE_LIBS @@ -686,6 +690,7 @@ CROSSCC CROSSTARGET PRELINK +WINELOADER_DEPENDS CARBON_LIBS QUICKTIME_LIBS OPENCL_LIBS @@ -699,18 +704,23 @@ FORCEFEEDBACK_LIBS IOKIT_LIBS COREFOUNDATION_LIBS -LIBWINE_RULES +LIBWINE_DEPENDS +LIBWINE_LDFLAGS +LIBWINE_INSTALL_DEV +LIBWINE_INSTALL_LIB +LIBWINE_IMPORTLIB +LIBWINE_SHAREDLIB SOCKET_LIBS DLLTOOL -LOADER_RULES +WINELOADER_PROGRAMS ALL_TEST_RESOURCES READELF OTOOL LDD +LDEXECFLAGS LDRPATH_LOCAL LDRPATH_INSTALL DLLFLAGS -DLLPREFIX dlldir CPP OPENGL_LIBS @@ -773,6 +783,7 @@ docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -828,6 +839,7 @@ with_pcap with_png with_pthread +with_pulse with_sane with_tiff with_v4l @@ -915,6 +927,21 @@ enable_api_ms_win_core_winrt_l1_1_0 enable_api_ms_win_core_winrt_string_l1_1_0 enable_api_ms_win_core_xstate_l2_1_0 +enable_api_ms_win_crt_conio_l1_1_0 +enable_api_ms_win_crt_convert_l1_1_0 +enable_api_ms_win_crt_environment_l1_1_0 +enable_api_ms_win_crt_filesystem_l1_1_0 +enable_api_ms_win_crt_heap_l1_1_0 +enable_api_ms_win_crt_locale_l1_1_0 +enable_api_ms_win_crt_math_l1_1_0 +enable_api_ms_win_crt_multibyte_l1_1_0 +enable_api_ms_win_crt_private_l1_1_0 +enable_api_ms_win_crt_process_l1_1_0 +enable_api_ms_win_crt_runtime_l1_1_0 +enable_api_ms_win_crt_stdio_l1_1_0 +enable_api_ms_win_crt_string_l1_1_0 +enable_api_ms_win_crt_time_l1_1_0 +enable_api_ms_win_crt_utility_l1_1_0 enable_api_ms_win_downlevel_advapi32_l1_1_0 enable_api_ms_win_downlevel_advapi32_l2_1_0 enable_api_ms_win_downlevel_normaliz_l1_1_0 @@ -944,7 +971,9 @@ enable_avifil32 enable_avrt enable_bcrypt +enable_bluetoothapis enable_browseui +enable_bthprops_cpl enable_cabinet enable_capi2032 enable_cards @@ -1062,11 +1091,13 @@ enable_dxdiagn enable_dxgi enable_dxva2 +enable_esent enable_evr enable_explorerframe enable_ext_ms_win_gdi_devcaps_l1_1_0 enable_faultrep enable_fltlib +enable_fltmgr_sys enable_fntcache enable_fontsub enable_fusion @@ -1138,6 +1169,7 @@ enable_msctf enable_msctfp enable_msdaps +enable_msdelta enable_msdmo enable_msftedit enable_msg711_acm @@ -1282,6 +1314,7 @@ enable_taskschd enable_traffic enable_twain_32 +enable_ucrtbase enable_unicows enable_updspapi enable_url @@ -1295,7 +1328,9 @@ enable_vcomp enable_vcomp100 enable_vcomp110 +enable_vcomp120 enable_vcomp90 +enable_vcruntime140 enable_vdmdbg enable_version enable_vssapi @@ -1305,6 +1340,7 @@ enable_wer enable_wevtapi enable_wiaservc +enable_wimgapi enable_windowscodecs enable_windowscodecsext enable_winealsa_drv @@ -1317,6 +1353,7 @@ enable_winemp3_acm enable_wineoss_drv enable_wineps_drv +enable_winepulse_drv enable_wineqtdecoder enable_winex11_drv enable_wing32 @@ -1344,6 +1381,7 @@ enable_wtsapi32 enable_wuapi enable_wuaueng +enable_x3daudio1_0 enable_x3daudio1_1 enable_x3daudio1_2 enable_x3daudio1_3 @@ -1352,9 +1390,17 @@ enable_x3daudio1_6 enable_x3daudio1_7 enable_xapofx1_1 +enable_xapofx1_2 enable_xapofx1_3 enable_xapofx1_4 enable_xapofx1_5 +enable_xaudio2_0 +enable_xaudio2_1 +enable_xaudio2_2 +enable_xaudio2_3 +enable_xaudio2_4 +enable_xaudio2_5 +enable_xaudio2_6 enable_xaudio2_7 enable_xaudio2_8 enable_xinput1_1 @@ -1366,7 +1412,6 @@ enable_xolehlp enable_xpsprint enable_xpssvcs -enable_documentation enable_fonts enable_include enable_libs_port @@ -1449,6 +1494,7 @@ enable_winhlp32 enable_winver enable_wmic +enable_wmplayer enable_wordpad enable_write enable_wscript @@ -1490,6 +1536,8 @@ LCMS2_LIBS FREETYPE_CFLAGS FREETYPE_LIBS +PULSE_CFLAGS +PULSE_LIBS GSTREAMER_CFLAGS GSTREAMER_LIBS CAPI20_CFLAGS @@ -1542,6 +1590,7 @@ sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1794,6 +1843,15 @@ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1931,7 +1989,7 @@ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -2044,7 +2102,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Wine 1.7.50 to adapt to many kinds of systems. +\`configure' configures Wine 1.7.55 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -2084,6 +2142,7 @@ --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -2113,7 +2172,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Wine 1.7.50:";; + short | recursive ) echo "Configuration of Wine 1.7.55:";; esac cat <<\_ACEOF @@ -2161,6 +2220,7 @@ --without-pcap do not use the Packet Capture library --without-png do not use PNG --without-pthread do not use the pthread library + --without-pulse do not use PulseAudio sound support --without-sane do not use SANE (scanner support) --without-tiff do not use TIFF --without-v4l do not use v4l1 (v4l support) @@ -2221,6 +2281,9 @@ C compiler flags for freetype2, overriding pkg-config FREETYPE_LIBS Linker flags for freetype2, overriding pkg-config + PULSE_CFLAGS + C compiler flags for libpulse, overriding pkg-config + PULSE_LIBS Linker flags for libpulse, overriding pkg-config GSTREAMER_CFLAGS C compiler flags for gstreamer-app-0.10, overriding pkg-config GSTREAMER_LIBS @@ -2236,8 +2299,8 @@ JPEG_LIBS Linker flags for libjpeg, overriding pkg-config PNG_CFLAGS C compiler flags for libpng, overriding pkg-config PNG_LIBS Linker flags for libpng, overriding pkg-config - TIFF_CFLAGS C compiler flags for libtiff, overriding pkg-config - TIFF_LIBS Linker flags for libtiff, overriding pkg-config + TIFF_CFLAGS C compiler flags for libtiff-4, overriding pkg-config + TIFF_LIBS Linker flags for libtiff-4, overriding pkg-config MPG123_CFLAGS C compiler flags for libmpg123, overriding pkg-config MPG123_LIBS Linker flags for libmpg123, overriding pkg-config @@ -2309,7 +2372,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Wine configure 1.7.50 +Wine configure 1.7.55 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2827,7 +2890,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Wine $as_me 1.7.50, which was +It was created by Wine $as_me 1.7.55, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3408,6 +3471,12 @@ fi +# Check whether --with-pulse was given. +if test "${with_pulse+set}" = set; then : + withval=$with_pulse; +fi + + # Check whether --with-sane was given. if test "${with_sane+set}" = set; then : withval=$with_sane; @@ -7075,14 +7144,14 @@ dlldir="\${libdir}/wine" -DLLPREFIX="" - DLLFLAGS="-D_REENTRANT" LDRPATH_INSTALL="" LDRPATH_LOCAL="" +LDEXECFLAGS="" + LIBEXT="so" DLLEXT=".so" IMPLIBEXT="def" @@ -7347,12 +7416,12 @@ wine_fn_depend_rules () { wine_fn_append_rule \ -"$ac_dir/Makefile: $srcdir/$ac_dir/Makefile.in $srcdir/Make.vars.in config.status \$(MAKEDEP) - @./config.status --file $ac_dir/Makefile:Make.vars.in:$ac_dir/Makefile.in && \$(MAKEDEP) $ac_dir +"$ac_dir/Makefile: $srcdir/$ac_dir/Makefile.in Makefile \$(MAKEDEP) + \$(MAKEDEP) $ac_dir depend: $ac_dir/depend .PHONY: $ac_dir/depend $ac_dir/depend: \$(MAKEDEP) dummy - @./config.status --file $ac_dir/Makefile:Make.vars.in:$ac_dir/Makefile.in && \$(MAKEDEP) $ac_dir" + \$(MAKEDEP) $ac_dir" } wine_fn_pot_rules () @@ -7451,11 +7520,9 @@ ac_extraclean="$ac_dir/Makefile" test "$srcdir" = . && ac_extraclean="$ac_extraclean $ac_dir/.gitignore" - wine_fn_append_rule \ -"__clean__: $ac_dir/clean -.PHONY: $ac_dir/clean -$ac_dir/clean: dummy - \$(RM) \$(CLEAN_FILES:%=$ac_dir/%) $ac_clean $ac_extraclean" + wine_fn_depend_rules + wine_fn_clean_rules $ac_clean + wine_fn_pot_rules } wine_fn_config_makefile () @@ -7533,6 +7600,7 @@ then wine_fn_depend_rules wine_fn_clean_rules $ac_clean + wine_fn_pot_rules else wine_fn_disabled_rules $ac_clean return @@ -7551,10 +7619,10 @@ then wine_fn_append_rule \ "$ac_dir/install-lib:: $ac_dir - \$(INSTALL_PROGRAM) $ac_dir/$ac_dll$DLLEXT \$(DESTDIR)\$(dlldir)/$DLLPREFIX$ac_dll$DLLEXT + \$(INSTALL_PROGRAM) $ac_dir/$ac_dll$DLLEXT \$(DESTDIR)\$(dlldir)/$ac_dll$DLLEXT \$(INSTALL_DATA) $ac_dir/$ac_dll.fake \$(DESTDIR)\$(fakedlldir)/$ac_dll $ac_dir/uninstall:: - \$(RM) \$(DESTDIR)\$(dlldir)/$DLLPREFIX$ac_dll$DLLEXT \$(DESTDIR)\$(fakedlldir)/$ac_dll" + \$(RM) \$(DESTDIR)\$(dlldir)/$ac_dll$DLLEXT \$(DESTDIR)\$(fakedlldir)/$ac_dll" else wine_fn_append_rule \ "$ac_dir/install-lib:: $ac_dir @@ -7684,10 +7752,10 @@ then wine_fn_append_rule \ "$ac_dir/install:: $ac_dir - \$(INSTALL_PROGRAM) $ac_dir/$ac_program$DLLEXT \$(DESTDIR)\$(dlldir)/$DLLPREFIX$ac_program$DLLEXT + \$(INSTALL_PROGRAM) $ac_dir/$ac_program$DLLEXT \$(DESTDIR)\$(dlldir)/$ac_program$DLLEXT \$(INSTALL_DATA) $ac_dir/$ac_program.fake \$(DESTDIR)\$(fakedlldir)/$ac_program $ac_dir/uninstall:: - \$(RM) \$(DESTDIR)\$(dlldir)/$DLLPREFIX$ac_program$DLLEXT \$(DESTDIR)\$(fakedlldir)/$ac_program" + \$(RM) \$(DESTDIR)\$(dlldir)/$ac_program$DLLEXT \$(DESTDIR)\$(fakedlldir)/$ac_program" if test -z "$with_wine64" && wine_fn_has_flag installbin then @@ -7793,19 +7861,9 @@ wine_binary="wine" test "x$enable_win64" != "xyes" || wine_binary="wine64" -loader_programs="$wine_binary wine-installed" -libwine_soversion=`expr $libwine_version : '\([0-9]*\)\..*'` - -LOADER_RULES=" -all: wine.inf - -install install-lib:: wine-installed - \$(INSTALL_PROGRAM) wine-installed \$(DESTDIR)\$(bindir)/$wine_binary - -uninstall:: - \$(RM) \$(DESTDIR)\$(bindir)/$wine_binary -" +WINELOADER_PROGRAMS="$wine_binary" +libwine_soversion=`expr $libwine_version : '\([0-9]*\)\..*'` case $host_os in cygwin*|mingw32*) @@ -7919,31 +7977,21 @@ case $host_os in mingw32*) crtlibs="-lmsvcrt" - SOCKET_LIBS="-L\$(top_builddir)/dlls/ws2_32 -lws2_32" + SOCKET_LIBS="-lws2_32" ;; esac - libwine_targets="libwine.dll libwine.a" - LIBWINE_RULES=" -OBJS = \$(C_SRCS:.c=.o) \$(EXTRA_OBJS) + LIBWINE_SHAREDLIB="libwine.dll" -all: libwine.dll libwine.a + LIBWINE_IMPORTLIB="libwine.a" -libwine.a: \$(srcdir)/wine.def - \$(DLLTOOL) -l \$@ -d \$(srcdir)/wine.def + LIBWINE_INSTALL_LIB="libwine.dll" -libwine.dll: \$(OBJS) \$(srcdir)/wine.def - \$(CC) -shared \$(srcdir)/wine.def -o \$@ \$(OBJS) $crtlibs \$(EXTRALIBS) + LIBWINE_INSTALL_DEV="libwine.a" -install install-lib:: libwine.dll - \$(INSTALL_DATA) libwine.dll \$(DESTDIR)\$(libdir)/libwine.dll + LIBWINE_LDFLAGS="-shared \$(srcdir)/wine.def" -install install-dev:: libwine.a - \$(INSTALL_DATA) libwine.a \$(DESTDIR)\$(libdir)/libwine.a - -uninstall:: - -cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.a libwine.dll -" + LIBWINE_DEPENDS="wine.def" ;; @@ -7962,8 +8010,7 @@ LIBEXT="dylib" DLLFLAGS="$DLLFLAGS -fPIC" - LIBWINE_LDFLAGS="-multiply_defined suppress" - LDRPATH_INSTALL="-Wl,-rpath,@loader_path/\`\$(MAKEDEP) -R \$(bindir) \$(libdir)\`" + LDRPATH_INSTALL="-Wl,-rpath,@loader_path/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`" LDRPATH_LOCAL="-Wl,-rpath,@loader_path/\$(top_builddir)/libs/wine" COREFOUNDATION_LIBS="-framework CoreFoundation" @@ -8180,46 +8227,20 @@ fi - libwine_targets="libwine.dylib libwine.$libwine_soversion.dylib libwine.$libwine_version.dylib" - LIBWINE_RULES=" -OBJS = \$(C_SRCS:.c=.o) \$(EXTRA_OBJS) + LIBWINE_SHAREDLIB="libwine.$libwine_version.dylib" -all: libwine.dylib + LIBWINE_INSTALL_LIB="libwine.$libwine_version.dylib libwine.$libwine_soversion.dylib" -libwine.$libwine_version.dylib: \$(OBJS) - \$(CC) -dynamiclib -install_name @rpath/libwine.$libwine_soversion.dylib -Wl,-rpath,@loader_path/ -compatibility_version $libwine_soversion -current_version $libwine_version \$(OBJS) \$(EXTRALIBS) \$(LDFLAGS) \$(LIBS) -o \$@ + LIBWINE_INSTALL_DEV="libwine.dylib" -libwine.$libwine_soversion.dylib: libwine.$libwine_version.dylib - \$(RM) \$@ && \$(LN_S) libwine.$libwine_version.dylib \$@ + LIBWINE_LDFLAGS="-dynamiclib -install_name @rpath/libwine.$libwine_soversion.dylib -Wl,-rpath,@loader_path/ -compatibility_version $libwine_soversion -current_version $libwine_version" -libwine.dylib: libwine.$libwine_soversion.dylib - \$(RM) \$@ && \$(LN_S) libwine.$libwine_soversion.dylib \$@ + WINELOADER_DEPENDS="wine_info.plist" -install install-lib:: libwine.$libwine_version.dylib - \$(INSTALL_PROGRAM) libwine.$libwine_version.dylib \$(DESTDIR)\$(libdir)/libwine.$libwine_version.dylib - cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.$libwine_soversion.dylib && \$(LN_S) libwine.$libwine_version.dylib libwine.$libwine_soversion.dylib - -install install-dev:: - cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.dylib && \$(LN_S) libwine.$libwine_version.dylib libwine.dylib - -uninstall:: - -cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.dylib libwine.$libwine_soversion.dylib libwine.$libwine_version.dylib -" - - - as_fn_append LOADER_RULES " -$wine_binary: main.o wine_info.plist - \$(CC) -o \$@ $LDEXECFLAGS main.o \$(LIBWINE) \$(LIBPORT) \$(EXTRALIBS) \$(LDFLAGS) \$(LDRPATH_LOCAL) - -wine-installed: main.o wine_info.plist - \$(CC) -o \$@ $LDEXECFLAGS main.o \$(LIBWINE) \$(LIBPORT) \$(EXTRALIBS) \$(LDFLAGS) \$(LDRPATH_INSTALL) -" ;; linux-android*) DLLFLAGS="$DLLFLAGS -fPIC" - DLLPREFIX="lib" - LDEXECFLAGS="" dlldir="\${libdir}" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fPIC -Wl,--export-dynamic" >&5 $as_echo_n "checking whether the compiler supports -fPIC -Wl,--export-dynamic... " >&6; } @@ -8271,7 +8292,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - LDRPATH_INSTALL="-Wl,--rpath,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \$(bindir) \$(libdir)\`" + LDRPATH_INSTALL="-Wl,--rpath,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`" LDRPATH_LOCAL="-Wl,--rpath,\\\$\$ORIGIN/\$(top_builddir)/libs/wine" else as_ac_var=`$as_echo "ac_cv_cflags_-fPIC -Wl,-R,\\$ORIGIN/../lib" | $as_tr_sh` @@ -8299,7 +8320,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - LDRPATH_INSTALL="-Wl,-R,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \$(bindir) \$(libdir)\`" + LDRPATH_INSTALL="-Wl,-R,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`" LDRPATH_LOCAL="-Wl,-R,\\\$\$ORIGIN/\$(top_builddir)/libs/wine" fi fi @@ -8360,30 +8381,12 @@ ;; esac - libwine_targets="libwine.so" - LIBWINE_RULES=" -OBJS = \$(C_SRCS:.c=.o) \$(EXTRA_OBJS) + LIBWINE_SHAREDLIB="libwine.so" -all: libwine.so + LIBWINE_INSTALL_LIB="libwine.so" -libwine.so: \$(OBJS) - \$(CC) -shared \$(OBJS) \$(EXTRALIBS) \$(LDFLAGS) \$(LIBS) -o \$@ + LIBWINE_LDFLAGS="-shared" -install install-lib:: libwine.so - \$(INSTALL_PROGRAM) libwine.so \$(DESTDIR)\$(libdir)/libwine.so - -uninstall:: - \$(RM) \$(DESTDIR)\$(libdir)/libwine.so -" - - - as_fn_append LOADER_RULES " -$wine_binary: main.o - \$(CC) -o \$@ $LDEXECFLAGS main.o \$(LIBWINE) \$(LIBPORT) \$(EXTRALIBS) \$(LDFLAGS) \$(LDRPATH_LOCAL) - -wine-installed: main.o - \$(CC) -o \$@ $LDEXECFLAGS main.o \$(LIBWINE) \$(LIBPORT) \$(EXTRALIBS) \$(LDFLAGS) \$(LDRPATH_INSTALL) -" ;; *) @@ -8413,7 +8416,7 @@ $as_echo "$ac_cv_c_dll_gnuelf" >&6; } if test "$ac_cv_c_dll_gnuelf" = "yes" then - LDSHARED="\$(CC) -shared" + LIBWINE_LDFLAGS="-shared" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fPIC -shared -Wl,-soname,confest.so.1" >&5 $as_echo_n "checking whether the compiler supports -fPIC -shared -Wl,-soname,confest.so.1... " >&6; } if ${ac_cv_cflags__fPIC__shared__Wl__soname_confest_so_1+:} false; then : @@ -8437,7 +8440,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fPIC__shared__Wl__soname_confest_so_1" >&5 $as_echo "$ac_cv_cflags__fPIC__shared__Wl__soname_confest_so_1" >&6; } if test "x$ac_cv_cflags__fPIC__shared__Wl__soname_confest_so_1" = xyes; then : - LDSHARED="\$(CC) -shared -Wl,-soname,libwine.so.$libwine_soversion" + LIBWINE_LDFLAGS="-shared -Wl,-soname,libwine.so.$libwine_soversion" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fPIC -shared -Wl,-h,confest.so.1" >&5 $as_echo_n "checking whether the compiler supports -fPIC -shared -Wl,-h,confest.so.1... " >&6; } @@ -8462,7 +8465,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fPIC__shared__Wl__h_confest_so_1" >&5 $as_echo "$ac_cv_cflags__fPIC__shared__Wl__h_confest_so_1" >&6; } if test "x$ac_cv_cflags__fPIC__shared__Wl__h_confest_so_1" = xyes; then : - LDSHARED="\$(CC) -shared -Wl,-h,libwine.so.$libwine_soversion" + LIBWINE_LDFLAGS="-shared -Wl,-h,libwine.so.$libwine_soversion" fi fi @@ -8490,7 +8493,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cflags__fPIC__shared__Wl___version_script_conftest_map" >&5 $as_echo "$ac_cv_cflags__fPIC__shared__Wl___version_script_conftest_map" >&6; } if test "x$ac_cv_cflags__fPIC__shared__Wl___version_script_conftest_map" = xyes; then : - LDSHARED="$LDSHARED -Wl,--version-script=\$(srcdir)/wine.map" + LIBWINE_LDFLAGS="$LIBWINE_LDFLAGS -Wl,--version-script=\$(srcdir)/wine.map" fi rm -f conftest.map @@ -8545,7 +8548,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - LDRPATH_INSTALL="-Wl,--rpath,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \$(bindir) \$(libdir)\`" + LDRPATH_INSTALL="-Wl,--rpath,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`" LDRPATH_LOCAL="-Wl,--rpath,\\\$\$ORIGIN/\$(top_builddir)/libs/wine" else as_ac_var=`$as_echo "ac_cv_cflags_-fPIC -Wl,-R,\\$ORIGIN/../lib" | $as_tr_sh` @@ -8573,7 +8576,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - LDRPATH_INSTALL="-Wl,-R,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \$(bindir) \$(libdir)\`" + LDRPATH_INSTALL="-Wl,-R,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`" LDRPATH_LOCAL="-Wl,-R,\\\$\$ORIGIN/\$(top_builddir)/libs/wine" fi fi @@ -8635,7 +8638,32 @@ esac fi - # Extract the first word of "prelink", so it can be a program name with args. + { $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,-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__Ttext_segment_0x7bc00000=yes +else + 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__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. 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; } @@ -8676,10 +8704,11 @@ fi - if test "x$PRELINK" = xfalse - then - as_fn_append wine_warnings "|prelink not found, base address of core dlls won't be set correctly." - fi + if test "x$PRELINK" = xfalse + then + 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 ;; esac @@ -8708,50 +8737,20 @@ $as_echo "$ac_cv_c_dll_unixware" >&6; } if test "$ac_cv_c_dll_unixware" = "yes" then - LDSHARED="\$(CC) -Wl,-G,-h,libwine.so.$libwine_soversion" + LIBWINE_LDFLAGS="-Wl,-G,-h,libwine.so.$libwine_soversion" fi fi - libwine_targets="libwine.so libwine.so.$libwine_soversion libwine.so.$libwine_version" - LIBWINE_RULES=" -OBJS = \$(C_SRCS:.c=.o) \$(EXTRA_OBJS) - -all: libwine.so - -libwine.so.$libwine_version: \$(OBJS) \$(srcdir)/wine.map - $LDSHARED \$(OBJS) \$(EXTRALIBS) \$(LDFLAGS) \$(LIBS) -o \$@ + LIBWINE_SHAREDLIB="libwine.so.$libwine_version" -libwine.so.$libwine_soversion: libwine.so.$libwine_version - \$(RM) \$@ && \$(LN_S) libwine.so.$libwine_version \$@ + LIBWINE_INSTALL_LIB="libwine.so.$libwine_version libwine.so.$libwine_soversion" -libwine.so: libwine.so.$libwine_soversion - \$(RM) \$@ && \$(LN_S) libwine.so.$libwine_soversion \$@ + LIBWINE_INSTALL_DEV="libwine.so" -install install-lib:: libwine.so.$libwine_version - \$(INSTALL_PROGRAM) libwine.so.$libwine_version \$(DESTDIR)\$(libdir)/libwine.so.$libwine_version - cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.so.$libwine_soversion && \$(LN_S) libwine.so.$libwine_version libwine.so.$libwine_soversion + LIBWINE_DEPENDS="wine.map" -install install-dev:: - cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.so && \$(LN_S) libwine.so.$libwine_version libwine.so - -uninstall:: - -cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.so libwine.so.$libwine_soversion libwine.so.$libwine_version -" - - - as_fn_append LOADER_RULES " -$wine_binary: main.o - \$(CC) -o \$@ $LDEXECFLAGS main.o \$(LIBWINE) \$(LIBPORT) \$(EXTRALIBS) \$(LDFLAGS) \$(LDRPATH_LOCAL) - -wine-installed: main.o - \$(CC) -o \$@ $LDEXECFLAGS main.o \$(LIBWINE) \$(LIBPORT) \$(EXTRALIBS) \$(LDFLAGS) \$(LDRPATH_INSTALL) -" ;; esac -as_fn_append LIBWINE_RULES " -EXTRA_TARGETS = $libwine_targets -" - enable_wineqtdecoder=${enable_wineqtdecoder:-no} enable_winemac_drv=${enable_winemac_drv:-no} @@ -10872,7 +10871,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcap_pcap_create" >&5 $as_echo "$ac_cv_lib_pcap_pcap_create" >&6; } if test "x$ac_cv_lib_pcap_pcap_create" = xyes; then : - LIBPCAP="-lpcap" + PCAP_LIBS="-lpcap" fi @@ -12500,6 +12499,94 @@ fi fi +if test "x$with_pulse" != "xno"; +then + if ${PULSE_CFLAGS:+false} :; then : + if ${PKG_CONFIG+:} false; then : + PULSE_CFLAGS=`$PKG_CONFIG --cflags libpulse 2>/dev/null` +fi +fi + +if ${PULSE_LIBS:+false} :; then : + if ${PKG_CONFIG+:} false; then : + PULSE_LIBS=`$PKG_CONFIG --libs libpulse 2>/dev/null` +fi +fi + + +$as_echo "$as_me:${as_lineno-$LINENO}: libpulse cflags: $PULSE_CFLAGS" >&5 +$as_echo "$as_me:${as_lineno-$LINENO}: libpulse libs: $PULSE_LIBS" >&5 +ac_save_CPPFLAGS=$CPPFLAGS +CPPFLAGS="$CPPFLAGS $PULSE_CFLAGS" +for ac_header in pulse/pulseaudio.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "pulse/pulseaudio.h" "ac_cv_header_pulse_pulseaudio_h" "$ac_includes_default" +if test "x$ac_cv_header_pulse_pulseaudio_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PULSE_PULSEAUDIO_H 1 +_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pa_stream_is_corked in -lpulse" >&5 +$as_echo_n "checking for pa_stream_is_corked in -lpulse... " >&6; } +if ${ac_cv_lib_pulse_pa_stream_is_corked+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpulse $PULSE_LIBS $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pa_stream_is_corked (); +int +main () +{ +return pa_stream_is_corked (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pulse_pa_stream_is_corked=yes +else + ac_cv_lib_pulse_pa_stream_is_corked=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pulse_pa_stream_is_corked" >&5 +$as_echo "$ac_cv_lib_pulse_pa_stream_is_corked" >&6; } +if test "x$ac_cv_lib_pulse_pa_stream_is_corked" = xyes; then : + : +else + PULSE_LIBS="" +fi + +else + PULSE_LIBS="" +fi + +done + +CPPFLAGS=$ac_save_CPPFLAGS +test -z "$PULSE_CFLAGS" || PULSE_CFLAGS=`echo " $PULSE_CFLAGS" | sed 's/ -I\([^/]\)/ -I\$(top_builddir)\/\1/g'` +test -z "$PULSE_LIBS" || PULSE_LIBS=`echo " $PULSE_LIBS" | sed 's/ -L\([^/]\)/ -L\$(top_builddir)\/\1/g'` + +fi +if test -z "$PULSE_LIBS"; then : + case "x$with_pulse" in + x) as_fn_append wine_notices "|libpulse ${notice_platform}development files not found or too old, Pulse won't be supported." ;; + xno) ;; + *) as_fn_error $? "libpulse ${notice_platform}development files not found or too old, Pulse won't be supported. +This is an error since --with-pulse was requested." "$LINENO" 5 ;; +esac +fi + if test "x$with_gstreamer" != "xno" then if ${GSTREAMER_CFLAGS:+false} :; then : @@ -13332,19 +13419,19 @@ then if ${TIFF_CFLAGS:+false} :; then : if ${PKG_CONFIG+:} false; then : - TIFF_CFLAGS=`$PKG_CONFIG --cflags libtiff 2>/dev/null` + TIFF_CFLAGS=`$PKG_CONFIG --cflags libtiff-4 2>/dev/null` fi fi if ${TIFF_LIBS:+false} :; then : if ${PKG_CONFIG+:} false; then : - TIFF_LIBS=`$PKG_CONFIG --libs libtiff 2>/dev/null` + TIFF_LIBS=`$PKG_CONFIG --libs libtiff-4 2>/dev/null` fi fi -$as_echo "$as_me:${as_lineno-$LINENO}: libtiff cflags: $TIFF_CFLAGS" >&5 -$as_echo "$as_me:${as_lineno-$LINENO}: libtiff libs: $TIFF_LIBS" >&5 +$as_echo "$as_me:${as_lineno-$LINENO}: libtiff-4 cflags: $TIFF_CFLAGS" >&5 +$as_echo "$as_me:${as_lineno-$LINENO}: libtiff-4 libs: $TIFF_LIBS" >&5 ac_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS $TIFF_CFLAGS" for ac_header in tiffio.h @@ -13588,14 +13675,49 @@ fi if test "x$ac_cv_lib_openal" != xyes; then : case "x$with_openal" in - x) as_fn_append wine_notices "|libopenal ${notice_platform}development files not found (or too old), OpenAL won't be supported." ;; + x) as_fn_append wine_notices "|libopenal ${notice_platform}development files not found (or too old), OpenAL won't be supported" ;; xno) ;; - *) as_fn_error $? "libopenal ${notice_platform}development files not found (or too old), OpenAL won't be supported. + *) as_fn_error $? "libopenal ${notice_platform}development files not found (or too old), OpenAL won't be supported This is an error since --with-openal was requested." "$LINENO" 5 ;; esac fi test "x$ac_cv_lib_openal" = xyes || enable_openal32=${enable_openal32:-no} +if test "x$ac_cv_lib_openal" = xyes +then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openal-soft" >&5 +$as_echo_n "checking for openal-soft... " >&6; } +if ${ac_cv_have_openalsoft+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +LPALCRENDERSAMPLESSOFT x; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_have_openalsoft=yes +else + ac_cv_have_openalsoft=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_openalsoft" >&5 +$as_echo "$ac_cv_have_openalsoft" >&6; } +fi +if test "x$ac_cv_have_openalsoft" != xyes +then + as_fn_append wine_notices "|openal-soft ${notice_platform}development files not found (or too old), XAudio2 won't be supported" + enable_xaudio2_7=${enable_xaudio2_7:-no} +fi + if test "$ac_cv_header_kstat_h" = "yes" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kstat_open in -lkstat" >&5 @@ -13811,12 +13933,13 @@ test -n "$ALSA_LIBS" || enable_winealsa_drv=${enable_winealsa_drv:-no} test -n "$COREAUDIO_LIBS" || enable_winecoreaudio_drv=${enable_winecoreaudio_drv:-no} +test -n "$PULSE_LIBS" || enable_winepulse_drv=${enable_winepulse_drv:-no} test "x$ac_cv_member_oss_sysinfo_numaudioengines" = xyes || enable_wineoss_drv=${enable_wineoss_drv:-no} test "$ac_cv_header_linux_joystick_h" = "yes" -o "$ac_cv_header_IOKit_hid_IOHIDLib_h" = "yes" || enable_winejoystick_drv=${enable_winejoystick_drv:-no} -if test "x$ALSA_LIBS$COREAUDIO_LIBS" = "x" -a \ +if test "x$ALSA_LIBS$COREAUDIO_LIBS$PULSE_LIBS" = "x" -a \ "x$ac_cv_member_oss_sysinfo_numaudioengines" != xyes -a \ - "x$with_alsa$with_coreaudio$with_oss" != xnonono + "x$with_alsa$with_coreaudio$with_oss$with_pulse" != xnononono then as_fn_append wine_warnings "|No sound system was found. Windows applications will be silent." fi @@ -13921,6 +14044,32 @@ if test "x$ac_cv_cflags__fno_strict_aliasing" = xyes; then : EXTRACFLAGS="$EXTRACFLAGS -fno-strict-aliasing" fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -fexcess-precision=standard" >&5 +$as_echo_n "checking whether the compiler supports -fexcess-precision=standard... " >&6; } +if ${ac_cv_cflags__fexcess_precision_standard+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_wine_try_cflags_saved=$CFLAGS +CFLAGS="$CFLAGS -fexcess-precision=standard" +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__fexcess_precision_standard=yes +else + ac_cv_cflags__fexcess_precision_standard=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__fexcess_precision_standard" >&5 +$as_echo "$ac_cv_cflags__fexcess_precision_standard" >&6; } +if test "x$ac_cv_cflags__fexcess_precision_standard" = xyes; then : + EXCESS_PRECISION_CFLAGS="-fexcess-precision=standard" + +fi saved_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking whether the compiler supports -Werror=unknown-warning-option... " >&6; } @@ -14022,6 +14171,31 @@ if test "x$ac_cv_cflags__Wignored_qualifiers" = xyes; then : EXTRACFLAGS="$EXTRACFLAGS -Wignored-qualifiers" fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wshift-overflow=2" >&5 +$as_echo_n "checking whether the compiler supports -Wshift-overflow=2... " >&6; } +if ${ac_cv_cflags__Wshift_overflow_2+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_wine_try_cflags_saved=$CFLAGS +CFLAGS="$CFLAGS -Wshift-overflow=2" +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__Wshift_overflow_2=yes +else + ac_cv_cflags__Wshift_overflow_2=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__Wshift_overflow_2" >&5 +$as_echo "$ac_cv_cflags__Wshift_overflow_2" >&6; } +if test "x$ac_cv_cflags__Wshift_overflow_2" = xyes; then : + EXTRACFLAGS="$EXTRACFLAGS -Wshift-overflow=2" +fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wstrict-prototypes" >&5 $as_echo_n "checking whether the compiler supports -Wstrict-prototypes... " >&6; } if ${ac_cv_cflags__Wstrict_prototypes+:} false; then : @@ -14450,7 +14624,7 @@ int main () { -#if defined(__USE_FORTIFY_LEVEL) && __USE_FORTIFY_LEVEL > 0 +#if (defined(__USE_FORTIFY_LEVEL) && __USE_FORTIFY_LEVEL > 0) || (defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0) #error Fortify enabled #endif ; @@ -14773,25 +14947,11 @@ case $host_cpu in *i[3456789]86*|x86_64*) test "$wine_binary" = wine || wine_fn_ignore_file "loader/wine-preloader" - loader_programs="$loader_programs $wine_binary-preloader" - as_fn_append LOADER_RULES " -$wine_binary-preloader: preloader.o - \$(CC) -o \$@ -static -nostartfiles -nodefaultlibs -Wl,-Ttext=0x7c400000 preloader.o \$(LIBPORT) \$(LDFLAGS) - -install install-lib:: $wine_binary-preloader - \$(INSTALL_PROGRAM) $wine_binary-preloader \$(DESTDIR)\$(bindir)/$wine_binary-preloader - -uninstall:: - \$(RM) \$(DESTDIR)\$(bindir)/$wine_binary-preloader - -preloader_EXTRADEFS = $BUILTINFLAG -" ;; + WINELOADER_PROGRAMS="$WINELOADER_PROGRAMS $wine_binary-preloader" + ;; esac ;; esac -as_fn_append LOADER_RULES " -PROGRAMS = $loader_programs -" ac_save_CFLAGS="$CFLAGS" @@ -16997,6 +17157,7 @@ X_PRE_LIBS = $X_PRE_LIBS X_LIBS = $X_LIBS X_EXTRA_LIBS = $X_EXTRA_LIBS +PCAP_LIBS = $PCAP_LIBS XML2_CFLAGS = $XML2_CFLAGS XML2_LIBS = $XML2_LIBS XSLT_CFLAGS = $XSLT_CFLAGS @@ -17020,6 +17181,8 @@ FREETYPE_LIBS = $FREETYPE_LIBS Z_LIBS = $Z_LIBS GETTEXTPO_LIBS = $GETTEXTPO_LIBS +PULSE_CFLAGS = $PULSE_CFLAGS +PULSE_LIBS = $PULSE_LIBS GSTREAMER_CFLAGS = $GSTREAMER_CFLAGS GSTREAMER_LIBS = $GSTREAMER_LIBS ALSA_LIBS = $ALSA_LIBS @@ -17039,6 +17202,7 @@ MPG123_LIBS = $MPG123_LIBS KSTAT_LIBS = $KSTAT_LIBS PROCSTAT_LIBS = $PROCSTAT_LIBS +EXCESS_PRECISION_CFLAGS = $EXCESS_PRECISION_CFLAGS DL_LIBS = $DL_LIBS POLL_LIBS = $POLL_LIBS RT_LIBS = $RT_LIBS @@ -17055,7 +17219,7 @@ .INIT: Makefile .MAKEFILEDEPS: all: Makefile -Makefile: $srcdir/Makefile.in $srcdir/Make.vars.in config.status \$(MAKEDEP) +Makefile: $srcdir/Makefile.in config.status \$(MAKEDEP) @./config.status Make.tmp Makefile" test "$srcdir" = . && wine_fn_append_rule "all: .gitignore @@ -17070,7 +17234,8 @@ ac_config_links="$ac_config_links fonts/symbol.ttf:fonts/symbol.ttf" ac_config_links="$ac_config_links fonts/tahoma.ttf:fonts/tahoma.ttf" ac_config_links="$ac_config_links fonts/tahomabd.ttf:fonts/tahomabd.ttf" -test "$srcdir" = "." || wine_fn_config_symlink fonts/marlett.ttf fonts/symbol.ttf fonts/tahoma.ttf fonts/tahomabd.ttf +ac_config_links="$ac_config_links fonts/wingding.ttf:fonts/wingding.ttf" +test "$srcdir" = "." || wine_fn_config_symlink fonts/marlett.ttf fonts/symbol.ttf fonts/tahoma.ttf fonts/tahomabd.ttf fonts/wingding.ttf fi ac_config_links="$ac_config_links loader/l_intl.nls:loader/l_intl.nls" test "$srcdir" = "." || wine_fn_config_symlink loader/l_intl.nls @@ -17154,6 +17319,21 @@ wine_fn_config_dll api-ms-win-core-winrt-l1-1-0 enable_api_ms_win_core_winrt_l1_1_0 wine_fn_config_dll api-ms-win-core-winrt-string-l1-1-0 enable_api_ms_win_core_winrt_string_l1_1_0 wine_fn_config_dll api-ms-win-core-xstate-l2-1-0 enable_api_ms_win_core_xstate_l2_1_0 +wine_fn_config_dll api-ms-win-crt-conio-l1-1-0 enable_api_ms_win_crt_conio_l1_1_0 +wine_fn_config_dll api-ms-win-crt-convert-l1-1-0 enable_api_ms_win_crt_convert_l1_1_0 +wine_fn_config_dll api-ms-win-crt-environment-l1-1-0 enable_api_ms_win_crt_environment_l1_1_0 +wine_fn_config_dll api-ms-win-crt-filesystem-l1-1-0 enable_api_ms_win_crt_filesystem_l1_1_0 +wine_fn_config_dll api-ms-win-crt-heap-l1-1-0 enable_api_ms_win_crt_heap_l1_1_0 +wine_fn_config_dll api-ms-win-crt-locale-l1-1-0 enable_api_ms_win_crt_locale_l1_1_0 +wine_fn_config_dll api-ms-win-crt-math-l1-1-0 enable_api_ms_win_crt_math_l1_1_0 +wine_fn_config_dll api-ms-win-crt-multibyte-l1-1-0 enable_api_ms_win_crt_multibyte_l1_1_0 +wine_fn_config_dll api-ms-win-crt-private-l1-1-0 enable_api_ms_win_crt_private_l1_1_0 +wine_fn_config_dll api-ms-win-crt-process-l1-1-0 enable_api_ms_win_crt_process_l1_1_0 +wine_fn_config_dll api-ms-win-crt-runtime-l1-1-0 enable_api_ms_win_crt_runtime_l1_1_0 +wine_fn_config_dll api-ms-win-crt-stdio-l1-1-0 enable_api_ms_win_crt_stdio_l1_1_0 +wine_fn_config_dll api-ms-win-crt-string-l1-1-0 enable_api_ms_win_crt_string_l1_1_0 +wine_fn_config_dll api-ms-win-crt-time-l1-1-0 enable_api_ms_win_crt_time_l1_1_0 +wine_fn_config_dll api-ms-win-crt-utility-l1-1-0 enable_api_ms_win_crt_utility_l1_1_0 wine_fn_config_dll api-ms-win-downlevel-advapi32-l1-1-0 enable_api_ms_win_downlevel_advapi32_l1_1_0 wine_fn_config_dll api-ms-win-downlevel-advapi32-l2-1-0 enable_api_ms_win_downlevel_advapi32_l2_1_0 wine_fn_config_dll api-ms-win-downlevel-normaliz-l1-1-0 enable_api_ms_win_downlevel_normaliz_l1_1_0 @@ -17190,8 +17370,10 @@ wine_fn_config_dll avrt enable_avrt implib wine_fn_config_dll bcrypt enable_bcrypt wine_fn_config_test dlls/bcrypt/tests bcrypt_test +wine_fn_config_dll bluetoothapis enable_bluetoothapis wine_fn_config_dll browseui enable_browseui clean,po wine_fn_config_test dlls/browseui/tests browseui_test +wine_fn_config_dll bthprops.cpl enable_bthprops_cpl wine_fn_config_dll cabinet enable_cabinet implib wine_fn_config_test dlls/cabinet/tests cabinet_test wine_fn_config_dll capi2032 enable_capi2032 implib @@ -17233,9 +17415,11 @@ wine_fn_config_dll d3d10 enable_d3d10 implib wine_fn_config_test dlls/d3d10/tests d3d10_test wine_fn_config_dll d3d10_1 enable_d3d10_1 implib +wine_fn_config_test dlls/d3d10_1/tests d3d10_1_test wine_fn_config_dll d3d10core enable_d3d10core implib wine_fn_config_test dlls/d3d10core/tests d3d10core_test wine_fn_config_dll d3d11 enable_d3d11 implib +wine_fn_config_test dlls/d3d11/tests d3d11_test wine_fn_config_dll d3d8 enable_d3d8 implib wine_fn_config_test dlls/d3d8/tests d3d8_test wine_fn_config_dll d3d9 enable_d3d9 implib @@ -17362,6 +17546,7 @@ wine_fn_config_test dlls/dxgi/tests dxgi_test wine_fn_config_lib dxguid wine_fn_config_dll dxva2 enable_dxva2 +wine_fn_config_dll esent enable_esent wine_fn_config_dll evr enable_evr wine_fn_config_dll explorerframe enable_explorerframe clean wine_fn_config_test dlls/explorerframe/tests explorerframe_test @@ -17369,6 +17554,7 @@ wine_fn_config_dll faultrep enable_faultrep implib wine_fn_config_test dlls/faultrep/tests faultrep_test wine_fn_config_dll fltlib enable_fltlib +wine_fn_config_dll fltmgr.sys enable_fltmgr_sys wine_fn_config_dll fntcache enable_fntcache wine_fn_config_dll fontsub enable_fontsub wine_fn_config_dll fusion enable_fusion @@ -17478,6 +17664,7 @@ wine_fn_config_test dlls/msctf/tests msctf_test wine_fn_config_dll msctfp enable_msctfp clean wine_fn_config_dll msdaps enable_msdaps clean +wine_fn_config_dll msdelta enable_msdelta wine_fn_config_dll msdmo enable_msdmo implib wine_fn_config_test dlls/msdmo/tests msdmo_test wine_fn_config_dll msftedit enable_msftedit @@ -17511,6 +17698,7 @@ wine_fn_config_dll msvcp100 enable_msvcp100 wine_fn_config_test dlls/msvcp100/tests msvcp100_test wine_fn_config_dll msvcp110 enable_msvcp110 +wine_fn_config_test dlls/msvcp110/tests msvcp110_test wine_fn_config_dll msvcp120 enable_msvcp120 wine_fn_config_test dlls/msvcp120/tests msvcp120_test wine_fn_config_dll msvcp120_app enable_msvcp120_app @@ -17702,6 +17890,8 @@ wine_fn_config_dll twain_32 enable_twain_32 wine_fn_config_test dlls/twain_32/tests twain_32_test wine_fn_config_dll typelib.dll16 enable_win16 +wine_fn_config_dll ucrtbase enable_ucrtbase +wine_fn_config_test dlls/ucrtbase/tests ucrtbase_test wine_fn_config_dll unicows enable_unicows implib wine_fn_config_dll updspapi enable_updspapi wine_fn_config_dll url enable_url implib @@ -17724,7 +17914,9 @@ wine_fn_config_test dlls/vcomp/tests vcomp_test wine_fn_config_dll vcomp100 enable_vcomp100 wine_fn_config_dll vcomp110 enable_vcomp110 +wine_fn_config_dll vcomp120 enable_vcomp120 wine_fn_config_dll vcomp90 enable_vcomp90 +wine_fn_config_dll vcruntime140 enable_vcruntime140 wine_fn_config_dll vdhcp.vxd enable_win16 wine_fn_config_dll vdmdbg enable_vdmdbg implib wine_fn_config_dll ver.dll16 enable_win16 @@ -17743,10 +17935,13 @@ wine_fn_config_dll wbemprox enable_wbemprox clean wine_fn_config_test dlls/wbemprox/tests wbemprox_test wine_fn_config_dll webservices enable_webservices implib +wine_fn_config_test dlls/webservices/tests webservices_test wine_fn_config_dll wer enable_wer implib wine_fn_config_test dlls/wer/tests wer_test wine_fn_config_dll wevtapi enable_wevtapi wine_fn_config_dll wiaservc enable_wiaservc clean +wine_fn_config_test dlls/wiaservc/tests wiaservc_test +wine_fn_config_dll wimgapi enable_wimgapi wine_fn_config_dll win32s16.dll16 enable_win16 wine_fn_config_dll win87em.dll16 enable_win16 wine_fn_config_dll winaspi.dll16 enable_win16 @@ -17767,6 +17962,7 @@ wine_fn_config_dll wineoss.drv enable_wineoss_drv wine_fn_config_dll wineps.drv enable_wineps_drv clean,po wine_fn_config_dll wineps16.drv16 enable_win16 +wine_fn_config_dll winepulse.drv enable_winepulse_drv wine_fn_config_dll wineqtdecoder enable_wineqtdecoder wine_fn_config_dll winex11.drv enable_winex11_drv wine_fn_config_dll wing.dll16 enable_win16 @@ -17812,6 +18008,7 @@ wine_fn_config_test dlls/wtsapi32/tests wtsapi32_test wine_fn_config_dll wuapi enable_wuapi clean wine_fn_config_dll wuaueng enable_wuaueng +wine_fn_config_dll x3daudio1_0 enable_x3daudio1_0 wine_fn_config_dll x3daudio1_1 enable_x3daudio1_1 wine_fn_config_dll x3daudio1_2 enable_x3daudio1_2 wine_fn_config_dll x3daudio1_3 enable_x3daudio1_3 @@ -17820,11 +18017,20 @@ wine_fn_config_dll x3daudio1_6 enable_x3daudio1_6 wine_fn_config_dll x3daudio1_7 enable_x3daudio1_7 wine_fn_config_dll xapofx1_1 enable_xapofx1_1 +wine_fn_config_dll xapofx1_2 enable_xapofx1_2 wine_fn_config_dll xapofx1_3 enable_xapofx1_3 wine_fn_config_dll xapofx1_4 enable_xapofx1_4 wine_fn_config_dll xapofx1_5 enable_xapofx1_5 +wine_fn_config_dll xaudio2_0 enable_xaudio2_0 clean +wine_fn_config_dll xaudio2_1 enable_xaudio2_1 clean +wine_fn_config_dll xaudio2_2 enable_xaudio2_2 clean +wine_fn_config_dll xaudio2_3 enable_xaudio2_3 clean +wine_fn_config_dll xaudio2_4 enable_xaudio2_4 clean +wine_fn_config_dll xaudio2_5 enable_xaudio2_5 clean +wine_fn_config_dll xaudio2_6 enable_xaudio2_6 clean wine_fn_config_dll xaudio2_7 enable_xaudio2_7 clean -wine_fn_config_dll xaudio2_8 enable_xaudio2_8 +wine_fn_config_test dlls/xaudio2_7/tests xaudio2_7_test +wine_fn_config_dll xaudio2_8 enable_xaudio2_8 implib wine_fn_config_dll xinput1_1 enable_xinput1_1 wine_fn_config_dll xinput1_2 enable_xinput1_2 wine_fn_config_dll xinput1_3 enable_xinput1_3 implib xinput @@ -17836,13 +18042,12 @@ wine_fn_config_dll xolehlp enable_xolehlp wine_fn_config_dll xpsprint enable_xpsprint wine_fn_config_dll xpssvcs enable_xpssvcs -wine_fn_config_makefile documentation enable_documentation clean wine_fn_config_makefile fonts enable_fonts clean,install-lib wine_fn_config_makefile include enable_include clean,install-dev wine_fn_config_makefile libs/port enable_libs_port -wine_fn_config_makefile libs/wine enable_libs_wine clean,install-dev,install-lib +wine_fn_config_makefile libs/wine enable_libs_wine clean,implib,install-dev,install-lib wine_fn_config_makefile libs/wpp enable_libs_wpp -wine_fn_config_makefile loader enable_loader clean,install-lib,manpage +wine_fn_config_makefile loader enable_loader clean,install-lib wine_fn_config_program arp enable_arp install wine_fn_config_program aspnet_regiis enable_aspnet_regiis install wine_fn_config_program attrib enable_attrib install,po @@ -17927,6 +18132,7 @@ wine_fn_config_program winoldap.mod16 enable_win16 install wine_fn_config_program winver enable_winver install wine_fn_config_program wmic enable_wmic install,po +wine_fn_config_program wmplayer enable_wmplayer install wine_fn_config_program wordpad enable_wordpad install,po wine_fn_config_program write enable_write install,po wine_fn_config_program wscript enable_wscript clean,install @@ -17934,15 +18140,16 @@ wine_fn_config_program wusa enable_wusa install wine_fn_config_program xcopy enable_xcopy install,po wine_fn_config_test programs/xcopy/tests xcopy.exe_test -wine_fn_config_makefile server enable_server clean,install-lib,manpage -wine_fn_config_tool tools clean,install-dev,install-lib,manpage +wine_fn_config_makefile server enable_server clean,install-lib +wine_fn_config_tool tools clean wine_fn_config_tool tools/sfnt2fon clean -wine_fn_config_tool tools/widl clean,install-dev,manpage -wine_fn_config_tool tools/winebuild clean,install-dev,manpage -wine_fn_config_tool tools/winedump clean,install-dev,manpage -wine_fn_config_tool tools/winegcc clean,install-dev,manpage -wine_fn_config_tool tools/wmc clean,install-dev,manpage -wine_fn_config_tool tools/wrc clean,install-dev,manpage +wine_fn_config_tool tools/widl clean,install-dev +wine_fn_config_tool tools/winebuild clean,install-dev +wine_fn_config_tool tools/winedump clean,install-dev +wine_fn_config_tool tools/winegcc clean,install-dev +wine_fn_config_tool tools/winemaker clean,install-dev +wine_fn_config_tool tools/wmc clean,install-dev +wine_fn_config_tool tools/wrc clean,install-dev LINGUAS="\ ar \ @@ -18017,7 +18224,7 @@ ac_config_commands="$ac_config_commands Makefile" -ac_config_files="$ac_config_files Make.tmp:Make.vars.in:Makefile.in" +ac_config_files="$ac_config_files Make.tmp:Makefile.in" @@ -18083,14 +18290,19 @@ clean:: \$(RM) fonts server tools $with_wine64/loader/wine $with_wine64/loader/wine-preloader" else - as_fn_append LOADER_RULES " -install install-lib:: wine.inf install-man-pages - \$(INSTALL_DATA) wine.inf \$(DESTDIR)\$(datadir)/wine/wine.inf - \$(INSTALL_DATA) \$(srcdir)/l_intl.nls \$(DESTDIR)\$(datadir)/wine/l_intl.nls + WINELOADER_INSTALL="wine.inf" + wine_fn_append_rule "install install-lib:: + \$(INSTALL_DATA) $srcdir/loader/l_intl.nls \$(DESTDIR)\$(datadir)/wine/l_intl.nls uninstall:: - \$(RM) \$(DESTDIR)\$(datadir)/wine/wine.inf \$(DESTDIR)\$(datadir)/wine/l_intl.nls -" + \$(RM) \$(DESTDIR)\$(datadir)/wine/l_intl.nls" + case $host_os in + cygwin*|mingw32*|darwin*|macosx*|linux-android*) ;; + *) wine_fn_append_rule "install install-lib:: + \$(INSTALL_DATA) $srcdir/loader/wine.desktop \$(DESTDIR)\$(datadir)/applications/wine.desktop +uninstall:: + \$(RM) \$(DESTDIR)\$(datadir)/applications/wine.desktop" ;; + esac fi if test "$srcdir" = . @@ -18606,7 +18818,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Wine $as_me 1.7.50, which was +This file was extended by Wine $as_me 1.7.55, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -18677,7 +18889,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -Wine config.status 1.7.50 +Wine config.status 1.7.55 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -18827,13 +19039,14 @@ "fonts/symbol.ttf") CONFIG_LINKS="$CONFIG_LINKS fonts/symbol.ttf:fonts/symbol.ttf" ;; "fonts/tahoma.ttf") CONFIG_LINKS="$CONFIG_LINKS fonts/tahoma.ttf:fonts/tahoma.ttf" ;; "fonts/tahomabd.ttf") CONFIG_LINKS="$CONFIG_LINKS fonts/tahomabd.ttf:fonts/tahomabd.ttf" ;; + "fonts/wingding.ttf") CONFIG_LINKS="$CONFIG_LINKS fonts/wingding.ttf:fonts/wingding.ttf" ;; "loader/l_intl.nls") CONFIG_LINKS="$CONFIG_LINKS loader/l_intl.nls:loader/l_intl.nls" ;; "po/LINGUAS") CONFIG_LINKS="$CONFIG_LINKS po/LINGUAS:po/LINGUAS" ;; "wine") CONFIG_LINKS="$CONFIG_LINKS wine:tools/winewrapper" ;; "wine64") CONFIG_LINKS="$CONFIG_LINKS wine64:tools/winewrapper" ;; "tools/makedep") CONFIG_COMMANDS="$CONFIG_COMMANDS tools/makedep" ;; "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;; - "Make.tmp") CONFIG_FILES="$CONFIG_FILES Make.tmp:Make.vars.in:Makefile.in" ;; + "Make.tmp") CONFIG_FILES="$CONFIG_FILES Make.tmp:Makefile.in" ;; ".gitignore") CONFIG_COMMANDS="$CONFIG_COMMANDS .gitignore" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; @@ -19466,7 +19679,7 @@ fi ac_save_IFS="$IFS" -if test "x$wine_notices != "x; then +if test "x$wine_notices" != x; then echo >&6 IFS="|" for msg in $wine_notices; do diff -Nru wine1.7-1.7.50/configure.ac wine1.7-1.7.55/configure.ac --- wine1.7-1.7.50/configure.ac 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/configure.ac 2015-11-13 14:32:40.000000000 +0000 @@ -72,6 +72,7 @@ AC_ARG_WITH(png, AS_HELP_STRING([--without-png],[do not use PNG])) AC_ARG_WITH(pthread, AS_HELP_STRING([--without-pthread],[do not use the pthread library]), [if test "x$withval" = "xno"; then ac_cv_header_pthread_h=no; fi]) +AC_ARG_WITH(pulse, AS_HELP_STRING([--without-pulse],[do not use PulseAudio sound support])) AC_ARG_WITH(sane, AS_HELP_STRING([--without-sane],[do not use SANE (scanner support)])) AC_ARG_WITH(tiff, AS_HELP_STRING([--without-tiff],[do not use TIFF])) AC_ARG_WITH(v4l, AS_HELP_STRING([--without-v4l],[do not use v4l1 (v4l support)])) @@ -673,10 +674,10 @@ dnl **** Check for working dll **** AC_SUBST(dlldir,"\${libdir}/wine") -AC_SUBST(DLLPREFIX,"") AC_SUBST(DLLFLAGS,"-D_REENTRANT") AC_SUBST(LDRPATH_INSTALL,"") AC_SUBST(LDRPATH_LOCAL,"") +AC_SUBST(LDEXECFLAGS,"") LIBEXT="so" DLLEXT=".so" IMPLIBEXT="def" @@ -686,19 +687,9 @@ wine_binary="wine" test "x$enable_win64" != "xyes" || wine_binary="wine64" -loader_programs="$wine_binary wine-installed" +AC_SUBST(WINELOADER_PROGRAMS,"$wine_binary") libwine_soversion=`expr $libwine_version : '\([[0-9]]*\)\..*'` -AC_SUBST(LOADER_RULES,[" -all: wine.inf - -install install-lib:: wine-installed - \$(INSTALL_PROGRAM) wine-installed \$(DESTDIR)\$(bindir)/$wine_binary - -uninstall:: - \$(RM) \$(DESTDIR)\$(bindir)/$wine_binary -"]) - case $host_os in cygwin*|mingw32*) AC_CHECK_TOOL(DLLTOOL,dlltool,false) @@ -723,38 +714,22 @@ case $host_os in mingw32*) crtlibs="-lmsvcrt" - AC_SUBST(SOCKET_LIBS,"-L\$(top_builddir)/dlls/ws2_32 -lws2_32") ;; + AC_SUBST(SOCKET_LIBS,"-lws2_32") ;; esac - libwine_targets="libwine.dll libwine.a" - AC_SUBST(LIBWINE_RULES,[" -OBJS = \$(C_SRCS:.c=.o) \$(EXTRA_OBJS) - -all: libwine.dll libwine.a - -libwine.a: \$(srcdir)/wine.def - \$(DLLTOOL) -l \$@ -d \$(srcdir)/wine.def - -libwine.dll: \$(OBJS) \$(srcdir)/wine.def - \$(CC) -shared \$(srcdir)/wine.def -o \$@ \$(OBJS) $crtlibs \$(EXTRALIBS) - -install install-lib:: libwine.dll - \$(INSTALL_DATA) libwine.dll \$(DESTDIR)\$(libdir)/libwine.dll - -install install-dev:: libwine.a - \$(INSTALL_DATA) libwine.a \$(DESTDIR)\$(libdir)/libwine.a - -uninstall:: - -cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.a libwine.dll -"]) + AC_SUBST(LIBWINE_SHAREDLIB,"libwine.dll") + AC_SUBST(LIBWINE_IMPORTLIB,"libwine.a") + AC_SUBST(LIBWINE_INSTALL_LIB,"libwine.dll") + AC_SUBST(LIBWINE_INSTALL_DEV,"libwine.a") + AC_SUBST(LIBWINE_LDFLAGS,"-shared \$(srcdir)/wine.def") + AC_SUBST(LIBWINE_DEPENDS,"wine.def") ;; darwin*|macosx*) AC_CHECK_HEADERS(libunwind.h) LIBEXT="dylib" DLLFLAGS="$DLLFLAGS -fPIC" - LIBWINE_LDFLAGS="-multiply_defined suppress" - LDRPATH_INSTALL="-Wl,-rpath,@loader_path/\`\$(MAKEDEP) -R \$(bindir) \$(libdir)\`" + LDRPATH_INSTALL="-Wl,-rpath,@loader_path/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`" LDRPATH_LOCAL="-Wl,-rpath,@loader_path/\$(top_builddir)/libs/wine" dnl declare needed frameworks AC_SUBST(COREFOUNDATION_LIBS,"-framework CoreFoundation") @@ -864,53 +839,23 @@ AC_MSG_RESULT([[cross-compiling, assuming yes]])) fi - libwine_targets="libwine.dylib libwine.$libwine_soversion.dylib libwine.$libwine_version.dylib" - AC_SUBST(LIBWINE_RULES,[" -OBJS = \$(C_SRCS:.c=.o) \$(EXTRA_OBJS) - -all: libwine.dylib - -libwine.$libwine_version.dylib: \$(OBJS) - \$(CC) -dynamiclib -install_name @rpath/libwine.$libwine_soversion.dylib -Wl,-rpath,@loader_path/ -compatibility_version $libwine_soversion -current_version $libwine_version \$(OBJS) \$(EXTRALIBS) \$(LDFLAGS) \$(LIBS) -o \$@ - -libwine.$libwine_soversion.dylib: libwine.$libwine_version.dylib - \$(RM) \$@ && \$(LN_S) libwine.$libwine_version.dylib \$@ - -libwine.dylib: libwine.$libwine_soversion.dylib - \$(RM) \$@ && \$(LN_S) libwine.$libwine_soversion.dylib \$@ - -install install-lib:: libwine.$libwine_version.dylib - \$(INSTALL_PROGRAM) libwine.$libwine_version.dylib \$(DESTDIR)\$(libdir)/libwine.$libwine_version.dylib - cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.$libwine_soversion.dylib && \$(LN_S) libwine.$libwine_version.dylib libwine.$libwine_soversion.dylib - -install install-dev:: - cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.dylib && \$(LN_S) libwine.$libwine_version.dylib libwine.dylib - -uninstall:: - -cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.dylib libwine.$libwine_soversion.dylib libwine.$libwine_version.dylib -"]) - - AS_VAR_APPEND([LOADER_RULES],[" -$wine_binary: main.o wine_info.plist - \$(CC) -o \$@ $LDEXECFLAGS main.o \$(LIBWINE) \$(LIBPORT) \$(EXTRALIBS) \$(LDFLAGS) \$(LDRPATH_LOCAL) - -wine-installed: main.o wine_info.plist - \$(CC) -o \$@ $LDEXECFLAGS main.o \$(LIBWINE) \$(LIBPORT) \$(EXTRALIBS) \$(LDFLAGS) \$(LDRPATH_INSTALL) -"]) + AC_SUBST(LIBWINE_SHAREDLIB,"libwine.$libwine_version.dylib") + AC_SUBST(LIBWINE_INSTALL_LIB,"libwine.$libwine_version.dylib libwine.$libwine_soversion.dylib") + AC_SUBST(LIBWINE_INSTALL_DEV,"libwine.dylib") + AC_SUBST(LIBWINE_LDFLAGS,["-dynamiclib -install_name @rpath/libwine.$libwine_soversion.dylib -Wl,-rpath,@loader_path/ -compatibility_version $libwine_soversion -current_version $libwine_version"]) + AC_SUBST(WINELOADER_DEPENDS,"wine_info.plist") ;; linux-android*) DLLFLAGS="$DLLFLAGS -fPIC" - DLLPREFIX="lib" - LDEXECFLAGS="" dlldir="\${libdir}" WINE_TRY_CFLAGS([-fPIC -Wl,--export-dynamic], [LDEXECFLAGS="-Wl,--export-dynamic"]) WINE_TRY_CFLAGS([-fPIC -Wl,--rpath,\$ORIGIN/../lib], - [LDRPATH_INSTALL="-Wl,--rpath,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \$(bindir) \$(libdir)\`" + [LDRPATH_INSTALL="-Wl,--rpath,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`" LDRPATH_LOCAL="-Wl,--rpath,\\\$\$ORIGIN/\$(top_builddir)/libs/wine"], [WINE_TRY_CFLAGS([-fPIC -Wl,-R,\$ORIGIN/../lib], - [LDRPATH_INSTALL="-Wl,-R,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \$(bindir) \$(libdir)\`" + [LDRPATH_INSTALL="-Wl,-R,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`" LDRPATH_LOCAL="-Wl,-R,\\\$\$ORIGIN/\$(top_builddir)/libs/wine"])]) WINE_TRY_CFLAGS([-Wl,--enable-new-dtags], @@ -923,29 +868,9 @@ ;; esac - libwine_targets="libwine.so" - AC_SUBST(LIBWINE_RULES,[" -OBJS = \$(C_SRCS:.c=.o) \$(EXTRA_OBJS) - -all: libwine.so - -libwine.so: \$(OBJS) - \$(CC) -shared \$(OBJS) \$(EXTRALIBS) \$(LDFLAGS) \$(LIBS) -o \$@ - -install install-lib:: libwine.so - \$(INSTALL_PROGRAM) libwine.so \$(DESTDIR)\$(libdir)/libwine.so - -uninstall:: - \$(RM) \$(DESTDIR)\$(libdir)/libwine.so -"]) - - AS_VAR_APPEND([LOADER_RULES],[" -$wine_binary: main.o - \$(CC) -o \$@ $LDEXECFLAGS main.o \$(LIBWINE) \$(LIBPORT) \$(EXTRALIBS) \$(LDFLAGS) \$(LDRPATH_LOCAL) - -wine-installed: main.o - \$(CC) -o \$@ $LDEXECFLAGS main.o \$(LIBWINE) \$(LIBPORT) \$(EXTRALIBS) \$(LDFLAGS) \$(LDRPATH_INSTALL) -"]) + AC_SUBST(LIBWINE_SHAREDLIB,"libwine.so") + AC_SUBST(LIBWINE_INSTALL_LIB,"libwine.so") + AC_SUBST(LIBWINE_LDFLAGS,"-shared") ;; *) @@ -956,25 +881,25 @@ ac_cv_c_dll_gnuelf="yes",ac_cv_c_dll_gnuelf="no")]) if test "$ac_cv_c_dll_gnuelf" = "yes" then - LDSHARED="\$(CC) -shared" + LIBWINE_LDFLAGS="-shared" WINE_TRY_CFLAGS([-fPIC -shared -Wl,-soname,confest.so.1], - [LDSHARED="\$(CC) -shared -Wl,-soname,libwine.so.$libwine_soversion"], + [LIBWINE_LDFLAGS="-shared -Wl,-soname,libwine.so.$libwine_soversion"], [WINE_TRY_CFLAGS([-fPIC -shared -Wl,-h,confest.so.1], - [LDSHARED="\$(CC) -shared -Wl,-h,libwine.so.$libwine_soversion"])]) + [LIBWINE_LDFLAGS="-shared -Wl,-h,libwine.so.$libwine_soversion"])]) echo '{ global: *; };' >conftest.map WINE_TRY_CFLAGS([-fPIC -shared -Wl,--version-script=conftest.map], - [LDSHARED="$LDSHARED -Wl,--version-script=\$(srcdir)/wine.map"]) + [LIBWINE_LDFLAGS="$LIBWINE_LDFLAGS -Wl,--version-script=\$(srcdir)/wine.map"]) rm -f conftest.map WINE_TRY_CFLAGS([-fPIC -Wl,--export-dynamic], [LDEXECFLAGS="-Wl,--export-dynamic"]) WINE_TRY_CFLAGS([-fPIC -Wl,--rpath,\$ORIGIN/../lib], - [LDRPATH_INSTALL="-Wl,--rpath,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \$(bindir) \$(libdir)\`" + [LDRPATH_INSTALL="-Wl,--rpath,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`" LDRPATH_LOCAL="-Wl,--rpath,\\\$\$ORIGIN/\$(top_builddir)/libs/wine"], [WINE_TRY_CFLAGS([-fPIC -Wl,-R,\$ORIGIN/../lib], - [LDRPATH_INSTALL="-Wl,-R,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \$(bindir) \$(libdir)\`" + [LDRPATH_INSTALL="-Wl,-R,\\\$\$ORIGIN/\`\$(MAKEDEP) -R \${bindir} \${libdir}\`" LDRPATH_LOCAL="-Wl,-R,\\\$\$ORIGIN/\$(top_builddir)/libs/wine"])]) WINE_TRY_CFLAGS([-Wl,--enable-new-dtags], @@ -988,11 +913,12 @@ *) LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x7bf00400" ;; esac ]) - AC_PATH_PROG(PRELINK, prelink, false, [/sbin /usr/sbin $PATH]) - if test "x$PRELINK" = xfalse - then - WINE_WARNING([prelink not found, base address of core dlls won't be set correctly.]) - fi + WINE_TRY_CFLAGS([-Wl,-Ttext-segment=0x7bc00000],[:], + [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]) ;; esac @@ -1002,49 +928,16 @@ ac_cv_c_dll_unixware="yes",ac_cv_c_dll_unixware="no")]) if test "$ac_cv_c_dll_unixware" = "yes" then - LDSHARED="\$(CC) -Wl,-G,-h,libwine.so.$libwine_soversion" + LIBWINE_LDFLAGS="-Wl,-G,-h,libwine.so.$libwine_soversion" fi fi - libwine_targets="libwine.so libwine.so.$libwine_soversion libwine.so.$libwine_version" - AC_SUBST(LIBWINE_RULES,[" -OBJS = \$(C_SRCS:.c=.o) \$(EXTRA_OBJS) - -all: libwine.so - -libwine.so.$libwine_version: \$(OBJS) \$(srcdir)/wine.map - $LDSHARED \$(OBJS) \$(EXTRALIBS) \$(LDFLAGS) \$(LIBS) -o \$@ - -libwine.so.$libwine_soversion: libwine.so.$libwine_version - \$(RM) \$@ && \$(LN_S) libwine.so.$libwine_version \$@ - -libwine.so: libwine.so.$libwine_soversion - \$(RM) \$@ && \$(LN_S) libwine.so.$libwine_soversion \$@ - -install install-lib:: libwine.so.$libwine_version - \$(INSTALL_PROGRAM) libwine.so.$libwine_version \$(DESTDIR)\$(libdir)/libwine.so.$libwine_version - cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.so.$libwine_soversion && \$(LN_S) libwine.so.$libwine_version libwine.so.$libwine_soversion - -install install-dev:: - cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.so && \$(LN_S) libwine.so.$libwine_version libwine.so - -uninstall:: - -cd \$(DESTDIR)\$(libdir) && \$(RM) libwine.so libwine.so.$libwine_soversion libwine.so.$libwine_version -"]) - - AS_VAR_APPEND([LOADER_RULES],[" -$wine_binary: main.o - \$(CC) -o \$@ $LDEXECFLAGS main.o \$(LIBWINE) \$(LIBPORT) \$(EXTRALIBS) \$(LDFLAGS) \$(LDRPATH_LOCAL) - -wine-installed: main.o - \$(CC) -o \$@ $LDEXECFLAGS main.o \$(LIBWINE) \$(LIBPORT) \$(EXTRALIBS) \$(LDFLAGS) \$(LDRPATH_INSTALL) -"]) + AC_SUBST(LIBWINE_SHAREDLIB,"libwine.so.$libwine_version") + AC_SUBST(LIBWINE_INSTALL_LIB,"libwine.so.$libwine_version libwine.so.$libwine_soversion") + AC_SUBST(LIBWINE_INSTALL_DEV,"libwine.so") + AC_SUBST(LIBWINE_DEPENDS,"wine.map") ;; esac -AS_VAR_APPEND([LIBWINE_RULES],[" -EXTRA_TARGETS = $libwine_targets -"]) - enable_wineqtdecoder=${enable_wineqtdecoder:-no} enable_winemac_drv=${enable_winemac_drv:-no} @@ -1288,7 +1181,7 @@ dnl **** Check for libpcap **** if test "$ac_cv_header_pcap_pcap_h" = "yes" then - AC_CHECK_LIB(pcap,pcap_create,[AC_SUBST(LIBPCAP,["-lpcap"])]) + AC_CHECK_LIB(pcap,pcap_create,[AC_SUBST(PCAP_LIBS,["-lpcap"])]) fi WINE_NOTICE_WITH(pcap,[test "x$ac_cv_lib_pcap_pcap_create" != xyes], [pcap ${notice_platform}development files not found, wpcap won't be supported.]) @@ -1551,6 +1444,17 @@ [GetText ${notice_platform}development files not found (or too old), po files can't be rebuilt.]) fi +dnl **** Check for PulseAudio **** +if test "x$with_pulse" != "xno"; +then + WINE_PACKAGE_FLAGS(PULSE,[libpulse],,,, + [AC_CHECK_HEADERS(pulse/pulseaudio.h, + [AC_CHECK_LIB(pulse, pa_stream_is_corked,[:],[PULSE_LIBS=""],[$PULSE_LIBS])], + [PULSE_LIBS=""])]) +fi +WINE_NOTICE_WITH(pulse, [test -z "$PULSE_LIBS"], + [libpulse ${notice_platform}development files not found or too old, Pulse won't be supported.]) + dnl **** Check for gstreamer **** if test "x$with_gstreamer" != "xno" then @@ -1703,7 +1607,7 @@ dnl **** Check for libtiff **** if test "x$with_tiff" != "xno" then - WINE_PACKAGE_FLAGS(TIFF,[libtiff],,,, + WINE_PACKAGE_FLAGS(TIFF,[libtiff-4],,,, [AC_CHECK_HEADERS([tiffio.h]) if test "$ac_cv_header_tiffio_h" = "yes" then @@ -1738,9 +1642,23 @@ AC_DEFINE_UNQUOTED(HAVE_OPENAL,1,[Define to 1 if OpenAL is available])],,) fi WINE_NOTICE_WITH(openal,[test "x$ac_cv_lib_openal" != xyes], - [libopenal ${notice_platform}development files not found (or too old), OpenAL won't be supported.]) + [libopenal ${notice_platform}development files not found (or too old), OpenAL won't be supported]) test "x$ac_cv_lib_openal" = xyes || enable_openal32=${enable_openal32:-no} +dnl **** Check for openal-soft **** +if test "x$ac_cv_lib_openal" = xyes +then + AC_CACHE_CHECK([for openal-soft], ac_cv_have_openalsoft, + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[#include +LPALCRENDERSAMPLESSOFT x;]])],[ac_cv_have_openalsoft=yes],[ac_cv_have_openalsoft=no])) +fi +if test "x$ac_cv_have_openalsoft" != xyes +then + WINE_NOTICE([openal-soft ${notice_platform}development files not found (or too old), XAudio2 won't be supported]) + enable_xaudio2_7=${enable_xaudio2_7:-no} +fi + dnl **** Check for libkstat **** if test "$ac_cv_header_kstat_h" = "yes" then @@ -1769,13 +1687,14 @@ dnl **** Disable unsupported winmm drivers **** test -n "$ALSA_LIBS" || enable_winealsa_drv=${enable_winealsa_drv:-no} test -n "$COREAUDIO_LIBS" || enable_winecoreaudio_drv=${enable_winecoreaudio_drv:-no} +test -n "$PULSE_LIBS" || enable_winepulse_drv=${enable_winepulse_drv:-no} test "x$ac_cv_member_oss_sysinfo_numaudioengines" = xyes || enable_wineoss_drv=${enable_wineoss_drv:-no} test "$ac_cv_header_linux_joystick_h" = "yes" -o "$ac_cv_header_IOKit_hid_IOHIDLib_h" = "yes" || enable_winejoystick_drv=${enable_winejoystick_drv:-no} dnl **** Check for any sound system **** -if test "x$ALSA_LIBS$COREAUDIO_LIBS" = "x" -a \ +if test "x$ALSA_LIBS$COREAUDIO_LIBS$PULSE_LIBS" = "x" -a \ "x$ac_cv_member_oss_sysinfo_numaudioengines" != xyes -a \ - "x$with_alsa$with_coreaudio$with_oss" != xnonono + "x$with_alsa$with_coreaudio$with_oss$with_pulse" != xnononono then WINE_WARNING([No sound system was found. Windows applications will be silent.]) fi @@ -1806,12 +1725,14 @@ dnl Check for some compiler flags WINE_TRY_CFLAGS([-fno-builtin],[AC_SUBST(BUILTINFLAG,"-fno-builtin")]) WINE_TRY_CFLAGS([-fno-strict-aliasing]) + WINE_TRY_CFLAGS([-fexcess-precision=standard],[AC_SUBST(EXCESS_PRECISION_CFLAGS,"-fexcess-precision=standard")]) dnl clang needs to be told to fail on unknown options saved_CFLAGS=$CFLAGS WINE_TRY_CFLAGS([-Werror=unknown-warning-option],[CFLAGS="$CFLAGS -Werror=unknown-warning-option"]) WINE_TRY_CFLAGS([-Wdeclaration-after-statement]) WINE_TRY_CFLAGS([-Wempty-body]) WINE_TRY_CFLAGS([-Wignored-qualifiers]) + WINE_TRY_CFLAGS([-Wshift-overflow=2]) WINE_TRY_CFLAGS([-Wstrict-prototypes]) WINE_TRY_CFLAGS([-Wtype-limits]) WINE_TRY_CFLAGS([-Wunused-but-set-parameter]) @@ -1883,7 +1804,7 @@ AC_CACHE_CHECK([for the need to disable Fortify], ac_cv_c_fortify_enabled, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], -[[#if defined(__USE_FORTIFY_LEVEL) && __USE_FORTIFY_LEVEL > 0 +[[#if (defined(__USE_FORTIFY_LEVEL) && __USE_FORTIFY_LEVEL > 0) || (defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0) #error Fortify enabled #endif]])], [ac_cv_c_fortify_enabled=no],[ac_cv_c_fortify_enabled=yes])) @@ -2016,25 +1937,11 @@ case $host_cpu in *i[[3456789]]86*|x86_64*) test "$wine_binary" = wine || WINE_IGNORE_FILE("loader/wine-preloader") - loader_programs="$loader_programs $wine_binary-preloader" - AS_VAR_APPEND([LOADER_RULES],[" -$wine_binary-preloader: preloader.o - \$(CC) -o \$@ -static -nostartfiles -nodefaultlibs -Wl,-Ttext=0x7c400000 preloader.o \$(LIBPORT) \$(LDFLAGS) - -install install-lib:: $wine_binary-preloader - \$(INSTALL_PROGRAM) $wine_binary-preloader \$(DESTDIR)\$(bindir)/$wine_binary-preloader - -uninstall:: - \$(RM) \$(DESTDIR)\$(bindir)/$wine_binary-preloader - -preloader_EXTRADEFS = $BUILTINFLAG -"]) ;; + WINELOADER_PROGRAMS="$WINELOADER_PROGRAMS $wine_binary-preloader" + ;; esac ;; esac -AS_VAR_APPEND([LOADER_RULES],[" -PROGRAMS = $loader_programs -"]) dnl **** Check for functions **** @@ -2666,7 +2573,7 @@ .INIT: Makefile .MAKEFILEDEPS: all: Makefile -Makefile: $srcdir/Makefile.in $srcdir/Make.vars.in config.status \$(MAKEDEP) +Makefile: $srcdir/Makefile.in config.status \$(MAKEDEP) @./config.status Make.tmp Makefile]) test "$srcdir" = . && WINE_APPEND_RULE( @@ -2678,7 +2585,7 @@ [crosstest: @echo \"crosstest is not supported (mingw not installed?)\" && false]) -WINE_CONFIG_SYMLINK(fonts,fonts,[marlett.ttf,symbol.ttf,tahoma.ttf,tahomabd.ttf],enable_fonts) +WINE_CONFIG_SYMLINK(fonts,fonts,[marlett.ttf,symbol.ttf,tahoma.ttf,tahomabd.ttf,wingding.ttf],enable_fonts) WINE_CONFIG_SYMLINK(loader,loader,[l_intl.nls]) WINE_CONFIG_SYMLINK(po,po,[LINGUAS]) WINE_CONFIG_SYMLINK(,tools,[wine],,winewrapper) @@ -2755,6 +2662,21 @@ WINE_CONFIG_DLL(api-ms-win-core-winrt-l1-1-0) WINE_CONFIG_DLL(api-ms-win-core-winrt-string-l1-1-0) WINE_CONFIG_DLL(api-ms-win-core-xstate-l2-1-0) +WINE_CONFIG_DLL(api-ms-win-crt-conio-l1-1-0) +WINE_CONFIG_DLL(api-ms-win-crt-convert-l1-1-0) +WINE_CONFIG_DLL(api-ms-win-crt-environment-l1-1-0) +WINE_CONFIG_DLL(api-ms-win-crt-filesystem-l1-1-0) +WINE_CONFIG_DLL(api-ms-win-crt-heap-l1-1-0) +WINE_CONFIG_DLL(api-ms-win-crt-locale-l1-1-0) +WINE_CONFIG_DLL(api-ms-win-crt-math-l1-1-0) +WINE_CONFIG_DLL(api-ms-win-crt-multibyte-l1-1-0) +WINE_CONFIG_DLL(api-ms-win-crt-private-l1-1-0) +WINE_CONFIG_DLL(api-ms-win-crt-process-l1-1-0) +WINE_CONFIG_DLL(api-ms-win-crt-runtime-l1-1-0) +WINE_CONFIG_DLL(api-ms-win-crt-stdio-l1-1-0) +WINE_CONFIG_DLL(api-ms-win-crt-string-l1-1-0) +WINE_CONFIG_DLL(api-ms-win-crt-time-l1-1-0) +WINE_CONFIG_DLL(api-ms-win-crt-utility-l1-1-0) WINE_CONFIG_DLL(api-ms-win-downlevel-advapi32-l1-1-0) WINE_CONFIG_DLL(api-ms-win-downlevel-advapi32-l2-1-0) WINE_CONFIG_DLL(api-ms-win-downlevel-normaliz-l1-1-0) @@ -2791,8 +2713,10 @@ WINE_CONFIG_DLL(avrt,,[implib]) WINE_CONFIG_DLL(bcrypt) WINE_CONFIG_TEST(dlls/bcrypt/tests) +WINE_CONFIG_DLL(bluetoothapis) WINE_CONFIG_DLL(browseui,,[clean,po]) WINE_CONFIG_TEST(dlls/browseui/tests) +WINE_CONFIG_DLL(bthprops.cpl) WINE_CONFIG_DLL(cabinet,,[implib]) WINE_CONFIG_TEST(dlls/cabinet/tests) WINE_CONFIG_DLL(capi2032,,[implib]) @@ -2834,9 +2758,11 @@ WINE_CONFIG_DLL(d3d10,,[implib]) WINE_CONFIG_TEST(dlls/d3d10/tests) WINE_CONFIG_DLL(d3d10_1,,[implib]) +WINE_CONFIG_TEST(dlls/d3d10_1/tests) WINE_CONFIG_DLL(d3d10core,,[implib]) WINE_CONFIG_TEST(dlls/d3d10core/tests) WINE_CONFIG_DLL(d3d11,,[implib]) +WINE_CONFIG_TEST(dlls/d3d11/tests) WINE_CONFIG_DLL(d3d8,,[implib]) WINE_CONFIG_TEST(dlls/d3d8/tests) WINE_CONFIG_DLL(d3d9,,[implib]) @@ -2963,6 +2889,7 @@ WINE_CONFIG_TEST(dlls/dxgi/tests) WINE_CONFIG_LIB(dxguid) WINE_CONFIG_DLL(dxva2) +WINE_CONFIG_DLL(esent) WINE_CONFIG_DLL(evr) WINE_CONFIG_DLL(explorerframe,,[clean]) WINE_CONFIG_TEST(dlls/explorerframe/tests) @@ -2970,6 +2897,7 @@ WINE_CONFIG_DLL(faultrep,,[implib]) WINE_CONFIG_TEST(dlls/faultrep/tests) WINE_CONFIG_DLL(fltlib) +WINE_CONFIG_DLL(fltmgr.sys) WINE_CONFIG_DLL(fntcache) WINE_CONFIG_DLL(fontsub) WINE_CONFIG_DLL(fusion) @@ -3079,6 +3007,7 @@ WINE_CONFIG_TEST(dlls/msctf/tests) WINE_CONFIG_DLL(msctfp,,[clean]) WINE_CONFIG_DLL(msdaps,,[clean]) +WINE_CONFIG_DLL(msdelta) WINE_CONFIG_DLL(msdmo,,[implib]) WINE_CONFIG_TEST(dlls/msdmo/tests) WINE_CONFIG_DLL(msftedit) @@ -3112,6 +3041,7 @@ WINE_CONFIG_DLL(msvcp100) WINE_CONFIG_TEST(dlls/msvcp100/tests) WINE_CONFIG_DLL(msvcp110) +WINE_CONFIG_TEST(dlls/msvcp110/tests) WINE_CONFIG_DLL(msvcp120) WINE_CONFIG_TEST(dlls/msvcp120/tests) WINE_CONFIG_DLL(msvcp120_app) @@ -3303,6 +3233,8 @@ WINE_CONFIG_DLL(twain_32) WINE_CONFIG_TEST(dlls/twain_32/tests) WINE_CONFIG_DLL(typelib.dll16,enable_win16) +WINE_CONFIG_DLL(ucrtbase) +WINE_CONFIG_TEST(dlls/ucrtbase/tests) WINE_CONFIG_DLL(unicows,,[implib]) WINE_CONFIG_DLL(updspapi) WINE_CONFIG_DLL(url,,[implib]) @@ -3325,7 +3257,9 @@ WINE_CONFIG_TEST(dlls/vcomp/tests) WINE_CONFIG_DLL(vcomp100) WINE_CONFIG_DLL(vcomp110) +WINE_CONFIG_DLL(vcomp120) WINE_CONFIG_DLL(vcomp90) +WINE_CONFIG_DLL(vcruntime140) WINE_CONFIG_DLL(vdhcp.vxd,enable_win16) WINE_CONFIG_DLL(vdmdbg,,[implib]) WINE_CONFIG_DLL(ver.dll16,enable_win16) @@ -3344,10 +3278,13 @@ WINE_CONFIG_DLL(wbemprox,,[clean]) WINE_CONFIG_TEST(dlls/wbemprox/tests) WINE_CONFIG_DLL(webservices,,[implib]) +WINE_CONFIG_TEST(dlls/webservices/tests) WINE_CONFIG_DLL(wer,,[implib]) WINE_CONFIG_TEST(dlls/wer/tests) WINE_CONFIG_DLL(wevtapi) WINE_CONFIG_DLL(wiaservc,,[clean]) +WINE_CONFIG_TEST(dlls/wiaservc/tests) +WINE_CONFIG_DLL(wimgapi) WINE_CONFIG_DLL(win32s16.dll16,enable_win16) WINE_CONFIG_DLL(win87em.dll16,enable_win16) WINE_CONFIG_DLL(winaspi.dll16,enable_win16) @@ -3368,6 +3305,7 @@ WINE_CONFIG_DLL(wineoss.drv) WINE_CONFIG_DLL(wineps.drv,,[clean,po]) WINE_CONFIG_DLL(wineps16.drv16,enable_win16) +WINE_CONFIG_DLL(winepulse.drv) WINE_CONFIG_DLL(wineqtdecoder) WINE_CONFIG_DLL(winex11.drv) WINE_CONFIG_DLL(wing.dll16,enable_win16) @@ -3413,6 +3351,7 @@ WINE_CONFIG_TEST(dlls/wtsapi32/tests) WINE_CONFIG_DLL(wuapi,,[clean]) WINE_CONFIG_DLL(wuaueng) +WINE_CONFIG_DLL(x3daudio1_0) WINE_CONFIG_DLL(x3daudio1_1) WINE_CONFIG_DLL(x3daudio1_2) WINE_CONFIG_DLL(x3daudio1_3) @@ -3421,11 +3360,20 @@ WINE_CONFIG_DLL(x3daudio1_6) WINE_CONFIG_DLL(x3daudio1_7) WINE_CONFIG_DLL(xapofx1_1) +WINE_CONFIG_DLL(xapofx1_2) WINE_CONFIG_DLL(xapofx1_3) WINE_CONFIG_DLL(xapofx1_4) WINE_CONFIG_DLL(xapofx1_5) +WINE_CONFIG_DLL(xaudio2_0,,[clean]) +WINE_CONFIG_DLL(xaudio2_1,,[clean]) +WINE_CONFIG_DLL(xaudio2_2,,[clean]) +WINE_CONFIG_DLL(xaudio2_3,,[clean]) +WINE_CONFIG_DLL(xaudio2_4,,[clean]) +WINE_CONFIG_DLL(xaudio2_5,,[clean]) +WINE_CONFIG_DLL(xaudio2_6,,[clean]) WINE_CONFIG_DLL(xaudio2_7,,[clean]) -WINE_CONFIG_DLL(xaudio2_8) +WINE_CONFIG_TEST(dlls/xaudio2_7/tests) +WINE_CONFIG_DLL(xaudio2_8,,[implib]) WINE_CONFIG_DLL(xinput1_1) WINE_CONFIG_DLL(xinput1_2) WINE_CONFIG_DLL(xinput1_3,,[implib],[xinput]) @@ -3437,13 +3385,12 @@ WINE_CONFIG_DLL(xolehlp) WINE_CONFIG_DLL(xpsprint) WINE_CONFIG_DLL(xpssvcs) -WINE_CONFIG_MAKEFILE([documentation],,[clean]) WINE_CONFIG_MAKEFILE([fonts],,[clean,install-lib]) WINE_CONFIG_MAKEFILE([include],,[clean,install-dev]) WINE_CONFIG_MAKEFILE([libs/port]) -WINE_CONFIG_MAKEFILE([libs/wine],,[clean,install-dev,install-lib]) +WINE_CONFIG_MAKEFILE([libs/wine],,[clean,implib,install-dev,install-lib]) WINE_CONFIG_MAKEFILE([libs/wpp]) -WINE_CONFIG_MAKEFILE([loader],,[clean,install-lib,manpage]) +WINE_CONFIG_MAKEFILE([loader],,[clean,install-lib]) WINE_CONFIG_PROGRAM(arp,,[install]) WINE_CONFIG_PROGRAM(aspnet_regiis,,[install]) WINE_CONFIG_PROGRAM(attrib,,[install,po]) @@ -3528,6 +3475,7 @@ WINE_CONFIG_PROGRAM(winoldap.mod16,enable_win16,[install]) WINE_CONFIG_PROGRAM(winver,,[install]) WINE_CONFIG_PROGRAM(wmic,,[install,po]) +WINE_CONFIG_PROGRAM(wmplayer,,[install]) WINE_CONFIG_PROGRAM(wordpad,,[install,po]) WINE_CONFIG_PROGRAM(write,,[install,po]) WINE_CONFIG_PROGRAM(wscript,,[clean,install]) @@ -3535,15 +3483,16 @@ WINE_CONFIG_PROGRAM(wusa,,[install]) WINE_CONFIG_PROGRAM(xcopy,,[install,po]) WINE_CONFIG_TEST(programs/xcopy/tests) -WINE_CONFIG_MAKEFILE([server],,[clean,install-lib,manpage]) -WINE_CONFIG_TOOL(tools,[clean,install-dev,install-lib,manpage]) +WINE_CONFIG_MAKEFILE([server],,[clean,install-lib]) +WINE_CONFIG_TOOL(tools,[clean]) WINE_CONFIG_TOOL(tools/sfnt2fon,[clean]) -WINE_CONFIG_TOOL(tools/widl,[clean,install-dev,manpage]) -WINE_CONFIG_TOOL(tools/winebuild,[clean,install-dev,manpage]) -WINE_CONFIG_TOOL(tools/winedump,[clean,install-dev,manpage]) -WINE_CONFIG_TOOL(tools/winegcc,[clean,install-dev,manpage]) -WINE_CONFIG_TOOL(tools/wmc,[clean,install-dev,manpage]) -WINE_CONFIG_TOOL(tools/wrc,[clean,install-dev,manpage]) +WINE_CONFIG_TOOL(tools/widl,[clean,install-dev]) +WINE_CONFIG_TOOL(tools/winebuild,[clean,install-dev]) +WINE_CONFIG_TOOL(tools/winedump,[clean,install-dev]) +WINE_CONFIG_TOOL(tools/winegcc,[clean,install-dev]) +WINE_CONFIG_TOOL(tools/winemaker,[clean,install-dev]) +WINE_CONFIG_TOOL(tools/wmc,[clean,install-dev]) +WINE_CONFIG_TOOL(tools/wrc,[clean,install-dev]) AC_SUBST([LINGUAS],["\ ar \ @@ -3629,7 +3578,7 @@ AS_ERROR([could not create Makefile]) }]) -AC_CONFIG_FILES([Make.tmp:Make.vars.in:Makefile.in]) +AC_CONFIG_FILES([Make.tmp:Makefile.in]) dnl Some final makefile rules @@ -3702,14 +3651,20 @@ clean:: \$(RM) fonts server tools $with_wine64/loader/wine $with_wine64/loader/wine-preloader]) else - AS_VAR_APPEND([LOADER_RULES],[" -install install-lib:: wine.inf install-man-pages - \$(INSTALL_DATA) wine.inf \$(DESTDIR)\$(datadir)/wine/wine.inf - \$(INSTALL_DATA) \$(srcdir)/l_intl.nls \$(DESTDIR)\$(datadir)/wine/l_intl.nls - + AC_SUBST(WINELOADER_INSTALL,"wine.inf") + WINE_APPEND_RULE( +[install install-lib:: + \$(INSTALL_DATA) $srcdir/loader/l_intl.nls \$(DESTDIR)\$(datadir)/wine/l_intl.nls uninstall:: - \$(RM) \$(DESTDIR)\$(datadir)/wine/wine.inf \$(DESTDIR)\$(datadir)/wine/l_intl.nls -"]) + \$(RM) \$(DESTDIR)\$(datadir)/wine/l_intl.nls]) + case $host_os in + cygwin*|mingw32*|darwin*|macosx*|linux-android*) ;; + *) WINE_APPEND_RULE( +[install install-lib:: + \$(INSTALL_DATA) $srcdir/loader/wine.desktop \$(DESTDIR)\$(datadir)/applications/wine.desktop +uninstall:: + \$(RM) \$(DESTDIR)\$(datadir)/applications/wine.desktop]) ;; + esac fi if test "$srcdir" = . diff -Nru wine1.7-1.7.50/debian/changelog wine1.7-1.7.55/debian/changelog --- wine1.7-1.7.50/debian/changelog 2015-08-22 13:11:25.000000000 +0000 +++ wine1.7-1.7.55/debian/changelog 2015-11-16 21:37:54.000000000 +0000 @@ -1,3 +1,16 @@ +wine1.7 (1:1.7.55-0ubuntu1) trusty; urgency=medium + + * New upstream release + - Pulse audio driver. + - Various fixes for Microsoft Office 2013 support. + - Some more implementation of the Web Services DLL. + - More fixes for the latest C runtime version. + - Improvements to the Makefile generation. + - Various bug fixes. + * Hell froze over.. + + -- Mon, 16 Nov 2015 22:35:31 +0100 + wine1.7 (1:1.7.50-0ubuntu1) trusty; urgency=medium * New upstream release diff -Nru wine1.7-1.7.50/debian/patches/0001-winemenubuilder-silence-an-err.patch wine1.7-1.7.55/debian/patches/0001-winemenubuilder-silence-an-err.patch --- wine1.7-1.7.50/debian/patches/0001-winemenubuilder-silence-an-err.patch 2015-06-12 06:27:04.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0001-winemenubuilder-silence-an-err.patch 2015-11-16 21:33:39.000000000 +0000 @@ -1,14 +1,14 @@ -From e0dfcbbf0bdcf15678532f837b289e09462b4cda Mon Sep 17 00:00:00 2001 +From 91b38ae21a4d6eb8a209892c4e0a8e72b83ee76a Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Mon, 23 Mar 2015 09:14:28 +0100 -Subject: [PATCH 01/50] winemenubuilder: silence an err +Subject: [PATCH 01/14] winemenubuilder: silence an err --- programs/winemenubuilder/winemenubuilder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/winemenubuilder/winemenubuilder.c b/programs/winemenubuilder/winemenubuilder.c -index bc1540b..4bb5d09 100644 +index e6fd042..e68016a 100644 --- a/programs/winemenubuilder/winemenubuilder.c +++ b/programs/winemenubuilder/winemenubuilder.c @@ -2549,7 +2549,7 @@ static BOOL write_freedesktop_association_entry(const char *desktopPath, const c @@ -21,5 +21,5 @@ } -- -2.3.2 +2.5.0 diff -Nru wine1.7-1.7.50/debian/patches/0002-valgrind-prevent-crash-hack.patch wine1.7-1.7.55/debian/patches/0002-valgrind-prevent-crash-hack.patch --- wine1.7-1.7.50/debian/patches/0002-valgrind-prevent-crash-hack.patch 2015-06-12 06:27:04.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0002-valgrind-prevent-crash-hack.patch 2015-11-16 21:33:39.000000000 +0000 @@ -1,14 +1,14 @@ -From 90e5053501b032fded19b9432daaf90fb7b7e4aa Mon Sep 17 00:00:00 2001 +From 2b1a701a4aecb65fc57c3e521fba9d8e2d620061 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Mon, 23 Mar 2015 09:14:28 +0100 -Subject: [PATCH 02/50] valgrind prevent crash hack +Subject: [PATCH 02/14] valgrind prevent crash hack --- libs/wine/loader.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libs/wine/loader.c b/libs/wine/loader.c -index 3591ede..fcb58cf 100644 +index b5b32cc..bc06920 100644 --- a/libs/wine/loader.c +++ b/libs/wine/loader.c @@ -63,6 +63,10 @@ extern char **environ; @@ -22,7 +22,7 @@ /* argc/argv for the Windows application */ int __wine_main_argc = 0; char **__wine_main_argv = NULL; -@@ -650,7 +654,6 @@ int wine_dll_get_owner( const char *name, char *buffer, int size, int *exists ) +@@ -647,7 +651,6 @@ int wine_dll_get_owner( const char *name, char *buffer, int size, int *exists ) return ret; } @@ -30,7 +30,7 @@ /*********************************************************************** * set_max_limit * -@@ -661,6 +664,11 @@ static void set_max_limit( int limit ) +@@ -658,6 +661,11 @@ static void set_max_limit( int limit ) #ifdef HAVE_SETRLIMIT struct rlimit rlimit; @@ -43,5 +43,5 @@ { rlimit.rlim_cur = rlimit.rlim_max; -- -2.3.2 +2.5.0 diff -Nru wine1.7-1.7.50/debian/patches/0003-server-Use-rtkit-to-set-realtime-priority-try-4.patch wine1.7-1.7.55/debian/patches/0003-server-Use-rtkit-to-set-realtime-priority-try-4.patch --- wine1.7-1.7.50/debian/patches/0003-server-Use-rtkit-to-set-realtime-priority-try-4.patch 2015-06-12 06:27:04.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0003-server-Use-rtkit-to-set-realtime-priority-try-4.patch 2015-11-16 21:33:39.000000000 +0000 @@ -1,7 +1,7 @@ -From 4377c9cbafdfd28402c1124baf3081e56a38a25c Mon Sep 17 00:00:00 2001 +From 06dfe5e45627a82ec9cc2b6cdc7a126538129f65 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Mon, 23 Mar 2015 09:14:28 +0100 -Subject: [PATCH 03/50] server: Use rtkit to set realtime priority, try 4 +Subject: [PATCH 03/14] server: Use rtkit to set realtime priority, try 4 --- libs/wine/loader.c | 27 ++++++++ @@ -12,10 +12,10 @@ create mode 100644 server/rtkit.c diff --git a/libs/wine/loader.c b/libs/wine/loader.c -index fcb58cf..600d99b 100644 +index bc06920..b9c3fa0 100644 --- a/libs/wine/loader.c +++ b/libs/wine/loader.c -@@ -921,6 +921,32 @@ jint JNI_OnLoad( JavaVM *vm, void *reserved ) +@@ -919,6 +919,32 @@ jint JNI_OnLoad( JavaVM *vm, void *reserved ) #endif /* __ANDROID__ */ /*********************************************************************** @@ -48,7 +48,7 @@ * wine_init * * Main Wine initialisation. -@@ -939,6 +965,7 @@ void wine_init( int argc, char *argv[], char *error, int error_size ) +@@ -937,6 +963,7 @@ void wine_init( int argc, char *argv[], char *error, int error_size ) #ifdef RLIMIT_AS set_max_limit( RLIMIT_AS ); #endif @@ -57,16 +57,10 @@ wine_init_argv0_path( argv[0] ); build_dll_path(); diff --git a/server/Makefile.in b/server/Makefile.in -index 19a4fac..76bdb96 100644 +index 75ba199..a44851d 100644 --- a/server/Makefile.in +++ b/server/Makefile.in -@@ -1,4 +1,5 @@ - EXTRALIBS = $(POLL_LIBS) $(RT_LIBS) -+EXTRAINCL = $(DBUS_CFLAGS) - - C_SRCS = \ - async.c \ -@@ -30,6 +31,7 @@ C_SRCS = \ +@@ -30,6 +30,7 @@ C_SRCS = \ region.c \ registry.c \ request.c \ @@ -74,6 +68,13 @@ semaphore.c \ serial.c \ signal.c \ +@@ -51,5 +52,6 @@ MANPAGES = \ + wineserver.man.in + + EXTRALIBS = -lwine $(POLL_LIBS) $(RT_LIBS) ++EXTRAINCL = $(DBUS_CFLAGS) + + INSTALL_LIB = $(PROGRAMS) diff --git a/server/rtkit.c b/server/rtkit.c new file mode 100644 index 0000000..a212106 @@ -261,7 +262,7 @@ + +#endif diff --git a/server/thread.c b/server/thread.c -index 6c5d12d..cdd6a34 100644 +index bad2231..fbffffb 100644 --- a/server/thread.c +++ b/server/thread.c @@ -52,6 +52,8 @@ @@ -273,7 +274,7 @@ #ifdef __i386__ static const unsigned int supported_cpus = CPU_FLAG(CPU_x86); -@@ -482,7 +484,17 @@ static void set_thread_info( struct thread *thread, +@@ -487,7 +489,17 @@ static void set_thread_info( struct thread *thread, if ((req->priority >= min && req->priority <= max) || req->priority == THREAD_PRIORITY_IDLE || req->priority == THREAD_PRIORITY_TIME_CRITICAL) @@ -291,7 +292,7 @@ else set_error( STATUS_INVALID_PARAMETER ); } -@@ -1309,6 +1321,10 @@ DECL_HANDLER(init_thread) +@@ -1320,6 +1332,10 @@ DECL_HANDLER(init_thread) } debug_level = max( debug_level, req->debug_level ); @@ -303,5 +304,5 @@ reply->tid = get_thread_id( current ); reply->version = SERVER_PROTOCOL_VERSION; -- -2.3.2 +2.5.0 diff -Nru wine1.7-1.7.50/debian/patches/0004-avrt-Add-realtime-to-stub.patch wine1.7-1.7.55/debian/patches/0004-avrt-Add-realtime-to-stub.patch --- wine1.7-1.7.50/debian/patches/0004-avrt-Add-realtime-to-stub.patch 2015-06-12 06:27:04.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0004-avrt-Add-realtime-to-stub.patch 2015-11-16 21:33:39.000000000 +0000 @@ -1,7 +1,7 @@ -From 5db6dc1c680423c0e974ad3026d2afa1c6fbe9a8 Mon Sep 17 00:00:00 2001 +From df70de885acd640100cec34df572eb8f7967aeca Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Mon, 23 Mar 2015 09:14:29 +0100 -Subject: [PATCH 04/50] avrt: Add realtime to stub +Subject: [PATCH 04/14] avrt: Add realtime to stub --- dlls/avrt/main.c | 1 + @@ -20,5 +20,5 @@ } -- -2.3.2 +2.5.0 diff -Nru wine1.7-1.7.50/debian/patches/0005-server-Bump-priority-on-server-to-process-messages-f.patch wine1.7-1.7.55/debian/patches/0005-server-Bump-priority-on-server-to-process-messages-f.patch --- wine1.7-1.7.50/debian/patches/0005-server-Bump-priority-on-server-to-process-messages-f.patch 2015-06-12 06:27:04.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0005-server-Bump-priority-on-server-to-process-messages-f.patch 2015-11-16 21:33:39.000000000 +0000 @@ -1,7 +1,7 @@ -From 5bfa89462ad1eb02e57ddf5ccbc92aaddfe643d0 Mon Sep 17 00:00:00 2001 +From 665e9b2a60840464185760a8cf54edb26bb0fa9a Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Mon, 23 Mar 2015 09:14:29 +0100 -Subject: [PATCH 05/50] server: Bump priority on server to process messages +Subject: [PATCH 05/14] server: Bump priority on server to process messages faster --- @@ -38,5 +38,5 @@ return 0; } -- -2.3.2 +2.5.0 diff -Nru wine1.7-1.7.50/debian/patches/0006-rtkit-add-SIGXCPU-handling-to-wineserver.patch wine1.7-1.7.55/debian/patches/0006-rtkit-add-SIGXCPU-handling-to-wineserver.patch --- wine1.7-1.7.50/debian/patches/0006-rtkit-add-SIGXCPU-handling-to-wineserver.patch 2015-06-12 06:27:04.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0006-rtkit-add-SIGXCPU-handling-to-wineserver.patch 2015-11-16 21:33:39.000000000 +0000 @@ -1,7 +1,7 @@ -From ab51be831f5e2c900241fafa8b9c0c37cc2e01fb Mon Sep 17 00:00:00 2001 +From a0d75ff88601352873e5f960532dd00077c1eca1 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Mon, 23 Mar 2015 09:14:29 +0100 -Subject: [PATCH 06/50] rtkit: add SIGXCPU handling to wineserver +Subject: [PATCH 06/14] rtkit: add SIGXCPU handling to wineserver This is dependent on getting the correct server_pid in the previous commit. Processes now forward SIGXCPU to wineserver, who will attempt to downgrade @@ -33,7 +33,7 @@ } diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c -index 95111ad..9a879df 100644 +index 356d631..4775dec 100644 --- a/dlls/ntdll/server.c +++ b/dlls/ntdll/server.c @@ -83,6 +83,9 @@ @@ -159,10 +159,10 @@ * server_init_thread * diff --git a/libs/wine/loader.c b/libs/wine/loader.c -index 600d99b..7261522 100644 +index b9c3fa0..1644955 100644 --- a/libs/wine/loader.c +++ b/libs/wine/loader.c -@@ -935,10 +935,12 @@ static void set_rttime_limit(void) +@@ -933,10 +933,12 @@ static void set_rttime_limit(void) if (!getrlimit( RLIMIT_RTTIME, &rlimit )) { @@ -420,7 +420,7 @@ return -ENOTSUP; } diff --git a/server/thread.c b/server/thread.c -index cdd6a34..ca46495 100644 +index fbffffb..194c6c3 100644 --- a/server/thread.c +++ b/server/thread.c @@ -52,8 +52,8 @@ @@ -434,7 +434,7 @@ #ifdef __i386__ static const unsigned int supported_cpus = CPU_FLAG(CPU_x86); -@@ -203,6 +203,8 @@ static inline void init_thread_structure( struct thread *thread ) +@@ -204,6 +204,8 @@ static inline void init_thread_structure( struct thread *thread ) list_init( &thread->mutex_list ); list_init( &thread->system_apc ); list_init( &thread->user_apc ); @@ -443,7 +443,7 @@ for (i = 0; i < MAX_INFLIGHT_FDS; i++) thread->inflight[i].server = thread->inflight[i].client = -1; -@@ -277,6 +279,9 @@ static void cleanup_thread( struct thread *thread ) +@@ -278,6 +280,9 @@ static void cleanup_thread( struct thread *thread ) { int i; @@ -453,7 +453,7 @@ clear_apc_queue( &thread->system_apc ); clear_apc_queue( &thread->user_apc ); free( thread->req_data ); -@@ -468,6 +473,15 @@ affinity_t get_thread_affinity( struct thread *thread ) +@@ -473,6 +478,15 @@ affinity_t get_thread_affinity( struct thread *thread ) #define THREAD_PRIORITY_REALTIME_HIGHEST 6 #define THREAD_PRIORITY_REALTIME_LOWEST -7 @@ -469,7 +469,7 @@ /* set all information about a thread */ static void set_thread_info( struct thread *thread, const struct set_thread_info_request *req ) -@@ -483,17 +497,21 @@ static void set_thread_info( struct thread *thread, +@@ -488,17 +502,21 @@ static void set_thread_info( struct thread *thread, } if ((req->priority >= min && req->priority <= max) || req->priority == THREAD_PRIORITY_IDLE || @@ -499,7 +499,7 @@ } else set_error( STATUS_INVALID_PARAMETER ); -@@ -1323,7 +1341,7 @@ DECL_HANDLER(init_thread) +@@ -1334,7 +1352,7 @@ DECL_HANDLER(init_thread) /* Raced with SetThreadPriority */ if (current->priority == THREAD_PRIORITY_TIME_CRITICAL) @@ -509,10 +509,10 @@ reply->pid = get_process_id( process ); reply->tid = get_thread_id( current ); diff --git a/server/thread.h b/server/thread.h -index 996d95b..36f09ce 100644 +index 2821991..8781721 100644 --- a/server/thread.h +++ b/server/thread.h -@@ -87,6 +87,8 @@ struct thread +@@ -88,6 +88,8 @@ struct thread timeout_t creation_time; /* Thread creation time */ timeout_t exit_time; /* Thread exit time */ struct token *token; /* security token associated with this thread */ @@ -522,5 +522,5 @@ struct thread_snapshot -- -2.3.2 +2.5.0 diff -Nru wine1.7-1.7.50/debian/patches/0007-dsound-rework-ugly-mixer-logic.patch wine1.7-1.7.55/debian/patches/0007-dsound-rework-ugly-mixer-logic.patch --- wine1.7-1.7.50/debian/patches/0007-dsound-rework-ugly-mixer-logic.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0007-dsound-rework-ugly-mixer-logic.patch 2015-11-16 21:33:39.000000000 +0000 @@ -0,0 +1,674 @@ +From 7169e00e79c1e6b563d3f7b64bda10fc8139ba46 Mon Sep 17 00:00:00 2001 +From: Maarten Lankhorst +Date: Mon, 23 Mar 2015 09:14:33 +0100 +Subject: [PATCH 07/14] dsound: rework ugly mixer logic + +--- + dlls/dsound/dsound.c | 1 - + dlls/dsound/dsound_main.c | 6 - + dlls/dsound/dsound_private.h | 6 +- + dlls/dsound/mixer.c | 254 +++++++++++-------------------------------- + dlls/dsound/primary.c | 107 ++++++++---------- + 5 files changed, 109 insertions(+), 265 deletions(-) + +diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c +index 7b93455..550e276 100644 +--- a/dlls/dsound/dsound.c ++++ b/dlls/dsound/dsound.c +@@ -158,7 +158,6 @@ static HRESULT DirectSoundDevice_Create(DirectSoundDevice ** ppDevice) + device->ds3dl.flRolloffFactor = DS3D_DEFAULTROLLOFFFACTOR; + device->ds3dl.flDopplerFactor = DS3D_DEFAULTDOPPLERFACTOR; + +- device->prebuf = ds_snd_queue_max; + device->guid = GUID_NULL; + + /* Set default wave format (may need it for waveOutOpen) */ +diff --git a/dlls/dsound/dsound_main.c b/dlls/dsound/dsound_main.c +index cb46301..112ce78 100644 +--- a/dlls/dsound/dsound_main.c ++++ b/dlls/dsound/dsound_main.c +@@ -93,7 +93,6 @@ WCHAR wine_vxd_drv[] = { 'w','i','n','e','m','m','.','v','x','d', 0 }; + + /* All default settings, you most likely don't want to touch these, see wiki on UsefulRegistryKeys */ + int ds_hel_buflen = 32768 * 2; +-int ds_snd_queue_max = 10; + static HINSTANCE instance; + + /* +@@ -146,15 +145,10 @@ void setup_dsound_options(void) + if (!get_config_key( hkey, appkey, "HelBuflen", buffer, MAX_PATH )) + ds_hel_buflen = atoi(buffer); + +- if (!get_config_key( hkey, appkey, "SndQueueMax", buffer, MAX_PATH )) +- ds_snd_queue_max = atoi(buffer); +- +- + if (appkey) RegCloseKey( appkey ); + if (hkey) RegCloseKey( hkey ); + + TRACE("ds_hel_buflen = %d\n", ds_hel_buflen); +- TRACE("ds_snd_queue_max = %d\n", ds_snd_queue_max); + } + + static const char * get_device_id(LPCGUID pGuid) +diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h +index 9c001ed..e180f7c 100644 +--- a/dlls/dsound/dsound_private.h ++++ b/dlls/dsound/dsound_private.h +@@ -35,7 +35,6 @@ + #define DS_MAX_CHANNELS 6 + + extern int ds_hel_buflen DECLSPEC_HIDDEN; +-extern int ds_snd_queue_max DECLSPEC_HIDDEN; + + /***************************************************************************** + * Predeclare the interface implementation structures +@@ -76,10 +75,8 @@ struct DirectSoundDevice + DSCAPS drvcaps; + DWORD priolevel, sleeptime; + PWAVEFORMATEX pwfx, primary_pwfx; +- UINT playing_offs_bytes, in_mmdev_bytes, prebuf; +- DWORD fraglen; + LPBYTE buffer; +- DWORD writelead, buflen, state, playpos, mixpos; ++ DWORD writelead, buflen, aclen, fraglen, state, playpos, pad; + int nrofbuffers; + IDirectSoundBufferImpl** buffers; + RTL_RWLOCK buffer_list_lock; +@@ -213,7 +210,6 @@ HRESULT DSOUND_PrimaryCreate(DirectSoundDevice *device) DECLSPEC_HIDDEN; + HRESULT DSOUND_PrimaryDestroy(DirectSoundDevice *device) DECLSPEC_HIDDEN; + HRESULT DSOUND_PrimaryPlay(DirectSoundDevice *device) DECLSPEC_HIDDEN; + HRESULT DSOUND_PrimaryStop(DirectSoundDevice *device) DECLSPEC_HIDDEN; +-HRESULT DSOUND_PrimaryGetPosition(DirectSoundDevice *device, LPDWORD playpos, LPDWORD writepos) DECLSPEC_HIDDEN; + LPWAVEFORMATEX DSOUND_CopyFormat(LPCWAVEFORMATEX wfex) DECLSPEC_HIDDEN; + HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) DECLSPEC_HIDDEN; + HRESULT DSOUND_PrimaryOpen(DirectSoundDevice *device) DECLSPEC_HIDDEN; +diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c +index 85ab14a..f650089 100644 +--- a/dlls/dsound/mixer.c ++++ b/dlls/dsound/mixer.c +@@ -468,7 +468,7 @@ static void DSOUND_MixerVol(const IDirectSoundBufferImpl *dsb, INT frames) + * writepos = position (offset) in device buffer to write at + * fraglen = number of bytes to mix + */ +-static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, DWORD writepos, DWORD fraglen) ++static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, float *mix_buffer, DWORD writepos, DWORD fraglen) + { + INT len = fraglen; + float *ibuf; +@@ -493,7 +493,7 @@ static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, DWORD writepos, DWO + /* Apply volume if needed */ + DSOUND_MixerVol(dsb, frames); + +- mixieee32(ibuf, dsb->device->mix_buffer, frames * dsb->device->pwfx->nChannels); ++ mixieee32(ibuf, mix_buffer, frames * dsb->device->pwfx->nChannels); + + /* check for notification positions */ + if (dsb->dsbd.dwFlags & DSBCAPS_CTRLPOSITIONNOTIFY && +@@ -517,7 +517,7 @@ static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, DWORD writepos, DWO + * + * Returns: the number of bytes beyond the writepos that were mixed. + */ +-static DWORD DSOUND_MixOne(IDirectSoundBufferImpl *dsb, DWORD writepos, DWORD mixlen) ++static DWORD DSOUND_MixOne(IDirectSoundBufferImpl *dsb, float *mix_buffer, DWORD writepos, DWORD mixlen) + { + DWORD primary_done = 0; + +@@ -544,7 +544,7 @@ static DWORD DSOUND_MixOne(IDirectSoundBufferImpl *dsb, DWORD writepos, DWORD mi + /* First try to mix to the end of the buffer if possible + * Theoretically it would allow for better optimization + */ +- primary_done += DSOUND_MixInBuffer(dsb, writepos, mixlen); ++ primary_done += DSOUND_MixInBuffer(dsb, mix_buffer, writepos, mixlen); + + TRACE("total mixed data=%d\n", primary_done); + +@@ -559,14 +559,12 @@ static DWORD DSOUND_MixOne(IDirectSoundBufferImpl *dsb, DWORD writepos, DWORD mi + * writepos = the current safe-to-write position in the primary buffer + * mixlen = the maximum amount to mix into the primary buffer + * (beyond the current writepos) +- * recover = true if the sound device may have been reset and the write +- * position in the device buffer changed + * all_stopped = reports back if all buffers have stopped + * + * Returns: the length beyond the writepos that was mixed to. + */ + +-static void DSOUND_MixToPrimary(const DirectSoundDevice *device, DWORD writepos, DWORD mixlen, BOOL recover, BOOL *all_stopped) ++static void DSOUND_MixToPrimary(const DirectSoundDevice *device, float *mix_buffer, DWORD writepos, DWORD mixlen, BOOL *all_stopped) + { + INT i; + IDirectSoundBufferImpl *dsb; +@@ -574,7 +572,7 @@ static void DSOUND_MixToPrimary(const DirectSoundDevice *device, DWORD writepos, + /* unless we find a running buffer, all have stopped */ + *all_stopped = TRUE; + +- TRACE("(%d,%d,%d)\n", writepos, mixlen, recover); ++ TRACE("(%d,%d)\n", writepos, mixlen); + for (i = 0; i < device->nrofbuffers; i++) { + dsb = device->buffers[i]; + +@@ -594,7 +592,7 @@ static void DSOUND_MixToPrimary(const DirectSoundDevice *device, DWORD writepos, + dsb->state = STATE_PLAYING; + + /* mix next buffer into the main buffer */ +- DSOUND_MixOne(dsb, writepos, mixlen); ++ DSOUND_MixOne(dsb, mix_buffer, writepos, mixlen); + + *all_stopped = FALSE; + } +@@ -613,86 +611,27 @@ static void DSOUND_MixToPrimary(const DirectSoundDevice *device, DWORD writepos, + * Returns: None + */ + +-static void DSOUND_WaveQueue(DirectSoundDevice *device, BOOL force) ++static void DSOUND_WaveQueue(DirectSoundDevice *device, LPBYTE pos, DWORD bytes) + { +- DWORD prebuf_frames, prebuf_bytes, read_offs_bytes; + BYTE *buffer; + HRESULT hr; + + TRACE("(%p)\n", device); + +- read_offs_bytes = (device->playing_offs_bytes + device->in_mmdev_bytes) % device->buflen; +- +- TRACE("read_offs_bytes = %u, playing_offs_bytes = %u, in_mmdev_bytes: %u, prebuf = %u\n", +- read_offs_bytes, device->playing_offs_bytes, device->in_mmdev_bytes, device->prebuf); +- +- if (!force) +- { +- if(device->mixpos < device->playing_offs_bytes) +- prebuf_bytes = device->mixpos + device->buflen - device->playing_offs_bytes; +- else +- prebuf_bytes = device->mixpos - device->playing_offs_bytes; +- } +- else +- /* buffer the maximum amount of frags */ +- prebuf_bytes = device->prebuf * device->fraglen; +- +- /* limit to the queue we have left */ +- if(device->in_mmdev_bytes + prebuf_bytes > device->prebuf * device->fraglen) +- prebuf_bytes = device->prebuf * device->fraglen - device->in_mmdev_bytes; +- +- TRACE("prebuf_bytes = %u\n", prebuf_bytes); +- +- if(!prebuf_bytes) +- return; +- +- if(prebuf_bytes + read_offs_bytes > device->buflen){ +- DWORD chunk_bytes = device->buflen - read_offs_bytes; +- prebuf_frames = chunk_bytes / device->pwfx->nBlockAlign; +- prebuf_bytes -= chunk_bytes; +- }else{ +- prebuf_frames = prebuf_bytes / device->pwfx->nBlockAlign; +- prebuf_bytes = 0; +- } +- +- hr = IAudioRenderClient_GetBuffer(device->render, prebuf_frames, &buffer); ++ hr = IAudioRenderClient_GetBuffer(device->render, bytes / device->pwfx->nBlockAlign, &buffer); + if(FAILED(hr)){ + WARN("GetBuffer failed: %08x\n", hr); +- return; ++ goto done; + } + +- memcpy(buffer, device->buffer + read_offs_bytes, +- prebuf_frames * device->pwfx->nBlockAlign); ++ memcpy(buffer, pos, bytes); + +- hr = IAudioRenderClient_ReleaseBuffer(device->render, prebuf_frames, 0); +- if(FAILED(hr)){ ++ hr = IAudioRenderClient_ReleaseBuffer(device->render, bytes / device->pwfx->nBlockAlign, 0); ++ if(FAILED(hr)) + WARN("ReleaseBuffer failed: %08x\n", hr); +- return; +- } +- +- device->in_mmdev_bytes += prebuf_frames * device->pwfx->nBlockAlign; +- +- /* check if anything wrapped */ +- if(prebuf_bytes > 0){ +- prebuf_frames = prebuf_bytes / device->pwfx->nBlockAlign; +- +- hr = IAudioRenderClient_GetBuffer(device->render, prebuf_frames, &buffer); +- if(FAILED(hr)){ +- WARN("GetBuffer failed: %08x\n", hr); +- return; +- } +- +- memcpy(buffer, device->buffer, prebuf_frames * device->pwfx->nBlockAlign); + +- hr = IAudioRenderClient_ReleaseBuffer(device->render, prebuf_frames, 0); +- if(FAILED(hr)){ +- WARN("ReleaseBuffer failed: %08x\n", hr); +- return; +- } +- device->in_mmdev_bytes += prebuf_frames * device->pwfx->nBlockAlign; +- } +- +- TRACE("in_mmdev_bytes now = %i\n", device->in_mmdev_bytes); ++done: ++ device->pad += bytes; + } + + /** +@@ -710,7 +649,8 @@ static void DSOUND_WaveQueue(DirectSoundDevice *device, BOOL force) + */ + static void DSOUND_PerformMix(DirectSoundDevice *device) + { +- UINT32 pad, to_mix_frags, to_mix_bytes; ++ UINT32 pad, maxq, writepos; ++ DWORD block; + HRESULT hr; + + TRACE("(%p)\n", device); +@@ -724,147 +664,79 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) + LeaveCriticalSection(&device->mixlock); + return; + } +- +- to_mix_frags = device->prebuf - (pad * device->pwfx->nBlockAlign + device->fraglen - 1) / device->fraglen; +- +- to_mix_bytes = to_mix_frags * device->fraglen; +- +- if(device->in_mmdev_bytes > 0){ +- DWORD delta_bytes = min(to_mix_bytes, device->in_mmdev_bytes); +- device->in_mmdev_bytes -= delta_bytes; +- device->playing_offs_bytes += delta_bytes; +- device->playing_offs_bytes %= device->buflen; ++ block = device->pwfx->nBlockAlign; ++ pad *= block; ++ device->playpos += device->pad - pad; ++ device->playpos %= device->buflen; ++ device->pad = pad; ++ ++ maxq = device->aclen - pad; ++ if(!maxq){ ++ /* nothing to do! */ ++ LeaveCriticalSection(&device->mixlock); ++ return; + } ++ if (maxq > device->fraglen * 3) ++ maxq = device->fraglen * 3; ++ ++ writepos = (device->playpos + pad) % device->buflen; + + if (device->priolevel != DSSCL_WRITEPRIMARY) { +- BOOL recover = FALSE, all_stopped = FALSE; +- DWORD playpos, writepos, writelead, maxq, prebuff_max, prebuff_left, size1, size2; +- LPVOID buf1, buf2; ++ BOOL all_stopped = FALSE; + int nfiller; ++ DWORD bpp = device->pwfx->wBitsPerSample>>3; + + /* the sound of silence */ + nfiller = device->pwfx->wBitsPerSample == 8 ? 128 : 0; + +- /* get the position in the primary buffer */ +- if (DSOUND_PrimaryGetPosition(device, &playpos, &writepos) != 0){ +- LeaveCriticalSection(&(device->mixlock)); +- return; +- } +- +- TRACE("primary playpos=%d, writepos=%d, clrpos=%d, mixpos=%d, buflen=%d\n", +- playpos,writepos,device->playpos,device->mixpos,device->buflen); +- assert(device->playpos < device->buflen); +- +- /* calc maximum prebuff */ +- prebuff_max = (device->prebuf * device->fraglen); +- +- /* check how close we are to an underrun. It occurs when the writepos overtakes the mixpos */ +- prebuff_left = DSOUND_BufPtrDiff(device->buflen, device->mixpos, playpos); +- writelead = DSOUND_BufPtrDiff(device->buflen, writepos, playpos); +- + /* check for underrun. underrun occurs when the write position passes the mix position + * also wipe out just-played sound data */ +- if((prebuff_left > prebuff_max) || (device->state == STATE_STOPPED) || (device->state == STATE_STARTING)){ +- if (device->state == STATE_STOPPING || device->state == STATE_PLAYING) +- WARN("Probable buffer underrun\n"); +- else TRACE("Buffer starting or buffer underrun\n"); +- +- /* recover mixing for all buffers */ +- recover = TRUE; +- +- /* reset mix position to write position */ +- device->mixpos = writepos; +- +- ZeroMemory(device->buffer, device->buflen); +- } else if (playpos < device->playpos) { +- buf1 = device->buffer + device->playpos; +- buf2 = device->buffer; +- size1 = device->buflen - device->playpos; +- size2 = playpos; +- FillMemory(buf1, size1, nfiller); +- if (playpos && (!buf2 || !size2)) +- FIXME("%d: (%d, %d)=>(%d, %d) There should be an additional buffer here!!\n", __LINE__, device->playpos, device->mixpos, playpos, writepos); +- FillMemory(buf2, size2, nfiller); +- } else { +- buf1 = device->buffer + device->playpos; +- buf2 = NULL; +- size1 = playpos - device->playpos; +- size2 = 0; +- FillMemory(buf1, size1, nfiller); ++ if (!pad) ++ WARN("Probable buffer underrun\n"); ++ else if (device->state == STATE_STOPPED || ++ device->state == STATE_STARTING) { ++ TRACE("Buffer restarting\n"); + } +- device->playpos = playpos; +- +- /* find the maximum we can prebuffer from current write position */ +- maxq = (writelead < prebuff_max) ? (prebuff_max - writelead) : 0; + +- TRACE("prebuff_left = %d, prebuff_max = %dx%d=%d, writelead=%d\n", +- prebuff_left, device->prebuf, device->fraglen, prebuff_max, writelead); +- +- ZeroMemory(device->mix_buffer, device->mix_buffer_len); ++ memset(device->mix_buffer, nfiller, maxq); + + /* do the mixing */ +- DSOUND_MixToPrimary(device, writepos, maxq, recover, &all_stopped); ++ DSOUND_MixToPrimary(device, device->mix_buffer, writepos, maxq, &all_stopped); + +- if (maxq + writepos > device->buflen) +- { ++ if (maxq + writepos > device->buflen) { + DWORD todo = device->buflen - writepos; +- DWORD offs_float = (todo / device->pwfx->nBlockAlign) * device->pwfx->nChannels; +- device->normfunction(device->mix_buffer, device->buffer + writepos, todo); +- device->normfunction(device->mix_buffer + offs_float, device->buffer, maxq - todo); +- } +- else +- device->normfunction(device->mix_buffer, device->buffer + writepos, maxq); + +- /* update the mix position, taking wrap-around into account */ +- device->mixpos = writepos + maxq; +- device->mixpos %= device->buflen; +- +- /* update prebuff left */ +- prebuff_left = DSOUND_BufPtrDiff(device->buflen, device->mixpos, playpos); +- +- /* check if have a whole fragment */ +- if (prebuff_left >= device->fraglen){ ++ device->normfunction(device->mix_buffer, device->buffer + writepos, todo); ++ DSOUND_WaveQueue(device, device->buffer + writepos, todo); + +- /* update the wave queue */ +- DSOUND_WaveQueue(device, FALSE); ++ device->normfunction(device->mix_buffer + todo / bpp, device->buffer, (maxq - todo)); ++ DSOUND_WaveQueue(device, device->buffer, maxq - todo); ++ } else { ++ device->normfunction(device->mix_buffer, device->buffer + writepos, maxq); ++ DSOUND_WaveQueue(device, device->buffer + writepos, maxq); ++ } + +- /* buffers are full. start playing if applicable */ +- if(device->state == STATE_STARTING){ +- TRACE("started primary buffer\n"); +- if(DSOUND_PrimaryPlay(device) != DS_OK){ ++ if (maxq) { ++ if (device->state == STATE_STARTING || ++ device->state == STATE_STOPPED) { ++ if(DSOUND_PrimaryPlay(device) != DS_OK) + WARN("DSOUND_PrimaryPlay failed\n"); +- } +- else{ +- /* we are playing now */ ++ else if (device->state == STATE_STARTING) + device->state = STATE_PLAYING; +- } +- } +- +- /* buffers are full. start stopping if applicable */ +- if(device->state == STATE_STOPPED){ +- TRACE("restarting primary buffer\n"); +- if(DSOUND_PrimaryPlay(device) != DS_OK){ +- WARN("DSOUND_PrimaryPlay failed\n"); +- } +- else{ +- /* start stopping again. as soon as there is no more data, it will stop */ ++ else + device->state = STATE_STOPPING; +- } + } +- } +- +- /* if device was stopping, its for sure stopped when all buffers have stopped */ +- else if (all_stopped && (device->state == STATE_STOPPING)) { +- TRACE("All buffers have stopped. Stopping primary buffer\n"); ++ } else if (!pad && !maxq && (all_stopped == TRUE) && ++ (device->state == STATE_STOPPING)) { + device->state = STATE_STOPPED; +- +- /* stop the primary buffer now */ + DSOUND_PrimaryStop(device); + } +- + } else if (device->state != STATE_STOPPED) { +- +- DSOUND_WaveQueue(device, TRUE); ++ if (writepos + maxq > device->buflen) { ++ DSOUND_WaveQueue(device, device->buffer + writepos, device->buflen - writepos); ++ DSOUND_WaveQueue(device, device->buffer, writepos + maxq - device->buflen); ++ } else ++ DSOUND_WaveQueue(device, device->buffer + writepos, maxq); + + /* in the DSSCL_WRITEPRIMARY mode, the app is totally in charge... */ + if (device->state == STATE_STARTING) { +diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c +index 3f8a478..19a76b0 100644 +--- a/dlls/dsound/primary.c ++++ b/dlls/dsound/primary.c +@@ -40,24 +40,6 @@ + + WINE_DEFAULT_DEBUG_CHANNEL(dsound); + +-static DWORD DSOUND_fraglen(DirectSoundDevice *device) +-{ +- REFERENCE_TIME period; +- HRESULT hr; +- DWORD ret; +- +- hr = IAudioClient_GetDevicePeriod(device->client, &period, NULL); +- if(FAILED(hr)){ +- /* just guess at 10ms */ +- WARN("GetDevicePeriod failed: %08x\n", hr); +- ret = MulDiv(device->pwfx->nBlockAlign, device->pwfx->nSamplesPerSec, 100); +- }else +- ret = MulDiv(device->pwfx->nSamplesPerSec * device->pwfx->nBlockAlign, period, 10000000); +- +- ret -= ret % device->pwfx->nBlockAlign; +- return ret; +-} +- + static DWORD speaker_config_to_channel_mask(DWORD speaker_config) + { + switch (DSSPEAKER_CONFIG(speaker_config)) { +@@ -217,11 +199,10 @@ static HRESULT DSOUND_WaveFormat(DirectSoundDevice *device, IAudioClient *client + + HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) + { +- UINT prebuf_frames; +- REFERENCE_TIME prebuf_rt; + WAVEFORMATEX *wfx = NULL; + HRESULT hres; +- REFERENCE_TIME period; ++ REFERENCE_TIME period, buflen = 800000; ++ UINT32 frames; + DWORD period_ms; + + TRACE("(%p, %d)\n", device, forcewave); +@@ -243,6 +224,12 @@ HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) + device->volume = NULL; + } + ++ if (device->pad) { ++ device->playpos += device->pad; ++ device->playpos %= device->buflen; ++ device->pad = 0; ++ } ++ + hres = IMMDevice_Activate(device->mmdevice, &IID_IAudioClient, + CLSCTX_INPROC_SERVER, NULL, (void **)&device->client); + if(FAILED(hres)) { +@@ -263,12 +250,9 @@ HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) + HeapFree(GetProcessHeap(), 0, device->pwfx); + device->pwfx = wfx; + +- prebuf_frames = device->prebuf * DSOUND_fraglen(device) / device->pwfx->nBlockAlign; +- prebuf_rt = (10000000 * (UINT64)prebuf_frames) / device->pwfx->nSamplesPerSec; +- + hres = IAudioClient_Initialize(device->client, + AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_NOPERSIST | +- AUDCLNT_STREAMFLAGS_EVENTCALLBACK, prebuf_rt, 0, device->pwfx, NULL); ++ AUDCLNT_STREAMFLAGS_EVENTCALLBACK, buflen, 0, device->pwfx, NULL); + if(FAILED(hres)){ + IAudioClient_Release(device->client); + device->client = NULL; +@@ -318,10 +302,19 @@ HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) + hres = IAudioClient_GetStreamLatency(device->client, &period); + if (FAILED(hres)) { + WARN("GetStreamLatency failed with %08x\n", hres); +- period_ms = 10; +- } else +- period_ms = (period + 9999) / 10000; +- TRACE("period %u ms fraglen %u prebuf %u\n", period_ms, device->fraglen, device->prebuf); ++ period = 100000; ++ } ++ period_ms = (period + 9999) / 10000; ++ ++ hres = IAudioClient_GetBufferSize(device->client, &frames); ++ if (FAILED(hres)) { ++ WARN("GetBufferSize failed with %08x\n", hres); ++ frames = (UINT64)device->pwfx->nSamplesPerSec * buflen / 10000000; ++ } ++ ++ device->fraglen = MulDiv(device->pwfx->nSamplesPerSec, period, 10000000) * device->pwfx->nBlockAlign; ++ device->aclen = frames * device->pwfx->nBlockAlign; ++ TRACE("period %u ms fraglen %u buflen %u\n", period_ms, device->fraglen, device->aclen); + + if (period_ms < 3) + device->sleeptime = 5; +@@ -339,17 +332,11 @@ HRESULT DSOUND_PrimaryOpen(DirectSoundDevice *device) + + TRACE("(%p)\n", device); + +- device->fraglen = DSOUND_fraglen(device); +- + /* on original windows, the buffer it set to a fixed size, no matter what the settings are. + on windows this size is always fixed (tested on win-xp) */ + if (!device->buflen) + device->buflen = ds_hel_buflen; + device->buflen -= device->buflen % device->pwfx->nBlockAlign; +- while(device->buflen < device->fraglen * device->prebuf){ +- device->buflen += ds_hel_buflen; +- device->buflen -= device->buflen % device->pwfx->nBlockAlign; +- } + + HeapFree(GetProcessHeap(), 0, device->mix_buffer); + device->mix_buffer_len = (device->buflen / (device->pwfx->wBitsPerSample / 8)) * sizeof(float); +@@ -419,9 +406,6 @@ static void DSOUND_PrimaryClose(DirectSoundDevice *device) + if(FAILED(hr)) + WARN("Stop failed: %08x\n", hr); + } +- +- /* clear the queue */ +- device->in_mmdev_bytes = 0; + } + + HRESULT DSOUND_PrimaryCreate(DirectSoundDevice *device) +@@ -496,32 +480,19 @@ HRESULT DSOUND_PrimaryStop(DirectSoundDevice *device) + return DS_OK; + } + +-HRESULT DSOUND_PrimaryGetPosition(DirectSoundDevice *device, LPDWORD playpos, LPDWORD writepos) +-{ +- TRACE("(%p,%p,%p)\n", device, playpos, writepos); +- +- /* check if playpos was requested */ +- if (playpos) +- *playpos = device->playing_offs_bytes; +- +- /* check if writepos was requested */ +- if (writepos) +- /* the writepos is the first non-queued position */ +- *writepos = (device->playing_offs_bytes + device->in_mmdev_bytes) % device->buflen; +- +- TRACE("playpos = %d, writepos = %d (%p, time=%d)\n", playpos?*playpos:-1, writepos?*writepos:-1, device, GetTickCount()); +- return DS_OK; +-} +- + WAVEFORMATEX *DSOUND_CopyFormat(const WAVEFORMATEX *wfex) + { + WAVEFORMATEX *pwfx; + if(wfex->wFormatTag == WAVE_FORMAT_PCM){ + pwfx = HeapAlloc(GetProcessHeap(), 0, sizeof(WAVEFORMATEX)); ++ if (!pwfx) ++ return NULL; + CopyMemory(pwfx, wfex, sizeof(PCMWAVEFORMAT)); + pwfx->cbSize = 0; + }else{ + pwfx = HeapAlloc(GetProcessHeap(), 0, sizeof(WAVEFORMATEX) + wfex->cbSize); ++ if (!pwfx) ++ return NULL; + CopyMemory(pwfx, wfex, sizeof(WAVEFORMATEX) + wfex->cbSize); + } + +@@ -608,8 +579,12 @@ done: + else + HeapFree(GetProcessHeap(), 0, old_fmt); + } else { +- HeapFree(GetProcessHeap(), 0, device->primary_pwfx); +- device->primary_pwfx = DSOUND_CopyFormat(passed_fmt); ++ WAVEFORMATEX *wfx = DSOUND_CopyFormat(passed_fmt); ++ if (wfx) { ++ HeapFree(GetProcessHeap(), 0, device->primary_pwfx); ++ device->primary_pwfx = wfx; ++ } else ++ err = DSERR_OUTOFMEMORY; + } + + out: +@@ -840,7 +815,9 @@ static ULONG WINAPI PrimaryBufferImpl_Release(IDirectSoundBuffer *iface) + static HRESULT WINAPI PrimaryBufferImpl_GetCurrentPosition(IDirectSoundBuffer *iface, + DWORD *playpos, DWORD *writepos) + { +- HRESULT hres; ++ HRESULT hres = DS_OK; ++ UINT32 pad = 0; ++ UINT32 mixpos; + IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); + DirectSoundDevice *device = This->device; + TRACE("(%p,%p,%p)\n", iface, playpos, writepos); +@@ -848,17 +825,23 @@ static HRESULT WINAPI PrimaryBufferImpl_GetCurrentPosition(IDirectSoundBuffer *i + /* **** */ + EnterCriticalSection(&(device->mixlock)); + +- hres = DSOUND_PrimaryGetPosition(device, playpos, writepos); ++ if (device->client) ++ hres = IAudioClient_GetCurrentPadding(device->client, &pad); + if (hres != DS_OK) { +- WARN("DSOUND_PrimaryGetPosition failed\n"); ++ WARN("IAudioClient_GetCurrentPadding failed\n"); + LeaveCriticalSection(&(device->mixlock)); + return hres; + } ++ mixpos = (device->playpos + pad * device->pwfx->nBlockAlign) % device->buflen; ++ if (playpos) ++ *playpos = mixpos; + if (writepos) { +- if (device->state != STATE_STOPPED) ++ *writepos = mixpos; ++ if (device->state != STATE_STOPPED) { + /* apply the documented 10ms lead to writepos */ + *writepos += device->writelead; +- while (*writepos >= device->buflen) *writepos -= device->buflen; ++ *writepos %= device->buflen; ++ } + } + + LeaveCriticalSection(&(device->mixlock)); +-- +2.5.0 + diff -Nru wine1.7-1.7.50/debian/patches/0007-mmdevapi-be-stricter-about-tests.patch wine1.7-1.7.55/debian/patches/0007-mmdevapi-be-stricter-about-tests.patch --- wine1.7-1.7.50/debian/patches/0007-mmdevapi-be-stricter-about-tests.patch 2015-06-12 06:27:04.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0007-mmdevapi-be-stricter-about-tests.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,209 +0,0 @@ -From d1cb43d56fcb559c7aba63e592dbf90202ef0c0a Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:29 +0100 -Subject: [PATCH 07/50] mmdevapi: be stricter about tests - -Dont care about broken drivers.. ---- - dlls/mmdevapi/tests/capture.c | 8 ++--- - dlls/mmdevapi/tests/render.c | 77 +++++++++++++++++++------------------------ - 2 files changed, 37 insertions(+), 48 deletions(-) - -diff --git a/dlls/mmdevapi/tests/capture.c b/dlls/mmdevapi/tests/capture.c -index 702843c..8f0d626 100644 ---- a/dlls/mmdevapi/tests/capture.c -+++ b/dlls/mmdevapi/tests/capture.c -@@ -241,7 +241,7 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx) - ok(hr == S_OK, "Valid IAudioCaptureClient_GetBuffer returns %08x\n", hr); - ok(frames2 == frames, "GetBuffer after ReleaseBuffer(0) %u/%u\n", frames2, frames); - ok(pos2 == pos, "Position after ReleaseBuffer(0) %u/%u\n", (UINT)pos2, (UINT)pos); -- todo_wine ok(qpc2 == qpc, "HPC after ReleaseBuffer(0) %u vs. %u\n", (UINT)qpc2, (UINT)qpc); -+ ok(qpc2 == qpc, "HPC after ReleaseBuffer(0) %u vs. %u\n", (UINT)qpc2, (UINT)qpc); - } - - /* trace after the GCP test because log output to MS-DOS console disturbs timing */ -@@ -304,13 +304,13 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx) - - if(hr == S_OK){ - /* The discontinuity is reported here, but is this an old or new packet? */ -- todo_wine ok(flags & AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY, "expect DISCONTINUITY %x\n", flags); -+ ok(flags & AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY, "expect DISCONTINUITY %x\n", flags); - ok(pad == next, "GCP %u vs. BufferSize %u\n", (UINT32)pad, next); - - /* Native's position is one period further than what we read. - * Perhaps that's precisely the meaning of DATA_DISCONTINUITY: - * signal when the position jump left a gap. */ -- todo_wine ok(pos == sum + frames, "Position %u gap %d\n", -+ ok(pos == sum + frames, "Position %u gap %d\n", - (UINT)pos, (UINT)pos - sum); - if(flags & AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY) - sum = pos; -@@ -388,7 +388,7 @@ static void test_capture(IAudioClient *ac, HANDLE handle, WAVEFORMATEX *wfx) - /* Only PulseAudio goes here; despite snd_pcm_drop it manages - * to fill GetBufferSize with a single snd_pcm_read */ - trace("Test marked todo: only PulseAudio gets here\n"); -- todo_wine ok(flags & AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY, "expect DISCONTINUITY %x\n", flags); -+ ok(flags & AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY, "expect DISCONTINUITY %x\n", flags); - /* Reset zeroes padding, not the position */ - ok(pos >= sum, "Position %u last %u\n", (UINT)pos, sum); - /*sum = pos; check after next GetBuffer */ -diff --git a/dlls/mmdevapi/tests/render.c b/dlls/mmdevapi/tests/render.c -index 3a48c8d..a6f0c09 100644 ---- a/dlls/mmdevapi/tests/render.c -+++ b/dlls/mmdevapi/tests/render.c -@@ -983,7 +983,7 @@ static void test_clock(int share) - ok(hr == S_OK, "GetBuffer failed: %08x\n", hr); - trace("data at %p\n", data); - -- hr = IAudioRenderClient_ReleaseBuffer(arc, avail, winetest_debug>2 ? -+ hr = IAudioRenderClient_ReleaseBuffer(arc, avail, winetest_interactive ? - wave_generate_tone(pwfx, data, avail) : AUDCLNT_BUFFERFLAGS_SILENT); - ok(hr == S_OK, "ReleaseBuffer failed: %08x\n", hr); - if(hr == S_OK) sum += avail; -@@ -1020,8 +1020,7 @@ static void test_clock(int share) - ok(hr == S_OK, "GetPosition failed: %08x\n", hr); - ok(pos >= last, "Position %u vs. last %u\n", (UINT)pos,(UINT)last); - last = pos; -- if(/*share &&*/ winetest_debug>1) -- ok(pos*1000/freq <= slept*1.1, "Position %u too far after stop %ums\n", (UINT)pos, slept); -+ ok(pos*1000/freq <= slept*1.1, "Position %u too far after stop %ums\n", (UINT)pos, slept); - - hr = IAudioClient_Start(ac); /* #2 */ - ok(hr == S_OK, "Start failed: %08x\n", hr); -@@ -1054,12 +1053,11 @@ static void test_clock(int share) - ok(pos * pwfx->nSamplesPerSec <= sum * freq, "Position %u > written %u\n", (UINT)pos, sum); - /* Prove that Stop must not drop frames (in shared mode). */ - ok(pad ? pos > last : pos >= last, "Position %u vs. last %u\n", (UINT)pos,(UINT)last); -- if (share && pad > 0 && winetest_debug>1) -+ if (share && pad > 0) - ok(pos*1000/freq <= slept*1.1, "Position %u too far after playing %ums\n", (UINT)pos, slept); - /* in exclusive mode, testbot's w7 machines yield pos > sum-pad */ -- if(/*share &&*/ winetest_debug>1) -- ok(pos * pwfx->nSamplesPerSec == (sum-pad) * freq, -- "Position %u after stop vs. %u padding\n", (UINT)pos, pad); -+ ok(pos * pwfx->nSamplesPerSec == (sum-pad) * freq, -+ "Position %u after stop vs. %u padding\n", (UINT)pos, pad); - last = pos; - - Sleep(100); -@@ -1086,7 +1084,7 @@ static void test_clock(int share) - ok(hr == S_OK, "GetBuffer failed: %08x\n", hr); - trace("data at %p\n", data); - -- hr = IAudioRenderClient_ReleaseBuffer(arc, avail, winetest_debug>2 ? -+ hr = IAudioRenderClient_ReleaseBuffer(arc, avail, winetest_interactive ? - wave_generate_tone(pwfx, data, avail) : AUDCLNT_BUFFERFLAGS_SILENT); - ok(hr == S_OK, "ReleaseBuffer failed: %08x\n", hr); - if(hr == S_OK) sum += avail; -@@ -1111,10 +1109,7 @@ static void test_clock(int share) - trace("position %u past %ums sleep #3\n", (UINT)pos, slept); - ok(pos > last, "Position %u vs. last %u\n", (UINT)pos,(UINT)last); - ok(pos * pwfx->nSamplesPerSec <= sum * freq, "Position %u > written %u\n", (UINT)pos, sum); -- if (winetest_debug>1) -- ok(pos*1000/freq <= slept*1.1, "Position %u too far after playing %ums\n", (UINT)pos, slept); -- else -- skip("Rerun with WINETEST_DEBUG=2 for GetPosition tests.\n"); -+ ok(pos*1000/freq <= slept*1.1, "Position %u too far after playing %ums\n", (UINT)pos, slept); - last = pos; - - hr = IAudioClient_Reset(ac); -@@ -1132,11 +1127,10 @@ static void test_clock(int share) - ok(pos >= last, "Position %u vs. last %u\n", (UINT)pos,(UINT)last); - ok(pcpos > pcpos0, "pcpos should increase\n"); - ok(pos * pwfx->nSamplesPerSec <= sum * freq, "Position %u > written %u\n", (UINT)pos, sum); -- if (pad > 0 && winetest_debug>1) -+ if (pad > 0) - ok(pos*1000/freq <= slept*1.1, "Position %u too far after stop %ums\n", (UINT)pos, slept); -- if(winetest_debug>1) -- ok(pos * pwfx->nSamplesPerSec == (sum-pad) * freq, -- "Position %u after stop vs. %u padding\n", (UINT)pos, pad); -+ ok(pos * pwfx->nSamplesPerSec == (sum-pad) * freq, -+ "Position %u after stop vs. %u padding\n", (UINT)pos, pad); - last = pos; - - /* Begin the big loop */ -@@ -1159,19 +1153,17 @@ static void test_clock(int share) - ok(hr == S_OK, "GetBuffer failed: %08x\n", hr); - trace("data at %p for prefill %u\n", data, avail); - -- if (winetest_debug>2) { -- hr = IAudioClient_Stop(ac); -- ok(hr == S_OK, "Stop failed: %08x\n", hr); -+ hr = IAudioClient_Stop(ac); -+ ok(hr == S_OK, "Stop failed: %08x\n", hr); - -- Sleep(20); -- slept += 20; -+ Sleep(20); -+ slept += 20; - -- hr = IAudioClient_Reset(ac); -- ok(hr == AUDCLNT_E_BUFFER_OPERATION_PENDING, "Reset failed: %08x\n", hr); -+ hr = IAudioClient_Reset(ac); -+ ok(hr == AUDCLNT_E_BUFFER_OPERATION_PENDING, "Reset failed: %08x\n", hr); - -- hr = IAudioClient_Start(ac); -- ok(hr == S_OK, "Start failed: %08x\n", hr); -- } -+ hr = IAudioClient_Start(ac); -+ ok(hr == S_OK, "Start failed: %08x\n", hr); - - /* Despite passed time, data must still point to valid memory... */ - hr = IAudioRenderClient_ReleaseBuffer(arc, avail, -@@ -1216,14 +1208,13 @@ static void test_clock(int share) - trace("padding %u position %u/%u slept %ums iteration %d\n", pad, (UINT)pos, sum-pad, slept, i); - ok(pad ? pos > last : pos >= last, "No position increase at iteration %d\n", i); - ok(pos * pwfx->nSamplesPerSec <= sum * freq, "Position %u > written %u\n", (UINT)pos, sum); -- if (winetest_debug>1) { -- /* Padding does not lag behind by much */ -- ok(pos * pwfx->nSamplesPerSec <= (sum-pad+fragment) * freq, "Position %u > written %u\n", (UINT)pos, sum); -- ok(pos*1000/freq <= slept*1.1, "Position %u too far after %ums\n", (UINT)pos, slept); -- if (pad) /* not in case of underrun */ -- ok((pos-last)*1000/freq >= 90 && 110 >= (pos-last)*1000/freq, -- "Position delta %ld not regular: %ld ms\n", (long)(pos-last), (long)((pos-last)*1000/freq)); -- } -+ -+ /* Padding does not lag behind by much */ -+ ok(pos * pwfx->nSamplesPerSec <= (sum-pad+fragment) * freq, "Position %u > written %u\n", (UINT)pos, sum); -+ ok(pos*1000/freq <= slept*1.1, "Position %u too far after %ums\n", (UINT)pos, slept); -+ if (pad) /* not in case of underrun */ -+ ok((pos-last)*1000/freq >= 90 && 110 >= (pos-last)*1000/freq, -+ "Position delta %ld not regular\n", (long)(pos-last)); - last = pos; - - hr = IAudioClient_GetStreamLatency(ac, &t1); -@@ -2088,7 +2079,7 @@ static void test_worst_case(void) - hr = IAudioClock_GetFrequency(acl, &freq); - ok(hr == S_OK, "GetFrequency failed: %08x\n", hr); - -- for(j = 0; j <= (winetest_interactive ? 9 : 2); j++){ -+ for(j = 0; j < 10; j++){ - sum = 0; - trace("Should play %ums continuous tone with fragment size %u.\n", - (ULONG)(defp/100), fragment); -@@ -2097,15 +2088,13 @@ static void test_worst_case(void) - ok(hr == S_OK, "GetPosition failed: %08x\n", hr); - - /* XAudio2 prefills one period, play without it */ -- if(winetest_debug>2){ -- hr = IAudioRenderClient_GetBuffer(arc, fragment, &data); -- ok(hr == S_OK, "GetBuffer failed: %08x\n", hr); -- -- hr = IAudioRenderClient_ReleaseBuffer(arc, fragment, AUDCLNT_BUFFERFLAGS_SILENT); -- ok(hr == S_OK, "ReleaseBuffer failed: %08x\n", hr); -- if(hr == S_OK) -- sum += fragment; -- } -+ hr = IAudioRenderClient_GetBuffer(arc, fragment, &data); -+ ok(hr == S_OK, "GetBuffer failed: %08x\n", hr); -+ -+ hr = IAudioRenderClient_ReleaseBuffer(arc, fragment, AUDCLNT_BUFFERFLAGS_SILENT); -+ ok(hr == S_OK, "ReleaseBuffer failed: %08x\n", hr); -+ if(hr == S_OK) -+ sum += fragment; - - hr = IAudioClient_Start(ac); - ok(hr == S_OK, "Start failed: %08x\n", hr); --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0008-dsound-mix-float-natively.patch wine1.7-1.7.55/debian/patches/0008-dsound-mix-float-natively.patch --- wine1.7-1.7.50/debian/patches/0008-dsound-mix-float-natively.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0008-dsound-mix-float-natively.patch 2015-11-16 21:33:39.000000000 +0000 @@ -0,0 +1,78 @@ +From 9c6e2ef7756169c1ae9b973afbaae232a19b461d Mon Sep 17 00:00:00 2001 +From: Maarten Lankhorst +Date: Mon, 23 Mar 2015 09:14:33 +0100 +Subject: [PATCH 08/14] dsound: mix float natively + +--- + dlls/dsound/mixer.c | 43 ++++++++++++++++++++++++++++++++----------- + 1 file changed, 32 insertions(+), 11 deletions(-) + +diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c +index f650089..59ee21d 100644 +--- a/dlls/dsound/mixer.c ++++ b/dlls/dsound/mixer.c +@@ -684,6 +684,7 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) + if (device->priolevel != DSSCL_WRITEPRIMARY) { + BOOL all_stopped = FALSE; + int nfiller; ++ BOOL native = device->normfunction == normfunctions[4]; + DWORD bpp = device->pwfx->wBitsPerSample>>3; + + /* the sound of silence */ +@@ -698,22 +699,42 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) + TRACE("Buffer restarting\n"); + } + +- memset(device->mix_buffer, nfiller, maxq); ++ if (native) { ++ void *buffer = NULL; + +- /* do the mixing */ +- DSOUND_MixToPrimary(device, device->mix_buffer, writepos, maxq, &all_stopped); ++ hr = IAudioRenderClient_GetBuffer(device->render, maxq / block, (void*)&buffer); ++ if(FAILED(hr)){ ++ WARN("GetBuffer failed: %08x\n", hr); ++ LeaveCriticalSection(&device->mixlock); ++ return; ++ } ++ memset(buffer, nfiller, maxq); + +- if (maxq + writepos > device->buflen) { +- DWORD todo = device->buflen - writepos; ++ DSOUND_MixToPrimary(device, buffer, writepos, maxq, &all_stopped); + +- device->normfunction(device->mix_buffer, device->buffer + writepos, todo); +- DSOUND_WaveQueue(device, device->buffer + writepos, todo); ++ hr = IAudioRenderClient_ReleaseBuffer(device->render, maxq / block, 0); ++ if(FAILED(hr)) ++ ERR("ReleaseBuffer failed: %08x\n", hr); + +- device->normfunction(device->mix_buffer + todo / bpp, device->buffer, (maxq - todo)); +- DSOUND_WaveQueue(device, device->buffer, maxq - todo); ++ device->pad += maxq; + } else { +- device->normfunction(device->mix_buffer, device->buffer + writepos, maxq); +- DSOUND_WaveQueue(device, device->buffer + writepos, maxq); ++ memset(device->mix_buffer, nfiller, maxq); ++ ++ /* do the mixing */ ++ DSOUND_MixToPrimary(device, device->mix_buffer, writepos, maxq, &all_stopped); ++ ++ if (maxq + writepos > device->buflen) { ++ DWORD todo = device->buflen - writepos; ++ ++ device->normfunction(device->mix_buffer, device->buffer + writepos, todo); ++ DSOUND_WaveQueue(device, device->buffer + writepos, todo); ++ ++ device->normfunction(device->mix_buffer + todo / bpp, device->buffer, (maxq - todo)); ++ DSOUND_WaveQueue(device, device->buffer, maxq - todo); ++ } else { ++ device->normfunction(device->mix_buffer, device->buffer + writepos, maxq); ++ DSOUND_WaveQueue(device, device->buffer + writepos, maxq); ++ } + } + + if (maxq) { +-- +2.5.0 + diff -Nru wine1.7-1.7.50/debian/patches/0008-winepulse-Add-initial-stub-for-pulseaudio-support.patch wine1.7-1.7.55/debian/patches/0008-winepulse-Add-initial-stub-for-pulseaudio-support.patch --- wine1.7-1.7.50/debian/patches/0008-winepulse-Add-initial-stub-for-pulseaudio-support.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0008-winepulse-Add-initial-stub-for-pulseaudio-support.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,586 +0,0 @@ -From 055f41f734056267b45de8f3e4c93c8290184781 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:29 +0100 -Subject: [PATCH 08/50] winepulse: Add initial stub for pulseaudio support - ---- -Just the basic of initialization and pulseaudio mainloop support is -added here. ---- - configure | 98 +++++++++++- - configure.ac | 31 +++- - dlls/mmdevapi/main.c | 2 +- - dlls/winepulse.drv/Makefile.in | 7 + - dlls/winepulse.drv/mmdevdrv.c | 290 ++++++++++++++++++++++++++++++++++ - dlls/winepulse.drv/winepulse.drv.spec | 5 + - 6 files changed, 428 insertions(+), 5 deletions(-) - create mode 100644 dlls/winepulse.drv/Makefile.in - create mode 100644 dlls/winepulse.drv/mmdevdrv.c - create mode 100644 dlls/winepulse.drv/winepulse.drv.spec - -diff --git a/configure b/configure -index f47c09e..643a600 100755 ---- a/configure -+++ b/configure -@@ -653,6 +653,8 @@ OSS4_CFLAGS - ALSA_LIBS - GSTREAMER_LIBS - GSTREAMER_CFLAGS -+PULSEINCL -+PULSELIBS - GETTEXTPO_LIBS - Z_LIBS - FREETYPE_LIBS -@@ -827,6 +829,7 @@ with_oss - with_pcap - with_png - with_pthread -+with_pulse - with_sane - with_tiff - with_v4l -@@ -1310,6 +1313,7 @@ enable_winemapi - enable_winemp3_acm - enable_wineoss_drv - enable_wineps_drv -+enable_winepulse_drv - enable_wineqtdecoder - enable_winex11_drv - enable_wing32 -@@ -2153,6 +2157,7 @@ Optional Packages: - --without-pcap do not use the Packet Capture library - --without-png do not use PNG - --without-pthread do not use the pthread library -+ --without-pulse do not use PulseAudio sound support - --without-sane do not use SANE (scanner support) - --without-tiff do not use TIFF - --without-v4l do not use v4l1 (v4l support) -@@ -3400,6 +3405,12 @@ if test "${with_pthread+set}" = set; then : - fi - - -+# Check whether --with-pulse was given. -+if test "${with_pulse+set}" = set; then : -+ withval=$with_pulse; -+fi -+ -+ - # Check whether --with-sane was given. - if test "${with_sane+set}" = set; then : - withval=$with_sane; -@@ -12388,6 +12399,87 @@ esac - fi - fi - -+PULSELIBS="" -+ -+PULSEINCL="" -+ -+if test "x$with_pulse" != "xno"; -+then -+ ac_save_CPPFLAGS="$CPPFLAGS" -+ if test "$PKG_CONFIG" != "false"; -+ then -+ ac_pulse_libs="`$PKG_CONFIG --libs libpulse 2>/dev/null`" -+ ac_pulse_cflags="`$PKG_CONFIG --cflags-only-I libpulse 2>/dev/null`" -+ -+ CPPFLAGS="$CPPFLAGS $ac_pulse_cflags" -+ for ac_header in pulse/pulseaudio.h -+do : -+ ac_fn_c_check_header_mongrel "$LINENO" "pulse/pulseaudio.h" "ac_cv_header_pulse_pulseaudio_h" "$ac_includes_default" -+if test "x$ac_cv_header_pulse_pulseaudio_h" = xyes; then : -+ cat >>confdefs.h <<_ACEOF -+#define HAVE_PULSE_PULSEAUDIO_H 1 -+_ACEOF -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pa_stream_is_corked in -lpulse" >&5 -+$as_echo_n "checking for pa_stream_is_corked in -lpulse... " >&6; } -+if ${ac_cv_lib_pulse_pa_stream_is_corked+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-lpulse $ac_pulse_libs $LIBS" -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+/* Override any GCC internal prototype to avoid an error. -+ Use char because int might match the return type of a GCC -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char pa_stream_is_corked (); -+int -+main () -+{ -+return pa_stream_is_corked (); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ ac_cv_lib_pulse_pa_stream_is_corked=yes -+else -+ ac_cv_lib_pulse_pa_stream_is_corked=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pulse_pa_stream_is_corked" >&5 -+$as_echo "$ac_cv_lib_pulse_pa_stream_is_corked" >&6; } -+if test "x$ac_cv_lib_pulse_pa_stream_is_corked" = xyes; then : -+ -+$as_echo "#define HAVE_PULSEAUDIO 1" >>confdefs.h -+ -+ PULSELIBS="$ac_pulse_libs" -+ PULSEINCL="$ac_pulse_cflags" -+fi -+ -+ -+fi -+ -+done -+ -+ fi -+ CPPFLAGS="$ac_save_CPPFLAGS" -+fi -+if test "$ac_cv_lib_pulse_pa_stream_is_corked" != "yes"; then : -+ case "x$with_pulse" in -+ x) as_fn_append wine_warnings "|libpulse ${notice_platform}development files not found or too old, Pulse won't be supported." ;; -+ xno) ;; -+ *) as_fn_error $? "libpulse ${notice_platform}development files not found or too old, Pulse won't be supported. -+This is an error since --with-pulse was requested." "$LINENO" 5 ;; -+esac -+fi -+ - if test "x$with_gstreamer" != "xno" - then - if ${GSTREAMER_CFLAGS:+false} :; then : -@@ -13699,12 +13791,13 @@ fi - - test -n "$ALSA_LIBS" || enable_winealsa_drv=${enable_winealsa_drv:-no} - test -n "$COREAUDIO_LIBS" || enable_winecoreaudio_drv=${enable_winecoreaudio_drv:-no} -+test -n "$PULSELIBS" || enable_winepulse_drv=${enable_winepulse_drv:-no} - test "x$ac_cv_member_oss_sysinfo_numaudioengines" = xyes || enable_wineoss_drv=${enable_wineoss_drv:-no} - test "$ac_cv_header_linux_joystick_h" = "yes" -o "$ac_cv_header_IOKit_hid_IOHIDLib_h" = "yes" || enable_winejoystick_drv=${enable_winejoystick_drv:-no} - --if test "x$ALSA_LIBS$COREAUDIO_LIBS" = "x" -a \ -+if test "x$ALSA_LIBS$COREAUDIO_LIBS$PULSELIBS" = "x" -a \ - "x$ac_cv_member_oss_sysinfo_numaudioengines" != xyes -a \ -- "x$with_alsa$with_coreaudio$with_oss" != xnonono -+ "x$with_alsa$with_coreaudio$with_oss$with_pulse" != xnononono - then - as_fn_append wine_warnings "|No sound system was found. Windows applications will be silent." - fi -@@ -17670,6 +17763,7 @@ wine_fn_config_dll winemp3.acm enable_winemp3_acm - wine_fn_config_dll wineoss.drv enable_wineoss_drv - wine_fn_config_dll wineps.drv enable_wineps_drv clean,po - wine_fn_config_dll wineps16.drv16 enable_win16 -+wine_fn_config_dll winepulse.drv enable_winepulse_drv - wine_fn_config_dll wineqtdecoder enable_wineqtdecoder - wine_fn_config_dll winex11.drv enable_winex11_drv - wine_fn_config_dll wing.dll16 enable_win16 -diff --git a/configure.ac b/configure.ac -index c61a975..53d8b28 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -72,6 +72,7 @@ AC_ARG_WITH(pcap, AS_HELP_STRING([--without-pcap],[do not use the Packet Ca - AC_ARG_WITH(png, AS_HELP_STRING([--without-png],[do not use PNG])) - AC_ARG_WITH(pthread, AS_HELP_STRING([--without-pthread],[do not use the pthread library]), - [if test "x$withval" = "xno"; then ac_cv_header_pthread_h=no; fi]) -+AC_ARG_WITH(pulse, AC_HELP_STRING([--without-pulse],[do not use PulseAudio sound support])) - AC_ARG_WITH(sane, AS_HELP_STRING([--without-sane],[do not use SANE (scanner support)])) - AC_ARG_WITH(tiff, AS_HELP_STRING([--without-tiff],[do not use TIFF])) - AC_ARG_WITH(v4l, AS_HELP_STRING([--without-v4l],[do not use v4l1 (v4l support)])) -@@ -1550,6 +1551,30 @@ then - [GetText ${notice_platform}development files not found (or too old), po files can't be rebuilt.]) - fi - -+dnl **** Check for PulseAudio **** -+AC_SUBST(PULSELIBS,"") -+AC_SUBST(PULSEINCL,"") -+if test "x$with_pulse" != "xno"; -+then -+ ac_save_CPPFLAGS="$CPPFLAGS" -+ if test "$PKG_CONFIG" != "false"; -+ then -+ ac_pulse_libs="`$PKG_CONFIG --libs libpulse 2>/dev/null`" -+ ac_pulse_cflags="`$PKG_CONFIG --cflags-only-I libpulse 2>/dev/null`" -+ -+ CPPFLAGS="$CPPFLAGS $ac_pulse_cflags" -+ AC_CHECK_HEADERS(pulse/pulseaudio.h, -+ [AC_CHECK_LIB(pulse, pa_stream_is_corked, -+ [AC_DEFINE(HAVE_PULSEAUDIO, 1, [Define if you have pulseaudio]) -+ PULSELIBS="$ac_pulse_libs" -+ PULSEINCL="$ac_pulse_cflags"],,$ac_pulse_libs) -+ ]) -+ fi -+ CPPFLAGS="$ac_save_CPPFLAGS" -+fi -+WINE_WARNING_WITH(pulse, [test "$ac_cv_lib_pulse_pa_stream_is_corked" != "yes"], -+ [libpulse ${notice_platform}development files not found or too old, Pulse won't be supported.]) -+ - dnl **** Check for gstreamer **** - if test "x$with_gstreamer" != "xno" - then -@@ -1768,13 +1793,14 @@ fi - dnl **** Disable unsupported winmm drivers **** - test -n "$ALSA_LIBS" || enable_winealsa_drv=${enable_winealsa_drv:-no} - test -n "$COREAUDIO_LIBS" || enable_winecoreaudio_drv=${enable_winecoreaudio_drv:-no} -+test -n "$PULSELIBS" || enable_winepulse_drv=${enable_winepulse_drv:-no} - test "x$ac_cv_member_oss_sysinfo_numaudioengines" = xyes || enable_wineoss_drv=${enable_wineoss_drv:-no} - test "$ac_cv_header_linux_joystick_h" = "yes" -o "$ac_cv_header_IOKit_hid_IOHIDLib_h" = "yes" || enable_winejoystick_drv=${enable_winejoystick_drv:-no} - - dnl **** Check for any sound system **** --if test "x$ALSA_LIBS$COREAUDIO_LIBS" = "x" -a \ -+if test "x$ALSA_LIBS$COREAUDIO_LIBS$PULSELIBS" = "x" -a \ - "x$ac_cv_member_oss_sysinfo_numaudioengines" != xyes -a \ -- "x$with_alsa$with_coreaudio$with_oss" != xnonono -+ "x$with_alsa$with_coreaudio$with_oss$with_pulse" != xnononono - then - WINE_WARNING([No sound system was found. Windows applications will be silent.]) - fi -@@ -3358,6 +3384,7 @@ WINE_CONFIG_DLL(winemp3.acm) - WINE_CONFIG_DLL(wineoss.drv) - WINE_CONFIG_DLL(wineps.drv,,[clean,po]) - WINE_CONFIG_DLL(wineps16.drv16,enable_win16) -+WINE_CONFIG_DLL(winepulse.drv) - WINE_CONFIG_DLL(wineqtdecoder) - WINE_CONFIG_DLL(winex11.drv) - WINE_CONFIG_DLL(wing.dll16,enable_win16) -diff --git a/dlls/mmdevapi/main.c b/dlls/mmdevapi/main.c -index 52cf6f1..aa4baa5 100644 ---- a/dlls/mmdevapi/main.c -+++ b/dlls/mmdevapi/main.c -@@ -113,7 +113,7 @@ static BOOL init_driver(void) - { - static const WCHAR drv_value[] = {'A','u','d','i','o',0}; - -- static WCHAR default_list[] = {'a','l','s','a',',','o','s','s',',', -+ static WCHAR default_list[] = {'p','u','l','s','e',',','a','l','s','a',',','o','s','s',',', - 'c','o','r','e','a','u','d','i','o',0}; - - DriverFuncs driver; -diff --git a/dlls/winepulse.drv/Makefile.in b/dlls/winepulse.drv/Makefile.in -new file mode 100644 -index 0000000..158bbc0 ---- /dev/null -+++ b/dlls/winepulse.drv/Makefile.in -@@ -0,0 +1,7 @@ -+MODULE = winepulse.drv -+IMPORTS = dxguid uuid winmm user32 advapi32 ole32 -+EXTRALIBS = @PULSELIBS@ $(PTHREAD_LIBS) -+EXTRAINCL = @PULSEINCL@ -+ -+C_SRCS = \ -+ mmdevdrv.c -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -new file mode 100644 -index 0000000..d187bdc ---- /dev/null -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -0,0 +1,290 @@ -+/* -+ * Copyright 2011-2012 Maarten Lankhorst -+ * Copyright 2010-2011 Maarten Lankhorst for CodeWeavers -+ * Copyright 2011 Andrew Eikum 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 -+ * -+ * Pulseaudio driver support.. hell froze over -+ */ -+ -+#define NONAMELESSUNION -+#define COBJMACROS -+#include "config.h" -+#include -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include -+ -+#include "windef.h" -+#include "winbase.h" -+#include "winnls.h" -+#include "winreg.h" -+#include "wine/debug.h" -+#include "wine/unicode.h" -+#include "wine/list.h" -+ -+#include "ole2.h" -+#include "dshow.h" -+#include "dsound.h" -+#include "propsys.h" -+ -+#include "initguid.h" -+#include "ks.h" -+#include "ksmedia.h" -+#include "mmdeviceapi.h" -+#include "audioclient.h" -+#include "endpointvolume.h" -+#include "audiopolicy.h" -+ -+#include "wine/list.h" -+ -+#define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER) -+ -+WINE_DEFAULT_DEBUG_CHANNEL(pulse); -+ -+static const REFERENCE_TIME MinimumPeriod = 30000; -+static const REFERENCE_TIME DefaultPeriod = 100000; -+ -+static pa_context *pulse_ctx; -+static pa_mainloop *pulse_ml; -+ -+static HANDLE pulse_thread; -+static pthread_mutex_t pulse_lock = PTHREAD_MUTEX_INITIALIZER; -+static pthread_cond_t pulse_cond = PTHREAD_COND_INITIALIZER; -+ -+static DWORD pulse_stream_volume; -+ -+const WCHAR pulse_keyW[] = {'S','o','f','t','w','a','r','e','\\', -+ 'W','i','n','e','\\','P','u','l','s','e',0}; -+const WCHAR pulse_streamW[] = { 'S','t','r','e','a','m','V','o','l',0 }; -+ -+BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved) -+{ -+ if (reason == DLL_PROCESS_ATTACH) { -+ HKEY key; -+ if (RegOpenKeyW(HKEY_CURRENT_USER, pulse_keyW, &key) == ERROR_SUCCESS) { -+ DWORD size = sizeof(pulse_stream_volume); -+ RegQueryValueExW(key, pulse_streamW, 0, NULL, -+ (BYTE*)&pulse_stream_volume, &size); -+ RegCloseKey(key); -+ } -+ DisableThreadLibraryCalls(dll); -+ } else if (reason == DLL_PROCESS_DETACH) { -+ if (pulse_ctx) { -+ pa_context_disconnect(pulse_ctx); -+ pa_context_unref(pulse_ctx); -+ } -+ if (pulse_ml) -+ pa_mainloop_quit(pulse_ml, 0); -+ CloseHandle(pulse_thread); -+ } -+ return TRUE; -+} -+ -+ -+static const WCHAR defaultW[] = {'P','u','l','s','e','a','u','d','i','o',0}; -+ -+/* Following pulseaudio design here, mainloop has the lock taken whenever -+ * it is handling something for pulse, and the lock is required whenever -+ * doing any pa_* call that can affect the state in any way -+ * -+ * pa_cond_wait is used when waiting on results, because the mainloop needs -+ * the same lock taken to affect the state -+ * -+ * This is basically the same as the pa_threaded_mainloop implementation, -+ * but that cannot be used because it uses pthread_create directly -+ * -+ * pa_threaded_mainloop_(un)lock -> pthread_mutex_(un)lock -+ * pa_threaded_mainloop_signal -> pthread_cond_signal -+ * pa_threaded_mainloop_wait -> pthread_cond_wait -+ */ -+ -+static int pulse_poll_func(struct pollfd *ufds, unsigned long nfds, int timeout, void *userdata) { -+ int r; -+ pthread_mutex_unlock(&pulse_lock); -+ r = poll(ufds, nfds, timeout); -+ pthread_mutex_lock(&pulse_lock); -+ return r; -+} -+ -+static DWORD CALLBACK pulse_mainloop_thread(void *tmp) { -+ int ret; -+ pulse_ml = pa_mainloop_new(); -+ pa_mainloop_set_poll_func(pulse_ml, pulse_poll_func, NULL); -+ pthread_mutex_lock(&pulse_lock); -+ pthread_cond_signal(&pulse_cond); -+ pa_mainloop_run(pulse_ml, &ret); -+ pthread_mutex_unlock(&pulse_lock); -+ pa_mainloop_free(pulse_ml); -+ CloseHandle(pulse_thread); -+ return ret; -+} -+ -+static void pulse_contextcallback(pa_context *c, void *userdata); -+ -+static HRESULT pulse_connect(void) -+{ -+ int len; -+ WCHAR path[PATH_MAX], *name; -+ char *str; -+ -+ if (!pulse_thread) -+ { -+ if (!(pulse_thread = CreateThread(NULL, 0, pulse_mainloop_thread, NULL, 0, NULL))) -+ { -+ ERR("Failed to create mainloop thread."); -+ return E_FAIL; -+ } -+ SetThreadPriority(pulse_thread, THREAD_PRIORITY_TIME_CRITICAL); -+ pthread_cond_wait(&pulse_cond, &pulse_lock); -+ } -+ -+ if (pulse_ctx && PA_CONTEXT_IS_GOOD(pa_context_get_state(pulse_ctx))) -+ return S_OK; -+ if (pulse_ctx) -+ pa_context_unref(pulse_ctx); -+ -+ GetModuleFileNameW(NULL, path, sizeof(path)/sizeof(*path)); -+ name = strrchrW(path, '\\'); -+ if (!name) -+ name = path; -+ else -+ name++; -+ len = WideCharToMultiByte(CP_UNIXCP, 0, name, -1, NULL, 0, NULL, NULL); -+ str = pa_xmalloc(len); -+ WideCharToMultiByte(CP_UNIXCP, 0, name, -1, str, len, NULL, NULL); -+ TRACE("Name: %s\n", str); -+ pulse_ctx = pa_context_new(pa_mainloop_get_api(pulse_ml), str); -+ pa_xfree(str); -+ if (!pulse_ctx) { -+ ERR("Failed to create context\n"); -+ return E_FAIL; -+ } -+ -+ pa_context_set_state_callback(pulse_ctx, pulse_contextcallback, NULL); -+ -+ TRACE("libpulse protocol version: %u. API Version %u\n", pa_context_get_protocol_version(pulse_ctx), PA_API_VERSION); -+ if (pa_context_connect(pulse_ctx, NULL, 0, NULL) < 0) -+ goto fail; -+ -+ /* Wait for connection */ -+ while (pthread_cond_wait(&pulse_cond, &pulse_lock)) { -+ pa_context_state_t state = pa_context_get_state(pulse_ctx); -+ -+ if (state == PA_CONTEXT_FAILED || state == PA_CONTEXT_TERMINATED) -+ goto fail; -+ -+ if (state == PA_CONTEXT_READY) -+ break; -+ } -+ -+ TRACE("Connected to server %s with protocol version: %i.\n", -+ pa_context_get_server(pulse_ctx), -+ pa_context_get_server_protocol_version(pulse_ctx)); -+ return S_OK; -+ -+fail: -+ pa_context_unref(pulse_ctx); -+ pulse_ctx = NULL; -+ return E_FAIL; -+} -+ -+static void pulse_contextcallback(pa_context *c, void *userdata) { -+ switch (pa_context_get_state(c)) { -+ default: -+ FIXME("Unhandled state: %i\n", pa_context_get_state(c)); -+ case PA_CONTEXT_CONNECTING: -+ case PA_CONTEXT_UNCONNECTED: -+ case PA_CONTEXT_AUTHORIZING: -+ case PA_CONTEXT_SETTING_NAME: -+ case PA_CONTEXT_TERMINATED: -+ TRACE("State change to %i\n", pa_context_get_state(c)); -+ return; -+ -+ case PA_CONTEXT_READY: -+ TRACE("Ready\n"); -+ break; -+ -+ case PA_CONTEXT_FAILED: -+ ERR("Context failed: %s\n", pa_strerror(pa_context_errno(c))); -+ break; -+ } -+ pthread_cond_signal(&pulse_cond); -+} -+ -+HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids, void ***keys, -+ UINT *num, UINT *def_index) -+{ -+ HRESULT hr = S_OK; -+ TRACE("%d %p %p %p\n", flow, ids, num, def_index); -+ -+ pthread_mutex_lock(&pulse_lock); -+ hr = pulse_connect(); -+ pthread_mutex_unlock(&pulse_lock); -+ if (FAILED(hr)) -+ return hr; -+ *num = 1; -+ *def_index = 0; -+ -+ *ids = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR *)); -+ if (!*ids) -+ return E_OUTOFMEMORY; -+ -+ (*ids)[0] = HeapAlloc(GetProcessHeap(), 0, sizeof(defaultW)); -+ if (!(*ids)[0]) { -+ HeapFree(GetProcessHeap(), 0, *ids); -+ return E_OUTOFMEMORY; -+ } -+ -+ lstrcpyW((*ids)[0], defaultW); -+ -+ *keys = HeapAlloc(GetProcessHeap(), 0, sizeof(void *)); -+ (*keys)[0] = NULL; -+ -+ return S_OK; -+} -+ -+int WINAPI AUDDRV_GetPriority(void) -+{ -+ HRESULT hr; -+ pthread_mutex_lock(&pulse_lock); -+ hr = pulse_connect(); -+ pthread_mutex_unlock(&pulse_lock); -+ return SUCCEEDED(hr) ? 3 : 0; -+} -+ -+HRESULT WINAPI AUDDRV_GetAudioEndpoint(void *key, IMMDevice *dev, -+ EDataFlow dataflow, IAudioClient **out) -+{ -+ TRACE("%p %p %d %p\n", key, dev, dataflow, out); -+ if (dataflow != eRender && dataflow != eCapture) -+ return E_UNEXPECTED; -+ -+ *out = NULL; -+ return E_NOTIMPL; -+} -+ -+HRESULT WINAPI AUDDRV_GetAudioSessionManager(IMMDevice *device, -+ IAudioSessionManager2 **out) -+{ -+ *out = NULL; -+ return E_NOTIMPL; -+} -diff --git a/dlls/winepulse.drv/winepulse.drv.spec b/dlls/winepulse.drv/winepulse.drv.spec -new file mode 100644 -index 0000000..a089166 ---- /dev/null -+++ b/dlls/winepulse.drv/winepulse.drv.spec -@@ -0,0 +1,5 @@ -+# MMDevAPI driver functions -+@ stdcall -private GetPriority() AUDDRV_GetPriority -+@ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs -+@ stdcall -private GetAudioEndpoint(ptr ptr long ptr) AUDDRV_GetAudioEndpoint -+@ stdcall -private GetAudioSessionManager(ptr ptr) AUDDRV_GetAudioSessionManager --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0009-dsound-fixup-DSOUND_WaveQueue-checks.patch wine1.7-1.7.55/debian/patches/0009-dsound-fixup-DSOUND_WaveQueue-checks.patch --- wine1.7-1.7.50/debian/patches/0009-dsound-fixup-DSOUND_WaveQueue-checks.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0009-dsound-fixup-DSOUND_WaveQueue-checks.patch 2015-11-16 21:33:39.000000000 +0000 @@ -0,0 +1,40 @@ +From d32f874be3a4d27111acdc61e375dca6776bbdba Mon Sep 17 00:00:00 2001 +From: Maarten Lankhorst +Date: Mon, 23 Mar 2015 09:14:33 +0100 +Subject: [PATCH 09/14] dsound: fixup DSOUND_WaveQueue checks + +If you're going to be silly, you should go all the way. :P +--- + dlls/dsound/mixer.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c +index 59ee21d..c763650 100644 +--- a/dlls/dsound/mixer.c ++++ b/dlls/dsound/mixer.c +@@ -621,16 +621,18 @@ static void DSOUND_WaveQueue(DirectSoundDevice *device, LPBYTE pos, DWORD bytes) + hr = IAudioRenderClient_GetBuffer(device->render, bytes / device->pwfx->nBlockAlign, &buffer); + if(FAILED(hr)){ + WARN("GetBuffer failed: %08x\n", hr); +- goto done; ++ return; + } + + memcpy(buffer, pos, bytes); + + hr = IAudioRenderClient_ReleaseBuffer(device->render, bytes / device->pwfx->nBlockAlign, 0); +- if(FAILED(hr)) +- WARN("ReleaseBuffer failed: %08x\n", hr); ++ if(FAILED(hr)) { ++ ERR("ReleaseBuffer failed: %08x\n", hr); ++ IAudioRenderClient_ReleaseBuffer(device->render, 0, 0); ++ return; ++ } + +-done: + device->pad += bytes; + } + +-- +2.5.0 + diff -Nru wine1.7-1.7.50/debian/patches/0009-winepulse-Add-format-and-period-probing.patch wine1.7-1.7.55/debian/patches/0009-winepulse-Add-format-and-period-probing.patch --- wine1.7-1.7.50/debian/patches/0009-winepulse-Add-format-and-period-probing.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0009-winepulse-Add-format-and-period-probing.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,172 +0,0 @@ -From b8a18ea660dc9015cf7bb1e91de3a62cbe0f5616 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:29 +0100 -Subject: [PATCH 09/50] winepulse: Add format and period probing - ---- - dlls/winepulse.drv/mmdevdrv.c | 128 ++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 128 insertions(+) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index d187bdc..40db26d 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -70,6 +70,10 @@ static HANDLE pulse_thread; - static pthread_mutex_t pulse_lock = PTHREAD_MUTEX_INITIALIZER; - static pthread_cond_t pulse_cond = PTHREAD_COND_INITIALIZER; - -+/* Mixer format + period times */ -+static WAVEFORMATEXTENSIBLE pulse_fmt[2]; -+static REFERENCE_TIME pulse_min_period[2], pulse_def_period[2]; -+ - static DWORD pulse_stream_volume; - - const WCHAR pulse_keyW[] = {'S','o','f','t','w','a','r','e','\\', -@@ -139,6 +143,121 @@ static DWORD CALLBACK pulse_mainloop_thread(void *tmp) { - } - - static void pulse_contextcallback(pa_context *c, void *userdata); -+static void pulse_stream_state(pa_stream *s, void *user); -+ -+static const enum pa_channel_position pulse_pos_from_wfx[] = { -+ PA_CHANNEL_POSITION_FRONT_LEFT, -+ PA_CHANNEL_POSITION_FRONT_RIGHT, -+ PA_CHANNEL_POSITION_FRONT_CENTER, -+ PA_CHANNEL_POSITION_LFE, -+ PA_CHANNEL_POSITION_REAR_LEFT, -+ PA_CHANNEL_POSITION_REAR_RIGHT, -+ PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER, -+ PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER, -+ PA_CHANNEL_POSITION_REAR_CENTER, -+ PA_CHANNEL_POSITION_SIDE_LEFT, -+ PA_CHANNEL_POSITION_SIDE_RIGHT, -+ PA_CHANNEL_POSITION_TOP_CENTER, -+ PA_CHANNEL_POSITION_TOP_FRONT_LEFT, -+ PA_CHANNEL_POSITION_TOP_FRONT_CENTER, -+ PA_CHANNEL_POSITION_TOP_FRONT_RIGHT, -+ PA_CHANNEL_POSITION_TOP_REAR_LEFT, -+ PA_CHANNEL_POSITION_TOP_REAR_CENTER, -+ PA_CHANNEL_POSITION_TOP_REAR_RIGHT -+}; -+ -+static void pulse_probe_settings(int render, WAVEFORMATEXTENSIBLE *fmt) { -+ WAVEFORMATEX *wfx = &fmt->Format; -+ pa_stream *stream; -+ pa_channel_map map; -+ pa_sample_spec ss; -+ pa_buffer_attr attr; -+ int ret, i; -+ unsigned int length = 0; -+ -+ pa_channel_map_init_auto(&map, 2, PA_CHANNEL_MAP_ALSA); -+ ss.rate = 48000; -+ ss.format = PA_SAMPLE_FLOAT32LE; -+ ss.channels = map.channels; -+ -+ attr.maxlength = -1; -+ attr.tlength = -1; -+ attr.minreq = attr.fragsize = pa_frame_size(&ss); -+ attr.prebuf = 0; -+ -+ stream = pa_stream_new(pulse_ctx, "format test stream", &ss, &map); -+ if (stream) -+ pa_stream_set_state_callback(stream, pulse_stream_state, NULL); -+ if (!stream) -+ ret = -1; -+ else if (render) -+ ret = pa_stream_connect_playback(stream, NULL, &attr, -+ PA_STREAM_START_CORKED|PA_STREAM_FIX_RATE|PA_STREAM_FIX_CHANNELS|PA_STREAM_EARLY_REQUESTS, NULL, NULL); -+ else -+ ret = pa_stream_connect_record(stream, NULL, &attr, PA_STREAM_START_CORKED|PA_STREAM_FIX_RATE|PA_STREAM_FIX_CHANNELS|PA_STREAM_EARLY_REQUESTS); -+ if (ret >= 0) { -+ while (pa_stream_get_state(stream) == PA_STREAM_CREATING) -+ pthread_cond_wait(&pulse_cond, &pulse_lock); -+ if (pa_stream_get_state(stream) == PA_STREAM_READY) { -+ ss = *pa_stream_get_sample_spec(stream); -+ map = *pa_stream_get_channel_map(stream); -+ if (render) -+ length = pa_stream_get_buffer_attr(stream)->minreq; -+ else -+ length = pa_stream_get_buffer_attr(stream)->fragsize; -+ pa_stream_disconnect(stream); -+ while (pa_stream_get_state(stream) == PA_STREAM_READY) -+ pthread_cond_wait(&pulse_cond, &pulse_lock); -+ } -+ } -+ if (stream) -+ pa_stream_unref(stream); -+ if (length) -+ pulse_def_period[!render] = pulse_min_period[!render] = pa_bytes_to_usec(10 * length, &ss); -+ else -+ pulse_min_period[!render] = MinimumPeriod; -+ if (pulse_def_period[!render] <= DefaultPeriod) -+ pulse_def_period[!render] = DefaultPeriod; -+ -+ wfx->wFormatTag = WAVE_FORMAT_EXTENSIBLE; -+ wfx->cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX); -+ wfx->nChannels = ss.channels; -+ wfx->wBitsPerSample = 8 * pa_sample_size_of_format(ss.format); -+ wfx->nSamplesPerSec = ss.rate; -+ wfx->nBlockAlign = pa_frame_size(&ss); -+ wfx->nAvgBytesPerSec = wfx->nSamplesPerSec * wfx->nBlockAlign; -+ if (ss.format != PA_SAMPLE_S24_32LE) -+ fmt->Samples.wValidBitsPerSample = wfx->wBitsPerSample; -+ else -+ fmt->Samples.wValidBitsPerSample = 24; -+ if (ss.format == PA_SAMPLE_FLOAT32LE) -+ fmt->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; -+ else -+ fmt->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; -+ -+ fmt->dwChannelMask = 0; -+ for (i = 0; i < map.channels; ++i) -+ switch (map.map[i]) { -+ default: FIXME("Unhandled channel %s\n", pa_channel_position_to_string(map.map[i])); break; -+ case PA_CHANNEL_POSITION_FRONT_LEFT: fmt->dwChannelMask |= SPEAKER_FRONT_LEFT; break; -+ case PA_CHANNEL_POSITION_MONO: -+ case PA_CHANNEL_POSITION_FRONT_CENTER: fmt->dwChannelMask |= SPEAKER_FRONT_CENTER; break; -+ case PA_CHANNEL_POSITION_FRONT_RIGHT: fmt->dwChannelMask |= SPEAKER_FRONT_RIGHT; break; -+ case PA_CHANNEL_POSITION_REAR_LEFT: fmt->dwChannelMask |= SPEAKER_BACK_LEFT; break; -+ case PA_CHANNEL_POSITION_REAR_CENTER: fmt->dwChannelMask |= SPEAKER_BACK_CENTER; break; -+ case PA_CHANNEL_POSITION_REAR_RIGHT: fmt->dwChannelMask |= SPEAKER_BACK_RIGHT; break; -+ case PA_CHANNEL_POSITION_LFE: fmt->dwChannelMask |= SPEAKER_LOW_FREQUENCY; break; -+ case PA_CHANNEL_POSITION_SIDE_LEFT: fmt->dwChannelMask |= SPEAKER_SIDE_LEFT; break; -+ case PA_CHANNEL_POSITION_SIDE_RIGHT: fmt->dwChannelMask |= SPEAKER_SIDE_RIGHT; break; -+ case PA_CHANNEL_POSITION_TOP_CENTER: fmt->dwChannelMask |= SPEAKER_TOP_CENTER; break; -+ case PA_CHANNEL_POSITION_TOP_FRONT_LEFT: fmt->dwChannelMask |= SPEAKER_TOP_FRONT_LEFT; break; -+ case PA_CHANNEL_POSITION_TOP_FRONT_CENTER: fmt->dwChannelMask |= SPEAKER_TOP_FRONT_CENTER; break; -+ case PA_CHANNEL_POSITION_TOP_FRONT_RIGHT: fmt->dwChannelMask |= SPEAKER_TOP_FRONT_RIGHT; break; -+ case PA_CHANNEL_POSITION_TOP_REAR_LEFT: fmt->dwChannelMask |= SPEAKER_TOP_BACK_LEFT; break; -+ case PA_CHANNEL_POSITION_TOP_REAR_CENTER: fmt->dwChannelMask |= SPEAKER_TOP_BACK_CENTER; break; -+ case PA_CHANNEL_POSITION_TOP_REAR_RIGHT: fmt->dwChannelMask |= SPEAKER_TOP_BACK_RIGHT; break; -+ } -+} - - static HRESULT pulse_connect(void) - { -@@ -199,6 +318,8 @@ static HRESULT pulse_connect(void) - TRACE("Connected to server %s with protocol version: %i.\n", - pa_context_get_server(pulse_ctx), - pa_context_get_server_protocol_version(pulse_ctx)); -+ pulse_probe_settings(1, &pulse_fmt[0]); -+ pulse_probe_settings(0, &pulse_fmt[1]); - return S_OK; - - fail: -@@ -230,6 +351,13 @@ static void pulse_contextcallback(pa_context *c, void *userdata) { - pthread_cond_signal(&pulse_cond); - } - -+static void pulse_stream_state(pa_stream *s, void *user) -+{ -+ pa_stream_state_t state = pa_stream_get_state(s); -+ TRACE("Stream state changed to %i\n", state); -+ pthread_cond_signal(&pulse_cond); -+} -+ - HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids, void ***keys, - UINT *num, UINT *def_index) - { --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0010-dsound-fixup-IDirectSoundCaptureBuffer_QueryInterfac.patch wine1.7-1.7.55/debian/patches/0010-dsound-fixup-IDirectSoundCaptureBuffer_QueryInterfac.patch --- wine1.7-1.7.50/debian/patches/0010-dsound-fixup-IDirectSoundCaptureBuffer_QueryInterfac.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0010-dsound-fixup-IDirectSoundCaptureBuffer_QueryInterfac.patch 2015-11-16 21:33:39.000000000 +0000 @@ -0,0 +1,47 @@ +From aa95c73d64298c9ce661582cfd2df89a3ed95e24 Mon Sep 17 00:00:00 2001 +From: Maarten Lankhorst +Date: Mon, 23 Mar 2015 09:14:33 +0100 +Subject: [PATCH 10/14] dsound: fixup IDirectSoundCaptureBuffer_QueryInterface + +Don't expose v8, and actually respond to iunknown. +--- + dlls/dsound/capture.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/dlls/dsound/capture.c b/dlls/dsound/capture.c +index 0764261..412b59e 100644 +--- a/dlls/dsound/capture.c ++++ b/dlls/dsound/capture.c +@@ -50,7 +50,7 @@ typedef struct IDirectSoundCaptureBufferImpl + IDirectSoundCaptureBuffer8 IDirectSoundCaptureBuffer8_iface; + IDirectSoundNotify IDirectSoundNotify_iface; + LONG numIfaces; /* "in use interfaces" refcount */ +- LONG ref, refn; ++ LONG ref, refn, has_dsc8; + /* IDirectSoundCaptureBuffer fields */ + DirectSoundCaptureDevice *device; + DSCBUFFERDESC *pdscbd; +@@ -240,8 +240,9 @@ static HRESULT WINAPI IDirectSoundCaptureBufferImpl_QueryInterface(IDirectSoundC + + *ppobj = NULL; + +- if ( IsEqualGUID( &IID_IDirectSoundCaptureBuffer, riid ) || +- IsEqualGUID( &IID_IDirectSoundCaptureBuffer8, riid ) ) { ++ if ( IsEqualIID( &IID_IUnknown, riid ) || ++ IsEqualIID( &IID_IDirectSoundCaptureBuffer, riid ) || ++ (This->has_dsc8 && IsEqualIID( &IID_IDirectSoundCaptureBuffer8, riid )) ) { + IDirectSoundCaptureBuffer8_AddRef(iface); + *ppobj = iface; + return S_OK; +@@ -1233,6 +1234,8 @@ static HRESULT WINAPI IDirectSoundCaptureImpl_CreateCaptureBuffer(IDirectSoundCa + + if (hr != DS_OK) + WARN("IDirectSoundCaptureBufferImpl_Create failed\n"); ++ else ++ This->device->capture_buffer->has_dsc8 = This->has_dsc8; + + return hr; + } +-- +2.5.0 + diff -Nru wine1.7-1.7.50/debian/patches/0010-winepulse-Add-audioclient.patch wine1.7-1.7.55/debian/patches/0010-winepulse-Add-audioclient.patch --- wine1.7-1.7.50/debian/patches/0010-winepulse-Add-audioclient.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0010-winepulse-Add-audioclient.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,1098 +0,0 @@ -From b187bc62061a89210d090b46217fceb6b5c007db Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:29 +0100 -Subject: [PATCH 10/50] winepulse: Add audioclient - ---- -Without AudioRenderClient and AudioCaptureClient it won't work, -but it's easier to review ---- - dlls/winepulse.drv/mmdevdrv.c | 1041 ++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 1040 insertions(+), 1 deletion(-) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index 40db26d..37d85ff 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -103,9 +103,55 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved) - return TRUE; - } - -+typedef struct ACImpl ACImpl; -+ -+typedef struct _ACPacket { -+ struct list entry; -+ UINT64 qpcpos; -+ BYTE *data; -+ UINT32 discont; -+} ACPacket; -+ -+struct ACImpl { -+ IAudioClient IAudioClient_iface; -+ IAudioRenderClient IAudioRenderClient_iface; -+ IAudioCaptureClient IAudioCaptureClient_iface; -+ IAudioClock IAudioClock_iface; -+ IAudioClock2 IAudioClock2_iface; -+ IAudioStreamVolume IAudioStreamVolume_iface; -+ IMMDevice *parent; -+ struct list entry; -+ float vol[PA_CHANNELS_MAX]; -+ -+ LONG ref; -+ EDataFlow dataflow; -+ DWORD flags; -+ AUDCLNT_SHAREMODE share; -+ HANDLE event; -+ -+ UINT32 bufsize_frames, bufsize_bytes, locked, capture_period, pad, started, peek_ofs; -+ void *locked_ptr, *tmp_buffer; -+ -+ pa_stream *stream; -+ pa_sample_spec ss; -+ pa_channel_map map; -+ -+ INT64 clock_lastpos, clock_written; -+ pa_usec_t clock_pulse; -+ -+ struct list packet_free_head; -+ struct list packet_filled_head; -+}; - - static const WCHAR defaultW[] = {'P','u','l','s','e','a','u','d','i','o',0}; - -+static const IAudioClientVtbl AudioClient_Vtbl; -+ -+static inline ACImpl *impl_from_IAudioClient(IAudioClient *iface) -+{ -+ return CONTAINING_RECORD(iface, ACImpl, IAudioClient_iface); -+} -+ - /* Following pulseaudio design here, mainloop has the lock taken whenever - * it is handling something for pulse, and the lock is required whenever - * doing any pa_* call that can affect the state in any way -@@ -351,6 +397,192 @@ static void pulse_contextcallback(pa_context *c, void *userdata) { - pthread_cond_signal(&pulse_cond); - } - -+static HRESULT pulse_stream_valid(ACImpl *This) { -+ if (!This->stream) -+ return AUDCLNT_E_NOT_INITIALIZED; -+ if (!This->stream || pa_stream_get_state(This->stream) != PA_STREAM_READY) -+ return AUDCLNT_E_DEVICE_INVALIDATED; -+ return S_OK; -+} -+ -+static void dump_attr(const pa_buffer_attr *attr) { -+ TRACE("maxlength: %u\n", attr->maxlength); -+ TRACE("minreq: %u\n", attr->minreq); -+ TRACE("fragsize: %u\n", attr->fragsize); -+ TRACE("tlength: %u\n", attr->tlength); -+ TRACE("prebuf: %u\n", attr->prebuf); -+} -+ -+static void pulse_op_cb(pa_stream *s, int success, void *user) { -+ TRACE("Success: %i\n", success); -+ *(int*)user = success; -+ pthread_cond_signal(&pulse_cond); -+} -+ -+static void pulse_attr_update(pa_stream *s, void *user) { -+ const pa_buffer_attr *attr = pa_stream_get_buffer_attr(s); -+ TRACE("New attributes or device moved:\n"); -+ dump_attr(attr); -+} -+ -+static void pulse_wr_callback(pa_stream *s, size_t bytes, void *userdata) -+{ -+ ACImpl *This = userdata; -+ pa_usec_t time; -+ UINT32 oldpad = This->pad; -+ -+ if (bytes < This->bufsize_bytes) -+ This->pad = This->bufsize_bytes - bytes; -+ else -+ This->pad = 0; -+ -+ assert(oldpad >= This->pad); -+ -+ if (0 && This->pad && pa_stream_get_time(This->stream, &time) >= 0) -+ This->clock_pulse = time; -+ else -+ This->clock_pulse = PA_USEC_INVALID; -+ -+ This->clock_written += oldpad - This->pad; -+ TRACE("New pad: %u (-%u)\n", This->pad / pa_frame_size(&This->ss), (oldpad - This->pad) / pa_frame_size(&This->ss)); -+ -+ if (This->event) -+ SetEvent(This->event); -+} -+ -+static void pulse_underflow_callback(pa_stream *s, void *userdata) -+{ -+ ACImpl *This = userdata; -+ This->clock_pulse = PA_USEC_INVALID; -+ WARN("Underflow\n"); -+} -+ -+/* Latency is periodically updated even when nothing is played, -+ * because of PA_STREAM_AUTO_TIMING_UPDATE so use it as timer -+ * -+ * Perfect for passing all tests :) -+ */ -+static void pulse_latency_callback(pa_stream *s, void *userdata) -+{ -+ ACImpl *This = userdata; -+ if (!This->pad && This->event) -+ SetEvent(This->event); -+} -+ -+static void pulse_started_callback(pa_stream *s, void *userdata) -+{ -+ ACImpl *This = userdata; -+ pa_usec_t time; -+ -+ TRACE("(Re)started playing\n"); -+ assert(This->clock_pulse == PA_USEC_INVALID); -+ if (0 && pa_stream_get_time(This->stream, &time) >= 0) -+ This->clock_pulse = time; -+ if (This->event) -+ SetEvent(This->event); -+} -+ -+static void pulse_rd_loop(ACImpl *This, size_t bytes) -+{ -+ while (bytes >= This->capture_period) { -+ ACPacket *p, *next; -+ LARGE_INTEGER stamp, freq; -+ BYTE *dst, *src; -+ UINT32 src_len, copy, rem = This->capture_period; -+ if (!(p = (ACPacket*)list_head(&This->packet_free_head))) { -+ p = (ACPacket*)list_head(&This->packet_filled_head); -+ if (!p->discont) { -+ next = (ACPacket*)p->entry.next; -+ next->discont = 1; -+ } else -+ p = (ACPacket*)list_tail(&This->packet_filled_head); -+ assert(This->pad == This->bufsize_bytes); -+ } else { -+ assert(This->pad < This->bufsize_bytes); -+ This->pad += This->capture_period; -+ assert(This->pad <= This->bufsize_bytes); -+ } -+ QueryPerformanceCounter(&stamp); -+ QueryPerformanceFrequency(&freq); -+ p->qpcpos = (stamp.QuadPart * (INT64)10000000) / freq.QuadPart; -+ p->discont = 0; -+ list_remove(&p->entry); -+ list_add_tail(&This->packet_filled_head, &p->entry); -+ -+ dst = p->data; -+ while (rem) { -+ pa_stream_peek(This->stream, (const void**)&src, &src_len); -+ assert(src_len && src_len <= bytes); -+ assert(This->peek_ofs < src_len); -+ src += This->peek_ofs; -+ src_len -= This->peek_ofs; -+ -+ copy = rem; -+ if (copy > src_len) -+ copy = src_len; -+ memcpy(dst, src, rem); -+ src += copy; -+ src_len -= copy; -+ dst += copy; -+ rem -= copy; -+ -+ if (!src_len) { -+ This->peek_ofs = 0; -+ pa_stream_drop(This->stream); -+ } else -+ This->peek_ofs += copy; -+ } -+ bytes -= This->capture_period; -+ } -+} -+ -+static void pulse_rd_drop(ACImpl *This, size_t bytes) -+{ -+ while (bytes >= This->capture_period) { -+ UINT32 src_len, copy, rem = This->capture_period; -+ while (rem) { -+ const void *src; -+ pa_stream_peek(This->stream, &src, &src_len); -+ assert(src_len && src_len <= bytes); -+ assert(This->peek_ofs < src_len); -+ src_len -= This->peek_ofs; -+ -+ copy = rem; -+ if (copy > src_len) -+ copy = src_len; -+ -+ src_len -= copy; -+ rem -= copy; -+ -+ if (!src_len) { -+ This->peek_ofs = 0; -+ pa_stream_drop(This->stream); -+ } else -+ This->peek_ofs += copy; -+ bytes -= copy; -+ } -+ } -+} -+ -+static void pulse_rd_callback(pa_stream *s, size_t bytes, void *userdata) -+{ -+ ACImpl *This = userdata; -+ -+ TRACE("Readable total: %u, fragsize: %u\n", bytes, pa_stream_get_buffer_attr(s)->fragsize); -+ assert(bytes >= This->peek_ofs); -+ bytes -= This->peek_ofs; -+ if (bytes < This->capture_period) -+ return; -+ -+ if (This->started) -+ pulse_rd_loop(This, bytes); -+ else -+ pulse_rd_drop(This, bytes); -+ -+ if (This->event) -+ SetEvent(This->event); -+} -+ - static void pulse_stream_state(pa_stream *s, void *user) - { - pa_stream_state_t state = pa_stream_get_state(s); -@@ -358,6 +590,53 @@ static void pulse_stream_state(pa_stream *s, void *user) - pthread_cond_signal(&pulse_cond); - } - -+static HRESULT pulse_stream_connect(ACImpl *This, UINT32 period_bytes) { -+ int ret; -+ char buffer[64]; -+ static LONG number; -+ pa_buffer_attr attr; -+ if (This->stream) { -+ pa_stream_disconnect(This->stream); -+ while (pa_stream_get_state(This->stream) == PA_STREAM_READY) -+ pthread_cond_wait(&pulse_cond, &pulse_lock); -+ pa_stream_unref(This->stream); -+ } -+ ret = InterlockedIncrement(&number); -+ sprintf(buffer, "audio stream #%i", ret); -+ This->stream = pa_stream_new(pulse_ctx, buffer, &This->ss, &This->map); -+ pa_stream_set_state_callback(This->stream, pulse_stream_state, This); -+ pa_stream_set_buffer_attr_callback(This->stream, pulse_attr_update, This); -+ pa_stream_set_moved_callback(This->stream, pulse_attr_update, This); -+ -+ /* Pulseaudio will fill in correct values */ -+ attr.minreq = attr.fragsize = period_bytes; -+ attr.maxlength = attr.tlength = This->bufsize_bytes; -+ attr.prebuf = pa_frame_size(&This->ss); -+ dump_attr(&attr); -+ if (This->dataflow == eRender) -+ ret = pa_stream_connect_playback(This->stream, NULL, &attr, -+ PA_STREAM_START_CORKED|PA_STREAM_START_UNMUTED|PA_STREAM_AUTO_TIMING_UPDATE|PA_STREAM_INTERPOLATE_TIMING|PA_STREAM_EARLY_REQUESTS, NULL, NULL); -+ else -+ ret = pa_stream_connect_record(This->stream, NULL, &attr, -+ PA_STREAM_START_CORKED|PA_STREAM_START_UNMUTED|PA_STREAM_AUTO_TIMING_UPDATE|PA_STREAM_INTERPOLATE_TIMING|PA_STREAM_EARLY_REQUESTS); -+ if (ret < 0) { -+ WARN("Returns %i\n", ret); -+ return AUDCLNT_E_ENDPOINT_CREATE_FAILED; -+ } -+ while (pa_stream_get_state(This->stream) == PA_STREAM_CREATING) -+ pthread_cond_wait(&pulse_cond, &pulse_lock); -+ if (pa_stream_get_state(This->stream) != PA_STREAM_READY) -+ return AUDCLNT_E_ENDPOINT_CREATE_FAILED; -+ -+ if (This->dataflow == eRender) { -+ pa_stream_set_write_callback(This->stream, pulse_wr_callback, This); -+ pa_stream_set_underflow_callback(This->stream, pulse_underflow_callback, This); -+ pa_stream_set_started_callback(This->stream, pulse_started_callback, This); -+ } else -+ pa_stream_set_read_callback(This->stream, pulse_rd_callback, This); -+ return S_OK; -+} -+ - HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids, void ***keys, - UINT *num, UINT *def_index) - { -@@ -402,14 +681,774 @@ int WINAPI AUDDRV_GetPriority(void) - HRESULT WINAPI AUDDRV_GetAudioEndpoint(void *key, IMMDevice *dev, - EDataFlow dataflow, IAudioClient **out) - { -+ HRESULT hr; -+ ACImpl *This; -+ int i; -+ - TRACE("%p %p %d %p\n", key, dev, dataflow, out); - if (dataflow != eRender && dataflow != eCapture) - return E_UNEXPECTED; - - *out = NULL; -- return E_NOTIMPL; -+ pthread_mutex_lock(&pulse_lock); -+ hr = pulse_connect(); -+ pthread_mutex_unlock(&pulse_lock); -+ if (FAILED(hr)) -+ return hr; -+ -+ This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*This)); -+ if (!This) -+ return E_OUTOFMEMORY; -+ -+ This->IAudioClient_iface.lpVtbl = &AudioClient_Vtbl; -+ This->dataflow = dataflow; -+ This->parent = dev; -+ This->clock_pulse = PA_USEC_INVALID; -+ for (i = 0; i < PA_CHANNELS_MAX; ++i) -+ This->vol[i] = 1.f; -+ IMMDevice_AddRef(This->parent); -+ -+ *out = &This->IAudioClient_iface; -+ IAudioClient_AddRef(&This->IAudioClient_iface); -+ -+ return S_OK; -+} -+ -+static HRESULT WINAPI AudioClient_QueryInterface(IAudioClient *iface, -+ REFIID riid, void **ppv) -+{ -+ TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); -+ -+ if (!ppv) -+ return E_POINTER; -+ *ppv = NULL; -+ if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IAudioClient)) -+ *ppv = iface; -+ if (*ppv) { -+ IUnknown_AddRef((IUnknown*)*ppv); -+ return S_OK; -+ } -+ WARN("Unknown interface %s\n", debugstr_guid(riid)); -+ return E_NOINTERFACE; -+} -+ -+static ULONG WINAPI AudioClient_AddRef(IAudioClient *iface) -+{ -+ ACImpl *This = impl_from_IAudioClient(iface); -+ ULONG ref; -+ ref = InterlockedIncrement(&This->ref); -+ TRACE("(%p) Refcount now %u\n", This, ref); -+ return ref; -+} -+ -+static ULONG WINAPI AudioClient_Release(IAudioClient *iface) -+{ -+ ACImpl *This = impl_from_IAudioClient(iface); -+ ULONG ref; -+ ref = InterlockedDecrement(&This->ref); -+ TRACE("(%p) Refcount now %u\n", This, ref); -+ if (!ref) { -+ if (This->stream) { -+ pthread_mutex_lock(&pulse_lock); -+ if (PA_STREAM_IS_GOOD(pa_stream_get_state(This->stream))) { -+ pa_stream_disconnect(This->stream); -+ while (PA_STREAM_IS_GOOD(pa_stream_get_state(This->stream))) -+ pthread_cond_wait(&pulse_cond, &pulse_lock); -+ } -+ pa_stream_unref(This->stream); -+ This->stream = NULL; -+ list_remove(&This->entry); -+ pthread_mutex_unlock(&pulse_lock); -+ } -+ IMMDevice_Release(This->parent); -+ HeapFree(GetProcessHeap(), 0, This->tmp_buffer); -+ HeapFree(GetProcessHeap(), 0, This); -+ } -+ return ref; -+} -+ -+static void dump_fmt(const WAVEFORMATEX *fmt) -+{ -+ TRACE("wFormatTag: 0x%x (", fmt->wFormatTag); -+ switch(fmt->wFormatTag) { -+ case WAVE_FORMAT_PCM: -+ TRACE("WAVE_FORMAT_PCM"); -+ break; -+ case WAVE_FORMAT_IEEE_FLOAT: -+ TRACE("WAVE_FORMAT_IEEE_FLOAT"); -+ break; -+ case WAVE_FORMAT_EXTENSIBLE: -+ TRACE("WAVE_FORMAT_EXTENSIBLE"); -+ break; -+ default: -+ TRACE("Unknown"); -+ break; -+ } -+ TRACE(")\n"); -+ -+ TRACE("nChannels: %u\n", fmt->nChannels); -+ TRACE("nSamplesPerSec: %u\n", fmt->nSamplesPerSec); -+ TRACE("nAvgBytesPerSec: %u\n", fmt->nAvgBytesPerSec); -+ TRACE("nBlockAlign: %u\n", fmt->nBlockAlign); -+ TRACE("wBitsPerSample: %u\n", fmt->wBitsPerSample); -+ TRACE("cbSize: %u\n", fmt->cbSize); -+ -+ if (fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE) { -+ WAVEFORMATEXTENSIBLE *fmtex = (void*)fmt; -+ TRACE("dwChannelMask: %08x\n", fmtex->dwChannelMask); -+ TRACE("Samples: %04x\n", fmtex->Samples.wReserved); -+ TRACE("SubFormat: %s\n", wine_dbgstr_guid(&fmtex->SubFormat)); -+ } -+} -+ -+static WAVEFORMATEX *clone_format(const WAVEFORMATEX *fmt) -+{ -+ WAVEFORMATEX *ret; -+ size_t size; -+ -+ if (fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE) -+ size = sizeof(WAVEFORMATEXTENSIBLE); -+ else -+ size = sizeof(WAVEFORMATEX); -+ -+ ret = CoTaskMemAlloc(size); -+ if (!ret) -+ return NULL; -+ -+ memcpy(ret, fmt, size); -+ -+ ret->cbSize = size - sizeof(WAVEFORMATEX); -+ -+ return ret; -+} -+ -+static DWORD get_channel_mask(unsigned int channels) -+{ -+ switch(channels) { -+ case 0: -+ return 0; -+ case 1: -+ return SPEAKER_FRONT_CENTER; -+ case 2: -+ return SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT; -+ case 3: -+ return SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | -+ SPEAKER_LOW_FREQUENCY; -+ case 4: -+ return SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | -+ SPEAKER_BACK_RIGHT; -+ case 5: -+ return SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | -+ SPEAKER_BACK_RIGHT | SPEAKER_LOW_FREQUENCY; -+ case 6: -+ return SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | -+ SPEAKER_BACK_RIGHT | SPEAKER_LOW_FREQUENCY | SPEAKER_FRONT_CENTER; -+ case 7: -+ return SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | -+ SPEAKER_BACK_RIGHT | SPEAKER_LOW_FREQUENCY | SPEAKER_FRONT_CENTER | -+ SPEAKER_BACK_CENTER; -+ case 8: -+ return SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | -+ SPEAKER_BACK_RIGHT | SPEAKER_LOW_FREQUENCY | SPEAKER_FRONT_CENTER | -+ SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT; -+ } -+ FIXME("Unknown speaker configuration: %u\n", channels); -+ return 0; -+} -+ -+static HRESULT pulse_spec_from_waveformat(ACImpl *This, const WAVEFORMATEX *fmt) -+{ -+ pa_channel_map_init(&This->map); -+ This->ss.rate = fmt->nSamplesPerSec; -+ This->ss.format = PA_SAMPLE_INVALID; -+ switch(fmt->wFormatTag) { -+ case WAVE_FORMAT_IEEE_FLOAT: -+ if (!fmt->nChannels || fmt->nChannels > 2 || fmt->wBitsPerSample != 32) -+ break; -+ This->ss.format = PA_SAMPLE_FLOAT32LE; -+ pa_channel_map_init_auto(&This->map, fmt->nChannels, PA_CHANNEL_MAP_ALSA); -+ break; -+ case WAVE_FORMAT_PCM: -+ if (!fmt->nChannels || fmt->nChannels > 2) -+ break; -+ if (fmt->wBitsPerSample == 8) -+ This->ss.format = PA_SAMPLE_U8; -+ else if (fmt->wBitsPerSample == 16) -+ This->ss.format = PA_SAMPLE_S16LE; -+ pa_channel_map_init_auto(&This->map, fmt->nChannels, PA_CHANNEL_MAP_ALSA); -+ break; -+ case WAVE_FORMAT_EXTENSIBLE: { -+ WAVEFORMATEXTENSIBLE *wfe = (WAVEFORMATEXTENSIBLE*)fmt; -+ DWORD mask = wfe->dwChannelMask; -+ DWORD i = 0, j; -+ if (fmt->cbSize != (sizeof(*wfe) - sizeof(*fmt)) && fmt->cbSize != sizeof(*wfe)) -+ break; -+ if (IsEqualGUID(&wfe->SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT) && -+ (!wfe->Samples.wValidBitsPerSample || wfe->Samples.wValidBitsPerSample == 32) && -+ fmt->wBitsPerSample == 32) -+ This->ss.format = PA_SAMPLE_FLOAT32LE; -+ else if (IsEqualGUID(&wfe->SubFormat, &KSDATAFORMAT_SUBTYPE_PCM)) { -+ DWORD valid = wfe->Samples.wValidBitsPerSample; -+ if (!valid) -+ valid = fmt->wBitsPerSample; -+ if (!valid || valid > fmt->wBitsPerSample) -+ break; -+ switch (fmt->wBitsPerSample) { -+ case 8: -+ if (valid == 8) -+ This->ss.format = PA_SAMPLE_U8; -+ break; -+ case 16: -+ if (valid == 16) -+ This->ss.format = PA_SAMPLE_S16LE; -+ break; -+ case 24: -+ if (valid == 24) -+ This->ss.format = PA_SAMPLE_S24LE; -+ break; -+ case 32: -+ if (valid == 24) -+ This->ss.format = PA_SAMPLE_S24_32LE; -+ else if (valid == 32) -+ This->ss.format = PA_SAMPLE_S32LE; -+ default: -+ break; -+ } -+ } -+ This->map.channels = fmt->nChannels; -+ if (!mask) -+ mask = get_channel_mask(fmt->nChannels); -+ for (j = 0; j < sizeof(pulse_pos_from_wfx)/sizeof(*pulse_pos_from_wfx) && i < fmt->nChannels; ++j) { -+ if (mask & (1 << j)) -+ This->map.map[i++] = pulse_pos_from_wfx[j]; -+ } -+ -+ /* Special case for mono since pulse appears to map it differently */ -+ if (mask == SPEAKER_FRONT_CENTER) -+ This->map.map[0] = PA_CHANNEL_POSITION_MONO; -+ -+ if ((mask & SPEAKER_ALL) && i < fmt->nChannels) { -+ This->map.map[i++] = PA_CHANNEL_POSITION_MONO; -+ FIXME("Is the 'all' channel mapped correctly?\n"); -+ } -+ -+ if (i < fmt->nChannels || (mask & SPEAKER_RESERVED)) { -+ This->map.channels = 0; -+ ERR("Invalid channel mask: %i/%i and %x\n", i, fmt->nChannels, mask); -+ break; -+ } -+ break; -+ } -+ default: FIXME("Unhandled tag %x\n", fmt->wFormatTag); -+ } -+ This->ss.channels = This->map.channels; -+ if (!pa_channel_map_valid(&This->map) || This->ss.format == PA_SAMPLE_INVALID) { -+ ERR("Invalid format! Channel spec valid: %i, format: %i\n", pa_channel_map_valid(&This->map), This->ss.format); -+ dump_fmt(fmt); -+ return AUDCLNT_E_UNSUPPORTED_FORMAT; -+ } -+ return S_OK; - } - -+static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface, -+ AUDCLNT_SHAREMODE mode, DWORD flags, REFERENCE_TIME duration, -+ REFERENCE_TIME period, const WAVEFORMATEX *fmt, -+ const GUID *sessionguid) -+{ -+ ACImpl *This = impl_from_IAudioClient(iface); -+ HRESULT hr = S_OK; -+ UINT period_bytes; -+ -+ TRACE("(%p)->(%x, %x, %s, %s, %p, %s)\n", This, mode, flags, -+ wine_dbgstr_longlong(duration), wine_dbgstr_longlong(period), fmt, debugstr_guid(sessionguid)); -+ -+ if (!fmt) -+ return E_POINTER; -+ -+ if (mode != AUDCLNT_SHAREMODE_SHARED && mode != AUDCLNT_SHAREMODE_EXCLUSIVE) -+ return AUDCLNT_E_NOT_INITIALIZED; -+ if (mode == AUDCLNT_SHAREMODE_EXCLUSIVE) -+ return AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED; -+ -+ if (flags & ~(AUDCLNT_STREAMFLAGS_CROSSPROCESS | -+ AUDCLNT_STREAMFLAGS_LOOPBACK | -+ AUDCLNT_STREAMFLAGS_EVENTCALLBACK | -+ AUDCLNT_STREAMFLAGS_NOPERSIST | -+ AUDCLNT_STREAMFLAGS_RATEADJUST | -+ AUDCLNT_SESSIONFLAGS_EXPIREWHENUNOWNED | -+ AUDCLNT_SESSIONFLAGS_DISPLAY_HIDE | -+ AUDCLNT_SESSIONFLAGS_DISPLAY_HIDEWHENEXPIRED)) { -+ TRACE("Unknown flags: %08x\n", flags); -+ return E_INVALIDARG; -+ } -+ -+ pthread_mutex_lock(&pulse_lock); -+ if (This->stream) { -+ pthread_mutex_unlock(&pulse_lock); -+ return AUDCLNT_E_ALREADY_INITIALIZED; -+ } -+ -+ hr = pulse_spec_from_waveformat(This, fmt); -+ if (FAILED(hr)) -+ goto exit; -+ -+ if (mode == AUDCLNT_SHAREMODE_SHARED) { -+ period = pulse_def_period[This->dataflow == eCapture]; -+ if (duration < 2 * period) -+ duration = 2 * period; -+ } -+ period_bytes = pa_frame_size(&This->ss) * MulDiv(period, This->ss.rate, 10000000); -+ -+ if (duration < 20000000) -+ This->bufsize_frames = ceil((duration / 10000000.) * fmt->nSamplesPerSec); -+ else -+ This->bufsize_frames = 2 * fmt->nSamplesPerSec; -+ This->bufsize_bytes = This->bufsize_frames * pa_frame_size(&This->ss); -+ -+ This->share = mode; -+ This->flags = flags; -+ hr = pulse_stream_connect(This, period_bytes); -+ if (SUCCEEDED(hr)) { -+ UINT32 unalign; -+ const pa_buffer_attr *attr = pa_stream_get_buffer_attr(This->stream); -+ /* Update frames according to new size */ -+ dump_attr(attr); -+ if (This->dataflow == eRender) -+ This->bufsize_bytes = attr->tlength; -+ else { -+ This->capture_period = period_bytes = attr->fragsize; -+ if ((unalign = This->bufsize_bytes % period_bytes)) -+ This->bufsize_bytes += period_bytes - unalign; -+ } -+ This->bufsize_frames = This->bufsize_bytes / pa_frame_size(&This->ss); -+ } -+ if (SUCCEEDED(hr)) { -+ UINT32 i, capture_packets = This->capture_period ? This->bufsize_bytes / This->capture_period : 0; -+ This->tmp_buffer = HeapAlloc(GetProcessHeap(), 0, This->bufsize_bytes + capture_packets * sizeof(ACPacket)); -+ if (!This->tmp_buffer) -+ hr = E_OUTOFMEMORY; -+ else { -+ ACPacket *cur_packet = (ACPacket*)((char*)This->tmp_buffer + This->bufsize_bytes); -+ BYTE *data = This->tmp_buffer; -+ memset(This->tmp_buffer, This->ss.format == PA_SAMPLE_U8 ? 0x80 : 0, This->bufsize_bytes); -+ list_init(&This->packet_free_head); -+ list_init(&This->packet_filled_head); -+ for (i = 0; i < capture_packets; ++i, ++cur_packet) { -+ list_add_tail(&This->packet_free_head, &cur_packet->entry); -+ cur_packet->data = data; -+ data += This->capture_period; -+ } -+ assert(!This->capture_period || This->bufsize_bytes == This->capture_period * capture_packets); -+ assert(!capture_packets || data - This->bufsize_bytes == This->tmp_buffer); -+ } -+ } -+ -+exit: -+ if (FAILED(hr)) { -+ HeapFree(GetProcessHeap(), 0, This->tmp_buffer); -+ This->tmp_buffer = NULL; -+ if (This->stream) { -+ pa_stream_disconnect(This->stream); -+ pa_stream_unref(This->stream); -+ This->stream = NULL; -+ } -+ } -+ pthread_mutex_unlock(&pulse_lock); -+ return hr; -+} -+ -+static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient *iface, -+ UINT32 *out) -+{ -+ ACImpl *This = impl_from_IAudioClient(iface); -+ HRESULT hr; -+ -+ TRACE("(%p)->(%p)\n", This, out); -+ -+ if (!out) -+ return E_POINTER; -+ -+ pthread_mutex_lock(&pulse_lock); -+ hr = pulse_stream_valid(This); -+ if (SUCCEEDED(hr)) -+ *out = This->bufsize_frames; -+ pthread_mutex_unlock(&pulse_lock); -+ -+ return hr; -+} -+ -+static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient *iface, -+ REFERENCE_TIME *latency) -+{ -+ ACImpl *This = impl_from_IAudioClient(iface); -+ const pa_buffer_attr *attr; -+ REFERENCE_TIME lat; -+ HRESULT hr; -+ -+ TRACE("(%p)->(%p)\n", This, latency); -+ -+ if (!latency) -+ return E_POINTER; -+ -+ pthread_mutex_lock(&pulse_lock); -+ hr = pulse_stream_valid(This); -+ if (FAILED(hr)) { -+ pthread_mutex_unlock(&pulse_lock); -+ return hr; -+ } -+ attr = pa_stream_get_buffer_attr(This->stream); -+ if (This->dataflow == eRender) -+ lat = attr->minreq / pa_frame_size(&This->ss); -+ else -+ lat = attr->fragsize / pa_frame_size(&This->ss); -+ *latency = 10000000; -+ *latency *= lat; -+ *latency /= This->ss.rate; -+ pthread_mutex_unlock(&pulse_lock); -+ TRACE("Latency: %u ms\n", (DWORD)(*latency / 10000)); -+ return S_OK; -+} -+ -+static void ACImpl_GetRenderPad(ACImpl *This, UINT32 *out) -+{ -+ *out = This->pad / pa_frame_size(&This->ss); -+} -+ -+static void ACImpl_GetCapturePad(ACImpl *This, UINT32 *out) -+{ -+ ACPacket *packet = This->locked_ptr; -+ if (!packet && !list_empty(&This->packet_filled_head)) { -+ packet = (ACPacket*)list_head(&This->packet_filled_head); -+ This->locked_ptr = packet; -+ list_remove(&packet->entry); -+ } -+ if (out) -+ *out = This->pad / pa_frame_size(&This->ss); -+} -+ -+static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient *iface, -+ UINT32 *out) -+{ -+ ACImpl *This = impl_from_IAudioClient(iface); -+ HRESULT hr; -+ -+ TRACE("(%p)->(%p)\n", This, out); -+ -+ if (!out) -+ return E_POINTER; -+ -+ pthread_mutex_lock(&pulse_lock); -+ hr = pulse_stream_valid(This); -+ if (FAILED(hr)) { -+ pthread_mutex_unlock(&pulse_lock); -+ return hr; -+ } -+ -+ if (This->dataflow == eRender) -+ ACImpl_GetRenderPad(This, out); -+ else -+ ACImpl_GetCapturePad(This, out); -+ pthread_mutex_unlock(&pulse_lock); -+ -+ TRACE("%p Pad: %u ms (%u)\n", This, MulDiv(*out, 1000, This->ss.rate), *out); -+ return S_OK; -+} -+ -+static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface, -+ AUDCLNT_SHAREMODE mode, const WAVEFORMATEX *fmt, -+ WAVEFORMATEX **out) -+{ -+ ACImpl *This = impl_from_IAudioClient(iface); -+ HRESULT hr = S_OK; -+ WAVEFORMATEX *closest = NULL; -+ -+ TRACE("(%p)->(%x, %p, %p)\n", This, mode, fmt, out); -+ -+ if (!fmt || (mode == AUDCLNT_SHAREMODE_SHARED && !out)) -+ return E_POINTER; -+ -+ if (out) -+ *out = NULL; -+ if (mode != AUDCLNT_SHAREMODE_SHARED && mode != AUDCLNT_SHAREMODE_EXCLUSIVE) -+ return E_INVALIDARG; -+ if (mode == AUDCLNT_SHAREMODE_EXCLUSIVE) -+ return This->dataflow == eCapture ? AUDCLNT_E_UNSUPPORTED_FORMAT : AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED; -+ if (fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE && -+ fmt->cbSize < sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)) -+ return E_INVALIDARG; -+ -+ dump_fmt(fmt); -+ -+ closest = clone_format(fmt); -+ if (!closest) -+ hr = E_OUTOFMEMORY; -+ -+ if (hr == S_OK || !out) { -+ CoTaskMemFree(closest); -+ if (out) -+ *out = NULL; -+ } else if (closest) { -+ closest->nBlockAlign = -+ closest->nChannels * closest->wBitsPerSample / 8; -+ closest->nAvgBytesPerSec = -+ closest->nBlockAlign * closest->nSamplesPerSec; -+ *out = closest; -+ } -+ -+ TRACE("returning: %08x %p\n", hr, out ? *out : NULL); -+ return hr; -+} -+ -+static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface, -+ WAVEFORMATEX **pwfx) -+{ -+ ACImpl *This = impl_from_IAudioClient(iface); -+ WAVEFORMATEXTENSIBLE *fmt = &pulse_fmt[This->dataflow == eCapture]; -+ -+ TRACE("(%p)->(%p)\n", This, pwfx); -+ -+ if (!pwfx) -+ return E_POINTER; -+ -+ *pwfx = clone_format(&fmt->Format); -+ if (!*pwfx) -+ return E_OUTOFMEMORY; -+ dump_fmt(*pwfx); -+ return S_OK; -+} -+ -+static HRESULT WINAPI AudioClient_GetDevicePeriod(IAudioClient *iface, -+ REFERENCE_TIME *defperiod, REFERENCE_TIME *minperiod) -+{ -+ ACImpl *This = impl_from_IAudioClient(iface); -+ -+ TRACE("(%p)->(%p, %p)\n", This, defperiod, minperiod); -+ -+ if (!defperiod && !minperiod) -+ return E_POINTER; -+ -+ if (defperiod) -+ *defperiod = pulse_def_period[This->dataflow == eCapture]; -+ if (minperiod) -+ *minperiod = pulse_min_period[This->dataflow == eCapture]; -+ -+ return S_OK; -+} -+ -+static HRESULT WINAPI AudioClient_Start(IAudioClient *iface) -+{ -+ ACImpl *This = impl_from_IAudioClient(iface); -+ HRESULT hr = S_OK; -+ int success; -+ pa_operation *o; -+ -+ TRACE("(%p)\n", This); -+ -+ pthread_mutex_lock(&pulse_lock); -+ hr = pulse_stream_valid(This); -+ if (FAILED(hr)) { -+ pthread_mutex_unlock(&pulse_lock); -+ return hr; -+ } -+ -+ if ((This->flags & AUDCLNT_STREAMFLAGS_EVENTCALLBACK) && !This->event) { -+ pthread_mutex_unlock(&pulse_lock); -+ return AUDCLNT_E_EVENTHANDLE_NOT_SET; -+ } -+ -+ if (This->started) { -+ pthread_mutex_unlock(&pulse_lock); -+ return AUDCLNT_E_NOT_STOPPED; -+ } -+ This->clock_pulse = PA_USEC_INVALID; -+ -+ if (pa_stream_is_corked(This->stream)) { -+ o = pa_stream_cork(This->stream, 0, pulse_op_cb, &success); -+ if (o) { -+ while(pa_operation_get_state(o) == PA_OPERATION_RUNNING) -+ pthread_cond_wait(&pulse_cond, &pulse_lock); -+ pa_operation_unref(o); -+ } else -+ success = 0; -+ if (!success) -+ hr = E_FAIL; -+ } -+ if (SUCCEEDED(hr)) { -+ This->started = TRUE; -+ if (This->dataflow == eRender && This->event) -+ pa_stream_set_latency_update_callback(This->stream, pulse_latency_callback, This); -+ } -+ pthread_mutex_unlock(&pulse_lock); -+ return hr; -+} -+ -+static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface) -+{ -+ ACImpl *This = impl_from_IAudioClient(iface); -+ HRESULT hr = S_OK; -+ pa_operation *o; -+ int success; -+ -+ TRACE("(%p)\n", This); -+ -+ pthread_mutex_lock(&pulse_lock); -+ hr = pulse_stream_valid(This); -+ if (FAILED(hr)) { -+ pthread_mutex_unlock(&pulse_lock); -+ return hr; -+ } -+ -+ if (!This->started) { -+ pthread_mutex_unlock(&pulse_lock); -+ return S_FALSE; -+ } -+ -+ if (This->dataflow == eRender) { -+ o = pa_stream_cork(This->stream, 1, pulse_op_cb, &success); -+ if (o) { -+ while(pa_operation_get_state(o) == PA_OPERATION_RUNNING) -+ pthread_cond_wait(&pulse_cond, &pulse_lock); -+ pa_operation_unref(o); -+ } else -+ success = 0; -+ if (!success) -+ hr = E_FAIL; -+ } -+ if (SUCCEEDED(hr)) { -+ This->started = FALSE; -+ This->clock_pulse = PA_USEC_INVALID; -+ } -+ pthread_mutex_unlock(&pulse_lock); -+ return hr; -+} -+ -+static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface) -+{ -+ ACImpl *This = impl_from_IAudioClient(iface); -+ HRESULT hr = S_OK; -+ -+ TRACE("(%p)\n", This); -+ -+ pthread_mutex_lock(&pulse_lock); -+ hr = pulse_stream_valid(This); -+ if (FAILED(hr)) { -+ pthread_mutex_unlock(&pulse_lock); -+ return hr; -+ } -+ -+ if (This->started) { -+ pthread_mutex_unlock(&pulse_lock); -+ return AUDCLNT_E_NOT_STOPPED; -+ } -+ -+ if (This->locked) { -+ pthread_mutex_unlock(&pulse_lock); -+ return AUDCLNT_E_BUFFER_OPERATION_PENDING; -+ } -+ -+ if (This->dataflow == eRender) { -+ /* If there is still data in the render buffer it needs to be removed from the server */ -+ int success = 0; -+ if (This->pad) { -+ pa_operation *o = pa_stream_flush(This->stream, pulse_op_cb, &success); -+ if (o) { -+ while(pa_operation_get_state(o) == PA_OPERATION_RUNNING) -+ pthread_cond_wait(&pulse_cond, &pulse_lock); -+ pa_operation_unref(o); -+ } -+ } -+ if (success || !This->pad) -+ This->clock_lastpos = This->clock_written = This->pad = 0; -+ } else { -+ ACPacket *p; -+ This->clock_written += This->pad; -+ This->pad = 0; -+ -+ if ((p = This->locked_ptr)) { -+ This->locked_ptr = NULL; -+ list_add_tail(&This->packet_free_head, &p->entry); -+ } -+ list_move_tail(&This->packet_free_head, &This->packet_filled_head); -+ } -+ pthread_mutex_unlock(&pulse_lock); -+ -+ return hr; -+} -+ -+static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient *iface, -+ HANDLE event) -+{ -+ ACImpl *This = impl_from_IAudioClient(iface); -+ HRESULT hr; -+ -+ TRACE("(%p)->(%p)\n", This, event); -+ -+ if (!event) -+ return E_INVALIDARG; -+ -+ pthread_mutex_lock(&pulse_lock); -+ hr = pulse_stream_valid(This); -+ if (FAILED(hr)) { -+ pthread_mutex_unlock(&pulse_lock); -+ return hr; -+ } -+ -+ if (!(This->flags & AUDCLNT_STREAMFLAGS_EVENTCALLBACK)) -+ hr = AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED; -+ else if (This->event) -+ hr = HRESULT_FROM_WIN32(ERROR_INVALID_NAME); -+ else -+ This->event = event; -+ pthread_mutex_unlock(&pulse_lock); -+ return hr; -+} -+ -+static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid, -+ void **ppv) -+{ -+ ACImpl *This = impl_from_IAudioClient(iface); -+ HRESULT hr; -+ -+ TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppv); -+ -+ if (!ppv) -+ return E_POINTER; -+ *ppv = NULL; -+ -+ pthread_mutex_lock(&pulse_lock); -+ hr = pulse_stream_valid(This); -+ pthread_mutex_unlock(&pulse_lock); -+ if (FAILED(hr)) -+ return hr; -+ -+ if (*ppv) { -+ IUnknown_AddRef((IUnknown*)*ppv); -+ return S_OK; -+ } -+ -+ FIXME("stub %s\n", debugstr_guid(riid)); -+ return E_NOINTERFACE; -+} -+ -+static const IAudioClientVtbl AudioClient_Vtbl = -+{ -+ AudioClient_QueryInterface, -+ AudioClient_AddRef, -+ AudioClient_Release, -+ AudioClient_Initialize, -+ AudioClient_GetBufferSize, -+ AudioClient_GetStreamLatency, -+ AudioClient_GetCurrentPadding, -+ AudioClient_IsFormatSupported, -+ AudioClient_GetMixFormat, -+ AudioClient_GetDevicePeriod, -+ AudioClient_Start, -+ AudioClient_Stop, -+ AudioClient_Reset, -+ AudioClient_SetEventHandle, -+ AudioClient_GetService -+}; -+ - HRESULT WINAPI AUDDRV_GetAudioSessionManager(IMMDevice *device, - IAudioSessionManager2 **out) - { --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0011-dsound-fix-format-handling-on-invalid-format-to-neve.patch wine1.7-1.7.55/debian/patches/0011-dsound-fix-format-handling-on-invalid-format-to-neve.patch --- wine1.7-1.7.50/debian/patches/0011-dsound-fix-format-handling-on-invalid-format-to-neve.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0011-dsound-fix-format-handling-on-invalid-format-to-neve.patch 2015-11-16 21:33:39.000000000 +0000 @@ -0,0 +1,736 @@ +From ad55b64afbc29df1f5559cbd01b653298347047d Mon Sep 17 00:00:00 2001 +From: Maarten Lankhorst +Date: Mon, 23 Mar 2015 09:14:34 +0100 +Subject: [PATCH 11/14] dsound: fix format handling on invalid format to never + fail + +For the users still on oss4 this is probably useful. This is more of +a theoretical concern than practical, since nobody uses primary mode. +And even if someone did, they would have to find a format that was +unsupported, like IEEE float would probably be the easiest to trigger. + +This patch now forces everything to a single call to DSOUND_ReopenDevice, +which will either fail and keep previous state, or succeed. +--- + dlls/dsound/dsound.c | 50 +++---- + dlls/dsound/dsound_convert.c | 18 --- + dlls/dsound/dsound_main.c | 2 +- + dlls/dsound/dsound_private.h | 5 +- + dlls/dsound/mixer.c | 53 +++---- + dlls/dsound/primary.c | 341 +++++++++++++++++++------------------------ + 6 files changed, 193 insertions(+), 276 deletions(-) + +diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c +index 550e276..3828bed 100644 +--- a/dlls/dsound/dsound.c ++++ b/dlls/dsound/dsound.c +@@ -161,24 +161,20 @@ static HRESULT DirectSoundDevice_Create(DirectSoundDevice ** ppDevice) + device->guid = GUID_NULL; + + /* Set default wave format (may need it for waveOutOpen) */ +- device->pwfx = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(WAVEFORMATEXTENSIBLE)); + device->primary_pwfx = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(WAVEFORMATEXTENSIBLE)); +- if (!device->pwfx || !device->primary_pwfx) { ++ if (!device->primary_pwfx) { + WARN("out of memory\n"); +- HeapFree(GetProcessHeap(),0,device->primary_pwfx); +- HeapFree(GetProcessHeap(),0,device->pwfx); + HeapFree(GetProcessHeap(),0,device); + return DSERR_OUTOFMEMORY; + } + +- device->pwfx->wFormatTag = WAVE_FORMAT_PCM; +- device->pwfx->nSamplesPerSec = 22050; +- device->pwfx->wBitsPerSample = 8; +- device->pwfx->nChannels = 2; +- device->pwfx->nBlockAlign = device->pwfx->wBitsPerSample * device->pwfx->nChannels / 8; +- device->pwfx->nAvgBytesPerSec = device->pwfx->nSamplesPerSec * device->pwfx->nBlockAlign; +- device->pwfx->cbSize = 0; +- memcpy(device->primary_pwfx, device->pwfx, sizeof(*device->pwfx)); ++ device->primary_pwfx->wFormatTag = WAVE_FORMAT_PCM; ++ device->primary_pwfx->nSamplesPerSec = 22050; ++ device->primary_pwfx->wBitsPerSample = 8; ++ device->primary_pwfx->nChannels = 2; ++ device->primary_pwfx->nBlockAlign = device->primary_pwfx->wBitsPerSample * device->primary_pwfx->nChannels / 8; ++ device->primary_pwfx->nAvgBytesPerSec = device->primary_pwfx->nSamplesPerSec * device->primary_pwfx->nBlockAlign; ++ device->primary_pwfx->cbSize = 0; + + InitializeCriticalSection(&(device->mixlock)); + device->mixlock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": DirectSoundDevice.mixlock"); +@@ -228,17 +224,16 @@ static ULONG DirectSoundDevice_Release(DirectSoundDevice * device) + if (hr != DS_OK) + WARN("DSOUND_PrimaryDestroy failed\n"); + +- if(device->client) ++ if(device->client) { ++ IAudioClient_Stop(device->client); + IAudioClient_Release(device->client); ++ } + if(device->render) + IAudioRenderClient_Release(device->render); +- if(device->clock) +- IAudioClock_Release(device->clock); + if(device->volume) + IAudioStreamVolume_Release(device->volume); + + HeapFree(GetProcessHeap(), 0, device->tmp_buffer); +- HeapFree(GetProcessHeap(), 0, device->mix_buffer); + HeapFree(GetProcessHeap(), 0, device->buffer); + RtlDeleteResource(&device->buffer_list_lock); + device->mixlock.DebugInfo->Spare[0] = 0; +@@ -324,6 +319,7 @@ static HRESULT DirectSoundDevice_Initialize(DirectSoundDevice ** ppDevice, LPCGU + device->mmdevice = mmdevice; + device->guid = devGUID; + device->sleepev = CreateEventW(0, 0, 0, 0); ++ device->buflen = ds_hel_buflen; + + hr = DSOUND_ReopenDevice(device, FALSE); + if (FAILED(hr)) +@@ -382,13 +378,9 @@ static HRESULT DirectSoundDevice_Initialize(DirectSoundDevice ** ppDevice, LPCGU + + ZeroMemory(&device->volpan, sizeof(device->volpan)); + +- hr = DSOUND_PrimaryCreate(device); +- if (hr == DS_OK) { +- device->thread_finished = CreateEventW(0, 0, 0, 0); +- device->thread = CreateThread(0, 0, DSOUND_mixthread, device, 0, 0); +- SetThreadPriority(device->thread, THREAD_PRIORITY_TIME_CRITICAL); +- } else +- WARN("DSOUND_PrimaryCreate failed: %08x\n", hr); ++ device->thread_finished = CreateEventW(0, 0, 0, 0); ++ device->thread = CreateThread(0, 0, DSOUND_mixthread, device, 0, 0); ++ SetThreadPriority(device->thread, THREAD_PRIORITY_TIME_CRITICAL); + + *ppDevice = device; + list_add_tail(&DSOUND_renderers, &device->entry); +@@ -850,7 +842,6 @@ static HRESULT WINAPI IDirectSound8Impl_SetCooperativeLevel(IDirectSound8 *iface + { + IDirectSoundImpl *This = impl_from_IDirectSound8(iface); + DirectSoundDevice *device = This->device; +- DWORD oldlevel; + HRESULT hr = S_OK; + + TRACE("(%p,%p,%s)\n", This, hwnd, dumpCooperativeLevel(level)); +@@ -867,15 +858,10 @@ static HRESULT WINAPI IDirectSound8Impl_SetCooperativeLevel(IDirectSound8 *iface + + RtlAcquireResourceExclusive(&device->buffer_list_lock, TRUE); + EnterCriticalSection(&device->mixlock); +- oldlevel = device->priolevel; +- device->priolevel = level; +- if ((level == DSSCL_WRITEPRIMARY) != (oldlevel == DSSCL_WRITEPRIMARY)) { ++ if ((level == DSSCL_WRITEPRIMARY) != (device->priolevel == DSSCL_WRITEPRIMARY)) + hr = DSOUND_ReopenDevice(device, level == DSSCL_WRITEPRIMARY); +- if (FAILED(hr)) +- device->priolevel = oldlevel; +- else +- DSOUND_PrimaryOpen(device); +- } ++ if (SUCCEEDED(hr)) ++ device->priolevel = level; + LeaveCriticalSection(&device->mixlock); + RtlReleaseResource(&device->buffer_list_lock); + return hr; +diff --git a/dlls/dsound/dsound_convert.c b/dlls/dsound/dsound_convert.c +index 5accba6..af81c91 100644 +--- a/dlls/dsound/dsound_convert.c ++++ b/dlls/dsound/dsound_convert.c +@@ -263,27 +263,9 @@ static void norm32(float *src, INT *dst, unsigned len) + } + } + +-static void normieee32(float *src, float *dst, unsigned len) +-{ +- TRACE("%p - %p %d\n", src, dst, len); +- len /= 4; +- while (len--) +- { +- if(*src > 1) +- *dst = 1; +- else if(*src < -1) +- *dst = -1; +- else +- *dst = *src; +- ++dst; +- ++src; +- } +-} +- + const normfunc normfunctions[5] = { + (normfunc)norm8, + (normfunc)norm16, + (normfunc)norm24, + (normfunc)norm32, +- (normfunc)normieee32 + }; +diff --git a/dlls/dsound/dsound_main.c b/dlls/dsound/dsound_main.c +index 112ce78..e89d857 100644 +--- a/dlls/dsound/dsound_main.c ++++ b/dlls/dsound/dsound_main.c +@@ -92,7 +92,7 @@ GUID DSOUND_capture_guids[MAXWAVEDRIVERS]; + WCHAR wine_vxd_drv[] = { 'w','i','n','e','m','m','.','v','x','d', 0 }; + + /* All default settings, you most likely don't want to touch these, see wiki on UsefulRegistryKeys */ +-int ds_hel_buflen = 32768 * 2; ++int ds_hel_buflen = 32768; + static HINSTANCE instance; + + /* +diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h +index e180f7c..f142b7c 100644 +--- a/dlls/dsound/dsound_private.h ++++ b/dlls/dsound/dsound_private.h +@@ -87,7 +87,7 @@ struct DirectSoundDevice + int speaker_num[DS_MAX_CHANNELS]; + int num_speakers; + int lfe_channel; +- float *mix_buffer, *tmp_buffer; ++ float *tmp_buffer; + DWORD tmp_buffer_len, mix_buffer_len; + + DSVOLUMEPAN volpan; +@@ -100,7 +100,6 @@ struct DirectSoundDevice + + IMMDevice *mmdevice; + IAudioClient *client; +- IAudioClock *clock; + IAudioStreamVolume *volume; + IAudioRenderClient *render; + +@@ -206,13 +205,11 @@ void DSOUND_ParseSpeakerConfig(DirectSoundDevice *device) DECLSPEC_HIDDEN; + + /* primary.c */ + +-HRESULT DSOUND_PrimaryCreate(DirectSoundDevice *device) DECLSPEC_HIDDEN; + HRESULT DSOUND_PrimaryDestroy(DirectSoundDevice *device) DECLSPEC_HIDDEN; + HRESULT DSOUND_PrimaryPlay(DirectSoundDevice *device) DECLSPEC_HIDDEN; + HRESULT DSOUND_PrimaryStop(DirectSoundDevice *device) DECLSPEC_HIDDEN; + LPWAVEFORMATEX DSOUND_CopyFormat(LPCWAVEFORMATEX wfex) DECLSPEC_HIDDEN; + HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) DECLSPEC_HIDDEN; +-HRESULT DSOUND_PrimaryOpen(DirectSoundDevice *device) DECLSPEC_HIDDEN; + HRESULT primarybuffer_create(DirectSoundDevice *device, IDirectSoundBufferImpl **ppdsb, + const DSBUFFERDESC *dsbd) DECLSPEC_HIDDEN; + void primarybuffer_destroy(IDirectSoundBufferImpl *This) DECLSPEC_HIDDEN; +diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c +index c763650..155e378 100644 +--- a/dlls/dsound/mixer.c ++++ b/dlls/dsound/mixer.c +@@ -646,8 +646,7 @@ static void DSOUND_WaveQueue(DirectSoundDevice *device, LPBYTE pos, DWORD bytes) + * secondary->buffer (secondary format) + * =[Resample]=> device->tmp_buffer (float format) + * =[Volume]=> device->tmp_buffer (float format) +- * =[Mix]=> device->mix_buffer (float format) +- * =[Reformat]=> device->buffer (device format) ++ * =[Reformat]=> device->buffer (device format, skipped on float) + */ + static void DSOUND_PerformMix(DirectSoundDevice *device) + { +@@ -686,8 +685,7 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) + if (device->priolevel != DSSCL_WRITEPRIMARY) { + BOOL all_stopped = FALSE; + int nfiller; +- BOOL native = device->normfunction == normfunctions[4]; +- DWORD bpp = device->pwfx->wBitsPerSample>>3; ++ void *buffer = NULL; + + /* the sound of silence */ + nfiller = device->pwfx->wBitsPerSample == 8 ? 128 : 0; +@@ -701,43 +699,30 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) + TRACE("Buffer restarting\n"); + } + +- if (native) { +- void *buffer = NULL; ++ hr = IAudioRenderClient_GetBuffer(device->render, maxq / block, (void*)&buffer); ++ if(FAILED(hr)){ ++ WARN("GetBuffer failed: %08x\n", hr); ++ LeaveCriticalSection(&device->mixlock); ++ return; ++ } + +- hr = IAudioRenderClient_GetBuffer(device->render, maxq / block, (void*)&buffer); +- if(FAILED(hr)){ +- WARN("GetBuffer failed: %08x\n", hr); +- LeaveCriticalSection(&device->mixlock); +- return; +- } +- memset(buffer, nfiller, maxq); ++ memset(buffer, nfiller, maxq); + ++ if (!device->normfunction) + DSOUND_MixToPrimary(device, buffer, writepos, maxq, &all_stopped); +- +- hr = IAudioRenderClient_ReleaseBuffer(device->render, maxq / block, 0); +- if(FAILED(hr)) +- ERR("ReleaseBuffer failed: %08x\n", hr); +- +- device->pad += maxq; +- } else { +- memset(device->mix_buffer, nfiller, maxq); ++ else { + + /* do the mixing */ +- DSOUND_MixToPrimary(device, device->mix_buffer, writepos, maxq, &all_stopped); ++ DSOUND_MixToPrimary(device, (float*)device->buffer, writepos, maxq, &all_stopped); + +- if (maxq + writepos > device->buflen) { +- DWORD todo = device->buflen - writepos; ++ device->normfunction(device->buffer, buffer, maxq); ++ } + +- device->normfunction(device->mix_buffer, device->buffer + writepos, todo); +- DSOUND_WaveQueue(device, device->buffer + writepos, todo); ++ hr = IAudioRenderClient_ReleaseBuffer(device->render, maxq / block, 0); ++ if(FAILED(hr)) ++ ERR("ReleaseBuffer failed: %08x\n", hr); + +- device->normfunction(device->mix_buffer + todo / bpp, device->buffer, (maxq - todo)); +- DSOUND_WaveQueue(device, device->buffer, maxq - todo); +- } else { +- device->normfunction(device->mix_buffer, device->buffer + writepos, maxq); +- DSOUND_WaveQueue(device, device->buffer + writepos, maxq); +- } +- } ++ device->pad += maxq; + + if (maxq) { + if (device->state == STATE_STARTING || +@@ -755,6 +740,8 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) + DSOUND_PrimaryStop(device); + } + } else if (device->state != STATE_STOPPED) { ++ if (maxq > device->buflen) ++ maxq = device->buflen; + if (writepos + maxq > device->buflen) { + DSOUND_WaveQueue(device, device->buffer + writepos, device->buflen - writepos); + DSOUND_WaveQueue(device, device->buffer, writepos + maxq - device->buflen); +diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c +index 19a76b0..4bfae7e 100644 +--- a/dlls/dsound/primary.c ++++ b/dlls/dsound/primary.c +@@ -197,16 +197,8 @@ static HRESULT DSOUND_WaveFormat(DirectSoundDevice *device, IAudioClient *client + return S_OK; + } + +-HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) ++static void DSOUND_ReleaseDevice(DirectSoundDevice *device) + { +- WAVEFORMATEX *wfx = NULL; +- HRESULT hres; +- REFERENCE_TIME period, buflen = 800000; +- UINT32 frames; +- DWORD period_ms; +- +- TRACE("(%p, %d)\n", device, forcewave); +- + if(device->client){ + IAudioClient_Release(device->client); + device->client = NULL; +@@ -215,10 +207,6 @@ HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) + IAudioRenderClient_Release(device->render); + device->render = NULL; + } +- if(device->clock){ +- IAudioClock_Release(device->clock); +- device->clock = NULL; +- } + if(device->volume){ + IAudioStreamVolume_Release(device->volume); + device->volume = NULL; +@@ -229,92 +217,171 @@ HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) + device->playpos %= device->buflen; + device->pad = 0; + } ++} + +- hres = IMMDevice_Activate(device->mmdevice, &IID_IAudioClient, +- CLSCTX_INPROC_SERVER, NULL, (void **)&device->client); +- if(FAILED(hres)) { +- WARN("Activate failed: %08x\n", hres); +- return hres; +- } ++static HRESULT DSOUND_PrimaryOpen(DirectSoundDevice *device, WAVEFORMATEX *wfx, DWORD aclen, BOOL forcewave) ++{ ++ IDirectSoundBufferImpl** dsb = device->buffers; ++ LPBYTE newbuf; ++ DWORD new_buflen; ++ BOOL mixfloat = FALSE; ++ int i; + +- device->speaker_config = DSOUND_FindSpeakerConfig(device->mmdevice, 0); ++ TRACE("(%p)\n", device); + +- DSOUND_ParseSpeakerConfig(device); ++ new_buflen = device->buflen; ++ new_buflen -= new_buflen % wfx->nBlockAlign; + +- hres = DSOUND_WaveFormat(device, device->client, forcewave, &wfx); +- if (FAILED(hres)) { +- IAudioClient_Release(device->client); +- device->client = NULL; +- return hres; ++ if (wfx->wFormatTag == WAVE_FORMAT_IEEE_FLOAT || ++ (wfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE && ++ IsEqualGUID(&((WAVEFORMATEXTENSIBLE*)wfx)->SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT))) ++ mixfloat = TRUE; ++ ++ /* reallocate emulated primary buffer */ ++ if (forcewave) { ++ if (device->buffer) ++ newbuf = HeapReAlloc(GetProcessHeap(), 0, device->buffer, new_buflen); ++ else ++ newbuf = HeapAlloc(GetProcessHeap(), 0, new_buflen); ++ ++ if (!newbuf) { ++ ERR("failed to allocate primary buffer\n"); ++ return DSERR_OUTOFMEMORY; ++ } ++ device->mix_buffer_len = 0; ++ } else if (!mixfloat) { ++ DWORD alloc_len = aclen / (wfx->nBlockAlign / 8) * sizeof(float); ++ ++ if (device->buffer) ++ newbuf = HeapReAlloc(GetProcessHeap(), 0, device->buffer, alloc_len); ++ else ++ newbuf = HeapAlloc(GetProcessHeap(), 0, alloc_len); ++ ++ if (!newbuf) { ++ ERR("failed to allocate primary buffer\n"); ++ return DSERR_OUTOFMEMORY; ++ } ++ device->mix_buffer_len = alloc_len; ++ } else { ++ HeapFree(GetProcessHeap(), 0, device->buffer); ++ newbuf = NULL; ++ device->mix_buffer_len = 0; + } ++ ++ device->buffer = newbuf; ++ device->buflen = new_buflen; + HeapFree(GetProcessHeap(), 0, device->pwfx); + device->pwfx = wfx; + +- hres = IAudioClient_Initialize(device->client, +- AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_NOPERSIST | +- AUDCLNT_STREAMFLAGS_EVENTCALLBACK, buflen, 0, device->pwfx, NULL); +- if(FAILED(hres)){ +- IAudioClient_Release(device->client); +- device->client = NULL; +- WARN("Initialize failed: %08x\n", hres); +- return hres; ++ if (device->state == STATE_PLAYING) ++ device->state = STATE_STARTING; ++ else if (device->state == STATE_STOPPING) ++ device->state = STATE_STOPPED; ++ ++ device->writelead = (wfx->nSamplesPerSec / 100) * wfx->nBlockAlign; ++ ++ TRACE("buflen: %u, fraglen: %u, mix_buffer_len: %u\n", ++ device->buflen, device->fraglen, device->mix_buffer_len); ++ ++ if (!forcewave && !mixfloat) ++ device->normfunction = normfunctions[wfx->nBlockAlign/8 - 1]; ++ else ++ device->normfunction = NULL; ++ ++ if (device->mix_buffer_len) ++ FillMemory(device->buffer, device->mix_buffer_len, 0); ++ else if (device->buffer) ++ FillMemory(device->buffer, device->buflen, (wfx->wBitsPerSample == 8) ? 128 : 0); ++ device->playpos = 0; ++ ++ for (i = 0; i < device->nrofbuffers; i++) { ++ RtlAcquireResourceExclusive(&dsb[i]->lock, TRUE); ++ DSOUND_RecalcFormat(dsb[i]); ++ RtlReleaseResource(&dsb[i]->lock); + } +- IAudioClient_SetEventHandle(device->client, device->sleepev); + +- hres = IAudioClient_GetService(device->client, &IID_IAudioRenderClient, +- (void**)&device->render); ++ return DS_OK; ++} ++ ++HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) ++{ ++ HRESULT hres; ++ REFERENCE_TIME period; ++ UINT32 frames; ++ DWORD period_ms; ++ IAudioClient *client = NULL; ++ IAudioRenderClient *render = NULL; ++ IAudioStreamVolume *volume = NULL; ++ DWORD fraglen, aclen; ++ WAVEFORMATEX *wfx = NULL; ++ DWORD oldspeakerconfig = device->speaker_config; ++ ++ TRACE("(%p, %d)\n", device, forcewave); ++ ++ hres = IMMDevice_Activate(device->mmdevice, &IID_IAudioClient, ++ CLSCTX_INPROC_SERVER, NULL, (void **)&client); + if(FAILED(hres)){ +- IAudioClient_Release(device->client); +- device->client = NULL; +- WARN("GetService failed: %08x\n", hres); ++ WARN("Activate failed: %08x\n", hres); + return hres; + } + +- hres = IAudioClient_GetService(device->client, &IID_IAudioClock, +- (void**)&device->clock); +- if(FAILED(hres)){ +- IAudioClient_Release(device->client); +- IAudioRenderClient_Release(device->render); +- device->client = NULL; +- device->render = NULL; +- WARN("GetService failed: %08x\n", hres); ++ hres = DSOUND_WaveFormat(device, client, forcewave, &wfx); ++ if (FAILED(hres)) { ++ IAudioClient_Release(client); + return hres; + } + +- hres = IAudioClient_GetService(device->client, &IID_IAudioStreamVolume, +- (void**)&device->volume); ++ hres = IAudioClient_Initialize(client, ++ AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_NOPERSIST | ++ AUDCLNT_STREAMFLAGS_EVENTCALLBACK, 800000, 0, wfx, NULL); + if(FAILED(hres)){ +- IAudioClient_Release(device->client); +- IAudioRenderClient_Release(device->render); +- IAudioClock_Release(device->clock); +- device->client = NULL; +- device->render = NULL; +- device->clock = NULL; +- WARN("GetService failed: %08x\n", hres); ++ IAudioClient_Release(client); ++ ERR("Initialize failed: %08x\n", hres); + return hres; + } + +- /* Now kick off the timer so the event fires periodically */ +- hres = IAudioClient_Start(device->client); +- if (FAILED(hres)) +- WARN("starting failed with %08x\n", hres); ++ IAudioClient_SetEventHandle(client, device->sleepev); ++ ++ hres = IAudioClient_GetService(client, &IID_IAudioRenderClient, (void**)&render); ++ if(FAILED(hres)) ++ goto err_service; ++ ++ hres = IAudioClient_GetService(client, &IID_IAudioStreamVolume, (void**)&volume); ++ if(FAILED(hres)) ++ goto err_service; + +- hres = IAudioClient_GetStreamLatency(device->client, &period); ++ /* Now kick off the timer so the event fires periodically */ ++ hres = IAudioClient_Start(client); ++ if (FAILED(hres)) { ++ WARN("Start failed with %08x\n", hres); ++ goto err; ++ } ++ hres = IAudioClient_GetStreamLatency(client, &period); + if (FAILED(hres)) { + WARN("GetStreamLatency failed with %08x\n", hres); +- period = 100000; ++ goto err; + } +- period_ms = (period + 9999) / 10000; +- +- hres = IAudioClient_GetBufferSize(device->client, &frames); ++ hres = IAudioClient_GetBufferSize(client, &frames); + if (FAILED(hres)) { + WARN("GetBufferSize failed with %08x\n", hres); +- frames = (UINT64)device->pwfx->nSamplesPerSec * buflen / 10000000; ++ goto err; + } + +- device->fraglen = MulDiv(device->pwfx->nSamplesPerSec, period, 10000000) * device->pwfx->nBlockAlign; +- device->aclen = frames * device->pwfx->nBlockAlign; +- TRACE("period %u ms fraglen %u buflen %u\n", period_ms, device->fraglen, device->aclen); ++ period_ms = (period + 9999) / 10000; ++ fraglen = MulDiv(wfx->nSamplesPerSec, period, 10000000) * wfx->nBlockAlign; ++ aclen = frames * wfx->nBlockAlign; ++ TRACE("period %u ms fraglen %u buflen %u\n", period_ms, fraglen, aclen); ++ ++ hres = DSOUND_PrimaryOpen(device, wfx, aclen, forcewave); ++ if(FAILED(hres)) ++ goto err; ++ ++ DSOUND_ReleaseDevice(device); ++ device->client = client; ++ device->render = render; ++ device->volume = volume; ++ device->fraglen = fraglen; ++ device->aclen = aclen; + + if (period_ms < 3) + device->sleeptime = 5; +@@ -322,107 +389,20 @@ HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) + device->sleeptime = period_ms * 5 / 2; + + return S_OK; +-} +- +-HRESULT DSOUND_PrimaryOpen(DirectSoundDevice *device) +-{ +- IDirectSoundBufferImpl** dsb = device->buffers; +- LPBYTE newbuf; +- int i; +- +- TRACE("(%p)\n", device); +- +- /* on original windows, the buffer it set to a fixed size, no matter what the settings are. +- on windows this size is always fixed (tested on win-xp) */ +- if (!device->buflen) +- device->buflen = ds_hel_buflen; +- device->buflen -= device->buflen % device->pwfx->nBlockAlign; +- +- HeapFree(GetProcessHeap(), 0, device->mix_buffer); +- device->mix_buffer_len = (device->buflen / (device->pwfx->wBitsPerSample / 8)) * sizeof(float); +- device->mix_buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, device->mix_buffer_len); +- if (!device->mix_buffer) +- return DSERR_OUTOFMEMORY; +- +- if (device->state == STATE_PLAYING) device->state = STATE_STARTING; +- else if (device->state == STATE_STOPPING) device->state = STATE_STOPPED; +- +- /* reallocate emulated primary buffer */ +- if (device->buffer) +- newbuf = HeapReAlloc(GetProcessHeap(),0,device->buffer, device->buflen); +- else +- newbuf = HeapAlloc(GetProcessHeap(),0, device->buflen); +- +- if (!newbuf) { +- ERR("failed to allocate primary buffer\n"); +- return DSERR_OUTOFMEMORY; +- /* but the old buffer might still exist and must be re-prepared */ +- } +- +- device->writelead = (device->pwfx->nSamplesPerSec / 100) * device->pwfx->nBlockAlign; +- +- device->buffer = newbuf; +- +- TRACE("buflen: %u, fraglen: %u, mix_buffer_len: %u\n", +- device->buflen, device->fraglen, device->mix_buffer_len); +- +- if(device->pwfx->wFormatTag == WAVE_FORMAT_IEEE_FLOAT || +- (device->pwfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE && +- IsEqualGUID(&((WAVEFORMATEXTENSIBLE*)device->pwfx)->SubFormat, +- &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT))) +- device->normfunction = normfunctions[4]; +- else +- device->normfunction = normfunctions[device->pwfx->wBitsPerSample/8 - 1]; +- +- FillMemory(device->buffer, device->buflen, (device->pwfx->wBitsPerSample == 8) ? 128 : 0); +- FillMemory(device->mix_buffer, device->mix_buffer_len, 0); +- device->playpos = 0; + +- if (device->pwfx->wFormatTag == WAVE_FORMAT_IEEE_FLOAT || +- (device->pwfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE && +- IsEqualGUID(&((WAVEFORMATEXTENSIBLE*)device->pwfx)->SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT))) +- device->normfunction = normfunctions[4]; +- else +- device->normfunction = normfunctions[device->pwfx->wBitsPerSample/8 - 1]; +- +- for (i = 0; i < device->nrofbuffers; i++) { +- RtlAcquireResourceExclusive(&dsb[i]->lock, TRUE); +- DSOUND_RecalcFormat(dsb[i]); +- RtlReleaseResource(&dsb[i]->lock); +- } +- +- return DS_OK; +-} +- +- +-static void DSOUND_PrimaryClose(DirectSoundDevice *device) +-{ +- HRESULT hr; +- +- TRACE("(%p)\n", device); +- +- if(device->client){ +- hr = IAudioClient_Stop(device->client); +- if(FAILED(hr)) +- WARN("Stop failed: %08x\n", hr); +- } +-} +- +-HRESULT DSOUND_PrimaryCreate(DirectSoundDevice *device) +-{ +- HRESULT err = DS_OK; +- TRACE("(%p)\n", device); +- +- device->buflen = ds_hel_buflen; +- err = DSOUND_PrimaryOpen(device); +- +- if (err != DS_OK) { +- WARN("DSOUND_PrimaryOpen failed\n"); +- return err; +- } +- +- device->state = STATE_STOPPED; +- return DS_OK; ++err_service: ++ ERR("GetService failed: %08x\n", hres); ++err: ++ device->speaker_config = oldspeakerconfig; ++ DSOUND_ParseSpeakerConfig(device); ++ if (volume) ++ IAudioStreamVolume_Release(volume); ++ if (render) ++ IAudioRenderClient_Release(render); ++ if (client) ++ IAudioClient_Release(client); ++ HeapFree(GetProcessHeap(), 0, wfx); ++ return hres; + } + + HRESULT DSOUND_PrimaryDestroy(DirectSoundDevice *device) +@@ -432,8 +412,6 @@ HRESULT DSOUND_PrimaryDestroy(DirectSoundDevice *device) + /* **** */ + EnterCriticalSection(&(device->mixlock)); + +- DSOUND_PrimaryClose(device); +- + if(device->primary && (device->primary->ref || device->primary->numIfaces)) + WARN("Destroying primary buffer while references held (%u %u)\n", device->primary->ref, device->primary->numIfaces); + +@@ -509,7 +487,6 @@ HRESULT primarybuffer_SetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX passe + HRESULT err = S_OK; + WAVEFORMATEX *old_fmt; + WAVEFORMATEXTENSIBLE *fmtex, *passed_fmtex = (WAVEFORMATEXTENSIBLE*)passed_fmt; +- BOOL forced = (device->priolevel == DSSCL_WRITEPRIMARY); + + TRACE("(%p,%p)\n", device, passed_fmt); + +@@ -559,24 +536,12 @@ HRESULT primarybuffer_SetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX passe + fmtex->Samples.wValidBitsPerSample = fmtex->Format.wBitsPerSample; + } + +- DSOUND_PrimaryClose(device); +- +- err = DSOUND_ReopenDevice(device, forced); ++ err = DSOUND_ReopenDevice(device, TRUE); + if (FAILED(err)) { + ERR("No formats could be opened\n"); +- goto done; +- } +- +- err = DSOUND_PrimaryOpen(device); +- if (err != DS_OK) { +- ERR("DSOUND_PrimaryOpen failed\n"); +- goto done; +- } +- +-done: +- if (err != DS_OK) ++ HeapFree(GetProcessHeap(), 0, device->primary_pwfx); + device->primary_pwfx = old_fmt; +- else ++ } else + HeapFree(GetProcessHeap(), 0, old_fmt); + } else { + WAVEFORMATEX *wfx = DSOUND_CopyFormat(passed_fmt); +-- +2.5.0 + diff -Nru wine1.7-1.7.50/debian/patches/0011-winepulse-Add-IAudioRenderClient-and-IAudioCaptureCl.patch wine1.7-1.7.55/debian/patches/0011-winepulse-Add-IAudioRenderClient-and-IAudioCaptureCl.patch --- wine1.7-1.7.50/debian/patches/0011-winepulse-Add-IAudioRenderClient-and-IAudioCaptureCl.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0011-winepulse-Add-IAudioRenderClient-and-IAudioCaptureCl.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,352 +0,0 @@ -From 69c6d04b39ef20700bb1cc4348f59a8c4133daf2 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:29 +0100 -Subject: [PATCH 11/50] winepulse: Add IAudioRenderClient and - IAudioCaptureClient - ---- - dlls/winepulse.drv/mmdevdrv.c | 301 ++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 301 insertions(+) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index 37d85ff..01cfd25 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -146,12 +146,27 @@ struct ACImpl { - static const WCHAR defaultW[] = {'P','u','l','s','e','a','u','d','i','o',0}; - - static const IAudioClientVtbl AudioClient_Vtbl; -+static const IAudioRenderClientVtbl AudioRenderClient_Vtbl; -+static const IAudioCaptureClientVtbl AudioCaptureClient_Vtbl; -+static const IAudioClockVtbl AudioClock_Vtbl; -+static const IAudioClock2Vtbl AudioClock2_Vtbl; -+static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl; - - static inline ACImpl *impl_from_IAudioClient(IAudioClient *iface) - { - return CONTAINING_RECORD(iface, ACImpl, IAudioClient_iface); - } - -+static inline ACImpl *impl_from_IAudioRenderClient(IAudioRenderClient *iface) -+{ -+ return CONTAINING_RECORD(iface, ACImpl, IAudioRenderClient_iface); -+} -+ -+static inline ACImpl *impl_from_IAudioCaptureClient(IAudioCaptureClient *iface) -+{ -+ return CONTAINING_RECORD(iface, ACImpl, IAudioCaptureClient_iface); -+} -+ - /* Following pulseaudio design here, mainloop has the lock taken whenever - * it is handling something for pulse, and the lock is required whenever - * doing any pa_* call that can affect the state in any way -@@ -701,6 +716,11 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(void *key, IMMDevice *dev, - return E_OUTOFMEMORY; - - This->IAudioClient_iface.lpVtbl = &AudioClient_Vtbl; -+ This->IAudioRenderClient_iface.lpVtbl = &AudioRenderClient_Vtbl; -+ This->IAudioCaptureClient_iface.lpVtbl = &AudioCaptureClient_Vtbl; -+ This->IAudioClock_iface.lpVtbl = &AudioClock_Vtbl; -+ This->IAudioClock2_iface.lpVtbl = &AudioClock2_Vtbl; -+ This->IAudioStreamVolume_iface.lpVtbl = &AudioStreamVolume_Vtbl; - This->dataflow = dataflow; - This->parent = dev; - This->clock_pulse = PA_USEC_INVALID; -@@ -1421,6 +1441,16 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid, - if (FAILED(hr)) - return hr; - -+ if (IsEqualIID(riid, &IID_IAudioRenderClient)) { -+ if (This->dataflow != eRender) -+ return AUDCLNT_E_WRONG_ENDPOINT_TYPE; -+ *ppv = &This->IAudioRenderClient_iface; -+ } else if (IsEqualIID(riid, &IID_IAudioCaptureClient)) { -+ if (This->dataflow != eCapture) -+ return AUDCLNT_E_WRONG_ENDPOINT_TYPE; -+ *ppv = &This->IAudioCaptureClient_iface; -+ } -+ - if (*ppv) { - IUnknown_AddRef((IUnknown*)*ppv); - return S_OK; -@@ -1449,6 +1479,277 @@ static const IAudioClientVtbl AudioClient_Vtbl = - AudioClient_GetService - }; - -+static HRESULT WINAPI AudioRenderClient_QueryInterface( -+ IAudioRenderClient *iface, REFIID riid, void **ppv) -+{ -+ TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); -+ -+ if (!ppv) -+ return E_POINTER; -+ *ppv = NULL; -+ -+ if (IsEqualIID(riid, &IID_IUnknown) || -+ IsEqualIID(riid, &IID_IAudioRenderClient)) -+ *ppv = iface; -+ if (*ppv) { -+ IUnknown_AddRef((IUnknown*)*ppv); -+ return S_OK; -+ } -+ -+ WARN("Unknown interface %s\n", debugstr_guid(riid)); -+ return E_NOINTERFACE; -+} -+ -+static ULONG WINAPI AudioRenderClient_AddRef(IAudioRenderClient *iface) -+{ -+ ACImpl *This = impl_from_IAudioRenderClient(iface); -+ return AudioClient_AddRef(&This->IAudioClient_iface); -+} -+ -+static ULONG WINAPI AudioRenderClient_Release(IAudioRenderClient *iface) -+{ -+ ACImpl *This = impl_from_IAudioRenderClient(iface); -+ return AudioClient_Release(&This->IAudioClient_iface); -+} -+ -+static HRESULT WINAPI AudioRenderClient_GetBuffer(IAudioRenderClient *iface, -+ UINT32 frames, BYTE **data) -+{ -+ ACImpl *This = impl_from_IAudioRenderClient(iface); -+ UINT32 avail, pad, req, bytes = frames * pa_frame_size(&This->ss); -+ HRESULT hr = S_OK; -+ int ret = -1; -+ -+ TRACE("(%p)->(%u, %p)\n", This, frames, data); -+ -+ if (!data) -+ return E_POINTER; -+ *data = NULL; -+ -+ pthread_mutex_lock(&pulse_lock); -+ hr = pulse_stream_valid(This); -+ if (FAILED(hr) || This->locked) { -+ pthread_mutex_unlock(&pulse_lock); -+ return FAILED(hr) ? hr : AUDCLNT_E_OUT_OF_ORDER; -+ } -+ if (!frames) { -+ pthread_mutex_unlock(&pulse_lock); -+ return S_OK; -+ } -+ -+ ACImpl_GetRenderPad(This, &pad); -+ avail = This->bufsize_frames - pad; -+ if (avail < frames || bytes > This->bufsize_bytes) { -+ pthread_mutex_unlock(&pulse_lock); -+ WARN("Wanted to write %u, but only %u available\n", frames, avail); -+ return AUDCLNT_E_BUFFER_TOO_LARGE; -+ } -+ -+ This->locked = frames; -+ req = bytes; -+ ret = pa_stream_begin_write(This->stream, &This->locked_ptr, &req); -+ if (ret < 0 || req < bytes) { -+ FIXME("%p Not using pulse locked data: %i %u/%u %u/%u\n", This, ret, req/pa_frame_size(&This->ss), frames, pad, This->bufsize_frames); -+ if (ret >= 0) -+ pa_stream_cancel_write(This->stream); -+ *data = This->tmp_buffer; -+ This->locked_ptr = NULL; -+ } else -+ *data = This->locked_ptr; -+ pthread_mutex_unlock(&pulse_lock); -+ return hr; -+} -+ -+static HRESULT WINAPI AudioRenderClient_ReleaseBuffer( -+ IAudioRenderClient *iface, UINT32 written_frames, DWORD flags) -+{ -+ ACImpl *This = impl_from_IAudioRenderClient(iface); -+ UINT32 written_bytes = written_frames * pa_frame_size(&This->ss); -+ -+ TRACE("(%p)->(%u, %x)\n", This, written_frames, flags); -+ -+ pthread_mutex_lock(&pulse_lock); -+ if (!This->locked || !written_frames) { -+ if (This->locked_ptr) -+ pa_stream_cancel_write(This->stream); -+ This->locked = 0; -+ This->locked_ptr = NULL; -+ pthread_mutex_unlock(&pulse_lock); -+ return written_frames ? AUDCLNT_E_OUT_OF_ORDER : S_OK; -+ } -+ -+ if (This->locked < written_frames) { -+ pthread_mutex_unlock(&pulse_lock); -+ return AUDCLNT_E_INVALID_SIZE; -+ } -+ -+ if (flags & AUDCLNT_BUFFERFLAGS_SILENT) { -+ if (This->ss.format == PA_SAMPLE_U8) -+ memset(This->tmp_buffer, 128, written_bytes); -+ else -+ memset(This->tmp_buffer, 0, written_bytes); -+ } -+ -+ This->locked = 0; -+ if (This->locked_ptr) -+ pa_stream_write(This->stream, This->locked_ptr, written_bytes, NULL, 0, PA_SEEK_RELATIVE); -+ else -+ pa_stream_write(This->stream, This->tmp_buffer, written_bytes, NULL, 0, PA_SEEK_RELATIVE); -+ This->pad += written_bytes; -+ This->locked_ptr = NULL; -+ TRACE("Released %u, pad %u\n", written_frames, This->pad / pa_frame_size(&This->ss)); -+ assert(This->pad <= This->bufsize_bytes); -+ pthread_mutex_unlock(&pulse_lock); -+ return S_OK; -+} -+ -+static const IAudioRenderClientVtbl AudioRenderClient_Vtbl = { -+ AudioRenderClient_QueryInterface, -+ AudioRenderClient_AddRef, -+ AudioRenderClient_Release, -+ AudioRenderClient_GetBuffer, -+ AudioRenderClient_ReleaseBuffer -+}; -+ -+static HRESULT WINAPI AudioCaptureClient_QueryInterface( -+ IAudioCaptureClient *iface, REFIID riid, void **ppv) -+{ -+ TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); -+ -+ if (!ppv) -+ return E_POINTER; -+ *ppv = NULL; -+ -+ if (IsEqualIID(riid, &IID_IUnknown) || -+ IsEqualIID(riid, &IID_IAudioCaptureClient)) -+ *ppv = iface; -+ if (*ppv) { -+ IUnknown_AddRef((IUnknown*)*ppv); -+ return S_OK; -+ } -+ -+ WARN("Unknown interface %s\n", debugstr_guid(riid)); -+ return E_NOINTERFACE; -+} -+ -+static ULONG WINAPI AudioCaptureClient_AddRef(IAudioCaptureClient *iface) -+{ -+ ACImpl *This = impl_from_IAudioCaptureClient(iface); -+ return IAudioClient_AddRef(&This->IAudioClient_iface); -+} -+ -+static ULONG WINAPI AudioCaptureClient_Release(IAudioCaptureClient *iface) -+{ -+ ACImpl *This = impl_from_IAudioCaptureClient(iface); -+ return IAudioClient_Release(&This->IAudioClient_iface); -+} -+ -+static HRESULT WINAPI AudioCaptureClient_GetBuffer(IAudioCaptureClient *iface, -+ BYTE **data, UINT32 *frames, DWORD *flags, UINT64 *devpos, -+ UINT64 *qpcpos) -+{ -+ ACImpl *This = impl_from_IAudioCaptureClient(iface); -+ HRESULT hr; -+ ACPacket *packet; -+ -+ TRACE("(%p)->(%p, %p, %p, %p, %p)\n", This, data, frames, flags, -+ devpos, qpcpos); -+ -+ if (!data || !frames || !flags) -+ return E_POINTER; -+ -+ pthread_mutex_lock(&pulse_lock); -+ hr = pulse_stream_valid(This); -+ if (FAILED(hr) || This->locked) { -+ pthread_mutex_unlock(&pulse_lock); -+ return FAILED(hr) ? hr : AUDCLNT_E_OUT_OF_ORDER; -+ } -+ -+ ACImpl_GetCapturePad(This, NULL); -+ if ((packet = This->locked_ptr)) { -+ *frames = This->capture_period / pa_frame_size(&This->ss); -+ *flags = 0; -+ if (packet->discont) -+ *flags |= AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY; -+ if (devpos) { -+ if (packet->discont) -+ *devpos = (This->clock_written + This->capture_period) / pa_frame_size(&This->ss); -+ else -+ *devpos = This->clock_written / pa_frame_size(&This->ss); -+ } -+ if (qpcpos) -+ *qpcpos = packet->qpcpos; -+ *data = packet->data; -+ } -+ else -+ *frames = 0; -+ This->locked = *frames; -+ pthread_mutex_unlock(&pulse_lock); -+ return *frames ? S_OK : AUDCLNT_S_BUFFER_EMPTY; -+} -+ -+static HRESULT WINAPI AudioCaptureClient_ReleaseBuffer( -+ IAudioCaptureClient *iface, UINT32 done) -+{ -+ ACImpl *This = impl_from_IAudioCaptureClient(iface); -+ -+ TRACE("(%p)->(%u)\n", This, done); -+ -+ pthread_mutex_lock(&pulse_lock); -+ if (!This->locked && done) { -+ pthread_mutex_unlock(&pulse_lock); -+ return AUDCLNT_E_OUT_OF_ORDER; -+ } -+ if (done && This->locked != done) { -+ pthread_mutex_unlock(&pulse_lock); -+ return AUDCLNT_E_INVALID_SIZE; -+ } -+ if (done) { -+ ACPacket *packet = This->locked_ptr; -+ This->locked_ptr = NULL; -+ This->pad -= This->capture_period; -+ if (packet->discont) -+ This->clock_written += 2 * This->capture_period; -+ else -+ This->clock_written += This->capture_period; -+ list_add_tail(&This->packet_free_head, &packet->entry); -+ } -+ This->locked = 0; -+ pthread_mutex_unlock(&pulse_lock); -+ return S_OK; -+} -+ -+static HRESULT WINAPI AudioCaptureClient_GetNextPacketSize( -+ IAudioCaptureClient *iface, UINT32 *frames) -+{ -+ ACImpl *This = impl_from_IAudioCaptureClient(iface); -+ ACPacket *p; -+ -+ TRACE("(%p)->(%p)\n", This, frames); -+ if (!frames) -+ return E_POINTER; -+ -+ pthread_mutex_lock(&pulse_lock); -+ ACImpl_GetCapturePad(This, NULL); -+ p = This->locked_ptr; -+ if (p) -+ *frames = This->capture_period / pa_frame_size(&This->ss); -+ else -+ *frames = 0; -+ pthread_mutex_unlock(&pulse_lock); -+ return S_OK; -+} -+ -+static const IAudioCaptureClientVtbl AudioCaptureClient_Vtbl = -+{ -+ AudioCaptureClient_QueryInterface, -+ AudioCaptureClient_AddRef, -+ AudioCaptureClient_Release, -+ AudioCaptureClient_GetBuffer, -+ AudioCaptureClient_ReleaseBuffer, -+ AudioCaptureClient_GetNextPacketSize -+}; -+ - HRESULT WINAPI AUDDRV_GetAudioSessionManager(IMMDevice *device, - IAudioSessionManager2 **out) - { --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0012-dsound-remove-state-machine-from-render-buffer.patch wine1.7-1.7.55/debian/patches/0012-dsound-remove-state-machine-from-render-buffer.patch --- wine1.7-1.7.50/debian/patches/0012-dsound-remove-state-machine-from-render-buffer.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0012-dsound-remove-state-machine-from-render-buffer.patch 2015-11-16 21:33:39.000000000 +0000 @@ -0,0 +1,220 @@ +From 76c0cd47ef39abbc0280db57fa058e4a9b2afb54 Mon Sep 17 00:00:00 2001 +From: Maarten Lankhorst +Date: Mon, 16 Mar 2015 14:33:41 +0100 +Subject: [PATCH 12/14] dsound: remove state machine from render buffer + +.. wat +--- + dlls/dsound/dsound.c | 2 +- + dlls/dsound/dsound_private.h | 2 +- + dlls/dsound/mixer.c | 36 +------------------------ + dlls/dsound/primary.c | 64 ++++---------------------------------------- + 4 files changed, 8 insertions(+), 96 deletions(-) + +diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c +index 3828bed..492f546 100644 +--- a/dlls/dsound/dsound.c ++++ b/dlls/dsound/dsound.c +@@ -135,7 +135,7 @@ static HRESULT DirectSoundDevice_Create(DirectSoundDevice ** ppDevice) + + device->ref = 1; + device->priolevel = DSSCL_NORMAL; +- device->state = STATE_STOPPED; ++ device->stopped = 1; + device->speaker_config = DSSPEAKER_COMBINED(DSSPEAKER_STEREO, DSSPEAKER_GEOMETRY_WIDE); + + DSOUND_ParseSpeakerConfig(device); +diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h +index f142b7c..44bd527 100644 +--- a/dlls/dsound/dsound_private.h ++++ b/dlls/dsound/dsound_private.h +@@ -76,7 +76,7 @@ struct DirectSoundDevice + DWORD priolevel, sleeptime; + PWAVEFORMATEX pwfx, primary_pwfx; + LPBYTE buffer; +- DWORD writelead, buflen, aclen, fraglen, state, playpos, pad; ++ DWORD writelead, buflen, aclen, fraglen, playpos, pad, stopped; + int nrofbuffers; + IDirectSoundBufferImpl** buffers; + RTL_RWLOCK buffer_list_lock; +diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c +index 155e378..794d9c4 100644 +--- a/dlls/dsound/mixer.c ++++ b/dlls/dsound/mixer.c +@@ -694,10 +694,6 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) + * also wipe out just-played sound data */ + if (!pad) + WARN("Probable buffer underrun\n"); +- else if (device->state == STATE_STOPPED || +- device->state == STATE_STARTING) { +- TRACE("Buffer restarting\n"); +- } + + hr = IAudioRenderClient_GetBuffer(device->render, maxq / block, (void*)&buffer); + if(FAILED(hr)){ +@@ -723,23 +719,7 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) + ERR("ReleaseBuffer failed: %08x\n", hr); + + device->pad += maxq; +- +- if (maxq) { +- if (device->state == STATE_STARTING || +- device->state == STATE_STOPPED) { +- if(DSOUND_PrimaryPlay(device) != DS_OK) +- WARN("DSOUND_PrimaryPlay failed\n"); +- else if (device->state == STATE_STARTING) +- device->state = STATE_PLAYING; +- else +- device->state = STATE_STOPPING; +- } +- } else if (!pad && !maxq && (all_stopped == TRUE) && +- (device->state == STATE_STOPPING)) { +- device->state = STATE_STOPPED; +- DSOUND_PrimaryStop(device); +- } +- } else if (device->state != STATE_STOPPED) { ++ } else if (!device->stopped) { + if (maxq > device->buflen) + maxq = device->buflen; + if (writepos + maxq > device->buflen) { +@@ -747,20 +727,6 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) + DSOUND_WaveQueue(device, device->buffer, writepos + maxq - device->buflen); + } else + DSOUND_WaveQueue(device, device->buffer + writepos, maxq); +- +- /* in the DSSCL_WRITEPRIMARY mode, the app is totally in charge... */ +- if (device->state == STATE_STARTING) { +- if (DSOUND_PrimaryPlay(device) != DS_OK) +- WARN("DSOUND_PrimaryPlay failed\n"); +- else +- device->state = STATE_PLAYING; +- } +- else if (device->state == STATE_STOPPING) { +- if (DSOUND_PrimaryStop(device) != DS_OK) +- WARN("DSOUND_PrimaryStop failed\n"); +- else +- device->state = STATE_STOPPED; +- } + } + + LeaveCriticalSection(&(device->mixlock)); +diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c +index 4bfae7e..0f83eb9 100644 +--- a/dlls/dsound/primary.c ++++ b/dlls/dsound/primary.c +@@ -273,11 +273,6 @@ static HRESULT DSOUND_PrimaryOpen(DirectSoundDevice *device, WAVEFORMATEX *wfx, + HeapFree(GetProcessHeap(), 0, device->pwfx); + device->pwfx = wfx; + +- if (device->state == STATE_PLAYING) +- device->state = STATE_STARTING; +- else if (device->state == STATE_STOPPING) +- device->state = STATE_STOPPED; +- + device->writelead = (wfx->nSamplesPerSec / 100) * wfx->nBlockAlign; + + TRACE("buflen: %u, fraglen: %u, mix_buffer_len: %u\n", +@@ -391,7 +386,7 @@ HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) + return S_OK; + + err_service: +- ERR("GetService failed: %08x\n", hres); ++ WARN("GetService failed: %08x\n", hres); + err: + device->speaker_config = oldspeakerconfig; + DSOUND_ParseSpeakerConfig(device); +@@ -428,36 +423,6 @@ HRESULT DSOUND_PrimaryDestroy(DirectSoundDevice *device) + return DS_OK; + } + +-HRESULT DSOUND_PrimaryPlay(DirectSoundDevice *device) +-{ +- HRESULT hr; +- +- TRACE("(%p)\n", device); +- +- hr = IAudioClient_Start(device->client); +- if(FAILED(hr) && hr != AUDCLNT_E_NOT_STOPPED){ +- WARN("Start failed: %08x\n", hr); +- return hr; +- } +- +- return DS_OK; +-} +- +-HRESULT DSOUND_PrimaryStop(DirectSoundDevice *device) +-{ +- HRESULT hr; +- +- TRACE("(%p)\n", device); +- +- hr = IAudioClient_Stop(device->client); +- if(FAILED(hr)){ +- WARN("Stop failed: %08x\n", hr); +- return hr; +- } +- +- return DS_OK; +-} +- + WAVEFORMATEX *DSOUND_CopyFormat(const WAVEFORMATEX *wfex) + { + WAVEFORMATEX *pwfx; +@@ -705,16 +670,7 @@ static HRESULT WINAPI PrimaryBufferImpl_Play(IDirectSoundBuffer *iface, DWORD re + return DSERR_INVALIDPARAM; + } + +- /* **** */ +- EnterCriticalSection(&(device->mixlock)); +- +- if (device->state == STATE_STOPPED) +- device->state = STATE_STARTING; +- else if (device->state == STATE_STOPPING) +- device->state = STATE_PLAYING; +- +- LeaveCriticalSection(&(device->mixlock)); +- /* **** */ ++ device->stopped = 0; + + return DS_OK; + } +@@ -725,16 +681,7 @@ static HRESULT WINAPI PrimaryBufferImpl_Stop(IDirectSoundBuffer *iface) + DirectSoundDevice *device = This->device; + TRACE("(%p)\n", iface); + +- /* **** */ +- EnterCriticalSection(&(device->mixlock)); +- +- if (device->state == STATE_PLAYING) +- device->state = STATE_STOPPING; +- else if (device->state == STATE_STARTING) +- device->state = STATE_STOPPED; +- +- LeaveCriticalSection(&(device->mixlock)); +- /* **** */ ++ device->stopped = 1; + + return DS_OK; + } +@@ -802,7 +749,7 @@ static HRESULT WINAPI PrimaryBufferImpl_GetCurrentPosition(IDirectSoundBuffer *i + *playpos = mixpos; + if (writepos) { + *writepos = mixpos; +- if (device->state != STATE_STOPPED) { ++ if (!device->stopped) { + /* apply the documented 10ms lead to writepos */ + *writepos += device->writelead; + *writepos %= device->buflen; +@@ -828,8 +775,7 @@ static HRESULT WINAPI PrimaryBufferImpl_GetStatus(IDirectSoundBuffer *iface, DWO + } + + *status = 0; +- if ((device->state == STATE_STARTING) || +- (device->state == STATE_PLAYING)) ++ if (!device->stopped) + *status |= DSBSTATUS_PLAYING | DSBSTATUS_LOOPING; + + TRACE("status=%x\n", *status); +-- +2.5.0 + diff -Nru wine1.7-1.7.50/debian/patches/0012-winepulse-Add-IAudioClock-and-IAudioClock2.patch wine1.7-1.7.55/debian/patches/0012-winepulse-Add-IAudioClock-and-IAudioClock2.patch --- wine1.7-1.7.50/debian/patches/0012-winepulse-Add-IAudioClock-and-IAudioClock2.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0012-winepulse-Add-IAudioClock-and-IAudioClock2.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,209 +0,0 @@ -From c3626d40c2f37ba7a85f764d27140e534e9f2308 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:29 +0100 -Subject: [PATCH 12/50] winepulse: Add IAudioClock and IAudioClock2 - ---- - dlls/winepulse.drv/mmdevdrv.c | 172 ++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 172 insertions(+) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index 01cfd25..3ed2288 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -167,6 +167,16 @@ static inline ACImpl *impl_from_IAudioCaptureClient(IAudioCaptureClient *iface) - return CONTAINING_RECORD(iface, ACImpl, IAudioCaptureClient_iface); - } - -+static inline ACImpl *impl_from_IAudioClock(IAudioClock *iface) -+{ -+ return CONTAINING_RECORD(iface, ACImpl, IAudioClock_iface); -+} -+ -+static inline ACImpl *impl_from_IAudioClock2(IAudioClock2 *iface) -+{ -+ return CONTAINING_RECORD(iface, ACImpl, IAudioClock2_iface); -+} -+ - /* Following pulseaudio design here, mainloop has the lock taken whenever - * it is handling something for pulse, and the lock is required whenever - * doing any pa_* call that can affect the state in any way -@@ -1449,6 +1459,8 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid, - if (This->dataflow != eCapture) - return AUDCLNT_E_WRONG_ENDPOINT_TYPE; - *ppv = &This->IAudioCaptureClient_iface; -+ } else if (IsEqualIID(riid, &IID_IAudioClock)) { -+ *ppv = &This->IAudioClock_iface; - } - - if (*ppv) { -@@ -1750,6 +1762,166 @@ static const IAudioCaptureClientVtbl AudioCaptureClient_Vtbl = - AudioCaptureClient_GetNextPacketSize - }; - -+static HRESULT WINAPI AudioClock_QueryInterface(IAudioClock *iface, -+ REFIID riid, void **ppv) -+{ -+ ACImpl *This = impl_from_IAudioClock(iface); -+ -+ TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); -+ -+ if (!ppv) -+ return E_POINTER; -+ *ppv = NULL; -+ -+ if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IAudioClock)) -+ *ppv = iface; -+ else if (IsEqualIID(riid, &IID_IAudioClock2)) -+ *ppv = &This->IAudioClock2_iface; -+ if (*ppv) { -+ IUnknown_AddRef((IUnknown*)*ppv); -+ return S_OK; -+ } -+ -+ WARN("Unknown interface %s\n", debugstr_guid(riid)); -+ return E_NOINTERFACE; -+} -+ -+static ULONG WINAPI AudioClock_AddRef(IAudioClock *iface) -+{ -+ ACImpl *This = impl_from_IAudioClock(iface); -+ return IAudioClient_AddRef(&This->IAudioClient_iface); -+} -+ -+static ULONG WINAPI AudioClock_Release(IAudioClock *iface) -+{ -+ ACImpl *This = impl_from_IAudioClock(iface); -+ return IAudioClient_Release(&This->IAudioClient_iface); -+} -+ -+static HRESULT WINAPI AudioClock_GetFrequency(IAudioClock *iface, UINT64 *freq) -+{ -+ ACImpl *This = impl_from_IAudioClock(iface); -+ HRESULT hr; -+ -+ TRACE("(%p)->(%p)\n", This, freq); -+ -+ pthread_mutex_lock(&pulse_lock); -+ hr = pulse_stream_valid(This); -+ if (SUCCEEDED(hr)) -+ *freq = This->ss.rate * pa_frame_size(&This->ss); -+ pthread_mutex_unlock(&pulse_lock); -+ return hr; -+} -+ -+static HRESULT WINAPI AudioClock_GetPosition(IAudioClock *iface, UINT64 *pos, -+ UINT64 *qpctime) -+{ -+ ACImpl *This = impl_from_IAudioClock(iface); -+ pa_usec_t time; -+ HRESULT hr; -+ -+ TRACE("(%p)->(%p, %p)\n", This, pos, qpctime); -+ -+ if (!pos) -+ return E_POINTER; -+ -+ pthread_mutex_lock(&pulse_lock); -+ hr = pulse_stream_valid(This); -+ if (FAILED(hr)) { -+ pthread_mutex_unlock(&pulse_lock); -+ return hr; -+ } -+ -+ *pos = This->clock_written; -+ if (This->clock_pulse != PA_USEC_INVALID && pa_stream_get_time(This->stream, &time) >= 0) { -+ UINT32 delta = pa_usec_to_bytes(time - This->clock_pulse, &This->ss); -+ if (delta < This->pad) -+ *pos += delta; -+ else -+ *pos += This->pad; -+ } -+ -+ /* Make time never go backwards */ -+ if (*pos < This->clock_lastpos) -+ *pos = This->clock_lastpos; -+ else -+ This->clock_lastpos = *pos; -+ pthread_mutex_unlock(&pulse_lock); -+ -+ TRACE("%p Position: %u\n", This, (unsigned)*pos); -+ -+ if (qpctime) { -+ LARGE_INTEGER stamp, freq; -+ QueryPerformanceCounter(&stamp); -+ QueryPerformanceFrequency(&freq); -+ *qpctime = (stamp.QuadPart * (INT64)10000000) / freq.QuadPart; -+ } -+ -+ return S_OK; -+} -+ -+static HRESULT WINAPI AudioClock_GetCharacteristics(IAudioClock *iface, -+ DWORD *chars) -+{ -+ ACImpl *This = impl_from_IAudioClock(iface); -+ -+ TRACE("(%p)->(%p)\n", This, chars); -+ -+ if (!chars) -+ return E_POINTER; -+ -+ *chars = AUDIOCLOCK_CHARACTERISTIC_FIXED_FREQ; -+ -+ return S_OK; -+} -+ -+static const IAudioClockVtbl AudioClock_Vtbl = -+{ -+ AudioClock_QueryInterface, -+ AudioClock_AddRef, -+ AudioClock_Release, -+ AudioClock_GetFrequency, -+ AudioClock_GetPosition, -+ AudioClock_GetCharacteristics -+}; -+ -+static HRESULT WINAPI AudioClock2_QueryInterface(IAudioClock2 *iface, -+ REFIID riid, void **ppv) -+{ -+ ACImpl *This = impl_from_IAudioClock2(iface); -+ return IAudioClock_QueryInterface(&This->IAudioClock_iface, riid, ppv); -+} -+ -+static ULONG WINAPI AudioClock2_AddRef(IAudioClock2 *iface) -+{ -+ ACImpl *This = impl_from_IAudioClock2(iface); -+ return IAudioClient_AddRef(&This->IAudioClient_iface); -+} -+ -+static ULONG WINAPI AudioClock2_Release(IAudioClock2 *iface) -+{ -+ ACImpl *This = impl_from_IAudioClock2(iface); -+ return IAudioClient_Release(&This->IAudioClient_iface); -+} -+ -+static HRESULT WINAPI AudioClock2_GetDevicePosition(IAudioClock2 *iface, -+ UINT64 *pos, UINT64 *qpctime) -+{ -+ ACImpl *This = impl_from_IAudioClock2(iface); -+ HRESULT hr = AudioClock_GetPosition(&This->IAudioClock_iface, pos, qpctime); -+ if (SUCCEEDED(hr)) -+ *pos /= pa_frame_size(&This->ss); -+ return hr; -+} -+ -+static const IAudioClock2Vtbl AudioClock2_Vtbl = -+{ -+ AudioClock2_QueryInterface, -+ AudioClock2_AddRef, -+ AudioClock2_Release, -+ AudioClock2_GetDevicePosition -+}; -+ - HRESULT WINAPI AUDDRV_GetAudioSessionManager(IMMDevice *device, - IAudioSessionManager2 **out) - { --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0013-dsound-kill-unconditional-memory-allocation-in-mixin.patch wine1.7-1.7.55/debian/patches/0013-dsound-kill-unconditional-memory-allocation-in-mixin.patch --- wine1.7-1.7.50/debian/patches/0013-dsound-kill-unconditional-memory-allocation-in-mixin.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0013-dsound-kill-unconditional-memory-allocation-in-mixin.patch 2015-11-16 21:33:39.000000000 +0000 @@ -0,0 +1,105 @@ +From 664381a654c89338874501c5e7647b8ad0763764 Mon Sep 17 00:00:00 2001 +From: Maarten Lankhorst +Date: Mon, 16 Mar 2015 14:33:41 +0100 +Subject: [PATCH 13/14] dsound: kill unconditional memory allocation in mixing + thread + +Unfortunately this doesn't get rid of the memory allocation entirely, +but it will decrease the chance of underruns due to locking immensely. + +Signed-off-by: Maarten Lankhorst +--- + dlls/dsound/dsound.c | 1 + + dlls/dsound/dsound_private.h | 4 ++-- + dlls/dsound/mixer.c | 27 ++++++++++++++++++--------- + 3 files changed, 21 insertions(+), 11 deletions(-) + +diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c +index 492f546..8249bcb 100644 +--- a/dlls/dsound/dsound.c ++++ b/dlls/dsound/dsound.c +@@ -234,6 +234,7 @@ static ULONG DirectSoundDevice_Release(DirectSoundDevice * device) + IAudioStreamVolume_Release(device->volume); + + HeapFree(GetProcessHeap(), 0, device->tmp_buffer); ++ HeapFree(GetProcessHeap(), 0, device->cp_buffer); + HeapFree(GetProcessHeap(), 0, device->buffer); + RtlDeleteResource(&device->buffer_list_lock); + device->mixlock.DebugInfo->Spare[0] = 0; +diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h +index 44bd527..04067e1 100644 +--- a/dlls/dsound/dsound_private.h ++++ b/dlls/dsound/dsound_private.h +@@ -87,8 +87,8 @@ struct DirectSoundDevice + int speaker_num[DS_MAX_CHANNELS]; + int num_speakers; + int lfe_channel; +- float *tmp_buffer; +- DWORD tmp_buffer_len, mix_buffer_len; ++ float *tmp_buffer, *cp_buffer; ++ DWORD tmp_buffer_len, mix_buffer_len, cp_buffer_len; + + DSVOLUMEPAN volpan; + +diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c +index 794d9c4..39dc4a4 100644 +--- a/dlls/dsound/mixer.c ++++ b/dlls/dsound/mixer.c +@@ -282,7 +282,8 @@ static UINT cp_fields_resample(IDirectSoundBufferImpl *dsb, UINT count, LONG64 * + { + UINT i, channel; + UINT istride = dsb->pwfx->nBlockAlign; +- UINT ostride = dsb->device->pwfx->nChannels * sizeof(float); ++ DirectSoundDevice *dev = dsb->device; ++ UINT ostride = dev->pwfx->nChannels * sizeof(float); + + LONG64 freqAcc_start = *freqAccNum; + LONG64 freqAcc_end = freqAcc_start + count * dsb->freqAdjustNum; +@@ -292,18 +293,29 @@ static UINT cp_fields_resample(IDirectSoundBufferImpl *dsb, UINT count, LONG64 * + + UINT fir_cachesize = (fir_len + dsbfirstep - 2) / dsbfirstep; + UINT required_input = max_ipos + fir_cachesize; ++ float *intermediate, *fir_copy, *itmp; ++ ++ DWORD len = required_input * channels; ++ len += fir_cachesize; ++ len *= sizeof(float); ++ ++ if (!dev->cp_buffer) { ++ dev->cp_buffer = HeapAlloc(GetProcessHeap(), 0, len); ++ dev->cp_buffer_len = len; ++ } else if (len > dev->cp_buffer_len) { ++ dev->cp_buffer = HeapReAlloc(GetProcessHeap(), 0, dev->cp_buffer, len); ++ dev->cp_buffer_len = len; ++ } + +- float* intermediate = HeapAlloc(GetProcessHeap(), 0, +- sizeof(float) * required_input * channels); ++ fir_copy = dev->cp_buffer; ++ intermediate = fir_copy + fir_cachesize; + +- float* fir_copy = HeapAlloc(GetProcessHeap(), 0, +- sizeof(float) * fir_cachesize); + + /* Important: this buffer MUST be non-interleaved + * if you want -msse3 to have any effect. + * This is good for CPU cache effects, too. + */ +- float* itmp = intermediate; ++ itmp = intermediate; + for (channel = 0; channel < channels; channel++) + for (i = 0; i < required_input; i++) + *(itmp++) = get_current_sample(dsb, +@@ -338,9 +350,6 @@ static UINT cp_fields_resample(IDirectSoundBufferImpl *dsb, UINT count, LONG64 * + + *freqAccNum = freqAcc_end % dsb->freqAdjustDen; + +- HeapFree(GetProcessHeap(), 0, fir_copy); +- HeapFree(GetProcessHeap(), 0, intermediate); +- + return max_ipos; + } + +-- +2.5.0 + diff -Nru wine1.7-1.7.50/debian/patches/0013-winepulse-Add-audiostreamvolume.patch wine1.7-1.7.55/debian/patches/0013-winepulse-Add-audiostreamvolume.patch --- wine1.7-1.7.50/debian/patches/0013-winepulse-Add-audiostreamvolume.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0013-winepulse-Add-audiostreamvolume.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,285 +0,0 @@ -From 5c44180de98c2c3963112001f578f2021f130b52 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:29 +0100 -Subject: [PATCH 13/50] winepulse: Add audiostreamvolume - ---- -Pulse allows streams to set volume, but for various reasons it's -better off being disabled by default. - -It can be enabled with HKCU\Software\Wine\Pulse\StreamVol=0x1 ---- - dlls/winepulse.drv/mmdevdrv.c | 236 ++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 236 insertions(+) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index 3ed2288..b7414c2 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -177,6 +177,11 @@ static inline ACImpl *impl_from_IAudioClock2(IAudioClock2 *iface) - return CONTAINING_RECORD(iface, ACImpl, IAudioClock2_iface); - } - -+static inline ACImpl *impl_from_IAudioStreamVolume(IAudioStreamVolume *iface) -+{ -+ return CONTAINING_RECORD(iface, ACImpl, IAudioStreamVolume_iface); -+} -+ - /* Following pulseaudio design here, mainloop has the lock taken whenever - * it is handling something for pulse, and the lock is required whenever - * doing any pa_* call that can affect the state in any way -@@ -444,6 +449,12 @@ static void pulse_op_cb(pa_stream *s, int success, void *user) { - pthread_cond_signal(&pulse_cond); - } - -+static void pulse_ctx_op_cb(pa_context *c, int success, void *user) { -+ TRACE("Success: %i\n", success); -+ *(int*)user = success; -+ pthread_cond_signal(&pulse_cond); -+} -+ - static void pulse_attr_update(pa_stream *s, void *user) { - const pa_buffer_attr *attr = pa_stream_get_buffer_attr(s); - TRACE("New attributes or device moved:\n"); -@@ -1461,6 +1472,8 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid, - *ppv = &This->IAudioCaptureClient_iface; - } else if (IsEqualIID(riid, &IID_IAudioClock)) { - *ppv = &This->IAudioClock_iface; -+ } else if (IsEqualIID(riid, &IID_IAudioStreamVolume)) { -+ *ppv = &This->IAudioStreamVolume_iface; - } - - if (*ppv) { -@@ -1922,6 +1935,229 @@ static const IAudioClock2Vtbl AudioClock2_Vtbl = - AudioClock2_GetDevicePosition - }; - -+static HRESULT WINAPI AudioStreamVolume_QueryInterface( -+ IAudioStreamVolume *iface, REFIID riid, void **ppv) -+{ -+ TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); -+ -+ if (!ppv) -+ return E_POINTER; -+ *ppv = NULL; -+ -+ if (IsEqualIID(riid, &IID_IUnknown) || -+ IsEqualIID(riid, &IID_IAudioStreamVolume)) -+ *ppv = iface; -+ if (*ppv) { -+ IUnknown_AddRef((IUnknown*)*ppv); -+ return S_OK; -+ } -+ -+ WARN("Unknown interface %s\n", debugstr_guid(riid)); -+ return E_NOINTERFACE; -+} -+ -+static ULONG WINAPI AudioStreamVolume_AddRef(IAudioStreamVolume *iface) -+{ -+ ACImpl *This = impl_from_IAudioStreamVolume(iface); -+ return IAudioClient_AddRef(&This->IAudioClient_iface); -+} -+ -+static ULONG WINAPI AudioStreamVolume_Release(IAudioStreamVolume *iface) -+{ -+ ACImpl *This = impl_from_IAudioStreamVolume(iface); -+ return IAudioClient_Release(&This->IAudioClient_iface); -+} -+ -+static HRESULT WINAPI AudioStreamVolume_GetChannelCount( -+ IAudioStreamVolume *iface, UINT32 *out) -+{ -+ ACImpl *This = impl_from_IAudioStreamVolume(iface); -+ -+ TRACE("(%p)->(%p)\n", This, out); -+ -+ if (!out) -+ return E_POINTER; -+ -+ *out = This->ss.channels; -+ -+ return S_OK; -+} -+ -+struct pulse_info_cb_data { -+ UINT32 n; -+ float *levels; -+}; -+ -+static void pulse_sink_input_info_cb(pa_context *c, const pa_sink_input_info *info, int eol, void *data) -+{ -+ struct pulse_info_cb_data *d = data; -+ int i; -+ if (eol) -+ return; -+ for (i = 0; i < d->n; ++i) -+ d->levels[i] = (float)info->volume.values[i] / (float)PA_VOLUME_NORM; -+ pthread_cond_signal(&pulse_cond); -+} -+ -+static void pulse_source_info_cb(pa_context *c, const pa_source_info *info, int eol, void *data) -+{ -+ struct pulse_info_cb_data *d = data; -+ int i; -+ if (eol) -+ return; -+ for (i = 0; i < d->n; ++i) -+ d->levels[i] = (float)info->volume.values[i] / (float)PA_VOLUME_NORM; -+ pthread_cond_signal(&pulse_cond); -+} -+ -+static HRESULT WINAPI AudioStreamVolume_SetAllVolumes( -+ IAudioStreamVolume *iface, UINT32 count, const float *levels) -+{ -+ ACImpl *This = impl_from_IAudioStreamVolume(iface); -+ pa_operation *o; -+ HRESULT hr; -+ int success = 0, i; -+ pa_cvolume cv; -+ -+ TRACE("(%p)->(%d, %p)\n", This, count, levels); -+ -+ if (!levels) -+ return E_POINTER; -+ -+ if (count != This->ss.channels) -+ return E_INVALIDARG; -+ -+ pthread_mutex_lock(&pulse_lock); -+ hr = pulse_stream_valid(This); -+ if (FAILED(hr)) -+ goto out; -+ -+ if (pulse_stream_volume) { -+ cv.channels = count; -+ for (i = 0; i < cv.channels; ++i) -+ cv.values[i] = levels[i] * (float)PA_VOLUME_NORM; -+ if (This->dataflow == eRender) -+ o = pa_context_set_sink_input_volume(pulse_ctx, pa_stream_get_index(This->stream), &cv, pulse_ctx_op_cb, &success); -+ else -+ o = pa_context_set_source_volume_by_index(pulse_ctx, pa_stream_get_device_index(This->stream), &cv, pulse_ctx_op_cb, &success); -+ if (o) { -+ while(pa_operation_get_state(o) == PA_OPERATION_RUNNING) -+ pthread_cond_wait(&pulse_cond, &pulse_lock); -+ pa_operation_unref(o); -+ } -+ if (!success) -+ hr = AUDCLNT_E_BUFFER_ERROR; -+ } else { -+ int i; -+ for (i = 0; i < count; ++i) -+ This->vol[i] = levels[i]; -+ } -+ -+out: -+ pthread_mutex_unlock(&pulse_lock); -+ return hr; -+} -+ -+static HRESULT WINAPI AudioStreamVolume_GetAllVolumes( -+ IAudioStreamVolume *iface, UINT32 count, float *levels) -+{ -+ ACImpl *This = impl_from_IAudioStreamVolume(iface); -+ pa_operation *o; -+ HRESULT hr; -+ struct pulse_info_cb_data info; -+ -+ TRACE("(%p)->(%d, %p)\n", This, count, levels); -+ -+ if (!levels) -+ return E_POINTER; -+ -+ if (count != This->ss.channels) -+ return E_INVALIDARG; -+ -+ pthread_mutex_lock(&pulse_lock); -+ hr = pulse_stream_valid(This); -+ if (FAILED(hr)) -+ goto out; -+ -+ if (pulse_stream_volume) { -+ info.n = count; -+ info.levels = levels; -+ if (This->dataflow == eRender) -+ o = pa_context_get_sink_input_info(pulse_ctx, pa_stream_get_index(This->stream), pulse_sink_input_info_cb, &info); -+ else -+ o = pa_context_get_source_info_by_index(pulse_ctx, pa_stream_get_device_index(This->stream), pulse_source_info_cb, &info); -+ if (o) { -+ while(pa_operation_get_state(o) == PA_OPERATION_RUNNING) -+ pthread_cond_wait(&pulse_cond, &pulse_lock); -+ pa_operation_unref(o); -+ } else -+ hr = AUDCLNT_E_BUFFER_ERROR; -+ } else { -+ int i; -+ for (i = 0; i < count; ++i) -+ levels[i] = This->vol[i]; -+ } -+ -+out: -+ pthread_mutex_unlock(&pulse_lock); -+ return hr; -+} -+ -+static HRESULT WINAPI AudioStreamVolume_SetChannelVolume( -+ IAudioStreamVolume *iface, UINT32 index, float level) -+{ -+ ACImpl *This = impl_from_IAudioStreamVolume(iface); -+ HRESULT hr; -+ float volumes[PA_CHANNELS_MAX]; -+ -+ TRACE("(%p)->(%d, %f)\n", This, index, level); -+ -+ if (level < 0.f || level > 1.f) -+ return E_INVALIDARG; -+ -+ if (index >= This->ss.channels) -+ return E_INVALIDARG; -+ -+ hr = AudioStreamVolume_GetAllVolumes(iface, This->ss.channels, volumes); -+ volumes[index] = level; -+ if (SUCCEEDED(hr)) -+ hr = AudioStreamVolume_SetAllVolumes(iface, This->ss.channels, volumes); -+ return hr; -+} -+ -+static HRESULT WINAPI AudioStreamVolume_GetChannelVolume( -+ IAudioStreamVolume *iface, UINT32 index, float *level) -+{ -+ ACImpl *This = impl_from_IAudioStreamVolume(iface); -+ float volumes[PA_CHANNELS_MAX]; -+ HRESULT hr; -+ -+ TRACE("(%p)->(%d, %p)\n", This, index, level); -+ -+ if (!level) -+ return E_POINTER; -+ -+ if (index >= This->ss.channels) -+ return E_INVALIDARG; -+ -+ hr = AudioStreamVolume_GetAllVolumes(iface, This->ss.channels, volumes); -+ if (SUCCEEDED(hr)) -+ *level = volumes[index]; -+ return hr; -+} -+ -+static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl = -+{ -+ AudioStreamVolume_QueryInterface, -+ AudioStreamVolume_AddRef, -+ AudioStreamVolume_Release, -+ AudioStreamVolume_GetChannelCount, -+ AudioStreamVolume_SetChannelVolume, -+ AudioStreamVolume_GetChannelVolume, -+ AudioStreamVolume_SetAllVolumes, -+ AudioStreamVolume_GetAllVolumes -+}; -+ - HRESULT WINAPI AUDDRV_GetAudioSessionManager(IMMDevice *device, - IAudioSessionManager2 **out) - { --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0014-TESTING-override-pthreads-to-fix-gstreamer-v5.patch wine1.7-1.7.55/debian/patches/0014-TESTING-override-pthreads-to-fix-gstreamer-v5.patch --- wine1.7-1.7.50/debian/patches/0014-TESTING-override-pthreads-to-fix-gstreamer-v5.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0014-TESTING-override-pthreads-to-fix-gstreamer-v5.patch 2015-11-16 21:33:39.000000000 +0000 @@ -0,0 +1,665 @@ +From c0ed9cbc7ff8fb21304078e48fb72c49495c4151 Mon Sep 17 00:00:00 2001 +From: Maarten Lankhorst +Date: Mon, 16 Mar 2015 14:33:41 +0100 +Subject: [PATCH 14/14] TESTING -- override pthreads to fix gstreamer v5 + +I believe the code is ready and will work properly now in all cases. +but please test before cherry picking this patch, and report +success or failure to me please. + +Changes since v1: + - Call pthread_yield to make sure that we link against libpthread. + This fixes the build on saucy. +Changes since v2: + - Set thread_data->detached before creating the thread to prevent + a race condition. +Changes since v3: + - Set thread_data->detached CORRECTLY. Fix a small race between + thread creation and pthread_detach. +Changes since v4: + - Set native thread stack defaults in a similar way to eglibc, + and respect the defaults for win32 again. This fixes the regression + where you can only create 194 threads in java. +--- + dlls/ntdll/ntdll_misc.h | 3 + + dlls/ntdll/thread.c | 331 ++++++++++++++++++++++++++++++++++++++-- + dlls/winegstreamer/glibthread.c | 13 ++ + libs/wine/loader.c | 7 + + libs/wine/wine.map | 6 + + loader/Makefile.in | 4 +- + loader/main.c | 41 +++++ + 7 files changed, 387 insertions(+), 18 deletions(-) + +diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h +index cbd19db..52b8e8d 100644 +--- a/dlls/ntdll/ntdll_misc.h ++++ b/dlls/ntdll/ntdll_misc.h +@@ -28,6 +28,7 @@ + #include "winnt.h" + #include "winternl.h" + #include "wine/server.h" ++#include "wine/list.h" + + #define MAX_NT_PATH_LENGTH 277 + +@@ -240,6 +241,8 @@ struct ntdll_thread_data + WINE_VM86_TEB_INFO vm86; /* 1fc vm86 private data */ + void *exit_frame; /* 204 exit frame pointer */ + #endif ++ struct list entry; ++ BOOL detached; + }; + + static inline struct ntdll_thread_data *ntdll_get_thread_data(void) +diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c +index aaf7a71..62277a1 100644 +--- a/dlls/ntdll/thread.c ++++ b/dlls/ntdll/thread.c +@@ -33,6 +33,7 @@ + #ifdef HAVE_SYS_SYSCALL_H + #include + #endif ++#include + + #define NONAMELESSUNION + #include "ntstatus.h" +@@ -58,6 +59,7 @@ struct startup_info + TEB *teb; + PRTL_THREAD_START_ROUTINE entry_point; + void *entry_arg; ++ BOOL native_thread; + }; + + static PEB *peb; +@@ -202,6 +204,80 @@ static ULONG64 get_dyld_image_info_addr(void) + } + #endif /* __APPLE__ */ + ++#ifdef __linux__ ++#include ++ ++extern typeof(pthread_create) *__glob_pthread_create, *call_pthread_create; ++extern typeof(pthread_join) *__glob_pthread_join, *call_pthread_join; ++extern typeof(pthread_detach) *__glob_pthread_detach, *call_pthread_detach; ++ ++static typeof(pthread_create) __hook_pthread_create; ++static typeof(pthread_join) __hook_pthread_join; ++static typeof(pthread_detach) __hook_pthread_detach; ++ ++static pthread_mutex_t thread_lock; ++ ++static void thread_wrap_init(void) ++{ ++ pthread_mutexattr_t attr; ++ pthread_mutexattr_init(&attr); ++ pthread_mutexattr_setrobust(&attr, PTHREAD_MUTEX_ROBUST); ++ pthread_mutex_init(&thread_lock, &attr); ++ pthread_mutexattr_destroy(&attr); ++ ++ call_pthread_create = __hook_pthread_create; ++ call_pthread_join = __hook_pthread_join; ++ call_pthread_detach = __hook_pthread_detach; ++} ++ ++static TEB *dead_teb; ++static struct list active_list = LIST_INIT(active_list); ++ ++static void take_thread_lock(void) ++{ ++ int ret = pthread_mutex_lock(&thread_lock); ++ if (ret == EOWNERDEAD) ++ pthread_mutex_consistent(&thread_lock); ++} ++ ++static void detach_thread_unlock(TEB *own_teb) ++{ ++ struct ntdll_thread_data *thread_data; ++ TEB *teb = dead_teb; ++ ++ dead_teb = own_teb; ++ ++ pthread_mutex_unlock(&thread_lock); ++ if (!teb) ++ return; ++ ++ thread_data = (struct ntdll_thread_data *)teb->SpareBytes1; ++ __glob_pthread_join(thread_data->pthread_id, NULL); ++ signal_free_thread(teb); ++} ++ ++static void reap_thread(TEB *teb) ++{ ++ struct ntdll_thread_data *thread_data = (struct ntdll_thread_data *)teb->SpareBytes1; ++ take_thread_lock(); ++ if (thread_data->detached) ++ detach_thread_unlock(teb); ++ else { ++ /* ++ * Do not unlock, wait until the thread is thoroughly dead. ++ * This prevents a race condition where detach is called ++ * after the thread has not finished dying yet. ++ */ ++ } ++} ++ ++#else ++#define __glob_pthread_create pthread_create ++#define __glob_pthread_join pthread_join ++#define __glob_pthread_detach pthread_detach ++#define thread_wrap_init() ++#endif ++ + /*********************************************************************** + * thread_init + * +@@ -223,6 +299,7 @@ HANDLE thread_init(void) + ULONG64 dyld_image_info; + #endif + ++ thread_wrap_init(); + virtual_init(); + + /* reserve space for shared user data */ +@@ -369,14 +446,12 @@ void terminate_thread( int status ) + pthread_exit( UIntToPtr(status) ); + } + +- +-/*********************************************************************** +- * exit_thread +- */ +-void exit_thread( int status ) ++static void exit_thread_common( int status ) + { ++#ifndef __linux__ + static void *prev_teb; + TEB *teb; ++#endif + + if (status) /* send the exit code to the server (0 is already the default) */ + { +@@ -400,24 +475,199 @@ void exit_thread( int status ) + + pthread_sigmask( SIG_BLOCK, &server_block_set, NULL ); + ++#ifndef __linux__ + if ((teb = interlocked_xchg_ptr( &prev_teb, NtCurrentTeb() ))) + { + struct ntdll_thread_data *thread_data = (struct ntdll_thread_data *)teb->SpareBytes1; + + if (thread_data->pthread_id) + { +- pthread_join( thread_data->pthread_id, NULL ); ++ __glob_pthread_join( thread_data->pthread_id, NULL ); + signal_free_thread( teb ); + } + } ++#else ++ reap_thread(NtCurrentTeb()); ++#endif + + close( ntdll_get_thread_data()->wait_fd[0] ); + close( ntdll_get_thread_data()->wait_fd[1] ); + close( ntdll_get_thread_data()->reply_fd ); + close( ntdll_get_thread_data()->request_fd ); ++} ++ ++void exit_thread( int status ) ++{ ++ exit_thread_common(status); + pthread_exit( UIntToPtr(status) ); + } + ++#ifdef __linux__ ++ ++struct unix_arg { ++ void *(*start)(void *); ++ void *arg; ++}; ++ ++/* dummy used for comparison */ ++static DWORD native_unix_start; ++ ++static void call_native_cleanup(void *arg) ++{ ++ exit_thread_common(0); ++} ++ ++static int ++__hook_pthread_create(pthread_t *thread, const pthread_attr_t *attr, ++ void *(*start_routine) (void *), void *parm) ++{ ++ NTSTATUS ret; ++ pthread_t tid; ++ size_t stack = 0, stack_commit; ++ static size_t default_stack; ++ struct unix_arg arg; ++ IMAGE_NT_HEADERS *nt; ++ ++ arg.start = start_routine; ++ arg.arg = parm; ++ ++ if (!default_stack) { ++ struct rlimit limit; ++ ++ if (getrlimit(RLIMIT_STACK, &limit) == 0 && ++ limit.rlim_cur != RLIM_INFINITY) ++ default_stack = limit.rlim_cur; ++ else ++ default_stack = 2 * 1024 * 1024; ++ } ++ ++ if (!thread) ++ thread = &tid; ++ ++ TRACE("Overriding thread creation!\n"); ++ if (attr) { ++ static int once; ++ if (!once++) ++ FIXME("most thread attributes ignored!\n"); ++ else ++ WARN("most thread attributes ignored!\n"); ++ ++ pthread_attr_getstacksize(attr, &stack); ++ } ++ ++ if (!stack) ++ stack = default_stack; ++ ++ nt = RtlImageNtHeader( NtCurrentTeb()->Peb->ImageBaseAddress ); ++ stack_commit = nt->OptionalHeader.SizeOfStackCommit; ++ ++ if (!stack_commit || stack_commit > stack) ++ stack_commit = stack; ++ ++ ret = RtlCreateUserThread( NtCurrentProcess(), NULL, FALSE, NULL, stack, stack_commit, (void*)&native_unix_start, &arg, NULL, (void*)thread ); ++ if (ret != STATUS_SUCCESS) ++ FIXME("ret: %08x\n", ret); ++ switch (ret) { ++ case STATUS_SUCCESS: ++ TRACE("created thread %lx for %p/%p\n", *thread, start_routine, parm); ++ return 0; ++ case STATUS_NO_MEMORY: ++ return ENOMEM; ++ case STATUS_TOO_MANY_OPENED_FILES: ++ return EMFILE; ++ default: ++ ERR("Unhandled ntstatus %08x\n", ret); ++ return ENOMEM; ++ } ++} ++ ++static int __hook_pthread_detach(pthread_t thread) ++{ ++ struct ntdll_thread_data *thread_data; ++ TEB *teb = NULL; ++ ++ if (pthread_equal(thread, pthread_self())) { ++ TRACE("Detached self: %lx\n", pthread_self()); ++ ntdll_get_thread_data()->detached = 1; ++ return 0; ++ } ++ ++ take_thread_lock(); ++ LIST_FOR_EACH_ENTRY(thread_data, &active_list, typeof(*thread_data), entry) { ++ if (pthread_equal(thread_data->pthread_id, thread)) { ++ teb = CONTAINING_RECORD(thread_data, typeof(*teb), SpareBytes1); ++ ++ list_remove(&thread_data->entry); ++ if (!pthread_tryjoin_np(thread, NULL)) { ++ detach_thread_unlock(NULL); ++ TRACE("Thread %lx was dead, cleaning up\n", thread); ++ signal_free_thread(teb); ++ return 0; ++ } ++ thread_data->detached = 1; ++ break; ++ } ++ } ++ detach_thread_unlock(NULL); ++ if (!teb) ++ TRACE("Could not find thread %lx to detach\n", thread); ++ else ++ TRACE("Changed thread %lx to detached\n", thread); ++ return teb ? 0 : ESRCH; ++} ++ ++static int __hook_pthread_join(pthread_t thread, void **retval) ++{ ++ struct ntdll_thread_data *thread_data, *t2; ++ int ret = ESRCH; ++ ++ if (pthread_equal(thread, pthread_self())) ++ return EDEADLK; ++ ++ take_thread_lock(); ++ LIST_FOR_EACH_ENTRY(thread_data, &active_list, typeof(*thread_data), entry) { ++ TEB *teb = CONTAINING_RECORD(thread_data, typeof(*teb), SpareBytes1); ++ ++ if (pthread_equal(thread, thread_data->pthread_id)) { ++ ++ ret = pthread_tryjoin_np(thread, retval); ++ if (!ret) { ++ TRACE("Thread %lx was dead fastpath, cleaning up\n", thread); ++ goto free; ++ } ++ detach_thread_unlock(NULL); ++ ++ ret = __glob_pthread_join(thread, retval); ++ if (ret) { ++ TRACE("Thread %lx join failed with %i, ignoring\n", thread, ret); ++ return ret; ++ } ++ ++ take_thread_lock(); ++ /* Check if someone else freed the thread yet */ ++ LIST_FOR_EACH_ENTRY(t2, &active_list, typeof(*thread_data), entry) ++ if (t2 == thread_data) { ++ TRACE("Cleaning up after successful join\n"); ++ goto free; ++ } ++ TRACE("No clean up after successful join, multiple pthread_join's?\n"); ++ break; ++ ++free: ++ list_remove(&thread_data->entry); ++ detach_thread_unlock(NULL); ++ signal_free_thread(teb); ++ return 0; ++ } ++ } ++ ++ detach_thread_unlock(NULL); ++ if (ret) ++ TRACE("failed with %i\n", ret); ++ return ret; ++} ++ ++#endif + + /*********************************************************************** + * start_thread +@@ -446,9 +696,19 @@ static void start_thread( struct startup_info *info ) + if (TRACE_ON(relay)) + DPRINTF( "%04x:Starting thread proc %p (arg=%p)\n", GetCurrentThreadId(), func, arg ); + +- call_thread_entry_point( (LPTHREAD_START_ROUTINE)func, arg ); +-} ++#ifdef __linux__ ++ if (info->native_thread) { ++ void *(*start)(void*) = (void*)func; + ++ FIXME("Started native thread %08x\n", GetCurrentThreadId()); ++ pthread_cleanup_push(call_native_cleanup, NULL); ++ pthread_exit(start(arg)); ++ pthread_cleanup_pop(1); ++ return; ++ } ++#endif ++ call_thread_entry_point( (LPTHREAD_START_ROUTINE)func, arg ); ++} + + /*********************************************************************** + * RtlCreateUserThread (NTDLL.@) +@@ -460,14 +720,13 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR * + HANDLE *handle_ptr, CLIENT_ID *id ) + { + sigset_t sigset; +- pthread_t pthread_id; + pthread_attr_t attr; + struct ntdll_thread_data *thread_data; + struct startup_info *info = NULL; + HANDLE handle = 0, actctx = 0; + TEB *teb = NULL; + DWORD tid = 0; +- int request_pipe[2]; ++ int request_pipe[2], ret; + NTSTATUS status; + + if (process != NtCurrentProcess()) +@@ -492,10 +751,14 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR * + if (handle_ptr) *handle_ptr = wine_server_ptr_handle( result.create_thread.handle ); + else NtClose( wine_server_ptr_handle( result.create_thread.handle )); + } ++ TRACE("CreateThread for other process returns %08x\n", result.create_thread.status); + return result.create_thread.status; + } + +- if (server_pipe( request_pipe ) == -1) return STATUS_TOO_MANY_OPENED_FILES; ++ if (server_pipe( request_pipe ) == -1) { ++ TRACE("CreateThread cannot create request pipe: %m\n"); ++ return STATUS_TOO_MANY_OPENED_FILES; ++ } + wine_server_send_fd( request_pipe[0] ); + + SERVER_START_REQ( new_thread ) +@@ -516,12 +779,16 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR * + if (status) + { + close( request_pipe[1] ); ++ TRACE("CreateThread server request failed with %08x\n", status); + return status; + } + + pthread_sigmask( SIG_BLOCK, &server_block_set, &sigset ); + +- if ((status = signal_alloc_thread( &teb ))) goto error; ++ if ((status = signal_alloc_thread( &teb ))) { ++ TRACE("CreateThread signal thread allocation failed with %08x\n", status); ++ goto error; ++ } + + teb->Peb = NtCurrentTeb()->Peb; + teb->ClientId.UniqueProcess = ULongToHandle(GetCurrentProcessId()); +@@ -544,32 +811,64 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR * + + info = (struct startup_info *)(teb + 1); + info->teb = teb; +- info->entry_point = start; +- info->entry_arg = param; ++#ifdef __linux__ ++ info->native_thread = (void*)start == (void*)&native_unix_start; ++ if (info->native_thread) { ++ struct unix_arg *arg = param; ++ info->entry_point = (void*)arg->start; ++ info->entry_arg = arg->arg; ++ } else ++#endif ++ { ++ info->entry_point = start; ++ info->entry_arg = param; ++ } + + thread_data = (struct ntdll_thread_data *)teb->SpareBytes1; ++#ifdef __linux__ ++ thread_data->detached = !info->native_thread; ++#endif + thread_data->request_fd = request_pipe[1]; + thread_data->reply_fd = -1; + thread_data->wait_fd[0] = -1; + thread_data->wait_fd[1] = -1; ++ thread_data->entry.next = NULL; + +- if ((status = virtual_alloc_thread_stack( teb, stack_reserve, stack_commit ))) goto error; ++ if ((status = virtual_alloc_thread_stack( teb, stack_reserve, stack_commit ))) { ++ TRACE("Allocating virtual stack for %p (%li/%li) failed with %08x\n", start, stack_reserve, stack_commit, status); ++ goto error; ++ } + + pthread_attr_init( &attr ); + pthread_attr_setstack( &attr, teb->DeallocationStack, + (char *)teb->Tib.StackBase - (char *)teb->DeallocationStack ); + pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM ); /* force creating a kernel thread */ + interlocked_xchg_add( &nb_threads, 1 ); +- if (pthread_create( &pthread_id, &attr, (void * (*)(void *))start_thread, info )) ++ ++ take_thread_lock(); ++ ret = __glob_pthread_create( &thread_data->pthread_id, &attr, (void * (*)(void *))start_thread, info ); ++ if (ret) + { ++ TRACE("pthread create failed with %i/%m\n", ret); + interlocked_xchg_add( &nb_threads, -1 ); + pthread_attr_destroy( &attr ); + status = STATUS_NO_MEMORY; + goto error; + } ++ if (!thread_data->detached) ++ list_add_tail(&active_list, &thread_data->entry); ++ detach_thread_unlock(NULL); ++ + pthread_attr_destroy( &attr ); + pthread_sigmask( SIG_SETMASK, &sigset, NULL ); + ++ TRACE("Created thread succesfully, win handle: %04x, pthread: %lx\n", tid, thread_data->pthread_id); ++ ++#ifdef __linux__ ++ if ((void*)start == (void*)&native_unix_start && id) ++ *(pthread_t*)id = thread_data->pthread_id; ++ else ++#endif + if (id) id->UniqueThread = ULongToHandle(tid); + if (handle_ptr) *handle_ptr = handle; + else NtClose( handle ); +diff --git a/dlls/winegstreamer/glibthread.c b/dlls/winegstreamer/glibthread.c +index 0d829a0..46e22f4 100644 +--- a/dlls/winegstreamer/glibthread.c ++++ b/dlls/winegstreamer/glibthread.c +@@ -43,6 +43,7 @@ + #include + #include + ++#if 0 + #include "windef.h" + #include "winbase.h" + #include "winnls.h" +@@ -388,3 +389,15 @@ void g_thread_impl_init (void) + g_thread_self_tls = TlsAlloc (); + g_thread_init(&g_thread_functions_for_glib_use_default); + } ++ ++#else ++ ++void g_thread_impl_init (void) ++{ ++ static gboolean beenhere = FALSE; ++ ++ if (!beenhere++) ++ g_thread_init(NULL); ++} ++ ++#endif +diff --git a/libs/wine/loader.c b/libs/wine/loader.c +index 1644955..82fbd74 100644 +--- a/libs/wine/loader.c ++++ b/libs/wine/loader.c +@@ -73,6 +73,13 @@ char **__wine_main_argv = NULL; + WCHAR **__wine_main_wargv = NULL; + char **__wine_main_environ = NULL; + ++#ifdef __linux__ ++#include ++typeof(pthread_create) *call_pthread_create, *__glob_pthread_create; ++typeof(pthread_join) *call_pthread_join, *__glob_pthread_join; ++typeof(pthread_detach) *call_pthread_detach, *__glob_pthread_detach; ++#endif ++ + struct dll_path_context + { + unsigned int index; /* current index in the dll path list */ +diff --git a/libs/wine/wine.map b/libs/wine/wine.map +index 2159fac..fb3b951 100644 +--- a/libs/wine/wine.map ++++ b/libs/wine/wine.map +@@ -117,6 +117,12 @@ WINE_1.0 + wine_utf8_mbstowcs; + wine_utf8_wcstombs; + wine_wctype_table; ++ __glob_pthread_create; ++ call_pthread_create; ++ __glob_pthread_join; ++ call_pthread_join; ++ __glob_pthread_detach; ++ call_pthread_detach; + + local: *; + }; +diff --git a/loader/Makefile.in b/loader/Makefile.in +index 8190037..f470c32 100644 +--- a/loader/Makefile.in ++++ b/loader/Makefile.in +@@ -19,11 +19,11 @@ preloader_EXTRADEFS = $(MSVCRTFLAGS) + + wine_OBJS = main.o + wine_DEPS = $(WINELOADER_DEPENDS) +-wine_LDFLAGS = $(LDEXECFLAGS) -lwine $(PTHREAD_LIBS) ++wine_LDFLAGS = $(LDEXECFLAGS) -lwine $(PTHREAD_LIBS) $(DL_LIBS) + + wine64_OBJS = main.o + wine64_DEPS = $(WINELOADER_DEPENDS) +-wine64_LDFLAGS = $(LDEXECFLAGS) -lwine $(PTHREAD_LIBS) ++wine64_LDFLAGS = $(LDEXECFLAGS) -lwine $(PTHREAD_LIBS) $(DL_LIBS) + + wine_preloader_OBJS = preloader.o + wine_preloader_LDFLAGS = -static -nostartfiles -nodefaultlibs -Wl,-Ttext=0x7c400000 +diff --git a/loader/main.c b/loader/main.c +index bb752b5..bb50006 100644 +--- a/loader/main.c ++++ b/loader/main.c +@@ -212,6 +212,45 @@ static int pre_exec(void) + + #endif + ++#ifdef __linux__ ++ ++extern typeof(pthread_create) *call_pthread_create, *__glob_pthread_create; ++extern typeof(pthread_detach) *call_pthread_detach, *__glob_pthread_detach; ++extern typeof(pthread_join) *call_pthread_join, *__glob_pthread_join; ++ ++int pthread_create(pthread_t *thread, const pthread_attr_t *attr, ++ void *(*start_routine) (void *), void *arg) ++{ ++ return call_pthread_create(thread, attr, start_routine, arg); ++} ++ ++int pthread_detach(pthread_t thread) ++{ ++ return call_pthread_detach(thread); ++} ++ ++int pthread_join(pthread_t thread, void **retval) ++{ ++ return call_pthread_join(thread, retval); ++} ++ ++static void init_thread_hook(void) { ++ call_pthread_create = __glob_pthread_create = dlvsym(RTLD_NEXT, "pthread_create", "GLIBC_2.2.5"); ++ if (!__glob_pthread_create) ++ call_pthread_create = __glob_pthread_create = dlvsym(RTLD_NEXT, "pthread_create", "GLIBC_2.1"); ++ ++ call_pthread_detach = __glob_pthread_detach = dlsym(RTLD_NEXT, "pthread_detach"); ++ call_pthread_join = __glob_pthread_join = dlsym(RTLD_NEXT, "pthread_join"); ++ ++ /* Call a function from libpthread to ensure being linked against it */ ++ pthread_yield(); ++} ++ ++#else ++ ++#define init_thread_hook() ++ ++#endif + + /********************************************************************** + * main +@@ -221,6 +260,8 @@ int main( int argc, char *argv[] ) + char error[1024]; + int i; + ++ init_thread_hook(); ++ + if (!getenv( "WINELOADERNOEXEC" )) /* first time around */ + { + static char noexec[] = "WINELOADERNOEXEC=1"; +-- +2.5.0 + diff -Nru wine1.7-1.7.50/debian/patches/0014-winepulse-Add-session-support.patch wine1.7-1.7.55/debian/patches/0014-winepulse-Add-session-support.patch --- wine1.7-1.7.50/debian/patches/0014-winepulse-Add-session-support.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0014-winepulse-Add-session-support.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,936 +0,0 @@ -From 1a0d34e92930c7e97c32100b081da3a7ab290ac7 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:30 +0100 -Subject: [PATCH 14/50] winepulse: Add session support - ---- -Copied verbatim from winealsa ---- - dlls/winepulse.drv/mmdevdrv.c | 849 +++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 848 insertions(+), 1 deletion(-) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index b7414c2..64ee62e 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -69,6 +69,7 @@ static pa_mainloop *pulse_ml; - static HANDLE pulse_thread; - static pthread_mutex_t pulse_lock = PTHREAD_MUTEX_INITIALIZER; - static pthread_cond_t pulse_cond = PTHREAD_COND_INITIALIZER; -+static struct list g_sessions = LIST_INIT(g_sessions); - - /* Mixer format + period times */ - static WAVEFORMATEXTENSIBLE pulse_fmt[2]; -@@ -105,6 +106,31 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved) - - typedef struct ACImpl ACImpl; - -+typedef struct _AudioSession { -+ GUID guid; -+ struct list clients; -+ -+ IMMDevice *device; -+ -+ float master_vol; -+ UINT32 channel_count; -+ float *channel_vols; -+ BOOL mute; -+ -+ struct list entry; -+} AudioSession; -+ -+typedef struct _AudioSessionWrapper { -+ IAudioSessionControl2 IAudioSessionControl2_iface; -+ IChannelAudioVolume IChannelAudioVolume_iface; -+ ISimpleAudioVolume ISimpleAudioVolume_iface; -+ -+ LONG ref; -+ -+ ACImpl *client; -+ AudioSession *session; -+} AudioSessionWrapper; -+ - typedef struct _ACPacket { - struct list entry; - UINT64 qpcpos; -@@ -139,6 +165,8 @@ struct ACImpl { - INT64 clock_lastpos, clock_written; - pa_usec_t clock_pulse; - -+ AudioSession *session; -+ AudioSessionWrapper *session_wrapper; - struct list packet_free_head; - struct list packet_filled_head; - }; -@@ -148,10 +176,15 @@ static const WCHAR defaultW[] = {'P','u','l','s','e','a','u','d','i','o',0}; - static const IAudioClientVtbl AudioClient_Vtbl; - static const IAudioRenderClientVtbl AudioRenderClient_Vtbl; - static const IAudioCaptureClientVtbl AudioCaptureClient_Vtbl; -+static const IAudioSessionControl2Vtbl AudioSessionControl2_Vtbl; -+static const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl; -+static const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl; - static const IAudioClockVtbl AudioClock_Vtbl; - static const IAudioClock2Vtbl AudioClock2_Vtbl; - static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl; - -+static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client); -+ - static inline ACImpl *impl_from_IAudioClient(IAudioClient *iface) - { - return CONTAINING_RECORD(iface, ACImpl, IAudioClient_iface); -@@ -167,6 +200,21 @@ static inline ACImpl *impl_from_IAudioCaptureClient(IAudioCaptureClient *iface) - return CONTAINING_RECORD(iface, ACImpl, IAudioCaptureClient_iface); - } - -+static inline AudioSessionWrapper *impl_from_IAudioSessionControl2(IAudioSessionControl2 *iface) -+{ -+ return CONTAINING_RECORD(iface, AudioSessionWrapper, IAudioSessionControl2_iface); -+} -+ -+static inline AudioSessionWrapper *impl_from_ISimpleAudioVolume(ISimpleAudioVolume *iface) -+{ -+ return CONTAINING_RECORD(iface, AudioSessionWrapper, ISimpleAudioVolume_iface); -+} -+ -+static inline AudioSessionWrapper *impl_from_IChannelAudioVolume(IChannelAudioVolume *iface) -+{ -+ return CONTAINING_RECORD(iface, AudioSessionWrapper, IChannelAudioVolume_iface); -+} -+ - static inline ACImpl *impl_from_IAudioClock(IAudioClock *iface) - { - return CONTAINING_RECORD(iface, ACImpl, IAudioClock_iface); -@@ -897,6 +945,85 @@ static DWORD get_channel_mask(unsigned int channels) - return 0; - } - -+static void session_init_vols(AudioSession *session, UINT channels) -+{ -+ if (session->channel_count < channels) { -+ UINT i; -+ -+ if (session->channel_vols) -+ session->channel_vols = HeapReAlloc(GetProcessHeap(), 0, -+ session->channel_vols, sizeof(float) * channels); -+ else -+ session->channel_vols = HeapAlloc(GetProcessHeap(), 0, -+ sizeof(float) * channels); -+ if (!session->channel_vols) -+ return; -+ -+ for(i = session->channel_count; i < channels; ++i) -+ session->channel_vols[i] = 1.f; -+ -+ session->channel_count = channels; -+ } -+} -+ -+static AudioSession *create_session(const GUID *guid, IMMDevice *device, -+ UINT num_channels) -+{ -+ AudioSession *ret; -+ -+ ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(AudioSession)); -+ if (!ret) -+ return NULL; -+ -+ memcpy(&ret->guid, guid, sizeof(GUID)); -+ -+ ret->device = device; -+ -+ list_init(&ret->clients); -+ -+ list_add_head(&g_sessions, &ret->entry); -+ -+ session_init_vols(ret, num_channels); -+ -+ ret->master_vol = 1.f; -+ -+ return ret; -+} -+ -+/* if channels == 0, then this will return or create a session with -+ * matching dataflow and GUID. otherwise, channels must also match */ -+static HRESULT get_audio_session(const GUID *sessionguid, -+ IMMDevice *device, UINT channels, AudioSession **out) -+{ -+ AudioSession *session; -+ -+ if (!sessionguid || IsEqualGUID(sessionguid, &GUID_NULL)) { -+ *out = create_session(&GUID_NULL, device, channels); -+ if (!*out) -+ return E_OUTOFMEMORY; -+ -+ return S_OK; -+ } -+ -+ *out = NULL; -+ LIST_FOR_EACH_ENTRY(session, &g_sessions, AudioSession, entry) { -+ if (session->device == device && -+ IsEqualGUID(sessionguid, &session->guid)) { -+ session_init_vols(session, channels); -+ *out = session; -+ break; -+ } -+ } -+ -+ if (!*out) { -+ *out = create_session(sessionguid, device, channels); -+ if (!*out) -+ return E_OUTOFMEMORY; -+ } -+ -+ return S_OK; -+} -+ - static HRESULT pulse_spec_from_waveformat(ACImpl *This, const WAVEFORMATEX *fmt) - { - pa_channel_map_init(&This->map); -@@ -1083,6 +1210,10 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface, - assert(!capture_packets || data - This->bufsize_bytes == This->tmp_buffer); - } - } -+ if (SUCCEEDED(hr)) -+ hr = get_audio_session(sessionguid, This->parent, fmt->nChannels, &This->session); -+ if (SUCCEEDED(hr)) -+ list_add_tail(&This->session->clients, &This->entry); - - exit: - if (FAILED(hr)) { -@@ -1474,6 +1605,20 @@ static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid, - *ppv = &This->IAudioClock_iface; - } else if (IsEqualIID(riid, &IID_IAudioStreamVolume)) { - *ppv = &This->IAudioStreamVolume_iface; -+ } else if (IsEqualIID(riid, &IID_IAudioSessionControl) || -+ IsEqualIID(riid, &IID_IChannelAudioVolume) || -+ IsEqualIID(riid, &IID_ISimpleAudioVolume)) { -+ if (!This->session_wrapper) { -+ This->session_wrapper = AudioSessionWrapper_Create(This); -+ if (!This->session_wrapper) -+ return E_OUTOFMEMORY; -+ } -+ if (IsEqualIID(riid, &IID_IAudioSessionControl)) -+ *ppv = &This->session_wrapper->IAudioSessionControl2_iface; -+ else if (IsEqualIID(riid, &IID_IChannelAudioVolume)) -+ *ppv = &This->session_wrapper->IChannelAudioVolume_iface; -+ else if (IsEqualIID(riid, &IID_ISimpleAudioVolume)) -+ *ppv = &This->session_wrapper->ISimpleAudioVolume_iface; - } - - if (*ppv) { -@@ -2158,9 +2303,711 @@ static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl = - AudioStreamVolume_GetAllVolumes - }; - -+static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client) -+{ -+ AudioSessionWrapper *ret; -+ -+ ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, -+ sizeof(AudioSessionWrapper)); -+ if (!ret) -+ return NULL; -+ -+ ret->IAudioSessionControl2_iface.lpVtbl = &AudioSessionControl2_Vtbl; -+ ret->ISimpleAudioVolume_iface.lpVtbl = &SimpleAudioVolume_Vtbl; -+ ret->IChannelAudioVolume_iface.lpVtbl = &ChannelAudioVolume_Vtbl; -+ -+ ret->ref = !client; -+ -+ ret->client = client; -+ if (client) { -+ ret->session = client->session; -+ AudioClient_AddRef(&client->IAudioClient_iface); -+ } -+ -+ return ret; -+} -+ -+static HRESULT WINAPI AudioSessionControl_QueryInterface( -+ IAudioSessionControl2 *iface, REFIID riid, void **ppv) -+{ -+ TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); -+ -+ if (!ppv) -+ return E_POINTER; -+ *ppv = NULL; -+ -+ if (IsEqualIID(riid, &IID_IUnknown) || -+ IsEqualIID(riid, &IID_IAudioSessionControl) || -+ IsEqualIID(riid, &IID_IAudioSessionControl2)) -+ *ppv = iface; -+ if (*ppv) { -+ IUnknown_AddRef((IUnknown*)*ppv); -+ return S_OK; -+ } -+ -+ WARN("Unknown interface %s\n", debugstr_guid(riid)); -+ return E_NOINTERFACE; -+} -+ -+static ULONG WINAPI AudioSessionControl_AddRef(IAudioSessionControl2 *iface) -+{ -+ AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); -+ ULONG ref; -+ ref = InterlockedIncrement(&This->ref); -+ TRACE("(%p) Refcount now %u\n", This, ref); -+ return ref; -+} -+ -+static ULONG WINAPI AudioSessionControl_Release(IAudioSessionControl2 *iface) -+{ -+ AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); -+ ULONG ref; -+ ref = InterlockedDecrement(&This->ref); -+ TRACE("(%p) Refcount now %u\n", This, ref); -+ if (!ref) { -+ if (This->client) { -+ This->client->session_wrapper = NULL; -+ AudioClient_Release(&This->client->IAudioClient_iface); -+ } -+ HeapFree(GetProcessHeap(), 0, This); -+ } -+ return ref; -+} -+ -+static HRESULT WINAPI AudioSessionControl_GetState(IAudioSessionControl2 *iface, -+ AudioSessionState *state) -+{ -+ AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); -+ ACImpl *client; -+ -+ TRACE("(%p)->(%p)\n", This, state); -+ -+ if (!state) -+ return NULL_PTR_ERR; -+ -+ pthread_mutex_lock(&pulse_lock); -+ if (list_empty(&This->session->clients)) { -+ *state = AudioSessionStateExpired; -+ goto out; -+ } -+ LIST_FOR_EACH_ENTRY(client, &This->session->clients, ACImpl, entry) { -+ if (client->started) { -+ *state = AudioSessionStateActive; -+ goto out; -+ } -+ } -+ *state = AudioSessionStateInactive; -+ -+out: -+ pthread_mutex_unlock(&pulse_lock); -+ return S_OK; -+} -+ -+static HRESULT WINAPI AudioSessionControl_GetDisplayName( -+ IAudioSessionControl2 *iface, WCHAR **name) -+{ -+ AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); -+ -+ FIXME("(%p)->(%p) - stub\n", This, name); -+ -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI AudioSessionControl_SetDisplayName( -+ IAudioSessionControl2 *iface, const WCHAR *name, const GUID *session) -+{ -+ AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); -+ -+ FIXME("(%p)->(%p, %s) - stub\n", This, name, debugstr_guid(session)); -+ -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI AudioSessionControl_GetIconPath( -+ IAudioSessionControl2 *iface, WCHAR **path) -+{ -+ AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); -+ -+ FIXME("(%p)->(%p) - stub\n", This, path); -+ -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI AudioSessionControl_SetIconPath( -+ IAudioSessionControl2 *iface, const WCHAR *path, const GUID *session) -+{ -+ AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); -+ -+ FIXME("(%p)->(%p, %s) - stub\n", This, path, debugstr_guid(session)); -+ -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI AudioSessionControl_GetGroupingParam( -+ IAudioSessionControl2 *iface, GUID *group) -+{ -+ AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); -+ -+ FIXME("(%p)->(%p) - stub\n", This, group); -+ -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI AudioSessionControl_SetGroupingParam( -+ IAudioSessionControl2 *iface, const GUID *group, const GUID *session) -+{ -+ AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); -+ -+ FIXME("(%p)->(%s, %s) - stub\n", This, debugstr_guid(group), -+ debugstr_guid(session)); -+ -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI AudioSessionControl_RegisterAudioSessionNotification( -+ IAudioSessionControl2 *iface, IAudioSessionEvents *events) -+{ -+ AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); -+ -+ FIXME("(%p)->(%p) - stub\n", This, events); -+ -+ return S_OK; -+} -+ -+static HRESULT WINAPI AudioSessionControl_UnregisterAudioSessionNotification( -+ IAudioSessionControl2 *iface, IAudioSessionEvents *events) -+{ -+ AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); -+ -+ FIXME("(%p)->(%p) - stub\n", This, events); -+ -+ return S_OK; -+} -+ -+static HRESULT WINAPI AudioSessionControl_GetSessionIdentifier( -+ IAudioSessionControl2 *iface, WCHAR **id) -+{ -+ AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); -+ -+ FIXME("(%p)->(%p) - stub\n", This, id); -+ -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI AudioSessionControl_GetSessionInstanceIdentifier( -+ IAudioSessionControl2 *iface, WCHAR **id) -+{ -+ AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); -+ -+ FIXME("(%p)->(%p) - stub\n", This, id); -+ -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI AudioSessionControl_GetProcessId( -+ IAudioSessionControl2 *iface, DWORD *pid) -+{ -+ AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); -+ -+ TRACE("(%p)->(%p)\n", This, pid); -+ -+ if (!pid) -+ return E_POINTER; -+ -+ *pid = GetCurrentProcessId(); -+ -+ return S_OK; -+} -+ -+static HRESULT WINAPI AudioSessionControl_IsSystemSoundsSession( -+ IAudioSessionControl2 *iface) -+{ -+ AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); -+ -+ TRACE("(%p)\n", This); -+ -+ return S_FALSE; -+} -+ -+static HRESULT WINAPI AudioSessionControl_SetDuckingPreference( -+ IAudioSessionControl2 *iface, BOOL optout) -+{ -+ AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); -+ -+ TRACE("(%p)->(%d)\n", This, optout); -+ -+ return S_OK; -+} -+ -+static const IAudioSessionControl2Vtbl AudioSessionControl2_Vtbl = -+{ -+ AudioSessionControl_QueryInterface, -+ AudioSessionControl_AddRef, -+ AudioSessionControl_Release, -+ AudioSessionControl_GetState, -+ AudioSessionControl_GetDisplayName, -+ AudioSessionControl_SetDisplayName, -+ AudioSessionControl_GetIconPath, -+ AudioSessionControl_SetIconPath, -+ AudioSessionControl_GetGroupingParam, -+ AudioSessionControl_SetGroupingParam, -+ AudioSessionControl_RegisterAudioSessionNotification, -+ AudioSessionControl_UnregisterAudioSessionNotification, -+ AudioSessionControl_GetSessionIdentifier, -+ AudioSessionControl_GetSessionInstanceIdentifier, -+ AudioSessionControl_GetProcessId, -+ AudioSessionControl_IsSystemSoundsSession, -+ AudioSessionControl_SetDuckingPreference -+}; -+ -+typedef struct _SessionMgr { -+ IAudioSessionManager2 IAudioSessionManager2_iface; -+ -+ LONG ref; -+ -+ IMMDevice *device; -+} SessionMgr; -+ -+static HRESULT WINAPI AudioSessionManager_QueryInterface(IAudioSessionManager2 *iface, -+ REFIID riid, void **ppv) -+{ -+ TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); -+ -+ if (!ppv) -+ return E_POINTER; -+ *ppv = NULL; -+ -+ if (IsEqualIID(riid, &IID_IUnknown) || -+ IsEqualIID(riid, &IID_IAudioSessionManager) || -+ IsEqualIID(riid, &IID_IAudioSessionManager2)) -+ *ppv = iface; -+ if (*ppv) { -+ IUnknown_AddRef((IUnknown*)*ppv); -+ return S_OK; -+ } -+ -+ WARN("Unknown interface %s\n", debugstr_guid(riid)); -+ return E_NOINTERFACE; -+} -+ -+static inline SessionMgr *impl_from_IAudioSessionManager2(IAudioSessionManager2 *iface) -+{ -+ return CONTAINING_RECORD(iface, SessionMgr, IAudioSessionManager2_iface); -+} -+ -+static ULONG WINAPI AudioSessionManager_AddRef(IAudioSessionManager2 *iface) -+{ -+ SessionMgr *This = impl_from_IAudioSessionManager2(iface); -+ ULONG ref; -+ ref = InterlockedIncrement(&This->ref); -+ TRACE("(%p) Refcount now %u\n", This, ref); -+ return ref; -+} -+ -+static ULONG WINAPI AudioSessionManager_Release(IAudioSessionManager2 *iface) -+{ -+ SessionMgr *This = impl_from_IAudioSessionManager2(iface); -+ ULONG ref; -+ ref = InterlockedDecrement(&This->ref); -+ TRACE("(%p) Refcount now %u\n", This, ref); -+ if (!ref) -+ HeapFree(GetProcessHeap(), 0, This); -+ return ref; -+} -+ -+static HRESULT WINAPI AudioSessionManager_GetAudioSessionControl( -+ IAudioSessionManager2 *iface, const GUID *session_guid, DWORD flags, -+ IAudioSessionControl **out) -+{ -+ SessionMgr *This = impl_from_IAudioSessionManager2(iface); -+ AudioSession *session; -+ AudioSessionWrapper *wrapper; -+ HRESULT hr; -+ -+ TRACE("(%p)->(%s, %x, %p)\n", This, debugstr_guid(session_guid), -+ flags, out); -+ -+ hr = get_audio_session(session_guid, This->device, 0, &session); -+ if (FAILED(hr)) -+ return hr; -+ -+ wrapper = AudioSessionWrapper_Create(NULL); -+ if (!wrapper) -+ return E_OUTOFMEMORY; -+ -+ wrapper->session = session; -+ -+ *out = (IAudioSessionControl*)&wrapper->IAudioSessionControl2_iface; -+ -+ return S_OK; -+} -+ -+static HRESULT WINAPI AudioSessionManager_GetSimpleAudioVolume( -+ IAudioSessionManager2 *iface, const GUID *session_guid, DWORD flags, -+ ISimpleAudioVolume **out) -+{ -+ SessionMgr *This = impl_from_IAudioSessionManager2(iface); -+ AudioSession *session; -+ AudioSessionWrapper *wrapper; -+ HRESULT hr; -+ -+ TRACE("(%p)->(%s, %x, %p)\n", This, debugstr_guid(session_guid), -+ flags, out); -+ -+ hr = get_audio_session(session_guid, This->device, 0, &session); -+ if (FAILED(hr)) -+ return hr; -+ -+ wrapper = AudioSessionWrapper_Create(NULL); -+ if (!wrapper) -+ return E_OUTOFMEMORY; -+ -+ wrapper->session = session; -+ -+ *out = &wrapper->ISimpleAudioVolume_iface; -+ -+ return S_OK; -+} -+ -+static HRESULT WINAPI AudioSessionManager_GetSessionEnumerator( -+ IAudioSessionManager2 *iface, IAudioSessionEnumerator **out) -+{ -+ SessionMgr *This = impl_from_IAudioSessionManager2(iface); -+ FIXME("(%p)->(%p) - stub\n", This, out); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI AudioSessionManager_RegisterSessionNotification( -+ IAudioSessionManager2 *iface, IAudioSessionNotification *notification) -+{ -+ SessionMgr *This = impl_from_IAudioSessionManager2(iface); -+ FIXME("(%p)->(%p) - stub\n", This, notification); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI AudioSessionManager_UnregisterSessionNotification( -+ IAudioSessionManager2 *iface, IAudioSessionNotification *notification) -+{ -+ SessionMgr *This = impl_from_IAudioSessionManager2(iface); -+ FIXME("(%p)->(%p) - stub\n", This, notification); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI AudioSessionManager_RegisterDuckNotification( -+ IAudioSessionManager2 *iface, const WCHAR *session_id, -+ IAudioVolumeDuckNotification *notification) -+{ -+ SessionMgr *This = impl_from_IAudioSessionManager2(iface); -+ FIXME("(%p)->(%p) - stub\n", This, notification); -+ return E_NOTIMPL; -+} -+ -+static HRESULT WINAPI AudioSessionManager_UnregisterDuckNotification( -+ IAudioSessionManager2 *iface, -+ IAudioVolumeDuckNotification *notification) -+{ -+ SessionMgr *This = impl_from_IAudioSessionManager2(iface); -+ FIXME("(%p)->(%p) - stub\n", This, notification); -+ return E_NOTIMPL; -+} -+ -+static const IAudioSessionManager2Vtbl AudioSessionManager2_Vtbl = -+{ -+ AudioSessionManager_QueryInterface, -+ AudioSessionManager_AddRef, -+ AudioSessionManager_Release, -+ AudioSessionManager_GetAudioSessionControl, -+ AudioSessionManager_GetSimpleAudioVolume, -+ AudioSessionManager_GetSessionEnumerator, -+ AudioSessionManager_RegisterSessionNotification, -+ AudioSessionManager_UnregisterSessionNotification, -+ AudioSessionManager_RegisterDuckNotification, -+ AudioSessionManager_UnregisterDuckNotification -+}; -+ -+static HRESULT WINAPI SimpleAudioVolume_QueryInterface( -+ ISimpleAudioVolume *iface, REFIID riid, void **ppv) -+{ -+ TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); -+ -+ if (!ppv) -+ return E_POINTER; -+ *ppv = NULL; -+ -+ if (IsEqualIID(riid, &IID_IUnknown) || -+ IsEqualIID(riid, &IID_ISimpleAudioVolume)) -+ *ppv = iface; -+ if (*ppv) { -+ IUnknown_AddRef((IUnknown*)*ppv); -+ return S_OK; -+ } -+ -+ WARN("Unknown interface %s\n", debugstr_guid(riid)); -+ return E_NOINTERFACE; -+} -+ -+static ULONG WINAPI SimpleAudioVolume_AddRef(ISimpleAudioVolume *iface) -+{ -+ AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); -+ return AudioSessionControl_AddRef(&This->IAudioSessionControl2_iface); -+} -+ -+static ULONG WINAPI SimpleAudioVolume_Release(ISimpleAudioVolume *iface) -+{ -+ AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); -+ return AudioSessionControl_Release(&This->IAudioSessionControl2_iface); -+} -+ -+static HRESULT WINAPI SimpleAudioVolume_SetMasterVolume( -+ ISimpleAudioVolume *iface, float level, const GUID *context) -+{ -+ AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); -+ AudioSession *session = This->session; -+ -+ TRACE("(%p)->(%f, %s)\n", session, level, wine_dbgstr_guid(context)); -+ -+ if (level < 0.f || level > 1.f) -+ return E_INVALIDARG; -+ -+ if (context) -+ FIXME("Notifications not supported yet\n"); -+ -+ TRACE("Pulseaudio does not support session volume control\n"); -+ -+ pthread_mutex_lock(&pulse_lock); -+ session->master_vol = level; -+ pthread_mutex_unlock(&pulse_lock); -+ -+ return S_OK; -+} -+ -+static HRESULT WINAPI SimpleAudioVolume_GetMasterVolume( -+ ISimpleAudioVolume *iface, float *level) -+{ -+ AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); -+ AudioSession *session = This->session; -+ -+ TRACE("(%p)->(%p)\n", session, level); -+ -+ if (!level) -+ return NULL_PTR_ERR; -+ -+ *level = session->master_vol; -+ -+ return S_OK; -+} -+ -+static HRESULT WINAPI SimpleAudioVolume_SetMute(ISimpleAudioVolume *iface, -+ BOOL mute, const GUID *context) -+{ -+ AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); -+ AudioSession *session = This->session; -+ -+ TRACE("(%p)->(%u, %p)\n", session, mute, context); -+ -+ if (context) -+ FIXME("Notifications not supported yet\n"); -+ -+ session->mute = mute; -+ -+ return S_OK; -+} -+ -+static HRESULT WINAPI SimpleAudioVolume_GetMute(ISimpleAudioVolume *iface, -+ BOOL *mute) -+{ -+ AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); -+ AudioSession *session = This->session; -+ -+ TRACE("(%p)->(%p)\n", session, mute); -+ -+ if (!mute) -+ return NULL_PTR_ERR; -+ -+ *mute = session->mute; -+ -+ return S_OK; -+} -+ -+static const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl = -+{ -+ SimpleAudioVolume_QueryInterface, -+ SimpleAudioVolume_AddRef, -+ SimpleAudioVolume_Release, -+ SimpleAudioVolume_SetMasterVolume, -+ SimpleAudioVolume_GetMasterVolume, -+ SimpleAudioVolume_SetMute, -+ SimpleAudioVolume_GetMute -+}; -+ -+static HRESULT WINAPI ChannelAudioVolume_QueryInterface( -+ IChannelAudioVolume *iface, REFIID riid, void **ppv) -+{ -+ TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); -+ -+ if (!ppv) -+ return E_POINTER; -+ *ppv = NULL; -+ -+ if (IsEqualIID(riid, &IID_IUnknown) || -+ IsEqualIID(riid, &IID_IChannelAudioVolume)) -+ *ppv = iface; -+ if (*ppv) { -+ IUnknown_AddRef((IUnknown*)*ppv); -+ return S_OK; -+ } -+ -+ WARN("Unknown interface %s\n", debugstr_guid(riid)); -+ return E_NOINTERFACE; -+} -+ -+static ULONG WINAPI ChannelAudioVolume_AddRef(IChannelAudioVolume *iface) -+{ -+ AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); -+ return AudioSessionControl_AddRef(&This->IAudioSessionControl2_iface); -+} -+ -+static ULONG WINAPI ChannelAudioVolume_Release(IChannelAudioVolume *iface) -+{ -+ AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); -+ return AudioSessionControl_Release(&This->IAudioSessionControl2_iface); -+} -+ -+static HRESULT WINAPI ChannelAudioVolume_GetChannelCount( -+ IChannelAudioVolume *iface, UINT32 *out) -+{ -+ AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); -+ AudioSession *session = This->session; -+ -+ TRACE("(%p)->(%p)\n", session, out); -+ -+ if (!out) -+ return NULL_PTR_ERR; -+ -+ *out = session->channel_count; -+ -+ return S_OK; -+} -+ -+static HRESULT WINAPI ChannelAudioVolume_SetChannelVolume( -+ IChannelAudioVolume *iface, UINT32 index, float level, -+ const GUID *context) -+{ -+ AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); -+ AudioSession *session = This->session; -+ -+ TRACE("(%p)->(%d, %f, %s)\n", session, index, level, -+ wine_dbgstr_guid(context)); -+ -+ if (level < 0.f || level > 1.f) -+ return E_INVALIDARG; -+ -+ if (index >= session->channel_count) -+ return E_INVALIDARG; -+ -+ if (context) -+ FIXME("Notifications not supported yet\n"); -+ -+ TRACE("Pulseaudio does not support session volume control\n"); -+ -+ pthread_mutex_lock(&pulse_lock); -+ session->channel_vols[index] = level; -+ pthread_mutex_unlock(&pulse_lock); -+ -+ return S_OK; -+} -+ -+static HRESULT WINAPI ChannelAudioVolume_GetChannelVolume( -+ IChannelAudioVolume *iface, UINT32 index, float *level) -+{ -+ AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); -+ AudioSession *session = This->session; -+ -+ TRACE("(%p)->(%d, %p)\n", session, index, level); -+ -+ if (!level) -+ return NULL_PTR_ERR; -+ -+ if (index >= session->channel_count) -+ return E_INVALIDARG; -+ -+ *level = session->channel_vols[index]; -+ -+ return S_OK; -+} -+ -+static HRESULT WINAPI ChannelAudioVolume_SetAllVolumes( -+ IChannelAudioVolume *iface, UINT32 count, const float *levels, -+ const GUID *context) -+{ -+ AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); -+ AudioSession *session = This->session; -+ int i; -+ -+ TRACE("(%p)->(%d, %p, %s)\n", session, count, levels, -+ wine_dbgstr_guid(context)); -+ -+ if (!levels) -+ return NULL_PTR_ERR; -+ -+ if (count != session->channel_count) -+ return E_INVALIDARG; -+ -+ if (context) -+ FIXME("Notifications not supported yet\n"); -+ -+ TRACE("Pulseaudio does not support session volume control\n"); -+ -+ pthread_mutex_lock(&pulse_lock); -+ for(i = 0; i < count; ++i) -+ session->channel_vols[i] = levels[i]; -+ pthread_mutex_unlock(&pulse_lock); -+ return S_OK; -+} -+ -+static HRESULT WINAPI ChannelAudioVolume_GetAllVolumes( -+ IChannelAudioVolume *iface, UINT32 count, float *levels) -+{ -+ AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); -+ AudioSession *session = This->session; -+ int i; -+ -+ TRACE("(%p)->(%d, %p)\n", session, count, levels); -+ -+ if (!levels) -+ return NULL_PTR_ERR; -+ -+ if (count != session->channel_count) -+ return E_INVALIDARG; -+ -+ for(i = 0; i < count; ++i) -+ levels[i] = session->channel_vols[i]; -+ -+ return S_OK; -+} -+ -+static const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl = -+{ -+ ChannelAudioVolume_QueryInterface, -+ ChannelAudioVolume_AddRef, -+ ChannelAudioVolume_Release, -+ ChannelAudioVolume_GetChannelCount, -+ ChannelAudioVolume_SetChannelVolume, -+ ChannelAudioVolume_GetChannelVolume, -+ ChannelAudioVolume_SetAllVolumes, -+ ChannelAudioVolume_GetAllVolumes -+}; -+ - HRESULT WINAPI AUDDRV_GetAudioSessionManager(IMMDevice *device, - IAudioSessionManager2 **out) - { -+ SessionMgr *This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SessionMgr)); - *out = NULL; -- return E_NOTIMPL; -+ if (!This) -+ return E_OUTOFMEMORY; -+ This->IAudioSessionManager2_iface.lpVtbl = &AudioSessionManager2_Vtbl; -+ This->device = device; -+ This->ref = 1; -+ *out = &This->IAudioSessionManager2_iface; -+ return S_OK; - } --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0015-fix-fdels-trailing-whitespaces.patch wine1.7-1.7.55/debian/patches/0015-fix-fdels-trailing-whitespaces.patch --- wine1.7-1.7.50/debian/patches/0015-fix-fdels-trailing-whitespaces.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0015-fix-fdels-trailing-whitespaces.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -From a798f810425161e6c684cf37b8730a6fa5c6e46b Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:30 +0100 -Subject: [PATCH 15/50] fix fdels trailing whitespaces - -Happy? :P ---- - dlls/winepulse.drv/mmdevdrv.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index 64ee62e..5a71a3d 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -1898,7 +1898,7 @@ static HRESULT WINAPI AudioCaptureClient_GetNextPacketSize( - TRACE("(%p)->(%p)\n", This, frames); - if (!frames) - return E_POINTER; -- -+ - pthread_mutex_lock(&pulse_lock); - ACImpl_GetCapturePad(This, NULL); - p = This->locked_ptr; -@@ -1998,7 +1998,7 @@ static HRESULT WINAPI AudioClock_GetPosition(IAudioClock *iface, UINT64 *pos, - else - *pos += This->pad; - } -- -+ - /* Make time never go backwards */ - if (*pos < This->clock_lastpos) - *pos = This->clock_lastpos; --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0016-winepulse-v12.patch wine1.7-1.7.55/debian/patches/0016-winepulse-v12.patch --- wine1.7-1.7.50/debian/patches/0016-winepulse-v12.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0016-winepulse-v12.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -From 82b5ee1a0c20f1ce4b24c40760c1977c89eaddf3 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:30 +0100 -Subject: [PATCH 16/50] winepulse v12 - -Changes since v11: -- Fix incorrect assertions which may fail on moving a capture device -- Whitespace apply fixes - -Changes since v10: -- Make some members static -- Fix small memory leak in GetService ---- - dlls/winepulse.drv/mmdevdrv.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index 5a71a3d..960af3c 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -596,10 +596,11 @@ static void pulse_rd_loop(ACImpl *This, size_t bytes) - dst = p->data; - while (rem) { - pa_stream_peek(This->stream, (const void**)&src, &src_len); -- assert(src_len && src_len <= bytes); -+ assert(src_len); - assert(This->peek_ofs < src_len); - src += This->peek_ofs; - src_len -= This->peek_ofs; -+ assert(src_len <= bytes); - - copy = rem; - if (copy > src_len) -@@ -627,9 +628,10 @@ static void pulse_rd_drop(ACImpl *This, size_t bytes) - while (rem) { - const void *src; - pa_stream_peek(This->stream, &src, &src_len); -- assert(src_len && src_len <= bytes); -+ assert(src_len); - assert(This->peek_ofs < src_len); - src_len -= This->peek_ofs; -+ assert(src_len <= bytes); - - copy = rem; - if (copy > src_len) --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0017-winepulse-v15-Add-support-for-missing-formats-and-si.patch wine1.7-1.7.55/debian/patches/0017-winepulse-v15-Add-support-for-missing-formats-and-si.patch --- wine1.7-1.7.50/debian/patches/0017-winepulse-v15-Add-support-for-missing-formats-and-si.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0017-winepulse-v15-Add-support-for-missing-formats-and-si.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -From 6eca4b7088aef2955b4cf2cc41d0db01eedbeb62 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:30 +0100 -Subject: [PATCH 17/50] winepulse v15: Add support for missing formats, and - silence an error for missing format tags - ---- - dlls/winepulse.drv/mmdevdrv.c | 17 ++++++++++++++++- - 1 file changed, 16 insertions(+), 1 deletion(-) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index 960af3c..f52f119 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -1109,7 +1109,22 @@ static HRESULT pulse_spec_from_waveformat(ACImpl *This, const WAVEFORMATEX *fmt) - } - break; - } -- default: FIXME("Unhandled tag %x\n", fmt->wFormatTag); -+ case WAVE_FORMAT_ALAW: -+ case WAVE_FORMAT_MULAW: -+ if (fmt->wBitsPerSample != 8) { -+ FIXME("Unsupported bpp %u for LAW\n", fmt->wBitsPerSample); -+ return AUDCLNT_E_UNSUPPORTED_FORMAT; -+ } -+ if (fmt->nChannels != 1 && fmt->nChannels != 2) { -+ FIXME("Unsupported channels %u for LAW\n", fmt->nChannels); -+ return AUDCLNT_E_UNSUPPORTED_FORMAT; -+ } -+ This->ss.format = fmt->wFormatTag == WAVE_FORMAT_MULAW ? PA_SAMPLE_ULAW : PA_SAMPLE_ALAW; -+ pa_channel_map_init_auto(&This->map, fmt->nChannels, PA_CHANNEL_MAP_ALSA); -+ break; -+ default: -+ WARN("Unhandled tag %x\n", fmt->wFormatTag); -+ return AUDCLNT_E_UNSUPPORTED_FORMAT; - } - This->ss.channels = This->map.channels; - if (!pa_channel_map_valid(&This->map) || This->ss.format == PA_SAMPLE_INVALID) { --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0018-winepulse-v16-Add-official-warning-wine-doesn-t-want.patch wine1.7-1.7.55/debian/patches/0018-winepulse-v16-Add-official-warning-wine-doesn-t-want.patch --- wine1.7-1.7.50/debian/patches/0018-winepulse-v16-Add-official-warning-wine-doesn-t-want.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0018-winepulse-v16-Add-official-warning-wine-doesn-t-want.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,79 +0,0 @@ -From fd34b8e2a08843702b328299416965218d535dda Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:30 +0100 -Subject: [PATCH 18/50] winepulse v16: Add official warning wine doesn't want - to support winepulse - -And give an alternative place to ask for support. -I wish it didn't have to come to this. ---- - dlls/winepulse.drv/mmdevdrv.c | 25 +++++++++++++++++++++++-- - 1 file changed, 23 insertions(+), 2 deletions(-) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index f52f119..76a2e0e 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -59,6 +59,7 @@ - #define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER) - - WINE_DEFAULT_DEBUG_CHANNEL(pulse); -+WINE_DECLARE_DEBUG_CHANNEL(winediag); - - static const REFERENCE_TIME MinimumPeriod = 30000; - static const REFERENCE_TIME DefaultPeriod = 100000; -@@ -81,6 +82,8 @@ const WCHAR pulse_keyW[] = {'S','o','f','t','w','a','r','e','\\', - 'W','i','n','e','\\','P','u','l','s','e',0}; - const WCHAR pulse_streamW[] = { 'S','t','r','e','a','m','V','o','l',0 }; - -+static HANDLE warn_once; -+ - BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved) - { - if (reason == DLL_PROCESS_ATTACH) { -@@ -99,7 +102,10 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved) - } - if (pulse_ml) - pa_mainloop_quit(pulse_ml, 0); -- CloseHandle(pulse_thread); -+ if (pulse_thread) -+ CloseHandle(pulse_thread); -+ if (warn_once) -+ CloseHandle(warn_once); - } - return TRUE; - } -@@ -758,6 +764,10 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids, void ***keys, - int WINAPI AUDDRV_GetPriority(void) - { - HRESULT hr; -+ if (getenv("WINENOPULSE")) { -+ FIXME_(winediag)("winepulse has been temporarily disabled through the environment\n"); -+ return 0; -+ } - pthread_mutex_lock(&pulse_lock); - hr = pulse_connect(); - pthread_mutex_unlock(&pulse_lock); -@@ -771,7 +781,18 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(void *key, IMMDevice *dev, - ACImpl *This; - int i; - -- TRACE("%p %p %d %p\n", key, dev, dataflow, out); -+ /* Give one visible warning per session -+ * Sadly wine has chosen not to accept the winepulse patch, so support ourselves -+ */ -+ if (!warn_once && (warn_once = CreateEventA(0, 0, 0, "__winepulse_warn_event")) && GetLastError() != ERROR_ALREADY_EXISTS) { -+ FIXME_(winediag)("Winepulse is not officially supported by the wine project\n"); -+ FIXME_(winediag)("For sound related feedback and support, please visit http://ubuntuforums.org/showthread.php?t=1960599\n"); -+ } else { -+ WARN_(winediag)("Winepulse is not officially supported by the wine project\n"); -+ WARN_(winediag)("For sound related feedback and support, please visit http://ubuntuforums.org/showthread.php?t=1960599\n"); -+ } -+ -+ TRACE("%s %p %p\n", debugstr_guid(guid), dev, out); - if (dataflow != eRender && dataflow != eCapture) - return E_UNEXPECTED; - --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0019-winepulse-v17-Fix-winmm-tests.patch wine1.7-1.7.55/debian/patches/0019-winepulse-v17-Fix-winmm-tests.patch --- wine1.7-1.7.50/debian/patches/0019-winepulse-v17-Fix-winmm-tests.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0019-winepulse-v17-Fix-winmm-tests.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,125 +0,0 @@ -From 7a8dd4a444da0d372841a0d4316712940802c3bb Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:30 +0100 -Subject: [PATCH 19/50] winepulse v17: Fix winmm tests - -Handle dwChannelMask = SPEAKER_ALL better so WAVE_FORMAT_EXTENSIBLE tests pass too ---- - dlls/winepulse.drv/mmdevdrv.c | 72 +++++++++++++++++++++++++++++++++---------- - 1 file changed, 56 insertions(+), 16 deletions(-) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index 76a2e0e..6e75674 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -1066,6 +1066,8 @@ static HRESULT pulse_spec_from_waveformat(ACImpl *This, const WAVEFORMATEX *fmt) - This->ss.format = PA_SAMPLE_U8; - else if (fmt->wBitsPerSample == 16) - This->ss.format = PA_SAMPLE_S16LE; -+ else -+ return AUDCLNT_E_UNSUPPORTED_FORMAT; - pa_channel_map_init_auto(&This->map, fmt->nChannels, PA_CHANNEL_MAP_ALSA); - break; - case WAVE_FORMAT_EXTENSIBLE: { -@@ -1102,13 +1104,16 @@ static HRESULT pulse_spec_from_waveformat(ACImpl *This, const WAVEFORMATEX *fmt) - This->ss.format = PA_SAMPLE_S24_32LE; - else if (valid == 32) - This->ss.format = PA_SAMPLE_S32LE; -- default: - break; -+ default: -+ return AUDCLNT_E_UNSUPPORTED_FORMAT; - } - } - This->map.channels = fmt->nChannels; -- if (!mask) -+ if (!mask || mask == SPEAKER_ALL) - mask = get_channel_mask(fmt->nChannels); -+ else if (mask == ~0U && fmt->nChannels == 1) -+ mask = SPEAKER_FRONT_CENTER; - for (j = 0; j < sizeof(pulse_pos_from_wfx)/sizeof(*pulse_pos_from_wfx) && i < fmt->nChannels; ++j) { - if (mask & (1 << j)) - This->map.map[i++] = pulse_pos_from_wfx[j]; -@@ -1118,14 +1123,9 @@ static HRESULT pulse_spec_from_waveformat(ACImpl *This, const WAVEFORMATEX *fmt) - if (mask == SPEAKER_FRONT_CENTER) - This->map.map[0] = PA_CHANNEL_POSITION_MONO; - -- if ((mask & SPEAKER_ALL) && i < fmt->nChannels) { -- This->map.map[i++] = PA_CHANNEL_POSITION_MONO; -- FIXME("Is the 'all' channel mapped correctly?\n"); -- } -- - if (i < fmt->nChannels || (mask & SPEAKER_RESERVED)) { - This->map.channels = 0; -- ERR("Invalid channel mask: %i/%i and %x\n", i, fmt->nChannels, mask); -+ ERR("Invalid channel mask: %i/%i and %x(%x)\n", i, fmt->nChannels, mask, wfe->dwChannelMask); - break; - } - break; -@@ -1383,15 +1383,55 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface, - return E_INVALIDARG; - if (mode == AUDCLNT_SHAREMODE_EXCLUSIVE) - return This->dataflow == eCapture ? AUDCLNT_E_UNSUPPORTED_FORMAT : AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED; -- if (fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE && -- fmt->cbSize < sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)) -- return E_INVALIDARG; -- -- dump_fmt(fmt); -- -+ switch (fmt->wFormatTag) { -+ case WAVE_FORMAT_EXTENSIBLE: -+ if (fmt->cbSize < sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)) -+ return E_INVALIDARG; -+ dump_fmt(fmt); -+ break; -+ case WAVE_FORMAT_ALAW: -+ case WAVE_FORMAT_MULAW: -+ case WAVE_FORMAT_IEEE_FLOAT: -+ case WAVE_FORMAT_PCM: -+ dump_fmt(fmt); -+ break; -+ default: -+ dump_fmt(fmt); -+ return AUDCLNT_E_UNSUPPORTED_FORMAT; -+ } -+ if (fmt->nChannels == 0) -+ return AUDCLNT_E_UNSUPPORTED_FORMAT; - closest = clone_format(fmt); -- if (!closest) -- hr = E_OUTOFMEMORY; -+ if (!closest) { -+ if (out) -+ *out = NULL; -+ return E_OUTOFMEMORY; -+ } -+ -+ if (fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE) { -+ UINT32 mask = 0, i, channels = 0; -+ WAVEFORMATEXTENSIBLE *ext = (WAVEFORMATEXTENSIBLE*)closest; -+ -+ if ((fmt->nChannels > 1 && ext->dwChannelMask == SPEAKER_ALL) || -+ (fmt->nChannels == 1 && ext->dwChannelMask == ~0U)) { -+ mask = ext->dwChannelMask; -+ channels = fmt->nChannels; -+ } else if (ext->dwChannelMask) { -+ for (i = 1; !(i & SPEAKER_RESERVED); i <<= 1) { -+ if (i & ext->dwChannelMask) { -+ mask |= i; -+ channels++; -+ } -+ } -+ if (channels < fmt->nChannels) -+ mask = get_channel_mask(fmt->nChannels); -+ } else -+ mask = ext->dwChannelMask; -+ if (ext->dwChannelMask != mask) { -+ ext->dwChannelMask = mask; -+ hr = S_FALSE; -+ } -+ } - - if (hr == S_OK || !out) { - CoTaskMemFree(closest); --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0020-winepulse-v18-Latency-and-compilation-improvements.patch wine1.7-1.7.55/debian/patches/0020-winepulse-v18-Latency-and-compilation-improvements.patch --- wine1.7-1.7.50/debian/patches/0020-winepulse-v18-Latency-and-compilation-improvements.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0020-winepulse-v18-Latency-and-compilation-improvements.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,207 +0,0 @@ -From 5fd233b05bceca07d7241d27a5e75f6e688859b2 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:30 +0100 -Subject: [PATCH 20/50] winepulse v18: Latency and compilation improvements - -Changes since v17: -- Remove clock_pulse interpolation - * Couldn't work, sadly -- Allow 2 * MinimumPeriod for shared buffers -- Fix all compiler warnings when compiling with 64-bits -- Dynamically select low latency mode if less than 2 default periods are request - * This requires the rtkit patch to be useful ---- - dlls/winepulse.drv/mmdevdrv.c | 55 +++++++++++++++++-------------------------- - 1 file changed, 22 insertions(+), 33 deletions(-) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index 6e75674..8e76826 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -169,7 +169,6 @@ struct ACImpl { - pa_channel_map map; - - INT64 clock_lastpos, clock_written; -- pa_usec_t clock_pulse; - - AudioSession *session; - AudioSessionWrapper *session_wrapper; -@@ -518,7 +517,6 @@ static void pulse_attr_update(pa_stream *s, void *user) { - static void pulse_wr_callback(pa_stream *s, size_t bytes, void *userdata) - { - ACImpl *This = userdata; -- pa_usec_t time; - UINT32 oldpad = This->pad; - - if (bytes < This->bufsize_bytes) -@@ -528,13 +526,8 @@ static void pulse_wr_callback(pa_stream *s, size_t bytes, void *userdata) - - assert(oldpad >= This->pad); - -- if (0 && This->pad && pa_stream_get_time(This->stream, &time) >= 0) -- This->clock_pulse = time; -- else -- This->clock_pulse = PA_USEC_INVALID; -- - This->clock_written += oldpad - This->pad; -- TRACE("New pad: %u (-%u)\n", This->pad / pa_frame_size(&This->ss), (oldpad - This->pad) / pa_frame_size(&This->ss)); -+ TRACE("New pad: %zu (-%zu)\n", This->pad / pa_frame_size(&This->ss), (oldpad - This->pad) / pa_frame_size(&This->ss)); - - if (This->event) - SetEvent(This->event); -@@ -542,8 +535,6 @@ static void pulse_wr_callback(pa_stream *s, size_t bytes, void *userdata) - - static void pulse_underflow_callback(pa_stream *s, void *userdata) - { -- ACImpl *This = userdata; -- This->clock_pulse = PA_USEC_INVALID; - WARN("Underflow\n"); - } - -@@ -562,12 +553,8 @@ static void pulse_latency_callback(pa_stream *s, void *userdata) - static void pulse_started_callback(pa_stream *s, void *userdata) - { - ACImpl *This = userdata; -- pa_usec_t time; - - TRACE("(Re)started playing\n"); -- assert(This->clock_pulse == PA_USEC_INVALID); -- if (0 && pa_stream_get_time(This->stream, &time) >= 0) -- This->clock_pulse = time; - if (This->event) - SetEvent(This->event); - } -@@ -578,7 +565,7 @@ static void pulse_rd_loop(ACImpl *This, size_t bytes) - ACPacket *p, *next; - LARGE_INTEGER stamp, freq; - BYTE *dst, *src; -- UINT32 src_len, copy, rem = This->capture_period; -+ size_t src_len, copy, rem = This->capture_period; - if (!(p = (ACPacket*)list_head(&This->packet_free_head))) { - p = (ACPacket*)list_head(&This->packet_filled_head); - if (!p->discont) { -@@ -630,7 +617,7 @@ static void pulse_rd_loop(ACImpl *This, size_t bytes) - static void pulse_rd_drop(ACImpl *This, size_t bytes) - { - while (bytes >= This->capture_period) { -- UINT32 src_len, copy, rem = This->capture_period; -+ size_t src_len, copy, rem = This->capture_period; - while (rem) { - const void *src; - pa_stream_peek(This->stream, &src, &src_len); -@@ -660,7 +647,7 @@ static void pulse_rd_callback(pa_stream *s, size_t bytes, void *userdata) - { - ACImpl *This = userdata; - -- TRACE("Readable total: %u, fragsize: %u\n", bytes, pa_stream_get_buffer_attr(s)->fragsize); -+ TRACE("Readable total: %zu, fragsize: %u\n", bytes, pa_stream_get_buffer_attr(s)->fragsize); - assert(bytes >= This->peek_ofs); - bytes -= This->peek_ofs; - if (bytes < This->capture_period) -@@ -815,7 +802,6 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(void *key, IMMDevice *dev, - This->IAudioStreamVolume_iface.lpVtbl = &AudioStreamVolume_Vtbl; - This->dataflow = dataflow; - This->parent = dev; -- This->clock_pulse = PA_USEC_INVALID; - for (i = 0; i < PA_CHANNELS_MAX; ++i) - This->vol[i] = 1.f; - IMMDevice_AddRef(This->parent); -@@ -1199,7 +1185,19 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface, - goto exit; - - if (mode == AUDCLNT_SHAREMODE_SHARED) { -- period = pulse_def_period[This->dataflow == eCapture]; -+ REFERENCE_TIME def = pulse_def_period[This->dataflow == eCapture]; -+ REFERENCE_TIME min = pulse_min_period[This->dataflow == eCapture]; -+ -+ /* Switch to low latency mode if below 2 default periods, -+ * which is 20 ms by default, this will increase the amount -+ * of interrupts but allows very low latency. In dsound I -+ * managed to get a total latency of ~8ms, which is well below -+ * default -+ */ -+ if (duration < 2 * def) -+ period = min; -+ else -+ period = def; - if (duration < 2 * period) - duration = 2 * period; - } -@@ -1510,7 +1508,6 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient *iface) - pthread_mutex_unlock(&pulse_lock); - return AUDCLNT_E_NOT_STOPPED; - } -- This->clock_pulse = PA_USEC_INVALID; - - if (pa_stream_is_corked(This->stream)) { - o = pa_stream_cork(This->stream, 0, pulse_op_cb, &success); -@@ -1566,7 +1563,6 @@ static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface) - } - if (SUCCEEDED(hr)) { - This->started = FALSE; -- This->clock_pulse = PA_USEC_INVALID; - } - pthread_mutex_unlock(&pulse_lock); - return hr; -@@ -1764,7 +1760,8 @@ static HRESULT WINAPI AudioRenderClient_GetBuffer(IAudioRenderClient *iface, - UINT32 frames, BYTE **data) - { - ACImpl *This = impl_from_IAudioRenderClient(iface); -- UINT32 avail, pad, req, bytes = frames * pa_frame_size(&This->ss); -+ size_t avail, req, bytes = frames * pa_frame_size(&This->ss); -+ UINT32 pad; - HRESULT hr = S_OK; - int ret = -1; - -@@ -1789,7 +1786,7 @@ static HRESULT WINAPI AudioRenderClient_GetBuffer(IAudioRenderClient *iface, - avail = This->bufsize_frames - pad; - if (avail < frames || bytes > This->bufsize_bytes) { - pthread_mutex_unlock(&pulse_lock); -- WARN("Wanted to write %u, but only %u available\n", frames, avail); -+ WARN("Wanted to write %u, but only %zu available\n", frames, avail); - return AUDCLNT_E_BUFFER_TOO_LARGE; - } - -@@ -1797,7 +1794,7 @@ static HRESULT WINAPI AudioRenderClient_GetBuffer(IAudioRenderClient *iface, - req = bytes; - ret = pa_stream_begin_write(This->stream, &This->locked_ptr, &req); - if (ret < 0 || req < bytes) { -- FIXME("%p Not using pulse locked data: %i %u/%u %u/%u\n", This, ret, req/pa_frame_size(&This->ss), frames, pad, This->bufsize_frames); -+ FIXME("%p Not using pulse locked data: %i %zu/%u %u/%u\n", This, ret, req/pa_frame_size(&This->ss), frames, pad, This->bufsize_frames); - if (ret >= 0) - pa_stream_cancel_write(This->stream); - *data = This->tmp_buffer; -@@ -1845,7 +1842,7 @@ static HRESULT WINAPI AudioRenderClient_ReleaseBuffer( - pa_stream_write(This->stream, This->tmp_buffer, written_bytes, NULL, 0, PA_SEEK_RELATIVE); - This->pad += written_bytes; - This->locked_ptr = NULL; -- TRACE("Released %u, pad %u\n", written_frames, This->pad / pa_frame_size(&This->ss)); -+ TRACE("Released %u, pad %zu\n", written_frames, This->pad / pa_frame_size(&This->ss)); - assert(This->pad <= This->bufsize_bytes); - pthread_mutex_unlock(&pulse_lock); - return S_OK; -@@ -2053,7 +2050,6 @@ static HRESULT WINAPI AudioClock_GetPosition(IAudioClock *iface, UINT64 *pos, - UINT64 *qpctime) - { - ACImpl *This = impl_from_IAudioClock(iface); -- pa_usec_t time; - HRESULT hr; - - TRACE("(%p)->(%p, %p)\n", This, pos, qpctime); -@@ -2069,13 +2065,6 @@ static HRESULT WINAPI AudioClock_GetPosition(IAudioClock *iface, UINT64 *pos, - } - - *pos = This->clock_written; -- if (This->clock_pulse != PA_USEC_INVALID && pa_stream_get_time(This->stream, &time) >= 0) { -- UINT32 delta = pa_usec_to_bytes(time - This->clock_pulse, &This->ss); -- if (delta < This->pad) -- *pos += delta; -- else -- *pos += This->pad; -- } - - /* Make time never go backwards */ - if (*pos < This->clock_lastpos) --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0021-winepulse-API-Compatibility-with-1.5.2-onward-v2.patch wine1.7-1.7.55/debian/patches/0021-winepulse-API-Compatibility-with-1.5.2-onward-v2.patch --- wine1.7-1.7.50/debian/patches/0021-winepulse-API-Compatibility-with-1.5.2-onward-v2.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0021-winepulse-API-Compatibility-with-1.5.2-onward-v2.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,114 +0,0 @@ -From b6cd82a80d2997949773f16ceb97a8fec1dd6f8e Mon Sep 17 00:00:00 2001 -From: Juergen Tretthahn -Date: Mon, 23 Mar 2015 09:14:30 +0100 -Subject: [PATCH 21/50] winepulse: API Compatibility with 1.5.2 onward, v2 - -V2: Add winepulse.drv.spec to commit too -V1: Original version - -Commit e87cb774d131963d2642d075977571585ec5da8d changed the driver api -leave this commit out to build for builds prior to this - -Not needed for: 1.5.1, 1.5 and 1.4 builds ---- - dlls/winepulse.drv/mmdevdrv.c | 34 ++++++++++++++++++++++------------ - dlls/winepulse.drv/winepulse.drv.spec | 2 +- - 2 files changed, 23 insertions(+), 13 deletions(-) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index 8e76826..b374b53 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -82,6 +82,11 @@ const WCHAR pulse_keyW[] = {'S','o','f','t','w','a','r','e','\\', - 'W','i','n','e','\\','P','u','l','s','e',0}; - const WCHAR pulse_streamW[] = { 'S','t','r','e','a','m','V','o','l',0 }; - -+static GUID pulse_render_guid = -+{ 0xfd47d9cc, 0x4218, 0x4135, { 0x9c, 0xe2, 0x0c, 0x19, 0x5c, 0x87, 0x40, 0x5b } }; -+static GUID pulse_capture_guid = -+{ 0x25da76d0, 0x033c, 0x4235, { 0x90, 0x02, 0x19, 0xf4, 0x88, 0x94, 0xac, 0x6f } }; -+ - static HANDLE warn_once; - - BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved) -@@ -716,7 +721,7 @@ static HRESULT pulse_stream_connect(ACImpl *This, UINT32 period_bytes) { - return S_OK; - } - --HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids, void ***keys, -+HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, const WCHAR ***ids, GUID **keys, - UINT *num, UINT *def_index) - { - HRESULT hr = S_OK; -@@ -730,20 +735,21 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids, void ***keys, - *num = 1; - *def_index = 0; - -- *ids = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR *)); -+ *ids = HeapAlloc(GetProcessHeap(), 0, sizeof(**ids)); - if (!*ids) - return E_OUTOFMEMORY; -+ (*ids)[0] = defaultW; - -- (*ids)[0] = HeapAlloc(GetProcessHeap(), 0, sizeof(defaultW)); -- if (!(*ids)[0]) { -+ *keys = HeapAlloc(GetProcessHeap(), 0, sizeof(**keys)); -+ if (!*keys) { - HeapFree(GetProcessHeap(), 0, *ids); -+ *ids = NULL; - return E_OUTOFMEMORY; - } -- -- lstrcpyW((*ids)[0], defaultW); -- -- *keys = HeapAlloc(GetProcessHeap(), 0, sizeof(void *)); -- (*keys)[0] = NULL; -+ if (flow == eRender) -+ (*keys)[0] = pulse_render_guid; -+ else -+ (*keys)[0] = pulse_capture_guid; - - return S_OK; - } -@@ -761,12 +767,12 @@ int WINAPI AUDDRV_GetPriority(void) - return SUCCEEDED(hr) ? 3 : 0; - } - --HRESULT WINAPI AUDDRV_GetAudioEndpoint(void *key, IMMDevice *dev, -- EDataFlow dataflow, IAudioClient **out) -+HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev, IAudioClient **out) - { - HRESULT hr; - ACImpl *This; - int i; -+ EDataFlow dataflow; - - /* Give one visible warning per session - * Sadly wine has chosen not to accept the winepulse patch, so support ourselves -@@ -780,7 +786,11 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(void *key, IMMDevice *dev, - } - - TRACE("%s %p %p\n", debugstr_guid(guid), dev, out); -- if (dataflow != eRender && dataflow != eCapture) -+ if (IsEqualGUID(guid, &pulse_render_guid)) -+ dataflow = eRender; -+ else if (IsEqualGUID(guid, &pulse_capture_guid)) -+ dataflow = eCapture; -+ else - return E_UNEXPECTED; - - *out = NULL; -diff --git a/dlls/winepulse.drv/winepulse.drv.spec b/dlls/winepulse.drv/winepulse.drv.spec -index a089166..612bf46 100644 ---- a/dlls/winepulse.drv/winepulse.drv.spec -+++ b/dlls/winepulse.drv/winepulse.drv.spec -@@ -1,5 +1,5 @@ - # MMDevAPI driver functions - @ stdcall -private GetPriority() AUDDRV_GetPriority - @ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs --@ stdcall -private GetAudioEndpoint(ptr ptr long ptr) AUDDRV_GetAudioEndpoint -+@ stdcall -private GetAudioEndpoint(ptr ptr ptr) AUDDRV_GetAudioEndpoint - @ stdcall -private GetAudioSessionManager(ptr ptr) AUDDRV_GetAudioSessionManager --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0022-winepulse-Fix-low-latency-support.patch wine1.7-1.7.55/debian/patches/0022-winepulse-Fix-low-latency-support.patch --- wine1.7-1.7.50/debian/patches/0022-winepulse-Fix-low-latency-support.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0022-winepulse-Fix-low-latency-support.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -From d52ec84b9b0ef857b175f2c423ef5cda3e8461ab Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:30 +0100 -Subject: [PATCH 22/50] winepulse: Fix low latency support - -Some games request a 20 ms buffer and will only fill 20 ms. -Since 10 ms periods are too long in this case for winepulse, -fill change period size to 5 ms and force a trigger if -there's still data left to fill. ---- - dlls/winepulse.drv/mmdevdrv.c | 14 ++++++++++++-- - 1 file changed, 12 insertions(+), 2 deletions(-) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index b374b53..7c07f54 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -1205,11 +1205,15 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface, - * default - */ - if (duration < 2 * def) -- period = min; -+ period = min; - else -- period = def; -+ period = def; - if (duration < 2 * period) - duration = 2 * period; -+ -+ /* Uh oh, really low latency requested.. */ -+ if (duration <= 2 * period) -+ period /= 2; - } - period_bytes = pa_frame_size(&This->ss) * MulDiv(period, This->ss.rate, 10000000); - -@@ -1820,6 +1824,7 @@ static HRESULT WINAPI AudioRenderClient_ReleaseBuffer( - { - ACImpl *This = impl_from_IAudioRenderClient(iface); - UINT32 written_bytes = written_frames * pa_frame_size(&This->ss); -+ UINT32 period; - - TRACE("(%p)->(%u, %x)\n", This, written_frames, flags); - -@@ -1854,6 +1859,11 @@ static HRESULT WINAPI AudioRenderClient_ReleaseBuffer( - This->locked_ptr = NULL; - TRACE("Released %u, pad %zu\n", written_frames, This->pad / pa_frame_size(&This->ss)); - assert(This->pad <= This->bufsize_bytes); -+ -+ period = pa_stream_get_buffer_attr(This->stream)->minreq; -+ /* Require a minimum of 3 periods filled, if possible */ -+ if (This->event && This->pad + period <= This->bufsize_bytes && This->pad < period * 3) -+ SetEvent(This->event); - pthread_mutex_unlock(&pulse_lock); - return S_OK; - } --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0023-winepulse-drop-realtime-priority-before-thread-destr.patch wine1.7-1.7.55/debian/patches/0023-winepulse-drop-realtime-priority-before-thread-destr.patch --- wine1.7-1.7.50/debian/patches/0023-winepulse-drop-realtime-priority-before-thread-destr.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0023-winepulse-drop-realtime-priority-before-thread-destr.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -From aa506aeb2de069de1fd6c3543299d70194f2ca12 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:31 +0100 -Subject: [PATCH 23/50] winepulse: drop realtime priority before thread - destruction - -prevents having to handle a kernel RT Watchdog Timeout. ---- - dlls/winepulse.drv/mmdevdrv.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index 7c07f54..ba68102 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -101,6 +101,8 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved) - } - DisableThreadLibraryCalls(dll); - } else if (reason == DLL_PROCESS_DETACH) { -+ if (pulse_thread) -+ SetThreadPriority(pulse_thread, 0); - if (pulse_ctx) { - pa_context_disconnect(pulse_ctx); - pa_context_unref(pulse_ctx); --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0024-winepulse-remove-bogus-SetEvent-from-pulse_started_c.patch wine1.7-1.7.55/debian/patches/0024-winepulse-remove-bogus-SetEvent-from-pulse_started_c.patch --- wine1.7-1.7.50/debian/patches/0024-winepulse-remove-bogus-SetEvent-from-pulse_started_c.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0024-winepulse-remove-bogus-SetEvent-from-pulse_started_c.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -From 2b5deaf30cf8f5225e936b89262736b43435cc86 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:31 +0100 -Subject: [PATCH 24/50] winepulse: remove bogus SetEvent from - pulse_started_callback - ---- - dlls/winepulse.drv/mmdevdrv.c | 4 ---- - 1 file changed, 4 deletions(-) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index ba68102..68de00c 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -559,11 +559,7 @@ static void pulse_latency_callback(pa_stream *s, void *userdata) - - static void pulse_started_callback(pa_stream *s, void *userdata) - { -- ACImpl *This = userdata; -- - TRACE("(Re)started playing\n"); -- if (This->event) -- SetEvent(This->event); - } - - static void pulse_rd_loop(ACImpl *This, size_t bytes) --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0025-winepulse-disable-the-setevent-part-of-the-latency-h.patch wine1.7-1.7.55/debian/patches/0025-winepulse-disable-the-setevent-part-of-the-latency-h.patch --- wine1.7-1.7.50/debian/patches/0025-winepulse-disable-the-setevent-part-of-the-latency-h.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0025-winepulse-disable-the-setevent-part-of-the-latency-h.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -From 1f2224b9068d5ca65af6d39836df0f5ce98d85cd Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:31 +0100 -Subject: [PATCH 25/50] winepulse: disable the setevent part of the latency - hack - -If you get playback glitches in skyrim or other games as a result of -this patch, PLEASE REPORT TO ME! ---- - dlls/winepulse.drv/mmdevdrv.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index 68de00c..643d55e 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -1822,7 +1822,7 @@ static HRESULT WINAPI AudioRenderClient_ReleaseBuffer( - { - ACImpl *This = impl_from_IAudioRenderClient(iface); - UINT32 written_bytes = written_frames * pa_frame_size(&This->ss); -- UINT32 period; -+// UINT32 period; - - TRACE("(%p)->(%u, %x)\n", This, written_frames, flags); - -@@ -1858,10 +1858,10 @@ static HRESULT WINAPI AudioRenderClient_ReleaseBuffer( - TRACE("Released %u, pad %zu\n", written_frames, This->pad / pa_frame_size(&This->ss)); - assert(This->pad <= This->bufsize_bytes); - -- period = pa_stream_get_buffer_attr(This->stream)->minreq; -+// period = pa_stream_get_buffer_attr(This->stream)->minreq; - /* Require a minimum of 3 periods filled, if possible */ -- if (This->event && This->pad + period <= This->bufsize_bytes && This->pad < period * 3) -- SetEvent(This->event); -+// if (This->event && This->pad + period <= This->bufsize_bytes && This->pad < period * 3) -+// SetEvent(This->event); - pthread_mutex_unlock(&pulse_lock); - return S_OK; - } --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0026-winepulse-v20-fix-the-checks-in-IsFormatSupported.patch wine1.7-1.7.55/debian/patches/0026-winepulse-v20-fix-the-checks-in-IsFormatSupported.patch --- wine1.7-1.7.50/debian/patches/0026-winepulse-v20-fix-the-checks-in-IsFormatSupported.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0026-winepulse-v20-fix-the-checks-in-IsFormatSupported.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -From 307e9bae2ae5323e734ff2d3f8a524e9fb6c273b Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:31 +0100 -Subject: [PATCH 26/50] winepulse v20: fix the checks in IsFormatSupported - -Thanks to DGhost001 for reporting and isolating the issue. ---- - dlls/winepulse.drv/mmdevdrv.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index 643d55e..86dd10a 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -1443,6 +1443,10 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface, - } - } - -+ if (fmt->nBlockAlign != fmt->nChannels * fmt->wBitsPerSample / 8 || -+ fmt->nAvgBytesPerSec != fmt->nBlockAlign * fmt->nSamplesPerSec) -+ hr = S_FALSE; -+ - if (hr == S_OK || !out) { - CoTaskMemFree(closest); - if (out) --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0027-winepulse-fixup-IsFormatSupported-calls.patch wine1.7-1.7.55/debian/patches/0027-winepulse-fixup-IsFormatSupported-calls.patch --- wine1.7-1.7.50/debian/patches/0027-winepulse-fixup-IsFormatSupported-calls.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0027-winepulse-fixup-IsFormatSupported-calls.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,413 +0,0 @@ -From 676f6ad2b168a74ee823436beceab6c2b14779df Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:31 +0100 -Subject: [PATCH 27/50] winepulse: fixup IsFormatSupported calls - ---- - dlls/mmdevapi/tests/render.c | 164 +++++++++++++++++++++++++++++++++++++++ - dlls/winepulse.drv/mmdevdrv.c | 176 ++++++++++++++++++++++++++++-------------- - 2 files changed, 283 insertions(+), 57 deletions(-) - -diff --git a/dlls/mmdevapi/tests/render.c b/dlls/mmdevapi/tests/render.c -index a6f0c09..245c244 100644 ---- a/dlls/mmdevapi/tests/render.c -+++ b/dlls/mmdevapi/tests/render.c -@@ -467,6 +467,169 @@ static void test_formats(AUDCLNT_SHAREMODE mode) - } - } - -+static void test_formats2(void) -+{ -+ IAudioClient *ac; -+ HRESULT hr; -+ WAVEFORMATEX *pwfx, *pwfx2; -+ WAVEFORMATEXTENSIBLE *pwfe, wfe, *pwfe2; -+ -+ hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, -+ NULL, (void**)&ac); -+ -+ ok(hr == S_OK, "Activation failed with %08x\n", hr); -+ if (hr != S_OK) -+ return; -+ -+ hr = IAudioClient_GetMixFormat(ac, &pwfx); -+ ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr); -+ if (hr != S_OK) -+ return; -+ -+ ok(pwfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE, "Invalid wFormatTag\n"); -+ if (pwfx->wFormatTag != WAVE_FORMAT_EXTENSIBLE) { -+ CoTaskMemFree(pwfx); -+ return; -+ } -+ -+ pwfe = (WAVEFORMATEXTENSIBLE*)pwfx; -+ ok(pwfe->Samples.wValidBitsPerSample, "wValidBitsPerSample should be non-zero\n"); -+ -+ if (pwfx->nChannels > 2) { -+ trace("Limiting channels to 2\n"); -+ pwfx->nChannels = 2; -+ pwfx->nBlockAlign = pwfx->wBitsPerSample / 8 * pwfx->nChannels; -+ pwfx->nAvgBytesPerSec = pwfx->nBlockAlign * pwfx->nSamplesPerSec; -+ pwfe->dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT; -+ } -+ -+ wfe = *pwfe; -+ pwfx->nAvgBytesPerSec = pwfx->nBlockAlign = 0; -+ -+ hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_EXCLUSIVE, pwfx, NULL); -+ ok(hr == AUDCLNT_E_UNSUPPORTED_FORMAT || hr == AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED, -+ "Exclusive IsFormatSupported with nAvgBytesPerSec=0 and nBlockAlign=0 returned %08x\n", hr); -+ -+ pwfx2 = NULL; -+ hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_SHARED, pwfx, &pwfx2); -+ ok((hr == E_INVALIDARG || hr == AUDCLNT_E_UNSUPPORTED_FORMAT) && !pwfx2, -+ "Shared IsFormatSupported with nAvgBytesPerSec=0 and nBlockAlign=0 returned %08x %p\n", hr, pwfx2); -+ CoTaskMemFree(pwfx2); -+ -+ pwfx->wFormatTag = WAVE_FORMAT_PCM; -+ pwfx2 = NULL; -+ hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_SHARED, pwfx, &pwfx2); -+ ok((hr == S_OK || hr == AUDCLNT_E_UNSUPPORTED_FORMAT) && !pwfx2, -+ "Shared IsFormatSupported with nAvgBytesPerSec=0 and nBlockAlign=0 returned %08x %p\n", hr, pwfx2); -+ CoTaskMemFree(pwfx2); -+ -+ *pwfe = wfe; -+ pwfe->dwChannelMask = 0; -+ hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_EXCLUSIVE, pwfx, NULL); -+ ok(hr == AUDCLNT_E_UNSUPPORTED_FORMAT || hr == AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED, -+ "Exclusive IsFormatSupported with dwChannelMask=0 returned %08x\n", hr); -+ -+ pwfx2 = NULL; -+ hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_SHARED, pwfx, &pwfx2); -+ ok(hr == S_OK, -+ "Shared IsFormatSupported with dwChannelMask=0 returned %08x\n", hr); -+ CoTaskMemFree(pwfx2); -+ -+ -+ pwfe->dwChannelMask = 0x3ffff; -+ hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_EXCLUSIVE, pwfx, NULL); -+ ok(hr == AUDCLNT_E_UNSUPPORTED_FORMAT || hr == AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED, -+ "Exclusive IsFormatSupported with dwChannelMask=0x3ffff returned %08x\n", hr); -+ -+ pwfx2 = NULL; -+ hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_SHARED, pwfx, &pwfx2); -+ ok(hr == S_OK && !pwfx2, -+ "Shared IsFormatSupported with dwChannelMask=0x3ffff returned %08x %p\n", hr, pwfx2); -+ CoTaskMemFree(pwfx2); -+ -+ -+ pwfe->dwChannelMask = 0x40000000; -+ hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_EXCLUSIVE, pwfx, NULL); -+ ok(hr == AUDCLNT_E_UNSUPPORTED_FORMAT || hr == AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED, -+ "Exclusive IsFormatSupported with dwChannelMask=0x40000000 returned %08x\n", hr); -+ -+ pwfx2 = NULL; -+ hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_SHARED, pwfx, &pwfx2); -+ ok(hr == S_OK && !pwfx2, -+ "Shared IsFormatSupported with dwChannelMask=0x40000000 returned %08x %p\n", hr, pwfx2); -+ CoTaskMemFree(pwfx2); -+ -+ pwfe->dwChannelMask = SPEAKER_ALL | SPEAKER_RESERVED; -+ hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_EXCLUSIVE, pwfx, NULL); -+ ok(hr == AUDCLNT_E_UNSUPPORTED_FORMAT || hr == AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED, -+ "Exclusive IsFormatSupported with dwChannelMask=SPEAKER_ALL | SPEAKER_RESERVED returned %08x\n", hr); -+ -+ pwfx2 = NULL; -+ hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_SHARED, pwfx, &pwfx2); -+ ok(hr == S_OK && !pwfx2, -+ "Shared IsFormatSupported with dwChannelMask=SPEAKER_ALL | SPEAKER_RESERVED returned %08x %p\n", hr, pwfx2); -+ CoTaskMemFree(pwfx2); -+ -+ *pwfe = wfe; -+ pwfe->Samples.wValidBitsPerSample = 0; -+ hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_EXCLUSIVE, pwfx, NULL); -+ ok(hr == AUDCLNT_E_UNSUPPORTED_FORMAT || hr == AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED, -+ "Exclusive IsFormatSupported with wValidBitsPerSample=0 returned %08x\n", hr); -+ -+ pwfx2 = NULL; -+ hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_SHARED, pwfx, &pwfx2); -+ ok((hr == S_FALSE || hr == AUDCLNT_E_UNSUPPORTED_FORMAT) && pwfx2, -+ "Shared IsFormatSupported with wValidBitsPerSample=0 returned %08x %p\n", hr, pwfx2); -+ if (pwfx2) { -+ pwfe2 = (WAVEFORMATEXTENSIBLE*)pwfx2; -+ ok(pwfe2->Samples.wValidBitsPerSample == pwfx->wBitsPerSample, -+ "Shared IsFormatSupported had wValidBitsPerSample set to %u, not %u\n", -+ pwfe2->Samples.wValidBitsPerSample, pwfx->wBitsPerSample); -+ CoTaskMemFree(pwfx2); -+ } -+ -+ pwfx2 = NULL; -+ pwfe->Samples.wValidBitsPerSample = pwfx->wBitsPerSample + 1; -+ hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_SHARED, pwfx, &pwfx2); -+ ok((hr == E_INVALIDARG || hr == AUDCLNT_E_UNSUPPORTED_FORMAT) && !pwfx2, -+ "Shared IsFormatSupported with wValidBitsPerSample += 1 returned %08x %p\n", hr, pwfx2); -+ -+ *pwfe = wfe; -+ memset(&pwfe->SubFormat, 0xff, 16); -+ pwfx2 = NULL; -+ hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_SHARED, pwfx, &pwfx2); -+ ok(hr == AUDCLNT_E_UNSUPPORTED_FORMAT && !pwfx2, -+ "Shared IsFormatSupported with SubFormat=-1 returned %08x %p\n", hr, pwfx2); -+ CoTaskMemFree(pwfx2); -+ -+ *pwfe = wfe; -+ pwfx2 = NULL; -+ pwfe->Samples.wValidBitsPerSample = pwfx->wBitsPerSample = 256; -+ pwfx->nBlockAlign = pwfx->wBitsPerSample / 8 * pwfx->nChannels; -+ pwfx->nAvgBytesPerSec = pwfx->nBlockAlign * pwfx->nSamplesPerSec; -+ hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_SHARED, pwfx, &pwfx2); -+ ok((hr == E_INVALIDARG || hr == AUDCLNT_E_UNSUPPORTED_FORMAT) && !pwfx2, -+ "Shared IsFormatSupported with wBitsPerSample=256 returned %08x %p\n", hr, pwfx2); -+ CoTaskMemFree(pwfx2); -+ -+ *pwfe = wfe; -+ pwfx2 = NULL; -+ pwfe->Samples.wValidBitsPerSample = pwfx->wBitsPerSample - 1; -+ hr = IAudioClient_IsFormatSupported(ac, AUDCLNT_SHAREMODE_SHARED, pwfx, &pwfx2); -+ ok(hr == S_FALSE && pwfx2, -+ "Shared IsFormatSupported with wValidBitsPerSample-=1 returned %08x %p\n", hr, pwfx2); -+ if (pwfx2) { -+ pwfe2 = (WAVEFORMATEXTENSIBLE*)pwfx2; -+ ok(pwfe2->Samples.wValidBitsPerSample == pwfx->wBitsPerSample, -+ "Shared IsFormatSupported had wValidBitsPerSample set to %u, not %u\n", -+ pwfe2->Samples.wValidBitsPerSample, pwfx->wBitsPerSample); -+ CoTaskMemFree(pwfx2); -+ } -+ -+ CoTaskMemFree(pwfx); -+ IAudioClient_Release(ac); -+} -+ - static void test_references(void) - { - IAudioClient *ac; -@@ -2244,6 +2407,7 @@ START_TEST(render) - test_audioclient(); - test_formats(AUDCLNT_SHAREMODE_EXCLUSIVE); - test_formats(AUDCLNT_SHAREMODE_SHARED); -+ test_formats2(); - test_references(); - test_marshal(); - trace("Output to a MS-DOS console is particularly slow and disturbs timing.\n"); -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index 86dd10a..554a9fc 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -1104,10 +1104,8 @@ static HRESULT pulse_spec_from_waveformat(ACImpl *This, const WAVEFORMATEX *fmt) - } - } - This->map.channels = fmt->nChannels; -- if (!mask || mask == SPEAKER_ALL) -+ if (!mask || (mask & (SPEAKER_ALL|SPEAKER_RESERVED))) - mask = get_channel_mask(fmt->nChannels); -- else if (mask == ~0U && fmt->nChannels == 1) -- mask = SPEAKER_FRONT_CENTER; - for (j = 0; j < sizeof(pulse_pos_from_wfx)/sizeof(*pulse_pos_from_wfx) && i < fmt->nChannels; ++j) { - if (mask & (1 << j)) - This->map.map[i++] = pulse_pos_from_wfx[j]; -@@ -1381,83 +1379,147 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface, - ACImpl *This = impl_from_IAudioClient(iface); - HRESULT hr = S_OK; - WAVEFORMATEX *closest = NULL; -+ BOOL exclusive; - - TRACE("(%p)->(%x, %p, %p)\n", This, mode, fmt, out); - -- if (!fmt || (mode == AUDCLNT_SHAREMODE_SHARED && !out)) -+ if (!fmt) - return E_POINTER; - - if (out) - *out = NULL; -- if (mode != AUDCLNT_SHAREMODE_SHARED && mode != AUDCLNT_SHAREMODE_EXCLUSIVE) -+ -+ if (mode == AUDCLNT_SHAREMODE_EXCLUSIVE) { -+ exclusive = 1; -+ out = NULL; -+ } else if (mode == AUDCLNT_SHAREMODE_SHARED) { -+ exclusive = 0; -+ if (!out) -+ return E_POINTER; -+ } else - return E_INVALIDARG; -- if (mode == AUDCLNT_SHAREMODE_EXCLUSIVE) -- return This->dataflow == eCapture ? AUDCLNT_E_UNSUPPORTED_FORMAT : AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED; -- switch (fmt->wFormatTag) { -- case WAVE_FORMAT_EXTENSIBLE: -- if (fmt->cbSize < sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX)) -- return E_INVALIDARG; -- dump_fmt(fmt); -- break; -- case WAVE_FORMAT_ALAW: -- case WAVE_FORMAT_MULAW: -- case WAVE_FORMAT_IEEE_FLOAT: -- case WAVE_FORMAT_PCM: -- dump_fmt(fmt); -- break; -- default: -- dump_fmt(fmt); -- return AUDCLNT_E_UNSUPPORTED_FORMAT; -- } -+ - if (fmt->nChannels == 0) - return AUDCLNT_E_UNSUPPORTED_FORMAT; -+ - closest = clone_format(fmt); -- if (!closest) { -- if (out) -- *out = NULL; -+ if (!closest) - return E_OUTOFMEMORY; -- } - -- if (fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE) { -- UINT32 mask = 0, i, channels = 0; -+ dump_fmt(fmt); -+ -+ switch (fmt->wFormatTag) { -+ case WAVE_FORMAT_EXTENSIBLE: { - WAVEFORMATEXTENSIBLE *ext = (WAVEFORMATEXTENSIBLE*)closest; - -- if ((fmt->nChannels > 1 && ext->dwChannelMask == SPEAKER_ALL) || -- (fmt->nChannels == 1 && ext->dwChannelMask == ~0U)) { -- mask = ext->dwChannelMask; -- channels = fmt->nChannels; -- } else if (ext->dwChannelMask) { -- for (i = 1; !(i & SPEAKER_RESERVED); i <<= 1) { -- if (i & ext->dwChannelMask) { -- mask |= i; -- channels++; -+ if ((fmt->cbSize != sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX) && -+ fmt->cbSize != sizeof(WAVEFORMATEXTENSIBLE)) || -+ fmt->nBlockAlign != fmt->wBitsPerSample / 8 * fmt->nChannels || -+ ext->Samples.wValidBitsPerSample > fmt->wBitsPerSample || -+ fmt->nAvgBytesPerSec != fmt->nBlockAlign * fmt->nSamplesPerSec) { -+ hr = E_INVALIDARG; -+ break; -+ } -+ -+ if (exclusive) { -+ UINT32 mask = 0, i, channels = 0; -+ -+ if (!(ext->dwChannelMask & (SPEAKER_ALL | SPEAKER_RESERVED))) { -+ for (i = 1; !(i & SPEAKER_RESERVED); i <<= 1) { -+ if (i & ext->dwChannelMask) { -+ mask |= i; -+ channels++; -+ } -+ } -+ -+ if (channels != fmt->nChannels || (ext->dwChannelMask & ~mask)) { -+ hr = AUDCLNT_E_UNSUPPORTED_FORMAT; -+ break; - } -+ } else { -+ hr = AUDCLNT_E_UNSUPPORTED_FORMAT; -+ break; - } -- if (channels < fmt->nChannels) -- mask = get_channel_mask(fmt->nChannels); -- } else -- mask = ext->dwChannelMask; -- if (ext->dwChannelMask != mask) { -- ext->dwChannelMask = mask; -- hr = S_FALSE; - } -+ -+ if (IsEqualGUID(&ext->SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT)) { -+ if (fmt->wBitsPerSample != 32) { -+ hr = E_INVALIDARG; -+ break; -+ } -+ -+ if (ext->Samples.wValidBitsPerSample != fmt->wBitsPerSample) { -+ hr = S_FALSE; -+ ext->Samples.wValidBitsPerSample = fmt->wBitsPerSample; -+ } -+ } else if (IsEqualGUID(&ext->SubFormat, &KSDATAFORMAT_SUBTYPE_PCM)) { -+ if (!fmt->wBitsPerSample || fmt->wBitsPerSample > 32 || fmt->wBitsPerSample % 8) { -+ hr = E_INVALIDARG; -+ break; -+ } -+ -+ if (ext->Samples.wValidBitsPerSample != fmt->wBitsPerSample && -+ !(fmt->wBitsPerSample == 32 && -+ ext->Samples.wValidBitsPerSample == 24)) { -+ hr = S_FALSE; -+ ext->Samples.wValidBitsPerSample = fmt->wBitsPerSample; -+ break; -+ } -+ } else { -+ hr = AUDCLNT_E_UNSUPPORTED_FORMAT; -+ break; -+ } -+ -+ break; - } - -- if (fmt->nBlockAlign != fmt->nChannels * fmt->wBitsPerSample / 8 || -- fmt->nAvgBytesPerSec != fmt->nBlockAlign * fmt->nSamplesPerSec) -- hr = S_FALSE; -+ case WAVE_FORMAT_ALAW: -+ case WAVE_FORMAT_MULAW: -+ if (fmt->wBitsPerSample != 8) { -+ hr = E_INVALIDARG; -+ break; -+ } -+ /* Fall-through */ -+ case WAVE_FORMAT_IEEE_FLOAT: -+ if (fmt->wFormatTag == WAVE_FORMAT_IEEE_FLOAT && fmt->wBitsPerSample != 32) { -+ hr = E_INVALIDARG; -+ break; -+ } -+ /* Fall-through */ -+ case WAVE_FORMAT_PCM: -+ if (fmt->wFormatTag == WAVE_FORMAT_PCM && -+ (!fmt->wBitsPerSample || fmt->wBitsPerSample > 32 || fmt->wBitsPerSample % 8)) { -+ hr = E_INVALIDARG; -+ break; -+ } -+ -+ if (fmt->nChannels > 2) { -+ hr = AUDCLNT_E_UNSUPPORTED_FORMAT; -+ break; -+ } -+ /* -+ * fmt->cbSize, fmt->nBlockAlign and fmt->nAvgBytesPerSec seem to be -+ * ignored, invalid values are happily accepted. -+ */ -+ break; -+ default: -+ hr = AUDCLNT_E_UNSUPPORTED_FORMAT; -+ break; -+ } - -- if (hr == S_OK || !out) { -+ if (exclusive && hr != S_OK) { -+ hr = AUDCLNT_E_UNSUPPORTED_FORMAT; - CoTaskMemFree(closest); -- if (out) -- *out = NULL; -- } else if (closest) { -- closest->nBlockAlign = -- closest->nChannels * closest->wBitsPerSample / 8; -- closest->nAvgBytesPerSec = -- closest->nBlockAlign * closest->nSamplesPerSec; -+ } else if (hr != S_FALSE) -+ CoTaskMemFree(closest); -+ else - *out = closest; -- } -+ -+ /* Winepulse does not currently support exclusive mode, if you know of an -+ * application that uses it, I will correct this.. -+ */ -+ if (hr == S_OK && exclusive) -+ return This->dataflow == eCapture ? AUDCLNT_E_UNSUPPORTED_FORMAT : AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED; - - TRACE("returning: %08x %p\n", hr, out ? *out : NULL); - return hr; --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0028-winepulse-v21-return-early-if-padding-didn-t-update.patch wine1.7-1.7.55/debian/patches/0028-winepulse-v21-return-early-if-padding-didn-t-update.patch --- wine1.7-1.7.50/debian/patches/0028-winepulse-v21-return-early-if-padding-didn-t-update.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0028-winepulse-v21-return-early-if-padding-didn-t-update.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -From 1f08f1a02a6e4667fba601486628bba8ac73d360 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:31 +0100 -Subject: [PATCH 28/50] winepulse v21: return early if padding didn't update - ---- - dlls/winepulse.drv/mmdevdrv.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index 554a9fc..a4575d5 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -531,7 +531,10 @@ static void pulse_wr_callback(pa_stream *s, size_t bytes, void *userdata) - else - This->pad = 0; - -- assert(oldpad >= This->pad); -+ if (oldpad == This->pad) -+ return; -+ -+ assert(oldpad > This->pad); - - This->clock_written += oldpad - This->pad; - TRACE("New pad: %zu (-%zu)\n", This->pad / pa_frame_size(&This->ss), (oldpad - This->pad) / pa_frame_size(&This->ss)); --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0029-winepulse-fix-unneeded-free-in-write.patch wine1.7-1.7.55/debian/patches/0029-winepulse-fix-unneeded-free-in-write.patch --- wine1.7-1.7.50/debian/patches/0029-winepulse-fix-unneeded-free-in-write.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0029-winepulse-fix-unneeded-free-in-write.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -From 20987fa169207ec1808f265c34c9c796a55fe807 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:31 +0100 -Subject: [PATCH 29/50] winepulse: fix unneeded free in write.. - ---- - dlls/winepulse.drv/mmdevdrv.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index a4575d5..3ca68fd 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -1886,6 +1886,10 @@ static HRESULT WINAPI AudioRenderClient_GetBuffer(IAudioRenderClient *iface, - return hr; - } - -+static void pulse_free_noop(void *buf) -+{ -+} -+ - static HRESULT WINAPI AudioRenderClient_ReleaseBuffer( - IAudioRenderClient *iface, UINT32 written_frames, DWORD flags) - { -@@ -1921,7 +1925,7 @@ static HRESULT WINAPI AudioRenderClient_ReleaseBuffer( - if (This->locked_ptr) - pa_stream_write(This->stream, This->locked_ptr, written_bytes, NULL, 0, PA_SEEK_RELATIVE); - else -- pa_stream_write(This->stream, This->tmp_buffer, written_bytes, NULL, 0, PA_SEEK_RELATIVE); -+ pa_stream_write(This->stream, This->tmp_buffer, written_bytes, pulse_free_noop, 0, PA_SEEK_RELATIVE); - This->pad += written_bytes; - This->locked_ptr = NULL; - TRACE("Released %u, pad %zu\n", written_frames, This->pad / pa_frame_size(&This->ss)); --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0030-winepulse-v23-fixup-a-invalid-free-in-mmdevapi.patch wine1.7-1.7.55/debian/patches/0030-winepulse-v23-fixup-a-invalid-free-in-mmdevapi.patch --- wine1.7-1.7.50/debian/patches/0030-winepulse-v23-fixup-a-invalid-free-in-mmdevapi.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0030-winepulse-v23-fixup-a-invalid-free-in-mmdevapi.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -From 1bdfb52f351de248aae9a20c4e5811b04709c4a8 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:31 +0100 -Subject: [PATCH 30/50] winepulse v23: fixup a invalid free in mmdevapi - -array members of ids should be dynamically allocated, judging from valgrind output. ---- - dlls/winepulse.drv/mmdevdrv.c | 12 ++++++++++-- - 1 file changed, 10 insertions(+), 2 deletions(-) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index 3ca68fd..5b041a2 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -726,6 +726,8 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, const WCHAR ***ids, GUID ** - UINT *num, UINT *def_index) - { - HRESULT hr = S_OK; -+ WCHAR *id; -+ - TRACE("%d %p %p %p\n", flow, ids, num, def_index); - - pthread_mutex_lock(&pulse_lock); -@@ -737,16 +739,22 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, const WCHAR ***ids, GUID ** - *def_index = 0; - - *ids = HeapAlloc(GetProcessHeap(), 0, sizeof(**ids)); -+ *keys = NULL; - if (!*ids) - return E_OUTOFMEMORY; -- (*ids)[0] = defaultW; - -+ (*ids)[0] = id = HeapAlloc(GetProcessHeap(), 0, sizeof(defaultW)); - *keys = HeapAlloc(GetProcessHeap(), 0, sizeof(**keys)); -- if (!*keys) { -+ if (!*keys || !id) { -+ HeapFree(GetProcessHeap(), 0, id); -+ HeapFree(GetProcessHeap(), 0, *keys); - HeapFree(GetProcessHeap(), 0, *ids); - *ids = NULL; -+ *keys = NULL; - return E_OUTOFMEMORY; - } -+ memcpy(id, defaultW, sizeof(defaultW)); -+ - if (flow == eRender) - (*keys)[0] = pulse_render_guid; - else --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0031-winepulse-use-a-pi-mutex-for-serialization.patch wine1.7-1.7.55/debian/patches/0031-winepulse-use-a-pi-mutex-for-serialization.patch --- wine1.7-1.7.50/debian/patches/0031-winepulse-use-a-pi-mutex-for-serialization.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0031-winepulse-use-a-pi-mutex-for-serialization.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -From 4e84b580df63aef41352bb9ad2a458c30cb69bb3 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:32 +0100 -Subject: [PATCH 31/50] winepulse: use a pi-mutex for serialization. - -The winepulse thread is realtime, to prevent blocking it indefinitely -use priority inheritance. Only initialize and release are potentially -unsafe, the rest should be ok with -rt. ---- - dlls/winepulse.drv/mmdevdrv.c | 13 ++++++++++++- - 1 file changed, 12 insertions(+), 1 deletion(-) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index 5b041a2..a09ce7f 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -22,6 +22,8 @@ - - #define NONAMELESSUNION - #define COBJMACROS -+#define _GNU_SOURCE -+ - #include "config.h" - #include - #include -@@ -30,6 +32,7 @@ - #include - #include - #include -+#include - - #include - -@@ -68,7 +71,7 @@ static pa_context *pulse_ctx; - static pa_mainloop *pulse_ml; - - static HANDLE pulse_thread; --static pthread_mutex_t pulse_lock = PTHREAD_MUTEX_INITIALIZER; -+static pthread_mutex_t pulse_lock; - static pthread_cond_t pulse_cond = PTHREAD_COND_INITIALIZER; - static struct list g_sessions = LIST_INIT(g_sessions); - -@@ -93,6 +96,8 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved) - { - if (reason == DLL_PROCESS_ATTACH) { - HKEY key; -+ pthread_mutexattr_t attr; -+ - if (RegOpenKeyW(HKEY_CURRENT_USER, pulse_keyW, &key) == ERROR_SUCCESS) { - DWORD size = sizeof(pulse_stream_volume); - RegQueryValueExW(key, pulse_streamW, 0, NULL, -@@ -100,6 +105,12 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved) - RegCloseKey(key); - } - DisableThreadLibraryCalls(dll); -+ -+ pthread_mutexattr_init(&attr); -+ pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT); -+ -+ if (pthread_mutex_init(&pulse_lock, &attr) != 0) -+ pthread_mutex_init(&pulse_lock, NULL); - } else if (reason == DLL_PROCESS_DETACH) { - if (pulse_thread) - SetThreadPriority(pulse_thread, 0); --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0032-winepulse-add-support-for-IMarshal.patch wine1.7-1.7.55/debian/patches/0032-winepulse-add-support-for-IMarshal.patch --- wine1.7-1.7.50/debian/patches/0032-winepulse-add-support-for-IMarshal.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0032-winepulse-add-support-for-IMarshal.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,137 +0,0 @@ -From bf39baf86e201efcf284bf238703a0b106a08a1f Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:32 +0100 -Subject: [PATCH 32/50] winepulse: add support for IMarshal - -Fixes bug 32161 for winepulse. Based On Jeff Klein's patches for the -other drivers. ---- - dlls/winepulse.drv/mmdevdrv.c | 31 +++++++++++++++++++++++++++++++ - 1 file changed, 31 insertions(+) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index a09ce7f..f052a08 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -169,6 +169,7 @@ struct ACImpl { - IAudioClock IAudioClock_iface; - IAudioClock2 IAudioClock2_iface; - IAudioStreamVolume IAudioStreamVolume_iface; -+ IUnknown *marshal; - IMMDevice *parent; - struct list entry; - float vol[PA_CHANNELS_MAX]; -@@ -834,6 +835,12 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev, IAudioClient - This->parent = dev; - for (i = 0; i < PA_CHANNELS_MAX; ++i) - This->vol[i] = 1.f; -+ -+ hr = CoCreateFreeThreadedMarshaler((IUnknown*)This, &This->marshal); -+ if (hr) { -+ HeapFree(GetProcessHeap(), 0, This); -+ return hr; -+ } - IMMDevice_AddRef(This->parent); - - *out = &This->IAudioClient_iface; -@@ -845,10 +852,13 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev, IAudioClient - static HRESULT WINAPI AudioClient_QueryInterface(IAudioClient *iface, - REFIID riid, void **ppv) - { -+ ACImpl *This = impl_from_IAudioClient(iface); -+ - TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); - - if (!ppv) - return E_POINTER; -+ - *ppv = NULL; - if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IAudioClient)) - *ppv = iface; -@@ -856,6 +866,10 @@ static HRESULT WINAPI AudioClient_QueryInterface(IAudioClient *iface, - IUnknown_AddRef((IUnknown*)*ppv); - return S_OK; - } -+ -+ if (IsEqualIID(riid, &IID_IMarshal)) -+ return IUnknown_QueryInterface(This->marshal, riid, ppv); -+ - WARN("Unknown interface %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; - } -@@ -888,6 +902,7 @@ static ULONG WINAPI AudioClient_Release(IAudioClient *iface) - list_remove(&This->entry); - pthread_mutex_unlock(&pulse_lock); - } -+ IUnknown_Release(This->marshal); - IMMDevice_Release(This->parent); - HeapFree(GetProcessHeap(), 0, This->tmp_buffer); - HeapFree(GetProcessHeap(), 0, This); -@@ -1826,6 +1841,7 @@ static const IAudioClientVtbl AudioClient_Vtbl = - static HRESULT WINAPI AudioRenderClient_QueryInterface( - IAudioRenderClient *iface, REFIID riid, void **ppv) - { -+ ACImpl *This = impl_from_IAudioRenderClient(iface); - TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); - - if (!ppv) -@@ -1840,6 +1856,9 @@ static HRESULT WINAPI AudioRenderClient_QueryInterface( - return S_OK; - } - -+ if (IsEqualIID(riid, &IID_IMarshal)) -+ return IUnknown_QueryInterface(This->marshal, riid, ppv); -+ - WARN("Unknown interface %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; - } -@@ -1969,6 +1988,7 @@ static const IAudioRenderClientVtbl AudioRenderClient_Vtbl = { - static HRESULT WINAPI AudioCaptureClient_QueryInterface( - IAudioCaptureClient *iface, REFIID riid, void **ppv) - { -+ ACImpl *This = impl_from_IAudioCaptureClient(iface); - TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); - - if (!ppv) -@@ -1983,6 +2003,9 @@ static HRESULT WINAPI AudioCaptureClient_QueryInterface( - return S_OK; - } - -+ if (IsEqualIID(riid, &IID_IMarshal)) -+ return IUnknown_QueryInterface(This->marshal, riid, ppv); -+ - WARN("Unknown interface %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; - } -@@ -2125,6 +2148,9 @@ static HRESULT WINAPI AudioClock_QueryInterface(IAudioClock *iface, - return S_OK; - } - -+ if (IsEqualIID(riid, &IID_IMarshal)) -+ return IUnknown_QueryInterface(This->marshal, riid, ppv); -+ - WARN("Unknown interface %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; - } -@@ -2260,6 +2286,8 @@ static const IAudioClock2Vtbl AudioClock2_Vtbl = - static HRESULT WINAPI AudioStreamVolume_QueryInterface( - IAudioStreamVolume *iface, REFIID riid, void **ppv) - { -+ ACImpl *This = impl_from_IAudioStreamVolume(iface); -+ - TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); - - if (!ppv) -@@ -2274,6 +2302,9 @@ static HRESULT WINAPI AudioStreamVolume_QueryInterface( - return S_OK; - } - -+ if (IsEqualIID(riid, &IID_IMarshal)) -+ return IUnknown_QueryInterface(This->marshal, riid, ppv); -+ - WARN("Unknown interface %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; - } --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0033-winepulse-handle-stream-create-failing-correctly.patch wine1.7-1.7.55/debian/patches/0033-winepulse-handle-stream-create-failing-correctly.patch --- wine1.7-1.7.50/debian/patches/0033-winepulse-handle-stream-create-failing-correctly.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0033-winepulse-handle-stream-create-failing-correctly.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -From b5e67ccfd3fb3178f981bc715f280c512f241dec Mon Sep 17 00:00:00 2001 -From: Mark Harmstone -Date: Mon, 23 Mar 2015 09:14:32 +0100 -Subject: [PATCH 33/50] winepulse: handle stream create failing correctly - ---- - dlls/winepulse.drv/mmdevdrv.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index f052a08..e755e8a 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -701,6 +701,12 @@ static HRESULT pulse_stream_connect(ACImpl *This, UINT32 period_bytes) { - ret = InterlockedIncrement(&number); - sprintf(buffer, "audio stream #%i", ret); - This->stream = pa_stream_new(pulse_ctx, buffer, &This->ss, &This->map); -+ -+ if (!This->stream) { -+ WARN("pa_stream_new returned error %i\n", pa_context_errno(pulse_ctx)); -+ return AUDCLNT_E_ENDPOINT_CREATE_FAILED; -+ } -+ - pa_stream_set_state_callback(This->stream, pulse_stream_state, This); - pa_stream_set_buffer_attr_callback(This->stream, pulse_attr_update, This); - pa_stream_set_moved_callback(This->stream, pulse_attr_update, This); --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0034-winepulse-Trivial-cleanups-and-changes-for-consisten.patch wine1.7-1.7.55/debian/patches/0034-winepulse-Trivial-cleanups-and-changes-for-consisten.patch --- wine1.7-1.7.50/debian/patches/0034-winepulse-Trivial-cleanups-and-changes-for-consisten.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0034-winepulse-Trivial-cleanups-and-changes-for-consisten.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,206 +0,0 @@ -From 876b5be4ce2e45e53be9520fa358b22e5039d90c Mon Sep 17 00:00:00 2001 -From: Andrew Eikum -Date: Mon, 23 Mar 2015 09:14:32 +0100 -Subject: [PATCH 34/50] winepulse: Trivial cleanups and changes for consistency - with other drivers - -Removes some C++ comments, the FIXME's and fixes indent some. ---- - dlls/winepulse.drv/mmdevdrv.c | 86 +++++++++++++++++-------------------------- - 1 file changed, 33 insertions(+), 53 deletions(-) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index e755e8a..62d040a 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -16,8 +16,6 @@ - * 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 -- * -- * Pulseaudio driver support.. hell froze over - */ - - #define NONAMELESSUNION -@@ -62,7 +60,14 @@ - #define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER) - - WINE_DEFAULT_DEBUG_CHANNEL(pulse); --WINE_DECLARE_DEBUG_CHANNEL(winediag); -+ -+/* From */ -+enum DriverPriority { -+ Priority_Unavailable = 0, -+ Priority_Low, -+ Priority_Neutral, -+ Priority_Preferred -+}; - - static const REFERENCE_TIME MinimumPeriod = 30000; - static const REFERENCE_TIME DefaultPeriod = 100000; -@@ -90,8 +95,6 @@ static GUID pulse_render_guid = - static GUID pulse_capture_guid = - { 0x25da76d0, 0x033c, 0x4235, { 0x90, 0x02, 0x19, 0xf4, 0x88, 0x94, 0xac, 0x6f } }; - --static HANDLE warn_once; -- - BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved) - { - if (reason == DLL_PROCESS_ATTACH) { -@@ -122,8 +125,6 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved) - pa_mainloop_quit(pulse_ml, 0); - if (pulse_thread) - CloseHandle(pulse_thread); -- if (warn_once) -- CloseHandle(warn_once); - } - return TRUE; - } -@@ -507,6 +508,11 @@ static HRESULT pulse_stream_valid(ACImpl *This) { - return S_OK; - } - -+static void silence_buffer(pa_sample_format_t format, BYTE *buffer, UINT32 bytes) -+{ -+ memset(buffer, format == PA_SAMPLE_U8 ? 0x80 : 0, bytes); -+} -+ - static void dump_attr(const pa_buffer_attr *attr) { - TRACE("maxlength: %u\n", attr->maxlength); - TRACE("minreq: %u\n", attr->minreq); -@@ -784,14 +790,10 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, const WCHAR ***ids, GUID ** - int WINAPI AUDDRV_GetPriority(void) - { - HRESULT hr; -- if (getenv("WINENOPULSE")) { -- FIXME_(winediag)("winepulse has been temporarily disabled through the environment\n"); -- return 0; -- } - pthread_mutex_lock(&pulse_lock); - hr = pulse_connect(); - pthread_mutex_unlock(&pulse_lock); -- return SUCCEEDED(hr) ? 3 : 0; -+ return SUCCEEDED(hr) ? Priority_Preferred : Priority_Unavailable; - } - - HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev, IAudioClient **out) -@@ -801,17 +803,6 @@ HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev, IAudioClient - int i; - EDataFlow dataflow; - -- /* Give one visible warning per session -- * Sadly wine has chosen not to accept the winepulse patch, so support ourselves -- */ -- if (!warn_once && (warn_once = CreateEventA(0, 0, 0, "__winepulse_warn_event")) && GetLastError() != ERROR_ALREADY_EXISTS) { -- FIXME_(winediag)("Winepulse is not officially supported by the wine project\n"); -- FIXME_(winediag)("For sound related feedback and support, please visit http://ubuntuforums.org/showthread.php?t=1960599\n"); -- } else { -- WARN_(winediag)("Winepulse is not officially supported by the wine project\n"); -- WARN_(winediag)("For sound related feedback and support, please visit http://ubuntuforums.org/showthread.php?t=1960599\n"); -- } -- - TRACE("%s %p %p\n", debugstr_guid(guid), dev, out); - if (IsEqualGUID(guid, &pulse_render_guid)) - dataflow = eRender; -@@ -1165,22 +1156,22 @@ static HRESULT pulse_spec_from_waveformat(ACImpl *This, const WAVEFORMATEX *fmt) - } - break; - } -- case WAVE_FORMAT_ALAW: -- case WAVE_FORMAT_MULAW: -- if (fmt->wBitsPerSample != 8) { -- FIXME("Unsupported bpp %u for LAW\n", fmt->wBitsPerSample); -- return AUDCLNT_E_UNSUPPORTED_FORMAT; -- } -- if (fmt->nChannels != 1 && fmt->nChannels != 2) { -- FIXME("Unsupported channels %u for LAW\n", fmt->nChannels); -- return AUDCLNT_E_UNSUPPORTED_FORMAT; -- } -- This->ss.format = fmt->wFormatTag == WAVE_FORMAT_MULAW ? PA_SAMPLE_ULAW : PA_SAMPLE_ALAW; -- pa_channel_map_init_auto(&This->map, fmt->nChannels, PA_CHANNEL_MAP_ALSA); -- break; -- default: -- WARN("Unhandled tag %x\n", fmt->wFormatTag); -+ case WAVE_FORMAT_ALAW: -+ case WAVE_FORMAT_MULAW: -+ if (fmt->wBitsPerSample != 8) { -+ FIXME("Unsupported bpp %u for LAW\n", fmt->wBitsPerSample); -+ return AUDCLNT_E_UNSUPPORTED_FORMAT; -+ } -+ if (fmt->nChannels != 1 && fmt->nChannels != 2) { -+ FIXME("Unsupported channels %u for LAW\n", fmt->nChannels); - return AUDCLNT_E_UNSUPPORTED_FORMAT; -+ } -+ This->ss.format = fmt->wFormatTag == WAVE_FORMAT_MULAW ? PA_SAMPLE_ULAW : PA_SAMPLE_ALAW; -+ pa_channel_map_init_auto(&This->map, fmt->nChannels, PA_CHANNEL_MAP_ALSA); -+ break; -+ default: -+ WARN("Unhandled tag %x\n", fmt->wFormatTag); -+ return AUDCLNT_E_UNSUPPORTED_FORMAT; - } - This->ss.channels = This->map.channels; - if (!pa_channel_map_valid(&This->map) || This->ss.format == PA_SAMPLE_INVALID) { -@@ -1287,7 +1278,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface, - else { - ACPacket *cur_packet = (ACPacket*)((char*)This->tmp_buffer + This->bufsize_bytes); - BYTE *data = This->tmp_buffer; -- memset(This->tmp_buffer, This->ss.format == PA_SAMPLE_U8 ? 0x80 : 0, This->bufsize_bytes); -+ silence_buffer(This->ss.format, This->tmp_buffer, This->bufsize_bytes); - list_init(&This->packet_free_head); - list_init(&This->packet_filled_head); - for (i = 0; i < capture_packets; ++i, ++cur_packet) { -@@ -1939,7 +1930,6 @@ static HRESULT WINAPI AudioRenderClient_ReleaseBuffer( - { - ACImpl *This = impl_from_IAudioRenderClient(iface); - UINT32 written_bytes = written_frames * pa_frame_size(&This->ss); --// UINT32 period; - - TRACE("(%p)->(%u, %x)\n", This, written_frames, flags); - -@@ -1958,12 +1948,8 @@ static HRESULT WINAPI AudioRenderClient_ReleaseBuffer( - return AUDCLNT_E_INVALID_SIZE; - } - -- if (flags & AUDCLNT_BUFFERFLAGS_SILENT) { -- if (This->ss.format == PA_SAMPLE_U8) -- memset(This->tmp_buffer, 128, written_bytes); -- else -- memset(This->tmp_buffer, 0, written_bytes); -- } -+ if (flags & AUDCLNT_BUFFERFLAGS_SILENT) -+ silence_buffer(This->ss.format, This->tmp_buffer, written_bytes); - - This->locked = 0; - if (This->locked_ptr) -@@ -1975,10 +1961,6 @@ static HRESULT WINAPI AudioRenderClient_ReleaseBuffer( - TRACE("Released %u, pad %zu\n", written_frames, This->pad / pa_frame_size(&This->ss)); - assert(This->pad <= This->bufsize_bytes); - --// period = pa_stream_get_buffer_attr(This->stream)->minreq; -- /* Require a minimum of 3 periods filled, if possible */ --// if (This->event && This->pad + period <= This->bufsize_bytes && This->pad < period * 3) --// SetEvent(This->event); - pthread_mutex_unlock(&pulse_lock); - return S_OK; - } -@@ -2107,7 +2089,6 @@ static HRESULT WINAPI AudioCaptureClient_GetNextPacketSize( - IAudioCaptureClient *iface, UINT32 *frames) - { - ACImpl *This = impl_from_IAudioCaptureClient(iface); -- ACPacket *p; - - TRACE("(%p)->(%p)\n", This, frames); - if (!frames) -@@ -2115,8 +2096,7 @@ static HRESULT WINAPI AudioCaptureClient_GetNextPacketSize( - - pthread_mutex_lock(&pulse_lock); - ACImpl_GetCapturePad(This, NULL); -- p = This->locked_ptr; -- if (p) -+ if (This->locked_ptr) - *frames = This->capture_period / pa_frame_size(&This->ss); - else - *frames = 0; --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0035-winepulse-Sync-default-channel-masks-with-other-driv.patch wine1.7-1.7.55/debian/patches/0035-winepulse-Sync-default-channel-masks-with-other-driv.patch --- wine1.7-1.7.50/debian/patches/0035-winepulse-Sync-default-channel-masks-with-other-driv.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0035-winepulse-Sync-default-channel-masks-with-other-driv.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -From 1b6d3a8a505c7d77312740bc883086ca11ebec65 Mon Sep 17 00:00:00 2001 -From: Andrew Eikum -Date: Mon, 23 Mar 2015 09:14:32 +0100 -Subject: [PATCH 35/50] winepulse: Sync default channel masks with other - drivers - ---- - dlls/winepulse.drv/mmdevdrv.c | 26 +++++++++----------------- - 1 file changed, 9 insertions(+), 17 deletions(-) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index 62d040a..1ef2ea2 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -964,33 +964,25 @@ static WAVEFORMATEX *clone_format(const WAVEFORMATEX *fmt) - - static DWORD get_channel_mask(unsigned int channels) - { -- switch(channels) { -+ switch(channels){ - case 0: - return 0; - case 1: -- return SPEAKER_FRONT_CENTER; -+ return KSAUDIO_SPEAKER_MONO; - case 2: -- return SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT; -+ return KSAUDIO_SPEAKER_STEREO; - case 3: -- return SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | -- SPEAKER_LOW_FREQUENCY; -+ return KSAUDIO_SPEAKER_STEREO | SPEAKER_LOW_FREQUENCY; - case 4: -- return SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | -- SPEAKER_BACK_RIGHT; -+ return KSAUDIO_SPEAKER_QUAD; /* not _SURROUND */ - case 5: -- return SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | -- SPEAKER_BACK_RIGHT | SPEAKER_LOW_FREQUENCY; -+ return KSAUDIO_SPEAKER_QUAD | SPEAKER_LOW_FREQUENCY; - case 6: -- return SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | -- SPEAKER_BACK_RIGHT | SPEAKER_LOW_FREQUENCY | SPEAKER_FRONT_CENTER; -+ return KSAUDIO_SPEAKER_5POINT1; /* not 5POINT1_SURROUND */ - case 7: -- return SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | -- SPEAKER_BACK_RIGHT | SPEAKER_LOW_FREQUENCY | SPEAKER_FRONT_CENTER | -- SPEAKER_BACK_CENTER; -+ return KSAUDIO_SPEAKER_5POINT1 | SPEAKER_BACK_CENTER; - case 8: -- return SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | -- SPEAKER_BACK_RIGHT | SPEAKER_LOW_FREQUENCY | SPEAKER_FRONT_CENTER | -- SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT; -+ return KSAUDIO_SPEAKER_7POINT1_SURROUND; /* Vista deprecates 7POINT1 */ - } - FIXME("Unknown speaker configuration: %u\n", channels); - return 0; --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0036-winepulse-In-Shared-mode-track-device-position-in-by.patch wine1.7-1.7.55/debian/patches/0036-winepulse-In-Shared-mode-track-device-position-in-by.patch --- wine1.7-1.7.50/debian/patches/0036-winepulse-In-Shared-mode-track-device-position-in-by.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0036-winepulse-In-Shared-mode-track-device-position-in-by.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -From f0f0c2c65c58717ac1074130ad4b0e1d21d841a0 Mon Sep 17 00:00:00 2001 -From: Andrew Eikum -Date: Mon, 23 Mar 2015 09:14:32 +0100 -Subject: [PATCH 36/50] winepulse: In Shared mode, track device position in - bytes - ---- - dlls/winepulse.drv/mmdevdrv.c | 13 ++++++++++--- - 1 file changed, 10 insertions(+), 3 deletions(-) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index 1ef2ea2..3463cd8 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -2154,8 +2154,12 @@ static HRESULT WINAPI AudioClock_GetFrequency(IAudioClock *iface, UINT64 *freq) - - pthread_mutex_lock(&pulse_lock); - hr = pulse_stream_valid(This); -- if (SUCCEEDED(hr)) -- *freq = This->ss.rate * pa_frame_size(&This->ss); -+ if (SUCCEEDED(hr)) { -+ if (This->share == AUDCLNT_SHAREMODE_SHARED) -+ *freq = This->ss.rate * pa_frame_size(&This->ss); -+ else -+ *freq = This->ss.rate; -+ } - pthread_mutex_unlock(&pulse_lock); - return hr; - } -@@ -2180,6 +2184,9 @@ static HRESULT WINAPI AudioClock_GetPosition(IAudioClock *iface, UINT64 *pos, - - *pos = This->clock_written; - -+ if (This->share == AUDCLNT_SHAREMODE_EXCLUSIVE) -+ *pos /= pa_frame_size(&This->ss); -+ - /* Make time never go backwards */ - if (*pos < This->clock_lastpos) - *pos = This->clock_lastpos; -@@ -2248,7 +2255,7 @@ static HRESULT WINAPI AudioClock2_GetDevicePosition(IAudioClock2 *iface, - { - ACImpl *This = impl_from_IAudioClock2(iface); - HRESULT hr = AudioClock_GetPosition(&This->IAudioClock_iface, pos, qpctime); -- if (SUCCEEDED(hr)) -+ if (SUCCEEDED(hr) && This->share == AUDCLNT_SHAREMODE_SHARED) - *pos /= pa_frame_size(&This->ss); - return hr; - } --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0037-winepulse-Always-mute-buffer.patch wine1.7-1.7.55/debian/patches/0037-winepulse-Always-mute-buffer.patch --- wine1.7-1.7.50/debian/patches/0037-winepulse-Always-mute-buffer.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0037-winepulse-Always-mute-buffer.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -From 18df21a989975af3fbaaeaee6fc14d7a172052fe Mon Sep 17 00:00:00 2001 -From: Andrew Eikum -Date: Mon, 23 Mar 2015 09:14:32 +0100 -Subject: [PATCH 37/50] winepulse: Always mute buffer - ---- - dlls/winepulse.drv/mmdevdrv.c | 13 ++++++++----- - 1 file changed, 8 insertions(+), 5 deletions(-) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index 3463cd8..ba38ab9 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -1940,14 +1940,17 @@ static HRESULT WINAPI AudioRenderClient_ReleaseBuffer( - return AUDCLNT_E_INVALID_SIZE; - } - -- if (flags & AUDCLNT_BUFFERFLAGS_SILENT) -- silence_buffer(This->ss.format, This->tmp_buffer, written_bytes); -- - This->locked = 0; -- if (This->locked_ptr) -+ if (This->locked_ptr) { -+ if (flags & AUDCLNT_BUFFERFLAGS_SILENT) -+ silence_buffer(This->ss.format, This->locked_ptr, written_bytes); - pa_stream_write(This->stream, This->locked_ptr, written_bytes, NULL, 0, PA_SEEK_RELATIVE); -- else -+ } else { -+ if (flags & AUDCLNT_BUFFERFLAGS_SILENT) -+ silence_buffer(This->ss.format, This->tmp_buffer, written_bytes); - pa_stream_write(This->stream, This->tmp_buffer, written_bytes, pulse_free_noop, 0, PA_SEEK_RELATIVE); -+ } -+ - This->pad += written_bytes; - This->locked_ptr = NULL; - TRACE("Released %u, pad %zu\n", written_frames, This->pad / pa_frame_size(&This->ss)); --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0038-winepulse-Remove-volume-support.patch wine1.7-1.7.55/debian/patches/0038-winepulse-Remove-volume-support.patch --- wine1.7-1.7.50/debian/patches/0038-winepulse-Remove-volume-support.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0038-winepulse-Remove-volume-support.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,166 +0,0 @@ -From ff589bfa26efd056aa3dc1328113a06670d46e62 Mon Sep 17 00:00:00 2001 -From: Andrew Eikum -Date: Mon, 23 Mar 2015 09:14:32 +0100 -Subject: [PATCH 38/50] winepulse: Remove volume support - -This was disabled by default, and a quick Google turned up no references -to anyone being told to set it. If no one's using it, let's just remove -it. ---- - dlls/winepulse.drv/mmdevdrv.c | 90 +++---------------------------------------- - 1 file changed, 6 insertions(+), 84 deletions(-) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index ba38ab9..063b1db 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -84,12 +84,6 @@ static struct list g_sessions = LIST_INIT(g_sessions); - static WAVEFORMATEXTENSIBLE pulse_fmt[2]; - static REFERENCE_TIME pulse_min_period[2], pulse_def_period[2]; - --static DWORD pulse_stream_volume; -- --const WCHAR pulse_keyW[] = {'S','o','f','t','w','a','r','e','\\', -- 'W','i','n','e','\\','P','u','l','s','e',0}; --const WCHAR pulse_streamW[] = { 'S','t','r','e','a','m','V','o','l',0 }; -- - static GUID pulse_render_guid = - { 0xfd47d9cc, 0x4218, 0x4135, { 0x9c, 0xe2, 0x0c, 0x19, 0x5c, 0x87, 0x40, 0x5b } }; - static GUID pulse_capture_guid = -@@ -98,15 +92,8 @@ static GUID pulse_capture_guid = - BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved) - { - if (reason == DLL_PROCESS_ATTACH) { -- HKEY key; - pthread_mutexattr_t attr; - -- if (RegOpenKeyW(HKEY_CURRENT_USER, pulse_keyW, &key) == ERROR_SUCCESS) { -- DWORD size = sizeof(pulse_stream_volume); -- RegQueryValueExW(key, pulse_streamW, 0, NULL, -- (BYTE*)&pulse_stream_volume, &size); -- RegCloseKey(key); -- } - DisableThreadLibraryCalls(dll); - - pthread_mutexattr_init(&attr); -@@ -527,12 +514,6 @@ static void pulse_op_cb(pa_stream *s, int success, void *user) { - pthread_cond_signal(&pulse_cond); - } - --static void pulse_ctx_op_cb(pa_context *c, int success, void *user) { -- TRACE("Success: %i\n", success); -- *(int*)user = success; -- pthread_cond_signal(&pulse_cond); --} -- - static void pulse_attr_update(pa_stream *s, void *user) { - const pa_buffer_attr *attr = pa_stream_get_buffer_attr(s); - TRACE("New attributes or device moved:\n"); -@@ -2329,36 +2310,12 @@ struct pulse_info_cb_data { - float *levels; - }; - --static void pulse_sink_input_info_cb(pa_context *c, const pa_sink_input_info *info, int eol, void *data) --{ -- struct pulse_info_cb_data *d = data; -- int i; -- if (eol) -- return; -- for (i = 0; i < d->n; ++i) -- d->levels[i] = (float)info->volume.values[i] / (float)PA_VOLUME_NORM; -- pthread_cond_signal(&pulse_cond); --} -- --static void pulse_source_info_cb(pa_context *c, const pa_source_info *info, int eol, void *data) --{ -- struct pulse_info_cb_data *d = data; -- int i; -- if (eol) -- return; -- for (i = 0; i < d->n; ++i) -- d->levels[i] = (float)info->volume.values[i] / (float)PA_VOLUME_NORM; -- pthread_cond_signal(&pulse_cond); --} -- - static HRESULT WINAPI AudioStreamVolume_SetAllVolumes( - IAudioStreamVolume *iface, UINT32 count, const float *levels) - { - ACImpl *This = impl_from_IAudioStreamVolume(iface); -- pa_operation *o; - HRESULT hr; -- int success = 0, i; -- pa_cvolume cv; -+ int i; - - TRACE("(%p)->(%d, %p)\n", This, count, levels); - -@@ -2373,26 +2330,8 @@ static HRESULT WINAPI AudioStreamVolume_SetAllVolumes( - if (FAILED(hr)) - goto out; - -- if (pulse_stream_volume) { -- cv.channels = count; -- for (i = 0; i < cv.channels; ++i) -- cv.values[i] = levels[i] * (float)PA_VOLUME_NORM; -- if (This->dataflow == eRender) -- o = pa_context_set_sink_input_volume(pulse_ctx, pa_stream_get_index(This->stream), &cv, pulse_ctx_op_cb, &success); -- else -- o = pa_context_set_source_volume_by_index(pulse_ctx, pa_stream_get_device_index(This->stream), &cv, pulse_ctx_op_cb, &success); -- if (o) { -- while(pa_operation_get_state(o) == PA_OPERATION_RUNNING) -- pthread_cond_wait(&pulse_cond, &pulse_lock); -- pa_operation_unref(o); -- } -- if (!success) -- hr = AUDCLNT_E_BUFFER_ERROR; -- } else { -- int i; -- for (i = 0; i < count; ++i) -- This->vol[i] = levels[i]; -- } -+ for (i = 0; i < count; ++i) -+ This->vol[i] = levels[i]; - - out: - pthread_mutex_unlock(&pulse_lock); -@@ -2403,9 +2342,8 @@ static HRESULT WINAPI AudioStreamVolume_GetAllVolumes( - IAudioStreamVolume *iface, UINT32 count, float *levels) - { - ACImpl *This = impl_from_IAudioStreamVolume(iface); -- pa_operation *o; - HRESULT hr; -- struct pulse_info_cb_data info; -+ int i; - - TRACE("(%p)->(%d, %p)\n", This, count, levels); - -@@ -2420,24 +2358,8 @@ static HRESULT WINAPI AudioStreamVolume_GetAllVolumes( - if (FAILED(hr)) - goto out; - -- if (pulse_stream_volume) { -- info.n = count; -- info.levels = levels; -- if (This->dataflow == eRender) -- o = pa_context_get_sink_input_info(pulse_ctx, pa_stream_get_index(This->stream), pulse_sink_input_info_cb, &info); -- else -- o = pa_context_get_source_info_by_index(pulse_ctx, pa_stream_get_device_index(This->stream), pulse_source_info_cb, &info); -- if (o) { -- while(pa_operation_get_state(o) == PA_OPERATION_RUNNING) -- pthread_cond_wait(&pulse_cond, &pulse_lock); -- pa_operation_unref(o); -- } else -- hr = AUDCLNT_E_BUFFER_ERROR; -- } else { -- int i; -- for (i = 0; i < count; ++i) -- levels[i] = This->vol[i]; -- } -+ for (i = 0; i < count; ++i) -+ levels[i] = This->vol[i]; - - out: - pthread_mutex_unlock(&pulse_lock); --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0039-winepulse-Forward-winmm-functions-to-winealsa.patch wine1.7-1.7.55/debian/patches/0039-winepulse-Forward-winmm-functions-to-winealsa.patch --- wine1.7-1.7.50/debian/patches/0039-winepulse-Forward-winmm-functions-to-winealsa.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0039-winepulse-Forward-winmm-functions-to-winealsa.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -From 62c1f8da2ff2fdb3403e33cbab388f3a7f664cc9 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:33 +0100 -Subject: [PATCH 39/50] winepulse: Forward winmm functions to winealsa - ---- - configure | 2 +- - configure.ac | 2 +- - dlls/winepulse.drv/Makefile.in | 1 + - dlls/winepulse.drv/winepulse.drv.spec | 5 +++++ - 4 files changed, 8 insertions(+), 2 deletions(-) - -diff --git a/configure b/configure -index 643a600..7f9c79e 100755 ---- a/configure -+++ b/configure -@@ -17751,7 +17751,7 @@ wine_fn_config_dll windowscodecs enable_windowscodecs clean,implib - wine_fn_config_test dlls/windowscodecs/tests windowscodecs_test - wine_fn_config_dll windowscodecsext enable_windowscodecsext implib - wine_fn_config_test dlls/windowscodecsext/tests windowscodecsext_test --wine_fn_config_dll winealsa.drv enable_winealsa_drv -+wine_fn_config_dll winealsa.drv enable_winealsa_drv implib - wine_fn_config_dll winecoreaudio.drv enable_winecoreaudio_drv - wine_fn_config_lib winecrt0 - wine_fn_config_dll wined3d enable_wined3d implib -diff --git a/configure.ac b/configure.ac -index 53d8b28..73bb972 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3372,7 +3372,7 @@ WINE_CONFIG_DLL(windowscodecs,,[clean,implib]) - WINE_CONFIG_TEST(dlls/windowscodecs/tests) - WINE_CONFIG_DLL(windowscodecsext,,[implib]) - WINE_CONFIG_TEST(dlls/windowscodecsext/tests) --WINE_CONFIG_DLL(winealsa.drv) -+WINE_CONFIG_DLL(winealsa.drv,,[implib]) - WINE_CONFIG_DLL(winecoreaudio.drv) - WINE_CONFIG_LIB(winecrt0) - WINE_CONFIG_DLL(wined3d,,[implib]) -diff --git a/dlls/winepulse.drv/Makefile.in b/dlls/winepulse.drv/Makefile.in -index 158bbc0..3428329 100644 ---- a/dlls/winepulse.drv/Makefile.in -+++ b/dlls/winepulse.drv/Makefile.in -@@ -1,5 +1,6 @@ - MODULE = winepulse.drv - IMPORTS = dxguid uuid winmm user32 advapi32 ole32 -+DELAYIMPORTS = winealsa.drv - EXTRALIBS = @PULSELIBS@ $(PTHREAD_LIBS) - EXTRAINCL = @PULSEINCL@ - -diff --git a/dlls/winepulse.drv/winepulse.drv.spec b/dlls/winepulse.drv/winepulse.drv.spec -index 612bf46..288de87 100644 ---- a/dlls/winepulse.drv/winepulse.drv.spec -+++ b/dlls/winepulse.drv/winepulse.drv.spec -@@ -3,3 +3,8 @@ - @ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs - @ stdcall -private GetAudioEndpoint(ptr ptr ptr) AUDDRV_GetAudioEndpoint - @ stdcall -private GetAudioSessionManager(ptr ptr) AUDDRV_GetAudioSessionManager -+ -+# WinMM driver functions -+@ stdcall -private DriverProc(long long long long long) winealsa.drv.DriverProc -+@ stdcall -private midMessage(long long long long long) winealsa.drv.midMessage -+@ stdcall -private modMessage(long long long long long) winealsa.drv.modMessage --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0040-winepulse-dump-format-in-initialize.patch wine1.7-1.7.55/debian/patches/0040-winepulse-dump-format-in-initialize.patch --- wine1.7-1.7.50/debian/patches/0040-winepulse-dump-format-in-initialize.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0040-winepulse-dump-format-in-initialize.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ -From 0c02f8fd88017d7979ece05d8fd08f9b11896102 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:33 +0100 -Subject: [PATCH 40/50] winepulse: dump format in initialize - ---- - dlls/winepulse.drv/mmdevdrv.c | 7 +++++-- - include/config.h.in | 6 ++++++ - 2 files changed, 11 insertions(+), 2 deletions(-) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index 063b1db..63ef9e6 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -945,7 +945,7 @@ static WAVEFORMATEX *clone_format(const WAVEFORMATEX *fmt) - - static DWORD get_channel_mask(unsigned int channels) - { -- switch(channels){ -+ switch(channels) { - case 0: - return 0; - case 1: -@@ -1053,6 +1053,7 @@ static HRESULT pulse_spec_from_waveformat(ACImpl *This, const WAVEFORMATEX *fmt) - pa_channel_map_init(&This->map); - This->ss.rate = fmt->nSamplesPerSec; - This->ss.format = PA_SAMPLE_INVALID; -+ - switch(fmt->wFormatTag) { - case WAVE_FORMAT_IEEE_FLOAT: - if (!fmt->nChannels || fmt->nChannels > 2 || fmt->wBitsPerSample != 32) -@@ -1149,7 +1150,6 @@ static HRESULT pulse_spec_from_waveformat(ACImpl *This, const WAVEFORMATEX *fmt) - This->ss.channels = This->map.channels; - if (!pa_channel_map_valid(&This->map) || This->ss.format == PA_SAMPLE_INVALID) { - ERR("Invalid format! Channel spec valid: %i, format: %i\n", pa_channel_map_valid(&This->map), This->ss.format); -- dump_fmt(fmt); - return AUDCLNT_E_UNSUPPORTED_FORMAT; - } - return S_OK; -@@ -1194,6 +1194,9 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface, - } - - hr = pulse_spec_from_waveformat(This, fmt); -+ TRACE("Obtaining format returns %08x\n", hr); -+ dump_fmt(fmt); -+ - if (FAILED(hr)) - goto exit; - -diff --git a/include/config.h.in b/include/config.h.in -index 0f435d1..5e999e2 100644 ---- a/include/config.h.in -+++ b/include/config.h.in -@@ -693,6 +693,12 @@ - /* Define to 1 if you have the header file. */ - #undef HAVE_PTHREAD_NP_H - -+/* Define if you have pulseaudio */ -+#undef HAVE_PULSEAUDIO -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_PULSE_PULSEAUDIO_H -+ - /* Define to 1 if you have the header file. */ - #undef HAVE_PWD_H - --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0041-winepulse-add-stub-for-GetPropValue.patch wine1.7-1.7.55/debian/patches/0041-winepulse-add-stub-for-GetPropValue.patch --- wine1.7-1.7.50/debian/patches/0041-winepulse-add-stub-for-GetPropValue.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0041-winepulse-add-stub-for-GetPropValue.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -From 6c1f88375fcd8d44381b877ce3c5a35fbe36e8d1 Mon Sep 17 00:00:00 2001 -From: Mark Harmstone -Date: Mon, 23 Mar 2015 09:14:33 +0100 -Subject: [PATCH 41/50] winepulse: add stub for GetPropValue - -Edited by Maarten Lankhorst: No support for multiple devices in winepulse yet. ---- - dlls/winepulse.drv/mmdevdrv.c | 13 +++++++++++++ - dlls/winepulse.drv/winepulse.drv.spec | 1 + - 2 files changed, 14 insertions(+) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index 63ef9e6..5ae76ef 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -50,6 +50,7 @@ - #include "initguid.h" - #include "ks.h" - #include "ksmedia.h" -+#include "propkey.h" - #include "mmdeviceapi.h" - #include "audioclient.h" - #include "endpointvolume.h" -@@ -3132,3 +3133,15 @@ HRESULT WINAPI AUDDRV_GetAudioSessionManager(IMMDevice *device, - *out = &This->IAudioSessionManager2_iface; - return S_OK; - } -+ -+HRESULT WINAPI AUDDRV_GetPropValue(GUID *guid, const PROPERTYKEY *prop, PROPVARIANT *out) -+{ -+ struct pulse_prop_values_info_cb_data userdata; -+ char name[256]; -+ EDataFlow flow; -+ pa_operation *o; -+ -+ TRACE("%s, (%s,%u), %p\n", wine_dbgstr_guid(guid), wine_dbgstr_guid(&prop->fmtid), prop->pid, out); -+ -+ return E_NOTIMPL; -+} -diff --git a/dlls/winepulse.drv/winepulse.drv.spec b/dlls/winepulse.drv/winepulse.drv.spec -index 288de87..7aeb175 100644 ---- a/dlls/winepulse.drv/winepulse.drv.spec -+++ b/dlls/winepulse.drv/winepulse.drv.spec -@@ -3,6 +3,7 @@ - @ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs - @ stdcall -private GetAudioEndpoint(ptr ptr ptr) AUDDRV_GetAudioEndpoint - @ stdcall -private GetAudioSessionManager(ptr ptr) AUDDRV_GetAudioSessionManager -+@ stdcall -private GetPropValue(ptr ptr ptr) AUDDRV_GetPropValue - - # WinMM driver functions - @ stdcall -private DriverProc(long long long long long) winealsa.drv.DriverProc --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0042-winepulse-return-PKEY_AudioEndpoint_PhysicalSpeakers.patch wine1.7-1.7.55/debian/patches/0042-winepulse-return-PKEY_AudioEndpoint_PhysicalSpeakers.patch --- wine1.7-1.7.50/debian/patches/0042-winepulse-return-PKEY_AudioEndpoint_PhysicalSpeakers.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0042-winepulse-return-PKEY_AudioEndpoint_PhysicalSpeakers.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,137 +0,0 @@ -From d3c3d7ebdc6d3abffc3ebd4e098598cb4856ab50 Mon Sep 17 00:00:00 2001 -From: Mark Harmstone -Date: Mon, 23 Mar 2015 09:14:33 +0100 -Subject: [PATCH 42/50] winepulse: return PKEY_AudioEndpoint_PhysicalSpeakers - device prop - -Edited by Maarten Lankhorst: No support for multiple devices in winepulse yet. ---- - dlls/winepulse.drv/mmdevdrv.c | 87 ++++++++++++++++++++++++++++++------------- - 1 file changed, 61 insertions(+), 26 deletions(-) - -diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c -index 5ae76ef..ab78d5a 100644 ---- a/dlls/winepulse.drv/mmdevdrv.c -+++ b/dlls/winepulse.drv/mmdevdrv.c -@@ -303,13 +303,44 @@ static const enum pa_channel_position pulse_pos_from_wfx[] = { - PA_CHANNEL_POSITION_TOP_REAR_RIGHT - }; - -+static DWORD pulse_channel_map_to_channel_mask(const pa_channel_map *map) { -+ int i; -+ DWORD mask = 0; -+ -+ for (i = 0; i < map->channels; ++i) -+ switch (map->map[i]) { -+ default: FIXME("Unhandled channel %s\n", pa_channel_position_to_string(map->map[i])); break; -+ case PA_CHANNEL_POSITION_FRONT_LEFT: mask |= SPEAKER_FRONT_LEFT; break; -+ case PA_CHANNEL_POSITION_MONO: -+ case PA_CHANNEL_POSITION_FRONT_CENTER: mask |= SPEAKER_FRONT_CENTER; break; -+ case PA_CHANNEL_POSITION_FRONT_RIGHT: mask |= SPEAKER_FRONT_RIGHT; break; -+ case PA_CHANNEL_POSITION_REAR_LEFT: mask |= SPEAKER_BACK_LEFT; break; -+ case PA_CHANNEL_POSITION_REAR_CENTER: mask |= SPEAKER_BACK_CENTER; break; -+ case PA_CHANNEL_POSITION_REAR_RIGHT: mask |= SPEAKER_BACK_RIGHT; break; -+ case PA_CHANNEL_POSITION_LFE: mask |= SPEAKER_LOW_FREQUENCY; break; -+ case PA_CHANNEL_POSITION_SIDE_LEFT: mask |= SPEAKER_SIDE_LEFT; break; -+ case PA_CHANNEL_POSITION_SIDE_RIGHT: mask |= SPEAKER_SIDE_RIGHT; break; -+ case PA_CHANNEL_POSITION_TOP_CENTER: mask |= SPEAKER_TOP_CENTER; break; -+ case PA_CHANNEL_POSITION_TOP_FRONT_LEFT: mask |= SPEAKER_TOP_FRONT_LEFT; break; -+ case PA_CHANNEL_POSITION_TOP_FRONT_CENTER: mask |= SPEAKER_TOP_FRONT_CENTER; break; -+ case PA_CHANNEL_POSITION_TOP_FRONT_RIGHT: mask |= SPEAKER_TOP_FRONT_RIGHT; break; -+ case PA_CHANNEL_POSITION_TOP_REAR_LEFT: mask |= SPEAKER_TOP_BACK_LEFT; break; -+ case PA_CHANNEL_POSITION_TOP_REAR_CENTER: mask |= SPEAKER_TOP_BACK_CENTER; break; -+ case PA_CHANNEL_POSITION_TOP_REAR_RIGHT: mask |= SPEAKER_TOP_BACK_RIGHT; break; -+ case PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER: mask |= SPEAKER_FRONT_LEFT_OF_CENTER; break; -+ case PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER: mask |= SPEAKER_FRONT_RIGHT_OF_CENTER; break; -+ } -+ -+ return mask; -+} -+ - static void pulse_probe_settings(int render, WAVEFORMATEXTENSIBLE *fmt) { - WAVEFORMATEX *wfx = &fmt->Format; - pa_stream *stream; - pa_channel_map map; - pa_sample_spec ss; - pa_buffer_attr attr; -- int ret, i; -+ int ret; - unsigned int length = 0; - - pa_channel_map_init_auto(&map, 2, PA_CHANNEL_MAP_ALSA); -@@ -372,28 +403,7 @@ static void pulse_probe_settings(int render, WAVEFORMATEXTENSIBLE *fmt) { - else - fmt->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; - -- fmt->dwChannelMask = 0; -- for (i = 0; i < map.channels; ++i) -- switch (map.map[i]) { -- default: FIXME("Unhandled channel %s\n", pa_channel_position_to_string(map.map[i])); break; -- case PA_CHANNEL_POSITION_FRONT_LEFT: fmt->dwChannelMask |= SPEAKER_FRONT_LEFT; break; -- case PA_CHANNEL_POSITION_MONO: -- case PA_CHANNEL_POSITION_FRONT_CENTER: fmt->dwChannelMask |= SPEAKER_FRONT_CENTER; break; -- case PA_CHANNEL_POSITION_FRONT_RIGHT: fmt->dwChannelMask |= SPEAKER_FRONT_RIGHT; break; -- case PA_CHANNEL_POSITION_REAR_LEFT: fmt->dwChannelMask |= SPEAKER_BACK_LEFT; break; -- case PA_CHANNEL_POSITION_REAR_CENTER: fmt->dwChannelMask |= SPEAKER_BACK_CENTER; break; -- case PA_CHANNEL_POSITION_REAR_RIGHT: fmt->dwChannelMask |= SPEAKER_BACK_RIGHT; break; -- case PA_CHANNEL_POSITION_LFE: fmt->dwChannelMask |= SPEAKER_LOW_FREQUENCY; break; -- case PA_CHANNEL_POSITION_SIDE_LEFT: fmt->dwChannelMask |= SPEAKER_SIDE_LEFT; break; -- case PA_CHANNEL_POSITION_SIDE_RIGHT: fmt->dwChannelMask |= SPEAKER_SIDE_RIGHT; break; -- case PA_CHANNEL_POSITION_TOP_CENTER: fmt->dwChannelMask |= SPEAKER_TOP_CENTER; break; -- case PA_CHANNEL_POSITION_TOP_FRONT_LEFT: fmt->dwChannelMask |= SPEAKER_TOP_FRONT_LEFT; break; -- case PA_CHANNEL_POSITION_TOP_FRONT_CENTER: fmt->dwChannelMask |= SPEAKER_TOP_FRONT_CENTER; break; -- case PA_CHANNEL_POSITION_TOP_FRONT_RIGHT: fmt->dwChannelMask |= SPEAKER_TOP_FRONT_RIGHT; break; -- case PA_CHANNEL_POSITION_TOP_REAR_LEFT: fmt->dwChannelMask |= SPEAKER_TOP_BACK_LEFT; break; -- case PA_CHANNEL_POSITION_TOP_REAR_CENTER: fmt->dwChannelMask |= SPEAKER_TOP_BACK_CENTER; break; -- case PA_CHANNEL_POSITION_TOP_REAR_RIGHT: fmt->dwChannelMask |= SPEAKER_TOP_BACK_RIGHT; break; -- } -+ fmt->dwChannelMask = pulse_channel_map_to_channel_mask(&map); - } - - static HRESULT pulse_connect(void) -@@ -3134,14 +3144,39 @@ HRESULT WINAPI AUDDRV_GetAudioSessionManager(IMMDevice *device, - return S_OK; - } - -+static void pulse_phys_speakers_cb(pa_context *c, const pa_sink_info *i, int eol, void *userdata) -+{ -+ PROPVARIANT *pv = userdata; -+ -+ if (i) -+ pv->u.ulVal |= pulse_channel_map_to_channel_mask(&i->channel_map); -+ -+ pthread_cond_signal(&pulse_cond); -+} -+ - HRESULT WINAPI AUDDRV_GetPropValue(GUID *guid, const PROPERTYKEY *prop, PROPVARIANT *out) - { -- struct pulse_prop_values_info_cb_data userdata; -- char name[256]; -- EDataFlow flow; - pa_operation *o; - - TRACE("%s, (%s,%u), %p\n", wine_dbgstr_guid(guid), wine_dbgstr_guid(&prop->fmtid), prop->pid, out); - -+ if (IsEqualGUID(guid, &pulse_render_guid) && IsEqualPropertyKey(*prop, PKEY_AudioEndpoint_PhysicalSpeakers)) { -+ /* For default Pulseaudio render device, OR together all of the -+ * PKEY_AudioEndpoint_PhysicalSpeakers values of the sinks. */ -+ -+ out->vt = VT_UI4; -+ out->u.ulVal = 0; -+ -+ pthread_mutex_lock(&pulse_lock); -+ o = pa_context_get_sink_info_list(pulse_ctx, &pulse_phys_speakers_cb, out); -+ if (o) { -+ while (pa_operation_get_state(o) == PA_OPERATION_RUNNING) -+ pthread_cond_wait(&pulse_cond, &pulse_lock); -+ pa_operation_unref(o); -+ } -+ pthread_mutex_unlock(&pulse_lock); -+ return out->u.ulVal ? S_OK : E_FAIL; -+ } -+ - return E_NOTIMPL; - } --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0043-dsound-rework-ugly-mixer-logic.patch wine1.7-1.7.55/debian/patches/0043-dsound-rework-ugly-mixer-logic.patch --- wine1.7-1.7.50/debian/patches/0043-dsound-rework-ugly-mixer-logic.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0043-dsound-rework-ugly-mixer-logic.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,674 +0,0 @@ -From f88683ad63ddd2cd73c9546f33796fe19565ce17 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:33 +0100 -Subject: [PATCH 43/50] dsound: rework ugly mixer logic - ---- - dlls/dsound/dsound.c | 1 - - dlls/dsound/dsound_main.c | 6 - - dlls/dsound/dsound_private.h | 6 +- - dlls/dsound/mixer.c | 254 +++++++++++-------------------------------- - dlls/dsound/primary.c | 107 ++++++++---------- - 5 files changed, 109 insertions(+), 265 deletions(-) - -diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c -index 7b93455..550e276 100644 ---- a/dlls/dsound/dsound.c -+++ b/dlls/dsound/dsound.c -@@ -158,7 +158,6 @@ static HRESULT DirectSoundDevice_Create(DirectSoundDevice ** ppDevice) - device->ds3dl.flRolloffFactor = DS3D_DEFAULTROLLOFFFACTOR; - device->ds3dl.flDopplerFactor = DS3D_DEFAULTDOPPLERFACTOR; - -- device->prebuf = ds_snd_queue_max; - device->guid = GUID_NULL; - - /* Set default wave format (may need it for waveOutOpen) */ -diff --git a/dlls/dsound/dsound_main.c b/dlls/dsound/dsound_main.c -index cb46301..112ce78 100644 ---- a/dlls/dsound/dsound_main.c -+++ b/dlls/dsound/dsound_main.c -@@ -93,7 +93,6 @@ WCHAR wine_vxd_drv[] = { 'w','i','n','e','m','m','.','v','x','d', 0 }; - - /* All default settings, you most likely don't want to touch these, see wiki on UsefulRegistryKeys */ - int ds_hel_buflen = 32768 * 2; --int ds_snd_queue_max = 10; - static HINSTANCE instance; - - /* -@@ -146,15 +145,10 @@ void setup_dsound_options(void) - if (!get_config_key( hkey, appkey, "HelBuflen", buffer, MAX_PATH )) - ds_hel_buflen = atoi(buffer); - -- if (!get_config_key( hkey, appkey, "SndQueueMax", buffer, MAX_PATH )) -- ds_snd_queue_max = atoi(buffer); -- -- - if (appkey) RegCloseKey( appkey ); - if (hkey) RegCloseKey( hkey ); - - TRACE("ds_hel_buflen = %d\n", ds_hel_buflen); -- TRACE("ds_snd_queue_max = %d\n", ds_snd_queue_max); - } - - static const char * get_device_id(LPCGUID pGuid) -diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h -index 9c001ed..e180f7c 100644 ---- a/dlls/dsound/dsound_private.h -+++ b/dlls/dsound/dsound_private.h -@@ -35,7 +35,6 @@ - #define DS_MAX_CHANNELS 6 - - extern int ds_hel_buflen DECLSPEC_HIDDEN; --extern int ds_snd_queue_max DECLSPEC_HIDDEN; - - /***************************************************************************** - * Predeclare the interface implementation structures -@@ -76,10 +75,8 @@ struct DirectSoundDevice - DSCAPS drvcaps; - DWORD priolevel, sleeptime; - PWAVEFORMATEX pwfx, primary_pwfx; -- UINT playing_offs_bytes, in_mmdev_bytes, prebuf; -- DWORD fraglen; - LPBYTE buffer; -- DWORD writelead, buflen, state, playpos, mixpos; -+ DWORD writelead, buflen, aclen, fraglen, state, playpos, pad; - int nrofbuffers; - IDirectSoundBufferImpl** buffers; - RTL_RWLOCK buffer_list_lock; -@@ -213,7 +210,6 @@ HRESULT DSOUND_PrimaryCreate(DirectSoundDevice *device) DECLSPEC_HIDDEN; - HRESULT DSOUND_PrimaryDestroy(DirectSoundDevice *device) DECLSPEC_HIDDEN; - HRESULT DSOUND_PrimaryPlay(DirectSoundDevice *device) DECLSPEC_HIDDEN; - HRESULT DSOUND_PrimaryStop(DirectSoundDevice *device) DECLSPEC_HIDDEN; --HRESULT DSOUND_PrimaryGetPosition(DirectSoundDevice *device, LPDWORD playpos, LPDWORD writepos) DECLSPEC_HIDDEN; - LPWAVEFORMATEX DSOUND_CopyFormat(LPCWAVEFORMATEX wfex) DECLSPEC_HIDDEN; - HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) DECLSPEC_HIDDEN; - HRESULT DSOUND_PrimaryOpen(DirectSoundDevice *device) DECLSPEC_HIDDEN; -diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c -index 85ab14a..f650089 100644 ---- a/dlls/dsound/mixer.c -+++ b/dlls/dsound/mixer.c -@@ -468,7 +468,7 @@ static void DSOUND_MixerVol(const IDirectSoundBufferImpl *dsb, INT frames) - * writepos = position (offset) in device buffer to write at - * fraglen = number of bytes to mix - */ --static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, DWORD writepos, DWORD fraglen) -+static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, float *mix_buffer, DWORD writepos, DWORD fraglen) - { - INT len = fraglen; - float *ibuf; -@@ -493,7 +493,7 @@ static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, DWORD writepos, DWO - /* Apply volume if needed */ - DSOUND_MixerVol(dsb, frames); - -- mixieee32(ibuf, dsb->device->mix_buffer, frames * dsb->device->pwfx->nChannels); -+ mixieee32(ibuf, mix_buffer, frames * dsb->device->pwfx->nChannels); - - /* check for notification positions */ - if (dsb->dsbd.dwFlags & DSBCAPS_CTRLPOSITIONNOTIFY && -@@ -517,7 +517,7 @@ static DWORD DSOUND_MixInBuffer(IDirectSoundBufferImpl *dsb, DWORD writepos, DWO - * - * Returns: the number of bytes beyond the writepos that were mixed. - */ --static DWORD DSOUND_MixOne(IDirectSoundBufferImpl *dsb, DWORD writepos, DWORD mixlen) -+static DWORD DSOUND_MixOne(IDirectSoundBufferImpl *dsb, float *mix_buffer, DWORD writepos, DWORD mixlen) - { - DWORD primary_done = 0; - -@@ -544,7 +544,7 @@ static DWORD DSOUND_MixOne(IDirectSoundBufferImpl *dsb, DWORD writepos, DWORD mi - /* First try to mix to the end of the buffer if possible - * Theoretically it would allow for better optimization - */ -- primary_done += DSOUND_MixInBuffer(dsb, writepos, mixlen); -+ primary_done += DSOUND_MixInBuffer(dsb, mix_buffer, writepos, mixlen); - - TRACE("total mixed data=%d\n", primary_done); - -@@ -559,14 +559,12 @@ static DWORD DSOUND_MixOne(IDirectSoundBufferImpl *dsb, DWORD writepos, DWORD mi - * writepos = the current safe-to-write position in the primary buffer - * mixlen = the maximum amount to mix into the primary buffer - * (beyond the current writepos) -- * recover = true if the sound device may have been reset and the write -- * position in the device buffer changed - * all_stopped = reports back if all buffers have stopped - * - * Returns: the length beyond the writepos that was mixed to. - */ - --static void DSOUND_MixToPrimary(const DirectSoundDevice *device, DWORD writepos, DWORD mixlen, BOOL recover, BOOL *all_stopped) -+static void DSOUND_MixToPrimary(const DirectSoundDevice *device, float *mix_buffer, DWORD writepos, DWORD mixlen, BOOL *all_stopped) - { - INT i; - IDirectSoundBufferImpl *dsb; -@@ -574,7 +572,7 @@ static void DSOUND_MixToPrimary(const DirectSoundDevice *device, DWORD writepos, - /* unless we find a running buffer, all have stopped */ - *all_stopped = TRUE; - -- TRACE("(%d,%d,%d)\n", writepos, mixlen, recover); -+ TRACE("(%d,%d)\n", writepos, mixlen); - for (i = 0; i < device->nrofbuffers; i++) { - dsb = device->buffers[i]; - -@@ -594,7 +592,7 @@ static void DSOUND_MixToPrimary(const DirectSoundDevice *device, DWORD writepos, - dsb->state = STATE_PLAYING; - - /* mix next buffer into the main buffer */ -- DSOUND_MixOne(dsb, writepos, mixlen); -+ DSOUND_MixOne(dsb, mix_buffer, writepos, mixlen); - - *all_stopped = FALSE; - } -@@ -613,86 +611,27 @@ static void DSOUND_MixToPrimary(const DirectSoundDevice *device, DWORD writepos, - * Returns: None - */ - --static void DSOUND_WaveQueue(DirectSoundDevice *device, BOOL force) -+static void DSOUND_WaveQueue(DirectSoundDevice *device, LPBYTE pos, DWORD bytes) - { -- DWORD prebuf_frames, prebuf_bytes, read_offs_bytes; - BYTE *buffer; - HRESULT hr; - - TRACE("(%p)\n", device); - -- read_offs_bytes = (device->playing_offs_bytes + device->in_mmdev_bytes) % device->buflen; -- -- TRACE("read_offs_bytes = %u, playing_offs_bytes = %u, in_mmdev_bytes: %u, prebuf = %u\n", -- read_offs_bytes, device->playing_offs_bytes, device->in_mmdev_bytes, device->prebuf); -- -- if (!force) -- { -- if(device->mixpos < device->playing_offs_bytes) -- prebuf_bytes = device->mixpos + device->buflen - device->playing_offs_bytes; -- else -- prebuf_bytes = device->mixpos - device->playing_offs_bytes; -- } -- else -- /* buffer the maximum amount of frags */ -- prebuf_bytes = device->prebuf * device->fraglen; -- -- /* limit to the queue we have left */ -- if(device->in_mmdev_bytes + prebuf_bytes > device->prebuf * device->fraglen) -- prebuf_bytes = device->prebuf * device->fraglen - device->in_mmdev_bytes; -- -- TRACE("prebuf_bytes = %u\n", prebuf_bytes); -- -- if(!prebuf_bytes) -- return; -- -- if(prebuf_bytes + read_offs_bytes > device->buflen){ -- DWORD chunk_bytes = device->buflen - read_offs_bytes; -- prebuf_frames = chunk_bytes / device->pwfx->nBlockAlign; -- prebuf_bytes -= chunk_bytes; -- }else{ -- prebuf_frames = prebuf_bytes / device->pwfx->nBlockAlign; -- prebuf_bytes = 0; -- } -- -- hr = IAudioRenderClient_GetBuffer(device->render, prebuf_frames, &buffer); -+ hr = IAudioRenderClient_GetBuffer(device->render, bytes / device->pwfx->nBlockAlign, &buffer); - if(FAILED(hr)){ - WARN("GetBuffer failed: %08x\n", hr); -- return; -+ goto done; - } - -- memcpy(buffer, device->buffer + read_offs_bytes, -- prebuf_frames * device->pwfx->nBlockAlign); -+ memcpy(buffer, pos, bytes); - -- hr = IAudioRenderClient_ReleaseBuffer(device->render, prebuf_frames, 0); -- if(FAILED(hr)){ -+ hr = IAudioRenderClient_ReleaseBuffer(device->render, bytes / device->pwfx->nBlockAlign, 0); -+ if(FAILED(hr)) - WARN("ReleaseBuffer failed: %08x\n", hr); -- return; -- } -- -- device->in_mmdev_bytes += prebuf_frames * device->pwfx->nBlockAlign; -- -- /* check if anything wrapped */ -- if(prebuf_bytes > 0){ -- prebuf_frames = prebuf_bytes / device->pwfx->nBlockAlign; -- -- hr = IAudioRenderClient_GetBuffer(device->render, prebuf_frames, &buffer); -- if(FAILED(hr)){ -- WARN("GetBuffer failed: %08x\n", hr); -- return; -- } -- -- memcpy(buffer, device->buffer, prebuf_frames * device->pwfx->nBlockAlign); - -- hr = IAudioRenderClient_ReleaseBuffer(device->render, prebuf_frames, 0); -- if(FAILED(hr)){ -- WARN("ReleaseBuffer failed: %08x\n", hr); -- return; -- } -- device->in_mmdev_bytes += prebuf_frames * device->pwfx->nBlockAlign; -- } -- -- TRACE("in_mmdev_bytes now = %i\n", device->in_mmdev_bytes); -+done: -+ device->pad += bytes; - } - - /** -@@ -710,7 +649,8 @@ static void DSOUND_WaveQueue(DirectSoundDevice *device, BOOL force) - */ - static void DSOUND_PerformMix(DirectSoundDevice *device) - { -- UINT32 pad, to_mix_frags, to_mix_bytes; -+ UINT32 pad, maxq, writepos; -+ DWORD block; - HRESULT hr; - - TRACE("(%p)\n", device); -@@ -724,147 +664,79 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) - LeaveCriticalSection(&device->mixlock); - return; - } -- -- to_mix_frags = device->prebuf - (pad * device->pwfx->nBlockAlign + device->fraglen - 1) / device->fraglen; -- -- to_mix_bytes = to_mix_frags * device->fraglen; -- -- if(device->in_mmdev_bytes > 0){ -- DWORD delta_bytes = min(to_mix_bytes, device->in_mmdev_bytes); -- device->in_mmdev_bytes -= delta_bytes; -- device->playing_offs_bytes += delta_bytes; -- device->playing_offs_bytes %= device->buflen; -+ block = device->pwfx->nBlockAlign; -+ pad *= block; -+ device->playpos += device->pad - pad; -+ device->playpos %= device->buflen; -+ device->pad = pad; -+ -+ maxq = device->aclen - pad; -+ if(!maxq){ -+ /* nothing to do! */ -+ LeaveCriticalSection(&device->mixlock); -+ return; - } -+ if (maxq > device->fraglen * 3) -+ maxq = device->fraglen * 3; -+ -+ writepos = (device->playpos + pad) % device->buflen; - - if (device->priolevel != DSSCL_WRITEPRIMARY) { -- BOOL recover = FALSE, all_stopped = FALSE; -- DWORD playpos, writepos, writelead, maxq, prebuff_max, prebuff_left, size1, size2; -- LPVOID buf1, buf2; -+ BOOL all_stopped = FALSE; - int nfiller; -+ DWORD bpp = device->pwfx->wBitsPerSample>>3; - - /* the sound of silence */ - nfiller = device->pwfx->wBitsPerSample == 8 ? 128 : 0; - -- /* get the position in the primary buffer */ -- if (DSOUND_PrimaryGetPosition(device, &playpos, &writepos) != 0){ -- LeaveCriticalSection(&(device->mixlock)); -- return; -- } -- -- TRACE("primary playpos=%d, writepos=%d, clrpos=%d, mixpos=%d, buflen=%d\n", -- playpos,writepos,device->playpos,device->mixpos,device->buflen); -- assert(device->playpos < device->buflen); -- -- /* calc maximum prebuff */ -- prebuff_max = (device->prebuf * device->fraglen); -- -- /* check how close we are to an underrun. It occurs when the writepos overtakes the mixpos */ -- prebuff_left = DSOUND_BufPtrDiff(device->buflen, device->mixpos, playpos); -- writelead = DSOUND_BufPtrDiff(device->buflen, writepos, playpos); -- - /* check for underrun. underrun occurs when the write position passes the mix position - * also wipe out just-played sound data */ -- if((prebuff_left > prebuff_max) || (device->state == STATE_STOPPED) || (device->state == STATE_STARTING)){ -- if (device->state == STATE_STOPPING || device->state == STATE_PLAYING) -- WARN("Probable buffer underrun\n"); -- else TRACE("Buffer starting or buffer underrun\n"); -- -- /* recover mixing for all buffers */ -- recover = TRUE; -- -- /* reset mix position to write position */ -- device->mixpos = writepos; -- -- ZeroMemory(device->buffer, device->buflen); -- } else if (playpos < device->playpos) { -- buf1 = device->buffer + device->playpos; -- buf2 = device->buffer; -- size1 = device->buflen - device->playpos; -- size2 = playpos; -- FillMemory(buf1, size1, nfiller); -- if (playpos && (!buf2 || !size2)) -- FIXME("%d: (%d, %d)=>(%d, %d) There should be an additional buffer here!!\n", __LINE__, device->playpos, device->mixpos, playpos, writepos); -- FillMemory(buf2, size2, nfiller); -- } else { -- buf1 = device->buffer + device->playpos; -- buf2 = NULL; -- size1 = playpos - device->playpos; -- size2 = 0; -- FillMemory(buf1, size1, nfiller); -+ if (!pad) -+ WARN("Probable buffer underrun\n"); -+ else if (device->state == STATE_STOPPED || -+ device->state == STATE_STARTING) { -+ TRACE("Buffer restarting\n"); - } -- device->playpos = playpos; -- -- /* find the maximum we can prebuffer from current write position */ -- maxq = (writelead < prebuff_max) ? (prebuff_max - writelead) : 0; - -- TRACE("prebuff_left = %d, prebuff_max = %dx%d=%d, writelead=%d\n", -- prebuff_left, device->prebuf, device->fraglen, prebuff_max, writelead); -- -- ZeroMemory(device->mix_buffer, device->mix_buffer_len); -+ memset(device->mix_buffer, nfiller, maxq); - - /* do the mixing */ -- DSOUND_MixToPrimary(device, writepos, maxq, recover, &all_stopped); -+ DSOUND_MixToPrimary(device, device->mix_buffer, writepos, maxq, &all_stopped); - -- if (maxq + writepos > device->buflen) -- { -+ if (maxq + writepos > device->buflen) { - DWORD todo = device->buflen - writepos; -- DWORD offs_float = (todo / device->pwfx->nBlockAlign) * device->pwfx->nChannels; -- device->normfunction(device->mix_buffer, device->buffer + writepos, todo); -- device->normfunction(device->mix_buffer + offs_float, device->buffer, maxq - todo); -- } -- else -- device->normfunction(device->mix_buffer, device->buffer + writepos, maxq); - -- /* update the mix position, taking wrap-around into account */ -- device->mixpos = writepos + maxq; -- device->mixpos %= device->buflen; -- -- /* update prebuff left */ -- prebuff_left = DSOUND_BufPtrDiff(device->buflen, device->mixpos, playpos); -- -- /* check if have a whole fragment */ -- if (prebuff_left >= device->fraglen){ -+ device->normfunction(device->mix_buffer, device->buffer + writepos, todo); -+ DSOUND_WaveQueue(device, device->buffer + writepos, todo); - -- /* update the wave queue */ -- DSOUND_WaveQueue(device, FALSE); -+ device->normfunction(device->mix_buffer + todo / bpp, device->buffer, (maxq - todo)); -+ DSOUND_WaveQueue(device, device->buffer, maxq - todo); -+ } else { -+ device->normfunction(device->mix_buffer, device->buffer + writepos, maxq); -+ DSOUND_WaveQueue(device, device->buffer + writepos, maxq); -+ } - -- /* buffers are full. start playing if applicable */ -- if(device->state == STATE_STARTING){ -- TRACE("started primary buffer\n"); -- if(DSOUND_PrimaryPlay(device) != DS_OK){ -+ if (maxq) { -+ if (device->state == STATE_STARTING || -+ device->state == STATE_STOPPED) { -+ if(DSOUND_PrimaryPlay(device) != DS_OK) - WARN("DSOUND_PrimaryPlay failed\n"); -- } -- else{ -- /* we are playing now */ -+ else if (device->state == STATE_STARTING) - device->state = STATE_PLAYING; -- } -- } -- -- /* buffers are full. start stopping if applicable */ -- if(device->state == STATE_STOPPED){ -- TRACE("restarting primary buffer\n"); -- if(DSOUND_PrimaryPlay(device) != DS_OK){ -- WARN("DSOUND_PrimaryPlay failed\n"); -- } -- else{ -- /* start stopping again. as soon as there is no more data, it will stop */ -+ else - device->state = STATE_STOPPING; -- } - } -- } -- -- /* if device was stopping, its for sure stopped when all buffers have stopped */ -- else if (all_stopped && (device->state == STATE_STOPPING)) { -- TRACE("All buffers have stopped. Stopping primary buffer\n"); -+ } else if (!pad && !maxq && (all_stopped == TRUE) && -+ (device->state == STATE_STOPPING)) { - device->state = STATE_STOPPED; -- -- /* stop the primary buffer now */ - DSOUND_PrimaryStop(device); - } -- - } else if (device->state != STATE_STOPPED) { -- -- DSOUND_WaveQueue(device, TRUE); -+ if (writepos + maxq > device->buflen) { -+ DSOUND_WaveQueue(device, device->buffer + writepos, device->buflen - writepos); -+ DSOUND_WaveQueue(device, device->buffer, writepos + maxq - device->buflen); -+ } else -+ DSOUND_WaveQueue(device, device->buffer + writepos, maxq); - - /* in the DSSCL_WRITEPRIMARY mode, the app is totally in charge... */ - if (device->state == STATE_STARTING) { -diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c -index 3f8a478..19a76b0 100644 ---- a/dlls/dsound/primary.c -+++ b/dlls/dsound/primary.c -@@ -40,24 +40,6 @@ - - WINE_DEFAULT_DEBUG_CHANNEL(dsound); - --static DWORD DSOUND_fraglen(DirectSoundDevice *device) --{ -- REFERENCE_TIME period; -- HRESULT hr; -- DWORD ret; -- -- hr = IAudioClient_GetDevicePeriod(device->client, &period, NULL); -- if(FAILED(hr)){ -- /* just guess at 10ms */ -- WARN("GetDevicePeriod failed: %08x\n", hr); -- ret = MulDiv(device->pwfx->nBlockAlign, device->pwfx->nSamplesPerSec, 100); -- }else -- ret = MulDiv(device->pwfx->nSamplesPerSec * device->pwfx->nBlockAlign, period, 10000000); -- -- ret -= ret % device->pwfx->nBlockAlign; -- return ret; --} -- - static DWORD speaker_config_to_channel_mask(DWORD speaker_config) - { - switch (DSSPEAKER_CONFIG(speaker_config)) { -@@ -217,11 +199,10 @@ static HRESULT DSOUND_WaveFormat(DirectSoundDevice *device, IAudioClient *client - - HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) - { -- UINT prebuf_frames; -- REFERENCE_TIME prebuf_rt; - WAVEFORMATEX *wfx = NULL; - HRESULT hres; -- REFERENCE_TIME period; -+ REFERENCE_TIME period, buflen = 800000; -+ UINT32 frames; - DWORD period_ms; - - TRACE("(%p, %d)\n", device, forcewave); -@@ -243,6 +224,12 @@ HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) - device->volume = NULL; - } - -+ if (device->pad) { -+ device->playpos += device->pad; -+ device->playpos %= device->buflen; -+ device->pad = 0; -+ } -+ - hres = IMMDevice_Activate(device->mmdevice, &IID_IAudioClient, - CLSCTX_INPROC_SERVER, NULL, (void **)&device->client); - if(FAILED(hres)) { -@@ -263,12 +250,9 @@ HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) - HeapFree(GetProcessHeap(), 0, device->pwfx); - device->pwfx = wfx; - -- prebuf_frames = device->prebuf * DSOUND_fraglen(device) / device->pwfx->nBlockAlign; -- prebuf_rt = (10000000 * (UINT64)prebuf_frames) / device->pwfx->nSamplesPerSec; -- - hres = IAudioClient_Initialize(device->client, - AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_NOPERSIST | -- AUDCLNT_STREAMFLAGS_EVENTCALLBACK, prebuf_rt, 0, device->pwfx, NULL); -+ AUDCLNT_STREAMFLAGS_EVENTCALLBACK, buflen, 0, device->pwfx, NULL); - if(FAILED(hres)){ - IAudioClient_Release(device->client); - device->client = NULL; -@@ -318,10 +302,19 @@ HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) - hres = IAudioClient_GetStreamLatency(device->client, &period); - if (FAILED(hres)) { - WARN("GetStreamLatency failed with %08x\n", hres); -- period_ms = 10; -- } else -- period_ms = (period + 9999) / 10000; -- TRACE("period %u ms fraglen %u prebuf %u\n", period_ms, device->fraglen, device->prebuf); -+ period = 100000; -+ } -+ period_ms = (period + 9999) / 10000; -+ -+ hres = IAudioClient_GetBufferSize(device->client, &frames); -+ if (FAILED(hres)) { -+ WARN("GetBufferSize failed with %08x\n", hres); -+ frames = (UINT64)device->pwfx->nSamplesPerSec * buflen / 10000000; -+ } -+ -+ device->fraglen = MulDiv(device->pwfx->nSamplesPerSec, period, 10000000) * device->pwfx->nBlockAlign; -+ device->aclen = frames * device->pwfx->nBlockAlign; -+ TRACE("period %u ms fraglen %u buflen %u\n", period_ms, device->fraglen, device->aclen); - - if (period_ms < 3) - device->sleeptime = 5; -@@ -339,17 +332,11 @@ HRESULT DSOUND_PrimaryOpen(DirectSoundDevice *device) - - TRACE("(%p)\n", device); - -- device->fraglen = DSOUND_fraglen(device); -- - /* on original windows, the buffer it set to a fixed size, no matter what the settings are. - on windows this size is always fixed (tested on win-xp) */ - if (!device->buflen) - device->buflen = ds_hel_buflen; - device->buflen -= device->buflen % device->pwfx->nBlockAlign; -- while(device->buflen < device->fraglen * device->prebuf){ -- device->buflen += ds_hel_buflen; -- device->buflen -= device->buflen % device->pwfx->nBlockAlign; -- } - - HeapFree(GetProcessHeap(), 0, device->mix_buffer); - device->mix_buffer_len = (device->buflen / (device->pwfx->wBitsPerSample / 8)) * sizeof(float); -@@ -419,9 +406,6 @@ static void DSOUND_PrimaryClose(DirectSoundDevice *device) - if(FAILED(hr)) - WARN("Stop failed: %08x\n", hr); - } -- -- /* clear the queue */ -- device->in_mmdev_bytes = 0; - } - - HRESULT DSOUND_PrimaryCreate(DirectSoundDevice *device) -@@ -496,32 +480,19 @@ HRESULT DSOUND_PrimaryStop(DirectSoundDevice *device) - return DS_OK; - } - --HRESULT DSOUND_PrimaryGetPosition(DirectSoundDevice *device, LPDWORD playpos, LPDWORD writepos) --{ -- TRACE("(%p,%p,%p)\n", device, playpos, writepos); -- -- /* check if playpos was requested */ -- if (playpos) -- *playpos = device->playing_offs_bytes; -- -- /* check if writepos was requested */ -- if (writepos) -- /* the writepos is the first non-queued position */ -- *writepos = (device->playing_offs_bytes + device->in_mmdev_bytes) % device->buflen; -- -- TRACE("playpos = %d, writepos = %d (%p, time=%d)\n", playpos?*playpos:-1, writepos?*writepos:-1, device, GetTickCount()); -- return DS_OK; --} -- - WAVEFORMATEX *DSOUND_CopyFormat(const WAVEFORMATEX *wfex) - { - WAVEFORMATEX *pwfx; - if(wfex->wFormatTag == WAVE_FORMAT_PCM){ - pwfx = HeapAlloc(GetProcessHeap(), 0, sizeof(WAVEFORMATEX)); -+ if (!pwfx) -+ return NULL; - CopyMemory(pwfx, wfex, sizeof(PCMWAVEFORMAT)); - pwfx->cbSize = 0; - }else{ - pwfx = HeapAlloc(GetProcessHeap(), 0, sizeof(WAVEFORMATEX) + wfex->cbSize); -+ if (!pwfx) -+ return NULL; - CopyMemory(pwfx, wfex, sizeof(WAVEFORMATEX) + wfex->cbSize); - } - -@@ -608,8 +579,12 @@ done: - else - HeapFree(GetProcessHeap(), 0, old_fmt); - } else { -- HeapFree(GetProcessHeap(), 0, device->primary_pwfx); -- device->primary_pwfx = DSOUND_CopyFormat(passed_fmt); -+ WAVEFORMATEX *wfx = DSOUND_CopyFormat(passed_fmt); -+ if (wfx) { -+ HeapFree(GetProcessHeap(), 0, device->primary_pwfx); -+ device->primary_pwfx = wfx; -+ } else -+ err = DSERR_OUTOFMEMORY; - } - - out: -@@ -840,7 +815,9 @@ static ULONG WINAPI PrimaryBufferImpl_Release(IDirectSoundBuffer *iface) - static HRESULT WINAPI PrimaryBufferImpl_GetCurrentPosition(IDirectSoundBuffer *iface, - DWORD *playpos, DWORD *writepos) - { -- HRESULT hres; -+ HRESULT hres = DS_OK; -+ UINT32 pad = 0; -+ UINT32 mixpos; - IDirectSoundBufferImpl *This = impl_from_IDirectSoundBuffer(iface); - DirectSoundDevice *device = This->device; - TRACE("(%p,%p,%p)\n", iface, playpos, writepos); -@@ -848,17 +825,23 @@ static HRESULT WINAPI PrimaryBufferImpl_GetCurrentPosition(IDirectSoundBuffer *i - /* **** */ - EnterCriticalSection(&(device->mixlock)); - -- hres = DSOUND_PrimaryGetPosition(device, playpos, writepos); -+ if (device->client) -+ hres = IAudioClient_GetCurrentPadding(device->client, &pad); - if (hres != DS_OK) { -- WARN("DSOUND_PrimaryGetPosition failed\n"); -+ WARN("IAudioClient_GetCurrentPadding failed\n"); - LeaveCriticalSection(&(device->mixlock)); - return hres; - } -+ mixpos = (device->playpos + pad * device->pwfx->nBlockAlign) % device->buflen; -+ if (playpos) -+ *playpos = mixpos; - if (writepos) { -- if (device->state != STATE_STOPPED) -+ *writepos = mixpos; -+ if (device->state != STATE_STOPPED) { - /* apply the documented 10ms lead to writepos */ - *writepos += device->writelead; -- while (*writepos >= device->buflen) *writepos -= device->buflen; -+ *writepos %= device->buflen; -+ } - } - - LeaveCriticalSection(&(device->mixlock)); --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0044-dsound-mix-float-natively.patch wine1.7-1.7.55/debian/patches/0044-dsound-mix-float-natively.patch --- wine1.7-1.7.50/debian/patches/0044-dsound-mix-float-natively.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0044-dsound-mix-float-natively.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,78 +0,0 @@ -From 6478dcabafcafff9b8f34023a38e91374d8a048c Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:33 +0100 -Subject: [PATCH 44/50] dsound: mix float natively - ---- - dlls/dsound/mixer.c | 43 ++++++++++++++++++++++++++++++++----------- - 1 file changed, 32 insertions(+), 11 deletions(-) - -diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c -index f650089..59ee21d 100644 ---- a/dlls/dsound/mixer.c -+++ b/dlls/dsound/mixer.c -@@ -684,6 +684,7 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) - if (device->priolevel != DSSCL_WRITEPRIMARY) { - BOOL all_stopped = FALSE; - int nfiller; -+ BOOL native = device->normfunction == normfunctions[4]; - DWORD bpp = device->pwfx->wBitsPerSample>>3; - - /* the sound of silence */ -@@ -698,22 +699,42 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) - TRACE("Buffer restarting\n"); - } - -- memset(device->mix_buffer, nfiller, maxq); -+ if (native) { -+ void *buffer = NULL; - -- /* do the mixing */ -- DSOUND_MixToPrimary(device, device->mix_buffer, writepos, maxq, &all_stopped); -+ hr = IAudioRenderClient_GetBuffer(device->render, maxq / block, (void*)&buffer); -+ if(FAILED(hr)){ -+ WARN("GetBuffer failed: %08x\n", hr); -+ LeaveCriticalSection(&device->mixlock); -+ return; -+ } -+ memset(buffer, nfiller, maxq); - -- if (maxq + writepos > device->buflen) { -- DWORD todo = device->buflen - writepos; -+ DSOUND_MixToPrimary(device, buffer, writepos, maxq, &all_stopped); - -- device->normfunction(device->mix_buffer, device->buffer + writepos, todo); -- DSOUND_WaveQueue(device, device->buffer + writepos, todo); -+ hr = IAudioRenderClient_ReleaseBuffer(device->render, maxq / block, 0); -+ if(FAILED(hr)) -+ ERR("ReleaseBuffer failed: %08x\n", hr); - -- device->normfunction(device->mix_buffer + todo / bpp, device->buffer, (maxq - todo)); -- DSOUND_WaveQueue(device, device->buffer, maxq - todo); -+ device->pad += maxq; - } else { -- device->normfunction(device->mix_buffer, device->buffer + writepos, maxq); -- DSOUND_WaveQueue(device, device->buffer + writepos, maxq); -+ memset(device->mix_buffer, nfiller, maxq); -+ -+ /* do the mixing */ -+ DSOUND_MixToPrimary(device, device->mix_buffer, writepos, maxq, &all_stopped); -+ -+ if (maxq + writepos > device->buflen) { -+ DWORD todo = device->buflen - writepos; -+ -+ device->normfunction(device->mix_buffer, device->buffer + writepos, todo); -+ DSOUND_WaveQueue(device, device->buffer + writepos, todo); -+ -+ device->normfunction(device->mix_buffer + todo / bpp, device->buffer, (maxq - todo)); -+ DSOUND_WaveQueue(device, device->buffer, maxq - todo); -+ } else { -+ device->normfunction(device->mix_buffer, device->buffer + writepos, maxq); -+ DSOUND_WaveQueue(device, device->buffer + writepos, maxq); -+ } - } - - if (maxq) { --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0045-dsound-fixup-DSOUND_WaveQueue-checks.patch wine1.7-1.7.55/debian/patches/0045-dsound-fixup-DSOUND_WaveQueue-checks.patch --- wine1.7-1.7.50/debian/patches/0045-dsound-fixup-DSOUND_WaveQueue-checks.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0045-dsound-fixup-DSOUND_WaveQueue-checks.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -From 71d767d0bf82b47847349201131db6da486b76f4 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:33 +0100 -Subject: [PATCH 45/50] dsound: fixup DSOUND_WaveQueue checks - -If you're going to be silly, you should go all the way. :P ---- - dlls/dsound/mixer.c | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - -diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c -index 59ee21d..c763650 100644 ---- a/dlls/dsound/mixer.c -+++ b/dlls/dsound/mixer.c -@@ -621,16 +621,18 @@ static void DSOUND_WaveQueue(DirectSoundDevice *device, LPBYTE pos, DWORD bytes) - hr = IAudioRenderClient_GetBuffer(device->render, bytes / device->pwfx->nBlockAlign, &buffer); - if(FAILED(hr)){ - WARN("GetBuffer failed: %08x\n", hr); -- goto done; -+ return; - } - - memcpy(buffer, pos, bytes); - - hr = IAudioRenderClient_ReleaseBuffer(device->render, bytes / device->pwfx->nBlockAlign, 0); -- if(FAILED(hr)) -- WARN("ReleaseBuffer failed: %08x\n", hr); -+ if(FAILED(hr)) { -+ ERR("ReleaseBuffer failed: %08x\n", hr); -+ IAudioRenderClient_ReleaseBuffer(device->render, 0, 0); -+ return; -+ } - --done: - device->pad += bytes; - } - --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0046-dsound-fixup-IDirectSoundCaptureBuffer_QueryInterfac.patch wine1.7-1.7.55/debian/patches/0046-dsound-fixup-IDirectSoundCaptureBuffer_QueryInterfac.patch --- wine1.7-1.7.50/debian/patches/0046-dsound-fixup-IDirectSoundCaptureBuffer_QueryInterfac.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0046-dsound-fixup-IDirectSoundCaptureBuffer_QueryInterfac.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -From 8d87d7cb0f2bc665cbea239fd5dbb6ea8173f0d7 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:33 +0100 -Subject: [PATCH 46/50] dsound: fixup IDirectSoundCaptureBuffer_QueryInterface - -Don't expose v8, and actually respond to iunknown. ---- - dlls/dsound/capture.c | 9 ++++++--- - 1 file changed, 6 insertions(+), 3 deletions(-) - -diff --git a/dlls/dsound/capture.c b/dlls/dsound/capture.c -index 0764261..412b59e 100644 ---- a/dlls/dsound/capture.c -+++ b/dlls/dsound/capture.c -@@ -50,7 +50,7 @@ typedef struct IDirectSoundCaptureBufferImpl - IDirectSoundCaptureBuffer8 IDirectSoundCaptureBuffer8_iface; - IDirectSoundNotify IDirectSoundNotify_iface; - LONG numIfaces; /* "in use interfaces" refcount */ -- LONG ref, refn; -+ LONG ref, refn, has_dsc8; - /* IDirectSoundCaptureBuffer fields */ - DirectSoundCaptureDevice *device; - DSCBUFFERDESC *pdscbd; -@@ -240,8 +240,9 @@ static HRESULT WINAPI IDirectSoundCaptureBufferImpl_QueryInterface(IDirectSoundC - - *ppobj = NULL; - -- if ( IsEqualGUID( &IID_IDirectSoundCaptureBuffer, riid ) || -- IsEqualGUID( &IID_IDirectSoundCaptureBuffer8, riid ) ) { -+ if ( IsEqualIID( &IID_IUnknown, riid ) || -+ IsEqualIID( &IID_IDirectSoundCaptureBuffer, riid ) || -+ (This->has_dsc8 && IsEqualIID( &IID_IDirectSoundCaptureBuffer8, riid )) ) { - IDirectSoundCaptureBuffer8_AddRef(iface); - *ppobj = iface; - return S_OK; -@@ -1233,6 +1234,8 @@ static HRESULT WINAPI IDirectSoundCaptureImpl_CreateCaptureBuffer(IDirectSoundCa - - if (hr != DS_OK) - WARN("IDirectSoundCaptureBufferImpl_Create failed\n"); -+ else -+ This->device->capture_buffer->has_dsc8 = This->has_dsc8; - - return hr; - } --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0047-dsound-fix-format-handling-on-invalid-format-to-neve.patch wine1.7-1.7.55/debian/patches/0047-dsound-fix-format-handling-on-invalid-format-to-neve.patch --- wine1.7-1.7.50/debian/patches/0047-dsound-fix-format-handling-on-invalid-format-to-neve.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0047-dsound-fix-format-handling-on-invalid-format-to-neve.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,736 +0,0 @@ -From 3904443b0ddd2ae8dcef73bafbf09f97835ae030 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 23 Mar 2015 09:14:34 +0100 -Subject: [PATCH 47/50] dsound: fix format handling on invalid format to never - fail - -For the users still on oss4 this is probably useful. This is more of -a theoretical concern than practical, since nobody uses primary mode. -And even if someone did, they would have to find a format that was -unsupported, like IEEE float would probably be the easiest to trigger. - -This patch now forces everything to a single call to DSOUND_ReopenDevice, -which will either fail and keep previous state, or succeed. ---- - dlls/dsound/dsound.c | 50 +++---- - dlls/dsound/dsound_convert.c | 18 --- - dlls/dsound/dsound_main.c | 2 +- - dlls/dsound/dsound_private.h | 5 +- - dlls/dsound/mixer.c | 53 +++---- - dlls/dsound/primary.c | 341 +++++++++++++++++++------------------------ - 6 files changed, 193 insertions(+), 276 deletions(-) - -diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c -index 550e276..3828bed 100644 ---- a/dlls/dsound/dsound.c -+++ b/dlls/dsound/dsound.c -@@ -161,24 +161,20 @@ static HRESULT DirectSoundDevice_Create(DirectSoundDevice ** ppDevice) - device->guid = GUID_NULL; - - /* Set default wave format (may need it for waveOutOpen) */ -- device->pwfx = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(WAVEFORMATEXTENSIBLE)); - device->primary_pwfx = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(WAVEFORMATEXTENSIBLE)); -- if (!device->pwfx || !device->primary_pwfx) { -+ if (!device->primary_pwfx) { - WARN("out of memory\n"); -- HeapFree(GetProcessHeap(),0,device->primary_pwfx); -- HeapFree(GetProcessHeap(),0,device->pwfx); - HeapFree(GetProcessHeap(),0,device); - return DSERR_OUTOFMEMORY; - } - -- device->pwfx->wFormatTag = WAVE_FORMAT_PCM; -- device->pwfx->nSamplesPerSec = 22050; -- device->pwfx->wBitsPerSample = 8; -- device->pwfx->nChannels = 2; -- device->pwfx->nBlockAlign = device->pwfx->wBitsPerSample * device->pwfx->nChannels / 8; -- device->pwfx->nAvgBytesPerSec = device->pwfx->nSamplesPerSec * device->pwfx->nBlockAlign; -- device->pwfx->cbSize = 0; -- memcpy(device->primary_pwfx, device->pwfx, sizeof(*device->pwfx)); -+ device->primary_pwfx->wFormatTag = WAVE_FORMAT_PCM; -+ device->primary_pwfx->nSamplesPerSec = 22050; -+ device->primary_pwfx->wBitsPerSample = 8; -+ device->primary_pwfx->nChannels = 2; -+ device->primary_pwfx->nBlockAlign = device->primary_pwfx->wBitsPerSample * device->primary_pwfx->nChannels / 8; -+ device->primary_pwfx->nAvgBytesPerSec = device->primary_pwfx->nSamplesPerSec * device->primary_pwfx->nBlockAlign; -+ device->primary_pwfx->cbSize = 0; - - InitializeCriticalSection(&(device->mixlock)); - device->mixlock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": DirectSoundDevice.mixlock"); -@@ -228,17 +224,16 @@ static ULONG DirectSoundDevice_Release(DirectSoundDevice * device) - if (hr != DS_OK) - WARN("DSOUND_PrimaryDestroy failed\n"); - -- if(device->client) -+ if(device->client) { -+ IAudioClient_Stop(device->client); - IAudioClient_Release(device->client); -+ } - if(device->render) - IAudioRenderClient_Release(device->render); -- if(device->clock) -- IAudioClock_Release(device->clock); - if(device->volume) - IAudioStreamVolume_Release(device->volume); - - HeapFree(GetProcessHeap(), 0, device->tmp_buffer); -- HeapFree(GetProcessHeap(), 0, device->mix_buffer); - HeapFree(GetProcessHeap(), 0, device->buffer); - RtlDeleteResource(&device->buffer_list_lock); - device->mixlock.DebugInfo->Spare[0] = 0; -@@ -324,6 +319,7 @@ static HRESULT DirectSoundDevice_Initialize(DirectSoundDevice ** ppDevice, LPCGU - device->mmdevice = mmdevice; - device->guid = devGUID; - device->sleepev = CreateEventW(0, 0, 0, 0); -+ device->buflen = ds_hel_buflen; - - hr = DSOUND_ReopenDevice(device, FALSE); - if (FAILED(hr)) -@@ -382,13 +378,9 @@ static HRESULT DirectSoundDevice_Initialize(DirectSoundDevice ** ppDevice, LPCGU - - ZeroMemory(&device->volpan, sizeof(device->volpan)); - -- hr = DSOUND_PrimaryCreate(device); -- if (hr == DS_OK) { -- device->thread_finished = CreateEventW(0, 0, 0, 0); -- device->thread = CreateThread(0, 0, DSOUND_mixthread, device, 0, 0); -- SetThreadPriority(device->thread, THREAD_PRIORITY_TIME_CRITICAL); -- } else -- WARN("DSOUND_PrimaryCreate failed: %08x\n", hr); -+ device->thread_finished = CreateEventW(0, 0, 0, 0); -+ device->thread = CreateThread(0, 0, DSOUND_mixthread, device, 0, 0); -+ SetThreadPriority(device->thread, THREAD_PRIORITY_TIME_CRITICAL); - - *ppDevice = device; - list_add_tail(&DSOUND_renderers, &device->entry); -@@ -850,7 +842,6 @@ static HRESULT WINAPI IDirectSound8Impl_SetCooperativeLevel(IDirectSound8 *iface - { - IDirectSoundImpl *This = impl_from_IDirectSound8(iface); - DirectSoundDevice *device = This->device; -- DWORD oldlevel; - HRESULT hr = S_OK; - - TRACE("(%p,%p,%s)\n", This, hwnd, dumpCooperativeLevel(level)); -@@ -867,15 +858,10 @@ static HRESULT WINAPI IDirectSound8Impl_SetCooperativeLevel(IDirectSound8 *iface - - RtlAcquireResourceExclusive(&device->buffer_list_lock, TRUE); - EnterCriticalSection(&device->mixlock); -- oldlevel = device->priolevel; -- device->priolevel = level; -- if ((level == DSSCL_WRITEPRIMARY) != (oldlevel == DSSCL_WRITEPRIMARY)) { -+ if ((level == DSSCL_WRITEPRIMARY) != (device->priolevel == DSSCL_WRITEPRIMARY)) - hr = DSOUND_ReopenDevice(device, level == DSSCL_WRITEPRIMARY); -- if (FAILED(hr)) -- device->priolevel = oldlevel; -- else -- DSOUND_PrimaryOpen(device); -- } -+ if (SUCCEEDED(hr)) -+ device->priolevel = level; - LeaveCriticalSection(&device->mixlock); - RtlReleaseResource(&device->buffer_list_lock); - return hr; -diff --git a/dlls/dsound/dsound_convert.c b/dlls/dsound/dsound_convert.c -index 5accba6..af81c91 100644 ---- a/dlls/dsound/dsound_convert.c -+++ b/dlls/dsound/dsound_convert.c -@@ -263,27 +263,9 @@ static void norm32(float *src, INT *dst, unsigned len) - } - } - --static void normieee32(float *src, float *dst, unsigned len) --{ -- TRACE("%p - %p %d\n", src, dst, len); -- len /= 4; -- while (len--) -- { -- if(*src > 1) -- *dst = 1; -- else if(*src < -1) -- *dst = -1; -- else -- *dst = *src; -- ++dst; -- ++src; -- } --} -- - const normfunc normfunctions[5] = { - (normfunc)norm8, - (normfunc)norm16, - (normfunc)norm24, - (normfunc)norm32, -- (normfunc)normieee32 - }; -diff --git a/dlls/dsound/dsound_main.c b/dlls/dsound/dsound_main.c -index 112ce78..e89d857 100644 ---- a/dlls/dsound/dsound_main.c -+++ b/dlls/dsound/dsound_main.c -@@ -92,7 +92,7 @@ GUID DSOUND_capture_guids[MAXWAVEDRIVERS]; - WCHAR wine_vxd_drv[] = { 'w','i','n','e','m','m','.','v','x','d', 0 }; - - /* All default settings, you most likely don't want to touch these, see wiki on UsefulRegistryKeys */ --int ds_hel_buflen = 32768 * 2; -+int ds_hel_buflen = 32768; - static HINSTANCE instance; - - /* -diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h -index e180f7c..f142b7c 100644 ---- a/dlls/dsound/dsound_private.h -+++ b/dlls/dsound/dsound_private.h -@@ -87,7 +87,7 @@ struct DirectSoundDevice - int speaker_num[DS_MAX_CHANNELS]; - int num_speakers; - int lfe_channel; -- float *mix_buffer, *tmp_buffer; -+ float *tmp_buffer; - DWORD tmp_buffer_len, mix_buffer_len; - - DSVOLUMEPAN volpan; -@@ -100,7 +100,6 @@ struct DirectSoundDevice - - IMMDevice *mmdevice; - IAudioClient *client; -- IAudioClock *clock; - IAudioStreamVolume *volume; - IAudioRenderClient *render; - -@@ -206,13 +205,11 @@ void DSOUND_ParseSpeakerConfig(DirectSoundDevice *device) DECLSPEC_HIDDEN; - - /* primary.c */ - --HRESULT DSOUND_PrimaryCreate(DirectSoundDevice *device) DECLSPEC_HIDDEN; - HRESULT DSOUND_PrimaryDestroy(DirectSoundDevice *device) DECLSPEC_HIDDEN; - HRESULT DSOUND_PrimaryPlay(DirectSoundDevice *device) DECLSPEC_HIDDEN; - HRESULT DSOUND_PrimaryStop(DirectSoundDevice *device) DECLSPEC_HIDDEN; - LPWAVEFORMATEX DSOUND_CopyFormat(LPCWAVEFORMATEX wfex) DECLSPEC_HIDDEN; - HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) DECLSPEC_HIDDEN; --HRESULT DSOUND_PrimaryOpen(DirectSoundDevice *device) DECLSPEC_HIDDEN; - HRESULT primarybuffer_create(DirectSoundDevice *device, IDirectSoundBufferImpl **ppdsb, - const DSBUFFERDESC *dsbd) DECLSPEC_HIDDEN; - void primarybuffer_destroy(IDirectSoundBufferImpl *This) DECLSPEC_HIDDEN; -diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c -index c763650..155e378 100644 ---- a/dlls/dsound/mixer.c -+++ b/dlls/dsound/mixer.c -@@ -646,8 +646,7 @@ static void DSOUND_WaveQueue(DirectSoundDevice *device, LPBYTE pos, DWORD bytes) - * secondary->buffer (secondary format) - * =[Resample]=> device->tmp_buffer (float format) - * =[Volume]=> device->tmp_buffer (float format) -- * =[Mix]=> device->mix_buffer (float format) -- * =[Reformat]=> device->buffer (device format) -+ * =[Reformat]=> device->buffer (device format, skipped on float) - */ - static void DSOUND_PerformMix(DirectSoundDevice *device) - { -@@ -686,8 +685,7 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) - if (device->priolevel != DSSCL_WRITEPRIMARY) { - BOOL all_stopped = FALSE; - int nfiller; -- BOOL native = device->normfunction == normfunctions[4]; -- DWORD bpp = device->pwfx->wBitsPerSample>>3; -+ void *buffer = NULL; - - /* the sound of silence */ - nfiller = device->pwfx->wBitsPerSample == 8 ? 128 : 0; -@@ -701,43 +699,30 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) - TRACE("Buffer restarting\n"); - } - -- if (native) { -- void *buffer = NULL; -+ hr = IAudioRenderClient_GetBuffer(device->render, maxq / block, (void*)&buffer); -+ if(FAILED(hr)){ -+ WARN("GetBuffer failed: %08x\n", hr); -+ LeaveCriticalSection(&device->mixlock); -+ return; -+ } - -- hr = IAudioRenderClient_GetBuffer(device->render, maxq / block, (void*)&buffer); -- if(FAILED(hr)){ -- WARN("GetBuffer failed: %08x\n", hr); -- LeaveCriticalSection(&device->mixlock); -- return; -- } -- memset(buffer, nfiller, maxq); -+ memset(buffer, nfiller, maxq); - -+ if (!device->normfunction) - DSOUND_MixToPrimary(device, buffer, writepos, maxq, &all_stopped); -- -- hr = IAudioRenderClient_ReleaseBuffer(device->render, maxq / block, 0); -- if(FAILED(hr)) -- ERR("ReleaseBuffer failed: %08x\n", hr); -- -- device->pad += maxq; -- } else { -- memset(device->mix_buffer, nfiller, maxq); -+ else { - - /* do the mixing */ -- DSOUND_MixToPrimary(device, device->mix_buffer, writepos, maxq, &all_stopped); -+ DSOUND_MixToPrimary(device, (float*)device->buffer, writepos, maxq, &all_stopped); - -- if (maxq + writepos > device->buflen) { -- DWORD todo = device->buflen - writepos; -+ device->normfunction(device->buffer, buffer, maxq); -+ } - -- device->normfunction(device->mix_buffer, device->buffer + writepos, todo); -- DSOUND_WaveQueue(device, device->buffer + writepos, todo); -+ hr = IAudioRenderClient_ReleaseBuffer(device->render, maxq / block, 0); -+ if(FAILED(hr)) -+ ERR("ReleaseBuffer failed: %08x\n", hr); - -- device->normfunction(device->mix_buffer + todo / bpp, device->buffer, (maxq - todo)); -- DSOUND_WaveQueue(device, device->buffer, maxq - todo); -- } else { -- device->normfunction(device->mix_buffer, device->buffer + writepos, maxq); -- DSOUND_WaveQueue(device, device->buffer + writepos, maxq); -- } -- } -+ device->pad += maxq; - - if (maxq) { - if (device->state == STATE_STARTING || -@@ -755,6 +740,8 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) - DSOUND_PrimaryStop(device); - } - } else if (device->state != STATE_STOPPED) { -+ if (maxq > device->buflen) -+ maxq = device->buflen; - if (writepos + maxq > device->buflen) { - DSOUND_WaveQueue(device, device->buffer + writepos, device->buflen - writepos); - DSOUND_WaveQueue(device, device->buffer, writepos + maxq - device->buflen); -diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c -index 19a76b0..4bfae7e 100644 ---- a/dlls/dsound/primary.c -+++ b/dlls/dsound/primary.c -@@ -197,16 +197,8 @@ static HRESULT DSOUND_WaveFormat(DirectSoundDevice *device, IAudioClient *client - return S_OK; - } - --HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) -+static void DSOUND_ReleaseDevice(DirectSoundDevice *device) - { -- WAVEFORMATEX *wfx = NULL; -- HRESULT hres; -- REFERENCE_TIME period, buflen = 800000; -- UINT32 frames; -- DWORD period_ms; -- -- TRACE("(%p, %d)\n", device, forcewave); -- - if(device->client){ - IAudioClient_Release(device->client); - device->client = NULL; -@@ -215,10 +207,6 @@ HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) - IAudioRenderClient_Release(device->render); - device->render = NULL; - } -- if(device->clock){ -- IAudioClock_Release(device->clock); -- device->clock = NULL; -- } - if(device->volume){ - IAudioStreamVolume_Release(device->volume); - device->volume = NULL; -@@ -229,92 +217,171 @@ HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) - device->playpos %= device->buflen; - device->pad = 0; - } -+} - -- hres = IMMDevice_Activate(device->mmdevice, &IID_IAudioClient, -- CLSCTX_INPROC_SERVER, NULL, (void **)&device->client); -- if(FAILED(hres)) { -- WARN("Activate failed: %08x\n", hres); -- return hres; -- } -+static HRESULT DSOUND_PrimaryOpen(DirectSoundDevice *device, WAVEFORMATEX *wfx, DWORD aclen, BOOL forcewave) -+{ -+ IDirectSoundBufferImpl** dsb = device->buffers; -+ LPBYTE newbuf; -+ DWORD new_buflen; -+ BOOL mixfloat = FALSE; -+ int i; - -- device->speaker_config = DSOUND_FindSpeakerConfig(device->mmdevice, 0); -+ TRACE("(%p)\n", device); - -- DSOUND_ParseSpeakerConfig(device); -+ new_buflen = device->buflen; -+ new_buflen -= new_buflen % wfx->nBlockAlign; - -- hres = DSOUND_WaveFormat(device, device->client, forcewave, &wfx); -- if (FAILED(hres)) { -- IAudioClient_Release(device->client); -- device->client = NULL; -- return hres; -+ if (wfx->wFormatTag == WAVE_FORMAT_IEEE_FLOAT || -+ (wfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE && -+ IsEqualGUID(&((WAVEFORMATEXTENSIBLE*)wfx)->SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT))) -+ mixfloat = TRUE; -+ -+ /* reallocate emulated primary buffer */ -+ if (forcewave) { -+ if (device->buffer) -+ newbuf = HeapReAlloc(GetProcessHeap(), 0, device->buffer, new_buflen); -+ else -+ newbuf = HeapAlloc(GetProcessHeap(), 0, new_buflen); -+ -+ if (!newbuf) { -+ ERR("failed to allocate primary buffer\n"); -+ return DSERR_OUTOFMEMORY; -+ } -+ device->mix_buffer_len = 0; -+ } else if (!mixfloat) { -+ DWORD alloc_len = aclen / (wfx->nBlockAlign / 8) * sizeof(float); -+ -+ if (device->buffer) -+ newbuf = HeapReAlloc(GetProcessHeap(), 0, device->buffer, alloc_len); -+ else -+ newbuf = HeapAlloc(GetProcessHeap(), 0, alloc_len); -+ -+ if (!newbuf) { -+ ERR("failed to allocate primary buffer\n"); -+ return DSERR_OUTOFMEMORY; -+ } -+ device->mix_buffer_len = alloc_len; -+ } else { -+ HeapFree(GetProcessHeap(), 0, device->buffer); -+ newbuf = NULL; -+ device->mix_buffer_len = 0; - } -+ -+ device->buffer = newbuf; -+ device->buflen = new_buflen; - HeapFree(GetProcessHeap(), 0, device->pwfx); - device->pwfx = wfx; - -- hres = IAudioClient_Initialize(device->client, -- AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_NOPERSIST | -- AUDCLNT_STREAMFLAGS_EVENTCALLBACK, buflen, 0, device->pwfx, NULL); -- if(FAILED(hres)){ -- IAudioClient_Release(device->client); -- device->client = NULL; -- WARN("Initialize failed: %08x\n", hres); -- return hres; -+ if (device->state == STATE_PLAYING) -+ device->state = STATE_STARTING; -+ else if (device->state == STATE_STOPPING) -+ device->state = STATE_STOPPED; -+ -+ device->writelead = (wfx->nSamplesPerSec / 100) * wfx->nBlockAlign; -+ -+ TRACE("buflen: %u, fraglen: %u, mix_buffer_len: %u\n", -+ device->buflen, device->fraglen, device->mix_buffer_len); -+ -+ if (!forcewave && !mixfloat) -+ device->normfunction = normfunctions[wfx->nBlockAlign/8 - 1]; -+ else -+ device->normfunction = NULL; -+ -+ if (device->mix_buffer_len) -+ FillMemory(device->buffer, device->mix_buffer_len, 0); -+ else if (device->buffer) -+ FillMemory(device->buffer, device->buflen, (wfx->wBitsPerSample == 8) ? 128 : 0); -+ device->playpos = 0; -+ -+ for (i = 0; i < device->nrofbuffers; i++) { -+ RtlAcquireResourceExclusive(&dsb[i]->lock, TRUE); -+ DSOUND_RecalcFormat(dsb[i]); -+ RtlReleaseResource(&dsb[i]->lock); - } -- IAudioClient_SetEventHandle(device->client, device->sleepev); - -- hres = IAudioClient_GetService(device->client, &IID_IAudioRenderClient, -- (void**)&device->render); -+ return DS_OK; -+} -+ -+HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) -+{ -+ HRESULT hres; -+ REFERENCE_TIME period; -+ UINT32 frames; -+ DWORD period_ms; -+ IAudioClient *client = NULL; -+ IAudioRenderClient *render = NULL; -+ IAudioStreamVolume *volume = NULL; -+ DWORD fraglen, aclen; -+ WAVEFORMATEX *wfx = NULL; -+ DWORD oldspeakerconfig = device->speaker_config; -+ -+ TRACE("(%p, %d)\n", device, forcewave); -+ -+ hres = IMMDevice_Activate(device->mmdevice, &IID_IAudioClient, -+ CLSCTX_INPROC_SERVER, NULL, (void **)&client); - if(FAILED(hres)){ -- IAudioClient_Release(device->client); -- device->client = NULL; -- WARN("GetService failed: %08x\n", hres); -+ WARN("Activate failed: %08x\n", hres); - return hres; - } - -- hres = IAudioClient_GetService(device->client, &IID_IAudioClock, -- (void**)&device->clock); -- if(FAILED(hres)){ -- IAudioClient_Release(device->client); -- IAudioRenderClient_Release(device->render); -- device->client = NULL; -- device->render = NULL; -- WARN("GetService failed: %08x\n", hres); -+ hres = DSOUND_WaveFormat(device, client, forcewave, &wfx); -+ if (FAILED(hres)) { -+ IAudioClient_Release(client); - return hres; - } - -- hres = IAudioClient_GetService(device->client, &IID_IAudioStreamVolume, -- (void**)&device->volume); -+ hres = IAudioClient_Initialize(client, -+ AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_NOPERSIST | -+ AUDCLNT_STREAMFLAGS_EVENTCALLBACK, 800000, 0, wfx, NULL); - if(FAILED(hres)){ -- IAudioClient_Release(device->client); -- IAudioRenderClient_Release(device->render); -- IAudioClock_Release(device->clock); -- device->client = NULL; -- device->render = NULL; -- device->clock = NULL; -- WARN("GetService failed: %08x\n", hres); -+ IAudioClient_Release(client); -+ ERR("Initialize failed: %08x\n", hres); - return hres; - } - -- /* Now kick off the timer so the event fires periodically */ -- hres = IAudioClient_Start(device->client); -- if (FAILED(hres)) -- WARN("starting failed with %08x\n", hres); -+ IAudioClient_SetEventHandle(client, device->sleepev); -+ -+ hres = IAudioClient_GetService(client, &IID_IAudioRenderClient, (void**)&render); -+ if(FAILED(hres)) -+ goto err_service; -+ -+ hres = IAudioClient_GetService(client, &IID_IAudioStreamVolume, (void**)&volume); -+ if(FAILED(hres)) -+ goto err_service; - -- hres = IAudioClient_GetStreamLatency(device->client, &period); -+ /* Now kick off the timer so the event fires periodically */ -+ hres = IAudioClient_Start(client); -+ if (FAILED(hres)) { -+ WARN("Start failed with %08x\n", hres); -+ goto err; -+ } -+ hres = IAudioClient_GetStreamLatency(client, &period); - if (FAILED(hres)) { - WARN("GetStreamLatency failed with %08x\n", hres); -- period = 100000; -+ goto err; - } -- period_ms = (period + 9999) / 10000; -- -- hres = IAudioClient_GetBufferSize(device->client, &frames); -+ hres = IAudioClient_GetBufferSize(client, &frames); - if (FAILED(hres)) { - WARN("GetBufferSize failed with %08x\n", hres); -- frames = (UINT64)device->pwfx->nSamplesPerSec * buflen / 10000000; -+ goto err; - } - -- device->fraglen = MulDiv(device->pwfx->nSamplesPerSec, period, 10000000) * device->pwfx->nBlockAlign; -- device->aclen = frames * device->pwfx->nBlockAlign; -- TRACE("period %u ms fraglen %u buflen %u\n", period_ms, device->fraglen, device->aclen); -+ period_ms = (period + 9999) / 10000; -+ fraglen = MulDiv(wfx->nSamplesPerSec, period, 10000000) * wfx->nBlockAlign; -+ aclen = frames * wfx->nBlockAlign; -+ TRACE("period %u ms fraglen %u buflen %u\n", period_ms, fraglen, aclen); -+ -+ hres = DSOUND_PrimaryOpen(device, wfx, aclen, forcewave); -+ if(FAILED(hres)) -+ goto err; -+ -+ DSOUND_ReleaseDevice(device); -+ device->client = client; -+ device->render = render; -+ device->volume = volume; -+ device->fraglen = fraglen; -+ device->aclen = aclen; - - if (period_ms < 3) - device->sleeptime = 5; -@@ -322,107 +389,20 @@ HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) - device->sleeptime = period_ms * 5 / 2; - - return S_OK; --} -- --HRESULT DSOUND_PrimaryOpen(DirectSoundDevice *device) --{ -- IDirectSoundBufferImpl** dsb = device->buffers; -- LPBYTE newbuf; -- int i; -- -- TRACE("(%p)\n", device); -- -- /* on original windows, the buffer it set to a fixed size, no matter what the settings are. -- on windows this size is always fixed (tested on win-xp) */ -- if (!device->buflen) -- device->buflen = ds_hel_buflen; -- device->buflen -= device->buflen % device->pwfx->nBlockAlign; -- -- HeapFree(GetProcessHeap(), 0, device->mix_buffer); -- device->mix_buffer_len = (device->buflen / (device->pwfx->wBitsPerSample / 8)) * sizeof(float); -- device->mix_buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, device->mix_buffer_len); -- if (!device->mix_buffer) -- return DSERR_OUTOFMEMORY; -- -- if (device->state == STATE_PLAYING) device->state = STATE_STARTING; -- else if (device->state == STATE_STOPPING) device->state = STATE_STOPPED; -- -- /* reallocate emulated primary buffer */ -- if (device->buffer) -- newbuf = HeapReAlloc(GetProcessHeap(),0,device->buffer, device->buflen); -- else -- newbuf = HeapAlloc(GetProcessHeap(),0, device->buflen); -- -- if (!newbuf) { -- ERR("failed to allocate primary buffer\n"); -- return DSERR_OUTOFMEMORY; -- /* but the old buffer might still exist and must be re-prepared */ -- } -- -- device->writelead = (device->pwfx->nSamplesPerSec / 100) * device->pwfx->nBlockAlign; -- -- device->buffer = newbuf; -- -- TRACE("buflen: %u, fraglen: %u, mix_buffer_len: %u\n", -- device->buflen, device->fraglen, device->mix_buffer_len); -- -- if(device->pwfx->wFormatTag == WAVE_FORMAT_IEEE_FLOAT || -- (device->pwfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE && -- IsEqualGUID(&((WAVEFORMATEXTENSIBLE*)device->pwfx)->SubFormat, -- &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT))) -- device->normfunction = normfunctions[4]; -- else -- device->normfunction = normfunctions[device->pwfx->wBitsPerSample/8 - 1]; -- -- FillMemory(device->buffer, device->buflen, (device->pwfx->wBitsPerSample == 8) ? 128 : 0); -- FillMemory(device->mix_buffer, device->mix_buffer_len, 0); -- device->playpos = 0; - -- if (device->pwfx->wFormatTag == WAVE_FORMAT_IEEE_FLOAT || -- (device->pwfx->wFormatTag == WAVE_FORMAT_EXTENSIBLE && -- IsEqualGUID(&((WAVEFORMATEXTENSIBLE*)device->pwfx)->SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT))) -- device->normfunction = normfunctions[4]; -- else -- device->normfunction = normfunctions[device->pwfx->wBitsPerSample/8 - 1]; -- -- for (i = 0; i < device->nrofbuffers; i++) { -- RtlAcquireResourceExclusive(&dsb[i]->lock, TRUE); -- DSOUND_RecalcFormat(dsb[i]); -- RtlReleaseResource(&dsb[i]->lock); -- } -- -- return DS_OK; --} -- -- --static void DSOUND_PrimaryClose(DirectSoundDevice *device) --{ -- HRESULT hr; -- -- TRACE("(%p)\n", device); -- -- if(device->client){ -- hr = IAudioClient_Stop(device->client); -- if(FAILED(hr)) -- WARN("Stop failed: %08x\n", hr); -- } --} -- --HRESULT DSOUND_PrimaryCreate(DirectSoundDevice *device) --{ -- HRESULT err = DS_OK; -- TRACE("(%p)\n", device); -- -- device->buflen = ds_hel_buflen; -- err = DSOUND_PrimaryOpen(device); -- -- if (err != DS_OK) { -- WARN("DSOUND_PrimaryOpen failed\n"); -- return err; -- } -- -- device->state = STATE_STOPPED; -- return DS_OK; -+err_service: -+ ERR("GetService failed: %08x\n", hres); -+err: -+ device->speaker_config = oldspeakerconfig; -+ DSOUND_ParseSpeakerConfig(device); -+ if (volume) -+ IAudioStreamVolume_Release(volume); -+ if (render) -+ IAudioRenderClient_Release(render); -+ if (client) -+ IAudioClient_Release(client); -+ HeapFree(GetProcessHeap(), 0, wfx); -+ return hres; - } - - HRESULT DSOUND_PrimaryDestroy(DirectSoundDevice *device) -@@ -432,8 +412,6 @@ HRESULT DSOUND_PrimaryDestroy(DirectSoundDevice *device) - /* **** */ - EnterCriticalSection(&(device->mixlock)); - -- DSOUND_PrimaryClose(device); -- - if(device->primary && (device->primary->ref || device->primary->numIfaces)) - WARN("Destroying primary buffer while references held (%u %u)\n", device->primary->ref, device->primary->numIfaces); - -@@ -509,7 +487,6 @@ HRESULT primarybuffer_SetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX passe - HRESULT err = S_OK; - WAVEFORMATEX *old_fmt; - WAVEFORMATEXTENSIBLE *fmtex, *passed_fmtex = (WAVEFORMATEXTENSIBLE*)passed_fmt; -- BOOL forced = (device->priolevel == DSSCL_WRITEPRIMARY); - - TRACE("(%p,%p)\n", device, passed_fmt); - -@@ -559,24 +536,12 @@ HRESULT primarybuffer_SetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX passe - fmtex->Samples.wValidBitsPerSample = fmtex->Format.wBitsPerSample; - } - -- DSOUND_PrimaryClose(device); -- -- err = DSOUND_ReopenDevice(device, forced); -+ err = DSOUND_ReopenDevice(device, TRUE); - if (FAILED(err)) { - ERR("No formats could be opened\n"); -- goto done; -- } -- -- err = DSOUND_PrimaryOpen(device); -- if (err != DS_OK) { -- ERR("DSOUND_PrimaryOpen failed\n"); -- goto done; -- } -- --done: -- if (err != DS_OK) -+ HeapFree(GetProcessHeap(), 0, device->primary_pwfx); - device->primary_pwfx = old_fmt; -- else -+ } else - HeapFree(GetProcessHeap(), 0, old_fmt); - } else { - WAVEFORMATEX *wfx = DSOUND_CopyFormat(passed_fmt); --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0048-dsound-remove-state-machine-from-render-buffer.patch wine1.7-1.7.55/debian/patches/0048-dsound-remove-state-machine-from-render-buffer.patch --- wine1.7-1.7.50/debian/patches/0048-dsound-remove-state-machine-from-render-buffer.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0048-dsound-remove-state-machine-from-render-buffer.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,220 +0,0 @@ -From 2ee71275bd70368cf2b6f6aeed003afebf6b8987 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 16 Mar 2015 14:33:41 +0100 -Subject: [PATCH 48/50] dsound: remove state machine from render buffer - -.. wat ---- - dlls/dsound/dsound.c | 2 +- - dlls/dsound/dsound_private.h | 2 +- - dlls/dsound/mixer.c | 36 +------------------------ - dlls/dsound/primary.c | 64 ++++---------------------------------------- - 4 files changed, 8 insertions(+), 96 deletions(-) - -diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c -index 3828bed..492f546 100644 ---- a/dlls/dsound/dsound.c -+++ b/dlls/dsound/dsound.c -@@ -135,7 +135,7 @@ static HRESULT DirectSoundDevice_Create(DirectSoundDevice ** ppDevice) - - device->ref = 1; - device->priolevel = DSSCL_NORMAL; -- device->state = STATE_STOPPED; -+ device->stopped = 1; - device->speaker_config = DSSPEAKER_COMBINED(DSSPEAKER_STEREO, DSSPEAKER_GEOMETRY_WIDE); - - DSOUND_ParseSpeakerConfig(device); -diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h -index f142b7c..44bd527 100644 ---- a/dlls/dsound/dsound_private.h -+++ b/dlls/dsound/dsound_private.h -@@ -76,7 +76,7 @@ struct DirectSoundDevice - DWORD priolevel, sleeptime; - PWAVEFORMATEX pwfx, primary_pwfx; - LPBYTE buffer; -- DWORD writelead, buflen, aclen, fraglen, state, playpos, pad; -+ DWORD writelead, buflen, aclen, fraglen, playpos, pad, stopped; - int nrofbuffers; - IDirectSoundBufferImpl** buffers; - RTL_RWLOCK buffer_list_lock; -diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c -index 155e378..794d9c4 100644 ---- a/dlls/dsound/mixer.c -+++ b/dlls/dsound/mixer.c -@@ -694,10 +694,6 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) - * also wipe out just-played sound data */ - if (!pad) - WARN("Probable buffer underrun\n"); -- else if (device->state == STATE_STOPPED || -- device->state == STATE_STARTING) { -- TRACE("Buffer restarting\n"); -- } - - hr = IAudioRenderClient_GetBuffer(device->render, maxq / block, (void*)&buffer); - if(FAILED(hr)){ -@@ -723,23 +719,7 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) - ERR("ReleaseBuffer failed: %08x\n", hr); - - device->pad += maxq; -- -- if (maxq) { -- if (device->state == STATE_STARTING || -- device->state == STATE_STOPPED) { -- if(DSOUND_PrimaryPlay(device) != DS_OK) -- WARN("DSOUND_PrimaryPlay failed\n"); -- else if (device->state == STATE_STARTING) -- device->state = STATE_PLAYING; -- else -- device->state = STATE_STOPPING; -- } -- } else if (!pad && !maxq && (all_stopped == TRUE) && -- (device->state == STATE_STOPPING)) { -- device->state = STATE_STOPPED; -- DSOUND_PrimaryStop(device); -- } -- } else if (device->state != STATE_STOPPED) { -+ } else if (!device->stopped) { - if (maxq > device->buflen) - maxq = device->buflen; - if (writepos + maxq > device->buflen) { -@@ -747,20 +727,6 @@ static void DSOUND_PerformMix(DirectSoundDevice *device) - DSOUND_WaveQueue(device, device->buffer, writepos + maxq - device->buflen); - } else - DSOUND_WaveQueue(device, device->buffer + writepos, maxq); -- -- /* in the DSSCL_WRITEPRIMARY mode, the app is totally in charge... */ -- if (device->state == STATE_STARTING) { -- if (DSOUND_PrimaryPlay(device) != DS_OK) -- WARN("DSOUND_PrimaryPlay failed\n"); -- else -- device->state = STATE_PLAYING; -- } -- else if (device->state == STATE_STOPPING) { -- if (DSOUND_PrimaryStop(device) != DS_OK) -- WARN("DSOUND_PrimaryStop failed\n"); -- else -- device->state = STATE_STOPPED; -- } - } - - LeaveCriticalSection(&(device->mixlock)); -diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c -index 4bfae7e..0f83eb9 100644 ---- a/dlls/dsound/primary.c -+++ b/dlls/dsound/primary.c -@@ -273,11 +273,6 @@ static HRESULT DSOUND_PrimaryOpen(DirectSoundDevice *device, WAVEFORMATEX *wfx, - HeapFree(GetProcessHeap(), 0, device->pwfx); - device->pwfx = wfx; - -- if (device->state == STATE_PLAYING) -- device->state = STATE_STARTING; -- else if (device->state == STATE_STOPPING) -- device->state = STATE_STOPPED; -- - device->writelead = (wfx->nSamplesPerSec / 100) * wfx->nBlockAlign; - - TRACE("buflen: %u, fraglen: %u, mix_buffer_len: %u\n", -@@ -391,7 +386,7 @@ HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) - return S_OK; - - err_service: -- ERR("GetService failed: %08x\n", hres); -+ WARN("GetService failed: %08x\n", hres); - err: - device->speaker_config = oldspeakerconfig; - DSOUND_ParseSpeakerConfig(device); -@@ -428,36 +423,6 @@ HRESULT DSOUND_PrimaryDestroy(DirectSoundDevice *device) - return DS_OK; - } - --HRESULT DSOUND_PrimaryPlay(DirectSoundDevice *device) --{ -- HRESULT hr; -- -- TRACE("(%p)\n", device); -- -- hr = IAudioClient_Start(device->client); -- if(FAILED(hr) && hr != AUDCLNT_E_NOT_STOPPED){ -- WARN("Start failed: %08x\n", hr); -- return hr; -- } -- -- return DS_OK; --} -- --HRESULT DSOUND_PrimaryStop(DirectSoundDevice *device) --{ -- HRESULT hr; -- -- TRACE("(%p)\n", device); -- -- hr = IAudioClient_Stop(device->client); -- if(FAILED(hr)){ -- WARN("Stop failed: %08x\n", hr); -- return hr; -- } -- -- return DS_OK; --} -- - WAVEFORMATEX *DSOUND_CopyFormat(const WAVEFORMATEX *wfex) - { - WAVEFORMATEX *pwfx; -@@ -705,16 +670,7 @@ static HRESULT WINAPI PrimaryBufferImpl_Play(IDirectSoundBuffer *iface, DWORD re - return DSERR_INVALIDPARAM; - } - -- /* **** */ -- EnterCriticalSection(&(device->mixlock)); -- -- if (device->state == STATE_STOPPED) -- device->state = STATE_STARTING; -- else if (device->state == STATE_STOPPING) -- device->state = STATE_PLAYING; -- -- LeaveCriticalSection(&(device->mixlock)); -- /* **** */ -+ device->stopped = 0; - - return DS_OK; - } -@@ -725,16 +681,7 @@ static HRESULT WINAPI PrimaryBufferImpl_Stop(IDirectSoundBuffer *iface) - DirectSoundDevice *device = This->device; - TRACE("(%p)\n", iface); - -- /* **** */ -- EnterCriticalSection(&(device->mixlock)); -- -- if (device->state == STATE_PLAYING) -- device->state = STATE_STOPPING; -- else if (device->state == STATE_STARTING) -- device->state = STATE_STOPPED; -- -- LeaveCriticalSection(&(device->mixlock)); -- /* **** */ -+ device->stopped = 1; - - return DS_OK; - } -@@ -802,7 +749,7 @@ static HRESULT WINAPI PrimaryBufferImpl_GetCurrentPosition(IDirectSoundBuffer *i - *playpos = mixpos; - if (writepos) { - *writepos = mixpos; -- if (device->state != STATE_STOPPED) { -+ if (!device->stopped) { - /* apply the documented 10ms lead to writepos */ - *writepos += device->writelead; - *writepos %= device->buflen; -@@ -828,8 +775,7 @@ static HRESULT WINAPI PrimaryBufferImpl_GetStatus(IDirectSoundBuffer *iface, DWO - } - - *status = 0; -- if ((device->state == STATE_STARTING) || -- (device->state == STATE_PLAYING)) -+ if (!device->stopped) - *status |= DSBSTATUS_PLAYING | DSBSTATUS_LOOPING; - - TRACE("status=%x\n", *status); --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0049-dsound-kill-unconditional-memory-allocation-in-mixin.patch wine1.7-1.7.55/debian/patches/0049-dsound-kill-unconditional-memory-allocation-in-mixin.patch --- wine1.7-1.7.50/debian/patches/0049-dsound-kill-unconditional-memory-allocation-in-mixin.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0049-dsound-kill-unconditional-memory-allocation-in-mixin.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,105 +0,0 @@ -From e3791e611d369f142cba4d0564da747c0dd24ed2 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 16 Mar 2015 14:33:41 +0100 -Subject: [PATCH 49/50] dsound: kill unconditional memory allocation in mixing - thread - -Unfortunately this doesn't get rid of the memory allocation entirely, -but it will decrease the chance of underruns due to locking immensely. - -Signed-off-by: Maarten Lankhorst ---- - dlls/dsound/dsound.c | 1 + - dlls/dsound/dsound_private.h | 4 ++-- - dlls/dsound/mixer.c | 27 ++++++++++++++++++--------- - 3 files changed, 21 insertions(+), 11 deletions(-) - -diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c -index 492f546..8249bcb 100644 ---- a/dlls/dsound/dsound.c -+++ b/dlls/dsound/dsound.c -@@ -234,6 +234,7 @@ static ULONG DirectSoundDevice_Release(DirectSoundDevice * device) - IAudioStreamVolume_Release(device->volume); - - HeapFree(GetProcessHeap(), 0, device->tmp_buffer); -+ HeapFree(GetProcessHeap(), 0, device->cp_buffer); - HeapFree(GetProcessHeap(), 0, device->buffer); - RtlDeleteResource(&device->buffer_list_lock); - device->mixlock.DebugInfo->Spare[0] = 0; -diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h -index 44bd527..04067e1 100644 ---- a/dlls/dsound/dsound_private.h -+++ b/dlls/dsound/dsound_private.h -@@ -87,8 +87,8 @@ struct DirectSoundDevice - int speaker_num[DS_MAX_CHANNELS]; - int num_speakers; - int lfe_channel; -- float *tmp_buffer; -- DWORD tmp_buffer_len, mix_buffer_len; -+ float *tmp_buffer, *cp_buffer; -+ DWORD tmp_buffer_len, mix_buffer_len, cp_buffer_len; - - DSVOLUMEPAN volpan; - -diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c -index 794d9c4..39dc4a4 100644 ---- a/dlls/dsound/mixer.c -+++ b/dlls/dsound/mixer.c -@@ -282,7 +282,8 @@ static UINT cp_fields_resample(IDirectSoundBufferImpl *dsb, UINT count, LONG64 * - { - UINT i, channel; - UINT istride = dsb->pwfx->nBlockAlign; -- UINT ostride = dsb->device->pwfx->nChannels * sizeof(float); -+ DirectSoundDevice *dev = dsb->device; -+ UINT ostride = dev->pwfx->nChannels * sizeof(float); - - LONG64 freqAcc_start = *freqAccNum; - LONG64 freqAcc_end = freqAcc_start + count * dsb->freqAdjustNum; -@@ -292,18 +293,29 @@ static UINT cp_fields_resample(IDirectSoundBufferImpl *dsb, UINT count, LONG64 * - - UINT fir_cachesize = (fir_len + dsbfirstep - 2) / dsbfirstep; - UINT required_input = max_ipos + fir_cachesize; -+ float *intermediate, *fir_copy, *itmp; -+ -+ DWORD len = required_input * channels; -+ len += fir_cachesize; -+ len *= sizeof(float); -+ -+ if (!dev->cp_buffer) { -+ dev->cp_buffer = HeapAlloc(GetProcessHeap(), 0, len); -+ dev->cp_buffer_len = len; -+ } else if (len > dev->cp_buffer_len) { -+ dev->cp_buffer = HeapReAlloc(GetProcessHeap(), 0, dev->cp_buffer, len); -+ dev->cp_buffer_len = len; -+ } - -- float* intermediate = HeapAlloc(GetProcessHeap(), 0, -- sizeof(float) * required_input * channels); -+ fir_copy = dev->cp_buffer; -+ intermediate = fir_copy + fir_cachesize; - -- float* fir_copy = HeapAlloc(GetProcessHeap(), 0, -- sizeof(float) * fir_cachesize); - - /* Important: this buffer MUST be non-interleaved - * if you want -msse3 to have any effect. - * This is good for CPU cache effects, too. - */ -- float* itmp = intermediate; -+ itmp = intermediate; - for (channel = 0; channel < channels; channel++) - for (i = 0; i < required_input; i++) - *(itmp++) = get_current_sample(dsb, -@@ -338,9 +350,6 @@ static UINT cp_fields_resample(IDirectSoundBufferImpl *dsb, UINT count, LONG64 * - - *freqAccNum = freqAcc_end % dsb->freqAdjustDen; - -- HeapFree(GetProcessHeap(), 0, fir_copy); -- HeapFree(GetProcessHeap(), 0, intermediate); -- - return max_ipos; - } - --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/0050-TESTING-override-pthreads-to-fix-gstreamer-v5.patch wine1.7-1.7.55/debian/patches/0050-TESTING-override-pthreads-to-fix-gstreamer-v5.patch --- wine1.7-1.7.50/debian/patches/0050-TESTING-override-pthreads-to-fix-gstreamer-v5.patch 2015-06-12 06:27:05.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/0050-TESTING-override-pthreads-to-fix-gstreamer-v5.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,657 +0,0 @@ -From 1c0bdd650a24f95885c3e3d000236d120019dc0b Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Mon, 16 Mar 2015 14:33:41 +0100 -Subject: [PATCH 50/50] TESTING -- override pthreads to fix gstreamer v5 - -I believe the code is ready and will work properly now in all cases. -but please test before cherry picking this patch, and report -success or failure to me please. - -Changes since v1: - - Call pthread_yield to make sure that we link against libpthread. - This fixes the build on saucy. -Changes since v2: - - Set thread_data->detached before creating the thread to prevent - a race condition. -Changes since v3: - - Set thread_data->detached CORRECTLY. Fix a small race between - thread creation and pthread_detach. -Changes since v4: - - Set native thread stack defaults in a similar way to eglibc, - and respect the defaults for win32 again. This fixes the regression - where you can only create 194 threads in java. ---- - dlls/ntdll/ntdll_misc.h | 3 + - dlls/ntdll/thread.c | 331 ++++++++++++++++++++++++++++++++++++++-- - dlls/winegstreamer/glibthread.c | 13 ++ - libs/wine/loader.c | 7 + - libs/wine/wine.map | 6 + - loader/Makefile.in | 2 +- - loader/main.c | 41 +++++ - 7 files changed, 386 insertions(+), 17 deletions(-) - -diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h -index cbd19db..52b8e8d 100644 ---- a/dlls/ntdll/ntdll_misc.h -+++ b/dlls/ntdll/ntdll_misc.h -@@ -28,6 +28,7 @@ - #include "winnt.h" - #include "winternl.h" - #include "wine/server.h" -+#include "wine/list.h" - - #define MAX_NT_PATH_LENGTH 277 - -@@ -240,6 +241,8 @@ struct ntdll_thread_data - WINE_VM86_TEB_INFO vm86; /* 1fc vm86 private data */ - void *exit_frame; /* 204 exit frame pointer */ - #endif -+ struct list entry; -+ BOOL detached; - }; - - static inline struct ntdll_thread_data *ntdll_get_thread_data(void) -diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c -index 3696c8e..a33bf47 100644 ---- a/dlls/ntdll/thread.c -+++ b/dlls/ntdll/thread.c -@@ -33,6 +33,7 @@ - #ifdef HAVE_SYS_SYSCALL_H - #include - #endif -+#include - - #define NONAMELESSUNION - #include "ntstatus.h" -@@ -58,6 +59,7 @@ struct startup_info - TEB *teb; - PRTL_THREAD_START_ROUTINE entry_point; - void *entry_arg; -+ BOOL native_thread; - }; - - static PEB *peb; -@@ -202,6 +204,80 @@ static ULONG64 get_dyld_image_info_addr(void) - } - #endif /* __APPLE__ */ - -+#ifdef __linux__ -+#include -+ -+extern typeof(pthread_create) *__glob_pthread_create, *call_pthread_create; -+extern typeof(pthread_join) *__glob_pthread_join, *call_pthread_join; -+extern typeof(pthread_detach) *__glob_pthread_detach, *call_pthread_detach; -+ -+static typeof(pthread_create) __hook_pthread_create; -+static typeof(pthread_join) __hook_pthread_join; -+static typeof(pthread_detach) __hook_pthread_detach; -+ -+static pthread_mutex_t thread_lock; -+ -+static void thread_wrap_init(void) -+{ -+ pthread_mutexattr_t attr; -+ pthread_mutexattr_init(&attr); -+ pthread_mutexattr_setrobust(&attr, PTHREAD_MUTEX_ROBUST); -+ pthread_mutex_init(&thread_lock, &attr); -+ pthread_mutexattr_destroy(&attr); -+ -+ call_pthread_create = __hook_pthread_create; -+ call_pthread_join = __hook_pthread_join; -+ call_pthread_detach = __hook_pthread_detach; -+} -+ -+static TEB *dead_teb; -+static struct list active_list = LIST_INIT(active_list); -+ -+static void take_thread_lock(void) -+{ -+ int ret = pthread_mutex_lock(&thread_lock); -+ if (ret == EOWNERDEAD) -+ pthread_mutex_consistent(&thread_lock); -+} -+ -+static void detach_thread_unlock(TEB *own_teb) -+{ -+ struct ntdll_thread_data *thread_data; -+ TEB *teb = dead_teb; -+ -+ dead_teb = own_teb; -+ -+ pthread_mutex_unlock(&thread_lock); -+ if (!teb) -+ return; -+ -+ thread_data = (struct ntdll_thread_data *)teb->SpareBytes1; -+ __glob_pthread_join(thread_data->pthread_id, NULL); -+ signal_free_thread(teb); -+} -+ -+static void reap_thread(TEB *teb) -+{ -+ struct ntdll_thread_data *thread_data = (struct ntdll_thread_data *)teb->SpareBytes1; -+ take_thread_lock(); -+ if (thread_data->detached) -+ detach_thread_unlock(teb); -+ else { -+ /* -+ * Do not unlock, wait until the thread is thoroughly dead. -+ * This prevents a race condition where detach is called -+ * after the thread has not finished dying yet. -+ */ -+ } -+} -+ -+#else -+#define __glob_pthread_create pthread_create -+#define __glob_pthread_join pthread_join -+#define __glob_pthread_detach pthread_detach -+#define thread_wrap_init() -+#endif -+ - /*********************************************************************** - * thread_init - * -@@ -223,6 +299,7 @@ HANDLE thread_init(void) - ULONG64 dyld_image_info; - #endif - -+ thread_wrap_init(); - virtual_init(); - - /* reserve space for shared user data */ -@@ -363,14 +440,12 @@ void terminate_thread( int status ) - pthread_exit( UIntToPtr(status) ); - } - -- --/*********************************************************************** -- * exit_thread -- */ --void exit_thread( int status ) -+static void exit_thread_common( int status ) - { -+#ifndef __linux__ - static void *prev_teb; - TEB *teb; -+#endif - - if (status) /* send the exit code to the server (0 is already the default) */ - { -@@ -394,24 +469,199 @@ void exit_thread( int status ) - - pthread_sigmask( SIG_BLOCK, &server_block_set, NULL ); - -+#ifndef __linux__ - if ((teb = interlocked_xchg_ptr( &prev_teb, NtCurrentTeb() ))) - { - struct ntdll_thread_data *thread_data = (struct ntdll_thread_data *)teb->SpareBytes1; - - if (thread_data->pthread_id) - { -- pthread_join( thread_data->pthread_id, NULL ); -+ __glob_pthread_join( thread_data->pthread_id, NULL ); - signal_free_thread( teb ); - } - } -+#else -+ reap_thread(NtCurrentTeb()); -+#endif - - close( ntdll_get_thread_data()->wait_fd[0] ); - close( ntdll_get_thread_data()->wait_fd[1] ); - close( ntdll_get_thread_data()->reply_fd ); - close( ntdll_get_thread_data()->request_fd ); -+} -+ -+void exit_thread( int status ) -+{ -+ exit_thread_common(status); - pthread_exit( UIntToPtr(status) ); - } - -+#ifdef __linux__ -+ -+struct unix_arg { -+ void *(*start)(void *); -+ void *arg; -+}; -+ -+/* dummy used for comparison */ -+static DWORD native_unix_start; -+ -+static void call_native_cleanup(void *arg) -+{ -+ exit_thread_common(0); -+} -+ -+static int -+__hook_pthread_create(pthread_t *thread, const pthread_attr_t *attr, -+ void *(*start_routine) (void *), void *parm) -+{ -+ NTSTATUS ret; -+ pthread_t tid; -+ size_t stack = 0, stack_commit; -+ static size_t default_stack; -+ struct unix_arg arg; -+ IMAGE_NT_HEADERS *nt; -+ -+ arg.start = start_routine; -+ arg.arg = parm; -+ -+ if (!default_stack) { -+ struct rlimit limit; -+ -+ if (getrlimit(RLIMIT_STACK, &limit) == 0 && -+ limit.rlim_cur != RLIM_INFINITY) -+ default_stack = limit.rlim_cur; -+ else -+ default_stack = 2 * 1024 * 1024; -+ } -+ -+ if (!thread) -+ thread = &tid; -+ -+ TRACE("Overriding thread creation!\n"); -+ if (attr) { -+ static int once; -+ if (!once++) -+ FIXME("most thread attributes ignored!\n"); -+ else -+ WARN("most thread attributes ignored!\n"); -+ -+ pthread_attr_getstacksize(attr, &stack); -+ } -+ -+ if (!stack) -+ stack = default_stack; -+ -+ nt = RtlImageNtHeader( NtCurrentTeb()->Peb->ImageBaseAddress ); -+ stack_commit = nt->OptionalHeader.SizeOfStackCommit; -+ -+ if (!stack_commit || stack_commit > stack) -+ stack_commit = stack; -+ -+ ret = RtlCreateUserThread( NtCurrentProcess(), NULL, FALSE, NULL, stack, stack_commit, (void*)&native_unix_start, &arg, NULL, (void*)thread ); -+ if (ret != STATUS_SUCCESS) -+ FIXME("ret: %08x\n", ret); -+ switch (ret) { -+ case STATUS_SUCCESS: -+ TRACE("created thread %lx for %p/%p\n", *thread, start_routine, parm); -+ return 0; -+ case STATUS_NO_MEMORY: -+ return ENOMEM; -+ case STATUS_TOO_MANY_OPENED_FILES: -+ return EMFILE; -+ default: -+ ERR("Unhandled ntstatus %08x\n", ret); -+ return ENOMEM; -+ } -+} -+ -+static int __hook_pthread_detach(pthread_t thread) -+{ -+ struct ntdll_thread_data *thread_data; -+ TEB *teb = NULL; -+ -+ if (pthread_equal(thread, pthread_self())) { -+ TRACE("Detached self: %lx\n", pthread_self()); -+ ntdll_get_thread_data()->detached = 1; -+ return 0; -+ } -+ -+ take_thread_lock(); -+ LIST_FOR_EACH_ENTRY(thread_data, &active_list, typeof(*thread_data), entry) { -+ if (pthread_equal(thread_data->pthread_id, thread)) { -+ teb = CONTAINING_RECORD(thread_data, typeof(*teb), SpareBytes1); -+ -+ list_remove(&thread_data->entry); -+ if (!pthread_tryjoin_np(thread, NULL)) { -+ detach_thread_unlock(NULL); -+ TRACE("Thread %lx was dead, cleaning up\n", thread); -+ signal_free_thread(teb); -+ return 0; -+ } -+ thread_data->detached = 1; -+ break; -+ } -+ } -+ detach_thread_unlock(NULL); -+ if (!teb) -+ TRACE("Could not find thread %lx to detach\n", thread); -+ else -+ TRACE("Changed thread %lx to detached\n", thread); -+ return teb ? 0 : ESRCH; -+} -+ -+static int __hook_pthread_join(pthread_t thread, void **retval) -+{ -+ struct ntdll_thread_data *thread_data, *t2; -+ int ret = ESRCH; -+ -+ if (pthread_equal(thread, pthread_self())) -+ return EDEADLK; -+ -+ take_thread_lock(); -+ LIST_FOR_EACH_ENTRY(thread_data, &active_list, typeof(*thread_data), entry) { -+ TEB *teb = CONTAINING_RECORD(thread_data, typeof(*teb), SpareBytes1); -+ -+ if (pthread_equal(thread, thread_data->pthread_id)) { -+ -+ ret = pthread_tryjoin_np(thread, retval); -+ if (!ret) { -+ TRACE("Thread %lx was dead fastpath, cleaning up\n", thread); -+ goto free; -+ } -+ detach_thread_unlock(NULL); -+ -+ ret = __glob_pthread_join(thread, retval); -+ if (ret) { -+ TRACE("Thread %lx join failed with %i, ignoring\n", thread, ret); -+ return ret; -+ } -+ -+ take_thread_lock(); -+ /* Check if someone else freed the thread yet */ -+ LIST_FOR_EACH_ENTRY(t2, &active_list, typeof(*thread_data), entry) -+ if (t2 == thread_data) { -+ TRACE("Cleaning up after successful join\n"); -+ goto free; -+ } -+ TRACE("No clean up after successful join, multiple pthread_join's?\n"); -+ break; -+ -+free: -+ list_remove(&thread_data->entry); -+ detach_thread_unlock(NULL); -+ signal_free_thread(teb); -+ return 0; -+ } -+ } -+ -+ detach_thread_unlock(NULL); -+ if (ret) -+ TRACE("failed with %i\n", ret); -+ return ret; -+} -+ -+#endif - - /*********************************************************************** - * start_thread -@@ -440,9 +690,19 @@ static void start_thread( struct startup_info *info ) - if (TRACE_ON(relay)) - DPRINTF( "%04x:Starting thread proc %p (arg=%p)\n", GetCurrentThreadId(), func, arg ); - -- call_thread_entry_point( (LPTHREAD_START_ROUTINE)func, arg ); --} -+#ifdef __linux__ -+ if (info->native_thread) { -+ void *(*start)(void*) = (void*)func; - -+ FIXME("Started native thread %08x\n", GetCurrentThreadId()); -+ pthread_cleanup_push(call_native_cleanup, NULL); -+ pthread_exit(start(arg)); -+ pthread_cleanup_pop(1); -+ return; -+ } -+#endif -+ call_thread_entry_point( (LPTHREAD_START_ROUTINE)func, arg ); -+} - - /*********************************************************************** - * RtlCreateUserThread (NTDLL.@) -@@ -454,14 +714,13 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR * - HANDLE *handle_ptr, CLIENT_ID *id ) - { - sigset_t sigset; -- pthread_t pthread_id; - pthread_attr_t attr; - struct ntdll_thread_data *thread_data; - struct startup_info *info = NULL; - HANDLE handle = 0, actctx = 0; - TEB *teb = NULL; - DWORD tid = 0; -- int request_pipe[2]; -+ int request_pipe[2], ret; - NTSTATUS status; - - if (process != NtCurrentProcess()) -@@ -486,10 +745,14 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR * - if (handle_ptr) *handle_ptr = wine_server_ptr_handle( result.create_thread.handle ); - else NtClose( wine_server_ptr_handle( result.create_thread.handle )); - } -+ TRACE("CreateThread for other process returns %08x\n", result.create_thread.status); - return result.create_thread.status; - } - -- if (server_pipe( request_pipe ) == -1) return STATUS_TOO_MANY_OPENED_FILES; -+ if (server_pipe( request_pipe ) == -1) { -+ TRACE("CreateThread cannot create request pipe: %m\n"); -+ return STATUS_TOO_MANY_OPENED_FILES; -+ } - wine_server_send_fd( request_pipe[0] ); - - SERVER_START_REQ( new_thread ) -@@ -510,12 +773,16 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR * - if (status) - { - close( request_pipe[1] ); -+ TRACE("CreateThread server request failed with %08x\n", status); - return status; - } - - pthread_sigmask( SIG_BLOCK, &server_block_set, &sigset ); - -- if ((status = signal_alloc_thread( &teb ))) goto error; -+ if ((status = signal_alloc_thread( &teb ))) { -+ TRACE("CreateThread signal thread allocation failed with %08x\n", status); -+ goto error; -+ } - - teb->Peb = NtCurrentTeb()->Peb; - teb->ClientId.UniqueProcess = ULongToHandle(GetCurrentProcessId()); -@@ -538,32 +805,64 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR * - - info = (struct startup_info *)(teb + 1); - info->teb = teb; -- info->entry_point = start; -- info->entry_arg = param; -+#ifdef __linux__ -+ info->native_thread = (void*)start == (void*)&native_unix_start; -+ if (info->native_thread) { -+ struct unix_arg *arg = param; -+ info->entry_point = (void*)arg->start; -+ info->entry_arg = arg->arg; -+ } else -+#endif -+ { -+ info->entry_point = start; -+ info->entry_arg = param; -+ } - - thread_data = (struct ntdll_thread_data *)teb->SpareBytes1; -+#ifdef __linux__ -+ thread_data->detached = !info->native_thread; -+#endif - thread_data->request_fd = request_pipe[1]; - thread_data->reply_fd = -1; - thread_data->wait_fd[0] = -1; - thread_data->wait_fd[1] = -1; -+ thread_data->entry.next = NULL; - -- if ((status = virtual_alloc_thread_stack( teb, stack_reserve, stack_commit ))) goto error; -+ if ((status = virtual_alloc_thread_stack( teb, stack_reserve, stack_commit ))) { -+ TRACE("Allocating virtual stack for %p (%li/%li) failed with %08x\n", start, stack_reserve, stack_commit, status); -+ goto error; -+ } - - pthread_attr_init( &attr ); - pthread_attr_setstack( &attr, teb->DeallocationStack, - (char *)teb->Tib.StackBase - (char *)teb->DeallocationStack ); - pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM ); /* force creating a kernel thread */ - interlocked_xchg_add( &nb_threads, 1 ); -- if (pthread_create( &pthread_id, &attr, (void * (*)(void *))start_thread, info )) -+ -+ take_thread_lock(); -+ ret = __glob_pthread_create( &thread_data->pthread_id, &attr, (void * (*)(void *))start_thread, info ); -+ if (ret) - { -+ TRACE("pthread create failed with %i/%m\n", ret); - interlocked_xchg_add( &nb_threads, -1 ); - pthread_attr_destroy( &attr ); - status = STATUS_NO_MEMORY; - goto error; - } -+ if (!thread_data->detached) -+ list_add_tail(&active_list, &thread_data->entry); -+ detach_thread_unlock(NULL); -+ - pthread_attr_destroy( &attr ); - pthread_sigmask( SIG_SETMASK, &sigset, NULL ); - -+ TRACE("Created thread succesfully, win handle: %04x, pthread: %lx\n", tid, thread_data->pthread_id); -+ -+#ifdef __linux__ -+ if ((void*)start == (void*)&native_unix_start && id) -+ *(pthread_t*)id = thread_data->pthread_id; -+ else -+#endif - if (id) id->UniqueThread = ULongToHandle(tid); - if (handle_ptr) *handle_ptr = handle; - else NtClose( handle ); -diff --git a/dlls/winegstreamer/glibthread.c b/dlls/winegstreamer/glibthread.c -index 0d829a0..46e22f4 100644 ---- a/dlls/winegstreamer/glibthread.c -+++ b/dlls/winegstreamer/glibthread.c -@@ -43,6 +43,7 @@ - #include - #include - -+#if 0 - #include "windef.h" - #include "winbase.h" - #include "winnls.h" -@@ -388,3 +389,15 @@ void g_thread_impl_init (void) - g_thread_self_tls = TlsAlloc (); - g_thread_init(&g_thread_functions_for_glib_use_default); - } -+ -+#else -+ -+void g_thread_impl_init (void) -+{ -+ static gboolean beenhere = FALSE; -+ -+ if (!beenhere++) -+ g_thread_init(NULL); -+} -+ -+#endif -diff --git a/libs/wine/loader.c b/libs/wine/loader.c -index 7261522..a8c31b9 100644 ---- a/libs/wine/loader.c -+++ b/libs/wine/loader.c -@@ -73,6 +73,13 @@ char **__wine_main_argv = NULL; - WCHAR **__wine_main_wargv = NULL; - char **__wine_main_environ = NULL; - -+#ifdef __linux__ -+#include -+typeof(pthread_create) *call_pthread_create, *__glob_pthread_create; -+typeof(pthread_join) *call_pthread_join, *__glob_pthread_join; -+typeof(pthread_detach) *call_pthread_detach, *__glob_pthread_detach; -+#endif -+ - struct dll_path_context - { - unsigned int index; /* current index in the dll path list */ -diff --git a/libs/wine/wine.map b/libs/wine/wine.map -index 2159fac..fb3b951 100644 ---- a/libs/wine/wine.map -+++ b/libs/wine/wine.map -@@ -117,6 +117,12 @@ WINE_1.0 - wine_utf8_mbstowcs; - wine_utf8_wcstombs; - wine_wctype_table; -+ __glob_pthread_create; -+ call_pthread_create; -+ __glob_pthread_join; -+ call_pthread_join; -+ __glob_pthread_detach; -+ call_pthread_detach; - - local: *; - }; -diff --git a/loader/Makefile.in b/loader/Makefile.in -index 95e4798..a18dd02 100644 ---- a/loader/Makefile.in -+++ b/loader/Makefile.in -@@ -1,4 +1,4 @@ --EXTRALIBS = $(PTHREAD_LIBS) -+EXTRALIBS = $(PTHREAD_LIBS) $(DL_LIBS) - - C_SRCS = \ - main.c \ -diff --git a/loader/main.c b/loader/main.c -index bb752b5..bb50006 100644 ---- a/loader/main.c -+++ b/loader/main.c -@@ -212,6 +212,45 @@ static int pre_exec(void) - - #endif - -+#ifdef __linux__ -+ -+extern typeof(pthread_create) *call_pthread_create, *__glob_pthread_create; -+extern typeof(pthread_detach) *call_pthread_detach, *__glob_pthread_detach; -+extern typeof(pthread_join) *call_pthread_join, *__glob_pthread_join; -+ -+int pthread_create(pthread_t *thread, const pthread_attr_t *attr, -+ void *(*start_routine) (void *), void *arg) -+{ -+ return call_pthread_create(thread, attr, start_routine, arg); -+} -+ -+int pthread_detach(pthread_t thread) -+{ -+ return call_pthread_detach(thread); -+} -+ -+int pthread_join(pthread_t thread, void **retval) -+{ -+ return call_pthread_join(thread, retval); -+} -+ -+static void init_thread_hook(void) { -+ call_pthread_create = __glob_pthread_create = dlvsym(RTLD_NEXT, "pthread_create", "GLIBC_2.2.5"); -+ if (!__glob_pthread_create) -+ call_pthread_create = __glob_pthread_create = dlvsym(RTLD_NEXT, "pthread_create", "GLIBC_2.1"); -+ -+ call_pthread_detach = __glob_pthread_detach = dlsym(RTLD_NEXT, "pthread_detach"); -+ call_pthread_join = __glob_pthread_join = dlsym(RTLD_NEXT, "pthread_join"); -+ -+ /* Call a function from libpthread to ensure being linked against it */ -+ pthread_yield(); -+} -+ -+#else -+ -+#define init_thread_hook() -+ -+#endif - - /********************************************************************** - * main -@@ -221,6 +260,8 @@ int main( int argc, char *argv[] ) - char error[1024]; - int i; - -+ init_thread_hook(); -+ - if (!getenv( "WINELOADERNOEXEC" )) /* first time around */ - { - static char noexec[] = "WINELOADERNOEXEC=1"; --- -2.3.2 - diff -Nru wine1.7-1.7.50/debian/patches/series wine1.7-1.7.55/debian/patches/series --- wine1.7-1.7.50/debian/patches/series 2015-06-12 06:26:40.000000000 +0000 +++ wine1.7-1.7.55/debian/patches/series 2015-11-16 21:36:19.000000000 +0000 @@ -6,47 +6,11 @@ 0004-avrt-Add-realtime-to-stub.patch 0005-server-Bump-priority-on-server-to-process-messages-f.patch 0006-rtkit-add-SIGXCPU-handling-to-wineserver.patch -0007-mmdevapi-be-stricter-about-tests.patch -0008-winepulse-Add-initial-stub-for-pulseaudio-support.patch -0009-winepulse-Add-format-and-period-probing.patch -0010-winepulse-Add-audioclient.patch -0011-winepulse-Add-IAudioRenderClient-and-IAudioCaptureCl.patch -0012-winepulse-Add-IAudioClock-and-IAudioClock2.patch -0013-winepulse-Add-audiostreamvolume.patch -0014-winepulse-Add-session-support.patch -0015-fix-fdels-trailing-whitespaces.patch -0016-winepulse-v12.patch -0017-winepulse-v15-Add-support-for-missing-formats-and-si.patch -0018-winepulse-v16-Add-official-warning-wine-doesn-t-want.patch -0019-winepulse-v17-Fix-winmm-tests.patch -0020-winepulse-v18-Latency-and-compilation-improvements.patch -0021-winepulse-API-Compatibility-with-1.5.2-onward-v2.patch -0022-winepulse-Fix-low-latency-support.patch -0023-winepulse-drop-realtime-priority-before-thread-destr.patch -0024-winepulse-remove-bogus-SetEvent-from-pulse_started_c.patch -0025-winepulse-disable-the-setevent-part-of-the-latency-h.patch -0026-winepulse-v20-fix-the-checks-in-IsFormatSupported.patch -0027-winepulse-fixup-IsFormatSupported-calls.patch -0028-winepulse-v21-return-early-if-padding-didn-t-update.patch -0029-winepulse-fix-unneeded-free-in-write.patch -0030-winepulse-v23-fixup-a-invalid-free-in-mmdevapi.patch -0031-winepulse-use-a-pi-mutex-for-serialization.patch -0032-winepulse-add-support-for-IMarshal.patch -0033-winepulse-handle-stream-create-failing-correctly.patch -0034-winepulse-Trivial-cleanups-and-changes-for-consisten.patch -0035-winepulse-Sync-default-channel-masks-with-other-driv.patch -0036-winepulse-In-Shared-mode-track-device-position-in-by.patch -0037-winepulse-Always-mute-buffer.patch -0038-winepulse-Remove-volume-support.patch -0039-winepulse-Forward-winmm-functions-to-winealsa.patch -0040-winepulse-dump-format-in-initialize.patch -0041-winepulse-add-stub-for-GetPropValue.patch -0042-winepulse-return-PKEY_AudioEndpoint_PhysicalSpeakers.patch -0043-dsound-rework-ugly-mixer-logic.patch -0044-dsound-mix-float-natively.patch -0045-dsound-fixup-DSOUND_WaveQueue-checks.patch -0046-dsound-fixup-IDirectSoundCaptureBuffer_QueryInterfac.patch -0047-dsound-fix-format-handling-on-invalid-format-to-neve.patch -0048-dsound-remove-state-machine-from-render-buffer.patch -0049-dsound-kill-unconditional-memory-allocation-in-mixin.patch -0050-TESTING-override-pthreads-to-fix-gstreamer-v5.patch +0007-dsound-rework-ugly-mixer-logic.patch +0008-dsound-mix-float-natively.patch +0009-dsound-fixup-DSOUND_WaveQueue-checks.patch +0010-dsound-fixup-IDirectSoundCaptureBuffer_QueryInterfac.patch +0011-dsound-fix-format-handling-on-invalid-format-to-neve.patch +0012-dsound-remove-state-machine-from-render-buffer.patch +0013-dsound-kill-unconditional-memory-allocation-in-mixin.patch +0014-TESTING-override-pthreads-to-fix-gstreamer-v5.patch diff -Nru wine1.7-1.7.50/dlls/advapi32/advapi32.spec wine1.7-1.7.55/dlls/advapi32/advapi32.spec --- wine1.7-1.7.50/dlls/advapi32/advapi32.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/advapi32/advapi32.spec 2015-11-13 14:32:40.000000000 +0000 @@ -121,7 +121,7 @@ # @ stub CreateCodeAuthzLevel @ stdcall CreatePrivateObjectSecurity(ptr ptr ptr long long ptr) # @ stub CreatePrivateObjectSecurityEx -# @ stub CreatePrivateObjectSecurityWithMultipleInheritance +@ stdcall CreatePrivateObjectSecurityWithMultipleInheritance(ptr ptr ptr ptr long long long long ptr) @ stdcall CreateProcessAsUserA(long str str ptr ptr long long ptr str ptr ptr) # @ stub CreateProcessAsUserSecure @ stdcall CreateProcessAsUserW(long wstr wstr ptr ptr long long ptr wstr ptr ptr) diff -Nru wine1.7-1.7.50/dlls/advapi32/registry.c wine1.7-1.7.55/dlls/advapi32/registry.c --- wine1.7-1.7.50/dlls/advapi32/registry.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/advapi32/registry.c 2015-11-13 14:32:40.000000000 +0000 @@ -23,6 +23,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" + #include #include #include @@ -46,23 +48,29 @@ #define HKEY_SPECIAL_ROOT_LAST HKEY_DYN_DATA static const WCHAR name_CLASSES_ROOT[] = - {'M','a','c','h','i','n','e','\\', + {'\\','R','e','g','i','s','t','r','y','\\', + 'M','a','c','h','i','n','e','\\', 'S','o','f','t','w','a','r','e','\\', 'C','l','a','s','s','e','s',0}; static const WCHAR name_LOCAL_MACHINE[] = - {'M','a','c','h','i','n','e',0}; + {'\\','R','e','g','i','s','t','r','y','\\', + 'M','a','c','h','i','n','e',0}; static const WCHAR name_USERS[] = - {'U','s','e','r',0}; + {'\\','R','e','g','i','s','t','r','y','\\', + 'U','s','e','r',0}; static const WCHAR name_PERFORMANCE_DATA[] = - {'P','e','r','f','D','a','t','a',0}; + {'\\','R','e','g','i','s','t','r','y','\\', + 'P','e','r','f','D','a','t','a',0}; static const WCHAR name_CURRENT_CONFIG[] = - {'M','a','c','h','i','n','e','\\', + {'\\','R','e','g','i','s','t','r','y','\\', + 'M','a','c','h','i','n','e','\\', 'S','y','s','t','e','m','\\', 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\', 'H','a','r','d','w','a','r','e',' ','P','r','o','f','i','l','e','s','\\', 'C','u','r','r','e','n','t',0}; static const WCHAR name_DYN_DATA[] = - {'D','y','n','D','a','t','a',0}; + {'\\','R','e','g','i','s','t','r','y','\\', + 'D','y','n','D','a','t','a',0}; static const WCHAR * const root_key_names[] = { @@ -476,6 +484,14 @@ OBJECT_ATTRIBUTES attr; UNICODE_STRING nameW; + if (retkey && (!name || !name[0]) && + (HandleToUlong(hkey) >= HandleToUlong(HKEY_SPECIAL_ROOT_FIRST)) && + (HandleToUlong(hkey) <= HandleToUlong(HKEY_SPECIAL_ROOT_LAST))) + { + *retkey = hkey; + return ERROR_SUCCESS; + } + /* NT+ allows beginning backslash for HKEY_CLASSES_ROOT */ if (HandleToUlong(hkey) == HandleToUlong(HKEY_CLASSES_ROOT) && name && *name == '\\') name++; @@ -514,12 +530,20 @@ * Unlike RegCreateKeyExA(), this function will not create the key if it * does not exist. */ -LSTATUS WINAPI RegOpenKeyExA( HKEY hkey, LPCSTR name, DWORD options, REGSAM access, PHKEY retkey ) +LSTATUS WINAPI DECLSPEC_HOTPATCH RegOpenKeyExA( HKEY hkey, LPCSTR name, DWORD options, REGSAM access, PHKEY retkey ) { OBJECT_ATTRIBUTES attr; STRING nameA; NTSTATUS status; + if (retkey && (!name || !name[0]) && + (HandleToUlong(hkey) >= HandleToUlong(HKEY_SPECIAL_ROOT_FIRST)) && + (HandleToUlong(hkey) <= HandleToUlong(HKEY_SPECIAL_ROOT_LAST))) + { + *retkey = hkey; + return ERROR_SUCCESS; + } + if (!is_version_nt()) access = MAXIMUM_ALLOWED; /* Win95 ignores the access mask */ else { @@ -877,13 +901,19 @@ if (class_len) *class_len = info->ClassLength / sizeof(WCHAR); if (subkeys) *subkeys = info->SubKeys; - if (max_subkey) *max_subkey = info->MaxNameLen; - if (max_class) *max_class = info->MaxClassLen; + if (max_subkey) *max_subkey = info->MaxNameLen / sizeof(WCHAR); + if (max_class) *max_class = info->MaxClassLen / sizeof(WCHAR); if (values) *values = info->Values; - if (max_value) *max_value = info->MaxValueNameLen; + if (max_value) *max_value = info->MaxValueNameLen / sizeof(WCHAR); if (max_data) *max_data = info->MaxValueDataLen; if (modif) *modif = *(FILETIME *)&info->LastWriteTime; + if (security) + { + FIXME( "security argument not supported.\n"); + *security = 0; + } + done: if (buf_ptr != buffer) heap_free( buf_ptr ); return RtlNtStatusToDosError( status ); @@ -1066,13 +1096,19 @@ else status = STATUS_SUCCESS; if (subkeys) *subkeys = info->SubKeys; - if (max_subkey) *max_subkey = info->MaxNameLen; - if (max_class) *max_class = info->MaxClassLen; + if (max_subkey) *max_subkey = info->MaxNameLen / sizeof(WCHAR); + if (max_class) *max_class = info->MaxClassLen / sizeof(WCHAR); if (values) *values = info->Values; - if (max_value) *max_value = info->MaxValueNameLen; + if (max_value) *max_value = info->MaxValueNameLen / sizeof(WCHAR); if (max_data) *max_data = info->MaxValueDataLen; if (modif) *modif = *(FILETIME *)&info->LastWriteTime; + if (security) + { + FIXME( "security argument not supported.\n"); + *security = 0; + } + done: if (buf_ptr != buffer) heap_free( buf_ptr ); return RtlNtStatusToDosError( status ); @@ -1091,7 +1127,7 @@ * Success: ERROR_SUCCESS * Failure: Error code */ -LSTATUS WINAPI RegCloseKey( HKEY hkey ) +LSTATUS WINAPI DECLSPEC_HOTPATCH RegCloseKey( HKEY hkey ) { if (!hkey) return ERROR_INVALID_HANDLE; if (hkey >= (HKEY)0x80000000) return ERROR_SUCCESS; @@ -1461,8 +1497,8 @@ * MSDN states that if data is too small it is partially filled. In reality * it remains untouched. */ -LSTATUS WINAPI RegQueryValueExA( HKEY hkey, LPCSTR name, LPDWORD reserved, LPDWORD type, - LPBYTE data, LPDWORD count ) +LSTATUS WINAPI DECLSPEC_HOTPATCH RegQueryValueExA( HKEY hkey, LPCSTR name, LPDWORD reserved, + LPDWORD type, LPBYTE data, LPDWORD count ) { NTSTATUS status; ANSI_STRING nameA; @@ -1922,53 +1958,45 @@ status = NtEnumerateValueKey( hkey, index, KeyValueFullInformation, buffer, total_size, &total_size ); - if (status && status != STATUS_BUFFER_OVERFLOW) goto done; - if (value || data) + /* retry with a dynamically allocated buffer */ + while (status == STATUS_BUFFER_OVERFLOW) { - /* retry with a dynamically allocated buffer */ - while (status == STATUS_BUFFER_OVERFLOW) - { - if (buf_ptr != buffer) heap_free( buf_ptr ); - if (!(buf_ptr = heap_alloc( total_size ))) - return ERROR_NOT_ENOUGH_MEMORY; - info = (KEY_VALUE_FULL_INFORMATION *)buf_ptr; - status = NtEnumerateValueKey( hkey, index, KeyValueFullInformation, - buf_ptr, total_size, &total_size ); - } + if (buf_ptr != buffer) heap_free( buf_ptr ); + if (!(buf_ptr = heap_alloc( total_size ))) + return ERROR_NOT_ENOUGH_MEMORY; + info = (KEY_VALUE_FULL_INFORMATION *)buf_ptr; + status = NtEnumerateValueKey( hkey, index, KeyValueFullInformation, + buf_ptr, total_size, &total_size ); + } - if (status) goto done; + if (status) goto done; - if (value) + if (info->NameLength/sizeof(WCHAR) >= *val_count) + { + status = STATUS_BUFFER_OVERFLOW; + goto overflow; + } + memcpy( value, info->Name, info->NameLength ); + *val_count = info->NameLength / sizeof(WCHAR); + value[*val_count] = 0; + + if (data) + { + if (total_size - info->DataOffset > *count) { - if (info->NameLength/sizeof(WCHAR) >= *val_count) - { - status = STATUS_BUFFER_OVERFLOW; - goto overflow; - } - memcpy( value, info->Name, info->NameLength ); - *val_count = info->NameLength / sizeof(WCHAR); - value[*val_count] = 0; + status = STATUS_BUFFER_OVERFLOW; + goto overflow; } - - if (data) + memcpy( data, buf_ptr + info->DataOffset, total_size - info->DataOffset ); + if (total_size - info->DataOffset <= *count-sizeof(WCHAR) && is_string(info->Type)) { - if (total_size - info->DataOffset > *count) - { - status = STATUS_BUFFER_OVERFLOW; - goto overflow; - } - memcpy( data, buf_ptr + info->DataOffset, total_size - info->DataOffset ); - if (total_size - info->DataOffset <= *count-sizeof(WCHAR) && is_string(info->Type)) - { - /* if the type is REG_SZ and data is not 0-terminated - * and there is enough space in the buffer NT appends a \0 */ - WCHAR *ptr = (WCHAR *)(data + total_size - info->DataOffset); - if (ptr > (WCHAR *)data && ptr[-1]) *ptr = 0; - } + /* if the type is REG_SZ and data is not 0-terminated + * and there is enough space in the buffer NT appends a \0 */ + WCHAR *ptr = (WCHAR *)(data + total_size - info->DataOffset); + if (ptr > (WCHAR *)data && ptr[-1]) *ptr = 0; } } - else status = STATUS_SUCCESS; overflow: if (type) *type = info->Type; @@ -2007,74 +2035,70 @@ status = NtEnumerateValueKey( hkey, index, KeyValueFullInformation, buffer, total_size, &total_size ); - if (status && status != STATUS_BUFFER_OVERFLOW) goto done; /* we need to fetch the contents for a string type even if not requested, * because we need to compute the length of the ASCII string. */ - if (value || data || is_string(info->Type)) + + /* retry with a dynamically allocated buffer */ + while (status == STATUS_BUFFER_OVERFLOW) { - /* retry with a dynamically allocated buffer */ - while (status == STATUS_BUFFER_OVERFLOW) - { - if (buf_ptr != buffer) heap_free( buf_ptr ); - if (!(buf_ptr = heap_alloc( total_size ))) - return ERROR_NOT_ENOUGH_MEMORY; - info = (KEY_VALUE_FULL_INFORMATION *)buf_ptr; - status = NtEnumerateValueKey( hkey, index, KeyValueFullInformation, - buf_ptr, total_size, &total_size ); - } + if (buf_ptr != buffer) heap_free( buf_ptr ); + if (!(buf_ptr = heap_alloc( total_size ))) + return ERROR_NOT_ENOUGH_MEMORY; + info = (KEY_VALUE_FULL_INFORMATION *)buf_ptr; + status = NtEnumerateValueKey( hkey, index, KeyValueFullInformation, + buf_ptr, total_size, &total_size ); + } - if (status) goto done; + if (status) goto done; - if (is_string(info->Type)) + if (is_string(info->Type)) + { + DWORD len; + RtlUnicodeToMultiByteSize( &len, (WCHAR *)(buf_ptr + info->DataOffset), + total_size - info->DataOffset ); + if (data && len) { - DWORD len; - RtlUnicodeToMultiByteSize( &len, (WCHAR *)(buf_ptr + info->DataOffset), - total_size - info->DataOffset ); - if (data && len) + if (len > *count) status = STATUS_BUFFER_OVERFLOW; + else { - if (len > *count) status = STATUS_BUFFER_OVERFLOW; - else - { - RtlUnicodeToMultiByteN( (char*)data, len, NULL, (WCHAR *)(buf_ptr + info->DataOffset), - total_size - info->DataOffset ); - /* if the type is REG_SZ and data is not 0-terminated - * and there is enough space in the buffer NT appends a \0 */ - if (len < *count && data[len-1]) data[len] = 0; - } + RtlUnicodeToMultiByteN( (char*)data, len, NULL, (WCHAR *)(buf_ptr + info->DataOffset), + total_size - info->DataOffset ); + /* if the type is REG_SZ and data is not 0-terminated + * and there is enough space in the buffer NT appends a \0 */ + if (len < *count && data[len-1]) data[len] = 0; } - info->DataLength = len; - } - else if (data) - { - if (total_size - info->DataOffset > *count) status = STATUS_BUFFER_OVERFLOW; - else memcpy( data, buf_ptr + info->DataOffset, total_size - info->DataOffset ); } + info->DataLength = len; + } + else if (data) + { + if (total_size - info->DataOffset > *count) status = STATUS_BUFFER_OVERFLOW; + else memcpy( data, buf_ptr + info->DataOffset, total_size - info->DataOffset ); + } - if (value && !status) - { - DWORD len; + if (!status) + { + DWORD len; - RtlUnicodeToMultiByteSize( &len, info->Name, info->NameLength ); - if (len >= *val_count) - { - status = STATUS_BUFFER_OVERFLOW; - if (*val_count) - { - len = *val_count - 1; - RtlUnicodeToMultiByteN( value, len, NULL, info->Name, info->NameLength ); - value[len] = 0; - } - } - else + RtlUnicodeToMultiByteSize( &len, info->Name, info->NameLength ); + if (len >= *val_count) + { + status = STATUS_BUFFER_OVERFLOW; + if (*val_count) { + len = *val_count - 1; RtlUnicodeToMultiByteN( value, len, NULL, info->Name, info->NameLength ); value[len] = 0; - *val_count = len; } } + else + { + RtlUnicodeToMultiByteN( value, len, NULL, info->Name, info->NameLength ); + value[len] = 0; + *val_count = len; + } } - else status = STATUS_SUCCESS; if (type) *type = info->Type; if (count) *count = info->DataLength; @@ -2656,8 +2680,8 @@ hEvent, fAsync); status = NtNotifyChangeKey( hkey, hEvent, NULL, NULL, &iosb, - fdwNotifyFilter, fAsync, NULL, 0, - fWatchSubTree); + fdwNotifyFilter, fWatchSubTree, NULL, 0, + fAsync); if (status && status != STATUS_TIMEOUT) return RtlNtStatusToDosError( status ); diff -Nru wine1.7-1.7.50/dlls/advapi32/security.c wine1.7-1.7.55/dlls/advapi32/security.c --- wine1.7-1.7.50/dlls/advapi32/security.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/advapi32/security.c 2015-11-13 14:32:40.000000000 +0000 @@ -19,6 +19,8 @@ * */ +#include "config.h" + #include #include @@ -133,6 +135,7 @@ { {'M','E'}, WinMediumLabelSid, { SID_REVISION, 1, { SECURITY_MANDATORY_LABEL_AUTHORITY}, { SECURITY_MANDATORY_MEDIUM_RID } } }, { {'H','I'}, WinHighLabelSid, { SID_REVISION, 1, { SECURITY_MANDATORY_LABEL_AUTHORITY}, { SECURITY_MANDATORY_HIGH_RID } } }, { {'S','I'}, WinSystemLabelSid, { SID_REVISION, 1, { SECURITY_MANDATORY_LABEL_AUTHORITY}, { SECURITY_MANDATORY_SYSTEM_RID } } }, + { {0,0}, WinBuiltinAnyPackageSid, { SID_REVISION, 2, { SECURITY_APP_PACKAGE_AUTHORITY }, { SECURITY_APP_PACKAGE_BASE_RID, SECURITY_BUILTIN_PACKAGE_ANY_PACKAGE } } }, }; /* these SIDs must be constructed as relative to some domain - only the RID is well-known */ @@ -173,7 +176,9 @@ static const WCHAR Account_Operators[] = { 'A','c','c','o','u','n','t',' ','O','p','e','r','a','t','o','r','s',0 }; static const WCHAR Administrator[] = {'A','d','m','i','n','i','s','t','r','a','t','o','r',0 }; static const WCHAR Administrators[] = { 'A','d','m','i','n','i','s','t','r','a','t','o','r','s',0 }; +static const WCHAR ALL_APPLICATION_PACKAGES[] = { 'A','L','L',' ','A','P','P','L','I','C','A','T','I','O','N',' ','P','A','C','K','A','G','E','S',0 }; static const WCHAR ANONYMOUS_LOGON[] = { 'A','N','O','N','Y','M','O','U','S',' ','L','O','G','O','N',0 }; +static const WCHAR APPLICATION_PACKAGE_AUTHORITY[] = { 'A','P','P','L','I','C','A','T','I','O','N',' ','P','A','C','K','A','G','E',' ','A','U','T','H','O','R','I','T','Y',0 }; static const WCHAR Authenticated_Users[] = { 'A','u','t','h','e','n','t','i','c','a','t','e','d',' ','U','s','e','r','s',0 }; static const WCHAR Backup_Operators[] = { 'B','a','c','k','u','p',' ','O','p','e','r','a','t','o','r','s',0 }; static const WCHAR BATCH[] = { 'B','A','T','C','H',0 }; @@ -277,6 +282,7 @@ { WinOtherOrganizationSid, Other_Organization, NT_AUTHORITY, SidTypeWellKnownGroup }, { WinBuiltinPerfMonitoringUsersSid, Performance_Monitor_Users, BUILTIN, SidTypeAlias }, { WinBuiltinPerfLoggingUsersSid, Performance_Log_Users, BUILTIN, SidTypeAlias }, + { WinBuiltinAnyPackageSid, ALL_APPLICATION_PACKAGES, APPLICATION_PACKAGE_AUTHORITY, SidTypeWellKnownGroup }, }; /* * ACE access rights @@ -416,7 +422,7 @@ attr.Attributes = OBJ_CASE_INSENSITIVE; attr.ObjectName = &file_nameW; attr.SecurityDescriptor = NULL; - status = NtCreateFile( file, access, &attr, &io, NULL, FILE_FLAG_BACKUP_SEMANTICS, + status = NtCreateFile( file, access|SYNCHRONIZE, &attr, &io, NULL, FILE_FLAG_BACKUP_SEMANTICS, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, FILE_OPEN, FILE_OPEN_FOR_BACKUP_INTENT, NULL, 0 ); RtlFreeUnicodeString( &file_nameW ); @@ -2208,7 +2214,7 @@ } /* check the well known SIDs first */ - for (i = 0; i <= 60; i++) { + for (i = 0; i <= WinAccountProtectedUsersSid; i++) { if (IsWellKnownSid(sid, i)) { for (j = 0; j < (sizeof(ACCOUNT_SIDS) / sizeof(ACCOUNT_SIDS[0])); j++) { if (ACCOUNT_SIDS[j].type == i) { @@ -5292,6 +5298,14 @@ return TRUE; } +BOOL WINAPI CreatePrivateObjectSecurityWithMultipleInheritance( + PSECURITY_DESCRIPTOR parent, PSECURITY_DESCRIPTOR creator, PSECURITY_DESCRIPTOR *out, + GUID **types, ULONG count, BOOL is_container, ULONG flags, HANDLE token, PGENERIC_MAPPING mapping) +{ + FIXME(": semi-stub\n"); + return CreatePrivateObjectSecurity(parent, creator, out, is_container, token, mapping); +} + BOOL WINAPI DestroyPrivateObjectSecurity( PSECURITY_DESCRIPTOR* ObjectDescriptor ) { FIXME("%p - stub\n", ObjectDescriptor); @@ -5300,7 +5314,7 @@ return TRUE; } -BOOL WINAPI CreateProcessAsUserA( +BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessAsUserA( HANDLE hToken, LPCSTR lpApplicationName, LPSTR lpCommandLine, @@ -5355,7 +5369,7 @@ return ret; } -BOOL WINAPI CreateProcessAsUserW( +BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessAsUserW( HANDLE hToken, LPCWSTR lpApplicationName, LPWSTR lpCommandLine, @@ -5879,7 +5893,7 @@ attr.Attributes = 0; attr.ObjectName = &name_info->Name; attr.SecurityDescriptor = NULL; - status = NtOpenFile(&parent, READ_CONTROL, &attr, &io, + status = NtOpenFile(&parent, READ_CONTROL|SYNCHRONIZE, &attr, &io, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, FILE_OPEN_FOR_BACKUP_INTENT); heap_free(name_info); diff -Nru wine1.7-1.7.50/dlls/advapi32/tests/cred.c wine1.7-1.7.55/dlls/advapi32/tests/cred.c --- wine1.7-1.7.50/dlls/advapi32/tests/cred.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/advapi32/tests/cred.c 2015-11-13 14:32:40.000000000 +0000 @@ -295,7 +295,7 @@ for (i = 0; i < count; i++) { - if (!strcmp(creds[i]->TargetName, TEST_TARGET_NAME)) + if (creds[i]->TargetName && !strcmp(creds[i]->TargetName, TEST_TARGET_NAME)) { ok(creds[i]->Type == CRED_TYPE_GENERIC || creds[i]->Type == CRED_TYPE_DOMAIN_PASSWORD, /* Vista */ @@ -353,7 +353,7 @@ for (i = 0; i < count; i++) { - if (!strcmp(creds[i]->TargetName, TEST_TARGET_NAME)) + if (creds[i]->TargetName && !strcmp(creds[i]->TargetName, TEST_TARGET_NAME)) { ok(creds[i]->Type == cred_type, "expected creds[%d]->Type CRED_TYPE_DOMAIN_PASSWORD but got %d\n", i, creds[i]->Type); ok(!creds[i]->Flags, "expected creds[%d]->Flags 0 but got 0x%x\n", i, creds[i]->Flags); diff -Nru wine1.7-1.7.50/dlls/advapi32/tests/registry.c wine1.7-1.7.55/dlls/advapi32/tests/registry.c --- wine1.7-1.7.50/dlls/advapi32/tests/registry.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/advapi32/tests/registry.c 2015-11-13 14:32:40.000000000 +0000 @@ -1075,7 +1075,6 @@ ok(ret == ERROR_INVALID_HANDLE || ret == ERROR_BADKEY, /* Windows 95 returns BADKEY */ "expected ERROR_INVALID_HANDLE or ERROR_BADKEY, got %d\n", ret); ok(hkResult == hkPreserve, "expected hkResult == hkPreserve\n"); - RegCloseKey(hkResult); /* send in NULL hkResult */ ret = RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Test", NULL); @@ -1101,6 +1100,45 @@ "expected ERROR_SUCCESS, ERROR_BAD_PATHNAME or ERROR_FILE_NOT_FOUND, got %d\n", ret); RegCloseKey(hkResult); + /* NULL or empty subkey of special root */ + hkResult = NULL; + ret = RegOpenKeyExA(HKEY_CLASSES_ROOT, NULL, 0, KEY_QUERY_VALUE, &hkResult); + ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret); + ok(hkResult == HKEY_CLASSES_ROOT, "expected hkResult == HKEY_CLASSES_ROOT\n"); + + hkResult = NULL; + ret = RegOpenKeyExA(HKEY_CLASSES_ROOT, "", 0, KEY_QUERY_VALUE, &hkResult); + ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret); + ok(hkResult == HKEY_CLASSES_ROOT, "expected hkResult == HKEY_CLASSES_ROOT\n"); + + hkResult = NULL; + ret = RegOpenKeyExA(HKEY_CLASSES_ROOT, "\\", 0, KEY_QUERY_VALUE, &hkResult); + ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret); + ok(hkResult != HKEY_CLASSES_ROOT, "expected hkResult to be a new key\n"); + ok(!RegCloseKey(hkResult), "got invalid hkey\n"); + + /* empty subkey of existing handle */ + hkResult = hkPreserve; + ret = RegOpenKeyExA(hkPreserve, "", 0, KEY_QUERY_VALUE, &hkResult); + ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret); + ok(hkResult != hkPreserve, "expected hkResult != hkPreserve\n"); + ok(!RegCloseKey(hkResult), "got invalid hkey\n"); + + /* NULL subkey of existing handle */ + hkResult = hkPreserve; + ret = RegOpenKeyExA(hkPreserve, NULL, 0, KEY_QUERY_VALUE, &hkResult); + ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret); + ok(hkResult != hkPreserve, "expected hkResult != hkPreserve\n"); + ok(!RegCloseKey(hkResult), "got invalid hkey\n"); + + /* empty subkey of NULL */ + hkResult = hkPreserve; + ret = RegOpenKeyExA(NULL, "", 0, KEY_QUERY_VALUE, &hkResult); + ok(ret == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %d\n", ret); + ok(hkResult == hkPreserve, "expected hkResult == hkPreserve\n"); + + RegCloseKey(hkPreserve); + /* WOW64 flags */ hkResult = NULL; ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software", 0, KEY_READ|KEY_WOW64_32KEY, &hkResult); @@ -1765,6 +1803,7 @@ ok(classbufferW[0] == 0x5555, "classbufferW[0] = 0x%x\n", classbufferW[0]); /* empty key */ + sdlen = 0; ret = RegQueryInfoKeyA(subkey, NULL, &classlen, NULL, &subkeys, &maxsubkeylen, &maxclasslen, &values, &maxvaluenamelen, &maxvaluelen, &sdlen, &lastwrite); ok(ret == ERROR_SUCCESS, "ret = %d\n", ret); ok(classlen == strlen(subkey_class), "classlen = %u\n", classlen); @@ -1774,10 +1813,11 @@ ok(values == 0, "values = %u\n", values); ok(maxvaluenamelen == 0, "maxvaluenamelen = %u\n", maxvaluenamelen); ok(maxvaluelen == 0, "maxvaluelen = %u\n", maxvaluelen); - ok(sdlen != 0, "sdlen = %u\n", sdlen); + todo_wine ok(sdlen != 0, "sdlen = %u\n", sdlen); ok(lastwrite.dwLowDateTime != 0, "lastwrite.dwLowDateTime = %u\n", lastwrite.dwLowDateTime); ok(lastwrite.dwHighDateTime != 0, "lastwrite.dwHighDateTime = %u\n", lastwrite.dwHighDateTime); + sdlen = 0; ret = RegQueryInfoKeyW(subkey, NULL, &classlen, NULL, &subkeys, &maxsubkeylen, &maxclasslen, &values, &maxvaluenamelen, &maxvaluelen, &sdlen, &lastwrite); ok(ret == ERROR_SUCCESS, "ret = %d\n", ret); ok(classlen == strlen(subkey_class), "classlen = %u\n", classlen); @@ -1787,7 +1827,7 @@ ok(values == 0, "values = %u\n", values); ok(maxvaluenamelen == 0, "maxvaluenamelen = %u\n", maxvaluenamelen); ok(maxvaluelen == 0, "maxvaluelen = %u\n", maxvaluelen); - ok(sdlen != 0, "sdlen = %u\n", sdlen); + todo_wine ok(sdlen != 0, "sdlen = %u\n", sdlen); ok(lastwrite.dwLowDateTime != 0, "lastwrite.dwLowDateTime = %u\n", lastwrite.dwLowDateTime); ok(lastwrite.dwHighDateTime != 0, "lastwrite.dwHighDateTime = %u\n", lastwrite.dwHighDateTime); @@ -1798,6 +1838,7 @@ ok(ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", ret); /* with subkey & default value */ + sdlen = 0; ret = RegQueryInfoKeyA(subkey, NULL, &classlen, NULL, &subkeys, &maxsubkeylen, &maxclasslen, &values, &maxvaluenamelen, &maxvaluelen, &sdlen, &lastwrite); ok(ret == ERROR_SUCCESS, "ret = %d\n", ret); ok(classlen == strlen(subkey_class), "classlen = %u\n", classlen); @@ -1807,10 +1848,11 @@ ok(values == 1, "values = %u\n", values); ok(maxvaluenamelen == 0, "maxvaluenamelen = %u\n", maxvaluenamelen); ok(maxvaluelen == sizeof("data") * sizeof(WCHAR), "maxvaluelen = %u\n", maxvaluelen); - ok(sdlen != 0, "sdlen = %u\n", sdlen); + todo_wine ok(sdlen != 0, "sdlen = %u\n", sdlen); ok(lastwrite.dwLowDateTime != 0, "lastwrite.dwLowDateTime = %u\n", lastwrite.dwLowDateTime); ok(lastwrite.dwHighDateTime != 0, "lastwrite.dwHighDateTime = %u\n", lastwrite.dwHighDateTime); + sdlen = 0; ret = RegQueryInfoKeyW(subkey, NULL, &classlen, NULL, &subkeys, &maxsubkeylen, &maxclasslen, &values, &maxvaluenamelen, &maxvaluelen, &sdlen, &lastwrite); ok(ret == ERROR_SUCCESS, "ret = %d\n", ret); ok(classlen == strlen(subkey_class), "classlen = %u\n", classlen); @@ -1820,7 +1862,7 @@ ok(values == 1, "values = %u\n", values); ok(maxvaluenamelen == 0, "maxvaluenamelen = %u\n", maxvaluenamelen); ok(maxvaluelen == sizeof("data") * sizeof(WCHAR), "maxvaluelen = %u\n", maxvaluelen); - ok(sdlen != 0, "sdlen = %u\n", sdlen); + todo_wine ok(sdlen != 0, "sdlen = %u\n", sdlen); ok(lastwrite.dwLowDateTime != 0, "lastwrite.dwLowDateTime = %u\n", lastwrite.dwLowDateTime); ok(lastwrite.dwHighDateTime != 0, "lastwrite.dwHighDateTime = %u\n", lastwrite.dwHighDateTime); diff -Nru wine1.7-1.7.50/dlls/advapi32/tests/security.c wine1.7-1.7.55/dlls/advapi32/tests/security.c --- wine1.7-1.7.50/dlls/advapi32/tests/security.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/advapi32/tests/security.c 2015-11-13 14:32:40.000000000 +0000 @@ -1686,7 +1686,7 @@ DWORD acc_size = MAX_PATH; DWORD dom_size = MAX_PATH; ret = LookupAccountSidA (NULL, sid, account, &acc_size, domain, &dom_size, &use); - ok(ret || (!ret && (GetLastError() == ERROR_NONE_MAPPED)), + ok(ret || GetLastError() == ERROR_NONE_MAPPED, "LookupAccountSid(%s) failed: %d\n", str_sid, GetLastError()); if (ret) trace(" %s %s\\%s %d\n", str_sid, domain, account, use); @@ -1731,7 +1731,9 @@ /* 69 */ {TRUE, "S-1-16-16384"}, {TRUE, "S-1-5-33"}, {TRUE, "S-1-3-4"}, /* 72 */ {FALSE, "S-1-5-21-12-23-34-45-56-571"}, {FALSE, "S-1-5-21-12-23-34-45-56-572"}, /* 74 */ {TRUE, "S-1-5-22"}, {FALSE, "S-1-5-21-12-23-34-45-56-521"}, {TRUE, "S-1-5-32-573"}, -/* 77 */ {FALSE, "S-1-5-21-12-23-34-45-56-498"}, {TRUE, "S-1-5-32-574"}, {TRUE, "S-1-16-8448"} +/* 77 */ {FALSE, "S-1-5-21-12-23-34-45-56-498"}, {TRUE, "S-1-5-32-574"}, {TRUE, "S-1-16-8448"}, +/* 80 */ {FALSE, NULL}, {TRUE, "S-1-2-1"}, {TRUE, "S-1-5-65-1"}, {FALSE, NULL}, +/* 84 */ {TRUE, "S-1-15-2-1"}, }; static void test_CreateWellKnownSid(void) @@ -1780,15 +1782,12 @@ if (value->sid_string == NULL) continue; - if (i > WinAccountRasAndIasServersSid) + /* some SIDs aren't implemented by all Windows versions - detect it */ + cb = sizeof(sid_buffer); + if (!pCreateWellKnownSid(i, NULL, sid_buffer, &cb)) { - /* These SIDs aren't implemented by all Windows versions - detect it and break the loop */ - cb = sizeof(sid_buffer); - if (!pCreateWellKnownSid(i, domainsid, sid_buffer, &cb)) - { - skip("Well known SIDs starting from %u are not implemented\n", i); - break; - } + skip("Well known SID %u not implemented\n", i); + continue; } cb = sizeof(sid_buffer); @@ -2250,7 +2249,7 @@ ok(ret, "Failed to lookup account name\n"); ok(sid_size == GetLengthSid(psid), "Expected %d, got %d\n", GetLengthSid(psid), sid_size); ok(!lstrcmpA(account, user_name), "Expected %s, got %s\n", user_name, account); - ok(!lstrcmpA(domain, sid_dom), "Expected %s, got %s\n", sid_dom, domain); + ok(!lstrcmpiA(domain, sid_dom), "Expected %s, got %s\n", sid_dom, domain); ok(domain_size == domain_save - 1, "Expected %d, got %d\n", domain_save - 1, domain_size); ok(strlen(domain) == domain_size, "Expected %d, got %d\n", lstrlenA(domain), domain_size); ok(sid_use == SidTypeUser, "Expected SidTypeUser (%d), got %d\n", SidTypeUser, sid_use); @@ -2268,7 +2267,7 @@ ok(ret, "Failed to lookup account name\n"); ok(sid_size != 0, "sid_size was zero\n"); ok(!lstrcmpA(account, "Everyone"), "Expected Everyone, got %s\n", account); - ok(!lstrcmpA(domain, sid_dom), "Expected %s, got %s\n", sid_dom, domain); + ok(!lstrcmpiA(domain, sid_dom), "Expected %s, got %s\n", sid_dom, domain); ok(domain_size == 0, "Expected 0, got %d\n", domain_size); ok(strlen(domain) == domain_size, "Expected %d, got %d\n", lstrlenA(domain), domain_size); ok(sid_use == SidTypeWellKnownGroup, "Expected SidTypeWellKnownGroup (%d), got %d\n", SidTypeWellKnownGroup, sid_use); @@ -2333,9 +2332,8 @@ get_sid_info(psid, &account, &sid_dom); ok(ret, "Failed to lookup account name\n"); /* Using a fixed string will not work on different locales */ - ok(!lstrcmpA(account, domain), - "Got %s for account and %s for domain, these should be the same\n", - account, domain); + ok(!lstrcmpiA(account, domain), + "Got %s for account and %s for domain, these should be the same\n", account, domain); ok(sid_use == SidTypeDomain, "Expected SidTypeDomain (%d), got %d\n", SidTypeDomain, sid_use); HeapFree(GetProcessHeap(), 0, psid); @@ -3791,7 +3789,8 @@ ok(bret, "Failed to get Builtin Admins ACE.\n"); flags = ((ACE_HEADER *)ace)->AceFlags; ok(flags == 0x0 - || broken(flags == (INHERIT_ONLY_ACE|CONTAINER_INHERIT_ACE|INHERITED_ACE)) /* w2k8 */, + || broken(flags == (INHERIT_ONLY_ACE|CONTAINER_INHERIT_ACE|INHERITED_ACE)) /* w2k8 */ + || broken(flags == (OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE)), /* win7 */ "Builtin Admins ACE has unexpected flags (0x%x != 0x0)\n", flags); ok(ace->Mask == KEY_ALL_ACCESS || broken(ace->Mask == GENERIC_ALL) /* w2k8 */, "Builtin Admins ACE has unexpected mask (0x%x != 0x%x)\n", ace->Mask, KEY_ALL_ACCESS); @@ -5886,6 +5885,12 @@ /* ACCESS_SYSTEM_SECURITY requires special privilege */ res = RegCreateKeyExW( HKEY_LOCAL_MACHINE, testkeyW, 0, NULL, 0, KEY_READ|ACCESS_SYSTEM_SECURITY, NULL, &hkey, NULL ); + if (res == ERROR_ACCESS_DENIED) + { + skip( "unprivileged user\n" ); + CloseHandle( token ); + return; + } todo_wine ok( res == ERROR_PRIVILEGE_NOT_HELD, "got %d\n", res ); priv.PrivilegeCount = 1; @@ -5897,6 +5902,13 @@ ok( ret, "got %u\n", GetLastError()); res = RegCreateKeyExW( HKEY_LOCAL_MACHINE, testkeyW, 0, NULL, 0, KEY_READ|ACCESS_SYSTEM_SECURITY, NULL, &hkey, NULL ); + if (res == ERROR_PRIVILEGE_NOT_HELD) + { + win_skip( "privilege not held\n" ); + HeapFree( GetProcessHeap(), 0, priv_prev ); + CloseHandle( token ); + return; + } ok( !res, "got %d\n", res ); /* restore privileges */ diff -Nru wine1.7-1.7.50/dlls/advpack/install.c wine1.7-1.7.55/dlls/advpack/install.c --- wine1.7-1.7.50/dlls/advpack/install.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/advpack/install.c 2015-11-13 14:32:40.000000000 +0000 @@ -776,7 +776,11 @@ str_flags = get_parameter(&cmdline_ptr, ',', TRUE); if (str_flags) - flags = atolW(str_flags); + { + DWORD inf_flags = atolW(str_flags); + if (inf_flags & LIS_QUIET) flags |= RSC_FLAG_QUIET; + if (inf_flags & LIS_NOGRPCONV) flags |= RSC_FLAG_NGCONV; + } ZeroMemory(&info, sizeof(ADVInfo)); diff -Nru wine1.7-1.7.50/dlls/advpack/tests/install.c wine1.7-1.7.55/dlls/advpack/tests/install.c --- wine1.7-1.7.50/dlls/advpack/tests/install.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/advpack/tests/install.c 2015-11-13 14:32:40.000000000 +0000 @@ -190,6 +190,7 @@ HRESULT hr; char cmdline[MAX_PATH]; static char file[] = "test.inf,DefaultInstall,4,0"; + static char file2[] = "test.inf,,1,0"; /* The 'No UI' flag seems to have no effect whatsoever on Windows. * So only do this test in interactive mode. @@ -220,6 +221,9 @@ hr = pLaunchINFSection(NULL, NULL, file, 0); ok(hr == 0, "Expected 0, got %d\n", hr); + hr = pLaunchINFSection(NULL, NULL, file2, 0); + ok(hr == 0, "Expected 0, got %d\n", hr); + DeleteFileA("test.inf"); } diff -Nru wine1.7-1.7.50/dlls/amstream/mediastream.c wine1.7-1.7.55/dlls/amstream/mediastream.c --- wine1.7-1.7.50/dlls/amstream/mediastream.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/amstream/mediastream.c 2015-11-13 14:32:40.000000000 +0000 @@ -1003,6 +1003,7 @@ desc.ddpfPixelFormat.dwBBitMask = 0x0000ff; desc.ddpfPixelFormat.dwRGBAlphaBitMask = 0; desc.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY|DDSCAPS_OFFSCREENPLAIN; + desc.lpSurface = NULL; hr = IDirectDraw_CreateSurface(ddraw, &desc, &object->surface, NULL); IDirectDraw_Release(ddraw); diff -Nru wine1.7-1.7.50/dlls/amstream/tests/amstream.c wine1.7-1.7.55/dlls/amstream/tests/amstream.c --- wine1.7-1.7.50/dlls/amstream/tests/amstream.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/amstream/tests/amstream.c 2015-11-13 14:32:40.000000000 +0000 @@ -425,9 +425,9 @@ ok(!lstrcmpW(info.achName, id), "Pin name is %s instead of %s\n", wine_dbgstr_w(info.achName), wine_dbgstr_w(id)); hr = IPin_EnumMediaTypes(pins[i], &enum_media_types); ok(hr == S_OK, "IPin_EnumMediaTypes returned: %x\n", hr); - hr = IEnumMediaTypes_Next(enum_media_types, sizeof(media_types) / sizeof(AM_MEDIA_TYPE), media_types, &nb_media_types); + hr = IEnumMediaTypes_Next(enum_media_types, sizeof(media_types) / sizeof(media_types[0]), media_types, &nb_media_types); ok(SUCCEEDED(hr), "IEnumMediaTypes_Next returned: %x\n", hr); - ok(nb_media_types == 0, "nb_media_types should be 0 instead of %u\n", nb_media_types); + ok(nb_media_types > 0, "nb_media_types should be >0\n"); IEnumMediaTypes_Release(enum_media_types); IPin_Release(pins[i]); } diff -Nru wine1.7-1.7.50/dlls/api-ms-win-core-io-l1-1-1/api-ms-win-core-io-l1-1-1.spec wine1.7-1.7.55/dlls/api-ms-win-core-io-l1-1-1/api-ms-win-core-io-l1-1-1.spec --- wine1.7-1.7.50/dlls/api-ms-win-core-io-l1-1-1/api-ms-win-core-io-l1-1-1.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-core-io-l1-1-1/api-ms-win-core-io-l1-1-1.spec 2015-11-13 14:32:40.000000000 +0000 @@ -1,6 +1,6 @@ @ stdcall CancelIo(long) kernel32.CancelIo @ stdcall CancelIoEx(long ptr) kernel32.CancelIoEx -@ stub CancelSynchronousIo +@ stdcall CancelSynchronousIo(long) kernel32.CancelSynchronousIo @ stdcall CreateIoCompletionPort(long long long long) kernel32.CreateIoCompletionPort @ stdcall DeviceIoControl(long long ptr long ptr long ptr ptr) kernel32.DeviceIoControl @ stdcall GetOverlappedResult(long ptr ptr long) kernel32.GetOverlappedResult diff -Nru wine1.7-1.7.50/dlls/api-ms-win-core-processthreads-l1-1-1/api-ms-win-core-processthreads-l1-1-1.spec wine1.7-1.7.55/dlls/api-ms-win-core-processthreads-l1-1-1/api-ms-win-core-processthreads-l1-1-1.spec --- wine1.7-1.7.50/dlls/api-ms-win-core-processthreads-l1-1-1/api-ms-win-core-processthreads-l1-1-1.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-core-processthreads-l1-1-1/api-ms-win-core-processthreads-l1-1-1.spec 2015-11-13 14:32:40.000000000 +0000 @@ -12,7 +12,7 @@ @ stdcall -norelay GetCurrentProcess() kernel32.GetCurrentProcess @ stdcall -norelay GetCurrentProcessId() kernel32.GetCurrentProcessId @ stdcall GetCurrentProcessorNumber() kernel32.GetCurrentProcessorNumber -@ stub GetCurrentProcessorNumberEx +@ stdcall GetCurrentProcessorNumberEx(ptr) kernel32.GetCurrentProcessorNumberEx @ stdcall -norelay GetCurrentThread() kernel32.GetCurrentThread @ stdcall -norelay GetCurrentThreadId() kernel32.GetCurrentThreadId @ stub GetCurrentThreadStackLimits diff -Nru wine1.7-1.7.50/dlls/api-ms-win-core-processthreads-l1-1-2/api-ms-win-core-processthreads-l1-1-2.spec wine1.7-1.7.55/dlls/api-ms-win-core-processthreads-l1-1-2/api-ms-win-core-processthreads-l1-1-2.spec --- wine1.7-1.7.50/dlls/api-ms-win-core-processthreads-l1-1-2/api-ms-win-core-processthreads-l1-1-2.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-core-processthreads-l1-1-2/api-ms-win-core-processthreads-l1-1-2.spec 2015-11-13 14:32:40.000000000 +0000 @@ -12,7 +12,7 @@ @ stdcall -norelay GetCurrentProcess() kernel32.GetCurrentProcess @ stdcall -norelay GetCurrentProcessId() kernel32.GetCurrentProcessId @ stdcall GetCurrentProcessorNumber() kernel32.GetCurrentProcessorNumber -@ stub GetCurrentProcessorNumberEx +@ stdcall GetCurrentProcessorNumberEx(ptr) kernel32.GetCurrentProcessorNumberEx @ stdcall -norelay GetCurrentThread() kernel32.GetCurrentThread @ stdcall -norelay GetCurrentThreadId() kernel32.GetCurrentThreadId @ stub GetCurrentThreadStackLimits diff -Nru wine1.7-1.7.50/dlls/api-ms-win-core-sysinfo-l1-2-1/api-ms-win-core-sysinfo-l1-2-1.spec wine1.7-1.7.55/dlls/api-ms-win-core-sysinfo-l1-2-1/api-ms-win-core-sysinfo-l1-2-1.spec --- wine1.7-1.7.50/dlls/api-ms-win-core-sysinfo-l1-2-1/api-ms-win-core-sysinfo-l1-2-1.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-core-sysinfo-l1-2-1/api-ms-win-core-sysinfo-l1-2-1.spec 2015-11-13 14:32:40.000000000 +0000 @@ -7,7 +7,7 @@ @ stdcall GetLogicalProcessorInformationEx(long ptr ptr) kernel32.GetLogicalProcessorInformationEx @ stdcall GetNativeSystemInfo(ptr) kernel32.GetNativeSystemInfo @ stub GetOsSafeBootMode -@ stub GetPhysicallyInstalledSystemMemory +@ stdcall GetPhysicallyInstalledSystemMemory(ptr) kernel32.GetPhysicallyInstalledSystemMemory @ stdcall GetProductInfo(long long long long ptr) kernel32.GetProductInfo @ stdcall GetSystemDirectoryA(ptr long) kernel32.GetSystemDirectoryA @ stdcall GetSystemDirectoryW(ptr long) kernel32.GetSystemDirectoryW diff -Nru wine1.7-1.7.50/dlls/api-ms-win-core-winrt-l1-1-0/api-ms-win-core-winrt-l1-1-0.spec wine1.7-1.7.55/dlls/api-ms-win-core-winrt-l1-1-0/api-ms-win-core-winrt-l1-1-0.spec --- wine1.7-1.7.50/dlls/api-ms-win-core-winrt-l1-1-0/api-ms-win-core-winrt-l1-1-0.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-core-winrt-l1-1-0/api-ms-win-core-winrt-l1-1-0.spec 2015-11-13 14:32:40.000000000 +0000 @@ -1,5 +1,5 @@ @ stub RoActivateInstance -@ stub RoGetActivationFactory +@ stdcall RoGetActivationFactory(ptr ptr ptr) combase.RoGetActivationFactory @ stub RoGetApartmentIdentifier @ stdcall RoInitialize(long) combase.RoInitialize @ stub RoRegisterActivationFactories diff -Nru wine1.7-1.7.50/dlls/api-ms-win-core-winrt-string-l1-1-0/api-ms-win-core-winrt-string-l1-1-0.spec wine1.7-1.7.55/dlls/api-ms-win-core-winrt-string-l1-1-0/api-ms-win-core-winrt-string-l1-1-0.spec --- wine1.7-1.7.50/dlls/api-ms-win-core-winrt-string-l1-1-0/api-ms-win-core-winrt-string-l1-1-0.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-core-winrt-string-l1-1-0/api-ms-win-core-winrt-string-l1-1-0.spec 2015-11-13 14:32:40.000000000 +0000 @@ -7,8 +7,8 @@ @ stub HSTRING_UserUnmarshal @ stub HSTRING_UserUnmarshal64 @ stub WindowsCompareStringOrdinal -@ stub WindowsConcatString -@ stdcall WindowsCreateString(ptr long ptr) combase.WindowsCreateString +@ stdcall WindowsConcatString(ptr ptr ptr) combase.WindowsConcatString +@ stdcall WindowsCreateString(wstr long ptr) combase.WindowsCreateString @ stdcall WindowsCreateStringReference(wstr long ptr ptr) combase.WindowsCreateStringReference @ stdcall WindowsDeleteString(ptr) combase.WindowsDeleteString @ stdcall WindowsDeleteStringBuffer(ptr) combase.WindowsDeleteStringBuffer @@ -21,7 +21,7 @@ @ stdcall WindowsPromoteStringBuffer(ptr ptr) combase.WindowsPromoteStringBuffer @ stub WindowsReplaceString @ stdcall WindowsStringHasEmbeddedNull(ptr ptr) combase.WindowsStringHasEmbeddedNull -@ stub WindowsSubstring -@ stub WindowsSubstringWithSpecifiedLength +@ stdcall WindowsSubstring(ptr long ptr) combase.WindowsSubstring +@ stdcall WindowsSubstringWithSpecifiedLength(ptr long long ptr) combase.WindowsSubstringWithSpecifiedLength @ stub WindowsTrimStringEnd @ stub WindowsTrimStringStart diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-conio-l1-1-0/api-ms-win-crt-conio-l1-1-0.spec wine1.7-1.7.55/dlls/api-ms-win-crt-conio-l1-1-0/api-ms-win-crt-conio-l1-1-0.spec --- wine1.7-1.7.50/dlls/api-ms-win-crt-conio-l1-1-0/api-ms-win-crt-conio-l1-1-0.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-conio-l1-1-0/api-ms-win-crt-conio-l1-1-0.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,30 @@ +@ stub __conio_common_vcprintf +@ stub __conio_common_vcprintf_p +@ stub __conio_common_vcprintf_s +@ stub __conio_common_vcscanf +@ stub __conio_common_vcwprintf +@ stub __conio_common_vcwprintf_p +@ stub __conio_common_vcwprintf_s +@ stub __conio_common_vcwscanf +@ cdecl _cgets(ptr) ucrtbase._cgets +@ stub _cgets_s +@ stub _cgetws +@ stub _cgetws_s +@ cdecl _cputs(str) ucrtbase._cputs +@ cdecl _cputws(wstr) ucrtbase._cputws +@ cdecl _getch() ucrtbase._getch +@ cdecl _getch_nolock() ucrtbase._getch_nolock +@ cdecl _getche() ucrtbase._getche +@ cdecl _getche_nolock() ucrtbase._getche_nolock +@ cdecl _getwch() ucrtbase._getwch +@ cdecl _getwch_nolock() ucrtbase._getwch_nolock +@ cdecl _getwche() ucrtbase._getwche +@ cdecl _getwche_nolock() ucrtbase._getwche_nolock +@ cdecl _putch(long) ucrtbase._putch +@ cdecl _putch_nolock(long) ucrtbase._putch_nolock +@ cdecl _putwch(long) ucrtbase._putwch +@ cdecl _putwch_nolock(long) ucrtbase._putwch_nolock +@ cdecl _ungetch(long) ucrtbase._ungetch +@ cdecl _ungetch_nolock(long) ucrtbase._ungetch_nolock +@ cdecl _ungetwch(long) ucrtbase._ungetwch +@ cdecl _ungetwch_nolock(long) ucrtbase._ungetwch_nolock diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-conio-l1-1-0/Makefile.in wine1.7-1.7.55/dlls/api-ms-win-crt-conio-l1-1-0/Makefile.in --- wine1.7-1.7.50/dlls/api-ms-win-crt-conio-l1-1-0/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-conio-l1-1-0/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1 @@ +MODULE = api-ms-win-crt-conio-l1-1-0.dll diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-convert-l1-1-0/api-ms-win-crt-convert-l1-1-0.spec wine1.7-1.7.55/dlls/api-ms-win-crt-convert-l1-1-0/api-ms-win-crt-convert-l1-1-0.spec --- wine1.7-1.7.50/dlls/api-ms-win-crt-convert-l1-1-0/api-ms-win-crt-convert-l1-1-0.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-convert-l1-1-0/api-ms-win-crt-convert-l1-1-0.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,122 @@ +@ cdecl __toascii(long) ucrtbase.__toascii +@ cdecl _atodbl(ptr str) ucrtbase._atodbl +@ cdecl _atodbl_l(ptr str ptr) ucrtbase._atodbl_l +@ cdecl _atof_l(str ptr) ucrtbase._atof_l +@ cdecl _atoflt(ptr str) ucrtbase._atoflt +@ cdecl _atoflt_l(ptr str ptr) ucrtbase._atoflt_l +@ cdecl -ret64 _atoi64(str) ucrtbase._atoi64 +@ stub _atoi64_l +@ cdecl _atoi_l(str ptr) ucrtbase._atoi_l +@ stub _atol_l +@ cdecl _atoldbl(ptr str) ucrtbase._atoldbl +@ stub _atoldbl_l +@ stub _atoll_l +@ cdecl _ecvt(double long ptr ptr) ucrtbase._ecvt +@ cdecl _ecvt_s(str long double long ptr ptr) ucrtbase._ecvt_s +@ cdecl _fcvt(double long ptr ptr) ucrtbase._fcvt +@ cdecl _fcvt_s(ptr long double long ptr ptr) ucrtbase._fcvt_s +@ cdecl _gcvt(double long str) ucrtbase._gcvt +@ cdecl _gcvt_s(ptr long double long) ucrtbase._gcvt_s +@ cdecl _i64toa(int64 ptr long) ucrtbase._i64toa +@ cdecl _i64toa_s(int64 ptr long long) ucrtbase._i64toa_s +@ cdecl _i64tow(int64 ptr long) ucrtbase._i64tow +@ cdecl _i64tow_s(int64 ptr long long) ucrtbase._i64tow_s +@ cdecl _itoa(long ptr long) ucrtbase._itoa +@ cdecl _itoa_s(long ptr long long) ucrtbase._itoa_s +@ cdecl _itow(long ptr long) ucrtbase._itow +@ cdecl _itow_s(long ptr long long) ucrtbase._itow_s +@ cdecl _ltoa(long ptr long) ucrtbase._ltoa +@ cdecl _ltoa_s(long ptr long long) ucrtbase._ltoa_s +@ cdecl _ltow(long ptr long) ucrtbase._ltow +@ cdecl _ltow_s(long ptr long long) ucrtbase._ltow_s +@ cdecl _strtod_l(str ptr ptr) ucrtbase._strtod_l +@ stub _strtof_l +@ cdecl -ret64 _strtoi64(str ptr long) ucrtbase._strtoi64 +@ cdecl -ret64 _strtoi64_l(str ptr long ptr) ucrtbase._strtoi64_l +@ stub _strtoimax_l +@ stub _strtol_l +@ stub _strtold_l +@ cdecl -ret64 _strtoll_l(str ptr long ptr) ucrtbase._strtoll_l +@ cdecl -ret64 _strtoui64(str ptr long) ucrtbase._strtoui64 +@ cdecl -ret64 _strtoui64_l(str ptr long ptr) ucrtbase._strtoui64_l +@ cdecl _strtoul_l(str ptr long ptr) ucrtbase._strtoul_l +@ cdecl -ret64 _strtoull_l(str ptr long ptr) ucrtbase._strtoull_l +@ stub _strtoumax_l +@ cdecl _ui64toa(int64 ptr long) ucrtbase._ui64toa +@ cdecl _ui64toa_s(int64 ptr long long) ucrtbase._ui64toa_s +@ cdecl _ui64tow(int64 ptr long) ucrtbase._ui64tow +@ cdecl _ui64tow_s(int64 ptr long long) ucrtbase._ui64tow_s +@ cdecl _ultoa(long ptr long) ucrtbase._ultoa +@ cdecl _ultoa_s(long ptr long long) ucrtbase._ultoa_s +@ cdecl _ultow(long ptr long) ucrtbase._ultow +@ cdecl _ultow_s(long ptr long long) ucrtbase._ultow_s +@ cdecl _wcstod_l(wstr ptr) ucrtbase._wcstod_l +@ stub _wcstof_l +@ cdecl -ret64 _wcstoi64(wstr ptr long) ucrtbase._wcstoi64 +@ cdecl -ret64 _wcstoi64_l(wstr ptr long ptr) ucrtbase._wcstoi64_l +@ stub _wcstoimax_l +@ cdecl _wcstol_l(wstr ptr long ptr) ucrtbase._wcstol_l +@ stub _wcstold_l +@ stub _wcstoll_l +@ cdecl _wcstombs_l(ptr ptr long ptr) ucrtbase._wcstombs_l +@ cdecl _wcstombs_s_l(ptr ptr long wstr long ptr) ucrtbase._wcstombs_s_l +@ cdecl -ret64 _wcstoui64(wstr ptr long) ucrtbase._wcstoui64 +@ cdecl -ret64 _wcstoui64_l(wstr ptr long ptr) ucrtbase._wcstoui64_l +@ cdecl _wcstoul_l(wstr ptr long ptr) ucrtbase._wcstoul_l +@ stub _wcstoull_l +@ stub _wcstoumax_l +@ cdecl _wctomb_l(ptr long ptr) ucrtbase._wctomb_l +@ cdecl _wctomb_s_l(ptr ptr long long ptr) ucrtbase._wctomb_s_l +@ cdecl _wtof(wstr) ucrtbase._wtof +@ cdecl _wtof_l(wstr ptr) ucrtbase._wtof_l +@ cdecl _wtoi(wstr) ucrtbase._wtoi +@ cdecl -ret64 _wtoi64(wstr) ucrtbase._wtoi64 +@ cdecl -ret64 _wtoi64_l(wstr ptr) ucrtbase._wtoi64_l +@ cdecl _wtoi_l(wstr ptr) ucrtbase._wtoi_l +@ cdecl _wtol(wstr) ucrtbase._wtol +@ cdecl _wtol_l(wstr ptr) ucrtbase._wtol_l +@ stub _wtoll +@ stub _wtoll_l +@ cdecl atof(str) ucrtbase.atof +@ cdecl atoi(str) ucrtbase.atoi +@ cdecl atol(str) ucrtbase.atol +@ stub atoll +@ cdecl btowc(long) ucrtbase.btowc +@ stub c16rtomb +@ stub c32rtomb +@ stub mbrtoc16 +@ stub mbrtoc32 +@ cdecl mbrtowc(ptr str long ptr) ucrtbase.mbrtowc +@ cdecl mbsrtowcs(ptr ptr long ptr) ucrtbase.mbsrtowcs +@ stub mbsrtowcs_s +@ cdecl mbstowcs(ptr str long) ucrtbase.mbstowcs +@ cdecl mbstowcs_s(ptr ptr long str long) ucrtbase.mbstowcs_s +@ cdecl mbtowc(ptr str long) ucrtbase.mbtowc +@ cdecl strtod(str ptr) ucrtbase.strtod +@ stub strtof +@ stub strtoimax +@ cdecl strtol(str ptr long) ucrtbase.strtol +@ stub strtold +@ cdecl -ret64 strtoll(str ptr long) ucrtbase.strtoll +@ cdecl strtoul(str ptr long) ucrtbase.strtoul +@ cdecl -ret64 strtoull(str ptr long) ucrtbase.strtoull +@ stub strtoumax +@ cdecl wcrtomb(ptr long ptr) ucrtbase.wcrtomb +@ stub wcrtomb_s +@ cdecl wcsrtombs(ptr ptr long ptr) ucrtbase.wcsrtombs +@ cdecl wcsrtombs_s(ptr ptr long ptr long ptr) ucrtbase.wcsrtombs_s +@ cdecl wcstod(wstr ptr) ucrtbase.wcstod +@ stub wcstof +@ stub wcstoimax +@ cdecl wcstol(wstr ptr long) ucrtbase.wcstol +@ stub wcstold +@ stub wcstoll +@ cdecl wcstombs(ptr ptr long) ucrtbase.wcstombs +@ cdecl wcstombs_s(ptr ptr long wstr long) ucrtbase.wcstombs_s +@ cdecl wcstoul(wstr ptr long) ucrtbase.wcstoul +@ stub wcstoull +@ stub wcstoumax +@ cdecl wctob(long) ucrtbase.wctob +@ cdecl wctomb(ptr long) ucrtbase.wctomb +@ cdecl wctomb_s(ptr ptr long long) ucrtbase.wctomb_s +@ stub wctrans diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-convert-l1-1-0/Makefile.in wine1.7-1.7.55/dlls/api-ms-win-crt-convert-l1-1-0/Makefile.in --- wine1.7-1.7.50/dlls/api-ms-win-crt-convert-l1-1-0/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-convert-l1-1-0/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1 @@ +MODULE = api-ms-win-crt-convert-l1-1-0.dll diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-environment-l1-1-0/api-ms-win-crt-environment-l1-1-0.spec wine1.7-1.7.55/dlls/api-ms-win-crt-environment-l1-1-0/api-ms-win-crt-environment-l1-1-0.spec --- wine1.7-1.7.50/dlls/api-ms-win-crt-environment-l1-1-0/api-ms-win-crt-environment-l1-1-0.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-environment-l1-1-0/api-ms-win-crt-environment-l1-1-0.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,18 @@ +@ cdecl __p__environ() ucrtbase.__p__environ +@ cdecl __p__wenviron() ucrtbase.__p__wenviron +@ cdecl _dupenv_s(ptr ptr str) ucrtbase._dupenv_s +@ cdecl _putenv(str) ucrtbase._putenv +@ cdecl _putenv_s(str str) ucrtbase._putenv_s +@ cdecl _searchenv(str str ptr) ucrtbase._searchenv +@ cdecl _searchenv_s(str str ptr long) ucrtbase._searchenv_s +@ cdecl _wdupenv_s(ptr ptr wstr) ucrtbase._wdupenv_s +@ cdecl _wgetcwd(wstr long) ucrtbase._wgetcwd +@ cdecl _wgetdcwd(long wstr long) ucrtbase._wgetdcwd +@ cdecl _wgetenv(wstr) ucrtbase._wgetenv +@ cdecl _wgetenv_s(ptr ptr long wstr) ucrtbase._wgetenv_s +@ cdecl _wputenv(wstr) ucrtbase._wputenv +@ cdecl _wputenv_s(wstr wstr) ucrtbase._wputenv_s +@ cdecl _wsearchenv(wstr wstr ptr) ucrtbase._wsearchenv +@ cdecl _wsearchenv_s(wstr wstr ptr long) ucrtbase._wsearchenv_s +@ cdecl getenv(str) ucrtbase.getenv +@ cdecl getenv_s(ptr ptr long str) ucrtbase.getenv_s diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-environment-l1-1-0/Makefile.in wine1.7-1.7.55/dlls/api-ms-win-crt-environment-l1-1-0/Makefile.in --- wine1.7-1.7.50/dlls/api-ms-win-crt-environment-l1-1-0/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-environment-l1-1-0/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1 @@ +MODULE = api-ms-win-crt-environment-l1-1-0.dll diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-filesystem-l1-1-0/api-ms-win-crt-filesystem-l1-1-0.spec wine1.7-1.7.55/dlls/api-ms-win-crt-filesystem-l1-1-0/api-ms-win-crt-filesystem-l1-1-0.spec --- wine1.7-1.7.50/dlls/api-ms-win-crt-filesystem-l1-1-0/api-ms-win-crt-filesystem-l1-1-0.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-filesystem-l1-1-0/api-ms-win-crt-filesystem-l1-1-0.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,65 @@ +@ cdecl _access(str long) ucrtbase._access +@ cdecl _access_s(str long) ucrtbase._access_s +@ cdecl _chdir(str) ucrtbase._chdir +@ cdecl _chdrive(long) ucrtbase._chdrive +@ cdecl _chmod(str long) ucrtbase._chmod +@ cdecl _findclose(long) ucrtbase._findclose +@ cdecl _findfirst32(str ptr) ucrtbase._findfirst32 +@ stub _findfirst32i64 +@ cdecl _findfirst64(str ptr) ucrtbase._findfirst64 +@ cdecl _findfirst64i32(str ptr) ucrtbase._findfirst64i32 +@ cdecl _findnext32(long ptr) ucrtbase._findnext32 +@ stub _findnext32i64 +@ cdecl _findnext64(long ptr) ucrtbase._findnext64 +@ cdecl _findnext64i32(long ptr) ucrtbase._findnext64i32 +@ cdecl _fstat32(long ptr) ucrtbase._fstat32 +@ stub _fstat32i64 +@ cdecl _fstat64(long ptr) ucrtbase._fstat64 +@ cdecl _fstat64i32(long ptr) ucrtbase._fstat64i32 +@ cdecl _fullpath(ptr str long) ucrtbase._fullpath +@ cdecl _getdiskfree(long ptr) ucrtbase._getdiskfree +@ cdecl _getdrive() ucrtbase._getdrive +@ cdecl _getdrives() ucrtbase._getdrives +@ cdecl _lock_file(ptr) ucrtbase._lock_file +@ cdecl _makepath(ptr str str str str) ucrtbase._makepath +@ cdecl _makepath_s(ptr long str str str str) ucrtbase._makepath_s +@ cdecl _mkdir(str) ucrtbase._mkdir +@ cdecl _rmdir(str) ucrtbase._rmdir +@ cdecl _splitpath(str ptr ptr ptr ptr) ucrtbase._splitpath +@ cdecl _splitpath_s(str ptr long ptr long ptr long ptr long) ucrtbase._splitpath_s +@ cdecl _stat32(str ptr) ucrtbase._stat32 +@ cdecl _stat32i64(str ptr) ucrtbase._stat32i64 +@ cdecl _stat64(str ptr) ucrtbase._stat64 +@ cdecl _stat64i32(str ptr) ucrtbase._stat64i32 +@ cdecl _umask(long) ucrtbase._umask +@ stub _umask_s +@ cdecl _unlink(str) ucrtbase._unlink +@ cdecl _unlock_file(ptr) ucrtbase._unlock_file +@ cdecl _waccess(wstr long) ucrtbase._waccess +@ cdecl _waccess_s(wstr long) ucrtbase._waccess_s +@ cdecl _wchdir(wstr) ucrtbase._wchdir +@ cdecl _wchmod(wstr long) ucrtbase._wchmod +@ cdecl _wfindfirst32(wstr ptr) ucrtbase._wfindfirst32 +@ stub _wfindfirst32i64 +@ cdecl _wfindfirst64(wstr ptr) ucrtbase._wfindfirst64 +@ cdecl _wfindfirst64i32(wstr ptr) ucrtbase._wfindfirst64i32 +@ stub _wfindnext32 +@ stub _wfindnext32i64 +@ cdecl _wfindnext64(long ptr) ucrtbase._wfindnext64 +@ cdecl _wfindnext64i32(long ptr) ucrtbase._wfindnext64i32 +@ cdecl _wfullpath(ptr wstr long) ucrtbase._wfullpath +@ cdecl _wmakepath(ptr wstr wstr wstr wstr) ucrtbase._wmakepath +@ cdecl _wmakepath_s(ptr long wstr wstr wstr wstr) ucrtbase._wmakepath_s +@ cdecl _wmkdir(wstr) ucrtbase._wmkdir +@ cdecl _wremove(wstr) ucrtbase._wremove +@ cdecl _wrename(wstr wstr) ucrtbase._wrename +@ cdecl _wrmdir(wstr) ucrtbase._wrmdir +@ cdecl _wsplitpath(wstr ptr ptr ptr ptr) ucrtbase._wsplitpath +@ cdecl _wsplitpath_s(wstr ptr long ptr long ptr long ptr long) ucrtbase._wsplitpath_s +@ cdecl _wstat32(wstr ptr) ucrtbase._wstat32 +@ cdecl _wstat32i64(wstr ptr) ucrtbase._wstat32i64 +@ cdecl _wstat64(wstr ptr) ucrtbase._wstat64 +@ cdecl _wstat64i32(wstr ptr) ucrtbase._wstat64i32 +@ cdecl _wunlink(wstr) ucrtbase._wunlink +@ cdecl remove(str) ucrtbase.remove +@ cdecl rename(str str) ucrtbase.rename diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-filesystem-l1-1-0/Makefile.in wine1.7-1.7.55/dlls/api-ms-win-crt-filesystem-l1-1-0/Makefile.in --- wine1.7-1.7.50/dlls/api-ms-win-crt-filesystem-l1-1-0/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-filesystem-l1-1-0/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1 @@ +MODULE = api-ms-win-crt-filesystem-l1-1-0.dll diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-heap-l1-1-0/api-ms-win-crt-heap-l1-1-0.spec wine1.7-1.7.55/dlls/api-ms-win-crt-heap-l1-1-0/api-ms-win-crt-heap-l1-1-0.spec --- wine1.7-1.7.50/dlls/api-ms-win-crt-heap-l1-1-0/api-ms-win-crt-heap-l1-1-0.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-heap-l1-1-0/api-ms-win-crt-heap-l1-1-0.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,27 @@ +@ cdecl _aligned_free(ptr) ucrtbase._aligned_free +@ cdecl _aligned_malloc(long long) ucrtbase._aligned_malloc +@ cdecl _aligned_msize(ptr long long) ucrtbase._aligned_msize +@ cdecl _aligned_offset_malloc(long long long) ucrtbase._aligned_offset_malloc +@ cdecl _aligned_offset_realloc(ptr long long long) ucrtbase._aligned_offset_realloc +@ stub _aligned_offset_recalloc +@ cdecl _aligned_realloc(ptr long long) ucrtbase._aligned_realloc +@ stub _aligned_recalloc +@ cdecl _callnewh(long) ucrtbase._callnewh +@ stub _calloc_base +@ cdecl _expand(ptr long) ucrtbase._expand +@ stub _free_base +@ cdecl _get_heap_handle() ucrtbase._get_heap_handle +@ cdecl _heapchk() ucrtbase._heapchk +@ cdecl _heapmin() ucrtbase._heapmin +@ cdecl _heapwalk(ptr) ucrtbase._heapwalk +@ stub _malloc_base +@ cdecl _msize(ptr) ucrtbase._msize +@ stub _query_new_handler +@ stub _query_new_mode +@ stub _realloc_base +@ cdecl _recalloc(ptr long long) ucrtbase._recalloc +@ cdecl _set_new_mode(long) ucrtbase._set_new_mode +@ cdecl calloc(long long) ucrtbase.calloc +@ cdecl free(ptr) ucrtbase.free +@ cdecl malloc(long) ucrtbase.malloc +@ cdecl realloc(ptr long) ucrtbase.realloc diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-heap-l1-1-0/Makefile.in wine1.7-1.7.55/dlls/api-ms-win-crt-heap-l1-1-0/Makefile.in --- wine1.7-1.7.50/dlls/api-ms-win-crt-heap-l1-1-0/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-heap-l1-1-0/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1 @@ +MODULE = api-ms-win-crt-heap-l1-1-0.dll diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-locale-l1-1-0/api-ms-win-crt-locale-l1-1-0.spec wine1.7-1.7.55/dlls/api-ms-win-crt-locale-l1-1-0/api-ms-win-crt-locale-l1-1-0.spec --- wine1.7-1.7.50/dlls/api-ms-win-crt-locale-l1-1-0/api-ms-win-crt-locale-l1-1-0.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-locale-l1-1-0/api-ms-win-crt-locale-l1-1-0.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,20 @@ +@ cdecl ___lc_codepage_func() ucrtbase.___lc_codepage_func +@ cdecl ___lc_collate_cp_func() ucrtbase.___lc_collate_cp_func +@ cdecl ___lc_locale_name_func() ucrtbase.___lc_locale_name_func +@ cdecl ___mb_cur_max_func() ucrtbase.___mb_cur_max_func +@ cdecl ___mb_cur_max_l_func(ptr) ucrtbase.___mb_cur_max_l_func +@ stub __initialize_lconv_for_unsigned_char +@ cdecl __pctype_func() ucrtbase.__pctype_func +@ stub __pwctype_func +@ cdecl _configthreadlocale(long) ucrtbase._configthreadlocale +@ cdecl _create_locale(long str) ucrtbase._create_locale +@ cdecl _free_locale(ptr) ucrtbase._free_locale +@ cdecl _get_current_locale() ucrtbase._get_current_locale +@ cdecl _getmbcp() ucrtbase._getmbcp +@ stub _lock_locales +@ cdecl _setmbcp(long) ucrtbase._setmbcp +@ stub _unlock_locales +@ stub _wcreate_locale +@ cdecl _wsetlocale(long wstr) ucrtbase._wsetlocale +@ cdecl localeconv() ucrtbase.localeconv +@ cdecl setlocale(long str) ucrtbase.setlocale diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-locale-l1-1-0/Makefile.in wine1.7-1.7.55/dlls/api-ms-win-crt-locale-l1-1-0/Makefile.in --- wine1.7-1.7.50/dlls/api-ms-win-crt-locale-l1-1-0/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-locale-l1-1-0/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1 @@ +MODULE = api-ms-win-crt-locale-l1-1-0.dll diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec wine1.7-1.7.55/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec --- wine1.7-1.7.50/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,340 @@ +@ cdecl -arch=i386 _CIacos() ucrtbase._CIacos +@ cdecl -arch=i386 _CIasin() ucrtbase._CIasin +@ cdecl -arch=i386 _CIatan() ucrtbase._CIatan +@ cdecl -arch=i386 _CIatan2() ucrtbase._CIatan2 +@ cdecl -arch=i386 _CIcos() ucrtbase._CIcos +@ cdecl -arch=i386 _CIcosh() ucrtbase._CIcosh +@ cdecl -arch=i386 _CIexp() ucrtbase._CIexp +@ cdecl -arch=i386 _CIfmod() ucrtbase._CIfmod +@ cdecl -arch=i386 _CIlog() ucrtbase._CIlog +@ cdecl -arch=i386 _CIlog10() ucrtbase._CIlog10 +@ cdecl -arch=i386 _CIpow() ucrtbase._CIpow +@ cdecl -arch=i386 _CIsin() ucrtbase._CIsin +@ cdecl -arch=i386 _CIsinh() ucrtbase._CIsinh +@ cdecl -arch=i386 _CIsqrt() ucrtbase._CIsqrt +@ cdecl -arch=i386 _CItan() ucrtbase._CItan +@ cdecl -arch=i386 _CItanh() ucrtbase._CItanh +@ stub _Cbuild +@ stub _Cmulcc +@ stub _Cmulcr +@ stub _FCbuild +@ stub _FCmulcc +@ stub _FCmulcr +@ stub _LCbuild +@ stub _LCmulcc +@ stub _LCmulcr +@ cdecl -arch=i386 __libm_sse2_acos() ucrtbase.__libm_sse2_acos +@ cdecl -arch=i386 __libm_sse2_acosf() ucrtbase.__libm_sse2_acosf +@ cdecl -arch=i386 __libm_sse2_asin() ucrtbase.__libm_sse2_asin +@ cdecl -arch=i386 __libm_sse2_asinf() ucrtbase.__libm_sse2_asinf +@ cdecl -arch=i386 __libm_sse2_atan() ucrtbase.__libm_sse2_atan +@ cdecl -arch=i386 __libm_sse2_atan2() ucrtbase.__libm_sse2_atan2 +@ cdecl -arch=i386 __libm_sse2_atanf() ucrtbase.__libm_sse2_atanf +@ cdecl -arch=i386 __libm_sse2_cos() ucrtbase.__libm_sse2_cos +@ cdecl -arch=i386 __libm_sse2_cosf() ucrtbase.__libm_sse2_cosf +@ cdecl -arch=i386 __libm_sse2_exp() ucrtbase.__libm_sse2_exp +@ cdecl -arch=i386 __libm_sse2_expf() ucrtbase.__libm_sse2_expf +@ cdecl -arch=i386 __libm_sse2_log() ucrtbase.__libm_sse2_log +@ cdecl -arch=i386 __libm_sse2_log10() ucrtbase.__libm_sse2_log10 +@ cdecl -arch=i386 __libm_sse2_log10f() ucrtbase.__libm_sse2_log10f +@ cdecl -arch=i386 __libm_sse2_logf() ucrtbase.__libm_sse2_logf +@ cdecl -arch=i386 __libm_sse2_pow() ucrtbase.__libm_sse2_pow +@ cdecl -arch=i386 __libm_sse2_powf() ucrtbase.__libm_sse2_powf +@ cdecl -arch=i386 __libm_sse2_sin() ucrtbase.__libm_sse2_sin +@ cdecl -arch=i386 __libm_sse2_sinf() ucrtbase.__libm_sse2_sinf +@ cdecl -arch=i386 __libm_sse2_tan() ucrtbase.__libm_sse2_tan +@ cdecl -arch=i386 __libm_sse2_tanf() ucrtbase.__libm_sse2_tanf +@ cdecl __setusermatherr(ptr) ucrtbase.__setusermatherr +@ cdecl _cabs(long) ucrtbase._cabs +@ cdecl _chgsign(double) ucrtbase._chgsign +@ cdecl _chgsignf(float) ucrtbase._chgsignf +@ cdecl _copysign(double double) ucrtbase._copysign +@ cdecl _copysignf(float float) ucrtbase._copysignf +@ stub _d_int +@ cdecl _dclass(double) ucrtbase._dclass +@ stub _dexp +@ stub _dlog +@ stub _dnorm +@ stub _dpcomp +@ stub _dpoly +@ stub _dscale +@ cdecl _dsign(double) ucrtbase._dsign +@ stub _dsin +@ cdecl _dtest(ptr) ucrtbase._dtest +@ stub _dunscale +@ stub _except1 +@ stub _fd_int +@ cdecl _fdclass(float) ucrtbase._fdclass +@ stub _fdexp +@ stub _fdlog +@ stub _fdnorm +@ cdecl _fdopen(long str) ucrtbase._fdopen +@ stub _fdpcomp +@ stub _fdpoly +@ stub _fdscale +@ cdecl _fdsign(float) ucrtbase._fdsign +@ stub _fdsin +@ cdecl _fdtest(ptr) ucrtbase._fdtest +@ stub _fdunscale +@ cdecl _finite(double) ucrtbase._finite +@ cdecl -arch=arm,x86_64 _finitef(float) ucrtbase._finitef +@ cdecl _fpclass(double) ucrtbase._fpclass +@ stub _fpclassf +@ cdecl -arch=i386 -ret64 _ftol() ucrtbase._ftol +@ stub _get_FMA3_enable +@ cdecl _hypot(double double) ucrtbase._hypot +@ cdecl _hypotf(float float) ucrtbase._hypotf +@ cdecl _isnan(double) ucrtbase._isnan +@ cdecl -arch=arm,x86_64 _isnanf(float) ucrtbase._isnanf +@ cdecl _j0(double) ucrtbase._j0 +@ cdecl _j1(double) ucrtbase._j1 +@ cdecl _jn(long double) ucrtbase._jn +@ stub _ld_int +@ cdecl _ldclass(double) ucrtbase._ldclass +@ stub _ldexp +@ stub _ldlog +@ stub _ldpcomp +@ stub _ldpoly +@ stub _ldscale +@ cdecl _ldsign(double) ucrtbase._ldsign +@ stub _ldsin +@ cdecl _ldtest(ptr) ucrtbase._ldtest +@ stub _ldunscale +@ cdecl -arch=i386 _libm_sse2_acos_precise() ucrtbase._libm_sse2_acos_precise +@ cdecl -arch=i386 _libm_sse2_asin_precise() ucrtbase._libm_sse2_asin_precise +@ cdecl -arch=i386 _libm_sse2_atan_precise() ucrtbase._libm_sse2_atan_precise +@ cdecl -arch=i386 _libm_sse2_cos_precise() ucrtbase._libm_sse2_cos_precise +@ cdecl -arch=i386 _libm_sse2_exp_precise() ucrtbase._libm_sse2_exp_precise +@ cdecl -arch=i386 _libm_sse2_log10_precise() ucrtbase._libm_sse2_log10_precise +@ cdecl -arch=i386 _libm_sse2_log_precise() ucrtbase._libm_sse2_log_precise +@ cdecl -arch=i386 _libm_sse2_pow_precise() ucrtbase._libm_sse2_pow_precise +@ cdecl -arch=i386 _libm_sse2_sin_precise() ucrtbase._libm_sse2_sin_precise +@ cdecl -arch=i386 _libm_sse2_sqrt_precise() ucrtbase._libm_sse2_sqrt_precise +@ cdecl -arch=i386 _libm_sse2_tan_precise() ucrtbase._libm_sse2_tan_precise +@ cdecl _logb(double) ucrtbase._logb +@ cdecl -arch=arm,x86_64 _logbf(float) ucrtbase._logbf +@ cdecl _nextafter(double double) ucrtbase._nextafter +@ cdecl -arch=arm,x86_64 _nextafterf(float float) ucrtbase._nextafterf +@ cdecl _scalb(double long) ucrtbase._scalb +@ cdecl -arch=arm,x86_64 _scalbf(float long) ucrtbase._scalbf +@ stub _set_FMA3_enable +@ cdecl -arch=i386 _set_SSE2_enable(long) ucrtbase._set_SSE2_enable +@ cdecl _y0(double) ucrtbase._y0 +@ cdecl _y1(double) ucrtbase._y1 +@ cdecl _yn(long double) ucrtbase._yn +@ cdecl acos(double) ucrtbase.acos +@ cdecl -arch=arm,x86_64 acosf(float) ucrtbase.acosf +@ stub acosh +@ stub acoshf +@ stub acoshl +@ cdecl asin(double) ucrtbase.asin +@ cdecl -arch=arm,x86_64 asinf(float) ucrtbase.asinf +@ stub asinh +@ stub asinhf +@ stub asinhl +@ cdecl atan(double) ucrtbase.atan +@ cdecl atan2(double double) ucrtbase.atan2 +@ cdecl -arch=arm,x86_64 atan2f(float float) ucrtbase.atan2f +@ cdecl -arch=arm,x86_64 atanf(float) ucrtbase.atanf +@ stub atanh +@ stub atanhf +@ stub atanhl +@ stub cabs +@ stub cabsf +@ stub cabsl +@ stub cacos +@ stub cacosf +@ stub cacosh +@ stub cacoshf +@ stub cacoshl +@ stub cacosl +@ stub carg +@ stub cargf +@ stub cargl +@ stub casin +@ stub casinf +@ stub casinh +@ stub casinhf +@ stub casinhl +@ stub casinl +@ stub catan +@ stub catanf +@ stub catanh +@ stub catanhf +@ stub catanhl +@ stub catanl +@ cdecl cbrt(double) ucrtbase.cbrt +@ cdecl cbrtf(float) ucrtbase.cbrtf +@ cdecl cbrtl(double) ucrtbase.cbrtl +@ stub ccos +@ stub ccosf +@ stub ccosh +@ stub ccoshf +@ stub ccoshl +@ stub ccosl +@ cdecl ceil(double) ucrtbase.ceil +@ cdecl -arch=arm,x86_64 ceilf(float) ucrtbase.ceilf +@ stub cexp +@ stub cexpf +@ stub cexpl +@ stub cimag +@ stub cimagf +@ stub cimagl +@ stub clog +@ stub clog10 +@ stub clog10f +@ stub clog10l +@ stub clogf +@ stub clogl +@ stub conj +@ stub conjf +@ stub conjl +@ cdecl copysign(double double) ucrtbase.copysign +@ cdecl copysignf(float float) ucrtbase.copysignf +@ cdecl copysignl(double double) ucrtbase.copysignl +@ cdecl cos(double) ucrtbase.cos +@ cdecl -arch=arm,x86_64 cosf(float) ucrtbase.cosf +@ cdecl cosh(double) ucrtbase.cosh +@ cdecl -arch=arm,x86_64 coshf(float) ucrtbase.coshf +@ stub cpow +@ stub cpowf +@ stub cpowl +@ stub cproj +@ stub cprojf +@ stub cprojl +@ stub creal +@ stub crealf +@ stub creall +@ stub csin +@ stub csinf +@ stub csinh +@ stub csinhf +@ stub csinhl +@ stub csinl +@ stub csqrt +@ stub csqrtf +@ stub csqrtl +@ stub ctan +@ stub ctanf +@ stub ctanh +@ stub ctanhf +@ stub ctanhl +@ stub ctanl +@ cdecl erf(double) ucrtbase.erf +@ stub erfc +@ stub erfcf +@ stub erfcl +@ cdecl erff(double) ucrtbase.erff +@ cdecl erfl(double) ucrtbase.erfl +@ cdecl exp(double) ucrtbase.exp +@ cdecl exp2(double) ucrtbase.exp2 +@ cdecl exp2f(float) ucrtbase.exp2f +@ cdecl exp2l(double) ucrtbase.exp2l +@ cdecl -arch=arm,x86_64 expf(float) ucrtbase.expf +@ stub expm1 +@ stub expm1f +@ stub expm1l +@ cdecl fabs(double) ucrtbase.fabs +@ stub fdim +@ stub fdimf +@ stub fdiml +@ cdecl floor(double) ucrtbase.floor +@ cdecl -arch=arm,x86_64 floorf(float) ucrtbase.floorf +@ stub fma +@ stub fmaf +@ stub fmal +@ cdecl fmax(double double) ucrtbase.fmax +@ cdecl fmaxf(float float) ucrtbase.fmaxf +@ cdecl fmaxl(double double) ucrtbase.fmaxl +@ stub fmin +@ stub fminf +@ stub fminl +@ cdecl fmod(double double) ucrtbase.fmod +@ cdecl -arch=arm,x86_64 fmodf(float float) ucrtbase.fmodf +@ cdecl frexp(double ptr) ucrtbase.frexp +@ stub hypot +@ stub ilogb +@ stub ilogbf +@ stub ilogbl +@ cdecl ldexp(double long) ucrtbase.ldexp +@ stub lgamma +@ stub lgammaf +@ stub lgammal +@ cdecl -ret64 llrint(double) ucrtbase.llrint +@ cdecl -ret64 llrintf(float) ucrtbase.llrintf +@ cdecl -ret64 llrintl(double) ucrtbase.llrintl +@ cdecl -ret64 llround(double) ucrtbase.llround +@ cdecl -ret64 llroundf(float) ucrtbase.llroundf +@ cdecl -ret64 llroundl(double) ucrtbase.llroundl +@ cdecl log(double) ucrtbase.log +@ cdecl log10(double) ucrtbase.log10 +@ cdecl -arch=arm,x86_64 log10f(float) ucrtbase.log10f +@ stub log1p +@ stub log1pf +@ stub log1pl +@ cdecl log2(double) ucrtbase.log2 +@ cdecl log2f(float) ucrtbase.log2f +@ cdecl log2l(double) ucrtbase.log2l +@ stub logb +@ stub logbf +@ stub logbl +@ cdecl -arch=arm,x86_64 logf(float) ucrtbase.logf +@ cdecl lrint(double) ucrtbase.lrint +@ cdecl lrintf(float) ucrtbase.lrintf +@ cdecl lrintl(double) ucrtbase.lrintl +@ cdecl lround(double) ucrtbase.lround +@ cdecl lroundf(float) ucrtbase.lroundf +@ cdecl lroundl(double) ucrtbase.lroundl +@ cdecl modf(double ptr) ucrtbase.modf +@ cdecl -arch=arm,x86_64 modff(float ptr) ucrtbase.modff +@ stub nan +@ stub nanf +@ stub nanl +@ stub nearbyint +@ stub nearbyintf +@ stub nearbyintl +@ stub nextafter +@ stub nextafterf +@ stub nextafterl +@ stub nexttoward +@ stub nexttowardf +@ stub nexttowardl +@ stub norm +@ stub normf +@ stub norml +@ cdecl pow(double double) ucrtbase.pow +@ cdecl -arch=arm,x86_64 powf(float float) ucrtbase.powf +@ stub remainder +@ stub remainderf +@ stub remainderl +@ stub remquo +@ stub remquof +@ stub remquol +@ cdecl rint(double) ucrtbase.rint +@ cdecl rintf(float) ucrtbase.rintf +@ cdecl rintl(double) ucrtbase.rintl +@ cdecl round(double) ucrtbase.round +@ cdecl roundf(float) ucrtbase.roundf +@ cdecl roundl(double) ucrtbase.roundl +@ stub scalbln +@ stub scalblnf +@ stub scalblnl +@ stub scalbn +@ stub scalbnf +@ stub scalbnl +@ cdecl sin(double) ucrtbase.sin +@ cdecl -arch=arm,x86_64 sinf(float) ucrtbase.sinf +@ cdecl sinh(double) ucrtbase.sinh +@ cdecl -arch=arm,x86_64 sinhf(float) ucrtbase.sinhf +@ cdecl sqrt(double) ucrtbase.sqrt +@ cdecl -arch=arm,x86_64 sqrtf(float) ucrtbase.sqrtf +@ cdecl tan(double) ucrtbase.tan +@ cdecl -arch=arm,x86_64 tanf(float) ucrtbase.tanf +@ cdecl tanh(double) ucrtbase.tanh +@ cdecl -arch=arm,x86_64 tanhf(float) ucrtbase.tanhf +@ stub tgamma +@ stub tgammaf +@ stub tgammal +@ cdecl trunc(double) ucrtbase.trunc +@ cdecl truncf(float) ucrtbase.truncf +@ cdecl truncl(double) ucrtbase.truncl diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-math-l1-1-0/Makefile.in wine1.7-1.7.55/dlls/api-ms-win-crt-math-l1-1-0/Makefile.in --- wine1.7-1.7.50/dlls/api-ms-win-crt-math-l1-1-0/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-math-l1-1-0/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1 @@ +MODULE = api-ms-win-crt-math-l1-1-0.dll diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-multibyte-l1-1-0/api-ms-win-crt-multibyte-l1-1-0.spec wine1.7-1.7.55/dlls/api-ms-win-crt-multibyte-l1-1-0/api-ms-win-crt-multibyte-l1-1-0.spec --- wine1.7-1.7.50/dlls/api-ms-win-crt-multibyte-l1-1-0/api-ms-win-crt-multibyte-l1-1-0.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-multibyte-l1-1-0/api-ms-win-crt-multibyte-l1-1-0.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,200 @@ +@ cdecl __p__mbcasemap() ucrtbase.__p__mbcasemap +@ cdecl __p__mbctype() ucrtbase.__p__mbctype +@ cdecl _ismbbalnum(long) ucrtbase._ismbbalnum +@ stub _ismbbalnum_l +@ cdecl _ismbbalpha(long) ucrtbase._ismbbalpha +@ stub _ismbbalpha_l +@ stub _ismbbblank +@ stub _ismbbblank_l +@ cdecl _ismbbgraph(long) ucrtbase._ismbbgraph +@ stub _ismbbgraph_l +@ cdecl _ismbbkalnum(long) ucrtbase._ismbbkalnum +@ stub _ismbbkalnum_l +@ cdecl _ismbbkana(long) ucrtbase._ismbbkana +@ stub _ismbbkana_l +@ cdecl _ismbbkprint(long) ucrtbase._ismbbkprint +@ stub _ismbbkprint_l +@ cdecl _ismbbkpunct(long) ucrtbase._ismbbkpunct +@ stub _ismbbkpunct_l +@ cdecl _ismbblead(long) ucrtbase._ismbblead +@ cdecl _ismbblead_l(long ptr) ucrtbase._ismbblead_l +@ cdecl _ismbbprint(long) ucrtbase._ismbbprint +@ stub _ismbbprint_l +@ cdecl _ismbbpunct(long) ucrtbase._ismbbpunct +@ stub _ismbbpunct_l +@ cdecl _ismbbtrail(long) ucrtbase._ismbbtrail +@ stub _ismbbtrail_l +@ cdecl _ismbcalnum(long) ucrtbase._ismbcalnum +@ stub _ismbcalnum_l +@ cdecl _ismbcalpha(long) ucrtbase._ismbcalpha +@ stub _ismbcalpha_l +@ stub _ismbcblank +@ stub _ismbcblank_l +@ cdecl _ismbcdigit(long) ucrtbase._ismbcdigit +@ stub _ismbcdigit_l +@ cdecl _ismbcgraph(long) ucrtbase._ismbcgraph +@ stub _ismbcgraph_l +@ cdecl _ismbchira(long) ucrtbase._ismbchira +@ stub _ismbchira_l +@ cdecl _ismbckata(long) ucrtbase._ismbckata +@ stub _ismbckata_l +@ cdecl _ismbcl0(long) ucrtbase._ismbcl0 +@ stub _ismbcl0_l +@ cdecl _ismbcl1(long) ucrtbase._ismbcl1 +@ stub _ismbcl1_l +@ cdecl _ismbcl2(long) ucrtbase._ismbcl2 +@ stub _ismbcl2_l +@ cdecl _ismbclegal(long) ucrtbase._ismbclegal +@ stub _ismbclegal_l +@ cdecl _ismbclower(long) ucrtbase._ismbclower +@ stub _ismbclower_l +@ cdecl _ismbcprint(long) ucrtbase._ismbcprint +@ stub _ismbcprint_l +@ cdecl _ismbcpunct(long) ucrtbase._ismbcpunct +@ stub _ismbcpunct_l +@ cdecl _ismbcspace(long) ucrtbase._ismbcspace +@ stub _ismbcspace_l +@ cdecl _ismbcsymbol(long) ucrtbase._ismbcsymbol +@ stub _ismbcsymbol_l +@ cdecl _ismbcupper(long) ucrtbase._ismbcupper +@ stub _ismbcupper_l +@ cdecl _ismbslead(ptr ptr) ucrtbase._ismbslead +@ stub _ismbslead_l +@ cdecl _ismbstrail(ptr ptr) ucrtbase._ismbstrail +@ stub _ismbstrail_l +@ cdecl _mbbtombc(long) ucrtbase._mbbtombc +@ stub _mbbtombc_l +@ cdecl _mbbtype(long long) ucrtbase._mbbtype +@ stub _mbbtype_l +@ stub _mbcasemap +@ cdecl _mbccpy(ptr str) ucrtbase._mbccpy +@ stub _mbccpy_l +@ stub _mbccpy_s +@ stub _mbccpy_s_l +@ cdecl _mbcjistojms(long) ucrtbase._mbcjistojms +@ stub _mbcjistojms_l +@ cdecl _mbcjmstojis(long) ucrtbase._mbcjmstojis +@ stub _mbcjmstojis_l +@ cdecl _mbclen(ptr) ucrtbase._mbclen +@ stub _mbclen_l +@ cdecl _mbctohira(long) ucrtbase._mbctohira +@ stub _mbctohira_l +@ cdecl _mbctokata(long) ucrtbase._mbctokata +@ stub _mbctokata_l +@ cdecl _mbctolower(long) ucrtbase._mbctolower +@ stub _mbctolower_l +@ cdecl _mbctombb(long) ucrtbase._mbctombb +@ stub _mbctombb_l +@ cdecl _mbctoupper(long) ucrtbase._mbctoupper +@ stub _mbctoupper_l +@ stub _mblen_l +@ cdecl _mbsbtype(str long) ucrtbase._mbsbtype +@ stub _mbsbtype_l +@ cdecl _mbscat_s(ptr long str) ucrtbase._mbscat_s +@ cdecl _mbscat_s_l(ptr long str ptr) ucrtbase._mbscat_s_l +@ cdecl _mbschr(str long) ucrtbase._mbschr +@ stub _mbschr_l +@ cdecl _mbscmp(str str) ucrtbase._mbscmp +@ stub _mbscmp_l +@ cdecl _mbscoll(str str) ucrtbase._mbscoll +@ cdecl _mbscoll_l(str str ptr) ucrtbase._mbscoll_l +@ cdecl _mbscpy_s(ptr long str) ucrtbase._mbscpy_s +@ cdecl _mbscpy_s_l(ptr long str ptr) ucrtbase._mbscpy_s_l +@ cdecl _mbscspn(str str) ucrtbase._mbscspn +@ stub _mbscspn_l +@ cdecl _mbsdec(ptr ptr) ucrtbase._mbsdec +@ stub _mbsdec_l +@ stub _mbsdup +@ cdecl _mbsicmp(str str) ucrtbase._mbsicmp +@ stub _mbsicmp_l +@ cdecl _mbsicoll(str str) ucrtbase._mbsicoll +@ cdecl _mbsicoll_l(str str ptr) ucrtbase._mbsicoll_l +@ cdecl _mbsinc(str) ucrtbase._mbsinc +@ stub _mbsinc_l +@ cdecl _mbslen(str) ucrtbase._mbslen +@ stub _mbslen_l +@ cdecl _mbslwr(str) ucrtbase._mbslwr +@ stub _mbslwr_l +@ cdecl _mbslwr_s(str long) ucrtbase._mbslwr_s +@ stub _mbslwr_s_l +@ cdecl _mbsnbcat(str str long) ucrtbase._mbsnbcat +@ stub _mbsnbcat_l +@ cdecl _mbsnbcat_s(str long ptr long) ucrtbase._mbsnbcat_s +@ stub _mbsnbcat_s_l +@ cdecl _mbsnbcmp(str str long) ucrtbase._mbsnbcmp +@ stub _mbsnbcmp_l +@ cdecl _mbsnbcnt(ptr long) ucrtbase._mbsnbcnt +@ stub _mbsnbcnt_l +@ cdecl _mbsnbcoll(str str long) ucrtbase._mbsnbcoll +@ cdecl _mbsnbcoll_l(str str long ptr) ucrtbase._mbsnbcoll_l +@ cdecl _mbsnbcpy(ptr str long) ucrtbase._mbsnbcpy +@ stub _mbsnbcpy_l +@ cdecl _mbsnbcpy_s(ptr long str long) ucrtbase._mbsnbcpy_s +@ cdecl _mbsnbcpy_s_l(ptr long str long ptr) ucrtbase._mbsnbcpy_s_l +@ cdecl _mbsnbicmp(str str long) ucrtbase._mbsnbicmp +@ stub _mbsnbicmp_l +@ cdecl _mbsnbicoll(str str long) ucrtbase._mbsnbicoll +@ cdecl _mbsnbicoll_l(str str long ptr) ucrtbase._mbsnbicoll_l +@ cdecl _mbsnbset(ptr long long) ucrtbase._mbsnbset +@ stub _mbsnbset_l +@ stub _mbsnbset_s +@ stub _mbsnbset_s_l +@ cdecl _mbsncat(str str long) ucrtbase._mbsncat +@ stub _mbsncat_l +@ stub _mbsncat_s +@ stub _mbsncat_s_l +@ cdecl _mbsnccnt(str long) ucrtbase._mbsnccnt +@ stub _mbsnccnt_l +@ cdecl _mbsncmp(str str long) ucrtbase._mbsncmp +@ stub _mbsncmp_l +@ cdecl _mbsncoll(str str long) ucrtbase._mbsncoll +@ stub _mbsncoll_l +@ cdecl _mbsncpy(ptr str long) ucrtbase._mbsncpy +@ stub _mbsncpy_l +@ stub _mbsncpy_s +@ stub _mbsncpy_s_l +@ cdecl _mbsnextc(str) ucrtbase._mbsnextc +@ stub _mbsnextc_l +@ cdecl _mbsnicmp(str str long) ucrtbase._mbsnicmp +@ stub _mbsnicmp_l +@ cdecl _mbsnicoll(str str long) ucrtbase._mbsnicoll +@ stub _mbsnicoll_l +@ cdecl _mbsninc(str long) ucrtbase._mbsninc +@ stub _mbsninc_l +@ stub _mbsnlen +@ stub _mbsnlen_l +@ cdecl _mbsnset(ptr long long) ucrtbase._mbsnset +@ stub _mbsnset_l +@ stub _mbsnset_s +@ stub _mbsnset_s_l +@ cdecl _mbspbrk(str str) ucrtbase._mbspbrk +@ stub _mbspbrk_l +@ cdecl _mbsrchr(str long) ucrtbase._mbsrchr +@ stub _mbsrchr_l +@ cdecl _mbsrev(str) ucrtbase._mbsrev +@ stub _mbsrev_l +@ cdecl _mbsset(ptr long) ucrtbase._mbsset +@ stub _mbsset_l +@ stub _mbsset_s +@ stub _mbsset_s_l +@ cdecl _mbsspn(str str) ucrtbase._mbsspn +@ stub _mbsspn_l +@ cdecl _mbsspnp(str str) ucrtbase._mbsspnp +@ stub _mbsspnp_l +@ cdecl _mbsstr(str str) ucrtbase._mbsstr +@ stub _mbsstr_l +@ cdecl _mbstok(str str) ucrtbase._mbstok +@ cdecl _mbstok_l(str str ptr) ucrtbase._mbstok_l +@ cdecl _mbstok_s(str str ptr) ucrtbase._mbstok_s +@ cdecl _mbstok_s_l(str str ptr ptr) ucrtbase._mbstok_s_l +@ cdecl _mbstowcs_l(ptr str long ptr) ucrtbase._mbstowcs_l +@ cdecl _mbstowcs_s_l(ptr ptr long str long ptr) ucrtbase._mbstowcs_s_l +@ cdecl _mbstrlen(str) ucrtbase._mbstrlen +@ cdecl _mbstrlen_l(str ptr) ucrtbase._mbstrlen_l +@ stub _mbstrnlen +@ stub _mbstrnlen_l +@ cdecl _mbsupr(str) ucrtbase._mbsupr +@ stub _mbsupr_l +@ cdecl _mbsupr_s(str long) ucrtbase._mbsupr_s +@ stub _mbsupr_s_l +@ cdecl _mbtowc_l(ptr str long ptr) ucrtbase._mbtowc_l diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-multibyte-l1-1-0/Makefile.in wine1.7-1.7.55/dlls/api-ms-win-crt-multibyte-l1-1-0/Makefile.in --- wine1.7-1.7.50/dlls/api-ms-win-crt-multibyte-l1-1-0/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-multibyte-l1-1-0/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1 @@ +MODULE = api-ms-win-crt-multibyte-l1-1-0.dll diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec wine1.7-1.7.55/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec --- wine1.7-1.7.50/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,1167 @@ +@ stub _CreateFrameInfo +@ stdcall _CxxThrowException(long long) ucrtbase._CxxThrowException +@ cdecl -arch=i386 -norelay _EH_prolog() ucrtbase._EH_prolog +@ stub _FindAndUnlinkFrame +@ stub _GetImageBase +@ stub _GetThrowImageBase +@ stub _IsExceptionObjectToBeDestroyed +@ stub _NLG_Dispatch2 +@ stub _NLG_Return +@ stub _NLG_Return2 +@ stub _SetImageBase +@ stub _SetThrowImageBase +@ stub _SetWinRTOutOfMemoryExceptionCallback +@ cdecl __AdjustPointer(ptr ptr) ucrtbase.__AdjustPointer +@ stub __BuildCatchObject +@ stub __BuildCatchObjectHelper +@ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ucrtbase.__C_specific_handler +@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) ucrtbase.__CxxDetectRethrow +@ cdecl -arch=i386,x86_64,arm __CxxExceptionFilter(ptr ptr long ptr) ucrtbase.__CxxExceptionFilter +@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) ucrtbase.__CxxFrameHandler +@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler2(ptr ptr ptr ptr) ucrtbase.__CxxFrameHandler2 +@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler3(ptr ptr ptr ptr) ucrtbase.__CxxFrameHandler3 +@ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) ucrtbase.__CxxLongjmpUnwind +@ cdecl -arch=i386,x86_64,arm __CxxQueryExceptionSize() ucrtbase.__CxxQueryExceptionSize +@ stub __CxxRegisterExceptionObject +@ stub __CxxUnregisterExceptionObject +@ stub __DestructExceptionObject +@ stub __FrameUnwindFilter +@ stub __GetPlatformExceptionInfo +@ stub __NLG_Dispatch2 +@ stub __NLG_Return2 +@ cdecl __RTCastToVoid(ptr) ucrtbase.__RTCastToVoid +@ cdecl __RTDynamicCast(ptr long ptr ptr long) ucrtbase.__RTDynamicCast +@ cdecl __RTtypeid(ptr) ucrtbase.__RTtypeid +@ stub __TypeMatch +@ stub __current_exception +@ stub __current_exception_context +@ stub __dcrt_get_wide_environment_from_os +@ stub __dcrt_initial_narrow_environment +@ stub __intrinsic_abnormal_termination +@ stub __intrinsic_setjmp +@ stub __intrinsic_setjmpex +@ stub __processing_throw +@ stub __report_gsfailure +@ stub __std_exception_copy +@ stub __std_exception_destroy +@ cdecl __std_type_info_compare(ptr ptr) ucrtbase.__std_type_info_compare +@ stub __std_type_info_destroy_list +@ stub __std_type_info_hash +@ stub __std_type_info_name +@ cdecl __unDName(ptr str long ptr ptr long) ucrtbase.__unDName +@ cdecl __unDNameEx(ptr str long ptr ptr ptr long) ucrtbase.__unDNameEx +@ cdecl __uncaught_exception() ucrtbase.__uncaught_exception +@ cdecl -arch=i386 -norelay _chkesp() ucrtbase._chkesp +@ cdecl -arch=i386 _except_handler2(ptr ptr ptr ptr) ucrtbase._except_handler2 +@ cdecl -arch=i386 _except_handler3(ptr ptr ptr ptr) ucrtbase._except_handler3 +@ cdecl -arch=i386 _except_handler4_common(ptr ptr ptr ptr ptr ptr) ucrtbase._except_handler4_common +@ stub _get_purecall_handler +@ cdecl _get_unexpected() ucrtbase._get_unexpected +@ cdecl -arch=i386 _global_unwind2(ptr) ucrtbase._global_unwind2 +@ stub _is_exception_typeof +@ cdecl -arch=x86_64 _local_unwind(ptr ptr) ucrtbase._local_unwind +@ cdecl -arch=i386 _local_unwind2(ptr long) ucrtbase._local_unwind2 +@ cdecl -arch=i386 _local_unwind4(ptr ptr long) ucrtbase._local_unwind4 +@ cdecl -arch=i386 _longjmpex(ptr long) ucrtbase._longjmpex +@ stub _o__CIacos +@ stub _o__CIasin +@ stub _o__CIatan +@ stub _o__CIatan2 +@ stub _o__CIcos +@ stub _o__CIcosh +@ stub _o__CIexp +@ stub _o__CIfmod +@ stub _o__CIlog +@ stub _o__CIlog10 +@ stub _o__CIpow +@ stub _o__CIsin +@ stub _o__CIsinh +@ stub _o__CIsqrt +@ stub _o__CItan +@ stub _o__CItanh +@ stub _o__Getdays +@ stub _o__Getmonths +@ stub _o__Gettnames +@ stub _o__Strftime +@ stub _o__W_Getdays +@ stub _o__W_Getmonths +@ stub _o__W_Gettnames +@ stub _o__Wcsftime +@ stub _o___acrt_iob_func +@ stub _o___conio_common_vcprintf +@ stub _o___conio_common_vcprintf_p +@ stub _o___conio_common_vcprintf_s +@ stub _o___conio_common_vcscanf +@ stub _o___conio_common_vcwprintf +@ stub _o___conio_common_vcwprintf_p +@ stub _o___conio_common_vcwprintf_s +@ stub _o___conio_common_vcwscanf +@ stub _o___daylight +@ stub _o___dstbias +@ stub _o___fpe_flt_rounds +@ stub _o___libm_sse2_acos +@ stub _o___libm_sse2_acosf +@ stub _o___libm_sse2_asin +@ stub _o___libm_sse2_asinf +@ stub _o___libm_sse2_atan +@ stub _o___libm_sse2_atan2 +@ stub _o___libm_sse2_atanf +@ stub _o___libm_sse2_cos +@ stub _o___libm_sse2_cosf +@ stub _o___libm_sse2_exp +@ stub _o___libm_sse2_expf +@ stub _o___libm_sse2_log +@ stub _o___libm_sse2_log10 +@ stub _o___libm_sse2_log10f +@ stub _o___libm_sse2_logf +@ stub _o___libm_sse2_pow +@ stub _o___libm_sse2_powf +@ stub _o___libm_sse2_sin +@ stub _o___libm_sse2_sinf +@ stub _o___libm_sse2_tan +@ stub _o___libm_sse2_tanf +@ stub _o___p___argc +@ stub _o___p___argv +@ stub _o___p___wargv +@ stub _o___p__acmdln +@ stub _o___p__commode +@ stub _o___p__environ +@ stub _o___p__fmode +@ stub _o___p__mbcasemap +@ stub _o___p__mbctype +@ stub _o___p__pgmptr +@ stub _o___p__wcmdln +@ stub _o___p__wenviron +@ stub _o___p__wpgmptr +@ stub _o___pctype_func +@ stub _o___pwctype_func +@ stub _o___stdio_common_vfprintf +@ stub _o___stdio_common_vfprintf_p +@ stub _o___stdio_common_vfprintf_s +@ stub _o___stdio_common_vfscanf +@ stub _o___stdio_common_vfwprintf +@ stub _o___stdio_common_vfwprintf_p +@ stub _o___stdio_common_vfwprintf_s +@ stub _o___stdio_common_vfwscanf +@ stub _o___stdio_common_vsnprintf_s +@ stub _o___stdio_common_vsnwprintf_s +@ stub _o___stdio_common_vsprintf +@ stub _o___stdio_common_vsprintf_p +@ stub _o___stdio_common_vsprintf_s +@ stub _o___stdio_common_vsscanf +@ stub _o___stdio_common_vswprintf +@ stub _o___stdio_common_vswprintf_p +@ stub _o___stdio_common_vswprintf_s +@ stub _o___stdio_common_vswscanf +@ stub _o___timezone +@ stub _o___tzname +@ stub _o___wcserror +@ stub _o__access +@ stub _o__access_s +@ stub _o__aligned_free +@ stub _o__aligned_malloc +@ stub _o__aligned_msize +@ stub _o__aligned_offset_malloc +@ stub _o__aligned_offset_realloc +@ stub _o__aligned_offset_recalloc +@ stub _o__aligned_realloc +@ stub _o__aligned_recalloc +@ stub _o__atodbl +@ stub _o__atodbl_l +@ stub _o__atof_l +@ stub _o__atoflt +@ stub _o__atoflt_l +@ stub _o__atoi64 +@ stub _o__atoi64_l +@ stub _o__atoi_l +@ stub _o__atol_l +@ stub _o__atoldbl +@ stub _o__atoldbl_l +@ stub _o__atoll_l +@ stub _o__beep +@ stub _o__beginthread +@ stub _o__beginthreadex +@ stub _o__cabs +@ stub _o__callnewh +@ stub _o__calloc_base +@ stub _o__cgets +@ stub _o__cgets_s +@ stub _o__cgetws +@ stub _o__cgetws_s +@ stub _o__chdir +@ stub _o__chdrive +@ stub _o__chmod +@ stub _o__chsize +@ stub _o__chsize_s +@ stub _o__close +@ stub _o__commit +@ stub _o__configure_wide_argv +@ stub _o__cputs +@ stub _o__cputws +@ stub _o__creat +@ stub _o__create_locale +@ stub _o__ctime32_s +@ stub _o__ctime64_s +@ stub _o__cwait +@ stub _o__d_int +@ stub _o__dclass +@ stub _o__difftime32 +@ stub _o__difftime64 +@ stub _o__dlog +@ stub _o__dnorm +@ stub _o__dpcomp +@ stub _o__dpoly +@ stub _o__dscale +@ stub _o__dsign +@ stub _o__dsin +@ stub _o__dtest +@ stub _o__dunscale +@ stub _o__dup +@ stub _o__dup2 +@ stub _o__dupenv_s +@ stub _o__ecvt +@ stub _o__ecvt_s +@ stub _o__endthread +@ stub _o__endthreadex +@ stub _o__eof +@ stub _o__errno +@ stub _o__except1 +@ stub _o__execute_onexit_table +@ stub _o__execv +@ stub _o__execve +@ stub _o__execvp +@ stub _o__execvpe +@ stub _o__expand +@ stub _o__fclose_nolock +@ stub _o__fcloseall +@ stub _o__fcvt +@ stub _o__fcvt_s +@ stub _o__fd_int +@ stub _o__fdclass +@ stub _o__fdexp +@ stub _o__fdlog +@ stub _o__fdopen +@ stub _o__fdpcomp +@ stub _o__fdpoly +@ stub _o__fdscale +@ stub _o__fdsign +@ stub _o__fdsin +@ stub _o__fflush_nolock +@ stub _o__fgetc_nolock +@ stub _o__fgetchar +@ stub _o__fgetwc_nolock +@ stub _o__fgetwchar +@ stub _o__filelength +@ stub _o__filelengthi64 +@ stub _o__fileno +@ stub _o__findclose +@ stub _o__findfirst32 +@ stub _o__findfirst32i64 +@ stub _o__findfirst64 +@ stub _o__findfirst64i32 +@ stub _o__findnext32 +@ stub _o__findnext32i64 +@ stub _o__findnext64 +@ stub _o__findnext64i32 +@ stub _o__flushall +@ stub _o__fpclass +@ stub _o__fpclassf +@ stub _o__fputc_nolock +@ stub _o__fputchar +@ stub _o__fputwc_nolock +@ stub _o__fputwchar +@ stub _o__fread_nolock +@ stub _o__fread_nolock_s +@ stub _o__free_base +@ stub _o__free_locale +@ stub _o__fseek_nolock +@ stub _o__fseeki64 +@ stub _o__fseeki64_nolock +@ stub _o__fsopen +@ stub _o__fstat32 +@ stub _o__fstat32i64 +@ stub _o__fstat64 +@ stub _o__fstat64i32 +@ stub _o__ftell_nolock +@ stub _o__ftelli64 +@ stub _o__ftelli64_nolock +@ stub _o__ftime32 +@ stub _o__ftime32_s +@ stub _o__ftime64 +@ stub _o__ftime64_s +@ stub _o__fullpath +@ stub _o__futime32 +@ stub _o__futime64 +@ stub _o__fwrite_nolock +@ stub _o__gcvt +@ stub _o__gcvt_s +@ stub _o__get_daylight +@ stub _o__get_doserrno +@ stub _o__get_dstbias +@ stub _o__get_errno +@ stub _o__get_fmode +@ stub _o__get_heap_handle +@ stub _o__get_invalid_parameter_handler +@ stub _o__get_narrow_winmain_command_line +@ stub _o__get_osfhandle +@ stub _o__get_pgmptr +@ stub _o__get_stream_buffer_pointers +@ stub _o__get_terminate +@ stub _o__get_thread_local_invalid_parameter_handler +@ stub _o__get_timezone +@ stub _o__get_tzname +@ stub _o__get_wide_winmain_command_line +@ stub _o__get_wpgmptr +@ stub _o__getc_nolock +@ stub _o__getch +@ stub _o__getch_nolock +@ stub _o__getche +@ stub _o__getche_nolock +@ stub _o__getcwd +@ stub _o__getdcwd +@ stub _o__getdiskfree +@ stub _o__getdllprocaddr +@ stub _o__getdrive +@ stub _o__getdrives +@ stub _o__getmbcp +@ stub _o__getsystime +@ stub _o__getw +@ stub _o__getwc_nolock +@ stub _o__getwch +@ stub _o__getwch_nolock +@ stub _o__getwche +@ stub _o__getwche_nolock +@ stub _o__getws +@ stub _o__getws_s +@ stub _o__gmtime32 +@ stub _o__gmtime32_s +@ stub _o__gmtime64 +@ stub _o__gmtime64_s +@ stub _o__heapchk +@ stub _o__heapmin +@ stub _o__hypot +@ stub _o__hypotf +@ stub _o__i64toa +@ stub _o__i64toa_s +@ stub _o__i64tow +@ stub _o__i64tow_s +@ stub _o__initialize_onexit_table +@ stub _o__invalid_parameter_noinfo +@ stub _o__invalid_parameter_noinfo_noreturn +@ stub _o__isatty +@ stub _o__isctype +@ stub _o__isctype_l +@ stub _o__isleadbyte_l +@ stub _o__ismbbalnum +@ stub _o__ismbbalnum_l +@ stub _o__ismbbalpha +@ stub _o__ismbbalpha_l +@ stub _o__ismbbblank +@ stub _o__ismbbblank_l +@ stub _o__ismbbgraph +@ stub _o__ismbbgraph_l +@ stub _o__ismbbkalnum +@ stub _o__ismbbkalnum_l +@ stub _o__ismbbkana +@ stub _o__ismbbkana_l +@ stub _o__ismbbkprint +@ stub _o__ismbbkprint_l +@ stub _o__ismbbkpunct +@ stub _o__ismbbkpunct_l +@ stub _o__ismbblead +@ stub _o__ismbblead_l +@ stub _o__ismbbprint +@ stub _o__ismbbprint_l +@ stub _o__ismbbpunct +@ stub _o__ismbbpunct_l +@ stub _o__ismbbtrail +@ stub _o__ismbbtrail_l +@ stub _o__ismbcalnum +@ stub _o__ismbcalnum_l +@ stub _o__ismbcalpha +@ stub _o__ismbcalpha_l +@ stub _o__ismbcblank +@ stub _o__ismbcblank_l +@ stub _o__ismbcdigit +@ stub _o__ismbcdigit_l +@ stub _o__ismbcgraph +@ stub _o__ismbcgraph_l +@ stub _o__ismbchira +@ stub _o__ismbchira_l +@ stub _o__ismbckata +@ stub _o__ismbckata_l +@ stub _o__ismbcl0 +@ stub _o__ismbcl0_l +@ stub _o__ismbcl1 +@ stub _o__ismbcl1_l +@ stub _o__ismbcl2 +@ stub _o__ismbcl2_l +@ stub _o__ismbclegal +@ stub _o__ismbclegal_l +@ stub _o__ismbclower +@ stub _o__ismbclower_l +@ stub _o__ismbcprint +@ stub _o__ismbcprint_l +@ stub _o__ismbcpunct +@ stub _o__ismbcpunct_l +@ stub _o__ismbcspace +@ stub _o__ismbcspace_l +@ stub _o__ismbcsymbol +@ stub _o__ismbcsymbol_l +@ stub _o__ismbcupper +@ stub _o__ismbcupper_l +@ stub _o__ismbslead +@ stub _o__ismbslead_l +@ stub _o__ismbstrail +@ stub _o__ismbstrail_l +@ stub _o__iswctype_l +@ stub _o__itoa +@ stub _o__itoa_s +@ stub _o__itow +@ stub _o__itow_s +@ stub _o__j0 +@ stub _o__j1 +@ stub _o__jn +@ stub _o__kbhit +@ stub _o__ld_int +@ stub _o__ldclass +@ stub _o__ldexp +@ stub _o__ldlog +@ stub _o__ldpcomp +@ stub _o__ldpoly +@ stub _o__ldscale +@ stub _o__ldsign +@ stub _o__ldsin +@ stub _o__ldtest +@ stub _o__ldunscale +@ stub _o__lfind +@ stub _o__lfind_s +@ stub _o__libm_sse2_acos_precise +@ stub _o__libm_sse2_asin_precise +@ stub _o__libm_sse2_atan_precise +@ stub _o__libm_sse2_cos_precise +@ stub _o__libm_sse2_exp_precise +@ stub _o__libm_sse2_log10_precise +@ stub _o__libm_sse2_log_precise +@ stub _o__libm_sse2_pow_precise +@ stub _o__libm_sse2_sin_precise +@ stub _o__libm_sse2_sqrt_precise +@ stub _o__libm_sse2_tan_precise +@ stub _o__loaddll +@ stub _o__localtime32 +@ stub _o__localtime32_s +@ stub _o__localtime64 +@ stub _o__localtime64_s +@ stub _o__lock_file +@ stub _o__locking +@ stub _o__logb +@ stub _o__logbf +@ stub _o__lsearch +@ stub _o__lsearch_s +@ stub _o__lseek +@ stub _o__lseeki64 +@ stub _o__ltoa +@ stub _o__ltoa_s +@ stub _o__ltow +@ stub _o__ltow_s +@ stub _o__makepath +@ stub _o__makepath_s +@ stub _o__malloc_base +@ stub _o__mbbtombc +@ stub _o__mbbtombc_l +@ stub _o__mbbtype +@ stub _o__mbbtype_l +@ stub _o__mbccpy +@ stub _o__mbccpy_l +@ stub _o__mbccpy_s +@ stub _o__mbccpy_s_l +@ stub _o__mbcjistojms +@ stub _o__mbcjistojms_l +@ stub _o__mbcjmstojis +@ stub _o__mbcjmstojis_l +@ stub _o__mbclen +@ stub _o__mbclen_l +@ stub _o__mbctohira +@ stub _o__mbctohira_l +@ stub _o__mbctokata +@ stub _o__mbctokata_l +@ stub _o__mbctolower +@ stub _o__mbctolower_l +@ stub _o__mbctombb +@ stub _o__mbctombb_l +@ stub _o__mbctoupper +@ stub _o__mbctoupper_l +@ stub _o__mblen_l +@ stub _o__mbsbtype +@ stub _o__mbsbtype_l +@ stub _o__mbscat_s +@ stub _o__mbscat_s_l +@ stub _o__mbschr +@ stub _o__mbschr_l +@ stub _o__mbscmp +@ stub _o__mbscmp_l +@ stub _o__mbscoll +@ stub _o__mbscoll_l +@ stub _o__mbscpy_s +@ stub _o__mbscpy_s_l +@ stub _o__mbscspn +@ stub _o__mbscspn_l +@ stub _o__mbsdec +@ stub _o__mbsdec_l +@ stub _o__mbsicmp +@ stub _o__mbsicmp_l +@ stub _o__mbsicoll +@ stub _o__mbsicoll_l +@ stub _o__mbsinc +@ stub _o__mbsinc_l +@ stub _o__mbslen +@ stub _o__mbslen_l +@ stub _o__mbslwr +@ stub _o__mbslwr_l +@ stub _o__mbslwr_s +@ stub _o__mbslwr_s_l +@ stub _o__mbsnbcat +@ stub _o__mbsnbcat_l +@ stub _o__mbsnbcat_s +@ stub _o__mbsnbcat_s_l +@ stub _o__mbsnbcmp +@ stub _o__mbsnbcmp_l +@ stub _o__mbsnbcnt +@ stub _o__mbsnbcnt_l +@ stub _o__mbsnbcoll +@ stub _o__mbsnbcoll_l +@ stub _o__mbsnbcpy +@ stub _o__mbsnbcpy_l +@ stub _o__mbsnbcpy_s +@ stub _o__mbsnbcpy_s_l +@ stub _o__mbsnbicmp +@ stub _o__mbsnbicmp_l +@ stub _o__mbsnbicoll +@ stub _o__mbsnbicoll_l +@ stub _o__mbsnbset +@ stub _o__mbsnbset_l +@ stub _o__mbsnbset_s +@ stub _o__mbsnbset_s_l +@ stub _o__mbsncat +@ stub _o__mbsncat_l +@ stub _o__mbsncat_s +@ stub _o__mbsncat_s_l +@ stub _o__mbsnccnt +@ stub _o__mbsnccnt_l +@ stub _o__mbsncmp +@ stub _o__mbsncmp_l +@ stub _o__mbsncoll +@ stub _o__mbsncoll_l +@ stub _o__mbsncpy +@ stub _o__mbsncpy_l +@ stub _o__mbsncpy_s +@ stub _o__mbsncpy_s_l +@ stub _o__mbsnextc +@ stub _o__mbsnextc_l +@ stub _o__mbsnicmp +@ stub _o__mbsnicmp_l +@ stub _o__mbsnicoll +@ stub _o__mbsnicoll_l +@ stub _o__mbsninc +@ stub _o__mbsninc_l +@ stub _o__mbsnlen +@ stub _o__mbsnlen_l +@ stub _o__mbsnset +@ stub _o__mbsnset_l +@ stub _o__mbsnset_s +@ stub _o__mbsnset_s_l +@ stub _o__mbspbrk +@ stub _o__mbspbrk_l +@ stub _o__mbsrchr +@ stub _o__mbsrchr_l +@ stub _o__mbsrev +@ stub _o__mbsrev_l +@ stub _o__mbsset +@ stub _o__mbsset_l +@ stub _o__mbsset_s +@ stub _o__mbsset_s_l +@ stub _o__mbsspn +@ stub _o__mbsspn_l +@ stub _o__mbsspnp +@ stub _o__mbsspnp_l +@ stub _o__mbsstr +@ stub _o__mbsstr_l +@ stub _o__mbstok +@ stub _o__mbstok_l +@ stub _o__mbstok_s +@ stub _o__mbstok_s_l +@ stub _o__mbstowcs_l +@ stub _o__mbstowcs_s_l +@ stub _o__mbstrlen +@ stub _o__mbstrlen_l +@ stub _o__mbstrnlen +@ stub _o__mbstrnlen_l +@ stub _o__mbsupr +@ stub _o__mbsupr_l +@ stub _o__mbsupr_s +@ stub _o__mbsupr_s_l +@ stub _o__mbtowc_l +@ stub _o__memicmp +@ stub _o__memicmp_l +@ stub _o__mkdir +@ stub _o__mkgmtime32 +@ stub _o__mkgmtime64 +@ stub _o__mktemp +@ stub _o__mktemp_s +@ stub _o__mktime32 +@ stub _o__mktime64 +@ stub _o__msize +@ stub _o__nextafter +@ stub _o__nextafterf +@ stub _o__open_osfhandle +@ stub _o__pclose +@ stub _o__pipe +@ stub _o__popen +@ stub _o__putc_nolock +@ stub _o__putch +@ stub _o__putch_nolock +@ stub _o__putenv +@ stub _o__putenv_s +@ stub _o__putw +@ stub _o__putwc_nolock +@ stub _o__putwch +@ stub _o__putwch_nolock +@ stub _o__putws +@ stub _o__read +@ stub _o__realloc_base +@ stub _o__recalloc +@ stub _o__register_onexit_function +@ stub _o__resetstkoflw +@ stub _o__rmdir +@ stub _o__rmtmp +@ stub _o__scalb +@ stub _o__scalbf +@ stub _o__searchenv +@ stub _o__searchenv_s +@ stub _o__set_abort_behavior +@ stub _o__set_doserrno +@ stub _o__set_errno +@ stub _o__set_invalid_parameter_handler +@ stub _o__set_new_handler +@ stub _o__set_new_mode +@ stub _o__set_thread_local_invalid_parameter_handler +@ stub _o__seterrormode +@ stub _o__setmbcp +@ stub _o__setmode +@ stub _o__setsystime +@ stub _o__sleep +@ stub _o__sopen +@ stub _o__sopen_dispatch +@ stub _o__sopen_s +@ stub _o__spawnv +@ stub _o__spawnve +@ stub _o__spawnvp +@ stub _o__spawnvpe +@ stub _o__splitpath +@ stub _o__splitpath_s +@ stub _o__stat32 +@ stub _o__stat32i64 +@ stub _o__stat64 +@ stub _o__stat64i32 +@ stub _o__strcoll_l +@ stub _o__strdate +@ stub _o__strdate_s +@ stub _o__strdup +@ stub _o__strerror +@ stub _o__strerror_s +@ stub _o__strftime_l +@ stub _o__stricmp +@ stub _o__stricmp_l +@ stub _o__stricoll +@ stub _o__stricoll_l +@ stub _o__strlwr +@ stub _o__strlwr_l +@ stub _o__strlwr_s +@ stub _o__strlwr_s_l +@ stub _o__strncoll +@ stub _o__strncoll_l +@ stub _o__strnicmp +@ stub _o__strnicmp_l +@ stub _o__strnicoll +@ stub _o__strnicoll_l +@ stub _o__strnset_s +@ stub _o__strset_s +@ stub _o__strtime +@ stub _o__strtime_s +@ stub _o__strtod_l +@ stub _o__strtof_l +@ stub _o__strtoi64 +@ stub _o__strtoi64_l +@ stub _o__strtol_l +@ stub _o__strtold_l +@ stub _o__strtoll_l +@ stub _o__strtoui64 +@ stub _o__strtoui64_l +@ stub _o__strtoul_l +@ stub _o__strtoull_l +@ stub _o__strupr +@ stub _o__strupr_l +@ stub _o__strupr_s +@ stub _o__strupr_s_l +@ stub _o__strxfrm_l +@ stub _o__swab +@ stub _o__tell +@ stub _o__telli64 +@ stub _o__timespec32_get +@ stub _o__timespec64_get +@ stub _o__tolower +@ stub _o__tolower_l +@ stub _o__toupper +@ stub _o__toupper_l +@ stub _o__towlower_l +@ stub _o__towupper_l +@ stub _o__tzset +@ stub _o__ui64toa +@ stub _o__ui64toa_s +@ stub _o__ui64tow +@ stub _o__ui64tow_s +@ stub _o__ultoa +@ stub _o__ultoa_s +@ stub _o__ultow +@ stub _o__ultow_s +@ stub _o__umask +@ stub _o__umask_s +@ stub _o__ungetc_nolock +@ stub _o__ungetch +@ stub _o__ungetch_nolock +@ stub _o__ungetwc_nolock +@ stub _o__ungetwch +@ stub _o__ungetwch_nolock +@ stub _o__unlink +@ stub _o__unloaddll +@ stub _o__unlock_file +@ stub _o__utime32 +@ stub _o__utime64 +@ stub _o__waccess +@ stub _o__waccess_s +@ stub _o__wasctime +@ stub _o__wasctime_s +@ stub _o__wchdir +@ stub _o__wchmod +@ stub _o__wcreat +@ stub _o__wcreate_locale +@ stub _o__wcscoll_l +@ stub _o__wcsdup +@ stub _o__wcserror +@ stub _o__wcserror_s +@ stub _o__wcsftime_l +@ stub _o__wcsicmp +@ stub _o__wcsicmp_l +@ stub _o__wcsicoll +@ stub _o__wcsicoll_l +@ stub _o__wcslwr +@ stub _o__wcslwr_l +@ stub _o__wcslwr_s +@ stub _o__wcslwr_s_l +@ stub _o__wcsncoll +@ stub _o__wcsncoll_l +@ stub _o__wcsnicmp +@ stub _o__wcsnicmp_l +@ stub _o__wcsnicoll +@ stub _o__wcsnicoll_l +@ stub _o__wcsnset +@ stub _o__wcsnset_s +@ stub _o__wcsset +@ stub _o__wcsset_s +@ stub _o__wcstod_l +@ stub _o__wcstof_l +@ stub _o__wcstoi64 +@ stub _o__wcstoi64_l +@ stub _o__wcstol_l +@ stub _o__wcstold_l +@ stub _o__wcstoll_l +@ stub _o__wcstombs_l +@ stub _o__wcstombs_s_l +@ stub _o__wcstoui64 +@ stub _o__wcstoui64_l +@ stub _o__wcstoul_l +@ stub _o__wcstoull_l +@ stub _o__wcsupr +@ stub _o__wcsupr_l +@ stub _o__wcsupr_s +@ stub _o__wcsupr_s_l +@ stub _o__wcsxfrm_l +@ stub _o__wctime32 +@ stub _o__wctime32_s +@ stub _o__wctime64 +@ stub _o__wctime64_s +@ stub _o__wctomb_l +@ stub _o__wctomb_s_l +@ stub _o__wdupenv_s +@ stub _o__wexecv +@ stub _o__wexecve +@ stub _o__wexecvp +@ stub _o__wexecvpe +@ stub _o__wfdopen +@ stub _o__wfindfirst32 +@ stub _o__wfindfirst32i64 +@ stub _o__wfindfirst64 +@ stub _o__wfindfirst64i32 +@ stub _o__wfindnext32 +@ stub _o__wfindnext32i64 +@ stub _o__wfindnext64 +@ stub _o__wfindnext64i32 +@ stub _o__wfopen +@ stub _o__wfopen_s +@ stub _o__wfreopen +@ stub _o__wfreopen_s +@ stub _o__wfsopen +@ stub _o__wfullpath +@ stub _o__wgetcwd +@ stub _o__wgetdcwd +@ stub _o__wgetenv +@ stub _o__wgetenv_s +@ stub _o__wmakepath +@ stub _o__wmakepath_s +@ stub _o__wmkdir +@ stub _o__wmktemp +@ stub _o__wmktemp_s +@ stub _o__wperror +@ stub _o__wpopen +@ stub _o__wputenv +@ stub _o__wputenv_s +@ stub _o__wremove +@ stub _o__wrename +@ stub _o__write +@ stub _o__wrmdir +@ stub _o__wsearchenv +@ stub _o__wsearchenv_s +@ stub _o__wsetlocale +@ stub _o__wsopen_dispatch +@ stub _o__wsopen_s +@ stub _o__wspawnv +@ stub _o__wspawnve +@ stub _o__wspawnvp +@ stub _o__wspawnvpe +@ stub _o__wsplitpath +@ stub _o__wsplitpath_s +@ stub _o__wstat32 +@ stub _o__wstat32i64 +@ stub _o__wstat64 +@ stub _o__wstat64i32 +@ stub _o__wstrdate +@ stub _o__wstrdate_s +@ stub _o__wstrtime +@ stub _o__wstrtime_s +@ stub _o__wsystem +@ stub _o__wtmpnam_s +@ stub _o__wtof +@ stub _o__wtof_l +@ stub _o__wtoi +@ stub _o__wtoi64 +@ stub _o__wtoi64_l +@ stub _o__wtoi_l +@ stub _o__wtol +@ stub _o__wtol_l +@ stub _o__wtoll +@ stub _o__wtoll_l +@ stub _o__wunlink +@ stub _o__wutime32 +@ stub _o__wutime64 +@ stub _o__y0 +@ stub _o__y1 +@ stub _o__yn +@ stub _o_abort +@ stub _o_acos +@ stub _o_acosf +@ stub _o_acosh +@ stub _o_acoshf +@ stub _o_acoshl +@ stub _o_asctime +@ stub _o_asctime_s +@ stub _o_asin +@ stub _o_asinf +@ stub _o_asinh +@ stub _o_asinhf +@ stub _o_asinhl +@ stub _o_atan +@ stub _o_atan2 +@ stub _o_atan2f +@ stub _o_atanf +@ stub _o_atanh +@ stub _o_atanhf +@ stub _o_atanhl +@ stub _o_atof +@ stub _o_atoi +@ stub _o_atol +@ stub _o_atoll +@ stub _o_bsearch +@ stub _o_bsearch_s +@ stub _o_btowc +@ stub _o_calloc +@ stub _o_cbrt +@ stub _o_cbrtf +@ stub _o_ceil +@ stub _o_ceilf +@ stub _o_clearerr +@ stub _o_clearerr_s +@ stub _o_cos +@ stub _o_cosf +@ stub _o_cosh +@ stub _o_coshf +@ stub _o_erf +@ stub _o_erfc +@ stub _o_erfcf +@ stub _o_erfcl +@ stub _o_erff +@ stub _o_erfl +@ stub _o_exp +@ stub _o_exp2 +@ stub _o_exp2f +@ stub _o_exp2l +@ stub _o_expf +@ stub _o_fabs +@ stub _o_fclose +@ stub _o_feof +@ stub _o_ferror +@ stub _o_fflush +@ stub _o_fgetc +@ stub _o_fgetpos +@ stub _o_fgets +@ stub _o_fgetwc +@ stub _o_fgetws +@ stub _o_floor +@ stub _o_floorf +@ stub _o_fma +@ stub _o_fmaf +@ stub _o_fmal +@ stub _o_fmod +@ stub _o_fmodf +@ stub _o_fopen +@ stub _o_fopen_s +@ stub _o_fputc +@ stub _o_fputs +@ stub _o_fputwc +@ stub _o_fputws +@ stub _o_fread +@ stub _o_fread_s +@ stub _o_free +@ stub _o_freopen +@ stub _o_freopen_s +@ stub _o_frexp +@ stub _o_fseek +@ stub _o_fsetpos +@ stub _o_ftell +@ stub _o_fwrite +@ stub _o_getc +@ stub _o_getchar +@ stub _o_getenv +@ stub _o_getenv_s +@ stub _o_gets +@ stub _o_gets_s +@ stub _o_getwc +@ stub _o_getwchar +@ stub _o_hypot +@ stub _o_is_wctype +@ stub _o_isalnum +@ stub _o_isalpha +@ stub _o_isblank +@ stub _o_iscntrl +@ stub _o_isdigit +@ stub _o_isgraph +@ stub _o_isleadbyte +@ stub _o_islower +@ stub _o_isprint +@ stub _o_ispunct +@ stub _o_isspace +@ stub _o_isupper +@ stub _o_iswalnum +@ stub _o_iswalpha +@ stub _o_iswascii +@ stub _o_iswblank +@ stub _o_iswcntrl +@ stub _o_iswctype +@ stub _o_iswdigit +@ stub _o_iswgraph +@ stub _o_iswlower +@ stub _o_iswprint +@ stub _o_iswpunct +@ stub _o_iswspace +@ stub _o_iswupper +@ stub _o_iswxdigit +@ stub _o_isxdigit +@ stub _o_ldexp +@ stub _o_lgamma +@ stub _o_lgammaf +@ stub _o_lgammal +@ stub _o_llrint +@ stub _o_llrintf +@ stub _o_llrintl +@ stub _o_llround +@ stub _o_llroundf +@ stub _o_llroundl +@ stub _o_localeconv +@ stub _o_log +@ stub _o_log10 +@ stub _o_log10f +@ stub _o_log1p +@ stub _o_log1pf +@ stub _o_log1pl +@ stub _o_log2 +@ stub _o_log2f +@ stub _o_log2l +@ stub _o_logb +@ stub _o_logbf +@ stub _o_logbl +@ stub _o_logf +@ stub _o_lrint +@ stub _o_lrintf +@ stub _o_lrintl +@ stub _o_lround +@ stub _o_lroundf +@ stub _o_lroundl +@ stub _o_malloc +@ stub _o_mblen +@ stub _o_mbrlen +@ stub _o_mbrtoc16 +@ stub _o_mbrtoc32 +@ stub _o_mbrtowc +@ stub _o_mbsrtowcs +@ stub _o_mbsrtowcs_s +@ stub _o_mbstowcs +@ stub _o_mbstowcs_s +@ stub _o_mbtowc +@ stub _o_memset +@ stub _o_modf +@ stub _o_modff +@ stub _o_nan +@ stub _o_nanf +@ stub _o_nanl +@ stub _o_nearbyint +@ stub _o_nearbyintf +@ stub _o_nearbyintl +@ stub _o_nextafter +@ stub _o_nextafterf +@ stub _o_nextafterl +@ stub _o_nexttoward +@ stub _o_nexttowardf +@ stub _o_nexttowardl +@ stub _o_pow +@ stub _o_powf +@ stub _o_putc +@ stub _o_putchar +@ stub _o_puts +@ stub _o_putwc +@ stub _o_putwchar +@ stub _o_qsort +@ stub _o_qsort_s +@ stub _o_raise +@ stub _o_rand +@ stub _o_rand_s +@ stub _o_realloc +@ stub _o_remainder +@ stub _o_remainderf +@ stub _o_remainderl +@ stub _o_remove +@ stub _o_remquo +@ stub _o_remquof +@ stub _o_remquol +@ stub _o_rewind +@ stub _o_rint +@ stub _o_rintf +@ stub _o_rintl +@ stub _o_round +@ stub _o_roundf +@ stub _o_roundl +@ stub _o_scalbln +@ stub _o_scalblnf +@ stub _o_scalblnl +@ stub _o_scalbn +@ stub _o_scalbnf +@ stub _o_scalbnl +@ stub _o_set_terminate +@ stub _o_setbuf +@ stub _o_setvbuf +@ stub _o_sin +@ stub _o_sinf +@ stub _o_sinh +@ stub _o_sinhf +@ stub _o_sqrt +@ stub _o_sqrtf +@ stub _o_srand +@ stub _o_strcat_s +@ stub _o_strcoll +@ stub _o_strcpy_s +@ stub _o_strerror +@ stub _o_strerror_s +@ stub _o_strftime +@ stub _o_strncat_s +@ stub _o_strncpy_s +@ stub _o_strtod +@ stub _o_strtof +@ stub _o_strtok +@ stub _o_strtok_s +@ stub _o_strtol +@ stub _o_strtold +@ stub _o_strtoll +@ stub _o_strtoul +@ stub _o_strtoull +@ stub _o_system +@ stub _o_tan +@ stub _o_tanf +@ stub _o_tanh +@ stub _o_tanhf +@ stub _o_terminate +@ stub _o_tgamma +@ stub _o_tgammaf +@ stub _o_tgammal +@ stub _o_tmpfile_s +@ stub _o_tmpnam_s +@ stub _o_tolower +@ stub _o_toupper +@ stub _o_towlower +@ stub _o_towupper +@ stub _o_ungetc +@ stub _o_ungetwc +@ stub _o_wcrtomb +@ stub _o_wcrtomb_s +@ stub _o_wcscat_s +@ stub _o_wcscoll +@ stub _o_wcscpy +@ stub _o_wcscpy_s +@ stub _o_wcsftime +@ stub _o_wcsncat_s +@ stub _o_wcsncpy_s +@ stub _o_wcsrtombs +@ stub _o_wcsrtombs_s +@ stub _o_wcstod +@ stub _o_wcstof +@ stub _o_wcstok +@ stub _o_wcstok_s +@ stub _o_wcstol +@ stub _o_wcstold +@ stub _o_wcstoll +@ stub _o_wcstombs +@ stub _o_wcstombs_s +@ stub _o_wcstoul +@ stub _o_wcstoull +@ stub _o_wctob +@ stub _o_wctomb +@ stub _o_wctomb_s +@ stub _o_wmemcpy_s +@ stub _o_wmemmove_s +@ cdecl _purecall() ucrtbase._purecall +@ stdcall -arch=i386 _seh_longjmp_unwind(ptr) ucrtbase._seh_longjmp_unwind +@ stdcall -arch=i386 _seh_longjmp_unwind4(ptr) ucrtbase._seh_longjmp_unwind4 +@ cdecl _set_purecall_handler(ptr) ucrtbase._set_purecall_handler +@ stub _set_se_translator +@ cdecl -arch=i386 -norelay _setjmp3(ptr long) ucrtbase._setjmp3 +@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) ucrtbase.longjmp +@ cdecl memchr(ptr long long) ucrtbase.memchr +@ cdecl memcmp(ptr ptr long) ucrtbase.memcmp +@ cdecl memcpy(ptr ptr long) ucrtbase.memcpy +@ cdecl memmove(ptr ptr long) ucrtbase.memmove +@ stub set_unexpected +@ cdecl -arch=arm,x86_64 -norelay -private setjmp(ptr) ucrtbase.setjmp +@ cdecl strchr(str long) ucrtbase.strchr +@ cdecl strrchr(str long) ucrtbase.strrchr +@ cdecl strstr(str str) ucrtbase.strstr +@ stub unexpected +@ cdecl wcschr(wstr long) ucrtbase.wcschr +@ cdecl wcsrchr(wstr long) ucrtbase.wcsrchr +@ cdecl wcsstr(wstr wstr) ucrtbase.wcsstr diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-private-l1-1-0/Makefile.in wine1.7-1.7.55/dlls/api-ms-win-crt-private-l1-1-0/Makefile.in --- wine1.7-1.7.50/dlls/api-ms-win-crt-private-l1-1-0/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-private-l1-1-0/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1 @@ +MODULE = api-ms-win-crt-private-l1-1-0.dll diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-process-l1-1-0/api-ms-win-crt-process-l1-1-0.spec wine1.7-1.7.55/dlls/api-ms-win-crt-process-l1-1-0/api-ms-win-crt-process-l1-1-0.spec --- wine1.7-1.7.50/dlls/api-ms-win-crt-process-l1-1-0/api-ms-win-crt-process-l1-1-0.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-process-l1-1-0/api-ms-win-crt-process-l1-1-0.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,36 @@ +@ cdecl _beep(long long) ucrtbase._beep +@ cdecl _cwait(ptr long long) ucrtbase._cwait +@ varargs _execl(str str) ucrtbase._execl +@ varargs _execle(str str) ucrtbase._execle +@ varargs _execlp(str str) ucrtbase._execlp +@ varargs _execlpe(str str) ucrtbase._execlpe +@ cdecl _execv(str ptr) ucrtbase._execv +@ cdecl _execve(str ptr ptr) ucrtbase._execve +@ cdecl _execvp(str ptr) ucrtbase._execvp +@ cdecl _execvpe(str ptr ptr) ucrtbase._execvpe +@ cdecl _loaddll(str) ucrtbase._loaddll +@ varargs _spawnl(long str str) ucrtbase._spawnl +@ varargs _spawnle(long str str) ucrtbase._spawnle +@ varargs _spawnlp(long str str) ucrtbase._spawnlp +@ varargs _spawnlpe(long str str) ucrtbase._spawnlpe +@ cdecl _spawnv(long str ptr) ucrtbase._spawnv +@ cdecl _spawnve(long str ptr ptr) ucrtbase._spawnve +@ cdecl _spawnvp(long str ptr) ucrtbase._spawnvp +@ cdecl _spawnvpe(long str ptr ptr) ucrtbase._spawnvpe +@ cdecl _unloaddll(long) ucrtbase._unloaddll +@ varargs _wexecl(wstr wstr) ucrtbase._wexecl +@ varargs _wexecle(wstr wstr) ucrtbase._wexecle +@ varargs _wexeclp(wstr wstr) ucrtbase._wexeclp +@ varargs _wexeclpe(wstr wstr) ucrtbase._wexeclpe +@ cdecl _wexecv(wstr ptr) ucrtbase._wexecv +@ cdecl _wexecve(wstr ptr ptr) ucrtbase._wexecve +@ cdecl _wexecvp(wstr ptr) ucrtbase._wexecvp +@ cdecl _wexecvpe(wstr ptr ptr) ucrtbase._wexecvpe +@ varargs _wspawnl(long wstr wstr) ucrtbase._wspawnl +@ varargs _wspawnle(long wstr wstr) ucrtbase._wspawnle +@ varargs _wspawnlp(long wstr wstr) ucrtbase._wspawnlp +@ varargs _wspawnlpe(long wstr wstr) ucrtbase._wspawnlpe +@ cdecl _wspawnv(long wstr ptr) ucrtbase._wspawnv +@ cdecl _wspawnve(long wstr ptr ptr) ucrtbase._wspawnve +@ cdecl _wspawnvp(long wstr ptr) ucrtbase._wspawnvp +@ cdecl _wspawnvpe(long wstr ptr ptr) ucrtbase._wspawnvpe diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-process-l1-1-0/Makefile.in wine1.7-1.7.55/dlls/api-ms-win-crt-process-l1-1-0/Makefile.in --- wine1.7-1.7.50/dlls/api-ms-win-crt-process-l1-1-0/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-process-l1-1-0/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1 @@ +MODULE = api-ms-win-crt-process-l1-1-0.dll diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-runtime-l1-1-0/api-ms-win-crt-runtime-l1-1-0.spec wine1.7-1.7.55/dlls/api-ms-win-crt-runtime-l1-1-0/api-ms-win-crt-runtime-l1-1-0.spec --- wine1.7-1.7.50/dlls/api-ms-win-crt-runtime-l1-1-0/api-ms-win-crt-runtime-l1-1-0.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-runtime-l1-1-0/api-ms-win-crt-runtime-l1-1-0.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,107 @@ +@ stub _Exit +@ cdecl -arch=i386 __control87_2(long long ptr ptr) ucrtbase.__control87_2 +@ cdecl __doserrno() ucrtbase.__doserrno +@ stub __fpe_flt_rounds +@ cdecl __fpecode() ucrtbase.__fpecode +@ cdecl __p___argc() ucrtbase.__p___argc +@ cdecl __p___argv() ucrtbase.__p___argv +@ cdecl __p___wargv() ucrtbase.__p___wargv +@ cdecl __p__acmdln() ucrtbase.__p__acmdln +@ cdecl __p__pgmptr() ucrtbase.__p__pgmptr +@ cdecl __p__wcmdln() ucrtbase.__p__wcmdln +@ cdecl __p__wpgmptr() ucrtbase.__p__wpgmptr +@ cdecl __pxcptinfoptrs() ucrtbase.__pxcptinfoptrs +@ cdecl __sys_errlist() ucrtbase.__sys_errlist +@ cdecl __sys_nerr() ucrtbase.__sys_nerr +@ cdecl __threadhandle() ucrtbase.__threadhandle +@ cdecl __threadid() ucrtbase.__threadid +@ cdecl __wcserror(wstr) ucrtbase.__wcserror +@ cdecl __wcserror_s(ptr long wstr) ucrtbase.__wcserror_s +@ cdecl _assert(str str long) ucrtbase._assert +@ cdecl _beginthread(ptr long ptr) ucrtbase._beginthread +@ cdecl _beginthreadex(ptr long ptr ptr long ptr) ucrtbase._beginthreadex +@ cdecl _c_exit() ucrtbase._c_exit +@ cdecl _cexit() ucrtbase._cexit +@ cdecl _clearfp() ucrtbase._clearfp +@ cdecl _configure_narrow_argv(long) ucrtbase._configure_narrow_argv +@ stub _configure_wide_argv +@ cdecl _control87(long long) ucrtbase._control87 +@ cdecl _controlfp(long long) ucrtbase._controlfp +@ cdecl _controlfp_s(ptr long long) ucrtbase._controlfp_s +@ stub _crt_at_quick_exit +@ cdecl _crt_atexit(ptr) ucrtbase._crt_atexit +@ stub _crt_debugger_hook +@ cdecl _endthread() ucrtbase._endthread +@ cdecl _endthreadex(long) ucrtbase._endthreadex +@ cdecl _errno() ucrtbase._errno +@ stub _execute_onexit_table +@ cdecl _exit(long) ucrtbase._exit +@ cdecl _fpieee_flt(long ptr ptr) ucrtbase._fpieee_flt +@ cdecl _fpreset() ucrtbase._fpreset +@ cdecl _get_doserrno(ptr) ucrtbase._get_doserrno +@ cdecl _get_errno(ptr) ucrtbase._get_errno +@ cdecl _get_initial_narrow_environment() ucrtbase._get_initial_narrow_environment +@ stub _get_initial_wide_environment +@ cdecl _get_invalid_parameter_handler() ucrtbase._get_invalid_parameter_handler +@ stub _get_narrow_winmain_command_line +@ cdecl _get_pgmptr(ptr) ucrtbase._get_pgmptr +@ cdecl _get_terminate() ucrtbase._get_terminate +@ stub _get_thread_local_invalid_parameter_handler +@ stub _get_wide_winmain_command_line +@ cdecl _get_wpgmptr(ptr) ucrtbase._get_wpgmptr +@ cdecl _getdllprocaddr(long str long) ucrtbase._getdllprocaddr +@ cdecl _getpid() ucrtbase._getpid +@ cdecl _initialize_narrow_environment() ucrtbase._initialize_narrow_environment +@ stub _initialize_onexit_table +@ stub _initialize_wide_environment +@ cdecl _initterm(ptr ptr) ucrtbase._initterm +@ cdecl _initterm_e(ptr ptr) ucrtbase._initterm_e +@ cdecl _invalid_parameter_noinfo() ucrtbase._invalid_parameter_noinfo +@ stub _invalid_parameter_noinfo_noreturn +@ stub _invoke_watson +@ stub _query_app_type +@ stub _register_onexit_function +@ stub _register_thread_local_exe_atexit_callback +@ cdecl _resetstkoflw() ucrtbase._resetstkoflw +@ cdecl -arch=i386,x86_64,arm _seh_filter_dll(long ptr) ucrtbase._seh_filter_dll +@ cdecl _seh_filter_exe(long ptr) ucrtbase._seh_filter_exe +@ cdecl _set_abort_behavior(long long) ucrtbase._set_abort_behavior +@ cdecl _set_app_type(long) ucrtbase._set_app_type +@ cdecl _set_controlfp(long long) ucrtbase._set_controlfp +@ cdecl _set_doserrno(long) ucrtbase._set_doserrno +@ cdecl _set_errno(long) ucrtbase._set_errno +@ cdecl _set_error_mode(long) ucrtbase._set_error_mode +@ cdecl _set_invalid_parameter_handler(ptr) ucrtbase._set_invalid_parameter_handler +@ cdecl _set_new_handler(ptr) ucrtbase._set_new_handler +@ stub _set_thread_local_invalid_parameter_handler +@ cdecl _seterrormode(long) ucrtbase._seterrormode +@ cdecl _sleep(long) ucrtbase._sleep +@ cdecl _statusfp() ucrtbase._statusfp +@ cdecl -arch=i386 _statusfp2(ptr ptr) ucrtbase._statusfp2 +@ cdecl _strerror(long) ucrtbase._strerror +@ stub _strerror_s +@ cdecl _wassert(wstr wstr long) ucrtbase._wassert +@ cdecl _wcserror(long) ucrtbase._wcserror +@ cdecl _wcserror_s(ptr long long) ucrtbase._wcserror_s +@ cdecl _wperror(wstr) ucrtbase._wperror +@ cdecl _wsystem(wstr) ucrtbase._wsystem +@ cdecl abort() ucrtbase.abort +@ cdecl exit(long) ucrtbase.exit +@ stub feclearexcept +@ stub fegetenv +@ stub fegetexceptflag +@ stub fegetround +@ stub feholdexcept +@ stub fesetenv +@ stub fesetexceptflag +@ stub fesetround +@ stub fetestexcept +@ cdecl perror(str) ucrtbase.perror +@ stub quick_exit +@ cdecl raise(long) ucrtbase.raise +@ stub set_terminate +@ cdecl signal(long long) ucrtbase.signal +@ cdecl strerror(long) ucrtbase.strerror +@ cdecl strerror_s(ptr long long) ucrtbase.strerror_s +@ cdecl system(str) ucrtbase.system +@ cdecl terminate() ucrtbase.terminate diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-runtime-l1-1-0/Makefile.in wine1.7-1.7.55/dlls/api-ms-win-crt-runtime-l1-1-0/Makefile.in --- wine1.7-1.7.50/dlls/api-ms-win-crt-runtime-l1-1-0/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-runtime-l1-1-0/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1 @@ +MODULE = api-ms-win-crt-runtime-l1-1-0.dll diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-stdio-l1-1-0/api-ms-win-crt-stdio-l1-1-0.spec wine1.7-1.7.55/dlls/api-ms-win-crt-stdio-l1-1-0/api-ms-win-crt-stdio-l1-1-0.spec --- wine1.7-1.7.50/dlls/api-ms-win-crt-stdio-l1-1-0/api-ms-win-crt-stdio-l1-1-0.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-stdio-l1-1-0/api-ms-win-crt-stdio-l1-1-0.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,159 @@ +@ cdecl __acrt_iob_func(long) ucrtbase.__acrt_iob_func +@ cdecl __p__commode() ucrtbase.__p__commode +@ cdecl __p__fmode() ucrtbase.__p__fmode +@ cdecl __stdio_common_vfprintf(int64 ptr ptr ptr ptr) ucrtbase.__stdio_common_vfprintf +@ stub __stdio_common_vfprintf_p +@ stub __stdio_common_vfprintf_s +@ stub __stdio_common_vfscanf +@ stub __stdio_common_vfwprintf +@ stub __stdio_common_vfwprintf_p +@ stub __stdio_common_vfwprintf_s +@ stub __stdio_common_vfwscanf +@ cdecl __stdio_common_vsnprintf_s(int64 ptr long long ptr ptr ptr) ucrtbase.__stdio_common_vsnprintf_s +@ stub __stdio_common_vsnwprintf_s +@ cdecl __stdio_common_vsprintf(int64 ptr long ptr ptr ptr) ucrtbase.__stdio_common_vsprintf +@ stub __stdio_common_vsprintf_p +@ cdecl __stdio_common_vsprintf_s(int64 ptr long ptr ptr ptr) ucrtbase.__stdio_common_vsprintf_s +@ cdecl __stdio_common_vsscanf(int64 ptr long ptr ptr ptr) ucrtbase.__stdio_common_vsscanf +@ cdecl __stdio_common_vswprintf(int64 ptr long ptr ptr ptr) ucrtbase.__stdio_common_vswprintf +@ stub __stdio_common_vswprintf_p +@ stub __stdio_common_vswprintf_s +@ stub __stdio_common_vswscanf +@ cdecl _chsize(long long) ucrtbase._chsize +@ cdecl _chsize_s(long int64) ucrtbase._chsize_s +@ cdecl _close(long) ucrtbase._close +@ cdecl _commit(long) ucrtbase._commit +@ cdecl _creat(str long) ucrtbase._creat +@ cdecl _dup(long) ucrtbase._dup +@ cdecl _dup2(long long) ucrtbase._dup2 +@ cdecl _eof(long) ucrtbase._eof +@ cdecl _fclose_nolock(ptr) ucrtbase._fclose_nolock +@ cdecl _fcloseall() ucrtbase._fcloseall +@ cdecl _fflush_nolock(ptr) ucrtbase._fflush_nolock +@ cdecl _fgetc_nolock(ptr) ucrtbase._fgetc_nolock +@ cdecl _fgetchar() ucrtbase._fgetchar +@ cdecl _fgetwc_nolock(ptr) ucrtbase._fgetwc_nolock +@ cdecl _fgetwchar() ucrtbase._fgetwchar +@ cdecl _filelength(long) ucrtbase._filelength +@ cdecl -ret64 _filelengthi64(long) ucrtbase._filelengthi64 +@ cdecl _fileno(ptr) ucrtbase._fileno +@ cdecl _flushall() ucrtbase._flushall +@ cdecl _fputc_nolock(long ptr) ucrtbase._fputc_nolock +@ cdecl _fputchar(long) ucrtbase._fputchar +@ cdecl _fputwc_nolock(long ptr) ucrtbase._fputwc_nolock +@ cdecl _fputwchar(long) ucrtbase._fputwchar +@ cdecl _fread_nolock(ptr long long ptr) ucrtbase._fread_nolock +@ cdecl _fread_nolock_s(ptr long long long ptr) ucrtbase._fread_nolock_s +@ cdecl _fseek_nolock(ptr long long) ucrtbase._fseek_nolock +@ cdecl _fseeki64(ptr int64 long) ucrtbase._fseeki64 +@ cdecl _fseeki64_nolock(ptr int64 long) ucrtbase._fseeki64_nolock +@ cdecl _fsopen(str str long) ucrtbase._fsopen +@ cdecl _ftell_nolock(ptr) ucrtbase._ftell_nolock +@ cdecl -ret64 _ftelli64(ptr) ucrtbase._ftelli64 +@ cdecl -ret64 _ftelli64_nolock(ptr) ucrtbase._ftelli64_nolock +@ cdecl _fwrite_nolock(ptr long long ptr) ucrtbase._fwrite_nolock +@ cdecl _get_fmode(ptr) ucrtbase._get_fmode +@ cdecl _get_osfhandle(long) ucrtbase._get_osfhandle +@ cdecl _get_printf_count_output() ucrtbase._get_printf_count_output +@ cdecl _get_stream_buffer_pointers(ptr ptr ptr ptr) ucrtbase._get_stream_buffer_pointers +@ cdecl _getc_nolock(ptr) ucrtbase._getc_nolock +@ cdecl _getcwd(str long) ucrtbase._getcwd +@ cdecl _getdcwd(long str long) ucrtbase._getdcwd +@ cdecl _getmaxstdio() ucrtbase._getmaxstdio +@ cdecl _getw(ptr) ucrtbase._getw +@ cdecl _getwc_nolock(ptr) ucrtbase._getwc_nolock +@ cdecl _getws(ptr) ucrtbase._getws +@ stub _getws_s +@ cdecl _isatty(long) ucrtbase._isatty +@ cdecl _kbhit() ucrtbase._kbhit +@ cdecl _locking(long long long) ucrtbase._locking +@ cdecl _lseek(long long long) ucrtbase._lseek +@ cdecl -ret64 _lseeki64(long int64 long) ucrtbase._lseeki64 +@ cdecl _mktemp(str) ucrtbase._mktemp +@ cdecl _mktemp_s(str long) ucrtbase._mktemp_s +@ varargs _open(str long) ucrtbase._open +@ cdecl _open_osfhandle(long long) ucrtbase._open_osfhandle +@ cdecl _pclose(ptr) ucrtbase._pclose +@ cdecl _pipe(ptr long long) ucrtbase._pipe +@ cdecl _popen(str str) ucrtbase._popen +@ cdecl _putc_nolock(long ptr) ucrtbase._putc_nolock +@ cdecl _putw(long ptr) ucrtbase._putw +@ cdecl _putwc_nolock(long ptr) ucrtbase._putwc_nolock +@ cdecl _putws(wstr) ucrtbase._putws +@ cdecl _read(long ptr long) ucrtbase._read +@ cdecl _rmtmp() ucrtbase._rmtmp +@ cdecl _set_fmode(long) ucrtbase._set_fmode +@ cdecl _set_printf_count_output(long) ucrtbase._set_printf_count_output +@ cdecl _setmaxstdio(long) ucrtbase._setmaxstdio +@ cdecl _setmode(long long) ucrtbase._setmode +@ varargs _sopen(str long long) ucrtbase._sopen +@ stub _sopen_dispatch +@ cdecl _sopen_s(ptr str long long long) ucrtbase._sopen_s +@ cdecl _tell(long) ucrtbase._tell +@ cdecl -ret64 _telli64(long) ucrtbase._telli64 +@ cdecl _tempnam(str str) ucrtbase._tempnam +@ cdecl _ungetc_nolock(long ptr) ucrtbase._ungetc_nolock +@ cdecl _ungetwc_nolock(long ptr) ucrtbase._ungetwc_nolock +@ cdecl _wcreat(wstr long) ucrtbase._wcreat +@ cdecl _wfdopen(long wstr) ucrtbase._wfdopen +@ cdecl _wfopen(wstr wstr) ucrtbase._wfopen +@ cdecl _wfopen_s(ptr wstr wstr) ucrtbase._wfopen_s +@ cdecl _wfreopen(wstr wstr ptr) ucrtbase._wfreopen +@ cdecl _wfreopen_s(ptr wstr wstr ptr) ucrtbase._wfreopen_s +@ cdecl _wfsopen(wstr wstr long) ucrtbase._wfsopen +@ cdecl _wmktemp(wstr) ucrtbase._wmktemp +@ cdecl _wmktemp_s(wstr long) ucrtbase._wmktemp_s +@ varargs _wopen(wstr long) ucrtbase._wopen +@ cdecl _wpopen(wstr wstr) ucrtbase._wpopen +@ cdecl _write(long ptr long) ucrtbase._write +@ varargs _wsopen(wstr long long) ucrtbase._wsopen +@ stub _wsopen_dispatch +@ cdecl _wsopen_s(ptr wstr long long long) ucrtbase._wsopen_s +@ cdecl _wtempnam(wstr wstr) ucrtbase._wtempnam +@ cdecl _wtmpnam(ptr) ucrtbase._wtmpnam +@ stub _wtmpnam_s +@ cdecl clearerr(ptr) ucrtbase.clearerr +@ stub clearerr_s +@ cdecl fclose(ptr) ucrtbase.fclose +@ cdecl feof(ptr) ucrtbase.feof +@ cdecl ferror(ptr) ucrtbase.ferror +@ cdecl fflush(ptr) ucrtbase.fflush +@ cdecl fgetc(ptr) ucrtbase.fgetc +@ cdecl fgetpos(ptr ptr) ucrtbase.fgetpos +@ cdecl fgets(ptr long ptr) ucrtbase.fgets +@ cdecl fgetwc(ptr) ucrtbase.fgetwc +@ cdecl fgetws(ptr long ptr) ucrtbase.fgetws +@ cdecl fopen(str str) ucrtbase.fopen +@ cdecl fopen_s(ptr str str) ucrtbase.fopen_s +@ cdecl fputc(long ptr) ucrtbase.fputc +@ cdecl fputs(str ptr) ucrtbase.fputs +@ cdecl fputwc(long ptr) ucrtbase.fputwc +@ cdecl fputws(wstr ptr) ucrtbase.fputws +@ cdecl fread(ptr long long ptr) ucrtbase.fread +@ cdecl fread_s(ptr long long long ptr) ucrtbase.fread_s +@ cdecl freopen(str str ptr) ucrtbase.freopen +@ cdecl freopen_s(ptr str str ptr) ucrtbase.freopen_s +@ cdecl fseek(ptr long long) ucrtbase.fseek +@ cdecl fsetpos(ptr ptr) ucrtbase.fsetpos +@ cdecl ftell(ptr) ucrtbase.ftell +@ cdecl fwrite(ptr long long ptr) ucrtbase.fwrite +@ cdecl getc(ptr) ucrtbase.getc +@ cdecl getchar() ucrtbase.getchar +@ cdecl gets(str) ucrtbase.gets +@ stub gets_s +@ cdecl getwc(ptr) ucrtbase.getwc +@ cdecl getwchar() ucrtbase.getwchar +@ cdecl putc(long ptr) ucrtbase.putc +@ cdecl putchar(long) ucrtbase.putchar +@ cdecl puts(str) ucrtbase.puts +@ cdecl putwc(long ptr) ucrtbase.putwc +@ cdecl putwchar(long) ucrtbase.putwchar +@ cdecl rewind(ptr) ucrtbase.rewind +@ cdecl setbuf(ptr ptr) ucrtbase.setbuf +@ cdecl setvbuf(ptr str long long) ucrtbase.setvbuf +@ cdecl tmpfile() ucrtbase.tmpfile +@ cdecl tmpfile_s(ptr) ucrtbase.tmpfile_s +@ cdecl tmpnam(ptr) ucrtbase.tmpnam +@ stub tmpnam_s +@ cdecl ungetc(long ptr) ucrtbase.ungetc +@ cdecl ungetwc(long ptr) ucrtbase.ungetwc diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-stdio-l1-1-0/Makefile.in wine1.7-1.7.55/dlls/api-ms-win-crt-stdio-l1-1-0/Makefile.in --- wine1.7-1.7.50/dlls/api-ms-win-crt-stdio-l1-1-0/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-stdio-l1-1-0/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1 @@ +MODULE = api-ms-win-crt-stdio-l1-1-0.dll diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-string-l1-1-0/api-ms-win-crt-string-l1-1-0.spec wine1.7-1.7.55/dlls/api-ms-win-crt-string-l1-1-0/api-ms-win-crt-string-l1-1-0.spec --- wine1.7-1.7.50/dlls/api-ms-win-crt-string-l1-1-0/api-ms-win-crt-string-l1-1-0.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-string-l1-1-0/api-ms-win-crt-string-l1-1-0.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,178 @@ +@ cdecl __isascii(long) ucrtbase.__isascii +@ cdecl __iscsym(long) ucrtbase.__iscsym +@ cdecl __iscsymf(long) ucrtbase.__iscsymf +@ stub __iswcsym +@ stub __iswcsymf +@ stub __strncnt +@ stub __wcsncnt +@ cdecl _isalnum_l(long ptr) ucrtbase._isalnum_l +@ cdecl _isalpha_l(long ptr) ucrtbase._isalpha_l +@ stub _isblank_l +@ cdecl _iscntrl_l(long ptr) ucrtbase._iscntrl_l +@ cdecl _isctype(long long) ucrtbase._isctype +@ cdecl _isctype_l(long long ptr) ucrtbase._isctype_l +@ cdecl _isdigit_l(long ptr) ucrtbase._isdigit_l +@ cdecl _isgraph_l(long ptr) ucrtbase._isgraph_l +@ cdecl _isleadbyte_l(long ptr) ucrtbase._isleadbyte_l +@ cdecl _islower_l(long ptr) ucrtbase._islower_l +@ cdecl _isprint_l(long ptr) ucrtbase._isprint_l +@ stub _ispunct_l +@ cdecl _isspace_l(long ptr) ucrtbase._isspace_l +@ cdecl _isupper_l(long ptr) ucrtbase._isupper_l +@ stub _iswalnum_l +@ cdecl _iswalpha_l(long ptr) ucrtbase._iswalpha_l +@ stub _iswblank_l +@ stub _iswcntrl_l +@ stub _iswcsym_l +@ stub _iswcsymf_l +@ stub _iswctype_l +@ cdecl _iswdigit_l(long ptr) ucrtbase._iswdigit_l +@ stub _iswgraph_l +@ stub _iswlower_l +@ stub _iswprint_l +@ cdecl _iswpunct_l(long ptr) ucrtbase._iswpunct_l +@ cdecl _iswspace_l(long ptr) ucrtbase._iswspace_l +@ stub _iswupper_l +@ stub _iswxdigit_l +@ cdecl _isxdigit_l(long ptr) ucrtbase._isxdigit_l +@ cdecl _memccpy(ptr ptr long long) ucrtbase._memccpy +@ cdecl _memicmp(str str long) ucrtbase._memicmp +@ stub _memicmp_l +@ cdecl _strcoll_l(str str ptr) ucrtbase._strcoll_l +@ cdecl _strdup(str) ucrtbase._strdup +@ cdecl _stricmp(str str) ucrtbase._stricmp +@ cdecl _stricmp_l(str str ptr) ucrtbase._stricmp_l +@ cdecl _stricoll(str str) ucrtbase._stricoll +@ cdecl _stricoll_l(str str ptr) ucrtbase._stricoll_l +@ cdecl _strlwr(str) ucrtbase._strlwr +@ cdecl _strlwr_l(str ptr) ucrtbase._strlwr_l +@ cdecl _strlwr_s(ptr long) ucrtbase._strlwr_s +@ cdecl _strlwr_s_l(ptr long ptr) ucrtbase._strlwr_s_l +@ cdecl _strncoll(str str long) ucrtbase._strncoll +@ cdecl _strncoll_l(str str long ptr) ucrtbase._strncoll_l +@ cdecl _strnicmp(str str long) ucrtbase._strnicmp +@ cdecl _strnicmp_l(str str long ptr) ucrtbase._strnicmp_l +@ cdecl _strnicoll(str str long) ucrtbase._strnicoll +@ cdecl _strnicoll_l(str str long ptr) ucrtbase._strnicoll_l +@ cdecl _strnset(str long long) ucrtbase._strnset +@ cdecl _strnset_s(str long long long) ucrtbase._strnset_s +@ cdecl _strrev(str) ucrtbase._strrev +@ cdecl _strset(str long) ucrtbase._strset +@ stub _strset_s +@ cdecl _strupr(str) ucrtbase._strupr +@ cdecl _strupr_l(str ptr) ucrtbase._strupr_l +@ cdecl _strupr_s(str long) ucrtbase._strupr_s +@ cdecl _strupr_s_l(str long ptr) ucrtbase._strupr_s_l +@ cdecl _strxfrm_l(ptr str long ptr) ucrtbase._strxfrm_l +@ cdecl _tolower(long) ucrtbase._tolower +@ cdecl _tolower_l(long ptr) ucrtbase._tolower_l +@ cdecl _toupper(long) ucrtbase._toupper +@ cdecl _toupper_l(long ptr) ucrtbase._toupper_l +@ cdecl _towlower_l(long ptr) ucrtbase._towlower_l +@ cdecl _towupper_l(long ptr) ucrtbase._towupper_l +@ cdecl _wcscoll_l(wstr wstr ptr) ucrtbase._wcscoll_l +@ cdecl _wcsdup(wstr) ucrtbase._wcsdup +@ cdecl _wcsicmp(wstr wstr) ucrtbase._wcsicmp +@ cdecl _wcsicmp_l(wstr wstr ptr) ucrtbase._wcsicmp_l +@ cdecl _wcsicoll(wstr wstr) ucrtbase._wcsicoll +@ cdecl _wcsicoll_l(wstr wstr ptr) ucrtbase._wcsicoll_l +@ cdecl _wcslwr(wstr) ucrtbase._wcslwr +@ cdecl _wcslwr_l(wstr ptr) ucrtbase._wcslwr_l +@ cdecl _wcslwr_s(wstr long) ucrtbase._wcslwr_s +@ cdecl _wcslwr_s_l(wstr long ptr) ucrtbase._wcslwr_s_l +@ cdecl _wcsncoll(wstr wstr long) ucrtbase._wcsncoll +@ cdecl _wcsncoll_l(wstr wstr long ptr) ucrtbase._wcsncoll_l +@ cdecl _wcsnicmp(wstr wstr long) ucrtbase._wcsnicmp +@ cdecl _wcsnicmp_l(wstr wstr long ptr) ucrtbase._wcsnicmp_l +@ cdecl _wcsnicoll(wstr wstr long) ucrtbase._wcsnicoll +@ cdecl _wcsnicoll_l(wstr wstr long ptr) ucrtbase._wcsnicoll_l +@ cdecl _wcsnset(wstr long long) ucrtbase._wcsnset +@ stub _wcsnset_s +@ cdecl _wcsrev(wstr) ucrtbase._wcsrev +@ cdecl _wcsset(wstr long) ucrtbase._wcsset +@ cdecl _wcsset_s(wstr long long) ucrtbase._wcsset_s +@ cdecl _wcsupr(wstr) ucrtbase._wcsupr +@ cdecl _wcsupr_l(wstr ptr) ucrtbase._wcsupr_l +@ cdecl _wcsupr_s(wstr long) ucrtbase._wcsupr_s +@ cdecl _wcsupr_s_l(wstr long ptr) ucrtbase._wcsupr_s_l +@ cdecl _wcsxfrm_l(ptr wstr long ptr) ucrtbase._wcsxfrm_l +@ stub _wctype +@ cdecl is_wctype(long long) ucrtbase.is_wctype +@ cdecl isalnum(long) ucrtbase.isalnum +@ cdecl isalpha(long) ucrtbase.isalpha +@ stub isblank +@ cdecl iscntrl(long) ucrtbase.iscntrl +@ cdecl isdigit(long) ucrtbase.isdigit +@ cdecl isgraph(long) ucrtbase.isgraph +@ cdecl isleadbyte(long) ucrtbase.isleadbyte +@ cdecl islower(long) ucrtbase.islower +@ cdecl isprint(long) ucrtbase.isprint +@ cdecl ispunct(long) ucrtbase.ispunct +@ cdecl isspace(long) ucrtbase.isspace +@ cdecl isupper(long) ucrtbase.isupper +@ cdecl iswalnum(long) ucrtbase.iswalnum +@ cdecl iswalpha(long) ucrtbase.iswalpha +@ cdecl iswascii(long) ucrtbase.iswascii +@ stub iswblank +@ cdecl iswcntrl(long) ucrtbase.iswcntrl +@ cdecl iswctype(long long) ucrtbase.iswctype +@ cdecl iswdigit(long) ucrtbase.iswdigit +@ cdecl iswgraph(long) ucrtbase.iswgraph +@ cdecl iswlower(long) ucrtbase.iswlower +@ cdecl iswprint(long) ucrtbase.iswprint +@ cdecl iswpunct(long) ucrtbase.iswpunct +@ cdecl iswspace(long) ucrtbase.iswspace +@ cdecl iswupper(long) ucrtbase.iswupper +@ cdecl iswxdigit(long) ucrtbase.iswxdigit +@ cdecl isxdigit(long) ucrtbase.isxdigit +@ cdecl mblen(ptr long) ucrtbase.mblen +@ cdecl mbrlen(ptr long ptr) ucrtbase.mbrlen +@ cdecl memcpy_s(ptr long ptr long) ucrtbase.memcpy_s +@ cdecl memmove_s(ptr long ptr long) ucrtbase.memmove_s +@ cdecl memset(ptr long long) ucrtbase.memset +@ cdecl strcat(str str) ucrtbase.strcat +@ cdecl strcat_s(str long str) ucrtbase.strcat_s +@ cdecl strcmp(str str) ucrtbase.strcmp +@ cdecl strcoll(str str) ucrtbase.strcoll +@ cdecl strcpy(ptr str) ucrtbase.strcpy +@ cdecl strcpy_s(ptr long str) ucrtbase.strcpy_s +@ cdecl strcspn(str str) ucrtbase.strcspn +@ cdecl strlen(str) ucrtbase.strlen +@ cdecl strncat(str str long) ucrtbase.strncat +@ cdecl strncat_s(str long str long) ucrtbase.strncat_s +@ cdecl strncmp(str str long) ucrtbase.strncmp +@ cdecl strncpy(ptr str long) ucrtbase.strncpy +@ cdecl strncpy_s(ptr long str long) ucrtbase.strncpy_s +@ cdecl strnlen(str long) ucrtbase.strnlen +@ cdecl strpbrk(str str) ucrtbase.strpbrk +@ cdecl strspn(str str) ucrtbase.strspn +@ cdecl strtok(str str) ucrtbase.strtok +@ cdecl strtok_s(ptr str ptr) ucrtbase.strtok_s +@ cdecl strxfrm(ptr str long) ucrtbase.strxfrm +@ cdecl tolower(long) ucrtbase.tolower +@ cdecl toupper(long) ucrtbase.toupper +@ stub towctrans +@ cdecl towlower(long) ucrtbase.towlower +@ cdecl towupper(long) ucrtbase.towupper +@ cdecl wcscat(wstr wstr) ucrtbase.wcscat +@ cdecl wcscat_s(wstr long wstr) ucrtbase.wcscat_s +@ cdecl wcscmp(wstr wstr) ucrtbase.wcscmp +@ cdecl wcscoll(wstr wstr) ucrtbase.wcscoll +@ cdecl wcscpy(ptr wstr) ucrtbase.wcscpy +@ cdecl wcscpy_s(ptr long wstr) ucrtbase.wcscpy_s +@ cdecl wcscspn(wstr wstr) ucrtbase.wcscspn +@ cdecl wcslen(wstr) ucrtbase.wcslen +@ cdecl wcsncat(wstr wstr long) ucrtbase.wcsncat +@ cdecl wcsncat_s(wstr long wstr long) ucrtbase.wcsncat_s +@ cdecl wcsncmp(wstr wstr long) ucrtbase.wcsncmp +@ cdecl wcsncpy(ptr wstr long) ucrtbase.wcsncpy +@ cdecl wcsncpy_s(ptr long wstr long) ucrtbase.wcsncpy_s +@ cdecl wcsnlen(wstr long) ucrtbase.wcsnlen +@ cdecl wcspbrk(wstr wstr) ucrtbase.wcspbrk +@ cdecl wcsspn(wstr wstr) ucrtbase.wcsspn +@ cdecl wcstok(wstr wstr) ucrtbase.wcstok +@ cdecl wcstok_s(ptr wstr ptr) ucrtbase.wcstok_s +@ cdecl wcsxfrm(ptr wstr long) ucrtbase.wcsxfrm +@ stub wctype +@ cdecl wmemcpy_s(ptr long ptr long) ucrtbase.wmemcpy_s +@ cdecl wmemmove_s(ptr long ptr long) ucrtbase.wmemmove_s diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-string-l1-1-0/Makefile.in wine1.7-1.7.55/dlls/api-ms-win-crt-string-l1-1-0/Makefile.in --- wine1.7-1.7.50/dlls/api-ms-win-crt-string-l1-1-0/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-string-l1-1-0/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1 @@ +MODULE = api-ms-win-crt-string-l1-1-0.dll diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-time-l1-1-0/api-ms-win-crt-time-l1-1-0.spec wine1.7-1.7.55/dlls/api-ms-win-crt-time-l1-1-0/api-ms-win-crt-time-l1-1-0.spec --- wine1.7-1.7.50/dlls/api-ms-win-crt-time-l1-1-0/api-ms-win-crt-time-l1-1-0.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-time-l1-1-0/api-ms-win-crt-time-l1-1-0.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,72 @@ +@ cdecl _Getdays() ucrtbase._Getdays +@ cdecl _Getmonths() ucrtbase._Getmonths +@ cdecl _Gettnames() ucrtbase._Gettnames +@ cdecl _Strftime(str long str ptr ptr) ucrtbase._Strftime +@ cdecl _W_Getdays() ucrtbase._W_Getdays +@ cdecl _W_Getmonths() ucrtbase._W_Getmonths +@ stub _W_Gettnames +@ stub _Wcsftime +@ cdecl __daylight() ucrtbase.__daylight +@ cdecl __dstbias() ucrtbase.__dstbias +@ cdecl __timezone() ucrtbase.__timezone +@ cdecl __tzname() ucrtbase.__tzname +@ cdecl _ctime32(ptr) ucrtbase._ctime32 +@ cdecl _ctime32_s(str long ptr) ucrtbase._ctime32_s +@ cdecl _ctime64(ptr) ucrtbase._ctime64 +@ cdecl _ctime64_s(str long ptr) ucrtbase._ctime64_s +@ cdecl _difftime32(long long) ucrtbase._difftime32 +@ cdecl _difftime64(long long) ucrtbase._difftime64 +@ cdecl _ftime32(ptr) ucrtbase._ftime32 +@ cdecl _ftime32_s(ptr) ucrtbase._ftime32_s +@ cdecl _ftime64(ptr) ucrtbase._ftime64 +@ cdecl _ftime64_s(ptr) ucrtbase._ftime64_s +@ cdecl _futime32(long ptr) ucrtbase._futime32 +@ cdecl _futime64(long ptr) ucrtbase._futime64 +@ cdecl _get_daylight(ptr) ucrtbase._get_daylight +@ stub _get_dstbias +@ cdecl _get_timezone(ptr) ucrtbase._get_timezone +@ cdecl _get_tzname(ptr str long long) ucrtbase._get_tzname +@ cdecl _getsystime(ptr) ucrtbase._getsystime +@ cdecl _gmtime32(ptr) ucrtbase._gmtime32 +@ cdecl _gmtime32_s(ptr ptr) ucrtbase._gmtime32_s +@ cdecl _gmtime64(ptr) ucrtbase._gmtime64 +@ cdecl _gmtime64_s(ptr ptr) ucrtbase._gmtime64_s +@ cdecl _localtime32(ptr) ucrtbase._localtime32 +@ cdecl _localtime32_s(ptr ptr) ucrtbase._localtime32_s +@ cdecl _localtime64(ptr) ucrtbase._localtime64 +@ cdecl _localtime64_s(ptr ptr) ucrtbase._localtime64_s +@ cdecl _mkgmtime32(ptr) ucrtbase._mkgmtime32 +@ cdecl _mkgmtime64(ptr) ucrtbase._mkgmtime64 +@ cdecl _mktime32(ptr) ucrtbase._mktime32 +@ cdecl _mktime64(ptr) ucrtbase._mktime64 +@ cdecl _setsystime(ptr long) ucrtbase._setsystime +@ cdecl _strdate(ptr) ucrtbase._strdate +@ cdecl _strdate_s(ptr long) ucrtbase._strdate_s +@ stub _strftime_l +@ cdecl _strtime(ptr) ucrtbase._strtime +@ cdecl _strtime_s(ptr long) ucrtbase._strtime_s +@ cdecl _time32(ptr) ucrtbase._time32 +@ cdecl _time64(ptr) ucrtbase._time64 +@ stub _timespec32_get +@ stub _timespec64_get +@ cdecl _tzset() ucrtbase._tzset +@ cdecl _utime32(str ptr) ucrtbase._utime32 +@ cdecl _utime64(str ptr) ucrtbase._utime64 +@ cdecl _wasctime(ptr) ucrtbase._wasctime +@ cdecl _wasctime_s(ptr long ptr) ucrtbase._wasctime_s +@ stub _wcsftime_l +@ cdecl _wctime32(ptr) ucrtbase._wctime32 +@ stub _wctime32_s +@ cdecl _wctime64(ptr) ucrtbase._wctime64 +@ stub _wctime64_s +@ cdecl _wstrdate(ptr) ucrtbase._wstrdate +@ cdecl _wstrdate_s(ptr long) ucrtbase._wstrdate_s +@ cdecl _wstrtime(ptr) ucrtbase._wstrtime +@ cdecl _wstrtime_s(ptr long) ucrtbase._wstrtime_s +@ cdecl _wutime32(wstr ptr) ucrtbase._wutime32 +@ cdecl _wutime64(wstr ptr) ucrtbase._wutime64 +@ cdecl asctime(ptr) ucrtbase.asctime +@ cdecl asctime_s(ptr long ptr) ucrtbase.asctime_s +@ cdecl clock() ucrtbase.clock +@ cdecl strftime(str long str ptr) ucrtbase.strftime +@ cdecl wcsftime(ptr long wstr ptr) ucrtbase.wcsftime diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-time-l1-1-0/Makefile.in wine1.7-1.7.55/dlls/api-ms-win-crt-time-l1-1-0/Makefile.in --- wine1.7-1.7.50/dlls/api-ms-win-crt-time-l1-1-0/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-time-l1-1-0/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1 @@ +MODULE = api-ms-win-crt-time-l1-1-0.dll diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-utility-l1-1-0/api-ms-win-crt-utility-l1-1-0.spec wine1.7-1.7.55/dlls/api-ms-win-crt-utility-l1-1-0/api-ms-win-crt-utility-l1-1-0.spec --- wine1.7-1.7.50/dlls/api-ms-win-crt-utility-l1-1-0/api-ms-win-crt-utility-l1-1-0.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-utility-l1-1-0/api-ms-win-crt-utility-l1-1-0.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,30 @@ +@ cdecl -ret64 _abs64(int64) ucrtbase._abs64 +@ cdecl _byteswap_uint64(int64) ucrtbase._byteswap_uint64 +@ cdecl _byteswap_ulong(long) ucrtbase._byteswap_ulong +@ cdecl _byteswap_ushort(long) ucrtbase._byteswap_ushort +@ cdecl _lfind(ptr ptr ptr long ptr) ucrtbase._lfind +@ stub _lfind_s +@ cdecl _lrotl(long long) ucrtbase._lrotl +@ cdecl _lrotr(long long) ucrtbase._lrotr +@ cdecl _lsearch(ptr ptr ptr long ptr) ucrtbase._lsearch +@ stub _lsearch_s +@ cdecl _rotl(long long) ucrtbase._rotl +@ cdecl -ret64 _rotl64(int64 long) ucrtbase._rotl64 +@ cdecl _rotr(long long) ucrtbase._rotr +@ cdecl -ret64 _rotr64(int64 long) ucrtbase._rotr64 +@ cdecl _swab(str str long) ucrtbase._swab +@ cdecl abs(long) ucrtbase.abs +@ cdecl bsearch(ptr ptr long long ptr) ucrtbase.bsearch +@ cdecl bsearch_s(ptr ptr long long ptr ptr) ucrtbase.bsearch_s +@ cdecl -ret64 div(long long) ucrtbase.div +@ stub imaxabs +@ stub imaxdiv +@ cdecl labs(long) ucrtbase.labs +@ cdecl ldiv(long long) ucrtbase.ldiv +@ cdecl -ret64 llabs(int64) ucrtbase.llabs +@ stub lldiv +@ cdecl qsort(ptr long long ptr) ucrtbase.qsort +@ cdecl qsort_s(ptr long long ptr ptr) ucrtbase.qsort_s +@ cdecl rand() ucrtbase.rand +@ cdecl rand_s(ptr) ucrtbase.rand_s +@ cdecl srand(long) ucrtbase.srand diff -Nru wine1.7-1.7.50/dlls/api-ms-win-crt-utility-l1-1-0/Makefile.in wine1.7-1.7.55/dlls/api-ms-win-crt-utility-l1-1-0/Makefile.in --- wine1.7-1.7.50/dlls/api-ms-win-crt-utility-l1-1-0/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-crt-utility-l1-1-0/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1 @@ +MODULE = api-ms-win-crt-utility-l1-1-0.dll diff -Nru wine1.7-1.7.50/dlls/api-ms-win-downlevel-advapi32-l1-1-0/api-ms-win-downlevel-advapi32-l1-1-0.spec wine1.7-1.7.55/dlls/api-ms-win-downlevel-advapi32-l1-1-0/api-ms-win-downlevel-advapi32-l1-1-0.spec --- wine1.7-1.7.50/dlls/api-ms-win-downlevel-advapi32-l1-1-0/api-ms-win-downlevel-advapi32-l1-1-0.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-downlevel-advapi32-l1-1-0/api-ms-win-downlevel-advapi32-l1-1-0.spec 2015-11-13 14:32:40.000000000 +0000 @@ -27,7 +27,7 @@ @ stdcall CopySid(long ptr ptr) advapi32.CopySid @ stdcall CreatePrivateObjectSecurity(ptr ptr ptr long long ptr) advapi32.CreatePrivateObjectSecurity @ stub CreatePrivateObjectSecurityEx -@ stub CreatePrivateObjectSecurityWithMultipleInheritance +@ stdcall CreatePrivateObjectSecurityWithMultipleInheritance(ptr ptr ptr ptr long long long long ptr) advapi32.CreatePrivateObjectSecurityWithMultipleInheritance @ stdcall CreateProcessAsUserW(long wstr wstr ptr ptr long long ptr wstr ptr ptr) advapi32.CreateProcessAsUserW @ stdcall CreateRestrictedToken(long long long ptr long ptr long ptr ptr) advapi32.CreateRestrictedToken @ stdcall CreateWellKnownSid(long ptr ptr ptr) advapi32.CreateWellKnownSid diff -Nru wine1.7-1.7.50/dlls/api-ms-win-security-base-l1-1-0/api-ms-win-security-base-l1-1-0.spec wine1.7-1.7.55/dlls/api-ms-win-security-base-l1-1-0/api-ms-win-security-base-l1-1-0.spec --- wine1.7-1.7.50/dlls/api-ms-win-security-base-l1-1-0/api-ms-win-security-base-l1-1-0.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-security-base-l1-1-0/api-ms-win-security-base-l1-1-0.spec 2015-11-13 14:32:40.000000000 +0000 @@ -27,7 +27,7 @@ @ stdcall CopySid(long ptr ptr) advapi32.CopySid @ stdcall CreatePrivateObjectSecurity(ptr ptr ptr long long ptr) advapi32.CreatePrivateObjectSecurity @ stub CreatePrivateObjectSecurityEx -@ stub CreatePrivateObjectSecurityWithMultipleInheritance +@ stdcall CreatePrivateObjectSecurityWithMultipleInheritance(ptr ptr ptr ptr long long long long ptr) advapi32.CreatePrivateObjectSecurityWithMultipleInheritance @ stdcall CreateRestrictedToken(long long long ptr long ptr long ptr ptr) advapi32.CreateRestrictedToken @ stdcall CreateWellKnownSid(long ptr ptr ptr) advapi32.CreateWellKnownSid @ stdcall DeleteAce(ptr long) advapi32.DeleteAce diff -Nru wine1.7-1.7.50/dlls/api-ms-win-security-base-l1-2-0/api-ms-win-security-base-l1-2-0.spec wine1.7-1.7.55/dlls/api-ms-win-security-base-l1-2-0/api-ms-win-security-base-l1-2-0.spec --- wine1.7-1.7.50/dlls/api-ms-win-security-base-l1-2-0/api-ms-win-security-base-l1-2-0.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/api-ms-win-security-base-l1-2-0/api-ms-win-security-base-l1-2-0.spec 2015-11-13 14:32:40.000000000 +0000 @@ -31,7 +31,7 @@ @ stdcall CopySid(long ptr ptr) advapi32.CopySid @ stdcall CreatePrivateObjectSecurity(ptr ptr ptr long long ptr) advapi32.CreatePrivateObjectSecurity @ stub CreatePrivateObjectSecurityEx -@ stub CreatePrivateObjectSecurityWithMultipleInheritance +@ stdcall CreatePrivateObjectSecurityWithMultipleInheritance(ptr ptr ptr ptr long long long long ptr) advapi32.CreatePrivateObjectSecurityWithMultipleInheritance @ stdcall CreateRestrictedToken(long long long ptr long ptr long ptr ptr) advapi32.CreateRestrictedToken @ stdcall CreateWellKnownSid(long ptr ptr ptr) advapi32.CreateWellKnownSid @ stdcall DeleteAce(ptr long) advapi32.DeleteAce diff -Nru wine1.7-1.7.50/dlls/avifil32/api.c wine1.7-1.7.55/dlls/avifil32/api.c --- wine1.7-1.7.50/dlls/avifil32/api.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/avifil32/api.c 2015-11-13 14:32:40.000000000 +0000 @@ -2278,17 +2278,85 @@ HRESULT WINAPIV AVISaveA(LPCSTR szFile, CLSID * pclsidHandler, AVISAVECALLBACK lpfnCallback, int nStreams, PAVISTREAM pavi, LPAVICOMPRESSOPTIONS lpOptions, ...) { - FIXME("(%s,%p,%p,0x%08x,%p,%p), stub!\n", debugstr_a(szFile), pclsidHandler, lpfnCallback, + va_list vl; + int i; + HRESULT ret; + PAVISTREAM *streams; + LPAVICOMPRESSOPTIONS *options; + + TRACE("(%s,%p,%p,%d,%p,%p)\n", debugstr_a(szFile), pclsidHandler, lpfnCallback, nStreams, pavi, lpOptions); - return AVIERR_UNSUPPORTED; + if (nStreams <= 0) return AVIERR_BADPARAM; + + streams = HeapAlloc(GetProcessHeap(), 0, nStreams * sizeof(void *)); + options = HeapAlloc(GetProcessHeap(), 0, nStreams * sizeof(void *)); + if (!streams || !options) + { + ret = AVIERR_MEMORY; + goto error; + } + + streams[0] = pavi; + options[0] = lpOptions; + + va_start(vl, lpOptions); + for (i = 1; i < nStreams; i++) + { + streams[i] = va_arg(vl, void *); + options[i] = va_arg(vl, void *); + } + va_end(vl); + + for (i = 0; i < nStreams; i++) + TRACE("Pair[%d] - Stream = %p, Options = %p\n", i, streams[i], options[i]); + + ret = AVISaveVA(szFile, pclsidHandler, lpfnCallback, nStreams, streams, options); +error: + HeapFree(GetProcessHeap(), 0, streams); + HeapFree(GetProcessHeap(), 0, options); + return ret; } HRESULT WINAPIV AVISaveW(LPCWSTR szFile, CLSID * pclsidHandler, AVISAVECALLBACK lpfnCallback, int nStreams, PAVISTREAM pavi, LPAVICOMPRESSOPTIONS lpOptions, ...) { - FIXME("(%s,%p,%p,0x%08x,%p,%p), stub!\n", debugstr_w(szFile), pclsidHandler, lpfnCallback, + va_list vl; + int i; + HRESULT ret; + PAVISTREAM *streams; + LPAVICOMPRESSOPTIONS *options; + + TRACE("(%s,%p,%p,%d,%p,%p)\n", debugstr_w(szFile), pclsidHandler, lpfnCallback, nStreams, pavi, lpOptions); - return AVIERR_UNSUPPORTED; + if (nStreams <= 0) return AVIERR_BADPARAM; + + streams = HeapAlloc(GetProcessHeap(), 0, nStreams * sizeof(void *)); + options = HeapAlloc(GetProcessHeap(), 0, nStreams * sizeof(void *)); + if (!streams || !options) + { + ret = AVIERR_MEMORY; + goto error; + } + + streams[0] = pavi; + options[0] = lpOptions; + + va_start(vl, lpOptions); + for (i = 1; i < nStreams; i++) + { + streams[i] = va_arg(vl, void *); + options[i] = va_arg(vl, void *); + } + va_end(vl); + + for (i = 0; i < nStreams; i++) + TRACE("Pair[%d] - Stream = %p, Options = %p\n", i, streams[i], options[i]); + + ret = AVISaveVW(szFile, pclsidHandler, lpfnCallback, nStreams, streams, options); +error: + HeapFree(GetProcessHeap(), 0, streams); + HeapFree(GetProcessHeap(), 0, options); + return ret; } diff -Nru wine1.7-1.7.50/dlls/avifil32/avifile.c wine1.7-1.7.55/dlls/avifil32/avifile.c --- wine1.7-1.7.50/dlls/avifil32/avifile.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/avifil32/avifile.c 2015-11-13 14:32:40.000000000 +0000 @@ -1987,13 +1987,17 @@ if (nStream > This->fInfo.dwStreams) return AVIERR_BADFORMAT; + /* Video frames can be either indexed in a relative position to the + * "movi" chunk or in a absolute position in the file. If the index + * is relative the frame offset will always be so small that it will + * virtually never reach the "movi" offset so we can detect if the + * video is relative very fast. + */ if (*bAbsolute && lp->dwChunkOffset < This->dwMoviChunkPos) *bAbsolute = FALSE; - if (*bAbsolute) - lp->dwChunkOffset += sizeof(DWORD); - else - lp->dwChunkOffset += pos; + if (!*bAbsolute) + lp->dwChunkOffset += pos; /* make the offset absolute */ if (FAILED(AVIFILE_AddFrame(This->ppStreams[nStream], lp->ckid, lp->dwChunkLength, lp->dwChunkOffset, lp->dwFlags))) return AVIERR_MEMORY; diff -Nru wine1.7-1.7.50/dlls/bcrypt/bcrypt_main.c wine1.7-1.7.55/dlls/bcrypt/bcrypt_main.c --- wine1.7-1.7.50/dlls/bcrypt/bcrypt_main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/bcrypt/bcrypt_main.c 2015-11-13 14:32:40.000000000 +0000 @@ -115,3 +115,11 @@ return STATUS_NOT_IMPLEMENTED; } + +NTSTATUS WINAPI BCryptCreateHash(BCRYPT_ALG_HANDLE algorithm, BCRYPT_HASH_HANDLE* hash, UCHAR* hashobject, + ULONG hashobjectlen, UCHAR *secret, ULONG secretlen, ULONG flags) +{ + FIXME("%p, %p, %p, %u, %p, %u, %08x - stub\n", algorithm, hash, hashobject, hashobjectlen, secret, secretlen, flags); + + return STATUS_NOT_IMPLEMENTED; +} diff -Nru wine1.7-1.7.50/dlls/bcrypt/bcrypt.spec wine1.7-1.7.55/dlls/bcrypt/bcrypt.spec --- wine1.7-1.7.50/dlls/bcrypt/bcrypt.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/bcrypt/bcrypt.spec 2015-11-13 14:32:40.000000000 +0000 @@ -4,7 +4,7 @@ @ stub BCryptConfigureContext @ stub BCryptConfigureContextFunction @ stub BCryptCreateContext -@ stub BCryptCreateHash +@ stdcall BCryptCreateHash(ptr ptr ptr long ptr long long) @ stub BCryptDecrypt @ stub BCryptDeleteContext @ stub BCryptDeriveKey diff -Nru wine1.7-1.7.50/dlls/bluetoothapis/bluetoothapis.spec wine1.7-1.7.55/dlls/bluetoothapis/bluetoothapis.spec --- wine1.7-1.7.50/dlls/bluetoothapis/bluetoothapis.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/bluetoothapis/bluetoothapis.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,96 @@ +@ stub BluetoothAddressToString +@ stub BluetoothDisconnectDevice +@ stub BluetoothEnableDiscovery +@ stub BluetoothEnableIncomingConnections +@ stub BluetoothEnumerateInstalledServices +@ stub BluetoothEnumerateInstalledServicesEx +@ stub BluetoothEnumerateLocalServices +@ stub BluetoothFindBrowseGroupClose +@ stub BluetoothFindClassIdClose +@ stub BluetoothFindDeviceClose +@ stub BluetoothFindFirstBrowseGroup +@ stub BluetoothFindFirstClassId +@ stub BluetoothFindFirstDevice +@ stub BluetoothFindFirstProfileDescriptor +@ stub BluetoothFindFirstProtocolDescriptorStack +@ stub BluetoothFindFirstProtocolEntry +@ stub BluetoothFindFirstRadio +@ stub BluetoothFindFirstService +@ stub BluetoothFindFirstServiceEx +@ stub BluetoothFindNextBrowseGroup +@ stub BluetoothFindNextClassId +@ stub BluetoothFindNextDevice +@ stub BluetoothFindNextProfileDescriptor +@ stub BluetoothFindNextProtocolDescriptorStack +@ stub BluetoothFindNextProtocolEntry +@ stub BluetoothFindNextRadio +@ stub BluetoothFindNextService +@ stub BluetoothFindProfileDescriptorClose +@ stub BluetoothFindProtocolDescriptorStackClose +@ stub BluetoothFindProtocolEntryClose +@ stub BluetoothFindRadioClose +@ stub BluetoothFindServiceClose +@ stub BluetoothGATTAbortReliableWrite +@ stub BluetoothGATTBeginReliableWrite +@ stub BluetoothGATTEndReliableWrite +@ stub BluetoothGATTGetCharacteristicValue +@ stub BluetoothGATTGetCharacteristics +@ stub BluetoothGATTGetDescriptorValue +@ stub BluetoothGATTGetDescriptors +@ stub BluetoothGATTGetIncludedServices +@ stub BluetoothGATTGetServices +@ stub BluetoothGATTRegisterEvent +@ stub BluetoothGATTSetCharacteristicValue +@ stub BluetoothGATTSetDescriptorValue +@ stub BluetoothGATTUnregisterEvent +@ stub BluetoothGetDeviceInfo +@ stub BluetoothGetLocalServiceInfo +@ stub BluetoothGetRadioInfo +@ stub BluetoothGetServicePnpInstance +@ stub BluetoothIsConnectable +@ stub BluetoothIsDiscoverable +@ stub BluetoothIsVersionAvailable +@ stub BluetoothRegisterForAuthentication +@ stub BluetoothRegisterForAuthenticationEx +@ stub BluetoothRemoveDevice +@ stub BluetoothSdpEnumAttributes +@ stub BluetoothSdpGetAttributeValue +@ stub BluetoothSdpGetContainerElementData +@ stub BluetoothSdpGetElementData +@ stub BluetoothSdpGetString +@ stub BluetoothSendAuthenticationResponse +@ stub BluetoothSendAuthenticationResponseEx +@ stub BluetoothSetLocalServiceInfo +@ stub BluetoothSetServiceState +@ stub BluetoothSetServiceStateEx +@ stub BluetoothUnregisterAuthentication +@ stub BluetoothUpdateDeviceRecord +@ stub BthpCheckForUnsupportedGuid +@ stub BthpCleanupBRDeviceNode +@ stub BthpCleanupDeviceLocalServices +@ stub BthpCleanupDeviceRemoteServices +@ stub BthpCleanupLEDeviceNodes +@ stub BthpEnableAllServices +@ stub BthpEnableConnectableAndDiscoverable +@ stub BthpEnableRadioSoftware +@ stub BthpFindPnpInfo +@ stub BthpGATTCloseSession +@ stub BthpInnerRecord +@ stub BthpIsBluetoothServiceRunning +@ stub BthpIsConnectableByDefault +@ stub BthpIsDiscoverable +@ stub BthpIsDiscoverableByDefault +@ stub BthpIsRadioSoftwareEnabled +@ stub BthpIsTopOfServiceGroup +@ stub BthpMapStatusToErr +@ stub BthpNextRecord +@ stub BthpRegisterForAuthentication +@ stub BthpSetServiceState +@ stub BthpSetServiceStateEx +@ stub BthpTranspose16Bits +@ stub BthpTranspose32Bits +@ stub BthpTransposeAndExtendBytes +@ stub DllCanUnloadNow +@ stub FindNextOpenVCOMPort +@ stub InstallIncomingComPort +@ stub ShouldForceAuthentication diff -Nru wine1.7-1.7.50/dlls/bluetoothapis/main.c wine1.7-1.7.55/dlls/bluetoothapis/main.c --- wine1.7-1.7.50/dlls/bluetoothapis/main.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/bluetoothapis/main.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,40 @@ +/* + * Bluetooth APIs + * + * Copyright 2015 Austin English + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" + +#include + +#include "windef.h" +#include "winbase.h" + +BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) +{ + switch (reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(instance); + break; + } + + return TRUE; +} diff -Nru wine1.7-1.7.50/dlls/bluetoothapis/Makefile.in wine1.7-1.7.55/dlls/bluetoothapis/Makefile.in --- wine1.7-1.7.50/dlls/bluetoothapis/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/bluetoothapis/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,4 @@ +MODULE = bluetoothapis.dll + +C_SRCS = \ + main.c diff -Nru wine1.7-1.7.50/dlls/bthprops.cpl/bthprops.cpl.spec wine1.7-1.7.55/dlls/bthprops.cpl/bthprops.cpl.spec --- wine1.7-1.7.50/dlls/bthprops.cpl/bthprops.cpl.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/bthprops.cpl/bthprops.cpl.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,65 @@ +@ stub BluetoothAddressToString +@ stub BluetoothAuthenticateDevice +@ stub BluetoothAuthenticateDeviceEx +@ stub BluetoothAuthenticateMultipleDevices +@ stub BluetoothAuthenticationAgent +@ stub BluetoothDisconnectDevice +@ stub BluetoothDisplayDeviceProperties +@ stub BluetoothEnableDiscovery +@ stub BluetoothEnableIncomingConnections +@ stub BluetoothEnumerateInstalledServices +@ stub BluetoothEnumerateInstalledServicesEx +@ stub BluetoothFindBrowseGroupClose +@ stub BluetoothFindClassIdClose +@ stub BluetoothFindDeviceClose +@ stub BluetoothFindFirstBrowseGroup +@ stub BluetoothFindFirstClassId +@ stub BluetoothFindFirstDevice +@ stub BluetoothFindFirstProfileDescriptor +@ stub BluetoothFindFirstProtocolDescriptorStack +@ stub BluetoothFindFirstProtocolEntry +@ stub BluetoothFindFirstRadio +@ stub BluetoothFindFirstService +@ stub BluetoothFindFirstServiceEx +@ stub BluetoothFindNextBrowseGroup +@ stub BluetoothFindNextClassId +@ stub BluetoothFindNextDevice +@ stub BluetoothFindNextProfileDescriptor +@ stub BluetoothFindNextProtocolDescriptorStack +@ stub BluetoothFindNextProtocolEntry +@ stub BluetoothFindNextRadio +@ stub BluetoothFindNextService +@ stub BluetoothFindProfileDescriptorClose +@ stub BluetoothFindProtocolDescriptorStackClose +@ stub BluetoothFindProtocolEntryClose +@ stub BluetoothFindRadioClose +@ stub BluetoothFindServiceClose +@ stub BluetoothGetDeviceInfo +@ stub BluetoothGetRadioInfo +@ stub BluetoothIsConnectable +@ stub BluetoothIsDiscoverable +@ stub BluetoothIsVersionAvailable +@ stub BluetoothMapClassOfDeviceToImageIndex +@ stub BluetoothMapClassOfDeviceToString +@ stub BluetoothRegisterForAuthentication +@ stub BluetoothRegisterForAuthenticationEx +@ stub BluetoothRemoveDevice +@ stub BluetoothSdpEnumAttributes +@ stub BluetoothSdpGetAttributeValue +@ stub BluetoothSdpGetContainerElementData +@ stub BluetoothSdpGetElementData +@ stub BluetoothSdpGetString +@ stub BluetoothSelectDevices +@ stub BluetoothSelectDevicesFree +@ stub BluetoothSendAuthenticationResponse +@ stub BluetoothSendAuthenticationResponseEx +@ stub BluetoothSetLocalServiceInfo +@ stub BluetoothSetServiceState +@ stub BluetoothUnregisterAuthentication +@ stub BluetoothUpdateDeviceRecord +@ stub BthpEnableAllServices +@ stub BthpFindPnpInfo +@ stub BthpMapStatusToErr +#@ stub CPlApplet +@ stub DllCanUnloadNow +@ stub DllGetClassObject diff -Nru wine1.7-1.7.50/dlls/bthprops.cpl/Makefile.in wine1.7-1.7.55/dlls/bthprops.cpl/Makefile.in --- wine1.7-1.7.50/dlls/bthprops.cpl/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/bthprops.cpl/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1 @@ +MODULE = bthprops.cpl diff -Nru wine1.7-1.7.50/dlls/combase/combase.spec wine1.7-1.7.55/dlls/combase/combase.spec --- wine1.7-1.7.50/dlls/combase/combase.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/combase/combase.spec 2015-11-13 14:32:40.000000000 +0000 @@ -248,7 +248,7 @@ @ stub RoFailFastWithErrorContext @ stub RoFreeParameterizedTypeExtra @ stub RoGetActivatableClassRegistration -@ stub RoGetActivationFactory +@ stdcall RoGetActivationFactory(ptr ptr ptr) @ stub RoGetAgileReference @ stub RoGetApartmentIdentifier @ stub RoGetErrorReportingFlags @@ -288,8 +288,8 @@ @ stdcall WdtpInterfacePointer_UserUnmarshal(ptr ptr ptr ptr) ole32.WdtpInterfacePointer_UserUnmarshal @ stub WdtpInterfacePointer_UserUnmarshal64 @ stub WindowsCompareStringOrdinal -@ stub WindowsConcatString -@ stdcall WindowsCreateString(ptr long ptr) +@ stdcall WindowsConcatString(ptr ptr ptr) +@ stdcall WindowsCreateString(wstr long ptr) @ stdcall WindowsCreateStringReference(wstr long ptr ptr) @ stdcall WindowsDeleteString(ptr) @ stdcall WindowsDeleteStringBuffer(ptr) @@ -302,7 +302,7 @@ @ stdcall WindowsPromoteStringBuffer(ptr ptr) @ stub WindowsReplaceString @ stdcall WindowsStringHasEmbeddedNull(ptr ptr) -@ stub WindowsSubstring -@ stub WindowsSubstringWithSpecifiedLength +@ stdcall WindowsSubstring(ptr long ptr) +@ stdcall WindowsSubstringWithSpecifiedLength(ptr long long ptr) @ stub WindowsTrimStringEnd @ stub WindowsTrimStringStart diff -Nru wine1.7-1.7.50/dlls/combase/roapi.c wine1.7-1.7.55/dlls/combase/roapi.c --- wine1.7-1.7.50/dlls/combase/roapi.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/combase/roapi.c 2015-11-13 14:32:40.000000000 +0000 @@ -18,6 +18,7 @@ #include "objbase.h" #include "roapi.h" +#include "hstring.h" #include "wine/debug.h" @@ -45,3 +46,12 @@ { CoUninitialize(); } + +/*********************************************************************** + * RoGetActivationFactory (combase.@) + */ +HRESULT WINAPI RoGetActivationFactory(HSTRING classid, REFIID iid, void **factory) +{ + FIXME("stub: %p %p %p\n", classid, iid, factory); + return E_NOTIMPL; +} diff -Nru wine1.7-1.7.50/dlls/combase/string.c wine1.7-1.7.55/dlls/combase/string.c --- wine1.7-1.7.50/dlls/combase/string.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/combase/string.c 2015-11-13 14:32:40.000000000 +0000 @@ -21,7 +21,9 @@ #include "windows.h" #include "winerror.h" #include "hstring.h" +#include "wine/debug.h" +WINE_DEFAULT_DEBUG_CHANNEL(winstring); struct hstring_private { @@ -72,15 +74,18 @@ HSTRING *out) { struct hstring_private *priv; + + TRACE("(%s, %u, %p)\n", debugstr_wn(ptr, len), len, out); + if (out == NULL) return E_INVALIDARG; - if (ptr == NULL && len > 0) - return E_POINTER; if (len == 0) { *out = NULL; return S_OK; } + if (ptr == NULL) + return E_POINTER; if (!alloc_string(len, out)) return E_OUTOFMEMORY; priv = impl_from_HSTRING(*out); @@ -95,17 +100,20 @@ HSTRING_HEADER *header, HSTRING *out) { struct hstring_private *priv = impl_from_HSTRING_HEADER(header); + + TRACE("(%s, %u, %p, %p)\n", debugstr_wn(ptr, len), len, header, out); + if (out == NULL || header == NULL) return E_INVALIDARG; - if (ptr == NULL && len > 0) - return E_POINTER; + if (ptr != NULL && ptr[len] != '\0') + return E_INVALIDARG; if (len == 0) { *out = NULL; return S_OK; } - if (ptr[len] != '\0') - return E_INVALIDARG; + if (ptr == NULL) + return E_POINTER; priv->buffer = (LPWSTR)ptr; priv->length = len; priv->reference = TRUE; @@ -119,6 +127,9 @@ HRESULT WINAPI WindowsDeleteString(HSTRING str) { struct hstring_private *priv = impl_from_HSTRING(str); + + TRACE("(%p)\n", str); + if (str == NULL) return S_OK; if (priv->reference) @@ -134,6 +145,9 @@ HRESULT WINAPI WindowsDuplicateString(HSTRING str, HSTRING *out) { struct hstring_private *priv = impl_from_HSTRING(str); + + TRACE("(%p, %p)\n", str, out); + if (out == NULL) return E_INVALIDARG; if (str == NULL) @@ -156,6 +170,9 @@ { struct hstring_private *priv; HSTRING str; + + TRACE("(%u, %p, %p)\n", len, outptr, out); + if (outptr == NULL || out == NULL) return E_POINTER; if (len == 0) @@ -178,6 +195,8 @@ */ HRESULT WINAPI WindowsDeleteStringBuffer(HSTRING_BUFFER buf) { + TRACE("(%p)\n", buf); + return WindowsDeleteString((HSTRING)buf); } @@ -187,6 +206,9 @@ HRESULT WINAPI WindowsPromoteStringBuffer(HSTRING_BUFFER buf, HSTRING *out) { struct hstring_private *priv = impl_from_HSTRING_BUFFER(buf); + + TRACE("(%p, %p)\n", buf, out); + if (out == NULL) return E_POINTER; if (buf == NULL) @@ -206,6 +228,9 @@ UINT32 WINAPI WindowsGetStringLen(HSTRING str) { struct hstring_private *priv = impl_from_HSTRING(str); + + TRACE("(%p)\n", str); + if (str == NULL) return 0; return priv->length; @@ -217,6 +242,9 @@ LPCWSTR WINAPI WindowsGetStringRawBuffer(HSTRING str, UINT32 *len) { struct hstring_private *priv = impl_from_HSTRING(str); + + TRACE("(%p, %p)\n", str, len); + if (str == NULL) { if (len) @@ -235,6 +263,9 @@ { UINT32 i; struct hstring_private *priv = impl_from_HSTRING(str); + + TRACE("(%p, %p)\n", str, out); + if (out == NULL) return E_INVALIDARG; if (str == NULL) @@ -255,11 +286,88 @@ } /*********************************************************************** + * WindowsSubstring (combase.@) + */ +HRESULT WINAPI WindowsSubstring(HSTRING str, UINT32 start, HSTRING *out) +{ + struct hstring_private *priv = impl_from_HSTRING(str); + UINT32 len = WindowsGetStringLen(str); + + TRACE("(%p, %u, %p)\n", str, start, out); + + if (out == NULL) + return E_INVALIDARG; + if (start > len) + return E_BOUNDS; + if (start == len) + { + *out = NULL; + return S_OK; + } + return WindowsCreateString(&priv->buffer[start], len - start, out); +} + +/*********************************************************************** + * WindowsSubstringWithSpecifiedLength (combase.@) + */ +HRESULT WINAPI WindowsSubstringWithSpecifiedLength(HSTRING str, UINT32 start, UINT32 len, HSTRING *out) +{ + struct hstring_private *priv = impl_from_HSTRING(str); + + TRACE("(%p, %u, %u, %p)\n", str, start, len, out); + + if (out == NULL) + return E_INVALIDARG; + if (start + len < start || + start + len > WindowsGetStringLen(str)) + return E_BOUNDS; + if (len == 0) + { + *out = NULL; + return S_OK; + } + return WindowsCreateString(&priv->buffer[start], len, out); +} + +/*********************************************************************** + * WindowsConcatString (combase.@) + */ +HRESULT WINAPI WindowsConcatString(HSTRING str1, HSTRING str2, HSTRING *out) +{ + struct hstring_private *priv1 = impl_from_HSTRING(str1); + struct hstring_private *priv2 = impl_from_HSTRING(str2); + struct hstring_private *priv; + + TRACE("(%p, %p, %p)\n", str1, str2, out); + + if (out == NULL) + return E_INVALIDARG; + if (str1 == NULL) + return WindowsDuplicateString(str2, out); + if (str2 == NULL) + return WindowsDuplicateString(str1, out); + if (!priv1->length && !priv2->length) + { + *out = NULL; + return S_OK; + } + if (!alloc_string(priv1->length + priv2->length, out)) + return E_OUTOFMEMORY; + priv = impl_from_HSTRING(*out); + memcpy(priv->buffer, priv1->buffer, priv1->length * sizeof(*priv1->buffer)); + memcpy(priv->buffer + priv1->length, priv2->buffer, priv2->length * sizeof(*priv2->buffer)); + return S_OK; +} + +/*********************************************************************** * WindowsIsStringEmpty (combase.@) */ BOOL WINAPI WindowsIsStringEmpty(HSTRING str) { struct hstring_private *priv = impl_from_HSTRING(str); + + TRACE("(%p)\n", str); + if (str == NULL) return TRUE; return priv->length == 0; diff -Nru wine1.7-1.7.50/dlls/combase/tests/string.c wine1.7-1.7.55/dlls/combase/tests/string.c --- wine1.7-1.7.50/dlls/combase/tests/string.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/combase/tests/string.c 2015-11-13 14:32:40.000000000 +0000 @@ -27,6 +27,7 @@ #include "wine/test.h" +static HRESULT (WINAPI *pWindowsConcatString)(HSTRING, HSTRING, HSTRING *); static HRESULT (WINAPI *pWindowsCreateString)(LPCWSTR, UINT32, HSTRING *); static HRESULT (WINAPI *pWindowsCreateStringReference)(LPCWSTR, UINT32, HSTRING_HEADER *, HSTRING *); static HRESULT (WINAPI *pWindowsDeleteString)(HSTRING); @@ -38,6 +39,8 @@ static HRESULT (WINAPI *pWindowsPreallocateStringBuffer)(UINT32, WCHAR **, HSTRING_BUFFER *); static HRESULT (WINAPI *pWindowsPromoteStringBuffer)(HSTRING_BUFFER, HSTRING *); static HRESULT (WINAPI *pWindowsStringHasEmbeddedNull)(HSTRING, BOOL *); +static HRESULT (WINAPI *pWindowsSubstring)(HSTRING, UINT32, HSTRING *); +static HRESULT (WINAPI *pWindowsSubstringWithSpecifiedLength)(HSTRING, UINT32, UINT32, HSTRING *); #define SET(x) p##x = (void*)GetProcAddress(hmod, #x) @@ -49,6 +52,7 @@ win_skip("Failed to load combase.dll, skipping tests\n"); return FALSE; } + SET(WindowsConcatString); SET(WindowsCreateString); SET(WindowsCreateStringReference); SET(WindowsDeleteString); @@ -60,6 +64,8 @@ SET(WindowsPreallocateStringBuffer); SET(WindowsPromoteStringBuffer); SET(WindowsStringHasEmbeddedNull); + SET(WindowsSubstring); + SET(WindowsSubstringWithSpecifiedLength); return TRUE; } @@ -90,8 +96,11 @@ } static const WCHAR input_string[] = { 'a', 'b', 'c', 'd', 'e', 'f', '\0', '\0' }; +static const WCHAR input_string1[] = { 'a', 'b', 'c', '\0' }; +static const WCHAR input_string2[] = { 'd', 'e', 'f', '\0' }; static const WCHAR input_empty_string[] = { '\0' }; static const WCHAR input_embed_null[] = { 'a', '\0', 'c', '\0', 'e', 'f', '\0' }; +static const WCHAR output_substring[] = { 'c', 'd', 'e', 'f', '\0' }; static void test_create_delete(void) { @@ -119,6 +128,9 @@ * length. According to MSDN this should be E_INVALIDARG, but it returns * 0x80000017 in practice. */ ok(FAILED(pWindowsCreateStringReference(input_string, 5, &header, &str)), "Incorrect error handling\n"); + /* If the input string is non-null, it must be null-terminated even if the + * length is zero. */ + ok(FAILED(pWindowsCreateStringReference(input_string, 0, &header, &str)), "Incorrect error handling\n"); ok(pWindowsCreateStringReference(input_string, 6, NULL, &str) == E_INVALIDARG, "Incorrect error handling\n"); ok(pWindowsCreateStringReference(input_string, 6, &header, NULL) == E_INVALIDARG, "Incorrect error handling\n"); ok(pWindowsCreateStringReference(NULL, 6, &header, &str) == E_POINTER, "Incorrect error handling\n"); @@ -133,9 +145,21 @@ ok(str == NULL, "Empty string not a null string\n"); ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n"); + ok(pWindowsCreateString(input_string, 0, &str) == S_OK, "Failed to create string\n"); + ok(str == NULL, "Empty string not a null string\n"); + ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n"); + ok(pWindowsCreateStringReference(input_empty_string, 0, &header, &str) == S_OK, "Failed to create string\n"); ok(str == NULL, "Empty string not a null string\n"); ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n"); + + ok(pWindowsCreateString(NULL, 0, &str) == S_OK, "Failed to create string\n"); + ok(str == NULL, "Empty string not a null string\n"); + ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n"); + + ok(pWindowsCreateStringReference(NULL, 0, &header, &str) == S_OK, "Failed to create string\n"); + ok(str == NULL, "Empty string not a null string\n"); + ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n"); } static void test_duplicate(void) @@ -236,6 +260,140 @@ ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n"); } +static void test_substring(void) +{ + HSTRING str, substr; + HSTRING_HEADER header; + + /* Test substring of string buffers */ + ok(pWindowsCreateString(input_string, 6, &str) == S_OK, "Failed to create string\n"); + ok(pWindowsSubstring(str, 2, &substr) == S_OK, "Failed to create substring\n"); + check_string(substr, output_substring, 4, FALSE); + ok(pWindowsDeleteString(substr) == S_OK, "Failed to delete string\n"); + ok(pWindowsSubstringWithSpecifiedLength(str, 2, 3, &substr) == S_OK, "Failed to create substring\n"); + check_string(substr, output_substring, 3, FALSE); + ok(pWindowsDeleteString(substr) == S_OK, "Failed to delete string\n"); + ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n"); + + /* Test duplication of string using substring */ + ok(pWindowsCreateString(input_string, 6, &str) == S_OK, "Failed to create string\n"); + ok(pWindowsSubstring(str, 0, &substr) == S_OK, "Failed to create substring\n"); + ok(str != substr, "Duplicated string didn't create new string\n"); + check_string(substr, input_string, 6, FALSE); + ok(pWindowsDeleteString(substr) == S_OK, "Failed to delete string\n"); + ok(pWindowsSubstringWithSpecifiedLength(str, 0, 6, &substr) == S_OK, "Failed to create substring\n"); + ok(str != substr, "Duplicated string didn't create new string\n"); + check_string(substr, input_string, 6, FALSE); + ok(pWindowsDeleteString(substr) == S_OK, "Failed to delete string\n"); + ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n"); + + /* Test substring of string reference */ + ok(pWindowsCreateStringReference(input_string, 6, &header, &str) == S_OK, "Failed to create string ref\n"); + ok(pWindowsSubstring(str, 2, &substr) == S_OK, "Failed to create substring of string ref\n"); + check_string(substr, output_substring, 4, FALSE); + ok(pWindowsDeleteString(substr) == S_OK, "Failed to delete string\n"); + ok(pWindowsSubstringWithSpecifiedLength(str, 2, 3, &substr) == S_OK, "Failed to create substring of string ref\n"); + check_string(substr, output_substring, 3, FALSE); + ok(pWindowsDeleteString(substr) == S_OK, "Failed to delete string\n"); + ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string ref\n"); + + /* Test duplication of string reference using substring */ + ok(pWindowsCreateStringReference(input_string, 6, &header, &str) == S_OK, "Failed to create string ref\n"); + ok(pWindowsSubstring(str, 0, &substr) == S_OK, "Failed to create substring of string ref\n"); + ok(str != substr, "Duplicated string ref didn't create new string\n"); + check_string(substr, input_string, 6, FALSE); + ok(pWindowsDeleteString(substr) == S_OK, "Failed to delete string\n"); + ok(pWindowsSubstringWithSpecifiedLength(str, 0, 6, &substr) == S_OK, "Failed to create substring of string ref\n"); + ok(str != substr, "Duplicated string ref didn't create new string\n"); + check_string(substr, input_string, 6, FALSE); + ok(pWindowsDeleteString(substr) == S_OK, "Failed to delete string\n"); + ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string ref\n"); + + /* Test get substring of empty string */ + ok(pWindowsSubstring(NULL, 0, &substr) == S_OK, "Failed to duplicate NULL string\n"); + ok(substr == NULL, "Substring created new string\n"); + ok(pWindowsSubstringWithSpecifiedLength(NULL, 0, 0, &substr) == S_OK, "Failed to duplicate NULL string\n"); + ok(substr == NULL, "Substring created new string\n"); + + /* Test get empty substring of string */ + ok(pWindowsCreateString(input_string, 6, &str) == S_OK, "Failed to create string\n"); + ok(pWindowsSubstring(str, 6, &substr) == S_OK, "Failed to create substring\n"); + ok(substr == NULL, "Substring created new string\n"); + ok(pWindowsSubstringWithSpecifiedLength(str, 6, 0, &substr) == S_OK, "Failed to create substring\n"); + ok(substr == NULL, "Substring created new string\n"); + ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n"); + + /* Test handling of using too high start index or length */ + ok(pWindowsCreateString(input_string, 6, &str) == S_OK, "Failed to create string\n"); + ok(pWindowsSubstring(str, 7, &substr) == E_BOUNDS, "Incorrect error handling\n"); + ok(pWindowsSubstringWithSpecifiedLength(str, 7, 0, &substr) == E_BOUNDS, "Incorrect error handling\n"); + ok(pWindowsSubstringWithSpecifiedLength(str, 6, 1, &substr) == E_BOUNDS, "Incorrect error handling\n"); + ok(pWindowsSubstringWithSpecifiedLength(str, 7, ~0U, &substr) == E_BOUNDS, "Incorrect error handling\n"); + ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n"); + + /* Test handling of a NULL string */ + ok(pWindowsCreateString(input_string, 6, &str) == S_OK, "Failed to create string\n"); + ok(pWindowsSubstring(str, 7, NULL) == E_INVALIDARG, "Incorrect error handling\n"); + ok(pWindowsSubstringWithSpecifiedLength(str, 7, 0, NULL) == E_INVALIDARG, "Incorrect error handling\n"); + ok(pWindowsDeleteString(str) == S_OK, "Failed to delete string\n"); +} + +static void test_concat(void) +{ + HSTRING str1, str2, concat; + HSTRING_HEADER header1, header2; + + /* Test concatenation of string buffers */ + ok(pWindowsCreateString(input_string1, 3, &str1) == S_OK, "Failed to create string\n"); + ok(pWindowsCreateString(input_string2, 3, &str2) == S_OK, "Failed to create string\n"); + + ok(pWindowsConcatString(str1, NULL, NULL) == E_INVALIDARG, "Incorrect error handling\n"); + ok(pWindowsConcatString(str1, NULL, &concat) == S_OK, "Failed to concatenate string\n"); + ok(str1 == concat, "Concatenate created new string\n"); + check_string(concat, input_string1, 3, FALSE); + ok(pWindowsDeleteString(concat) == S_OK, "Failed to delete string\n"); + + ok(pWindowsConcatString(NULL, str2, NULL) == E_INVALIDARG, "Incorrect error handling\n"); + ok(pWindowsConcatString(NULL, str2, &concat) == S_OK, "Failed to concatenate string\n"); + ok(str2 == concat, "Concatenate created new string\n"); + check_string(concat, input_string2, 3, FALSE); + ok(pWindowsDeleteString(concat) == S_OK, "Failed to delete string\n"); + + ok(pWindowsConcatString(str1, str2, NULL) == E_INVALIDARG, "Incorrect error handling\n"); + ok(pWindowsConcatString(str1, str2, &concat) == S_OK, "Failed to concatenate string\n"); + check_string(concat, input_string, 6, FALSE); + ok(pWindowsDeleteString(concat) == S_OK, "Failed to delete string\n"); + + ok(pWindowsDeleteString(str2) == S_OK, "Failed to delete string\n"); + ok(pWindowsDeleteString(str1) == S_OK, "Failed to delete string\n"); + + /* Test concatenation of string references */ + ok(pWindowsCreateStringReference(input_string1, 3, &header1, &str1) == S_OK, "Failed to create string ref\n"); + ok(pWindowsCreateStringReference(input_string2, 3, &header2, &str2) == S_OK, "Failed to create string ref\n"); + + ok(pWindowsConcatString(str1, NULL, &concat) == S_OK, "Failed to concatenate string\n"); + ok(str1 != concat, "Concatenate string ref didn't create new string\n"); + check_string(concat, input_string1, 3, FALSE); + ok(pWindowsDeleteString(concat) == S_OK, "Failed to delete string\n"); + + ok(pWindowsConcatString(NULL, str2, &concat) == S_OK, "Failed to concatenate string\n"); + ok(str2 != concat, "Concatenate string ref didn't create new string\n"); + check_string(concat, input_string2, 3, FALSE); + ok(pWindowsDeleteString(concat) == S_OK, "Failed to delete string\n"); + + ok(pWindowsConcatString(str1, str2, &concat) == S_OK, "Failed to concatenate string\n"); + check_string(concat, input_string, 6, FALSE); + ok(pWindowsDeleteString(concat) == S_OK, "Failed to delete string\n"); + + ok(pWindowsDeleteString(str2) == S_OK, "Failed to delete string ref\n"); + ok(pWindowsDeleteString(str1) == S_OK, "Failed to delete string ref\n"); + + /* Test concatenation of two empty strings */ + ok(pWindowsConcatString(NULL, NULL, NULL) == E_INVALIDARG, "Incorrect error handling\n"); + ok(pWindowsConcatString(NULL, NULL, &concat) == S_OK, "Failed to concatenate string\n"); + ok(concat == NULL, "Concatenate created new string\n"); +} + START_TEST(string) { if (!init_functions()) @@ -244,4 +402,6 @@ test_duplicate(); test_access(); test_string_buffer(); + test_substring(); + test_concat(); } diff -Nru wine1.7-1.7.50/dlls/comctl32/comctl32.spec wine1.7-1.7.55/dlls/comctl32/comctl32.spec --- wine1.7-1.7.50/dlls/comctl32/comctl32.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/comctl32/comctl32.spec 2015-11-13 14:32:40.000000000 +0000 @@ -88,6 +88,7 @@ 375 stdcall -noname -private StrCSpnIW(wstr wstr) 376 stdcall -noname -private IntlStrEqWorkerA(long str str long) 377 stdcall -noname -private IntlStrEqWorkerW(long wstr wstr long) +380 stdcall -ordinal LoadIconMetric(ptr wstr long ptr) 381 stdcall -ordinal LoadIconWithScaleDown(ptr wstr long long ptr) 382 stdcall -noname SmoothScrollWindow(ptr) 383 stub -noname DoReaderMode diff -Nru wine1.7-1.7.50/dlls/comctl32/commctrl.c wine1.7-1.7.55/dlls/comctl32/commctrl.c --- wine1.7-1.7.50/dlls/comctl32/commctrl.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/comctl32/commctrl.c 2015-11-13 14:32:40.000000000 +0000 @@ -3,6 +3,7 @@ * * Copyright 1997 Dimitrie O. Paun * Copyright 1998,2000 Eric Kohl + * Copyright 2014-2015 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 @@ -1641,8 +1642,47 @@ /*********************************************************************** * LoadIconWithScaleDown [COMCTL32.@] */ -HRESULT WINAPI LoadIconWithScaleDown(HINSTANCE hinst, PCWSTR name, int cx, int cy, HICON *icon) +HRESULT WINAPI LoadIconWithScaleDown(HINSTANCE hinst, const WCHAR *name, int cx, int cy, HICON *icon) { - FIXME("stub: %p %s %d %d %p\n", hinst, wine_dbgstr_w(name), cx, cy, icon); - return E_NOTIMPL; + TRACE("(%p, %s, %d, %d, %p)\n", hinst, debugstr_w(name), cx, cy, icon); + + *icon = NULL; + + if (!name) + return E_INVALIDARG; + + *icon = LoadImageW(hinst, name, IMAGE_ICON, cx, cy, + (hinst || IS_INTRESOURCE(name)) ? 0 : LR_LOADFROMFILE); + if (!*icon) + return HRESULT_FROM_WIN32(GetLastError()); + + return S_OK; +} + +/*********************************************************************** + * LoadIconMetric [COMCTL32.@] + */ +HRESULT WINAPI LoadIconMetric(HINSTANCE hinst, const WCHAR *name, int size, HICON *icon) +{ + int cx, cy; + + TRACE("(%p, %s, %d, %p)\n", hinst, debugstr_w(name), size, icon); + + if (size == LIM_SMALL) + { + cx = GetSystemMetrics(SM_CXSMICON); + cy = GetSystemMetrics(SM_CYSMICON); + } + else if (size == LIM_LARGE) + { + cx = GetSystemMetrics(SM_CXICON); + cy = GetSystemMetrics(SM_CYICON); + } + else + { + *icon = NULL; + return E_INVALIDARG; + } + + return LoadIconWithScaleDown(hinst, name, cx, cy, icon); } diff -Nru wine1.7-1.7.50/dlls/comctl32/imagelist.c wine1.7-1.7.55/dlls/comctl32/imagelist.c --- wine1.7-1.7.50/dlls/comctl32/imagelist.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/comctl32/imagelist.c 2015-11-13 14:32:40.000000000 +0000 @@ -3554,7 +3554,7 @@ IUnknown *punk, int iDrag, int dxHotspot, int dyHotspot) { IImageList *iml2 = NULL; - HRESULT ret; + BOOL ret; if (!punk) return E_FAIL; diff -Nru wine1.7-1.7.50/dlls/comctl32/listview.c wine1.7-1.7.55/dlls/comctl32/listview.c --- wine1.7-1.7.50/dlls/comctl32/listview.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/comctl32/listview.c 2015-11-13 14:32:40.000000000 +0000 @@ -587,7 +587,7 @@ int len, size = DEBUG_BUFFER_SIZE; if (pScrollInfo == NULL) return "(null)"; - len = snprintf(buf, size, "{cbSize=%d, ", pScrollInfo->cbSize); + len = snprintf(buf, size, "{cbSize=%u, ", pScrollInfo->cbSize); if (len == -1) goto end; buf += len; size -= len; if (pScrollInfo->fMask & SIF_RANGE) len = snprintf(buf, size, "nMin=%d, nMax=%d, ", pScrollInfo->nMin, pScrollInfo->nMax); @@ -4122,6 +4122,7 @@ /* see if we are supposed to be tracking mouse hovering */ if (LISTVIEW_IsHotTracking(infoPtr)) { TRACKMOUSEEVENT trackinfo; + DWORD flags; trackinfo.cbSize = sizeof(TRACKMOUSEEVENT); trackinfo.dwFlags = TME_QUERY; @@ -4129,8 +4130,12 @@ /* see if we are already tracking this hwnd */ _TrackMouseEvent(&trackinfo); - if(!(trackinfo.dwFlags & TME_HOVER) || trackinfo.hwndTrack != infoPtr->hwndSelf) { - trackinfo.dwFlags = TME_HOVER; + flags = TME_LEAVE; + if(infoPtr->dwLvExStyle & LVS_EX_TRACKSELECT) + flags |= TME_HOVER; + + if((trackinfo.dwFlags & flags) != flags || trackinfo.hwndTrack != infoPtr->hwndSelf) { + trackinfo.dwFlags = flags; trackinfo.dwHoverTime = infoPtr->dwHoverTime; trackinfo.hwndTrack = infoPtr->hwndSelf; @@ -5674,11 +5679,11 @@ } /* update the other column info */ - LISTVIEW_UpdateItemSize(infoPtr); if(DPA_GetPtrCount(infoPtr->hdpaColumns) == 0) LISTVIEW_InvalidateList(infoPtr); else LISTVIEW_ScrollColumns(infoPtr, nColumn, -(rcCol.right - rcCol.left)); + LISTVIEW_UpdateItemSize(infoPtr); return TRUE; } @@ -7846,10 +7851,18 @@ item.iItem = nItem; if (infoPtr->dwLvExStyle & LVS_EX_CHECKBOXES) { - item.mask |= LVIF_STATE; - item.stateMask |= LVIS_STATEIMAGEMASK; - item.state &= ~LVIS_STATEIMAGEMASK; - item.state |= INDEXTOSTATEIMAGEMASK(1); + if (item.mask & LVIF_STATE) + { + item.stateMask |= LVIS_STATEIMAGEMASK; + item.state &= ~LVIS_STATEIMAGEMASK; + item.state |= INDEXTOSTATEIMAGEMASK(1); + } + else + { + item.mask |= LVIF_STATE; + item.stateMask = LVIS_STATEIMAGEMASK; + item.state = INDEXTOSTATEIMAGEMASK(1); + } } if (!set_main_item(infoPtr, &item, TRUE, isW, &has_changed)) goto undo; diff -Nru wine1.7-1.7.50/dlls/comctl32/propsheet.c wine1.7-1.7.55/dlls/comctl32/propsheet.c --- wine1.7-1.7.50/dlls/comctl32/propsheet.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/comctl32/propsheet.c 2015-11-13 14:32:40.000000000 +0000 @@ -2706,6 +2706,7 @@ MSG msg; INT ret = -1; HWND hwnd = psInfo->hwnd; + HWND parent = psInfo->ppshheader.hwndParent; while(IsWindow(hwnd) && !psInfo->ended && (ret = GetMessageW(&msg, NULL, 0, 0))) { @@ -2728,6 +2729,9 @@ if(ret != -1) ret = psInfo->result; + if(parent) + EnableWindow(parent, TRUE); + DestroyWindow(hwnd); return ret; } @@ -2754,10 +2758,7 @@ } bRet = PROPSHEET_CreateDialog(psInfo); if(!psInfo->isModeless) - { bRet = do_loop(psInfo); - if (parent) EnableWindow(parent, TRUE); - } return bRet; } diff -Nru wine1.7-1.7.50/dlls/comctl32/syslink.c wine1.7-1.7.55/dlls/comctl32/syslink.c --- wine1.7-1.7.50/dlls/comctl32/syslink.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/comctl32/syslink.c 2015-11-13 14:32:40.000000000 +0000 @@ -1387,7 +1387,7 @@ for(Current = infoPtr->Items; Current != NULL; Current = Current->Next) { if((Current->Type == slLink) && SYSLINK_PtInDocItem(Current, *pt) && - (!MustBeEnabled || (MustBeEnabled && (Current->u.Link.state & LIS_ENABLED)))) + (!MustBeEnabled || (Current->u.Link.state & LIS_ENABLED))) { if(LinkId != NULL) { diff -Nru wine1.7-1.7.50/dlls/comctl32/tests/imagelist.c wine1.7-1.7.55/dlls/comctl32/tests/imagelist.c --- wine1.7-1.7.50/dlls/comctl32/tests/imagelist.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/comctl32/tests/imagelist.c 2015-11-13 14:32:40.000000000 +0000 @@ -1254,7 +1254,7 @@ static void test_shell_imagelist(void) { - BOOL (WINAPI *pSHGetImageList)(INT, REFIID, void**); + HRESULT (WINAPI *pSHGetImageList)(INT, REFIID, void**); IImageList *iml = NULL; HMODULE hShell32; HRESULT hr; @@ -1274,8 +1274,7 @@ } /* Get system image list */ - hr = (pSHGetImageList)(SHIL_SYSSMALL, &IID_IImageList, (void**)&iml); - + hr = pSHGetImageList(SHIL_SYSSMALL, &IID_IImageList, (void**)&iml); ok(SUCCEEDED(hr), "SHGetImageList failed, hr=%x\n", hr); if (hr != S_OK) { diff -Nru wine1.7-1.7.50/dlls/comctl32/tests/listview.c wine1.7-1.7.55/dlls/comctl32/tests/listview.c --- wine1.7-1.7.50/dlls/comctl32/tests/listview.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/comctl32/tests/listview.c 2015-11-13 14:32:40.000000000 +0000 @@ -5342,6 +5342,7 @@ flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_ITEMCHANGINGW; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); + ok(ret == 0, "got %d\n", ret); parent_header_notify_seq[0].id = HDN_ITEMCHANGINGA; ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq, "header notify, parent", TRUE); @@ -5350,6 +5351,7 @@ flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_ITEMCHANGEDW; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); + ok(ret == 0, "got %d\n", ret); parent_header_notify_seq[0].id = HDN_ITEMCHANGEDA; ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq, "header notify, parent", TRUE); @@ -5360,30 +5362,35 @@ flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_ITEMCLICKW; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); + ok(ret == 0, "got %d\n", ret); ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_click_seq, "header notify, parent", FALSE); ok(nmhdr.hdr.code == HDN_ITEMCLICKA, "Expected ANSI notification code\n"); flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_ITEMDBLCLICKW; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); + ok(ret == 0, "got %d\n", ret); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "header notify, parent", FALSE); ok(nmhdr.hdr.code == HDN_ITEMDBLCLICKW, "Expected Unicode notification code\n"); flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_DIVIDERDBLCLICKW; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); + ok(ret == 0, "got %d\n", ret); ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_divider_dclick_seq, "header notify, parent", TRUE); ok(nmhdr.hdr.code == HDN_DIVIDERDBLCLICKA, "Expected ANSI notification code\n"); flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_BEGINTRACKW; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); + ok(ret == 0, "got %d\n", ret); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "header notify, parent", FALSE); ok(nmhdr.hdr.code == HDN_BEGINTRACKW, "Expected Unicode notification code\n"); flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_ENDTRACKW; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); + ok(ret == 0, "got %d\n", ret); parent_header_notify_seq[0].id = HDN_ENDTRACKA; ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq, "header notify, parent", FALSE); @@ -5391,6 +5398,7 @@ flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_TRACKW; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); + ok(ret == 0, "got %d\n", ret); parent_header_notify_seq[0].id = HDN_TRACKA; ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq, "header notify, parent", FALSE); @@ -5398,17 +5406,20 @@ flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_BEGINDRAG; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); + ok(ret == 1, "got %d\n", ret); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "header notify, parent", FALSE); flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_ENDDRAG; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); + ok(ret == 0, "got %d\n", ret); parent_header_notify_seq[0].id = HDN_ENDDRAG; ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq, "header notify, parent", FALSE); flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_FILTERCHANGE; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); + ok(ret == 0, "got %d\n", ret); parent_header_notify_seq[0].id = HDN_FILTERCHANGE; parent_header_notify_seq[0].flags |= optional; /* NT4 does not send this message */ ok_sequence(sequences, PARENT_SEQ_INDEX, parent_header_notify_seq, @@ -5417,21 +5428,25 @@ flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_BEGINFILTEREDIT; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); + ok(ret == 0, "got %d\n", ret); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "header notify, parent", FALSE); flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_ENDFILTEREDIT; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); + ok(ret == 0, "got %d\n", ret); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "header notify, parent", FALSE); flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_ITEMSTATEICONCLICK; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); + ok(ret == 0, "got %d\n", ret); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "header notify, parent", FALSE); flush_sequences(sequences, NUM_MSG_SEQUENCES); nmhdr.hdr.code = HDN_ITEMKEYDOWN; ret = SendMessageW(list, WM_NOTIFY, 0, (LPARAM)&nmhdr); + ok(ret == 0, "got %d\n", ret); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "header notify, parent", FALSE); @@ -5745,6 +5760,76 @@ DestroyWindow(hwnd); } +static void flush_events(void) +{ + MSG msg; + int diff = 200; + int min_timeout = 100; + DWORD time = GetTickCount() + diff; + + while (diff > 0) + { + if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min_timeout, QS_ALLINPUT ) == WAIT_TIMEOUT) break; + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); + diff = time - GetTickCount(); + } +} + +static void test_oneclickactivate(void) +{ + TRACKMOUSEEVENT track; + char item1[] = "item1"; + LVITEMA item; + HWND hwnd, fg; + RECT rect; + INT r; + + hwnd = CreateWindowExA(0, "SysListView32", "foo", WS_VISIBLE|WS_CHILD|LVS_LIST, + 10, 10, 100, 200, hwndparent, NULL, NULL, NULL); + ok(hwnd != NULL, "failed to create listview window\n"); + r = SendMessageA(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_ONECLICKACTIVATE); + ok(r == 0, "should return zero\n"); + + SetForegroundWindow(hwndparent); + flush_events(); + fg = GetForegroundWindow(); + if (fg != hwndparent) + { + skip("Window is not in the foreground. Skipping oneclickactivate tests.\n"); + DestroyWindow(hwnd); + return; + } + + item.mask = LVIF_TEXT; + item.iItem = 0; + item.iSubItem = 0; + item.iImage = 0; + item.pszText = item1; + r = SendMessageA(hwnd, LVM_INSERTITEMA, 0, (LPARAM) &item); + ok(r == 0, "should not fail\n"); + + GetWindowRect(hwnd, &rect); + SetCursorPos(rect.left+5, rect.top+5); + flush_events(); + r = SendMessageA(hwnd, WM_MOUSEMOVE, MAKELONG(1, 1), 0); + expect(0, r); + + track.cbSize = sizeof(track); + track.dwFlags = TME_QUERY; + _TrackMouseEvent(&track); + ok(track.hwndTrack == hwnd, "hwndTrack != hwnd\n"); + ok(track.dwFlags == TME_LEAVE, "dwFlags = %x\n", track.dwFlags); + + r = SendMessageA(hwnd, LVM_GETSELECTEDCOUNT, 0, 0); + expect(0, r); + r = SendMessageA(hwnd, WM_MOUSEHOVER, MAKELONG(1, 1), 0); + expect(0, r); + r = SendMessageA(hwnd, LVM_GETSELECTEDCOUNT, 0, 0); + expect(1, r); + + DestroyWindow(hwnd); +} + START_TEST(listview) { HMODULE hComctl32; @@ -5814,6 +5899,7 @@ test_deleteitem(); test_insertitem(); test_header_proc(); + test_oneclickactivate(); if (!load_v6_module(&ctx_cookie, &hCtx)) { diff -Nru wine1.7-1.7.50/dlls/comctl32/tests/misc.c wine1.7-1.7.55/dlls/comctl32/tests/misc.c --- wine1.7-1.7.50/dlls/comctl32/tests/misc.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/comctl32/tests/misc.c 2015-11-13 14:32:40.000000000 +0000 @@ -20,6 +20,7 @@ #include #include +#include #include "wine/test.h" #include "v6util.h" @@ -36,6 +37,18 @@ static HMODULE hComctl32 = 0; +static char testicon_data[] = +{ + 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x02, 0x00, 0x00, 0x01, 0x00, + 0x20, 0x00, 0x40, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x28, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x12, 0x0b, + 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xde, 0xde, 0xde, 0xff, 0xde, 0xde, 0xde, 0xff, 0xde, 0xde, + 0xde, 0xff, 0xde, 0xde, 0xde, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00 +}; + #define COMCTL32_GET_PROC(ordinal, func) \ p ## func = (void*)GetProcAddress(hComctl32, (LPSTR)ordinal); \ if(!p ## func) { \ @@ -205,6 +218,145 @@ ok(ptr == ptr2, "got wrong pointer for ordinal 345, %p expected %p\n", ptr2, ptr); } +static void test_LoadIconWithScaleDown(void) +{ + static const WCHAR nonexisting_fileW[] = {'n','o','n','e','x','i','s','t','i','n','g','.','i','c','o',0}; + static const WCHAR nonexisting_resourceW[] = {'N','o','n','e','x','i','s','t','i','n','g',0}; + static const WCHAR prefixW[] = {'I','C','O',0}; + HRESULT (WINAPI *pLoadIconMetric)(HINSTANCE, const WCHAR *, int, HICON *); + HRESULT (WINAPI *pLoadIconWithScaleDown)(HINSTANCE, const WCHAR *, int, int, HICON *); + WCHAR tmp_path[MAX_PATH], icon_path[MAX_PATH]; + ICONINFO info; + HMODULE hinst; + HANDLE handle; + DWORD written; + HRESULT hr; + BITMAP bmp; + HICON icon; + void *ptr; + int bytes; + BOOL res; + + hinst = LoadLibraryA("comctl32.dll"); + pLoadIconMetric = (void *)GetProcAddress(hinst, "LoadIconMetric"); + pLoadIconWithScaleDown = (void *)GetProcAddress(hinst, "LoadIconWithScaleDown"); + if (!pLoadIconMetric || !pLoadIconWithScaleDown) + { + win_skip("LoadIconMetric or pLoadIconWithScaleDown not exported by name\n"); + FreeLibrary(hinst); + return; + } + + GetTempPathW(MAX_PATH, tmp_path); + GetTempFileNameW(tmp_path, prefixW, 0, icon_path); + handle = CreateFileW(icon_path, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, NULL); + ok(handle != INVALID_HANDLE_VALUE, "CreateFileW failed with error %u\n", GetLastError()); + res = WriteFile(handle, testicon_data, sizeof(testicon_data), &written, NULL); + ok(res && written == sizeof(testicon_data), "Failed to write icon file\n"); + CloseHandle(handle); + + /* test ordinals */ + ptr = GetProcAddress(hinst, (const char *)380); + ok(ptr == pLoadIconMetric, + "got wrong pointer for ordinal 380, %p expected %p\n", ptr, pLoadIconMetric); + + ptr = GetProcAddress(hinst, (const char *)381); + ok(ptr == pLoadIconWithScaleDown, + "got wrong pointer for ordinal 381, %p expected %p\n", ptr, pLoadIconWithScaleDown); + + /* invalid arguments */ + icon = (HICON)0x1234; + hr = pLoadIconMetric(NULL, (LPWSTR)IDI_APPLICATION, 0x100, &icon); + ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %x\n", hr); + ok(icon == NULL, "Expected NULL, got %p\n", icon); + + icon = (HICON)0x1234; + hr = pLoadIconMetric(NULL, NULL, LIM_LARGE, &icon); + ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %x\n", hr); + ok(icon == NULL, "Expected NULL, got %p\n", icon); + + icon = (HICON)0x1234; + hr = pLoadIconWithScaleDown(NULL, NULL, 32, 32, &icon); + ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %x\n", hr); + ok(icon == NULL, "Expected NULL, got %p\n", icon); + + /* non-existing filename */ + hr = pLoadIconMetric(NULL, nonexisting_fileW, LIM_LARGE, &icon); + todo_wine + ok(hr == HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), + "Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %x\n", hr); + + hr = pLoadIconWithScaleDown(NULL, nonexisting_fileW, 32, 32, &icon); + todo_wine + ok(hr == HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), + "Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %x\n", hr); + + /* non-existing resource name */ + hr = pLoadIconMetric(hinst, nonexisting_resourceW, LIM_LARGE, &icon); + ok(hr == HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), + "Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %x\n", hr); + + hr = pLoadIconWithScaleDown(hinst, nonexisting_resourceW, 32, 32, &icon); + ok(hr == HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), + "Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %x\n", hr); + + /* load icon using predefined identifier */ + hr = pLoadIconMetric(NULL, (LPWSTR)IDI_APPLICATION, LIM_SMALL, &icon); + ok(hr == S_OK, "Expected S_OK, got %x\n", hr); + res = GetIconInfo(icon, &info); + ok(res, "Failed to get icon info, error %u\n", GetLastError()); + bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp); + ok(bytes > 0, "Failed to get bitmap info for icon\n"); + ok(bmp.bmWidth == GetSystemMetrics(SM_CXSMICON), "Wrong icon width %d\n", bmp.bmWidth); + ok(bmp.bmHeight == GetSystemMetrics(SM_CYSMICON), "Wrong icon height %d\n", bmp.bmHeight); + DestroyIcon(icon); + + hr = pLoadIconMetric(NULL, (LPWSTR)IDI_APPLICATION, LIM_LARGE, &icon); + ok(hr == S_OK, "Expected S_OK, got %x\n", hr); + res = GetIconInfo(icon, &info); + ok(res, "Failed to get icon info, error %u\n", GetLastError()); + bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp); + ok(bytes > 0, "Failed to get bitmap info for icon\n"); + ok(bmp.bmWidth == GetSystemMetrics(SM_CXICON), "Wrong icon width %d\n", bmp.bmWidth); + ok(bmp.bmHeight == GetSystemMetrics(SM_CYICON), "Wrong icon height %d\n", bmp.bmHeight); + DestroyIcon(icon); + + hr = pLoadIconWithScaleDown(NULL, (LPWSTR)IDI_APPLICATION, 42, 42, &icon); + ok(hr == S_OK, "Expected S_OK, got %x\n", hr); + res = GetIconInfo(icon, &info); + ok(res, "Failed to get icon info, error %u\n", GetLastError()); + bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp); + ok(bytes > 0, "Failed to get bitmap info for icon\n"); + ok(bmp.bmWidth == 42, "Wrong icon width %d\n", bmp.bmWidth); + ok(bmp.bmHeight == 42, "Wrong icon height %d\n", bmp.bmHeight); + DestroyIcon(icon); + + /* load icon from file */ + hr = pLoadIconMetric(NULL, icon_path, LIM_SMALL, &icon); + ok(hr == S_OK, "Expected S_OK, got %x\n", hr); + res = GetIconInfo(icon, &info); + ok(res, "Failed to get icon info, error %u\n", GetLastError()); + bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp); + ok(bytes > 0, "Failed to get bitmap info for icon\n"); + ok(bmp.bmWidth == GetSystemMetrics(SM_CXSMICON), "Wrong icon width %d\n", bmp.bmWidth); + ok(bmp.bmHeight == GetSystemMetrics(SM_CYSMICON), "Wrong icon height %d\n", bmp.bmHeight); + DestroyIcon(icon); + + hr = pLoadIconWithScaleDown(NULL, icon_path, 42, 42, &icon); + ok(hr == S_OK, "Expected S_OK, got %x\n", hr); + res = GetIconInfo(icon, &info); + ok(res, "Failed to get icon info, error %u\n", GetLastError()); + bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp); + ok(bytes > 0, "Failed to get bitmap info for icon\n"); + ok(bmp.bmWidth == 42, "Wrong icon width %d\n", bmp.bmWidth); + ok(bmp.bmHeight == 42, "Wrong icon height %d\n", bmp.bmHeight); + DestroyIcon(icon); + + DeleteFileW(icon_path); + FreeLibrary(hinst); +} + START_TEST(misc) { ULONG_PTR ctx_cookie; @@ -220,6 +372,7 @@ return; test_TaskDialogIndirect(); + test_LoadIconWithScaleDown(); unload_v6_module(ctx_cookie, hCtx); } diff -Nru wine1.7-1.7.50/dlls/comctl32/tests/propsheet.c wine1.7-1.7.55/dlls/comctl32/tests/propsheet.c --- wine1.7-1.7.50/dlls/comctl32/tests/propsheet.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/comctl32/tests/propsheet.c 2015-11-13 14:32:40.000000000 +0000 @@ -300,7 +300,7 @@ CBT_CREATEWNDW *c = (CBT_CREATEWNDW *)lp; /* The first dialog created will be the parent dialog */ - if (!done && c->lpcs->lpszClass == MAKEINTRESOURCEW(WC_DIALOG)) + if (!done && c->lpcs->lpszClass == (LPWSTR)WC_DIALOG) { old_nav_dialog_proc = (WNDPROC)SetWindowLongPtrW( (HWND)wp, GWLP_WNDPROC, (LONG_PTR)new_nav_dialog_proc ); done = TRUE; diff -Nru wine1.7-1.7.50/dlls/comctl32/tests/status.c wine1.7-1.7.55/dlls/comctl32/tests/status.c --- wine1.7-1.7.50/dlls/comctl32/tests/status.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/comctl32/tests/status.c 2015-11-13 14:32:40.000000000 +0000 @@ -344,6 +344,7 @@ r = SendMessageA(hWndStatus, SB_SETTEXTA, 0, (LPARAM)chstr); expect(TRUE,r); r = SendMessageA(hWndStatus, SB_GETTEXTA, 0, (LPARAM)charArray); + ok(r == strlen(charArray), "got %d\n", r); /* substitution with single space */ if (ch > 0x00 && ch < 0x20 && ch != '\t') chstr[5] = ' '; diff -Nru wine1.7-1.7.50/dlls/comctl32/tests/toolbar.c wine1.7-1.7.55/dlls/comctl32/tests/toolbar.c --- wine1.7-1.7.50/dlls/comctl32/tests/toolbar.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/comctl32/tests/toolbar.c 2015-11-13 14:32:40.000000000 +0000 @@ -1536,7 +1536,6 @@ /* Single non-BTNS_AUTOSIZE button with string with TBSTYLE_EX_MIXEDBUTTONS set. */ rebuild_toolbar(&hToolbar); SendMessageA(hToolbar, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS); - style = SendMessageA(hToolbar, TB_GETSTYLE, 0, 0); ok(SendMessageA(hToolbar, TB_ADDBUTTONSA, 1, (LPARAM)&buttons4[1]) == 1, "TB_ADDBUTTONSA failed\n"); ok(SendMessageA(hToolbar, TB_SETBUTTONSIZE, 0, MAKELPARAM(40, 20)) == 1, "TB_SETBUTTONSIZE failed\n"); SendMessageA(hToolbar, TB_AUTOSIZE, 0, 0 ); @@ -1545,7 +1544,6 @@ /* Single non-BTNS_AUTOSIZE, BTNS_SHOWTEXT button with string with TBSTYLE_EX_MIXEDBUTTONS set. */ rebuild_toolbar(&hToolbar); SendMessageA(hToolbar, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS); - style = SendMessageA(hToolbar, TB_GETSTYLE, 0, 0); ok(SendMessageA(hToolbar, TB_ADDBUTTONSA, 1, (LPARAM)&buttons4[2]) == 1, "TB_ADDBUTTONSA failed\n"); ok(SendMessageA(hToolbar, TB_SETBUTTONSIZE, 0, MAKELPARAM(40, 20)) == 1, "TB_SETBUTTONSIZE failed\n"); SendMessageA(hToolbar, TB_AUTOSIZE, 0, 0 ); diff -Nru wine1.7-1.7.50/dlls/comctl32/tests/treeview.c wine1.7-1.7.55/dlls/comctl32/tests/treeview.c --- wine1.7-1.7.50/dlls/comctl32/tests/treeview.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/comctl32/tests/treeview.c 2015-11-13 14:32:40.000000000 +0000 @@ -905,6 +905,13 @@ expect(TRUE, ret); ok(tviRoot.state == TVIS_FOCUSED, "got state 0x%0x\n", tviRoot.state); + /* invalid item pointer, nt4 crashes here but later versions just return 0 */ + tviRoot.hItem = (HTREEITEM)0xdeadbeef; + tviRoot.mask = TVIF_STATE; + tviRoot.state = 0; + ret = SendMessageA(hTree2, TVM_GETITEMA, 0, (LPARAM)&tviRoot); + expect(FALSE, ret); + DestroyWindow(hTree); DestroyWindow(hTree2); } diff -Nru wine1.7-1.7.50/dlls/comctl32/theme_button.c wine1.7-1.7.55/dlls/comctl32/theme_button.c --- wine1.7-1.7.50/dlls/comctl32/theme_button.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/comctl32/theme_button.c 2015-11-13 14:32:40.000000000 +0000 @@ -319,9 +319,6 @@ ButtonState drawState; pfThemedPaint paint = btnThemedPaintFunc[ dwStyle & BUTTON_TYPE ]; - if(!paint) - return FALSE; - if(IsWindowEnabled(hwnd)) { if(state & BST_PUSHED) drawState = STATE_PRESSED; @@ -332,7 +329,7 @@ else drawState = STATE_DISABLED; hDC = hParamDC ? hParamDC : BeginPaint(hwnd, &ps); - paint(theme, hwnd, hDC, drawState, dtFlags, state & BST_FOCUS); + if (paint) paint(theme, hwnd, hDC, drawState, dtFlags, state & BST_FOCUS); if (!hParamDC) EndPaint(hwnd, &ps); return TRUE; } diff -Nru wine1.7-1.7.50/dlls/comctl32/toolbar.c wine1.7-1.7.55/dlls/comctl32/toolbar.c --- wine1.7-1.7.50/dlls/comctl32/toolbar.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/comctl32/toolbar.c 2015-11-13 14:32:40.000000000 +0000 @@ -3152,7 +3152,7 @@ bChecked = (btnPtr->fsState & TBSTATE_CHECKED) != 0; - if (LOWORD(lParam) == FALSE) + if (!LOWORD(lParam)) btnPtr->fsState &= ~TBSTATE_CHECKED; else { if (btnPtr->fsStyle & BTNS_GROUP) { @@ -3284,7 +3284,7 @@ bState = btnPtr->fsState & TBSTATE_ENABLED; /* update the toolbar button state */ - if(LOWORD(lParam) == FALSE) { + if(!LOWORD(lParam)) { btnPtr->fsState &= ~(TBSTATE_ENABLED | TBSTATE_PRESSED); } else { btnPtr->fsState |= TBSTATE_ENABLED; @@ -5155,16 +5155,13 @@ return ret; } -/* UNDOCUMENTED MESSAGE: This appears to set some kind of size. Perhaps it - * is the maximum size of the toolbar? */ -static LRESULT TOOLBAR_Unkwn45D(HWND hwnd, WPARAM wParam, LPARAM lParam) +static LRESULT TOOLBAR_SetBoundingSize(HWND hwnd, WPARAM wParam, LPARAM lParam) { SIZE * pSize = (SIZE*)lParam; FIXME("hwnd=%p, wParam=0x%08lx, size.cx=%d, size.cy=%d stub!\n", hwnd, wParam, pSize->cx, pSize->cy); return 0; } - /* This is an extended version of the TB_SETHOTITEM message. It allows the * caller to specify a reason why the hot item changed (rather than just the * HICF_OTHER that TB_SETHOTITEM sends). */ @@ -5536,95 +5533,92 @@ nHit = TOOLBAR_InternalHitTest (infoPtr, &pt, &button); if (button) + { btnPtr = &infoPtr->buttons[nHit]; - if (button && bDragKeyPressed && (infoPtr->dwStyle & CCS_ADJUSTABLE)) - { - infoPtr->nButtonDrag = nHit; - SetCapture (infoPtr->hwndSelf); - - /* If drag cursor has not been loaded, load it. - * Note: it doesn't need to be freed */ - if (!hCursorDrag) - hCursorDrag = LoadCursorW(COMCTL32_hModule, (LPCWSTR)IDC_MOVEBUTTON); - SetCursor(hCursorDrag); - } - else if (button) - { - RECT arrowRect; - infoPtr->nOldHit = nHit; - - CopyRect(&arrowRect, &btnPtr->rect); - arrowRect.left = max(btnPtr->rect.left, btnPtr->rect.right - DDARROW_WIDTH); - - /* for EX_DRAWDDARROWS style, click must be in the drop-down arrow rect */ - if ((btnPtr->fsState & TBSTATE_ENABLED) && - ((btnPtr->fsStyle & BTNS_WHOLEDROPDOWN) || - ((btnPtr->fsStyle & BTNS_DROPDOWN) && - ((TOOLBAR_HasDropDownArrows(infoPtr->dwExStyle) && PtInRect(&arrowRect, pt)) || - (!TOOLBAR_HasDropDownArrows(infoPtr->dwExStyle)))))) - { - LRESULT res; + if (bDragKeyPressed && (infoPtr->dwStyle & CCS_ADJUSTABLE)) + { + infoPtr->nButtonDrag = nHit; + SetCapture (infoPtr->hwndSelf); - /* draw in pressed state */ - if (btnPtr->fsStyle & BTNS_WHOLEDROPDOWN) - btnPtr->fsState |= TBSTATE_PRESSED; - else - btnPtr->bDropDownPressed = TRUE; - RedrawWindow(infoPtr->hwndSelf,&btnPtr->rect,0, - RDW_ERASE|RDW_INVALIDATE|RDW_UPDATENOW); - - memset(&nmtb, 0, sizeof(nmtb)); - nmtb.iItem = btnPtr->idCommand; - nmtb.rcButton = btnPtr->rect; - res = TOOLBAR_SendNotify ((NMHDR *) &nmtb, infoPtr, - TBN_DROPDOWN); - TRACE("TBN_DROPDOWN responded with %ld\n", res); + /* If drag cursor has not been loaded, load it. + * Note: it doesn't need to be freed */ + if (!hCursorDrag) + hCursorDrag = LoadCursorW(COMCTL32_hModule, (LPCWSTR)IDC_MOVEBUTTON); + SetCursor(hCursorDrag); + } + else + { + RECT arrowRect; + infoPtr->nOldHit = nHit; - if (res != TBDDRET_TREATPRESSED) + CopyRect(&arrowRect, &btnPtr->rect); + arrowRect.left = max(btnPtr->rect.left, btnPtr->rect.right - DDARROW_WIDTH); + + /* for EX_DRAWDDARROWS style, click must be in the drop-down arrow rect */ + if ((btnPtr->fsState & TBSTATE_ENABLED) && + ((btnPtr->fsStyle & BTNS_WHOLEDROPDOWN) || + ((btnPtr->fsStyle & BTNS_DROPDOWN) && + ((TOOLBAR_HasDropDownArrows(infoPtr->dwExStyle) && PtInRect(&arrowRect, pt)) || + (!TOOLBAR_HasDropDownArrows(infoPtr->dwExStyle)))))) { - MSG msg; + LRESULT res; - /* redraw button in unpressed state */ - if (btnPtr->fsStyle & BTNS_WHOLEDROPDOWN) - btnPtr->fsState &= ~TBSTATE_PRESSED; - else - btnPtr->bDropDownPressed = FALSE; - InvalidateRect(infoPtr->hwndSelf, &btnPtr->rect, TRUE); + /* draw in pressed state */ + if (btnPtr->fsStyle & BTNS_WHOLEDROPDOWN) + btnPtr->fsState |= TBSTATE_PRESSED; + else + btnPtr->bDropDownPressed = TRUE; + RedrawWindow(infoPtr->hwndSelf, &btnPtr->rect, 0, RDW_ERASE|RDW_INVALIDATE|RDW_UPDATENOW); - /* find and set hot item */ - GetCursorPos(&pt); - ScreenToClient(infoPtr->hwndSelf, &pt); - nHit = TOOLBAR_InternalHitTest(infoPtr, &pt, &button); - if (!infoPtr->bAnchor || button) - TOOLBAR_SetHotItemEx(infoPtr, button ? nHit : TOOLBAR_NOWHERE, HICF_MOUSE | HICF_LMOUSE); - - /* remove any left mouse button down or double-click messages - * so that we can get a toggle effect on the button */ - while (PeekMessageW(&msg, infoPtr->hwndSelf, WM_LBUTTONDOWN, WM_LBUTTONDOWN, PM_REMOVE) || - PeekMessageW(&msg, infoPtr->hwndSelf, WM_LBUTTONDBLCLK, WM_LBUTTONDBLCLK, PM_REMOVE)) - ; + memset(&nmtb, 0, sizeof(nmtb)); + nmtb.iItem = btnPtr->idCommand; + nmtb.rcButton = btnPtr->rect; + res = TOOLBAR_SendNotify ((NMHDR *) &nmtb, infoPtr, TBN_DROPDOWN); + TRACE("TBN_DROPDOWN responded with %ld\n", res); - return 0; + if (res != TBDDRET_TREATPRESSED) + { + MSG msg; + + /* redraw button in unpressed state */ + if (btnPtr->fsStyle & BTNS_WHOLEDROPDOWN) + btnPtr->fsState &= ~TBSTATE_PRESSED; + else + btnPtr->bDropDownPressed = FALSE; + InvalidateRect(infoPtr->hwndSelf, &btnPtr->rect, TRUE); + + /* find and set hot item */ + GetCursorPos(&pt); + ScreenToClient(infoPtr->hwndSelf, &pt); + nHit = TOOLBAR_InternalHitTest(infoPtr, &pt, &button); + if (!infoPtr->bAnchor || button) + TOOLBAR_SetHotItemEx(infoPtr, nHit, HICF_MOUSE | HICF_LMOUSE); + + /* remove any left mouse button down or double-click messages + * so that we can get a toggle effect on the button */ + while (PeekMessageW(&msg, infoPtr->hwndSelf, WM_LBUTTONDOWN, WM_LBUTTONDOWN, PM_REMOVE) || + PeekMessageW(&msg, infoPtr->hwndSelf, WM_LBUTTONDBLCLK, WM_LBUTTONDBLCLK, PM_REMOVE)) + ; + + return 0; + } + /* otherwise drop through and process as pushed */ } - /* otherwise drop through and process as pushed */ - } - infoPtr->bCaptured = TRUE; - infoPtr->nButtonDown = nHit; - infoPtr->bDragOutSent = FALSE; + infoPtr->bCaptured = TRUE; + infoPtr->nButtonDown = nHit; + infoPtr->bDragOutSent = FALSE; - btnPtr->fsState |= TBSTATE_PRESSED; + btnPtr->fsState |= TBSTATE_PRESSED; - TOOLBAR_SetHotItemEx(infoPtr, button ? nHit : TOOLBAR_NOWHERE, HICF_MOUSE | HICF_LMOUSE); + TOOLBAR_SetHotItemEx(infoPtr, nHit, HICF_MOUSE | HICF_LMOUSE); - if (btnPtr->fsState & TBSTATE_ENABLED) - InvalidateRect(infoPtr->hwndSelf, &btnPtr->rect, TRUE); - UpdateWindow(infoPtr->hwndSelf); - SetCapture (infoPtr->hwndSelf); - } + if (btnPtr->fsState & TBSTATE_ENABLED) + InvalidateRect(infoPtr->hwndSelf, &btnPtr->rect, TRUE); + UpdateWindow(infoPtr->hwndSelf); + SetCapture (infoPtr->hwndSelf); + } - if (button) - { memset(&nmtb, 0, sizeof(nmtb)); nmtb.iItem = btnPtr->idCommand; TOOLBAR_SendNotify((NMHDR *)&nmtb, infoPtr, TBN_BEGINDRAG); @@ -6737,8 +6731,8 @@ case TB_SETUNICODEFORMAT: return TOOLBAR_SetUnicodeFormat (infoPtr, wParam); - case TB_UNKWN45D: - return TOOLBAR_Unkwn45D(hwnd, wParam, lParam); + case TB_SETBOUNDINGSIZE: + return TOOLBAR_SetBoundingSize(hwnd, wParam, lParam); case TB_SETHOTITEM2: return TOOLBAR_SetHotItem2 (infoPtr, wParam, lParam); diff -Nru wine1.7-1.7.50/dlls/comctl32/treeview.c wine1.7-1.7.55/dlls/comctl32/treeview.c --- wine1.7-1.7.50/dlls/comctl32/treeview.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/comctl32/treeview.c 2015-11-13 14:32:40.000000000 +0000 @@ -63,6 +63,7 @@ #include "vssym32.h" #include "wine/unicode.h" #include "wine/debug.h" +#include "wine/exception.h" WINE_DEFAULT_DEBUG_CHANNEL(treeview); @@ -2068,11 +2069,20 @@ if (!TREEVIEW_ValidItem(infoPtr, item)) { + BOOL valid_item = FALSE; if (!item) return FALSE; - TRACE("got item from different tree %p, called from %p\n", item->infoPtr, infoPtr); - infoPtr = item->infoPtr; - if (!TREEVIEW_ValidItem(infoPtr, item)) return FALSE; + __TRY + { + infoPtr = item->infoPtr; + TRACE("got item from different tree %p, called from %p\n", item->infoPtr, infoPtr); + valid_item = TREEVIEW_ValidItem(infoPtr, item); + } + __EXCEPT_PAGE_FAULT + { + } + __ENDTRY + if (!valid_item) return FALSE; } TREEVIEW_UpdateDispInfo(infoPtr, item, tvItem->mask); diff -Nru wine1.7-1.7.50/dlls/comdlg32/comdlg32.rc wine1.7-1.7.55/dlls/comdlg32/comdlg32.rc --- wine1.7-1.7.50/dlls/comdlg32/comdlg32.rc 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/comdlg32/comdlg32.rc 2015-11-13 14:32:40.000000000 +0000 @@ -483,16 +483,21 @@ CAPTION "Open" FONT 8, "MS Shell Dlg" { - LTEXT "File name:", IDC_FILENAMESTATIC, 160, 240, 60, 9, SS_RIGHT - EDITTEXT IDC_FILENAME, 226, 240, 100, 12, WS_CHILD | WS_VISIBLE | WS_TABSTOP + LTEXT "File name:", IDC_FILENAMESTATIC, 160, 240, 60, 9, SS_RIGHT | WS_CLIPSIBLINGS + EDITTEXT IDC_FILENAME, 226, 240, 100, 12, WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_CLIPSIBLINGS | ES_AUTOHSCROLL - LTEXT "Files of type:", IDC_FILETYPESTATIC, 160, 256, 60, 9, SS_RIGHT + LTEXT "Files of type:", IDC_FILETYPESTATIC, 160, 256, 60, 9, SS_RIGHT | WS_CLIPSIBLINGS COMBOBOX IDC_FILETYPE, 226, 256, 100, 12, WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL | - CBS_HASSTRINGS | CBS_DROPDOWNLIST + WS_CLIPSIBLINGS | CBS_HASSTRINGS | CBS_DROPDOWNLIST - DEFPUSHBUTTON "&Open", IDOK, 350, 240, 40, 14, WS_GROUP - PUSHBUTTON "Cancel", IDCANCEL, 395, 240, 40, 14 - PUSHBUTTON "&Help", pshHelp, 350, 272, 40, 14 + DEFPUSHBUTTON "&Open", IDOK, 350, 240, 32, 14, WS_GROUP | WS_CLIPSIBLINGS + + /* drop-down menu for open button */ + CONTROL "#msgctxt#do not translate#6", psh1, "Button", WS_CHILD | WS_CLIPSIBLINGS | WS_GROUP | WS_TABSTOP | + BS_CHECKBOX | BS_PUSHLIKE, 342, 240, 8, 14 + + PUSHBUTTON "Cancel", IDCANCEL, 395, 240, 40, 14, WS_CLIPSIBLINGS + PUSHBUTTON "&Help", pshHelp, 350, 272, 40, 14, WS_CLIPSIBLINGS } LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL diff -Nru wine1.7-1.7.50/dlls/comdlg32/itemdlg.c wine1.7-1.7.55/dlls/comdlg32/itemdlg.c --- wine1.7-1.7.50/dlls/comdlg32/itemdlg.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/comdlg32/itemdlg.c 2015-11-13 14:32:40.000000000 +0000 @@ -50,6 +50,7 @@ static const WCHAR notifysink_childW[] = {'n','f','s','_','c','h','i','l','d',0}; static const WCHAR floatnotifysinkW[] = {'F','l','o','a','t','N','o','t','i','f','y','S','i','n','k',0}; +static const WCHAR radiobuttonlistW[] = {'R','a','d','i','o','B','u','t','t','o','n','L','i','s','t',0}; enum ITEMDLG_TYPE { ITEMDLG_TYPE_OPEN, @@ -73,6 +74,7 @@ DWORD id, parent_id; LPWSTR label; CDCONTROLSTATEF cdcstate; + HWND hwnd; struct list entry; } cctrl_item; @@ -142,6 +144,9 @@ HMENU hmenu_opendropdown; customctrl cctrl_opendropdown; + HFONT hfont_opendropdown; + BOOL opendropdown_has_selection; + DWORD opendropdown_selection; GUID client_guid; } FileDialogImpl; @@ -293,7 +298,7 @@ static HRESULT cctrl_event_OnItemSelected(FileDialogImpl *This, DWORD ctl_id, DWORD item_id) { events_client *cursor; - TRACE("%p\n", This); + TRACE("%p %i %i\n", This, ctl_id, item_id); LIST_FOR_EACH_ENTRY(cursor, &This->events_clients, events_client, entry) { @@ -703,12 +708,42 @@ return ret; } +static void show_opendropdown(FileDialogImpl *This) +{ + HWND open_hwnd; + RECT open_rc; + MSG msg; + + open_hwnd = GetDlgItem(This->dlg_hwnd, IDOK); + + GetWindowRect(open_hwnd, &open_rc); + + if (TrackPopupMenu(This->hmenu_opendropdown, 0, open_rc.left, open_rc.bottom, 0, This->dlg_hwnd, NULL) && + PeekMessageW(&msg, This->dlg_hwnd, WM_MENUCOMMAND, WM_MENUCOMMAND, PM_REMOVE)) + { + MENUITEMINFOW mii; + + This->opendropdown_has_selection = TRUE; + + mii.cbSize = sizeof(mii); + mii.fMask = MIIM_ID; + GetMenuItemInfoW((HMENU)msg.lParam, msg.wParam, TRUE, &mii); + This->opendropdown_selection = mii.wID; + + if(SUCCEEDED(on_default_action(This))) + EndDialog(This->dlg_hwnd, S_OK); + else + This->opendropdown_has_selection = FALSE; + } +} + /************************************************************************** * Control item functions. */ static void item_free(cctrl_item *item) { + DestroyWindow(item->hwnd); HeapFree(GetProcessHeap(), 0, item->label); HeapFree(GetProcessHeap(), 0, item); } @@ -734,6 +769,19 @@ return NULL; } +static cctrl_item* get_first_item(customctrl* parent) +{ + cctrl_item* item; + + LIST_FOR_EACH_ENTRY(item, &parent->sub_items, cctrl_item, entry) + { + if ((item->cdcstate & (CDCS_VISIBLE|CDCS_ENABLED)) == (CDCS_VISIBLE|CDCS_ENABLED)) + return item; + } + + return NULL; +} + static HRESULT add_item(customctrl* parent, DWORD itemid, LPCWSTR label, cctrl_item** result) { cctrl_item* item; @@ -757,8 +805,11 @@ lstrcpyW(label_copy, label); item->label = label_copy; item->cdcstate = CDCS_VISIBLE|CDCS_ENABLED; + item->hwnd = NULL; list_add_tail(&parent->sub_items, &item->entry); + *result = item; + return S_OK; } @@ -885,6 +936,7 @@ { RECT rc; UINT total_height; + UINT max_width; customctrl *sub_ctrl; switch(ctrl->type) @@ -927,6 +979,32 @@ SWP_NOZORDER|SWP_NOMOVE); break; case IDLG_CCTRL_RADIOBUTTONLIST: + { + cctrl_item* item; + + total_height = 0; + max_width = 0; + + LIST_FOR_EACH_ENTRY(item, &ctrl->sub_items, cctrl_item, entry) + { + ctrl_resize(item->hwnd, 160, 160, TRUE); + SetWindowPos(item->hwnd, NULL, 0, total_height, 0, 0, + SWP_NOZORDER|SWP_NOSIZE); + + GetWindowRect(item->hwnd, &rc); + + total_height += rc.bottom - rc.top; + max_width = max(rc.right - rc.left, max_width); + } + + SetWindowPos(ctrl->hwnd, NULL, 0, 0, max_width, total_height, + SWP_NOZORDER|SWP_NOMOVE); + + SetWindowPos(ctrl->wrapper_hwnd, NULL, 0, 0, max_width, total_height, + SWP_NOZORDER|SWP_NOMOVE); + + break; + } case IDLG_CCTRL_EDITBOX: case IDLG_CCTRL_SEPARATOR: case IDLG_CCTRL_MENU: @@ -1270,6 +1348,15 @@ if(font) SendMessageW(sub_ctrl->hwnd, WM_SETFONT, (WPARAM)font, TRUE); } + if (ctrl->type == IDLG_CCTRL_RADIOBUTTONLIST) + { + cctrl_item* item; + LIST_FOR_EACH_ENTRY(item, &ctrl->sub_items, cctrl_item, entry) + { + if (font) SendMessageW(item->hwnd, WM_SETFONT, (WPARAM)font, TRUE); + } + } + customctrl_resize(This, ctrl); } } @@ -1323,6 +1410,75 @@ return FALSE; } +static void radiobuttonlist_set_selected_item(FileDialogImpl *This, customctrl *ctrl, cctrl_item *item) +{ + cctrl_item *cursor; + + LIST_FOR_EACH_ENTRY(cursor, &ctrl->sub_items, cctrl_item, entry) + { + SendMessageW(cursor->hwnd, BM_SETCHECK, (cursor == item) ? BST_CHECKED : BST_UNCHECKED, 0); + } +} + +static LRESULT radiobuttonlist_on_bn_clicked(FileDialogImpl *This, HWND hwnd, HWND child) +{ + DWORD ctrl_id = (DWORD)GetWindowLongPtrW(hwnd, GWLP_ID); + customctrl *ctrl; + cctrl_item *item; + BOOL found_item=FALSE; + + ctrl = get_cctrl_from_dlgid(This, ctrl_id); + + if (!ctrl) + { + ERR("Can't find this control\n"); + return 0; + } + + LIST_FOR_EACH_ENTRY(item, &ctrl->sub_items, cctrl_item, entry) + { + if (item->hwnd == child) + { + found_item = TRUE; + break; + } + } + + if (!found_item) + { + ERR("Can't find control item\n"); + return 0; + } + + radiobuttonlist_set_selected_item(This, ctrl, item); + + cctrl_event_OnItemSelected(This, ctrl->id, item->id); + + return 0; +} + +static LRESULT radiobuttonlist_on_wm_command(FileDialogImpl *This, HWND hwnd, WPARAM wparam, LPARAM lparam) +{ + switch(HIWORD(wparam)) + { + case BN_CLICKED: return radiobuttonlist_on_bn_clicked(This, hwnd, (HWND)lparam); + } + + return FALSE; +} + +static LRESULT CALLBACK radiobuttonlist_proc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) +{ + FileDialogImpl *This = (FileDialogImpl*)GetWindowLongPtrW(hwnd, GWLP_USERDATA); + + switch(message) + { + case WM_COMMAND: return radiobuttonlist_on_wm_command(This, hwnd, wparam, lparam); + } + + return DefWindowProcW(hwnd, message, wparam, lparam); +} + static HRESULT init_custom_controls(FileDialogImpl *This) { WNDCLASSW wc; @@ -1384,22 +1540,99 @@ ERR("Failed to register FloatNotifySink window class.\n"); } + if( !GetClassInfoW(COMDLG32_hInstance, radiobuttonlistW, &wc) || + wc.hInstance != COMDLG32_hInstance) + { + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.lpfnWndProc = radiobuttonlist_proc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = COMDLG32_hInstance; + wc.hIcon = 0; + wc.hCursor = LoadCursorW(0, (LPWSTR)IDC_ARROW); + wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); + wc.lpszMenuName = NULL; + wc.lpszClassName = radiobuttonlistW; + + if (!RegisterClassW(&wc)) + ERR("Failed to register RadioButtonList window class.\n"); + } + return S_OK; } /************************************************************************** * Window related functions. */ +static BOOL update_open_dropdown(FileDialogImpl *This) +{ + /* Show or hide the open dropdown button as appropriate */ + BOOL show=FALSE, showing; + HWND open_hwnd, dropdown_hwnd; + + if (This->hmenu_opendropdown) + { + INT num_visible_items=0; + cctrl_item* item; + + LIST_FOR_EACH_ENTRY(item, &This->cctrl_opendropdown.sub_items, cctrl_item, entry) + { + if (item->cdcstate & CDCS_VISIBLE) + { + num_visible_items++; + if (num_visible_items >= 2) + { + show = TRUE; + break; + } + } + } + } + + open_hwnd = GetDlgItem(This->dlg_hwnd, IDOK); + dropdown_hwnd = GetDlgItem(This->dlg_hwnd, psh1); + + showing = (GetWindowLongPtrW(dropdown_hwnd, GWL_STYLE) & WS_VISIBLE) != 0; + + if (showing != show) + { + RECT open_rc, dropdown_rc; + + GetWindowRect(open_hwnd, &open_rc); + GetWindowRect(dropdown_hwnd, &dropdown_rc); + + if (show) + { + ShowWindow(dropdown_hwnd, SW_SHOW); + + SetWindowPos(open_hwnd, NULL, 0, 0, + (open_rc.right - open_rc.left) - (dropdown_rc.right - dropdown_rc.left), + open_rc.bottom - open_rc.top, SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); + } + else + { + ShowWindow(dropdown_hwnd, SW_HIDE); + + SetWindowPos(open_hwnd, NULL, 0, 0, + (open_rc.right - open_rc.left) + (dropdown_rc.right - dropdown_rc.left), + open_rc.bottom - open_rc.top, SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE); + } + } + + return show; +} + static void update_layout(FileDialogImpl *This) { HDWP hdwp; HWND hwnd; RECT dialog_rc; - RECT cancel_rc, open_rc; + RECT cancel_rc, dropdown_rc, open_rc; RECT filetype_rc, filename_rc, filenamelabel_rc; RECT toolbar_rc, ebrowser_rc, customctrls_rc; static const UINT vspacing = 4, hspacing = 4; static const UINT min_width = 320, min_height = 200; + BOOL show_dropdown; if (!GetClientRect(This->dlg_hwnd, &dialog_rc)) { @@ -1432,6 +1665,30 @@ cancel_rc.bottom = cancel_rc.top + cancel_height; } + /* Open/Save dropdown */ + show_dropdown = update_open_dropdown(This); + + if(show_dropdown) + { + int dropdown_width, dropdown_height; + hwnd = GetDlgItem(This->dlg_hwnd, psh1); + + GetWindowRect(hwnd, &dropdown_rc); + dropdown_width = dropdown_rc.right - dropdown_rc.left; + dropdown_height = dropdown_rc.bottom - dropdown_rc.top; + + dropdown_rc.left = cancel_rc.left - dropdown_width - hspacing; + dropdown_rc.top = cancel_rc.top; + dropdown_rc.right = dropdown_rc.left + dropdown_width; + dropdown_rc.bottom = dropdown_rc.top + dropdown_height; + } + else + { + dropdown_rc.left = dropdown_rc.right = cancel_rc.left - hspacing; + dropdown_rc.top = cancel_rc.top; + dropdown_rc.bottom = cancel_rc.bottom; + } + /* Open/Save button */ hwnd = GetDlgItem(This->dlg_hwnd, IDOK); if(hwnd) @@ -1441,8 +1698,8 @@ open_width = open_rc.right - open_rc.left; open_height = open_rc.bottom - open_rc.top; - open_rc.left = cancel_rc.left - open_width - hspacing; - open_rc.top = cancel_rc.top; + open_rc.left = dropdown_rc.left - open_width; + open_rc.top = dropdown_rc.top; open_rc.right = open_rc.left + open_width; open_rc.bottom = open_rc.top + open_height; } @@ -1553,6 +1810,10 @@ DeferWindowPos(hdwp, hwnd, NULL, open_rc.left, open_rc.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE); + if(hdwp && This->hmenu_opendropdown && (hwnd = GetDlgItem(This->dlg_hwnd, psh1))) + DeferWindowPos(hdwp, hwnd, NULL, dropdown_rc.left, dropdown_rc.top, 0, 0, + SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE); + if(hdwp && (hwnd = GetDlgItem(This->dlg_hwnd, IDCANCEL)) ) DeferWindowPos(hdwp, hwnd, NULL, cancel_rc.left, cancel_rc.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE); @@ -1657,13 +1918,21 @@ static void update_control_text(FileDialogImpl *This) { HWND hitem; + LPCWSTR custom_okbutton; + cctrl_item* item; + if(This->custom_title) SetWindowTextW(This->dlg_hwnd, This->custom_title); - if(This->custom_okbutton && + if(This->hmenu_opendropdown && (item = get_first_item(&This->cctrl_opendropdown))) + custom_okbutton = item->label; + else + custom_okbutton = This->custom_okbutton; + + if(custom_okbutton && (hitem = GetDlgItem(This->dlg_hwnd, IDOK))) { - SetWindowTextW(hitem, This->custom_okbutton); + SetWindowTextW(hitem, custom_okbutton); ctrl_resize(hitem, 50, 250, FALSE); } @@ -1682,6 +1951,25 @@ } } +static LRESULT CALLBACK dropdown_subclass_proc(HWND hwnd, UINT umessage, WPARAM wparam, LPARAM lparam) +{ + static const WCHAR prop_this[] = {'i','t','e','m','d','l','g','_','T','h','i','s',0}; + static const WCHAR prop_oldwndproc[] = {'i','t','e','m','d','l','g','_','o','l','d','w','n','d','p','r','o','c',0}; + + if (umessage == WM_LBUTTONDOWN) + { + FileDialogImpl *This = (FileDialogImpl*)GetPropW(hwnd, prop_this); + + SendMessageW(hwnd, BM_SETCHECK, BST_CHECKED, 0); + show_opendropdown(This); + SendMessageW(hwnd, BM_SETCHECK, BST_UNCHECKED, 0); + + return 0; + } + + return CallWindowProcW((WNDPROC)GetPropW(hwnd, prop_oldwndproc), hwnd, umessage, wparam, lparam); +} + static LRESULT on_wm_initdialog(HWND hwnd, LPARAM lParam) { FileDialogImpl *This = (FileDialogImpl*)lParam; @@ -1737,6 +2025,37 @@ (hitem = GetDlgItem(This->dlg_hwnd, IDC_FILENAME)) ) SendMessageW(hitem, WM_SETTEXT, 0, (LPARAM)This->set_filename); + if(This->hmenu_opendropdown) + { + HWND dropdown_hwnd; + LOGFONTW lfw, lfw_marlett; + HFONT dialog_font; + static const WCHAR marlett[] = {'M','a','r','l','e','t','t',0}; + static const WCHAR prop_this[] = {'i','t','e','m','d','l','g','_','T','h','i','s',0}; + static const WCHAR prop_oldwndproc[] = {'i','t','e','m','d','l','g','_','o','l','d','w','n','d','p','r','o','c',0}; + + dropdown_hwnd = GetDlgItem(This->dlg_hwnd, psh1); + + /* Change dropdown button font to Marlett */ + dialog_font = (HFONT)SendMessageW(dropdown_hwnd, WM_GETFONT, 0, 0); + + GetObjectW(dialog_font, sizeof(lfw), &lfw); + + memset(&lfw_marlett, 0, sizeof(lfw_marlett)); + lstrcpyW(lfw_marlett.lfFaceName, marlett); + lfw_marlett.lfHeight = lfw.lfHeight; + lfw_marlett.lfCharSet = SYMBOL_CHARSET; + + This->hfont_opendropdown = CreateFontIndirectW(&lfw_marlett); + + SendMessageW(dropdown_hwnd, WM_SETFONT, (LPARAM)This->hfont_opendropdown, 0); + + /* Subclass button so we can handle LBUTTONDOWN */ + SetPropW(dropdown_hwnd, prop_this, (HANDLE)This); + SetPropW(dropdown_hwnd, prop_oldwndproc, + (HANDLE)SetWindowLongPtrW(dropdown_hwnd, GWLP_WNDPROC, (LONG_PTR)dropdown_subclass_proc)); + } + ctrl_container_reparent(This, This->dlg_hwnd); init_explorerbrowser(This); init_toolbar(This, hwnd); @@ -1746,7 +2065,10 @@ if(This->filterspec_count) events_OnTypeChange(This); - return TRUE; + if ((hitem = GetDlgItem(This->dlg_hwnd, IDC_FILENAME))) + SetFocus(hitem); + + return FALSE; } static LRESULT on_wm_size(FileDialogImpl *This) @@ -1781,6 +2103,9 @@ ctrl_container_reparent(This, NULL); This->dlg_hwnd = NULL; + DeleteObject(This->hfont_opendropdown); + This->hfont_opendropdown = NULL; + return TRUE; } @@ -1803,6 +2128,19 @@ return FALSE; } +static LRESULT on_command_opendropdown(FileDialogImpl *This, WPARAM wparam, LPARAM lparam) +{ + if(HIWORD(wparam) == BN_CLICKED) + { + HWND hwnd = (HWND)lparam; + SendMessageW(hwnd, BM_SETCHECK, BST_CHECKED, 0); + show_opendropdown(This); + SendMessageW(hwnd, BM_SETCHECK, BST_UNCHECKED, 0); + } + + return FALSE; +} + static LRESULT on_browse_back(FileDialogImpl *This) { TRACE("%p\n", This); @@ -1872,6 +2210,7 @@ { case IDOK: return on_idok(This); case IDCANCEL: return on_idcancel(This); + case psh1: return on_command_opendropdown(This, wparam, lparam); case IDC_NAVBACK: return on_browse_back(This); case IDC_NAVFORWARD: return on_browse_forward(This); case IDC_FILETYPE: return on_command_filetype(This, wparam, lparam); @@ -2021,6 +2360,7 @@ LocalFree(This->custom_filenamelabel); DestroyMenu(This->hmenu_opendropdown); + DeleteObject(This->hfont_opendropdown); HeapFree(GetProcessHeap(), 0, This); } @@ -2033,6 +2373,8 @@ FileDialogImpl *This = impl_from_IFileDialog2(iface); TRACE("%p (%p)\n", iface, hwndOwner); + This->opendropdown_has_selection = FALSE; + return create_dialog(This, hwndOwner); } @@ -2342,7 +2684,7 @@ { FileDialogImpl *This = impl_from_IFileDialog2(iface); FIXME("stub - %p (%p, %d)\n", This, psi, fdap); - return E_NOTIMPL; + return S_OK; } static HRESULT WINAPI IFileDialog2_fnSetDefaultExtension(IFileDialog2 *iface, LPCWSTR pszDefaultExtension) @@ -3369,7 +3711,8 @@ DWORD dwIDCtl) { FileDialogImpl *This = impl_from_IFileDialogCustomize(iface); - FIXME("semi-stub - %p (%d)\n", This, dwIDCtl); + MENUINFO mi; + TRACE("%p (%d)\n", This, dwIDCtl); if (This->hmenu_opendropdown || get_cctrl(This, dwIDCtl)) return E_UNEXPECTED; @@ -3379,6 +3722,11 @@ if (!This->hmenu_opendropdown) return E_OUTOFMEMORY; + mi.cbSize = sizeof(mi); + mi.fMask = MIM_STYLE; + mi.dwStyle = MNS_NOTIFYBYPOS; + SetMenuInfo(This->hmenu_opendropdown, &mi); + This->cctrl_opendropdown.hwnd = NULL; This->cctrl_opendropdown.wrapper_hwnd = NULL; This->cctrl_opendropdown.id = dwIDCtl; @@ -3460,8 +3808,18 @@ DWORD dwIDCtl) { FileDialogImpl *This = impl_from_IFileDialogCustomize(iface); - FIXME("stub - %p (%d)\n", This, dwIDCtl); - return E_NOTIMPL; + customctrl *ctrl; + HRESULT hr; + TRACE("%p (%d)\n", This, dwIDCtl); + + hr = cctrl_create_new(This, dwIDCtl, NULL, radiobuttonlistW, 0, 0, 0, &ctrl); + if(SUCCEEDED(hr)) + { + ctrl->type = IDLG_CCTRL_RADIOBUTTONLIST; + SetWindowLongPtrW(ctrl->hwnd, GWLP_USERDATA, (LPARAM)This); + } + + return hr; } static HRESULT WINAPI IFileDialogCustomize_fnAddCheckButton(IFileDialogCustomize *iface, @@ -3737,6 +4095,29 @@ AppendMenuW(hmenu, MF_STRING, dwIDItem, pszLabel); return S_OK; } + case IDLG_CCTRL_RADIOBUTTONLIST: + { + cctrl_item* item; + + hr = add_item(ctrl, dwIDItem, pszLabel, &item); + + if (SUCCEEDED(hr)) + { + item->hwnd = CreateWindowExW(0, WC_BUTTONW, pszLabel, + WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|BS_RADIOBUTTON|BS_MULTILINE, + 0, 0, 0, 0, ctrl->hwnd, ULongToHandle(dwIDItem), COMDLG32_hInstance, 0); + + if (!item->hwnd) + { + ERR("Failed to create radio button\n"); + list_remove(&item->entry); + item_free(item); + return E_FAIL; + } + } + + return hr; + } default: break; } @@ -3805,6 +4186,20 @@ return S_OK; } + case IDLG_CCTRL_RADIOBUTTONLIST: + { + cctrl_item* item; + + item = get_item(ctrl, dwIDItem, 0, NULL); + + if (!item) + return E_UNEXPECTED; + + list_remove(&item->entry); + item_free(item); + + return S_OK; + } default: break; } @@ -3838,6 +4233,7 @@ case IDLG_CCTRL_COMBOBOX: case IDLG_CCTRL_MENU: case IDLG_CCTRL_OPENDROPDOWN: + case IDLG_CCTRL_RADIOBUTTONLIST: { cctrl_item* item; @@ -3952,6 +4348,26 @@ item->cdcstate = dwState; + if (ctrl->type == IDLG_CCTRL_OPENDROPDOWN) + { + update_control_text(This); + update_layout(This); + } + + return S_OK; + } + case IDLG_CCTRL_RADIOBUTTONLIST: + { + cctrl_item* item; + + item = get_item(ctrl, dwIDItem, CDCS_VISIBLE, NULL); + + if (!item) + return E_UNEXPECTED; + + /* Oddly, native allows setting this but doesn't seem to do anything with it. */ + item->cdcstate = dwState; + return S_OK; } default: @@ -3982,6 +4398,42 @@ *pdwIDItem = SendMessageW(ctrl->hwnd, CB_GETITEMDATA, index, 0); return S_OK; } + case IDLG_CCTRL_OPENDROPDOWN: + if (This->opendropdown_has_selection) + { + *pdwIDItem = This->opendropdown_selection; + return S_OK; + } + else + { + /* Return first enabled item. */ + cctrl_item* item = get_first_item(ctrl); + + if (item) + { + *pdwIDItem = item->id; + return S_OK; + } + + WARN("no enabled items in open dropdown\n"); + return E_FAIL; + } + case IDLG_CCTRL_RADIOBUTTONLIST: + { + cctrl_item* item; + + LIST_FOR_EACH_ENTRY(item, &ctrl->sub_items, cctrl_item, entry) + { + if (SendMessageW(item->hwnd, BM_GETCHECK, 0, 0) == BST_CHECKED) + { + *pdwIDItem = item->id; + return S_OK; + } + } + + WARN("no checked items in radio button list\n"); + return E_FAIL; + } default: FIXME("Unsupported control type %d\n", ctrl->type); } @@ -4013,6 +4465,20 @@ return S_OK; } + case IDLG_CCTRL_RADIOBUTTONLIST: + { + cctrl_item* item; + + item = get_item(ctrl, dwIDItem, 0, NULL); + + if (item) + { + radiobuttonlist_set_selected_item(This, ctrl, item); + return S_OK; + } + + return E_INVALIDARG; + } default: FIXME("Unsupported control type %d\n", ctrl->type); } @@ -4058,7 +4524,7 @@ { FileDialogImpl *This = impl_from_IFileDialogCustomize(iface); FIXME("stub - %p (%d)\n", This, dwIDCtl); - return E_NOTIMPL; + return S_OK; } static HRESULT WINAPI IFileDialogCustomize_fnSetControlItemText(IFileDialogCustomize *iface, @@ -4167,6 +4633,7 @@ fdimpl->client_guid = GUID_NULL; fdimpl->hmenu_opendropdown = NULL; + fdimpl->hfont_opendropdown = NULL; /* FIXME: The default folder setting should be restored for the * application if it was previously set. */ diff -Nru wine1.7-1.7.50/dlls/comdlg32/tests/itemdlg.c wine1.7-1.7.55/dlls/comdlg32/tests/itemdlg.c --- wine1.7-1.7.50/dlls/comdlg32/tests/itemdlg.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/comdlg32/tests/itemdlg.c 2015-11-13 14:32:40.000000000 +0000 @@ -778,22 +778,19 @@ IFileSaveDialog_AddPlace(pfsd, NULL, 0); } - todo_wine - { hr = IFileOpenDialog_AddPlace(pfod, psidesktop, FDAP_TOP + 1); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + todo_wine ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); hr = IFileOpenDialog_AddPlace(pfod, psidesktop, FDAP_BOTTOM); ok(hr == S_OK, "got 0x%08x\n", hr); hr = IFileOpenDialog_AddPlace(pfod, psidesktop, FDAP_TOP); ok(hr == S_OK, "got 0x%08x\n", hr); hr = IFileSaveDialog_AddPlace(pfsd, psidesktop, FDAP_TOP + 1); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + todo_wine ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); hr = IFileSaveDialog_AddPlace(pfsd, psidesktop, FDAP_BOTTOM); ok(hr == S_OK, "got 0x%08x\n", hr); hr = IFileSaveDialog_AddPlace(pfsd, psidesktop, FDAP_TOP); ok(hr == S_OK, "got 0x%08x\n", hr); - } /* SetFileName */ hr = IFileOpenDialog_SetFileName(pfod, NULL); @@ -1552,10 +1549,10 @@ GetClassNameW(item_parent, buf, 1024); ok(!lstrcmpW(buf, floatnotifysinkW), "Got %s\n", wine_dbgstr_w(buf)); item = find_window(dlg_hwnd, NULL, radiobutton1W); - todo_wine ok(item != NULL, "Failed to find item.\n"); + ok(item != NULL, "Failed to find item.\n"); item_parent = GetParent(item); GetClassNameW(item_parent, buf, 1024); - todo_wine ok(!lstrcmpW(buf, RadioButtonListW), "Got %s\n", wine_dbgstr_w(buf)); + ok(!lstrcmpW(buf, RadioButtonListW), "Got %s\n", wine_dbgstr_w(buf)); item_parent = GetParent(item_parent); GetClassNameW(item_parent, buf, 1024); ok(!lstrcmpW(buf, floatnotifysinkW), "Got %s\n", wine_dbgstr_w(buf)); @@ -1734,25 +1731,25 @@ ok(hr == S_OK, "got 0x%08x (control: %d).\n", hr, i); hr = IFileDialogCustomize_AddRadioButtonList(pfdc, i); - todo_wine ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr); + ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr); hr = IFileDialogCustomize_AddRadioButtonList(pfdc, ++i); - todo_wine ok(hr == S_OK, "got 0x%08x.\n", hr); + ok(hr == S_OK, "got 0x%08x.\n", hr); cdstate = 0xdeadbeef; hr = IFileDialogCustomize_GetControlState(pfdc, i, &cdstate); - todo_wine ok(hr == S_OK, "got 0x%08x.\n", hr); - todo_wine ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate); + ok(hr == S_OK, "got 0x%08x.\n", hr); + ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate); hr = IFileDialogCustomize_AddControlItem(pfdc, i, 0, radiobutton1W); - todo_wine ok(hr == S_OK, "got 0x%08x.\n", hr); + ok(hr == S_OK, "got 0x%08x.\n", hr); hr = IFileDialogCustomize_AddControlItem(pfdc, i, 0, radiobutton1W); - todo_wine ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr); + ok(hr == E_INVALIDARG, "got 0x%08x.\n", hr); hr = IFileDialogCustomize_SetControlLabel(pfdc, i, radiobutton2W); - todo_wine ok(hr == S_OK, "got 0x%08x (control: %d).\n", hr, i); + ok(hr == S_OK, "got 0x%08x (control: %d).\n", hr, i); hr = IFileDialogCustomize_AddCheckButton(pfdc, i, label, TRUE); - todo_wine ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr); + ok(hr == E_UNEXPECTED, "got 0x%08x.\n", hr); hr = IFileDialogCustomize_AddCheckButton(pfdc, ++i, checkbutton1W, TRUE); ok(hr == S_OK, "got 0x%08x.\n", hr); @@ -2015,7 +2012,7 @@ } hr = IFileDialogCustomize_AddRadioButtonList(pfdc, ++i); - todo_wine ok(hr == S_OK, "got 0x%08x.\n", hr); + ok(hr == S_OK, "got 0x%08x.\n", hr); if(SUCCEEDED(hr)) { DWORD selected = -1; @@ -2031,7 +2028,6 @@ ok(hr == E_FAIL, "got 0x%08x.\n", hr); ok(selected == -1, "got %d.\n", selected); - todo_wine { cdstate = 0xdeadbeef; hr = IFileDialogCustomize_GetControlItemState(pfdc, i, 0, &cdstate); ok(hr == S_OK, "got 0x%08x.\n", hr); @@ -2048,7 +2044,6 @@ hr = IFileDialogCustomize_GetControlItemState(pfdc, i, 0, &cdstate); ok(hr == S_OK, "got 0x%08x.\n", hr); ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate); - } for(j = 0; j < 10; j++) { @@ -2085,8 +2080,8 @@ } hr = IFileDialogCustomize_GetSelectedControlItem(pfdc, i, &selected); - todo_wine ok(hr == S_OK, "got 0x%08x.\n", hr); - todo_wine ok(selected == 0, "got %d.\n", selected); + ok(hr == S_OK, "got 0x%08x.\n", hr); + ok(selected == 0, "got %d.\n", selected); cdstate = 0xdeadbeef; hr = IFileDialogCustomize_GetControlItemState(pfdc, i, 0, &cdstate); @@ -2236,7 +2231,7 @@ ok(cdstate == CDCS_ENABLEDVISIBLE, "got 0x%08x.\n", cdstate); hr = IFileDialogCustomize_MakeProminent(pfdc, id_vgroup1); - todo_wine ok(hr == S_OK, "got 0x%08x.\n", hr); + ok(hr == S_OK, "got 0x%08x.\n", hr); IFileDialogCustomize_Release(pfdc); ref = IFileDialog_Release(pfod); diff -Nru wine1.7-1.7.50/dlls/comdlg32/tests/printdlg.c wine1.7-1.7.55/dlls/comdlg32/tests/printdlg.c --- wine1.7-1.7.50/dlls/comdlg32/tests/printdlg.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/comdlg32/tests/printdlg.c 2015-11-13 14:32:40.000000000 +0000 @@ -379,14 +379,16 @@ return; } - /* Set CommDlgExtendedError != 0 */ - PrintDlgA(NULL); - SetLastError(0xdeadbeef); - res = pPrintDlgExW(NULL); - ok( (res == E_INVALIDARG), - "got 0x%x with %u and %u (expected 'E_INVALIDARG')\n", - res, GetLastError(), CommDlgExtendedError()); - + if (0) /* Crashes on Win10 */ + { + /* Set CommDlgExtendedError != 0 */ + PrintDlgA(NULL); + SetLastError(0xdeadbeef); + res = pPrintDlgExW(NULL); + ok( (res == E_INVALIDARG), + "got 0x%x with %u and %u (expected 'E_INVALIDARG')\n", + res, GetLastError(), CommDlgExtendedError() ); + } pDlg = HeapAlloc(GetProcessHeap(), 0, (sizeof(PRINTDLGEXW)) + 8); if (!pDlg) return; diff -Nru wine1.7-1.7.50/dlls/crypt32/cert.c wine1.7-1.7.55/dlls/crypt32/cert.c --- wine1.7-1.7.50/dlls/crypt32/cert.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/crypt32/cert.c 2015-11-13 14:32:40.000000000 +0000 @@ -694,6 +694,7 @@ case CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID: case CERT_ENROLLMENT_PROP_ID: case CERT_CROSS_CERT_DIST_POINTS_PROP_ID: + case CERT_OCSP_RESPONSE_PROP_ID: case CERT_RENEWAL_PROP_ID: { if (pvData) diff -Nru wine1.7-1.7.50/dlls/crypt32/decode.c wine1.7-1.7.55/dlls/crypt32/decode.c --- wine1.7-1.7.50/dlls/crypt32/decode.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/crypt32/decode.c 2015-11-13 14:32:40.000000000 +0000 @@ -4002,18 +4002,19 @@ &size, NULL, NULL); if (ret) { - halflen = decodedKey->modulus.cbData / 2; - if ((decodedKey->modulus.cbData != halflen * 2) || - (decodedKey->prime1.cbData != halflen) || - (decodedKey->prime2.cbData != halflen) || - (decodedKey->exponent1.cbData != halflen) || - (decodedKey->exponent2.cbData != halflen) || - (decodedKey->coefficient.cbData != halflen) || - (decodedKey->privexp.cbData != halflen * 2)) - { - ret = FALSE; - SetLastError(CRYPT_E_BAD_ENCODE); - } + halflen = decodedKey->prime1.cbData; + if (halflen < decodedKey->prime2.cbData) + halflen = decodedKey->prime2.cbData; + if (halflen < decodedKey->exponent1.cbData) + halflen = decodedKey->exponent1.cbData; + if (halflen < decodedKey->exponent2.cbData) + halflen = decodedKey->exponent2.cbData; + if (halflen < decodedKey->coefficient.cbData) + halflen = decodedKey->coefficient.cbData; + if (halflen * 2 < decodedKey->modulus.cbData) + halflen = decodedKey->modulus.cbData / 2 + decodedKey->modulus.cbData % 2; + if (halflen * 2 < decodedKey->privexp.cbData) + halflen = decodedKey->privexp.cbData / 2 + decodedKey->privexp.cbData % 2; if (ret) { @@ -4048,20 +4049,21 @@ rsaPubKey->bitlen = halflen * 16; vardata = (BYTE*)(rsaPubKey + 1); + memset(vardata, 0, halflen * 9); memcpy(vardata, - decodedKey->modulus.pbData, halflen * 2); + decodedKey->modulus.pbData, decodedKey->modulus.cbData); memcpy(vardata + halflen * 2, - decodedKey->prime1.pbData, halflen); + decodedKey->prime1.pbData, decodedKey->prime1.cbData); memcpy(vardata + halflen * 3, - decodedKey->prime2.pbData, halflen); + decodedKey->prime2.pbData, decodedKey->prime2.cbData); memcpy(vardata + halflen * 4, - decodedKey->exponent1.pbData, halflen); + decodedKey->exponent1.pbData, decodedKey->exponent1.cbData); memcpy(vardata + halflen * 5, - decodedKey->exponent2.pbData, halflen); + decodedKey->exponent2.pbData, decodedKey->exponent2.cbData); memcpy(vardata + halflen * 6, - decodedKey->coefficient.pbData, halflen); + decodedKey->coefficient.pbData, decodedKey->coefficient.cbData); memcpy(vardata + halflen * 7, - decodedKey->privexp.pbData, halflen * 2); + decodedKey->privexp.pbData, decodedKey->privexp.cbData); } } diff -Nru wine1.7-1.7.50/dlls/crypt32/tests/encode.c wine1.7-1.7.55/dlls/crypt32/tests/encode.c --- wine1.7-1.7.50/dlls/crypt32/tests/encode.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/crypt32/tests/encode.c 2015-11-13 14:32:40.000000000 +0000 @@ -7262,7 +7262,7 @@ if (constraints->cPermittedSubtree != encodedNameConstraints[i].constraints.cPermittedSubtree) - fprintf(stderr, "%d: expected %d permitted, got %d\n", i, + fprintf(stderr, "%d: expected %u permitted, got %u\n", i, encodedNameConstraints[i].constraints.cPermittedSubtree, constraints->cPermittedSubtree); if (constraints->cPermittedSubtree == @@ -7276,7 +7276,7 @@ } if (constraints->cExcludedSubtree != encodedNameConstraints[i].constraints.cExcludedSubtree) - fprintf(stderr, "%d: expected %d excluded, got %d\n", i, + fprintf(stderr, "%d: expected %u excluded, got %u\n", i, encodedNameConstraints[i].constraints.cExcludedSubtree, constraints->cExcludedSubtree); if (constraints->cExcludedSubtree == diff -Nru wine1.7-1.7.50/dlls/crypt32/tests/store.c wine1.7-1.7.55/dlls/crypt32/tests/store.c --- wine1.7-1.7.50/dlls/crypt32/tests/store.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/crypt32/tests/store.c 2015-11-13 14:32:40.000000000 +0000 @@ -2203,6 +2203,35 @@ 0xff,0x04,0x08,0x30,0x06,0x01,0x01,0xff,0x02,0x01,0x01,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; +static void delete_test_key(void) +{ + HKEY root_key, test_key; + static const WCHAR SysCertW[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\', + 'S','y','s','t','e','m','C','e','r','t','i','f','i','c','a','t','e','s',0}; + static const WCHAR WineTestW[] = {'W','i','n','e','T','e','s','t',0}; + WCHAR subkey_name[32]; + DWORD num_subkeys, subkey_name_len; + int idx; + + if (RegOpenKeyExW(HKEY_CURRENT_USER, SysCertW, 0, KEY_READ, &root_key)) + return; + if (RegOpenKeyExW(root_key, WineTestW, 0, KEY_READ, &test_key)) + { + RegCloseKey(root_key); + return; + } + RegQueryInfoKeyW(test_key, NULL, NULL, NULL, &num_subkeys, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + for (idx = num_subkeys; idx-- > 0;) + { + subkey_name_len = sizeof(subkey_name)/sizeof(WCHAR); + RegEnumKeyExW(test_key, idx, subkey_name, &subkey_name_len, NULL, NULL, NULL, NULL); + RegDeleteKeyW(test_key, subkey_name); + } + RegCloseKey(test_key); + RegDeleteKeyW(root_key, WineTestW); + RegCloseKey(root_key); +} + static void testAddCertificateLink(void) { BOOL ret; @@ -2499,6 +2528,8 @@ CertFreeCertificateContext(source); CertCloseStore(store1, 0); + + delete_test_key(); } static DWORD countCertsInStore(HCERTSTORE store) diff -Nru wine1.7-1.7.50/dlls/d2d1/factory.c wine1.7-1.7.55/dlls/d2d1/factory.c --- wine1.7-1.7.50/dlls/d2d1/factory.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d2d1/factory.c 2015-11-13 14:32:40.000000000 +0000 @@ -239,6 +239,7 @@ D3D10_CREATE_DEVICE_BGRA_SUPPORT, D3D10_FEATURE_LEVEL_10_0, D3D10_1_SDK_VERSION, &factory->wic_device))) { WARN("Failed to create device, hr %#x.\n", hr); + HeapFree(GetProcessHeap(), 0, object); return hr; } diff -Nru wine1.7-1.7.50/dlls/d2d1/geometry.c wine1.7-1.7.55/dlls/d2d1/geometry.c --- wine1.7-1.7.50/dlls/d2d1/geometry.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d2d1/geometry.c 2015-11-13 14:32:40.000000000 +0000 @@ -20,12 +20,17 @@ #include "wine/port.h" #include "d2d1_private.h" +#ifdef HAVE_FLOAT_H +#include +#endif WINE_DEFAULT_DEBUG_CHANNEL(d2d); #define D2D_CDT_EDGE_FLAG_FREED 0x80000000u #define D2D_CDT_EDGE_FLAG_VISITED(r) (1u << (r)) +#define D2D_FP_EPS (1.0f / (1 << FLT_MANT_DIG)) + static const D2D1_MATRIX_3X2_F identity = { 1.0f, 0.0f, @@ -50,6 +55,8 @@ struct d2d_bezier *beziers; size_t beziers_size; size_t bezier_count; + + D2D1_RECT_F bounds; }; struct d2d_cdt_edge_ref @@ -75,6 +82,225 @@ const D2D1_POINT_2F *vertices; }; +struct d2d_fp_two_vec2 +{ + float x[2]; + float y[2]; +}; + +struct d2d_fp_fin +{ + float *now, *other; + size_t length; +}; + +static void d2d_fp_two_sum(float *out, float a, float b) +{ + float a_virt, a_round, b_virt, b_round; + + out[1] = a + b; + b_virt = out[1] - a; + a_virt = out[1] - b_virt; + b_round = b - b_virt; + a_round = a - a_virt; + out[0] = a_round + b_round; +} + +static void d2d_fp_fast_two_sum(float *out, float a, float b) +{ + float b_virt; + + out[1] = a + b; + b_virt = out[1] - a; + out[0] = b - b_virt; +} + +static void d2d_fp_two_two_sum(float *out, const float *a, const float *b) +{ + float sum[2]; + + d2d_fp_two_sum(out, a[0], b[0]); + d2d_fp_two_sum(sum, a[1], out[1]); + d2d_fp_two_sum(&out[1], sum[0], b[1]); + d2d_fp_two_sum(&out[2], sum[1], out[2]); +} + +static void d2d_fp_two_diff_tail(float *out, float a, float b, float x) +{ + float a_virt, a_round, b_virt, b_round; + + b_virt = a - x; + a_virt = x + b_virt; + b_round = b_virt - b; + a_round = a - a_virt; + *out = a_round + b_round; +} + +static void d2d_fp_two_two_diff(float *out, const float *a, const float *b) +{ + float sum[2], diff; + + diff = a[0] - b[0]; + d2d_fp_two_diff_tail(out, a[0], b[0], diff); + d2d_fp_two_sum(sum, a[1], diff); + diff = sum[0] - b[1]; + d2d_fp_two_diff_tail(&out[1], sum[0], b[1], diff); + d2d_fp_two_sum(&out[2], sum[1], diff); +} + +static void d2d_fp_split(float *out, float a) +{ + float a_big, c; + + c = a * ((1 << (FLT_MANT_DIG / 2)) + 1.0f); + a_big = c - a; + out[1] = c - a_big; + out[0] = a - out[1]; +} + +static void d2d_fp_two_product_presplit(float *out, float a, float b, const float *b_split) +{ + float a_split[2], err1, err2, err3; + + out[1] = a * b; + d2d_fp_split(a_split, a); + err1 = out[1] - (a_split[1] * b_split[1]); + err2 = err1 - (a_split[0] * b_split[1]); + err3 = err2 - (a_split[1] * b_split[0]); + out[0] = (a_split[0] * b_split[0]) - err3; +} + +static void d2d_fp_two_product(float *out, float a, float b) +{ + float b_split[2]; + + d2d_fp_split(b_split, b); + d2d_fp_two_product_presplit(out, a, b, b_split); +} + +static void d2d_fp_square(float *out, float a) +{ + float a_split[2], err1, err2; + + out[1] = a * a; + d2d_fp_split(a_split, a); + err1 = out[1] - (a_split[1] * a_split[1]); + err2 = err1 - ((a_split[1] + a_split[1]) * a_split[0]); + out[0] = (a_split[0] * a_split[0]) - err2; +} + +static float d2d_fp_estimate(float *a, size_t len) +{ + float out = a[0]; + size_t idx = 1; + + while (idx < len) + out += a[idx++]; + + return out; +} + +static void d2d_fp_fast_expansion_sum_zeroelim(float *out, size_t *out_len, + const float *a, size_t a_len, const float *b, size_t b_len) +{ + float sum[2], q, a_curr, b_curr; + size_t a_idx, b_idx, out_idx; + + a_curr = a[0]; + b_curr = b[0]; + a_idx = b_idx = 0; + if ((b_curr > a_curr) == (b_curr > -a_curr)) + { + q = a_curr; + a_curr = a[++a_idx]; + } + else + { + q = b_curr; + b_curr = b[++b_idx]; + } + out_idx = 0; + if (a_idx < a_len && b_idx < b_len) + { + if ((b_curr > a_curr) == (b_curr > -a_curr)) + { + d2d_fp_fast_two_sum(sum, a_curr, q); + a_curr = a[++a_idx]; + } + else + { + d2d_fp_fast_two_sum(sum, b_curr, q); + b_curr = b[++b_idx]; + } + if (sum[0] != 0.0f) + out[out_idx++] = sum[0]; + q = sum[1]; + while (a_idx < a_len && b_idx < b_len) + { + if ((b_curr > a_curr) == (b_curr > -a_curr)) + { + d2d_fp_two_sum(sum, q, a_curr); + a_curr = a[++a_idx]; + } + else + { + d2d_fp_two_sum(sum, q, b_curr); + b_curr = b[++b_idx]; + } + if (sum[0] != 0.0f) + out[out_idx++] = sum[0]; + q = sum[1]; + } + } + while (a_idx < a_len) + { + d2d_fp_two_sum(sum, q, a_curr); + a_curr = a[++a_idx]; + if (sum[0] != 0.0f) + out[out_idx++] = sum[0]; + q = sum[1]; + } + while (b_idx < b_len) + { + d2d_fp_two_sum(sum, q, b_curr); + b_curr = b[++b_idx]; + if (sum[0] != 0.0f) + out[out_idx++] = sum[0]; + q = sum[1]; + } + if (q != 0.0f || !out_idx) + out[out_idx++] = q; + + *out_len = out_idx; +} + +static void d2d_fp_scale_expansion_zeroelim(float *out, size_t *out_len, const float *a, size_t a_len, float b) +{ + float product[2], sum[2], b_split[2], q[2], a_curr; + size_t a_idx, out_idx; + + d2d_fp_split(b_split, b); + d2d_fp_two_product_presplit(q, a[0], b, b_split); + out_idx = 0; + if (q[0] != 0.0f) + out[out_idx++] = q[0]; + for (a_idx = 1; a_idx < a_len; ++a_idx) + { + a_curr = a[a_idx]; + d2d_fp_two_product_presplit(product, a_curr, b, b_split); + d2d_fp_two_sum(sum, q[1], product[0]); + if (sum[0] != 0.0f) + out[out_idx++] = sum[0]; + d2d_fp_fast_two_sum(q, product[1], sum[1]); + if (q[0] != 0.0f) + out[out_idx++] = q[0]; + } + if (q[1] != 0.0f || !out_idx) + out[out_idx++] = q[1]; + + *out_len = out_idx; +} + static void d2d_point_subtract(D2D1_POINT_2F *out, const D2D1_POINT_2F *a, const D2D1_POINT_2F *b) { @@ -82,14 +308,88 @@ out->y = a->y - b->y; } +/* This implementation is based on the paper "Adaptive Precision + * Floating-Point Arithmetic and Fast Robust Geometric Predicates" and + * associated (Public Domain) code by Jonathan Richard Shewchuk. */ static float d2d_point_ccw(const D2D1_POINT_2F *a, const D2D1_POINT_2F *b, const D2D1_POINT_2F *c) { - D2D1_POINT_2F ab, ac; + static const float err_bound_result = (3.0f + 8.0f * D2D_FP_EPS) * D2D_FP_EPS; + static const float err_bound_a = (3.0f + 16.0f * D2D_FP_EPS) * D2D_FP_EPS; + static const float err_bound_b = (2.0f + 12.0f * D2D_FP_EPS) * D2D_FP_EPS; + static const float err_bound_c = (9.0f + 64.0f * D2D_FP_EPS) * D2D_FP_EPS * D2D_FP_EPS; + float det_d[16], det_c2[12], det_c1[8], det_b[4], temp4[4], temp2a[2], temp2b[2], abxacy[2], abyacx[2]; + size_t det_d_len, det_c2_len, det_c1_len; + float det, det_sum, err_bound; + struct d2d_fp_two_vec2 ab, ac; + + ab.x[1] = b->x - a->x; + ab.y[1] = b->y - a->y; + ac.x[1] = c->x - a->x; + ac.y[1] = c->y - a->y; + + abxacy[1] = ab.x[1] * ac.y[1]; + abyacx[1] = ab.y[1] * ac.x[1]; + det = abxacy[1] - abyacx[1]; + + if (abxacy[1] > 0.0f) + { + if (abyacx[1] <= 0.0f) + return det; + det_sum = abxacy[1] + abyacx[1]; + } + else if (abxacy[1] < 0.0f) + { + if (abyacx[1] >= 0.0f) + return det; + det_sum = -abxacy[1] - abyacx[1]; + } + else + { + return det; + } - d2d_point_subtract(&ab, b, a); - d2d_point_subtract(&ac, c, a); + err_bound = err_bound_a * det_sum; + if (det >= err_bound || -det >= err_bound) + return det; + + d2d_fp_two_product(abxacy, ab.x[1], ac.y[1]); + d2d_fp_two_product(abyacx, ab.y[1], ac.x[1]); + d2d_fp_two_two_diff(det_b, abxacy, abyacx); + + det = d2d_fp_estimate(det_b, 4); + err_bound = err_bound_b * det_sum; + if (det >= err_bound || -det >= err_bound) + return det; + + d2d_fp_two_diff_tail(&ab.x[0], b->x, a->x, ab.x[1]); + d2d_fp_two_diff_tail(&ab.y[0], b->y, a->y, ab.y[1]); + d2d_fp_two_diff_tail(&ac.x[0], c->x, a->x, ac.x[1]); + d2d_fp_two_diff_tail(&ac.y[0], c->y, a->y, ac.y[1]); + + if (ab.x[0] == 0.0f && ab.y[0] == 0.0f && ac.x[0] == 0.0f && ac.y[0] == 0.0f) + return det; + + err_bound = err_bound_c * det_sum + err_bound_result * fabsf(det); + det += (ab.x[1] * ac.y[0] + ac.y[1] * ab.x[0]) - (ab.y[1] * ac.x[0] + ac.x[1] * ab.y[0]); + if (det >= err_bound || -det >= err_bound) + return det; + + d2d_fp_two_product(temp2a, ab.x[0], ac.y[1]); + d2d_fp_two_product(temp2b, ab.y[0], ac.x[1]); + d2d_fp_two_two_diff(temp4, temp2a, temp2b); + d2d_fp_fast_expansion_sum_zeroelim(det_c1, &det_c1_len, det_b, 4, temp4, 4); + + d2d_fp_two_product(temp2a, ab.x[1], ac.y[0]); + d2d_fp_two_product(temp2b, ab.y[1], ac.x[0]); + d2d_fp_two_two_diff(temp4, temp2a, temp2b); + d2d_fp_fast_expansion_sum_zeroelim(det_c2, &det_c2_len, det_c1, det_c1_len, temp4, 4); + + d2d_fp_two_product(temp2a, ab.x[0], ac.y[0]); + d2d_fp_two_product(temp2b, ab.y[0], ac.x[0]); + d2d_fp_two_two_diff(temp4, temp2a, temp2b); + d2d_fp_fast_expansion_sum_zeroelim(det_d, &det_d_len, det_c2, det_c2_len, temp4, 4); - return ab.x * ac.y - ab.y * ac.x; + return det_d[det_d_len - 1]; } static BOOL d2d_array_reserve(void **elements, size_t *capacity, size_t element_count, size_t element_size) @@ -124,6 +424,18 @@ return TRUE; } +static void d2d_figure_update_bounds(struct d2d_figure *figure, D2D1_POINT_2F vertex) +{ + if (vertex.x < figure->bounds.left) + figure->bounds.left = vertex.x; + if (vertex.x > figure->bounds.right) + figure->bounds.right = vertex.x; + if (vertex.y < figure->bounds.top) + figure->bounds.top = vertex.y; + if (vertex.y > figure->bounds.bottom) + figure->bounds.bottom = vertex.y; +} + static BOOL d2d_figure_insert_vertex(struct d2d_figure *figure, size_t idx, D2D1_POINT_2F vertex) { if (!d2d_array_reserve((void **)&figure->vertices, &figure->vertices_size, @@ -136,6 +448,7 @@ memmove(&figure->vertices[idx + 1], &figure->vertices[idx], (figure->vertex_count - idx) * sizeof(*figure->vertices)); figure->vertices[idx] = vertex; + d2d_figure_update_bounds(figure, vertex); ++figure->vertex_count; return TRUE; } @@ -150,6 +463,7 @@ } figure->vertices[figure->vertex_count] = vertex; + d2d_figure_update_bounds(figure, vertex); ++figure->vertex_count; return TRUE; } @@ -276,6 +590,153 @@ return d2d_cdt_ccw(cdt, p, d2d_cdt_edge_origin(cdt, e), d2d_cdt_edge_destination(cdt, e)) > 0.0f; } +/* |ax ay| + * |bx by| */ +static void d2d_fp_four_det2x2(float *out, float ax, float ay, float bx, float by) +{ + float axby[2], aybx[2]; + + d2d_fp_two_product(axby, ax, by); + d2d_fp_two_product(aybx, ay, bx); + d2d_fp_two_two_diff(out, axby, aybx); +} + +/* (a->x² + a->y²) * det2x2 */ +static void d2d_fp_sub_det3x3(float *out, size_t *out_len, const struct d2d_fp_two_vec2 *a, const float *det2x2) +{ + size_t axd_len, ayd_len, axxd_len, ayyd_len; + float axd[8], ayd[8], axxd[16], ayyd[16]; + + d2d_fp_scale_expansion_zeroelim(axd, &axd_len, det2x2, 4, a->x[1]); + d2d_fp_scale_expansion_zeroelim(axxd, &axxd_len, axd, axd_len, a->x[1]); + d2d_fp_scale_expansion_zeroelim(ayd, &ayd_len, det2x2, 4, a->y[1]); + d2d_fp_scale_expansion_zeroelim(ayyd, &ayyd_len, ayd, ayd_len, a->y[1]); + d2d_fp_fast_expansion_sum_zeroelim(out, out_len, axxd, axxd_len, ayyd, ayyd_len); +} + +/* det_abt = det_ab * c[0] + * fin += c[0] * (az * b - bz * a + c[1] * det_ab * 2.0f) */ +static void d2d_cdt_incircle_refine1(struct d2d_fp_fin *fin, float *det_abt, size_t *det_abt_len, + const float *det_ab, float a, const float *az, float b, const float *bz, const float *c) +{ + size_t temp48_len, temp32_len, temp16a_len, temp16b_len, temp16c_len, temp8_len; + float temp48[48], temp32[32], temp16a[16], temp16b[16], temp16c[16], temp8[8]; + float *swap; + + d2d_fp_scale_expansion_zeroelim(det_abt, det_abt_len, det_ab, 4, c[0]); + d2d_fp_scale_expansion_zeroelim(temp16a, &temp16a_len, det_abt, *det_abt_len, 2.0f * c[1]); + d2d_fp_scale_expansion_zeroelim(temp8, &temp8_len, az, 4, c[0]); + d2d_fp_scale_expansion_zeroelim(temp16b, &temp16b_len, temp8, temp8_len, b); + d2d_fp_scale_expansion_zeroelim(temp8, &temp8_len, bz, 4, c[0]); + d2d_fp_scale_expansion_zeroelim(temp16c, &temp16c_len, temp8, temp8_len, -a); + d2d_fp_fast_expansion_sum_zeroelim(temp32, &temp32_len, temp16a, temp16a_len, temp16b, temp16b_len); + d2d_fp_fast_expansion_sum_zeroelim(temp48, &temp48_len, temp16c, temp16c_len, temp32, temp32_len); + d2d_fp_fast_expansion_sum_zeroelim(fin->other, &fin->length, fin->now, fin->length, temp48, temp48_len); + swap = fin->now; fin->now = fin->other; fin->other = swap; +} + +static void d2d_cdt_incircle_refine2(struct d2d_fp_fin *fin, const struct d2d_fp_two_vec2 *a, + const struct d2d_fp_two_vec2 *b, const float *bz, const struct d2d_fp_two_vec2 *c, const float *cz, + const float *axt_det_bc, size_t axt_det_bc_len, const float *ayt_det_bc, size_t ayt_det_bc_len) +{ + size_t temp64_len, temp48_len, temp32a_len, temp32b_len, temp16a_len, temp16b_len, temp8_len; + float temp64[64], temp48[48], temp32a[32], temp32b[32], temp16a[16], temp16b[16], temp8[8]; + float bct[8], bctt[4], temp4a[4], temp4b[4], temp2a[2], temp2b[2]; + size_t bct_len, bctt_len; + float *swap; + + /* bct = (b->x[0] * c->y[1] + b->x[1] * c->y[0]) - (c->x[0] * b->y[1] + c->x[1] * b->y[0]) */ + /* bctt = b->x[0] * c->y[0] + c->x[0] * b->y[0] */ + if (b->x[0] != 0.0f || b->y[0] != 0.0f || c->x[0] != 0.0f || c->y[0] != 0.0f) + { + d2d_fp_two_product(temp2a, b->x[0], c->y[1]); + d2d_fp_two_product(temp2b, b->x[1], c->y[0]); + d2d_fp_two_two_sum(temp4a, temp2a, temp2b); + d2d_fp_two_product(temp2a, c->x[0], -b->y[1]); + d2d_fp_two_product(temp2b, c->x[1], -b->y[0]); + d2d_fp_two_two_sum(temp4b, temp2a, temp2b); + d2d_fp_fast_expansion_sum_zeroelim(bct, &bct_len, temp4a, 4, temp4b, 4); + + d2d_fp_two_product(temp2a, b->x[0], c->y[0]); + d2d_fp_two_product(temp2b, c->x[0], b->y[0]); + d2d_fp_two_two_diff(bctt, temp2a, temp2b); + bctt_len = 4; + } + else + { + bct[0] = 0.0f; + bct_len = 1; + bctt[0] = 0.0f; + bctt_len = 1; + } + + if (a->x[0] != 0.0f) + { + size_t axt_bct_len, axt_bctt_len; + float axt_bct[16], axt_bctt[8]; + + /* fin += a->x[0] * (axt_det_bc + bct * 2.0f * a->x[1]) */ + d2d_fp_scale_expansion_zeroelim(temp16a, &temp16a_len, axt_det_bc, axt_det_bc_len, a->x[0]); + d2d_fp_scale_expansion_zeroelim(axt_bct, &axt_bct_len, bct, bct_len, a->x[0]); + d2d_fp_scale_expansion_zeroelim(temp32a, &temp32a_len, axt_bct, axt_bct_len, 2.0f * a->x[1]); + d2d_fp_fast_expansion_sum_zeroelim(temp48, &temp48_len, temp16a, temp16a_len, temp32a, temp32a_len); + d2d_fp_fast_expansion_sum_zeroelim(fin->other, &fin->length, fin->now, fin->length, temp48, temp48_len); + swap = fin->now; fin->now = fin->other; fin->other = swap; + + if (b->y[0] != 0.0f) + { + /* fin += a->x[0] * cz * b->y[0] */ + d2d_fp_scale_expansion_zeroelim(temp8, &temp8_len, cz, 4, a->x[0]); + d2d_fp_scale_expansion_zeroelim(temp16a, &temp16a_len, temp8, temp8_len, b->y[0]); + d2d_fp_fast_expansion_sum_zeroelim(fin->other, &fin->length, fin->now, fin->length, temp16a, temp16a_len); + swap = fin->now; fin->now = fin->other; fin->other = swap; + } + + if (c->y[0] != 0.0f) + { + /* fin -= a->x[0] * bz * c->y[0] */ + d2d_fp_scale_expansion_zeroelim(temp8, &temp8_len, bz, 4, -a->x[0]); + d2d_fp_scale_expansion_zeroelim(temp16a, &temp16a_len, temp8, temp8_len, c->y[0]); + d2d_fp_fast_expansion_sum_zeroelim(fin->other, &fin->length, fin->now, fin->length, temp16a, temp16a_len); + swap = fin->now; fin->now = fin->other; fin->other = swap; + } + + /* fin += a->x[0] * (bct * a->x[0] + bctt * (2.0f * a->x[1] + a->x[0])) */ + d2d_fp_scale_expansion_zeroelim(temp32a, &temp32a_len, axt_bct, axt_bct_len, a->x[0]); + d2d_fp_scale_expansion_zeroelim(axt_bctt, &axt_bctt_len, bctt, bctt_len, a->x[0]); + d2d_fp_scale_expansion_zeroelim(temp16a, &temp16a_len, axt_bctt, axt_bctt_len, 2.0f * a->x[1]); + d2d_fp_scale_expansion_zeroelim(temp16b, &temp16b_len, axt_bctt, axt_bctt_len, a->x[0]); + d2d_fp_fast_expansion_sum_zeroelim(temp32b, &temp32b_len, temp16a, temp16a_len, temp16b, temp16b_len); + d2d_fp_fast_expansion_sum_zeroelim(temp64, &temp64_len, temp32a, temp32a_len, temp32b, temp32b_len); + d2d_fp_fast_expansion_sum_zeroelim(fin->other, &fin->length, fin->now, fin->length, temp64, temp64_len); + swap = fin->now; fin->now = fin->other; fin->other = swap; + } + + if (a->y[0] != 0.0f) + { + size_t ayt_bct_len, ayt_bctt_len; + float ayt_bct[16], ayt_bctt[8]; + + /* fin += a->y[0] * (ayt_det_bc + bct * 2.0f * a->y[1]) */ + d2d_fp_scale_expansion_zeroelim(temp16a, &temp16a_len, ayt_det_bc, ayt_det_bc_len, a->y[0]); + d2d_fp_scale_expansion_zeroelim(ayt_bct, &ayt_bct_len, bct, bct_len, a->y[0]); + d2d_fp_scale_expansion_zeroelim(temp32a, &temp32a_len, ayt_bct, ayt_bct_len, 2.0f * a->y[1]); + d2d_fp_fast_expansion_sum_zeroelim(temp48, &temp48_len, temp16a, temp16a_len, temp32a, temp32a_len); + d2d_fp_fast_expansion_sum_zeroelim(fin->other, &fin->length, fin->now, fin->length, temp48, temp48_len); + swap = fin->now; fin->now = fin->other; fin->other = swap; + + /* fin += a->y[0] * (bct * a->y[0] + bctt * (2.0f * a->y[1] + a->y[0])) */ + d2d_fp_scale_expansion_zeroelim(temp32a, &temp32a_len, ayt_bct, ayt_bct_len, a->y[0]); + d2d_fp_scale_expansion_zeroelim(ayt_bctt, &ayt_bctt_len, bctt, bctt_len, a->y[0]); + d2d_fp_scale_expansion_zeroelim(temp16a, &temp16a_len, ayt_bctt, ayt_bctt_len, 2.0f * a->y[1]); + d2d_fp_scale_expansion_zeroelim(temp16b, &temp16b_len, ayt_bctt, ayt_bctt_len, a->y[0]); + d2d_fp_fast_expansion_sum_zeroelim(temp32b, &temp32b_len, temp16a, temp16a_len, temp16b, temp16b_len); + d2d_fp_fast_expansion_sum_zeroelim(temp64, &temp64_len, temp32a, temp32a_len, temp32b, temp32b_len); + d2d_fp_fast_expansion_sum_zeroelim(fin->other, &fin->length, fin->now, fin->length, temp64, temp64_len); + swap = fin->now; fin->now = fin->other; fin->other = swap; + } +} + /* Determine if point D is inside or outside the circle defined by points A, * B, C. As explained in the paper by Guibas and Stolfi, this is equivalent to * calculating the signed volume of the tetrahedron defined by projecting the @@ -291,21 +752,138 @@ * * |λ(A-D)| * |λ(B-D)| > 0 - * |λ(C-D)| */ + * |λ(C-D)| + * + * This implementation is based on the paper "Adaptive Precision + * Floating-Point Arithmetic and Fast Robust Geometric Predicates" and + * associated (Public Domain) code by Jonathan Richard Shewchuk. */ static BOOL d2d_cdt_incircle(const struct d2d_cdt *cdt, size_t a, size_t b, size_t c, size_t d) { + static const float err_bound_result = (3.0f + 8.0f * D2D_FP_EPS) * D2D_FP_EPS; + static const float err_bound_a = (10.0f + 96.0f * D2D_FP_EPS) * D2D_FP_EPS; + static const float err_bound_b = (4.0f + 48.0f * D2D_FP_EPS) * D2D_FP_EPS; + static const float err_bound_c = (44.0f + 576.0f * D2D_FP_EPS) * D2D_FP_EPS * D2D_FP_EPS; + + size_t axt_det_bc_len, ayt_det_bc_len, bxt_det_ca_len, byt_det_ca_len, cxt_det_ab_len, cyt_det_ab_len; + float axt_det_bc[8], ayt_det_bc[8], bxt_det_ca[8], byt_det_ca[8], cxt_det_ab[8], cyt_det_ab[8]; + float fin1[1152], fin2[1152], temp64[64], sub_det_a[32], sub_det_b[32], sub_det_c[32]; + float det_bc[4], det_ca[4], det_ab[4], daz[4], dbz[4], dcz[4], temp2a[2], temp2b[2]; + size_t temp64_len, sub_det_a_len, sub_det_b_len, sub_det_c_len; + float dbxdcy, dbydcx, dcxday, dcydax, daxdby, daydbx; const D2D1_POINT_2F *p = cdt->vertices; - const struct - { - double x, y; - } - da = {p[a].x - p[d].x, p[a].y - p[d].y}, - db = {p[b].x - p[d].x, p[b].y - p[d].y}, - dc = {p[c].x - p[d].x, p[c].y - p[d].y}; + struct d2d_fp_two_vec2 da, db, dc; + float permanent, err_bound, det; + struct d2d_fp_fin fin; + + da.x[1] = p[a].x - p[d].x; + da.y[1] = p[a].y - p[d].y; + db.x[1] = p[b].x - p[d].x; + db.y[1] = p[b].y - p[d].y; + dc.x[1] = p[c].x - p[d].x; + dc.y[1] = p[c].y - p[d].y; + + daz[3] = da.x[1] * da.x[1] + da.y[1] * da.y[1]; + dbxdcy = db.x[1] * dc.y[1]; + dbydcx = db.y[1] * dc.x[1]; + + dbz[3] = db.x[1] * db.x[1] + db.y[1] * db.y[1]; + dcxday = dc.x[1] * da.y[1]; + dcydax = dc.y[1] * da.x[1]; + + dcz[3] = dc.x[1] * dc.x[1] + dc.y[1] * dc.y[1]; + daxdby = da.x[1] * db.y[1]; + daydbx = da.y[1] * db.x[1]; + + det = daz[3] * (dbxdcy - dbydcx) + dbz[3] * (dcxday - dcydax) + dcz[3] * (daxdby - daydbx); + permanent = daz[3] * (fabsf(dbxdcy) + fabsf(dbydcx)) + + dbz[3] * (fabsf(dcxday) + fabsf(dcydax)) + + dcz[3] * (fabsf(daxdby) + fabsf(daydbx)); + err_bound = err_bound_a * permanent; + if (det > err_bound || -det > err_bound) + return det > 0.0f; + + fin.now = fin1; + fin.other = fin2; + + d2d_fp_four_det2x2(det_bc, db.x[1], db.y[1], dc.x[1], dc.y[1]); + d2d_fp_sub_det3x3(sub_det_a, &sub_det_a_len, &da, det_bc); + + d2d_fp_four_det2x2(det_ca, dc.x[1], dc.y[1], da.x[1], da.y[1]); + d2d_fp_sub_det3x3(sub_det_b, &sub_det_b_len, &db, det_ca); + + d2d_fp_four_det2x2(det_ab, da.x[1], da.y[1], db.x[1], db.y[1]); + d2d_fp_sub_det3x3(sub_det_c, &sub_det_c_len, &dc, det_ab); + + d2d_fp_fast_expansion_sum_zeroelim(temp64, &temp64_len, sub_det_a, sub_det_a_len, sub_det_b, sub_det_b_len); + d2d_fp_fast_expansion_sum_zeroelim(fin.now, &fin.length, temp64, temp64_len, sub_det_c, sub_det_c_len); + det = d2d_fp_estimate(fin.now, fin.length); + err_bound = err_bound_b * permanent; + if (det >= err_bound || -det >= err_bound) + return det > 0.0f; + + d2d_fp_two_diff_tail(&da.x[0], p[a].x, p[d].x, da.x[1]); + d2d_fp_two_diff_tail(&da.y[0], p[a].y, p[d].y, da.y[1]); + d2d_fp_two_diff_tail(&db.x[0], p[b].x, p[d].x, db.x[1]); + d2d_fp_two_diff_tail(&db.y[0], p[b].y, p[d].y, db.y[1]); + d2d_fp_two_diff_tail(&dc.x[0], p[c].x, p[d].x, dc.x[1]); + d2d_fp_two_diff_tail(&dc.y[0], p[c].y, p[d].y, dc.y[1]); + if (da.x[0] == 0.0f && db.x[0] == 0.0f && dc.x[0] == 0.0f + && da.y[0] == 0.0f && db.y[0] == 0.0f && dc.y[0] == 0.0f) + return det > 0.0f; + + err_bound = err_bound_c * permanent + err_bound_result * fabsf(det); + det += (daz[3] * ((db.x[1] * dc.y[0] + dc.y[1] * db.x[0]) - (db.y[1] * dc.x[0] + dc.x[1] * db.y[0])) + + 2.0f * (da.x[1] * da.x[0] + da.y[1] * da.y[0]) * (db.x[1] * dc.y[1] - db.y[1] * dc.x[1])) + + (dbz[3] * ((dc.x[1] * da.y[0] + da.y[1] * dc.x[0]) - (dc.y[1] * da.x[0] + da.x[1] * dc.y[0])) + + 2.0f * (db.x[1] * db.x[0] + db.y[1] * db.y[0]) * (dc.x[1] * da.y[1] - dc.y[1] * da.x[1])) + + (dcz[3] * ((da.x[1] * db.y[0] + db.y[1] * da.x[0]) - (da.y[1] * db.x[0] + db.x[1] * da.y[0])) + + 2.0f * (dc.x[1] * dc.x[0] + dc.y[1] * dc.y[0]) * (da.x[1] * db.y[1] - da.y[1] * db.x[1])); + if (det >= err_bound || -det >= err_bound) + return det > 0.0f; + + if (db.x[0] != 0.0f || db.y[0] != 0.0f || dc.x[0] != 0.0f || dc.y[0] != 0.0f) + { + d2d_fp_square(temp2a, da.x[1]); + d2d_fp_square(temp2b, da.y[1]); + d2d_fp_two_two_sum(daz, temp2a, temp2b); + } + if (dc.x[0] != 0.0f || dc.y[0] != 0.0f || da.x[0] != 0.0f || da.y[0] != 0.0f) + { + d2d_fp_square(temp2a, db.x[1]); + d2d_fp_square(temp2b, db.y[1]); + d2d_fp_two_two_sum(dbz, temp2a, temp2b); + } + if (da.x[0] != 0.0f || da.y[0] != 0.0f || db.x[0] != 0.0f || db.y[0] != 0.0f) + { + d2d_fp_square(temp2a, dc.x[1]); + d2d_fp_square(temp2b, dc.y[1]); + d2d_fp_two_two_sum(dcz, temp2a, temp2b); + } + + if (da.x[0] != 0.0f) + d2d_cdt_incircle_refine1(&fin, axt_det_bc, &axt_det_bc_len, det_bc, dc.y[1], dcz, db.y[1], dbz, da.x); + if (da.y[0] != 0.0f) + d2d_cdt_incircle_refine1(&fin, ayt_det_bc, &ayt_det_bc_len, det_bc, db.x[1], dbz, dc.x[1], dcz, da.y); + if (db.x[0] != 0.0f) + d2d_cdt_incircle_refine1(&fin, bxt_det_ca, &bxt_det_ca_len, det_ca, da.y[1], daz, dc.y[1], dcz, db.x); + if (db.y[0] != 0.0f) + d2d_cdt_incircle_refine1(&fin, byt_det_ca, &byt_det_ca_len, det_ca, dc.x[1], dcz, da.x[1], daz, db.y); + if (dc.x[0] != 0.0f) + d2d_cdt_incircle_refine1(&fin, cxt_det_ab, &cxt_det_ab_len, det_ab, db.y[1], dbz, da.y[1], daz, dc.x); + if (dc.y[0] != 0.0f) + d2d_cdt_incircle_refine1(&fin, cyt_det_ab, &cyt_det_ab_len, det_ab, da.x[1], daz, db.x[1], dbz, dc.y); + + if (da.x[0] != 0.0f || da.y[0] != 0.0f) + d2d_cdt_incircle_refine2(&fin, &da, &db, dbz, &dc, dcz, + axt_det_bc, axt_det_bc_len, ayt_det_bc, ayt_det_bc_len); + if (db.x[0] != 0.0f || db.y[0] != 0.0f) + d2d_cdt_incircle_refine2(&fin, &db, &dc, dcz, &da, daz, + bxt_det_ca, bxt_det_ca_len, byt_det_ca, byt_det_ca_len); + if (dc.x[0] != 0.0f || dc.y[0] != 0.0f) + d2d_cdt_incircle_refine2(&fin, &dc, &da, daz, &db, dbz, + cxt_det_ab, cxt_det_ab_len, cyt_det_ab, cyt_det_ab_len); - return (da.x * da.x + da.y * da.y) * (db.x * dc.y - db.y * dc.x) - + (db.x * db.x + db.y * db.y) * (dc.x * da.y - dc.y * da.x) - + (dc.x * dc.x + dc.y * dc.y) * (da.x * db.y - da.y * db.x) > 0.0; + return fin.now[fin.length - 1] > 0.0f; } static void d2d_cdt_splice(const struct d2d_cdt *cdt, const struct d2d_cdt_edge_ref *a, @@ -592,6 +1170,10 @@ { const struct d2d_figure *figure = &geometry->u.path.figures[i]; + if (probe->x < figure->bounds.left || probe->x > figure->bounds.right + || probe->y < figure->bounds.top || probe->y > figure->bounds.bottom) + continue; + p0 = &figure->vertices[figure->vertex_count - 1]; for (j = 0; j < figure->vertex_count; p0 = p1, ++j) { @@ -652,8 +1234,7 @@ probe.x += cdt->vertices[d2d_cdt_edge_origin(cdt, &tmp)].x * 0.50f; probe.y += cdt->vertices[d2d_cdt_edge_origin(cdt, &tmp)].y * 0.50f; - d2d_cdt_edge_next_left(cdt, &tmp, &tmp); - if (tmp.idx == base_edge->idx && d2d_path_geometry_point_inside(geometry, &probe)) + if (d2d_cdt_leftof(cdt, face->v[2], base_edge) && d2d_path_geometry_point_inside(geometry, &probe)) ++geometry->face_count; return TRUE; @@ -712,7 +1293,12 @@ if (count > 1) { - if (!d2d_cdt_connect(cdt, &new_base, &candidate, base_edge)) + d2d_cdt_edge_next_left(cdt, &next, &candidate); + if (d2d_cdt_edge_destination(cdt, &next) == d2d_cdt_edge_origin(cdt, base_edge)) + d2d_cdt_edge_next_left(cdt, &next, base_edge); + else + next = *base_edge; + if (!d2d_cdt_connect(cdt, &new_base, &candidate, &next)) return FALSE; if (!d2d_cdt_fixup(cdt, &new_base)) return FALSE; @@ -728,6 +1314,7 @@ const struct d2d_cdt_edge_ref *base_edge, size_t start_vertex, size_t end_vertex) { struct d2d_cdt_edge_ref next; + float ccw; d2d_cdt_edge_next_left(cdt, &next, base_edge); if (d2d_cdt_edge_destination(cdt, &next) == end_vertex) @@ -736,7 +1323,14 @@ return; } - if (d2d_cdt_ccw(cdt, d2d_cdt_edge_destination(cdt, &next), end_vertex, start_vertex) > 0.0f) + ccw = d2d_cdt_ccw(cdt, d2d_cdt_edge_destination(cdt, &next), end_vertex, start_vertex); + if (ccw == 0.0f) + { + *end_edge = next; + return; + } + + if (ccw > 0.0f) d2d_cdt_edge_next_left(cdt, &next, &next); d2d_cdt_edge_sym(&next, &next); @@ -745,16 +1339,32 @@ } static BOOL d2d_cdt_insert_segment(struct d2d_cdt *cdt, struct d2d_geometry *geometry, - const struct d2d_cdt_edge_ref *origin, size_t end_vertex) + const struct d2d_cdt_edge_ref *origin, struct d2d_cdt_edge_ref *edge, size_t end_vertex) { - struct d2d_cdt_edge_ref base_edge, current, next, target; + struct d2d_cdt_edge_ref base_edge, current, new_origin, next, target; + size_t current_destination, current_origin; for (current = *origin;; current = next) { d2d_cdt_edge_next_origin(cdt, &next, ¤t); - if (d2d_cdt_edge_destination(cdt, ¤t) == end_vertex) + current_destination = d2d_cdt_edge_destination(cdt, ¤t); + if (current_destination == end_vertex) + { + d2d_cdt_edge_sym(edge, ¤t); return TRUE; + } + + current_origin = d2d_cdt_edge_origin(cdt, ¤t); + if (d2d_cdt_ccw(cdt, end_vertex, current_origin, current_destination) == 0.0f + && (cdt->vertices[current_destination].x > cdt->vertices[current_origin].x) + == (cdt->vertices[end_vertex].x > cdt->vertices[current_origin].x) + && (cdt->vertices[current_destination].y > cdt->vertices[current_origin].y) + == (cdt->vertices[end_vertex].y > cdt->vertices[current_origin].y)) + { + d2d_cdt_edge_sym(&new_origin, ¤t); + return d2d_cdt_insert_segment(cdt, geometry, &new_origin, edge, end_vertex); + } if (d2d_cdt_rightof(cdt, end_vertex, &next) && d2d_cdt_leftof(cdt, end_vertex, ¤t)) { @@ -766,13 +1376,17 @@ if (!d2d_cdt_connect(cdt, &base_edge, &target, ¤t)) return FALSE; + *edge = base_edge; if (!d2d_cdt_fixup(cdt, &base_edge)) return FALSE; d2d_cdt_edge_sym(&base_edge, &base_edge); if (!d2d_cdt_fixup(cdt, &base_edge)) return FALSE; - return TRUE; + if (d2d_cdt_edge_origin(cdt, edge) == end_vertex) + return TRUE; + new_origin = *edge; + return d2d_cdt_insert_segment(cdt, geometry, &new_origin, edge, end_vertex); } if (next.idx == origin->idx) @@ -786,9 +1400,10 @@ static BOOL d2d_cdt_insert_segments(struct d2d_cdt *cdt, struct d2d_geometry *geometry) { size_t start_vertex, end_vertex, i, j, k; + struct d2d_cdt_edge_ref edge, new_edge; const struct d2d_figure *figure; - struct d2d_cdt_edge_ref edge; const D2D1_POINT_2F *p; + BOOL found; for (i = 0; i < geometry->u.path.figure_count; ++i) { @@ -798,6 +1413,33 @@ geometry->vertex_count, sizeof(*p), d2d_cdt_compare_vertices); start_vertex = p - cdt->vertices; + for (k = 0, found = FALSE; k < cdt->edge_count; ++k) + { + if (cdt->edges[k].flags & D2D_CDT_EDGE_FLAG_FREED) + continue; + + edge.idx = k; + edge.r = 0; + + if (d2d_cdt_edge_origin(cdt, &edge) == start_vertex) + { + found = TRUE; + break; + } + d2d_cdt_edge_sym(&edge, &edge); + if (d2d_cdt_edge_origin(cdt, &edge) == start_vertex) + { + found = TRUE; + break; + } + } + + if (!found) + { + ERR("Edge not found.\n"); + return FALSE; + } + for (j = 0; j < figure->vertex_count; start_vertex = end_vertex, ++j) { p = bsearch(&figure->vertices[j], cdt->vertices, @@ -807,28 +1449,9 @@ if (start_vertex == end_vertex) continue; - for (k = 0; k < cdt->edge_count; ++k) - { - if (cdt->edges[k].flags & D2D_CDT_EDGE_FLAG_FREED) - continue; - - edge.idx = k; - edge.r = 0; - - if (d2d_cdt_edge_origin(cdt, &edge) == start_vertex) - { - if (!d2d_cdt_insert_segment(cdt, geometry, &edge, end_vertex)) - return FALSE; - break; - } - d2d_cdt_edge_sym(&edge, &edge); - if (d2d_cdt_edge_origin(cdt, &edge) == start_vertex) - { - if (!d2d_cdt_insert_segment(cdt, geometry, &edge, end_vertex)) - return FALSE; - break; - } - } + if (!d2d_cdt_insert_segment(cdt, geometry, &edge, &new_edge, end_vertex)) + return FALSE; + edge = new_edge; } } @@ -843,23 +1466,32 @@ { D2D1_POINT_2F p0, p1, q0, q1, v_p, v_q, v_qp, intersection; struct d2d_figure *figure_p, *figure_q; - size_t i, j, k, l, limit; + size_t i, j, k, l, min_j, min_l, max_l; float s, t, det; for (i = 0; i < geometry->u.path.figure_count; ++i) { figure_p = &geometry->u.path.figures[i]; p0 = figure_p->vertices[figure_p->vertex_count - 1]; + min_j = 0; + min_l = 0; for (k = 0; k < figure_p->vertex_count; p0 = p1, ++k) { p1 = figure_p->vertices[k]; d2d_point_subtract(&v_p, &p1, &p0); - for (j = 0; j < i || (j == i && k); ++j) + for (j = min_j, min_j = 0, l = min_l, min_l = 0; j < i || (j == i && k); ++j, l = 0) { figure_q = &geometry->u.path.figures[j]; - limit = j == i ? k - 1 : figure_q->vertex_count; - q0 = figure_q->vertices[figure_q->vertex_count - 1]; - for (l = 0; l < limit; q0 = q1, ++l) + + if (figure_p->bounds.left > figure_q->bounds.right + || figure_q->bounds.left > figure_p->bounds.right + || figure_p->bounds.top > figure_q->bounds.bottom + || figure_q->bounds.top > figure_p->bounds.bottom) + continue; + + max_l = j == i ? k - 1 : figure_q->vertex_count; + q0 = figure_q->vertices[l == 0 ? figure_q->vertex_count - 1 : l - 1]; + for (; l < max_l; q0 = q1, ++l) { q1 = figure_q->vertices[l]; d2d_point_subtract(&v_q, &q1, &q0); @@ -884,7 +1516,7 @@ return FALSE; if (j == i) ++k; - ++limit; + ++max_l; ++l; } @@ -892,6 +1524,8 @@ { if (!d2d_figure_insert_vertex(figure_p, k, intersection)) return FALSE; + min_j = j; + min_l = l+1; p1 = intersection; d2d_point_subtract(&v_p, &p1, &p0); } @@ -979,6 +1613,10 @@ figure = &geometry->u.path.figures[geometry->u.path.figure_count]; memset(figure, 0, sizeof(*figure)); + figure->bounds.left = FLT_MAX; + figure->bounds.top = FLT_MAX; + figure->bounds.right = -FLT_MAX; + figure->bounds.bottom = -FLT_MAX; ++geometry->u.path.figure_count; return TRUE; diff -Nru wine1.7-1.7.50/dlls/d2d1/Makefile.in wine1.7-1.7.55/dlls/d2d1/Makefile.in --- wine1.7-1.7.50/dlls/d2d1/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d2d1/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -15,3 +15,5 @@ wic_render_target.c RC_SRCS = version.rc + +geometry_EXTRADEFS = $(EXCESS_PRECISION_CFLAGS) diff -Nru wine1.7-1.7.50/dlls/d2d1/tests/d2d1.c wine1.7-1.7.55/dlls/d2d1/tests/d2d1.c --- wine1.7-1.7.50/dlls/d2d1/tests/d2d1.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d2d1/tests/d2d1.c 2015-11-13 14:32:40.000000000 +0000 @@ -1630,6 +1630,46 @@ ID2D1TransformedGeometry_Release(transformed_geometry); ID2D1PathGeometry_Release(geometry); + hr = ID2D1Factory_CreatePathGeometry(factory, &geometry); + ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr); + hr = ID2D1PathGeometry_Open(geometry, &sink); + ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr); + + set_point(&point, 40.0f, 20.0f); + ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_FILLED); + set_point(&point, 75.0f, 300.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 5.0f, 300.0f); + ID2D1GeometrySink_AddLine(sink, point); + ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED); + + set_point(&point, 40.0f, 290.0f); + ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_FILLED); + set_point(&point, 55.0f, 160.0f); + ID2D1GeometrySink_AddLine(sink, point); + set_point(&point, 25.0f, 160.0f); + ID2D1GeometrySink_AddLine(sink, point); + ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED); + + hr = ID2D1GeometrySink_Close(sink); + ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr); + hr = ID2D1PathGeometry_GetFigureCount(geometry, &count); + ok(SUCCEEDED(hr), "Failed to get figure count, hr %#x.\n", hr); + ok(count == 2, "Got unexpected figure count %u.\n", count); + hr = ID2D1PathGeometry_GetSegmentCount(geometry, &count); + ok(SUCCEEDED(hr), "Failed to get segment count, hr %#x.\n", hr); + ok(count == 6, "Got unexpected segment count %u.\n", count); + ID2D1GeometrySink_Release(sink); + + ID2D1RenderTarget_BeginDraw(rt); + ID2D1RenderTarget_Clear(rt, &color); + ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)geometry, (ID2D1Brush *)brush, NULL); + hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr); + match = compare_surface(surface, "a875e68e0cb9c055927b1b50b879f90b24e38470"); + ok(match, "Surface does not match.\n"); + ID2D1PathGeometry_Release(geometry); + ID2D1SolidColorBrush_Release(brush); ID2D1RenderTarget_Release(rt); refcount = ID2D1Factory_Release(factory); diff -Nru wine1.7-1.7.50/dlls/d3d10_1/tests/d3d10_1.c wine1.7-1.7.55/dlls/d3d10_1/tests/d3d10_1.c --- wine1.7-1.7.50/dlls/d3d10_1/tests/d3d10_1.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d10_1/tests/d3d10_1.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,458 @@ +/* + * Copyright 2008 Henri Verbeet for CodeWeavers + * Copyright 2015 Józef Kucia for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS +#include "initguid.h" +#include "d3d11.h" +#include "wine/test.h" + +static const D3D10_FEATURE_LEVEL1 d3d10_feature_levels[] = +{ + D3D10_FEATURE_LEVEL_10_1, + D3D10_FEATURE_LEVEL_10_0, + D3D10_FEATURE_LEVEL_9_3, + D3D10_FEATURE_LEVEL_9_2, + D3D10_FEATURE_LEVEL_9_1 +}; + +static ULONG get_refcount(IUnknown *iface) +{ + IUnknown_AddRef(iface); + return IUnknown_Release(iface); +} + +static ID3D10Device1 *create_device(D3D10_FEATURE_LEVEL1 feature_level) +{ + ID3D10Device1 *device; + + if (SUCCEEDED(D3D10CreateDevice1(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, 0, feature_level, D3D10_1_SDK_VERSION, + &device))) + return device; + if (SUCCEEDED(D3D10CreateDevice1(NULL, D3D10_DRIVER_TYPE_WARP, NULL, 0, feature_level, D3D10_1_SDK_VERSION, + &device))) + return device; + if (SUCCEEDED(D3D10CreateDevice1(NULL, D3D10_DRIVER_TYPE_REFERENCE, NULL, 0, feature_level, D3D10_1_SDK_VERSION, + &device))) + return device; + + return NULL; +} + +static void test_device_interfaces(void) +{ + IDXGIAdapter *dxgi_adapter; + IDXGIDevice *dxgi_device; + ID3D10Device1 *device; + IUnknown *iface; + ULONG refcount; + unsigned int i; + HRESULT hr; + + for (i = 0; i < sizeof(d3d10_feature_levels) / sizeof(*d3d10_feature_levels); ++i) + { + if (!(device = create_device(d3d10_feature_levels[i]))) + { + skip("Failed to create device for feature level %#x.\n", d3d10_feature_levels[i]); + continue; + } + + hr = ID3D10Device1_QueryInterface(device, &IID_IUnknown, (void **)&iface); + ok(SUCCEEDED(hr), "Device should implement IUnknown interface, hr %#x.\n", hr); + IUnknown_Release(iface); + + hr = ID3D10Device1_QueryInterface(device, &IID_IDXGIObject, (void **)&iface); + ok(SUCCEEDED(hr), "Device should implement IDXGIObject interface, hr %#x.\n", hr); + IUnknown_Release(iface); + + hr = ID3D10Device1_QueryInterface(device, &IID_IDXGIDevice, (void **)&dxgi_device); + ok(SUCCEEDED(hr), "Device should implement IDXGIDevice.\n"); + hr = IDXGIDevice_GetParent(dxgi_device, &IID_IDXGIAdapter, (void **)&dxgi_adapter); + ok(SUCCEEDED(hr), "Device parent should implement IDXGIAdapter.\n"); + hr = IDXGIAdapter_GetParent(dxgi_adapter, &IID_IDXGIFactory, (void **)&iface); + ok(SUCCEEDED(hr), "Adapter parent should implement IDXGIFactory.\n"); + IUnknown_Release(iface); + IDXGIAdapter_Release(dxgi_adapter); + hr = IDXGIDevice_GetParent(dxgi_device, &IID_IDXGIAdapter1, (void **)&dxgi_adapter); + ok(SUCCEEDED(hr), "Device parent should implement IDXGIAdapter1.\n"); + hr = IDXGIAdapter_GetParent(dxgi_adapter, &IID_IDXGIFactory1, (void **)&iface); + ok(hr == E_NOINTERFACE, "Adapter parent should not implement IDXGIFactory1.\n"); + IDXGIAdapter_Release(dxgi_adapter); + IDXGIDevice_Release(dxgi_device); + + hr = ID3D10Device1_QueryInterface(device, &IID_IDXGIDevice1, (void **)&iface); + ok(SUCCEEDED(hr), "Device should implement IDXGIDevice1.\n"); + IUnknown_Release(iface); + + hr = ID3D10Device1_QueryInterface(device, &IID_ID3D10Multithread, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Device should implement ID3D10Multithread interface, hr %#x.\n", hr); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + + hr = ID3D10Device1_QueryInterface(device, &IID_ID3D10Device, (void **)&iface); + ok(SUCCEEDED(hr), "Device should implement ID3D10Device interface, hr %#x.\n", hr); + IUnknown_Release(iface); + + hr = ID3D10Device1_QueryInterface(device, &IID_ID3D11Device, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Device should implement ID3D11Device interface, hr %#x.\n", hr); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + + refcount = ID3D10Device1_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + } +} + +static void test_create_shader_resource_view(void) +{ + D3D10_SHADER_RESOURCE_VIEW_DESC1 srv_desc; + D3D10_TEXTURE2D_DESC texture_desc; + ULONG refcount, expected_refcount; + ID3D10ShaderResourceView1 *srview; + D3D10_BUFFER_DESC buffer_desc; + ID3D10Texture2D *texture; + ID3D10Device *tmp_device; + ID3D10Device1 *device; + ID3D10Buffer *buffer; + IUnknown *iface; + HRESULT hr; + + if (!(device = create_device(D3D10_FEATURE_LEVEL_10_1))) + { + skip("Failed to create device.\n"); + return; + } + + buffer_desc.ByteWidth = 1024; + buffer_desc.Usage = D3D10_USAGE_DEFAULT; + buffer_desc.BindFlags = D3D10_BIND_SHADER_RESOURCE; + buffer_desc.CPUAccessFlags = 0; + buffer_desc.MiscFlags = 0; + + hr = ID3D10Device1_CreateBuffer(device, &buffer_desc, NULL, &buffer); + ok(SUCCEEDED(hr), "Failed to create a buffer, hr %#x\n", hr); + + hr = ID3D10Device1_CreateShaderResourceView1(device, (ID3D10Resource *)buffer, NULL, &srview); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + srv_desc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT; + srv_desc.ViewDimension = D3D10_1_SRV_DIMENSION_BUFFER; + U(srv_desc).Buffer.ElementOffset = 0; + U(srv_desc).Buffer.ElementWidth = 64; + + expected_refcount = get_refcount((IUnknown *)device) + 1; + hr = ID3D10Device1_CreateShaderResourceView1(device, (ID3D10Resource *)buffer, &srv_desc, &srview); + ok(SUCCEEDED(hr), "Failed to create a shader resource view, hr %#x\n", hr); + refcount = get_refcount((IUnknown *)device); + ok(refcount >= expected_refcount, "Got unexpected refcount %u, expected >= %u.\n", refcount, expected_refcount); + tmp_device = NULL; + expected_refcount = refcount + 1; + ID3D10ShaderResourceView1_GetDevice(srview, &tmp_device); + ok(tmp_device == (ID3D10Device *)device, "Got unexpected device %p, expected %p.\n", tmp_device, device); + refcount = get_refcount((IUnknown *)device); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + ID3D10Device_Release(tmp_device); + + hr = ID3D10ShaderResourceView1_QueryInterface(srview, &IID_ID3D10ShaderResourceView, (void **)&iface); + ok(SUCCEEDED(hr), "Shader resource view should implement ID3D10ShaderResourceView.\n"); + IUnknown_Release(iface); + hr = ID3D10ShaderResourceView1_QueryInterface(srview, &IID_ID3D11ShaderResourceView, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Shader resource view should implement ID3D11ShaderResourceView.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + + ID3D10ShaderResourceView1_Release(srview); + ID3D10Buffer_Release(buffer); + + texture_desc.Width = 512; + texture_desc.Height = 512; + texture_desc.MipLevels = 0; + 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_SHADER_RESOURCE; + texture_desc.CPUAccessFlags = 0; + texture_desc.MiscFlags = 0; + + hr = ID3D10Device1_CreateTexture2D(device, &texture_desc, NULL, &texture); + ok(SUCCEEDED(hr), "Failed to create a 2d texture, hr %#x\n", hr); + + hr = ID3D10Device1_CreateShaderResourceView1(device, (ID3D10Resource *)texture, NULL, &srview); + ok(SUCCEEDED(hr), "Failed to create a shader resource view, hr %#x\n", hr); + + ID3D10ShaderResourceView1_GetDesc1(srview, &srv_desc); + ok(srv_desc.Format == texture_desc.Format, "Got unexpected format %#x.\n", srv_desc.Format); + ok(srv_desc.ViewDimension == D3D10_1_SRV_DIMENSION_TEXTURE2D, + "Got unexpected view dimension %#x.\n", srv_desc.ViewDimension); + ok(U(srv_desc).Texture2D.MostDetailedMip == 0, "Got unexpected MostDetailedMip %u.\n", + U(srv_desc).Texture2D.MostDetailedMip); + ok(U(srv_desc).Texture2D.MipLevels == 10, "Got unexpected MipLevels %u.\n", U(srv_desc).Texture2D.MipLevels); + + hr = ID3D10ShaderResourceView1_QueryInterface(srview, &IID_ID3D10ShaderResourceView, (void **)&iface); + ok(SUCCEEDED(hr), "Shader resource view should implement ID3D10ShaderResourceView.\n"); + IUnknown_Release(iface); + hr = ID3D10ShaderResourceView1_QueryInterface(srview, &IID_ID3D11ShaderResourceView, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Shader resource view should implement ID3D11ShaderResourceView.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + + ID3D10ShaderResourceView1_Release(srview); + ID3D10Texture2D_Release(texture); + + refcount = ID3D10Device1_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + +static void test_create_blend_state(void) +{ + static const D3D10_BLEND_DESC1 desc_conversion_tests[] = + { + { + FALSE, FALSE, + { + { + FALSE, D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, + D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD + }, + }, + }, + { + FALSE, TRUE, + { + { + TRUE, D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, + D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, D3D10_COLOR_WRITE_ENABLE_ALL + }, + { + FALSE, D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, + D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, D3D10_COLOR_WRITE_ENABLE_RED + }, + { + TRUE, D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, + D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, D3D10_COLOR_WRITE_ENABLE_ALL + }, + { + FALSE, D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, + D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, D3D10_COLOR_WRITE_ENABLE_GREEN + }, + { + TRUE, D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, + D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, D3D10_COLOR_WRITE_ENABLE_ALL + }, + { + TRUE, D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, + D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, D3D10_COLOR_WRITE_ENABLE_ALL + }, + { + TRUE, D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, + D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, D3D10_COLOR_WRITE_ENABLE_ALL + }, + { + TRUE, D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, + D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, D3D10_COLOR_WRITE_ENABLE_ALL + }, + }, + }, + { + FALSE, TRUE, + { + { + TRUE, D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, + D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, D3D10_COLOR_WRITE_ENABLE_ALL + }, + { + TRUE, D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_SUBTRACT, + D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, D3D10_COLOR_WRITE_ENABLE_ALL + }, + { + TRUE, D3D10_BLEND_ZERO, D3D10_BLEND_ONE, D3D10_BLEND_OP_ADD, + D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, D3D10_COLOR_WRITE_ENABLE_ALL + }, + { + TRUE, D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, + D3D10_BLEND_ZERO, D3D10_BLEND_ONE, D3D10_BLEND_OP_ADD, D3D10_COLOR_WRITE_ENABLE_ALL + }, + { + TRUE, D3D10_BLEND_ONE, D3D10_BLEND_ONE, D3D10_BLEND_OP_MAX, + D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, D3D10_COLOR_WRITE_ENABLE_ALL + }, + { + TRUE, D3D10_BLEND_ONE, D3D10_BLEND_ONE, D3D10_BLEND_OP_MIN, + D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, D3D10_COLOR_WRITE_ENABLE_ALL + }, + { + FALSE, D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, + D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, D3D10_COLOR_WRITE_ENABLE_ALL + }, + { + FALSE, D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, + D3D10_BLEND_ONE, D3D10_BLEND_ZERO, D3D10_BLEND_OP_ADD, D3D10_COLOR_WRITE_ENABLE_ALL + }, + }, + }, + }; + + ID3D10BlendState1 *blend_state1, *blend_state2; + D3D10_BLEND_DESC1 desc, obtained_desc; + ID3D10BlendState *d3d10_blend_state; + D3D10_BLEND_DESC d3d10_blend_desc; + ULONG refcount, expected_refcount; + ID3D10Device1 *device; + ID3D10Device *tmp; + unsigned int i, j; + IUnknown *iface; + HRESULT hr; + + if (!(device = create_device(D3D10_FEATURE_LEVEL_10_1))) + { + skip("Failed to create device.\n"); + return; + } + + hr = ID3D10Device1_CreateBlendState1(device, NULL, &blend_state1); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + memset(&desc, 0, sizeof(desc)); + desc.AlphaToCoverageEnable = FALSE; + desc.IndependentBlendEnable = FALSE; + desc.RenderTarget[0].BlendEnable = FALSE; + desc.RenderTarget[0].SrcBlend = D3D10_BLEND_ONE; + desc.RenderTarget[0].DestBlend = D3D10_BLEND_ZERO; + desc.RenderTarget[0].BlendOp = D3D10_BLEND_OP_ADD; + desc.RenderTarget[0].SrcBlendAlpha = D3D10_BLEND_ONE; + desc.RenderTarget[0].DestBlendAlpha = D3D10_BLEND_ZERO; + desc.RenderTarget[0].BlendOpAlpha = D3D10_BLEND_OP_ADD; + desc.RenderTarget[0].RenderTargetWriteMask = D3D10_COLOR_WRITE_ENABLE_ALL; + + expected_refcount = get_refcount((IUnknown *)device) + 1; + hr = ID3D10Device1_CreateBlendState1(device, &desc, &blend_state1); + ok(SUCCEEDED(hr), "Failed to create blend state, hr %#x.\n", hr); + hr = ID3D10Device1_CreateBlendState1(device, &desc, &blend_state2); + ok(SUCCEEDED(hr), "Failed to create blend state, hr %#x.\n", hr); + ok(blend_state1 == blend_state2, "Got different blend state objects.\n"); + refcount = get_refcount((IUnknown *)device); + ok(refcount >= expected_refcount, "Got unexpected refcount %u, expected >= %u.\n", refcount, expected_refcount); + tmp = NULL; + expected_refcount = refcount + 1; + ID3D10BlendState1_GetDevice(blend_state1, &tmp); + ok(tmp == (ID3D10Device *)device, "Got unexpected device %p, expected %p.\n", tmp, device); + refcount = get_refcount((IUnknown *)device); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + ID3D10Device_Release(tmp); + + ID3D10BlendState1_GetDesc1(blend_state1, &obtained_desc); + ok(obtained_desc.AlphaToCoverageEnable == FALSE, "Got unexpected alpha to coverage enable %#x.\n", + obtained_desc.AlphaToCoverageEnable); + ok(obtained_desc.IndependentBlendEnable == FALSE, "Got unexpected independent blend enable %#x.\n", + obtained_desc.IndependentBlendEnable); + for (i = 0; i < D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i) + { + ok(obtained_desc.RenderTarget[i].BlendEnable == FALSE, + "Got unexpected blend enable %#x for render target %u.\n", + obtained_desc.RenderTarget[i].BlendEnable, i); + ok(obtained_desc.RenderTarget[i].SrcBlend == D3D10_BLEND_ONE, + "Got unexpected src blend %u for render target %u.\n", + obtained_desc.RenderTarget[i].SrcBlend, i); + ok(obtained_desc.RenderTarget[i].DestBlend == D3D10_BLEND_ZERO, + "Got unexpected dest blend %u for render target %u.\n", + obtained_desc.RenderTarget[i].DestBlend, i); + ok(obtained_desc.RenderTarget[i].BlendOp == D3D10_BLEND_OP_ADD, + "Got unexpected blend op %u for render target %u.\n", + obtained_desc.RenderTarget[i].BlendOp, i); + ok(obtained_desc.RenderTarget[i].SrcBlendAlpha == D3D10_BLEND_ONE, + "Got unexpected src blend alpha %u for render target %u.\n", + obtained_desc.RenderTarget[i].SrcBlendAlpha, i); + ok(obtained_desc.RenderTarget[i].DestBlendAlpha == D3D10_BLEND_ZERO, + "Got unexpected dest blend alpha %u for render target %u.\n", + obtained_desc.RenderTarget[i].DestBlendAlpha, i); + ok(obtained_desc.RenderTarget[i].BlendOpAlpha == D3D10_BLEND_OP_ADD, + "Got unexpected blend op alpha %u for render target %u.\n", + obtained_desc.RenderTarget[i].BlendOpAlpha, i); + ok(obtained_desc.RenderTarget[i].RenderTargetWriteMask == D3D10_COLOR_WRITE_ENABLE_ALL, + "Got unexpected render target write mask %#x for render target %u.\n", + obtained_desc.RenderTarget[0].RenderTargetWriteMask, i); + } + + hr = ID3D10BlendState1_QueryInterface(blend_state1, &IID_ID3D10BlendState, (void **)&iface); + ok(SUCCEEDED(hr), "Blend state should implement ID3D10BlendState.\n"); + IUnknown_Release(iface); + hr = ID3D10BlendState1_QueryInterface(blend_state1, &IID_ID3D11BlendState, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Blend state should implement ID3D11BlendState.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + + refcount = ID3D10BlendState1_Release(blend_state1); + ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + refcount = ID3D10BlendState1_Release(blend_state2); + ok(!refcount, "Blend state has %u references left.\n", refcount); + + for (i = 0; i < sizeof(desc_conversion_tests) / sizeof(*desc_conversion_tests); ++i) + { + const D3D10_BLEND_DESC1 *current_desc = &desc_conversion_tests[i]; + + hr = ID3D10Device1_CreateBlendState1(device, current_desc, &blend_state1); + ok(SUCCEEDED(hr), "Failed to create blend state, hr %#x.\n", hr); + + hr = ID3D10BlendState1_QueryInterface(blend_state1, &IID_ID3D10BlendState, (void **)&d3d10_blend_state); + ok(SUCCEEDED(hr), "Blend state should implement ID3D10BlendState.\n"); + + ID3D10BlendState_GetDesc(d3d10_blend_state, &d3d10_blend_desc); + ok(d3d10_blend_desc.AlphaToCoverageEnable == current_desc->AlphaToCoverageEnable, + "Got unexpected alpha to coverage enable %#x for test %u.\n", + d3d10_blend_desc.AlphaToCoverageEnable, i); + ok(d3d10_blend_desc.SrcBlend == current_desc->RenderTarget[0].SrcBlend, + "Got unexpected src blend %u for test %u.\n", d3d10_blend_desc.SrcBlend, i); + ok(d3d10_blend_desc.DestBlend == current_desc->RenderTarget[0].DestBlend, + "Got unexpected dest blend %u for test %u.\n", d3d10_blend_desc.DestBlend, i); + ok(d3d10_blend_desc.BlendOp == current_desc->RenderTarget[0].BlendOp, + "Got unexpected blend op %u for test %u.\n", d3d10_blend_desc.BlendOp, i); + ok(d3d10_blend_desc.SrcBlendAlpha == current_desc->RenderTarget[0].SrcBlendAlpha, + "Got unexpected src blend alpha %u for test %u.\n", d3d10_blend_desc.SrcBlendAlpha, i); + ok(d3d10_blend_desc.DestBlendAlpha == current_desc->RenderTarget[0].DestBlendAlpha, + "Got unexpected dest blend alpha %u for test %u.\n", d3d10_blend_desc.DestBlendAlpha, i); + ok(d3d10_blend_desc.BlendOpAlpha == current_desc->RenderTarget[0].BlendOpAlpha, + "Got unexpected blend op alpha %u for test %u.\n", d3d10_blend_desc.BlendOpAlpha, i); + for (j = 0; j < D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT; j++) + { + unsigned int k = current_desc->IndependentBlendEnable ? j : 0; + ok(d3d10_blend_desc.BlendEnable[j] == current_desc->RenderTarget[k].BlendEnable, + "Got unexpected blend enable %#x for test %u, render target %u.\n", + d3d10_blend_desc.BlendEnable[j], i, j); + ok(d3d10_blend_desc.RenderTargetWriteMask[j] == current_desc->RenderTarget[k].RenderTargetWriteMask, + "Got unexpected render target write mask %#x for test %u, render target %u.\n", + d3d10_blend_desc.RenderTargetWriteMask[j], i, j); + } + + ID3D10BlendState_Release(d3d10_blend_state); + + refcount = ID3D10BlendState1_Release(blend_state1); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + } + + refcount = ID3D10Device1_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + +START_TEST(d3d10_1) +{ + test_device_interfaces(); + test_create_shader_resource_view(); + test_create_blend_state(); +} diff -Nru wine1.7-1.7.50/dlls/d3d10_1/tests/Makefile.in wine1.7-1.7.55/dlls/d3d10_1/tests/Makefile.in --- wine1.7-1.7.50/dlls/d3d10_1/tests/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d10_1/tests/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,5 @@ +TESTDLL = d3d10_1.dll +IMPORTS = d3d10_1 + +C_SRCS = \ + d3d10_1.c diff -Nru wine1.7-1.7.50/dlls/d3d10core/d3d10core_main.c wine1.7-1.7.55/dlls/d3d10core/d3d10core_main.c --- wine1.7-1.7.50/dlls/d3d10core/d3d10core_main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d10core/d3d10core_main.c 2015-11-13 14:32:40.000000000 +0000 @@ -22,7 +22,6 @@ #include "initguid.h" #define COBJMACROS -#include "d3d10_1.h" #include "d3d11.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d10core); diff -Nru wine1.7-1.7.50/dlls/d3d10core/tests/device.c wine1.7-1.7.55/dlls/d3d10core/tests/device.c --- wine1.7-1.7.50/dlls/d3d10core/tests/device.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d10core/tests/device.c 2015-11-13 14:32:40.000000000 +0000 @@ -18,7 +18,7 @@ #define COBJMACROS #include "initguid.h" -#include "d3d10.h" +#include "d3d11.h" #include "wine/test.h" #include @@ -85,33 +85,68 @@ return TRUE; } -static DWORD get_texture_color(ID3D10Texture2D *src_texture, unsigned int x, unsigned int y) +struct texture_readback { + ID3D10Texture2D *texture; D3D10_MAPPED_TEXTURE2D mapped_texture; +}; + +static void get_texture_readback(ID3D10Texture2D *texture, struct texture_readback *rb) +{ D3D10_TEXTURE2D_DESC texture_desc; - ID3D10Texture2D *dst_texture; ID3D10Device *device; - DWORD color; HRESULT hr; - ID3D10Texture2D_GetDevice(src_texture, &device); + memset(rb, 0, sizeof(*rb)); + + ID3D10Texture2D_GetDevice(texture, &device); - ID3D10Texture2D_GetDesc(src_texture, &texture_desc); + ID3D10Texture2D_GetDesc(texture, &texture_desc); texture_desc.Usage = D3D10_USAGE_STAGING; texture_desc.BindFlags = 0; texture_desc.CPUAccessFlags = D3D10_CPU_ACCESS_READ; texture_desc.MiscFlags = 0; - hr = ID3D10Device_CreateTexture2D(device, &texture_desc, NULL, &dst_texture); - ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + if (FAILED(hr = ID3D10Device_CreateTexture2D(device, &texture_desc, NULL, &rb->texture))) + { + trace("Failed to create texture, hr %#x.\n", hr); + ID3D10Device_Release(device); + return; + } - ID3D10Device_CopyResource(device, (ID3D10Resource *)dst_texture, (ID3D10Resource *)src_texture); - hr = ID3D10Texture2D_Map(dst_texture, 0, D3D10_MAP_READ, 0, &mapped_texture); - ok(SUCCEEDED(hr), "Failed to map texture, hr %#x.\n", hr); - color = *(DWORD *)(((BYTE *)mapped_texture.pData) + mapped_texture.RowPitch * y + x * 4); - ID3D10Texture2D_Unmap(dst_texture, 0); + ID3D10Device_CopyResource(device, (ID3D10Resource *)rb->texture, (ID3D10Resource *)texture); + if (FAILED(hr = ID3D10Texture2D_Map(rb->texture, 0, D3D10_MAP_READ, 0, &rb->mapped_texture))) + { + trace("Failed to map texture, hr %#x.\n", hr); + ID3D10Texture2D_Release(rb->texture); + rb->texture = NULL; + } - ID3D10Texture2D_Release(dst_texture); ID3D10Device_Release(device); +} + +static DWORD get_readback_color(struct texture_readback *rb, unsigned int x, unsigned int y) +{ + return rb->texture + ? ((DWORD *)rb->mapped_texture.pData)[rb->mapped_texture.RowPitch * y / sizeof(DWORD) + x] : 0xdeadbeef; +} + +static void release_texture_readback(struct texture_readback *rb) +{ + if (!rb->texture) + return; + + ID3D10Texture2D_Unmap(rb->texture, 0); + ID3D10Texture2D_Release(rb->texture); +} + +static DWORD get_texture_color(ID3D10Texture2D *texture, unsigned int x, unsigned int y) +{ + struct texture_readback rb; + DWORD color; + + get_texture_readback(texture, &rb); + color = get_readback_color(&rb, x, y); + release_texture_readback(&rb); return color; } @@ -171,6 +206,98 @@ return swapchain; } +static void test_feature_level(void) +{ + D3D_FEATURE_LEVEL feature_level; + ID3D11Device *device11; + ID3D10Device *device10; + HRESULT hr; + + if (!(device10 = create_device())) + { + skip("Failed to create device, skipping tests.\n"); + return; + } + + hr = ID3D10Device_QueryInterface(device10, &IID_ID3D11Device, (void **)&device11); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Failed to query ID3D11Device interface, hr %#x.\n", hr); + if (FAILED(hr)) + { + win_skip("D3D11 is not available.\n"); + ID3D10Device_Release(device10); + return; + } + + /* Device was created by D3D10CreateDevice. */ + feature_level = ID3D11Device_GetFeatureLevel(device11); + ok(feature_level == D3D_FEATURE_LEVEL_10_0, "Got unexpected feature level %#x.\n", feature_level); + + ID3D11Device_Release(device11); + ID3D10Device_Release(device10); +} + +static void test_device_interfaces(void) +{ + IDXGIAdapter *dxgi_adapter; + IDXGIDevice *dxgi_device; + ID3D10Device *device; + IUnknown *iface; + ULONG refcount; + HRESULT hr; + + if (!(device = create_device())) + { + skip("Failed to create device.\n"); + return; + } + + hr = ID3D10Device_QueryInterface(device, &IID_IUnknown, (void **)&iface); + ok(SUCCEEDED(hr), "Device should implement IUnknown interface, hr %#x.\n", hr); + IUnknown_Release(iface); + + hr = ID3D10Device_QueryInterface(device, &IID_IDXGIObject, (void **)&iface); + ok(SUCCEEDED(hr), "Device should implement IDXGIObject interface, hr %#x.\n", hr); + IUnknown_Release(iface); + + hr = ID3D10Device_QueryInterface(device, &IID_IDXGIDevice, (void **)&dxgi_device); + ok(SUCCEEDED(hr), "Device should implement IDXGIDevice.\n"); + hr = IDXGIDevice_GetParent(dxgi_device, &IID_IDXGIAdapter, (void **)&dxgi_adapter); + ok(SUCCEEDED(hr), "Device parent should implement IDXGIAdapter.\n"); + hr = IDXGIAdapter_GetParent(dxgi_adapter, &IID_IDXGIFactory, (void **)&iface); + ok(SUCCEEDED(hr), "Adapter parent should implement IDXGIFactory.\n"); + IUnknown_Release(iface); + IUnknown_Release(dxgi_adapter); + hr = IDXGIDevice_GetParent(dxgi_device, &IID_IDXGIAdapter1, (void **)&dxgi_adapter); + ok(SUCCEEDED(hr), "Device parent should implement IDXGIAdapter1.\n"); + hr = IDXGIAdapter_GetParent(dxgi_adapter, &IID_IDXGIFactory1, (void **)&iface); + ok(hr == E_NOINTERFACE, "Adapter parent should not implement IDXGIFactory1.\n"); + IUnknown_Release(dxgi_adapter); + IUnknown_Release(dxgi_device); + + hr = ID3D10Device_QueryInterface(device, &IID_IDXGIDevice1, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Device should implement IDXGIDevice1.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + + hr = ID3D10Device_QueryInterface(device, &IID_ID3D10Multithread, (void **)&iface); + ok(SUCCEEDED(hr), "Device should implement ID3D10Multithread interface, hr %#x.\n", hr); + IUnknown_Release(iface); + + hr = ID3D10Device_QueryInterface(device, &IID_ID3D10Device1, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Device should implement ID3D10Device1 interface, hr %#x.\n", hr); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + + hr = ID3D10Device_QueryInterface(device, &IID_ID3D11Device, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Device should implement ID3D11Device interface, hr %#x.\n", hr); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + + refcount = ID3D10Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + static void test_create_texture2d(void) { ULONG refcount, expected_refcount; @@ -266,6 +393,146 @@ ok(!refcount, "Device has %u references left.\n", refcount); } +static void test_texture2d_interfaces(void) +{ + ID3D11Texture2D *d3d11_texture; + D3D10_TEXTURE2D_DESC desc; + ID3D10Texture2D *texture; + IDXGISurface *surface; + ID3D10Device *device; + unsigned int i; + ULONG refcount; + HRESULT hr; + + static const struct test + { + UINT bind_flags; + UINT misc_flags; + UINT expected_bind_flags; + UINT expected_misc_flags; + } + desc_conversion_tests[] = + { + { + D3D10_BIND_RENDER_TARGET, 0, + D3D11_BIND_RENDER_TARGET, 0 + }, + { + 0, D3D10_RESOURCE_MISC_SHARED, + 0, D3D11_RESOURCE_MISC_SHARED + }, + }; + + if (!(device = create_device())) + { + skip("Failed to create device, skipping tests.\n"); + return; + } + + desc.Width = 512; + desc.Height = 512; + desc.MipLevels = 0; + desc.ArraySize = 1; + desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + desc.SampleDesc.Count = 1; + desc.SampleDesc.Quality = 0; + desc.Usage = D3D11_USAGE_DEFAULT; + desc.BindFlags = D3D11_BIND_RENDER_TARGET; + desc.CPUAccessFlags = 0; + desc.MiscFlags = 0; + + hr = ID3D10Device_CreateTexture2D(device, &desc, NULL, &texture); + ok(SUCCEEDED(hr), "Failed to create a 2d texture, hr %#x.\n", hr); + + hr = ID3D10Texture2D_QueryInterface(texture, &IID_IDXGISurface, (void **)&surface); + ok(hr == E_NOINTERFACE, "Texture should not implement IDXGISurface.\n"); + + hr = ID3D10Texture2D_QueryInterface(texture, &IID_ID3D11Texture2D, (void **)&d3d11_texture); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Texture should implement ID3D11Texture2D.\n"); + if (SUCCEEDED(hr)) ID3D11Texture2D_Release(d3d11_texture); + ID3D10Texture2D_Release(texture); + + if (FAILED(hr)) + { + win_skip("D3D11 is not available, skipping tests.\n"); + ID3D10Device_Release(device); + return; + } + + for (i = 0; i < sizeof(desc_conversion_tests) / sizeof(*desc_conversion_tests); ++i) + { + const struct test *current = &desc_conversion_tests[i]; + D3D11_TEXTURE2D_DESC d3d11_desc; + ID3D11Device *d3d11_device; + + desc.Width = 512; + desc.Height = 512; + desc.MipLevels = 1; + desc.ArraySize = 1; + desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + desc.SampleDesc.Count = 1; + desc.SampleDesc.Quality = 0; + desc.Usage = D3D10_USAGE_DEFAULT; + desc.BindFlags = current->bind_flags; + desc.CPUAccessFlags = 0; + desc.MiscFlags = current->misc_flags; + + hr = ID3D10Device_CreateTexture2D(device, &desc, NULL, &texture); + /* Shared resources are not supported by REF and WARP devices. */ + ok(SUCCEEDED(hr) || broken(hr == E_OUTOFMEMORY), + "Test %u: Failed to create a 2d texture, hr %#x.\n", i, hr); + if (FAILED(hr)) + { + win_skip("Failed to create ID3D10Texture2D, skipping test %u.\n", i); + continue; + } + + hr = ID3D10Texture2D_QueryInterface(texture, &IID_IDXGISurface, (void **)&surface); + ok(SUCCEEDED(hr), "Test %u: Texture should implement IDXGISurface.\n", i); + IDXGISurface_Release(surface); + + hr = ID3D10Texture2D_QueryInterface(texture, &IID_ID3D11Texture2D, (void **)&d3d11_texture); + ok(SUCCEEDED(hr), "Test %u: Texture should implement ID3D11Texture2D.\n", i); + ID3D10Texture2D_Release(texture); + + ID3D11Texture2D_GetDesc(d3d11_texture, &d3d11_desc); + + ok(d3d11_desc.Width == desc.Width, + "Test %u: Got unexpected Width %u.\n", i, d3d11_desc.Width); + ok(d3d11_desc.Height == desc.Height, + "Test %u: Got unexpected Height %u.\n", i, d3d11_desc.Height); + ok(d3d11_desc.MipLevels == desc.MipLevels, + "Test %u: Got unexpected MipLevels %u.\n", i, d3d11_desc.MipLevels); + ok(d3d11_desc.ArraySize == desc.ArraySize, + "Test %u: Got unexpected ArraySize %u.\n", i, d3d11_desc.ArraySize); + ok(d3d11_desc.Format == desc.Format, + "Test %u: Got unexpected Format %u.\n", i, d3d11_desc.Format); + ok(d3d11_desc.SampleDesc.Count == desc.SampleDesc.Count, + "Test %u: Got unexpected SampleDesc.Count %u.\n", i, d3d11_desc.SampleDesc.Count); + ok(d3d11_desc.SampleDesc.Quality == desc.SampleDesc.Quality, + "Test %u: Got unexpected SampleDesc.Quality %u.\n", i, d3d11_desc.SampleDesc.Quality); + ok(d3d11_desc.Usage == (D3D11_USAGE)desc.Usage, + "Test %u: Got unexpected Usage %u.\n", i, d3d11_desc.Usage); + ok(d3d11_desc.BindFlags == current->expected_bind_flags, + "Test %u: Got unexpected BindFlags %#x.\n", i, d3d11_desc.BindFlags); + ok(d3d11_desc.CPUAccessFlags == desc.CPUAccessFlags, + "Test %u: Got unexpected CPUAccessFlags %#x.\n", i, d3d11_desc.CPUAccessFlags); + ok(d3d11_desc.MiscFlags == current->expected_misc_flags, + "Test %u: Got unexpected MiscFlags %#x.\n", i, d3d11_desc.MiscFlags); + + d3d11_device = NULL; + ID3D11Texture2D_GetDevice(d3d11_texture, &d3d11_device); + ok(!!d3d11_device, "Test %u: Got NULL, expected device pointer.\n", i); + ID3D11Device_Release(d3d11_device); + + ID3D11Texture2D_Release(d3d11_texture); + } + + refcount = ID3D10Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + static void test_create_texture3d(void) { ULONG refcount, expected_refcount; @@ -347,6 +614,135 @@ ok(!refcount, "Device has %u references left.\n", refcount); } +static void test_buffer_interfaces(void) +{ + ID3D11Buffer *d3d11_buffer; + D3D10_BUFFER_DESC desc; + ID3D10Buffer *buffer; + ID3D10Device *device; + unsigned int i; + ULONG refcount; + HRESULT hr; + + static const struct test + { + UINT bind_flags; + UINT misc_flags; + UINT expected_bind_flags; + UINT expected_misc_flags; + } + desc_conversion_tests[] = + { + { + D3D10_BIND_VERTEX_BUFFER, 0, + D3D11_BIND_VERTEX_BUFFER, 0 + }, + { + D3D10_BIND_INDEX_BUFFER, 0, + D3D11_BIND_INDEX_BUFFER, 0 + }, + { + D3D10_BIND_CONSTANT_BUFFER, 0, + D3D11_BIND_CONSTANT_BUFFER, 0 + }, + { + D3D10_BIND_SHADER_RESOURCE, 0, + D3D11_BIND_SHADER_RESOURCE, 0 + }, + { + D3D10_BIND_STREAM_OUTPUT, 0, + D3D11_BIND_STREAM_OUTPUT, 0 + }, + { + D3D10_BIND_RENDER_TARGET, 0, + D3D11_BIND_RENDER_TARGET, 0 + }, + { + 0, D3D10_RESOURCE_MISC_SHARED, + 0, D3D11_RESOURCE_MISC_SHARED + }, + }; + + if (!(device = create_device())) + { + skip("Failed to create device.\n"); + return; + } + + desc.ByteWidth = 1024; + desc.Usage = D3D10_USAGE_DEFAULT; + desc.BindFlags = D3D10_BIND_VERTEX_BUFFER; + desc.CPUAccessFlags = 0; + desc.MiscFlags = 0; + + hr = ID3D10Device_CreateBuffer(device, &desc, NULL, &buffer); + ok(SUCCEEDED(hr), "Failed to create a buffer, hr %#x.\n", hr); + + hr = ID3D10Buffer_QueryInterface(buffer, &IID_ID3D11Buffer, (void **)&d3d11_buffer); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Buffer should implement ID3D11Buffer.\n"); + if (SUCCEEDED(hr)) ID3D11Buffer_Release(d3d11_buffer); + ID3D10Buffer_Release(buffer); + + if (FAILED(hr)) + { + win_skip("D3D11 is not available.\n"); + ID3D10Device_Release(device); + return; + } + + for (i = 0; i < sizeof(desc_conversion_tests) / sizeof(*desc_conversion_tests); ++i) + { + const struct test *current = &desc_conversion_tests[i]; + D3D11_BUFFER_DESC d3d11_desc; + ID3D11Device *d3d11_device; + + desc.ByteWidth = 1024; + desc.Usage = D3D10_USAGE_DEFAULT; + desc.BindFlags = current->bind_flags; + desc.CPUAccessFlags = 0; + desc.MiscFlags = current->misc_flags; + + hr = ID3D10Device_CreateBuffer(device, &desc, NULL, &buffer); + /* Shared resources are not supported by REF and WARP devices. */ + ok(SUCCEEDED(hr) || broken(hr == E_OUTOFMEMORY), "Test %u: Failed to create a buffer, hr %#x.\n", i, hr); + if (FAILED(hr)) + { + win_skip("Failed to create a buffer, skipping test %u.\n", i); + continue; + } + + hr = ID3D10Buffer_QueryInterface(buffer, &IID_ID3D11Buffer, (void **)&d3d11_buffer); + ok(SUCCEEDED(hr), "Test %u: Buffer should implement ID3D11Buffer.\n", i); + ID3D10Buffer_Release(buffer); + + ID3D11Buffer_GetDesc(d3d11_buffer, &d3d11_desc); + + ok(d3d11_desc.ByteWidth == desc.ByteWidth, + "Test %u: Got unexpected ByteWidth %u.\n", i, d3d11_desc.ByteWidth); + ok(d3d11_desc.Usage == (D3D11_USAGE)desc.Usage, + "Test %u: Got unexpected Usage %u.\n", i, d3d11_desc.Usage); + ok(d3d11_desc.BindFlags == current->expected_bind_flags, + "Test %u: Got unexpected BindFlags %#x.\n", i, d3d11_desc.BindFlags); + ok(d3d11_desc.CPUAccessFlags == desc.CPUAccessFlags, + "Test %u: Got unexpected CPUAccessFlags %#x.\n", i, d3d11_desc.CPUAccessFlags); + ok(d3d11_desc.MiscFlags == current->expected_misc_flags, + "Test %u: Got unexpected MiscFlags %#x.\n", i, d3d11_desc.MiscFlags); + ok(d3d11_desc.StructureByteStride == 0, + "Test %u: Got unexpected StructureByteStride %u.\n", i, d3d11_desc.StructureByteStride); + + d3d11_device = NULL; + ID3D11Buffer_GetDevice(d3d11_buffer, &d3d11_device); + ok(!!d3d11_device, "Test %u: Got NULL, expected device pointer.\n", i); + ID3D11Device_Release(d3d11_device); + + ID3D11Buffer_Release(d3d11_buffer); + } + + refcount = ID3D10Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + static void test_create_depthstencil_view(void) { D3D10_DEPTH_STENCIL_VIEW_DESC dsv_desc; @@ -404,6 +800,74 @@ ok(!refcount, "Device has %u references left.\n", refcount); } +static void test_depthstencil_view_interfaces(void) +{ + D3D11_DEPTH_STENCIL_VIEW_DESC d3d11_dsv_desc; + D3D10_DEPTH_STENCIL_VIEW_DESC dsv_desc; + ID3D11DepthStencilView *d3d11_dsview; + D3D10_TEXTURE2D_DESC texture_desc; + ID3D10DepthStencilView *dsview; + ID3D10Texture2D *texture; + ID3D10Device *device; + ULONG refcount; + HRESULT hr; + + if (!(device = create_device())) + { + skip("Failed to create device.\n"); + return; + } + + texture_desc.Width = 512; + texture_desc.Height = 512; + texture_desc.MipLevels = 1; + texture_desc.ArraySize = 1; + texture_desc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; + 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 a 2d texture, hr %#x.\n", hr); + + dsv_desc.Format = texture_desc.Format; + dsv_desc.ViewDimension = D3D10_DSV_DIMENSION_TEXTURE2D; + U(dsv_desc).Texture2D.MipSlice = 0; + + hr = ID3D10Device_CreateDepthStencilView(device, (ID3D10Resource *)texture, &dsv_desc, &dsview); + ok(SUCCEEDED(hr), "Failed to create a depthstencil view, hr %#x.\n", hr); + + hr = ID3D10DepthStencilView_QueryInterface(dsview, &IID_ID3D11DepthStencilView, (void **)&d3d11_dsview); + ID3D10DepthStencilView_Release(dsview); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Depth stencil view should implement ID3D11DepthStencilView.\n"); + + if (SUCCEEDED(hr)) + { + ID3D11DepthStencilView_GetDesc(d3d11_dsview, &d3d11_dsv_desc); + ok(d3d11_dsv_desc.Format == dsv_desc.Format, "Got unexpected format %#x.\n", d3d11_dsv_desc.Format); + ok(d3d11_dsv_desc.ViewDimension == (D3D11_DSV_DIMENSION)dsv_desc.ViewDimension, + "Got unexpected view dimension %u.\n", d3d11_dsv_desc.ViewDimension); + ok(!d3d11_dsv_desc.Flags, "Got unexpected flags %#x.\n", d3d11_dsv_desc.Flags); + ok(U(d3d11_dsv_desc).Texture2D.MipSlice == U(dsv_desc).Texture2D.MipSlice, + "Got unexpected mip slice %u.\n", U(d3d11_dsv_desc).Texture2D.MipSlice); + + ID3D11DepthStencilView_Release(d3d11_dsview); + } + else + { + win_skip("D3D11 is not available.\n"); + } + + ID3D10Texture2D_Release(texture); + + refcount = ID3D10Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + static void test_create_rendertarget_view(void) { D3D10_RENDER_TARGET_VIEW_DESC rtv_desc; @@ -415,6 +879,7 @@ ID3D10Device *device, *tmp; ID3D10Texture2D *texture; ID3D10Buffer *buffer; + IUnknown *iface; HRESULT hr; if (!(device = create_device())) @@ -463,6 +928,11 @@ ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); ID3D10Device_Release(tmp); + hr = ID3D10RenderTargetView_QueryInterface(rtview, &IID_ID3D11RenderTargetView, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Render target view should implement ID3D11RenderTargetView.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + ID3D10RenderTargetView_Release(rtview); ID3D10Buffer_Release(buffer); @@ -491,6 +961,11 @@ "Expected view dimension D3D10_RTV_DIMENSION_TEXTURE2D, got %#x\n", rtv_desc.ViewDimension); ok(U(rtv_desc).Texture2D.MipSlice == 0, "Expected mip slice 0, got %#x\n", U(rtv_desc).Texture2D.MipSlice); + hr = ID3D10RenderTargetView_QueryInterface(rtview, &IID_ID3D11RenderTargetView, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Render target view should implement ID3D11RenderTargetView.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + ID3D10RenderTargetView_Release(rtview); ID3D10Texture2D_Release(texture); @@ -508,6 +983,7 @@ ID3D10Device *device, *tmp; ID3D10Texture2D *texture; ID3D10Buffer *buffer; + IUnknown *iface; HRESULT hr; if (!(device = create_device())) @@ -546,6 +1022,15 @@ ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); ID3D10Device_Release(tmp); + hr = ID3D10ShaderResourceView_QueryInterface(srview, &IID_ID3D10ShaderResourceView1, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Shader resource view should implement ID3D10ShaderResourceView1.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + hr = ID3D10ShaderResourceView_QueryInterface(srview, &IID_ID3D11ShaderResourceView, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Shader resource view should implement ID3D11ShaderResourceView.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + ID3D10ShaderResourceView_Release(srview); ID3D10Buffer_Release(buffer); @@ -575,6 +1060,15 @@ U(srv_desc).Texture2D.MostDetailedMip); ok(U(srv_desc).Texture2D.MipLevels == 10, "Got unexpected MipLevels %u.\n", U(srv_desc).Texture2D.MipLevels); + hr = ID3D10ShaderResourceView_QueryInterface(srview, &IID_ID3D10ShaderResourceView1, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Shader resource view should implement ID3D10ShaderResourceView1.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + hr = ID3D10ShaderResourceView_QueryInterface(srview, &IID_ID3D11ShaderResourceView, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Shader resource view should implement ID3D11ShaderResourceView.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + ID3D10ShaderResourceView_Release(srview); ID3D10Texture2D_Release(texture); @@ -691,10 +1185,56 @@ 0x00000000, 0x00000000, }; +#if 0 +struct gs_out +{ + float4 pos : SV_POSITION; +}; + +[maxvertexcount(4)] +void main(point float4 vin[1] : POSITION, inout TriangleStream vout) +{ + float offset = 0.1 * vin[0].w; + gs_out v; + + v.pos = float4(vin[0].x - offset, vin[0].y - offset, vin[0].z, vin[0].w); + vout.Append(v); + v.pos = float4(vin[0].x - offset, vin[0].y + offset, vin[0].z, vin[0].w); + vout.Append(v); + v.pos = float4(vin[0].x + offset, vin[0].y - offset, vin[0].z, vin[0].w); + vout.Append(v); + v.pos = float4(vin[0].x + offset, vin[0].y + offset, vin[0].z, vin[0].w); + vout.Append(v); +} +#endif + static const DWORD gs_4_0[] = + { + 0x43425844, 0x000ee786, 0xc624c269, 0x885a5cbe, 0x444b3b1f, 0x00000001, 0x0000023c, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x49534f50, 0x4e4f4954, 0xababab00, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000001, 0x00000003, + 0x00000000, 0x0000000f, 0x505f5653, 0x5449534f, 0x004e4f49, 0x52444853, 0x000001a0, 0x00020040, + 0x00000068, 0x0400005f, 0x002010f2, 0x00000001, 0x00000000, 0x02000068, 0x00000001, 0x0100085d, + 0x0100285c, 0x04000067, 0x001020f2, 0x00000000, 0x00000001, 0x0200005e, 0x00000004, 0x0f000032, + 0x00100032, 0x00000000, 0x80201ff6, 0x00000041, 0x00000000, 0x00000000, 0x00004002, 0x3dcccccd, + 0x3dcccccd, 0x00000000, 0x00000000, 0x00201046, 0x00000000, 0x00000000, 0x05000036, 0x00102032, + 0x00000000, 0x00100046, 0x00000000, 0x06000036, 0x001020c2, 0x00000000, 0x00201ea6, 0x00000000, + 0x00000000, 0x01000013, 0x05000036, 0x00102012, 0x00000000, 0x0010000a, 0x00000000, 0x0e000032, + 0x00100052, 0x00000000, 0x00201ff6, 0x00000000, 0x00000000, 0x00004002, 0x3dcccccd, 0x00000000, + 0x3dcccccd, 0x00000000, 0x00201106, 0x00000000, 0x00000000, 0x05000036, 0x00102022, 0x00000000, + 0x0010002a, 0x00000000, 0x06000036, 0x001020c2, 0x00000000, 0x00201ea6, 0x00000000, 0x00000000, + 0x01000013, 0x05000036, 0x00102012, 0x00000000, 0x0010000a, 0x00000000, 0x05000036, 0x00102022, + 0x00000000, 0x0010001a, 0x00000000, 0x06000036, 0x001020c2, 0x00000000, 0x00201ea6, 0x00000000, + 0x00000000, 0x01000013, 0x05000036, 0x00102032, 0x00000000, 0x00100086, 0x00000000, 0x06000036, + 0x001020c2, 0x00000000, 0x00201ea6, 0x00000000, 0x00000000, 0x01000013, 0x0100003e, + }; + ULONG refcount, expected_refcount; - ID3D10VertexShader *vs = NULL; - ID3D10PixelShader *ps = NULL; ID3D10Device *device, *tmp; + ID3D10GeometryShader *gs; + ID3D10VertexShader *vs; + ID3D10PixelShader *ps; + IUnknown *iface; HRESULT hr; if (!(device = create_device())) @@ -703,9 +1243,11 @@ return; } + /* vertex shader */ expected_refcount = get_refcount((IUnknown *)device) + 1; hr = ID3D10Device_CreateVertexShader(device, vs_4_0, sizeof(vs_4_0), &vs); ok(SUCCEEDED(hr), "Failed to create SM4 vertex shader, hr %#x\n", hr); + refcount = get_refcount((IUnknown *)device); ok(refcount >= expected_refcount, "Got unexpected refcount %u, expected >= %u.\n", refcount, expected_refcount); tmp = NULL; @@ -715,7 +1257,14 @@ refcount = get_refcount((IUnknown *)device); ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); ID3D10Device_Release(tmp); - ID3D10VertexShader_Release(vs); + + hr = ID3D10VertexShader_QueryInterface(vs, &IID_ID3D11VertexShader, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Vertex shader should implement ID3D11VertexShader.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + + refcount = ID3D10VertexShader_Release(vs); + ok(!refcount, "Vertex shader has %u references left.\n", refcount); hr = ID3D10Device_CreateVertexShader(device, vs_2_0, sizeof(vs_2_0), &vs); ok(hr == E_INVALIDARG, "Created a SM2 vertex shader, hr %#x\n", hr); @@ -726,9 +1275,11 @@ hr = ID3D10Device_CreateVertexShader(device, ps_4_0, sizeof(ps_4_0), &vs); ok(hr == E_INVALIDARG, "Created a SM4 vertex shader from a pixel shader source, hr %#x\n", hr); + /* pixel shader */ expected_refcount = get_refcount((IUnknown *)device) + 1; hr = ID3D10Device_CreatePixelShader(device, ps_4_0, sizeof(ps_4_0), &ps); ok(SUCCEEDED(hr), "Failed to create SM4 vertex shader, hr %#x\n", hr); + refcount = get_refcount((IUnknown *)device); ok(refcount >= expected_refcount, "Got unexpected refcount %u, expected >= %u.\n", refcount, expected_refcount); tmp = NULL; @@ -738,7 +1289,37 @@ refcount = get_refcount((IUnknown *)device); ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); ID3D10Device_Release(tmp); - ID3D10PixelShader_Release(ps); + + hr = ID3D10PixelShader_QueryInterface(ps, &IID_ID3D11PixelShader, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Pixel shader should implement ID3D11PixelShader.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + + refcount = ID3D10PixelShader_Release(ps); + ok(!refcount, "Pixel shader has %u references left.\n", refcount); + + /* geometry shader */ + expected_refcount = get_refcount((IUnknown *)device) + 1; + hr = ID3D10Device_CreateGeometryShader(device, gs_4_0, sizeof(gs_4_0), &gs); + ok(SUCCEEDED(hr), "Failed to create SM4 geometry shader, hr %#x.\n", hr); + + refcount = get_refcount((IUnknown *)device); + ok(refcount >= expected_refcount, "Got unexpected refcount %u, expected >= %u.\n", refcount, expected_refcount); + tmp = NULL; + expected_refcount = refcount + 1; + ID3D10GeometryShader_GetDevice(gs, &tmp); + ok(tmp == device, "Got unexpected device %p, expected %p.\n", tmp, device); + refcount = get_refcount((IUnknown *)device); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + ID3D10Device_Release(tmp); + + hr = ID3D10GeometryShader_QueryInterface(gs, &IID_ID3D11GeometryShader, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Geometry shader should implement ID3D11GeometryShader.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + + refcount = ID3D10GeometryShader_Release(gs); + ok(!refcount, "Geometry shader has %u references left.\n", refcount); refcount = ID3D10Device_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); @@ -746,10 +1327,46 @@ static void test_create_sampler_state(void) { + static const struct test + { + D3D10_FILTER filter; + D3D11_FILTER expected_filter; + } + desc_conversion_tests[] = + { + {D3D10_FILTER_MIN_MAG_MIP_POINT, D3D11_FILTER_MIN_MAG_MIP_POINT}, + {D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR, D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR}, + {D3D10_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT, D3D11_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT}, + {D3D10_FILTER_MIN_POINT_MAG_MIP_LINEAR, D3D11_FILTER_MIN_POINT_MAG_MIP_LINEAR}, + {D3D10_FILTER_MIN_LINEAR_MAG_MIP_POINT, D3D11_FILTER_MIN_LINEAR_MAG_MIP_POINT}, + {D3D10_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR, D3D11_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR}, + {D3D10_FILTER_MIN_MAG_LINEAR_MIP_POINT, D3D11_FILTER_MIN_MAG_LINEAR_MIP_POINT}, + {D3D10_FILTER_MIN_MAG_MIP_LINEAR, D3D11_FILTER_MIN_MAG_MIP_LINEAR}, + {D3D10_FILTER_ANISOTROPIC, D3D11_FILTER_ANISOTROPIC}, + {D3D10_FILTER_COMPARISON_MIN_MAG_MIP_POINT, D3D11_FILTER_COMPARISON_MIN_MAG_MIP_POINT}, + {D3D10_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR, D3D11_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR}, + { + D3D10_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT, + D3D11_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT + }, + {D3D10_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR, D3D11_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR}, + {D3D10_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT, D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT}, + { + D3D10_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR, + D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR + }, + {D3D10_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT, D3D11_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT}, + {D3D10_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR, D3D11_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR}, + {D3D10_FILTER_COMPARISON_ANISOTROPIC, D3D11_FILTER_COMPARISON_ANISOTROPIC}, + }; + ID3D10SamplerState *sampler_state1, *sampler_state2; + ID3D11SamplerState *d3d11_sampler_state; ULONG refcount, expected_refcount; - D3D10_SAMPLER_DESC sampler_desc; ID3D10Device *device, *tmp; + ID3D11Device *d3d11_device; + D3D10_SAMPLER_DESC desc; + unsigned int i; HRESULT hr; if (!(device = create_device())) @@ -761,24 +1378,24 @@ hr = ID3D10Device_CreateSamplerState(device, NULL, &sampler_state1); ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); - sampler_desc.Filter = D3D10_FILTER_MIN_MAG_MIP_LINEAR; - sampler_desc.AddressU = D3D10_TEXTURE_ADDRESS_WRAP; - sampler_desc.AddressV = D3D10_TEXTURE_ADDRESS_WRAP; - sampler_desc.AddressW = D3D10_TEXTURE_ADDRESS_WRAP; - sampler_desc.MipLODBias = 0.0f; - sampler_desc.MaxAnisotropy = 16; - sampler_desc.ComparisonFunc = D3D10_COMPARISON_ALWAYS; - sampler_desc.BorderColor[0] = 0.0f; - sampler_desc.BorderColor[1] = 1.0f; - sampler_desc.BorderColor[2] = 0.0f; - sampler_desc.BorderColor[3] = 1.0f; - sampler_desc.MinLOD = 0.0f; - sampler_desc.MaxLOD = 16.0f; + desc.Filter = D3D10_FILTER_MIN_MAG_MIP_LINEAR; + desc.AddressU = D3D10_TEXTURE_ADDRESS_WRAP; + desc.AddressV = D3D10_TEXTURE_ADDRESS_WRAP; + desc.AddressW = D3D10_TEXTURE_ADDRESS_WRAP; + desc.MipLODBias = 0.0f; + desc.MaxAnisotropy = 16; + desc.ComparisonFunc = D3D10_COMPARISON_ALWAYS; + desc.BorderColor[0] = 0.0f; + desc.BorderColor[1] = 1.0f; + desc.BorderColor[2] = 0.0f; + desc.BorderColor[3] = 1.0f; + desc.MinLOD = 0.0f; + desc.MaxLOD = 16.0f; expected_refcount = get_refcount((IUnknown *)device) + 1; - hr = ID3D10Device_CreateSamplerState(device, &sampler_desc, &sampler_state1); + hr = ID3D10Device_CreateSamplerState(device, &desc, &sampler_state1); ok(SUCCEEDED(hr), "Failed to create sampler state, hr %#x.\n", hr); - hr = ID3D10Device_CreateSamplerState(device, &sampler_desc, &sampler_state2); + hr = ID3D10Device_CreateSamplerState(device, &desc, &sampler_state2); ok(SUCCEEDED(hr), "Failed to create sampler state, hr %#x.\n", hr); ok(sampler_state1 == sampler_state2, "Got different sampler state objects.\n"); refcount = get_refcount((IUnknown *)device); @@ -791,11 +1408,116 @@ ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); ID3D10Device_Release(tmp); + ID3D10SamplerState_GetDesc(sampler_state1, &desc); + ok(desc.Filter == D3D10_FILTER_MIN_MAG_MIP_LINEAR, "Got unexpected filter %#x.\n", desc.Filter); + ok(desc.AddressU == D3D10_TEXTURE_ADDRESS_WRAP, "Got unexpected address u %u.\n", desc.AddressU); + ok(desc.AddressV == D3D10_TEXTURE_ADDRESS_WRAP, "Got unexpected address v %u.\n", desc.AddressV); + ok(desc.AddressW == D3D10_TEXTURE_ADDRESS_WRAP, "Got unexpected address w %u.\n", desc.AddressW); + ok(!desc.MipLODBias, "Got unexpected mip LOD bias %f.\n", desc.MipLODBias); + ok(!desc.MaxAnisotropy || broken(desc.MaxAnisotropy == 16) /* Not set to 0 on all Windows versions. */, + "Got unexpected max anisotropy %u.\n", desc.MaxAnisotropy); + ok(desc.ComparisonFunc == D3D10_COMPARISON_NEVER, "Got unexpected comparison func %u.\n", desc.ComparisonFunc); + ok(!desc.BorderColor[0] && !desc.BorderColor[1] && !desc.BorderColor[2] && !desc.BorderColor[3], + "Got unexpected border color {%.8e, %.8e, %.8e, %.8e}.\n", + desc.BorderColor[0], desc.BorderColor[1], desc.BorderColor[2], desc.BorderColor[3]); + ok(!desc.MinLOD, "Got unexpected min LOD %f.\n", desc.MinLOD); + ok(desc.MaxLOD == 16.0f, "Got unexpected max LOD %f.\n", desc.MaxLOD); + refcount = ID3D10SamplerState_Release(sampler_state2); ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); refcount = ID3D10SamplerState_Release(sampler_state1); ok(!refcount, "Got unexpected refcount %u.\n", refcount); + hr = ID3D10Device_QueryInterface(device, &IID_ID3D11Device, (void **)&d3d11_device); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Device should implement ID3D11Device.\n"); + if (FAILED(hr)) + { + win_skip("D3D11 is not available.\n"); + goto done; + } + + for (i = 0; i < sizeof(desc_conversion_tests) / sizeof(*desc_conversion_tests); ++i) + { + const struct test *current = &desc_conversion_tests[i]; + D3D11_SAMPLER_DESC d3d11_desc, expected_desc; + + desc.Filter = current->filter; + desc.AddressU = D3D10_TEXTURE_ADDRESS_WRAP; + desc.AddressV = D3D10_TEXTURE_ADDRESS_WRAP; + desc.AddressW = D3D10_TEXTURE_ADDRESS_BORDER; + desc.MipLODBias = 0.0f; + desc.MaxAnisotropy = 16; + desc.ComparisonFunc = D3D10_COMPARISON_ALWAYS; + desc.BorderColor[0] = 0.0f; + desc.BorderColor[1] = 1.0f; + desc.BorderColor[2] = 0.0f; + desc.BorderColor[3] = 1.0f; + desc.MinLOD = 0.0f; + desc.MaxLOD = 16.0f; + + hr = ID3D10Device_CreateSamplerState(device, &desc, &sampler_state1); + ok(SUCCEEDED(hr), "Test %u: Failed to create sampler state, hr %#x.\n", i, hr); + + hr = ID3D10SamplerState_QueryInterface(sampler_state1, &IID_ID3D11SamplerState, + (void **)&d3d11_sampler_state); + ok(SUCCEEDED(hr), "Test %u: Sampler state should implement ID3D11SamplerState.\n", i); + + memcpy(&expected_desc, &desc, sizeof(expected_desc)); + expected_desc.Filter = current->expected_filter; + if (!D3D11_DECODE_IS_ANISOTROPIC_FILTER(current->filter)) + expected_desc.MaxAnisotropy = 0; + if (!D3D11_DECODE_IS_COMPARISON_FILTER(current->filter)) + expected_desc.ComparisonFunc = D3D11_COMPARISON_NEVER; + + ID3D11SamplerState_GetDesc(d3d11_sampler_state, &d3d11_desc); + ok(d3d11_desc.Filter == expected_desc.Filter, + "Test %u: Got unexpected filter %#x.\n", i, d3d11_desc.Filter); + ok(d3d11_desc.AddressU == expected_desc.AddressU, + "Test %u: Got unexpected adress u %u.\n", i, d3d11_desc.AddressU); + ok(d3d11_desc.AddressV == expected_desc.AddressV, + "Test %u: Got unexpected address v %u.\n", i, d3d11_desc.AddressV); + ok(d3d11_desc.AddressW == expected_desc.AddressW, + "Test %u: Got unexpected address w %u.\n", i, d3d11_desc.AddressW); + ok(d3d11_desc.MipLODBias == expected_desc.MipLODBias, + "Test %u: Got unexpected mip LOD bias %f.\n", i, d3d11_desc.MipLODBias); + ok(d3d11_desc.MaxAnisotropy == expected_desc.MaxAnisotropy, + "Test %u: Got unexpected max anisotropy %u.\n", i, d3d11_desc.MaxAnisotropy); + ok(d3d11_desc.ComparisonFunc == expected_desc.ComparisonFunc, + "Test %u: Got unexpected comparison func %u.\n", i, d3d11_desc.ComparisonFunc); + ok(d3d11_desc.BorderColor[0] == expected_desc.BorderColor[0] + && d3d11_desc.BorderColor[1] == expected_desc.BorderColor[1] + && d3d11_desc.BorderColor[2] == expected_desc.BorderColor[2] + && d3d11_desc.BorderColor[3] == expected_desc.BorderColor[3], + "Test %u: Got unexpected border color {%.8e, %.8e, %.8e, %.8e}.\n", i, + d3d11_desc.BorderColor[0], d3d11_desc.BorderColor[1], + d3d11_desc.BorderColor[2], d3d11_desc.BorderColor[3]); + ok(d3d11_desc.MinLOD == expected_desc.MinLOD, + "Test %u: Got unexpected min LOD %f.\n", i, d3d11_desc.MinLOD); + ok(d3d11_desc.MaxLOD == expected_desc.MaxLOD, + "Test %u: Got unexpected max LOD %f.\n", i, d3d11_desc.MaxLOD); + + refcount = ID3D11SamplerState_Release(d3d11_sampler_state); + ok(refcount == 1, "Test %u: Got unexpected refcount %u.\n", i, refcount); + + hr = ID3D11Device_CreateSamplerState(d3d11_device, &d3d11_desc, &d3d11_sampler_state); + ok(SUCCEEDED(hr), "Test %u: Failed to create sampler state, hr %#x.\n", i, hr); + hr = ID3D11SamplerState_QueryInterface(d3d11_sampler_state, &IID_ID3D10SamplerState, + (void **)&sampler_state2); + ok(SUCCEEDED(hr), "Test %u: Sampler state should implement ID3D10SamplerState.\n", i); + ok(sampler_state1 == sampler_state2, "Test %u: Got different sampler state objects.\n", i); + + refcount = ID3D11SamplerState_Release(d3d11_sampler_state); + ok(refcount == 2, "Test %u: Got unexpected refcount %u.\n", i, refcount); + refcount = ID3D10SamplerState_Release(sampler_state2); + ok(refcount == 1, "Test %u: Got unexpected refcount %u.\n", i, refcount); + refcount = ID3D10SamplerState_Release(sampler_state1); + ok(!refcount, "Test %u: Got unexpected refcount %u.\n", i, refcount); + } + + ID3D11Device_Release(d3d11_device); + +done: refcount = ID3D10Device_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); } @@ -803,14 +1525,19 @@ static void test_create_blend_state(void) { ID3D10BlendState *blend_state1, *blend_state2; + ID3D11BlendState *d3d11_blend_state; ULONG refcount, expected_refcount; + D3D11_BLEND_DESC d3d11_blend_desc; D3D10_BLEND_DESC blend_desc; + ID3D11Device *d3d11_device; ID3D10Device *device, *tmp; + IUnknown *iface; + unsigned int i; HRESULT hr; if (!(device = create_device())) { - skip("Failed to create device, skipping tests.\n"); + skip("Failed to create device.\n"); return; } @@ -818,28 +1545,17 @@ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); blend_desc.AlphaToCoverageEnable = FALSE; - blend_desc.BlendEnable[0] = FALSE; - blend_desc.BlendEnable[1] = FALSE; - blend_desc.BlendEnable[2] = FALSE; - blend_desc.BlendEnable[3] = FALSE; - blend_desc.BlendEnable[4] = FALSE; - blend_desc.BlendEnable[5] = FALSE; - blend_desc.BlendEnable[6] = FALSE; - blend_desc.BlendEnable[7] = FALSE; blend_desc.SrcBlend = D3D10_BLEND_ONE; blend_desc.DestBlend = D3D10_BLEND_ZERO; blend_desc.BlendOp = D3D10_BLEND_OP_ADD; blend_desc.SrcBlendAlpha = D3D10_BLEND_ONE; blend_desc.DestBlendAlpha = D3D10_BLEND_ZERO; blend_desc.BlendOpAlpha = D3D10_BLEND_OP_ADD; - blend_desc.RenderTargetWriteMask[0] = D3D10_COLOR_WRITE_ENABLE_ALL; - blend_desc.RenderTargetWriteMask[1] = D3D10_COLOR_WRITE_ENABLE_ALL; - blend_desc.RenderTargetWriteMask[2] = D3D10_COLOR_WRITE_ENABLE_ALL; - blend_desc.RenderTargetWriteMask[3] = D3D10_COLOR_WRITE_ENABLE_ALL; - blend_desc.RenderTargetWriteMask[4] = D3D10_COLOR_WRITE_ENABLE_ALL; - blend_desc.RenderTargetWriteMask[5] = D3D10_COLOR_WRITE_ENABLE_ALL; - blend_desc.RenderTargetWriteMask[6] = D3D10_COLOR_WRITE_ENABLE_ALL; - blend_desc.RenderTargetWriteMask[7] = D3D10_COLOR_WRITE_ENABLE_ALL; + for (i = 0; i < D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i) + { + blend_desc.BlendEnable[i] = FALSE; + blend_desc.RenderTargetWriteMask[i] = D3D10_COLOR_WRITE_ENABLE_ALL; + } expected_refcount = get_refcount((IUnknown *)device) + 1; hr = ID3D10Device_CreateBlendState(device, &blend_desc, &blend_state1); @@ -857,6 +1573,135 @@ ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); ID3D10Device_Release(tmp); + hr = ID3D10BlendState_QueryInterface(blend_state1, &IID_ID3D10BlendState1, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Blend state should implement ID3D10BlendState1.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + + hr = ID3D10Device_QueryInterface(device, &IID_ID3D11Device, (void **)&d3d11_device); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Device should implement ID3D11Device.\n"); + if (FAILED(hr)) + { + win_skip("D3D11 is not available.\n"); + goto done; + } + + hr = ID3D10BlendState_QueryInterface(blend_state1, &IID_ID3D11BlendState, (void **)&d3d11_blend_state); + ok(SUCCEEDED(hr), "Blend state should implement ID3D11BlendState.\n"); + + ID3D11BlendState_GetDesc(d3d11_blend_state, &d3d11_blend_desc); + ok(d3d11_blend_desc.AlphaToCoverageEnable == blend_desc.AlphaToCoverageEnable, + "Got unexpected alpha to coverage enable %#x.\n", d3d11_blend_desc.AlphaToCoverageEnable); + ok(d3d11_blend_desc.IndependentBlendEnable == FALSE, + "Got unexpected independent blend enable %#x.\n", d3d11_blend_desc.IndependentBlendEnable); + for (i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i) + { + ok(d3d11_blend_desc.RenderTarget[i].BlendEnable == blend_desc.BlendEnable[i], + "Got unexpected blend enable %#x for render target %u.\n", + d3d11_blend_desc.RenderTarget[i].BlendEnable, i); + ok(d3d11_blend_desc.RenderTarget[i].SrcBlend == (D3D11_BLEND)blend_desc.SrcBlend, + "Got unexpected src blend %u for render target %u.\n", + d3d11_blend_desc.RenderTarget[i].SrcBlend, i); + ok(d3d11_blend_desc.RenderTarget[i].DestBlend == (D3D11_BLEND)blend_desc.DestBlend, + "Got unexpected dest blend %u for render target %u.\n", + d3d11_blend_desc.RenderTarget[i].DestBlend, i); + ok(d3d11_blend_desc.RenderTarget[i].BlendOp == (D3D11_BLEND_OP)blend_desc.BlendOp, + "Got unexpected blend op %u for render target %u.\n", + d3d11_blend_desc.RenderTarget[i].BlendOp, i); + ok(d3d11_blend_desc.RenderTarget[i].SrcBlendAlpha == (D3D11_BLEND)blend_desc.SrcBlendAlpha, + "Got unexpected src blend alpha %u for render target %u.\n", + d3d11_blend_desc.RenderTarget[i].SrcBlendAlpha, i); + ok(d3d11_blend_desc.RenderTarget[i].DestBlendAlpha == (D3D11_BLEND)blend_desc.DestBlendAlpha, + "Got unexpected dest blend alpha %u for render target %u.\n", + d3d11_blend_desc.RenderTarget[i].DestBlendAlpha, i); + ok(d3d11_blend_desc.RenderTarget[i].BlendOpAlpha == (D3D11_BLEND_OP)blend_desc.BlendOpAlpha, + "Got unexpected blend op alpha %u for render target %u.\n", + d3d11_blend_desc.RenderTarget[i].BlendOpAlpha, i); + ok(d3d11_blend_desc.RenderTarget[i].RenderTargetWriteMask == blend_desc.RenderTargetWriteMask[i], + "Got unexpected render target write mask %#x for render target %u.\n", + d3d11_blend_desc.RenderTarget[i].RenderTargetWriteMask, i); + } + + refcount = ID3D11BlendState_Release(d3d11_blend_state); + ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); + refcount = ID3D10BlendState_Release(blend_state2); + ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + + hr = ID3D11Device_CreateBlendState(d3d11_device, &d3d11_blend_desc, &d3d11_blend_state); + ok(SUCCEEDED(hr), "Failed to create blend state, hr %#x.\n", hr); + + hr = ID3D11BlendState_QueryInterface(d3d11_blend_state, &IID_ID3D10BlendState, (void **)&blend_state2); + ok(SUCCEEDED(hr), "Blend state should implement ID3D10BlendState.\n"); + ok(blend_state1 == blend_state2, "Got different blend state objects.\n"); + + refcount = ID3D11BlendState_Release(d3d11_blend_state); + ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); + refcount = ID3D10BlendState_Release(blend_state2); + ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + refcount = ID3D10BlendState_Release(blend_state1); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + + blend_desc.BlendEnable[0] = TRUE; + blend_desc.RenderTargetWriteMask[1] = D3D10_COLOR_WRITE_ENABLE_RED; + blend_desc.RenderTargetWriteMask[2] = D3D10_COLOR_WRITE_ENABLE_GREEN; + blend_desc.RenderTargetWriteMask[3] = D3D10_COLOR_WRITE_ENABLE_BLUE; + + hr = ID3D10Device_CreateBlendState(device, &blend_desc, &blend_state1); + ok(SUCCEEDED(hr), "Failed to create blend state, hr %#x.\n", hr); + + hr = ID3D10BlendState_QueryInterface(blend_state1, &IID_ID3D11BlendState, (void **)&d3d11_blend_state); + ok(SUCCEEDED(hr), "Blend state should implement ID3D11BlendState.\n"); + + ID3D11BlendState_GetDesc(d3d11_blend_state, &d3d11_blend_desc); + ok(d3d11_blend_desc.AlphaToCoverageEnable == blend_desc.AlphaToCoverageEnable, + "Got unexpected alpha to coverage enable %#x.\n", d3d11_blend_desc.AlphaToCoverageEnable); + ok(d3d11_blend_desc.IndependentBlendEnable == TRUE, + "Got unexpected independent blend enable %#x.\n", d3d11_blend_desc.IndependentBlendEnable); + for (i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i) + { + ok(d3d11_blend_desc.RenderTarget[i].BlendEnable == blend_desc.BlendEnable[i], + "Got unexpected blend enable %#x for render target %u.\n", + d3d11_blend_desc.RenderTarget[i].BlendEnable, i); + ok(d3d11_blend_desc.RenderTarget[i].SrcBlend == (D3D11_BLEND)blend_desc.SrcBlend, + "Got unexpected src blend %u for render target %u.\n", + d3d11_blend_desc.RenderTarget[i].SrcBlend, i); + ok(d3d11_blend_desc.RenderTarget[i].DestBlend == (D3D11_BLEND)blend_desc.DestBlend, + "Got unexpected dest blend %u for render target %u.\n", + d3d11_blend_desc.RenderTarget[i].DestBlend, i); + ok(d3d11_blend_desc.RenderTarget[i].BlendOp == (D3D11_BLEND_OP)blend_desc.BlendOp, + "Got unexpected blend op %u for render target %u.\n", + d3d11_blend_desc.RenderTarget[i].BlendOp, i); + ok(d3d11_blend_desc.RenderTarget[i].SrcBlendAlpha == (D3D11_BLEND)blend_desc.SrcBlendAlpha, + "Got unexpected src blend alpha %u for render target %u.\n", + d3d11_blend_desc.RenderTarget[i].SrcBlendAlpha, i); + ok(d3d11_blend_desc.RenderTarget[i].DestBlendAlpha == (D3D11_BLEND)blend_desc.DestBlendAlpha, + "Got unexpected dest blend alpha %u for render target %u.\n", + d3d11_blend_desc.RenderTarget[i].DestBlendAlpha, i); + ok(d3d11_blend_desc.RenderTarget[i].BlendOpAlpha == (D3D11_BLEND_OP)blend_desc.BlendOpAlpha, + "Got unexpected blend op alpha %u for render target %u.\n", + d3d11_blend_desc.RenderTarget[i].BlendOpAlpha, i); + ok(d3d11_blend_desc.RenderTarget[i].RenderTargetWriteMask == blend_desc.RenderTargetWriteMask[i], + "Got unexpected render target write mask %#x for render target %u.\n", + d3d11_blend_desc.RenderTarget[i].RenderTargetWriteMask, i); + } + + refcount = ID3D11BlendState_Release(d3d11_blend_state); + ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + + hr = ID3D11Device_CreateBlendState(d3d11_device, &d3d11_blend_desc, &d3d11_blend_state); + ok(SUCCEEDED(hr), "Failed to create blend state, hr %#x.\n", hr); + + hr = ID3D11BlendState_QueryInterface(d3d11_blend_state, &IID_ID3D10BlendState, (void **)&blend_state2); + ok(SUCCEEDED(hr), "Blend state should implement ID3D10BlendState.\n"); + ok(blend_state1 == blend_state2, "Got different blend state objects.\n"); + + refcount = ID3D11BlendState_Release(d3d11_blend_state); + ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); + + ID3D11Device_Release(d3d11_device); + +done: refcount = ID3D10BlendState_Release(blend_state2); ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); refcount = ID3D10BlendState_Release(blend_state1); @@ -978,25 +1823,41 @@ static void test_create_predicate(void) { + static const D3D10_QUERY other_queries[] = + { + D3D10_QUERY_EVENT, + D3D10_QUERY_OCCLUSION, + D3D10_QUERY_TIMESTAMP, + D3D10_QUERY_TIMESTAMP_DISJOINT, + D3D10_QUERY_PIPELINE_STATISTICS, + D3D10_QUERY_SO_STATISTICS, + }; + ULONG refcount, expected_refcount; D3D10_QUERY_DESC query_desc; ID3D10Predicate *predicate; ID3D10Device *device, *tmp; + IUnknown *iface; + unsigned int i; HRESULT hr; if (!(device = create_device())) { - skip("Failed to create device, skipping tests.\n"); + skip("Failed to create device.\n"); return; } hr = ID3D10Device_CreatePredicate(device, NULL, &predicate); ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); - query_desc.Query = D3D10_QUERY_OCCLUSION; query_desc.MiscFlags = 0; - hr = ID3D10Device_CreatePredicate(device, &query_desc, &predicate); - ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + for (i = 0; i < sizeof(other_queries) / sizeof(*other_queries); ++i) + { + query_desc.Query = other_queries[i]; + hr = ID3D10Device_CreatePredicate(device, &query_desc, &predicate); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x for query type %u.\n", hr, other_queries[i]); + } query_desc.Query = D3D10_QUERY_OCCLUSION_PREDICATE; expected_refcount = get_refcount((IUnknown *)device) + 1; @@ -1011,6 +1872,10 @@ refcount = get_refcount((IUnknown *)device); ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); ID3D10Device_Release(tmp); + hr = ID3D10Predicate_QueryInterface(predicate, &IID_ID3D11Predicate, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Predicate should implement ID3D11Predicate.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); ID3D10Predicate_Release(predicate); query_desc.Query = D3D10_QUERY_SO_OVERFLOW_PREDICATE; @@ -1130,7 +1995,7 @@ skip("Failed to create device, skipping tests.\n"); return; } - window = CreateWindowA("static", "d2d1_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + window = CreateWindowA("static", "d3d10core_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 0, 0, 640, 480, NULL, NULL, NULL, NULL); swapchain = create_swapchain(device, window, TRUE); hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_ID3D10Texture2D, (void **)&backbuffer); @@ -1890,7 +2755,7 @@ for (i = 0; i < D3D10_SO_BUFFER_SLOT_COUNT; ++i) { ok(tmp_buffer[i] == so_buffer[i], "Got unexpected stream output %p in slot %u, expected %p.\n", - tmp_buffer[i], i, buffer[i]); + tmp_buffer[i], i, so_buffer[i]); ID3D10Buffer_Release(tmp_buffer[i]); todo_wine ok(offset[i] == ~0u, "Got unexpected stream output offset %u in slot %u.\n", offset[i], i); } @@ -2349,6 +3214,7 @@ D3D10_BUFFER_DESC buffer_desc; ID3D10Texture2D *backbuffer; unsigned int stride, offset; + struct texture_readback rb; IDXGISwapChain *swapchain; ID3D10Texture2D *texture; ID3D10VertexShader *vs; @@ -2525,16 +3391,18 @@ ID3D10Device_Draw(device, 4, 0); + get_texture_readback(backbuffer, &rb); for (i = 0; i < 4; ++i) { for (j = 0; j < 4; ++j) { - color = get_texture_color(backbuffer, 80 + j * 160, 60 + i * 120); + 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); ID3D10PixelShader_Release(ps); ID3D10VertexShader_Release(vs); @@ -2555,6 +3423,8 @@ { D3D10_TEXTURE2D_DESC texture_desc; ULONG refcount, expected_refcount; + ID3D11Texture2D *d3d11_texture; + ID3D11Device *d3d11_device; ID3D10Device *test_object; ID3D10Texture2D *texture; IDXGIDevice *dxgi_device; @@ -2675,6 +3545,23 @@ IUnknown_Release(ptr); --expected_refcount; + hr = ID3D10Device_QueryInterface(device, &IID_ID3D11Device, (void **)&d3d11_device); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Device should implement ID3D11Device.\n"); + if (SUCCEEDED(hr)) + { + ptr = NULL; + size = sizeof(ptr); + hr = ID3D11Device_GetPrivateData(d3d11_device, &test_guid, &size, &ptr); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(ptr == (IUnknown *)test_object, "Got unexpected ptr %p, expected %p.\n", ptr, test_object); + IUnknown_Release(ptr); + ID3D11Device_Release(d3d11_device); + refcount = get_refcount((IUnknown *)test_object); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", + refcount, expected_refcount); + } + ptr = (IUnknown *)0xdeadbeef; size = 1; hr = ID3D10Device_GetPrivateData(device, &test_guid, &size, NULL); @@ -2712,6 +3599,20 @@ ok(ptr == (IUnknown *)test_object, "Got unexpected ptr %p, expected %p.\n", ptr, test_object); IUnknown_Release(ptr); + hr = ID3D10Texture2D_QueryInterface(texture, &IID_ID3D11Texture2D, (void **)&d3d11_texture); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Texture should implement ID3D11Texture2D.\n"); + if (SUCCEEDED(hr)) + { + ptr = NULL; + size = sizeof(ptr); + hr = ID3D11Texture2D_GetPrivateData(d3d11_texture, &test_guid, &size, &ptr); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(ptr == (IUnknown *)test_object, "Got unexpected ptr %p, expected %p.\n", ptr, test_object); + IUnknown_Release(ptr); + ID3D11Texture2D_Release(d3d11_texture); + } + IDXGISurface_Release(surface); ID3D10Texture2D_Release(texture); refcount = ID3D10Device_Release(device); @@ -3184,6 +4085,7 @@ D3D10_BUFFER_DESC buffer_desc; ID3D10Texture2D *backbuffer; unsigned int stride, offset; + struct texture_readback rb; IDXGISwapChain *swapchain; ID3D10Texture2D *texture; ID3D10VertexShader *vs; @@ -3364,15 +4266,17 @@ ID3D10Device_ClearRenderTargetView(device, backbuffer_rtv, red); ID3D10Device_Draw(device, 4, 0); + get_texture_readback(backbuffer, &rb); for (i = 0; i < 4; ++i) { for (j = 0; j < 4; ++j) { - color = get_texture_color(backbuffer, 80 + j * 160, 60 + i * 120); + color = get_readback_color(&rb, 80 + j * 160, 60 + i * 120); ok(compare_color(color, 0x00000000, 0), "Got unexpected color 0x%08x at (%u, %u).\n", color, j, i); } } + release_texture_readback(&rb); set_box(&box, 1, 1, 0, 3, 3, 1); ID3D10Device_UpdateSubresource(device, (ID3D10Resource *)texture, 0, &box, @@ -3390,30 +4294,34 @@ ID3D10Device_UpdateSubresource(device, (ID3D10Resource *)texture, 0, &box, bitmap_data, sizeof(*bitmap_data), 0); ID3D10Device_Draw(device, 4, 0); + get_texture_readback(backbuffer, &rb); for (i = 0; i < 4; ++i) { for (j = 0; j < 4; ++j) { - color = get_texture_color(backbuffer, 80 + j * 160, 60 + i * 120); + color = get_readback_color(&rb, 80 + j * 160, 60 + i * 120); ok(compare_color(color, expected_colors[j + i * 4], 1), "Got unexpected color 0x%08x at (%u, %u), expected 0x%08x.\n", color, j, i, expected_colors[j + i * 4]); } } + release_texture_readback(&rb); ID3D10Device_UpdateSubresource(device, (ID3D10Resource *)texture, 0, NULL, bitmap_data, 4 * sizeof(*bitmap_data), 0); ID3D10Device_Draw(device, 4, 0); + get_texture_readback(backbuffer, &rb); for (i = 0; i < 4; ++i) { for (j = 0; j < 4; ++j) { - color = get_texture_color(backbuffer, 80 + j * 160, 60 + i * 120); + 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); ID3D10PixelShader_Release(ps); ID3D10VertexShader_Release(vs); @@ -3432,9 +4340,14 @@ START_TEST(device) { + test_feature_level(); + test_device_interfaces(); test_create_texture2d(); + test_texture2d_interfaces(); test_create_texture3d(); + test_buffer_interfaces(); test_create_depthstencil_view(); + test_depthstencil_view_interfaces(); test_create_rendertarget_view(); test_create_shader_resource_view(); test_create_shader(); diff -Nru wine1.7-1.7.50/dlls/d3d11/async.c wine1.7-1.7.55/dlls/d3d11/async.c --- wine1.7-1.7.50/dlls/d3d11/async.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d11/async.c 2015-11-13 14:32:40.000000000 +0000 @@ -24,27 +24,37 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d11); -static inline struct d3d10_query *impl_from_ID3D10Query(ID3D10Query *iface) +/* ID3D11Query methods */ + +static inline struct d3d_query *impl_from_ID3D11Query(ID3D11Query *iface) { - return CONTAINING_RECORD(iface, struct d3d10_query, ID3D10Query_iface); + return CONTAINING_RECORD(iface, struct d3d_query, ID3D11Query_iface); } -/* IUnknown methods */ - -static HRESULT STDMETHODCALLTYPE d3d10_query_QueryInterface(ID3D10Query *iface, REFIID riid, void **object) +static HRESULT STDMETHODCALLTYPE d3d11_query_QueryInterface(ID3D11Query *iface, REFIID riid, void **object) { - struct d3d10_query *query = impl_from_ID3D10Query(iface); + struct d3d_query *query = impl_from_ID3D11Query(iface); TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + if ((IsEqualGUID(riid, &IID_ID3D11Predicate) && query->predicate) + || IsEqualGUID(riid, &IID_ID3D11Query) + || IsEqualGUID(riid, &IID_ID3D11Asynchronous) + || IsEqualGUID(riid, &IID_ID3D11DeviceChild) + || IsEqualGUID(riid, &IID_IUnknown)) + { + ID3D11Query_AddRef(iface); + *object = iface; + return S_OK; + } + if ((IsEqualGUID(riid, &IID_ID3D10Predicate) && query->predicate) || IsEqualGUID(riid, &IID_ID3D10Query) || IsEqualGUID(riid, &IID_ID3D10Asynchronous) - || IsEqualGUID(riid, &IID_ID3D10DeviceChild) - || IsEqualGUID(riid, &IID_IUnknown)) + || IsEqualGUID(riid, &IID_ID3D10DeviceChild)) { - IUnknown_AddRef(iface); - *object = iface; + ID3D10Query_AddRef(&query->ID3D10Query_iface); + *object = &query->ID3D10Query_iface; return S_OK; } @@ -54,26 +64,26 @@ return E_NOINTERFACE; } -static ULONG STDMETHODCALLTYPE d3d10_query_AddRef(ID3D10Query *iface) +static ULONG STDMETHODCALLTYPE d3d11_query_AddRef(ID3D11Query *iface) { - struct d3d10_query *This = impl_from_ID3D10Query(iface); - ULONG refcount = InterlockedIncrement(&This->refcount); + struct d3d_query *query = impl_from_ID3D11Query(iface); + ULONG refcount = InterlockedIncrement(&query->refcount); - TRACE("%p increasing refcount to %u.\n", This, refcount); + TRACE("%p increasing refcount to %u.\n", query, refcount); return refcount; } -static ULONG STDMETHODCALLTYPE d3d10_query_Release(ID3D10Query *iface) +static ULONG STDMETHODCALLTYPE d3d11_query_Release(ID3D11Query *iface) { - struct d3d10_query *query = impl_from_ID3D10Query(iface); + struct d3d_query *query = impl_from_ID3D11Query(iface); ULONG refcount = InterlockedDecrement(&query->refcount); TRACE("%p decreasing refcount to %u.\n", query, refcount); if (!refcount) { - ID3D10Device1_Release(query->device); + ID3D11Device_Release(query->device); wined3d_mutex_lock(); wined3d_query_decref(query->wined3d_query); wined3d_private_store_cleanup(&query->private_store); @@ -84,48 +94,160 @@ return refcount; } +static void STDMETHODCALLTYPE d3d11_query_GetDevice(ID3D11Query *iface, ID3D11Device **device) +{ + struct d3d_query *query = impl_from_ID3D11Query(iface); + + TRACE("iface %p, device %p.\n", iface, device); + + *device = query->device; + ID3D11Device_AddRef(*device); +} + +static HRESULT STDMETHODCALLTYPE d3d11_query_GetPrivateData(ID3D11Query *iface, + REFGUID guid, UINT *data_size, void *data) +{ + struct d3d_query *query = impl_from_ID3D11Query(iface); + + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_get_private_data(&query->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_query_SetPrivateData(ID3D11Query *iface, + REFGUID guid, UINT data_size, const void *data) +{ + struct d3d_query *query = impl_from_ID3D11Query(iface); + + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_set_private_data(&query->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_query_SetPrivateDataInterface(ID3D11Query *iface, + REFGUID guid, const IUnknown *data) +{ + struct d3d_query *query = impl_from_ID3D11Query(iface); + + TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); + + return d3d_set_private_data_interface(&query->private_store, guid, data); +} + +static UINT STDMETHODCALLTYPE d3d11_query_GetDataSize(ID3D11Query *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static void STDMETHODCALLTYPE d3d11_query_GetDesc(ID3D11Query *iface, D3D11_QUERY_DESC *desc) +{ + FIXME("iface %p, desc %p stub!\n", iface, desc); +} + +static const struct ID3D11QueryVtbl d3d11_query_vtbl = +{ + /* IUnknown methods */ + d3d11_query_QueryInterface, + d3d11_query_AddRef, + d3d11_query_Release, + /* ID3D11DeviceChild methods */ + d3d11_query_GetDevice, + d3d11_query_GetPrivateData, + d3d11_query_SetPrivateData, + d3d11_query_SetPrivateDataInterface, + /* ID3D11Asynchronous methods */ + d3d11_query_GetDataSize, + /* ID3D11Query methods */ + d3d11_query_GetDesc, +}; + +struct d3d_query *unsafe_impl_from_ID3D11Query(ID3D11Query *iface) +{ + if (!iface) + return NULL; + assert(iface->lpVtbl == &d3d11_query_vtbl); + return CONTAINING_RECORD(iface, struct d3d_query, ID3D11Query_iface); +} + +/* ID3D10Query methods */ + +static inline struct d3d_query *impl_from_ID3D10Query(ID3D10Query *iface) +{ + return CONTAINING_RECORD(iface, struct d3d_query, ID3D10Query_iface); +} + +/* IUnknown methods */ + +static HRESULT STDMETHODCALLTYPE d3d10_query_QueryInterface(ID3D10Query *iface, REFIID riid, void **object) +{ + struct d3d_query *query = impl_from_ID3D10Query(iface); + + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + + return d3d11_query_QueryInterface(&query->ID3D11Query_iface, riid, object); +} + +static ULONG STDMETHODCALLTYPE d3d10_query_AddRef(ID3D10Query *iface) +{ + struct d3d_query *query = impl_from_ID3D10Query(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_query_AddRef(&query->ID3D11Query_iface); +} + +static ULONG STDMETHODCALLTYPE d3d10_query_Release(ID3D10Query *iface) +{ + struct d3d_query *query = impl_from_ID3D10Query(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_query_Release(&query->ID3D11Query_iface); +} + /* ID3D10DeviceChild methods */ static void STDMETHODCALLTYPE d3d10_query_GetDevice(ID3D10Query *iface, ID3D10Device **device) { - struct d3d10_query *query = impl_from_ID3D10Query(iface); + struct d3d_query *query = impl_from_ID3D10Query(iface); TRACE("iface %p, device %p.\n", iface, device); - *device = (ID3D10Device *)query->device; - ID3D10Device_AddRef(*device); + ID3D11Device_QueryInterface(query->device, &IID_ID3D10Device, (void **)device); } static HRESULT STDMETHODCALLTYPE d3d10_query_GetPrivateData(ID3D10Query *iface, REFGUID guid, UINT *data_size, void *data) { - struct d3d10_query *query = impl_from_ID3D10Query(iface); + struct d3d_query *query = impl_from_ID3D10Query(iface); TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_get_private_data(&query->private_store, guid, data_size, data); + return d3d_get_private_data(&query->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d10_query_SetPrivateData(ID3D10Query *iface, REFGUID guid, UINT data_size, const void *data) { - struct d3d10_query *query = impl_from_ID3D10Query(iface); + struct d3d_query *query = impl_from_ID3D10Query(iface); TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_set_private_data(&query->private_store, guid, data_size, data); + return d3d_set_private_data(&query->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d10_query_SetPrivateDataInterface(ID3D10Query *iface, REFGUID guid, const IUnknown *data) { - struct d3d10_query *query = impl_from_ID3D10Query(iface); + struct d3d_query *query = impl_from_ID3D10Query(iface); TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); - return d3d10_set_private_data_interface(&query->private_store, guid, data); + return d3d_set_private_data_interface(&query->private_store, guid, data); } /* ID3D10Asynchronous methods */ @@ -181,29 +303,29 @@ d3d10_query_GetDesc, }; -struct d3d10_query *unsafe_impl_from_ID3D10Query(ID3D10Query *iface) +struct d3d_query *unsafe_impl_from_ID3D10Query(ID3D10Query *iface) { if (!iface) return NULL; assert(iface->lpVtbl == &d3d10_query_vtbl); - return CONTAINING_RECORD(iface, struct d3d10_query, ID3D10Query_iface); + return CONTAINING_RECORD(iface, struct d3d_query, ID3D10Query_iface); } -HRESULT d3d10_query_init(struct d3d10_query *query, struct d3d_device *device, - const D3D10_QUERY_DESC *desc, BOOL predicate) +static HRESULT d3d_query_init(struct d3d_query *query, struct d3d_device *device, + const D3D11_QUERY_DESC *desc, BOOL predicate) { HRESULT hr; static const enum wined3d_query_type query_type_map[] = { - /* D3D10_QUERY_EVENT */ WINED3D_QUERY_TYPE_EVENT, - /* D3D10_QUERY_OCCLUSION */ WINED3D_QUERY_TYPE_OCCLUSION, - /* D3D10_QUERY_TIMESTAMP */ WINED3D_QUERY_TYPE_TIMESTAMP, - /* D3D10_QUERY_TIMESTAMP_DISJOINT */ WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT, - /* D3D10_QUERY_PIPELINE_STATISTICS */ WINED3D_QUERY_TYPE_PIPELINE_STATISTICS, - /* D3D10_QUERY_OCCLUSION_PREDICATE */ WINED3D_QUERY_TYPE_OCCLUSION, - /* D3D10_QUERY_SO_STATISTICS */ WINED3D_QUERY_TYPE_SO_STATISTICS, - /* D3D10_QUERY_SO_OVERFLOW_PREDICATE */ WINED3D_QUERY_TYPE_SO_OVERFLOW, + /* D3D11_QUERY_EVENT */ WINED3D_QUERY_TYPE_EVENT, + /* D3D11_QUERY_OCCLUSION */ WINED3D_QUERY_TYPE_OCCLUSION, + /* D3D11_QUERY_TIMESTAMP */ WINED3D_QUERY_TYPE_TIMESTAMP, + /* D3D11_QUERY_TIMESTAMP_DISJOINT */ WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT, + /* D3D11_QUERY_PIPELINE_STATISTICS */ WINED3D_QUERY_TYPE_PIPELINE_STATISTICS, + /* D3D11_QUERY_OCCLUSION_PREDICATE */ WINED3D_QUERY_TYPE_OCCLUSION, + /* D3D11_QUERY_SO_STATISTICS */ WINED3D_QUERY_TYPE_SO_STATISTICS, + /* D3D11_QUERY_SO_OVERFLOW_PREDICATE */ WINED3D_QUERY_TYPE_SO_OVERFLOW, }; if (desc->Query >= sizeof(query_type_map) / sizeof(*query_type_map)) @@ -215,6 +337,7 @@ if (desc->MiscFlags) FIXME("Ignoring MiscFlags %#x.\n", desc->MiscFlags); + query->ID3D11Query_iface.lpVtbl = &d3d11_query_vtbl; query->ID3D10Query_iface.lpVtbl = &d3d10_query_vtbl; query->refcount = 1; wined3d_mutex_lock(); @@ -231,8 +354,45 @@ wined3d_mutex_unlock(); query->predicate = predicate; - query->device = &device->ID3D10Device1_iface; - ID3D10Device1_AddRef(query->device); + query->device = &device->ID3D11Device_iface; + ID3D11Device_AddRef(query->device); + + return S_OK; +} + +HRESULT d3d_query_create(struct d3d_device *device, const D3D11_QUERY_DESC *desc, BOOL predicate, + struct d3d_query **query) +{ + struct d3d_query *object; + HRESULT hr; + + if (!desc) + return E_INVALIDARG; + + if (predicate + && desc->Query != D3D11_QUERY_OCCLUSION_PREDICATE + && desc->Query != D3D11_QUERY_SO_OVERFLOW_PREDICATE + && desc->Query != D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM0 + && desc->Query != D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM1 + && desc->Query != D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM2 + && desc->Query != D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM3) + { + WARN("Query type %u is not a predicate.\n", desc->Query); + return E_INVALIDARG; + } + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + if (FAILED(hr = d3d_query_init(object, device, desc, predicate))) + { + WARN("Failed to initialize predicate, hr %#x.\n", hr); + HeapFree(GetProcessHeap(), 0, object); + return hr; + } + + TRACE("Created predicate %p.\n", object); + *query = object; return S_OK; } diff -Nru wine1.7-1.7.50/dlls/d3d11/buffer.c wine1.7-1.7.55/dlls/d3d11/buffer.c --- wine1.7-1.7.50/dlls/d3d11/buffer.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d11/buffer.c 2015-11-13 14:32:40.000000000 +0000 @@ -24,43 +24,54 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d11); -static inline struct d3d10_buffer *impl_from_ID3D10Buffer(ID3D10Buffer *iface) +/* ID3D11Buffer methods */ + +static inline struct d3d_buffer *impl_from_ID3D11Buffer(ID3D11Buffer *iface) { - return CONTAINING_RECORD(iface, struct d3d10_buffer, ID3D10Buffer_iface); + return CONTAINING_RECORD(iface, struct d3d_buffer, ID3D11Buffer_iface); } -/* IUnknown methods */ - -static HRESULT STDMETHODCALLTYPE d3d10_buffer_QueryInterface(ID3D10Buffer *iface, REFIID riid, void **out) +static HRESULT STDMETHODCALLTYPE d3d11_buffer_QueryInterface(ID3D11Buffer *iface, REFIID riid, void **out) { + struct d3d_buffer *buffer = impl_from_ID3D11Buffer(iface); + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); - if (IsEqualGUID(riid, &IID_ID3D10Buffer) - || IsEqualGUID(riid, &IID_ID3D10Resource) - || IsEqualGUID(riid, &IID_ID3D10DeviceChild) + if (IsEqualGUID(riid, &IID_ID3D11Buffer) + || IsEqualGUID(riid, &IID_ID3D11Resource) + || IsEqualGUID(riid, &IID_ID3D11DeviceChild) || IsEqualGUID(riid, &IID_IUnknown)) { - IUnknown_AddRef(iface); + ID3D11Buffer_AddRef(iface); *out = iface; return S_OK; } - WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid)); + if (IsEqualGUID(riid, &IID_ID3D10Buffer) + || IsEqualGUID(riid, &IID_ID3D10Resource) + || IsEqualGUID(riid, &IID_ID3D10DeviceChild)) + { + ID3D10Buffer_AddRef(&buffer->ID3D10Buffer_iface); + *out = &buffer->ID3D10Buffer_iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); *out = NULL; return E_NOINTERFACE; } -static ULONG STDMETHODCALLTYPE d3d10_buffer_AddRef(ID3D10Buffer *iface) +static ULONG STDMETHODCALLTYPE d3d11_buffer_AddRef(ID3D11Buffer *iface) { - struct d3d10_buffer *buffer = impl_from_ID3D10Buffer(iface); + struct d3d_buffer *buffer = impl_from_ID3D11Buffer(iface); ULONG refcount = InterlockedIncrement(&buffer->refcount); TRACE("%p increasing refcount to %u.\n", buffer, refcount); if (refcount == 1) { - ID3D10Device1_AddRef(buffer->device); + ID3D11Device_AddRef(buffer->device); wined3d_mutex_lock(); wined3d_buffer_incref(buffer->wined3d_buffer); wined3d_mutex_unlock(); @@ -69,70 +80,201 @@ return refcount; } -static ULONG STDMETHODCALLTYPE d3d10_buffer_Release(ID3D10Buffer *iface) +static ULONG STDMETHODCALLTYPE d3d11_buffer_Release(ID3D11Buffer *iface) { - struct d3d10_buffer *buffer = impl_from_ID3D10Buffer(iface); + struct d3d_buffer *buffer = impl_from_ID3D11Buffer(iface); ULONG refcount = InterlockedDecrement(&buffer->refcount); TRACE("%p decreasing refcount to %u.\n", buffer, refcount); if (!refcount) { - ID3D10Device1 *device = buffer->device; + ID3D11Device *device = buffer->device; wined3d_mutex_lock(); wined3d_buffer_decref(buffer->wined3d_buffer); wined3d_mutex_unlock(); /* Release the device last, it may cause the wined3d device to be * destroyed. */ - ID3D10Device1_Release(device); + ID3D11Device_Release(device); } return refcount; } +static void STDMETHODCALLTYPE d3d11_buffer_GetDevice(ID3D11Buffer *iface, ID3D11Device **device) +{ + struct d3d_buffer *buffer = impl_from_ID3D11Buffer(iface); + + TRACE("iface %p, device %p.\n", iface, device); + + *device = buffer->device; + ID3D11Device_AddRef(*device); +} + +static HRESULT STDMETHODCALLTYPE d3d11_buffer_GetPrivateData(ID3D11Buffer *iface, + REFGUID guid, UINT *data_size, void *data) +{ + struct d3d_buffer *buffer = impl_from_ID3D11Buffer(iface); + + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_get_private_data(&buffer->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_buffer_SetPrivateData(ID3D11Buffer *iface, + REFGUID guid, UINT data_size, const void *data) +{ + struct d3d_buffer *buffer = impl_from_ID3D11Buffer(iface); + + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_set_private_data(&buffer->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_buffer_SetPrivateDataInterface(ID3D11Buffer *iface, + REFGUID guid, const IUnknown *data) +{ + struct d3d_buffer *buffer = impl_from_ID3D11Buffer(iface); + + TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); + + return d3d_set_private_data_interface(&buffer->private_store, guid, data); +} + +static void STDMETHODCALLTYPE d3d11_buffer_GetType(ID3D11Buffer *iface, + D3D11_RESOURCE_DIMENSION *resource_dimension) +{ + TRACE("iface %p, resource_dimension %p.\n", iface, resource_dimension); + + *resource_dimension = D3D11_RESOURCE_DIMENSION_BUFFER; +} + +static void STDMETHODCALLTYPE d3d11_buffer_SetEvictionPriority(ID3D11Buffer *iface, UINT eviction_priority) +{ + FIXME("iface %p, eviction_priority %#x stub!\n", iface, eviction_priority); +} + +static UINT STDMETHODCALLTYPE d3d11_buffer_GetEvictionPriority(ID3D11Buffer *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static void STDMETHODCALLTYPE d3d11_buffer_GetDesc(ID3D11Buffer *iface, D3D11_BUFFER_DESC *desc) +{ + struct d3d_buffer *buffer = impl_from_ID3D11Buffer(iface); + + TRACE("iface %p, desc %p.\n", iface, desc); + + *desc = buffer->desc; +} + +static const struct ID3D11BufferVtbl d3d11_buffer_vtbl = +{ + /* IUnknown methods */ + d3d11_buffer_QueryInterface, + d3d11_buffer_AddRef, + d3d11_buffer_Release, + /* ID3D11DeviceChild methods */ + d3d11_buffer_GetDevice, + d3d11_buffer_GetPrivateData, + d3d11_buffer_SetPrivateData, + d3d11_buffer_SetPrivateDataInterface, + /* ID3D11Resource methods */ + d3d11_buffer_GetType, + d3d11_buffer_SetEvictionPriority, + d3d11_buffer_GetEvictionPriority, + /* ID3D11Buffer methods */ + d3d11_buffer_GetDesc, +}; + +struct d3d_buffer *unsafe_impl_from_ID3D11Buffer(ID3D11Buffer *iface) +{ + if (!iface) + return NULL; + assert(iface->lpVtbl == &d3d11_buffer_vtbl); + return CONTAINING_RECORD(iface, struct d3d_buffer, ID3D11Buffer_iface); +} + +/* ID3D10Buffer methods */ + +static inline struct d3d_buffer *impl_from_ID3D10Buffer(ID3D10Buffer *iface) +{ + return CONTAINING_RECORD(iface, struct d3d_buffer, ID3D10Buffer_iface); +} + +/* IUnknown methods */ + +static HRESULT STDMETHODCALLTYPE d3d10_buffer_QueryInterface(ID3D10Buffer *iface, REFIID riid, void **out) +{ + struct d3d_buffer *buffer = impl_from_ID3D10Buffer(iface); + + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + return d3d11_buffer_QueryInterface(&buffer->ID3D11Buffer_iface, riid, out); +} + +static ULONG STDMETHODCALLTYPE d3d10_buffer_AddRef(ID3D10Buffer *iface) +{ + struct d3d_buffer *buffer = impl_from_ID3D10Buffer(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_buffer_AddRef(&buffer->ID3D11Buffer_iface); +} + +static ULONG STDMETHODCALLTYPE d3d10_buffer_Release(ID3D10Buffer *iface) +{ + struct d3d_buffer *buffer = impl_from_ID3D10Buffer(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_buffer_Release(&buffer->ID3D11Buffer_iface); +} + /* ID3D10DeviceChild methods */ static void STDMETHODCALLTYPE d3d10_buffer_GetDevice(ID3D10Buffer *iface, ID3D10Device **device) { - struct d3d10_buffer *buffer = impl_from_ID3D10Buffer(iface); + struct d3d_buffer *buffer = impl_from_ID3D10Buffer(iface); TRACE("iface %p, device %p.\n", iface, device); - *device = (ID3D10Device *)buffer->device; - ID3D10Device_AddRef(*device); + ID3D11Device_QueryInterface(buffer->device, &IID_ID3D10Device, (void **)device); } static HRESULT STDMETHODCALLTYPE d3d10_buffer_GetPrivateData(ID3D10Buffer *iface, REFGUID guid, UINT *data_size, void *data) { - struct d3d10_buffer *buffer = impl_from_ID3D10Buffer(iface); + struct d3d_buffer *buffer = impl_from_ID3D10Buffer(iface); TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_get_private_data(&buffer->private_store, guid, data_size, data); + return d3d_get_private_data(&buffer->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d10_buffer_SetPrivateData(ID3D10Buffer *iface, REFGUID guid, UINT data_size, const void *data) { - struct d3d10_buffer *buffer = impl_from_ID3D10Buffer(iface); + struct d3d_buffer *buffer = impl_from_ID3D10Buffer(iface); TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_set_private_data(&buffer->private_store, guid, data_size, data); + return d3d_set_private_data(&buffer->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d10_buffer_SetPrivateDataInterface(ID3D10Buffer *iface, REFGUID guid, const IUnknown *data) { - struct d3d10_buffer *buffer = impl_from_ID3D10Buffer(iface); + struct d3d_buffer *buffer = impl_from_ID3D10Buffer(iface); TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); - return d3d10_set_private_data_interface(&buffer->private_store, guid, data); + return d3d_set_private_data_interface(&buffer->private_store, guid, data); } /* ID3D10Resource methods */ @@ -160,7 +302,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_buffer_Map(ID3D10Buffer *iface, D3D10_MAP map_type, UINT map_flags, void **data) { - struct d3d10_buffer *buffer = impl_from_ID3D10Buffer(iface); + struct d3d_buffer *buffer = impl_from_ID3D10Buffer(iface); HRESULT hr; TRACE("iface %p, map_type %u, map_flags %#x, data %p.\n", iface, map_type, map_flags, data); @@ -170,7 +312,7 @@ wined3d_mutex_lock(); hr = wined3d_buffer_map(buffer->wined3d_buffer, 0, 0, (BYTE **)data, - wined3d_map_flags_from_d3d10_map_type(map_type)); + wined3d_map_flags_from_d3d11_map_type(map_type)); wined3d_mutex_unlock(); return hr; @@ -178,7 +320,7 @@ static void STDMETHODCALLTYPE d3d10_buffer_Unmap(ID3D10Buffer *iface) { - struct d3d10_buffer *buffer = impl_from_ID3D10Buffer(iface); + struct d3d_buffer *buffer = impl_from_ID3D10Buffer(iface); TRACE("iface %p.\n", iface); @@ -189,7 +331,16 @@ static void STDMETHODCALLTYPE d3d10_buffer_GetDesc(ID3D10Buffer *iface, D3D10_BUFFER_DESC *desc) { - FIXME("iface %p, desc %p stub!\n", iface, desc); + struct d3d_buffer *buffer = impl_from_ID3D10Buffer(iface); + const D3D11_BUFFER_DESC *d3d11_desc = &buffer->desc; + + TRACE("iface %p, desc %p.\n", iface, desc); + + desc->ByteWidth = d3d11_desc->ByteWidth; + desc->Usage = d3d10_usage_from_d3d11_usage(d3d11_desc->Usage); + desc->BindFlags = d3d10_bind_flags_from_d3d11_bind_flags(d3d11_desc->BindFlags); + desc->CPUAccessFlags = d3d10_cpu_access_flags_from_d3d11_cpu_access_flags(d3d11_desc->CPUAccessFlags); + desc->MiscFlags = d3d10_resource_misc_flags_from_d3d11_resource_misc_flags(d3d11_desc->MiscFlags); } static const struct ID3D10BufferVtbl d3d10_buffer_vtbl = @@ -213,17 +364,17 @@ d3d10_buffer_GetDesc, }; -struct d3d10_buffer *unsafe_impl_from_ID3D10Buffer(ID3D10Buffer *iface) +struct d3d_buffer *unsafe_impl_from_ID3D10Buffer(ID3D10Buffer *iface) { if (!iface) return NULL; assert(iface->lpVtbl == &d3d10_buffer_vtbl); - return CONTAINING_RECORD(iface, struct d3d10_buffer, ID3D10Buffer_iface); + return CONTAINING_RECORD(iface, struct d3d_buffer, ID3D10Buffer_iface); } static void STDMETHODCALLTYPE d3d10_buffer_wined3d_object_released(void *parent) { - struct d3d10_buffer *buffer = parent; + struct d3d_buffer *buffer = parent; wined3d_private_store_cleanup(&buffer->private_store); HeapFree(GetProcessHeap(), 0, parent); @@ -234,23 +385,28 @@ d3d10_buffer_wined3d_object_released, }; -HRESULT d3d10_buffer_init(struct d3d10_buffer *buffer, struct d3d_device *device, - const D3D10_BUFFER_DESC *desc, const D3D10_SUBRESOURCE_DATA *data) +static HRESULT d3d_buffer_init(struct d3d_buffer *buffer, struct d3d_device *device, + const D3D11_BUFFER_DESC *desc, const D3D11_SUBRESOURCE_DATA *data) { struct wined3d_buffer_desc wined3d_desc; HRESULT hr; + buffer->ID3D11Buffer_iface.lpVtbl = &d3d11_buffer_vtbl; buffer->ID3D10Buffer_iface.lpVtbl = &d3d10_buffer_vtbl; buffer->refcount = 1; wined3d_mutex_lock(); wined3d_private_store_init(&buffer->private_store); + buffer->desc = *desc; wined3d_desc.byte_width = desc->ByteWidth; - wined3d_desc.usage = wined3d_usage_from_d3d10core(0, desc->Usage); + wined3d_desc.usage = wined3d_usage_from_d3d11(0, desc->Usage); wined3d_desc.bind_flags = desc->BindFlags; wined3d_desc.cpu_access_flags = desc->CPUAccessFlags; wined3d_desc.misc_flags = desc->MiscFlags; + if (desc->StructureByteStride) + FIXME("Ignoring structure byte stride %u.\n", desc->StructureByteStride); + if (FAILED(hr = wined3d_buffer_create(device->wined3d_device, &wined3d_desc, (const struct wined3d_sub_resource_data *)data, buffer, &d3d10_buffer_wined3d_parent_ops, &buffer->wined3d_buffer))) @@ -262,8 +418,30 @@ } wined3d_mutex_unlock(); - buffer->device = &device->ID3D10Device1_iface; - ID3D10Device1_AddRef(buffer->device); + buffer->device = &device->ID3D11Device_iface; + ID3D11Device_AddRef(buffer->device); + + return S_OK; +} + +HRESULT d3d_buffer_create(struct d3d_device *device, const D3D11_BUFFER_DESC *desc, + const D3D11_SUBRESOURCE_DATA *data, struct d3d_buffer **buffer) +{ + struct d3d_buffer *object; + HRESULT hr; + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + if (FAILED(hr = d3d_buffer_init(object, device, desc, data))) + { + WARN("Failed to initialize buffer, hr %#x.\n", hr); + HeapFree(GetProcessHeap(), 0, object); + return hr; + } + + TRACE("Created buffer %p.\n", object); + *buffer = object; return S_OK; } diff -Nru wine1.7-1.7.50/dlls/d3d11/d3d11_main.c wine1.7-1.7.55/dlls/d3d11/d3d11_main.c --- wine1.7-1.7.50/dlls/d3d11/d3d11_main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d11/d3d11_main.c 2015-11-13 14:32:40.000000000 +0000 @@ -88,7 +88,7 @@ } object = *layer_base; - if (FAILED(hr = d3d10_device_init(object, device_object))) + if (FAILED(hr = d3d_device_init(object, device_object))) { WARN("Failed to initialize device, hr %#x.\n", hr); *device_layer = NULL; @@ -103,7 +103,7 @@ HRESULT WINAPI D3D11CoreRegisterLayers(void) { - const struct dxgi_device_layer layers[] = + static const struct dxgi_device_layer layers[] = { {DXGI_DEVICE_LAYER_D3D10_DEVICE, layer_init, layer_get_size, layer_create}, }; @@ -145,16 +145,24 @@ } HRESULT WINAPI D3D11CreateDevice(IDXGIAdapter *adapter, D3D_DRIVER_TYPE driver_type, HMODULE swrast, UINT flags, - const D3D_FEATURE_LEVEL *feature_levels, UINT levels, UINT sdk_version, ID3D11Device **device, + const D3D_FEATURE_LEVEL *feature_levels, UINT levels, UINT sdk_version, ID3D11Device **device_out, D3D_FEATURE_LEVEL *obtained_feature_level, ID3D11DeviceContext **immediate_context) { IDXGIFactory *factory; + ID3D11Device *device; HRESULT hr; TRACE("adapter %p, driver_type %s, swrast %p, flags %#x, feature_levels %p, levels %u, sdk_version %u, " "device %p, obtained_feature_level %p, immediate_context %p.\n", adapter, debug_d3d_driver_type(driver_type), swrast, flags, feature_levels, levels, sdk_version, - device, obtained_feature_level, immediate_context); + device_out, obtained_feature_level, immediate_context); + + if (device_out) + *device_out = NULL; + if (obtained_feature_level) + *obtained_feature_level = 0; + if (immediate_context) + *immediate_context = NULL; if (adapter) { @@ -168,7 +176,7 @@ } else { - hr = CreateDXGIFactory(&IID_IDXGIFactory, (void **)&factory); + hr = CreateDXGIFactory1(&IID_IDXGIFactory, (void **)&factory); if (FAILED(hr)) { WARN("Failed to create dxgi factory, returning %#x.\n", hr); @@ -237,7 +245,7 @@ } } - hr = D3D11CoreCreateDevice(factory, adapter, flags, feature_levels, levels, device); + hr = D3D11CoreCreateDevice(factory, adapter, flags, feature_levels, levels, &device); IDXGIAdapter_Release(adapter); IDXGIFactory_Release(factory); if (FAILED(hr)) @@ -246,25 +254,102 @@ return hr; } - TRACE("Created ID3D11Device %p.\n", *device); + TRACE("Created ID3D11Device %p.\n", device); if (obtained_feature_level) - *obtained_feature_level = ID3D11Device_GetFeatureLevel(*device); + *obtained_feature_level = ID3D11Device_GetFeatureLevel(device); if (immediate_context) - ID3D11Device_GetImmediateContext(*device, immediate_context); + ID3D11Device_GetImmediateContext(device, immediate_context); - return hr; + if (device_out) + *device_out = device; + else + ID3D11Device_Release(device); + + return S_OK; } HRESULT WINAPI D3D11CreateDeviceAndSwapChain(IDXGIAdapter *adapter, D3D_DRIVER_TYPE driver_type, HMODULE swrast, UINT flags, const D3D_FEATURE_LEVEL *feature_levels, UINT levels, UINT sdk_version, const DXGI_SWAP_CHAIN_DESC *swapchain_desc, IDXGISwapChain **swapchain, - ID3D11Device **device, D3D_FEATURE_LEVEL *feature_level, ID3D11DeviceContext **immediate_context) + ID3D11Device **device_out, D3D_FEATURE_LEVEL *obtained_feature_level, ID3D11DeviceContext **immediate_context) { - FIXME("adapter %p, driver_type %s, swrast %p, flags %#x, feature_levels %p, levels %#x, sdk_version %u, " - "swapchain_desc %p, swapchain %p, device %p, feature_level %p, immediate_context %p stub!\n", + DXGI_SWAP_CHAIN_DESC desc; + IDXGIDevice *dxgi_device; + IDXGIFactory *factory; + ID3D11Device *device; + HRESULT hr; + + TRACE("adapter %p, driver_type %s, swrast %p, flags %#x, feature_levels %p, levels %u, sdk_version %u, " + "swapchain_desc %p, swapchain %p, device %p, obtained_feature_level %p, immediate_context %p.\n", adapter, debug_d3d_driver_type(driver_type), swrast, flags, feature_levels, levels, sdk_version, - swapchain_desc, swapchain, device, feature_level, immediate_context); - return E_NOTIMPL; + swapchain_desc, swapchain, device_out, obtained_feature_level, immediate_context); + + if (swapchain) + *swapchain = NULL; + if (device_out) + *device_out = NULL; + + if (FAILED(hr = D3D11CreateDevice(adapter, driver_type, swrast, flags, feature_levels, levels, sdk_version, + &device, obtained_feature_level, immediate_context))) + { + WARN("Failed to create a device, returning %#x.\n", hr); + return hr; + } + + if (swapchain) + { + if (FAILED(hr = ID3D11Device_QueryInterface(device, &IID_IDXGIDevice, (void **)&dxgi_device))) + { + ERR("Failed to get a dxgi device from the d3d11 device, returning %#x.\n", hr); + goto cleanup; + } + + hr = IDXGIDevice_GetAdapter(dxgi_device, &adapter); + IDXGIDevice_Release(dxgi_device); + if (FAILED(hr)) + { + ERR("Failed to get the device adapter, returning %#x.\n", hr); + goto cleanup; + } + + hr = IDXGIAdapter_GetParent(adapter, &IID_IDXGIFactory, (void **)&factory); + IDXGIAdapter_Release(adapter); + if (FAILED(hr)) + { + ERR("Failed to get the adapter factory, returning %#x.\n", hr); + goto cleanup; + } + + desc = *swapchain_desc; + hr = IDXGIFactory_CreateSwapChain(factory, (IUnknown *)device, &desc, swapchain); + IDXGIFactory_Release(factory); + if (FAILED(hr)) + { + WARN("Failed to create a swapchain, returning %#x.\n", hr); + goto cleanup; + } + + TRACE("Created IDXGISwapChain %p.\n", swapchain); + } + + if (device_out) + *device_out = device; + else + ID3D11Device_Release(device); + + return S_OK; + +cleanup: + ID3D11Device_Release(device); + if (obtained_feature_level) + *obtained_feature_level = 0; + if (immediate_context) + { + ID3D11DeviceContext_Release(*immediate_context); + *immediate_context = NULL; + } + + return hr; } diff -Nru wine1.7-1.7.50/dlls/d3d11/d3d11_private.h wine1.7-1.7.55/dlls/d3d11/d3d11_private.h --- wine1.7-1.7.50/dlls/d3d11/d3d11_private.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d11/d3d11_private.h 2015-11-13 14:32:40.000000000 +0000 @@ -29,7 +29,6 @@ #include "winuser.h" #include "objbase.h" -#include "d3d10_1.h" #include "d3d11_1.h" #ifdef D3D11_INIT_GUID #include "initguid.h" @@ -48,14 +47,14 @@ struct d3d_device; -struct d3d10_shader_info +struct d3d_shader_info { const DWORD *shader_code; struct wined3d_shader_signature *input_signature; struct wined3d_shader_signature *output_signature; }; -extern const struct wined3d_parent_ops d3d10_null_wined3d_parent_ops DECLSPEC_HIDDEN; +extern const struct wined3d_parent_ops d3d_null_wined3d_parent_ops DECLSPEC_HIDDEN; /* TRACE helper functions */ const char *debug_d3d10_primitive_topology(D3D10_PRIMITIVE_TOPOLOGY topology) DECLSPEC_HIDDEN; @@ -63,15 +62,25 @@ DXGI_FORMAT dxgi_format_from_wined3dformat(enum wined3d_format_id format) DECLSPEC_HIDDEN; enum wined3d_format_id wined3dformat_from_dxgi_format(DXGI_FORMAT format) DECLSPEC_HIDDEN; -DWORD wined3d_usage_from_d3d10core(UINT bind_flags, enum D3D10_USAGE usage) DECLSPEC_HIDDEN; -struct wined3d_resource *wined3d_resource_from_resource(ID3D10Resource *resource) DECLSPEC_HIDDEN; -DWORD wined3d_map_flags_from_d3d10_map_type(D3D10_MAP map_type) DECLSPEC_HIDDEN; +DWORD wined3d_usage_from_d3d11(UINT bind_flags, enum D3D11_USAGE usage) DECLSPEC_HIDDEN; +struct wined3d_resource *wined3d_resource_from_d3d11_resource(ID3D11Resource *resource) DECLSPEC_HIDDEN; +struct wined3d_resource *wined3d_resource_from_d3d10_resource(ID3D10Resource *resource) DECLSPEC_HIDDEN; +DWORD wined3d_map_flags_from_d3d11_map_type(D3D11_MAP map_type) DECLSPEC_HIDDEN; + +enum D3D11_USAGE d3d11_usage_from_d3d10_usage(enum D3D10_USAGE usage) DECLSPEC_HIDDEN; +enum D3D10_USAGE d3d10_usage_from_d3d11_usage(enum D3D11_USAGE usage) DECLSPEC_HIDDEN; +UINT d3d11_bind_flags_from_d3d10_bind_flags(UINT bind_flags) DECLSPEC_HIDDEN; +UINT d3d10_bind_flags_from_d3d11_bind_flags(UINT bind_flags) DECLSPEC_HIDDEN; +UINT d3d11_cpu_access_flags_from_d3d10_cpu_access_flags(UINT cpu_access_flags) DECLSPEC_HIDDEN; +UINT d3d10_cpu_access_flags_from_d3d11_cpu_access_flags(UINT cpu_access_flags) DECLSPEC_HIDDEN; +UINT d3d11_resource_misc_flags_from_d3d10_resource_misc_flags(UINT resource_misc_flags) DECLSPEC_HIDDEN; +UINT d3d10_resource_misc_flags_from_d3d11_resource_misc_flags(UINT resource_misc_flags) DECLSPEC_HIDDEN; -HRESULT d3d10_get_private_data(struct wined3d_private_store *store, +HRESULT d3d_get_private_data(struct wined3d_private_store *store, REFGUID guid, UINT *data_size, void *data) DECLSPEC_HIDDEN; -HRESULT d3d10_set_private_data(struct wined3d_private_store *store, +HRESULT d3d_set_private_data(struct wined3d_private_store *store, REFGUID guid, UINT data_size, const void *data) DECLSPEC_HIDDEN; -HRESULT d3d10_set_private_data_interface(struct wined3d_private_store *store, +HRESULT d3d_set_private_data_interface(struct wined3d_private_store *store, REFGUID guid, const IUnknown *object) DECLSPEC_HIDDEN; static inline void read_dword(const char **ptr, DWORD *d) @@ -85,108 +94,128 @@ HRESULT parse_dxbc(const char *data, SIZE_T data_size, HRESULT (*chunk_handler)(const char *data, DWORD data_size, DWORD tag, void *ctx), void *ctx) DECLSPEC_HIDDEN; -/* ID3D10Texture2D */ -struct d3d10_texture2d +/* ID3D11Texture2D, ID3D10Texture2D */ +struct d3d_texture2d { + ID3D11Texture2D ID3D11Texture2D_iface; ID3D10Texture2D ID3D10Texture2D_iface; LONG refcount; struct wined3d_private_store private_store; IUnknown *dxgi_surface; struct wined3d_texture *wined3d_texture; - D3D10_TEXTURE2D_DESC desc; - ID3D10Device1 *device; + D3D11_TEXTURE2D_DESC desc; + ID3D11Device *device; }; -HRESULT d3d10_texture2d_init(struct d3d10_texture2d *texture, struct d3d_device *device, - const D3D10_TEXTURE2D_DESC *desc, const D3D10_SUBRESOURCE_DATA *initial_data) DECLSPEC_HIDDEN; -struct d3d10_texture2d *unsafe_impl_from_ID3D10Texture2D(ID3D10Texture2D *iface) DECLSPEC_HIDDEN; +static inline struct d3d_texture2d *impl_from_ID3D10Texture2D(ID3D10Texture2D *iface) +{ + return CONTAINING_RECORD(iface, struct d3d_texture2d, ID3D10Texture2D_iface); +} + +HRESULT d3d_texture2d_create(struct d3d_device *device, const D3D11_TEXTURE2D_DESC *desc, + const D3D11_SUBRESOURCE_DATA *data, struct d3d_texture2d **texture) DECLSPEC_HIDDEN; +struct d3d_texture2d *unsafe_impl_from_ID3D11Texture2D(ID3D11Texture2D *iface) DECLSPEC_HIDDEN; +struct d3d_texture2d *unsafe_impl_from_ID3D10Texture2D(ID3D10Texture2D *iface) DECLSPEC_HIDDEN; -/* ID3D10Texture3D */ -struct d3d10_texture3d +/* ID3D11Texture3D, ID3D10Texture3D */ +struct d3d_texture3d { + ID3D11Texture3D ID3D11Texture3D_iface; ID3D10Texture3D ID3D10Texture3D_iface; LONG refcount; struct wined3d_private_store private_store; struct wined3d_texture *wined3d_texture; - D3D10_TEXTURE3D_DESC desc; - ID3D10Device1 *device; + D3D11_TEXTURE3D_DESC desc; + ID3D11Device *device; }; -HRESULT d3d10_texture3d_init(struct d3d10_texture3d *texture, struct d3d_device *device, - const D3D10_TEXTURE3D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data) DECLSPEC_HIDDEN; +HRESULT d3d_texture3d_create(struct d3d_device *device, const D3D11_TEXTURE3D_DESC *desc, + const D3D11_SUBRESOURCE_DATA *data, struct d3d_texture3d **texture) DECLSPEC_HIDDEN; +struct d3d_texture3d *unsafe_impl_from_ID3D11Texture3D(ID3D11Texture3D *iface) DECLSPEC_HIDDEN; -/* ID3D10Buffer */ -struct d3d10_buffer +/* ID3D11Buffer, ID3D10Buffer */ +struct d3d_buffer { + ID3D11Buffer ID3D11Buffer_iface; ID3D10Buffer ID3D10Buffer_iface; LONG refcount; struct wined3d_private_store private_store; struct wined3d_buffer *wined3d_buffer; - ID3D10Device1 *device; + D3D11_BUFFER_DESC desc; + ID3D11Device *device; }; -HRESULT d3d10_buffer_init(struct d3d10_buffer *buffer, struct d3d_device *device, - const D3D10_BUFFER_DESC *desc, const D3D10_SUBRESOURCE_DATA *data) DECLSPEC_HIDDEN; -struct d3d10_buffer *unsafe_impl_from_ID3D10Buffer(ID3D10Buffer *iface) DECLSPEC_HIDDEN; +HRESULT d3d_buffer_create(struct d3d_device *device, const D3D11_BUFFER_DESC *desc, + const D3D11_SUBRESOURCE_DATA *data, struct d3d_buffer **buffer) DECLSPEC_HIDDEN; +struct d3d_buffer *unsafe_impl_from_ID3D11Buffer(ID3D11Buffer *iface) DECLSPEC_HIDDEN; +struct d3d_buffer *unsafe_impl_from_ID3D10Buffer(ID3D10Buffer *iface) DECLSPEC_HIDDEN; -/* ID3D10DepthStencilView */ -struct d3d10_depthstencil_view +/* ID3D11DepthStencilView, ID3D10DepthStencilView */ +struct d3d_depthstencil_view { + ID3D11DepthStencilView ID3D11DepthStencilView_iface; ID3D10DepthStencilView ID3D10DepthStencilView_iface; LONG refcount; struct wined3d_private_store private_store; struct wined3d_rendertarget_view *wined3d_view; - D3D10_DEPTH_STENCIL_VIEW_DESC desc; - ID3D10Resource *resource; - ID3D10Device1 *device; + D3D11_DEPTH_STENCIL_VIEW_DESC desc; + ID3D11Resource *resource; + ID3D11Device *device; }; -HRESULT d3d10_depthstencil_view_init(struct d3d10_depthstencil_view *view, struct d3d_device *device, - ID3D10Resource *resource, const D3D10_DEPTH_STENCIL_VIEW_DESC *desc) DECLSPEC_HIDDEN; -struct d3d10_depthstencil_view *unsafe_impl_from_ID3D10DepthStencilView(ID3D10DepthStencilView *iface) DECLSPEC_HIDDEN; +HRESULT d3d_depthstencil_view_create(struct d3d_device *device, ID3D11Resource *resource, + const D3D11_DEPTH_STENCIL_VIEW_DESC *desc, struct d3d_depthstencil_view **view) DECLSPEC_HIDDEN; +struct d3d_depthstencil_view *unsafe_impl_from_ID3D11DepthStencilView(ID3D11DepthStencilView *iface) DECLSPEC_HIDDEN; +struct d3d_depthstencil_view *unsafe_impl_from_ID3D10DepthStencilView(ID3D10DepthStencilView *iface) DECLSPEC_HIDDEN; -/* ID3D10RenderTargetView */ -struct d3d10_rendertarget_view +/* ID3D11RenderTargetView, ID3D10RenderTargetView */ +struct d3d_rendertarget_view { + ID3D11RenderTargetView ID3D11RenderTargetView_iface; ID3D10RenderTargetView ID3D10RenderTargetView_iface; LONG refcount; struct wined3d_private_store private_store; struct wined3d_rendertarget_view *wined3d_view; - D3D10_RENDER_TARGET_VIEW_DESC desc; - ID3D10Resource *resource; - ID3D10Device1 *device; + D3D11_RENDER_TARGET_VIEW_DESC desc; + ID3D11Resource *resource; + ID3D11Device *device; }; -HRESULT d3d10_rendertarget_view_init(struct d3d10_rendertarget_view *view, struct d3d_device *device, - ID3D10Resource *resource, const D3D10_RENDER_TARGET_VIEW_DESC *desc) DECLSPEC_HIDDEN; -struct d3d10_rendertarget_view *unsafe_impl_from_ID3D10RenderTargetView(ID3D10RenderTargetView *iface) DECLSPEC_HIDDEN; +HRESULT d3d_rendertarget_view_create(struct d3d_device *device, ID3D11Resource *resource, + const D3D11_RENDER_TARGET_VIEW_DESC *desc, struct d3d_rendertarget_view **view) DECLSPEC_HIDDEN; +struct d3d_rendertarget_view *unsafe_impl_from_ID3D11RenderTargetView(ID3D11RenderTargetView *iface) DECLSPEC_HIDDEN; +struct d3d_rendertarget_view *unsafe_impl_from_ID3D10RenderTargetView(ID3D10RenderTargetView *iface) DECLSPEC_HIDDEN; -/* ID3D10ShaderResourceView */ -struct d3d10_shader_resource_view +/* ID3D11ShaderResourceView, ID3D10ShaderResourceView1 */ +struct d3d_shader_resource_view { - ID3D10ShaderResourceView ID3D10ShaderResourceView_iface; + ID3D11ShaderResourceView ID3D11ShaderResourceView_iface; + ID3D10ShaderResourceView1 ID3D10ShaderResourceView1_iface; LONG refcount; struct wined3d_private_store private_store; struct wined3d_shader_resource_view *wined3d_view; - D3D10_SHADER_RESOURCE_VIEW_DESC desc; - ID3D10Resource *resource; - ID3D10Device1 *device; + D3D11_SHADER_RESOURCE_VIEW_DESC desc; + ID3D11Resource *resource; + ID3D11Device *device; }; -HRESULT d3d10_shader_resource_view_init(struct d3d10_shader_resource_view *view, struct d3d_device *device, - ID3D10Resource *resource, const D3D10_SHADER_RESOURCE_VIEW_DESC *desc) DECLSPEC_HIDDEN; -struct d3d10_shader_resource_view *unsafe_impl_from_ID3D10ShaderResourceView( +HRESULT d3d_shader_resource_view_create(struct d3d_device *device, ID3D11Resource *resource, + const D3D11_SHADER_RESOURCE_VIEW_DESC *desc, struct d3d_shader_resource_view **view) DECLSPEC_HIDDEN; +struct d3d_shader_resource_view *unsafe_impl_from_ID3D11ShaderResourceView( + ID3D11ShaderResourceView *iface) DECLSPEC_HIDDEN; +struct d3d_shader_resource_view *unsafe_impl_from_ID3D10ShaderResourceView( ID3D10ShaderResourceView *iface) DECLSPEC_HIDDEN; -/* ID3D10InputLayout */ -struct d3d10_input_layout +/* ID3D11InputLayout, ID3D10InputLayout */ +struct d3d_input_layout { + ID3D11InputLayout ID3D11InputLayout_iface; ID3D10InputLayout ID3D10InputLayout_iface; LONG refcount; @@ -194,141 +223,166 @@ struct wined3d_vertex_declaration *wined3d_decl; }; -HRESULT d3d10_input_layout_init(struct d3d10_input_layout *layout, struct d3d_device *device, - const D3D10_INPUT_ELEMENT_DESC *element_descs, UINT element_count, - const void *shader_byte_code, SIZE_T shader_byte_code_length) DECLSPEC_HIDDEN; -struct d3d10_input_layout *unsafe_impl_from_ID3D10InputLayout(ID3D10InputLayout *iface) DECLSPEC_HIDDEN; +HRESULT d3d_input_layout_create(struct d3d_device *device, + const D3D11_INPUT_ELEMENT_DESC *element_descs, UINT element_count, + const void *shader_byte_code, SIZE_T shader_byte_code_length, + struct d3d_input_layout **layout) DECLSPEC_HIDDEN; +struct d3d_input_layout *unsafe_impl_from_ID3D11InputLayout(ID3D11InputLayout *iface) DECLSPEC_HIDDEN; +struct d3d_input_layout *unsafe_impl_from_ID3D10InputLayout(ID3D10InputLayout *iface) DECLSPEC_HIDDEN; -/* ID3D10VertexShader */ -struct d3d10_vertex_shader +/* ID3D11VertexShader, ID3D10VertexShader */ +struct d3d_vertex_shader { + ID3D11VertexShader ID3D11VertexShader_iface; ID3D10VertexShader ID3D10VertexShader_iface; LONG refcount; struct wined3d_private_store private_store; struct wined3d_shader *wined3d_shader; - ID3D10Device1 *device; + ID3D11Device *device; }; -HRESULT d3d10_vertex_shader_init(struct d3d10_vertex_shader *shader, struct d3d_device *device, - const void *byte_code, SIZE_T byte_code_length) DECLSPEC_HIDDEN; -struct d3d10_vertex_shader *unsafe_impl_from_ID3D10VertexShader(ID3D10VertexShader *iface) DECLSPEC_HIDDEN; +HRESULT d3d_vertex_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, + struct d3d_vertex_shader **shader) DECLSPEC_HIDDEN; +struct d3d_vertex_shader *unsafe_impl_from_ID3D11VertexShader(ID3D11VertexShader *iface) DECLSPEC_HIDDEN; +struct d3d_vertex_shader *unsafe_impl_from_ID3D10VertexShader(ID3D10VertexShader *iface) DECLSPEC_HIDDEN; -/* ID3D10GeometryShader */ -struct d3d10_geometry_shader +/* ID3D11GeometryShader, ID3D10GeometryShader */ +struct d3d_geometry_shader { + ID3D11GeometryShader ID3D11GeometryShader_iface; ID3D10GeometryShader ID3D10GeometryShader_iface; LONG refcount; struct wined3d_private_store private_store; struct wined3d_shader *wined3d_shader; + ID3D11Device *device; }; -HRESULT d3d10_geometry_shader_init(struct d3d10_geometry_shader *shader, struct d3d_device *device, - const void *byte_code, SIZE_T byte_code_length) DECLSPEC_HIDDEN; -struct d3d10_geometry_shader *unsafe_impl_from_ID3D10GeometryShader(ID3D10GeometryShader *iface) DECLSPEC_HIDDEN; +HRESULT d3d_geometry_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, + struct d3d_geometry_shader **shader) DECLSPEC_HIDDEN; +struct d3d_geometry_shader *unsafe_impl_from_ID3D11GeometryShader(ID3D11GeometryShader *iface) DECLSPEC_HIDDEN; +struct d3d_geometry_shader *unsafe_impl_from_ID3D10GeometryShader(ID3D10GeometryShader *iface) DECLSPEC_HIDDEN; -/* ID3D10PixelShader */ -struct d3d10_pixel_shader +/* ID3D11PixelShader, ID3D10PixelShader */ +struct d3d_pixel_shader { + ID3D11PixelShader ID3D11PixelShader_iface; ID3D10PixelShader ID3D10PixelShader_iface; LONG refcount; struct wined3d_private_store private_store; struct wined3d_shader *wined3d_shader; - ID3D10Device1 *device; + ID3D11Device *device; }; -HRESULT d3d10_pixel_shader_init(struct d3d10_pixel_shader *shader, struct d3d_device *device, - const void *byte_code, SIZE_T byte_code_length) DECLSPEC_HIDDEN; -struct d3d10_pixel_shader *unsafe_impl_from_ID3D10PixelShader(ID3D10PixelShader *iface) DECLSPEC_HIDDEN; +HRESULT d3d_pixel_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, + struct d3d_pixel_shader **shader) DECLSPEC_HIDDEN; +struct d3d_pixel_shader *unsafe_impl_from_ID3D11PixelShader(ID3D11PixelShader *iface) DECLSPEC_HIDDEN; +struct d3d_pixel_shader *unsafe_impl_from_ID3D10PixelShader(ID3D10PixelShader *iface) DECLSPEC_HIDDEN; HRESULT shader_parse_signature(const char *data, DWORD data_size, struct wined3d_shader_signature *s) DECLSPEC_HIDDEN; void shader_free_signature(struct wined3d_shader_signature *s) DECLSPEC_HIDDEN; -/* ID3D10BlendState */ -struct d3d10_blend_state +/* ID3D11BlendState, ID3D10BlendState1 */ +struct d3d_blend_state { - ID3D10BlendState ID3D10BlendState_iface; + ID3D11BlendState ID3D11BlendState_iface; + ID3D10BlendState1 ID3D10BlendState1_iface; LONG refcount; struct wined3d_private_store private_store; - D3D10_BLEND_DESC desc; + D3D11_BLEND_DESC desc; struct wine_rb_entry entry; - ID3D10Device1 *device; + ID3D11Device *device; }; -HRESULT d3d10_blend_state_init(struct d3d10_blend_state *state, struct d3d_device *device, - const D3D10_BLEND_DESC *desc) DECLSPEC_HIDDEN; -struct d3d10_blend_state *unsafe_impl_from_ID3D10BlendState(ID3D10BlendState *iface) DECLSPEC_HIDDEN; +HRESULT d3d_blend_state_init(struct d3d_blend_state *state, struct d3d_device *device, + const D3D11_BLEND_DESC *desc) DECLSPEC_HIDDEN; +struct d3d_blend_state *unsafe_impl_from_ID3D11BlendState(ID3D11BlendState *iface) DECLSPEC_HIDDEN; +struct d3d_blend_state *unsafe_impl_from_ID3D10BlendState(ID3D10BlendState *iface) DECLSPEC_HIDDEN; -/* ID3D10DepthStencilState */ -struct d3d10_depthstencil_state +/* ID3D11DepthStencilState, ID3D10DepthStencilState */ +struct d3d_depthstencil_state { + ID3D11DepthStencilState ID3D11DepthStencilState_iface; ID3D10DepthStencilState ID3D10DepthStencilState_iface; LONG refcount; struct wined3d_private_store private_store; - D3D10_DEPTH_STENCIL_DESC desc; + D3D11_DEPTH_STENCIL_DESC desc; struct wine_rb_entry entry; - ID3D10Device1 *device; + ID3D11Device *device; }; -HRESULT d3d10_depthstencil_state_init(struct d3d10_depthstencil_state *state, struct d3d_device *device, - const D3D10_DEPTH_STENCIL_DESC *desc) DECLSPEC_HIDDEN; -struct d3d10_depthstencil_state *unsafe_impl_from_ID3D10DepthStencilState( +HRESULT d3d_depthstencil_state_init(struct d3d_depthstencil_state *state, struct d3d_device *device, + const D3D11_DEPTH_STENCIL_DESC *desc) DECLSPEC_HIDDEN; +struct d3d_depthstencil_state *unsafe_impl_from_ID3D10DepthStencilState( ID3D10DepthStencilState *iface) DECLSPEC_HIDDEN; -/* ID3D10RasterizerState */ -struct d3d10_rasterizer_state +/* ID3D11RasterizerState, ID3D10RasterizerState */ +struct d3d_rasterizer_state { + ID3D11RasterizerState ID3D11RasterizerState_iface; ID3D10RasterizerState ID3D10RasterizerState_iface; LONG refcount; struct wined3d_private_store private_store; - D3D10_RASTERIZER_DESC desc; + D3D11_RASTERIZER_DESC desc; struct wine_rb_entry entry; - ID3D10Device1 *device; + ID3D11Device *device; }; -HRESULT d3d10_rasterizer_state_init(struct d3d10_rasterizer_state *state, struct d3d_device *device, - const D3D10_RASTERIZER_DESC *desc) DECLSPEC_HIDDEN; -struct d3d10_rasterizer_state *unsafe_impl_from_ID3D10RasterizerState(ID3D10RasterizerState *iface) DECLSPEC_HIDDEN; +HRESULT d3d_rasterizer_state_init(struct d3d_rasterizer_state *state, struct d3d_device *device, + const D3D11_RASTERIZER_DESC *desc) DECLSPEC_HIDDEN; +struct d3d_rasterizer_state *unsafe_impl_from_ID3D11RasterizerState(ID3D11RasterizerState *iface) DECLSPEC_HIDDEN; +struct d3d_rasterizer_state *unsafe_impl_from_ID3D10RasterizerState(ID3D10RasterizerState *iface) DECLSPEC_HIDDEN; -/* ID3D10SamplerState */ -struct d3d10_sampler_state +/* ID3D11SamplerState, ID3D10SamplerState */ +struct d3d_sampler_state { + ID3D11SamplerState ID3D11SamplerState_iface; ID3D10SamplerState ID3D10SamplerState_iface; LONG refcount; struct wined3d_private_store private_store; struct wined3d_sampler *wined3d_sampler; - D3D10_SAMPLER_DESC desc; + D3D11_SAMPLER_DESC desc; struct wine_rb_entry entry; - ID3D10Device1 *device; + ID3D11Device *device; }; -HRESULT d3d10_sampler_state_init(struct d3d10_sampler_state *state, struct d3d_device *device, - const D3D10_SAMPLER_DESC *desc) DECLSPEC_HIDDEN; -struct d3d10_sampler_state *unsafe_impl_from_ID3D10SamplerState(ID3D10SamplerState *iface) DECLSPEC_HIDDEN; +HRESULT d3d_sampler_state_init(struct d3d_sampler_state *state, struct d3d_device *device, + const D3D11_SAMPLER_DESC *desc) DECLSPEC_HIDDEN; +struct d3d_sampler_state *unsafe_impl_from_ID3D11SamplerState(ID3D11SamplerState *iface) DECLSPEC_HIDDEN; +struct d3d_sampler_state *unsafe_impl_from_ID3D10SamplerState(ID3D10SamplerState *iface) DECLSPEC_HIDDEN; -/* ID3D10Query */ -struct d3d10_query +/* ID3D11Query, ID3D10Query */ +struct d3d_query { + ID3D11Query ID3D11Query_iface; ID3D10Query ID3D10Query_iface; LONG refcount; struct wined3d_private_store private_store; struct wined3d_query *wined3d_query; BOOL predicate; - ID3D10Device1 *device; + ID3D11Device *device; }; -HRESULT d3d10_query_init(struct d3d10_query *query, struct d3d_device *device, - const D3D10_QUERY_DESC *desc, BOOL predicate) DECLSPEC_HIDDEN; -struct d3d10_query *unsafe_impl_from_ID3D10Query(ID3D10Query *iface) DECLSPEC_HIDDEN; +HRESULT d3d_query_create(struct d3d_device *device, const D3D11_QUERY_DESC *desc, BOOL predicate, + struct d3d_query **query) DECLSPEC_HIDDEN; +struct d3d_query *unsafe_impl_from_ID3D11Query(ID3D11Query *iface) DECLSPEC_HIDDEN; +struct d3d_query *unsafe_impl_from_ID3D10Query(ID3D10Query *iface) DECLSPEC_HIDDEN; -/* IDirect3D10Device1 */ +/* ID3D11DeviceContext - immediate context */ +struct d3d11_immediate_context +{ + ID3D11DeviceContext ID3D11DeviceContext_iface; + LONG refcount; +}; + +/* ID3D11Device, ID3D10Device1 */ struct d3d_device { IUnknown IUnknown_inner; @@ -339,6 +393,8 @@ IUnknown *outer_unk; LONG refcount; + struct d3d11_immediate_context immediate_context; + struct wined3d_device_parent device_parent; struct wined3d_device *wined3d_device; @@ -347,19 +403,24 @@ struct wine_rb_tree rasterizer_states; struct wine_rb_tree sampler_states; - struct d3d10_blend_state *blend_state; + struct d3d_blend_state *blend_state; float blend_factor[4]; - struct d3d10_depthstencil_state *depth_stencil_state; + struct d3d_depthstencil_state *depth_stencil_state; UINT stencil_ref; - struct d3d10_rasterizer_state *rasterizer_state; + struct d3d_rasterizer_state *rasterizer_state; }; +static inline struct d3d_device *impl_from_ID3D11Device(ID3D11Device *iface) +{ + return CONTAINING_RECORD(iface, struct d3d_device, ID3D11Device_iface); +} + static inline struct d3d_device *impl_from_ID3D10Device(ID3D10Device1 *iface) { return CONTAINING_RECORD(iface, struct d3d_device, ID3D10Device1_iface); } -HRESULT d3d10_device_init(struct d3d_device *device, void *outer_unknown) DECLSPEC_HIDDEN; +HRESULT d3d_device_init(struct d3d_device *device, void *outer_unknown) DECLSPEC_HIDDEN; /* Layered device */ enum dxgi_device_layer_id diff -Nru wine1.7-1.7.50/dlls/d3d11/device.c wine1.7-1.7.55/dlls/d3d11/device.c --- wine1.7-1.7.50/dlls/d3d11/device.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d11/device.c 2015-11-13 14:32:40.000000000 +0000 @@ -20,120 +20,120 @@ #include "config.h" #include "wine/port.h" +#define NONAMELESSUNION #include "d3d11_private.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d11); -static void STDMETHODCALLTYPE d3d10_null_wined3d_object_destroyed(void *parent) {} +static void STDMETHODCALLTYPE d3d_null_wined3d_object_destroyed(void *parent) {} -const struct wined3d_parent_ops d3d10_null_wined3d_parent_ops = +const struct wined3d_parent_ops d3d_null_wined3d_parent_ops = { - d3d10_null_wined3d_object_destroyed, + d3d_null_wined3d_object_destroyed, }; -/* Inner IUnknown methods */ +/* ID3D11DeviceContext - immediate context methods */ -static inline struct d3d_device *impl_from_IUnknown(IUnknown *iface) +static inline struct d3d11_immediate_context *impl_from_ID3D11DeviceContext(ID3D11DeviceContext *iface) { - return CONTAINING_RECORD(iface, struct d3d_device, IUnknown_inner); + return CONTAINING_RECORD(iface, struct d3d11_immediate_context, ID3D11DeviceContext_iface); } -static HRESULT STDMETHODCALLTYPE d3d10_device_inner_QueryInterface(IUnknown *iface, REFIID riid, void **out) +static inline struct d3d_device *device_from_immediate_ID3D11DeviceContext(ID3D11DeviceContext *iface) { - struct d3d_device *device = impl_from_IUnknown(iface); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext(iface); + return CONTAINING_RECORD(context, struct d3d_device, immediate_context); +} +static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_QueryInterface(ID3D11DeviceContext *iface, + REFIID riid, void **out) +{ TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); - if (IsEqualGUID(riid, &IID_ID3D10Device1) - || IsEqualGUID(riid, &IID_ID3D10Device) + if (IsEqualGUID(riid, &IID_ID3D11DeviceContext) + || IsEqualGUID(riid, &IID_ID3D11DeviceChild) || IsEqualGUID(riid, &IID_IUnknown)) { - *out = &device->ID3D10Device1_iface; - } - else if (IsEqualGUID(riid, &IID_ID3D11Device)) - { - *out = &device->ID3D11Device_iface; - } - else if (IsEqualGUID(riid, &IID_ID3D10Multithread)) - { - *out = &device->ID3D10Multithread_iface; - } - else if (IsEqualGUID(riid, &IID_IWineDXGIDeviceParent)) - { - *out = &device->IWineDXGIDeviceParent_iface; - } - else - { - WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); - *out = NULL; - return E_NOINTERFACE; + ID3D11DeviceContext_AddRef(iface); + *out = iface; + return S_OK; } - IUnknown_AddRef((IUnknown *)*out); - return S_OK; + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + *out = NULL; + return E_NOINTERFACE; } -static ULONG STDMETHODCALLTYPE d3d10_device_inner_AddRef(IUnknown *iface) +static ULONG STDMETHODCALLTYPE d3d11_immediate_context_AddRef(ID3D11DeviceContext *iface) { - struct d3d_device *This = impl_from_IUnknown(iface); - ULONG refcount = InterlockedIncrement(&This->refcount); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); + ULONG refcount = InterlockedIncrement(&context->refcount); + + TRACE("%p increasing refcount to %u.\n", context, refcount); - TRACE("%p increasing refcount to %u\n", This, refcount); + if (refcount == 1) + { + ID3D11Device_AddRef(&device->ID3D11Device_iface); + } return refcount; } -static ULONG STDMETHODCALLTYPE d3d10_device_inner_Release(IUnknown *iface) +static ULONG STDMETHODCALLTYPE d3d11_immediate_context_Release(ID3D11DeviceContext *iface) { - struct d3d_device *device = impl_from_IUnknown(iface); - ULONG refcount = InterlockedDecrement(&device->refcount); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); + ULONG refcount = InterlockedDecrement(&context->refcount); - TRACE("%p decreasing refcount to %u.\n", device, refcount); + TRACE("%p decreasing refcount to %u.\n", context, refcount); if (!refcount) { - if (device->wined3d_device) - { - wined3d_mutex_lock(); - wined3d_device_decref(device->wined3d_device); - wined3d_mutex_unlock(); - } - wine_rb_destroy(&device->sampler_states, NULL, NULL); - wine_rb_destroy(&device->rasterizer_states, NULL, NULL); - wine_rb_destroy(&device->depthstencil_states, NULL, NULL); - wine_rb_destroy(&device->blend_states, NULL, NULL); + ID3D11Device_Release(&device->ID3D11Device_iface); } return refcount; } -/* IUnknown methods */ - -static HRESULT STDMETHODCALLTYPE d3d10_device_QueryInterface(ID3D10Device1 *iface, REFIID riid, - void **ppv) +static void STDMETHODCALLTYPE d3d11_immediate_context_GetDevice(ID3D11DeviceContext *iface, ID3D11Device **device) { - struct d3d_device *This = impl_from_ID3D10Device(iface); - return IUnknown_QueryInterface(This->outer_unk, riid, ppv); + struct d3d_device *device_object = device_from_immediate_ID3D11DeviceContext(iface); + + TRACE("iface %p, device %p.\n", iface, device); + + *device = &device_object->ID3D11Device_iface; + ID3D11Device_AddRef(*device); } -static ULONG STDMETHODCALLTYPE d3d10_device_AddRef(ID3D10Device1 *iface) +static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_GetPrivateData(ID3D11DeviceContext *iface, REFGUID guid, + UINT *data_size, void *data) { - struct d3d_device *This = impl_from_ID3D10Device(iface); - return IUnknown_AddRef(This->outer_unk); + FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); + + return E_NOTIMPL; } -static ULONG STDMETHODCALLTYPE d3d10_device_Release(ID3D10Device1 *iface) +static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_SetPrivateData(ID3D11DeviceContext *iface, REFGUID guid, + UINT data_size, const void *data) { - struct d3d_device *This = impl_from_ID3D10Device(iface); - return IUnknown_Release(This->outer_unk); + FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); + + return E_NOTIMPL; } -/* ID3D10Device methods */ +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); -static void STDMETHODCALLTYPE d3d10_device_VSSetConstantBuffers(ID3D10Device1 *iface, - UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers) + return E_NOTIMPL; +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_VSSetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); unsigned int i; TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", @@ -142,7 +142,7 @@ wined3d_mutex_lock(); for (i = 0; i < buffer_count; ++i) { - struct d3d10_buffer *buffer = unsafe_impl_from_ID3D10Buffer(buffers[i]); + struct d3d_buffer *buffer = unsafe_impl_from_ID3D11Buffer(buffers[i]); wined3d_device_set_vs_cb(device->wined3d_device, start_slot + i, buffer ? buffer->wined3d_buffer : NULL); @@ -150,10 +150,10 @@ wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_PSSetShaderResources(ID3D10Device1 *iface, - UINT start_slot, UINT view_count, ID3D10ShaderResourceView *const *views) +static void STDMETHODCALLTYPE d3d11_immediate_context_PSSetShaderResources(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11ShaderResourceView *const *views) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); unsigned int i; TRACE("iface %p, start_slot %u, view_count %u, views %p.\n", @@ -162,7 +162,7 @@ wined3d_mutex_lock(); for (i = 0; i < view_count; ++i) { - struct d3d10_shader_resource_view *view = unsafe_impl_from_ID3D10ShaderResourceView(views[i]); + struct d3d_shader_resource_view *view = unsafe_impl_from_ID3D11ShaderResourceView(views[i]); wined3d_device_set_ps_resource_view(device->wined3d_device, start_slot + i, view ? view->wined3d_view : NULL); @@ -170,23 +170,27 @@ wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_PSSetShader(ID3D10Device1 *iface, - ID3D10PixelShader *shader) +static void STDMETHODCALLTYPE d3d11_immediate_context_PSSetShader(ID3D11DeviceContext *iface, + ID3D11PixelShader *shader, ID3D11ClassInstance *const *class_instances, UINT class_instance_count) { - struct d3d_device *This = impl_from_ID3D10Device(iface); - struct d3d10_pixel_shader *ps = unsafe_impl_from_ID3D10PixelShader(shader); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); + struct d3d_pixel_shader *ps = unsafe_impl_from_ID3D11PixelShader(shader); - TRACE("iface %p, shader %p\n", iface, shader); + TRACE("iface %p, shader %p, class_instances %p, class_instance_count %u.\n", + iface, shader, class_instances, class_instance_count); + + if (class_instances) + FIXME("Dynamic linking is not implemented yet.\n"); wined3d_mutex_lock(); - wined3d_device_set_pixel_shader(This->wined3d_device, ps ? ps->wined3d_shader : NULL); + wined3d_device_set_pixel_shader(device->wined3d_device, ps ? ps->wined3d_shader : NULL); wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_PSSetSamplers(ID3D10Device1 *iface, - UINT start_slot, UINT sampler_count, ID3D10SamplerState *const *samplers) +static void STDMETHODCALLTYPE d3d11_immediate_context_PSSetSamplers(ID3D11DeviceContext *iface, + UINT start_slot, UINT sampler_count, ID3D11SamplerState *const *samplers) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); unsigned int i; TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n", @@ -195,7 +199,7 @@ wined3d_mutex_lock(); for (i = 0; i < sampler_count; ++i) { - struct d3d10_sampler_state *sampler = unsafe_impl_from_ID3D10SamplerState(samplers[i]); + struct d3d_sampler_state *sampler = unsafe_impl_from_ID3D11SamplerState(samplers[i]); wined3d_device_set_ps_sampler(device->wined3d_device, start_slot + i, sampler ? sampler->wined3d_sampler : NULL); @@ -203,50 +207,95 @@ wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_VSSetShader(ID3D10Device1 *iface, - ID3D10VertexShader *shader) +static void STDMETHODCALLTYPE d3d11_immediate_context_VSSetShader(ID3D11DeviceContext *iface, + ID3D11VertexShader *shader, ID3D11ClassInstance *const *class_instances, UINT class_instance_count) { - struct d3d_device *This = impl_from_ID3D10Device(iface); - struct d3d10_vertex_shader *vs = unsafe_impl_from_ID3D10VertexShader(shader); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); + struct d3d_vertex_shader *vs = unsafe_impl_from_ID3D11VertexShader(shader); - TRACE("iface %p, shader %p\n", iface, shader); + TRACE("iface %p, shader %p, class_instances %p, class_instance_count %u.\n", + iface, shader, class_instances, class_instance_count); + + if (class_instances) + FIXME("Dynamic linking is not implemented yet.\n"); wined3d_mutex_lock(); - wined3d_device_set_vertex_shader(This->wined3d_device, vs ? vs->wined3d_shader : NULL); + wined3d_device_set_vertex_shader(device->wined3d_device, vs ? vs->wined3d_shader : NULL); wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_DrawIndexed(ID3D10Device1 *iface, UINT index_count, - UINT start_index_location, INT base_vertex_location) +static void STDMETHODCALLTYPE d3d11_immediate_context_DrawIndexed(ID3D11DeviceContext *iface, + UINT index_count, UINT start_index_location, INT base_vertex_location) { - struct d3d_device *This = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); TRACE("iface %p, index_count %u, start_index_location %u, base_vertex_location %d.\n", iface, index_count, start_index_location, base_vertex_location); wined3d_mutex_lock(); - wined3d_device_set_base_vertex_index(This->wined3d_device, base_vertex_location); - wined3d_device_draw_indexed_primitive(This->wined3d_device, start_index_location, index_count); + wined3d_device_set_base_vertex_index(device->wined3d_device, base_vertex_location); + wined3d_device_draw_indexed_primitive(device->wined3d_device, start_index_location, index_count); wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_Draw(ID3D10Device1 *iface, UINT vertex_count, - UINT start_vertex_location) +static void STDMETHODCALLTYPE d3d11_immediate_context_Draw(ID3D11DeviceContext *iface, + UINT vertex_count, UINT start_vertex_location) { - struct d3d_device *This = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); - TRACE("iface %p, vertex_count %u, start_vertex_location %u\n", + TRACE("iface %p, vertex_count %u, start_vertex_location %u.\n", iface, vertex_count, start_vertex_location); wined3d_mutex_lock(); - wined3d_device_draw_primitive(This->wined3d_device, start_vertex_location, vertex_count); + wined3d_device_draw_primitive(device->wined3d_device, start_vertex_location, vertex_count); wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_PSSetConstantBuffers(ID3D10Device1 *iface, - UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers) +static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_Map(ID3D11DeviceContext *iface, ID3D11Resource *resource, + UINT subresource_idx, D3D11_MAP map_type, UINT map_flags, D3D11_MAPPED_SUBRESOURCE *mapped_subresource) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct wined3d_resource *wined3d_resource; + struct wined3d_map_desc map_desc; + HRESULT hr; + + TRACE("iface %p, resource %p, subresource_idx %u, map_type %u, map_flags %#x, mapped_subresource %p.\n", + iface, resource, subresource_idx, map_type, map_flags, mapped_subresource); + + if (map_flags) + FIXME("Ignoring map_flags %#x.\n", map_flags); + + wined3d_resource = wined3d_resource_from_d3d11_resource(resource); + + wined3d_mutex_lock(); + hr = wined3d_resource_map(wined3d_resource, subresource_idx, + &map_desc, NULL, wined3d_map_flags_from_d3d11_map_type(map_type)); + wined3d_mutex_unlock(); + + mapped_subresource->pData = map_desc.data; + mapped_subresource->RowPitch = map_desc.row_pitch; + mapped_subresource->DepthPitch = map_desc.slice_pitch; + + return hr; +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_Unmap(ID3D11DeviceContext *iface, ID3D11Resource *resource, + UINT subresource_idx) +{ + struct wined3d_resource *wined3d_resource; + + TRACE("iface %p, resource %p, subresource_idx %u.\n", iface, resource, subresource_idx); + + wined3d_resource = wined3d_resource_from_d3d11_resource(resource); + + wined3d_mutex_lock(); + wined3d_resource_unmap(wined3d_resource, subresource_idx); + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_PSSetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers) +{ + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); unsigned int i; TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", @@ -255,7 +304,7 @@ wined3d_mutex_lock(); for (i = 0; i < buffer_count; ++i) { - struct d3d10_buffer *buffer = unsafe_impl_from_ID3D10Buffer(buffers[i]); + struct d3d_buffer *buffer = unsafe_impl_from_ID3D11Buffer(buffers[i]); wined3d_device_set_ps_cb(device->wined3d_device, start_slot + i, buffer ? buffer->wined3d_buffer : NULL); @@ -263,62 +312,63 @@ wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_IASetInputLayout(ID3D10Device1 *iface, - ID3D10InputLayout *input_layout) +static void STDMETHODCALLTYPE d3d11_immediate_context_IASetInputLayout(ID3D11DeviceContext *iface, + ID3D11InputLayout *input_layout) { - struct d3d_device *This = impl_from_ID3D10Device(iface); - struct d3d10_input_layout *layout = unsafe_impl_from_ID3D10InputLayout(input_layout); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); + struct d3d_input_layout *layout = unsafe_impl_from_ID3D11InputLayout(input_layout); - TRACE("iface %p, input_layout %p\n", iface, input_layout); + TRACE("iface %p, input_layout %p.\n", iface, input_layout); wined3d_mutex_lock(); - wined3d_device_set_vertex_declaration(This->wined3d_device, - layout ? layout->wined3d_decl : NULL); + wined3d_device_set_vertex_declaration(device->wined3d_device, layout ? layout->wined3d_decl : NULL); wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_IASetVertexBuffers(ID3D10Device1 *iface, UINT start_slot, - UINT buffer_count, ID3D10Buffer *const *buffers, const UINT *strides, const UINT *offsets) +static void STDMETHODCALLTYPE d3d11_immediate_context_IASetVertexBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers, const UINT *strides, const UINT *offsets) { - struct d3d_device *This = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); unsigned int i; - TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p, strides %p, offsets %p\n", + TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p, strides %p, offsets %p.\n", iface, start_slot, buffer_count, buffers, strides, offsets); wined3d_mutex_lock(); for (i = 0; i < buffer_count; ++i) { - struct d3d10_buffer *buffer = unsafe_impl_from_ID3D10Buffer(buffers[i]); + struct d3d_buffer *buffer = unsafe_impl_from_ID3D11Buffer(buffers[i]); - wined3d_device_set_stream_source(This->wined3d_device, start_slot + i, + wined3d_device_set_stream_source(device->wined3d_device, start_slot + i, buffer ? buffer->wined3d_buffer : NULL, offsets[i], strides[i]); } wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_IASetIndexBuffer(ID3D10Device1 *iface, - ID3D10Buffer *buffer, DXGI_FORMAT format, UINT offset) +static void STDMETHODCALLTYPE d3d11_immediate_context_IASetIndexBuffer(ID3D11DeviceContext *iface, + ID3D11Buffer *buffer, DXGI_FORMAT format, UINT offset) { - struct d3d_device *This = impl_from_ID3D10Device(iface); - struct d3d10_buffer *buffer_impl = unsafe_impl_from_ID3D10Buffer(buffer); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); + struct d3d_buffer *buffer_impl = unsafe_impl_from_ID3D11Buffer(buffer); TRACE("iface %p, buffer %p, format %s, offset %u.\n", iface, buffer, debug_dxgi_format(format), offset); + if (offset) + FIXME("offset %u not supported.\n", offset); + wined3d_mutex_lock(); - wined3d_device_set_index_buffer(This->wined3d_device, + wined3d_device_set_index_buffer(device->wined3d_device, buffer_impl ? buffer_impl->wined3d_buffer : NULL, wined3dformat_from_dxgi_format(format)); wined3d_mutex_unlock(); - if (offset) FIXME("offset %u not supported.\n", offset); } -static void STDMETHODCALLTYPE d3d10_device_DrawIndexedInstanced(ID3D10Device1 *iface, - UINT instance_index_count, UINT instance_count, UINT start_index_location, - INT base_vertex_location, UINT start_instance_location) +static void STDMETHODCALLTYPE d3d11_immediate_context_DrawIndexedInstanced(ID3D11DeviceContext *iface, + UINT instance_index_count, UINT instance_count, UINT start_index_location, INT base_vertex_location, + UINT start_instance_location) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); TRACE("iface %p, instance_index_count %u, instance_count %u, start_index_location %u, " "base_vertex_location %d, start_instance_location %u.\n", @@ -332,15 +382,15 @@ wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_DrawInstanced(ID3D10Device1 *iface, - UINT instance_vertex_count, UINT instance_count, - UINT start_vertex_location, UINT start_instance_location) +static void STDMETHODCALLTYPE d3d11_immediate_context_DrawInstanced(ID3D11DeviceContext *iface, + UINT instance_vertex_count, UINT instance_count, UINT start_vertex_location, UINT start_instance_location) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); TRACE("iface %p, instance_vertex_count %u, instance_count %u, start_vertex_location %u, " - "start_instance_location %u.\n", iface, instance_vertex_count, instance_count, - start_vertex_location, start_instance_location); + "start_instance_location %u.\n", + iface, instance_vertex_count, instance_count, start_vertex_location, + start_instance_location); wined3d_mutex_lock(); wined3d_device_draw_primitive_instanced(device->wined3d_device, start_vertex_location, @@ -348,10 +398,10 @@ wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_GSSetConstantBuffers(ID3D10Device1 *iface, - UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers) +static void STDMETHODCALLTYPE d3d11_immediate_context_GSSetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); unsigned int i; TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", @@ -360,7 +410,7 @@ wined3d_mutex_lock(); for (i = 0; i < buffer_count; ++i) { - struct d3d10_buffer *buffer = unsafe_impl_from_ID3D10Buffer(buffers[i]); + struct d3d_buffer *buffer = unsafe_impl_from_ID3D11Buffer(buffers[i]); wined3d_device_set_gs_cb(device->wined3d_device, start_slot + i, buffer ? buffer->wined3d_buffer : NULL); @@ -368,43 +418,47 @@ wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_GSSetShader(ID3D10Device1 *iface, ID3D10GeometryShader *shader) +static void STDMETHODCALLTYPE d3d11_immediate_context_GSSetShader(ID3D11DeviceContext *iface, + ID3D11GeometryShader *shader, ID3D11ClassInstance *const *class_instances, UINT class_instance_count) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - struct d3d10_geometry_shader *gs = unsafe_impl_from_ID3D10GeometryShader(shader); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); + struct d3d_geometry_shader *gs = unsafe_impl_from_ID3D11GeometryShader(shader); - TRACE("iface %p, shader %p.\n", iface, shader); + TRACE("iface %p, shader %p, class_instances %p, class_instance_count %u.\n", + iface, shader, class_instances, class_instance_count); + + if (class_instances) + FIXME("Dynamic linking is not implemented yet.\n"); wined3d_mutex_lock(); wined3d_device_set_geometry_shader(device->wined3d_device, gs ? gs->wined3d_shader : NULL); wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_IASetPrimitiveTopology(ID3D10Device1 *iface, - D3D10_PRIMITIVE_TOPOLOGY topology) +static void STDMETHODCALLTYPE d3d11_immediate_context_IASetPrimitiveTopology(ID3D11DeviceContext *iface, + D3D11_PRIMITIVE_TOPOLOGY topology) { - struct d3d_device *This = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); - TRACE("iface %p, topology %s\n", iface, debug_d3d10_primitive_topology(topology)); + TRACE("iface %p, topology %u.\n", iface, topology); wined3d_mutex_lock(); - wined3d_device_set_primitive_type(This->wined3d_device, (enum wined3d_primitive_type)topology); + wined3d_device_set_primitive_type(device->wined3d_device, (enum wined3d_primitive_type)topology); wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_VSSetShaderResources(ID3D10Device1 *iface, - UINT start_slot, UINT view_count, ID3D10ShaderResourceView *const *views) +static void STDMETHODCALLTYPE d3d11_immediate_context_VSSetShaderResources(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11ShaderResourceView *const *views) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); unsigned int i; - TRACE("iface %p, start_slot %u, view_count %u, views %p.\n", - iface, start_slot, view_count, views); + TRACE("iface %p, start_slot %u, view_count %u, views %p.\n", iface, start_slot, view_count, views); wined3d_mutex_lock(); for (i = 0; i < view_count; ++i) { - struct d3d10_shader_resource_view *view = unsafe_impl_from_ID3D10ShaderResourceView(views[i]); + struct d3d_shader_resource_view *view = unsafe_impl_from_ID3D11ShaderResourceView(views[i]); wined3d_device_set_vs_resource_view(device->wined3d_device, start_slot + i, view ? view->wined3d_view : NULL); @@ -412,10 +466,10 @@ wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_VSSetSamplers(ID3D10Device1 *iface, - UINT start_slot, UINT sampler_count, ID3D10SamplerState *const *samplers) +static void STDMETHODCALLTYPE d3d11_immediate_context_VSSetSamplers(ID3D11DeviceContext *iface, + UINT start_slot, UINT sampler_count, ID3D11SamplerState *const *samplers) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); unsigned int i; TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n", @@ -424,7 +478,7 @@ wined3d_mutex_lock(); for (i = 0; i < sampler_count; ++i) { - struct d3d10_sampler_state *sampler = unsafe_impl_from_ID3D10SamplerState(samplers[i]); + struct d3d_sampler_state *sampler = unsafe_impl_from_ID3D11SamplerState(samplers[i]); wined3d_device_set_vs_sampler(device->wined3d_device, start_slot + i, sampler ? sampler->wined3d_sampler : NULL); @@ -432,32 +486,54 @@ wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_SetPredication(ID3D10Device1 *iface, ID3D10Predicate *predicate, BOOL value) +static void STDMETHODCALLTYPE d3d11_immediate_context_Begin(ID3D11DeviceContext *iface, + ID3D11Asynchronous *asynchronous) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - struct d3d10_query *query; + FIXME("iface %p, asynchronous %p stub!\n", iface, asynchronous); +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_End(ID3D11DeviceContext *iface, + ID3D11Asynchronous *asynchronous) +{ + FIXME("iface %p, asynchronous %p stub!\n", iface, asynchronous); +} + +static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_GetData(ID3D11DeviceContext *iface, + ID3D11Asynchronous *asynchronous, void *data, UINT data_size, UINT data_flags) +{ + FIXME("iface %p, asynchronous %p, data %p, data_size %u, data_flags %#x stub!\n", + iface, asynchronous, data, data_size, data_flags); + + return E_NOTIMPL; +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_SetPredication(ID3D11DeviceContext *iface, + ID3D11Predicate *predicate, BOOL value) +{ + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); + struct d3d_query *query; TRACE("iface %p, predicate %p, value %#x.\n", iface, predicate, value); - query = unsafe_impl_from_ID3D10Query((ID3D10Query *)predicate); + query = unsafe_impl_from_ID3D11Query((ID3D11Query *)predicate); + wined3d_mutex_lock(); wined3d_device_set_predication(device->wined3d_device, query ? query->wined3d_query : NULL, value); wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_GSSetShaderResources(ID3D10Device1 *iface, - UINT start_slot, UINT view_count, ID3D10ShaderResourceView *const *views) +static void STDMETHODCALLTYPE d3d11_immediate_context_GSSetShaderResources(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11ShaderResourceView *const *views) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); unsigned int i; - TRACE("iface %p, start_slot %u, view_count %u, views %p.\n", - iface, start_slot, view_count, views); + TRACE("iface %p, start_slot %u, view_count %u, views %p.\n", iface, start_slot, view_count, views); wined3d_mutex_lock(); for (i = 0; i < view_count; ++i) { - struct d3d10_shader_resource_view *view = unsafe_impl_from_ID3D10ShaderResourceView(views[i]); + struct d3d_shader_resource_view *view = unsafe_impl_from_ID3D11ShaderResourceView(views[i]); wined3d_device_set_gs_resource_view(device->wined3d_device, start_slot + i, view ? view->wined3d_view : NULL); @@ -465,10 +541,10 @@ wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_GSSetSamplers(ID3D10Device1 *iface, - UINT start_slot, UINT sampler_count, ID3D10SamplerState *const *samplers) +static void STDMETHODCALLTYPE d3d11_immediate_context_GSSetSamplers(ID3D11DeviceContext *iface, + UINT start_slot, UINT sampler_count, ID3D11SamplerState *const *samplers) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); unsigned int i; TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n", @@ -477,7 +553,7 @@ wined3d_mutex_lock(); for (i = 0; i < sampler_count; ++i) { - struct d3d10_sampler_state *sampler = unsafe_impl_from_ID3D10SamplerState(samplers[i]); + struct d3d_sampler_state *sampler = unsafe_impl_from_ID3D11SamplerState(samplers[i]); wined3d_device_set_gs_sampler(device->wined3d_device, start_slot + i, sampler ? sampler->wined3d_sampler : NULL); @@ -485,12 +561,12 @@ wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_OMSetRenderTargets(ID3D10Device1 *iface, - UINT render_target_view_count, ID3D10RenderTargetView *const *render_target_views, - ID3D10DepthStencilView *depth_stencil_view) +static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetRenderTargets(ID3D11DeviceContext *iface, + UINT render_target_view_count, ID3D11RenderTargetView *const *render_target_views, + ID3D11DepthStencilView *depth_stencil_view) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - struct d3d10_depthstencil_view *dsv; + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); + struct d3d_depthstencil_view *dsv; unsigned int i; TRACE("iface %p, render_target_view_count %u, render_target_views %p, depth_stencil_view %p.\n", @@ -499,27 +575,38 @@ wined3d_mutex_lock(); for (i = 0; i < render_target_view_count; ++i) { - struct d3d10_rendertarget_view *rtv = unsafe_impl_from_ID3D10RenderTargetView(render_target_views[i]); - - wined3d_device_set_rendertarget_view(device->wined3d_device, i, - rtv ? rtv->wined3d_view : NULL, FALSE); + struct d3d_rendertarget_view *rtv = unsafe_impl_from_ID3D11RenderTargetView(render_target_views[i]); + wined3d_device_set_rendertarget_view(device->wined3d_device, i, rtv ? rtv->wined3d_view : NULL, FALSE); } - for (; i < D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i) + for (; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i) { wined3d_device_set_rendertarget_view(device->wined3d_device, i, NULL, FALSE); } - dsv = unsafe_impl_from_ID3D10DepthStencilView(depth_stencil_view); - wined3d_device_set_depth_stencil_view(device->wined3d_device, - dsv ? dsv->wined3d_view : NULL); + dsv = unsafe_impl_from_ID3D11DepthStencilView(depth_stencil_view); + wined3d_device_set_depth_stencil_view(device->wined3d_device, dsv ? dsv->wined3d_view : NULL); wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_OMSetBlendState(ID3D10Device1 *iface, - ID3D10BlendState *blend_state, const FLOAT blend_factor[4], UINT sample_mask) +static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetRenderTargetsAndUnorderedAccessViews( + ID3D11DeviceContext *iface, UINT render_target_view_count, + ID3D11RenderTargetView *const *render_target_views, ID3D11DepthStencilView *depth_stencil_view, + UINT unordered_access_view_start_slot, UINT unordered_access_view_count, + ID3D11UnorderedAccessView *const *unordered_access_views, const UINT *initial_counts) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - const D3D10_BLEND_DESC *desc; + FIXME("iface %p, render_target_view_count %u, render_target_views %p, depth_stencil_view %p, " + "unordered_access_view_start_slot %u, unordered_access_view_count %u, unordered_access_views %p, " + "initial_counts %p stub!\n", + iface, render_target_view_count, render_target_views, depth_stencil_view, + unordered_access_view_start_slot, unordered_access_view_count, unordered_access_views, + initial_counts); +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11DeviceContext *iface, + ID3D11BlendState *blend_state, const FLOAT blend_factor[4], UINT sample_mask) +{ + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); + const D3D11_BLEND_DESC *desc; TRACE("iface %p, blend_state %p, blend_factor {%.8e %.8e %.8e %.8e}, sample_mask 0x%08x.\n", iface, blend_state, blend_factor[0], blend_factor[1], blend_factor[2], blend_factor[3], sample_mask); @@ -527,20 +614,21 @@ if (blend_factor[0] != 1.0f || blend_factor[1] != 1.0f || blend_factor[2] != 1.0f || blend_factor[3] != 1.0f) FIXME("Ignoring blend factor {%.8e %.8e %.8e %.8e}.\n", blend_factor[0], blend_factor[1], blend_factor[2], blend_factor[3]); + wined3d_mutex_lock(); memcpy(device->blend_factor, blend_factor, 4 * sizeof(*blend_factor)); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_MULTISAMPLEMASK, sample_mask); - if (!(device->blend_state = unsafe_impl_from_ID3D10BlendState(blend_state))) + if (!(device->blend_state = unsafe_impl_from_ID3D11BlendState(blend_state))) { wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_ALPHABLENDENABLE, FALSE); wined3d_device_set_render_state(device->wined3d_device, - WINED3D_RS_COLORWRITEENABLE, D3D10_COLOR_WRITE_ENABLE_ALL); + WINED3D_RS_COLORWRITEENABLE, D3D11_COLOR_WRITE_ENABLE_ALL); wined3d_device_set_render_state(device->wined3d_device, - WINED3D_RS_COLORWRITEENABLE1, D3D10_COLOR_WRITE_ENABLE_ALL); + WINED3D_RS_COLORWRITEENABLE1, D3D11_COLOR_WRITE_ENABLE_ALL); wined3d_device_set_render_state(device->wined3d_device, - WINED3D_RS_COLORWRITEENABLE2, D3D10_COLOR_WRITE_ENABLE_ALL); + WINED3D_RS_COLORWRITEENABLE2, D3D11_COLOR_WRITE_ENABLE_ALL); wined3d_device_set_render_state(device->wined3d_device, - WINED3D_RS_COLORWRITEENABLE3, D3D10_COLOR_WRITE_ENABLE_ALL); + WINED3D_RS_COLORWRITEENABLE3, D3D11_COLOR_WRITE_ENABLE_ALL); wined3d_mutex_unlock(); return; } @@ -550,78 +638,101 @@ if (desc->AlphaToCoverageEnable) FIXME("Ignoring AlphaToCoverageEnable %#x.\n", desc->AlphaToCoverageEnable); /* glEnableIndexedEXT(GL_BLEND, ...) */ - FIXME("Per-rendertarget blend enable not implemented.\n"); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_ALPHABLENDENABLE, desc->BlendEnable[0]); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SRCBLEND, desc->SrcBlend); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DESTBLEND, desc->DestBlend); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_BLENDOP, desc->BlendOp); + FIXME("Per-rendertarget blend not implemented.\n"); + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_ALPHABLENDENABLE, + desc->RenderTarget[0].BlendEnable); + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SRCBLEND, desc->RenderTarget[0].SrcBlend); + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DESTBLEND, desc->RenderTarget[0].DestBlend); + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_BLENDOP, desc->RenderTarget[0].BlendOp); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SEPARATEALPHABLENDENABLE, TRUE); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SRCBLENDALPHA, desc->SrcBlendAlpha); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DESTBLENDALPHA, desc->DestBlendAlpha); - wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_BLENDOPALPHA, desc->BlendOpAlpha); + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_SRCBLENDALPHA, + desc->RenderTarget[0].SrcBlendAlpha); + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DESTBLENDALPHA, + desc->RenderTarget[0].DestBlendAlpha); + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_BLENDOPALPHA, + desc->RenderTarget[0].BlendOpAlpha); FIXME("Color mask > 3 not implemented.\n"); wined3d_device_set_render_state(device->wined3d_device, - WINED3D_RS_COLORWRITEENABLE, desc->RenderTargetWriteMask[0]); + WINED3D_RS_COLORWRITEENABLE, desc->RenderTarget[0].RenderTargetWriteMask); wined3d_device_set_render_state(device->wined3d_device, - WINED3D_RS_COLORWRITEENABLE1, desc->RenderTargetWriteMask[1]); + WINED3D_RS_COLORWRITEENABLE1, desc->RenderTarget[1].RenderTargetWriteMask); wined3d_device_set_render_state(device->wined3d_device, - WINED3D_RS_COLORWRITEENABLE2, desc->RenderTargetWriteMask[2]); + WINED3D_RS_COLORWRITEENABLE2, desc->RenderTarget[2].RenderTargetWriteMask); wined3d_device_set_render_state(device->wined3d_device, - WINED3D_RS_COLORWRITEENABLE3, desc->RenderTargetWriteMask[3]); + WINED3D_RS_COLORWRITEENABLE3, desc->RenderTarget[3].RenderTargetWriteMask); wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_OMSetDepthStencilState(ID3D10Device1 *iface, - ID3D10DepthStencilState *depth_stencil_state, UINT stencil_ref) +static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetDepthStencilState(ID3D11DeviceContext *iface, + ID3D11DepthStencilState *depth_stencil_state, UINT stencil_ref) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - - TRACE("iface %p, depth_stencil_state %p, stencil_ref %u.\n", - iface, depth_stencil_state, stencil_ref); - - device->depth_stencil_state = unsafe_impl_from_ID3D10DepthStencilState(depth_stencil_state); - device->stencil_ref = stencil_ref; + FIXME("iface %p, depth_stencil_state %p, stencil_ref %u stub!\n", iface, depth_stencil_state, stencil_ref); } -static void STDMETHODCALLTYPE d3d10_device_SOSetTargets(ID3D10Device1 *iface, - UINT target_count, ID3D10Buffer *const *targets, const UINT *offsets) +static void STDMETHODCALLTYPE d3d11_immediate_context_SOSetTargets(ID3D11DeviceContext *iface, UINT buffer_count, + ID3D11Buffer *const *buffers, const UINT *offsets) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); unsigned int count, i; - TRACE("iface %p, target_count %u, targets %p, offsets %p.\n", iface, target_count, targets, offsets); + TRACE("iface %p, buffer_count %u, buffers %p, offsets %p.\n", iface, buffer_count, buffers, offsets); - count = min(target_count, 4); + count = min(buffer_count, D3D11_SO_BUFFER_SLOT_COUNT); wined3d_mutex_lock(); for (i = 0; i < count; ++i) { - struct d3d10_buffer *buffer = unsafe_impl_from_ID3D10Buffer(targets[i]); + struct d3d_buffer *buffer = unsafe_impl_from_ID3D11Buffer(buffers[i]); wined3d_device_set_stream_output(device->wined3d_device, i, buffer ? buffer->wined3d_buffer : NULL, offsets[i]); } - - for (i = count; i < 4; ++i) + for (; i < D3D11_SO_BUFFER_SLOT_COUNT; ++i) { wined3d_device_set_stream_output(device->wined3d_device, i, NULL, 0); } wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_DrawAuto(ID3D10Device1 *iface) +static void STDMETHODCALLTYPE d3d11_immediate_context_DrawAuto(ID3D11DeviceContext *iface) { FIXME("iface %p stub!\n", iface); } -static void STDMETHODCALLTYPE d3d10_device_RSSetState(ID3D10Device1 *iface, ID3D10RasterizerState *rasterizer_state) +static void STDMETHODCALLTYPE d3d11_immediate_context_DrawIndexedInstancedIndirect(ID3D11DeviceContext *iface, + ID3D11Buffer *buffer, UINT offset) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - const D3D10_RASTERIZER_DESC *desc; + FIXME("iface %p, buffer %p, offset %u stub!\n", iface, buffer, offset); +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_DrawInstancedIndirect(ID3D11DeviceContext *iface, + ID3D11Buffer *buffer, UINT offset) +{ + FIXME("iface %p, buffer %p, offset %u stub!\n", iface, buffer, offset); +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_Dispatch(ID3D11DeviceContext *iface, + UINT thread_group_count_x, UINT thread_group_count_y, UINT thread_group_count_z) +{ + FIXME("iface %p, thread_group_count_x %u, thread_group_count_y %u, thread_group_count_z %u stub!\n", + iface, thread_group_count_x, thread_group_count_y, thread_group_count_z); +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_DispatchIndirect(ID3D11DeviceContext *iface, + ID3D11Buffer *buffer, UINT offset) +{ + FIXME("iface %p, buffer %p, offset %u stub!\n", iface, buffer, offset); +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetState(ID3D11DeviceContext *iface, + ID3D11RasterizerState *rasterizer_state) +{ + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); + const D3D11_RASTERIZER_DESC *desc; TRACE("iface %p, rasterizer_state %p.\n", iface, rasterizer_state); wined3d_mutex_lock(); - if (!(device->rasterizer_state = unsafe_impl_from_ID3D10RasterizerState(rasterizer_state))) + if (!(device->rasterizer_state = unsafe_impl_from_ID3D11RasterizerState(rasterizer_state))) { wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_FILLMODE, WINED3D_FILL_SOLID); wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_CULLMODE, WINED3D_CULL_CCW); @@ -651,10 +762,10 @@ wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_RSSetViewports(ID3D10Device1 *iface, - UINT viewport_count, const D3D10_VIEWPORT *viewports) +static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetViewports(ID3D11DeviceContext *iface, + UINT viewport_count, const D3D11_VIEWPORT *viewports) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); struct wined3d_viewport wined3d_vp; TRACE("iface %p, viewport_count %u, viewports %p.\n", iface, viewport_count, viewports); @@ -665,6 +776,12 @@ if (!viewport_count) return; + if (viewports[0].TopLeftX != (UINT)viewports[0].TopLeftX + || viewports[0].TopLeftY != (UINT)viewports[0].TopLeftY + || viewports[0].Width != (UINT)viewports[0].Width + || viewports[0].Height != (UINT)viewports[0].Height) + FIXME("Floating-point viewports not implemented.\n"); + wined3d_vp.x = viewports[0].TopLeftX; wined3d_vp.y = viewports[0].TopLeftY; wined3d_vp.width = viewports[0].Width; @@ -677,10 +794,10 @@ wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_RSSetScissorRects(ID3D10Device1 *iface, - UINT rect_count, const D3D10_RECT *rects) +static void STDMETHODCALLTYPE d3d11_immediate_context_RSSetScissorRects(ID3D11DeviceContext *iface, + UINT rect_count, const D3D11_RECT *rects) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); TRACE("iface %p, rect_count %u, rects %p.\n", iface, rect_count, rects); @@ -695,53 +812,36 @@ wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_CopySubresourceRegion(ID3D10Device1 *iface, - ID3D10Resource *dst_resource, UINT dst_subresource_idx, UINT dst_x, UINT dst_y, UINT dst_z, - ID3D10Resource *src_resource, UINT src_subresource_idx, const D3D10_BOX *src_box) +static void STDMETHODCALLTYPE d3d11_immediate_context_CopySubresourceRegion(ID3D11DeviceContext *iface, + ID3D11Resource *dst_resource, UINT dst_subresource_idx, UINT dst_x, UINT dst_y, UINT dst_z, + ID3D11Resource *src_resource, UINT src_subresource_idx, const D3D11_BOX *src_box) { - struct wined3d_resource *wined3d_dst_resource, *wined3d_src_resource; - struct d3d_device *device = impl_from_ID3D10Device(iface); - struct wined3d_box wined3d_src_box; - - TRACE("iface %p, dst_resource %p, dst_subresource_idx %u, dst_x %u, dst_y %u, dst_z %u, " - "src_resource %p, src_subresource_idx %u, src_box %p.\n", + FIXME("iface %p, dst_resource %p, dst_subresource_idx %u, dst_x %u, dst_y %u, dst_z %u, " + "src_resource %p, src_subresource_idx %u, src_box %p stub!\n", iface, dst_resource, dst_subresource_idx, dst_x, dst_y, dst_z, src_resource, src_subresource_idx, src_box); - - wined3d_dst_resource = wined3d_resource_from_resource(dst_resource); - wined3d_src_resource = wined3d_resource_from_resource(src_resource); - wined3d_src_box.left = src_box->left; - wined3d_src_box.top = src_box->top; - wined3d_src_box.front = src_box->front; - wined3d_src_box.right = src_box->right; - wined3d_src_box.bottom = src_box->bottom; - wined3d_src_box.back = src_box->back; - wined3d_mutex_lock(); - wined3d_device_copy_sub_resource_region(device->wined3d_device, wined3d_dst_resource, dst_subresource_idx, - dst_x, dst_y, dst_z, wined3d_src_resource, src_subresource_idx, &wined3d_src_box); - wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_CopyResource(ID3D10Device1 *iface, - ID3D10Resource *dst_resource, ID3D10Resource *src_resource) +static void STDMETHODCALLTYPE d3d11_immediate_context_CopyResource(ID3D11DeviceContext *iface, + ID3D11Resource *dst_resource, ID3D11Resource *src_resource) { + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); struct wined3d_resource *wined3d_dst_resource, *wined3d_src_resource; - struct d3d_device *device = impl_from_ID3D10Device(iface); TRACE("iface %p, dst_resource %p, src_resource %p.\n", iface, dst_resource, src_resource); - wined3d_dst_resource = wined3d_resource_from_resource(dst_resource); - wined3d_src_resource = wined3d_resource_from_resource(src_resource); + wined3d_dst_resource = wined3d_resource_from_d3d11_resource(dst_resource); + wined3d_src_resource = wined3d_resource_from_d3d11_resource(src_resource); wined3d_mutex_lock(); wined3d_device_copy_resource(device->wined3d_device, wined3d_dst_resource, wined3d_src_resource); wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_UpdateSubresource(ID3D10Device1 *iface, - ID3D10Resource *resource, UINT subresource_idx, const D3D10_BOX *box, +static void STDMETHODCALLTYPE d3d11_immediate_context_UpdateSubresource(ID3D11DeviceContext *iface, + ID3D11Resource *resource, UINT subresource_idx, const D3D11_BOX *box, const void *data, UINT row_pitch, UINT depth_pitch) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); struct wined3d_resource *wined3d_resource; struct wined3d_box wined3d_box; @@ -758,22 +858,29 @@ wined3d_box.back = box->back; } - wined3d_resource = wined3d_resource_from_resource(resource); + wined3d_resource = wined3d_resource_from_d3d11_resource(resource); wined3d_mutex_lock(); wined3d_device_update_sub_resource(device->wined3d_device, wined3d_resource, subresource_idx, box ? &wined3d_box : NULL, data, row_pitch, depth_pitch); wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_ClearRenderTargetView(ID3D10Device1 *iface, - ID3D10RenderTargetView *render_target_view, const FLOAT color_rgba[4]) +static void STDMETHODCALLTYPE d3d11_immediate_context_CopyStructureCount(ID3D11DeviceContext *iface, + ID3D11Buffer *dst_buffer, UINT dst_offset, ID3D11UnorderedAccessView *src_view) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - struct d3d10_rendertarget_view *view = unsafe_impl_from_ID3D10RenderTargetView(render_target_view); + FIXME("iface %p, dst_buffer %p, dst_offset %u, src_view %p stub!\n", + iface, dst_buffer, dst_offset, src_view); +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_ClearRenderTargetView(ID3D11DeviceContext *iface, + ID3D11RenderTargetView *render_target_view, const FLOAT color_rgba[4]) +{ + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); + struct d3d_rendertarget_view *view = unsafe_impl_from_ID3D11RenderTargetView(render_target_view); const struct wined3d_color color = {color_rgba[0], color_rgba[1], color_rgba[2], color_rgba[3]}; HRESULT hr; - TRACE("iface %p, render_target_view %p, color_rgba {%.8e, %.8e, %.8e, %.8e}.\n", + TRACE("iface %p, render_target_view %p, color_rgba {%.8e %.8e %.8e %.8e}.\n", iface, render_target_view, color_rgba[0], color_rgba[1], color_rgba[2], color_rgba[3]); wined3d_mutex_lock(); @@ -782,33 +889,159 @@ wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_ClearDepthStencilView(ID3D10Device1 *iface, - ID3D10DepthStencilView *depth_stencil_view, UINT flags, FLOAT depth, UINT8 stencil) +static void STDMETHODCALLTYPE d3d11_immediate_context_ClearUnorderedAccessViewUint(ID3D11DeviceContext *iface, + ID3D11UnorderedAccessView *unordered_access_view, const UINT values[4]) +{ + FIXME("iface %p, unordered_access_view %p, values {%u %u %u %u} stub!\n", + iface, unordered_access_view, values[0], values[1], values[2], values[3]); +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_ClearUnorderedAccessViewFloat(ID3D11DeviceContext *iface, + ID3D11UnorderedAccessView *unordered_access_view, const FLOAT values[4]) +{ + FIXME("iface %p, unordered_access_view %p, values {%.8e %.8e %.8e %.8e} stub!\n", + iface, unordered_access_view, values[0], values[1], values[2], values[3]); +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_ClearDepthStencilView(ID3D11DeviceContext *iface, + ID3D11DepthStencilView *depth_stencil_view, UINT flags, FLOAT depth, UINT8 stencil) { FIXME("iface %p, depth_stencil_view %p, flags %#x, depth %f, stencil %u stub!\n", iface, depth_stencil_view, flags, depth, stencil); } -static void STDMETHODCALLTYPE d3d10_device_GenerateMips(ID3D10Device1 *iface, - ID3D10ShaderResourceView *shader_resource_view) +static void STDMETHODCALLTYPE d3d11_immediate_context_GenerateMips(ID3D11DeviceContext *iface, + ID3D11ShaderResourceView *view) { - FIXME("iface %p, shader_resource_view %p stub!\n", iface, shader_resource_view); + FIXME("iface %p, view %p stub!\n", iface, view); } -static void STDMETHODCALLTYPE d3d10_device_ResolveSubresource(ID3D10Device1 *iface, - ID3D10Resource *dst_resource, UINT dst_subresource_idx, - ID3D10Resource *src_resource, UINT src_subresource_idx, DXGI_FORMAT format) +static void STDMETHODCALLTYPE d3d11_immediate_context_SetResourceMinLOD(ID3D11DeviceContext *iface, + ID3D11Resource *resource, FLOAT min_lod) { - FIXME("iface %p, dst_resource %p, dst_subresource_idx %u, " - "src_resource %p, src_subresource_idx %u, format %s stub!\n", - iface, dst_resource, dst_subresource_idx, - src_resource, src_subresource_idx, debug_dxgi_format(format)); + FIXME("iface %p, resource %p, min_lod %f stub!\n", iface, resource, min_lod); } -static void STDMETHODCALLTYPE d3d10_device_VSGetConstantBuffers(ID3D10Device1 *iface, - UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers) +static FLOAT STDMETHODCALLTYPE d3d11_immediate_context_GetResourceMinLOD(ID3D11DeviceContext *iface, + ID3D11Resource *resource) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + FIXME("iface %p, resource %p stub!\n", iface, resource); + + return 0.0f; +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_ResolveSubresource(ID3D11DeviceContext *iface, + ID3D11Resource *dst_resource, UINT dst_subresource_idx, + ID3D11Resource *src_resource, UINT src_subresource_idx, + DXGI_FORMAT format) +{ + FIXME("iface %p, dst_resource %p, dst_subresource_idx %u, src_resource %p, src_subresource_idx %u, " + "format %s stub!\n", + iface, dst_resource, dst_subresource_idx, src_resource, src_subresource_idx, + debug_dxgi_format(format)); +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_ExecuteCommandList(ID3D11DeviceContext *iface, + ID3D11CommandList *command_list, BOOL restore_state) +{ + FIXME("iface %p, command_list %p, restore_state %#x stub!\n", iface, command_list, restore_state); +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_HSSetShaderResources(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11ShaderResourceView *const *views) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", + iface, start_slot, view_count, views); +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_HSSetShader(ID3D11DeviceContext *iface, + ID3D11HullShader *shader, ID3D11ClassInstance *const *class_instances, UINT class_instance_count) +{ + FIXME("iface %p, shader %p, class_instances %p, class_instance_count %u stub!\n", + iface, shader, class_instances, class_instance_count); +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_HSSetSamplers(ID3D11DeviceContext *iface, + UINT start_slot, UINT sampler_count, ID3D11SamplerState *const *samplers) +{ + FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + iface, start_slot, sampler_count, samplers); +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_HSSetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n", + iface, start_slot, buffer_count, buffers); +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_DSSetShaderResources(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11ShaderResourceView *const *views) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", + iface, start_slot, view_count, views); +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_DSSetShader(ID3D11DeviceContext *iface, + ID3D11DomainShader *shader, ID3D11ClassInstance *const *class_instances, UINT class_instance_count) +{ + FIXME("iface %p, shader %p, class_instances %p, class_instance_count %u stub!\n", + iface, shader, class_instances, class_instance_count); +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_DSSetSamplers(ID3D11DeviceContext *iface, + UINT start_slot, UINT sampler_count, ID3D11SamplerState *const *samplers) +{ + FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + iface, start_slot, sampler_count, samplers); +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_DSSetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n", + iface, start_slot, buffer_count, buffers); +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_CSSetShaderResources(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11ShaderResourceView *const *views) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", + iface, start_slot, view_count, views); +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_CSSetUnorderedAccessViews(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11UnorderedAccessView *const *views, const UINT *initial_counts) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p, initial_counts %p stub!\n", + iface, start_slot, view_count, views, initial_counts); +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_CSSetShader(ID3D11DeviceContext *iface, + ID3D11ComputeShader *shader, ID3D11ClassInstance *const *class_instances, UINT class_instance_count) +{ + FIXME("iface %p, shader %p, class_instances %p, class_instance_count %u stub!\n", + iface, shader, class_instances, class_instance_count); +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_CSSetSamplers(ID3D11DeviceContext *iface, + UINT start_slot, UINT sampler_count, ID3D11SamplerState *const *samplers) +{ + FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + iface, start_slot, sampler_count, samplers); +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_CSSetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer *const *buffers) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n", + iface, start_slot, buffer_count, buffers); +} + +static void STDMETHODCALLTYPE d3d11_immediate_context_VSGetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer **buffers) +{ + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); unsigned int i; TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", @@ -818,7 +1051,7 @@ for (i = 0; i < buffer_count; ++i) { struct wined3d_buffer *wined3d_buffer; - struct d3d10_buffer *buffer_impl; + struct d3d_buffer *buffer_impl; if (!(wined3d_buffer = wined3d_device_get_vs_cb(device->wined3d_device, start_slot + i))) { @@ -827,16 +1060,16 @@ } buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); - buffers[i] = &buffer_impl->ID3D10Buffer_iface; - ID3D10Buffer_AddRef(buffers[i]); + buffers[i] = &buffer_impl->ID3D11Buffer_iface; + ID3D11Buffer_AddRef(buffers[i]); } wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_PSGetShaderResources(ID3D10Device1 *iface, - UINT start_slot, UINT view_count, ID3D10ShaderResourceView **views) +static void STDMETHODCALLTYPE d3d11_immediate_context_PSGetShaderResources(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11ShaderResourceView **views) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); unsigned int i; TRACE("iface %p, start_slot %u, view_count %u, views %p.\n", @@ -846,7 +1079,7 @@ for (i = 0; i < view_count; ++i) { struct wined3d_shader_resource_view *wined3d_view; - struct d3d10_shader_resource_view *view_impl; + struct d3d_shader_resource_view *view_impl; if (!(wined3d_view = wined3d_device_get_ps_resource_view(device->wined3d_device, start_slot + i))) { @@ -855,19 +1088,24 @@ } view_impl = wined3d_shader_resource_view_get_parent(wined3d_view); - views[i] = &view_impl->ID3D10ShaderResourceView_iface; - ID3D10ShaderResourceView_AddRef(views[i]); + views[i] = &view_impl->ID3D11ShaderResourceView_iface; + ID3D11ShaderResourceView_AddRef(views[i]); } wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_PSGetShader(ID3D10Device1 *iface, ID3D10PixelShader **shader) +static void STDMETHODCALLTYPE d3d11_immediate_context_PSGetShader(ID3D11DeviceContext *iface, + ID3D11PixelShader **shader, ID3D11ClassInstance **class_instances, UINT *class_instance_count) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - struct d3d10_pixel_shader *shader_impl; + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); struct wined3d_shader *wined3d_shader; + struct d3d_pixel_shader *shader_impl; - TRACE("iface %p, shader %p.\n", iface, shader); + TRACE("iface %p, shader %p, class_instances %p, class_instance_count %p.\n", + iface, shader, class_instances, class_instance_count); + + if (class_instances || class_instance_count) + FIXME("Dynamic linking not implemented yet.\n"); wined3d_mutex_lock(); if (!(wined3d_shader = wined3d_device_get_pixel_shader(device->wined3d_device))) @@ -879,14 +1117,14 @@ shader_impl = wined3d_shader_get_parent(wined3d_shader); wined3d_mutex_unlock(); - *shader = &shader_impl->ID3D10PixelShader_iface; - ID3D10PixelShader_AddRef(*shader); + *shader = &shader_impl->ID3D11PixelShader_iface; + ID3D11PixelShader_AddRef(*shader); } -static void STDMETHODCALLTYPE d3d10_device_PSGetSamplers(ID3D10Device1 *iface, - UINT start_slot, UINT sampler_count, ID3D10SamplerState **samplers) +static void STDMETHODCALLTYPE d3d11_immediate_context_PSGetSamplers(ID3D11DeviceContext *iface, + UINT start_slot, UINT sampler_count, ID3D11SamplerState **samplers) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); unsigned int i; TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n", @@ -895,8 +1133,8 @@ wined3d_mutex_lock(); for (i = 0; i < sampler_count; ++i) { - struct d3d10_sampler_state *sampler_impl; struct wined3d_sampler *wined3d_sampler; + struct d3d_sampler_state *sampler_impl; if (!(wined3d_sampler = wined3d_device_get_ps_sampler(device->wined3d_device, start_slot + i))) { @@ -905,19 +1143,24 @@ } sampler_impl = wined3d_sampler_get_parent(wined3d_sampler); - samplers[i] = &sampler_impl->ID3D10SamplerState_iface; - ID3D10SamplerState_AddRef(samplers[i]); + samplers[i] = &sampler_impl->ID3D11SamplerState_iface; + ID3D11SamplerState_AddRef(samplers[i]); } wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_VSGetShader(ID3D10Device1 *iface, ID3D10VertexShader **shader) +static void STDMETHODCALLTYPE d3d11_immediate_context_VSGetShader(ID3D11DeviceContext *iface, + ID3D11VertexShader **shader, ID3D11ClassInstance **class_instances, UINT *class_instance_count) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - struct d3d10_vertex_shader *shader_impl; + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); + struct d3d_vertex_shader *shader_impl; struct wined3d_shader *wined3d_shader; - TRACE("iface %p, shader %p.\n", iface, shader); + TRACE("iface %p, shader %p, class_instances %p, class_instance_count %p.\n", + iface, shader, class_instances, class_instance_count); + + if (class_instances || class_instance_count) + FIXME("Dynamic linking not implemented yet.\n"); wined3d_mutex_lock(); if (!(wined3d_shader = wined3d_device_get_vertex_shader(device->wined3d_device))) @@ -929,14 +1172,14 @@ shader_impl = wined3d_shader_get_parent(wined3d_shader); wined3d_mutex_unlock(); - *shader = &shader_impl->ID3D10VertexShader_iface; - ID3D10VertexShader_AddRef(*shader); + *shader = &shader_impl->ID3D11VertexShader_iface; + ID3D11VertexShader_AddRef(*shader); } -static void STDMETHODCALLTYPE d3d10_device_PSGetConstantBuffers(ID3D10Device1 *iface, - UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers) +static void STDMETHODCALLTYPE d3d11_immediate_context_PSGetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer **buffers) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); unsigned int i; TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", @@ -946,7 +1189,7 @@ for (i = 0; i < buffer_count; ++i) { struct wined3d_buffer *wined3d_buffer; - struct d3d10_buffer *buffer_impl; + struct d3d_buffer *buffer_impl; if (!(wined3d_buffer = wined3d_device_get_ps_cb(device->wined3d_device, start_slot + i))) { @@ -955,17 +1198,18 @@ } buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); - buffers[i] = &buffer_impl->ID3D10Buffer_iface; - ID3D10Buffer_AddRef(buffers[i]); + buffers[i] = &buffer_impl->ID3D11Buffer_iface; + ID3D11Buffer_AddRef(buffers[i]); } wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_IAGetInputLayout(ID3D10Device1 *iface, ID3D10InputLayout **input_layout) +static void STDMETHODCALLTYPE d3d11_immediate_context_IAGetInputLayout(ID3D11DeviceContext *iface, + ID3D11InputLayout **input_layout) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); struct wined3d_vertex_declaration *wined3d_declaration; - struct d3d10_input_layout *input_layout_impl; + struct d3d_input_layout *input_layout_impl; TRACE("iface %p, input_layout %p.\n", iface, input_layout); @@ -979,73 +1223,27 @@ input_layout_impl = wined3d_vertex_declaration_get_parent(wined3d_declaration); wined3d_mutex_unlock(); - *input_layout = &input_layout_impl->ID3D10InputLayout_iface; - ID3D10InputLayout_AddRef(*input_layout); + *input_layout = &input_layout_impl->ID3D11InputLayout_iface; + ID3D11InputLayout_AddRef(*input_layout); } -static void STDMETHODCALLTYPE d3d10_device_IAGetVertexBuffers(ID3D10Device1 *iface, - UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers, UINT *strides, UINT *offsets) +static void STDMETHODCALLTYPE d3d11_immediate_context_IAGetVertexBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer **buffers, UINT *strides, UINT *offsets) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - unsigned int i; - - TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p, strides %p, offsets %p.\n", + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p, strides %p, offsets %p stub!\n", iface, start_slot, buffer_count, buffers, strides, offsets); - - wined3d_mutex_lock(); - for (i = 0; i < buffer_count; ++i) - { - struct wined3d_buffer *wined3d_buffer; - struct d3d10_buffer *buffer_impl; - - if (FAILED(wined3d_device_get_stream_source(device->wined3d_device, start_slot + i, - &wined3d_buffer, &offsets[i], &strides[i]))) - ERR("Failed to get vertex buffer.\n"); - - if (!wined3d_buffer) - { - buffers[i] = NULL; - continue; - } - - buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); - buffers[i] = &buffer_impl->ID3D10Buffer_iface; - ID3D10Buffer_AddRef(buffers[i]); - } - wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_IAGetIndexBuffer(ID3D10Device1 *iface, - ID3D10Buffer **buffer, DXGI_FORMAT *format, UINT *offset) +static void STDMETHODCALLTYPE d3d11_immediate_context_IAGetIndexBuffer(ID3D11DeviceContext *iface, + ID3D11Buffer **buffer, DXGI_FORMAT *format, UINT *offset) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - enum wined3d_format_id wined3d_format; - struct wined3d_buffer *wined3d_buffer; - struct d3d10_buffer *buffer_impl; - - TRACE("iface %p, buffer %p, format %p, offset %p.\n", iface, buffer, format, offset); - - wined3d_mutex_lock(); - wined3d_buffer = wined3d_device_get_index_buffer(device->wined3d_device, &wined3d_format); - *format = dxgi_format_from_wined3dformat(wined3d_format); - *offset = 0; /* FIXME */ - if (!wined3d_buffer) - { - wined3d_mutex_unlock(); - *buffer = NULL; - return; - } - - buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); - wined3d_mutex_unlock(); - *buffer = &buffer_impl->ID3D10Buffer_iface; - ID3D10Buffer_AddRef(*buffer); + FIXME("iface %p, buffer %p, format %p, offset %p stub!\n", iface, buffer, format, offset); } -static void STDMETHODCALLTYPE d3d10_device_GSGetConstantBuffers(ID3D10Device1 *iface, - UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers) +static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer **buffers) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); unsigned int i; TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", @@ -1055,7 +1253,7 @@ for (i = 0; i < buffer_count; ++i) { struct wined3d_buffer *wined3d_buffer; - struct d3d10_buffer *buffer_impl; + struct d3d_buffer *buffer_impl; if (!(wined3d_buffer = wined3d_device_get_gs_cb(device->wined3d_device, start_slot + i))) { @@ -1064,19 +1262,24 @@ } buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); - buffers[i] = &buffer_impl->ID3D10Buffer_iface; - ID3D10Buffer_AddRef(buffers[i]); + buffers[i] = &buffer_impl->ID3D11Buffer_iface; + ID3D11Buffer_AddRef(buffers[i]); } wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_GSGetShader(ID3D10Device1 *iface, ID3D10GeometryShader **shader) +static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetShader(ID3D11DeviceContext *iface, + ID3D11GeometryShader **shader, ID3D11ClassInstance **class_instances, UINT *class_instance_count) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - struct d3d10_geometry_shader *shader_impl; + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); + struct d3d_geometry_shader *shader_impl; struct wined3d_shader *wined3d_shader; - TRACE("iface %p, shader %p.\n", iface, shader); + TRACE("iface %p, shader %p, class_instances %p, class_instance_count %p.\n", + iface, shader, class_instances, class_instance_count); + + if (class_instances || class_instance_count) + FIXME("Dynamic linking not implemented yet.\n"); wined3d_mutex_lock(); if (!(wined3d_shader = wined3d_device_get_geometry_shader(device->wined3d_device))) @@ -1088,36 +1291,35 @@ shader_impl = wined3d_shader_get_parent(wined3d_shader); wined3d_mutex_unlock(); - *shader = &shader_impl->ID3D10GeometryShader_iface; - ID3D10GeometryShader_AddRef(*shader); + *shader = &shader_impl->ID3D11GeometryShader_iface; + ID3D11GeometryShader_AddRef(*shader); } -static void STDMETHODCALLTYPE d3d10_device_IAGetPrimitiveTopology(ID3D10Device1 *iface, - D3D10_PRIMITIVE_TOPOLOGY *topology) +static void STDMETHODCALLTYPE d3d11_immediate_context_IAGetPrimitiveTopology(ID3D11DeviceContext *iface, + D3D11_PRIMITIVE_TOPOLOGY *topology) { - struct d3d_device *This = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); - TRACE("iface %p, topology %p\n", iface, topology); + TRACE("iface %p, topology %p.\n", iface, topology); wined3d_mutex_lock(); - wined3d_device_get_primitive_type(This->wined3d_device, (enum wined3d_primitive_type *)topology); + wined3d_device_get_primitive_type(device->wined3d_device, (enum wined3d_primitive_type *)topology); wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_VSGetShaderResources(ID3D10Device1 *iface, - UINT start_slot, UINT view_count, ID3D10ShaderResourceView **views) +static void STDMETHODCALLTYPE d3d11_immediate_context_VSGetShaderResources(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11ShaderResourceView **views) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); unsigned int i; - TRACE("iface %p, start_slot %u, view_count %u, views %p.\n", - iface, start_slot, view_count, views); + TRACE("iface %p, start_slot %u, view_count %u, views %p.\n", iface, start_slot, view_count, views); wined3d_mutex_lock(); for (i = 0; i < view_count; ++i) { struct wined3d_shader_resource_view *wined3d_view; - struct d3d10_shader_resource_view *view_impl; + struct d3d_shader_resource_view *view_impl; if (!(wined3d_view = wined3d_device_get_vs_resource_view(device->wined3d_device, start_slot + i))) { @@ -1126,16 +1328,16 @@ } view_impl = wined3d_shader_resource_view_get_parent(wined3d_view); - views[i] = &view_impl->ID3D10ShaderResourceView_iface; - ID3D10ShaderResourceView_AddRef(views[i]); + views[i] = &view_impl->ID3D11ShaderResourceView_iface; + ID3D11ShaderResourceView_AddRef(views[i]); } wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_VSGetSamplers(ID3D10Device1 *iface, - UINT start_slot, UINT sampler_count, ID3D10SamplerState **samplers) +static void STDMETHODCALLTYPE d3d11_immediate_context_VSGetSamplers(ID3D11DeviceContext *iface, + UINT start_slot, UINT sampler_count, ID3D11SamplerState **samplers) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); unsigned int i; TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n", @@ -1144,8 +1346,8 @@ wined3d_mutex_lock(); for (i = 0; i < sampler_count; ++i) { - struct d3d10_sampler_state *sampler_impl; struct wined3d_sampler *wined3d_sampler; + struct d3d_sampler_state *sampler_impl; if (!(wined3d_sampler = wined3d_device_get_vs_sampler(device->wined3d_device, start_slot + i))) { @@ -1154,18 +1356,18 @@ } sampler_impl = wined3d_sampler_get_parent(wined3d_sampler); - samplers[i] = &sampler_impl->ID3D10SamplerState_iface; - ID3D10SamplerState_AddRef(samplers[i]); + samplers[i] = &sampler_impl->ID3D11SamplerState_iface; + ID3D11SamplerState_AddRef(samplers[i]); } wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_GetPredication(ID3D10Device1 *iface, - ID3D10Predicate **predicate, BOOL *value) +static void STDMETHODCALLTYPE d3d11_immediate_context_GetPredication(ID3D11DeviceContext *iface, + ID3D11Predicate **predicate, BOOL *value) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); struct wined3d_query *wined3d_predicate; - struct d3d10_query *predicate_impl; + struct d3d_query *predicate_impl; TRACE("iface %p, predicate %p, value %p.\n", iface, predicate, value); @@ -1179,24 +1381,23 @@ predicate_impl = wined3d_query_get_parent(wined3d_predicate); wined3d_mutex_unlock(); - *predicate = (ID3D10Predicate *)&predicate_impl->ID3D10Query_iface; - ID3D10Predicate_AddRef(*predicate); + *predicate = (ID3D11Predicate *)&predicate_impl->ID3D11Query_iface; + ID3D11Predicate_AddRef(*predicate); } -static void STDMETHODCALLTYPE d3d10_device_GSGetShaderResources(ID3D10Device1 *iface, - UINT start_slot, UINT view_count, ID3D10ShaderResourceView **views) +static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetShaderResources(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11ShaderResourceView **views) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); unsigned int i; - TRACE("iface %p, start_slot %u, view_count %u, views %p.\n", - iface, start_slot, view_count, views); + TRACE("iface %p, start_slot %u, view_count %u, views %p.\n", iface, start_slot, view_count, views); wined3d_mutex_lock(); for (i = 0; i < view_count; ++i) { struct wined3d_shader_resource_view *wined3d_view; - struct d3d10_shader_resource_view *view_impl; + struct d3d_shader_resource_view *view_impl; if (!(wined3d_view = wined3d_device_get_gs_resource_view(device->wined3d_device, start_slot + i))) { @@ -1205,16 +1406,16 @@ } view_impl = wined3d_shader_resource_view_get_parent(wined3d_view); - views[i] = &view_impl->ID3D10ShaderResourceView_iface; - ID3D10ShaderResourceView_AddRef(views[i]); + views[i] = &view_impl->ID3D11ShaderResourceView_iface; + ID3D11ShaderResourceView_AddRef(views[i]); } wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_GSGetSamplers(ID3D10Device1 *iface, - UINT start_slot, UINT sampler_count, ID3D10SamplerState **samplers) +static void STDMETHODCALLTYPE d3d11_immediate_context_GSGetSamplers(ID3D11DeviceContext *iface, + UINT start_slot, UINT sampler_count, ID3D11SamplerState **samplers) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); unsigned int i; TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n", @@ -1223,7 +1424,7 @@ wined3d_mutex_lock(); for (i = 0; i < sampler_count; ++i) { - struct d3d10_sampler_state *sampler_impl; + struct d3d_sampler_state *sampler_impl; struct wined3d_sampler *wined3d_sampler; if (!(wined3d_sampler = wined3d_device_get_gs_sampler(device->wined3d_device, start_slot + i))) @@ -1233,28 +1434,29 @@ } sampler_impl = wined3d_sampler_get_parent(wined3d_sampler); - samplers[i] = &sampler_impl->ID3D10SamplerState_iface; - ID3D10SamplerState_AddRef(samplers[i]); + samplers[i] = &sampler_impl->ID3D11SamplerState_iface; + ID3D11SamplerState_AddRef(samplers[i]); } wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_OMGetRenderTargets(ID3D10Device1 *iface, - UINT view_count, ID3D10RenderTargetView **render_target_views, ID3D10DepthStencilView **depth_stencil_view) +static void STDMETHODCALLTYPE d3d11_immediate_context_OMGetRenderTargets(ID3D11DeviceContext *iface, + UINT render_target_view_count, ID3D11RenderTargetView **render_target_views, + ID3D11DepthStencilView **depth_stencil_view) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); struct wined3d_rendertarget_view *wined3d_view; - TRACE("iface %p, view_count %u, render_target_views %p, depth_stencil_view %p.\n", - iface, view_count, render_target_views, depth_stencil_view); + TRACE("iface %p, render_target_view_count %u, render_target_views %p, depth_stencil_view %p.\n", + iface, render_target_view_count, render_target_views, depth_stencil_view); wined3d_mutex_lock(); if (render_target_views) { - struct d3d10_rendertarget_view *view_impl; + struct d3d_rendertarget_view *view_impl; unsigned int i; - for (i = 0; i < view_count; ++i) + for (i = 0; i < render_target_view_count; ++i) { if (!(wined3d_view = wined3d_device_get_rendertarget_view(device->wined3d_device, i)) || !(view_impl = wined3d_rendertarget_view_get_parent(wined3d_view))) @@ -1263,14 +1465,14 @@ continue; } - render_target_views[i] = &view_impl->ID3D10RenderTargetView_iface; - ID3D10RenderTargetView_AddRef(render_target_views[i]); + render_target_views[i] = &view_impl->ID3D11RenderTargetView_iface; + ID3D11RenderTargetView_AddRef(render_target_views[i]); } } if (depth_stencil_view) { - struct d3d10_depthstencil_view *view_impl; + struct d3d_depthstencil_view *view_impl; if (!(wined3d_view = wined3d_device_get_depth_stencil_view(device->wined3d_device)) || !(view_impl = wined3d_rendertarget_view_get_parent(wined3d_view))) @@ -1279,588 +1481,620 @@ } else { - *depth_stencil_view = &view_impl->ID3D10DepthStencilView_iface; - ID3D10DepthStencilView_AddRef(*depth_stencil_view); + *depth_stencil_view = &view_impl->ID3D11DepthStencilView_iface; + ID3D11DepthStencilView_AddRef(*depth_stencil_view); } } wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_OMGetBlendState(ID3D10Device1 *iface, - ID3D10BlendState **blend_state, FLOAT blend_factor[4], UINT *sample_mask) -{ - struct d3d_device *device = impl_from_ID3D10Device(iface); +static void STDMETHODCALLTYPE d3d11_immediate_context_OMGetRenderTargetsAndUnorderedAccessViews( + ID3D11DeviceContext *iface, + UINT render_target_view_count, ID3D11RenderTargetView **render_target_views, + ID3D11DepthStencilView **depth_stencil_view, + UINT unordered_access_view_start_slot, UINT unordered_access_view_count, + ID3D11UnorderedAccessView **unordered_access_views) +{ + FIXME("iface %p, render_target_view_count %u, render_target_views %p, depth_stencil_view %p, " + "unordered_access_view_start_slot %u, unordered_access_view_count %u, " + "unordered_access_views %p stub!\n", + iface, render_target_view_count, render_target_views, depth_stencil_view, + unordered_access_view_start_slot, unordered_access_view_count, unordered_access_views); +} - TRACE("iface %p, blend_state %p, blend_factor %p, sample_mask %p.\n", +static void STDMETHODCALLTYPE d3d11_immediate_context_OMGetBlendState(ID3D11DeviceContext *iface, + ID3D11BlendState **blend_state, FLOAT blend_factor[4], UINT *sample_mask) +{ + FIXME("iface %p, blend_state %p, blend_factor %p, sample_mask %p stub!\n", iface, blend_state, blend_factor, sample_mask); - - if ((*blend_state = device->blend_state ? &device->blend_state->ID3D10BlendState_iface : NULL)) - ID3D10BlendState_AddRef(*blend_state); - wined3d_mutex_lock(); - memcpy(blend_factor, device->blend_factor, 4 * sizeof(*blend_factor)); - *sample_mask = wined3d_device_get_render_state(device->wined3d_device, WINED3D_RS_MULTISAMPLEMASK); - wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_OMGetDepthStencilState(ID3D10Device1 *iface, - ID3D10DepthStencilState **depth_stencil_state, UINT *stencil_ref) +static void STDMETHODCALLTYPE d3d11_immediate_context_OMGetDepthStencilState(ID3D11DeviceContext *iface, + ID3D11DepthStencilState **depth_stencil_state, UINT *stencil_ref) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - - TRACE("iface %p, depth_stencil_state %p, stencil_ref %p.\n", - iface, depth_stencil_state, stencil_ref); - - if ((*depth_stencil_state = device->depth_stencil_state - ? &device->depth_stencil_state->ID3D10DepthStencilState_iface : NULL)) - ID3D10DepthStencilState_AddRef(*depth_stencil_state); - *stencil_ref = device->stencil_ref; + FIXME("iface %p, depth_stencil_state %p, stencil_ref %p stub!\n", iface, depth_stencil_state, stencil_ref); } -static void STDMETHODCALLTYPE d3d10_device_SOGetTargets(ID3D10Device1 *iface, - UINT buffer_count, ID3D10Buffer **buffers, UINT *offsets) +static void STDMETHODCALLTYPE d3d11_immediate_context_SOGetTargets(ID3D11DeviceContext *iface, + UINT buffer_count, ID3D11Buffer **buffers) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); unsigned int i; - TRACE("iface %p, buffer_count %u, buffers %p, offsets %p.\n", - iface, buffer_count, buffers, offsets); + TRACE("iface %p, buffer_count %u, buffers %p.\n", iface, buffer_count, buffers); wined3d_mutex_lock(); for (i = 0; i < buffer_count; ++i) { struct wined3d_buffer *wined3d_buffer; - struct d3d10_buffer *buffer_impl; + struct d3d_buffer *buffer_impl; - if (!(wined3d_buffer = wined3d_device_get_stream_output(device->wined3d_device, i, &offsets[i]))) + if (!(wined3d_buffer = wined3d_device_get_stream_output(device->wined3d_device, i, NULL))) { buffers[i] = NULL; continue; } buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); - buffers[i] = &buffer_impl->ID3D10Buffer_iface; - ID3D10Buffer_AddRef(buffers[i]); + buffers[i] = &buffer_impl->ID3D11Buffer_iface; + ID3D11Buffer_AddRef(buffers[i]); } wined3d_mutex_unlock(); } -static void STDMETHODCALLTYPE d3d10_device_RSGetState(ID3D10Device1 *iface, ID3D10RasterizerState **rasterizer_state) +static void STDMETHODCALLTYPE d3d11_immediate_context_RSGetState(ID3D11DeviceContext *iface, + ID3D11RasterizerState **rasterizer_state) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); TRACE("iface %p, rasterizer_state %p.\n", iface, rasterizer_state); - if ((*rasterizer_state = device->rasterizer_state ? &device->rasterizer_state->ID3D10RasterizerState_iface : NULL)) - ID3D10RasterizerState_AddRef(*rasterizer_state); + if ((*rasterizer_state = device->rasterizer_state ? &device->rasterizer_state->ID3D11RasterizerState_iface : NULL)) + ID3D11RasterizerState_AddRef(*rasterizer_state); } -static void STDMETHODCALLTYPE d3d10_device_RSGetViewports(ID3D10Device1 *iface, - UINT *viewport_count, D3D10_VIEWPORT *viewports) +static void STDMETHODCALLTYPE d3d11_immediate_context_RSGetViewports(ID3D11DeviceContext *iface, + UINT *viewport_count, D3D11_VIEWPORT *viewports) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - struct wined3d_viewport wined3d_vp; - - TRACE("iface %p, viewport_count %p, viewports %p.\n", iface, viewport_count, viewports); - - if (!viewports) - { - *viewport_count = 1; - return; - } + FIXME("iface %p, viewport_count %p, viewports %p stub!\n", iface, viewport_count, viewports); +} - if (!*viewport_count) - return; +static void STDMETHODCALLTYPE d3d11_immediate_context_RSGetScissorRects(ID3D11DeviceContext *iface, + UINT *rect_count, D3D11_RECT *rects) +{ + FIXME("iface %p, rect_count %p, rects %p stub!\n", iface, rect_count, rects); +} - wined3d_mutex_lock(); - wined3d_device_get_viewport(device->wined3d_device, &wined3d_vp); - wined3d_mutex_unlock(); +static void STDMETHODCALLTYPE d3d11_immediate_context_HSGetShaderResources(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11ShaderResourceView **views) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", iface, start_slot, view_count, views); +} - viewports[0].TopLeftX = wined3d_vp.x; - viewports[0].TopLeftY = wined3d_vp.y; - viewports[0].Width = wined3d_vp.width; - viewports[0].Height = wined3d_vp.height; - viewports[0].MinDepth = wined3d_vp.min_z; - viewports[0].MaxDepth = wined3d_vp.max_z; +static void STDMETHODCALLTYPE d3d11_immediate_context_HSGetShader(ID3D11DeviceContext *iface, + ID3D11HullShader **shader, ID3D11ClassInstance **class_instances, UINT *class_instance_count) +{ + FIXME("iface %p, shader %p, class_instances %p, class_instance_count %p stub!\n", + iface, shader, class_instances, class_instance_count); +} - if (*viewport_count > 1) - memset(&viewports[1], 0, (*viewport_count - 1) * sizeof(*viewports)); +static void STDMETHODCALLTYPE d3d11_immediate_context_HSGetSamplers(ID3D11DeviceContext *iface, + UINT start_slot, UINT sampler_count, ID3D11SamplerState **samplers) +{ + FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + iface, start_slot, sampler_count, samplers); } -static void STDMETHODCALLTYPE d3d10_device_RSGetScissorRects(ID3D10Device1 *iface, UINT *rect_count, D3D10_RECT *rects) +static void STDMETHODCALLTYPE d3d11_immediate_context_HSGetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer **buffers) { - struct d3d_device *device = impl_from_ID3D10Device(iface); + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n", + iface, start_slot, buffer_count, buffers); +} - TRACE("iface %p, rect_count %p, rects %p.\n", iface, rect_count, rects); +static void STDMETHODCALLTYPE d3d11_immediate_context_DSGetShaderResources(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11ShaderResourceView **views) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", + iface, start_slot, view_count, views); +} - if (!rects) - { - *rect_count = 1; - return; - } +static void STDMETHODCALLTYPE d3d11_immediate_context_DSGetShader(ID3D11DeviceContext *iface, + ID3D11DomainShader **shader, ID3D11ClassInstance **class_instances, UINT *class_instance_count) +{ + FIXME("iface %p, shader %p, class_instances %p, class_instance_count %p stub!\n", + iface, shader, class_instances, class_instance_count); +} - if (!*rect_count) - return; +static void STDMETHODCALLTYPE d3d11_immediate_context_DSGetSamplers(ID3D11DeviceContext *iface, + UINT start_slot, UINT sampler_count, ID3D11SamplerState **samplers) +{ + FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + iface, start_slot, sampler_count, samplers); +} - wined3d_mutex_lock(); - wined3d_device_get_scissor_rect(device->wined3d_device, rects); - wined3d_mutex_unlock(); - if (*rect_count > 1) - memset(&rects[1], 0, (*rect_count - 1) * sizeof(*rects)); +static void STDMETHODCALLTYPE d3d11_immediate_context_DSGetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer **buffers) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n", + iface, start_slot, buffer_count, buffers); } -static HRESULT STDMETHODCALLTYPE d3d10_device_GetDeviceRemovedReason(ID3D10Device1 *iface) +static void STDMETHODCALLTYPE d3d11_immediate_context_CSGetShaderResources(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11ShaderResourceView **views) { - TRACE("iface %p.\n", iface); + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", iface, start_slot, view_count, views); +} - /* In the current implementation the device is never removed, so we can - * just return S_OK here. */ +static void STDMETHODCALLTYPE d3d11_immediate_context_CSGetUnorderedAccessViews(ID3D11DeviceContext *iface, + UINT start_slot, UINT view_count, ID3D11UnorderedAccessView **views) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", iface, start_slot, view_count, views); +} - return S_OK; +static void STDMETHODCALLTYPE d3d11_immediate_context_CSGetShader(ID3D11DeviceContext *iface, + ID3D11ComputeShader **shader, ID3D11ClassInstance **class_instances, UINT *class_instance_count) +{ + FIXME("iface %p, shader %p, class_instances %p, class_instance_count %p stub!\n", + iface, shader, class_instances, class_instance_count); } -static HRESULT STDMETHODCALLTYPE d3d10_device_SetExceptionMode(ID3D10Device1 *iface, UINT flags) +static void STDMETHODCALLTYPE d3d11_immediate_context_CSGetSamplers(ID3D11DeviceContext *iface, + UINT start_slot, UINT sampler_count, ID3D11SamplerState **samplers) { - FIXME("iface %p, flags %#x stub!\n", iface, flags); + FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + iface, start_slot, sampler_count, samplers); +} - return E_NOTIMPL; +static void STDMETHODCALLTYPE d3d11_immediate_context_CSGetConstantBuffers(ID3D11DeviceContext *iface, + UINT start_slot, UINT buffer_count, ID3D11Buffer **buffers) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffer %p stub!\n", + iface, start_slot, buffer_count, buffers); } -static UINT STDMETHODCALLTYPE d3d10_device_GetExceptionMode(ID3D10Device1 *iface) +static void STDMETHODCALLTYPE d3d11_immediate_context_ClearState(ID3D11DeviceContext *iface) { FIXME("iface %p stub!\n", iface); - - return 0; } -static HRESULT STDMETHODCALLTYPE d3d10_device_GetPrivateData(ID3D10Device1 *iface, - REFGUID guid, UINT *data_size, void *data) +static void STDMETHODCALLTYPE d3d11_immediate_context_Flush(ID3D11DeviceContext *iface) { - IDXGIDevice *dxgi_device; - HRESULT hr; - - TRACE("iface %p, guid %s, data_size %p, data %p.\n", - iface, debugstr_guid(guid), data_size, data); + FIXME("iface %p stub!\n", iface); +} - if (FAILED(hr = ID3D10Device1_QueryInterface(iface, &IID_IDXGIDevice, (void **)&dxgi_device))) - return hr; - hr = IDXGIDevice_GetPrivateData(dxgi_device, guid, data_size, data); - IDXGIDevice_Release(dxgi_device); +static D3D11_DEVICE_CONTEXT_TYPE STDMETHODCALLTYPE d3d11_immediate_context_GetType(ID3D11DeviceContext *iface) +{ + TRACE("iface %p.\n", iface); - return hr; + return D3D11_DEVICE_CONTEXT_IMMEDIATE; } -static HRESULT STDMETHODCALLTYPE d3d10_device_SetPrivateData(ID3D10Device1 *iface, - REFGUID guid, UINT data_size, const void *data) +static UINT STDMETHODCALLTYPE d3d11_immediate_context_GetContextFlags(ID3D11DeviceContext *iface) { - IDXGIDevice *dxgi_device; - HRESULT hr; + FIXME("iface %p stub!\n", iface); - TRACE("iface %p, guid %s, data_size %u, data %p.\n", - iface, debugstr_guid(guid), data_size, data); + return 0; +} - if (FAILED(hr = ID3D10Device1_QueryInterface(iface, &IID_IDXGIDevice, (void **)&dxgi_device))) - return hr; - hr = IDXGIDevice_SetPrivateData(dxgi_device, guid, data_size, data); - IDXGIDevice_Release(dxgi_device); +static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_FinishCommandList(ID3D11DeviceContext *iface, + BOOL restore, ID3D11CommandList **command_list) +{ + FIXME("iface %p, restore %#x, command_list %p stub!\n", iface, restore, command_list); - return hr; + return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE d3d10_device_SetPrivateDataInterface(ID3D10Device1 *iface, - REFGUID guid, const IUnknown *data) +static const struct ID3D11DeviceContextVtbl d3d11_immediate_context_vtbl = { - IDXGIDevice *dxgi_device; - HRESULT hr; + /* IUnknown methods */ + d3d11_immediate_context_QueryInterface, + d3d11_immediate_context_AddRef, + d3d11_immediate_context_Release, + /* ID3D11DeviceChild methods */ + d3d11_immediate_context_GetDevice, + d3d11_immediate_context_GetPrivateData, + d3d11_immediate_context_SetPrivateData, + d3d11_immediate_context_SetPrivateDataInterface, + /* ID3D11DeviceContext methods */ + d3d11_immediate_context_VSSetConstantBuffers, + d3d11_immediate_context_PSSetShaderResources, + d3d11_immediate_context_PSSetShader, + d3d11_immediate_context_PSSetSamplers, + d3d11_immediate_context_VSSetShader, + d3d11_immediate_context_DrawIndexed, + d3d11_immediate_context_Draw, + d3d11_immediate_context_Map, + d3d11_immediate_context_Unmap, + d3d11_immediate_context_PSSetConstantBuffers, + d3d11_immediate_context_IASetInputLayout, + d3d11_immediate_context_IASetVertexBuffers, + d3d11_immediate_context_IASetIndexBuffer, + d3d11_immediate_context_DrawIndexedInstanced, + d3d11_immediate_context_DrawInstanced, + d3d11_immediate_context_GSSetConstantBuffers, + d3d11_immediate_context_GSSetShader, + d3d11_immediate_context_IASetPrimitiveTopology, + d3d11_immediate_context_VSSetShaderResources, + d3d11_immediate_context_VSSetSamplers, + d3d11_immediate_context_Begin, + d3d11_immediate_context_End, + d3d11_immediate_context_GetData, + d3d11_immediate_context_SetPredication, + d3d11_immediate_context_GSSetShaderResources, + d3d11_immediate_context_GSSetSamplers, + d3d11_immediate_context_OMSetRenderTargets, + d3d11_immediate_context_OMSetRenderTargetsAndUnorderedAccessViews, + d3d11_immediate_context_OMSetBlendState, + d3d11_immediate_context_OMSetDepthStencilState, + d3d11_immediate_context_SOSetTargets, + d3d11_immediate_context_DrawAuto, + d3d11_immediate_context_DrawIndexedInstancedIndirect, + d3d11_immediate_context_DrawInstancedIndirect, + d3d11_immediate_context_Dispatch, + d3d11_immediate_context_DispatchIndirect, + d3d11_immediate_context_RSSetState, + d3d11_immediate_context_RSSetViewports, + d3d11_immediate_context_RSSetScissorRects, + d3d11_immediate_context_CopySubresourceRegion, + d3d11_immediate_context_CopyResource, + d3d11_immediate_context_UpdateSubresource, + d3d11_immediate_context_CopyStructureCount, + d3d11_immediate_context_ClearRenderTargetView, + d3d11_immediate_context_ClearUnorderedAccessViewUint, + d3d11_immediate_context_ClearUnorderedAccessViewFloat, + d3d11_immediate_context_ClearDepthStencilView, + d3d11_immediate_context_GenerateMips, + d3d11_immediate_context_SetResourceMinLOD, + d3d11_immediate_context_GetResourceMinLOD, + d3d11_immediate_context_ResolveSubresource, + d3d11_immediate_context_ExecuteCommandList, + d3d11_immediate_context_HSSetShaderResources, + d3d11_immediate_context_HSSetShader, + d3d11_immediate_context_HSSetSamplers, + d3d11_immediate_context_HSSetConstantBuffers, + d3d11_immediate_context_DSSetShaderResources, + d3d11_immediate_context_DSSetShader, + d3d11_immediate_context_DSSetSamplers, + d3d11_immediate_context_DSSetConstantBuffers, + d3d11_immediate_context_CSSetShaderResources, + d3d11_immediate_context_CSSetUnorderedAccessViews, + d3d11_immediate_context_CSSetShader, + d3d11_immediate_context_CSSetSamplers, + d3d11_immediate_context_CSSetConstantBuffers, + d3d11_immediate_context_VSGetConstantBuffers, + d3d11_immediate_context_PSGetShaderResources, + d3d11_immediate_context_PSGetShader, + d3d11_immediate_context_PSGetSamplers, + d3d11_immediate_context_VSGetShader, + d3d11_immediate_context_PSGetConstantBuffers, + d3d11_immediate_context_IAGetInputLayout, + d3d11_immediate_context_IAGetVertexBuffers, + d3d11_immediate_context_IAGetIndexBuffer, + d3d11_immediate_context_GSGetConstantBuffers, + d3d11_immediate_context_GSGetShader, + d3d11_immediate_context_IAGetPrimitiveTopology, + d3d11_immediate_context_VSGetShaderResources, + d3d11_immediate_context_VSGetSamplers, + d3d11_immediate_context_GetPredication, + d3d11_immediate_context_GSGetShaderResources, + d3d11_immediate_context_GSGetSamplers, + d3d11_immediate_context_OMGetRenderTargets, + d3d11_immediate_context_OMGetRenderTargetsAndUnorderedAccessViews, + d3d11_immediate_context_OMGetBlendState, + d3d11_immediate_context_OMGetDepthStencilState, + d3d11_immediate_context_SOGetTargets, + d3d11_immediate_context_RSGetState, + d3d11_immediate_context_RSGetViewports, + d3d11_immediate_context_RSGetScissorRects, + d3d11_immediate_context_HSGetShaderResources, + d3d11_immediate_context_HSGetShader, + d3d11_immediate_context_HSGetSamplers, + d3d11_immediate_context_HSGetConstantBuffers, + d3d11_immediate_context_DSGetShaderResources, + d3d11_immediate_context_DSGetShader, + d3d11_immediate_context_DSGetSamplers, + d3d11_immediate_context_DSGetConstantBuffers, + d3d11_immediate_context_CSGetShaderResources, + d3d11_immediate_context_CSGetUnorderedAccessViews, + d3d11_immediate_context_CSGetShader, + d3d11_immediate_context_CSGetSamplers, + d3d11_immediate_context_CSGetConstantBuffers, + d3d11_immediate_context_ClearState, + d3d11_immediate_context_Flush, + d3d11_immediate_context_GetType, + d3d11_immediate_context_GetContextFlags, + d3d11_immediate_context_FinishCommandList, +}; - TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); +static HRESULT d3d11_immediate_context_init(struct d3d11_immediate_context *context, struct d3d_device *device) +{ + context->ID3D11DeviceContext_iface.lpVtbl = &d3d11_immediate_context_vtbl; + context->refcount = 1; - if (FAILED(hr = ID3D10Device1_QueryInterface(iface, &IID_IDXGIDevice, (void **)&dxgi_device))) - return hr; - hr = IDXGIDevice_SetPrivateDataInterface(dxgi_device, guid, data); - IDXGIDevice_Release(dxgi_device); + ID3D11Device_AddRef(&device->ID3D11Device_iface); - return hr; + return S_OK; } -static void STDMETHODCALLTYPE d3d10_device_ClearState(ID3D10Device1 *iface) -{ - static const float blend_factor[] = {1.0f, 1.0f, 1.0f, 1.0f}; - struct d3d_device *device = impl_from_ID3D10Device(iface); - unsigned int i; +/* ID3D11Device methods */ - TRACE("iface %p.\n", iface); +static HRESULT STDMETHODCALLTYPE d3d11_device_QueryInterface(ID3D11Device *iface, REFIID riid, void **out) +{ + struct d3d_device *device = impl_from_ID3D11Device(iface); + return IUnknown_QueryInterface(device->outer_unk, riid, out); +} - wined3d_mutex_lock(); - wined3d_device_set_vertex_shader(device->wined3d_device, NULL); - for (i = 0; i < D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT; ++i) - { - wined3d_device_set_vs_sampler(device->wined3d_device, i, NULL); - } - for (i = 0; i < D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT; ++i) - { - wined3d_device_set_vs_resource_view(device->wined3d_device, i, NULL); - } - for (i = 0; i < D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT; ++i) - { - wined3d_device_set_vs_cb(device->wined3d_device, i, NULL); - } - wined3d_device_set_geometry_shader(device->wined3d_device, NULL); - for (i = 0; i < D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT; ++i) - { - wined3d_device_set_gs_sampler(device->wined3d_device, i, NULL); - } - for (i = 0; i < D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT; ++i) - { - wined3d_device_set_gs_resource_view(device->wined3d_device, i, NULL); - } - for (i = 0; i < D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT; ++i) - { - wined3d_device_set_gs_cb(device->wined3d_device, i, NULL); - } - wined3d_device_set_pixel_shader(device->wined3d_device, NULL); - for (i = 0; i < D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT; ++i) - { - wined3d_device_set_ps_sampler(device->wined3d_device, i, NULL); - } - for (i = 0; i < D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT; ++i) - { - wined3d_device_set_ps_resource_view(device->wined3d_device, i, NULL); - } - for (i = 0; i < D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT; ++i) - { - wined3d_device_set_ps_cb(device->wined3d_device, i, NULL); - } - for (i = 0; i < D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT; ++i) - { - wined3d_device_set_stream_source(device->wined3d_device, i, NULL, 0, 0); - } - wined3d_device_set_index_buffer(device->wined3d_device, NULL, WINED3DFMT_UNKNOWN); - wined3d_device_set_vertex_declaration(device->wined3d_device, NULL); - wined3d_device_set_primitive_type(device->wined3d_device, WINED3D_PT_UNDEFINED); - for (i = 0; i < D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i) - { - wined3d_device_set_rendertarget_view(device->wined3d_device, i, NULL, FALSE); - } - wined3d_device_set_depth_stencil_view(device->wined3d_device, NULL); - ID3D10Device1_OMSetDepthStencilState(iface, NULL, 0); - ID3D10Device1_OMSetBlendState(iface, NULL, blend_factor, D3D10_DEFAULT_SAMPLE_MASK); - ID3D10Device1_RSSetViewports(iface, 0, NULL); - ID3D10Device1_RSSetScissorRects(iface, 0, NULL); - ID3D10Device1_RSSetState(iface, NULL); - for (i = 0; i < D3D10_SO_BUFFER_SLOT_COUNT; ++i) - { - wined3d_device_set_stream_output(device->wined3d_device, i, NULL, 0); - } - wined3d_device_set_predication(device->wined3d_device, NULL, FALSE); - wined3d_mutex_unlock(); +static ULONG STDMETHODCALLTYPE d3d11_device_AddRef(ID3D11Device *iface) +{ + struct d3d_device *device = impl_from_ID3D11Device(iface); + return IUnknown_AddRef(device->outer_unk); } -static void STDMETHODCALLTYPE d3d10_device_Flush(ID3D10Device1 *iface) +static ULONG STDMETHODCALLTYPE d3d11_device_Release(ID3D11Device *iface) { - FIXME("iface %p stub!\n", iface); + struct d3d_device *device = impl_from_ID3D11Device(iface); + return IUnknown_Release(device->outer_unk); } -static HRESULT STDMETHODCALLTYPE d3d10_device_CreateBuffer(ID3D10Device1 *iface, - const D3D10_BUFFER_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, ID3D10Buffer **buffer) +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateBuffer(ID3D11Device *iface, const D3D11_BUFFER_DESC *desc, + const D3D11_SUBRESOURCE_DATA *data, ID3D11Buffer **buffer) { - struct d3d_device *This = impl_from_ID3D10Device(iface); - struct d3d10_buffer *object; + struct d3d_device *device = impl_from_ID3D11Device(iface); + struct d3d_buffer *object; HRESULT hr; TRACE("iface %p, desc %p, data %p, buffer %p.\n", iface, desc, data, buffer); - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); - if (!object) - return E_OUTOFMEMORY; - - hr = d3d10_buffer_init(object, This, desc, data); - if (FAILED(hr)) - { - WARN("Failed to initialize buffer, hr %#x.\n", hr); - HeapFree(GetProcessHeap(), 0, object); + if (FAILED(hr = d3d_buffer_create(device, desc, data, &object))) return hr; - } - - *buffer = &object->ID3D10Buffer_iface; - TRACE("Created ID3D10Buffer %p\n", object); + *buffer = &object->ID3D11Buffer_iface; return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture1D(ID3D10Device1 *iface, - const D3D10_TEXTURE1D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, ID3D10Texture1D **texture) +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture1D(ID3D11Device *iface, + const D3D11_TEXTURE1D_DESC *desc, const D3D11_SUBRESOURCE_DATA *data, ID3D11Texture1D **texture) { FIXME("iface %p, desc %p, data %p, texture %p stub!\n", iface, desc, data, texture); return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture2D(ID3D10Device1 *iface, - const D3D10_TEXTURE2D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, - ID3D10Texture2D **texture) +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture2D(ID3D11Device *iface, + const D3D11_TEXTURE2D_DESC *desc, const D3D11_SUBRESOURCE_DATA *data, ID3D11Texture2D **texture) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - struct d3d10_texture2d *object; + struct d3d_device *device = impl_from_ID3D11Device(iface); + struct d3d_texture2d *object; HRESULT hr; TRACE("iface %p, desc %p, data %p, texture %p.\n", iface, desc, data, texture); - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); - if (!object) - return E_OUTOFMEMORY; - - if (FAILED(hr = d3d10_texture2d_init(object, device, desc, data))) - { - WARN("Failed to initialize texture, hr %#x.\n", hr); - HeapFree(GetProcessHeap(), 0, object); + if (FAILED(hr = d3d_texture2d_create(device, desc, data, &object))) return hr; - } - - *texture = &object->ID3D10Texture2D_iface; - TRACE("Created ID3D10Texture2D %p\n", object); + *texture = &object->ID3D11Texture2D_iface; return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture3D(ID3D10Device1 *iface, - const D3D10_TEXTURE3D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, - ID3D10Texture3D **texture) +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture3D(ID3D11Device *iface, + const D3D11_TEXTURE3D_DESC *desc, const D3D11_SUBRESOURCE_DATA *data, ID3D11Texture3D **texture) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - struct d3d10_texture3d *object; + struct d3d_device *device = impl_from_ID3D11Device(iface); + struct d3d_texture3d *object; HRESULT hr; TRACE("iface %p, desc %p, data %p, texture %p.\n", iface, desc, data, texture); - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); - if (!object) - return E_OUTOFMEMORY; - - if (FAILED(hr = d3d10_texture3d_init(object, device, desc, data))) - { - WARN("Failed to initialize texture, hr %#x.\n", hr); - HeapFree(GetProcessHeap(), 0, object); + if (FAILED(hr = d3d_texture3d_create(device, desc, data, &object))) return hr; - } - TRACE("Created 3D texture %p.\n", object); - *texture = &object->ID3D10Texture3D_iface; + *texture = &object->ID3D11Texture3D_iface; return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d10_device_CreateShaderResourceView(ID3D10Device1 *iface, - ID3D10Resource *resource, const D3D10_SHADER_RESOURCE_VIEW_DESC *desc, ID3D10ShaderResourceView **view) +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateShaderResourceView(ID3D11Device *iface, + ID3D11Resource *resource, const D3D11_SHADER_RESOURCE_VIEW_DESC *desc, ID3D11ShaderResourceView **view) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - struct d3d10_shader_resource_view *object; + struct d3d_device *device = impl_from_ID3D11Device(iface); + struct d3d_shader_resource_view *object; HRESULT hr; TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view); - if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) - return E_OUTOFMEMORY; - - if (FAILED(hr = d3d10_shader_resource_view_init(object, device, resource, desc))) - { - WARN("Failed to initialize shader resource view, hr %#x.\n", hr); - HeapFree(GetProcessHeap(), 0, object); + if (FAILED(hr = d3d_shader_resource_view_create(device, resource, desc, &object))) return hr; - } - TRACE("Created shader resource view %p.\n", object); - *view = &object->ID3D10ShaderResourceView_iface; + *view = &object->ID3D11ShaderResourceView_iface; return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d10_device_CreateRenderTargetView(ID3D10Device1 *iface, - ID3D10Resource *resource, const D3D10_RENDER_TARGET_VIEW_DESC *desc, ID3D10RenderTargetView **view) +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateUnorderedAccessView(ID3D11Device *iface, + ID3D11Resource *resource, const D3D11_UNORDERED_ACCESS_VIEW_DESC *desc, ID3D11UnorderedAccessView **view) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - struct d3d10_rendertarget_view *object; + FIXME("iface %p, resource %p, desc %p, view %p stub!\n", iface, resource, desc, view); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateRenderTargetView(ID3D11Device *iface, + ID3D11Resource *resource, const D3D11_RENDER_TARGET_VIEW_DESC *desc, ID3D11RenderTargetView **view) +{ + struct d3d_device *device = impl_from_ID3D11Device(iface); + struct d3d_rendertarget_view *object; HRESULT hr; TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view); - if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) - return E_OUTOFMEMORY; - - if (FAILED(hr = d3d10_rendertarget_view_init(object, device, resource, desc))) - { - WARN("Failed to initialize rendertarget view, hr %#x.\n", hr); - HeapFree(GetProcessHeap(), 0, object); + if (FAILED(hr = d3d_rendertarget_view_create(device, resource, desc, &object))) return hr; - } - TRACE("Created rendertarget view %p.\n", object); - *view = &object->ID3D10RenderTargetView_iface; + *view = &object->ID3D11RenderTargetView_iface; return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d10_device_CreateDepthStencilView(ID3D10Device1 *iface, - ID3D10Resource *resource, const D3D10_DEPTH_STENCIL_VIEW_DESC *desc, ID3D10DepthStencilView **view) +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDepthStencilView(ID3D11Device *iface, + ID3D11Resource *resource, const D3D11_DEPTH_STENCIL_VIEW_DESC *desc, ID3D11DepthStencilView **view) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - struct d3d10_depthstencil_view *object; + struct d3d_device *device = impl_from_ID3D11Device(iface); + struct d3d_depthstencil_view *object; HRESULT hr; TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view); - if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) - return E_OUTOFMEMORY; - - if (FAILED(hr = d3d10_depthstencil_view_init(object, device, resource, desc))) - { - WARN("Failed to initialize depthstencil view, hr %#x.\n", hr); - HeapFree(GetProcessHeap(), 0, object); + if (FAILED(hr = d3d_depthstencil_view_create(device, resource, desc, &object))) return hr; - } - TRACE("Created depthstencil view %p.\n", object); - *view = &object->ID3D10DepthStencilView_iface; + *view = &object->ID3D11DepthStencilView_iface; return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d10_device_CreateInputLayout(ID3D10Device1 *iface, - const D3D10_INPUT_ELEMENT_DESC *element_descs, UINT element_count, - const void *shader_byte_code, SIZE_T shader_byte_code_length, - ID3D10InputLayout **input_layout) +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateInputLayout(ID3D11Device *iface, + const D3D11_INPUT_ELEMENT_DESC *element_descs, UINT element_count, const void *shader_byte_code, + SIZE_T shader_byte_code_length, ID3D11InputLayout **input_layout) { - struct d3d_device *This = impl_from_ID3D10Device(iface); - struct d3d10_input_layout *object; + struct d3d_device *device = impl_from_ID3D11Device(iface); + struct d3d_input_layout *object; HRESULT hr; - TRACE("iface %p, element_descs %p, element_count %u, shader_byte_code %p, " - "shader_byte_code_length %lu, input_layout %p\n", - iface, element_descs, element_count, shader_byte_code, + TRACE("iface %p, element_descs %p, element_count %u, shader_byte_code %p, shader_byte_code_length %lu, " + "input_layout %p.\n", iface, element_descs, element_count, shader_byte_code, shader_byte_code_length, input_layout); - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); - if (!object) - return E_OUTOFMEMORY; - - hr = d3d10_input_layout_init(object, This, element_descs, element_count, - shader_byte_code, shader_byte_code_length); - if (FAILED(hr)) - { - WARN("Failed to initialize input layout, hr %#x.\n", hr); - HeapFree(GetProcessHeap(), 0, object); + if (FAILED(hr = d3d_input_layout_create(device, element_descs, element_count, + shader_byte_code, shader_byte_code_length, &object))) return hr; - } - TRACE("Created input layout %p.\n", object); - *input_layout = &object->ID3D10InputLayout_iface; + *input_layout = &object->ID3D11InputLayout_iface; return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d10_device_CreateVertexShader(ID3D10Device1 *iface, - const void *byte_code, SIZE_T byte_code_length, ID3D10VertexShader **shader) +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateVertexShader(ID3D11Device *iface, const void *byte_code, + SIZE_T byte_code_length, ID3D11ClassLinkage *class_linkage, ID3D11VertexShader **shader) { - struct d3d_device *This = impl_from_ID3D10Device(iface); - struct d3d10_vertex_shader *object; + struct d3d_device *device = impl_from_ID3D11Device(iface); + struct d3d_vertex_shader *object; HRESULT hr; - TRACE("iface %p, byte_code %p, byte_code_length %lu, shader %p\n", - iface, byte_code, byte_code_length, shader); + 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); - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); - if (!object) - return E_OUTOFMEMORY; + if (class_linkage) + FIXME("Class linkage is not implemented yet.\n"); - hr = d3d10_vertex_shader_init(object, This, byte_code, byte_code_length); - if (FAILED(hr)) - { - WARN("Failed to initialize vertex shader, hr %#x.\n", hr); - HeapFree(GetProcessHeap(), 0, object); + if (FAILED(hr = d3d_vertex_shader_create(device, byte_code, byte_code_length, &object))) return hr; - } - TRACE("Created vertex shader %p.\n", object); - *shader = &object->ID3D10VertexShader_iface; + *shader = &object->ID3D11VertexShader_iface; return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d10_device_CreateGeometryShader(ID3D10Device1 *iface, - const void *byte_code, SIZE_T byte_code_length, ID3D10GeometryShader **shader) +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateGeometryShader(ID3D11Device *iface, const void *byte_code, + SIZE_T byte_code_length, ID3D11ClassLinkage *class_linkage, ID3D11GeometryShader **shader) { - struct d3d_device *This = impl_from_ID3D10Device(iface); - struct d3d10_geometry_shader *object; + struct d3d_device *device = impl_from_ID3D11Device(iface); + struct d3d_geometry_shader *object; HRESULT hr; - TRACE("iface %p, byte_code %p, byte_code_length %lu, shader %p.\n", - iface, byte_code, byte_code_length, shader); + 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); - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); - if (!object) - return E_OUTOFMEMORY; + if (class_linkage) + FIXME("Class linkage is not implemented yet.\n"); - hr = d3d10_geometry_shader_init(object, This, byte_code, byte_code_length); - if (FAILED(hr)) - { - WARN("Failed to initialize geometry shader, hr %#x.\n", hr); - HeapFree(GetProcessHeap(), 0, object); + if (FAILED(hr = d3d_geometry_shader_create(device, byte_code, byte_code_length, &object))) return hr; - } - TRACE("Created geometry shader %p.\n", object); - *shader = &object->ID3D10GeometryShader_iface; + *shader = &object->ID3D11GeometryShader_iface; return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d10_device_CreateGeometryShaderWithStreamOutput(ID3D10Device1 *iface, - const void *byte_code, SIZE_T byte_code_length, const D3D10_SO_DECLARATION_ENTRY *output_stream_decls, - UINT output_stream_decl_count, UINT output_stream_stride, ID3D10GeometryShader **shader) +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateGeometryShaderWithStreamOutput(ID3D11Device *iface, + const void *byte_code, SIZE_T byte_code_length, const D3D11_SO_DECLARATION_ENTRY *so_entries, + UINT entry_count, const UINT *buffer_strides, UINT strides_count, UINT rasterized_stream, + ID3D11ClassLinkage *class_linkage, ID3D11GeometryShader **shader) { - FIXME("iface %p, byte_code %p, byte_code_length %lu, output_stream_decls %p, " - "output_stream_decl_count %u, output_stream_stride %u, shader %p stub!\n", - iface, byte_code, byte_code_length, output_stream_decls, - output_stream_decl_count, output_stream_stride, shader); + FIXME("iface %p, byte_code %p, byte_code_length %lu, so_entries %p, entry_count %u, " + "buffer_strides %p, strides_count %u, rasterized_stream %u, class_linkage %p, shader %p stub!\n", + iface, byte_code, byte_code_length, so_entries, entry_count, buffer_strides, strides_count, + rasterized_stream, class_linkage, shader); return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE d3d10_device_CreatePixelShader(ID3D10Device1 *iface, - const void *byte_code, SIZE_T byte_code_length, ID3D10PixelShader **shader) +static HRESULT STDMETHODCALLTYPE d3d11_device_CreatePixelShader(ID3D11Device *iface, const void *byte_code, + SIZE_T byte_code_length, ID3D11ClassLinkage *class_linkage, ID3D11PixelShader **shader) { - struct d3d_device *This = impl_from_ID3D10Device(iface); - struct d3d10_pixel_shader *object; + struct d3d_device *device = impl_from_ID3D11Device(iface); + struct d3d_pixel_shader *object; HRESULT hr; - TRACE("iface %p, byte_code %p, byte_code_length %lu, shader %p\n", - iface, byte_code, byte_code_length, shader); + 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); - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); - if (!object) - return E_OUTOFMEMORY; + if (class_linkage) + FIXME("Class linkage is not implemented yet.\n"); - hr = d3d10_pixel_shader_init(object, This, byte_code, byte_code_length); - if (FAILED(hr)) - { - WARN("Failed to initialize pixel shader, hr %#x.\n", hr); - HeapFree(GetProcessHeap(), 0, object); + if (FAILED(hr = d3d_pixel_shader_create(device, byte_code, byte_code_length, &object))) return hr; - } - TRACE("Created pixel shader %p.\n", object); - *shader = &object->ID3D10PixelShader_iface; + *shader = &object->ID3D11PixelShader_iface; return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d10_device_CreateBlendState(ID3D10Device1 *iface, - const D3D10_BLEND_DESC *desc, ID3D10BlendState **blend_state) +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateHullShader(ID3D11Device *iface, const void *byte_code, + SIZE_T byte_code_length, ID3D11ClassLinkage *class_linkage, ID3D11HullShader **shader) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - struct d3d10_blend_state *object; + FIXME("iface %p, byte_code %p, byte_code_length %lu, class_linkage %p, shader %p stub!\n", + iface, byte_code, byte_code_length, class_linkage, shader); + + return E_NOTIMPL; +} + +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", + iface, byte_code, byte_code_length, class_linkage, shader); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateComputeShader(ID3D11Device *iface, const void *byte_code, + SIZE_T byte_code_length, ID3D11ClassLinkage *class_linkage, ID3D11ComputeShader **shader) +{ + FIXME("iface %p, byte_code %p, byte_code_lenghth %lu, class_linkage %p, shader %p stub!\n", + iface, byte_code, byte_code_length, class_linkage, shader); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateClassLinkage(ID3D11Device *iface, + ID3D11ClassLinkage **class_linkage) +{ + FIXME("iface %p, class_linkage %p stub!\n", iface, class_linkage); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateBlendState(ID3D11Device *iface, + const D3D11_BLEND_DESC *desc, ID3D11BlendState **blend_state) +{ + struct d3d_device *device = impl_from_ID3D11Device(iface); + struct d3d_blend_state *object; struct wine_rb_entry *entry; + D3D11_BLEND_DESC tmp_desc; + unsigned int i, j; HRESULT hr; TRACE("iface %p, desc %p, blend_state %p.\n", iface, desc, blend_state); @@ -1868,25 +2102,42 @@ if (!desc) return E_INVALIDARG; + /* D3D11_RENDER_TARGET_BLEND_DESC has a hole, which is a problem because we use + * D3D11_BLEND_DESC as a key in the rbtree. */ + memset(&tmp_desc, 0, sizeof(tmp_desc)); + tmp_desc.AlphaToCoverageEnable = desc->AlphaToCoverageEnable; + tmp_desc.IndependentBlendEnable = desc->IndependentBlendEnable; + for (i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i) + { + j = desc->IndependentBlendEnable ? i : 0; + tmp_desc.RenderTarget[i].BlendEnable = desc->RenderTarget[j].BlendEnable; + tmp_desc.RenderTarget[i].SrcBlend = desc->RenderTarget[j].SrcBlend; + tmp_desc.RenderTarget[i].DestBlend = desc->RenderTarget[j].DestBlend; + tmp_desc.RenderTarget[i].BlendOp = desc->RenderTarget[j].BlendOp; + tmp_desc.RenderTarget[i].SrcBlendAlpha = desc->RenderTarget[j].SrcBlendAlpha; + tmp_desc.RenderTarget[i].DestBlendAlpha = desc->RenderTarget[j].DestBlendAlpha; + tmp_desc.RenderTarget[i].BlendOpAlpha = desc->RenderTarget[j].BlendOpAlpha; + tmp_desc.RenderTarget[i].RenderTargetWriteMask = desc->RenderTarget[j].RenderTargetWriteMask; + } + wined3d_mutex_lock(); - if ((entry = wine_rb_get(&device->blend_states, desc))) + if ((entry = wine_rb_get(&device->blend_states, &tmp_desc))) { - object = WINE_RB_ENTRY_VALUE(entry, struct d3d10_blend_state, entry); + object = WINE_RB_ENTRY_VALUE(entry, struct d3d_blend_state, entry); TRACE("Returning existing blend state %p.\n", object); - *blend_state = &object->ID3D10BlendState_iface; - ID3D10BlendState_AddRef(*blend_state); + *blend_state = &object->ID3D11BlendState_iface; + ID3D11BlendState_AddRef(*blend_state); wined3d_mutex_unlock(); return S_OK; } wined3d_mutex_unlock(); - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); - if (!object) + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) return E_OUTOFMEMORY; - if (FAILED(hr = d3d10_blend_state_init(object, device, desc))) + if (FAILED(hr = d3d_blend_state_init(object, device, &tmp_desc))) { WARN("Failed to initialize blend state, hr %#x.\n", hr); HeapFree(GetProcessHeap(), 0, object); @@ -1894,17 +2145,17 @@ } TRACE("Created blend state %p.\n", object); - *blend_state = &object->ID3D10BlendState_iface; + *blend_state = &object->ID3D11BlendState_iface; return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d10_device_CreateDepthStencilState(ID3D10Device1 *iface, - const D3D10_DEPTH_STENCIL_DESC *desc, ID3D10DepthStencilState **depth_stencil_state) +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDepthStencilState(ID3D11Device *iface, + const D3D11_DEPTH_STENCIL_DESC *desc, ID3D11DepthStencilState **depth_stencil_state) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - struct d3d10_depthstencil_state *object; - D3D10_DEPTH_STENCIL_DESC tmp_desc; + struct d3d_device *device = impl_from_ID3D11Device(iface); + struct d3d_depthstencil_state *object; + D3D11_DEPTH_STENCIL_DESC tmp_desc; struct wine_rb_entry *entry; HRESULT hr; @@ -1913,7 +2164,7 @@ if (!desc) return E_INVALIDARG; - /* D3D10_DEPTH_STENCIL_DESC has a hole, which is a problem because we use + /* D3D11_DEPTH_STENCIL_DESC has a hole, which is a problem because we use * it as a key in the rbtree. */ memset(&tmp_desc, 0, sizeof(tmp_desc)); tmp_desc.DepthEnable = desc->DepthEnable; @@ -1928,22 +2179,21 @@ wined3d_mutex_lock(); if ((entry = wine_rb_get(&device->depthstencil_states, &tmp_desc))) { - object = WINE_RB_ENTRY_VALUE(entry, struct d3d10_depthstencil_state, entry); + object = WINE_RB_ENTRY_VALUE(entry, struct d3d_depthstencil_state, entry); TRACE("Returning existing depthstencil state %p.\n", object); - *depth_stencil_state = &object->ID3D10DepthStencilState_iface; - ID3D10DepthStencilState_AddRef(*depth_stencil_state); + *depth_stencil_state = &object->ID3D11DepthStencilState_iface; + ID3D11DepthStencilState_AddRef(*depth_stencil_state); wined3d_mutex_unlock(); return S_OK; } wined3d_mutex_unlock(); - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); - if (!object) + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) return E_OUTOFMEMORY; - if (FAILED(hr = d3d10_depthstencil_state_init(object, device, &tmp_desc))) + if (FAILED(hr = d3d_depthstencil_state_init(object, device, &tmp_desc))) { WARN("Failed to initialize depthstencil state, hr %#x.\n", hr); HeapFree(GetProcessHeap(), 0, object); @@ -1951,16 +2201,16 @@ } TRACE("Created depthstencil state %p.\n", object); - *depth_stencil_state = &object->ID3D10DepthStencilState_iface; + *depth_stencil_state = &object->ID3D11DepthStencilState_iface; return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d10_device_CreateRasterizerState(ID3D10Device1 *iface, - const D3D10_RASTERIZER_DESC *desc, ID3D10RasterizerState **rasterizer_state) +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateRasterizerState(ID3D11Device *iface, + const D3D11_RASTERIZER_DESC *desc, ID3D11RasterizerState **rasterizer_state) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - struct d3d10_rasterizer_state *object; + struct d3d_device *device = impl_from_ID3D11Device(iface); + struct d3d_rasterizer_state *object; struct wine_rb_entry *entry; HRESULT hr; @@ -1972,22 +2222,21 @@ wined3d_mutex_lock(); if ((entry = wine_rb_get(&device->rasterizer_states, desc))) { - object = WINE_RB_ENTRY_VALUE(entry, struct d3d10_rasterizer_state, entry); + object = WINE_RB_ENTRY_VALUE(entry, struct d3d_rasterizer_state, entry); TRACE("Returning existing rasterizer state %p.\n", object); - *rasterizer_state = &object->ID3D10RasterizerState_iface; - ID3D10RasterizerState_AddRef(*rasterizer_state); + *rasterizer_state = &object->ID3D11RasterizerState_iface; + ID3D11RasterizerState_AddRef(*rasterizer_state); wined3d_mutex_unlock(); return S_OK; } wined3d_mutex_unlock(); - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); - if (!object) + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) return E_OUTOFMEMORY; - if (FAILED(hr = d3d10_rasterizer_state_init(object, device, desc))) + if (FAILED(hr = d3d_rasterizer_state_init(object, device, desc))) { WARN("Failed to initialize rasterizer state, hr %#x.\n", hr); HeapFree(GetProcessHeap(), 0, object); @@ -1995,16 +2244,17 @@ } TRACE("Created rasterizer state %p.\n", object); - *rasterizer_state = &object->ID3D10RasterizerState_iface; + *rasterizer_state = &object->ID3D11RasterizerState_iface; return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d10_device_CreateSamplerState(ID3D10Device1 *iface, - const D3D10_SAMPLER_DESC *desc, ID3D10SamplerState **sampler_state) +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateSamplerState(ID3D11Device *iface, + const D3D11_SAMPLER_DESC *desc, ID3D11SamplerState **sampler_state) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - struct d3d10_sampler_state *object; + struct d3d_device *device = impl_from_ID3D11Device(iface); + D3D11_SAMPLER_DESC normalized_desc; + struct d3d_sampler_state *object; struct wine_rb_entry *entry; HRESULT hr; @@ -2013,25 +2263,34 @@ if (!desc) return E_INVALIDARG; + normalized_desc = *desc; + if (!D3D11_DECODE_IS_ANISOTROPIC_FILTER(normalized_desc.Filter)) + normalized_desc.MaxAnisotropy = 0; + if (!D3D11_DECODE_IS_COMPARISON_FILTER(normalized_desc.Filter)) + normalized_desc.ComparisonFunc = D3D11_COMPARISON_NEVER; + if (normalized_desc.AddressU != D3D11_TEXTURE_ADDRESS_BORDER + && normalized_desc.AddressV != D3D11_TEXTURE_ADDRESS_BORDER + && normalized_desc.AddressW != D3D11_TEXTURE_ADDRESS_BORDER) + memset(&normalized_desc.BorderColor, 0, sizeof(normalized_desc.BorderColor)); + wined3d_mutex_lock(); - if ((entry = wine_rb_get(&device->sampler_states, desc))) + if ((entry = wine_rb_get(&device->sampler_states, &normalized_desc))) { - object = WINE_RB_ENTRY_VALUE(entry, struct d3d10_sampler_state, entry); + object = WINE_RB_ENTRY_VALUE(entry, struct d3d_sampler_state, entry); TRACE("Returning existing sampler state %p.\n", object); - *sampler_state = &object->ID3D10SamplerState_iface; - ID3D10SamplerState_AddRef(*sampler_state); + *sampler_state = &object->ID3D11SamplerState_iface; + ID3D11SamplerState_AddRef(*sampler_state); wined3d_mutex_unlock(); return S_OK; } wined3d_mutex_unlock(); - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); - if (!object) + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) return E_OUTOFMEMORY; - if (FAILED(hr = d3d10_sampler_state_init(object, device, desc))) + if (FAILED(hr = d3d_sampler_state_init(object, device, &normalized_desc))) { WARN("Failed to initialize sampler state, hr %#x.\n", hr); HeapFree(GetProcessHeap(), 0, object); @@ -2039,679 +2298,2294 @@ } TRACE("Created sampler state %p.\n", object); - *sampler_state = &object->ID3D10SamplerState_iface; + *sampler_state = &object->ID3D11SamplerState_iface; return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d10_device_CreateQuery(ID3D10Device1 *iface, - const D3D10_QUERY_DESC *desc, ID3D10Query **query) +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateQuery(ID3D11Device *iface, + const D3D11_QUERY_DESC *desc, ID3D11Query **query) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - struct d3d10_query *object; + struct d3d_device *device = impl_from_ID3D11Device(iface); + struct d3d_query *object; HRESULT hr; TRACE("iface %p, desc %p, query %p.\n", iface, desc, query); - if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) - return E_OUTOFMEMORY; - - if (FAILED(hr = d3d10_query_init(object, device, desc, FALSE))) - { - WARN("Failed to initialize query, hr %#x.\n", hr); - HeapFree(GetProcessHeap(), 0, object); + if (FAILED(hr = d3d_query_create(device, desc, FALSE, &object))) return hr; - } - TRACE("Created query %p.\n", object); - *query = &object->ID3D10Query_iface; + *query = &object->ID3D11Query_iface; return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d10_device_CreatePredicate(ID3D10Device1 *iface, - const D3D10_QUERY_DESC *desc, ID3D10Predicate **predicate) +static HRESULT STDMETHODCALLTYPE d3d11_device_CreatePredicate(ID3D11Device *iface, const D3D11_QUERY_DESC *desc, + ID3D11Predicate **predicate) { - struct d3d_device *device = impl_from_ID3D10Device(iface); - struct d3d10_query *object; + struct d3d_device *device = impl_from_ID3D11Device(iface); + struct d3d_query *object; HRESULT hr; TRACE("iface %p, desc %p, predicate %p.\n", iface, desc, predicate); - if (!desc) - return E_INVALIDARG; - - if (desc->Query != D3D10_QUERY_OCCLUSION_PREDICATE && desc->Query != D3D10_QUERY_SO_OVERFLOW_PREDICATE) - { - WARN("Query type %#x is not a predicate.\n", desc->Query); - return E_INVALIDARG; - } - - if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) - return E_OUTOFMEMORY; - - if (FAILED(hr = d3d10_query_init(object, device, desc, TRUE))) - { - WARN("Failed to initialize predicate, hr %#x.\n", hr); - HeapFree(GetProcessHeap(), 0, object); + if (FAILED(hr = d3d_query_create(device, desc, TRUE, &object))) return hr; - } - TRACE("Created predicate %p.\n", object); - *predicate = (ID3D10Predicate *)&object->ID3D10Query_iface; + *predicate = (ID3D11Predicate *)&object->ID3D11Query_iface; return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d10_device_CreateCounter(ID3D10Device1 *iface, - const D3D10_COUNTER_DESC *desc, ID3D10Counter **counter) +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateCounter(ID3D11Device *iface, const D3D11_COUNTER_DESC *desc, + ID3D11Counter **counter) { FIXME("iface %p, desc %p, counter %p stub!\n", iface, desc, counter); return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE d3d10_device_CheckFormatSupport(ID3D10Device1 *iface, - DXGI_FORMAT format, UINT *format_support) +static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext(ID3D11Device *iface, UINT flags, + ID3D11DeviceContext **context) { - FIXME("iface %p, format %s, format_support %p stub!\n", - iface, debug_dxgi_format(format), format_support); + FIXME("iface %p, flags %#x, context %p stub!\n", iface, flags, context); return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE d3d10_device_CheckMultisampleQualityLevels(ID3D10Device1 *iface, - DXGI_FORMAT format, UINT sample_count, UINT *quality_level_count) +static HRESULT STDMETHODCALLTYPE d3d11_device_OpenSharedResource(ID3D11Device *iface, HANDLE resource, REFIID riid, + void **out) { - FIXME("iface %p, format %s, sample_count %u, quality_level_count %p stub!\n", - iface, debug_dxgi_format(format), sample_count, quality_level_count); + FIXME("iface %p, resource %p, riid %s, out %p stub!\n", iface, resource, debugstr_guid(riid), out); return E_NOTIMPL; } -static void STDMETHODCALLTYPE d3d10_device_CheckCounterInfo(ID3D10Device1 *iface, D3D10_COUNTER_INFO *counter_info) +static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device *iface, DXGI_FORMAT format, + UINT *format_support) { - FIXME("iface %p, counter_info %p stub!\n", iface, counter_info); + FIXME("iface %p, format %u, format_support %p stub!\n", iface, format, format_support); + + return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE d3d10_device_CheckCounter(ID3D10Device1 *iface, - const D3D10_COUNTER_DESC *desc, D3D10_COUNTER_TYPE *type, UINT *active_counters, char *name, - UINT *name_length, char *units, UINT *units_length, char *description, UINT *description_length) +static HRESULT STDMETHODCALLTYPE d3d11_device_CheckMultisampleQualityLevels(ID3D11Device *iface, + DXGI_FORMAT format, UINT sample_count, UINT *quality_level_count) { - FIXME("iface %p, desc %p, type %p, active_counters %p, name %p, name_length %p, " - "units %p, units_length %p, description %p, description_length %p stub!\n", - iface, desc, type, active_counters, name, name_length, - units, units_length, description, description_length); + FIXME("iface %p, format %u, sample_count %u, quality_level_count %p stub!\n", + iface, format, sample_count, quality_level_count); return E_NOTIMPL; } -static UINT STDMETHODCALLTYPE d3d10_device_GetCreationFlags(ID3D10Device1 *iface) +static void STDMETHODCALLTYPE d3d11_device_CheckCounterInfo(ID3D11Device *iface, D3D11_COUNTER_INFO *info) { - FIXME("iface %p stub!\n", iface); - - return 0; + FIXME("iface %p, info %p stub!\n", iface, info); } -static HRESULT STDMETHODCALLTYPE d3d10_device_OpenSharedResource(ID3D10Device1 *iface, - HANDLE resource_handle, REFIID guid, void **resource) +static HRESULT STDMETHODCALLTYPE d3d11_device_CheckCounter(ID3D11Device *iface, const D3D11_COUNTER_DESC *desc, + D3D11_COUNTER_TYPE *type, UINT *active_counter_count, char *name, UINT *name_length, + char *units, UINT *units_length, char *description, UINT *description_length) { - FIXME("iface %p, resource_handle %p, guid %s, resource %p stub!\n", - iface, resource_handle, debugstr_guid(guid), resource); + FIXME("iface %p, desc %p, type %p, active_counter_count %p, name %p, name_length %p, " + "units %p, units_length %p, description %p, description_length %p stub!\n", + iface, desc, type, active_counter_count, name, name_length, + units, units_length, description, description_length); return E_NOTIMPL; } -static void STDMETHODCALLTYPE d3d10_device_SetTextFilterSize(ID3D10Device1 *iface, UINT width, UINT height) +static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFeatureSupport(ID3D11Device *iface, D3D11_FEATURE feature, + void *feature_support_data, UINT feature_support_data_size) { - FIXME("iface %p, width %u, height %u stub!\n", iface, width, height); + FIXME("iface %p, feature %u, feature_support_data %p, feature_support_data_size %u stub!\n", + iface, feature, feature_support_data, feature_support_data_size); + + return E_NOTIMPL; } -static void STDMETHODCALLTYPE d3d10_device_GetTextFilterSize(ID3D10Device1 *iface, UINT *width, UINT *height) +static HRESULT STDMETHODCALLTYPE d3d11_device_GetPrivateData(ID3D11Device *iface, REFGUID guid, + UINT *data_size, void *data) { - FIXME("iface %p, width %p, height %p stub!\n", iface, width, height); + IDXGIDevice *dxgi_device; + HRESULT hr; + + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + if (FAILED(hr = ID3D11Device_QueryInterface(iface, &IID_IDXGIDevice, (void **)&dxgi_device))) + return hr; + hr = IDXGIDevice_GetPrivateData(dxgi_device, guid, data_size, data); + IDXGIDevice_Release(dxgi_device); + + return hr; } -static HRESULT STDMETHODCALLTYPE d3d10_device_CreateShaderResourceView1(ID3D10Device1 *iface, - ID3D10Resource *resource, const D3D10_SHADER_RESOURCE_VIEW_DESC1 *desc, ID3D10ShaderResourceView1 **view) +static HRESULT STDMETHODCALLTYPE d3d11_device_SetPrivateData(ID3D11Device *iface, REFGUID guid, + UINT data_size, const void *data) { - FIXME("iface %p, resource %p, desc %p, view %p stub!\n", iface, resource, desc, view); + IDXGIDevice *dxgi_device; + HRESULT hr; - return E_NOTIMPL; + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + if (FAILED(hr = ID3D11Device_QueryInterface(iface, &IID_IDXGIDevice, (void **)&dxgi_device))) + return hr; + hr = IDXGIDevice_SetPrivateData(dxgi_device, guid, data_size, data); + IDXGIDevice_Release(dxgi_device); + + return hr; } -static HRESULT STDMETHODCALLTYPE d3d10_device_CreateBlendState1(ID3D10Device1 *iface, - const D3D10_BLEND_DESC1 *desc, ID3D10BlendState1 **blend_state) +static HRESULT STDMETHODCALLTYPE d3d11_device_SetPrivateDataInterface(ID3D11Device *iface, REFGUID guid, + const IUnknown *data) { - FIXME("iface %p, desc %p, blend_state %p stub!\n", iface, desc, blend_state); + IDXGIDevice *dxgi_device; + HRESULT hr; - return E_NOTIMPL; + TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); + + if (FAILED(hr = ID3D11Device_QueryInterface(iface, &IID_IDXGIDevice, (void **)&dxgi_device))) + return hr; + hr = IDXGIDevice_SetPrivateDataInterface(dxgi_device, guid, data); + IDXGIDevice_Release(dxgi_device); + + return hr; } -static D3D10_FEATURE_LEVEL1 STDMETHODCALLTYPE d3d10_device_GetFeatureLevel(ID3D10Device1 *iface) +static D3D_FEATURE_LEVEL STDMETHODCALLTYPE d3d11_device_GetFeatureLevel(ID3D11Device *iface) { FIXME("iface %p stub!\n", iface); - return D3D10_FEATURE_LEVEL_10_1; + return D3D_FEATURE_LEVEL_10_0; } -static const struct ID3D10Device1Vtbl d3d10_device1_vtbl = -{ - /* IUnknown methods */ - d3d10_device_QueryInterface, - d3d10_device_AddRef, - d3d10_device_Release, - /* ID3D10Device methods */ - d3d10_device_VSSetConstantBuffers, - d3d10_device_PSSetShaderResources, - d3d10_device_PSSetShader, - d3d10_device_PSSetSamplers, - d3d10_device_VSSetShader, - d3d10_device_DrawIndexed, - d3d10_device_Draw, - d3d10_device_PSSetConstantBuffers, - d3d10_device_IASetInputLayout, - d3d10_device_IASetVertexBuffers, - d3d10_device_IASetIndexBuffer, - d3d10_device_DrawIndexedInstanced, - d3d10_device_DrawInstanced, - d3d10_device_GSSetConstantBuffers, - d3d10_device_GSSetShader, - d3d10_device_IASetPrimitiveTopology, - d3d10_device_VSSetShaderResources, - d3d10_device_VSSetSamplers, - d3d10_device_SetPredication, - d3d10_device_GSSetShaderResources, - d3d10_device_GSSetSamplers, - d3d10_device_OMSetRenderTargets, - d3d10_device_OMSetBlendState, - d3d10_device_OMSetDepthStencilState, - d3d10_device_SOSetTargets, - d3d10_device_DrawAuto, - d3d10_device_RSSetState, - d3d10_device_RSSetViewports, - d3d10_device_RSSetScissorRects, - d3d10_device_CopySubresourceRegion, - d3d10_device_CopyResource, - d3d10_device_UpdateSubresource, - d3d10_device_ClearRenderTargetView, - d3d10_device_ClearDepthStencilView, - d3d10_device_GenerateMips, - d3d10_device_ResolveSubresource, - d3d10_device_VSGetConstantBuffers, - d3d10_device_PSGetShaderResources, - d3d10_device_PSGetShader, - d3d10_device_PSGetSamplers, - d3d10_device_VSGetShader, - d3d10_device_PSGetConstantBuffers, - d3d10_device_IAGetInputLayout, - d3d10_device_IAGetVertexBuffers, - d3d10_device_IAGetIndexBuffer, - d3d10_device_GSGetConstantBuffers, - d3d10_device_GSGetShader, - d3d10_device_IAGetPrimitiveTopology, - d3d10_device_VSGetShaderResources, - d3d10_device_VSGetSamplers, - d3d10_device_GetPredication, - d3d10_device_GSGetShaderResources, - d3d10_device_GSGetSamplers, - d3d10_device_OMGetRenderTargets, - d3d10_device_OMGetBlendState, - d3d10_device_OMGetDepthStencilState, - d3d10_device_SOGetTargets, - d3d10_device_RSGetState, - d3d10_device_RSGetViewports, - d3d10_device_RSGetScissorRects, - d3d10_device_GetDeviceRemovedReason, - d3d10_device_SetExceptionMode, - d3d10_device_GetExceptionMode, - d3d10_device_GetPrivateData, - d3d10_device_SetPrivateData, - d3d10_device_SetPrivateDataInterface, - d3d10_device_ClearState, - d3d10_device_Flush, - d3d10_device_CreateBuffer, - d3d10_device_CreateTexture1D, - d3d10_device_CreateTexture2D, - d3d10_device_CreateTexture3D, - d3d10_device_CreateShaderResourceView, - d3d10_device_CreateRenderTargetView, - d3d10_device_CreateDepthStencilView, - d3d10_device_CreateInputLayout, - d3d10_device_CreateVertexShader, - d3d10_device_CreateGeometryShader, - d3d10_device_CreateGeometryShaderWithStreamOutput, - d3d10_device_CreatePixelShader, - d3d10_device_CreateBlendState, - d3d10_device_CreateDepthStencilState, - d3d10_device_CreateRasterizerState, - d3d10_device_CreateSamplerState, - d3d10_device_CreateQuery, - d3d10_device_CreatePredicate, - d3d10_device_CreateCounter, - d3d10_device_CheckFormatSupport, - d3d10_device_CheckMultisampleQualityLevels, - d3d10_device_CheckCounterInfo, - d3d10_device_CheckCounter, - d3d10_device_GetCreationFlags, - d3d10_device_OpenSharedResource, - d3d10_device_SetTextFilterSize, - d3d10_device_GetTextFilterSize, - d3d10_device_CreateShaderResourceView1, - d3d10_device_CreateBlendState1, - d3d10_device_GetFeatureLevel, -}; - -static const struct IUnknownVtbl d3d10_device_inner_unknown_vtbl = +static UINT STDMETHODCALLTYPE d3d11_device_GetCreationFlags(ID3D11Device *iface) { - /* IUnknown methods */ - d3d10_device_inner_QueryInterface, - d3d10_device_inner_AddRef, - d3d10_device_inner_Release, -}; + FIXME("iface %p stub!\n", iface); -/* ID3D11Device methods */ + return 0; +} -static inline struct d3d_device *impl_from_ID3D11Device(ID3D11Device *iface) +static HRESULT STDMETHODCALLTYPE d3d11_device_GetDeviceRemovedReason(ID3D11Device *iface) { - return CONTAINING_RECORD(iface, struct d3d_device, ID3D11Device_iface); + FIXME("iface %p stub!\n", iface); + + return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d11_device_QueryInterface(ID3D11Device *iface, REFIID riid, void **out) +static void STDMETHODCALLTYPE d3d11_device_GetImmediateContext(ID3D11Device *iface, + ID3D11DeviceContext **immediate_context) { struct d3d_device *device = impl_from_ID3D11Device(iface); - return IUnknown_QueryInterface(device->outer_unk, riid, out); + + TRACE("iface %p, immediate_context %p.\n", iface, immediate_context); + + *immediate_context = &device->immediate_context.ID3D11DeviceContext_iface; + ID3D11DeviceContext_AddRef(*immediate_context); } -static ULONG STDMETHODCALLTYPE d3d11_device_AddRef(ID3D11Device *iface) +static HRESULT STDMETHODCALLTYPE d3d11_device_SetExceptionMode(ID3D11Device *iface, UINT flags) { - struct d3d_device *device = impl_from_ID3D11Device(iface); - return IUnknown_AddRef(device->outer_unk); + FIXME("iface %p, flags %#x stub!\n", iface, flags); + + return E_NOTIMPL; } -static ULONG STDMETHODCALLTYPE d3d11_device_Release(ID3D11Device *iface) +static UINT STDMETHODCALLTYPE d3d11_device_GetExceptionMode(ID3D11Device *iface) { - struct d3d_device *device = impl_from_ID3D11Device(iface); - return IUnknown_Release(device->outer_unk); + FIXME("iface %p stub!\n", iface); + + return 0; } -static HRESULT STDMETHODCALLTYPE d3d11_device_CreateBuffer(ID3D11Device *iface, const D3D11_BUFFER_DESC *desc, - const D3D11_SUBRESOURCE_DATA *data, ID3D11Buffer **buffer) +static const struct ID3D11DeviceVtbl d3d11_device_vtbl = { - FIXME("iface %p, desc %p, data %p, buffer %p stub!\n", iface, desc, data, buffer); + /* IUnknown methods */ + d3d11_device_QueryInterface, + d3d11_device_AddRef, + d3d11_device_Release, + /* ID3D11Device methods */ + d3d11_device_CreateBuffer, + d3d11_device_CreateTexture1D, + d3d11_device_CreateTexture2D, + d3d11_device_CreateTexture3D, + d3d11_device_CreateShaderResourceView, + d3d11_device_CreateUnorderedAccessView, + d3d11_device_CreateRenderTargetView, + d3d11_device_CreateDepthStencilView, + d3d11_device_CreateInputLayout, + d3d11_device_CreateVertexShader, + d3d11_device_CreateGeometryShader, + d3d11_device_CreateGeometryShaderWithStreamOutput, + d3d11_device_CreatePixelShader, + d3d11_device_CreateHullShader, + d3d11_device_CreateDomainShader, + d3d11_device_CreateComputeShader, + d3d11_device_CreateClassLinkage, + d3d11_device_CreateBlendState, + d3d11_device_CreateDepthStencilState, + d3d11_device_CreateRasterizerState, + d3d11_device_CreateSamplerState, + d3d11_device_CreateQuery, + d3d11_device_CreatePredicate, + d3d11_device_CreateCounter, + d3d11_device_CreateDeferredContext, + d3d11_device_OpenSharedResource, + d3d11_device_CheckFormatSupport, + d3d11_device_CheckMultisampleQualityLevels, + d3d11_device_CheckCounterInfo, + d3d11_device_CheckCounter, + d3d11_device_CheckFeatureSupport, + d3d11_device_GetPrivateData, + d3d11_device_SetPrivateData, + d3d11_device_SetPrivateDataInterface, + d3d11_device_GetFeatureLevel, + d3d11_device_GetCreationFlags, + d3d11_device_GetDeviceRemovedReason, + d3d11_device_GetImmediateContext, + d3d11_device_SetExceptionMode, + d3d11_device_GetExceptionMode, +}; + +/* Inner IUnknown methods */ + +static inline struct d3d_device *impl_from_IUnknown(IUnknown *iface) +{ + return CONTAINING_RECORD(iface, struct d3d_device, IUnknown_inner); +} + +static HRESULT STDMETHODCALLTYPE d3d_device_inner_QueryInterface(IUnknown *iface, REFIID riid, void **out) +{ + struct d3d_device *device = impl_from_IUnknown(iface); + + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + if (IsEqualGUID(riid, &IID_ID3D11Device) + || IsEqualGUID(riid, &IID_IUnknown)) + { + *out = &device->ID3D11Device_iface; + } + else if (IsEqualGUID(riid, &IID_ID3D10Device1) + || IsEqualGUID(riid, &IID_ID3D10Device)) + { + *out = &device->ID3D10Device1_iface; + } + else if (IsEqualGUID(riid, &IID_ID3D10Multithread)) + { + *out = &device->ID3D10Multithread_iface; + } + else if (IsEqualGUID(riid, &IID_IWineDXGIDeviceParent)) + { + *out = &device->IWineDXGIDeviceParent_iface; + } + else + { + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + *out = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown *)*out); + return S_OK; +} + +static ULONG STDMETHODCALLTYPE d3d_device_inner_AddRef(IUnknown *iface) +{ + struct d3d_device *device = impl_from_IUnknown(iface); + ULONG refcount = InterlockedIncrement(&device->refcount); + + TRACE("%p increasing refcount to %u.\n", device, refcount); + + return refcount; +} + +static ULONG STDMETHODCALLTYPE d3d_device_inner_Release(IUnknown *iface) +{ + struct d3d_device *device = impl_from_IUnknown(iface); + ULONG refcount = InterlockedDecrement(&device->refcount); + + TRACE("%p decreasing refcount to %u.\n", device, refcount); + + if (!refcount) + { + if (device->wined3d_device) + { + wined3d_mutex_lock(); + wined3d_device_decref(device->wined3d_device); + wined3d_mutex_unlock(); + } + wine_rb_destroy(&device->sampler_states, NULL, NULL); + wine_rb_destroy(&device->rasterizer_states, NULL, NULL); + wine_rb_destroy(&device->depthstencil_states, NULL, NULL); + wine_rb_destroy(&device->blend_states, NULL, NULL); + } + + return refcount; +} + +/* IUnknown methods */ + +static HRESULT STDMETHODCALLTYPE d3d10_device_QueryInterface(ID3D10Device1 *iface, REFIID riid, + void **ppv) +{ + struct d3d_device *This = impl_from_ID3D10Device(iface); + return IUnknown_QueryInterface(This->outer_unk, riid, ppv); +} + +static ULONG STDMETHODCALLTYPE d3d10_device_AddRef(ID3D10Device1 *iface) +{ + struct d3d_device *This = impl_from_ID3D10Device(iface); + return IUnknown_AddRef(This->outer_unk); +} + +static ULONG STDMETHODCALLTYPE d3d10_device_Release(ID3D10Device1 *iface) +{ + struct d3d_device *This = impl_from_ID3D10Device(iface); + return IUnknown_Release(This->outer_unk); +} + +/* ID3D10Device methods */ + +static void STDMETHODCALLTYPE d3d10_device_VSSetConstantBuffers(ID3D10Device1 *iface, + UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + unsigned int i; + + TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", + iface, start_slot, buffer_count, buffers); + + wined3d_mutex_lock(); + for (i = 0; i < buffer_count; ++i) + { + struct d3d_buffer *buffer = unsafe_impl_from_ID3D10Buffer(buffers[i]); + + wined3d_device_set_vs_cb(device->wined3d_device, start_slot + i, + buffer ? buffer->wined3d_buffer : NULL); + } + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_PSSetShaderResources(ID3D10Device1 *iface, + UINT start_slot, UINT view_count, ID3D10ShaderResourceView *const *views) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + unsigned int i; + + TRACE("iface %p, start_slot %u, view_count %u, views %p.\n", + iface, start_slot, view_count, views); + + wined3d_mutex_lock(); + for (i = 0; i < view_count; ++i) + { + struct d3d_shader_resource_view *view = unsafe_impl_from_ID3D10ShaderResourceView(views[i]); + + wined3d_device_set_ps_resource_view(device->wined3d_device, start_slot + i, + view ? view->wined3d_view : NULL); + } + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_PSSetShader(ID3D10Device1 *iface, + ID3D10PixelShader *shader) +{ + struct d3d_device *This = impl_from_ID3D10Device(iface); + struct d3d_pixel_shader *ps = unsafe_impl_from_ID3D10PixelShader(shader); + + TRACE("iface %p, shader %p\n", iface, shader); + + wined3d_mutex_lock(); + wined3d_device_set_pixel_shader(This->wined3d_device, ps ? ps->wined3d_shader : NULL); + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_PSSetSamplers(ID3D10Device1 *iface, + UINT start_slot, UINT sampler_count, ID3D10SamplerState *const *samplers) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + unsigned int i; + + TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n", + iface, start_slot, sampler_count, samplers); + + wined3d_mutex_lock(); + for (i = 0; i < sampler_count; ++i) + { + struct d3d_sampler_state *sampler = unsafe_impl_from_ID3D10SamplerState(samplers[i]); + + wined3d_device_set_ps_sampler(device->wined3d_device, start_slot + i, + sampler ? sampler->wined3d_sampler : NULL); + } + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_VSSetShader(ID3D10Device1 *iface, + ID3D10VertexShader *shader) +{ + struct d3d_device *This = impl_from_ID3D10Device(iface); + struct d3d_vertex_shader *vs = unsafe_impl_from_ID3D10VertexShader(shader); + + TRACE("iface %p, shader %p\n", iface, shader); + + wined3d_mutex_lock(); + wined3d_device_set_vertex_shader(This->wined3d_device, vs ? vs->wined3d_shader : NULL); + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_DrawIndexed(ID3D10Device1 *iface, UINT index_count, + UINT start_index_location, INT base_vertex_location) +{ + struct d3d_device *This = impl_from_ID3D10Device(iface); + + TRACE("iface %p, index_count %u, start_index_location %u, base_vertex_location %d.\n", + iface, index_count, start_index_location, base_vertex_location); + + wined3d_mutex_lock(); + wined3d_device_set_base_vertex_index(This->wined3d_device, base_vertex_location); + wined3d_device_draw_indexed_primitive(This->wined3d_device, start_index_location, index_count); + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_Draw(ID3D10Device1 *iface, UINT vertex_count, + UINT start_vertex_location) +{ + struct d3d_device *This = impl_from_ID3D10Device(iface); + + TRACE("iface %p, vertex_count %u, start_vertex_location %u\n", + iface, vertex_count, start_vertex_location); + + wined3d_mutex_lock(); + wined3d_device_draw_primitive(This->wined3d_device, start_vertex_location, vertex_count); + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_PSSetConstantBuffers(ID3D10Device1 *iface, + UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + unsigned int i; + + TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", + iface, start_slot, buffer_count, buffers); + + wined3d_mutex_lock(); + for (i = 0; i < buffer_count; ++i) + { + struct d3d_buffer *buffer = unsafe_impl_from_ID3D10Buffer(buffers[i]); + + wined3d_device_set_ps_cb(device->wined3d_device, start_slot + i, + buffer ? buffer->wined3d_buffer : NULL); + } + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_IASetInputLayout(ID3D10Device1 *iface, + ID3D10InputLayout *input_layout) +{ + struct d3d_device *This = impl_from_ID3D10Device(iface); + struct d3d_input_layout *layout = unsafe_impl_from_ID3D10InputLayout(input_layout); + + TRACE("iface %p, input_layout %p\n", iface, input_layout); + + wined3d_mutex_lock(); + wined3d_device_set_vertex_declaration(This->wined3d_device, + layout ? layout->wined3d_decl : NULL); + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_IASetVertexBuffers(ID3D10Device1 *iface, UINT start_slot, + UINT buffer_count, ID3D10Buffer *const *buffers, const UINT *strides, const UINT *offsets) +{ + struct d3d_device *This = impl_from_ID3D10Device(iface); + unsigned int i; + + TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p, strides %p, offsets %p\n", + iface, start_slot, buffer_count, buffers, strides, offsets); + + wined3d_mutex_lock(); + for (i = 0; i < buffer_count; ++i) + { + struct d3d_buffer *buffer = unsafe_impl_from_ID3D10Buffer(buffers[i]); + + wined3d_device_set_stream_source(This->wined3d_device, start_slot + i, + buffer ? buffer->wined3d_buffer : NULL, offsets[i], strides[i]); + } + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_IASetIndexBuffer(ID3D10Device1 *iface, + ID3D10Buffer *buffer, DXGI_FORMAT format, UINT offset) +{ + struct d3d_device *This = impl_from_ID3D10Device(iface); + struct d3d_buffer *buffer_impl = unsafe_impl_from_ID3D10Buffer(buffer); + + TRACE("iface %p, buffer %p, format %s, offset %u.\n", + iface, buffer, debug_dxgi_format(format), offset); + + wined3d_mutex_lock(); + wined3d_device_set_index_buffer(This->wined3d_device, + buffer_impl ? buffer_impl->wined3d_buffer : NULL, + wined3dformat_from_dxgi_format(format)); + wined3d_mutex_unlock(); + if (offset) FIXME("offset %u not supported.\n", offset); +} + +static void STDMETHODCALLTYPE d3d10_device_DrawIndexedInstanced(ID3D10Device1 *iface, + UINT instance_index_count, UINT instance_count, UINT start_index_location, + INT base_vertex_location, UINT start_instance_location) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + + TRACE("iface %p, instance_index_count %u, instance_count %u, start_index_location %u, " + "base_vertex_location %d, start_instance_location %u.\n", + iface, instance_index_count, instance_count, start_index_location, + base_vertex_location, start_instance_location); + + wined3d_mutex_lock(); + wined3d_device_set_base_vertex_index(device->wined3d_device, base_vertex_location); + wined3d_device_draw_indexed_primitive_instanced(device->wined3d_device, start_index_location, + instance_index_count, start_instance_location, instance_count); + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_DrawInstanced(ID3D10Device1 *iface, + UINT instance_vertex_count, UINT instance_count, + UINT start_vertex_location, UINT start_instance_location) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + + TRACE("iface %p, instance_vertex_count %u, instance_count %u, start_vertex_location %u, " + "start_instance_location %u.\n", iface, instance_vertex_count, instance_count, + start_vertex_location, start_instance_location); + + wined3d_mutex_lock(); + wined3d_device_draw_primitive_instanced(device->wined3d_device, start_vertex_location, + instance_vertex_count, start_instance_location, instance_count); + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_GSSetConstantBuffers(ID3D10Device1 *iface, + UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + unsigned int i; + + TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", + iface, start_slot, buffer_count, buffers); + + wined3d_mutex_lock(); + for (i = 0; i < buffer_count; ++i) + { + struct d3d_buffer *buffer = unsafe_impl_from_ID3D10Buffer(buffers[i]); + + wined3d_device_set_gs_cb(device->wined3d_device, start_slot + i, + buffer ? buffer->wined3d_buffer : NULL); + } + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_GSSetShader(ID3D10Device1 *iface, ID3D10GeometryShader *shader) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_geometry_shader *gs = unsafe_impl_from_ID3D10GeometryShader(shader); + + TRACE("iface %p, shader %p.\n", iface, shader); + + wined3d_mutex_lock(); + wined3d_device_set_geometry_shader(device->wined3d_device, gs ? gs->wined3d_shader : NULL); + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_IASetPrimitiveTopology(ID3D10Device1 *iface, + D3D10_PRIMITIVE_TOPOLOGY topology) +{ + struct d3d_device *This = impl_from_ID3D10Device(iface); + + TRACE("iface %p, topology %s\n", iface, debug_d3d10_primitive_topology(topology)); + + wined3d_mutex_lock(); + wined3d_device_set_primitive_type(This->wined3d_device, (enum wined3d_primitive_type)topology); + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_VSSetShaderResources(ID3D10Device1 *iface, + UINT start_slot, UINT view_count, ID3D10ShaderResourceView *const *views) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + unsigned int i; + + TRACE("iface %p, start_slot %u, view_count %u, views %p.\n", + iface, start_slot, view_count, views); + + wined3d_mutex_lock(); + for (i = 0; i < view_count; ++i) + { + struct d3d_shader_resource_view *view = unsafe_impl_from_ID3D10ShaderResourceView(views[i]); + + wined3d_device_set_vs_resource_view(device->wined3d_device, start_slot + i, + view ? view->wined3d_view : NULL); + } + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_VSSetSamplers(ID3D10Device1 *iface, + UINT start_slot, UINT sampler_count, ID3D10SamplerState *const *samplers) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + unsigned int i; + + TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n", + iface, start_slot, sampler_count, samplers); + + wined3d_mutex_lock(); + for (i = 0; i < sampler_count; ++i) + { + struct d3d_sampler_state *sampler = unsafe_impl_from_ID3D10SamplerState(samplers[i]); + + wined3d_device_set_vs_sampler(device->wined3d_device, start_slot + i, + sampler ? sampler->wined3d_sampler : NULL); + } + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_SetPredication(ID3D10Device1 *iface, ID3D10Predicate *predicate, BOOL value) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_query *query; + + TRACE("iface %p, predicate %p, value %#x.\n", iface, predicate, value); + + query = unsafe_impl_from_ID3D10Query((ID3D10Query *)predicate); + wined3d_mutex_lock(); + wined3d_device_set_predication(device->wined3d_device, query ? query->wined3d_query : NULL, value); + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_GSSetShaderResources(ID3D10Device1 *iface, + UINT start_slot, UINT view_count, ID3D10ShaderResourceView *const *views) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + unsigned int i; + + TRACE("iface %p, start_slot %u, view_count %u, views %p.\n", + iface, start_slot, view_count, views); + + wined3d_mutex_lock(); + for (i = 0; i < view_count; ++i) + { + struct d3d_shader_resource_view *view = unsafe_impl_from_ID3D10ShaderResourceView(views[i]); + + wined3d_device_set_gs_resource_view(device->wined3d_device, start_slot + i, + view ? view->wined3d_view : NULL); + } + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_GSSetSamplers(ID3D10Device1 *iface, + UINT start_slot, UINT sampler_count, ID3D10SamplerState *const *samplers) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + unsigned int i; + + TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n", + iface, start_slot, sampler_count, samplers); + + wined3d_mutex_lock(); + for (i = 0; i < sampler_count; ++i) + { + struct d3d_sampler_state *sampler = unsafe_impl_from_ID3D10SamplerState(samplers[i]); + + wined3d_device_set_gs_sampler(device->wined3d_device, start_slot + i, + sampler ? sampler->wined3d_sampler : NULL); + } + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_OMSetRenderTargets(ID3D10Device1 *iface, + UINT render_target_view_count, ID3D10RenderTargetView *const *render_target_views, + ID3D10DepthStencilView *depth_stencil_view) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_depthstencil_view *dsv; + unsigned int i; + + TRACE("iface %p, render_target_view_count %u, render_target_views %p, depth_stencil_view %p.\n", + iface, render_target_view_count, render_target_views, depth_stencil_view); + + wined3d_mutex_lock(); + for (i = 0; i < render_target_view_count; ++i) + { + struct d3d_rendertarget_view *rtv = unsafe_impl_from_ID3D10RenderTargetView(render_target_views[i]); + + wined3d_device_set_rendertarget_view(device->wined3d_device, i, + rtv ? rtv->wined3d_view : NULL, FALSE); + } + for (; i < D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i) + { + wined3d_device_set_rendertarget_view(device->wined3d_device, i, NULL, FALSE); + } + + dsv = unsafe_impl_from_ID3D10DepthStencilView(depth_stencil_view); + wined3d_device_set_depth_stencil_view(device->wined3d_device, + dsv ? dsv->wined3d_view : NULL); + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_OMSetBlendState(ID3D10Device1 *iface, + ID3D10BlendState *blend_state, const FLOAT blend_factor[4], UINT sample_mask) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_blend_state *blend_state_object; + + TRACE("iface %p, blend_state %p, blend_factor {%.8e %.8e %.8e %.8e}, sample_mask 0x%08x.\n", + iface, blend_state, blend_factor[0], blend_factor[1], blend_factor[2], blend_factor[3], sample_mask); + + blend_state_object = unsafe_impl_from_ID3D10BlendState(blend_state); + d3d11_immediate_context_OMSetBlendState(&device->immediate_context.ID3D11DeviceContext_iface, + blend_state_object ? &blend_state_object->ID3D11BlendState_iface : NULL, blend_factor, sample_mask); +} + +static void STDMETHODCALLTYPE d3d10_device_OMSetDepthStencilState(ID3D10Device1 *iface, + ID3D10DepthStencilState *depth_stencil_state, UINT stencil_ref) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + + TRACE("iface %p, depth_stencil_state %p, stencil_ref %u.\n", + iface, depth_stencil_state, stencil_ref); + + device->depth_stencil_state = unsafe_impl_from_ID3D10DepthStencilState(depth_stencil_state); + device->stencil_ref = stencil_ref; +} + +static void STDMETHODCALLTYPE d3d10_device_SOSetTargets(ID3D10Device1 *iface, + UINT target_count, ID3D10Buffer *const *targets, const UINT *offsets) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + unsigned int count, i; + + TRACE("iface %p, target_count %u, targets %p, offsets %p.\n", iface, target_count, targets, offsets); + + count = min(target_count, 4); + wined3d_mutex_lock(); + for (i = 0; i < count; ++i) + { + struct d3d_buffer *buffer = unsafe_impl_from_ID3D10Buffer(targets[i]); + + wined3d_device_set_stream_output(device->wined3d_device, i, + buffer ? buffer->wined3d_buffer : NULL, offsets[i]); + } + + for (i = count; i < 4; ++i) + { + wined3d_device_set_stream_output(device->wined3d_device, i, NULL, 0); + } + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_DrawAuto(ID3D10Device1 *iface) +{ + FIXME("iface %p stub!\n", iface); +} + +static void STDMETHODCALLTYPE d3d10_device_RSSetState(ID3D10Device1 *iface, ID3D10RasterizerState *rasterizer_state) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_rasterizer_state *rasterizer_state_object; + + TRACE("iface %p, rasterizer_state %p.\n", iface, rasterizer_state); + + rasterizer_state_object = unsafe_impl_from_ID3D10RasterizerState(rasterizer_state); + d3d11_immediate_context_RSSetState(&device->immediate_context.ID3D11DeviceContext_iface, + rasterizer_state_object ? &rasterizer_state_object->ID3D11RasterizerState_iface : NULL); +} + +static void STDMETHODCALLTYPE d3d10_device_RSSetViewports(ID3D10Device1 *iface, + UINT viewport_count, const D3D10_VIEWPORT *viewports) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + struct wined3d_viewport wined3d_vp; + + TRACE("iface %p, viewport_count %u, viewports %p.\n", iface, viewport_count, viewports); + + if (viewport_count > 1) + FIXME("Multiple viewports not implemented.\n"); + + if (!viewport_count) + return; + + wined3d_vp.x = viewports[0].TopLeftX; + wined3d_vp.y = viewports[0].TopLeftY; + wined3d_vp.width = viewports[0].Width; + wined3d_vp.height = viewports[0].Height; + wined3d_vp.min_z = viewports[0].MinDepth; + wined3d_vp.max_z = viewports[0].MaxDepth; + + wined3d_mutex_lock(); + wined3d_device_set_viewport(device->wined3d_device, &wined3d_vp); + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_RSSetScissorRects(ID3D10Device1 *iface, + UINT rect_count, const D3D10_RECT *rects) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + + TRACE("iface %p, rect_count %u, rects %p.\n", iface, rect_count, rects); + + if (rect_count > 1) + FIXME("Multiple scissor rects not implemented.\n"); + + if (!rect_count) + return; + + wined3d_mutex_lock(); + wined3d_device_set_scissor_rect(device->wined3d_device, rects); + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_CopySubresourceRegion(ID3D10Device1 *iface, + ID3D10Resource *dst_resource, UINT dst_subresource_idx, UINT dst_x, UINT dst_y, UINT dst_z, + ID3D10Resource *src_resource, UINT src_subresource_idx, const D3D10_BOX *src_box) +{ + struct wined3d_resource *wined3d_dst_resource, *wined3d_src_resource; + struct d3d_device *device = impl_from_ID3D10Device(iface); + struct wined3d_box wined3d_src_box; + + TRACE("iface %p, dst_resource %p, dst_subresource_idx %u, dst_x %u, dst_y %u, dst_z %u, " + "src_resource %p, src_subresource_idx %u, src_box %p.\n", + iface, dst_resource, dst_subresource_idx, dst_x, dst_y, dst_z, + src_resource, src_subresource_idx, src_box); + + wined3d_dst_resource = wined3d_resource_from_d3d10_resource(dst_resource); + wined3d_src_resource = wined3d_resource_from_d3d10_resource(src_resource); + wined3d_src_box.left = src_box->left; + wined3d_src_box.top = src_box->top; + wined3d_src_box.front = src_box->front; + wined3d_src_box.right = src_box->right; + wined3d_src_box.bottom = src_box->bottom; + wined3d_src_box.back = src_box->back; + wined3d_mutex_lock(); + wined3d_device_copy_sub_resource_region(device->wined3d_device, wined3d_dst_resource, dst_subresource_idx, + dst_x, dst_y, dst_z, wined3d_src_resource, src_subresource_idx, &wined3d_src_box); + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_CopyResource(ID3D10Device1 *iface, + ID3D10Resource *dst_resource, ID3D10Resource *src_resource) +{ + struct wined3d_resource *wined3d_dst_resource, *wined3d_src_resource; + struct d3d_device *device = impl_from_ID3D10Device(iface); + + TRACE("iface %p, dst_resource %p, src_resource %p.\n", iface, dst_resource, src_resource); + + wined3d_dst_resource = wined3d_resource_from_d3d10_resource(dst_resource); + wined3d_src_resource = wined3d_resource_from_d3d10_resource(src_resource); + wined3d_mutex_lock(); + wined3d_device_copy_resource(device->wined3d_device, wined3d_dst_resource, wined3d_src_resource); + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_UpdateSubresource(ID3D10Device1 *iface, + ID3D10Resource *resource, UINT subresource_idx, const D3D10_BOX *box, + const void *data, UINT row_pitch, UINT depth_pitch) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + ID3D11Resource *d3d11_resource; + + TRACE("iface %p, resource %p, subresource_idx %u, box %p, data %p, row_pitch %u, depth_pitch %u.\n", + iface, resource, subresource_idx, box, data, row_pitch, depth_pitch); + + ID3D10Resource_QueryInterface(resource, &IID_ID3D11Resource, (void **)&d3d11_resource); + d3d11_immediate_context_UpdateSubresource(&device->immediate_context.ID3D11DeviceContext_iface, + d3d11_resource, subresource_idx, (const D3D11_BOX *)box, data, row_pitch, depth_pitch); + ID3D11Resource_Release(d3d11_resource); +} + +static void STDMETHODCALLTYPE d3d10_device_ClearRenderTargetView(ID3D10Device1 *iface, + ID3D10RenderTargetView *render_target_view, const FLOAT color_rgba[4]) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_rendertarget_view *view = unsafe_impl_from_ID3D10RenderTargetView(render_target_view); + const struct wined3d_color color = {color_rgba[0], color_rgba[1], color_rgba[2], color_rgba[3]}; + HRESULT hr; + + TRACE("iface %p, render_target_view %p, color_rgba {%.8e, %.8e, %.8e, %.8e}.\n", + iface, render_target_view, color_rgba[0], color_rgba[1], color_rgba[2], color_rgba[3]); + + wined3d_mutex_lock(); + if (FAILED(hr = wined3d_device_clear_rendertarget_view(device->wined3d_device, view->wined3d_view, NULL, &color))) + ERR("Failed to clear view, hr %#x.\n", hr); + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_ClearDepthStencilView(ID3D10Device1 *iface, + ID3D10DepthStencilView *depth_stencil_view, UINT flags, FLOAT depth, UINT8 stencil) +{ + FIXME("iface %p, depth_stencil_view %p, flags %#x, depth %f, stencil %u stub!\n", + iface, depth_stencil_view, flags, depth, stencil); +} + +static void STDMETHODCALLTYPE d3d10_device_GenerateMips(ID3D10Device1 *iface, + ID3D10ShaderResourceView *shader_resource_view) +{ + FIXME("iface %p, shader_resource_view %p stub!\n", iface, shader_resource_view); +} + +static void STDMETHODCALLTYPE d3d10_device_ResolveSubresource(ID3D10Device1 *iface, + ID3D10Resource *dst_resource, UINT dst_subresource_idx, + ID3D10Resource *src_resource, UINT src_subresource_idx, DXGI_FORMAT format) +{ + FIXME("iface %p, dst_resource %p, dst_subresource_idx %u, " + "src_resource %p, src_subresource_idx %u, format %s stub!\n", + iface, dst_resource, dst_subresource_idx, + src_resource, src_subresource_idx, debug_dxgi_format(format)); +} + +static void STDMETHODCALLTYPE d3d10_device_VSGetConstantBuffers(ID3D10Device1 *iface, + UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + unsigned int i; + + TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", + iface, start_slot, buffer_count, buffers); + + wined3d_mutex_lock(); + for (i = 0; i < buffer_count; ++i) + { + struct wined3d_buffer *wined3d_buffer; + struct d3d_buffer *buffer_impl; + + if (!(wined3d_buffer = wined3d_device_get_vs_cb(device->wined3d_device, start_slot + i))) + { + buffers[i] = NULL; + continue; + } + + buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); + buffers[i] = &buffer_impl->ID3D10Buffer_iface; + ID3D10Buffer_AddRef(buffers[i]); + } + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_PSGetShaderResources(ID3D10Device1 *iface, + UINT start_slot, UINT view_count, ID3D10ShaderResourceView **views) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + unsigned int i; + + TRACE("iface %p, start_slot %u, view_count %u, views %p.\n", + iface, start_slot, view_count, views); + + wined3d_mutex_lock(); + for (i = 0; i < view_count; ++i) + { + struct wined3d_shader_resource_view *wined3d_view; + struct d3d_shader_resource_view *view_impl; + + if (!(wined3d_view = wined3d_device_get_ps_resource_view(device->wined3d_device, start_slot + i))) + { + views[i] = NULL; + continue; + } + + view_impl = wined3d_shader_resource_view_get_parent(wined3d_view); + views[i] = (ID3D10ShaderResourceView *)&view_impl->ID3D10ShaderResourceView1_iface; + ID3D10ShaderResourceView_AddRef(views[i]); + } + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_PSGetShader(ID3D10Device1 *iface, ID3D10PixelShader **shader) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_pixel_shader *shader_impl; + struct wined3d_shader *wined3d_shader; + + TRACE("iface %p, shader %p.\n", iface, shader); + + wined3d_mutex_lock(); + if (!(wined3d_shader = wined3d_device_get_pixel_shader(device->wined3d_device))) + { + wined3d_mutex_unlock(); + *shader = NULL; + return; + } + + shader_impl = wined3d_shader_get_parent(wined3d_shader); + wined3d_mutex_unlock(); + *shader = &shader_impl->ID3D10PixelShader_iface; + ID3D10PixelShader_AddRef(*shader); +} + +static void STDMETHODCALLTYPE d3d10_device_PSGetSamplers(ID3D10Device1 *iface, + UINT start_slot, UINT sampler_count, ID3D10SamplerState **samplers) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + unsigned int i; + + TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n", + iface, start_slot, sampler_count, samplers); + + wined3d_mutex_lock(); + for (i = 0; i < sampler_count; ++i) + { + struct d3d_sampler_state *sampler_impl; + struct wined3d_sampler *wined3d_sampler; + + if (!(wined3d_sampler = wined3d_device_get_ps_sampler(device->wined3d_device, start_slot + i))) + { + samplers[i] = NULL; + continue; + } + + sampler_impl = wined3d_sampler_get_parent(wined3d_sampler); + samplers[i] = &sampler_impl->ID3D10SamplerState_iface; + ID3D10SamplerState_AddRef(samplers[i]); + } + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_VSGetShader(ID3D10Device1 *iface, ID3D10VertexShader **shader) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_vertex_shader *shader_impl; + struct wined3d_shader *wined3d_shader; + + TRACE("iface %p, shader %p.\n", iface, shader); + + wined3d_mutex_lock(); + if (!(wined3d_shader = wined3d_device_get_vertex_shader(device->wined3d_device))) + { + wined3d_mutex_unlock(); + *shader = NULL; + return; + } + + shader_impl = wined3d_shader_get_parent(wined3d_shader); + wined3d_mutex_unlock(); + *shader = &shader_impl->ID3D10VertexShader_iface; + ID3D10VertexShader_AddRef(*shader); +} + +static void STDMETHODCALLTYPE d3d10_device_PSGetConstantBuffers(ID3D10Device1 *iface, + UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + unsigned int i; + + TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", + iface, start_slot, buffer_count, buffers); + + wined3d_mutex_lock(); + for (i = 0; i < buffer_count; ++i) + { + struct wined3d_buffer *wined3d_buffer; + struct d3d_buffer *buffer_impl; + + if (!(wined3d_buffer = wined3d_device_get_ps_cb(device->wined3d_device, start_slot + i))) + { + buffers[i] = NULL; + continue; + } + + buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); + buffers[i] = &buffer_impl->ID3D10Buffer_iface; + ID3D10Buffer_AddRef(buffers[i]); + } + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_IAGetInputLayout(ID3D10Device1 *iface, ID3D10InputLayout **input_layout) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + struct wined3d_vertex_declaration *wined3d_declaration; + struct d3d_input_layout *input_layout_impl; + + TRACE("iface %p, input_layout %p.\n", iface, input_layout); + + wined3d_mutex_lock(); + if (!(wined3d_declaration = wined3d_device_get_vertex_declaration(device->wined3d_device))) + { + wined3d_mutex_unlock(); + *input_layout = NULL; + return; + } + + input_layout_impl = wined3d_vertex_declaration_get_parent(wined3d_declaration); + wined3d_mutex_unlock(); + *input_layout = &input_layout_impl->ID3D10InputLayout_iface; + ID3D10InputLayout_AddRef(*input_layout); +} + +static void STDMETHODCALLTYPE d3d10_device_IAGetVertexBuffers(ID3D10Device1 *iface, + UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers, UINT *strides, UINT *offsets) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + unsigned int i; + + TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p, strides %p, offsets %p.\n", + iface, start_slot, buffer_count, buffers, strides, offsets); + + wined3d_mutex_lock(); + for (i = 0; i < buffer_count; ++i) + { + struct wined3d_buffer *wined3d_buffer; + struct d3d_buffer *buffer_impl; + + if (FAILED(wined3d_device_get_stream_source(device->wined3d_device, start_slot + i, + &wined3d_buffer, &offsets[i], &strides[i]))) + ERR("Failed to get vertex buffer.\n"); + + if (!wined3d_buffer) + { + buffers[i] = NULL; + continue; + } + + buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); + buffers[i] = &buffer_impl->ID3D10Buffer_iface; + ID3D10Buffer_AddRef(buffers[i]); + } + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_IAGetIndexBuffer(ID3D10Device1 *iface, + ID3D10Buffer **buffer, DXGI_FORMAT *format, UINT *offset) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + enum wined3d_format_id wined3d_format; + struct wined3d_buffer *wined3d_buffer; + struct d3d_buffer *buffer_impl; + + TRACE("iface %p, buffer %p, format %p, offset %p.\n", iface, buffer, format, offset); + + wined3d_mutex_lock(); + wined3d_buffer = wined3d_device_get_index_buffer(device->wined3d_device, &wined3d_format); + *format = dxgi_format_from_wined3dformat(wined3d_format); + *offset = 0; /* FIXME */ + if (!wined3d_buffer) + { + wined3d_mutex_unlock(); + *buffer = NULL; + return; + } + + buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); + wined3d_mutex_unlock(); + *buffer = &buffer_impl->ID3D10Buffer_iface; + ID3D10Buffer_AddRef(*buffer); +} + +static void STDMETHODCALLTYPE d3d10_device_GSGetConstantBuffers(ID3D10Device1 *iface, + UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + unsigned int i; + + TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n", + iface, start_slot, buffer_count, buffers); + + wined3d_mutex_lock(); + for (i = 0; i < buffer_count; ++i) + { + struct wined3d_buffer *wined3d_buffer; + struct d3d_buffer *buffer_impl; + + if (!(wined3d_buffer = wined3d_device_get_gs_cb(device->wined3d_device, start_slot + i))) + { + buffers[i] = NULL; + continue; + } + + buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); + buffers[i] = &buffer_impl->ID3D10Buffer_iface; + ID3D10Buffer_AddRef(buffers[i]); + } + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_GSGetShader(ID3D10Device1 *iface, ID3D10GeometryShader **shader) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_geometry_shader *shader_impl; + struct wined3d_shader *wined3d_shader; + + TRACE("iface %p, shader %p.\n", iface, shader); + + wined3d_mutex_lock(); + if (!(wined3d_shader = wined3d_device_get_geometry_shader(device->wined3d_device))) + { + wined3d_mutex_unlock(); + *shader = NULL; + return; + } + + shader_impl = wined3d_shader_get_parent(wined3d_shader); + wined3d_mutex_unlock(); + *shader = &shader_impl->ID3D10GeometryShader_iface; + ID3D10GeometryShader_AddRef(*shader); +} + +static void STDMETHODCALLTYPE d3d10_device_IAGetPrimitiveTopology(ID3D10Device1 *iface, + D3D10_PRIMITIVE_TOPOLOGY *topology) +{ + struct d3d_device *This = impl_from_ID3D10Device(iface); + + TRACE("iface %p, topology %p\n", iface, topology); + + wined3d_mutex_lock(); + wined3d_device_get_primitive_type(This->wined3d_device, (enum wined3d_primitive_type *)topology); + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_VSGetShaderResources(ID3D10Device1 *iface, + UINT start_slot, UINT view_count, ID3D10ShaderResourceView **views) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + unsigned int i; + + TRACE("iface %p, start_slot %u, view_count %u, views %p.\n", + iface, start_slot, view_count, views); + + wined3d_mutex_lock(); + for (i = 0; i < view_count; ++i) + { + struct wined3d_shader_resource_view *wined3d_view; + struct d3d_shader_resource_view *view_impl; + + if (!(wined3d_view = wined3d_device_get_vs_resource_view(device->wined3d_device, start_slot + i))) + { + views[i] = NULL; + continue; + } + + view_impl = wined3d_shader_resource_view_get_parent(wined3d_view); + views[i] = (ID3D10ShaderResourceView *)&view_impl->ID3D10ShaderResourceView1_iface; + ID3D10ShaderResourceView_AddRef(views[i]); + } + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_VSGetSamplers(ID3D10Device1 *iface, + UINT start_slot, UINT sampler_count, ID3D10SamplerState **samplers) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + unsigned int i; + + TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n", + iface, start_slot, sampler_count, samplers); + + wined3d_mutex_lock(); + for (i = 0; i < sampler_count; ++i) + { + struct d3d_sampler_state *sampler_impl; + struct wined3d_sampler *wined3d_sampler; + + if (!(wined3d_sampler = wined3d_device_get_vs_sampler(device->wined3d_device, start_slot + i))) + { + samplers[i] = NULL; + continue; + } + + sampler_impl = wined3d_sampler_get_parent(wined3d_sampler); + samplers[i] = &sampler_impl->ID3D10SamplerState_iface; + ID3D10SamplerState_AddRef(samplers[i]); + } + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_GetPredication(ID3D10Device1 *iface, + ID3D10Predicate **predicate, BOOL *value) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + struct wined3d_query *wined3d_predicate; + struct d3d_query *predicate_impl; + + TRACE("iface %p, predicate %p, value %p.\n", iface, predicate, value); + + wined3d_mutex_lock(); + if (!(wined3d_predicate = wined3d_device_get_predication(device->wined3d_device, value))) + { + wined3d_mutex_unlock(); + *predicate = NULL; + return; + } + + predicate_impl = wined3d_query_get_parent(wined3d_predicate); + wined3d_mutex_unlock(); + *predicate = (ID3D10Predicate *)&predicate_impl->ID3D10Query_iface; + ID3D10Predicate_AddRef(*predicate); +} + +static void STDMETHODCALLTYPE d3d10_device_GSGetShaderResources(ID3D10Device1 *iface, + UINT start_slot, UINT view_count, ID3D10ShaderResourceView **views) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + unsigned int i; + + TRACE("iface %p, start_slot %u, view_count %u, views %p.\n", + iface, start_slot, view_count, views); + + wined3d_mutex_lock(); + for (i = 0; i < view_count; ++i) + { + struct wined3d_shader_resource_view *wined3d_view; + struct d3d_shader_resource_view *view_impl; + + if (!(wined3d_view = wined3d_device_get_gs_resource_view(device->wined3d_device, start_slot + i))) + { + views[i] = NULL; + continue; + } + + view_impl = wined3d_shader_resource_view_get_parent(wined3d_view); + views[i] = (ID3D10ShaderResourceView *)&view_impl->ID3D10ShaderResourceView1_iface; + ID3D10ShaderResourceView_AddRef(views[i]); + } + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_GSGetSamplers(ID3D10Device1 *iface, + UINT start_slot, UINT sampler_count, ID3D10SamplerState **samplers) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + unsigned int i; + + TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n", + iface, start_slot, sampler_count, samplers); + + wined3d_mutex_lock(); + for (i = 0; i < sampler_count; ++i) + { + struct d3d_sampler_state *sampler_impl; + struct wined3d_sampler *wined3d_sampler; + + if (!(wined3d_sampler = wined3d_device_get_gs_sampler(device->wined3d_device, start_slot + i))) + { + samplers[i] = NULL; + continue; + } + + sampler_impl = wined3d_sampler_get_parent(wined3d_sampler); + samplers[i] = &sampler_impl->ID3D10SamplerState_iface; + ID3D10SamplerState_AddRef(samplers[i]); + } + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_OMGetRenderTargets(ID3D10Device1 *iface, + UINT view_count, ID3D10RenderTargetView **render_target_views, ID3D10DepthStencilView **depth_stencil_view) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + struct wined3d_rendertarget_view *wined3d_view; + + TRACE("iface %p, view_count %u, render_target_views %p, depth_stencil_view %p.\n", + iface, view_count, render_target_views, depth_stencil_view); + + wined3d_mutex_lock(); + if (render_target_views) + { + struct d3d_rendertarget_view *view_impl; + unsigned int i; + + for (i = 0; i < view_count; ++i) + { + if (!(wined3d_view = wined3d_device_get_rendertarget_view(device->wined3d_device, i)) + || !(view_impl = wined3d_rendertarget_view_get_parent(wined3d_view))) + { + render_target_views[i] = NULL; + continue; + } + + render_target_views[i] = &view_impl->ID3D10RenderTargetView_iface; + ID3D10RenderTargetView_AddRef(render_target_views[i]); + } + } + + if (depth_stencil_view) + { + struct d3d_depthstencil_view *view_impl; + + if (!(wined3d_view = wined3d_device_get_depth_stencil_view(device->wined3d_device)) + || !(view_impl = wined3d_rendertarget_view_get_parent(wined3d_view))) + { + *depth_stencil_view = NULL; + } + else + { + *depth_stencil_view = &view_impl->ID3D10DepthStencilView_iface; + ID3D10DepthStencilView_AddRef(*depth_stencil_view); + } + } + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_OMGetBlendState(ID3D10Device1 *iface, + ID3D10BlendState **blend_state, FLOAT blend_factor[4], UINT *sample_mask) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + + TRACE("iface %p, blend_state %p, blend_factor %p, sample_mask %p.\n", + iface, blend_state, blend_factor, sample_mask); + + if ((*blend_state = device->blend_state ? (ID3D10BlendState *)&device->blend_state->ID3D10BlendState1_iface : NULL)) + ID3D10BlendState_AddRef(*blend_state); + wined3d_mutex_lock(); + memcpy(blend_factor, device->blend_factor, 4 * sizeof(*blend_factor)); + *sample_mask = wined3d_device_get_render_state(device->wined3d_device, WINED3D_RS_MULTISAMPLEMASK); + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_OMGetDepthStencilState(ID3D10Device1 *iface, + ID3D10DepthStencilState **depth_stencil_state, UINT *stencil_ref) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + + TRACE("iface %p, depth_stencil_state %p, stencil_ref %p.\n", + iface, depth_stencil_state, stencil_ref); + + if ((*depth_stencil_state = device->depth_stencil_state + ? &device->depth_stencil_state->ID3D10DepthStencilState_iface : NULL)) + ID3D10DepthStencilState_AddRef(*depth_stencil_state); + *stencil_ref = device->stencil_ref; +} + +static void STDMETHODCALLTYPE d3d10_device_SOGetTargets(ID3D10Device1 *iface, + UINT buffer_count, ID3D10Buffer **buffers, UINT *offsets) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + unsigned int i; + + TRACE("iface %p, buffer_count %u, buffers %p, offsets %p.\n", + iface, buffer_count, buffers, offsets); + + wined3d_mutex_lock(); + for (i = 0; i < buffer_count; ++i) + { + struct wined3d_buffer *wined3d_buffer; + struct d3d_buffer *buffer_impl; + + if (!(wined3d_buffer = wined3d_device_get_stream_output(device->wined3d_device, i, &offsets[i]))) + { + buffers[i] = NULL; + continue; + } + + buffer_impl = wined3d_buffer_get_parent(wined3d_buffer); + buffers[i] = &buffer_impl->ID3D10Buffer_iface; + ID3D10Buffer_AddRef(buffers[i]); + } + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_RSGetState(ID3D10Device1 *iface, ID3D10RasterizerState **rasterizer_state) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + + TRACE("iface %p, rasterizer_state %p.\n", iface, rasterizer_state); + + if ((*rasterizer_state = device->rasterizer_state ? &device->rasterizer_state->ID3D10RasterizerState_iface : NULL)) + ID3D10RasterizerState_AddRef(*rasterizer_state); +} + +static void STDMETHODCALLTYPE d3d10_device_RSGetViewports(ID3D10Device1 *iface, + UINT *viewport_count, D3D10_VIEWPORT *viewports) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + struct wined3d_viewport wined3d_vp; + + TRACE("iface %p, viewport_count %p, viewports %p.\n", iface, viewport_count, viewports); + + if (!viewports) + { + *viewport_count = 1; + return; + } + + if (!*viewport_count) + return; + + wined3d_mutex_lock(); + wined3d_device_get_viewport(device->wined3d_device, &wined3d_vp); + wined3d_mutex_unlock(); + + viewports[0].TopLeftX = wined3d_vp.x; + viewports[0].TopLeftY = wined3d_vp.y; + viewports[0].Width = wined3d_vp.width; + viewports[0].Height = wined3d_vp.height; + viewports[0].MinDepth = wined3d_vp.min_z; + viewports[0].MaxDepth = wined3d_vp.max_z; + + if (*viewport_count > 1) + memset(&viewports[1], 0, (*viewport_count - 1) * sizeof(*viewports)); +} + +static void STDMETHODCALLTYPE d3d10_device_RSGetScissorRects(ID3D10Device1 *iface, UINT *rect_count, D3D10_RECT *rects) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + + TRACE("iface %p, rect_count %p, rects %p.\n", iface, rect_count, rects); + + if (!rects) + { + *rect_count = 1; + return; + } + + if (!*rect_count) + return; + + wined3d_mutex_lock(); + wined3d_device_get_scissor_rect(device->wined3d_device, rects); + wined3d_mutex_unlock(); + if (*rect_count > 1) + memset(&rects[1], 0, (*rect_count - 1) * sizeof(*rects)); +} + +static HRESULT STDMETHODCALLTYPE d3d10_device_GetDeviceRemovedReason(ID3D10Device1 *iface) +{ + TRACE("iface %p.\n", iface); + + /* In the current implementation the device is never removed, so we can + * just return S_OK here. */ + + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE d3d10_device_SetExceptionMode(ID3D10Device1 *iface, UINT flags) +{ + FIXME("iface %p, flags %#x stub!\n", iface, flags); + + return E_NOTIMPL; +} + +static UINT STDMETHODCALLTYPE d3d10_device_GetExceptionMode(ID3D10Device1 *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static HRESULT STDMETHODCALLTYPE d3d10_device_GetPrivateData(ID3D10Device1 *iface, + REFGUID guid, UINT *data_size, void *data) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d11_device_GetPrivateData(&device->ID3D11Device_iface, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d10_device_SetPrivateData(ID3D10Device1 *iface, + REFGUID guid, UINT data_size, const void *data) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d11_device_SetPrivateData(&device->ID3D11Device_iface, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d10_device_SetPrivateDataInterface(ID3D10Device1 *iface, + REFGUID guid, const IUnknown *data) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + + TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); + + return d3d11_device_SetPrivateDataInterface(&device->ID3D11Device_iface, guid, data); +} + +static void STDMETHODCALLTYPE d3d10_device_ClearState(ID3D10Device1 *iface) +{ + static const float blend_factor[] = {1.0f, 1.0f, 1.0f, 1.0f}; + struct d3d_device *device = impl_from_ID3D10Device(iface); + unsigned int i; + + TRACE("iface %p.\n", iface); + + wined3d_mutex_lock(); + wined3d_device_set_vertex_shader(device->wined3d_device, NULL); + for (i = 0; i < D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT; ++i) + { + wined3d_device_set_vs_sampler(device->wined3d_device, i, NULL); + } + for (i = 0; i < D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT; ++i) + { + wined3d_device_set_vs_resource_view(device->wined3d_device, i, NULL); + } + for (i = 0; i < D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT; ++i) + { + wined3d_device_set_vs_cb(device->wined3d_device, i, NULL); + } + wined3d_device_set_geometry_shader(device->wined3d_device, NULL); + for (i = 0; i < D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT; ++i) + { + wined3d_device_set_gs_sampler(device->wined3d_device, i, NULL); + } + for (i = 0; i < D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT; ++i) + { + wined3d_device_set_gs_resource_view(device->wined3d_device, i, NULL); + } + for (i = 0; i < D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT; ++i) + { + wined3d_device_set_gs_cb(device->wined3d_device, i, NULL); + } + wined3d_device_set_pixel_shader(device->wined3d_device, NULL); + for (i = 0; i < D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT; ++i) + { + wined3d_device_set_ps_sampler(device->wined3d_device, i, NULL); + } + for (i = 0; i < D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT; ++i) + { + wined3d_device_set_ps_resource_view(device->wined3d_device, i, NULL); + } + for (i = 0; i < D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT; ++i) + { + wined3d_device_set_ps_cb(device->wined3d_device, i, NULL); + } + for (i = 0; i < D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT; ++i) + { + wined3d_device_set_stream_source(device->wined3d_device, i, NULL, 0, 0); + } + wined3d_device_set_index_buffer(device->wined3d_device, NULL, WINED3DFMT_UNKNOWN); + wined3d_device_set_vertex_declaration(device->wined3d_device, NULL); + wined3d_device_set_primitive_type(device->wined3d_device, WINED3D_PT_UNDEFINED); + for (i = 0; i < D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i) + { + wined3d_device_set_rendertarget_view(device->wined3d_device, i, NULL, FALSE); + } + wined3d_device_set_depth_stencil_view(device->wined3d_device, NULL); + ID3D10Device1_OMSetDepthStencilState(iface, NULL, 0); + ID3D10Device1_OMSetBlendState(iface, NULL, blend_factor, D3D10_DEFAULT_SAMPLE_MASK); + ID3D10Device1_RSSetViewports(iface, 0, NULL); + ID3D10Device1_RSSetScissorRects(iface, 0, NULL); + ID3D10Device1_RSSetState(iface, NULL); + for (i = 0; i < D3D10_SO_BUFFER_SLOT_COUNT; ++i) + { + wined3d_device_set_stream_output(device->wined3d_device, i, NULL, 0); + } + wined3d_device_set_predication(device->wined3d_device, NULL, FALSE); + wined3d_mutex_unlock(); +} + +static void STDMETHODCALLTYPE d3d10_device_Flush(ID3D10Device1 *iface) +{ + FIXME("iface %p stub!\n", iface); +} + +static HRESULT STDMETHODCALLTYPE d3d10_device_CreateBuffer(ID3D10Device1 *iface, + const D3D10_BUFFER_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, ID3D10Buffer **buffer) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + D3D11_BUFFER_DESC d3d11_desc; + struct d3d_buffer *object; + HRESULT hr; + + TRACE("iface %p, desc %p, data %p, buffer %p.\n", iface, desc, data, buffer); + + d3d11_desc.ByteWidth = desc->ByteWidth; + d3d11_desc.Usage = d3d11_usage_from_d3d10_usage(desc->Usage); + d3d11_desc.BindFlags = d3d11_bind_flags_from_d3d10_bind_flags(desc->BindFlags); + d3d11_desc.CPUAccessFlags = d3d11_cpu_access_flags_from_d3d10_cpu_access_flags(desc->CPUAccessFlags); + d3d11_desc.MiscFlags = d3d11_resource_misc_flags_from_d3d10_resource_misc_flags(desc->MiscFlags); + d3d11_desc.StructureByteStride = 0; + + if (FAILED(hr = d3d_buffer_create(device, &d3d11_desc, (const D3D11_SUBRESOURCE_DATA *)data, &object))) + return hr; + + *buffer = &object->ID3D10Buffer_iface; + + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture1D(ID3D10Device1 *iface, + const D3D10_TEXTURE1D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, ID3D10Texture1D **texture) +{ + FIXME("iface %p, desc %p, data %p, texture %p stub!\n", iface, desc, data, texture); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture2D(ID3D10Device1 *iface, + const D3D10_TEXTURE2D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, + ID3D10Texture2D **texture) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + D3D11_TEXTURE2D_DESC d3d11_desc; + struct d3d_texture2d *object; + HRESULT hr; + + TRACE("iface %p, desc %p, data %p, texture %p.\n", iface, desc, data, texture); + + d3d11_desc.Width = desc->Width; + d3d11_desc.Height = desc->Height; + d3d11_desc.MipLevels = desc->MipLevels; + d3d11_desc.ArraySize = desc->ArraySize; + d3d11_desc.Format = desc->Format; + d3d11_desc.SampleDesc = desc->SampleDesc; + d3d11_desc.Usage = d3d11_usage_from_d3d10_usage(desc->Usage); + d3d11_desc.BindFlags = d3d11_bind_flags_from_d3d10_bind_flags(desc->BindFlags); + d3d11_desc.CPUAccessFlags = d3d11_cpu_access_flags_from_d3d10_cpu_access_flags(desc->CPUAccessFlags); + d3d11_desc.MiscFlags = d3d11_resource_misc_flags_from_d3d10_resource_misc_flags(desc->MiscFlags); + + if (FAILED(hr = d3d_texture2d_create(device, &d3d11_desc, (const D3D11_SUBRESOURCE_DATA *)data, &object))) + return hr; + + *texture = &object->ID3D10Texture2D_iface; + + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture3D(ID3D10Device1 *iface, + const D3D10_TEXTURE3D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, + ID3D10Texture3D **texture) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + D3D11_TEXTURE3D_DESC d3d11_desc; + struct d3d_texture3d *object; + HRESULT hr; + + TRACE("iface %p, desc %p, data %p, texture %p.\n", iface, desc, data, texture); + + d3d11_desc.Width = desc->Width; + d3d11_desc.Height = desc->Height; + d3d11_desc.Depth = desc->Depth; + d3d11_desc.MipLevels = desc->MipLevels; + d3d11_desc.Format = desc->Format; + d3d11_desc.Usage = d3d11_usage_from_d3d10_usage(desc->Usage); + d3d11_desc.BindFlags = d3d11_bind_flags_from_d3d10_bind_flags(desc->BindFlags); + d3d11_desc.CPUAccessFlags = d3d11_cpu_access_flags_from_d3d10_cpu_access_flags(desc->CPUAccessFlags); + d3d11_desc.MiscFlags = d3d11_resource_misc_flags_from_d3d10_resource_misc_flags(desc->MiscFlags); + + if (FAILED(hr = d3d_texture3d_create(device, &d3d11_desc, (const D3D11_SUBRESOURCE_DATA *)data, &object))) + return hr; + + *texture = &object->ID3D10Texture3D_iface; + + return S_OK; +} + +static HRESULT STDMETHODCALLTYPE d3d10_device_CreateShaderResourceView1(ID3D10Device1 *iface, + ID3D10Resource *resource, const D3D10_SHADER_RESOURCE_VIEW_DESC1 *desc, ID3D10ShaderResourceView1 **view) +{ + struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_shader_resource_view *object; + ID3D11Resource *d3d11_resource; + HRESULT hr; + + TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view); + + if (FAILED(hr = ID3D10Resource_QueryInterface(resource, &IID_ID3D11Resource, (void **)&d3d11_resource))) + { + ERR("Resource does not implement ID3D11Resource.\n"); + return E_FAIL; + } + + hr = d3d_shader_resource_view_create(device, d3d11_resource, (const D3D11_SHADER_RESOURCE_VIEW_DESC *)desc, + &object); + ID3D11Resource_Release(d3d11_resource); + if (FAILED(hr)) + return hr; - return E_NOTIMPL; + *view = &object->ID3D10ShaderResourceView1_iface; + + return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture1D(ID3D11Device *iface, - const D3D11_TEXTURE1D_DESC *desc, const D3D11_SUBRESOURCE_DATA *data, ID3D11Texture1D **texture) +static HRESULT STDMETHODCALLTYPE d3d10_device_CreateShaderResourceView(ID3D10Device1 *iface, + ID3D10Resource *resource, const D3D10_SHADER_RESOURCE_VIEW_DESC *desc, ID3D10ShaderResourceView **view) { - FIXME("iface %p, desc %p, data %p, texture %p stub!\n", iface, desc, data, texture); + TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view); - return E_NOTIMPL; + return d3d10_device_CreateShaderResourceView1(iface, resource, + (const D3D10_SHADER_RESOURCE_VIEW_DESC1 *)desc, (ID3D10ShaderResourceView1 **)view); } -static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture2D(ID3D11Device *iface, - const D3D11_TEXTURE2D_DESC *desc, const D3D11_SUBRESOURCE_DATA *data, ID3D11Texture2D **texture) +static HRESULT STDMETHODCALLTYPE d3d10_device_CreateRenderTargetView(ID3D10Device1 *iface, + ID3D10Resource *resource, const D3D10_RENDER_TARGET_VIEW_DESC *desc, ID3D10RenderTargetView **view) { - FIXME("iface %p, desc %p, data %p, texture %p stub!\n", iface, desc, data, texture); + struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_rendertarget_view *object; + ID3D11Resource *d3d11_resource; + HRESULT hr; - return E_NOTIMPL; -} + TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view); -static HRESULT STDMETHODCALLTYPE d3d11_device_CreateTexture3D(ID3D11Device *iface, - const D3D11_TEXTURE3D_DESC *desc, const D3D11_SUBRESOURCE_DATA *data, ID3D11Texture3D **texture) -{ - FIXME("iface %p, desc %p, data %p, texture %p stub!\n", iface, desc, data, texture); + if (FAILED(hr = ID3D10Resource_QueryInterface(resource, &IID_ID3D11Resource, (void **)&d3d11_resource))) + { + ERR("Resource does not implement ID3D11Resource.\n"); + return E_FAIL; + } - return E_NOTIMPL; -} + hr = d3d_rendertarget_view_create(device, d3d11_resource, (const D3D11_RENDER_TARGET_VIEW_DESC *)desc, &object); + ID3D11Resource_Release(d3d11_resource); + if (FAILED(hr)) + return hr; -static HRESULT STDMETHODCALLTYPE d3d11_device_CreateShaderResourceView(ID3D11Device *iface, - ID3D11Resource *resource, const D3D11_SHADER_RESOURCE_VIEW_DESC *desc, ID3D11ShaderResourceView **view) -{ - FIXME("iface %p, resource %p, desc %p, view %p stub!\n", iface, resource, desc, view); + *view = &object->ID3D10RenderTargetView_iface; - return E_NOTIMPL; + return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d11_device_CreateUnorderedAccessView(ID3D11Device *iface, - ID3D11Resource *resource, const D3D11_UNORDERED_ACCESS_VIEW_DESC *desc, ID3D11UnorderedAccessView **view) +static HRESULT STDMETHODCALLTYPE d3d10_device_CreateDepthStencilView(ID3D10Device1 *iface, + ID3D10Resource *resource, const D3D10_DEPTH_STENCIL_VIEW_DESC *desc, ID3D10DepthStencilView **view) { - FIXME("iface %p, resource %p, desc %p, view %p stub!\n", iface, resource, desc, view); + struct d3d_device *device = impl_from_ID3D10Device(iface); + D3D11_DEPTH_STENCIL_VIEW_DESC d3d11_desc; + struct d3d_depthstencil_view *object; + ID3D11Resource *d3d11_resource; + HRESULT hr; - return E_NOTIMPL; -} + TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view); -static HRESULT STDMETHODCALLTYPE d3d11_device_CreateRenderTargetView(ID3D11Device *iface, - ID3D11Resource *resource, const D3D11_RENDER_TARGET_VIEW_DESC *desc, ID3D11RenderTargetView **view) -{ - FIXME("iface %p, resource %p, desc %p, view %p stub!\n", iface, resource, desc, view); + if (desc) + { + d3d11_desc.Format = desc->Format; + d3d11_desc.ViewDimension = desc->ViewDimension; + d3d11_desc.Flags = 0; + memcpy(&d3d11_desc.u, &desc->u, sizeof(d3d11_desc.u)); + } - return E_NOTIMPL; -} + if (FAILED(hr = ID3D10Resource_QueryInterface(resource, &IID_ID3D11Resource, (void **)&d3d11_resource))) + { + ERR("Resource does not implement ID3D11Resource.\n"); + return E_FAIL; + } -static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDepthStencilView(ID3D11Device *iface, - ID3D11Resource *resource, const D3D11_DEPTH_STENCIL_VIEW_DESC *desc, ID3D11DepthStencilView **view) -{ - FIXME("iface %p, resource %p, desc %p, view %p stub!\n", iface, resource, desc, view); + hr = d3d_depthstencil_view_create(device, d3d11_resource, desc ? &d3d11_desc : NULL, &object); + ID3D11Resource_Release(d3d11_resource); + if (FAILED(hr)) + return hr; - return E_NOTIMPL; + *view = &object->ID3D10DepthStencilView_iface; + + return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d11_device_CreateInputLayout(ID3D11Device *iface, - const D3D11_INPUT_ELEMENT_DESC *element_descs, UINT element_count, const void *shader_byte_code, - SIZE_T shader_byte_code_length, ID3D11InputLayout **input_layout) +static HRESULT STDMETHODCALLTYPE d3d10_device_CreateInputLayout(ID3D10Device1 *iface, + const D3D10_INPUT_ELEMENT_DESC *element_descs, UINT element_count, + const void *shader_byte_code, SIZE_T shader_byte_code_length, + ID3D10InputLayout **input_layout) { - FIXME("iface %p, element_descs %p, element_count %u, shader_byte_code %p, shader_byte_code_length %lu, " - "input_layout %p stub!\n", iface, element_descs, element_count, shader_byte_code, + struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_input_layout *object; + HRESULT hr; + + TRACE("iface %p, element_descs %p, element_count %u, shader_byte_code %p, " + "shader_byte_code_length %lu, input_layout %p\n", + iface, element_descs, element_count, shader_byte_code, shader_byte_code_length, input_layout); - return E_NOTIMPL; -} + if (FAILED(hr = d3d_input_layout_create(device, (const D3D11_INPUT_ELEMENT_DESC *)element_descs, element_count, + shader_byte_code, shader_byte_code_length, &object))) + return hr; -static HRESULT STDMETHODCALLTYPE d3d11_device_CreateVertexShader(ID3D11Device *iface, const void *byte_code, - SIZE_T byte_code_length, ID3D11ClassLinkage *class_linkage, ID3D11VertexShader **shader) -{ - FIXME("iface %p, byte_code %p, byte_code_length %lu, class_linkage %p, shader %p stub!\n", - iface, byte_code, byte_code_length, class_linkage, shader); + *input_layout = &object->ID3D10InputLayout_iface; - return E_NOTIMPL; + return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d11_device_CreateGeometryShader(ID3D11Device *iface, const void *byte_code, - SIZE_T byte_code_length, ID3D11ClassLinkage *class_linkage, ID3D11GeometryShader **shader) +static HRESULT STDMETHODCALLTYPE d3d10_device_CreateVertexShader(ID3D10Device1 *iface, + const void *byte_code, SIZE_T byte_code_length, ID3D10VertexShader **shader) { - FIXME("iface %p, byte_code %p, byte_code_length %lu, class_linkage %p, shader %p stub!\n", - iface, byte_code, byte_code_length, class_linkage, shader); + struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_vertex_shader *object; + HRESULT hr; - return E_NOTIMPL; -} + TRACE("iface %p, byte_code %p, byte_code_length %lu, shader %p.\n", + iface, byte_code, byte_code_length, shader); -static HRESULT STDMETHODCALLTYPE d3d11_device_CreateGeometryShaderWithStreamOutput(ID3D11Device *iface, - const void *byte_code, SIZE_T byte_code_length, const D3D11_SO_DECLARATION_ENTRY *so_entries, - UINT entry_count, const UINT *buffer_strides, UINT strides_count, UINT rasterized_stream, - ID3D11ClassLinkage *class_linkage, ID3D11GeometryShader **shader) -{ - FIXME("iface %p, byte_code %p, byte_code_length %lu, so_entries %p, entry_count %u, " - "buffer_strides %p, strides_count %u, rasterized_stream %u, class_linkage %p, shader %p stub!\n", - iface, byte_code, byte_code_length, so_entries, entry_count, buffer_strides, strides_count, - rasterized_stream, class_linkage, shader); + if (FAILED(hr = d3d_vertex_shader_create(device, byte_code, byte_code_length, &object))) + return hr; - return E_NOTIMPL; + *shader = &object->ID3D10VertexShader_iface; + + return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d11_device_CreatePixelShader(ID3D11Device *iface, const void *byte_code, - SIZE_T byte_code_length, ID3D11ClassLinkage *class_linkage, ID3D11PixelShader **shader) +static HRESULT STDMETHODCALLTYPE d3d10_device_CreateGeometryShader(ID3D10Device1 *iface, + const void *byte_code, SIZE_T byte_code_length, ID3D10GeometryShader **shader) { - FIXME("iface %p, byte_code %p, byte_code_length %lu, class_linkage %p, shader %p stub!\n", - iface, byte_code, byte_code_length, class_linkage, shader); + struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_geometry_shader *object; + HRESULT hr; - return E_NOTIMPL; -} + TRACE("iface %p, byte_code %p, byte_code_length %lu, shader %p.\n", + iface, byte_code, byte_code_length, shader); -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", - iface, byte_code, byte_code_length, class_linkage, shader); + if (FAILED(hr = d3d_geometry_shader_create(device, byte_code, byte_code_length, &object))) + return hr; - return E_NOTIMPL; + *shader = &object->ID3D10GeometryShader_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) +static HRESULT STDMETHODCALLTYPE d3d10_device_CreateGeometryShaderWithStreamOutput(ID3D10Device1 *iface, + const void *byte_code, SIZE_T byte_code_length, const D3D10_SO_DECLARATION_ENTRY *output_stream_decls, + UINT output_stream_decl_count, UINT output_stream_stride, ID3D10GeometryShader **shader) { - FIXME("iface %p, byte_code %p, byte_code_length %lu, class_linkage %p, shader %p stub!\n", - iface, byte_code, byte_code_length, class_linkage, shader); + FIXME("iface %p, byte_code %p, byte_code_length %lu, output_stream_decls %p, " + "output_stream_decl_count %u, output_stream_stride %u, shader %p stub!\n", + iface, byte_code, byte_code_length, output_stream_decls, + output_stream_decl_count, output_stream_stride, shader); return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE d3d11_device_CreateComputeShader(ID3D11Device *iface, const void *byte_code, - SIZE_T byte_code_length, ID3D11ClassLinkage *class_linkage, ID3D11ComputeShader **shader) +static HRESULT STDMETHODCALLTYPE d3d10_device_CreatePixelShader(ID3D10Device1 *iface, + const void *byte_code, SIZE_T byte_code_length, ID3D10PixelShader **shader) { - FIXME("iface %p, byte_code %p, byte_code_lenghth %lu, class_linkage %p, shader %p stub!\n", - iface, byte_code, byte_code_length, class_linkage, shader); + struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_pixel_shader *object; + HRESULT hr; - return E_NOTIMPL; -} + TRACE("iface %p, byte_code %p, byte_code_length %lu, shader %p.\n", + iface, byte_code, byte_code_length, shader); -static HRESULT STDMETHODCALLTYPE d3d11_device_CreateClassLinkage(ID3D11Device *iface, - ID3D11ClassLinkage **class_linkage) -{ - FIXME("iface %p, class_linkage %p stub!\n", iface, class_linkage); + if (FAILED(hr = d3d_pixel_shader_create(device, byte_code, byte_code_length, &object))) + return hr; - return E_NOTIMPL; + *shader = &object->ID3D10PixelShader_iface; + + return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d11_device_CreateBlendState(ID3D11Device *iface, - const D3D11_BLEND_DESC *desc, ID3D11BlendState **blend_state) +static HRESULT STDMETHODCALLTYPE d3d10_device_CreateBlendState1(ID3D10Device1 *iface, + const D3D10_BLEND_DESC1 *desc, ID3D10BlendState1 **blend_state) { - FIXME("iface %p, desc %p, blend_state %p stub!\n", iface, desc, blend_state); + struct d3d_device *device = impl_from_ID3D10Device(iface); + ID3D11BlendState *d3d11_blend_state; + HRESULT hr; - return E_NOTIMPL; -} + TRACE("iface %p, desc %p, blend_state %p.\n", iface, desc, blend_state); -static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDepthStencilState(ID3D11Device *iface, - const D3D11_DEPTH_STENCIL_DESC *desc, ID3D11DepthStencilState **depth_stencil_state) -{ - FIXME("iface %p, desc %p, depth_stencil_state %p stub!\n", iface, desc, depth_stencil_state); + if (FAILED(hr = d3d11_device_CreateBlendState(&device->ID3D11Device_iface, (D3D11_BLEND_DESC *)desc, + &d3d11_blend_state))) + return hr; - return E_NOTIMPL; + hr = ID3D11BlendState_QueryInterface(d3d11_blend_state, &IID_ID3D10BlendState1, (void **)blend_state); + ID3D11BlendState_Release(d3d11_blend_state); + return hr; } -static HRESULT STDMETHODCALLTYPE d3d11_device_CreateRasterizerState(ID3D11Device *iface, - const D3D11_RASTERIZER_DESC *desc, ID3D11RasterizerState **rasterizer_state) +static HRESULT STDMETHODCALLTYPE d3d10_device_CreateBlendState(ID3D10Device1 *iface, + const D3D10_BLEND_DESC *desc, ID3D10BlendState **blend_state) { - FIXME("iface %p, desc %p, rasterizer_state %p stub!\n", iface, desc, rasterizer_state); + D3D10_BLEND_DESC1 d3d10_1_desc; + unsigned int i; - return E_NOTIMPL; -} + TRACE("iface %p, desc %p, blend_state %p.\n", iface, desc, blend_state); -static HRESULT STDMETHODCALLTYPE d3d11_device_CreateSamplerState(ID3D11Device *iface, - const D3D11_SAMPLER_DESC *desc, ID3D11SamplerState **sampler_state) -{ - FIXME("iface %p, desc %p, sampler_state %p stub!\n", iface, desc, sampler_state); + if (!desc) + return E_INVALIDARG; - return E_NOTIMPL; -} + d3d10_1_desc.AlphaToCoverageEnable = desc->AlphaToCoverageEnable; + d3d10_1_desc.IndependentBlendEnable = FALSE; + for (i = 0; i < D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT - 1; ++i) + { + if (desc->BlendEnable[i] != desc->BlendEnable[i + 1] + || desc->RenderTargetWriteMask[i] != desc->RenderTargetWriteMask[i + 1]) + d3d10_1_desc.IndependentBlendEnable = TRUE; + } -static HRESULT STDMETHODCALLTYPE d3d11_device_CreateQuery(ID3D11Device *iface, - const D3D11_QUERY_DESC *desc, ID3D11Query **query) -{ - FIXME("iface %p, desc %p, query %p stub!\n", iface, desc, query); + for (i = 0; i < D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i) + { + d3d10_1_desc.RenderTarget[i].BlendEnable = desc->BlendEnable[i]; + d3d10_1_desc.RenderTarget[i].SrcBlend = desc->SrcBlend; + d3d10_1_desc.RenderTarget[i].DestBlend = desc->DestBlend; + d3d10_1_desc.RenderTarget[i].BlendOp = desc->BlendOp; + d3d10_1_desc.RenderTarget[i].SrcBlendAlpha = desc->SrcBlendAlpha; + d3d10_1_desc.RenderTarget[i].DestBlendAlpha = desc->DestBlendAlpha; + d3d10_1_desc.RenderTarget[i].BlendOpAlpha = desc->BlendOpAlpha; + d3d10_1_desc.RenderTarget[i].RenderTargetWriteMask = desc->RenderTargetWriteMask[i]; + } - return E_NOTIMPL; + return d3d10_device_CreateBlendState1(iface, &d3d10_1_desc, (ID3D10BlendState1 **)blend_state); } -static HRESULT STDMETHODCALLTYPE d3d11_device_CreatePredicate(ID3D11Device *iface, const D3D11_QUERY_DESC *desc, - ID3D11Predicate **predicate) +static HRESULT STDMETHODCALLTYPE d3d10_device_CreateDepthStencilState(ID3D10Device1 *iface, + const D3D10_DEPTH_STENCIL_DESC *desc, ID3D10DepthStencilState **depth_stencil_state) { - FIXME("iface %p, desc %p, predicate %p stub!\n", iface, desc, predicate); + struct d3d_device *device = impl_from_ID3D10Device(iface); + ID3D11DepthStencilState *d3d11_depth_stencil_state; + HRESULT hr; - return E_NOTIMPL; + TRACE("iface %p, desc %p, depth_stencil_state %p.\n", iface, desc, depth_stencil_state); + + if (FAILED(hr = d3d11_device_CreateDepthStencilState(&device->ID3D11Device_iface, + (const D3D11_DEPTH_STENCIL_DESC *)desc, &d3d11_depth_stencil_state))) + return hr; + + hr = ID3D11DepthStencilState_QueryInterface(d3d11_depth_stencil_state, &IID_ID3D10DepthStencilState, + (void **)depth_stencil_state); + ID3D11DepthStencilState_Release(d3d11_depth_stencil_state); + return hr; } -static HRESULT STDMETHODCALLTYPE d3d11_device_CreateCounter(ID3D11Device *iface, const D3D11_COUNTER_DESC *desc, - ID3D11Counter **counter) +static HRESULT STDMETHODCALLTYPE d3d10_device_CreateRasterizerState(ID3D10Device1 *iface, + const D3D10_RASTERIZER_DESC *desc, ID3D10RasterizerState **rasterizer_state) { - FIXME("iface %p, desc %p, counter %p stub!\n", iface, desc, counter); + struct d3d_device *device = impl_from_ID3D10Device(iface); + ID3D11RasterizerState *d3d11_rasterizer_state; + HRESULT hr; - return E_NOTIMPL; + TRACE("iface %p, desc %p, rasterizer_state %p.\n", iface, desc, rasterizer_state); + + if (FAILED(hr = d3d11_device_CreateRasterizerState(&device->ID3D11Device_iface, + (const D3D11_RASTERIZER_DESC *)desc, &d3d11_rasterizer_state))) + return hr; + + hr = ID3D11RasterizerState_QueryInterface(d3d11_rasterizer_state, + &IID_ID3D10RasterizerState, (void **)rasterizer_state); + ID3D11RasterizerState_Release(d3d11_rasterizer_state); + return hr; } -static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext(ID3D11Device *iface, UINT flags, - ID3D11DeviceContext **context) +static HRESULT STDMETHODCALLTYPE d3d10_device_CreateSamplerState(ID3D10Device1 *iface, + const D3D10_SAMPLER_DESC *desc, ID3D10SamplerState **sampler_state) { - FIXME("iface %p, flags %#x, context %p stub!\n", iface, flags, context); + struct d3d_device *device = impl_from_ID3D10Device(iface); + ID3D11SamplerState *d3d11_sampler_state; + HRESULT hr; - return E_NOTIMPL; + TRACE("iface %p, desc %p, sampler_state %p.\n", iface, desc, sampler_state); + + if (FAILED(hr = d3d11_device_CreateSamplerState(&device->ID3D11Device_iface, + (const D3D11_SAMPLER_DESC *)desc, &d3d11_sampler_state))) + return hr; + + hr = ID3D11SamplerState_QueryInterface(d3d11_sampler_state, &IID_ID3D10SamplerState, (void **)sampler_state); + ID3D11SamplerState_Release(d3d11_sampler_state); + return hr; } -static HRESULT STDMETHODCALLTYPE d3d11_device_OpenSharedResource(ID3D11Device *iface, HANDLE resource, REFIID riid, - void **out) +static HRESULT STDMETHODCALLTYPE d3d10_device_CreateQuery(ID3D10Device1 *iface, + const D3D10_QUERY_DESC *desc, ID3D10Query **query) { - FIXME("iface %p, resource %p, riid %s, out %p stub!\n", iface, resource, debugstr_guid(riid), out); + struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_query *object; + HRESULT hr; + + TRACE("iface %p, desc %p, query %p.\n", iface, desc, query); - return E_NOTIMPL; -} + if (FAILED(hr = d3d_query_create(device, (const D3D11_QUERY_DESC *)desc, FALSE, &object))) + return hr; -static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device *iface, DXGI_FORMAT format, - UINT *format_support) -{ - FIXME("iface %p, format %u, format_support %p stub!\n", iface, format, format_support); + *query = &object->ID3D10Query_iface; - return E_NOTIMPL; + return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d11_device_CheckMultisampleQualityLevels(ID3D11Device *iface, - DXGI_FORMAT format, UINT sample_count, UINT *quality_level_count) +static HRESULT STDMETHODCALLTYPE d3d10_device_CreatePredicate(ID3D10Device1 *iface, + const D3D10_QUERY_DESC *desc, ID3D10Predicate **predicate) { - FIXME("iface %p, format %u, sample_count %u, quality_level_count %p stub!\n", - iface, format, sample_count, quality_level_count); + struct d3d_device *device = impl_from_ID3D10Device(iface); + struct d3d_query *object; + HRESULT hr; - return E_NOTIMPL; -} + TRACE("iface %p, desc %p, predicate %p.\n", iface, desc, predicate); -static void STDMETHODCALLTYPE d3d11_device_CheckCounterInfo(ID3D11Device *iface, D3D11_COUNTER_INFO *info) -{ - FIXME("iface %p, info %p stub!\n", iface, info); -} + if (FAILED(hr = d3d_query_create(device, (const D3D11_QUERY_DESC *)desc, TRUE, &object))) + return hr; -static HRESULT STDMETHODCALLTYPE d3d11_device_CheckCounter(ID3D11Device *iface, const D3D11_COUNTER_DESC *desc, - D3D11_COUNTER_TYPE *type, UINT *active_counter_count, char *name, UINT *name_length, - char *units, UINT *units_length, char *description, UINT *description_length) -{ - FIXME("iface %p, desc %p, type %p, active_counter_count %p, name %p, name_length %p, " - "units %p, units_length %p, description %p, description_length %p stub!\n", - iface, desc, type, active_counter_count, name, name_length, - units, units_length, description, description_length); + *predicate = (ID3D10Predicate *)&object->ID3D10Query_iface; - return E_NOTIMPL; + return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFeatureSupport(ID3D11Device *iface, D3D11_FEATURE feature, - void *feature_support_data, UINT feature_support_data_size) +static HRESULT STDMETHODCALLTYPE d3d10_device_CreateCounter(ID3D10Device1 *iface, + const D3D10_COUNTER_DESC *desc, ID3D10Counter **counter) { - FIXME("iface %p, feature %u, feature_support_data %p, feature_support_data_size %u stub!\n", - iface, feature, feature_support_data, feature_support_data_size); + FIXME("iface %p, desc %p, counter %p stub!\n", iface, desc, counter); return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE d3d11_device_GetPrivateData(ID3D11Device *iface, REFGUID guid, - UINT *data_size, void *data) +static HRESULT STDMETHODCALLTYPE d3d10_device_CheckFormatSupport(ID3D10Device1 *iface, + DXGI_FORMAT format, UINT *format_support) { - FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); + FIXME("iface %p, format %s, format_support %p stub!\n", + iface, debug_dxgi_format(format), format_support); return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE d3d11_device_SetPrivateData(ID3D11Device *iface, REFGUID guid, - UINT data_size, const void *data) +static HRESULT STDMETHODCALLTYPE d3d10_device_CheckMultisampleQualityLevels(ID3D10Device1 *iface, + DXGI_FORMAT format, UINT sample_count, UINT *quality_level_count) { - FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); + FIXME("iface %p, format %s, sample_count %u, quality_level_count %p stub!\n", + iface, debug_dxgi_format(format), sample_count, quality_level_count); return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE d3d11_device_SetPrivateDataInterface(ID3D11Device *iface, REFGUID guid, - const IUnknown *data_iface) +static void STDMETHODCALLTYPE d3d10_device_CheckCounterInfo(ID3D10Device1 *iface, D3D10_COUNTER_INFO *counter_info) { - FIXME("iface %p, guid %s, data_iface %p stub!\n", iface, debugstr_guid(guid), data_iface); - - return E_NOTIMPL; + FIXME("iface %p, counter_info %p stub!\n", iface, counter_info); } -static D3D_FEATURE_LEVEL STDMETHODCALLTYPE d3d11_device_GetFeatureLevel(ID3D11Device *iface) +static HRESULT STDMETHODCALLTYPE d3d10_device_CheckCounter(ID3D10Device1 *iface, + const D3D10_COUNTER_DESC *desc, D3D10_COUNTER_TYPE *type, UINT *active_counters, char *name, + UINT *name_length, char *units, UINT *units_length, char *description, UINT *description_length) { - FIXME("iface %p stub!\n", iface); + FIXME("iface %p, desc %p, type %p, active_counters %p, name %p, name_length %p, " + "units %p, units_length %p, description %p, description_length %p stub!\n", + iface, desc, type, active_counters, name, name_length, + units, units_length, description, description_length); - return D3D_FEATURE_LEVEL_10_0; + return E_NOTIMPL; } -static UINT STDMETHODCALLTYPE d3d11_device_GetCreationFlags(ID3D11Device *iface) +static UINT STDMETHODCALLTYPE d3d10_device_GetCreationFlags(ID3D10Device1 *iface) { FIXME("iface %p stub!\n", iface); return 0; } -static HRESULT STDMETHODCALLTYPE d3d11_device_GetDeviceRemovedReason(ID3D11Device *iface) +static HRESULT STDMETHODCALLTYPE d3d10_device_OpenSharedResource(ID3D10Device1 *iface, + HANDLE resource_handle, REFIID guid, void **resource) { - FIXME("iface %p stub!\n", iface); + FIXME("iface %p, resource_handle %p, guid %s, resource %p stub!\n", + iface, resource_handle, debugstr_guid(guid), resource); - return S_OK; + return E_NOTIMPL; } -static void STDMETHODCALLTYPE d3d11_device_GetImmediateContext(ID3D11Device *iface, - ID3D11DeviceContext **immediate_context) +static void STDMETHODCALLTYPE d3d10_device_SetTextFilterSize(ID3D10Device1 *iface, UINT width, UINT height) { - FIXME("iface %p, immediate_context %p stub!\n", iface, immediate_context); + FIXME("iface %p, width %u, height %u stub!\n", iface, width, height); } -static HRESULT STDMETHODCALLTYPE d3d11_device_SetExceptionMode(ID3D11Device *iface, UINT flags) +static void STDMETHODCALLTYPE d3d10_device_GetTextFilterSize(ID3D10Device1 *iface, UINT *width, UINT *height) { - FIXME("iface %p, flags %#x stub!\n", iface, flags); - - return E_NOTIMPL; + FIXME("iface %p, width %p, height %p stub!\n", iface, width, height); } -static UINT STDMETHODCALLTYPE d3d11_device_GetExceptionMode(ID3D11Device *iface) +static D3D10_FEATURE_LEVEL1 STDMETHODCALLTYPE d3d10_device_GetFeatureLevel(ID3D10Device1 *iface) { FIXME("iface %p stub!\n", iface); - return 0; + return D3D10_FEATURE_LEVEL_10_1; } -static const struct ID3D11DeviceVtbl d3d11_device_vtbl = +static const struct ID3D10Device1Vtbl d3d10_device1_vtbl = { /* IUnknown methods */ - d3d11_device_QueryInterface, - d3d11_device_AddRef, - d3d11_device_Release, - /* ID3D11Device methods */ - d3d11_device_CreateBuffer, - d3d11_device_CreateTexture1D, - d3d11_device_CreateTexture2D, - d3d11_device_CreateTexture3D, - d3d11_device_CreateShaderResourceView, - d3d11_device_CreateUnorderedAccessView, - d3d11_device_CreateRenderTargetView, - d3d11_device_CreateDepthStencilView, - d3d11_device_CreateInputLayout, - d3d11_device_CreateVertexShader, - d3d11_device_CreateGeometryShader, - d3d11_device_CreateGeometryShaderWithStreamOutput, - d3d11_device_CreatePixelShader, - d3d11_device_CreateHullShader, - d3d11_device_CreateDomainShader, - d3d11_device_CreateComputeShader, - d3d11_device_CreateClassLinkage, - d3d11_device_CreateBlendState, - d3d11_device_CreateDepthStencilState, - d3d11_device_CreateRasterizerState, - d3d11_device_CreateSamplerState, - d3d11_device_CreateQuery, - d3d11_device_CreatePredicate, - d3d11_device_CreateCounter, - d3d11_device_CreateDeferredContext, - d3d11_device_OpenSharedResource, - d3d11_device_CheckFormatSupport, - d3d11_device_CheckMultisampleQualityLevels, - d3d11_device_CheckCounterInfo, - d3d11_device_CheckCounter, - d3d11_device_CheckFeatureSupport, - d3d11_device_GetPrivateData, - d3d11_device_SetPrivateData, - d3d11_device_SetPrivateDataInterface, - d3d11_device_GetFeatureLevel, - d3d11_device_GetCreationFlags, - d3d11_device_GetDeviceRemovedReason, - d3d11_device_GetImmediateContext, - d3d11_device_SetExceptionMode, - d3d11_device_GetExceptionMode, + d3d10_device_QueryInterface, + d3d10_device_AddRef, + d3d10_device_Release, + /* ID3D10Device methods */ + d3d10_device_VSSetConstantBuffers, + d3d10_device_PSSetShaderResources, + d3d10_device_PSSetShader, + d3d10_device_PSSetSamplers, + d3d10_device_VSSetShader, + d3d10_device_DrawIndexed, + d3d10_device_Draw, + d3d10_device_PSSetConstantBuffers, + d3d10_device_IASetInputLayout, + d3d10_device_IASetVertexBuffers, + d3d10_device_IASetIndexBuffer, + d3d10_device_DrawIndexedInstanced, + d3d10_device_DrawInstanced, + d3d10_device_GSSetConstantBuffers, + d3d10_device_GSSetShader, + d3d10_device_IASetPrimitiveTopology, + d3d10_device_VSSetShaderResources, + d3d10_device_VSSetSamplers, + d3d10_device_SetPredication, + d3d10_device_GSSetShaderResources, + d3d10_device_GSSetSamplers, + d3d10_device_OMSetRenderTargets, + d3d10_device_OMSetBlendState, + d3d10_device_OMSetDepthStencilState, + d3d10_device_SOSetTargets, + d3d10_device_DrawAuto, + d3d10_device_RSSetState, + d3d10_device_RSSetViewports, + d3d10_device_RSSetScissorRects, + d3d10_device_CopySubresourceRegion, + d3d10_device_CopyResource, + d3d10_device_UpdateSubresource, + d3d10_device_ClearRenderTargetView, + d3d10_device_ClearDepthStencilView, + d3d10_device_GenerateMips, + d3d10_device_ResolveSubresource, + d3d10_device_VSGetConstantBuffers, + d3d10_device_PSGetShaderResources, + d3d10_device_PSGetShader, + d3d10_device_PSGetSamplers, + d3d10_device_VSGetShader, + d3d10_device_PSGetConstantBuffers, + d3d10_device_IAGetInputLayout, + d3d10_device_IAGetVertexBuffers, + d3d10_device_IAGetIndexBuffer, + d3d10_device_GSGetConstantBuffers, + d3d10_device_GSGetShader, + d3d10_device_IAGetPrimitiveTopology, + d3d10_device_VSGetShaderResources, + d3d10_device_VSGetSamplers, + d3d10_device_GetPredication, + d3d10_device_GSGetShaderResources, + d3d10_device_GSGetSamplers, + d3d10_device_OMGetRenderTargets, + d3d10_device_OMGetBlendState, + d3d10_device_OMGetDepthStencilState, + d3d10_device_SOGetTargets, + d3d10_device_RSGetState, + d3d10_device_RSGetViewports, + d3d10_device_RSGetScissorRects, + d3d10_device_GetDeviceRemovedReason, + d3d10_device_SetExceptionMode, + d3d10_device_GetExceptionMode, + d3d10_device_GetPrivateData, + d3d10_device_SetPrivateData, + d3d10_device_SetPrivateDataInterface, + d3d10_device_ClearState, + d3d10_device_Flush, + d3d10_device_CreateBuffer, + d3d10_device_CreateTexture1D, + d3d10_device_CreateTexture2D, + d3d10_device_CreateTexture3D, + d3d10_device_CreateShaderResourceView, + d3d10_device_CreateRenderTargetView, + d3d10_device_CreateDepthStencilView, + d3d10_device_CreateInputLayout, + d3d10_device_CreateVertexShader, + d3d10_device_CreateGeometryShader, + d3d10_device_CreateGeometryShaderWithStreamOutput, + d3d10_device_CreatePixelShader, + d3d10_device_CreateBlendState, + d3d10_device_CreateDepthStencilState, + d3d10_device_CreateRasterizerState, + d3d10_device_CreateSamplerState, + d3d10_device_CreateQuery, + d3d10_device_CreatePredicate, + d3d10_device_CreateCounter, + d3d10_device_CheckFormatSupport, + d3d10_device_CheckMultisampleQualityLevels, + d3d10_device_CheckCounterInfo, + d3d10_device_CheckCounter, + d3d10_device_GetCreationFlags, + d3d10_device_OpenSharedResource, + d3d10_device_SetTextFilterSize, + d3d10_device_GetTextFilterSize, + d3d10_device_CreateShaderResourceView1, + d3d10_device_CreateBlendState1, + d3d10_device_GetFeatureLevel, +}; + +static const struct IUnknownVtbl d3d_device_inner_unknown_vtbl = +{ + /* IUnknown methods */ + d3d_device_inner_QueryInterface, + d3d_device_inner_AddRef, + d3d_device_inner_Release, }; /* ID3D10Multithread methods */ @@ -2820,7 +4694,7 @@ return &device->device_parent; } -static const struct IWineDXGIDeviceParentVtbl d3d10_dxgi_device_parent_vtbl = +static const struct IWineDXGIDeviceParentVtbl d3d_dxgi_device_parent_vtbl = { /* IUnknown methods */ dxgi_device_parent_QueryInterface, @@ -2857,42 +4731,43 @@ } static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent *device_parent, - void *container_parent, struct wined3d_surface *surface, void **parent, + struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, struct wined3d_surface *surface, void **parent, const struct wined3d_parent_ops **parent_ops) { - TRACE("device_parent %p, container_parent %p, surface %p, parent %p, parent_ops %p.\n", - device_parent, container_parent, surface, parent, parent_ops); + TRACE("device_parent %p, wined3d_texture %p, sub_resource_idx %u, surface %p, parent %p, parent_ops %p.\n", + device_parent, wined3d_texture, sub_resource_idx, surface, parent, parent_ops); - *parent = container_parent; - *parent_ops = &d3d10_null_wined3d_parent_ops; + *parent = NULL; + *parent_ops = &d3d_null_wined3d_parent_ops; return S_OK; } static HRESULT CDECL device_parent_volume_created(struct wined3d_device_parent *device_parent, - void *container_parent, struct wined3d_volume *volume, void **parent, + struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, void **parent, const struct wined3d_parent_ops **parent_ops) { - TRACE("device_parent %p, container_parent %p, volume %p, parent %p, parent_ops %p.\n", - device_parent, container_parent, volume, parent, parent_ops); + TRACE("device_parent %p, texture %p, sub_resource_idx %u, parent %p, parent_ops %p.\n", + device_parent, wined3d_texture, sub_resource_idx, parent, parent_ops); - *parent = container_parent; - *parent_ops = &d3d10_null_wined3d_parent_ops; + *parent = NULL; + *parent_ops = &d3d_null_wined3d_parent_ops; return S_OK; } -static HRESULT CDECL device_parent_create_swapchain_surface(struct wined3d_device_parent *device_parent, - void *container_parent, const struct wined3d_resource_desc *wined3d_desc, struct wined3d_surface **surface) +static HRESULT CDECL device_parent_create_swapchain_texture(struct wined3d_device_parent *device_parent, + void *container_parent, const struct wined3d_resource_desc *wined3d_desc, + struct wined3d_texture **wined3d_texture) { struct d3d_device *device = device_from_wined3d_device_parent(device_parent); - struct wined3d_resource *sub_resource; - struct d3d10_texture2d *texture; + struct d3d_texture2d *texture; + ID3D10Texture2D *texture_iface; D3D10_TEXTURE2D_DESC desc; HRESULT hr; - FIXME("device_parent %p, container_parent %p, wined3d_desc %p, surface %p partial stub!\n", - device_parent, container_parent, wined3d_desc, surface); + FIXME("device_parent %p, container_parent %p, wined3d_desc %p, wined3d_texture %p partial stub!\n", + device_parent, container_parent, wined3d_desc, wined3d_texture); FIXME("Implement DXGI<->wined3d usage conversion\n"); @@ -2909,15 +4784,16 @@ desc.MiscFlags = 0; if (FAILED(hr = d3d10_device_CreateTexture2D(&device->ID3D10Device1_iface, - &desc, NULL, (ID3D10Texture2D **)&texture))) + &desc, NULL, &texture_iface))) { ERR("CreateTexture2D failed, returning %#x\n", hr); return hr; } - sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, 0); - *surface = wined3d_surface_from_resource(sub_resource); - wined3d_surface_incref(*surface); + texture = impl_from_ID3D10Texture2D(texture_iface); + + *wined3d_texture = texture->wined3d_texture; + wined3d_texture_incref(*wined3d_texture); ID3D10Texture2D_Release(&texture->ID3D10Texture2D_iface); return S_OK; @@ -2950,110 +4826,117 @@ return S_OK; } -static const struct wined3d_device_parent_ops d3d10_wined3d_device_parent_ops = +static const struct wined3d_device_parent_ops d3d_wined3d_device_parent_ops = { device_parent_wined3d_device_created, device_parent_mode_changed, device_parent_activate, device_parent_surface_created, device_parent_volume_created, - device_parent_create_swapchain_surface, + device_parent_create_swapchain_texture, device_parent_create_swapchain, }; -static void *d3d10_rb_alloc(size_t size) +static void *d3d_rb_alloc(size_t size) { return HeapAlloc(GetProcessHeap(), 0, size); } -static void *d3d10_rb_realloc(void *ptr, size_t size) +static void *d3d_rb_realloc(void *ptr, size_t size) { return HeapReAlloc(GetProcessHeap(), 0, ptr, size); } -static void d3d10_rb_free(void *ptr) +static void d3d_rb_free(void *ptr) { HeapFree(GetProcessHeap(), 0, ptr); } -static int d3d10_sampler_state_compare(const void *key, const struct wine_rb_entry *entry) +static int d3d_sampler_state_compare(const void *key, const struct wine_rb_entry *entry) { - const D3D10_SAMPLER_DESC *ka = key; - const D3D10_SAMPLER_DESC *kb = &WINE_RB_ENTRY_VALUE(entry, const struct d3d10_sampler_state, entry)->desc; + const D3D11_SAMPLER_DESC *ka = key; + const D3D11_SAMPLER_DESC *kb = &WINE_RB_ENTRY_VALUE(entry, const struct d3d_sampler_state, entry)->desc; return memcmp(ka, kb, sizeof(*ka)); } -static const struct wine_rb_functions d3d10_sampler_state_rb_ops = +static const struct wine_rb_functions d3d_sampler_state_rb_ops = { - d3d10_rb_alloc, - d3d10_rb_realloc, - d3d10_rb_free, - d3d10_sampler_state_compare, + d3d_rb_alloc, + d3d_rb_realloc, + d3d_rb_free, + d3d_sampler_state_compare, }; -static int d3d10_blend_state_compare(const void *key, const struct wine_rb_entry *entry) +static int d3d_blend_state_compare(const void *key, const struct wine_rb_entry *entry) { - const D3D10_BLEND_DESC *ka = key; - const D3D10_BLEND_DESC *kb = &WINE_RB_ENTRY_VALUE(entry, const struct d3d10_blend_state, entry)->desc; + const D3D11_BLEND_DESC *ka = key; + const D3D11_BLEND_DESC *kb = &WINE_RB_ENTRY_VALUE(entry, const struct d3d_blend_state, entry)->desc; return memcmp(ka, kb, sizeof(*ka)); } -static const struct wine_rb_functions d3d10_blend_state_rb_ops = +static const struct wine_rb_functions d3d_blend_state_rb_ops = { - d3d10_rb_alloc, - d3d10_rb_realloc, - d3d10_rb_free, - d3d10_blend_state_compare, + d3d_rb_alloc, + d3d_rb_realloc, + d3d_rb_free, + d3d_blend_state_compare, }; -static int d3d10_depthstencil_state_compare(const void *key, const struct wine_rb_entry *entry) +static int d3d_depthstencil_state_compare(const void *key, const struct wine_rb_entry *entry) { - const D3D10_DEPTH_STENCIL_DESC *ka = key; - const D3D10_DEPTH_STENCIL_DESC *kb = &WINE_RB_ENTRY_VALUE(entry, - const struct d3d10_depthstencil_state, entry)->desc; + const D3D11_DEPTH_STENCIL_DESC *ka = key; + const D3D11_DEPTH_STENCIL_DESC *kb = &WINE_RB_ENTRY_VALUE(entry, + const struct d3d_depthstencil_state, entry)->desc; return memcmp(ka, kb, sizeof(*ka)); } -static const struct wine_rb_functions d3d10_depthstencil_state_rb_ops = +static const struct wine_rb_functions d3d_depthstencil_state_rb_ops = { - d3d10_rb_alloc, - d3d10_rb_realloc, - d3d10_rb_free, - d3d10_depthstencil_state_compare, + d3d_rb_alloc, + d3d_rb_realloc, + d3d_rb_free, + d3d_depthstencil_state_compare, }; -static int d3d10_rasterizer_state_compare(const void *key, const struct wine_rb_entry *entry) +static int d3d_rasterizer_state_compare(const void *key, const struct wine_rb_entry *entry) { - const D3D10_RASTERIZER_DESC *ka = key; - const D3D10_RASTERIZER_DESC *kb = &WINE_RB_ENTRY_VALUE(entry, const struct d3d10_rasterizer_state, entry)->desc; + const D3D11_RASTERIZER_DESC *ka = key; + const D3D11_RASTERIZER_DESC *kb = &WINE_RB_ENTRY_VALUE(entry, const struct d3d_rasterizer_state, entry)->desc; return memcmp(ka, kb, sizeof(*ka)); } -static const struct wine_rb_functions d3d10_rasterizer_state_rb_ops = +static const struct wine_rb_functions d3d_rasterizer_state_rb_ops = { - d3d10_rb_alloc, - d3d10_rb_realloc, - d3d10_rb_free, - d3d10_rasterizer_state_compare, + d3d_rb_alloc, + d3d_rb_realloc, + d3d_rb_free, + d3d_rasterizer_state_compare, }; -HRESULT d3d10_device_init(struct d3d_device *device, void *outer_unknown) +HRESULT d3d_device_init(struct d3d_device *device, void *outer_unknown) { - device->IUnknown_inner.lpVtbl = &d3d10_device_inner_unknown_vtbl; + device->IUnknown_inner.lpVtbl = &d3d_device_inner_unknown_vtbl; device->ID3D11Device_iface.lpVtbl = &d3d11_device_vtbl; device->ID3D10Device1_iface.lpVtbl = &d3d10_device1_vtbl; device->ID3D10Multithread_iface.lpVtbl = &d3d10_multithread_vtbl; - device->IWineDXGIDeviceParent_iface.lpVtbl = &d3d10_dxgi_device_parent_vtbl; - device->device_parent.ops = &d3d10_wined3d_device_parent_ops; + device->IWineDXGIDeviceParent_iface.lpVtbl = &d3d_dxgi_device_parent_vtbl; + device->device_parent.ops = &d3d_wined3d_device_parent_ops; device->refcount = 1; /* COM aggregation always takes place */ device->outer_unk = outer_unknown; - if (wine_rb_init(&device->blend_states, &d3d10_blend_state_rb_ops) == -1) + if (FAILED(d3d11_immediate_context_init(&device->immediate_context, device))) + { + WARN("Failed to initialize immediate device context.\n"); + return E_FAIL; + } + ID3D11DeviceContext_Release(&device->immediate_context.ID3D11DeviceContext_iface); + + if (wine_rb_init(&device->blend_states, &d3d_blend_state_rb_ops) == -1) { WARN("Failed to initialize blend state rbtree.\n"); return E_FAIL; @@ -3063,14 +4946,14 @@ device->blend_factor[2] = 1.0f; device->blend_factor[3] = 1.0f; - if (wine_rb_init(&device->depthstencil_states, &d3d10_depthstencil_state_rb_ops) == -1) + if (wine_rb_init(&device->depthstencil_states, &d3d_depthstencil_state_rb_ops) == -1) { WARN("Failed to initialize depthstencil state rbtree.\n"); wine_rb_destroy(&device->blend_states, NULL, NULL); return E_FAIL; } - if (wine_rb_init(&device->rasterizer_states, &d3d10_rasterizer_state_rb_ops) == -1) + if (wine_rb_init(&device->rasterizer_states, &d3d_rasterizer_state_rb_ops) == -1) { WARN("Failed to initialize rasterizer state rbtree.\n"); wine_rb_destroy(&device->depthstencil_states, NULL, NULL); @@ -3078,7 +4961,7 @@ return E_FAIL; } - if (wine_rb_init(&device->sampler_states, &d3d10_sampler_state_rb_ops) == -1) + if (wine_rb_init(&device->sampler_states, &d3d_sampler_state_rb_ops) == -1) { WARN("Failed to initialize sampler state rbtree.\n"); wine_rb_destroy(&device->rasterizer_states, NULL, NULL); diff -Nru wine1.7-1.7.50/dlls/d3d11/inputlayout.c wine1.7-1.7.55/dlls/d3d11/inputlayout.c --- wine1.7-1.7.50/dlls/d3d11/inputlayout.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d11/inputlayout.c 2015-11-13 14:32:40.000000000 +0000 @@ -39,7 +39,7 @@ } } -static HRESULT d3d10_input_layout_to_wined3d_declaration(const D3D10_INPUT_ELEMENT_DESC *element_descs, +static HRESULT d3d11_input_layout_to_wined3d_declaration(const D3D11_INPUT_ELEMENT_DESC *element_descs, UINT element_count, const void *shader_byte_code, SIZE_T shader_byte_code_length, struct wined3d_vertex_element **wined3d_elements) { @@ -65,7 +65,7 @@ for (i = 0; i < element_count; ++i) { struct wined3d_vertex_element *e = &(*wined3d_elements)[i]; - const D3D10_INPUT_ELEMENT_DESC *f = &element_descs[i]; + const D3D11_INPUT_ELEMENT_DESC *f = &element_descs[i]; UINT j; e->format = wined3dformat_from_dxgi_format(f->Format); @@ -94,67 +94,163 @@ return S_OK; } -static inline struct d3d10_input_layout *impl_from_ID3D10InputLayout(ID3D10InputLayout *iface) +/* ID3D11InputLayout methods */ + +static inline struct d3d_input_layout *impl_from_ID3D11InputLayout(ID3D11InputLayout *iface) { - return CONTAINING_RECORD(iface, struct d3d10_input_layout, ID3D10InputLayout_iface); + return CONTAINING_RECORD(iface, struct d3d_input_layout, ID3D11InputLayout_iface); } -/* IUnknown methods */ - -static HRESULT STDMETHODCALLTYPE d3d10_input_layout_QueryInterface(ID3D10InputLayout *iface, +static HRESULT STDMETHODCALLTYPE d3d11_input_layout_QueryInterface(ID3D11InputLayout *iface, REFIID riid, void **object) { - TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object); + struct d3d_input_layout *layout = impl_from_ID3D11InputLayout(iface); - if (IsEqualGUID(riid, &IID_ID3D10InputLayout) - || IsEqualGUID(riid, &IID_ID3D10DeviceChild) + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + + if (IsEqualGUID(riid, &IID_ID3D11InputLayout) + || IsEqualGUID(riid, &IID_ID3D11DeviceChild) || IsEqualGUID(riid, &IID_IUnknown)) { - IUnknown_AddRef(iface); + ID3D11InputLayout_AddRef(iface); *object = iface; return S_OK; } - WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid)); + if (IsEqualGUID(riid, &IID_ID3D10InputLayout) + || IsEqualGUID(riid, &IID_ID3D10DeviceChild)) + { + ID3D10InputLayout_AddRef(&layout->ID3D10InputLayout_iface); + *object = &layout->ID3D10InputLayout_iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); *object = NULL; return E_NOINTERFACE; } -static ULONG STDMETHODCALLTYPE d3d10_input_layout_AddRef(ID3D10InputLayout *iface) +static ULONG STDMETHODCALLTYPE d3d11_input_layout_AddRef(ID3D11InputLayout *iface) { - struct d3d10_input_layout *This = impl_from_ID3D10InputLayout(iface); - ULONG refcount = InterlockedIncrement(&This->refcount); + struct d3d_input_layout *layout = impl_from_ID3D11InputLayout(iface); + ULONG refcount = InterlockedIncrement(&layout->refcount); - TRACE("%p increasing refcount to %u\n", This, refcount); + TRACE("%p increasing refcount to %u.\n", layout, refcount); if (refcount == 1) { wined3d_mutex_lock(); - wined3d_vertex_declaration_incref(This->wined3d_decl); + wined3d_vertex_declaration_incref(layout->wined3d_decl); wined3d_mutex_unlock(); } return refcount; } -static ULONG STDMETHODCALLTYPE d3d10_input_layout_Release(ID3D10InputLayout *iface) +static ULONG STDMETHODCALLTYPE d3d11_input_layout_Release(ID3D11InputLayout *iface) { - struct d3d10_input_layout *This = impl_from_ID3D10InputLayout(iface); - ULONG refcount = InterlockedDecrement(&This->refcount); + struct d3d_input_layout *layout = impl_from_ID3D11InputLayout(iface); + ULONG refcount = InterlockedDecrement(&layout->refcount); - TRACE("%p decreasing refcount to %u\n", This, refcount); + TRACE("%p decreasing refcount to %u.\n", layout, refcount); if (!refcount) { wined3d_mutex_lock(); - wined3d_vertex_declaration_decref(This->wined3d_decl); + wined3d_vertex_declaration_decref(layout->wined3d_decl); wined3d_mutex_unlock(); } return refcount; } +static void STDMETHODCALLTYPE d3d11_input_layout_GetDevice(ID3D11InputLayout *iface, + ID3D11Device **device) +{ + FIXME("iface %p, device %p stub!\n", iface, device); +} + +static HRESULT STDMETHODCALLTYPE d3d11_input_layout_GetPrivateData(ID3D11InputLayout *iface, + REFGUID guid, UINT *data_size, void *data) +{ + struct d3d_input_layout *layout = impl_from_ID3D11InputLayout(iface); + + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_get_private_data(&layout->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_input_layout_SetPrivateData(ID3D11InputLayout *iface, + REFGUID guid, UINT data_size, const void *data) +{ + struct d3d_input_layout *layout = impl_from_ID3D11InputLayout(iface); + + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_set_private_data(&layout->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_input_layout_SetPrivateDataInterface(ID3D11InputLayout *iface, + REFGUID guid, const IUnknown *data) +{ + struct d3d_input_layout *layout = impl_from_ID3D11InputLayout(iface); + + TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); + + return d3d_set_private_data_interface(&layout->private_store, guid, data); +} + +static const struct ID3D11InputLayoutVtbl d3d11_input_layout_vtbl = +{ + /* IUnknown methods */ + d3d11_input_layout_QueryInterface, + d3d11_input_layout_AddRef, + d3d11_input_layout_Release, + /* ID3D11DeviceChild methods */ + d3d11_input_layout_GetDevice, + d3d11_input_layout_GetPrivateData, + d3d11_input_layout_SetPrivateData, + d3d11_input_layout_SetPrivateDataInterface, +}; + +/* ID3D10InputLayout methods */ + +static inline struct d3d_input_layout *impl_from_ID3D10InputLayout(ID3D10InputLayout *iface) +{ + return CONTAINING_RECORD(iface, struct d3d_input_layout, ID3D10InputLayout_iface); +} + +/* IUnknown methods */ + +static HRESULT STDMETHODCALLTYPE d3d10_input_layout_QueryInterface(ID3D10InputLayout *iface, + REFIID riid, void **object) +{ + struct d3d_input_layout *layout = impl_from_ID3D10InputLayout(iface); + + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + + return d3d11_input_layout_QueryInterface(&layout->ID3D11InputLayout_iface, riid, object); +} + +static ULONG STDMETHODCALLTYPE d3d10_input_layout_AddRef(ID3D10InputLayout *iface) +{ + struct d3d_input_layout *layout = impl_from_ID3D10InputLayout(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_input_layout_AddRef(&layout->ID3D11InputLayout_iface); +} + +static ULONG STDMETHODCALLTYPE d3d10_input_layout_Release(ID3D10InputLayout *iface) +{ + struct d3d_input_layout *layout = impl_from_ID3D10InputLayout(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_input_layout_Release(&layout->ID3D11InputLayout_iface); +} + /* ID3D10DeviceChild methods */ static void STDMETHODCALLTYPE d3d10_input_layout_GetDevice(ID3D10InputLayout *iface, ID3D10Device **device) @@ -165,33 +261,33 @@ static HRESULT STDMETHODCALLTYPE d3d10_input_layout_GetPrivateData(ID3D10InputLayout *iface, REFGUID guid, UINT *data_size, void *data) { - struct d3d10_input_layout *layout = impl_from_ID3D10InputLayout(iface); + struct d3d_input_layout *layout = impl_from_ID3D10InputLayout(iface); TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_get_private_data(&layout->private_store, guid, data_size, data); + return d3d_get_private_data(&layout->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d10_input_layout_SetPrivateData(ID3D10InputLayout *iface, REFGUID guid, UINT data_size, const void *data) { - struct d3d10_input_layout *layout = impl_from_ID3D10InputLayout(iface); + struct d3d_input_layout *layout = impl_from_ID3D10InputLayout(iface); TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_set_private_data(&layout->private_store, guid, data_size, data); + return d3d_set_private_data(&layout->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d10_input_layout_SetPrivateDataInterface(ID3D10InputLayout *iface, REFGUID guid, const IUnknown *data) { - struct d3d10_input_layout *layout = impl_from_ID3D10InputLayout(iface); + struct d3d_input_layout *layout = impl_from_ID3D10InputLayout(iface); TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); - return d3d10_set_private_data_interface(&layout->private_store, guid, data); + return d3d_set_private_data_interface(&layout->private_store, guid, data); } static const struct ID3D10InputLayoutVtbl d3d10_input_layout_vtbl = @@ -207,32 +303,33 @@ d3d10_input_layout_SetPrivateDataInterface, }; -static void STDMETHODCALLTYPE d3d10_input_layout_wined3d_object_destroyed(void *parent) +static void STDMETHODCALLTYPE d3d_input_layout_wined3d_object_destroyed(void *parent) { - struct d3d10_input_layout *layout = parent; + struct d3d_input_layout *layout = parent; wined3d_private_store_cleanup(&layout->private_store); HeapFree(GetProcessHeap(), 0, parent); } -static const struct wined3d_parent_ops d3d10_input_layout_wined3d_parent_ops = +static const struct wined3d_parent_ops d3d_input_layout_wined3d_parent_ops = { - d3d10_input_layout_wined3d_object_destroyed, + d3d_input_layout_wined3d_object_destroyed, }; -HRESULT d3d10_input_layout_init(struct d3d10_input_layout *layout, struct d3d_device *device, - const D3D10_INPUT_ELEMENT_DESC *element_descs, UINT element_count, +static HRESULT d3d_input_layout_init(struct d3d_input_layout *layout, struct d3d_device *device, + const D3D11_INPUT_ELEMENT_DESC *element_descs, UINT element_count, const void *shader_byte_code, SIZE_T shader_byte_code_length) { struct wined3d_vertex_element *wined3d_elements; HRESULT hr; + layout->ID3D11InputLayout_iface.lpVtbl = &d3d11_input_layout_vtbl; layout->ID3D10InputLayout_iface.lpVtbl = &d3d10_input_layout_vtbl; layout->refcount = 1; wined3d_mutex_lock(); wined3d_private_store_init(&layout->private_store); - if (FAILED(hr = d3d10_input_layout_to_wined3d_declaration(element_descs, element_count, + if (FAILED(hr = d3d11_input_layout_to_wined3d_declaration(element_descs, element_count, shader_byte_code, shader_byte_code_length, &wined3d_elements))) { WARN("Failed to create wined3d vertex declaration elements, hr %#x.\n", hr); @@ -242,7 +339,7 @@ } hr = wined3d_vertex_declaration_create(device->wined3d_device, wined3d_elements, element_count, - layout, &d3d10_input_layout_wined3d_parent_ops, &layout->wined3d_decl); + layout, &d3d_input_layout_wined3d_parent_ops, &layout->wined3d_decl); HeapFree(GetProcessHeap(), 0, wined3d_elements); if (FAILED(hr)) { @@ -256,7 +353,42 @@ return S_OK; } -struct d3d10_input_layout *unsafe_impl_from_ID3D10InputLayout(ID3D10InputLayout *iface) +HRESULT d3d_input_layout_create(struct d3d_device *device, + const D3D11_INPUT_ELEMENT_DESC *element_descs, UINT element_count, + const void *shader_byte_code, SIZE_T shader_byte_code_length, + struct d3d_input_layout **layout) +{ + struct d3d_input_layout *object; + HRESULT hr; + + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); + if (!object) + return E_OUTOFMEMORY; + + if (FAILED(hr = d3d_input_layout_init(object, device, element_descs, element_count, + shader_byte_code, shader_byte_code_length))) + { + WARN("Failed to initialize input layout, hr %#x.\n", hr); + HeapFree(GetProcessHeap(), 0, object); + return hr; + } + + TRACE("Created input layout %p.\n", object); + *layout = object; + + return S_OK; +} + +struct d3d_input_layout *unsafe_impl_from_ID3D11InputLayout(ID3D11InputLayout *iface) +{ + if (!iface) + return NULL; + assert(iface->lpVtbl == &d3d11_input_layout_vtbl); + + return impl_from_ID3D11InputLayout(iface); +} + +struct d3d_input_layout *unsafe_impl_from_ID3D10InputLayout(ID3D10InputLayout *iface) { if (!iface) return NULL; diff -Nru wine1.7-1.7.50/dlls/d3d11/shader.c wine1.7-1.7.55/dlls/d3d11/shader.c --- wine1.7-1.7.50/dlls/d3d11/shader.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d11/shader.c 2015-11-13 14:32:40.000000000 +0000 @@ -26,7 +26,7 @@ static HRESULT shdr_handler(const char *data, DWORD data_size, DWORD tag, void *ctx) { - struct d3d10_shader_info *shader_info = ctx; + struct d3d_shader_info *shader_info = ctx; HRESULT hr; switch (tag) @@ -53,7 +53,7 @@ return S_OK; } -static HRESULT shader_extract_from_dxbc(const void *dxbc, SIZE_T dxbc_length, struct d3d10_shader_info *shader_info) +static HRESULT shader_extract_from_dxbc(const void *dxbc, SIZE_T dxbc_length, struct d3d_shader_info *shader_info) { HRESULT hr; @@ -122,115 +122,215 @@ HeapFree(GetProcessHeap(), 0, s->elements); } -static inline struct d3d10_vertex_shader *impl_from_ID3D10VertexShader(ID3D10VertexShader *iface) +/* ID3D11VertexShader methods */ + +static inline struct d3d_vertex_shader *impl_from_ID3D11VertexShader(ID3D11VertexShader *iface) { - return CONTAINING_RECORD(iface, struct d3d10_vertex_shader, ID3D10VertexShader_iface); + return CONTAINING_RECORD(iface, struct d3d_vertex_shader, ID3D11VertexShader_iface); } -/* IUnknown methods */ - -static HRESULT STDMETHODCALLTYPE d3d10_vertex_shader_QueryInterface(ID3D10VertexShader *iface, +static HRESULT STDMETHODCALLTYPE d3d11_vertex_shader_QueryInterface(ID3D11VertexShader *iface, REFIID riid, void **object) { - TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object); + struct d3d_vertex_shader *shader = impl_from_ID3D11VertexShader(iface); - if (IsEqualGUID(riid, &IID_ID3D10VertexShader) - || IsEqualGUID(riid, &IID_ID3D10DeviceChild) + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + + if (IsEqualGUID(riid, &IID_ID3D11VertexShader) + || IsEqualGUID(riid, &IID_ID3D11DeviceChild) || IsEqualGUID(riid, &IID_IUnknown)) { - IUnknown_AddRef(iface); + ID3D11VertexShader_AddRef(iface); *object = iface; return S_OK; } - WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid)); + if (IsEqualGUID(riid, &IID_ID3D10VertexShader) + || IsEqualGUID(riid, &IID_ID3D10DeviceChild)) + { + IUnknown_AddRef(&shader->ID3D10VertexShader_iface); + *object = &shader->ID3D10VertexShader_iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); *object = NULL; return E_NOINTERFACE; } -static ULONG STDMETHODCALLTYPE d3d10_vertex_shader_AddRef(ID3D10VertexShader *iface) +static ULONG STDMETHODCALLTYPE d3d11_vertex_shader_AddRef(ID3D11VertexShader *iface) { - struct d3d10_vertex_shader *This = impl_from_ID3D10VertexShader(iface); - ULONG refcount = InterlockedIncrement(&This->refcount); + struct d3d_vertex_shader *shader = impl_from_ID3D11VertexShader(iface); + ULONG refcount = InterlockedIncrement(&shader->refcount); - TRACE("%p increasing refcount to %u\n", This, refcount); + TRACE("%p increasing refcount to %u.\n", shader, refcount); if (refcount == 1) { - ID3D10Device1_AddRef(This->device); + ID3D11Device_AddRef(shader->device); wined3d_mutex_lock(); - wined3d_shader_incref(This->wined3d_shader); + wined3d_shader_incref(shader->wined3d_shader); wined3d_mutex_unlock(); } return refcount; } -static ULONG STDMETHODCALLTYPE d3d10_vertex_shader_Release(ID3D10VertexShader *iface) +static ULONG STDMETHODCALLTYPE d3d11_vertex_shader_Release(ID3D11VertexShader *iface) { - struct d3d10_vertex_shader *This = impl_from_ID3D10VertexShader(iface); - ULONG refcount = InterlockedDecrement(&This->refcount); + struct d3d_vertex_shader *shader = impl_from_ID3D11VertexShader(iface); + ULONG refcount = InterlockedDecrement(&shader->refcount); - TRACE("%p decreasing refcount to %u\n", This, refcount); + TRACE("%p decreasing refcount to %u.\n", shader, refcount); if (!refcount) { - ID3D10Device1 *device = This->device; + ID3D11Device *device = shader->device; wined3d_mutex_lock(); - wined3d_shader_decref(This->wined3d_shader); + wined3d_shader_decref(shader->wined3d_shader); wined3d_mutex_unlock(); /* Release the device last, it may cause the wined3d device to be * destroyed. */ - ID3D10Device1_Release(device); + ID3D11Device_Release(device); } return refcount; } +static void STDMETHODCALLTYPE d3d11_vertex_shader_GetDevice(ID3D11VertexShader *iface, + ID3D11Device **device) +{ + struct d3d_vertex_shader *shader = impl_from_ID3D11VertexShader(iface); + + TRACE("iface %p, device %p.\n", iface, device); + + *device = shader->device; + ID3D11Device_AddRef(*device); +} + +static HRESULT STDMETHODCALLTYPE d3d11_vertex_shader_GetPrivateData(ID3D11VertexShader *iface, + REFGUID guid, UINT *data_size, void *data) +{ + struct d3d_vertex_shader *shader = impl_from_ID3D11VertexShader(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_vertex_shader_SetPrivateData(ID3D11VertexShader *iface, + REFGUID guid, UINT data_size, const void *data) +{ + struct d3d_vertex_shader *shader = impl_from_ID3D11VertexShader(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_vertex_shader_SetPrivateDataInterface(ID3D11VertexShader *iface, + REFGUID guid, const IUnknown *data) +{ + struct d3d_vertex_shader *shader = impl_from_ID3D11VertexShader(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 ID3D11VertexShaderVtbl d3d11_vertex_shader_vtbl = +{ + /* IUnknown methods */ + d3d11_vertex_shader_QueryInterface, + d3d11_vertex_shader_AddRef, + d3d11_vertex_shader_Release, + /* ID3D11DeviceChild methods */ + d3d11_vertex_shader_GetDevice, + d3d11_vertex_shader_GetPrivateData, + d3d11_vertex_shader_SetPrivateData, + d3d11_vertex_shader_SetPrivateDataInterface, +}; + +/* ID3D10VertexShader methods */ + +static inline struct d3d_vertex_shader *impl_from_ID3D10VertexShader(ID3D10VertexShader *iface) +{ + return CONTAINING_RECORD(iface, struct d3d_vertex_shader, ID3D10VertexShader_iface); +} + +/* IUnknown methods */ + +static HRESULT STDMETHODCALLTYPE d3d10_vertex_shader_QueryInterface(ID3D10VertexShader *iface, + REFIID riid, void **object) +{ + struct d3d_vertex_shader *shader = impl_from_ID3D10VertexShader(iface); + + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + + return d3d11_vertex_shader_QueryInterface(&shader->ID3D11VertexShader_iface, riid, object); +} + +static ULONG STDMETHODCALLTYPE d3d10_vertex_shader_AddRef(ID3D10VertexShader *iface) +{ + struct d3d_vertex_shader *shader = impl_from_ID3D10VertexShader(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_vertex_shader_AddRef(&shader->ID3D11VertexShader_iface); +} + +static ULONG STDMETHODCALLTYPE d3d10_vertex_shader_Release(ID3D10VertexShader *iface) +{ + struct d3d_vertex_shader *shader = impl_from_ID3D10VertexShader(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_vertex_shader_Release(&shader->ID3D11VertexShader_iface); +} + /* ID3D10DeviceChild methods */ static void STDMETHODCALLTYPE d3d10_vertex_shader_GetDevice(ID3D10VertexShader *iface, ID3D10Device **device) { - struct d3d10_vertex_shader *shader = impl_from_ID3D10VertexShader(iface); + struct d3d_vertex_shader *shader = impl_from_ID3D10VertexShader(iface); TRACE("iface %p, device %p.\n", iface, device); - *device = (ID3D10Device *)shader->device; - ID3D10Device_AddRef(*device); + ID3D11Device_QueryInterface(shader->device, &IID_ID3D10Device, (void **)device); } static HRESULT STDMETHODCALLTYPE d3d10_vertex_shader_GetPrivateData(ID3D10VertexShader *iface, REFGUID guid, UINT *data_size, void *data) { - struct d3d10_vertex_shader *shader = impl_from_ID3D10VertexShader(iface); + struct d3d_vertex_shader *shader = impl_from_ID3D10VertexShader(iface); TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_get_private_data(&shader->private_store, guid, data_size, data); + return d3d_get_private_data(&shader->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d10_vertex_shader_SetPrivateData(ID3D10VertexShader *iface, REFGUID guid, UINT data_size, const void *data) { - struct d3d10_vertex_shader *shader = impl_from_ID3D10VertexShader(iface); + struct d3d_vertex_shader *shader = impl_from_ID3D10VertexShader(iface); TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_set_private_data(&shader->private_store, guid, data_size, data); + return d3d_set_private_data(&shader->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d10_vertex_shader_SetPrivateDataInterface(ID3D10VertexShader *iface, REFGUID guid, const IUnknown *data) { - struct d3d10_vertex_shader *shader = impl_from_ID3D10VertexShader(iface); + struct d3d_vertex_shader *shader = impl_from_ID3D10VertexShader(iface); TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); - return d3d10_set_private_data_interface(&shader->private_store, guid, data); + return d3d_set_private_data_interface(&shader->private_store, guid, data); } static const struct ID3D10VertexShaderVtbl d3d10_vertex_shader_vtbl = @@ -246,28 +346,29 @@ d3d10_vertex_shader_SetPrivateDataInterface, }; -static void STDMETHODCALLTYPE d3d10_vertex_shader_wined3d_object_destroyed(void *parent) +static void STDMETHODCALLTYPE d3d_vertex_shader_wined3d_object_destroyed(void *parent) { - struct d3d10_vertex_shader *shader = parent; + struct d3d_vertex_shader *shader = parent; wined3d_private_store_cleanup(&shader->private_store); HeapFree(GetProcessHeap(), 0, parent); } -static const struct wined3d_parent_ops d3d10_vertex_shader_wined3d_parent_ops = +static const struct wined3d_parent_ops d3d_vertex_shader_wined3d_parent_ops = { - d3d10_vertex_shader_wined3d_object_destroyed, + d3d_vertex_shader_wined3d_object_destroyed, }; -HRESULT d3d10_vertex_shader_init(struct d3d10_vertex_shader *shader, struct d3d_device *device, +static HRESULT d3d_vertex_shader_init(struct d3d_vertex_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 d3d10_shader_info shader_info; + struct d3d_shader_info shader_info; struct wined3d_shader_desc desc; HRESULT hr; + shader->ID3D11VertexShader_iface.lpVtbl = &d3d11_vertex_shader_vtbl; shader->ID3D10VertexShader_iface.lpVtbl = &d3d10_vertex_shader_vtbl; shader->refcount = 1; wined3d_mutex_lock(); @@ -289,7 +390,7 @@ desc.max_version = 4; hr = wined3d_shader_create_vs(device->wined3d_device, &desc, shader, - &d3d10_vertex_shader_wined3d_parent_ops, &shader->wined3d_shader); + &d3d_vertex_shader_wined3d_parent_ops, &shader->wined3d_shader); shader_free_signature(&input_signature); shader_free_signature(&output_signature); if (FAILED(hr)) @@ -301,13 +402,44 @@ } wined3d_mutex_unlock(); - shader->device = &device->ID3D10Device1_iface; - ID3D10Device1_AddRef(shader->device); + shader->device = &device->ID3D11Device_iface; + ID3D11Device_AddRef(shader->device); return S_OK; } -struct d3d10_vertex_shader *unsafe_impl_from_ID3D10VertexShader(ID3D10VertexShader *iface) +HRESULT d3d_vertex_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, + struct d3d_vertex_shader **shader) +{ + struct d3d_vertex_shader *object; + HRESULT hr; + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + if (FAILED(hr = d3d_vertex_shader_init(object, device, byte_code, byte_code_length))) + { + WARN("Failed to initialize vertex shader, hr %#x.\n", hr); + HeapFree(GetProcessHeap(), 0, object); + return hr; + } + + TRACE("Created vertex shader %p.\n", object); + *shader = object; + + return S_OK; +} + +struct d3d_vertex_shader *unsafe_impl_from_ID3D11VertexShader(ID3D11VertexShader *iface) +{ + if (!iface) + return NULL; + assert(iface->lpVtbl == &d3d11_vertex_shader_vtbl); + + return impl_from_ID3D11VertexShader(iface); +} + +struct d3d_vertex_shader *unsafe_impl_from_ID3D10VertexShader(ID3D10VertexShader *iface) { if (!iface) return NULL; @@ -316,97 +448,208 @@ return impl_from_ID3D10VertexShader(iface); } -static inline struct d3d10_geometry_shader *impl_from_ID3D10GeometryShader(ID3D10GeometryShader *iface) +/* ID3D11GeometryShader methods */ + +static inline struct d3d_geometry_shader *impl_from_ID3D11GeometryShader(ID3D11GeometryShader *iface) { - return CONTAINING_RECORD(iface, struct d3d10_geometry_shader, ID3D10GeometryShader_iface); + return CONTAINING_RECORD(iface, struct d3d_geometry_shader, ID3D11GeometryShader_iface); } -/* IUnknown methods */ - -static HRESULT STDMETHODCALLTYPE d3d10_geometry_shader_QueryInterface(ID3D10GeometryShader *iface, +static HRESULT STDMETHODCALLTYPE d3d11_geometry_shader_QueryInterface(ID3D11GeometryShader *iface, REFIID riid, void **object) { - TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object); + struct d3d_geometry_shader *shader = impl_from_ID3D11GeometryShader(iface); - if (IsEqualGUID(riid, &IID_ID3D10GeometryShader) - || IsEqualGUID(riid, &IID_ID3D10DeviceChild) + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + + if (IsEqualGUID(riid, &IID_ID3D11GeometryShader) + || IsEqualGUID(riid, &IID_ID3D11DeviceChild) || IsEqualGUID(riid, &IID_IUnknown)) { - IUnknown_AddRef(iface); + ID3D11GeometryShader_AddRef(iface); *object = iface; return S_OK; } - WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid)); + if (IsEqualGUID(riid, &IID_ID3D10GeometryShader) + || IsEqualGUID(riid, &IID_ID3D10DeviceChild)) + { + ID3D10GeometryShader_AddRef(&shader->ID3D10GeometryShader_iface); + *object = &shader->ID3D10GeometryShader_iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); *object = NULL; return E_NOINTERFACE; } -static ULONG STDMETHODCALLTYPE d3d10_geometry_shader_AddRef(ID3D10GeometryShader *iface) +static ULONG STDMETHODCALLTYPE d3d11_geometry_shader_AddRef(ID3D11GeometryShader *iface) { - struct d3d10_geometry_shader *This = impl_from_ID3D10GeometryShader(iface); - ULONG refcount = InterlockedIncrement(&This->refcount); + struct d3d_geometry_shader *shader = impl_from_ID3D11GeometryShader(iface); + ULONG refcount = InterlockedIncrement(&shader->refcount); - TRACE("%p increasing refcount to %u\n", This, refcount); + TRACE("%p increasing refcount to %u.\n", shader, refcount); return refcount; } -static ULONG STDMETHODCALLTYPE d3d10_geometry_shader_Release(ID3D10GeometryShader *iface) +static ULONG STDMETHODCALLTYPE d3d11_geometry_shader_Release(ID3D11GeometryShader *iface) { - struct d3d10_geometry_shader *This = impl_from_ID3D10GeometryShader(iface); - ULONG refcount = InterlockedDecrement(&This->refcount); + struct d3d_geometry_shader *shader = impl_from_ID3D11GeometryShader(iface); + ULONG refcount = InterlockedDecrement(&shader->refcount); - TRACE("%p decreasing refcount to %u\n", This, refcount); + TRACE("%p decreasing refcount to %u.\n", shader, refcount); if (!refcount) { + ID3D11Device *device = shader->device; + wined3d_mutex_lock(); - wined3d_shader_decref(This->wined3d_shader); + 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_geometry_shader_GetDevice(ID3D11GeometryShader *iface, + ID3D11Device **device) +{ + struct d3d_geometry_shader *shader = impl_from_ID3D11GeometryShader(iface); + + TRACE("iface %p, device %p.\n", iface, device); + + *device = shader->device; + ID3D11Device_AddRef(*device); +} + +static HRESULT STDMETHODCALLTYPE d3d11_geometry_shader_GetPrivateData(ID3D11GeometryShader *iface, + REFGUID guid, UINT *data_size, void *data) +{ + struct d3d_geometry_shader *shader = impl_from_ID3D11GeometryShader(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_geometry_shader_SetPrivateData(ID3D11GeometryShader *iface, + REFGUID guid, UINT data_size, const void *data) +{ + struct d3d_geometry_shader *shader = impl_from_ID3D11GeometryShader(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_geometry_shader_SetPrivateDataInterface(ID3D11GeometryShader *iface, + REFGUID guid, const IUnknown *data) +{ + struct d3d_geometry_shader *shader = impl_from_ID3D11GeometryShader(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 ID3D11GeometryShaderVtbl d3d11_geometry_shader_vtbl = +{ + /* IUnknown methods */ + d3d11_geometry_shader_QueryInterface, + d3d11_geometry_shader_AddRef, + d3d11_geometry_shader_Release, + /* ID3D11DeviceChild methods */ + d3d11_geometry_shader_GetDevice, + d3d11_geometry_shader_GetPrivateData, + d3d11_geometry_shader_SetPrivateData, + d3d11_geometry_shader_SetPrivateDataInterface, +}; + +/* ID3D10GeometryShader methods */ + +static inline struct d3d_geometry_shader *impl_from_ID3D10GeometryShader(ID3D10GeometryShader *iface) +{ + return CONTAINING_RECORD(iface, struct d3d_geometry_shader, ID3D10GeometryShader_iface); +} + +/* IUnknown methods */ + +static HRESULT STDMETHODCALLTYPE d3d10_geometry_shader_QueryInterface(ID3D10GeometryShader *iface, + REFIID riid, void **object) +{ + struct d3d_geometry_shader *shader = impl_from_ID3D10GeometryShader(iface); + + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + + return d3d11_geometry_shader_QueryInterface(&shader->ID3D11GeometryShader_iface, riid, object); +} + +static ULONG STDMETHODCALLTYPE d3d10_geometry_shader_AddRef(ID3D10GeometryShader *iface) +{ + struct d3d_geometry_shader *shader = impl_from_ID3D10GeometryShader(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_geometry_shader_AddRef(&shader->ID3D11GeometryShader_iface); +} + +static ULONG STDMETHODCALLTYPE d3d10_geometry_shader_Release(ID3D10GeometryShader *iface) +{ + struct d3d_geometry_shader *shader = impl_from_ID3D10GeometryShader(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_geometry_shader_Release(&shader->ID3D11GeometryShader_iface); +} + /* ID3D10DeviceChild methods */ static void STDMETHODCALLTYPE d3d10_geometry_shader_GetDevice(ID3D10GeometryShader *iface, ID3D10Device **device) { - FIXME("iface %p, device %p stub!\n", iface, device); + struct d3d_geometry_shader *shader = impl_from_ID3D10GeometryShader(iface); + + TRACE("iface %p, device %p.\n", iface, device); + + ID3D11Device_QueryInterface(shader->device, &IID_ID3D10Device, (void **)device); } static HRESULT STDMETHODCALLTYPE d3d10_geometry_shader_GetPrivateData(ID3D10GeometryShader *iface, REFGUID guid, UINT *data_size, void *data) { - struct d3d10_geometry_shader *shader = impl_from_ID3D10GeometryShader(iface); + struct d3d_geometry_shader *shader = impl_from_ID3D10GeometryShader(iface); TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_get_private_data(&shader->private_store, guid, data_size, data); + return d3d_get_private_data(&shader->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d10_geometry_shader_SetPrivateData(ID3D10GeometryShader *iface, REFGUID guid, UINT data_size, const void *data) { - struct d3d10_geometry_shader *shader = impl_from_ID3D10GeometryShader(iface); + struct d3d_geometry_shader *shader = impl_from_ID3D10GeometryShader(iface); TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_set_private_data(&shader->private_store, guid, data_size, data); + return d3d_set_private_data(&shader->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d10_geometry_shader_SetPrivateDataInterface(ID3D10GeometryShader *iface, REFGUID guid, const IUnknown *data) { - struct d3d10_geometry_shader *shader = impl_from_ID3D10GeometryShader(iface); + struct d3d_geometry_shader *shader = impl_from_ID3D10GeometryShader(iface); TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); - return d3d10_set_private_data_interface(&shader->private_store, guid, data); + return d3d_set_private_data_interface(&shader->private_store, guid, data); } static const struct ID3D10GeometryShaderVtbl d3d10_geometry_shader_vtbl = @@ -422,28 +665,29 @@ d3d10_geometry_shader_SetPrivateDataInterface, }; -static void STDMETHODCALLTYPE d3d10_geometry_shader_wined3d_object_destroyed(void *parent) +static void STDMETHODCALLTYPE d3d_geometry_shader_wined3d_object_destroyed(void *parent) { - struct d3d10_geometry_shader *shader = parent; + struct d3d_geometry_shader *shader = parent; wined3d_private_store_cleanup(&shader->private_store); HeapFree(GetProcessHeap(), 0, parent); } -static const struct wined3d_parent_ops d3d10_geometry_shader_wined3d_parent_ops = +static const struct wined3d_parent_ops d3d_geometry_shader_wined3d_parent_ops = { - d3d10_geometry_shader_wined3d_object_destroyed, + d3d_geometry_shader_wined3d_object_destroyed, }; -HRESULT d3d10_geometry_shader_init(struct d3d10_geometry_shader *shader, struct d3d_device *device, +static HRESULT d3d_geometry_shader_init(struct d3d_geometry_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 d3d10_shader_info shader_info; + struct d3d_shader_info shader_info; struct wined3d_shader_desc desc; HRESULT hr; + shader->ID3D11GeometryShader_iface.lpVtbl = &d3d11_geometry_shader_vtbl; shader->ID3D10GeometryShader_iface.lpVtbl = &d3d10_geometry_shader_vtbl; shader->refcount = 1; wined3d_mutex_lock(); @@ -465,7 +709,7 @@ desc.max_version = 4; hr = wined3d_shader_create_gs(device->wined3d_device, &desc, shader, - &d3d10_geometry_shader_wined3d_parent_ops, &shader->wined3d_shader); + &d3d_geometry_shader_wined3d_parent_ops, &shader->wined3d_shader); shader_free_signature(&input_signature); shader_free_signature(&output_signature); if (FAILED(hr)) @@ -477,10 +721,44 @@ } wined3d_mutex_unlock(); + shader->device = &device->ID3D11Device_iface; + ID3D11Device_AddRef(shader->device); + return S_OK; } -struct d3d10_geometry_shader *unsafe_impl_from_ID3D10GeometryShader(ID3D10GeometryShader *iface) +HRESULT d3d_geometry_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, + struct d3d_geometry_shader **shader) +{ + struct d3d_geometry_shader *object; + HRESULT hr; + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + if (FAILED(hr = d3d_geometry_shader_init(object, device, byte_code, byte_code_length))) + { + WARN("Failed to initialize geometry shader, hr %#x.\n", hr); + HeapFree(GetProcessHeap(), 0, object); + return hr; + } + + TRACE("Created geometry shader %p.\n", object); + *shader = object; + + return S_OK; +} + +struct d3d_geometry_shader *unsafe_impl_from_ID3D11GeometryShader(ID3D11GeometryShader *iface) +{ + if (!iface) + return NULL; + assert(iface->lpVtbl == &d3d11_geometry_shader_vtbl); + + return impl_from_ID3D11GeometryShader(iface); +} + +struct d3d_geometry_shader *unsafe_impl_from_ID3D10GeometryShader(ID3D10GeometryShader *iface) { if (!iface) return NULL; @@ -489,115 +767,215 @@ return impl_from_ID3D10GeometryShader(iface); } -static inline struct d3d10_pixel_shader *impl_from_ID3D10PixelShader(ID3D10PixelShader *iface) +/* ID3D11PixelShader methods */ + +static inline struct d3d_pixel_shader *impl_from_ID3D11PixelShader(ID3D11PixelShader *iface) { - return CONTAINING_RECORD(iface, struct d3d10_pixel_shader, ID3D10PixelShader_iface); + return CONTAINING_RECORD(iface, struct d3d_pixel_shader, ID3D11PixelShader_iface); } -/* IUnknown methods */ - -static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_QueryInterface(ID3D10PixelShader *iface, +static HRESULT STDMETHODCALLTYPE d3d11_pixel_shader_QueryInterface(ID3D11PixelShader *iface, REFIID riid, void **object) { - TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object); + struct d3d_pixel_shader *shader = impl_from_ID3D11PixelShader(iface); - if (IsEqualGUID(riid, &IID_ID3D10PixelShader) - || IsEqualGUID(riid, &IID_ID3D10DeviceChild) + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + + if (IsEqualGUID(riid, &IID_ID3D11PixelShader) + || IsEqualGUID(riid, &IID_ID3D11DeviceChild) || IsEqualGUID(riid, &IID_IUnknown)) { - IUnknown_AddRef(iface); + ID3D11PixelShader_AddRef(iface); *object = iface; return S_OK; } - WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid)); + if (IsEqualGUID(riid, &IID_ID3D10PixelShader) + || IsEqualGUID(riid, &IID_ID3D10DeviceChild)) + { + IUnknown_AddRef(&shader->ID3D10PixelShader_iface); + *object = &shader->ID3D10PixelShader_iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); *object = NULL; return E_NOINTERFACE; } -static ULONG STDMETHODCALLTYPE d3d10_pixel_shader_AddRef(ID3D10PixelShader *iface) +static ULONG STDMETHODCALLTYPE d3d11_pixel_shader_AddRef(ID3D11PixelShader *iface) { - struct d3d10_pixel_shader *This = impl_from_ID3D10PixelShader(iface); - ULONG refcount = InterlockedIncrement(&This->refcount); + struct d3d_pixel_shader *shader = impl_from_ID3D11PixelShader(iface); + ULONG refcount = InterlockedIncrement(&shader->refcount); - TRACE("%p increasing refcount to %u\n", This, refcount); + TRACE("%p increasing refcount to %u.\n", shader, refcount); if (refcount == 1) { - ID3D10Device1_AddRef(This->device); + ID3D11Device_AddRef(shader->device); wined3d_mutex_lock(); - wined3d_shader_incref(This->wined3d_shader); + wined3d_shader_incref(shader->wined3d_shader); wined3d_mutex_unlock(); } return refcount; } -static ULONG STDMETHODCALLTYPE d3d10_pixel_shader_Release(ID3D10PixelShader *iface) +static ULONG STDMETHODCALLTYPE d3d11_pixel_shader_Release(ID3D11PixelShader *iface) { - struct d3d10_pixel_shader *This = impl_from_ID3D10PixelShader(iface); - ULONG refcount = InterlockedDecrement(&This->refcount); + struct d3d_pixel_shader *shader = impl_from_ID3D11PixelShader(iface); + ULONG refcount = InterlockedDecrement(&shader->refcount); - TRACE("%p decreasing refcount to %u\n", This, refcount); + TRACE("%p decreasing refcount to %u.\n", shader, refcount); if (!refcount) { - ID3D10Device1 *device = This->device; + ID3D11Device *device = shader->device; wined3d_mutex_lock(); - wined3d_shader_decref(This->wined3d_shader); + wined3d_shader_decref(shader->wined3d_shader); wined3d_mutex_unlock(); /* Release the device last, it may cause the wined3d device to be * destroyed. */ - ID3D10Device1_Release(device); + ID3D11Device_Release(device); } return refcount; } +static void STDMETHODCALLTYPE d3d11_pixel_shader_GetDevice(ID3D11PixelShader *iface, + ID3D11Device **device) +{ + struct d3d_pixel_shader *shader = impl_from_ID3D11PixelShader(iface); + + TRACE("iface %p, device %p.\n", iface, device); + + *device = shader->device; + ID3D11Device_AddRef(*device); +} + +static HRESULT STDMETHODCALLTYPE d3d11_pixel_shader_GetPrivateData(ID3D11PixelShader *iface, + REFGUID guid, UINT *data_size, void *data) +{ + struct d3d_pixel_shader *shader = impl_from_ID3D11PixelShader(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_pixel_shader_SetPrivateData(ID3D11PixelShader *iface, + REFGUID guid, UINT data_size, const void *data) +{ + struct d3d_pixel_shader *shader = impl_from_ID3D11PixelShader(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_pixel_shader_SetPrivateDataInterface(ID3D11PixelShader *iface, + REFGUID guid, const IUnknown *data) +{ + struct d3d_pixel_shader *shader = impl_from_ID3D11PixelShader(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 ID3D11PixelShaderVtbl d3d11_pixel_shader_vtbl = +{ + /* IUnknown methods */ + d3d11_pixel_shader_QueryInterface, + d3d11_pixel_shader_AddRef, + d3d11_pixel_shader_Release, + /* ID3D11DeviceChild methods */ + d3d11_pixel_shader_GetDevice, + d3d11_pixel_shader_GetPrivateData, + d3d11_pixel_shader_SetPrivateData, + d3d11_pixel_shader_SetPrivateDataInterface, +}; + +/* ID3D10PixelShader methods */ + +static inline struct d3d_pixel_shader *impl_from_ID3D10PixelShader(ID3D10PixelShader *iface) +{ + return CONTAINING_RECORD(iface, struct d3d_pixel_shader, ID3D10PixelShader_iface); +} + +/* IUnknown methods */ + +static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_QueryInterface(ID3D10PixelShader *iface, + REFIID riid, void **object) +{ + struct d3d_pixel_shader *shader = impl_from_ID3D10PixelShader(iface); + + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + + return d3d11_pixel_shader_QueryInterface(&shader->ID3D11PixelShader_iface, riid, object); +} + +static ULONG STDMETHODCALLTYPE d3d10_pixel_shader_AddRef(ID3D10PixelShader *iface) +{ + struct d3d_pixel_shader *shader = impl_from_ID3D10PixelShader(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_pixel_shader_AddRef(&shader->ID3D11PixelShader_iface); +} + +static ULONG STDMETHODCALLTYPE d3d10_pixel_shader_Release(ID3D10PixelShader *iface) +{ + struct d3d_pixel_shader *shader = impl_from_ID3D10PixelShader(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_pixel_shader_Release(&shader->ID3D11PixelShader_iface); +} + /* ID3D10DeviceChild methods */ static void STDMETHODCALLTYPE d3d10_pixel_shader_GetDevice(ID3D10PixelShader *iface, ID3D10Device **device) { - struct d3d10_pixel_shader *shader = impl_from_ID3D10PixelShader(iface); + struct d3d_pixel_shader *shader = impl_from_ID3D10PixelShader(iface); TRACE("iface %p, device %p.\n", iface, device); - *device = (ID3D10Device *)shader->device; - ID3D10Device_AddRef(*device); + ID3D11Device_QueryInterface(shader->device, &IID_ID3D10Device, (void **)device); } static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_GetPrivateData(ID3D10PixelShader *iface, REFGUID guid, UINT *data_size, void *data) { - struct d3d10_pixel_shader *shader = impl_from_ID3D10PixelShader(iface); + struct d3d_pixel_shader *shader = impl_from_ID3D10PixelShader(iface); TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_get_private_data(&shader->private_store, guid, data_size, data); + return d3d_get_private_data(&shader->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_SetPrivateData(ID3D10PixelShader *iface, REFGUID guid, UINT data_size, const void *data) { - struct d3d10_pixel_shader *shader = impl_from_ID3D10PixelShader(iface); + struct d3d_pixel_shader *shader = impl_from_ID3D10PixelShader(iface); TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_set_private_data(&shader->private_store, guid, data_size, data); + return d3d_set_private_data(&shader->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_SetPrivateDataInterface(ID3D10PixelShader *iface, REFGUID guid, const IUnknown *data) { - struct d3d10_pixel_shader *shader = impl_from_ID3D10PixelShader(iface); + struct d3d_pixel_shader *shader = impl_from_ID3D10PixelShader(iface); TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); - return d3d10_set_private_data_interface(&shader->private_store, guid, data); + return d3d_set_private_data_interface(&shader->private_store, guid, data); } static const struct ID3D10PixelShaderVtbl d3d10_pixel_shader_vtbl = @@ -613,28 +991,29 @@ d3d10_pixel_shader_SetPrivateDataInterface, }; -static void STDMETHODCALLTYPE d3d10_pixel_shader_wined3d_object_destroyed(void *parent) +static void STDMETHODCALLTYPE d3d_pixel_shader_wined3d_object_destroyed(void *parent) { - struct d3d10_pixel_shader *shader = parent; + struct d3d_pixel_shader *shader = parent; wined3d_private_store_cleanup(&shader->private_store); HeapFree(GetProcessHeap(), 0, parent); } -static const struct wined3d_parent_ops d3d10_pixel_shader_wined3d_parent_ops = +static const struct wined3d_parent_ops d3d_pixel_shader_wined3d_parent_ops = { - d3d10_pixel_shader_wined3d_object_destroyed, + d3d_pixel_shader_wined3d_object_destroyed, }; -HRESULT d3d10_pixel_shader_init(struct d3d10_pixel_shader *shader, struct d3d_device *device, +static HRESULT d3d_pixel_shader_init(struct d3d_pixel_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 d3d10_shader_info shader_info; + struct d3d_shader_info shader_info; struct wined3d_shader_desc desc; HRESULT hr; + shader->ID3D11PixelShader_iface.lpVtbl = &d3d11_pixel_shader_vtbl; shader->ID3D10PixelShader_iface.lpVtbl = &d3d10_pixel_shader_vtbl; shader->refcount = 1; wined3d_mutex_lock(); @@ -656,7 +1035,7 @@ desc.max_version = 4; hr = wined3d_shader_create_ps(device->wined3d_device, &desc, shader, - &d3d10_pixel_shader_wined3d_parent_ops, &shader->wined3d_shader); + &d3d_pixel_shader_wined3d_parent_ops, &shader->wined3d_shader); shader_free_signature(&input_signature); shader_free_signature(&output_signature); if (FAILED(hr)) @@ -668,13 +1047,44 @@ } wined3d_mutex_unlock(); - shader->device = &device->ID3D10Device1_iface; - ID3D10Device1_AddRef(shader->device); + shader->device = &device->ID3D11Device_iface; + ID3D11Device_AddRef(shader->device); return S_OK; } -struct d3d10_pixel_shader *unsafe_impl_from_ID3D10PixelShader(ID3D10PixelShader *iface) +HRESULT d3d_pixel_shader_create(struct d3d_device *device, const void *byte_code, SIZE_T byte_code_length, + struct d3d_pixel_shader **shader) +{ + struct d3d_pixel_shader *object; + HRESULT hr; + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + if (FAILED(hr = d3d_pixel_shader_init(object, device, byte_code, byte_code_length))) + { + WARN("Failed to initialize pixel shader, hr %#x.\n", hr); + HeapFree(GetProcessHeap(), 0, object); + return hr; + } + + TRACE("Created pixel shader %p.\n", object); + *shader = object; + + return S_OK; +} + +struct d3d_pixel_shader *unsafe_impl_from_ID3D11PixelShader(ID3D11PixelShader *iface) +{ + if (!iface) + return NULL; + assert(iface->lpVtbl == &d3d11_pixel_shader_vtbl); + + return impl_from_ID3D11PixelShader(iface); +} + +struct d3d_pixel_shader *unsafe_impl_from_ID3D10PixelShader(ID3D10PixelShader *iface) { if (!iface) return NULL; diff -Nru wine1.7-1.7.50/dlls/d3d11/state.c wine1.7-1.7.55/dlls/d3d11/state.c --- wine1.7-1.7.50/dlls/d3d11/state.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d11/state.c 2015-11-13 14:32:40.000000000 +0000 @@ -24,62 +24,67 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d11); -#define D3D10_FILTER_MIP_MASK 0x01 -#define D3D10_FILTER_MAG_MASK 0x04 -#define D3D10_FILTER_MIN_MASK 0x10 -#define D3D10_FILTER_ANISO_MASK 0x40 -#define D3D10_FILTER_COMPARE_MASK 0x80 +/* ID3D11BlendState methods */ -static inline struct d3d10_blend_state *impl_from_ID3D10BlendState(ID3D10BlendState *iface) +static inline struct d3d_blend_state *impl_from_ID3D11BlendState(ID3D11BlendState *iface) { - return CONTAINING_RECORD(iface, struct d3d10_blend_state, ID3D10BlendState_iface); + return CONTAINING_RECORD(iface, struct d3d_blend_state, ID3D11BlendState_iface); } -/* IUnknown methods */ - -static HRESULT STDMETHODCALLTYPE d3d10_blend_state_QueryInterface(ID3D10BlendState *iface, +static HRESULT STDMETHODCALLTYPE d3d11_blend_state_QueryInterface(ID3D11BlendState *iface, REFIID riid, void **object) { + struct d3d_blend_state *state = impl_from_ID3D11BlendState(iface); + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); - if (IsEqualGUID(riid, &IID_ID3D10BlendState) - || IsEqualGUID(riid, &IID_ID3D10DeviceChild) + if (IsEqualGUID(riid, &IID_ID3D11BlendState) + || IsEqualGUID(riid, &IID_ID3D11DeviceChild) || IsEqualGUID(riid, &IID_IUnknown)) { - IUnknown_AddRef(iface); + ID3D11BlendState_AddRef(iface); *object = iface; return S_OK; } + if (IsEqualGUID(riid, &IID_ID3D10BlendState1) + || IsEqualGUID(riid, &IID_ID3D10BlendState) + || IsEqualGUID(riid, &IID_ID3D10DeviceChild)) + { + ID3D10BlendState1_AddRef(&state->ID3D10BlendState1_iface); + *object = &state->ID3D10BlendState1_iface; + return S_OK; + } + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); *object = NULL; return E_NOINTERFACE; } -static ULONG STDMETHODCALLTYPE d3d10_blend_state_AddRef(ID3D10BlendState *iface) +static ULONG STDMETHODCALLTYPE d3d11_blend_state_AddRef(ID3D11BlendState *iface) { - struct d3d10_blend_state *This = impl_from_ID3D10BlendState(iface); - ULONG refcount = InterlockedIncrement(&This->refcount); + struct d3d_blend_state *state = impl_from_ID3D11BlendState(iface); + ULONG refcount = InterlockedIncrement(&state->refcount); - TRACE("%p increasing refcount to %u.\n", This, refcount); + TRACE("%p increasing refcount to %u.\n", state, refcount); return refcount; } -static ULONG STDMETHODCALLTYPE d3d10_blend_state_Release(ID3D10BlendState *iface) +static ULONG STDMETHODCALLTYPE d3d11_blend_state_Release(ID3D11BlendState *iface) { - struct d3d10_blend_state *state = impl_from_ID3D10BlendState(iface); + struct d3d_blend_state *state = impl_from_ID3D11BlendState(iface); ULONG refcount = InterlockedDecrement(&state->refcount); TRACE("%p decreasing refcount to %u.\n", state, refcount); if (!refcount) { - struct d3d_device *device = impl_from_ID3D10Device(state->device); + struct d3d_device *device = impl_from_ID3D11Device(state->device); wined3d_mutex_lock(); wine_rb_remove(&device->blend_states, &state->desc); - ID3D10Device1_Release(state->device); + ID3D11Device_Release(state->device); wined3d_private_store_cleanup(&state->private_store); wined3d_mutex_unlock(); HeapFree(GetProcessHeap(), 0, state); @@ -88,63 +93,185 @@ return refcount; } +static void STDMETHODCALLTYPE d3d11_blend_state_GetDevice(ID3D11BlendState *iface, + ID3D11Device **device) +{ + struct d3d_blend_state *state = impl_from_ID3D11BlendState(iface); + + TRACE("iface %p, device %p.\n", iface, device); + + *device = state->device; + ID3D11Device_AddRef(*device); +} + +static HRESULT STDMETHODCALLTYPE d3d11_blend_state_GetPrivateData(ID3D11BlendState *iface, + REFGUID guid, UINT *data_size, void *data) +{ + struct d3d_blend_state *state = impl_from_ID3D11BlendState(iface); + + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_get_private_data(&state->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_blend_state_SetPrivateData(ID3D11BlendState *iface, + REFGUID guid, UINT data_size, const void *data) +{ + struct d3d_blend_state *state = impl_from_ID3D11BlendState(iface); + + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_set_private_data(&state->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_blend_state_SetPrivateDataInterface(ID3D11BlendState *iface, + REFGUID guid, const IUnknown *data) +{ + struct d3d_blend_state *state = impl_from_ID3D11BlendState(iface); + + TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); + + return d3d_set_private_data_interface(&state->private_store, guid, data); +} + +static void STDMETHODCALLTYPE d3d11_blend_state_GetDesc(ID3D11BlendState *iface, D3D11_BLEND_DESC *desc) +{ + struct d3d_blend_state *state = impl_from_ID3D11BlendState(iface); + + TRACE("iface %p, desc %p.\n", iface, desc); + + *desc = state->desc; +} + +static const struct ID3D11BlendStateVtbl d3d11_blend_state_vtbl = +{ + /* IUnknown methods */ + d3d11_blend_state_QueryInterface, + d3d11_blend_state_AddRef, + d3d11_blend_state_Release, + /* ID3D11DeviceChild methods */ + d3d11_blend_state_GetDevice, + d3d11_blend_state_GetPrivateData, + d3d11_blend_state_SetPrivateData, + d3d11_blend_state_SetPrivateDataInterface, + /* ID3D11BlendState methods */ + d3d11_blend_state_GetDesc, +}; + +/* ID3D10BlendState methods */ + +static inline struct d3d_blend_state *impl_from_ID3D10BlendState(ID3D10BlendState1 *iface) +{ + return CONTAINING_RECORD(iface, struct d3d_blend_state, ID3D10BlendState1_iface); +} + +/* IUnknown methods */ + +static HRESULT STDMETHODCALLTYPE d3d10_blend_state_QueryInterface(ID3D10BlendState1 *iface, + REFIID riid, void **object) +{ + struct d3d_blend_state *state = impl_from_ID3D10BlendState(iface); + + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + + return d3d11_blend_state_QueryInterface(&state->ID3D11BlendState_iface, riid, object); +} + +static ULONG STDMETHODCALLTYPE d3d10_blend_state_AddRef(ID3D10BlendState1 *iface) +{ + struct d3d_blend_state *state = impl_from_ID3D10BlendState(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_blend_state_AddRef(&state->ID3D11BlendState_iface); +} + +static ULONG STDMETHODCALLTYPE d3d10_blend_state_Release(ID3D10BlendState1 *iface) +{ + struct d3d_blend_state *state = impl_from_ID3D10BlendState(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_blend_state_Release(&state->ID3D11BlendState_iface); +} + /* ID3D10DeviceChild methods */ -static void STDMETHODCALLTYPE d3d10_blend_state_GetDevice(ID3D10BlendState *iface, ID3D10Device **device) +static void STDMETHODCALLTYPE d3d10_blend_state_GetDevice(ID3D10BlendState1 *iface, ID3D10Device **device) { - struct d3d10_blend_state *state = impl_from_ID3D10BlendState(iface); + struct d3d_blend_state *state = impl_from_ID3D10BlendState(iface); TRACE("iface %p, device %p.\n", iface, device); - *device = (ID3D10Device *)state->device; - ID3D10Device_AddRef(*device); + ID3D11Device_QueryInterface(state->device, &IID_ID3D10Device, (void **)device); } -static HRESULT STDMETHODCALLTYPE d3d10_blend_state_GetPrivateData(ID3D10BlendState *iface, +static HRESULT STDMETHODCALLTYPE d3d10_blend_state_GetPrivateData(ID3D10BlendState1 *iface, REFGUID guid, UINT *data_size, void *data) { - struct d3d10_blend_state *state = impl_from_ID3D10BlendState(iface); + struct d3d_blend_state *state = impl_from_ID3D10BlendState(iface); TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_get_private_data(&state->private_store, guid, data_size, data); + return d3d_get_private_data(&state->private_store, guid, data_size, data); } -static HRESULT STDMETHODCALLTYPE d3d10_blend_state_SetPrivateData(ID3D10BlendState *iface, +static HRESULT STDMETHODCALLTYPE d3d10_blend_state_SetPrivateData(ID3D10BlendState1 *iface, REFGUID guid, UINT data_size, const void *data) { - struct d3d10_blend_state *state = impl_from_ID3D10BlendState(iface); + struct d3d_blend_state *state = impl_from_ID3D10BlendState(iface); TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_set_private_data(&state->private_store, guid, data_size, data); + return d3d_set_private_data(&state->private_store, guid, data_size, data); } -static HRESULT STDMETHODCALLTYPE d3d10_blend_state_SetPrivateDataInterface(ID3D10BlendState *iface, +static HRESULT STDMETHODCALLTYPE d3d10_blend_state_SetPrivateDataInterface(ID3D10BlendState1 *iface, REFGUID guid, const IUnknown *data) { - struct d3d10_blend_state *state = impl_from_ID3D10BlendState(iface); + struct d3d_blend_state *state = impl_from_ID3D10BlendState(iface); TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); - return d3d10_set_private_data_interface(&state->private_store, guid, data); + return d3d_set_private_data_interface(&state->private_store, guid, data); } /* ID3D10BlendState methods */ -static void STDMETHODCALLTYPE d3d10_blend_state_GetDesc(ID3D10BlendState *iface, - D3D10_BLEND_DESC *desc) +static void STDMETHODCALLTYPE d3d10_blend_state_GetDesc(ID3D10BlendState1 *iface, D3D10_BLEND_DESC *desc) { - struct d3d10_blend_state *state = impl_from_ID3D10BlendState(iface); + struct d3d_blend_state *state = impl_from_ID3D10BlendState(iface); + const D3D11_BLEND_DESC *d3d11_desc = &state->desc; + unsigned int i; TRACE("iface %p, desc %p.\n", iface, desc); - *desc = state->desc; + desc->AlphaToCoverageEnable = d3d11_desc->AlphaToCoverageEnable; + desc->SrcBlend = d3d11_desc->RenderTarget[0].SrcBlend; + desc->DestBlend = d3d11_desc->RenderTarget[0].DestBlend; + desc->BlendOp = d3d11_desc->RenderTarget[0].BlendOp; + desc->SrcBlendAlpha = d3d11_desc->RenderTarget[0].SrcBlendAlpha; + desc->DestBlendAlpha = d3d11_desc->RenderTarget[0].DestBlendAlpha; + desc->BlendOpAlpha = d3d11_desc->RenderTarget[0].BlendOpAlpha; + for (i = 0; i < D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i) + { + desc->BlendEnable[i] = d3d11_desc->RenderTarget[i].BlendEnable; + desc->RenderTargetWriteMask[i] = d3d11_desc->RenderTarget[i].RenderTargetWriteMask; + } +} + +static void STDMETHODCALLTYPE d3d10_blend_state_GetDesc1(ID3D10BlendState1 *iface, D3D10_BLEND_DESC1 *desc) +{ + struct d3d_blend_state *state = impl_from_ID3D10BlendState(iface); + + TRACE("iface %p, desc %p.\n", iface, desc); + + memcpy(desc, &state->desc, sizeof(*desc)); } -static const struct ID3D10BlendStateVtbl d3d10_blend_state_vtbl = +static const struct ID3D10BlendState1Vtbl d3d10_blend_state_vtbl = { /* IUnknown methods */ d3d10_blend_state_QueryInterface, @@ -157,12 +284,15 @@ d3d10_blend_state_SetPrivateDataInterface, /* ID3D10BlendState methods */ d3d10_blend_state_GetDesc, + /* ID3D10BlendState1 methods */ + d3d10_blend_state_GetDesc1, }; -HRESULT d3d10_blend_state_init(struct d3d10_blend_state *state, struct d3d_device *device, - const D3D10_BLEND_DESC *desc) +HRESULT d3d_blend_state_init(struct d3d_blend_state *state, struct d3d_device *device, + const D3D11_BLEND_DESC *desc) { - state->ID3D10BlendState_iface.lpVtbl = &d3d10_blend_state_vtbl; + state->ID3D11BlendState_iface.lpVtbl = &d3d11_blend_state_vtbl; + state->ID3D10BlendState1_iface.lpVtbl = &d3d10_blend_state_vtbl; state->refcount = 1; wined3d_mutex_lock(); wined3d_private_store_init(&state->private_store); @@ -177,71 +307,90 @@ } wined3d_mutex_unlock(); - state->device = &device->ID3D10Device1_iface; - ID3D10Device1_AddRef(state->device); + state->device = &device->ID3D11Device_iface; + ID3D11Device_AddRef(state->device); return S_OK; } -struct d3d10_blend_state *unsafe_impl_from_ID3D10BlendState(ID3D10BlendState *iface) +struct d3d_blend_state *unsafe_impl_from_ID3D11BlendState(ID3D11BlendState *iface) { if (!iface) return NULL; - assert(iface->lpVtbl == &d3d10_blend_state_vtbl); + assert(iface->lpVtbl == &d3d11_blend_state_vtbl); - return impl_from_ID3D10BlendState(iface); + return impl_from_ID3D11BlendState(iface); } -static inline struct d3d10_depthstencil_state *impl_from_ID3D10DepthStencilState(ID3D10DepthStencilState *iface) +struct d3d_blend_state *unsafe_impl_from_ID3D10BlendState(ID3D10BlendState *iface) { - return CONTAINING_RECORD(iface, struct d3d10_depthstencil_state, ID3D10DepthStencilState_iface); + if (!iface) + return NULL; + assert(iface->lpVtbl == (ID3D10BlendStateVtbl *)&d3d10_blend_state_vtbl); + + return impl_from_ID3D10BlendState((ID3D10BlendState1 *)iface); } -/* IUnknown methods */ +/* ID3D11DepthStencilState methods */ -static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_state_QueryInterface(ID3D10DepthStencilState *iface, +static inline struct d3d_depthstencil_state *impl_from_ID3D11DepthStencilState(ID3D11DepthStencilState *iface) +{ + return CONTAINING_RECORD(iface, struct d3d_depthstencil_state, ID3D11DepthStencilState_iface); +} + +static HRESULT STDMETHODCALLTYPE d3d11_depthstencil_state_QueryInterface(ID3D11DepthStencilState *iface, REFIID riid, void **object) { + struct d3d_depthstencil_state *state = impl_from_ID3D11DepthStencilState(iface); + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); - if (IsEqualGUID(riid, &IID_ID3D10DepthStencilState) - || IsEqualGUID(riid, &IID_ID3D10DeviceChild) + if (IsEqualGUID(riid, &IID_ID3D11DepthStencilState) + || IsEqualGUID(riid, &IID_ID3D11DeviceChild) || IsEqualGUID(riid, &IID_IUnknown)) { - IUnknown_AddRef(iface); + ID3D11DepthStencilState_AddRef(iface); *object = iface; return S_OK; } + if (IsEqualGUID(riid, &IID_ID3D10DepthStencilState) + || IsEqualGUID(riid, &IID_ID3D10DeviceChild)) + { + ID3D10DepthStencilState_AddRef(&state->ID3D10DepthStencilState_iface); + *object = &state->ID3D10DepthStencilState_iface; + return S_OK; + } + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); *object = NULL; return E_NOINTERFACE; } -static ULONG STDMETHODCALLTYPE d3d10_depthstencil_state_AddRef(ID3D10DepthStencilState *iface) +static ULONG STDMETHODCALLTYPE d3d11_depthstencil_state_AddRef(ID3D11DepthStencilState *iface) { - struct d3d10_depthstencil_state *This = impl_from_ID3D10DepthStencilState(iface); - ULONG refcount = InterlockedIncrement(&This->refcount); + struct d3d_depthstencil_state *state = impl_from_ID3D11DepthStencilState(iface); + ULONG refcount = InterlockedIncrement(&state->refcount); - TRACE("%p increasing refcount to %u.\n", This, refcount); + TRACE("%p increasing refcount to %u.\n", state, refcount); return refcount; } -static ULONG STDMETHODCALLTYPE d3d10_depthstencil_state_Release(ID3D10DepthStencilState *iface) +static ULONG STDMETHODCALLTYPE d3d11_depthstencil_state_Release(ID3D11DepthStencilState *iface) { - struct d3d10_depthstencil_state *state = impl_from_ID3D10DepthStencilState(iface); + struct d3d_depthstencil_state *state = impl_from_ID3D11DepthStencilState(iface); ULONG refcount = InterlockedDecrement(&state->refcount); TRACE("%p decreasing refcount to %u.\n", state, refcount); if (!refcount) { - struct d3d_device *device = impl_from_ID3D10Device(state->device); + struct d3d_device *device = impl_from_ID3D11Device(state->device); wined3d_mutex_lock(); wine_rb_remove(&device->depthstencil_states, &state->desc); - ID3D10Device1_Release(state->device); + ID3D11Device_Release(state->device); wined3d_private_store_cleanup(&state->private_store); wined3d_mutex_unlock(); HeapFree(GetProcessHeap(), 0, state); @@ -250,48 +399,150 @@ return refcount; } +static void STDMETHODCALLTYPE d3d11_depthstencil_state_GetDevice(ID3D11DepthStencilState *iface, + ID3D11Device **device) +{ + struct d3d_depthstencil_state *state = impl_from_ID3D11DepthStencilState(iface); + + TRACE("iface %p, device %p.\n", iface, device); + + *device = state->device; + ID3D11Device_AddRef(*device); +} + +static HRESULT STDMETHODCALLTYPE d3d11_depthstencil_state_GetPrivateData(ID3D11DepthStencilState *iface, + REFGUID guid, UINT *data_size, void *data) +{ + struct d3d_depthstencil_state *state = impl_from_ID3D11DepthStencilState(iface); + + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_get_private_data(&state->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_depthstencil_state_SetPrivateData(ID3D11DepthStencilState *iface, + REFGUID guid, UINT data_size, const void *data) +{ + struct d3d_depthstencil_state *state = impl_from_ID3D11DepthStencilState(iface); + + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_set_private_data(&state->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_depthstencil_state_SetPrivateDataInterface(ID3D11DepthStencilState *iface, + REFGUID guid, const IUnknown *data) +{ + struct d3d_depthstencil_state *state = impl_from_ID3D11DepthStencilState(iface); + + TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); + + return d3d_set_private_data_interface(&state->private_store, guid, data); +} + +static void STDMETHODCALLTYPE d3d11_depthstencil_state_GetDesc(ID3D11DepthStencilState *iface, + D3D11_DEPTH_STENCIL_DESC *desc) +{ + struct d3d_depthstencil_state *state = impl_from_ID3D11DepthStencilState(iface); + + TRACE("iface %p, desc %p.\n", iface, desc); + + *desc = state->desc; +} + +static const struct ID3D11DepthStencilStateVtbl d3d11_depthstencil_state_vtbl = +{ + /* IUnknown methods */ + d3d11_depthstencil_state_QueryInterface, + d3d11_depthstencil_state_AddRef, + d3d11_depthstencil_state_Release, + /* ID3D11DeviceChild methods */ + d3d11_depthstencil_state_GetDevice, + d3d11_depthstencil_state_GetPrivateData, + d3d11_depthstencil_state_SetPrivateData, + d3d11_depthstencil_state_SetPrivateDataInterface, + /* ID3D11DepthStencilState methods */ + d3d11_depthstencil_state_GetDesc, +}; + +/* ID3D10DepthStencilState methods */ + +static inline struct d3d_depthstencil_state *impl_from_ID3D10DepthStencilState(ID3D10DepthStencilState *iface) +{ + return CONTAINING_RECORD(iface, struct d3d_depthstencil_state, ID3D10DepthStencilState_iface); +} + +/* IUnknown methods */ + +static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_state_QueryInterface(ID3D10DepthStencilState *iface, + REFIID riid, void **object) +{ + struct d3d_depthstencil_state *state = impl_from_ID3D10DepthStencilState(iface); + + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + + return d3d11_depthstencil_state_QueryInterface(&state->ID3D11DepthStencilState_iface, riid, object); +} + +static ULONG STDMETHODCALLTYPE d3d10_depthstencil_state_AddRef(ID3D10DepthStencilState *iface) +{ + struct d3d_depthstencil_state *state = impl_from_ID3D10DepthStencilState(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_depthstencil_state_AddRef(&state->ID3D11DepthStencilState_iface); +} + +static ULONG STDMETHODCALLTYPE d3d10_depthstencil_state_Release(ID3D10DepthStencilState *iface) +{ + struct d3d_depthstencil_state *state = impl_from_ID3D10DepthStencilState(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_depthstencil_state_Release(&state->ID3D11DepthStencilState_iface); +} + /* ID3D10DeviceChild methods */ static void STDMETHODCALLTYPE d3d10_depthstencil_state_GetDevice(ID3D10DepthStencilState *iface, ID3D10Device **device) { - struct d3d10_depthstencil_state *state = impl_from_ID3D10DepthStencilState(iface); + struct d3d_depthstencil_state *state = impl_from_ID3D10DepthStencilState(iface); TRACE("iface %p, device %p.\n", iface, device); - *device = (ID3D10Device *)state->device; - ID3D10Device_AddRef(*device); + ID3D11Device_QueryInterface(state->device, &IID_ID3D10Device, (void **)device); } static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_state_GetPrivateData(ID3D10DepthStencilState *iface, REFGUID guid, UINT *data_size, void *data) { - struct d3d10_depthstencil_state *state = impl_from_ID3D10DepthStencilState(iface); + struct d3d_depthstencil_state *state = impl_from_ID3D10DepthStencilState(iface); TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_get_private_data(&state->private_store, guid, data_size, data); + return d3d_get_private_data(&state->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_state_SetPrivateData(ID3D10DepthStencilState *iface, REFGUID guid, UINT data_size, const void *data) { - struct d3d10_depthstencil_state *state = impl_from_ID3D10DepthStencilState(iface); + struct d3d_depthstencil_state *state = impl_from_ID3D10DepthStencilState(iface); TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_set_private_data(&state->private_store, guid, data_size, data); + return d3d_set_private_data(&state->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_state_SetPrivateDataInterface(ID3D10DepthStencilState *iface, REFGUID guid, const IUnknown *data) { - struct d3d10_depthstencil_state *state = impl_from_ID3D10DepthStencilState(iface); + struct d3d_depthstencil_state *state = impl_from_ID3D10DepthStencilState(iface); TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); - return d3d10_set_private_data_interface(&state->private_store, guid, data); + return d3d_set_private_data_interface(&state->private_store, guid, data); } /* ID3D10DepthStencilState methods */ @@ -299,11 +550,11 @@ static void STDMETHODCALLTYPE d3d10_depthstencil_state_GetDesc(ID3D10DepthStencilState *iface, D3D10_DEPTH_STENCIL_DESC *desc) { - struct d3d10_depthstencil_state *state = impl_from_ID3D10DepthStencilState(iface); + struct d3d_depthstencil_state *state = impl_from_ID3D10DepthStencilState(iface); TRACE("iface %p, desc %p.\n", iface, desc); - *desc = state->desc; + memcpy(desc, &state->desc, sizeof(*desc)); } static const struct ID3D10DepthStencilStateVtbl d3d10_depthstencil_state_vtbl = @@ -321,9 +572,10 @@ d3d10_depthstencil_state_GetDesc, }; -HRESULT d3d10_depthstencil_state_init(struct d3d10_depthstencil_state *state, struct d3d_device *device, - const D3D10_DEPTH_STENCIL_DESC *desc) +HRESULT d3d_depthstencil_state_init(struct d3d_depthstencil_state *state, struct d3d_device *device, + const D3D11_DEPTH_STENCIL_DESC *desc) { + state->ID3D11DepthStencilState_iface.lpVtbl = &d3d11_depthstencil_state_vtbl; state->ID3D10DepthStencilState_iface.lpVtbl = &d3d10_depthstencil_state_vtbl; state->refcount = 1; wined3d_mutex_lock(); @@ -339,13 +591,13 @@ } wined3d_mutex_unlock(); - state->device = &device->ID3D10Device1_iface; - ID3D10Device1_AddRef(state->device); + state->device = &device->ID3D11Device_iface; + ID3D11Device_AddRef(state->device); return S_OK; } -struct d3d10_depthstencil_state *unsafe_impl_from_ID3D10DepthStencilState(ID3D10DepthStencilState *iface) +struct d3d_depthstencil_state *unsafe_impl_from_ID3D10DepthStencilState(ID3D10DepthStencilState *iface) { if (!iface) return NULL; @@ -354,56 +606,66 @@ return impl_from_ID3D10DepthStencilState(iface); } -static inline struct d3d10_rasterizer_state *impl_from_ID3D10RasterizerState(ID3D10RasterizerState *iface) +/* ID3D11RasterizerState methods */ + +static inline struct d3d_rasterizer_state *impl_from_ID3D11RasterizerState(ID3D11RasterizerState *iface) { - return CONTAINING_RECORD(iface, struct d3d10_rasterizer_state, ID3D10RasterizerState_iface); + return CONTAINING_RECORD(iface, struct d3d_rasterizer_state, ID3D11RasterizerState_iface); } -/* IUnknown methods */ - -static HRESULT STDMETHODCALLTYPE d3d10_rasterizer_state_QueryInterface(ID3D10RasterizerState *iface, +static HRESULT STDMETHODCALLTYPE d3d11_rasterizer_state_QueryInterface(ID3D11RasterizerState *iface, REFIID riid, void **object) { + struct d3d_rasterizer_state *state = impl_from_ID3D11RasterizerState(iface); + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); - if (IsEqualGUID(riid, &IID_ID3D10RasterizerState) - || IsEqualGUID(riid, &IID_ID3D10DeviceChild) + if (IsEqualGUID(riid, &IID_ID3D11RasterizerState) + || IsEqualGUID(riid, &IID_ID3D11DeviceChild) || IsEqualGUID(riid, &IID_IUnknown)) { - IUnknown_AddRef(iface); + ID3D11RasterizerState_AddRef(iface); *object = iface; return S_OK; } + if (IsEqualGUID(riid, &IID_ID3D10RasterizerState) + || IsEqualGUID(riid, &IID_ID3D10DeviceChild)) + { + ID3D10RasterizerState_AddRef(&state->ID3D10RasterizerState_iface); + *object = &state->ID3D10RasterizerState_iface; + return S_OK; + } + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); *object = NULL; return E_NOINTERFACE; } -static ULONG STDMETHODCALLTYPE d3d10_rasterizer_state_AddRef(ID3D10RasterizerState *iface) +static ULONG STDMETHODCALLTYPE d3d11_rasterizer_state_AddRef(ID3D11RasterizerState *iface) { - struct d3d10_rasterizer_state *This = impl_from_ID3D10RasterizerState(iface); - ULONG refcount = InterlockedIncrement(&This->refcount); + struct d3d_rasterizer_state *state = impl_from_ID3D11RasterizerState(iface); + ULONG refcount = InterlockedIncrement(&state->refcount); - TRACE("%p increasing refcount to %u.\n", This, refcount); + TRACE("%p increasing refcount to %u.\n", state, refcount); return refcount; } -static ULONG STDMETHODCALLTYPE d3d10_rasterizer_state_Release(ID3D10RasterizerState *iface) +static ULONG STDMETHODCALLTYPE d3d11_rasterizer_state_Release(ID3D11RasterizerState *iface) { - struct d3d10_rasterizer_state *state = impl_from_ID3D10RasterizerState(iface); + struct d3d_rasterizer_state *state = impl_from_ID3D11RasterizerState(iface); ULONG refcount = InterlockedDecrement(&state->refcount); TRACE("%p decreasing refcount to %u.\n", state, refcount); if (!refcount) { - struct d3d_device *device = impl_from_ID3D10Device(state->device); + struct d3d_device *device = impl_from_ID3D11Device(state->device); wined3d_mutex_lock(); wine_rb_remove(&device->rasterizer_states, &state->desc); - ID3D10Device1_Release(state->device); + ID3D11Device_Release(state->device); wined3d_private_store_cleanup(&state->private_store); wined3d_mutex_unlock(); HeapFree(GetProcessHeap(), 0, state); @@ -412,48 +674,150 @@ return refcount; } +static void STDMETHODCALLTYPE d3d11_rasterizer_state_GetDevice(ID3D11RasterizerState *iface, + ID3D11Device **device) +{ + struct d3d_rasterizer_state *state = impl_from_ID3D11RasterizerState(iface); + + TRACE("iface %p, device %p.\n", iface, device); + + *device = state->device; + ID3D11Device_AddRef(*device); +} + +static HRESULT STDMETHODCALLTYPE d3d11_rasterizer_state_GetPrivateData(ID3D11RasterizerState *iface, + REFGUID guid, UINT *data_size, void *data) +{ + struct d3d_rasterizer_state *state = impl_from_ID3D11RasterizerState(iface); + + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_get_private_data(&state->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_rasterizer_state_SetPrivateData(ID3D11RasterizerState *iface, + REFGUID guid, UINT data_size, const void *data) +{ + struct d3d_rasterizer_state *state = impl_from_ID3D11RasterizerState(iface); + + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_set_private_data(&state->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_rasterizer_state_SetPrivateDataInterface(ID3D11RasterizerState *iface, + REFGUID guid, const IUnknown *data) +{ + struct d3d_rasterizer_state *state = impl_from_ID3D11RasterizerState(iface); + + TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); + + return d3d_set_private_data_interface(&state->private_store, guid, data); +} + +static void STDMETHODCALLTYPE d3d11_rasterizer_state_GetDesc(ID3D11RasterizerState *iface, + D3D11_RASTERIZER_DESC *desc) +{ + struct d3d_rasterizer_state *state = impl_from_ID3D11RasterizerState(iface); + + TRACE("iface %p, desc %p.\n", iface, desc); + + *desc = state->desc; +} + +static const struct ID3D11RasterizerStateVtbl d3d11_rasterizer_state_vtbl = +{ + /* IUnknown methods */ + d3d11_rasterizer_state_QueryInterface, + d3d11_rasterizer_state_AddRef, + d3d11_rasterizer_state_Release, + /* ID3D11DeviceChild methods */ + d3d11_rasterizer_state_GetDevice, + d3d11_rasterizer_state_GetPrivateData, + d3d11_rasterizer_state_SetPrivateData, + d3d11_rasterizer_state_SetPrivateDataInterface, + /* ID3D11RasterizerState methods */ + d3d11_rasterizer_state_GetDesc, +}; + +/* ID3D10RasterizerState methods */ + +static inline struct d3d_rasterizer_state *impl_from_ID3D10RasterizerState(ID3D10RasterizerState *iface) +{ + return CONTAINING_RECORD(iface, struct d3d_rasterizer_state, ID3D10RasterizerState_iface); +} + +/* IUnknown methods */ + +static HRESULT STDMETHODCALLTYPE d3d10_rasterizer_state_QueryInterface(ID3D10RasterizerState *iface, + REFIID riid, void **object) +{ + struct d3d_rasterizer_state *state = impl_from_ID3D10RasterizerState(iface); + + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + + return d3d11_rasterizer_state_QueryInterface(&state->ID3D11RasterizerState_iface, riid, object); +} + +static ULONG STDMETHODCALLTYPE d3d10_rasterizer_state_AddRef(ID3D10RasterizerState *iface) +{ + struct d3d_rasterizer_state *state = impl_from_ID3D10RasterizerState(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_rasterizer_state_AddRef(&state->ID3D11RasterizerState_iface); +} + +static ULONG STDMETHODCALLTYPE d3d10_rasterizer_state_Release(ID3D10RasterizerState *iface) +{ + struct d3d_rasterizer_state *state = impl_from_ID3D10RasterizerState(iface); + + TRACE("iface %p.\n", state); + + return d3d11_rasterizer_state_Release(&state->ID3D11RasterizerState_iface); +} + /* ID3D10DeviceChild methods */ static void STDMETHODCALLTYPE d3d10_rasterizer_state_GetDevice(ID3D10RasterizerState *iface, ID3D10Device **device) { - struct d3d10_rasterizer_state *state = impl_from_ID3D10RasterizerState(iface); + struct d3d_rasterizer_state *state = impl_from_ID3D10RasterizerState(iface); TRACE("iface %p, device %p.\n", iface, device); - *device = (ID3D10Device *)state->device; - ID3D10Device_AddRef(*device); + ID3D11Device_QueryInterface(state->device, &IID_ID3D10Device, (void **)device); } static HRESULT STDMETHODCALLTYPE d3d10_rasterizer_state_GetPrivateData(ID3D10RasterizerState *iface, REFGUID guid, UINT *data_size, void *data) { - struct d3d10_rasterizer_state *state = impl_from_ID3D10RasterizerState(iface); + struct d3d_rasterizer_state *state = impl_from_ID3D10RasterizerState(iface); TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_get_private_data(&state->private_store, guid, data_size, data); + return d3d_get_private_data(&state->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d10_rasterizer_state_SetPrivateData(ID3D10RasterizerState *iface, REFGUID guid, UINT data_size, const void *data) { - struct d3d10_rasterizer_state *state = impl_from_ID3D10RasterizerState(iface); + struct d3d_rasterizer_state *state = impl_from_ID3D10RasterizerState(iface); TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_set_private_data(&state->private_store, guid, data_size, data); + return d3d_set_private_data(&state->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d10_rasterizer_state_SetPrivateDataInterface(ID3D10RasterizerState *iface, REFGUID guid, const IUnknown *data) { - struct d3d10_rasterizer_state *state = impl_from_ID3D10RasterizerState(iface); + struct d3d_rasterizer_state *state = impl_from_ID3D10RasterizerState(iface); TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); - return d3d10_set_private_data_interface(&state->private_store, guid, data); + return d3d_set_private_data_interface(&state->private_store, guid, data); } /* ID3D10RasterizerState methods */ @@ -461,11 +825,11 @@ static void STDMETHODCALLTYPE d3d10_rasterizer_state_GetDesc(ID3D10RasterizerState *iface, D3D10_RASTERIZER_DESC *desc) { - struct d3d10_rasterizer_state *state = impl_from_ID3D10RasterizerState(iface); + struct d3d_rasterizer_state *state = impl_from_ID3D10RasterizerState(iface); TRACE("iface %p, desc %p.\n", iface, desc); - *desc = state->desc; + memcpy(desc, &state->desc, sizeof(*desc)); } static const struct ID3D10RasterizerStateVtbl d3d10_rasterizer_state_vtbl = @@ -483,9 +847,10 @@ d3d10_rasterizer_state_GetDesc, }; -HRESULT d3d10_rasterizer_state_init(struct d3d10_rasterizer_state *state, struct d3d_device *device, - const D3D10_RASTERIZER_DESC *desc) +HRESULT d3d_rasterizer_state_init(struct d3d_rasterizer_state *state, struct d3d_device *device, + const D3D11_RASTERIZER_DESC *desc) { + state->ID3D11RasterizerState_iface.lpVtbl = &d3d11_rasterizer_state_vtbl; state->ID3D10RasterizerState_iface.lpVtbl = &d3d10_rasterizer_state_vtbl; state->refcount = 1; wined3d_mutex_lock(); @@ -501,13 +866,22 @@ } wined3d_mutex_unlock(); - state->device = &device->ID3D10Device1_iface; - ID3D10Device1_AddRef(state->device); + state->device = &device->ID3D11Device_iface; + ID3D11Device_AddRef(state->device); return S_OK; } -struct d3d10_rasterizer_state *unsafe_impl_from_ID3D10RasterizerState(ID3D10RasterizerState *iface) +struct d3d_rasterizer_state *unsafe_impl_from_ID3D11RasterizerState(ID3D11RasterizerState *iface) +{ + if (!iface) + return NULL; + assert(iface->lpVtbl == &d3d11_rasterizer_state_vtbl); + + return impl_from_ID3D11RasterizerState(iface); +} + +struct d3d_rasterizer_state *unsafe_impl_from_ID3D10RasterizerState(ID3D10RasterizerState *iface) { if (!iface) return NULL; @@ -516,58 +890,68 @@ return impl_from_ID3D10RasterizerState(iface); } -static inline struct d3d10_sampler_state *impl_from_ID3D10SamplerState(ID3D10SamplerState *iface) +/* ID3D11SampleState methods */ + +static inline struct d3d_sampler_state *impl_from_ID3D11SamplerState(ID3D11SamplerState *iface) { - return CONTAINING_RECORD(iface, struct d3d10_sampler_state, ID3D10SamplerState_iface); + return CONTAINING_RECORD(iface, struct d3d_sampler_state, ID3D11SamplerState_iface); } -/* IUnknown methods */ - -static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_QueryInterface(ID3D10SamplerState *iface, +static HRESULT STDMETHODCALLTYPE d3d11_sampler_state_QueryInterface(ID3D11SamplerState *iface, REFIID riid, void **object) { + struct d3d_sampler_state *state = impl_from_ID3D11SamplerState(iface); + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); - if (IsEqualGUID(riid, &IID_ID3D10SamplerState) - || IsEqualGUID(riid, &IID_ID3D10DeviceChild) + if (IsEqualGUID(riid, &IID_ID3D11SamplerState) + || IsEqualGUID(riid, &IID_ID3D11DeviceChild) || IsEqualGUID(riid, &IID_IUnknown)) { - IUnknown_AddRef(iface); + ID3D11SamplerState_AddRef(iface); *object = iface; return S_OK; } + if (IsEqualGUID(riid, &IID_ID3D10SamplerState) + || IsEqualGUID(riid, &IID_ID3D10DeviceChild)) + { + ID3D10SamplerState_AddRef(&state->ID3D10SamplerState_iface); + *object = &state->ID3D10SamplerState_iface; + return S_OK; + } + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); *object = NULL; return E_NOINTERFACE; } -static ULONG STDMETHODCALLTYPE d3d10_sampler_state_AddRef(ID3D10SamplerState *iface) +static ULONG STDMETHODCALLTYPE d3d11_sampler_state_AddRef(ID3D11SamplerState *iface) { - struct d3d10_sampler_state *This = impl_from_ID3D10SamplerState(iface); - ULONG refcount = InterlockedIncrement(&This->refcount); + struct d3d_sampler_state *state = impl_from_ID3D11SamplerState(iface); + ULONG refcount = InterlockedIncrement(&state->refcount); - TRACE("%p increasing refcount to %u.\n", This, refcount); + TRACE("%p increasing refcount to %u.\n", state, refcount); return refcount; } -static ULONG STDMETHODCALLTYPE d3d10_sampler_state_Release(ID3D10SamplerState *iface) +static ULONG STDMETHODCALLTYPE d3d11_sampler_state_Release(ID3D11SamplerState *iface) { - struct d3d10_sampler_state *state = impl_from_ID3D10SamplerState(iface); + struct d3d_sampler_state *state = impl_from_ID3D11SamplerState(iface); ULONG refcount = InterlockedDecrement(&state->refcount); TRACE("%p decreasing refcount to %u.\n", state, refcount); if (!refcount) { - struct d3d_device *device = impl_from_ID3D10Device(state->device); + struct d3d_device *device = impl_from_ID3D11Device(state->device); wined3d_mutex_lock(); wined3d_sampler_decref(state->wined3d_sampler); wine_rb_remove(&device->sampler_states, &state->desc); - ID3D10Device1_Release(state->device); + ID3D11Device_Release(state->device); wined3d_private_store_cleanup(&state->private_store); wined3d_mutex_unlock(); HeapFree(GetProcessHeap(), 0, state); @@ -576,48 +960,150 @@ return refcount; } +static void STDMETHODCALLTYPE d3d11_sampler_state_GetDevice(ID3D11SamplerState *iface, + ID3D11Device **device) +{ + struct d3d_sampler_state *state = impl_from_ID3D11SamplerState(iface); + + TRACE("iface %p, device %p.\n", iface, device); + + *device = state->device; + ID3D11Device_AddRef(*device); +} + +static HRESULT STDMETHODCALLTYPE d3d11_sampler_state_GetPrivateData(ID3D11SamplerState *iface, + REFGUID guid, UINT *data_size, void *data) +{ + struct d3d_sampler_state *state = impl_from_ID3D11SamplerState(iface); + + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_get_private_data(&state->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_sampler_state_SetPrivateData(ID3D11SamplerState *iface, + REFGUID guid, UINT data_size, const void *data) +{ + struct d3d_sampler_state *state = impl_from_ID3D11SamplerState(iface); + + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_set_private_data(&state->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_sampler_state_SetPrivateDataInterface(ID3D11SamplerState *iface, + REFGUID guid, const IUnknown *data) +{ + struct d3d_sampler_state *state = impl_from_ID3D11SamplerState(iface); + + TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); + + return d3d_set_private_data_interface(&state->private_store, guid, data); +} + +static void STDMETHODCALLTYPE d3d11_sampler_state_GetDesc(ID3D11SamplerState *iface, + D3D11_SAMPLER_DESC *desc) +{ + struct d3d_sampler_state *state = impl_from_ID3D11SamplerState(iface); + + TRACE("iface %p, desc %p.\n", iface, desc); + + *desc = state->desc; +} + +static const struct ID3D11SamplerStateVtbl d3d11_sampler_state_vtbl = +{ + /* IUnknown methods */ + d3d11_sampler_state_QueryInterface, + d3d11_sampler_state_AddRef, + d3d11_sampler_state_Release, + /* ID3D11DeviceChild methods */ + d3d11_sampler_state_GetDevice, + d3d11_sampler_state_GetPrivateData, + d3d11_sampler_state_SetPrivateData, + d3d11_sampler_state_SetPrivateDataInterface, + /* ID3D11SamplerState methods */ + d3d11_sampler_state_GetDesc, +}; + +/* ID3D10SamplerState methods */ + +static inline struct d3d_sampler_state *impl_from_ID3D10SamplerState(ID3D10SamplerState *iface) +{ + return CONTAINING_RECORD(iface, struct d3d_sampler_state, ID3D10SamplerState_iface); +} + +/* IUnknown methods */ + +static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_QueryInterface(ID3D10SamplerState *iface, + REFIID riid, void **object) +{ + struct d3d_sampler_state *state = impl_from_ID3D10SamplerState(iface); + + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + + return d3d11_sampler_state_QueryInterface(&state->ID3D11SamplerState_iface, riid, object); +} + +static ULONG STDMETHODCALLTYPE d3d10_sampler_state_AddRef(ID3D10SamplerState *iface) +{ + struct d3d_sampler_state *state = impl_from_ID3D10SamplerState(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_sampler_state_AddRef(&state->ID3D11SamplerState_iface); +} + +static ULONG STDMETHODCALLTYPE d3d10_sampler_state_Release(ID3D10SamplerState *iface) +{ + struct d3d_sampler_state *state = impl_from_ID3D10SamplerState(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_sampler_state_Release(&state->ID3D11SamplerState_iface); +} + /* ID3D10DeviceChild methods */ static void STDMETHODCALLTYPE d3d10_sampler_state_GetDevice(ID3D10SamplerState *iface, ID3D10Device **device) { - struct d3d10_sampler_state *state = impl_from_ID3D10SamplerState(iface); + struct d3d_sampler_state *state = impl_from_ID3D10SamplerState(iface); TRACE("iface %p, device %p.\n", iface, device); - *device = (ID3D10Device *)state->device; - ID3D10Device_AddRef(*device); + ID3D11Device_QueryInterface(state->device, &IID_ID3D10Device, (void **)device); } static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_GetPrivateData(ID3D10SamplerState *iface, REFGUID guid, UINT *data_size, void *data) { - struct d3d10_sampler_state *state = impl_from_ID3D10SamplerState(iface); + struct d3d_sampler_state *state = impl_from_ID3D10SamplerState(iface); TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_get_private_data(&state->private_store, guid, data_size, data); + return d3d_get_private_data(&state->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_SetPrivateData(ID3D10SamplerState *iface, REFGUID guid, UINT data_size, const void *data) { - struct d3d10_sampler_state *state = impl_from_ID3D10SamplerState(iface); + struct d3d_sampler_state *state = impl_from_ID3D10SamplerState(iface); TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_set_private_data(&state->private_store, guid, data_size, data); + return d3d_set_private_data(&state->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_SetPrivateDataInterface(ID3D10SamplerState *iface, REFGUID guid, const IUnknown *data) { - struct d3d10_sampler_state *state = impl_from_ID3D10SamplerState(iface); + struct d3d_sampler_state *state = impl_from_ID3D10SamplerState(iface); TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); - return d3d10_set_private_data_interface(&state->private_store, guid, data); + return d3d_set_private_data_interface(&state->private_store, guid, data); } /* ID3D10SamplerState methods */ @@ -625,11 +1111,11 @@ static void STDMETHODCALLTYPE d3d10_sampler_state_GetDesc(ID3D10SamplerState *iface, D3D10_SAMPLER_DESC *desc) { - struct d3d10_sampler_state *state = impl_from_ID3D10SamplerState(iface); + struct d3d_sampler_state *state = impl_from_ID3D10SamplerState(iface); TRACE("iface %p, desc %p.\n", iface, desc); - *desc = state->desc; + memcpy(desc, &state->desc, sizeof(*desc)); } static const struct ID3D10SamplerStateVtbl d3d10_sampler_state_vtbl = @@ -647,67 +1133,68 @@ d3d10_sampler_state_GetDesc, }; -static enum wined3d_texture_address wined3d_texture_address_from_d3d10core(enum D3D10_TEXTURE_ADDRESS_MODE t) +static enum wined3d_texture_address wined3d_texture_address_from_d3d11(enum D3D11_TEXTURE_ADDRESS_MODE t) { return (enum wined3d_texture_address)t; } -static enum wined3d_texture_filter_type wined3d_texture_filter_mip_from_d3d10core(enum D3D10_FILTER f) +static enum wined3d_texture_filter_type wined3d_texture_filter_mip_from_d3d11(enum D3D11_FILTER f) { - if (f & D3D10_FILTER_MIP_MASK) + if (D3D11_DECODE_MIP_FILTER(f) == D3D11_FILTER_TYPE_LINEAR) return WINED3D_TEXF_LINEAR; return WINED3D_TEXF_POINT; } -static enum wined3d_texture_filter_type wined3d_texture_filter_mag_from_d3d10core(enum D3D10_FILTER f) +static enum wined3d_texture_filter_type wined3d_texture_filter_mag_from_d3d11(enum D3D11_FILTER f) { - if (f & D3D10_FILTER_MAG_MASK) + if (D3D11_DECODE_MAG_FILTER(f) == D3D11_FILTER_TYPE_LINEAR) return WINED3D_TEXF_LINEAR; return WINED3D_TEXF_POINT; } -static enum wined3d_texture_filter_type wined3d_texture_filter_min_from_d3d10core(enum D3D10_FILTER f) +static enum wined3d_texture_filter_type wined3d_texture_filter_min_from_d3d11(enum D3D11_FILTER f) { - if (f & D3D10_FILTER_MIN_MASK) + if (D3D11_DECODE_MIN_FILTER(f) == D3D11_FILTER_TYPE_LINEAR) return WINED3D_TEXF_LINEAR; return WINED3D_TEXF_POINT; } -static BOOL wined3d_texture_compare_from_d3d10core(enum D3D10_FILTER f) +static BOOL wined3d_texture_compare_from_d3d11(enum D3D11_FILTER f) { - return f & D3D10_FILTER_COMPARE_MASK; + return D3D11_DECODE_IS_COMPARISON_FILTER(f); } -static enum wined3d_cmp_func wined3d_cmp_func_from_d3d10core(D3D10_COMPARISON_FUNC f) +static enum wined3d_cmp_func wined3d_cmp_func_from_d3d11(D3D11_COMPARISON_FUNC f) { return (enum wined3d_cmp_func)f; } -HRESULT d3d10_sampler_state_init(struct d3d10_sampler_state *state, struct d3d_device *device, - const D3D10_SAMPLER_DESC *desc) +HRESULT d3d_sampler_state_init(struct d3d_sampler_state *state, struct d3d_device *device, + const D3D11_SAMPLER_DESC *desc) { struct wined3d_sampler_desc wined3d_desc; HRESULT hr; + state->ID3D11SamplerState_iface.lpVtbl = &d3d11_sampler_state_vtbl; state->ID3D10SamplerState_iface.lpVtbl = &d3d10_sampler_state_vtbl; state->refcount = 1; wined3d_mutex_lock(); wined3d_private_store_init(&state->private_store); state->desc = *desc; - wined3d_desc.address_u = wined3d_texture_address_from_d3d10core(desc->AddressU); - wined3d_desc.address_v = wined3d_texture_address_from_d3d10core(desc->AddressV); - wined3d_desc.address_w = wined3d_texture_address_from_d3d10core(desc->AddressW); + wined3d_desc.address_u = wined3d_texture_address_from_d3d11(desc->AddressU); + wined3d_desc.address_v = wined3d_texture_address_from_d3d11(desc->AddressV); + wined3d_desc.address_w = wined3d_texture_address_from_d3d11(desc->AddressW); memcpy(wined3d_desc.border_color, desc->BorderColor, sizeof(wined3d_desc.border_color)); - wined3d_desc.mag_filter = wined3d_texture_filter_mag_from_d3d10core(desc->Filter); - wined3d_desc.min_filter = wined3d_texture_filter_min_from_d3d10core(desc->Filter); - wined3d_desc.mip_filter = wined3d_texture_filter_mip_from_d3d10core(desc->Filter); + wined3d_desc.mag_filter = wined3d_texture_filter_mag_from_d3d11(desc->Filter); + wined3d_desc.min_filter = wined3d_texture_filter_min_from_d3d11(desc->Filter); + wined3d_desc.mip_filter = wined3d_texture_filter_mip_from_d3d11(desc->Filter); wined3d_desc.lod_bias = desc->MipLODBias; wined3d_desc.min_lod = desc->MinLOD; wined3d_desc.max_lod = desc->MaxLOD; - wined3d_desc.max_anisotropy = desc->Filter & D3D10_FILTER_ANISO_MASK ? desc->MaxAnisotropy : 1; - wined3d_desc.compare = wined3d_texture_compare_from_d3d10core(desc->Filter); - wined3d_desc.comparison_func = wined3d_cmp_func_from_d3d10core(desc->ComparisonFunc); + wined3d_desc.max_anisotropy = D3D11_DECODE_IS_ANISOTROPIC_FILTER(desc->Filter) ? desc->MaxAnisotropy : 1; + wined3d_desc.compare = wined3d_texture_compare_from_d3d11(desc->Filter); + wined3d_desc.comparison_func = wined3d_cmp_func_from_d3d11(desc->ComparisonFunc); wined3d_desc.srgb_decode = FALSE; if (FAILED(hr = wined3d_sampler_create(device->wined3d_device, &wined3d_desc, state, &state->wined3d_sampler))) @@ -728,13 +1215,22 @@ } wined3d_mutex_unlock(); - state->device = &device->ID3D10Device1_iface; - ID3D10Device1_AddRef(state->device); + state->device = &device->ID3D11Device_iface; + ID3D11Device_AddRef(state->device); return S_OK; } -struct d3d10_sampler_state *unsafe_impl_from_ID3D10SamplerState(ID3D10SamplerState *iface) +struct d3d_sampler_state *unsafe_impl_from_ID3D11SamplerState(ID3D11SamplerState *iface) +{ + if (!iface) + return NULL; + assert(iface->lpVtbl == &d3d11_sampler_state_vtbl); + + return impl_from_ID3D11SamplerState(iface); +} + +struct d3d_sampler_state *unsafe_impl_from_ID3D10SamplerState(ID3D10SamplerState *iface) { if (!iface) return NULL; diff -Nru wine1.7-1.7.50/dlls/d3d11/tests/d3d11.c wine1.7-1.7.55/dlls/d3d11/tests/d3d11.c --- wine1.7-1.7.50/dlls/d3d11/tests/d3d11.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d11/tests/d3d11.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,4182 @@ +/* + * Copyright 2008 Henri Verbeet for CodeWeavers + * Copyright 2015 Józef Kucia for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS +#include "initguid.h" +#include "d3d11.h" +#include "wine/test.h" + +static const D3D_FEATURE_LEVEL d3d11_feature_levels[] = +{ + D3D_FEATURE_LEVEL_11_1, + D3D_FEATURE_LEVEL_11_0, + D3D_FEATURE_LEVEL_10_1, + D3D_FEATURE_LEVEL_10_0, + D3D_FEATURE_LEVEL_9_3, + D3D_FEATURE_LEVEL_9_2, + D3D_FEATURE_LEVEL_9_1 +}; + +struct vec2 +{ + float x, y; +}; + +struct vec3 +{ + float x, y, z; +}; + +struct vec4 +{ + float x, y, z, w; +}; + +static void set_box(D3D11_BOX *box, UINT left, UINT top, UINT front, UINT right, UINT bottom, UINT back) +{ + box->left = left; + box->top = top; + box->front = front; + box->right = right; + box->bottom = bottom; + box->back = back; +} + +static ULONG get_refcount(IUnknown *iface) +{ + IUnknown_AddRef(iface); + return IUnknown_Release(iface); +} + +static BOOL compare_color(DWORD c1, DWORD c2, BYTE max_diff) +{ + if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) + return FALSE; + c1 >>= 8; c2 >>= 8; + if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) + return FALSE; + c1 >>= 8; c2 >>= 8; + if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) + return FALSE; + c1 >>= 8; c2 >>= 8; + if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) + return FALSE; + return TRUE; +} + +struct texture_readback +{ + ID3D11Resource *texture; + D3D11_MAPPED_SUBRESOURCE map_desc; + ID3D11DeviceContext *immediate_context; +}; + +static void get_texture_readback(ID3D11Texture2D *texture, struct texture_readback *rb) +{ + D3D11_TEXTURE2D_DESC texture_desc; + ID3D11Device *device; + HRESULT hr; + + memset(rb, 0, sizeof(*rb)); + + ID3D11Texture2D_GetDevice(texture, &device); + + ID3D11Texture2D_GetDesc(texture, &texture_desc); + texture_desc.Usage = D3D11_USAGE_STAGING; + texture_desc.BindFlags = 0; + texture_desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; + texture_desc.MiscFlags = 0; + if (FAILED(hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, (ID3D11Texture2D **)&rb->texture))) + { + trace("Failed to create texture, hr %#x.\n", hr); + ID3D11Device_Release(device); + return; + } + + ID3D11Device_GetImmediateContext(device, &rb->immediate_context); + + ID3D11DeviceContext_CopyResource(rb->immediate_context, rb->texture, (ID3D11Resource *)texture); + if (FAILED(hr = ID3D11DeviceContext_Map(rb->immediate_context, rb->texture, 0, D3D11_MAP_READ, 0, &rb->map_desc))) + { + trace("Failed to map texture, hr %#x.\n", hr); + ID3D11Resource_Release(rb->texture); + rb->texture = NULL; + ID3D11DeviceContext_Release(rb->immediate_context); + rb->immediate_context = NULL; + } + + ID3D11Device_Release(device); +} + +static DWORD get_readback_color(struct texture_readback *rb, unsigned int x, unsigned int y) +{ + return rb->texture + ? ((DWORD *)rb->map_desc.pData)[rb->map_desc.RowPitch * y / sizeof(DWORD) + x] : 0xdeadbeef; +} + +static void release_texture_readback(struct texture_readback *rb) +{ + if (!rb->texture) + return; + + ID3D11DeviceContext_Unmap(rb->immediate_context, rb->texture, 0); + ID3D11Resource_Release(rb->texture); + ID3D11DeviceContext_Release(rb->immediate_context); +} + +static DWORD get_texture_color(ID3D11Texture2D *texture, unsigned int x, unsigned int y) +{ + struct texture_readback rb; + DWORD color; + + get_texture_readback(texture, &rb); + color = get_readback_color(&rb, x, y); + release_texture_readback(&rb); + + return color; +} + +static ID3D11Device *create_device(const D3D_FEATURE_LEVEL *feature_level) +{ + ID3D11Device *device; + UINT feature_level_count = feature_level ? 1 : 0; + + if (SUCCEEDED(D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, feature_level, feature_level_count, + D3D11_SDK_VERSION, &device, NULL, NULL))) + return device; + if (SUCCEEDED(D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_WARP, NULL, 0, feature_level, feature_level_count, + D3D11_SDK_VERSION, &device, NULL, NULL))) + return device; + if (SUCCEEDED(D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_REFERENCE, NULL, 0, feature_level, feature_level_count, + D3D11_SDK_VERSION, &device, NULL, NULL))) + return device; + + return NULL; +} + +static IDXGISwapChain *create_swapchain(ID3D11Device *device, HWND window, BOOL windowed) +{ + IDXGISwapChain *swapchain; + DXGI_SWAP_CHAIN_DESC desc; + IDXGIDevice *dxgi_device; + IDXGIAdapter *adapter; + IDXGIFactory *factory; + HRESULT hr; + + hr = ID3D11Device_QueryInterface(device, &IID_IDXGIDevice, (void **)&dxgi_device); + ok(SUCCEEDED(hr), "Failed to get DXGI device, 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_GetParent(adapter, &IID_IDXGIFactory, (void **)&factory); + ok(SUCCEEDED(hr), "Failed to get factory, hr %#x.\n", hr); + IDXGIAdapter_Release(adapter); + + desc.BufferDesc.Width = 640; + desc.BufferDesc.Height = 480; + desc.BufferDesc.RefreshRate.Numerator = 60; + desc.BufferDesc.RefreshRate.Denominator = 1; + desc.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + desc.BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED; + desc.BufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED; + desc.SampleDesc.Count = 1; + desc.SampleDesc.Quality = 0; + desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; + desc.BufferCount = 1; + desc.OutputWindow = window; + desc.Windowed = windowed; + desc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; + desc.Flags = 0; + + hr = IDXGIFactory_CreateSwapChain(factory, (IUnknown *)device, &desc, &swapchain); + ok(SUCCEEDED(hr), "Failed to create swapchain, hr %#x.\n", hr); + IDXGIFactory_Release(factory); + + return swapchain; +} + +static void test_create_device(void) +{ + D3D_FEATURE_LEVEL feature_level, supported_feature_level; + DXGI_SWAP_CHAIN_DESC swapchain_desc, obtained_desc; + ID3D11DeviceContext *immediate_context; + IDXGISwapChain *swapchain; + ID3D11Device *device; + ULONG refcount; + HWND window; + HRESULT hr; + + hr = D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL, 0, D3D11_SDK_VERSION, &device, + NULL, NULL); + if (FAILED(hr)) + { + skip("Failed to create HAL device.\n"); + return; + } + + supported_feature_level = ID3D11Device_GetFeatureLevel(device); + ID3D11Device_Release(device); + + hr = D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL, 0, D3D11_SDK_VERSION, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "D3D11CreateDevice failed %#x.\n", hr); + + hr = D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL, 0, D3D11_SDK_VERSION, NULL, + &feature_level, NULL); + ok(SUCCEEDED(hr), "D3D11CreateDevice failed %#x.\n", hr); + ok(feature_level == supported_feature_level, "Got feature level %#x, expected %#x.\n", + feature_level, supported_feature_level); + + hr = D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL, 0, D3D11_SDK_VERSION, NULL, NULL, + &immediate_context); + ok(SUCCEEDED(hr), "D3D11CreateDevice failed %#x.\n", hr); + + ok(!!immediate_context, "Expected immediate device context pointer, got NULL.\n"); + refcount = get_refcount((IUnknown *)immediate_context); + ok(refcount == 1, "Got refcount %u, expected 1.\n", refcount); + + ID3D11DeviceContext_GetDevice(immediate_context, &device); + refcount = ID3D11Device_Release(device); + ok(refcount == 1, "Got refcount %u, expected 1.\n", refcount); + + refcount = ID3D11DeviceContext_Release(immediate_context); + ok(!refcount, "ID3D11DeviceContext has %u references left.\n", refcount); + + device = (ID3D11Device *)0xdeadbeef; + feature_level = 0xdeadbeef; + immediate_context = (ID3D11DeviceContext *)0xdeadbeef; + hr = D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_UNKNOWN, NULL, 0, NULL, 0, D3D11_SDK_VERSION, + &device, &feature_level, &immediate_context); + todo_wine ok(hr == E_INVALIDARG, "D3D11CreateDevice returned %#x.\n", hr); + ok(!device, "Got unexpected device pointer %p.\n", device); + ok(!feature_level, "Got unexpected feature level %#x.\n", feature_level); + ok(!immediate_context, "Got unexpected immediate context pointer %p.\n", immediate_context); + + window = CreateWindowA("static", "d3d11_test", 0, 0, 0, 0, 0, 0, 0, 0, 0); + + swapchain_desc.BufferDesc.Width = 800; + swapchain_desc.BufferDesc.Height = 600; + swapchain_desc.BufferDesc.RefreshRate.Numerator = 60; + swapchain_desc.BufferDesc.RefreshRate.Denominator = 60; + swapchain_desc.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + swapchain_desc.BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED; + swapchain_desc.BufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED; + swapchain_desc.SampleDesc.Count = 1; + swapchain_desc.SampleDesc.Quality = 0; + swapchain_desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; + swapchain_desc.BufferCount = 1; + swapchain_desc.OutputWindow = window; + swapchain_desc.Windowed = TRUE; + swapchain_desc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; + swapchain_desc.Flags = 0; + + hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL, 0, D3D11_SDK_VERSION, + &swapchain_desc, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "D3D11CreateDeviceAndSwapChain failed %#x.\n", hr); + + hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL, 0, D3D11_SDK_VERSION, + &swapchain_desc, NULL, NULL, &feature_level, NULL); + ok(SUCCEEDED(hr), "D3D11CreateDeviceAndSwapChain failed %#x.\n", hr); + ok(feature_level == supported_feature_level, "Got feature level %#x, expected %#x.\n", + feature_level, supported_feature_level); + + hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL, 0, D3D11_SDK_VERSION, + &swapchain_desc, &swapchain, &device, NULL, NULL); + ok(SUCCEEDED(hr), "D3D11CreateDeviceAndSwapChain failed %#x.\n", hr); + + memset(&obtained_desc, 0, sizeof(obtained_desc)); + hr = IDXGISwapChain_GetDesc(swapchain, &obtained_desc); + ok(SUCCEEDED(hr), "GetDesc failed %#x.\n", hr); + ok(obtained_desc.BufferDesc.Width == swapchain_desc.BufferDesc.Width, + "Got unexpected BufferDesc.Width %u.\n", obtained_desc.BufferDesc.Width); + ok(obtained_desc.BufferDesc.Height == swapchain_desc.BufferDesc.Height, + "Got unexpected BufferDesc.Height %u.\n", obtained_desc.BufferDesc.Height); + todo_wine ok(obtained_desc.BufferDesc.RefreshRate.Numerator == swapchain_desc.BufferDesc.RefreshRate.Numerator, + "Got unexpected BufferDesc.RefreshRate.Numerator %u.\n", + obtained_desc.BufferDesc.RefreshRate.Numerator); + todo_wine ok(obtained_desc.BufferDesc.RefreshRate.Denominator == swapchain_desc.BufferDesc.RefreshRate.Denominator, + "Got unexpected BufferDesc.RefreshRate.Denominator %u.\n", + obtained_desc.BufferDesc.RefreshRate.Denominator); + ok(obtained_desc.BufferDesc.Format == swapchain_desc.BufferDesc.Format, + "Got unexpected BufferDesc.Format %#x.\n", obtained_desc.BufferDesc.Format); + ok(obtained_desc.BufferDesc.ScanlineOrdering == swapchain_desc.BufferDesc.ScanlineOrdering, + "Got unexpected BufferDesc.ScanlineOrdering %#x.\n", obtained_desc.BufferDesc.ScanlineOrdering); + ok(obtained_desc.BufferDesc.Scaling == swapchain_desc.BufferDesc.Scaling, + "Got unexpected BufferDesc.Scaling %#x.\n", obtained_desc.BufferDesc.Scaling); + ok(obtained_desc.SampleDesc.Count == swapchain_desc.SampleDesc.Count, + "Got unexpected SampleDesc.Count %u.\n", obtained_desc.SampleDesc.Count); + ok(obtained_desc.SampleDesc.Quality == swapchain_desc.SampleDesc.Quality, + "Got unexpected SampleDesc.Quality %u.\n", obtained_desc.SampleDesc.Quality); + todo_wine ok(obtained_desc.BufferUsage == swapchain_desc.BufferUsage, + "Got unexpected BufferUsage %#x.\n", obtained_desc.BufferUsage); + ok(obtained_desc.BufferCount == swapchain_desc.BufferCount, + "Got unexpected BufferCount %u.\n", obtained_desc.BufferCount); + ok(obtained_desc.OutputWindow == swapchain_desc.OutputWindow, + "Got unexpected OutputWindow %p.\n", obtained_desc.OutputWindow); + ok(obtained_desc.Windowed == swapchain_desc.Windowed, + "Got unexpected Windowed %#x.\n", obtained_desc.Windowed); + ok(obtained_desc.SwapEffect == swapchain_desc.SwapEffect, + "Got unexpected SwapEffect %#x.\n", obtained_desc.SwapEffect); + ok(obtained_desc.Flags == swapchain_desc.Flags, + "Got unexpected Flags %#x.\n", obtained_desc.Flags); + + refcount = IDXGISwapChain_Release(swapchain); + ok(!refcount, "Swapchain has %u references left.\n", refcount); + + feature_level = ID3D11Device_GetFeatureLevel(device); + ok(feature_level == supported_feature_level, "Got feature level %#x, expected %#x.\n", + feature_level, supported_feature_level); + + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + + hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL, 0, D3D11_SDK_VERSION, + NULL, NULL, &device, NULL, NULL); + ok(SUCCEEDED(hr), "D3D11CreateDeviceAndSwapChain failed %#x.\n", hr); + ID3D11Device_Release(device); + + hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL, 0, D3D11_SDK_VERSION, + NULL, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "D3D11CreateDeviceAndSwapChain failed %#x.\n", hr); + + hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL, 0, D3D11_SDK_VERSION, + NULL, NULL, NULL, &feature_level, NULL); + ok(SUCCEEDED(hr), "D3D11CreateDeviceAndSwapChain failed %#x.\n", hr); + ok(feature_level == supported_feature_level, "Got feature level %#x, expected %#x.\n", + feature_level, supported_feature_level); + + hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL, 0, D3D11_SDK_VERSION, + &swapchain_desc, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "D3D11CreateDeviceAndSwapChain failed %#x.\n", hr); + + swapchain_desc.OutputWindow = NULL; + hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL, 0, D3D11_SDK_VERSION, + &swapchain_desc, NULL, &device, NULL, NULL); + ok(SUCCEEDED(hr), "D3D11CreateDeviceAndSwapChain failed %#x.\n", hr); + ID3D11Device_Release(device); + + swapchain = (IDXGISwapChain *)0xdeadbeef; + device = (ID3D11Device *)0xdeadbeef; + feature_level = 0xdeadbeef; + immediate_context = (ID3D11DeviceContext *)0xdeadbeef; + swapchain_desc.OutputWindow = NULL; + hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL, 0, D3D11_SDK_VERSION, + &swapchain_desc, &swapchain, &device, &feature_level, &immediate_context); + todo_wine ok(hr == DXGI_ERROR_INVALID_CALL, "D3D11CreateDeviceAndSwapChain returned %#x.\n", hr); + ok(!swapchain, "Got unexpected swapchain pointer %p.\n", swapchain); + ok(!device, "Got unexpected device pointer %p.\n", device); + ok(!feature_level, "Got unexpected feature level %#x.\n", feature_level); + ok(!immediate_context, "Got unexpected immediate context pointer %p.\n", immediate_context); + + swapchain = (IDXGISwapChain *)0xdeadbeef; + device = (ID3D11Device *)0xdeadbeef; + feature_level = 0xdeadbeef; + immediate_context = (ID3D11DeviceContext *)0xdeadbeef; + swapchain_desc.OutputWindow = window; + swapchain_desc.BufferDesc.Format = DXGI_FORMAT_BC5_UNORM; + hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL, 0, D3D11_SDK_VERSION, + &swapchain_desc, &swapchain, &device, &feature_level, &immediate_context); + todo_wine ok(hr == E_INVALIDARG, "D3D11CreateDeviceAndSwapChain returned %#x.\n", hr); + ok(!swapchain, "Got unexpected swapchain pointer %p.\n", swapchain); + ok(!device, "Got unexpected device pointer %p.\n", device); + ok(!feature_level, "Got unexpected feature level %#x.\n", feature_level); + ok(!immediate_context, "Got unexpected immediate context pointer %p.\n", immediate_context); + + DestroyWindow(window); +} + +static void test_device_interfaces(void) +{ + IDXGIAdapter *dxgi_adapter; + IDXGIDevice *dxgi_device; + ID3D11Device *device; + IUnknown *iface; + ULONG refcount; + unsigned int i; + HRESULT hr; + + for (i = 0; i < sizeof(d3d11_feature_levels) / sizeof(*d3d11_feature_levels); ++i) + { + if (!(device = create_device(&d3d11_feature_levels[i]))) + { + skip("Failed to create device for feature level %#x.\n", d3d11_feature_levels[i]); + continue; + } + + hr = ID3D11Device_QueryInterface(device, &IID_IUnknown, (void **)&iface); + ok(SUCCEEDED(hr), "Device should implement IUnknown interface, hr %#x.\n", hr); + IUnknown_Release(iface); + + hr = ID3D11Device_QueryInterface(device, &IID_IDXGIObject, (void **)&iface); + ok(SUCCEEDED(hr), "Device should implement IDXGIObject interface, hr %#x.\n", hr); + IUnknown_Release(iface); + + hr = ID3D11Device_QueryInterface(device, &IID_IDXGIDevice, (void **)&dxgi_device); + ok(SUCCEEDED(hr), "Device should implement IDXGIDevice.\n"); + hr = IDXGIDevice_GetParent(dxgi_device, &IID_IDXGIAdapter, (void **)&dxgi_adapter); + ok(SUCCEEDED(hr), "Device parent should implement IDXGIAdapter.\n"); + hr = IDXGIAdapter_GetParent(dxgi_adapter, &IID_IDXGIFactory, (void **)&iface); + ok(SUCCEEDED(hr), "Adapter parent should implement IDXGIFactory.\n"); + IUnknown_Release(iface); + IDXGIAdapter_Release(dxgi_adapter); + hr = IDXGIDevice_GetParent(dxgi_device, &IID_IDXGIAdapter1, (void **)&dxgi_adapter); + ok(SUCCEEDED(hr), "Device parent should implement IDXGIAdapter1.\n"); + hr = IDXGIAdapter_GetParent(dxgi_adapter, &IID_IDXGIFactory1, (void **)&iface); + ok(SUCCEEDED(hr), "Adapter parent should implement IDXGIFactory1.\n"); + IUnknown_Release(iface); + IDXGIAdapter_Release(dxgi_adapter); + IDXGIDevice_Release(dxgi_device); + + hr = ID3D11Device_QueryInterface(device, &IID_IDXGIDevice1, (void **)&iface); + ok(SUCCEEDED(hr), "Device should implement IDXGIDevice1.\n"); + IUnknown_Release(iface); + + hr = ID3D11Device_QueryInterface(device, &IID_ID3D10Multithread, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Device should implement ID3D10Multithread interface, hr %#x.\n", hr); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + + hr = ID3D11Device_QueryInterface(device, &IID_ID3D10Device, (void **)&iface); + todo_wine ok(hr == E_NOINTERFACE, "Device should not implement ID3D10Device interface, hr %#x.\n", hr); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + + hr = ID3D11Device_QueryInterface(device, &IID_ID3D10Device1, (void **)&iface); + todo_wine ok(hr == E_NOINTERFACE, "Device should not implement ID3D10Device1 interface, hr %#x.\n", hr); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + } +} + +static void test_get_immediate_context(void) +{ + ID3D11DeviceContext *immediate_context, *previous_immediate_context; + ULONG expected_refcount, refcount; + ID3D11Device *device; + + if (!(device = create_device(NULL))) + { + skip("Failed to create device.\n"); + return; + } + + expected_refcount = get_refcount((IUnknown *)device) + 1; + ID3D11Device_GetImmediateContext(device, &immediate_context); + refcount = get_refcount((IUnknown *)device); + ok(refcount == expected_refcount, "Got unexpected refcount %u.\n", refcount); + previous_immediate_context = immediate_context; + + ID3D11Device_GetImmediateContext(device, &immediate_context); + ok(immediate_context == previous_immediate_context, "Got different immediate device context objects.\n"); + refcount = get_refcount((IUnknown *)device); + ok(refcount == expected_refcount, "Got unexpected refcount %u.\n", refcount); + + refcount = ID3D11DeviceContext_Release(previous_immediate_context); + ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + refcount = ID3D11DeviceContext_Release(immediate_context); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + + ID3D11Device_GetImmediateContext(device, &immediate_context); + ok(immediate_context == previous_immediate_context, "Got different immediate device context objects.\n"); + refcount = ID3D11DeviceContext_Release(immediate_context); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + +static void test_create_texture2d(void) +{ + ULONG refcount, expected_refcount; + D3D11_SUBRESOURCE_DATA data = {0}; + ID3D11Device *device, *tmp; + D3D11_TEXTURE2D_DESC desc; + ID3D11Texture2D *texture; + IDXGISurface *surface; + HRESULT hr; + + if (!(device = create_device(NULL))) + { + skip("Failed to create device, skipping tests.\n"); + return; + } + + desc.Width = 512; + desc.Height = 512; + desc.MipLevels = 1; + desc.ArraySize = 1; + desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + desc.SampleDesc.Count = 1; + desc.SampleDesc.Quality = 0; + desc.Usage = D3D11_USAGE_DEFAULT; + desc.BindFlags = D3D11_BIND_RENDER_TARGET; + desc.CPUAccessFlags = 0; + desc.MiscFlags = 0; + + hr = ID3D11Device_CreateTexture2D(device, &desc, &data, &texture); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + expected_refcount = get_refcount((IUnknown *)device) + 1; + hr = ID3D11Device_CreateTexture2D(device, &desc, NULL, &texture); + ok(SUCCEEDED(hr), "Failed to create a 2d texture, hr %#x.\n", hr); + refcount = get_refcount((IUnknown *)device); + ok(refcount >= expected_refcount, "Got unexpected refcount %u, expected >= %u.\n", refcount, expected_refcount); + tmp = NULL; + expected_refcount = refcount + 1; + ID3D11Texture2D_GetDevice(texture, &tmp); + ok(tmp == device, "Got unexpected device %p, expected %p.\n", tmp, device); + refcount = get_refcount((IUnknown *)device); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + ID3D11Device_Release(tmp); + + hr = ID3D11Texture2D_QueryInterface(texture, &IID_IDXGISurface, (void **)&surface); + ok(SUCCEEDED(hr), "Texture should implement IDXGISurface.\n"); + IDXGISurface_Release(surface); + ID3D11Texture2D_Release(texture); + + desc.MipLevels = 0; + expected_refcount = get_refcount((IUnknown *)device) + 1; + hr = ID3D11Device_CreateTexture2D(device, &desc, NULL, &texture); + ok(SUCCEEDED(hr), "Failed to create a 2d texture, hr %#x.\n", hr); + refcount = get_refcount((IUnknown *)device); + ok(refcount >= expected_refcount, "Got unexpected refcount %u, expected >= %u.\n", refcount, expected_refcount); + tmp = NULL; + expected_refcount = refcount + 1; + ID3D11Texture2D_GetDevice(texture, &tmp); + ok(tmp == device, "Got unexpected device %p, expected %p.\n", tmp, device); + refcount = get_refcount((IUnknown *)device); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + ID3D11Device_Release(tmp); + + ID3D11Texture2D_GetDesc(texture, &desc); + ok(desc.Width == 512, "Got unexpected Width %u.\n", desc.Width); + ok(desc.Height == 512, "Got unexpected Height %u.\n", desc.Height); + ok(desc.MipLevels == 10, "Got unexpected MipLevels %u.\n", desc.MipLevels); + ok(desc.ArraySize == 1, "Got unexpected ArraySize %u.\n", desc.ArraySize); + ok(desc.Format == DXGI_FORMAT_R8G8B8A8_UNORM, "Got unexpected Format %#x.\n", desc.Format); + ok(desc.SampleDesc.Count == 1, "Got unexpected SampleDesc.Count %u.\n", desc.SampleDesc.Count); + ok(desc.SampleDesc.Quality == 0, "Got unexpected SampleDesc.Quality %u.\n", desc.SampleDesc.Quality); + ok(desc.Usage == D3D11_USAGE_DEFAULT, "Got unexpected Usage %u.\n", desc.Usage); + ok(desc.BindFlags == D3D11_BIND_RENDER_TARGET, "Got unexpected BindFlags %#x.\n", desc.BindFlags); + ok(desc.CPUAccessFlags == 0, "Got unexpected CPUAccessFlags %#x.\n", desc.CPUAccessFlags); + ok(desc.MiscFlags == 0, "Got unexpected MiscFlags %#x.\n", desc.MiscFlags); + + hr = ID3D11Texture2D_QueryInterface(texture, &IID_IDXGISurface, (void **)&surface); + ok(FAILED(hr), "Texture should not implement IDXGISurface.\n"); + ID3D11Texture2D_Release(texture); + + desc.MipLevels = 1; + desc.ArraySize = 2; + hr = ID3D11Device_CreateTexture2D(device, &desc, NULL, &texture); + ok(SUCCEEDED(hr), "Failed to create a 2d texture, hr %#x.\n", hr); + + hr = ID3D11Texture2D_QueryInterface(texture, &IID_IDXGISurface, (void **)&surface); + ok(FAILED(hr), "Texture should not implement IDXGISurface.\n"); + ID3D11Texture2D_Release(texture); + + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + +static void test_texture2d_interfaces(void) +{ + ID3D10Texture2D *d3d10_texture; + D3D11_TEXTURE2D_DESC desc; + ID3D11Texture2D *texture; + IDXGISurface *surface; + ID3D11Device *device; + unsigned int i; + ULONG refcount; + HRESULT hr; + + static const struct test + { + BOOL implements_d3d10_interfaces; + UINT bind_flags; + UINT misc_flags; + UINT expected_bind_flags; + UINT expected_misc_flags; + } + desc_conversion_tests[] = + { + { + TRUE, + D3D11_BIND_SHADER_RESOURCE, 0, + D3D10_BIND_SHADER_RESOURCE, 0 + }, + { + TRUE, + D3D11_BIND_UNORDERED_ACCESS, 0, + D3D11_BIND_UNORDERED_ACCESS, 0 + }, + { + FALSE, + 0, D3D11_RESOURCE_MISC_RESOURCE_CLAMP, + 0, 0 + }, + { + TRUE, + 0, D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX, + 0, D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX + }, + { + TRUE, + 0, D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX | D3D11_RESOURCE_MISC_SHARED_NTHANDLE, + 0, D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX + }, + }; + + if (!(device = create_device(NULL))) + { + skip("Failed to create ID3D11Device, skipping tests.\n"); + return; + } + + desc.Width = 512; + desc.Height = 512; + desc.MipLevels = 0; + desc.ArraySize = 1; + desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + desc.SampleDesc.Count = 1; + desc.SampleDesc.Quality = 0; + desc.Usage = D3D11_USAGE_DEFAULT; + desc.BindFlags = D3D11_BIND_RENDER_TARGET; + desc.CPUAccessFlags = 0; + desc.MiscFlags = 0; + + hr = ID3D11Device_CreateTexture2D(device, &desc, NULL, &texture); + ok(SUCCEEDED(hr), "Failed to create a 2d texture, hr %#x.\n", hr); + + hr = ID3D11Texture2D_QueryInterface(texture, &IID_IDXGISurface, (void **)&surface); + ok(hr == E_NOINTERFACE, "Texture should not implement IDXGISurface.\n"); + + hr = ID3D11Texture2D_QueryInterface(texture, &IID_ID3D10Texture2D, (void **)&d3d10_texture); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Texture should implement ID3D10Texture2D.\n"); + if (SUCCEEDED(hr)) ID3D10Texture2D_Release(d3d10_texture); + ID3D11Texture2D_Release(texture); + + if (FAILED(hr)) + { + win_skip("2D textures do not implement ID3D10Texture2D, skipping tests.\n"); + ID3D11Device_Release(device); + return; + } + + for (i = 0; i < sizeof(desc_conversion_tests) / sizeof(*desc_conversion_tests); ++i) + { + const struct test *current = &desc_conversion_tests[i]; + D3D10_TEXTURE2D_DESC d3d10_desc; + ID3D10Device *d3d10_device; + + desc.Width = 512; + desc.Height = 512; + desc.MipLevels = 1; + desc.ArraySize = 1; + desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + desc.SampleDesc.Count = 1; + desc.SampleDesc.Quality = 0; + desc.Usage = D3D11_USAGE_DEFAULT; + desc.BindFlags = current->bind_flags; + desc.CPUAccessFlags = 0; + desc.MiscFlags = current->misc_flags; + + hr = ID3D11Device_CreateTexture2D(device, &desc, NULL, &texture); + /* Shared resources are not supported by REF and WARP devices. */ + ok(SUCCEEDED(hr) || broken(hr == E_OUTOFMEMORY), + "Test %u: Failed to create a 2d texture, hr %#x.\n", i, hr); + if (FAILED(hr)) + { + win_skip("Failed to create ID3D11Texture2D, skipping test %u.\n", i); + continue; + } + + hr = ID3D11Texture2D_QueryInterface(texture, &IID_IDXGISurface, (void **)&surface); + ok(SUCCEEDED(hr), "Test %u: Texture should implement IDXGISurface.\n", i); + IDXGISurface_Release(surface); + + hr = ID3D11Texture2D_QueryInterface(texture, &IID_ID3D10Texture2D, (void **)&d3d10_texture); + ID3D11Texture2D_Release(texture); + + if (current->implements_d3d10_interfaces) + { + ok(SUCCEEDED(hr), "Test %u: Texture should implement ID3D10Texture2D.\n", i); + } + else + { + todo_wine ok(hr == E_NOINTERFACE, "Test %u: Texture should not implement ID3D10Texture2D.\n", i); + if (SUCCEEDED(hr)) ID3D10Texture2D_Release(d3d10_texture); + continue; + } + + ID3D10Texture2D_GetDesc(d3d10_texture, &d3d10_desc); + + ok(d3d10_desc.Width == desc.Width, + "Test %u: Got unexpected Width %u.\n", i, d3d10_desc.Width); + ok(d3d10_desc.Height == desc.Height, + "Test %u: Got unexpected Height %u.\n", i, d3d10_desc.Height); + ok(d3d10_desc.MipLevels == desc.MipLevels, + "Test %u: Got unexpected MipLevels %u.\n", i, d3d10_desc.MipLevels); + ok(d3d10_desc.ArraySize == desc.ArraySize, + "Test %u: Got unexpected ArraySize %u.\n", i, d3d10_desc.ArraySize); + ok(d3d10_desc.Format == desc.Format, + "Test %u: Got unexpected Format %u.\n", i, d3d10_desc.Format); + ok(d3d10_desc.SampleDesc.Count == desc.SampleDesc.Count, + "Test %u: Got unexpected SampleDesc.Count %u.\n", i, d3d10_desc.SampleDesc.Count); + ok(d3d10_desc.SampleDesc.Quality == desc.SampleDesc.Quality, + "Test %u: Got unexpected SampleDesc.Quality %u.\n", i, d3d10_desc.SampleDesc.Quality); + ok(d3d10_desc.Usage == (D3D10_USAGE)desc.Usage, + "Test %u: Got unexpected Usage %u.\n", i, d3d10_desc.Usage); + ok(d3d10_desc.BindFlags == current->expected_bind_flags, + "Test %u: Got unexpected BindFlags %#x.\n", i, d3d10_desc.BindFlags); + ok(d3d10_desc.CPUAccessFlags == desc.CPUAccessFlags, + "Test %u: Got unexpected CPUAccessFlags %#x.\n", i, d3d10_desc.CPUAccessFlags); + ok(d3d10_desc.MiscFlags == current->expected_misc_flags, + "Test %u: Got unexpected MiscFlags %#x.\n", i, d3d10_desc.MiscFlags); + + d3d10_device = (ID3D10Device *)0xdeadbeef; + ID3D10Texture2D_GetDevice(d3d10_texture, &d3d10_device); + todo_wine ok(!d3d10_device, "Test %u: Got unexpected device pointer %p, expected NULL.\n", i, d3d10_device); + if (d3d10_device) ID3D10Device_Release(d3d10_device); + + ID3D10Texture2D_Release(d3d10_texture); + } + + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + +static void test_create_texture3d(void) +{ + ULONG refcount, expected_refcount; + D3D11_SUBRESOURCE_DATA data = {0}; + ID3D11Device *device, *tmp; + D3D11_TEXTURE3D_DESC desc; + ID3D11Texture3D *texture; + IDXGISurface *surface; + HRESULT hr; + + if (!(device = create_device(NULL))) + { + skip("Failed to create ID3D11Device, skipping tests.\n"); + return; + } + + desc.Width = 64; + desc.Height = 64; + desc.Depth = 64; + desc.MipLevels = 1; + desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + desc.Usage = D3D11_USAGE_DEFAULT; + desc.BindFlags = D3D11_BIND_RENDER_TARGET; + desc.CPUAccessFlags = 0; + desc.MiscFlags = 0; + + hr = ID3D11Device_CreateTexture3D(device, &desc, &data, &texture); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + expected_refcount = get_refcount((IUnknown *)device) + 1; + hr = ID3D11Device_CreateTexture3D(device, &desc, NULL, &texture); + ok(SUCCEEDED(hr), "Failed to create a 3d texture, hr %#x.\n", hr); + refcount = get_refcount((IUnknown *)device); + ok(refcount >= expected_refcount, "Got unexpected refcount %u, expected >= %u.\n", refcount, expected_refcount); + tmp = NULL; + expected_refcount = refcount + 1; + ID3D11Texture3D_GetDevice(texture, &tmp); + ok(tmp == device, "Got unexpected device %p, expected %p.\n", tmp, device); + refcount = get_refcount((IUnknown *)device); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + ID3D11Device_Release(tmp); + + hr = ID3D11Texture3D_QueryInterface(texture, &IID_IDXGISurface, (void **)&surface); + ok(FAILED(hr), "Texture should not implement IDXGISurface.\n"); + ID3D11Texture3D_Release(texture); + + desc.MipLevels = 0; + expected_refcount = get_refcount((IUnknown *)device) + 1; + hr = ID3D11Device_CreateTexture3D(device, &desc, NULL, &texture); + ok(SUCCEEDED(hr), "Failed to create a 3d texture, hr %#x.\n", hr); + refcount = get_refcount((IUnknown *)device); + ok(refcount >= expected_refcount, "Got unexpected refcount %u, expected >= %u.\n", refcount, expected_refcount); + tmp = NULL; + expected_refcount = refcount + 1; + ID3D11Texture3D_GetDevice(texture, &tmp); + ok(tmp == device, "Got unexpected device %p, expected %p.\n", tmp, device); + refcount = get_refcount((IUnknown *)device); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + ID3D11Device_Release(tmp); + + ID3D11Texture3D_GetDesc(texture, &desc); + ok(desc.Width == 64, "Got unexpected Width %u.\n", desc.Width); + ok(desc.Height == 64, "Got unexpected Height %u.\n", desc.Height); + ok(desc.Depth == 64, "Got unexpected Depth %u.\n", desc.Depth); + ok(desc.MipLevels == 7, "Got unexpected MipLevels %u.\n", desc.MipLevels); + ok(desc.Format == DXGI_FORMAT_R8G8B8A8_UNORM, "Got unexpected Format %#x.\n", desc.Format); + ok(desc.Usage == D3D11_USAGE_DEFAULT, "Got unexpected Usage %u.\n", desc.Usage); + ok(desc.BindFlags == D3D11_BIND_RENDER_TARGET, "Got unexpected BindFlags %u.\n", desc.BindFlags); + ok(desc.CPUAccessFlags == 0, "Got unexpected CPUAccessFlags %u.\n", desc.CPUAccessFlags); + ok(desc.MiscFlags == 0, "Got unexpected MiscFlags %u.\n", desc.MiscFlags); + + hr = ID3D11Texture3D_QueryInterface(texture, &IID_IDXGISurface, (void **)&surface); + ok(FAILED(hr), "Texture should not implement IDXGISurface.\n"); + ID3D11Texture3D_Release(texture); + + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + +static void test_texture3d_interfaces(void) +{ + ID3D10Texture3D *d3d10_texture; + D3D11_TEXTURE3D_DESC desc; + ID3D11Texture3D *texture; + IDXGISurface *surface; + ID3D11Device *device; + unsigned int i; + ULONG refcount; + HRESULT hr; + + static const struct test + { + BOOL implements_d3d10_interfaces; + UINT bind_flags; + UINT misc_flags; + UINT expected_bind_flags; + UINT expected_misc_flags; + } + desc_conversion_tests[] = + { + { + TRUE, + D3D11_BIND_SHADER_RESOURCE, 0, + D3D10_BIND_SHADER_RESOURCE, 0 + }, + { + TRUE, + D3D11_BIND_UNORDERED_ACCESS, 0, + D3D11_BIND_UNORDERED_ACCESS, 0 + }, + { + FALSE, + 0, D3D11_RESOURCE_MISC_RESOURCE_CLAMP, + 0, 0 + }, + { + TRUE, + 0, D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX, + 0, D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX + }, + }; + + if (!(device = create_device(NULL))) + { + skip("Failed to create ID3D11Device.\n"); + return; + } + + desc.Width = 64; + desc.Height = 64; + desc.Depth = 64; + desc.MipLevels = 0; + desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + desc.Usage = D3D11_USAGE_DEFAULT; + desc.BindFlags = D3D11_BIND_RENDER_TARGET; + desc.CPUAccessFlags = 0; + desc.MiscFlags = 0; + + hr = ID3D11Device_CreateTexture3D(device, &desc, NULL, &texture); + ok(SUCCEEDED(hr), "Failed to create a 3d texture, hr %#x.\n", hr); + + hr = ID3D11Texture3D_QueryInterface(texture, &IID_IDXGISurface, (void **)&surface); + ok(hr == E_NOINTERFACE, "Texture should not implement IDXGISurface.\n"); + + hr = ID3D11Texture3D_QueryInterface(texture, &IID_ID3D10Texture3D, (void **)&d3d10_texture); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Texture should implement ID3D10Texture3D.\n"); + if (SUCCEEDED(hr)) ID3D10Texture3D_Release(d3d10_texture); + ID3D11Texture3D_Release(texture); + + if (FAILED(hr)) + { + win_skip("3D textures do not implement ID3D10Texture3D.\n"); + ID3D11Device_Release(device); + return; + } + + for (i = 0; i < sizeof(desc_conversion_tests) / sizeof(*desc_conversion_tests); ++i) + { + const struct test *current = &desc_conversion_tests[i]; + D3D10_TEXTURE3D_DESC d3d10_desc; + ID3D10Device *d3d10_device; + + desc.Width = 64; + desc.Height = 64; + desc.Depth = 64; + desc.MipLevels = 1; + desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + desc.Usage = D3D11_USAGE_DEFAULT; + desc.BindFlags = current->bind_flags; + desc.CPUAccessFlags = 0; + desc.MiscFlags = current->misc_flags; + + hr = ID3D11Device_CreateTexture3D(device, &desc, NULL, &texture); + /* Shared resources are not supported by REF and WARP devices. */ + ok(SUCCEEDED(hr) || broken(hr == E_OUTOFMEMORY), + "Test %u: Failed to create a 3d texture, hr %#x.\n", i, hr); + if (FAILED(hr)) + { + win_skip("Failed to create ID3D11Texture3D, skipping test %u.\n", i); + continue; + } + + hr = ID3D11Texture3D_QueryInterface(texture, &IID_IDXGISurface, (void **)&surface); + ok(hr == E_NOINTERFACE, "Texture should not implement IDXGISurface.\n"); + + hr = ID3D11Texture3D_QueryInterface(texture, &IID_ID3D10Texture3D, (void **)&d3d10_texture); + ID3D11Texture3D_Release(texture); + + if (current->implements_d3d10_interfaces) + { + ok(SUCCEEDED(hr), "Test %u: Texture should implement ID3D10Texture3D.\n", i); + } + else + { + todo_wine ok(hr == E_NOINTERFACE, "Test %u: Texture should not implement ID3D10Texture3D.\n", i); + if (SUCCEEDED(hr)) ID3D10Texture3D_Release(d3d10_texture); + continue; + } + + ID3D10Texture3D_GetDesc(d3d10_texture, &d3d10_desc); + + ok(d3d10_desc.Width == desc.Width, + "Test %u: Got unexpected Width %u.\n", i, d3d10_desc.Width); + ok(d3d10_desc.Height == desc.Height, + "Test %u: Got unexpected Height %u.\n", i, d3d10_desc.Height); + ok(d3d10_desc.Depth == desc.Depth, + "Test %u: Got unexpected Depth %u.\n", i, d3d10_desc.Depth); + ok(d3d10_desc.MipLevels == desc.MipLevels, + "Test %u: Got unexpected MipLevels %u.\n", i, d3d10_desc.MipLevels); + ok(d3d10_desc.Format == desc.Format, + "Test %u: Got unexpected Format %u.\n", i, d3d10_desc.Format); + ok(d3d10_desc.Usage == (D3D10_USAGE)desc.Usage, + "Test %u: Got unexpected Usage %u.\n", i, d3d10_desc.Usage); + ok(d3d10_desc.BindFlags == current->expected_bind_flags, + "Test %u: Got unexpected BindFlags %#x.\n", i, d3d10_desc.BindFlags); + ok(d3d10_desc.CPUAccessFlags == desc.CPUAccessFlags, + "Test %u: Got unexpected CPUAccessFlags %#x.\n", i, d3d10_desc.CPUAccessFlags); + ok(d3d10_desc.MiscFlags == current->expected_misc_flags, + "Test %u: Got unexpected MiscFlags %#x.\n", i, d3d10_desc.MiscFlags); + + d3d10_device = (ID3D10Device *)0xdeadbeef; + ID3D10Texture3D_GetDevice(d3d10_texture, &d3d10_device); + todo_wine ok(!d3d10_device, "Test %u: Got unexpected device pointer %p, expected NULL.\n", i, d3d10_device); + if (d3d10_device) ID3D10Device_Release(d3d10_device); + + ID3D10Texture3D_Release(d3d10_texture); + } + + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + +static void test_buffer_interfaces(void) +{ + ID3D10Buffer *d3d10_buffer; + D3D11_BUFFER_DESC desc; + ID3D11Buffer *buffer; + ID3D11Device *device; + unsigned int i; + ULONG refcount; + HRESULT hr; + + static const struct test + { + BOOL implements_d3d10_interfaces; + UINT bind_flags; + UINT misc_flags; + UINT structure_stride; + UINT expected_bind_flags; + UINT expected_misc_flags; + } + desc_conversion_tests[] = + { + { + TRUE, + D3D11_BIND_VERTEX_BUFFER, 0, 0, + D3D10_BIND_VERTEX_BUFFER, 0 + }, + { + TRUE, + D3D11_BIND_INDEX_BUFFER, 0, 0, + D3D10_BIND_INDEX_BUFFER, 0 + }, + { + TRUE, + D3D11_BIND_CONSTANT_BUFFER, 0, 0, + D3D10_BIND_CONSTANT_BUFFER, 0 + }, + { + TRUE, + D3D11_BIND_SHADER_RESOURCE, 0, 0, + D3D10_BIND_SHADER_RESOURCE, 0 + }, + { + TRUE, + D3D11_BIND_STREAM_OUTPUT, 0, 0, + D3D10_BIND_STREAM_OUTPUT, 0 + }, + { + TRUE, + D3D11_BIND_RENDER_TARGET, 0, 0, + D3D10_BIND_RENDER_TARGET, 0 + }, + { + TRUE, + D3D11_BIND_UNORDERED_ACCESS, 0, 0, + D3D11_BIND_UNORDERED_ACCESS, 0 + }, + { + TRUE, + 0, D3D11_RESOURCE_MISC_SHARED, 0, + 0, D3D10_RESOURCE_MISC_SHARED + }, + { + TRUE, + 0, D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS, 0, + 0, 0 + }, + { + TRUE, + D3D11_BIND_SHADER_RESOURCE, D3D11_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS, 0, + D3D10_BIND_SHADER_RESOURCE, 0 + }, + { + FALSE /* Structured buffers do not implement ID3D10Buffer. */, + 0, D3D11_RESOURCE_MISC_BUFFER_STRUCTURED, 16, + 0, 0 + }, + { + TRUE, + 0, D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX, 0, + 0, D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX + }, + }; + + if (!(device = create_device(NULL))) + { + skip("Failed to create ID3D11Device.\n"); + return; + } + + desc.ByteWidth = 1024; + desc.Usage = D3D11_USAGE_DEFAULT; + desc.BindFlags = D3D11_BIND_VERTEX_BUFFER; + desc.CPUAccessFlags = 0; + desc.MiscFlags = 0; + desc.StructureByteStride = 0; + + hr = ID3D11Device_CreateBuffer(device, &desc, NULL, &buffer); + ok(SUCCEEDED(hr), "Failed to create a buffer, hr %#x.\n", hr); + + hr = ID3D11Buffer_QueryInterface(buffer, &IID_ID3D10Buffer, (void **)&d3d10_buffer); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Buffer should implement ID3D10Buffer.\n"); + if (SUCCEEDED(hr)) ID3D10Buffer_Release(d3d10_buffer); + ID3D11Buffer_Release(buffer); + + if (FAILED(hr)) + { + win_skip("Buffers do not implement ID3D10Buffer.\n"); + ID3D11Device_Release(device); + return; + } + + for (i = 0; i < sizeof(desc_conversion_tests) / sizeof(*desc_conversion_tests); ++i) + { + const struct test *current = &desc_conversion_tests[i]; + D3D10_BUFFER_DESC d3d10_desc; + ID3D10Device *d3d10_device; + + desc.ByteWidth = 1024; + desc.Usage = D3D11_USAGE_DEFAULT; + desc.BindFlags = current->bind_flags; + desc.CPUAccessFlags = 0; + desc.MiscFlags = current->misc_flags; + desc.StructureByteStride = current->structure_stride; + + hr = ID3D11Device_CreateBuffer(device, &desc, NULL, &buffer); + /* Shared resources are not supported by REF and WARP devices. */ + ok(SUCCEEDED(hr) || broken(hr == E_OUTOFMEMORY), "Test %u: Failed to create a buffer, hr %#x.\n", i, hr); + if (FAILED(hr)) + { + win_skip("Failed to create a buffer, skipping test %u.\n", i); + continue; + } + + hr = ID3D11Buffer_QueryInterface(buffer, &IID_ID3D10Buffer, (void **)&d3d10_buffer); + ID3D11Buffer_Release(buffer); + + if (current->implements_d3d10_interfaces) + { + ok(SUCCEEDED(hr), "Test %u: Buffer should implement ID3D10Buffer.\n", i); + } + else + { + todo_wine ok(hr == E_NOINTERFACE, "Test %u: Buffer should not implement ID3D10Buffer.\n", i); + if (SUCCEEDED(hr)) ID3D10Buffer_Release(d3d10_buffer); + continue; + } + + ID3D10Buffer_GetDesc(d3d10_buffer, &d3d10_desc); + + ok(d3d10_desc.ByteWidth == desc.ByteWidth, + "Test %u: Got unexpected ByteWidth %u.\n", i, d3d10_desc.ByteWidth); + ok(d3d10_desc.Usage == (D3D10_USAGE)desc.Usage, + "Test %u: Got unexpected Usage %u.\n", i, d3d10_desc.Usage); + ok(d3d10_desc.BindFlags == current->expected_bind_flags, + "Test %u: Got unexpected BindFlags %#x.\n", i, d3d10_desc.BindFlags); + ok(d3d10_desc.CPUAccessFlags == desc.CPUAccessFlags, + "Test %u: Got unexpected CPUAccessFlags %#x.\n", i, d3d10_desc.CPUAccessFlags); + ok(d3d10_desc.MiscFlags == current->expected_misc_flags, + "Test %u: Got unexpected MiscFlags %#x.\n", i, d3d10_desc.MiscFlags); + + d3d10_device = (ID3D10Device *)0xdeadbeef; + ID3D10Buffer_GetDevice(d3d10_buffer, &d3d10_device); + todo_wine ok(!d3d10_device, "Test %u: Got unexpected device pointer %p, expected NULL.\n", i, d3d10_device); + if (d3d10_device) ID3D10Device_Release(d3d10_device); + + ID3D10Buffer_Release(d3d10_buffer); + } + + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + +static void test_create_depthstencil_view(void) +{ + D3D11_DEPTH_STENCIL_VIEW_DESC dsv_desc; + D3D11_TEXTURE2D_DESC texture_desc; + ULONG refcount, expected_refcount; + ID3D11DepthStencilView *dsview; + ID3D11Device *device, *tmp; + ID3D11Texture2D *texture; + HRESULT hr; + + if (!(device = create_device(NULL))) + { + skip("Failed to create device.\n"); + return; + } + + texture_desc.Width = 512; + texture_desc.Height = 512; + texture_desc.MipLevels = 1; + texture_desc.ArraySize = 1; + texture_desc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; + 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 a 2d texture, hr %#x.\n", hr); + + expected_refcount = get_refcount((IUnknown *)device) + 1; + hr = ID3D11Device_CreateDepthStencilView(device, (ID3D11Resource *)texture, NULL, &dsview); + ok(SUCCEEDED(hr), "Failed to create a depthstencil view, hr %#x.\n", hr); + refcount = get_refcount((IUnknown *)device); + ok(refcount >= expected_refcount, "Got unexpected refcount %u, expected >= %u.\n", refcount, expected_refcount); + tmp = NULL; + expected_refcount = refcount + 1; + ID3D11DepthStencilView_GetDevice(dsview, &tmp); + ok(tmp == device, "Got unexpected device %p, expected %p.\n", tmp, device); + refcount = get_refcount((IUnknown *)device); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + ID3D11Device_Release(tmp); + + ID3D11DepthStencilView_GetDesc(dsview, &dsv_desc); + ok(dsv_desc.Format == texture_desc.Format, "Got unexpected format %#x.\n", dsv_desc.Format); + ok(dsv_desc.ViewDimension == D3D11_DSV_DIMENSION_TEXTURE2D, + "Got unexpected view dimension %#x.\n", dsv_desc.ViewDimension); + ok(!dsv_desc.Flags, "Got unexpected flags %#x.\n", dsv_desc.Flags); + ok(U(dsv_desc).Texture2D.MipSlice == 0, "Got Unexpected mip slice %u.\n", U(dsv_desc).Texture2D.MipSlice); + + ID3D11DepthStencilView_Release(dsview); + ID3D11Texture2D_Release(texture); + + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + +static void test_depthstencil_view_interfaces(void) +{ + D3D10_DEPTH_STENCIL_VIEW_DESC d3d10_dsv_desc; + D3D11_DEPTH_STENCIL_VIEW_DESC dsv_desc; + ID3D10DepthStencilView *d3d10_dsview; + D3D11_TEXTURE2D_DESC texture_desc; + ID3D11DepthStencilView *dsview; + ID3D11Texture2D *texture; + ID3D11Device *device; + ULONG refcount; + HRESULT hr; + + if (!(device = create_device(NULL))) + { + skip("Failed to create device.\n"); + return; + } + + texture_desc.Width = 512; + texture_desc.Height = 512; + texture_desc.MipLevels = 1; + texture_desc.ArraySize = 1; + texture_desc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; + 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 a 2d texture, hr %#x.\n", hr); + + dsv_desc.Format = texture_desc.Format; + dsv_desc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D; + dsv_desc.Flags = 0; + U(dsv_desc).Texture2D.MipSlice = 0; + + hr = ID3D11Device_CreateDepthStencilView(device, (ID3D11Resource *)texture, &dsv_desc, &dsview); + ok(SUCCEEDED(hr), "Failed to create a depthstencil view, hr %#x.\n", hr); + + hr = ID3D11DepthStencilView_QueryInterface(dsview, &IID_ID3D10DepthStencilView, (void **)&d3d10_dsview); + ID3D11DepthStencilView_Release(dsview); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Depth stencil view should implement ID3D10DepthStencilView.\n"); + + if (FAILED(hr)) + { + win_skip("Depth stencil view does not implement ID3D10DepthStencilView.\n"); + goto done; + } + + ID3D10DepthStencilView_GetDesc(d3d10_dsview, &d3d10_dsv_desc); + ok(d3d10_dsv_desc.Format == dsv_desc.Format, "Got unexpected format %#x.\n", d3d10_dsv_desc.Format); + ok(d3d10_dsv_desc.ViewDimension == (D3D10_DSV_DIMENSION)dsv_desc.ViewDimension, + "Got unexpected view dimension %u.\n", d3d10_dsv_desc.ViewDimension); + ok(U(d3d10_dsv_desc).Texture2D.MipSlice == U(dsv_desc).Texture2D.MipSlice, + "Got unexpected mip slice %u.\n", U(d3d10_dsv_desc).Texture2D.MipSlice); + + ID3D10DepthStencilView_Release(d3d10_dsview); + +done: + ID3D11Texture2D_Release(texture); + + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + +static void test_create_rendertarget_view(void) +{ + D3D11_RENDER_TARGET_VIEW_DESC rtv_desc; + D3D11_SUBRESOURCE_DATA data = {0}; + D3D11_TEXTURE2D_DESC texture_desc; + ULONG refcount, expected_refcount; + D3D11_BUFFER_DESC buffer_desc; + ID3D11RenderTargetView *rtview; + ID3D11Device *device, *tmp; + ID3D11Texture2D *texture; + ID3D11Buffer *buffer; + IUnknown *iface; + HRESULT hr; + + if (!(device = create_device(NULL))) + { + skip("Failed to create device.\n"); + return; + } + + buffer_desc.ByteWidth = 1024; + buffer_desc.Usage = D3D11_USAGE_DEFAULT; + buffer_desc.BindFlags = D3D11_BIND_RENDER_TARGET; + buffer_desc.CPUAccessFlags = 0; + buffer_desc.MiscFlags = 0; + buffer_desc.StructureByteStride = 0; + + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &data, &buffer); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + expected_refcount = get_refcount((IUnknown *)device) + 1; + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, NULL, &buffer); + ok(SUCCEEDED(hr), "Failed to create a buffer, hr %#x.\n", hr); + refcount = get_refcount((IUnknown *)device); + ok(refcount >= expected_refcount, "Got unexpected refcount %u, expected >= %u.\n", refcount, expected_refcount); + tmp = NULL; + expected_refcount = refcount + 1; + ID3D11Buffer_GetDevice(buffer, &tmp); + ok(tmp == device, "Got unexpected device %p, expected %p.\n", tmp, device); + refcount = get_refcount((IUnknown *)device); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + ID3D11Device_Release(tmp); + + rtv_desc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT; + rtv_desc.ViewDimension = D3D11_RTV_DIMENSION_BUFFER; + U(rtv_desc).Buffer.ElementOffset = 0; + U(rtv_desc).Buffer.ElementWidth = 64; + + expected_refcount = get_refcount((IUnknown *)device) + 1; + hr = ID3D11Device_CreateRenderTargetView(device, (ID3D11Resource *)buffer, &rtv_desc, &rtview); + ok(SUCCEEDED(hr), "Failed to create a rendertarget view, hr %#x.\n", hr); + refcount = get_refcount((IUnknown *)device); + ok(refcount >= expected_refcount, "Got unexpected refcount %u, expected >= %u.\n", refcount, expected_refcount); + tmp = NULL; + expected_refcount = refcount + 1; + ID3D11RenderTargetView_GetDevice(rtview, &tmp); + ok(tmp == device, "Got unexpected device %p, expected %p.\n", tmp, device); + refcount = get_refcount((IUnknown *)device); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + ID3D11Device_Release(tmp); + + hr = ID3D11RenderTargetView_QueryInterface(rtview, &IID_ID3D10RenderTargetView, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Render target view should implement ID3D10RenderTargetView.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + + ID3D11RenderTargetView_Release(rtview); + ID3D11Buffer_Release(buffer); + + texture_desc.Width = 512; + texture_desc.Height = 512; + 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 a 2d texture, hr %#x.\n", hr); + + /* For texture resources it's allowed to specify NULL as desc */ + hr = ID3D11Device_CreateRenderTargetView(device, (ID3D11Resource *)texture, NULL, &rtview); + ok(SUCCEEDED(hr), "Failed to create a rendertarget view, hr %#x.\n", hr); + + ID3D11RenderTargetView_GetDesc(rtview, &rtv_desc); + ok(rtv_desc.Format == texture_desc.Format, "Got unexpected format %#x.\n", rtv_desc.Format); + ok(rtv_desc.ViewDimension == D3D11_RTV_DIMENSION_TEXTURE2D, "Got unexpected view dimension %#x.\n", + rtv_desc.ViewDimension); + ok(U(rtv_desc).Texture2D.MipSlice == 0, "Got unexpected mip slice %#x.\n", U(rtv_desc).Texture2D.MipSlice); + + hr = ID3D11RenderTargetView_QueryInterface(rtview, &IID_ID3D10RenderTargetView, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Render target view should implement ID3D10RenderTargetView.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + + ID3D11RenderTargetView_Release(rtview); + ID3D11Texture2D_Release(texture); + + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + +static void test_create_shader_resource_view(void) +{ + D3D11_SHADER_RESOURCE_VIEW_DESC srv_desc; + D3D11_TEXTURE2D_DESC texture_desc; + ULONG refcount, expected_refcount; + ID3D11ShaderResourceView *srview; + D3D11_BUFFER_DESC buffer_desc; + ID3D11Device *device, *tmp; + ID3D11Texture2D *texture; + ID3D11Buffer *buffer; + IUnknown *iface; + HRESULT hr; + + if (!(device = create_device(NULL))) + { + skip("Failed to create device.\n"); + return; + } + + buffer_desc.ByteWidth = 1024; + buffer_desc.Usage = D3D11_USAGE_DEFAULT; + buffer_desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; + buffer_desc.CPUAccessFlags = 0; + buffer_desc.MiscFlags = 0; + buffer_desc.StructureByteStride = 0; + + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, NULL, &buffer); + ok(SUCCEEDED(hr), "Failed to create a buffer, hr %#x.\n", hr); + + hr = ID3D11Device_CreateShaderResourceView(device, (ID3D11Resource *)buffer, NULL, &srview); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + srv_desc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT; + srv_desc.ViewDimension = D3D11_SRV_DIMENSION_BUFFER; + U(srv_desc).Buffer.ElementOffset = 0; + U(srv_desc).Buffer.ElementWidth = 64; + + expected_refcount = get_refcount((IUnknown *)device) + 1; + hr = ID3D11Device_CreateShaderResourceView(device, (ID3D11Resource *)buffer, &srv_desc, &srview); + ok(SUCCEEDED(hr), "Failed to create a shader resource view, hr %#x.\n", hr); + refcount = get_refcount((IUnknown *)device); + ok(refcount >= expected_refcount, "Got unexpected refcount %u, expected >= %u.\n", refcount, expected_refcount); + tmp = NULL; + expected_refcount = refcount + 1; + ID3D11ShaderResourceView_GetDevice(srview, &tmp); + ok(tmp == device, "Got unexpected device %p, expected %p.\n", tmp, device); + refcount = get_refcount((IUnknown *)device); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + ID3D11Device_Release(tmp); + + hr = ID3D11ShaderResourceView_QueryInterface(srview, &IID_ID3D10ShaderResourceView, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Shader resource view should implement ID3D10ShaderResourceView.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + hr = ID3D11ShaderResourceView_QueryInterface(srview, &IID_ID3D10ShaderResourceView1, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Shader resource view should implement ID3D10ShaderResourceView1.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + + ID3D11ShaderResourceView_Release(srview); + ID3D11Buffer_Release(buffer); + + texture_desc.Width = 512; + texture_desc.Height = 512; + texture_desc.MipLevels = 0; + 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_SHADER_RESOURCE; + texture_desc.CPUAccessFlags = 0; + texture_desc.MiscFlags = 0; + + hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, &texture); + ok(SUCCEEDED(hr), "Failed to create a 2d texture, hr %#x.\n", hr); + + hr = ID3D11Device_CreateShaderResourceView(device, (ID3D11Resource *)texture, NULL, &srview); + ok(SUCCEEDED(hr), "Failed to create a shader resource view, hr %#x.\n", hr); + + hr = ID3D11ShaderResourceView_QueryInterface(srview, &IID_ID3D10ShaderResourceView, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Shader resource view should implement ID3D10ShaderResourceView.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + hr = ID3D11ShaderResourceView_QueryInterface(srview, &IID_ID3D10ShaderResourceView1, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Shader resource view should implement ID3D10ShaderResourceView1.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + + ID3D11ShaderResourceView_GetDesc(srview, &srv_desc); + ok(srv_desc.Format == texture_desc.Format, "Got unexpected format %#x.\n", srv_desc.Format); + ok(srv_desc.ViewDimension == D3D11_SRV_DIMENSION_TEXTURE2D, + "Got unexpected view dimension %#x.\n", srv_desc.ViewDimension); + ok(U(srv_desc).Texture2D.MostDetailedMip == 0, "Got unexpected MostDetailedMip %u.\n", + U(srv_desc).Texture2D.MostDetailedMip); + ok(U(srv_desc).Texture2D.MipLevels == 10, "Got unexpected MipLevels %u.\n", U(srv_desc).Texture2D.MipLevels); + + ID3D11ShaderResourceView_Release(srview); + ID3D11Texture2D_Release(texture); + + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + +static void test_create_shader(void) +{ +#if 0 + float4 light; + float4x4 mat; + + struct input + { + float4 position : POSITION; + float3 normal : NORMAL; + }; + + struct output + { + float4 position : POSITION; + float4 diffuse : COLOR; + }; + + output main(const input v) + { + output o; + + o.position = mul(v.position, mat); + o.diffuse = dot((float3)light, v.normal); + + return o; + } +#endif + static const DWORD vs_4_0[] = + { + 0x43425844, 0x3ae813ca, 0x0f034b91, 0x790f3226, 0x6b4a718a, 0x00000001, 0x000001c0, + 0x00000003, 0x0000002c, 0x0000007c, 0x000000cc, 0x4e475349, 0x00000048, 0x00000002, + 0x00000008, 0x00000038, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, + 0x00000041, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000707, 0x49534f50, + 0x4e4f4954, 0x524f4e00, 0x004c414d, 0x4e47534f, 0x00000048, 0x00000002, 0x00000008, + 0x00000038, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x00000041, + 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000000f, 0x49534f50, 0x4e4f4954, + 0x4c4f4300, 0xab00524f, 0x52444853, 0x000000ec, 0x00010040, 0x0000003b, 0x04000059, + 0x00208e46, 0x00000000, 0x00000005, 0x0300005f, 0x001010f2, 0x00000000, 0x0300005f, + 0x00101072, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x03000065, 0x001020f2, + 0x00000001, 0x08000011, 0x00102012, 0x00000000, 0x00101e46, 0x00000000, 0x00208e46, + 0x00000000, 0x00000001, 0x08000011, 0x00102022, 0x00000000, 0x00101e46, 0x00000000, + 0x00208e46, 0x00000000, 0x00000002, 0x08000011, 0x00102042, 0x00000000, 0x00101e46, + 0x00000000, 0x00208e46, 0x00000000, 0x00000003, 0x08000011, 0x00102082, 0x00000000, + 0x00101e46, 0x00000000, 0x00208e46, 0x00000000, 0x00000004, 0x08000010, 0x001020f2, + 0x00000001, 0x00208246, 0x00000000, 0x00000000, 0x00101246, 0x00000001, 0x0100003e, + }; + + static const DWORD vs_2_0[] = + { + 0xfffe0200, 0x002bfffe, 0x42415443, 0x0000001c, 0x00000077, 0xfffe0200, 0x00000002, + 0x0000001c, 0x00000100, 0x00000070, 0x00000044, 0x00040002, 0x00000001, 0x0000004c, + 0x00000000, 0x0000005c, 0x00000002, 0x00000004, 0x00000060, 0x00000000, 0x6867696c, + 0xabab0074, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x0074616d, 0x00030003, + 0x00040004, 0x00000001, 0x00000000, 0x325f7376, 0x4d00305f, 0x6f726369, 0x74666f73, + 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, + 0x392e3932, 0x332e3235, 0x00313131, 0x0200001f, 0x80000000, 0x900f0000, 0x0200001f, + 0x80000003, 0x900f0001, 0x03000009, 0xc0010000, 0x90e40000, 0xa0e40000, 0x03000009, + 0xc0020000, 0x90e40000, 0xa0e40001, 0x03000009, 0xc0040000, 0x90e40000, 0xa0e40002, + 0x03000009, 0xc0080000, 0x90e40000, 0xa0e40003, 0x03000008, 0xd00f0000, 0xa0e40004, + 0x90e40001, 0x0000ffff, + }; + + static const DWORD vs_3_0[] = + { + 0xfffe0300, 0x002bfffe, 0x42415443, 0x0000001c, 0x00000077, 0xfffe0300, 0x00000002, + 0x0000001c, 0x00000100, 0x00000070, 0x00000044, 0x00040002, 0x00000001, 0x0000004c, + 0x00000000, 0x0000005c, 0x00000002, 0x00000004, 0x00000060, 0x00000000, 0x6867696c, + 0xabab0074, 0x00030001, 0x00040001, 0x00000001, 0x00000000, 0x0074616d, 0x00030003, + 0x00040004, 0x00000001, 0x00000000, 0x335f7376, 0x4d00305f, 0x6f726369, 0x74666f73, + 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, 0x656c6970, 0x2e392072, + 0x392e3932, 0x332e3235, 0x00313131, 0x0200001f, 0x80000000, 0x900f0000, 0x0200001f, + 0x80000003, 0x900f0001, 0x0200001f, 0x80000000, 0xe00f0000, 0x0200001f, 0x8000000a, + 0xe00f0001, 0x03000009, 0xe0010000, 0x90e40000, 0xa0e40000, 0x03000009, 0xe0020000, + 0x90e40000, 0xa0e40001, 0x03000009, 0xe0040000, 0x90e40000, 0xa0e40002, 0x03000009, + 0xe0080000, 0x90e40000, 0xa0e40003, 0x03000008, 0xe00f0001, 0xa0e40004, 0x90e40001, + 0x0000ffff, + }; + +#if 0 + float4 main(const float4 color : COLOR) : SV_TARGET + { + float4 o; + + o = color; + + return o; + } +#endif + static const DWORD ps_4_0[] = + { + 0x43425844, 0x4da9446f, 0xfbe1f259, 0x3fdb3009, 0x517521fa, 0x00000001, 0x000001ac, + 0x00000005, 0x00000034, 0x0000008c, 0x000000bc, 0x000000f0, 0x00000130, 0x46454452, + 0x00000050, 0x00000000, 0x00000000, 0x00000000, 0x0000001c, 0xffff0400, 0x00000100, + 0x0000001c, 0x7263694d, 0x666f736f, 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, + 0x6f432072, 0x6c69706d, 0x39207265, 0x2e39322e, 0x2e323539, 0x31313133, 0xababab00, + 0x4e475349, 0x00000028, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, + 0x00000003, 0x00000000, 0x00000f0f, 0x4f4c4f43, 0xabab0052, 0x4e47534f, 0x0000002c, + 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, + 0x0000000f, 0x545f5653, 0x45475241, 0xabab0054, 0x52444853, 0x00000038, 0x00000040, + 0x0000000e, 0x03001062, 0x001010f2, 0x00000000, 0x03000065, 0x001020f2, 0x00000000, + 0x05000036, 0x001020f2, 0x00000000, 0x00101e46, 0x00000000, 0x0100003e, 0x54415453, + 0x00000074, 0x00000002, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000000, + 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, + }; + +#if 0 + struct gs_out + { + float4 pos : SV_POSITION; + }; + + [maxvertexcount(4)] + void main(point float4 vin[1] : POSITION, inout TriangleStream vout) + { + float offset = 0.1 * vin[0].w; + gs_out v; + + v.pos = float4(vin[0].x - offset, vin[0].y - offset, vin[0].z, vin[0].w); + vout.Append(v); + v.pos = float4(vin[0].x - offset, vin[0].y + offset, vin[0].z, vin[0].w); + vout.Append(v); + v.pos = float4(vin[0].x + offset, vin[0].y - offset, vin[0].z, vin[0].w); + vout.Append(v); + v.pos = float4(vin[0].x + offset, vin[0].y + offset, vin[0].z, vin[0].w); + vout.Append(v); + } +#endif + static const DWORD gs_4_0[] = + { + 0x43425844, 0x000ee786, 0xc624c269, 0x885a5cbe, 0x444b3b1f, 0x00000001, 0x0000023c, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x49534f50, 0x4e4f4954, 0xababab00, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000001, 0x00000003, + 0x00000000, 0x0000000f, 0x505f5653, 0x5449534f, 0x004e4f49, 0x52444853, 0x000001a0, 0x00020040, + 0x00000068, 0x0400005f, 0x002010f2, 0x00000001, 0x00000000, 0x02000068, 0x00000001, 0x0100085d, + 0x0100285c, 0x04000067, 0x001020f2, 0x00000000, 0x00000001, 0x0200005e, 0x00000004, 0x0f000032, + 0x00100032, 0x00000000, 0x80201ff6, 0x00000041, 0x00000000, 0x00000000, 0x00004002, 0x3dcccccd, + 0x3dcccccd, 0x00000000, 0x00000000, 0x00201046, 0x00000000, 0x00000000, 0x05000036, 0x00102032, + 0x00000000, 0x00100046, 0x00000000, 0x06000036, 0x001020c2, 0x00000000, 0x00201ea6, 0x00000000, + 0x00000000, 0x01000013, 0x05000036, 0x00102012, 0x00000000, 0x0010000a, 0x00000000, 0x0e000032, + 0x00100052, 0x00000000, 0x00201ff6, 0x00000000, 0x00000000, 0x00004002, 0x3dcccccd, 0x00000000, + 0x3dcccccd, 0x00000000, 0x00201106, 0x00000000, 0x00000000, 0x05000036, 0x00102022, 0x00000000, + 0x0010002a, 0x00000000, 0x06000036, 0x001020c2, 0x00000000, 0x00201ea6, 0x00000000, 0x00000000, + 0x01000013, 0x05000036, 0x00102012, 0x00000000, 0x0010000a, 0x00000000, 0x05000036, 0x00102022, + 0x00000000, 0x0010001a, 0x00000000, 0x06000036, 0x001020c2, 0x00000000, 0x00201ea6, 0x00000000, + 0x00000000, 0x01000013, 0x05000036, 0x00102032, 0x00000000, 0x00100086, 0x00000000, 0x06000036, + 0x001020c2, 0x00000000, 0x00201ea6, 0x00000000, 0x00000000, 0x01000013, 0x0100003e, + }; + + ULONG refcount, expected_refcount; + ID3D11Device *device, *tmp; + ID3D11GeometryShader *gs; + ID3D11VertexShader *vs; + ID3D11PixelShader *ps; + IUnknown *iface; + unsigned int i; + HRESULT hr; + + for (i = 0; i < sizeof(d3d11_feature_levels) / sizeof(*d3d11_feature_levels); ++i) + { + D3D_FEATURE_LEVEL feature_level = d3d11_feature_levels[i]; + if (!(device = create_device(&feature_level))) + { + skip("Failed to create device for feature level %#x.\n", feature_level); + continue; + } + + /* vertex shader */ + hr = ID3D11Device_CreateVertexShader(device, vs_2_0, sizeof(vs_2_0), NULL, &vs); + ok(hr == E_INVALIDARG, "Created a SM2 vertex shader, hr %#x, feature level %#x.\n", hr, feature_level); + + hr = ID3D11Device_CreateVertexShader(device, vs_3_0, sizeof(vs_3_0), NULL, &vs); + ok(hr == E_INVALIDARG, "Created a SM3 vertex shader, hr %#x, feature level %#x.\n", hr, feature_level); + + hr = ID3D11Device_CreateVertexShader(device, ps_4_0, sizeof(ps_4_0), NULL, &vs); + ok(hr == E_INVALIDARG, "Created a SM4 vertex shader from a pixel shader source, hr %#x, feature level %#x.\n", + hr, feature_level); + + if (feature_level < D3D_FEATURE_LEVEL_10_0) + { + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + continue; + } + + expected_refcount = get_refcount((IUnknown *)device) + 1; + hr = ID3D11Device_CreateVertexShader(device, vs_4_0, sizeof(vs_4_0), NULL, &vs); + ok(SUCCEEDED(hr), "Failed to create SM4 vertex shader, hr %#x, feature level %#x.\n", hr, feature_level); + + refcount = get_refcount((IUnknown *)device); + ok(refcount >= expected_refcount, "Got unexpected refcount %u, expected >= %u.\n", + refcount, expected_refcount); + tmp = NULL; + expected_refcount = refcount + 1; + ID3D11VertexShader_GetDevice(vs, &tmp); + ok(tmp == device, "Got unexpected device %p, expected %p.\n", tmp, device); + refcount = get_refcount((IUnknown *)device); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", + refcount, expected_refcount); + ID3D11Device_Release(tmp); + + hr = ID3D11VertexShader_QueryInterface(vs, &IID_ID3D10VertexShader, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Vertex shader should implement ID3D10VertexShader.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + + refcount = ID3D11VertexShader_Release(vs); + ok(!refcount, "Vertex shader has %u references left.\n", refcount); + + /* pixel shader */ + expected_refcount = get_refcount((IUnknown *)device) + 1; + hr = ID3D11Device_CreatePixelShader(device, ps_4_0, sizeof(ps_4_0), NULL, &ps); + ok(SUCCEEDED(hr), "Failed to create SM4 vertex shader, hr %#x, feature level %#x.\n", hr, feature_level); + + refcount = get_refcount((IUnknown *)device); + ok(refcount >= expected_refcount, "Got unexpected refcount %u, expected >= %u.\n", + refcount, expected_refcount); + tmp = NULL; + expected_refcount = refcount + 1; + ID3D11PixelShader_GetDevice(ps, &tmp); + ok(tmp == device, "Got unexpected device %p, expected %p.\n", tmp, device); + refcount = get_refcount((IUnknown *)device); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", + refcount, expected_refcount); + ID3D11Device_Release(tmp); + + hr = ID3D11PixelShader_QueryInterface(ps, &IID_ID3D10PixelShader, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Pixel shader should implement ID3D10PixelShader.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + + refcount = ID3D11PixelShader_Release(ps); + ok(!refcount, "Pixel shader has %u references left.\n", refcount); + + /* geometry shader */ + expected_refcount = get_refcount((IUnknown *)device) + 1; + hr = ID3D11Device_CreateGeometryShader(device, gs_4_0, sizeof(gs_4_0), NULL, &gs); + ok(SUCCEEDED(hr), "Failed to create SM4 geometry shader, hr %#x.\n", hr); + + refcount = get_refcount((IUnknown *)device); + ok(refcount >= expected_refcount, "Got unexpected refcount %u, expected >= %u.\n", + refcount, expected_refcount); + tmp = NULL; + expected_refcount = refcount + 1; + ID3D11GeometryShader_GetDevice(gs, &tmp); + ok(tmp == device, "Got unexpected device %p, expected %p.\n", tmp, device); + refcount = get_refcount((IUnknown *)device); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", + refcount, expected_refcount); + ID3D11Device_Release(tmp); + + hr = ID3D11GeometryShader_QueryInterface(gs, &IID_ID3D10GeometryShader, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Geometry shader should implement ID3D10GeometryShader.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + + refcount = ID3D11GeometryShader_Release(gs); + ok(!refcount, "Geometry shader has %u references left.\n", refcount); + + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + } +} + +static void test_create_sampler_state(void) +{ + static const struct test + { + D3D11_FILTER filter; + D3D10_FILTER expected_filter; + } + desc_conversion_tests[] = + { + {D3D11_FILTER_MIN_MAG_MIP_POINT, D3D10_FILTER_MIN_MAG_MIP_POINT}, + {D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR, D3D10_FILTER_MIN_MAG_POINT_MIP_LINEAR}, + {D3D11_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT, D3D10_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT}, + {D3D11_FILTER_MIN_POINT_MAG_MIP_LINEAR, D3D10_FILTER_MIN_POINT_MAG_MIP_LINEAR}, + {D3D11_FILTER_MIN_LINEAR_MAG_MIP_POINT, D3D10_FILTER_MIN_LINEAR_MAG_MIP_POINT}, + {D3D11_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR, D3D10_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR}, + {D3D11_FILTER_MIN_MAG_LINEAR_MIP_POINT, D3D10_FILTER_MIN_MAG_LINEAR_MIP_POINT}, + {D3D11_FILTER_MIN_MAG_MIP_LINEAR, D3D10_FILTER_MIN_MAG_MIP_LINEAR}, + {D3D11_FILTER_ANISOTROPIC, D3D10_FILTER_ANISOTROPIC}, + {D3D11_FILTER_COMPARISON_MIN_MAG_MIP_POINT, D3D10_FILTER_COMPARISON_MIN_MAG_MIP_POINT}, + {D3D11_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR, D3D10_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR}, + { + D3D11_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT, + D3D10_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT + }, + {D3D11_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR, D3D10_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR}, + {D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT, D3D10_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT}, + { + D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR, + D3D10_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR + }, + {D3D11_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT, D3D10_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT}, + {D3D11_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR, D3D10_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR}, + {D3D11_FILTER_COMPARISON_ANISOTROPIC, D3D10_FILTER_COMPARISON_ANISOTROPIC}, + }; + + ID3D11SamplerState *sampler_state1, *sampler_state2; + ID3D10SamplerState *d3d10_sampler_state; + ULONG refcount, expected_refcount; + ID3D11Device *device, *tmp; + D3D11_SAMPLER_DESC desc; + unsigned int i; + HRESULT hr; + + if (!(device = create_device(NULL))) + { + skip("Failed to create device.\n"); + return; + } + + hr = ID3D11Device_CreateSamplerState(device, NULL, &sampler_state1); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + desc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR; + desc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP; + desc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP; + desc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP; + desc.MipLODBias = 0.0f; + desc.MaxAnisotropy = 16; + desc.ComparisonFunc = D3D11_COMPARISON_ALWAYS; + desc.BorderColor[0] = 0.0f; + desc.BorderColor[1] = 1.0f; + desc.BorderColor[2] = 0.0f; + desc.BorderColor[3] = 1.0f; + desc.MinLOD = 0.0f; + desc.MaxLOD = 16.0f; + + expected_refcount = get_refcount((IUnknown *)device) + 1; + hr = ID3D11Device_CreateSamplerState(device, &desc, &sampler_state1); + ok(SUCCEEDED(hr), "Failed to create sampler state, hr %#x.\n", hr); + hr = ID3D11Device_CreateSamplerState(device, &desc, &sampler_state2); + ok(SUCCEEDED(hr), "Failed to create sampler state, hr %#x.\n", hr); + ok(sampler_state1 == sampler_state2, "Got different sampler state objects.\n"); + refcount = get_refcount((IUnknown *)device); + ok(refcount >= expected_refcount, "Got unexpected refcount %u, expected >= %u.\n", refcount, expected_refcount); + tmp = NULL; + expected_refcount = refcount + 1; + ID3D11SamplerState_GetDevice(sampler_state1, &tmp); + ok(tmp == device, "Got unexpected device %p, expected %p.\n", tmp, device); + refcount = get_refcount((IUnknown *)device); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + ID3D11Device_Release(tmp); + + ID3D11SamplerState_GetDesc(sampler_state1, &desc); + ok(desc.Filter == D3D11_FILTER_MIN_MAG_MIP_LINEAR, "Got unexpected filter %#x.\n", desc.Filter); + ok(desc.AddressU == D3D11_TEXTURE_ADDRESS_WRAP, "Got unexpected address u %u.\n", desc.AddressU); + ok(desc.AddressV == D3D11_TEXTURE_ADDRESS_WRAP, "Got unexpected address v %u.\n", desc.AddressV); + ok(desc.AddressW == D3D11_TEXTURE_ADDRESS_WRAP, "Got unexpected address w %u.\n", desc.AddressW); + ok(!desc.MipLODBias, "Got unexpected mip LOD bias %f.\n", desc.MipLODBias); + ok(!desc.MaxAnisotropy, "Got unexpected max anisotropy %u.\n", desc.MaxAnisotropy); + ok(desc.ComparisonFunc == D3D11_COMPARISON_NEVER, "Got unexpected comparison func %u.\n", desc.ComparisonFunc); + ok(!desc.BorderColor[0] && !desc.BorderColor[1] && !desc.BorderColor[2] && !desc.BorderColor[3], + "Got unexpected border color {%.8e, %.8e, %.8e, %.8e}.\n", + desc.BorderColor[0], desc.BorderColor[1], desc.BorderColor[2], desc.BorderColor[3]); + ok(!desc.MinLOD, "Got unexpected min LOD %f.\n", desc.MinLOD); + ok(desc.MaxLOD == 16.0f, "Got unexpected max LOD %f.\n", desc.MaxLOD); + + refcount = ID3D11SamplerState_Release(sampler_state2); + ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + refcount = ID3D11SamplerState_Release(sampler_state1); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + + for (i = 0; i < sizeof(desc_conversion_tests) / sizeof(*desc_conversion_tests); ++i) + { + const struct test *current = &desc_conversion_tests[i]; + D3D10_SAMPLER_DESC d3d10_desc, expected_desc; + + desc.Filter = current->filter; + desc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP; + desc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP; + desc.AddressW = D3D11_TEXTURE_ADDRESS_BORDER; + desc.MipLODBias = 0.0f; + desc.MaxAnisotropy = 16; + desc.ComparisonFunc = D3D11_COMPARISON_ALWAYS; + desc.BorderColor[0] = 0.0f; + desc.BorderColor[1] = 1.0f; + desc.BorderColor[2] = 0.0f; + desc.BorderColor[3] = 1.0f; + desc.MinLOD = 0.0f; + desc.MaxLOD = 16.0f; + + hr = ID3D11Device_CreateSamplerState(device, &desc, &sampler_state1); + ok(SUCCEEDED(hr), "Test %u: Failed to create sampler state, hr %#x.\n", i, hr); + + hr = ID3D11SamplerState_QueryInterface(sampler_state1, &IID_ID3D10SamplerState, + (void **)&d3d10_sampler_state); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Test %u: Sampler state should implement ID3D10SamplerState.\n", i); + if (FAILED(hr)) + { + win_skip("Sampler state does not implement ID3D10SamplerState.\n"); + ID3D11SamplerState_Release(sampler_state1); + break; + } + + memcpy(&expected_desc, &desc, sizeof(expected_desc)); + expected_desc.Filter = current->expected_filter; + if (!D3D11_DECODE_IS_ANISOTROPIC_FILTER(current->filter)) + expected_desc.MaxAnisotropy = 0; + if (!D3D11_DECODE_IS_COMPARISON_FILTER(current->filter)) + expected_desc.ComparisonFunc = D3D10_COMPARISON_NEVER; + + ID3D10SamplerState_GetDesc(d3d10_sampler_state, &d3d10_desc); + ok(d3d10_desc.Filter == expected_desc.Filter, + "Test %u: Got unexpected filter %#x.\n", i, d3d10_desc.Filter); + ok(d3d10_desc.AddressU == expected_desc.AddressU, + "Test %u: Got unexpected adress u %u.\n", i, d3d10_desc.AddressU); + ok(d3d10_desc.AddressV == expected_desc.AddressV, + "Test %u: Got unexpected address v %u.\n", i, d3d10_desc.AddressV); + ok(d3d10_desc.AddressW == expected_desc.AddressW, + "Test %u: Got unexpected address w %u.\n", i, d3d10_desc.AddressW); + ok(d3d10_desc.MipLODBias == expected_desc.MipLODBias, + "Test %u: Got unexpected mip LOD bias %f.\n", i, d3d10_desc.MipLODBias); + ok(d3d10_desc.MaxAnisotropy == expected_desc.MaxAnisotropy, + "Test %u: Got unexpected max anisotropy %u.\n", i, d3d10_desc.MaxAnisotropy); + ok(d3d10_desc.ComparisonFunc == expected_desc.ComparisonFunc, + "Test %u: Got unexpected comparison func %u.\n", i, d3d10_desc.ComparisonFunc); + ok(d3d10_desc.BorderColor[0] == expected_desc.BorderColor[0] + && d3d10_desc.BorderColor[1] == expected_desc.BorderColor[1] + && d3d10_desc.BorderColor[2] == expected_desc.BorderColor[2] + && d3d10_desc.BorderColor[3] == expected_desc.BorderColor[3], + "Test %u: Got unexpected border color {%.8e, %.8e, %.8e, %.8e}.\n", i, + d3d10_desc.BorderColor[0], d3d10_desc.BorderColor[1], + d3d10_desc.BorderColor[2], d3d10_desc.BorderColor[3]); + ok(d3d10_desc.MinLOD == expected_desc.MinLOD, + "Test %u: Got unexpected min LOD %f.\n", i, d3d10_desc.MinLOD); + ok(d3d10_desc.MaxLOD == expected_desc.MaxLOD, + "Test %u: Got unexpected max LOD %f.\n", i, d3d10_desc.MaxLOD); + + refcount = ID3D10SamplerState_Release(d3d10_sampler_state); + ok(refcount == 1, "Test %u: Got unexpected refcount %u.\n", i, refcount); + refcount = ID3D11SamplerState_Release(sampler_state1); + ok(!refcount, "Test %u: Got unexpected refcount %u.\n", i, refcount); + } + + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + +static void test_create_blend_state(void) +{ + static const D3D11_BLEND_DESC desc_conversion_tests[] = + { + { + FALSE, FALSE, + { + { + FALSE, D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, + D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD + }, + }, + }, + { + FALSE, TRUE, + { + { + TRUE, D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, + D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, D3D11_COLOR_WRITE_ENABLE_ALL + }, + { + FALSE, D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, + D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, D3D11_COLOR_WRITE_ENABLE_RED + }, + { + TRUE, D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, + D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, D3D11_COLOR_WRITE_ENABLE_ALL + }, + { + FALSE, D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, + D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, D3D11_COLOR_WRITE_ENABLE_GREEN + }, + { + TRUE, D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, + D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, D3D11_COLOR_WRITE_ENABLE_ALL + }, + { + TRUE, D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, + D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, D3D11_COLOR_WRITE_ENABLE_ALL + }, + { + TRUE, D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, + D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, D3D11_COLOR_WRITE_ENABLE_ALL + }, + { + TRUE, D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, + D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, D3D11_COLOR_WRITE_ENABLE_ALL + }, + }, + }, + { + FALSE, TRUE, + { + { + TRUE, D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, + D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, D3D11_COLOR_WRITE_ENABLE_ALL + }, + { + TRUE, D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_SUBTRACT, + D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, D3D11_COLOR_WRITE_ENABLE_ALL + }, + { + TRUE, D3D11_BLEND_ZERO, D3D11_BLEND_ONE, D3D11_BLEND_OP_ADD, + D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, D3D11_COLOR_WRITE_ENABLE_ALL + }, + { + TRUE, D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, + D3D11_BLEND_ZERO, D3D11_BLEND_ONE, D3D11_BLEND_OP_ADD, D3D11_COLOR_WRITE_ENABLE_ALL + }, + { + TRUE, D3D11_BLEND_ONE, D3D11_BLEND_ONE, D3D11_BLEND_OP_MAX, + D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, D3D11_COLOR_WRITE_ENABLE_ALL + }, + { + TRUE, D3D11_BLEND_ONE, D3D11_BLEND_ONE, D3D11_BLEND_OP_MIN, + D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, D3D11_COLOR_WRITE_ENABLE_ALL + }, + { + FALSE, D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, + D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, D3D11_COLOR_WRITE_ENABLE_ALL + }, + { + FALSE, D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, + D3D11_BLEND_ONE, D3D11_BLEND_ZERO, D3D11_BLEND_OP_ADD, D3D11_COLOR_WRITE_ENABLE_ALL + }, + }, + }, + }; + + ID3D11BlendState *blend_state1, *blend_state2; + D3D11_BLEND_DESC desc, obtained_desc; + ID3D10BlendState *d3d10_blend_state; + D3D10_BLEND_DESC d3d10_blend_desc; + ULONG refcount, expected_refcount; + ID3D11Device *device, *tmp; + unsigned int i, j; + IUnknown *iface; + HRESULT hr; + + if (!(device = create_device(NULL))) + { + skip("Failed to create device.\n"); + return; + } + + hr = ID3D11Device_CreateBlendState(device, NULL, &blend_state1); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + memset(&desc, 0, sizeof(desc)); + desc.AlphaToCoverageEnable = FALSE; + desc.IndependentBlendEnable = FALSE; + desc.RenderTarget[0].BlendEnable = FALSE; + desc.RenderTarget[0].SrcBlend = D3D11_BLEND_ONE; + desc.RenderTarget[0].DestBlend = D3D11_BLEND_ZERO; + desc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD; + desc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE; + desc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ZERO; + desc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD; + desc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL; + + expected_refcount = get_refcount((IUnknown *)device) + 1; + hr = ID3D11Device_CreateBlendState(device, &desc, &blend_state1); + ok(SUCCEEDED(hr), "Failed to create blend state, hr %#x.\n", hr); + hr = ID3D11Device_CreateBlendState(device, &desc, &blend_state2); + ok(SUCCEEDED(hr), "Failed to create blend state, hr %#x.\n", hr); + ok(blend_state1 == blend_state2, "Got different blend state objects.\n"); + refcount = get_refcount((IUnknown *)device); + ok(refcount >= expected_refcount, "Got unexpected refcount %u, expected >= %u.\n", refcount, expected_refcount); + tmp = NULL; + expected_refcount = refcount + 1; + ID3D11BlendState_GetDevice(blend_state1, &tmp); + ok(tmp == device, "Got unexpected device %p, expected %p.\n", tmp, device); + refcount = get_refcount((IUnknown *)device); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + ID3D11Device_Release(tmp); + + ID3D11BlendState_GetDesc(blend_state1, &obtained_desc); + ok(obtained_desc.AlphaToCoverageEnable == FALSE, "Got unexpected alpha to coverage enable %#x.\n", + obtained_desc.AlphaToCoverageEnable); + ok(obtained_desc.IndependentBlendEnable == FALSE, "Got unexpected independent blend enable %#x.\n", + obtained_desc.IndependentBlendEnable); + for (i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i) + { + ok(obtained_desc.RenderTarget[i].BlendEnable == FALSE, + "Got unexpected blend enable %#x for render target %u.\n", + obtained_desc.RenderTarget[i].BlendEnable, i); + ok(obtained_desc.RenderTarget[i].SrcBlend == D3D11_BLEND_ONE, + "Got unexpected src blend %u for render target %u.\n", + obtained_desc.RenderTarget[i].SrcBlend, i); + ok(obtained_desc.RenderTarget[i].DestBlend == D3D11_BLEND_ZERO, + "Got unexpected dest blend %u for render target %u.\n", + obtained_desc.RenderTarget[i].DestBlend, i); + ok(obtained_desc.RenderTarget[i].BlendOp == D3D11_BLEND_OP_ADD, + "Got unexpected blend op %u for render target %u.\n", + obtained_desc.RenderTarget[i].BlendOp, i); + ok(obtained_desc.RenderTarget[i].SrcBlendAlpha == D3D11_BLEND_ONE, + "Got unexpected src blend alpha %u for render target %u.\n", + obtained_desc.RenderTarget[i].SrcBlendAlpha, i); + ok(obtained_desc.RenderTarget[i].DestBlendAlpha == D3D11_BLEND_ZERO, + "Got unexpected dest blend alpha %u for render target %u.\n", + obtained_desc.RenderTarget[i].DestBlendAlpha, i); + ok(obtained_desc.RenderTarget[i].BlendOpAlpha == D3D11_BLEND_OP_ADD, + "Got unexpected blend op alpha %u for render target %u.\n", + obtained_desc.RenderTarget[i].BlendOpAlpha, i); + ok(obtained_desc.RenderTarget[i].RenderTargetWriteMask == D3D11_COLOR_WRITE_ENABLE_ALL, + "Got unexpected render target write mask %#x for render target %u.\n", + obtained_desc.RenderTarget[0].RenderTargetWriteMask, i); + } + + hr = ID3D11BlendState_QueryInterface(blend_state1, &IID_ID3D10BlendState, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Blend state should implement ID3D10BlendState.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + hr = ID3D11BlendState_QueryInterface(blend_state1, &IID_ID3D10BlendState1, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Blend state should implement ID3D10BlendState1.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + + refcount = ID3D11BlendState_Release(blend_state1); + ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + refcount = ID3D11BlendState_Release(blend_state2); + ok(!refcount, "Blend state has %u references left.\n", refcount); + + for (i = 0; i < sizeof(desc_conversion_tests) / sizeof(*desc_conversion_tests); ++i) + { + const D3D11_BLEND_DESC *current_desc = &desc_conversion_tests[i]; + + hr = ID3D11Device_CreateBlendState(device, current_desc, &blend_state1); + ok(SUCCEEDED(hr), "Failed to create blend state, hr %#x.\n", hr); + + hr = ID3D11BlendState_QueryInterface(blend_state1, &IID_ID3D10BlendState, (void **)&d3d10_blend_state); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Blend state should implement ID3D10BlendState.\n"); + if (FAILED(hr)) + { + win_skip("Blend state does not implement ID3D10BlendState.\n"); + ID3D11BlendState_Release(blend_state1); + break; + } + + ID3D10BlendState_GetDesc(d3d10_blend_state, &d3d10_blend_desc); + ok(d3d10_blend_desc.AlphaToCoverageEnable == current_desc->AlphaToCoverageEnable, + "Got unexpected alpha to coverage enable %#x for test %u.\n", + d3d10_blend_desc.AlphaToCoverageEnable, i); + ok(d3d10_blend_desc.SrcBlend == (D3D10_BLEND)current_desc->RenderTarget[0].SrcBlend, + "Got unexpected src blend %u for test %u.\n", d3d10_blend_desc.SrcBlend, i); + ok(d3d10_blend_desc.DestBlend == (D3D10_BLEND)current_desc->RenderTarget[0].DestBlend, + "Got unexpected dest blend %u for test %u.\n", d3d10_blend_desc.DestBlend, i); + ok(d3d10_blend_desc.BlendOp == (D3D10_BLEND_OP)current_desc->RenderTarget[0].BlendOp, + "Got unexpected blend op %u for test %u.\n", d3d10_blend_desc.BlendOp, i); + ok(d3d10_blend_desc.SrcBlendAlpha == (D3D10_BLEND)current_desc->RenderTarget[0].SrcBlendAlpha, + "Got unexpected src blend alpha %u for test %u.\n", d3d10_blend_desc.SrcBlendAlpha, i); + ok(d3d10_blend_desc.DestBlendAlpha == (D3D10_BLEND)current_desc->RenderTarget[0].DestBlendAlpha, + "Got unexpected dest blend alpha %u for test %u.\n", d3d10_blend_desc.DestBlendAlpha, i); + ok(d3d10_blend_desc.BlendOpAlpha == (D3D10_BLEND_OP)current_desc->RenderTarget[0].BlendOpAlpha, + "Got unexpected blend op alpha %u for test %u.\n", d3d10_blend_desc.BlendOpAlpha, i); + for (j = 0; j < D3D10_SIMULTANEOUS_RENDER_TARGET_COUNT; j++) + { + unsigned int k = current_desc->IndependentBlendEnable ? j : 0; + ok(d3d10_blend_desc.BlendEnable[j] == current_desc->RenderTarget[k].BlendEnable, + "Got unexpected blend enable %#x for test %u, render target %u.\n", + d3d10_blend_desc.BlendEnable[j], i, j); + ok(d3d10_blend_desc.RenderTargetWriteMask[j] == current_desc->RenderTarget[k].RenderTargetWriteMask, + "Got unexpected render target write mask %#x for test %u, render target %u.\n", + d3d10_blend_desc.RenderTargetWriteMask[j], i, j); + } + + ID3D10BlendState_Release(d3d10_blend_state); + + refcount = ID3D11BlendState_Release(blend_state1); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + } + + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + +static void test_create_depthstencil_state(void) +{ + ID3D11DepthStencilState *ds_state1, *ds_state2; + ID3D10DepthStencilState *d3d10_ds_state; + ULONG refcount, expected_refcount; + D3D11_DEPTH_STENCIL_DESC ds_desc; + ID3D11Device *device, *tmp; + HRESULT hr; + + if (!(device = create_device(NULL))) + { + skip("Failed to create device.\n"); + return; + } + + hr = ID3D11Device_CreateDepthStencilState(device, NULL, &ds_state1); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + ds_desc.DepthEnable = TRUE; + ds_desc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL; + ds_desc.DepthFunc = D3D11_COMPARISON_LESS; + ds_desc.StencilEnable = FALSE; + ds_desc.StencilReadMask = D3D11_DEFAULT_STENCIL_READ_MASK; + ds_desc.StencilWriteMask = D3D11_DEFAULT_STENCIL_WRITE_MASK; + ds_desc.FrontFace.StencilFailOp = D3D11_STENCIL_OP_KEEP; + ds_desc.FrontFace.StencilDepthFailOp = D3D11_STENCIL_OP_KEEP; + ds_desc.FrontFace.StencilPassOp = D3D11_STENCIL_OP_KEEP; + ds_desc.FrontFace.StencilFunc = D3D11_COMPARISON_ALWAYS; + ds_desc.BackFace.StencilFailOp = D3D11_STENCIL_OP_KEEP; + ds_desc.BackFace.StencilDepthFailOp = D3D11_STENCIL_OP_KEEP; + ds_desc.BackFace.StencilPassOp = D3D11_STENCIL_OP_KEEP; + ds_desc.BackFace.StencilFunc = D3D11_COMPARISON_ALWAYS; + + expected_refcount = get_refcount((IUnknown *)device) + 1; + hr = ID3D11Device_CreateDepthStencilState(device, &ds_desc, &ds_state1); + ok(SUCCEEDED(hr), "Failed to create depthstencil state, hr %#x.\n", hr); + hr = ID3D11Device_CreateDepthStencilState(device, &ds_desc, &ds_state2); + ok(SUCCEEDED(hr), "Failed to create depthstencil state, hr %#x.\n", hr); + ok(ds_state1 == ds_state2, "Got different depthstencil state objects.\n"); + refcount = get_refcount((IUnknown *)device); + ok(refcount >= expected_refcount, "Got unexpected refcount %u, expected >= %u.\n", refcount, expected_refcount); + tmp = NULL; + expected_refcount = refcount + 1; + ID3D11DepthStencilState_GetDevice(ds_state1, &tmp); + ok(tmp == device, "Got unexpected device %p, expected %p.\n", tmp, device); + refcount = get_refcount((IUnknown *)device); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + ID3D11Device_Release(tmp); + + hr = ID3D11DepthStencilState_QueryInterface(ds_state1, &IID_ID3D10DepthStencilState, (void **)&d3d10_ds_state); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Depth stencil state should implement ID3D10DepthStencilState.\n"); + if (SUCCEEDED(hr)) ID3D10DepthStencilState_Release(d3d10_ds_state); + + refcount = ID3D11DepthStencilState_Release(ds_state2); + ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + refcount = ID3D11DepthStencilState_Release(ds_state1); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + +static void test_create_rasterizer_state(void) +{ + ID3D11RasterizerState *rast_state1, *rast_state2; + ID3D10RasterizerState *d3d10_rast_state; + ULONG refcount, expected_refcount; + D3D10_RASTERIZER_DESC d3d10_desc; + D3D11_RASTERIZER_DESC desc; + ID3D11Device *device, *tmp; + HRESULT hr; + + if (!(device = create_device(NULL))) + { + skip("Failed to create device.\n"); + return; + } + + hr = ID3D11Device_CreateRasterizerState(device, NULL, &rast_state1); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + desc.FillMode = D3D11_FILL_SOLID; + desc.CullMode = D3D11_CULL_BACK; + desc.FrontCounterClockwise = FALSE; + desc.DepthBias = 0; + desc.DepthBiasClamp = 0.0f; + desc.SlopeScaledDepthBias = 0.0f; + desc.DepthClipEnable = TRUE; + desc.ScissorEnable = FALSE; + desc.MultisampleEnable = FALSE; + desc.AntialiasedLineEnable = FALSE; + + expected_refcount = get_refcount((IUnknown *)device) + 1; + hr = ID3D11Device_CreateRasterizerState(device, &desc, &rast_state1); + ok(SUCCEEDED(hr), "Failed to create rasterizer state, hr %#x.\n", hr); + hr = ID3D11Device_CreateRasterizerState(device, &desc, &rast_state2); + ok(SUCCEEDED(hr), "Failed to create rasterizer state, hr %#x.\n", hr); + ok(rast_state1 == rast_state2, "Got different rasterizer state objects.\n"); + refcount = get_refcount((IUnknown *)device); + ok(refcount >= expected_refcount, "Got unexpected refcount %u, expected >= %u.\n", refcount, expected_refcount); + tmp = NULL; + expected_refcount = refcount + 1; + ID3D11RasterizerState_GetDevice(rast_state1, &tmp); + ok(tmp == device, "Got unexpected device %p, expected %p.\n", tmp, device); + refcount = get_refcount((IUnknown *)device); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + ID3D11Device_Release(tmp); + + hr = ID3D11RasterizerState_QueryInterface(rast_state1, &IID_ID3D10RasterizerState, (void **)&d3d10_rast_state); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Rasterizer state should implement ID3D10RasterizerState.\n"); + if (SUCCEEDED(hr)) + { + ID3D10RasterizerState_GetDesc(d3d10_rast_state, &d3d10_desc); + ok(d3d10_desc.FillMode == D3D10_FILL_SOLID, "Got unexpected fill mode %u.\n", d3d10_desc.FillMode); + ok(d3d10_desc.CullMode == D3D10_CULL_BACK, "Got unexpected cull mode %u.\n", d3d10_desc.CullMode); + ok(!d3d10_desc.FrontCounterClockwise, "Got unexpected front counter clockwise %#x.\n", + d3d10_desc.FrontCounterClockwise); + ok(!d3d10_desc.DepthBias, "Got unexpected depth bias %d.\n", d3d10_desc.DepthBias); + ok(!d3d10_desc.DepthBiasClamp, "Got unexpected depth bias clamp %f.\n", d3d10_desc.DepthBiasClamp); + ok(!d3d10_desc.SlopeScaledDepthBias, "Got unexpected slope scaled depth bias %f.\n", + d3d10_desc.SlopeScaledDepthBias); + ok(!!d3d10_desc.DepthClipEnable, "Got unexpected depth clip enable %#x.\n", d3d10_desc.DepthClipEnable); + ok(!d3d10_desc.ScissorEnable, "Got unexpected scissor enable %#x.\n", d3d10_desc.ScissorEnable); + ok(!d3d10_desc.MultisampleEnable, "Got unexpected multisample enable %#x.\n", + d3d10_desc.MultisampleEnable); + ok(!d3d10_desc.AntialiasedLineEnable, "Got unexpected antialiased line enable %#x.\n", + d3d10_desc.AntialiasedLineEnable); + + refcount = ID3D10RasterizerState_Release(d3d10_rast_state); + ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); + } + + refcount = ID3D11RasterizerState_Release(rast_state2); + ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + refcount = ID3D11RasterizerState_Release(rast_state1); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + +static void test_create_predicate(void) +{ + static const D3D11_QUERY other_queries[] = + { + D3D11_QUERY_EVENT, + D3D11_QUERY_OCCLUSION, + D3D11_QUERY_TIMESTAMP, + D3D11_QUERY_TIMESTAMP_DISJOINT, + D3D11_QUERY_PIPELINE_STATISTICS, + D3D11_QUERY_SO_STATISTICS, + D3D11_QUERY_SO_STATISTICS_STREAM0, + D3D11_QUERY_SO_STATISTICS_STREAM1, + D3D11_QUERY_SO_STATISTICS_STREAM2, + D3D11_QUERY_SO_STATISTICS_STREAM3, + }; + + ULONG refcount, expected_refcount; + D3D11_QUERY_DESC query_desc; + ID3D11Predicate *predicate; + ID3D11Device *device, *tmp; + IUnknown *iface; + unsigned int i; + HRESULT hr; + + if (!(device = create_device(NULL))) + { + skip("Failed to create device.\n"); + return; + } + + hr = ID3D11Device_CreatePredicate(device, NULL, &predicate); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + query_desc.MiscFlags = 0; + + for (i = 0; i < sizeof(other_queries) / sizeof(*other_queries); ++i) + { + query_desc.Query = other_queries[i]; + hr = ID3D11Device_CreatePredicate(device, &query_desc, &predicate); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x for query type %u.\n", hr, other_queries[i]); + } + + query_desc.Query = D3D11_QUERY_OCCLUSION_PREDICATE; + expected_refcount = get_refcount((IUnknown *)device) + 1; + hr = ID3D11Device_CreatePredicate(device, &query_desc, &predicate); + ok(SUCCEEDED(hr), "Failed to create predicate, hr %#x.\n", hr); + refcount = get_refcount((IUnknown *)device); + ok(refcount >= expected_refcount, "Got unexpected refcount %u, expected >= %u.\n", refcount, expected_refcount); + tmp = NULL; + expected_refcount = refcount + 1; + ID3D11Predicate_GetDevice(predicate, &tmp); + ok(tmp == device, "Got unexpected device %p, expected %p.\n", tmp, device); + refcount = get_refcount((IUnknown *)device); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + ID3D11Device_Release(tmp); + hr = ID3D11Predicate_QueryInterface(predicate, &IID_ID3D10Predicate, (void **)&iface); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Predicate should implement ID3D10Predicate.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(iface); + ID3D11Predicate_Release(predicate); + + query_desc.Query = D3D11_QUERY_SO_OVERFLOW_PREDICATE; + hr = ID3D11Device_CreatePredicate(device, &query_desc, &predicate); + todo_wine ok(SUCCEEDED(hr), "Failed to create predicate, hr %#x.\n", hr); + if (SUCCEEDED(hr)) + ID3D11Predicate_Release(predicate); + + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + +static void test_device_removed_reason(void) +{ + ID3D11Device *device; + ULONG refcount; + HRESULT hr; + + if (!(device = create_device(NULL))) + { + skip("Failed to create device.\n"); + return; + } + + hr = ID3D11Device_GetDeviceRemovedReason(device); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = ID3D11Device_GetDeviceRemovedReason(device); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + +static void test_private_data(void) +{ + ULONG refcount, expected_refcount; + D3D11_TEXTURE2D_DESC texture_desc; + ID3D10Texture2D *d3d10_texture; + ID3D11Device *test_object; + ID3D11Texture2D *texture; + IDXGIDevice *dxgi_device; + IDXGISurface *surface; + ID3D11Device *device; + IUnknown *ptr; + HRESULT hr; + UINT size; + + static const GUID test_guid = + {0xfdb37466, 0x428f, 0x4edf, {0xa3, 0x7f, 0x9b, 0x1d, 0xf4, 0x88, 0xc5, 0xfc}}; + static const GUID test_guid2 = + {0x2e5afac2, 0x87b5, 0x4c10, {0x9b, 0x4b, 0x89, 0xd7, 0xd1, 0x12, 0xe7, 0x2b}}; + static const DWORD data[] = {1, 2, 3, 4}; + + if (!(device = create_device(NULL))) + { + skip("Failed to create device.\n"); + return; + } + + test_object = create_device(NULL); + + texture_desc.Width = 512; + texture_desc.Height = 512; + 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 texture, hr %#x.\n", hr); + hr = ID3D11Texture2D_QueryInterface(texture, &IID_IDXGISurface, (void **)&surface); + ok(SUCCEEDED(hr), "Failed to get IDXGISurface, hr %#x.\n", hr); + + hr = ID3D11Device_SetPrivateData(device, &test_guid, 0, NULL); + ok(hr == S_FALSE, "Got unexpected hr %#x.\n", hr); + hr = ID3D11Device_SetPrivateDataInterface(device, &test_guid, NULL); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = ID3D11Device_SetPrivateData(device, &test_guid, ~0u, NULL); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = ID3D11Device_SetPrivateData(device, &test_guid, ~0u, NULL); + ok(hr == S_FALSE, "Got unexpected hr %#x.\n", hr); + + hr = ID3D11Device_SetPrivateDataInterface(device, &test_guid, NULL); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + size = sizeof(ptr) * 2; + ptr = (IUnknown *)0xdeadbeef; + hr = ID3D11Device_GetPrivateData(device, &test_guid, &size, &ptr); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(!ptr, "Got unexpected pointer %p.\n", ptr); + ok(size == sizeof(IUnknown *), "Got unexpected size %u.\n", size); + + hr = ID3D11Device_QueryInterface(device, &IID_IDXGIDevice, (void **)&dxgi_device); + ok(SUCCEEDED(hr), "Failed to get DXGI device, hr %#x.\n", hr); + size = sizeof(ptr) * 2; + ptr = (IUnknown *)0xdeadbeef; + hr = IDXGIDevice_GetPrivateData(dxgi_device, &test_guid, &size, &ptr); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(!ptr, "Got unexpected pointer %p.\n", ptr); + ok(size == sizeof(IUnknown *), "Got unexpected size %u.\n", size); + IDXGIDevice_Release(dxgi_device); + + refcount = get_refcount((IUnknown *)test_object); + hr = ID3D11Device_SetPrivateDataInterface(device, &test_guid, (IUnknown *)test_object); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + expected_refcount = refcount + 1; + refcount = get_refcount((IUnknown *)test_object); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + hr = ID3D11Device_SetPrivateDataInterface(device, &test_guid, (IUnknown *)test_object); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + refcount = get_refcount((IUnknown *)test_object); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + + hr = ID3D11Device_SetPrivateDataInterface(device, &test_guid, NULL); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + --expected_refcount; + refcount = get_refcount((IUnknown *)test_object); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + + hr = ID3D11Device_SetPrivateDataInterface(device, &test_guid, (IUnknown *)test_object); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + size = sizeof(data); + hr = ID3D11Device_SetPrivateData(device, &test_guid, size, data); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + refcount = get_refcount((IUnknown *)test_object); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + hr = ID3D11Device_SetPrivateData(device, &test_guid, 42, NULL); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = ID3D11Device_SetPrivateData(device, &test_guid, 42, NULL); + ok(hr == S_FALSE, "Got unexpected hr %#x.\n", hr); + + hr = ID3D11Device_SetPrivateDataInterface(device, &test_guid, (IUnknown *)test_object); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ++expected_refcount; + size = 2 * sizeof(ptr); + ptr = NULL; + hr = ID3D11Device_GetPrivateData(device, &test_guid, &size, &ptr); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(size == sizeof(test_object), "Got unexpected size %u.\n", size); + ++expected_refcount; + refcount = get_refcount((IUnknown *)test_object); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + IUnknown_Release(ptr); + --expected_refcount; + + ptr = (IUnknown *)0xdeadbeef; + size = 1; + hr = ID3D11Device_GetPrivateData(device, &test_guid, &size, NULL); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(size == sizeof(device), "Got unexpected size %u.\n", size); + size = 2 * sizeof(ptr); + hr = ID3D11Device_GetPrivateData(device, &test_guid, &size, NULL); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(size == sizeof(device), "Got unexpected size %u.\n", size); + refcount = get_refcount((IUnknown *)test_object); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + + size = 1; + hr = ID3D11Device_GetPrivateData(device, &test_guid, &size, &ptr); + ok(hr == DXGI_ERROR_MORE_DATA, "Got unexpected hr %#x.\n", hr); + ok(size == sizeof(device), "Got unexpected size %u.\n", size); + ok(ptr == (IUnknown *)0xdeadbeef, "Got unexpected pointer %p.\n", ptr); + hr = ID3D11Device_GetPrivateData(device, &test_guid2, NULL, NULL); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + size = 0xdeadbabe; + hr = ID3D11Device_GetPrivateData(device, &test_guid2, &size, &ptr); + ok(hr == DXGI_ERROR_NOT_FOUND, "Got unexpected hr %#x.\n", hr); + ok(size == 0, "Got unexpected size %u.\n", size); + ok(ptr == (IUnknown *)0xdeadbeef, "Got unexpected pointer %p.\n", ptr); + hr = ID3D11Device_GetPrivateData(device, &test_guid, NULL, &ptr); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(ptr == (IUnknown *)0xdeadbeef, "Got unexpected pointer %p.\n", ptr); + + hr = ID3D11Texture2D_SetPrivateDataInterface(texture, &test_guid, (IUnknown *)test_object); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ptr = NULL; + size = sizeof(ptr); + hr = IDXGISurface_GetPrivateData(surface, &test_guid, &size, &ptr); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(ptr == (IUnknown *)test_object, "Got unexpected ptr %p, expected %p.\n", ptr, test_object); + IUnknown_Release(ptr); + + hr = ID3D11Texture2D_QueryInterface(texture, &IID_ID3D10Texture2D, (void **)&d3d10_texture); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Texture should implement ID3D10Texture2D.\n"); + if (SUCCEEDED(hr)) + { + ptr = NULL; + size = sizeof(ptr); + hr = ID3D10Texture2D_GetPrivateData(d3d10_texture, &test_guid, &size, &ptr); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(ptr == (IUnknown *)test_object, "Got unexpected ptr %p, expected %p.\n", ptr, test_object); + IUnknown_Release(ptr); + ID3D10Texture2D_Release(d3d10_texture); + } + + IDXGISurface_Release(surface); + ID3D11Texture2D_Release(texture); + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + refcount = ID3D11Device_Release(test_object); + ok(!refcount, "Test object has %u references left.\n", refcount); +} + +static void test_blend(void) +{ + ID3D11RenderTargetView *backbuffer_rtv, *offscreen_rtv; + ID3D11BlendState *src_blend, *dst_blend; + ID3D11Texture2D *backbuffer, *offscreen; + D3D11_SUBRESOURCE_DATA buffer_data; + D3D11_TEXTURE2D_DESC texture_desc; + ID3D11InputLayout *input_layout; + D3D11_BUFFER_DESC buffer_desc; + ID3D11DeviceContext *context; + D3D11_BLEND_DESC blend_desc; + unsigned int stride, offset; + IDXGISwapChain *swapchain; + ID3D11VertexShader *vs; + ID3D11PixelShader *ps; + ID3D11Device *device; + D3D11_VIEWPORT vp; + ID3D11Buffer *vb; + ULONG refcount; + DWORD color; + HWND window; + HRESULT hr; + + static const DWORD vs_code[] = + { +#if 0 + struct vs_out + { + float4 position : SV_POSITION; + float4 color : COLOR; + }; + + struct vs_out main(float4 position : POSITION, float4 color : COLOR) + { + struct vs_out o; + + o.position = position; + o.color = color; + + return o; + } +#endif + 0x43425844, 0x5c73b061, 0x5c71125f, 0x3f8b345f, 0xce04b9ab, 0x00000001, 0x00000140, 0x00000003, + 0x0000002c, 0x0000007c, 0x000000d0, 0x4e475349, 0x00000048, 0x00000002, 0x00000008, 0x00000038, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x00000041, 0x00000000, 0x00000000, + 0x00000003, 0x00000001, 0x00000f0f, 0x49534f50, 0x4e4f4954, 0x4c4f4300, 0xab00524f, 0x4e47534f, + 0x0000004c, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000, + 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000000f, 0x505f5653, + 0x5449534f, 0x004e4f49, 0x4f4c4f43, 0xabab0052, 0x52444853, 0x00000068, 0x00010040, 0x0000001a, + 0x0300005f, 0x001010f2, 0x00000000, 0x0300005f, 0x001010f2, 0x00000001, 0x04000067, 0x001020f2, + 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000001, 0x05000036, 0x001020f2, 0x00000000, + 0x00101e46, 0x00000000, 0x05000036, 0x001020f2, 0x00000001, 0x00101e46, 0x00000001, 0x0100003e, + }; + static const DWORD ps_code[] = + { +#if 0 + struct vs_out + { + float4 position : SV_POSITION; + float4 color : COLOR; + }; + + float4 main(struct vs_out i) : SV_TARGET + { + return i.color; + } +#endif + 0x43425844, 0xe2087fa6, 0xa35fbd95, 0x8e585b3f, 0x67890f54, 0x00000001, 0x000000f4, 0x00000003, + 0x0000002c, 0x00000080, 0x000000b4, 0x4e475349, 0x0000004c, 0x00000002, 0x00000008, 0x00000038, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, 0x00000000, + 0x00000003, 0x00000001, 0x00000f0f, 0x505f5653, 0x5449534f, 0x004e4f49, 0x4f4c4f43, 0xabab0052, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x545f5653, 0x45475241, 0xabab0054, 0x52444853, 0x00000038, 0x00000040, + 0x0000000e, 0x03001062, 0x001010f2, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x05000036, + 0x001020f2, 0x00000000, 0x00101e46, 0x00000001, 0x0100003e, + }; + static const struct + { + struct vec3 position; + DWORD diffuse; + } + quads[] = + { + /* quad1 */ + {{-1.0f, -1.0f, 0.1f}, 0x4000ff00}, + {{-1.0f, 0.0f, 0.1f}, 0x4000ff00}, + {{ 1.0f, -1.0f, 0.1f}, 0x4000ff00}, + {{ 1.0f, 0.0f, 0.1f}, 0x4000ff00}, + /* quad2 */ + {{-1.0f, 0.0f, 0.1f}, 0xc0ff0000}, + {{-1.0f, 1.0f, 0.1f}, 0xc0ff0000}, + {{ 1.0f, 0.0f, 0.1f}, 0xc0ff0000}, + {{ 1.0f, 1.0f, 0.1f}, 0xc0ff0000}, + }; + static const D3D11_INPUT_ELEMENT_DESC layout_desc[] = + { + {"POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0}, + {"COLOR", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0}, + }; + static const float blend_factor[] = {1.0f, 1.0f, 1.0f, 1.0f}; + static const float red[] = {1.0f, 0.0f, 0.0f, 0.5f}; + + if (!(device = create_device(NULL))) + { + skip("Failed to create device.\n"); + return; + } + window = CreateWindowA("static", "d3d11_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + swapchain = create_swapchain(device, window, TRUE); + hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_ID3D11Texture2D, (void **)&backbuffer); + ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr); + + hr = ID3D11Device_CreateInputLayout(device, layout_desc, sizeof(layout_desc) / sizeof(*layout_desc), + vs_code, sizeof(vs_code), &input_layout); + ok(SUCCEEDED(hr), "Failed to create input layout, hr %#x.\n", hr); + + buffer_desc.ByteWidth = sizeof(quads); + buffer_desc.Usage = D3D11_USAGE_DEFAULT; + buffer_desc.BindFlags = D3D11_BIND_VERTEX_BUFFER; + buffer_desc.CPUAccessFlags = 0; + buffer_desc.MiscFlags = 0; + buffer_desc.StructureByteStride = 0; + + buffer_data.pSysMem = quads; + buffer_data.SysMemPitch = 0; + buffer_data.SysMemSlicePitch = 0; + + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &buffer_data, &vb); + ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr); + hr = ID3D11Device_CreateVertexShader(device, vs_code, sizeof(vs_code), NULL, &vs); + ok(SUCCEEDED(hr), "Failed to create vertex shader, hr %#x.\n", hr); + hr = ID3D11Device_CreatePixelShader(device, ps_code, sizeof(ps_code), NULL, &ps); + ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x.\n", hr); + + hr = ID3D11Device_CreateRenderTargetView(device, (ID3D11Resource *)backbuffer, NULL, &backbuffer_rtv); + ok(SUCCEEDED(hr), "Failed to create rendertarget view, hr %#x.\n", hr); + + memset(&blend_desc, 0, sizeof(blend_desc)); + blend_desc.RenderTarget[0].BlendEnable = TRUE; + blend_desc.RenderTarget[0].SrcBlend = D3D11_BLEND_SRC_ALPHA; + blend_desc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA; + blend_desc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD; + blend_desc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_SRC_ALPHA; + blend_desc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_INV_SRC_ALPHA; + blend_desc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD; + blend_desc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL; + + hr = ID3D11Device_CreateBlendState(device, &blend_desc, &src_blend); + ok(SUCCEEDED(hr), "Failed to create blend state, hr %#x.\n", hr); + + blend_desc.RenderTarget[0].SrcBlend = D3D11_BLEND_DEST_ALPHA; + blend_desc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_DEST_ALPHA; + blend_desc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_DEST_ALPHA; + blend_desc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_INV_DEST_ALPHA; + + hr = ID3D11Device_CreateBlendState(device, &blend_desc, &dst_blend); + ok(SUCCEEDED(hr), "Failed to create blend state, hr %#x.\n", hr); + + ID3D11Device_GetImmediateContext(device, &context); + + ID3D11DeviceContext_OMSetRenderTargets(context, 1, &backbuffer_rtv, NULL); + ID3D11DeviceContext_IASetInputLayout(context, input_layout); + ID3D11DeviceContext_IASetPrimitiveTopology(context, D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); + stride = sizeof(*quads); + offset = 0; + ID3D11DeviceContext_IASetVertexBuffers(context, 0, 1, &vb, &stride, &offset); + ID3D11DeviceContext_VSSetShader(context, vs, NULL, 0); + ID3D11DeviceContext_PSSetShader(context, ps, NULL, 0); + + vp.TopLeftX = 0.0f; + vp.TopLeftY = 0.0f; + vp.Width = 640.0f; + vp.Height = 480.0f; + vp.MinDepth = 0.0f; + vp.MaxDepth = 1.0f; + ID3D11DeviceContext_RSSetViewports(context, 1, &vp); + + ID3D11DeviceContext_ClearRenderTargetView(context, backbuffer_rtv, red); + + ID3D11DeviceContext_OMSetBlendState(context, src_blend, blend_factor, D3D11_DEFAULT_SAMPLE_MASK); + ID3D11DeviceContext_Draw(context, 4, 0); + ID3D11DeviceContext_OMSetBlendState(context, dst_blend, blend_factor, D3D11_DEFAULT_SAMPLE_MASK); + ID3D11DeviceContext_Draw(context, 4, 4); + + color = get_texture_color(backbuffer, 320, 360); + ok(compare_color(color, 0x700040bf, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(backbuffer, 320, 120); + ok(compare_color(color, 0xa080007f, 1), "Got unexpected color 0x%08x.\n", color); + + texture_desc.Width = 128; + texture_desc.Height = 128; + texture_desc.MipLevels = 1; + texture_desc.ArraySize = 1; + texture_desc.Format = DXGI_FORMAT_B8G8R8X8_UNORM; + texture_desc.SampleDesc.Count = 1; + texture_desc.SampleDesc.Quality = 0; + texture_desc.Usage = D3D11_USAGE_DEFAULT; + texture_desc.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET; + texture_desc.CPUAccessFlags = 0; + texture_desc.MiscFlags = 0; + + /* DXGI_FORMAT_B8G8R8X8_UNORM is not supported on all implementations. */ + if (FAILED(ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, &offscreen))) + { + skip("DXGI_FORMAT_B8G8R8X8_UNORM not supported.\n"); + goto done; + } + + hr = ID3D11Device_CreateRenderTargetView(device, (ID3D11Resource *)offscreen, NULL, &offscreen_rtv); + ok(SUCCEEDED(hr), "Failed to create rendertarget view, hr %#x.\n", hr); + + ID3D11DeviceContext_OMSetRenderTargets(context, 1, &offscreen_rtv, NULL); + + vp.TopLeftX = 0.0f; + vp.TopLeftY = 0.0f; + vp.Width = 128.0f; + vp.Height = 128.0f; + vp.MinDepth = 0.0f; + vp.MaxDepth = 1.0f; + ID3D11DeviceContext_RSSetViewports(context, 1, &vp); + + ID3D11DeviceContext_ClearRenderTargetView(context, offscreen_rtv, red); + + ID3D11DeviceContext_OMSetBlendState(context, src_blend, blend_factor, D3D11_DEFAULT_SAMPLE_MASK); + ID3D11DeviceContext_Draw(context, 4, 0); + ID3D11DeviceContext_OMSetBlendState(context, dst_blend, blend_factor, D3D11_DEFAULT_SAMPLE_MASK); + ID3D11DeviceContext_Draw(context, 4, 4); + + color = get_texture_color(offscreen, 64, 96) & 0x00ffffff; + ok(compare_color(color, 0x00bf4000, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(offscreen, 64, 32) & 0x00ffffff; + ok(compare_color(color, 0x000000ff, 1), "Got unexpected color 0x%08x.\n", color); + + ID3D11RenderTargetView_Release(offscreen_rtv); + ID3D11Texture2D_Release(offscreen); +done: + ID3D11BlendState_Release(dst_blend); + ID3D11BlendState_Release(src_blend); + ID3D11PixelShader_Release(ps); + ID3D11VertexShader_Release(vs); + ID3D11Buffer_Release(vb); + ID3D11InputLayout_Release(input_layout); + ID3D11RenderTargetView_Release(backbuffer_rtv); + ID3D11Texture2D_Release(backbuffer); + IDXGISwapChain_Release(swapchain); + ID3D11DeviceContext_Release(context); + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + DestroyWindow(window); +} + +static void test_texture(void) +{ + ID3D11RenderTargetView *backbuffer_rtv; + D3D11_SUBRESOURCE_DATA resource_data; + D3D11_TEXTURE2D_DESC texture_desc; + ID3D11SamplerState *sampler_state; + ID3D11ShaderResourceView *ps_srv; + D3D11_SAMPLER_DESC sampler_desc; + ID3D11InputLayout *input_layout; + D3D11_BUFFER_DESC buffer_desc; + ID3D11DeviceContext *context; + ID3D11Texture2D *backbuffer; + unsigned int stride, offset; + struct texture_readback rb; + IDXGISwapChain *swapchain; + ID3D11Texture2D *texture; + ID3D11VertexShader *vs; + ID3D11PixelShader *ps; + ID3D11Device *device; + D3D11_VIEWPORT vp; + unsigned int i, j; + ID3D11Buffer *vb; + ULONG refcount; + DWORD color; + HWND window; + HRESULT hr; + + static const D3D11_INPUT_ELEMENT_DESC layout_desc[] = + { + {"POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0}, + }; + static const DWORD vs_code[] = + { +#if 0 + float4 main(float4 position : POSITION) : SV_POSITION + { + return position; + } +#endif + 0x43425844, 0xa7a2f22d, 0x83ff2560, 0xe61638bd, 0x87e3ce90, 0x00000001, 0x000000d8, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x49534f50, 0x4e4f4954, 0xababab00, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000001, 0x00000003, + 0x00000000, 0x0000000f, 0x505f5653, 0x5449534f, 0x004e4f49, 0x52444853, 0x0000003c, 0x00010040, + 0x0000000f, 0x0300005f, 0x001010f2, 0x00000000, 0x04000067, 0x001020f2, 0x00000000, 0x00000001, + 0x05000036, 0x001020f2, 0x00000000, 0x00101e46, 0x00000000, 0x0100003e, + }; + static const DWORD ps_code[] = + { +#if 0 + Texture2D t; + SamplerState s; + + float4 main(float4 position : SV_POSITION) : SV_Target + { + float2 p; + + p.x = position.x / 640.0f; + p.y = position.y / 480.0f; + return t.Sample(s, p); + } +#endif + 0x43425844, 0x1ce9b612, 0xc8176faa, 0xd37844af, 0xdb515605, 0x00000001, 0x00000134, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000030f, 0x505f5653, 0x5449534f, 0x004e4f49, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000098, 0x00000040, + 0x00000026, 0x0300005a, 0x00106000, 0x00000000, 0x04001858, 0x00107000, 0x00000000, 0x00005555, + 0x04002064, 0x00101032, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, + 0x00000001, 0x0a000038, 0x00100032, 0x00000000, 0x00101046, 0x00000000, 0x00004002, 0x3acccccd, + 0x3b088889, 0x00000000, 0x00000000, 0x09000045, 0x001020f2, 0x00000000, 0x00100046, 0x00000000, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0100003e, + }; + static const struct + { + float x, y; + } + quad[] = + { + {-1.0f, -1.0f}, + {-1.0f, 1.0f}, + { 1.0f, -1.0f}, + { 1.0f, 1.0f}, + }; + static const float red[] = {1.0f, 0.0f, 0.0f, 0.5f}; + static const DWORD bitmap_data[] = + { + 0xff0000ff, 0xff00ffff, 0xff00ff00, 0xffffff00, + 0xffff0000, 0xffff00ff, 0xff000000, 0xff7f7f7f, + 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + }; + + if (!(device = create_device(NULL))) + { + skip("Failed to create device.\n"); + return; + } + window = CreateWindowA("static", "d3d11_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + swapchain = create_swapchain(device, window, TRUE); + hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_ID3D11Texture2D, (void **)&backbuffer); + ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr); + + hr = ID3D11Device_CreateInputLayout(device, layout_desc, sizeof(layout_desc) / sizeof(*layout_desc), + vs_code, sizeof(vs_code), &input_layout); + ok(SUCCEEDED(hr), "Failed to create input layout, hr %#x.\n", hr); + + buffer_desc.ByteWidth = sizeof(quad); + buffer_desc.Usage = D3D11_USAGE_DEFAULT; + buffer_desc.BindFlags = D3D11_BIND_VERTEX_BUFFER; + buffer_desc.CPUAccessFlags = 0; + buffer_desc.MiscFlags = 0; + buffer_desc.StructureByteStride = 0; + + resource_data.pSysMem = quad; + resource_data.SysMemPitch = 0; + resource_data.SysMemSlicePitch = 0; + + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &resource_data, &vb); + ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr); + + texture_desc.Width = 4; + texture_desc.Height = 4; + 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_SHADER_RESOURCE; + texture_desc.CPUAccessFlags = 0; + texture_desc.MiscFlags = 0; + + resource_data.pSysMem = bitmap_data; + resource_data.SysMemPitch = 4 * sizeof(*bitmap_data); + + hr = ID3D11Device_CreateTexture2D(device, &texture_desc, &resource_data, &texture); + ok(SUCCEEDED(hr), "Failed to create 2d texture, hr %#x.\n", hr); + + hr = ID3D11Device_CreateShaderResourceView(device, (ID3D11Resource *)texture, NULL, &ps_srv); + ok(SUCCEEDED(hr), "Failed to create shader resource view, hr %#x.\n", hr); + + sampler_desc.Filter = D3D11_FILTER_MIN_MAG_MIP_POINT; + sampler_desc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP; + sampler_desc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP; + sampler_desc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP; + sampler_desc.MipLODBias = 0.0f; + sampler_desc.MaxAnisotropy = 0; + sampler_desc.ComparisonFunc = D3D11_COMPARISON_NEVER; + sampler_desc.BorderColor[0] = 0.0f; + sampler_desc.BorderColor[1] = 0.0f; + sampler_desc.BorderColor[2] = 0.0f; + sampler_desc.BorderColor[3] = 0.0f; + sampler_desc.MinLOD = 0.0f; + sampler_desc.MaxLOD = 0.0f; + + hr = ID3D11Device_CreateSamplerState(device, &sampler_desc, &sampler_state); + ok(SUCCEEDED(hr), "Failed to create sampler state, hr %#x.\n", hr); + + hr = ID3D11Device_CreateVertexShader(device, vs_code, sizeof(vs_code), NULL, &vs); + ok(SUCCEEDED(hr), "Failed to create vertex shader, hr %#x.\n", hr); + hr = ID3D11Device_CreatePixelShader(device, ps_code, sizeof(ps_code), NULL, &ps); + ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x.\n", hr); + + hr = ID3D11Device_CreateRenderTargetView(device, (ID3D11Resource *)backbuffer, NULL, &backbuffer_rtv); + ok(SUCCEEDED(hr), "Failed to create rendertarget view, hr %#x.\n", hr); + + ID3D11Device_GetImmediateContext(device, &context); + + ID3D11DeviceContext_OMSetRenderTargets(context, 1, &backbuffer_rtv, NULL); + ID3D11DeviceContext_IASetInputLayout(context, input_layout); + ID3D11DeviceContext_IASetPrimitiveTopology(context, D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); + stride = sizeof(*quad); + offset = 0; + ID3D11DeviceContext_IASetVertexBuffers(context, 0, 1, &vb, &stride, &offset); + ID3D11DeviceContext_VSSetShader(context, vs, NULL, 0); + ID3D11DeviceContext_PSSetShaderResources(context, 0, 1, &ps_srv); + ID3D11DeviceContext_PSSetSamplers(context, 0, 1, &sampler_state); + ID3D11DeviceContext_PSSetShader(context, ps, NULL, 0); + + vp.TopLeftX = 0.0f; + vp.TopLeftY = 0.0f; + vp.Width = 640.0f; + vp.Height = 480.0f; + vp.MinDepth = 0.0f; + vp.MaxDepth = 1.0f; + ID3D11DeviceContext_RSSetViewports(context, 1, &vp); + + ID3D11DeviceContext_ClearRenderTargetView(context, backbuffer_rtv, red); + + ID3D11DeviceContext_Draw(context, 4, 0); + + get_texture_readback(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); + + ID3D11PixelShader_Release(ps); + ID3D11VertexShader_Release(vs); + ID3D11SamplerState_Release(sampler_state); + ID3D11ShaderResourceView_Release(ps_srv); + ID3D11Texture2D_Release(texture); + ID3D11Buffer_Release(vb); + ID3D11InputLayout_Release(input_layout); + ID3D11RenderTargetView_Release(backbuffer_rtv); + ID3D11Texture2D_Release(backbuffer); + IDXGISwapChain_Release(swapchain); + ID3D11DeviceContext_Release(context); + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + DestroyWindow(window); +} + +static void test_scissor(void) +{ + ID3D11DeviceContext *immediate_context; + D3D11_SUBRESOURCE_DATA buffer_data; + ID3D11InputLayout *input_layout; + D3D11_RASTERIZER_DESC rs_desc; + D3D11_BUFFER_DESC buffer_desc; + ID3D11RenderTargetView *rtv; + ID3D11Texture2D *backbuffer; + unsigned int stride, offset; + ID3D11RasterizerState *rs; + IDXGISwapChain *swapchain; + D3D11_RECT scissor_rect; + ID3D11VertexShader *vs; + ID3D11PixelShader *ps; + ID3D11Device *device; + D3D11_VIEWPORT vp; + ID3D11Buffer *vb; + ULONG refcount; + DWORD color; + HWND window; + HRESULT hr; + + static const float red[] = {1.0f, 0.0f, 0.0f, 1.0f}; + static const D3D11_INPUT_ELEMENT_DESC layout_desc[] = + { + {"POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0}, + }; + static const DWORD vs_code[] = + { +#if 0 + float4 main(float4 position : POSITION) : SV_POSITION + { + return position; + } +#endif + 0x43425844, 0x1fa8c27f, 0x52d2f21d, 0xc196fdb7, 0x376f283a, 0x00000001, 0x000001b4, 0x00000005, + 0x00000034, 0x0000008c, 0x000000c0, 0x000000f4, 0x00000138, 0x46454452, 0x00000050, 0x00000000, + 0x00000000, 0x00000000, 0x0000001c, 0xfffe0400, 0x00000100, 0x0000001c, 0x7263694d, 0x666f736f, + 0x52282074, 0x4c482029, 0x53204c53, 0x65646168, 0x6f432072, 0x6c69706d, 0x39207265, 0x2e30332e, + 0x30303239, 0x3336312e, 0xab003438, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x49534f50, 0x4e4f4954, 0xababab00, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000001, 0x00000003, + 0x00000000, 0x0000000f, 0x505f5653, 0x5449534f, 0x004e4f49, 0x52444853, 0x0000003c, 0x00010040, + 0x0000000f, 0x0300005f, 0x001010f2, 0x00000000, 0x04000067, 0x001020f2, 0x00000000, 0x00000001, + 0x05000036, 0x001020f2, 0x00000000, 0x00101e46, 0x00000000, 0x0100003e, 0x54415453, 0x00000074, + 0x00000002, 0x00000000, 0x00000000, 0x00000002, 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, + }; + static const DWORD ps_code[] = + { +#if 0 + float4 main(float4 position : SV_POSITION) : SV_Target + { + 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, + 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, + }; + static const struct + { + float x, y; + } + quad[] = + { + {-1.0f, -1.0f}, + {-1.0f, 1.0f}, + { 1.0f, -1.0f}, + { 1.0f, 1.0f}, + }; + + if (!(device = create_device(NULL))) + { + skip("Failed to create device.\n"); + return; + } + window = CreateWindowA("static", "d3d11_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + swapchain = create_swapchain(device, window, TRUE); + hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_ID3D11Texture2D, (void **)&backbuffer); + ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr); + + hr = ID3D11Device_CreateInputLayout(device, layout_desc, sizeof(layout_desc) / sizeof(*layout_desc), + vs_code, sizeof(vs_code), &input_layout); + ok(SUCCEEDED(hr), "Failed to create input layout, hr %#x.\n", hr); + + buffer_desc.ByteWidth = sizeof(quad); + buffer_desc.Usage = D3D11_USAGE_DEFAULT; + buffer_desc.BindFlags = D3D11_BIND_VERTEX_BUFFER; + buffer_desc.CPUAccessFlags = 0; + buffer_desc.MiscFlags = 0; + buffer_desc.StructureByteStride = 0; + + buffer_data.pSysMem = quad; + buffer_data.SysMemPitch = 0; + buffer_data.SysMemSlicePitch = 0; + + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &buffer_data, &vb); + ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr); + hr = ID3D11Device_CreateVertexShader(device, vs_code, sizeof(vs_code), NULL, &vs); + ok(SUCCEEDED(hr), "Failed to create vertex shader, hr %#x.\n", hr); + hr = ID3D11Device_CreatePixelShader(device, ps_code, sizeof(ps_code), NULL, &ps); + ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x.\n", hr); + + rs_desc.FillMode = D3D11_FILL_SOLID; + rs_desc.CullMode = D3D11_CULL_BACK; + rs_desc.FrontCounterClockwise = FALSE; + rs_desc.DepthBias = 0; + rs_desc.DepthBiasClamp = 0.0f; + rs_desc.SlopeScaledDepthBias = 0.0f; + rs_desc.DepthClipEnable = TRUE; + rs_desc.ScissorEnable = TRUE; + rs_desc.MultisampleEnable = FALSE; + rs_desc.AntialiasedLineEnable = FALSE; + hr = ID3D11Device_CreateRasterizerState(device, &rs_desc, &rs); + ok(SUCCEEDED(hr), "Failed to create rasterizer state, hr %#x.\n", hr); + + hr = ID3D11Device_CreateRenderTargetView(device, (ID3D11Resource *)backbuffer, NULL, &rtv); + ok(SUCCEEDED(hr), "Failed to create rendertarget view, hr %#x.\n", hr); + + ID3D11Device_GetImmediateContext(device, &immediate_context); + + ID3D11DeviceContext_IASetInputLayout(immediate_context, input_layout); + ID3D11DeviceContext_IASetPrimitiveTopology(immediate_context, D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); + stride = sizeof(*quad); + offset = 0; + ID3D11DeviceContext_IASetVertexBuffers(immediate_context, 0, 1, &vb, &stride, &offset); + ID3D11DeviceContext_VSSetShader(immediate_context, vs, NULL, 0); + ID3D11DeviceContext_PSSetShader(immediate_context, ps, NULL, 0); + + vp.TopLeftX = 0.0f; + vp.TopLeftY = 0.0f; + vp.Width = 640.0f; + vp.Height = 480.0f; + vp.MinDepth = 0.0f; + vp.MaxDepth = 1.0f; + ID3D11DeviceContext_RSSetViewports(immediate_context, 1, &vp); + + scissor_rect.left = 160; + scissor_rect.top = 120; + scissor_rect.right = 480; + scissor_rect.bottom = 360; + ID3D11DeviceContext_RSSetScissorRects(immediate_context, 1, &scissor_rect); + + ID3D11DeviceContext_OMSetRenderTargets(immediate_context, 1, &rtv, NULL); + + ID3D11DeviceContext_ClearRenderTargetView(immediate_context, rtv, red); + color = get_texture_color(backbuffer, 320, 240); + ok(compare_color(color, 0xff0000ff, 1), "Got unexpected color 0x%08x.\n", color); + + ID3D11DeviceContext_Draw(immediate_context, 4, 0); + color = get_texture_color(backbuffer, 320, 60); + ok(compare_color(color, 0xff00ff00, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(backbuffer, 80, 240); + ok(compare_color(color, 0xff00ff00, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(backbuffer, 320, 240); + ok(compare_color(color, 0xff00ff00, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(backbuffer, 560, 240); + ok(compare_color(color, 0xff00ff00, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(backbuffer, 320, 420); + ok(compare_color(color, 0xff00ff00, 1), "Got unexpected color 0x%08x.\n", color); + + ID3D11DeviceContext_ClearRenderTargetView(immediate_context, rtv, red); + ID3D11DeviceContext_RSSetState(immediate_context, rs); + ID3D11DeviceContext_Draw(immediate_context, 4, 0); + color = get_texture_color(backbuffer, 320, 60); + ok(compare_color(color, 0xff0000ff, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(backbuffer, 80, 240); + ok(compare_color(color, 0xff0000ff, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(backbuffer, 320, 240); + ok(compare_color(color, 0xff00ff00, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(backbuffer, 560, 240); + ok(compare_color(color, 0xff0000ff, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(backbuffer, 320, 420); + ok(compare_color(color, 0xff0000ff, 1), "Got unexpected color 0x%08x.\n", color); + + ID3D11RenderTargetView_Release(rtv); + ID3D11RasterizerState_Release(rs); + ID3D11PixelShader_Release(ps); + ID3D11VertexShader_Release(vs); + ID3D11Buffer_Release(vb); + ID3D11InputLayout_Release(input_layout); + ID3D11Texture2D_Release(backbuffer); + IDXGISwapChain_Release(swapchain); + ID3D11DeviceContext_Release(immediate_context); + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + DestroyWindow(window); +} + +static void test_il_append_aligned(void) +{ + ID3D11RenderTargetView *backbuffer_rtv; + D3D11_SUBRESOURCE_DATA resource_data; + ID3D11InputLayout *input_layout; + D3D11_BUFFER_DESC buffer_desc; + ID3D11DeviceContext *context; + ID3D11Texture2D *backbuffer; + unsigned int stride, offset; + IDXGISwapChain *swapchain; + ID3D11VertexShader *vs; + ID3D11PixelShader *ps; + ID3D11Device *device; + ID3D11Buffer *vb[3]; + D3D11_VIEWPORT vp; + ULONG refcount; + DWORD color; + HWND window; + HRESULT hr; + + static const D3D11_INPUT_ELEMENT_DESC layout_desc[] = + { + {"COLOR", 2, DXGI_FORMAT_R32G32_FLOAT, 1, D3D11_APPEND_ALIGNED_ELEMENT, + D3D11_INPUT_PER_INSTANCE_DATA, 2}, + {"COLOR", 3, DXGI_FORMAT_R32G32_FLOAT, 2, D3D11_APPEND_ALIGNED_ELEMENT, + D3D11_INPUT_PER_INSTANCE_DATA, 1}, + {"POSITION", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, + D3D11_INPUT_PER_VERTEX_DATA, 0}, + {"COLOR", 0, DXGI_FORMAT_R32G32_FLOAT, 2, D3D11_APPEND_ALIGNED_ELEMENT, + D3D11_INPUT_PER_INSTANCE_DATA, 1}, + {"COLOR", 1, DXGI_FORMAT_R32G32_FLOAT, 1, D3D11_APPEND_ALIGNED_ELEMENT, + D3D11_INPUT_PER_INSTANCE_DATA, 2}, + }; + static const DWORD vs_code[] = + { +#if 0 + struct vs_in + { + float4 position : POSITION; + float2 color_xy : COLOR0; + float2 color_zw : COLOR1; + unsigned int instance_id : SV_INSTANCEID; + }; + + struct vs_out + { + float4 position : SV_POSITION; + float2 color_xy : COLOR0; + float2 color_zw : COLOR1; + }; + + struct vs_out main(struct vs_in i) + { + struct vs_out o; + + o.position = i.position; + o.position.x += i.instance_id * 0.5; + o.color_xy = i.color_xy; + o.color_zw = i.color_zw; + + return o; + } +#endif + 0x43425844, 0x52e3bf46, 0x6300403d, 0x624cffe4, 0xa4fc0013, 0x00000001, 0x00000214, 0x00000003, + 0x0000002c, 0x000000bc, 0x00000128, 0x4e475349, 0x00000088, 0x00000004, 0x00000008, 0x00000068, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x00000071, 0x00000000, 0x00000000, + 0x00000003, 0x00000001, 0x00000303, 0x00000071, 0x00000001, 0x00000000, 0x00000003, 0x00000002, + 0x00000303, 0x00000077, 0x00000000, 0x00000008, 0x00000001, 0x00000003, 0x00000101, 0x49534f50, + 0x4e4f4954, 0x4c4f4300, 0x5300524f, 0x4e495f56, 0x4e415453, 0x44494543, 0xababab00, 0x4e47534f, + 0x00000064, 0x00000003, 0x00000008, 0x00000050, 0x00000000, 0x00000001, 0x00000003, 0x00000000, + 0x0000000f, 0x0000005c, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x00000c03, 0x0000005c, + 0x00000001, 0x00000000, 0x00000003, 0x00000001, 0x0000030c, 0x505f5653, 0x5449534f, 0x004e4f49, + 0x4f4c4f43, 0xabab0052, 0x52444853, 0x000000e4, 0x00010040, 0x00000039, 0x0300005f, 0x001010f2, + 0x00000000, 0x0300005f, 0x00101032, 0x00000001, 0x0300005f, 0x00101032, 0x00000002, 0x04000060, + 0x00101012, 0x00000003, 0x00000008, 0x04000067, 0x001020f2, 0x00000000, 0x00000001, 0x03000065, + 0x00102032, 0x00000001, 0x03000065, 0x001020c2, 0x00000001, 0x02000068, 0x00000001, 0x05000056, + 0x00100012, 0x00000000, 0x0010100a, 0x00000003, 0x09000032, 0x00102012, 0x00000000, 0x0010000a, + 0x00000000, 0x00004001, 0x3f000000, 0x0010100a, 0x00000000, 0x05000036, 0x001020e2, 0x00000000, + 0x00101e56, 0x00000000, 0x05000036, 0x00102032, 0x00000001, 0x00101046, 0x00000001, 0x05000036, + 0x001020c2, 0x00000001, 0x00101406, 0x00000002, 0x0100003e, + }; + static const DWORD ps_code[] = + { +#if 0 + struct vs_out + { + float4 position : SV_POSITION; + float2 color_xy : COLOR0; + float2 color_zw : COLOR1; + }; + + float4 main(struct vs_out i) : SV_TARGET + { + return float4(i.color_xy.xy, i.color_zw.xy); + } +#endif + 0x43425844, 0x64e48a09, 0xaa484d46, 0xe40a6e78, 0x9885edf3, 0x00000001, 0x00000118, 0x00000003, + 0x0000002c, 0x00000098, 0x000000cc, 0x4e475349, 0x00000064, 0x00000003, 0x00000008, 0x00000050, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x0000005c, 0x00000000, 0x00000000, + 0x00000003, 0x00000001, 0x00000303, 0x0000005c, 0x00000001, 0x00000000, 0x00000003, 0x00000001, + 0x00000c0c, 0x505f5653, 0x5449534f, 0x004e4f49, 0x4f4c4f43, 0xabab0052, 0x4e47534f, 0x0000002c, + 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, + 0x545f5653, 0x45475241, 0xabab0054, 0x52444853, 0x00000044, 0x00000040, 0x00000011, 0x03001062, + 0x00101032, 0x00000001, 0x03001062, 0x001010c2, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, + 0x05000036, 0x001020f2, 0x00000000, 0x00101e46, 0x00000001, 0x0100003e, + }; + static const struct + { + struct vec4 position; + } + stream0[] = + { + {{-1.0f, -1.0f, 0.0f, 1.0f}}, + {{-1.0f, 1.0f, 0.0f, 1.0f}}, + {{-0.5f, -1.0f, 0.0f, 1.0f}}, + {{-0.5f, 1.0f, 0.0f, 1.0f}}, + }; + static const struct + { + struct vec2 color2; + struct vec2 color1; + } + stream1[] = + { + {{0.5f, 0.5f}, {0.0f, 1.0f}}, + {{0.5f, 0.5f}, {1.0f, 1.0f}}, + }; + static const struct + { + struct vec2 color3; + struct vec2 color0; + } + stream2[] = + { + {{0.5f, 0.5f}, {1.0f, 0.0f}}, + {{0.5f, 0.5f}, {0.0f, 1.0f}}, + {{0.5f, 0.5f}, {0.0f, 0.0f}}, + {{0.5f, 0.5f}, {1.0f, 0.0f}}, + }; + static const float red[] = {1.0f, 0.0f, 0.0f, 0.5f}; + + if (!(device = create_device(NULL))) + { + skip("Failed to create device.\n"); + return; + } + window = CreateWindowA("static", "d3d11_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + swapchain = create_swapchain(device, window, TRUE); + hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_ID3D11Texture2D, (void **)&backbuffer); + ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr); + + hr = ID3D11Device_CreateInputLayout(device, layout_desc, sizeof(layout_desc) / sizeof(*layout_desc), + vs_code, sizeof(vs_code), &input_layout); + ok(SUCCEEDED(hr), "Failed to create input layout, hr %#x.\n", hr); + + buffer_desc.ByteWidth = sizeof(stream0); + buffer_desc.Usage = D3D11_USAGE_DEFAULT; + buffer_desc.BindFlags = D3D11_BIND_VERTEX_BUFFER; + buffer_desc.CPUAccessFlags = 0; + buffer_desc.MiscFlags = 0; + buffer_desc.StructureByteStride = 0; + + resource_data.pSysMem = stream0; + resource_data.SysMemPitch = 0; + resource_data.SysMemSlicePitch = 0; + + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &resource_data, &vb[0]); + ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr); + + buffer_desc.ByteWidth = sizeof(stream1); + resource_data.pSysMem = stream1; + + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &resource_data, &vb[1]); + ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr); + + buffer_desc.ByteWidth = sizeof(stream2); + resource_data.pSysMem = stream2; + + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &resource_data, &vb[2]); + ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr); + + hr = ID3D11Device_CreateVertexShader(device, vs_code, sizeof(vs_code), NULL, &vs); + ok(SUCCEEDED(hr), "Failed to create vertex shader, hr %#x.\n", hr); + hr = ID3D11Device_CreatePixelShader(device, ps_code, sizeof(ps_code), NULL, &ps); + ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x.\n", hr); + + hr = ID3D11Device_CreateRenderTargetView(device, (ID3D11Resource *)backbuffer, NULL, &backbuffer_rtv); + ok(SUCCEEDED(hr), "Failed to create rendertarget view, hr %#x.\n", hr); + + ID3D11Device_GetImmediateContext(device, &context); + + ID3D11DeviceContext_OMSetRenderTargets(context, 1, &backbuffer_rtv, NULL); + ID3D11DeviceContext_IASetInputLayout(context, input_layout); + ID3D11DeviceContext_IASetPrimitiveTopology(context, D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); + offset = 0; + stride = sizeof(*stream0); + ID3D11DeviceContext_IASetVertexBuffers(context, 0, 1, &vb[0], &stride, &offset); + stride = sizeof(*stream1); + ID3D11DeviceContext_IASetVertexBuffers(context, 1, 1, &vb[1], &stride, &offset); + stride = sizeof(*stream2); + ID3D11DeviceContext_IASetVertexBuffers(context, 2, 1, &vb[2], &stride, &offset); + ID3D11DeviceContext_VSSetShader(context, vs, NULL, 0); + ID3D11DeviceContext_PSSetShader(context, ps, NULL, 0); + + vp.TopLeftX = 0.0f; + vp.TopLeftY = 0.0f; + vp.Width = 640.0f; + vp.Height = 480.0f; + vp.MinDepth = 0.0f; + vp.MaxDepth = 1.0f; + ID3D11DeviceContext_RSSetViewports(context, 1, &vp); + + ID3D11DeviceContext_ClearRenderTargetView(context, backbuffer_rtv, red); + + ID3D11DeviceContext_DrawInstanced(context, 4, 4, 0, 0); + + color = get_texture_color(backbuffer, 80, 240); + ok(compare_color(color, 0xff0000ff, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(backbuffer, 240, 240); + ok(compare_color(color, 0xff00ff00, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(backbuffer, 400, 240); + ok(compare_color(color, 0xffff0000, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(backbuffer, 560, 240); + ok(compare_color(color, 0xffff00ff, 1), "Got unexpected color 0x%08x.\n", color); + + ID3D11PixelShader_Release(ps); + ID3D11VertexShader_Release(vs); + ID3D11Buffer_Release(vb[2]); + ID3D11Buffer_Release(vb[1]); + ID3D11Buffer_Release(vb[0]); + ID3D11InputLayout_Release(input_layout); + ID3D11RenderTargetView_Release(backbuffer_rtv); + ID3D11Texture2D_Release(backbuffer); + IDXGISwapChain_Release(swapchain); + ID3D11DeviceContext_Release(context); + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + DestroyWindow(window); +} + +static void test_fragment_coords(void) +{ + ID3D11RenderTargetView *backbuffer_rtv; + D3D11_SUBRESOURCE_DATA resource_data; + ID3D11InputLayout *input_layout; + ID3D11PixelShader *ps, *ps_frac; + D3D11_BUFFER_DESC buffer_desc; + ID3D11DeviceContext *context; + ID3D11Texture2D *backbuffer; + unsigned int stride, offset; + IDXGISwapChain *swapchain; + ID3D11Buffer *vb, *ps_cb; + ID3D11VertexShader *vs; + ID3D11Device *device; + D3D11_VIEWPORT vp; + ULONG refcount; + DWORD color; + HWND window; + HRESULT hr; + + static const D3D11_INPUT_ELEMENT_DESC layout_desc[] = + { + {"POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0}, + }; + static const DWORD vs_code[] = + { +#if 0 + float4 main(float4 position : POSITION) : SV_POSITION + { + return position; + } +#endif + 0x43425844, 0xa7a2f22d, 0x83ff2560, 0xe61638bd, 0x87e3ce90, 0x00000001, 0x000000d8, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x49534f50, 0x4e4f4954, 0xababab00, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000001, 0x00000003, + 0x00000000, 0x0000000f, 0x505f5653, 0x5449534f, 0x004e4f49, 0x52444853, 0x0000003c, 0x00010040, + 0x0000000f, 0x0300005f, 0x001010f2, 0x00000000, 0x04000067, 0x001020f2, 0x00000000, 0x00000001, + 0x05000036, 0x001020f2, 0x00000000, 0x00101e46, 0x00000000, 0x0100003e, + }; + static const DWORD ps_code[] = + { +#if 0 + float2 cutoff; + + float4 main(float4 position : SV_POSITION) : SV_TARGET + { + float4 ret = float4(0.0, 0.0, 0.0, 1.0); + + if (position.x > cutoff.x) + ret.y = 1.0; + if (position.y > cutoff.y) + ret.z = 1.0; + + return ret; + } +#endif + 0x43425844, 0x49fc9e51, 0x8068867d, 0xf20cfa39, 0xb8099e6b, 0x00000001, 0x00000144, 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, 0x000000a8, 0x00000040, + 0x0000002a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x04002064, 0x00101032, 0x00000000, + 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000001, 0x08000031, 0x00100032, + 0x00000000, 0x00208046, 0x00000000, 0x00000000, 0x00101046, 0x00000000, 0x0a000001, 0x00102062, + 0x00000000, 0x00100106, 0x00000000, 0x00004002, 0x00000000, 0x3f800000, 0x3f800000, 0x00000000, + 0x08000036, 0x00102092, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, + 0x0100003e, + }; + static const DWORD ps_frac_code[] = + { +#if 0 + float4 main(float4 position : SV_POSITION) : SV_TARGET + { + return float4(frac(position.xy), 0.0, 1.0); + } +#endif + 0x43425844, 0x86d9d78a, 0x190b72c2, 0x50841fd6, 0xdc24022e, 0x00000001, 0x000000f8, 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, 0x0000005c, 0x00000040, + 0x00000017, 0x04002064, 0x00101032, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, + 0x0500001a, 0x00102032, 0x00000000, 0x00101046, 0x00000000, 0x08000036, 0x001020c2, 0x00000000, + 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, 0x0100003e, + }; + static const struct + { + struct vec2 position; + } + quad[] = + { + {{-1.0f, -1.0f}}, + {{-1.0f, 1.0f}}, + {{ 1.0f, -1.0f}}, + {{ 1.0f, 1.0f}}, + }; + static const float red[] = {1.0f, 0.0f, 0.0f, 0.5f}; + struct vec4 cutoff = {320.0f, 240.0f, 0.0f, 0.0f}; + + if (!(device = create_device(NULL))) + { + skip("Failed to create device.\n"); + return; + } + window = CreateWindowA("static", "d3d11_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + swapchain = create_swapchain(device, window, TRUE); + hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_ID3D11Texture2D, (void **)&backbuffer); + ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr); + + hr = ID3D11Device_CreateInputLayout(device, layout_desc, sizeof(layout_desc) / sizeof(*layout_desc), + vs_code, sizeof(vs_code), &input_layout); + ok(SUCCEEDED(hr), "Failed to create input layout, hr %#x.\n", hr); + + buffer_desc.ByteWidth = sizeof(quad); + buffer_desc.Usage = D3D11_USAGE_DEFAULT; + buffer_desc.BindFlags = D3D11_BIND_VERTEX_BUFFER; + buffer_desc.CPUAccessFlags = 0; + buffer_desc.MiscFlags = 0; + buffer_desc.StructureByteStride = 0; + + resource_data.pSysMem = quad; + resource_data.SysMemPitch = 0; + resource_data.SysMemSlicePitch = 0; + + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &resource_data, &vb); + ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr); + + buffer_desc.ByteWidth = sizeof(cutoff); + buffer_desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; + + resource_data.pSysMem = &cutoff; + + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &resource_data, &ps_cb); + ok(SUCCEEDED(hr), "Failed to create constant buffer, hr %#x.\n", hr); + + hr = ID3D11Device_CreateVertexShader(device, vs_code, sizeof(vs_code), NULL, &vs); + ok(SUCCEEDED(hr), "Failed to create vertex shader, hr %#x.\n", hr); + hr = ID3D11Device_CreatePixelShader(device, ps_code, sizeof(ps_code), NULL, &ps); + ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x.\n", hr); + hr = ID3D11Device_CreatePixelShader(device, ps_frac_code, sizeof(ps_frac_code), NULL, &ps_frac); + ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x.\n", hr); + + hr = ID3D11Device_CreateRenderTargetView(device, (ID3D11Resource *)backbuffer, NULL, &backbuffer_rtv); + ok(SUCCEEDED(hr), "Failed to create rendertarget view, hr %#x.\n", hr); + + ID3D11Device_GetImmediateContext(device, &context); + + ID3D11DeviceContext_OMSetRenderTargets(context, 1, &backbuffer_rtv, NULL); + ID3D11DeviceContext_IASetInputLayout(context, input_layout); + ID3D11DeviceContext_IASetPrimitiveTopology(context, D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); + stride = sizeof(*quad); + offset = 0; + ID3D11DeviceContext_IASetVertexBuffers(context, 0, 1, &vb, &stride, &offset); + ID3D11DeviceContext_VSSetShader(context, vs, NULL, 0); + ID3D11DeviceContext_PSSetConstantBuffers(context, 0, 1, &ps_cb); + ID3D11DeviceContext_PSSetShader(context, ps, NULL, 0); + + vp.TopLeftX = 0.0f; + vp.TopLeftY = 0.0f; + vp.Width = 640.0f; + vp.Height = 480.0f; + vp.MinDepth = 0.0f; + vp.MaxDepth = 1.0f; + ID3D11DeviceContext_RSSetViewports(context, 1, &vp); + + ID3D11DeviceContext_ClearRenderTargetView(context, backbuffer_rtv, red); + + ID3D11DeviceContext_Draw(context, 4, 0); + + color = get_texture_color(backbuffer, 319, 239); + ok(compare_color(color, 0xff000000, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(backbuffer, 320, 239); + ok(compare_color(color, 0xff00ff00, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(backbuffer, 319, 240); + ok(compare_color(color, 0xffff0000, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(backbuffer, 320, 240); + ok(compare_color(color, 0xffffff00, 1), "Got unexpected color 0x%08x.\n", color); + + ID3D11Buffer_Release(ps_cb); + cutoff.x = 16.0f; + cutoff.y = 16.0f; + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &resource_data, &ps_cb); + ok(SUCCEEDED(hr), "Failed to create constant buffer, hr %#x.\n", hr); + ID3D11DeviceContext_PSSetConstantBuffers(context, 0, 1, &ps_cb); + + ID3D11DeviceContext_Draw(context, 4, 0); + + color = get_texture_color(backbuffer, 14, 14); + ok(compare_color(color, 0xff000000, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(backbuffer, 18, 14); + ok(compare_color(color, 0xff00ff00, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(backbuffer, 14, 18); + ok(compare_color(color, 0xffff0000, 1), "Got unexpected color 0x%08x.\n", color); + color = get_texture_color(backbuffer, 18, 18); + ok(compare_color(color, 0xffffff00, 1), "Got unexpected color 0x%08x.\n", color); + + ID3D11DeviceContext_PSSetShader(context, ps_frac, NULL, 0); + ID3D11DeviceContext_ClearRenderTargetView(context, backbuffer_rtv, red); + + ID3D11DeviceContext_Draw(context, 4, 0); + + color = get_texture_color(backbuffer, 14, 14); + ok(compare_color(color, 0xff008080, 1), "Got unexpected color 0x%08x.\n", color); + + ID3D11Buffer_Release(ps_cb); + ID3D11PixelShader_Release(ps_frac); + ID3D11PixelShader_Release(ps); + ID3D11VertexShader_Release(vs); + ID3D11Buffer_Release(vb); + ID3D11InputLayout_Release(input_layout); + ID3D11RenderTargetView_Release(backbuffer_rtv); + ID3D11Texture2D_Release(backbuffer); + IDXGISwapChain_Release(swapchain); + ID3D11DeviceContext_Release(context); + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + DestroyWindow(window); +} + +static void test_update_subresource(void) +{ + ID3D11RenderTargetView *backbuffer_rtv; + D3D11_SUBRESOURCE_DATA resource_data; + D3D11_TEXTURE2D_DESC texture_desc; + ID3D11SamplerState *sampler_state; + ID3D11ShaderResourceView *ps_srv; + D3D11_SAMPLER_DESC sampler_desc; + ID3D11InputLayout *input_layout; + D3D11_BUFFER_DESC buffer_desc; + ID3D11DeviceContext *context; + ID3D11Texture2D *backbuffer; + unsigned int stride, offset; + struct texture_readback rb; + IDXGISwapChain *swapchain; + ID3D11Texture2D *texture; + ID3D11VertexShader *vs; + ID3D11PixelShader *ps; + ID3D11Device *device; + D3D11_VIEWPORT vp; + unsigned int i, j; + ID3D11Buffer *vb; + ULONG refcount; + D3D11_BOX box; + DWORD color; + HWND window; + HRESULT hr; + + static const D3D11_INPUT_ELEMENT_DESC layout_desc[] = + { + {"POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0}, + }; + static const DWORD vs_code[] = + { +#if 0 + float4 main(float4 position : POSITION) : SV_POSITION + { + return position; + } +#endif + 0x43425844, 0xa7a2f22d, 0x83ff2560, 0xe61638bd, 0x87e3ce90, 0x00000001, 0x000000d8, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x49534f50, 0x4e4f4954, 0xababab00, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000001, 0x00000003, + 0x00000000, 0x0000000f, 0x505f5653, 0x5449534f, 0x004e4f49, 0x52444853, 0x0000003c, 0x00010040, + 0x0000000f, 0x0300005f, 0x001010f2, 0x00000000, 0x04000067, 0x001020f2, 0x00000000, 0x00000001, + 0x05000036, 0x001020f2, 0x00000000, 0x00101e46, 0x00000000, 0x0100003e, + }; + static const DWORD ps_code[] = + { +#if 0 + Texture2D t; + SamplerState s; + + float4 main(float4 position : SV_POSITION) : SV_Target + { + float2 p; + + p.x = position.x / 640.0f; + p.y = position.y / 480.0f; + return t.Sample(s, p); + } +#endif + 0x43425844, 0x1ce9b612, 0xc8176faa, 0xd37844af, 0xdb515605, 0x00000001, 0x00000134, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000030f, 0x505f5653, 0x5449534f, 0x004e4f49, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000098, 0x00000040, + 0x00000026, 0x0300005a, 0x00106000, 0x00000000, 0x04001858, 0x00107000, 0x00000000, 0x00005555, + 0x04002064, 0x00101032, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, + 0x00000001, 0x0a000038, 0x00100032, 0x00000000, 0x00101046, 0x00000000, 0x00004002, 0x3acccccd, + 0x3b088889, 0x00000000, 0x00000000, 0x09000045, 0x001020f2, 0x00000000, 0x00100046, 0x00000000, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0100003e, + }; + static const struct + { + float x, y; + } + quad[] = + { + {-1.0f, -1.0f}, + {-1.0f, 1.0f}, + { 1.0f, -1.0f}, + { 1.0f, 1.0f}, + }; + static const float red[] = {1.0f, 0.0f, 0.0f, 0.5f}; + static const DWORD bitmap_data[] = + { + 0xff0000ff, 0xff00ffff, 0xff00ff00, 0xffffff00, + 0xffff0000, 0xffff00ff, 0xff000000, 0xff7f7f7f, + 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + }; + static const DWORD expected_colors[] = + { + 0xffffffff, 0xff000000, 0xffffffff, 0xff000000, + 0xff00ff00, 0xff0000ff, 0xff00ffff, 0x00000000, + 0xffffff00, 0xffff0000, 0xffff00ff, 0x00000000, + 0xff000000, 0xff7f7f7f, 0xffffffff, 0x00000000, + }; + + if (!(device = create_device(NULL))) + { + skip("Failed to create device.\n"); + return; + } + window = CreateWindowA("static", "d3d11_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + swapchain = create_swapchain(device, window, TRUE); + hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_ID3D11Texture2D, (void **)&backbuffer); + ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr); + + hr = ID3D11Device_CreateInputLayout(device, layout_desc, sizeof(layout_desc) / sizeof(*layout_desc), + vs_code, sizeof(vs_code), &input_layout); + ok(SUCCEEDED(hr), "Failed to create input layout, hr %#x.\n", hr); + + buffer_desc.ByteWidth = sizeof(quad); + buffer_desc.Usage = D3D11_USAGE_DEFAULT; + buffer_desc.BindFlags = D3D11_BIND_VERTEX_BUFFER; + buffer_desc.CPUAccessFlags = 0; + buffer_desc.MiscFlags = 0; + buffer_desc.StructureByteStride = 0; + + resource_data.pSysMem = quad; + resource_data.SysMemPitch = 0; + resource_data.SysMemSlicePitch = 0; + + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &resource_data, &vb); + ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr); + + texture_desc.Width = 4; + texture_desc.Height = 4; + 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_SHADER_RESOURCE; + texture_desc.CPUAccessFlags = 0; + texture_desc.MiscFlags = 0; + + hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, &texture); + ok(SUCCEEDED(hr), "Failed to create 2d texture, hr %#x.\n", hr); + + hr = ID3D11Device_CreateShaderResourceView(device, (ID3D11Resource *)texture, NULL, &ps_srv); + ok(SUCCEEDED(hr), "Failed to create shader resource view, hr %#x.\n", hr); + + sampler_desc.Filter = D3D11_FILTER_MIN_MAG_MIP_POINT; + sampler_desc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP; + sampler_desc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP; + sampler_desc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP; + sampler_desc.MipLODBias = 0.0f; + sampler_desc.MaxAnisotropy = 0; + sampler_desc.ComparisonFunc = D3D11_COMPARISON_NEVER; + sampler_desc.BorderColor[0] = 0.0f; + sampler_desc.BorderColor[1] = 0.0f; + sampler_desc.BorderColor[2] = 0.0f; + sampler_desc.BorderColor[3] = 0.0f; + sampler_desc.MinLOD = 0.0f; + sampler_desc.MaxLOD = 0.0f; + + hr = ID3D11Device_CreateSamplerState(device, &sampler_desc, &sampler_state); + ok(SUCCEEDED(hr), "Failed to create sampler state, hr %#x.\n", hr); + + hr = ID3D11Device_CreateVertexShader(device, vs_code, sizeof(vs_code), NULL, &vs); + ok(SUCCEEDED(hr), "Failed to create vertex shader, hr %#x.\n", hr); + hr = ID3D11Device_CreatePixelShader(device, ps_code, sizeof(ps_code), NULL, &ps); + ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x.\n", hr); + + hr = ID3D11Device_CreateRenderTargetView(device, (ID3D11Resource *)backbuffer, NULL, &backbuffer_rtv); + ok(SUCCEEDED(hr), "Failed to create rendertarget view, hr %#x.\n", hr); + + ID3D11Device_GetImmediateContext(device, &context); + + ID3D11DeviceContext_OMSetRenderTargets(context, 1, &backbuffer_rtv, NULL); + ID3D11DeviceContext_IASetInputLayout(context, input_layout); + ID3D11DeviceContext_IASetPrimitiveTopology(context, D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); + stride = sizeof(*quad); + offset = 0; + ID3D11DeviceContext_IASetVertexBuffers(context, 0, 1, &vb, &stride, &offset); + ID3D11DeviceContext_VSSetShader(context, vs, NULL, 0); + ID3D11DeviceContext_PSSetShaderResources(context, 0, 1, &ps_srv); + ID3D11DeviceContext_PSSetSamplers(context, 0, 1, &sampler_state); + ID3D11DeviceContext_PSSetShader(context, ps, NULL, 0); + + vp.TopLeftX = 0.0f; + vp.TopLeftY = 0.0f; + vp.Width = 640.0f; + vp.Height = 480.0f; + vp.MinDepth = 0.0f; + vp.MaxDepth = 1.0f; + ID3D11DeviceContext_RSSetViewports(context, 1, &vp); + + ID3D11DeviceContext_ClearRenderTargetView(context, backbuffer_rtv, red); + + ID3D11DeviceContext_Draw(context, 4, 0); + get_texture_readback(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, 0x00000000, 0), + "Got unexpected color 0x%08x at (%u, %u).\n", color, j, i); + } + } + release_texture_readback(&rb); + + set_box(&box, 1, 1, 0, 3, 3, 1); + ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)texture, 0, &box, + bitmap_data, 4 * sizeof(*bitmap_data), 0); + set_box(&box, 0, 3, 0, 3, 4, 1); + ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)texture, 0, &box, + &bitmap_data[6], 4 * sizeof(*bitmap_data), 0); + set_box(&box, 0, 0, 0, 4, 1, 1); + ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)texture, 0, &box, + &bitmap_data[10], 4 * sizeof(*bitmap_data), 0); + set_box(&box, 0, 1, 0, 1, 3, 1); + ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)texture, 0, &box, + &bitmap_data[2], sizeof(*bitmap_data), 0); + set_box(&box, 4, 4, 0, 3, 1, 1); + ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)texture, 0, &box, + bitmap_data, sizeof(*bitmap_data), 0); + ID3D11DeviceContext_Draw(context, 4, 0); + get_texture_readback(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, expected_colors[j + i * 4], 1), + "Got unexpected color 0x%08x at (%u, %u), expected 0x%08x.\n", + color, j, i, expected_colors[j + i * 4]); + } + } + release_texture_readback(&rb); + + ID3D11DeviceContext_UpdateSubresource(context, (ID3D11Resource *)texture, 0, NULL, + bitmap_data, 4 * sizeof(*bitmap_data), 0); + ID3D11DeviceContext_Draw(context, 4, 0); + get_texture_readback(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); + + ID3D11PixelShader_Release(ps); + ID3D11VertexShader_Release(vs); + ID3D11SamplerState_Release(sampler_state); + ID3D11ShaderResourceView_Release(ps_srv); + ID3D11Texture2D_Release(texture); + ID3D11Buffer_Release(vb); + ID3D11InputLayout_Release(input_layout); + ID3D11RenderTargetView_Release(backbuffer_rtv); + ID3D11Texture2D_Release(backbuffer); + IDXGISwapChain_Release(swapchain); + ID3D11DeviceContext_Release(context); + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + DestroyWindow(window); +} + +static void test_resource_map(void) +{ + D3D11_MAPPED_SUBRESOURCE mapped_subresource; + D3D11_TEXTURE3D_DESC texture3d_desc; + D3D11_TEXTURE2D_DESC texture2d_desc; + D3D11_BUFFER_DESC buffer_desc; + ID3D11DeviceContext *context; + ID3D11Texture3D *texture3d; + ID3D11Texture2D *texture2d; + ID3D11Buffer *buffer; + ID3D11Device *device; + ULONG refcount; + HRESULT hr; + DWORD data; + + if (!(device = create_device(NULL))) + { + skip("Failed to create device.\n"); + return; + } + + ID3D11Device_GetImmediateContext(device, &context); + + buffer_desc.ByteWidth = 1024; + buffer_desc.Usage = D3D11_USAGE_STAGING; + buffer_desc.BindFlags = 0; + buffer_desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE; + buffer_desc.MiscFlags = 0; + buffer_desc.StructureByteStride = 0; + + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, NULL, &buffer); + ok(SUCCEEDED(hr), "Failed to create a buffer, hr %#x.\n", hr); + + hr = ID3D11DeviceContext_Map(context, (ID3D11Resource *)buffer, 1, D3D11_MAP_READ, 0, &mapped_subresource); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + memset(&mapped_subresource, 0, sizeof(mapped_subresource)); + hr = ID3D11DeviceContext_Map(context, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE, 0, &mapped_subresource); + ok(SUCCEEDED(hr), "Failed to map buffer, hr %#x.\n", hr); + ok(mapped_subresource.RowPitch == 1024, "Got unexpected row pitch %u.\n", mapped_subresource.RowPitch); + ok(mapped_subresource.DepthPitch == 1024, "Got unexpected depth pitch %u.\n", mapped_subresource.DepthPitch); + *((DWORD *)mapped_subresource.pData) = 0xdeadbeef; + ID3D11DeviceContext_Unmap(context, (ID3D11Resource *)buffer, 0); + + memset(&mapped_subresource, 0, sizeof(mapped_subresource)); + hr = ID3D11DeviceContext_Map(context, (ID3D11Resource *)buffer, 0, D3D11_MAP_READ, 0, &mapped_subresource); + ok(SUCCEEDED(hr), "Failed to map buffer, hr %#x.\n", hr); + ok(mapped_subresource.RowPitch == 1024, "Got unexpected row pitch %u.\n", mapped_subresource.RowPitch); + ok(mapped_subresource.DepthPitch == 1024, "Got unexpected depth pitch %u.\n", mapped_subresource.DepthPitch); + data = *((DWORD *)mapped_subresource.pData); + ok(data == 0xdeadbeef, "Got unexpected data %#x.\n", data); + ID3D11DeviceContext_Unmap(context, (ID3D11Resource *)buffer, 0); + + refcount = ID3D11Buffer_Release(buffer); + ok(!refcount, "Buffer has %u references left.\n", refcount); + + texture2d_desc.Width = 512; + texture2d_desc.Height = 512; + texture2d_desc.MipLevels = 1; + texture2d_desc.ArraySize = 1; + texture2d_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + texture2d_desc.SampleDesc.Count = 1; + texture2d_desc.SampleDesc.Quality = 0; + texture2d_desc.Usage = D3D11_USAGE_STAGING; + texture2d_desc.BindFlags = 0; + texture2d_desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE; + texture2d_desc.MiscFlags = 0; + + hr = ID3D11Device_CreateTexture2D(device, &texture2d_desc, NULL, &texture2d); + ok(SUCCEEDED(hr), "Failed to create 2d texture, hr %#x.\n", hr); + + hr = ID3D11DeviceContext_Map(context, (ID3D11Resource *)texture2d, 1, D3D11_MAP_READ, 0, &mapped_subresource); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + memset(&mapped_subresource, 0, sizeof(mapped_subresource)); + hr = ID3D11DeviceContext_Map(context, (ID3D11Resource *)texture2d, 0, D3D11_MAP_WRITE, 0, &mapped_subresource); + ok(SUCCEEDED(hr), "Failed to map texture, hr %#x.\n", hr); + ok(mapped_subresource.RowPitch == 4 * 512, "Got unexpected row pitch %u.\n", mapped_subresource.RowPitch); + ok(mapped_subresource.DepthPitch == 4 * 512 * 512, "Got unexpected depth pitch %u.\n", + mapped_subresource.DepthPitch); + *((DWORD *)mapped_subresource.pData) = 0xdeadbeef; + ID3D11DeviceContext_Unmap(context, (ID3D11Resource *)texture2d, 0); + + memset(&mapped_subresource, 0, sizeof(mapped_subresource)); + hr = ID3D11DeviceContext_Map(context, (ID3D11Resource *)texture2d, 0, D3D11_MAP_READ, 0, &mapped_subresource); + ok(SUCCEEDED(hr), "Failed to map texture, hr %#x.\n", hr); + ok(mapped_subresource.RowPitch == 4 * 512, "Got unexpected row pitch %u.\n", mapped_subresource.RowPitch); + ok(mapped_subresource.DepthPitch == 4 * 512 * 512, "Got unexpected depth pitch %u.\n", + mapped_subresource.DepthPitch); + data = *((DWORD *)mapped_subresource.pData); + ok(data == 0xdeadbeef, "Got unexpected data %#x.\n", data); + ID3D11DeviceContext_Unmap(context, (ID3D11Resource *)texture2d, 0); + + refcount = ID3D11Texture2D_Release(texture2d); + ok(!refcount, "2D texture has %u references left.\n", refcount); + + texture3d_desc.Width = 64; + texture3d_desc.Height = 64; + texture3d_desc.Depth = 64; + texture3d_desc.MipLevels = 1; + texture3d_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + texture3d_desc.Usage = D3D11_USAGE_STAGING; + texture3d_desc.BindFlags = 0; + texture3d_desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE; + texture3d_desc.MiscFlags = 0; + + hr = ID3D11Device_CreateTexture3D(device, &texture3d_desc, NULL, &texture3d); + ok(SUCCEEDED(hr), "Failed to create 3d texture, hr %#x.\n", hr); + + hr = ID3D11DeviceContext_Map(context, (ID3D11Resource *)texture3d, 1, D3D11_MAP_READ, 0, &mapped_subresource); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + memset(&mapped_subresource, 0, sizeof(mapped_subresource)); + hr = ID3D11DeviceContext_Map(context, (ID3D11Resource *)texture3d, 0, D3D11_MAP_WRITE, 0, &mapped_subresource); + todo_wine ok(SUCCEEDED(hr), "Failed to map texture, hr %#x.\n", hr); + if (FAILED(hr)) goto done; + ok(mapped_subresource.RowPitch == 4 * 64, "Got unexpected row pitch %u.\n", mapped_subresource.RowPitch); + ok(mapped_subresource.DepthPitch == 4 * 64 * 64, "Got unexpected depth pitch %u.\n", + mapped_subresource.DepthPitch); + *((DWORD *)mapped_subresource.pData) = 0xdeadbeef; + ID3D11DeviceContext_Unmap(context, (ID3D11Resource *)texture3d, 0); + + memset(&mapped_subresource, 0, sizeof(mapped_subresource)); + hr = ID3D11DeviceContext_Map(context, (ID3D11Resource *)texture3d, 0, D3D11_MAP_READ, 0, &mapped_subresource); + ok(SUCCEEDED(hr), "Failed to map texture, hr %#x.\n", hr); + ok(mapped_subresource.RowPitch == 4 * 64, "Got unexpected row pitch %u.\n", mapped_subresource.RowPitch); + ok(mapped_subresource.DepthPitch == 4 * 64 * 64, "Got unexpected depth pitch %u.\n", + mapped_subresource.DepthPitch); + data = *((DWORD *)mapped_subresource.pData); + ok(data == 0xdeadbeef, "Got unexpected data %#x.\n", data); + ID3D11DeviceContext_Unmap(context, (ID3D11Resource *)texture3d, 0); + +done: + refcount = ID3D11Texture3D_Release(texture3d); + ok(!refcount, "3D texture has %u references left.\n", refcount); + + ID3D11DeviceContext_Release(context); + + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + +START_TEST(d3d11) +{ + test_create_device(); + test_device_interfaces(); + test_get_immediate_context(); + test_create_texture2d(); + test_texture2d_interfaces(); + test_create_texture3d(); + test_texture3d_interfaces(); + test_buffer_interfaces(); + test_create_depthstencil_view(); + test_depthstencil_view_interfaces(); + test_create_rendertarget_view(); + test_create_shader_resource_view(); + test_create_shader(); + test_create_sampler_state(); + test_create_blend_state(); + test_create_depthstencil_state(); + test_create_rasterizer_state(); + test_create_predicate(); + test_device_removed_reason(); + test_private_data(); + test_blend(); + test_texture(); + test_scissor(); + test_il_append_aligned(); + test_fragment_coords(); + test_update_subresource(); + test_resource_map(); +} diff -Nru wine1.7-1.7.50/dlls/d3d11/tests/Makefile.in wine1.7-1.7.55/dlls/d3d11/tests/Makefile.in --- wine1.7-1.7.50/dlls/d3d11/tests/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d11/tests/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,5 @@ +TESTDLL = d3d11.dll +IMPORTS = d3d11 user32 + +C_SRCS = \ + d3d11.c diff -Nru wine1.7-1.7.50/dlls/d3d11/texture.c wine1.7-1.7.55/dlls/d3d11/texture.c --- wine1.7-1.7.50/dlls/d3d11/texture.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d11/texture.c 2015-11-13 14:32:40.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright 2009 Henri Verbeet for CodeWeavers + * Copyright 2015 Józef Kucia for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,111 +25,107 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d11); -static inline struct d3d10_texture2d *impl_from_ID3D10Texture2D(ID3D10Texture2D *iface) +/* ID3D11Texture2D methods */ + +static inline struct d3d_texture2d *impl_from_ID3D11Texture2D(ID3D11Texture2D *iface) { - return CONTAINING_RECORD(iface, struct d3d10_texture2d, ID3D10Texture2D_iface); + return CONTAINING_RECORD(iface, struct d3d_texture2d, ID3D11Texture2D_iface); } -/* IUnknown methods */ - -static HRESULT STDMETHODCALLTYPE d3d10_texture2d_QueryInterface(ID3D10Texture2D *iface, REFIID riid, void **object) +static HRESULT STDMETHODCALLTYPE d3d11_texture2d_QueryInterface(ID3D11Texture2D *iface, REFIID riid, void **object) { - struct d3d10_texture2d *This = impl_from_ID3D10Texture2D(iface); + struct d3d_texture2d *texture = impl_from_ID3D11Texture2D(iface); - TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object); + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); - if (IsEqualGUID(riid, &IID_ID3D10Texture2D) - || IsEqualGUID(riid, &IID_ID3D10Resource) - || IsEqualGUID(riid, &IID_ID3D10DeviceChild) + if (IsEqualGUID(riid, &IID_ID3D11Texture2D) + || IsEqualGUID(riid, &IID_ID3D11Resource) + || IsEqualGUID(riid, &IID_ID3D11DeviceChild) || IsEqualGUID(riid, &IID_IUnknown)) { - IUnknown_AddRef(iface); - *object = iface; + *object = &texture->ID3D11Texture2D_iface; + IUnknown_AddRef((IUnknown *)*object); + return S_OK; + } + else if (IsEqualGUID(riid, &IID_ID3D10Texture2D) + || IsEqualGUID(riid, &IID_ID3D10Resource) + || IsEqualGUID(riid, &IID_ID3D10DeviceChild)) + { + *object = &texture->ID3D10Texture2D_iface; + IUnknown_AddRef((IUnknown *)*object); return S_OK; } - if (This->dxgi_surface) + if (texture->dxgi_surface) { - TRACE("Forwarding to dxgi surface\n"); - return IUnknown_QueryInterface(This->dxgi_surface, riid, object); + TRACE("Forwarding to dxgi surface.\n"); + return IUnknown_QueryInterface(texture->dxgi_surface, riid, object); } - WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid)); + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); *object = NULL; return E_NOINTERFACE; } -static ULONG STDMETHODCALLTYPE d3d10_texture2d_AddRef(ID3D10Texture2D *iface) +static ULONG STDMETHODCALLTYPE d3d11_texture2d_AddRef(ID3D11Texture2D *iface) { - struct d3d10_texture2d *This = impl_from_ID3D10Texture2D(iface); - ULONG refcount = InterlockedIncrement(&This->refcount); + struct d3d_texture2d *texture = impl_from_ID3D11Texture2D(iface); + ULONG refcount = InterlockedIncrement(&texture->refcount); - TRACE("%p increasing refcount to %u\n", This, refcount); + TRACE("%p increasing refcount to %u.\n", texture, refcount); if (refcount == 1) { - ID3D10Device1_AddRef(This->device); + ID3D11Device_AddRef(texture->device); wined3d_mutex_lock(); - wined3d_texture_incref(This->wined3d_texture); + wined3d_texture_incref(texture->wined3d_texture); wined3d_mutex_unlock(); } return refcount; } -static void STDMETHODCALLTYPE d3d10_texture2d_wined3d_object_released(void *parent) +static ULONG STDMETHODCALLTYPE d3d11_texture2d_Release(ID3D11Texture2D *iface) { - struct d3d10_texture2d *This = parent; - - if (This->dxgi_surface) IUnknown_Release(This->dxgi_surface); - wined3d_private_store_cleanup(&This->private_store); - HeapFree(GetProcessHeap(), 0, This); -} - -static ULONG STDMETHODCALLTYPE d3d10_texture2d_Release(ID3D10Texture2D *iface) -{ - struct d3d10_texture2d *This = impl_from_ID3D10Texture2D(iface); - ULONG refcount = InterlockedDecrement(&This->refcount); + struct d3d_texture2d *texture = impl_from_ID3D11Texture2D(iface); + ULONG refcount = InterlockedDecrement(&texture->refcount); - TRACE("%p decreasing refcount to %u\n", This, refcount); + TRACE("%p decreasing refcount to %u.\n", texture, refcount); if (!refcount) { - ID3D10Device1 *device = This->device; + ID3D11Device *device = texture->device; wined3d_mutex_lock(); - wined3d_texture_decref(This->wined3d_texture); + wined3d_texture_decref(texture->wined3d_texture); wined3d_mutex_unlock(); /* Release the device last, it may cause the wined3d device to be * destroyed. */ - ID3D10Device1_Release(device); + ID3D11Device_Release(device); } return refcount; } -/* ID3D10DeviceChild methods */ - -static void STDMETHODCALLTYPE d3d10_texture2d_GetDevice(ID3D10Texture2D *iface, ID3D10Device **device) +static void STDMETHODCALLTYPE d3d11_texture2d_GetDevice(ID3D11Texture2D *iface, ID3D11Device **device) { - struct d3d10_texture2d *texture = impl_from_ID3D10Texture2D(iface); + struct d3d_texture2d *texture = impl_from_ID3D11Texture2D(iface); TRACE("iface %p, device %p.\n", iface, device); - *device = (ID3D10Device *)texture->device; - ID3D10Device_AddRef(*device); + *device = texture->device; + ID3D11Device_AddRef(*device); } -static HRESULT STDMETHODCALLTYPE d3d10_texture2d_GetPrivateData(ID3D10Texture2D *iface, +static HRESULT STDMETHODCALLTYPE d3d11_texture2d_GetPrivateData(ID3D11Texture2D *iface, REFGUID guid, UINT *data_size, void *data) { - struct d3d10_texture2d *texture = impl_from_ID3D10Texture2D(iface); + struct d3d_texture2d *texture = impl_from_ID3D11Texture2D(iface); IDXGISurface *dxgi_surface; HRESULT hr; - TRACE("iface %p, guid %s, data_size %p, data %p.\n", - iface, debugstr_guid(guid), data_size, data); + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); if (texture->dxgi_surface && SUCCEEDED(IUnknown_QueryInterface(texture->dxgi_surface, &IID_IDXGISurface, (void **)&dxgi_surface))) @@ -138,18 +135,17 @@ return hr; } - return d3d10_get_private_data(&texture->private_store, guid, data_size, data); + return d3d_get_private_data(&texture->private_store, guid, data_size, data); } -static HRESULT STDMETHODCALLTYPE d3d10_texture2d_SetPrivateData(ID3D10Texture2D *iface, +static HRESULT STDMETHODCALLTYPE d3d11_texture2d_SetPrivateData(ID3D11Texture2D *iface, REFGUID guid, UINT data_size, const void *data) { - struct d3d10_texture2d *texture = impl_from_ID3D10Texture2D(iface); + struct d3d_texture2d *texture = impl_from_ID3D11Texture2D(iface); IDXGISurface *dxgi_surface; HRESULT hr; - TRACE("iface %p, guid %s, data_size %u, data %p.\n", - iface, debugstr_guid(guid), data_size, data); + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); if (texture->dxgi_surface && SUCCEEDED(IUnknown_QueryInterface(texture->dxgi_surface, &IID_IDXGISurface, (void **)&dxgi_surface))) @@ -159,13 +155,13 @@ return hr; } - return d3d10_set_private_data(&texture->private_store, guid, data_size, data); + return d3d_set_private_data(&texture->private_store, guid, data_size, data); } -static HRESULT STDMETHODCALLTYPE d3d10_texture2d_SetPrivateDataInterface(ID3D10Texture2D *iface, +static HRESULT STDMETHODCALLTYPE d3d11_texture2d_SetPrivateDataInterface(ID3D11Texture2D *iface, REFGUID guid, const IUnknown *data) { - struct d3d10_texture2d *texture = impl_from_ID3D10Texture2D(iface); + struct d3d_texture2d *texture = impl_from_ID3D11Texture2D(iface); IDXGISurface *dxgi_surface; HRESULT hr; @@ -179,7 +175,157 @@ return hr; } - return d3d10_set_private_data_interface(&texture->private_store, guid, data); + return d3d_set_private_data_interface(&texture->private_store, guid, data); +} + +static void STDMETHODCALLTYPE d3d11_texture2d_GetType(ID3D11Texture2D *iface, + D3D11_RESOURCE_DIMENSION *resource_dimension) +{ + TRACE("iface %p, resource_dimension %p.\n", iface, resource_dimension); + + *resource_dimension = D3D11_RESOURCE_DIMENSION_TEXTURE2D; +} + +static void STDMETHODCALLTYPE d3d11_texture2d_SetEvictionPriority(ID3D11Texture2D *iface, UINT eviction_priority) +{ + FIXME("iface %p, eviction_priority %#x stub!\n", iface, eviction_priority); +} + +static UINT STDMETHODCALLTYPE d3d11_texture2d_GetEvictionPriority(ID3D11Texture2D *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static void STDMETHODCALLTYPE d3d11_texture2d_GetDesc(ID3D11Texture2D *iface, D3D11_TEXTURE2D_DESC *desc) +{ + struct d3d_texture2d *texture = impl_from_ID3D11Texture2D(iface); + struct wined3d_resource_desc wined3d_desc; + + TRACE("iface %p, desc %p.\n", iface, desc); + + *desc = texture->desc; + + wined3d_mutex_lock(); + wined3d_resource_get_desc(wined3d_texture_get_resource(texture->wined3d_texture), &wined3d_desc); + wined3d_mutex_unlock(); + + /* FIXME: Resizing swapchain buffers can cause these to change. We'd like + * to get everything from wined3d, but e.g. bind flags don't exist as such + * there (yet). */ + desc->Width = wined3d_desc.width; + desc->Height = wined3d_desc.height; + desc->Format = dxgi_format_from_wined3dformat(wined3d_desc.format); + desc->SampleDesc.Count = wined3d_desc.multisample_type == WINED3D_MULTISAMPLE_NONE + ? 1 : wined3d_desc.multisample_type; + desc->SampleDesc.Quality = wined3d_desc.multisample_quality; +} + +static const struct ID3D11Texture2DVtbl d3d11_texture2d_vtbl = +{ + /* IUnknown methods */ + d3d11_texture2d_QueryInterface, + d3d11_texture2d_AddRef, + d3d11_texture2d_Release, + /* ID3D11DeviceChild methods */ + d3d11_texture2d_GetDevice, + d3d11_texture2d_GetPrivateData, + d3d11_texture2d_SetPrivateData, + d3d11_texture2d_SetPrivateDataInterface, + /* ID3D11Resource methods */ + d3d11_texture2d_GetType, + d3d11_texture2d_SetEvictionPriority, + d3d11_texture2d_GetEvictionPriority, + /* ID3D11Texture2D methods */ + d3d11_texture2d_GetDesc, +}; + +struct d3d_texture2d *unsafe_impl_from_ID3D11Texture2D(ID3D11Texture2D *iface) +{ + if (!iface) + return NULL; + assert(iface->lpVtbl == &d3d11_texture2d_vtbl); + return CONTAINING_RECORD(iface, struct d3d_texture2d, ID3D11Texture2D_iface); +} + +/* IUnknown methods */ + +static HRESULT STDMETHODCALLTYPE d3d10_texture2d_QueryInterface(ID3D10Texture2D *iface, REFIID riid, void **object) +{ + struct d3d_texture2d *texture = impl_from_ID3D10Texture2D(iface); + + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + + return d3d11_texture2d_QueryInterface(&texture->ID3D11Texture2D_iface, riid, object); +} + +static ULONG STDMETHODCALLTYPE d3d10_texture2d_AddRef(ID3D10Texture2D *iface) +{ + struct d3d_texture2d *texture = impl_from_ID3D10Texture2D(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_texture2d_AddRef(&texture->ID3D11Texture2D_iface); +} + +static void STDMETHODCALLTYPE d3d_texture2d_wined3d_object_released(void *parent) +{ + struct d3d_texture2d *texture = parent; + + if (texture->dxgi_surface) IUnknown_Release(texture->dxgi_surface); + wined3d_private_store_cleanup(&texture->private_store); + HeapFree(GetProcessHeap(), 0, texture); +} + +static ULONG STDMETHODCALLTYPE d3d10_texture2d_Release(ID3D10Texture2D *iface) +{ + struct d3d_texture2d *texture = impl_from_ID3D10Texture2D(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_texture2d_Release(&texture->ID3D11Texture2D_iface); +} + +/* ID3D10DeviceChild methods */ + +static void STDMETHODCALLTYPE d3d10_texture2d_GetDevice(ID3D10Texture2D *iface, ID3D10Device **device) +{ + struct d3d_texture2d *texture = impl_from_ID3D10Texture2D(iface); + + TRACE("iface %p, device %p.\n", iface, device); + + ID3D11Device_QueryInterface(texture->device, &IID_ID3D10Device, (void **)device); +} + +static HRESULT STDMETHODCALLTYPE d3d10_texture2d_GetPrivateData(ID3D10Texture2D *iface, + REFGUID guid, UINT *data_size, void *data) +{ + struct d3d_texture2d *texture = impl_from_ID3D10Texture2D(iface); + + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d11_texture2d_GetPrivateData(&texture->ID3D11Texture2D_iface, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d10_texture2d_SetPrivateData(ID3D10Texture2D *iface, + REFGUID guid, UINT data_size, const void *data) +{ + struct d3d_texture2d *texture = impl_from_ID3D10Texture2D(iface); + + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d11_texture2d_SetPrivateData(&texture->ID3D11Texture2D_iface, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d10_texture2d_SetPrivateDataInterface(ID3D10Texture2D *iface, + REFGUID guid, const IUnknown *data) +{ + struct d3d_texture2d *texture = impl_from_ID3D10Texture2D(iface); + + TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); + + return d3d11_texture2d_SetPrivateDataInterface(&texture->ID3D11Texture2D_iface, guid, data); } /* ID3D10Resource methods */ @@ -209,9 +355,8 @@ static HRESULT STDMETHODCALLTYPE d3d10_texture2d_Map(ID3D10Texture2D *iface, UINT sub_resource_idx, D3D10_MAP map_type, UINT map_flags, D3D10_MAPPED_TEXTURE2D *mapped_texture) { - struct d3d10_texture2d *texture = impl_from_ID3D10Texture2D(iface); + struct d3d_texture2d *texture = impl_from_ID3D10Texture2D(iface); struct wined3d_map_desc wined3d_map_desc; - struct wined3d_resource *sub_resource; HRESULT hr; TRACE("iface %p, sub_resource_idx %u, map_type %u, map_flags %#x, mapped_texture %p.\n", @@ -221,10 +366,8 @@ FIXME("Ignoring map_flags %#x.\n", map_flags); wined3d_mutex_lock(); - if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, sub_resource_idx))) - hr = E_INVALIDARG; - else if (SUCCEEDED(hr = wined3d_surface_map(wined3d_surface_from_resource(sub_resource), - &wined3d_map_desc, NULL, wined3d_map_flags_from_d3d10_map_type(map_type)))) + if (SUCCEEDED(hr = wined3d_resource_map(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx, + &wined3d_map_desc, NULL, wined3d_map_flags_from_d3d11_map_type(map_type)))) { mapped_texture->pData = wined3d_map_desc.data; mapped_texture->RowPitch = wined3d_map_desc.row_pitch; @@ -236,44 +379,34 @@ static void STDMETHODCALLTYPE d3d10_texture2d_Unmap(ID3D10Texture2D *iface, UINT sub_resource_idx) { - struct d3d10_texture2d *texture = impl_from_ID3D10Texture2D(iface); - struct wined3d_resource *sub_resource; + struct d3d_texture2d *texture = impl_from_ID3D10Texture2D(iface); TRACE("iface %p, sub_resource_idx %u.\n", iface, sub_resource_idx); wined3d_mutex_lock(); - if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, sub_resource_idx))) - { - wined3d_mutex_unlock(); - return; - } - - wined3d_surface_unmap(wined3d_surface_from_resource(sub_resource)); + wined3d_resource_unmap(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx); wined3d_mutex_unlock(); } static void STDMETHODCALLTYPE d3d10_texture2d_GetDesc(ID3D10Texture2D *iface, D3D10_TEXTURE2D_DESC *desc) { - struct d3d10_texture2d *texture = impl_from_ID3D10Texture2D(iface); - struct wined3d_resource_desc wined3d_desc; + struct d3d_texture2d *texture = impl_from_ID3D10Texture2D(iface); + D3D11_TEXTURE2D_DESC d3d11_desc; TRACE("iface %p, desc %p\n", iface, desc); - *desc = texture->desc; - - wined3d_mutex_lock(); - wined3d_resource_get_desc(wined3d_texture_get_resource(texture->wined3d_texture), &wined3d_desc); - wined3d_mutex_unlock(); + d3d11_texture2d_GetDesc(&texture->ID3D11Texture2D_iface, &d3d11_desc); - /* FIXME: Resizing swapchain buffers can cause these to change. We'd like - * to get everything from wined3d, but e.g. bind flags don't exist as such - * there (yet). */ - desc->Width = wined3d_desc.width; - desc->Height = wined3d_desc.height; - desc->Format = dxgi_format_from_wined3dformat(wined3d_desc.format); - desc->SampleDesc.Count = wined3d_desc.multisample_type == WINED3D_MULTISAMPLE_NONE - ? 1 : wined3d_desc.multisample_type; - desc->SampleDesc.Quality = wined3d_desc.multisample_quality; + desc->Width = d3d11_desc.Width; + desc->Height = d3d11_desc.Height; + desc->MipLevels = d3d11_desc.MipLevels; + desc->ArraySize = d3d11_desc.ArraySize; + desc->Format = d3d11_desc.Format; + desc->SampleDesc = d3d11_desc.SampleDesc; + desc->Usage = d3d10_usage_from_d3d11_usage(d3d11_desc.Usage); + desc->BindFlags = d3d10_bind_flags_from_d3d11_bind_flags(d3d11_desc.BindFlags); + desc->CPUAccessFlags = d3d10_cpu_access_flags_from_d3d11_cpu_access_flags(d3d11_desc.CPUAccessFlags); + desc->MiscFlags = d3d10_resource_misc_flags_from_d3d11_resource_misc_flags(d3d11_desc.MiscFlags); } static const struct ID3D10Texture2DVtbl d3d10_texture2d_vtbl = @@ -297,26 +430,27 @@ d3d10_texture2d_GetDesc, }; -struct d3d10_texture2d *unsafe_impl_from_ID3D10Texture2D(ID3D10Texture2D *iface) +struct d3d_texture2d *unsafe_impl_from_ID3D10Texture2D(ID3D10Texture2D *iface) { if (!iface) return NULL; assert(iface->lpVtbl == &d3d10_texture2d_vtbl); - return CONTAINING_RECORD(iface, struct d3d10_texture2d, ID3D10Texture2D_iface); + return CONTAINING_RECORD(iface, struct d3d_texture2d, ID3D10Texture2D_iface); } -static const struct wined3d_parent_ops d3d10_texture2d_wined3d_parent_ops = +static const struct wined3d_parent_ops d3d_texture2d_wined3d_parent_ops = { - d3d10_texture2d_wined3d_object_released, + d3d_texture2d_wined3d_object_released, }; -HRESULT d3d10_texture2d_init(struct d3d10_texture2d *texture, struct d3d_device *device, - const D3D10_TEXTURE2D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data) +static HRESULT d3d_texture2d_init(struct d3d_texture2d *texture, struct d3d_device *device, + const D3D11_TEXTURE2D_DESC *desc, const D3D11_SUBRESOURCE_DATA *data) { struct wined3d_resource_desc wined3d_desc; unsigned int levels; HRESULT hr; + texture->ID3D11Texture2D_iface.lpVtbl = &d3d11_texture2d_vtbl; texture->ID3D10Texture2D_iface.lpVtbl = &d3d10_texture2d_vtbl; texture->refcount = 1; wined3d_mutex_lock(); @@ -332,7 +466,7 @@ wined3d_desc.format = wined3dformat_from_dxgi_format(desc->Format); wined3d_desc.multisample_type = desc->SampleDesc.Count > 1 ? desc->SampleDesc.Count : WINED3D_MULTISAMPLE_NONE; wined3d_desc.multisample_quality = desc->SampleDesc.Quality; - wined3d_desc.usage = wined3d_usage_from_d3d10core(desc->BindFlags, desc->Usage); + wined3d_desc.usage = wined3d_usage_from_d3d11(desc->BindFlags, desc->Usage); wined3d_desc.pool = WINED3D_POOL_DEFAULT; wined3d_desc.width = desc->Width; wined3d_desc.height = desc->Height; @@ -343,7 +477,7 @@ if (FAILED(hr = wined3d_texture_create(device->wined3d_device, &wined3d_desc, levels, 0, (struct wined3d_sub_resource_data *)data, texture, - &d3d10_texture2d_wined3d_parent_ops, &texture->wined3d_texture))) + &d3d_texture2d_wined3d_parent_ops, &texture->wined3d_texture))) { WARN("Failed to create wined3d texture, hr %#x.\n", hr); wined3d_private_store_cleanup(&texture->private_store); @@ -379,30 +513,64 @@ } wined3d_mutex_unlock(); - texture->device = &device->ID3D10Device1_iface; - ID3D10Device1_AddRef(texture->device); + texture->device = &device->ID3D11Device_iface; + ID3D11Device_AddRef(texture->device); return S_OK; } -static inline struct d3d10_texture3d *impl_from_ID3D10Texture3D(ID3D10Texture3D *iface) +HRESULT d3d_texture2d_create(struct d3d_device *device, const D3D11_TEXTURE2D_DESC *desc, + const D3D11_SUBRESOURCE_DATA *data, struct d3d_texture2d **texture) { - return CONTAINING_RECORD(iface, struct d3d10_texture3d, ID3D10Texture3D_iface); + struct d3d_texture2d *object; + HRESULT hr; + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + if (FAILED(hr = d3d_texture2d_init(object, device, desc, data))) + { + WARN("Failed to initialize texture, hr %#x.\n", hr); + HeapFree(GetProcessHeap(), 0, object); + return hr; + } + + TRACE("Created texture %p.\n", object); + *texture = object; + + return S_OK; } -static HRESULT STDMETHODCALLTYPE d3d10_texture3d_QueryInterface(ID3D10Texture3D *iface, REFIID riid, void **object) +/* ID3D11Texture3D methods */ + +static inline struct d3d_texture3d *impl_from_ID3D11Texture3D(ID3D11Texture3D *iface) +{ + return CONTAINING_RECORD(iface, struct d3d_texture3d, ID3D11Texture3D_iface); +} + +static HRESULT STDMETHODCALLTYPE d3d11_texture3d_QueryInterface(ID3D11Texture3D *iface, REFIID riid, void **object) { + struct d3d_texture3d *texture = impl_from_ID3D11Texture3D(iface); + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); - if (IsEqualGUID(riid, &IID_ID3D10Texture3D) - || IsEqualGUID(riid, &IID_ID3D10Resource) - || IsEqualGUID(riid, &IID_ID3D10DeviceChild) + if (IsEqualGUID(riid, &IID_ID3D11Texture3D) + || IsEqualGUID(riid, &IID_ID3D11Resource) + || IsEqualGUID(riid, &IID_ID3D11DeviceChild) || IsEqualGUID(riid, &IID_IUnknown)) { IUnknown_AddRef(iface); *object = iface; return S_OK; } + else if (IsEqualGUID(riid, &IID_ID3D10Texture3D) + || IsEqualGUID(riid, &IID_ID3D10Resource) + || IsEqualGUID(riid, &IID_ID3D10DeviceChild)) + { + IUnknown_AddRef(iface); + *object = &texture->ID3D10Texture3D_iface; + return S_OK; + } WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); @@ -410,16 +578,16 @@ return E_NOINTERFACE; } -static ULONG STDMETHODCALLTYPE d3d10_texture3d_AddRef(ID3D10Texture3D *iface) +static ULONG STDMETHODCALLTYPE d3d11_texture3d_AddRef(ID3D11Texture3D *iface) { - struct d3d10_texture3d *texture = impl_from_ID3D10Texture3D(iface); + struct d3d_texture3d *texture = impl_from_ID3D11Texture3D(iface); ULONG refcount = InterlockedIncrement(&texture->refcount); TRACE("%p increasing refcount to %u.\n", texture, refcount); if (refcount == 1) { - ID3D10Device1_AddRef(texture->device); + ID3D11Device_AddRef(texture->device); wined3d_mutex_lock(); wined3d_texture_incref(texture->wined3d_texture); wined3d_mutex_unlock(); @@ -428,76 +596,197 @@ return refcount; } -static void STDMETHODCALLTYPE d3d10_texture3d_wined3d_object_released(void *parent) +static void STDMETHODCALLTYPE d3d_texture3d_wined3d_object_released(void *parent) { - struct d3d10_texture3d *texture = parent; + struct d3d_texture3d *texture = parent; wined3d_private_store_cleanup(&texture->private_store); HeapFree(GetProcessHeap(), 0, parent); } -static ULONG STDMETHODCALLTYPE d3d10_texture3d_Release(ID3D10Texture3D *iface) +static ULONG STDMETHODCALLTYPE d3d11_texture3d_Release(ID3D11Texture3D *iface) { - struct d3d10_texture3d *texture = impl_from_ID3D10Texture3D(iface); + struct d3d_texture3d *texture = impl_from_ID3D11Texture3D(iface); ULONG refcount = InterlockedDecrement(&texture->refcount); TRACE("%p decreasing refcount to %u.\n", texture, refcount); if (!refcount) { - ID3D10Device1 *device = texture->device; + ID3D11Device *device = texture->device; wined3d_mutex_lock(); wined3d_texture_decref(texture->wined3d_texture); wined3d_mutex_unlock(); /* Release the device last, it may cause the wined3d device to be * destroyed. */ - ID3D10Device1_Release(device); + ID3D11Device_Release(device); } return refcount; } +static void STDMETHODCALLTYPE d3d11_texture3d_GetDevice(ID3D11Texture3D *iface, ID3D11Device **device) +{ + struct d3d_texture3d *texture = impl_from_ID3D11Texture3D(iface); + + TRACE("iface %p, device %p.\n", iface, device); + + *device = texture->device; + ID3D11Device_AddRef(*device); +} + +static HRESULT STDMETHODCALLTYPE d3d11_texture3d_GetPrivateData(ID3D11Texture3D *iface, + REFGUID guid, UINT *data_size, void *data) +{ + struct d3d_texture3d *texture = impl_from_ID3D11Texture3D(iface); + + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_get_private_data(&texture->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_texture3d_SetPrivateData(ID3D11Texture3D *iface, + REFGUID guid, UINT data_size, const void *data) +{ + struct d3d_texture3d *texture = impl_from_ID3D11Texture3D(iface); + + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_set_private_data(&texture->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_texture3d_SetPrivateDataInterface(ID3D11Texture3D *iface, + REFGUID guid, const IUnknown *data) +{ + struct d3d_texture3d *texture = impl_from_ID3D11Texture3D(iface); + + TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); + + return d3d_set_private_data_interface(&texture->private_store, guid, data); +} + +static void STDMETHODCALLTYPE d3d11_texture3d_GetType(ID3D11Texture3D *iface, + D3D11_RESOURCE_DIMENSION *resource_dimension) +{ + TRACE("iface %p, resource_dimension %p.\n", iface, resource_dimension); + + *resource_dimension = D3D11_RESOURCE_DIMENSION_TEXTURE3D; +} + +static void STDMETHODCALLTYPE d3d11_texture3d_SetEvictionPriority(ID3D11Texture3D *iface, UINT eviction_priority) +{ + FIXME("iface %p, eviction_priority %#x stub!\n", iface, eviction_priority); +} + +static UINT STDMETHODCALLTYPE d3d11_texture3d_GetEvictionPriority(ID3D11Texture3D *iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +static void STDMETHODCALLTYPE d3d11_texture3d_GetDesc(ID3D11Texture3D *iface, D3D11_TEXTURE3D_DESC *desc) +{ + struct d3d_texture3d *texture = impl_from_ID3D11Texture3D(iface); + + TRACE("iface %p, desc %p.\n", iface, desc); + + *desc = texture->desc; +} + +static const struct ID3D11Texture3DVtbl d3d11_texture3d_vtbl = +{ + /* IUnknown methods */ + d3d11_texture3d_QueryInterface, + d3d11_texture3d_AddRef, + d3d11_texture3d_Release, + /* ID3D11DeviceChild methods */ + d3d11_texture3d_GetDevice, + d3d11_texture3d_GetPrivateData, + d3d11_texture3d_SetPrivateData, + d3d11_texture3d_SetPrivateDataInterface, + /* ID3D11Resource methods */ + d3d11_texture3d_GetType, + d3d11_texture3d_SetEvictionPriority, + d3d11_texture3d_GetEvictionPriority, + /* ID3D11Texture3D methods */ + d3d11_texture3d_GetDesc, +}; + +/* ID3D10Texture3D methods */ + +static inline struct d3d_texture3d *impl_from_ID3D10Texture3D(ID3D10Texture3D *iface) +{ + return CONTAINING_RECORD(iface, struct d3d_texture3d, ID3D10Texture3D_iface); +} + +static HRESULT STDMETHODCALLTYPE d3d10_texture3d_QueryInterface(ID3D10Texture3D *iface, REFIID riid, void **object) +{ + struct d3d_texture3d *texture = impl_from_ID3D10Texture3D(iface); + + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + + return d3d11_texture3d_QueryInterface(&texture->ID3D11Texture3D_iface, riid, object); +} + +static ULONG STDMETHODCALLTYPE d3d10_texture3d_AddRef(ID3D10Texture3D *iface) +{ + struct d3d_texture3d *texture = impl_from_ID3D10Texture3D(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_texture3d_AddRef(&texture->ID3D11Texture3D_iface); +} + +static ULONG STDMETHODCALLTYPE d3d10_texture3d_Release(ID3D10Texture3D *iface) +{ + struct d3d_texture3d *texture = impl_from_ID3D10Texture3D(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_texture3d_Release(&texture->ID3D11Texture3D_iface); +} + static void STDMETHODCALLTYPE d3d10_texture3d_GetDevice(ID3D10Texture3D *iface, ID3D10Device **device) { - struct d3d10_texture3d *texture = impl_from_ID3D10Texture3D(iface); + struct d3d_texture3d *texture = impl_from_ID3D10Texture3D(iface); TRACE("iface %p, device %p.\n", iface, device); - *device = (ID3D10Device *)texture->device; - ID3D10Device_AddRef(*device); + ID3D11Device_QueryInterface(texture->device, &IID_ID3D10Device, (void **)device); } static HRESULT STDMETHODCALLTYPE d3d10_texture3d_GetPrivateData(ID3D10Texture3D *iface, REFGUID guid, UINT *data_size, void *data) { - struct d3d10_texture3d *texture = impl_from_ID3D10Texture3D(iface); + struct d3d_texture3d *texture = impl_from_ID3D10Texture3D(iface); TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_get_private_data(&texture->private_store, guid, data_size, data); + return d3d_get_private_data(&texture->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d10_texture3d_SetPrivateData(ID3D10Texture3D *iface, REFGUID guid, UINT data_size, const void *data) { - struct d3d10_texture3d *texture = impl_from_ID3D10Texture3D(iface); + struct d3d_texture3d *texture = impl_from_ID3D10Texture3D(iface); TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_set_private_data(&texture->private_store, guid, data_size, data); + return d3d_set_private_data(&texture->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d10_texture3d_SetPrivateDataInterface(ID3D10Texture3D *iface, REFGUID guid, const IUnknown *data) { - struct d3d10_texture3d *texture = impl_from_ID3D10Texture3D(iface); + struct d3d_texture3d *texture = impl_from_ID3D10Texture3D(iface); TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); - return d3d10_set_private_data_interface(&texture->private_store, guid, data); + return d3d_set_private_data_interface(&texture->private_store, guid, data); } static void STDMETHODCALLTYPE d3d10_texture3d_GetType(ID3D10Texture3D *iface, @@ -523,9 +812,8 @@ static HRESULT STDMETHODCALLTYPE d3d10_texture3d_Map(ID3D10Texture3D *iface, UINT sub_resource_idx, D3D10_MAP map_type, UINT map_flags, D3D10_MAPPED_TEXTURE3D *mapped_texture) { - struct d3d10_texture3d *texture = impl_from_ID3D10Texture3D(iface); + struct d3d_texture3d *texture = impl_from_ID3D10Texture3D(iface); struct wined3d_map_desc wined3d_map_desc; - struct wined3d_resource *sub_resource; HRESULT hr; TRACE("iface %p, sub_resource_idx %u, map_type %u, map_flags %#x, mapped_texture %p.\n", @@ -535,10 +823,8 @@ FIXME("Ignoring map_flags %#x.\n", map_flags); wined3d_mutex_lock(); - if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, sub_resource_idx))) - hr = E_INVALIDARG; - else if (SUCCEEDED(hr = wined3d_volume_map(wined3d_volume_from_resource(sub_resource), - &wined3d_map_desc, NULL, wined3d_map_flags_from_d3d10_map_type(map_type)))) + if (SUCCEEDED(hr = wined3d_resource_map(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx, + &wined3d_map_desc, NULL, wined3d_map_flags_from_d3d11_map_type(map_type)))) { mapped_texture->pData = wined3d_map_desc.data; mapped_texture->RowPitch = wined3d_map_desc.row_pitch; @@ -551,29 +837,33 @@ static void STDMETHODCALLTYPE d3d10_texture3d_Unmap(ID3D10Texture3D *iface, UINT sub_resource_idx) { - struct d3d10_texture3d *texture = impl_from_ID3D10Texture3D(iface); - struct wined3d_resource *sub_resource; + struct d3d_texture3d *texture = impl_from_ID3D10Texture3D(iface); TRACE("iface %p, sub_resource_idx %u.\n", iface, sub_resource_idx); wined3d_mutex_lock(); - if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, sub_resource_idx))) - { - wined3d_mutex_unlock(); - return; - } - - wined3d_volume_unmap(wined3d_volume_from_resource(sub_resource)); + wined3d_resource_unmap(wined3d_texture_get_resource(texture->wined3d_texture), sub_resource_idx); wined3d_mutex_unlock(); } static void STDMETHODCALLTYPE d3d10_texture3d_GetDesc(ID3D10Texture3D *iface, D3D10_TEXTURE3D_DESC *desc) { - struct d3d10_texture3d *texture = impl_from_ID3D10Texture3D(iface); + struct d3d_texture3d *texture = impl_from_ID3D10Texture3D(iface); + D3D11_TEXTURE3D_DESC d3d11_desc; TRACE("iface %p, desc %p.\n", iface, desc); - *desc = texture->desc; + d3d11_texture3d_GetDesc(&texture->ID3D11Texture3D_iface, &d3d11_desc); + + desc->Width = d3d11_desc.Width; + desc->Height = d3d11_desc.Height; + desc->Depth = d3d11_desc.Depth; + desc->MipLevels = d3d11_desc.MipLevels; + desc->Format = d3d11_desc.Format; + desc->Usage = d3d10_usage_from_d3d11_usage(d3d11_desc.Usage); + desc->BindFlags = d3d10_bind_flags_from_d3d11_bind_flags(d3d11_desc.BindFlags); + desc->CPUAccessFlags = d3d10_cpu_access_flags_from_d3d11_cpu_access_flags(d3d11_desc.CPUAccessFlags); + desc->MiscFlags = d3d10_resource_misc_flags_from_d3d11_resource_misc_flags(d3d11_desc.MiscFlags); } static const struct ID3D10Texture3DVtbl d3d10_texture3d_vtbl = @@ -597,18 +887,27 @@ d3d10_texture3d_GetDesc, }; -static const struct wined3d_parent_ops d3d10_texture3d_wined3d_parent_ops = +struct d3d_texture3d *unsafe_impl_from_ID3D11Texture3D(ID3D11Texture3D *iface) { - d3d10_texture3d_wined3d_object_released, + if (!iface) + return NULL; + assert(iface->lpVtbl == &d3d11_texture3d_vtbl); + return impl_from_ID3D11Texture3D(iface); +} + +static const struct wined3d_parent_ops d3d_texture3d_wined3d_parent_ops = +{ + d3d_texture3d_wined3d_object_released, }; -HRESULT d3d10_texture3d_init(struct d3d10_texture3d *texture, struct d3d_device *device, - const D3D10_TEXTURE3D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data) +static HRESULT d3d_texture3d_init(struct d3d_texture3d *texture, struct d3d_device *device, + const D3D11_TEXTURE3D_DESC *desc, const D3D11_SUBRESOURCE_DATA *data) { struct wined3d_resource_desc wined3d_desc; unsigned int levels; HRESULT hr; + texture->ID3D11Texture3D_iface.lpVtbl = &d3d11_texture3d_vtbl; texture->ID3D10Texture3D_iface.lpVtbl = &d3d10_texture3d_vtbl; texture->refcount = 1; wined3d_mutex_lock(); @@ -619,7 +918,7 @@ wined3d_desc.format = wined3dformat_from_dxgi_format(desc->Format); wined3d_desc.multisample_type = WINED3D_MULTISAMPLE_NONE; wined3d_desc.multisample_quality = 0; - wined3d_desc.usage = wined3d_usage_from_d3d10core(desc->BindFlags, desc->Usage); + wined3d_desc.usage = wined3d_usage_from_d3d11(desc->BindFlags, desc->Usage); wined3d_desc.pool = WINED3D_POOL_DEFAULT; wined3d_desc.width = desc->Width; wined3d_desc.height = desc->Height; @@ -630,7 +929,7 @@ if (FAILED(hr = wined3d_texture_create(device->wined3d_device, &wined3d_desc, levels, 0, (struct wined3d_sub_resource_data *)data, texture, - &d3d10_texture3d_wined3d_parent_ops, &texture->wined3d_texture))) + &d3d_texture3d_wined3d_parent_ops, &texture->wined3d_texture))) { WARN("Failed to create wined3d texture, hr %#x.\n", hr); wined3d_private_store_cleanup(&texture->private_store); @@ -640,8 +939,30 @@ wined3d_mutex_unlock(); texture->desc.MipLevels = levels; - texture->device = &device->ID3D10Device1_iface; - ID3D10Device1_AddRef(texture->device); + texture->device = &device->ID3D11Device_iface; + ID3D11Device_AddRef(texture->device); + + return S_OK; +} + +HRESULT d3d_texture3d_create(struct d3d_device *device, const D3D11_TEXTURE3D_DESC *desc, + const D3D11_SUBRESOURCE_DATA *data, struct d3d_texture3d **texture) +{ + struct d3d_texture3d *object; + HRESULT hr; + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + if (FAILED(hr = d3d_texture3d_init(object, device, desc, data))) + { + WARN("Failed to initialize texture, hr %#x.\n", hr); + HeapFree(GetProcessHeap(), 0, object); + return hr; + } + + TRACE("Created texture %p.\n", object); + *texture = object; return S_OK; } diff -Nru wine1.7-1.7.50/dlls/d3d11/utils.c wine1.7-1.7.55/dlls/d3d11/utils.c --- wine1.7-1.7.50/dlls/d3d11/utils.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d11/utils.c 2015-11-13 14:32:40.000000000 +0000 @@ -345,29 +345,190 @@ } } -DWORD wined3d_usage_from_d3d10core(UINT bind_flags, enum D3D10_USAGE usage) +DWORD wined3d_usage_from_d3d11(UINT bind_flags, enum D3D11_USAGE usage) { - static const DWORD handled = D3D10_BIND_SHADER_RESOURCE - | D3D10_BIND_RENDER_TARGET - | D3D10_BIND_DEPTH_STENCIL; + static const DWORD handled = D3D11_BIND_SHADER_RESOURCE + | D3D11_BIND_RENDER_TARGET + | D3D11_BIND_DEPTH_STENCIL; DWORD wined3d_usage = 0; - if (bind_flags & D3D10_BIND_SHADER_RESOURCE) + if (bind_flags & D3D11_BIND_SHADER_RESOURCE) wined3d_usage |= WINED3DUSAGE_TEXTURE; - if (bind_flags & D3D10_BIND_RENDER_TARGET) + if (bind_flags & D3D11_BIND_RENDER_TARGET) wined3d_usage |= WINED3DUSAGE_RENDERTARGET; - if (bind_flags & D3D10_BIND_DEPTH_STENCIL) + if (bind_flags & D3D11_BIND_DEPTH_STENCIL) wined3d_usage |= WINED3DUSAGE_DEPTHSTENCIL; if (bind_flags & ~handled) FIXME("Unhandled bind flags %#x.\n", usage & ~handled); - if (usage == D3D10_USAGE_DYNAMIC) + if (usage == D3D11_USAGE_DYNAMIC) wined3d_usage |= WINED3DUSAGE_DYNAMIC; return wined3d_usage; } -struct wined3d_resource *wined3d_resource_from_resource(ID3D10Resource *resource) +enum D3D11_USAGE d3d11_usage_from_d3d10_usage(enum D3D10_USAGE usage) +{ + switch (usage) + { + case D3D10_USAGE_DEFAULT: return D3D11_USAGE_DEFAULT; + case D3D10_USAGE_IMMUTABLE: return D3D11_USAGE_IMMUTABLE; + case D3D10_USAGE_DYNAMIC: return D3D11_USAGE_DYNAMIC; + case D3D10_USAGE_STAGING: return D3D11_USAGE_STAGING; + default: + FIXME("Unhandled usage %#x.\n", usage); + return D3D11_USAGE_DEFAULT; + } +} + +enum D3D10_USAGE d3d10_usage_from_d3d11_usage(enum D3D11_USAGE usage) +{ + switch (usage) + { + case D3D11_USAGE_DEFAULT: return D3D10_USAGE_DEFAULT; + case D3D11_USAGE_IMMUTABLE: return D3D10_USAGE_IMMUTABLE; + case D3D11_USAGE_DYNAMIC: return D3D10_USAGE_DYNAMIC; + case D3D11_USAGE_STAGING: return D3D10_USAGE_STAGING; + default: + FIXME("Unhandled usage %#x.\n", usage); + return D3D10_USAGE_DEFAULT; + } +} + +UINT d3d11_bind_flags_from_d3d10_bind_flags(UINT bind_flags) +{ + static const UINT handled_flags = D3D10_BIND_VERTEX_BUFFER + | D3D10_BIND_INDEX_BUFFER + | D3D10_BIND_CONSTANT_BUFFER + | D3D10_BIND_SHADER_RESOURCE + | D3D10_BIND_STREAM_OUTPUT + | D3D10_BIND_RENDER_TARGET + | D3D10_BIND_DEPTH_STENCIL; + UINT d3d11_bind_flags = bind_flags & handled_flags; + + if (bind_flags & ~handled_flags) + FIXME("Unhandled bind flags %#x.\n", bind_flags & ~handled_flags); + + return d3d11_bind_flags; +} + +UINT d3d10_bind_flags_from_d3d11_bind_flags(UINT bind_flags) +{ + static const UINT handled_flags = D3D11_BIND_VERTEX_BUFFER + | D3D11_BIND_INDEX_BUFFER + | D3D11_BIND_CONSTANT_BUFFER + | D3D11_BIND_SHADER_RESOURCE + | D3D11_BIND_STREAM_OUTPUT + | D3D11_BIND_RENDER_TARGET + | D3D11_BIND_DEPTH_STENCIL + | D3D11_BIND_UNORDERED_ACCESS + | D3D11_BIND_DECODER + | D3D11_BIND_VIDEO_ENCODER; + UINT d3d10_bind_flags = bind_flags & handled_flags; + + if (bind_flags & ~handled_flags) + FIXME("Unhandled bind flags %#x.\n", bind_flags & ~handled_flags); + + return d3d10_bind_flags; +} + +UINT d3d11_cpu_access_flags_from_d3d10_cpu_access_flags(UINT cpu_access_flags) +{ + static const UINT handled_flags = D3D10_CPU_ACCESS_WRITE + | D3D10_CPU_ACCESS_READ; + UINT d3d11_cpu_access_flags = cpu_access_flags & handled_flags; + + if (cpu_access_flags & ~handled_flags) + FIXME("Unhandled cpu access flags %#x.\n", cpu_access_flags & ~handled_flags); + + return d3d11_cpu_access_flags; +} + +UINT d3d10_cpu_access_flags_from_d3d11_cpu_access_flags(UINT cpu_access_flags) +{ + static const UINT handled_flags = D3D11_CPU_ACCESS_WRITE + | D3D11_CPU_ACCESS_READ; + UINT d3d10_cpu_access_flags = cpu_access_flags & handled_flags; + + if (cpu_access_flags & ~handled_flags) + FIXME("Unhandled cpu access flags %#x.\n", cpu_access_flags & ~handled_flags); + + return d3d10_cpu_access_flags; +} + +UINT d3d11_resource_misc_flags_from_d3d10_resource_misc_flags(UINT resource_misc_flags) +{ + static const UINT bitwise_identical_flags = D3D10_RESOURCE_MISC_GENERATE_MIPS + | D3D10_RESOURCE_MISC_SHARED + | D3D10_RESOURCE_MISC_TEXTURECUBE; + const UINT handled_flags = bitwise_identical_flags + | D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX + | D3D10_RESOURCE_MISC_GDI_COMPATIBLE; + UINT d3d11_resource_misc_flags = resource_misc_flags & bitwise_identical_flags; + + if (resource_misc_flags & D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX) + d3d11_resource_misc_flags |= D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX; + if (resource_misc_flags & D3D10_RESOURCE_MISC_GDI_COMPATIBLE) + d3d11_resource_misc_flags |= D3D11_RESOURCE_MISC_GDI_COMPATIBLE; + + if (resource_misc_flags & ~handled_flags) + FIXME("Unhandled resource misc flags %#x.\n", resource_misc_flags & ~handled_flags); + + return d3d11_resource_misc_flags; +} + +UINT d3d10_resource_misc_flags_from_d3d11_resource_misc_flags(UINT resource_misc_flags) +{ + static const UINT bitwise_identical_flags = D3D11_RESOURCE_MISC_GENERATE_MIPS + | D3D11_RESOURCE_MISC_SHARED + | D3D11_RESOURCE_MISC_TEXTURECUBE; + const UINT handled_flags = bitwise_identical_flags + | D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS + | D3D11_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS + | D3D11_RESOURCE_MISC_BUFFER_STRUCTURED + | D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX + | D3D11_RESOURCE_MISC_GDI_COMPATIBLE + | D3D11_RESOURCE_MISC_SHARED_NTHANDLE; + UINT d3d10_resource_misc_flags = resource_misc_flags & bitwise_identical_flags; + + if (resource_misc_flags & D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX) + d3d10_resource_misc_flags |= D3D10_RESOURCE_MISC_SHARED_KEYEDMUTEX; + if (resource_misc_flags & D3D11_RESOURCE_MISC_GDI_COMPATIBLE) + d3d10_resource_misc_flags |= D3D10_RESOURCE_MISC_GDI_COMPATIBLE; + + if (resource_misc_flags & ~handled_flags) + FIXME("Unhandled resource misc flags #%x.\n", resource_misc_flags & ~handled_flags); + + return d3d10_resource_misc_flags; +} + +struct wined3d_resource *wined3d_resource_from_d3d11_resource(ID3D11Resource *resource) +{ + D3D11_RESOURCE_DIMENSION dimension; + + ID3D11Resource_GetType(resource, &dimension); + + switch (dimension) + { + case D3D11_RESOURCE_DIMENSION_BUFFER: + return wined3d_buffer_get_resource(unsafe_impl_from_ID3D11Buffer( + (ID3D11Buffer *)resource)->wined3d_buffer); + + case D3D11_RESOURCE_DIMENSION_TEXTURE2D: + return wined3d_texture_get_resource(unsafe_impl_from_ID3D11Texture2D( + (ID3D11Texture2D *)resource)->wined3d_texture); + + case D3D11_RESOURCE_DIMENSION_TEXTURE3D: + return wined3d_texture_get_resource(unsafe_impl_from_ID3D11Texture3D( + (ID3D11Texture3D *)resource)->wined3d_texture); + + default: + FIXME("Unhandled resource dimension %#x.\n", dimension); + return NULL; + } +} + +struct wined3d_resource *wined3d_resource_from_d3d10_resource(ID3D10Resource *resource) { D3D10_RESOURCE_DIMENSION dimension; @@ -389,20 +550,20 @@ } } -DWORD wined3d_map_flags_from_d3d10_map_type(D3D10_MAP map_type) +DWORD wined3d_map_flags_from_d3d11_map_type(D3D11_MAP map_type) { switch (map_type) { - case D3D10_MAP_READ_WRITE: + case D3D11_MAP_READ_WRITE: return 0; - case D3D10_MAP_READ: + case D3D11_MAP_READ: return WINED3D_MAP_READONLY; - case D3D10_MAP_WRITE_DISCARD: + case D3D11_MAP_WRITE_DISCARD: return WINED3D_MAP_DISCARD; - case D3D10_MAP_WRITE_NO_OVERWRITE: + case D3D11_MAP_WRITE_NO_OVERWRITE: return WINED3D_MAP_NOOVERWRITE; default: @@ -411,7 +572,7 @@ } } -HRESULT d3d10_get_private_data(struct wined3d_private_store *store, +HRESULT d3d_get_private_data(struct wined3d_private_store *store, REFGUID guid, UINT *data_size, void *data) { const struct wined3d_private_data *stored_data; @@ -449,7 +610,7 @@ return S_OK; } -HRESULT d3d10_set_private_data(struct wined3d_private_store *store, +HRESULT d3d_set_private_data(struct wined3d_private_store *store, REFGUID guid, UINT data_size, const void *data) { struct wined3d_private_data *entry; @@ -475,13 +636,13 @@ return hr; } -HRESULT d3d10_set_private_data_interface(struct wined3d_private_store *store, +HRESULT d3d_set_private_data_interface(struct wined3d_private_store *store, REFGUID guid, const IUnknown *object) { HRESULT hr; if (!object) - return d3d10_set_private_data(store, guid, sizeof(object), &object); + return d3d_set_private_data(store, guid, sizeof(object), &object); wined3d_mutex_lock(); hr = wined3d_private_store_set_private_data(store, diff -Nru wine1.7-1.7.50/dlls/d3d11/view.c wine1.7-1.7.55/dlls/d3d11/view.c --- wine1.7-1.7.50/dlls/d3d11/view.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d11/view.c 2015-11-13 14:32:40.000000000 +0000 @@ -25,37 +25,39 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d11); -static HRESULT set_dsdesc_from_resource(D3D10_DEPTH_STENCIL_VIEW_DESC *desc, ID3D10Resource *resource) +static HRESULT set_dsdesc_from_resource(D3D11_DEPTH_STENCIL_VIEW_DESC *desc, ID3D11Resource *resource) { - D3D10_RESOURCE_DIMENSION dimension; + D3D11_RESOURCE_DIMENSION dimension; - ID3D10Resource_GetType(resource, &dimension); + ID3D11Resource_GetType(resource, &dimension); + + desc->Flags = 0; switch (dimension) { - case D3D10_RESOURCE_DIMENSION_TEXTURE1D: + case D3D11_RESOURCE_DIMENSION_TEXTURE1D: { - D3D10_TEXTURE1D_DESC texture_desc; - ID3D10Texture1D *texture; + D3D11_TEXTURE1D_DESC texture_desc; + ID3D11Texture1D *texture; - if (FAILED(ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture1D, (void **)&texture))) + if (FAILED(ID3D11Resource_QueryInterface(resource, &IID_ID3D11Texture1D, (void **)&texture))) { - ERR("Resource of type TEXTURE1D doesn't implement ID3D10Texture1D.\n"); + ERR("Resource of type TEXTURE1D doesn't implement ID3D11Texture1D.\n"); return E_INVALIDARG; } - ID3D10Texture1D_GetDesc(texture, &texture_desc); - ID3D10Texture1D_Release(texture); + ID3D11Texture1D_GetDesc(texture, &texture_desc); + ID3D11Texture1D_Release(texture); desc->Format = texture_desc.Format; if (texture_desc.ArraySize == 1) { - desc->ViewDimension = D3D10_DSV_DIMENSION_TEXTURE1D; + desc->ViewDimension = D3D11_DSV_DIMENSION_TEXTURE1D; desc->u.Texture1D.MipSlice = 0; } else { - desc->ViewDimension = D3D10_DSV_DIMENSION_TEXTURE1DARRAY; + desc->ViewDimension = D3D11_DSV_DIMENSION_TEXTURE1DARRAY; desc->u.Texture1DArray.MipSlice = 0; desc->u.Texture1DArray.FirstArraySlice = 0; desc->u.Texture1DArray.ArraySize = 1; @@ -64,45 +66,45 @@ return S_OK; } - case D3D10_RESOURCE_DIMENSION_TEXTURE2D: + case D3D11_RESOURCE_DIMENSION_TEXTURE2D: { - D3D10_TEXTURE2D_DESC texture_desc; - ID3D10Texture2D *texture; + D3D11_TEXTURE2D_DESC texture_desc; + ID3D11Texture2D *texture; - if (FAILED(ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture2D, (void **)&texture))) + if (FAILED(ID3D11Resource_QueryInterface(resource, &IID_ID3D11Texture2D, (void **)&texture))) { - ERR("Resource of type TEXTURE2D doesn't implement ID3D10Texture2D.\n"); + ERR("Resource of type TEXTURE2D doesn't implement ID3D11Texture2D.\n"); return E_INVALIDARG; } - ID3D10Texture2D_GetDesc(texture, &texture_desc); - ID3D10Texture2D_Release(texture); + ID3D11Texture2D_GetDesc(texture, &texture_desc); + ID3D11Texture2D_Release(texture); desc->Format = texture_desc.Format; if (texture_desc.ArraySize == 1) { if (texture_desc.SampleDesc.Count == 1) { - desc->ViewDimension = D3D10_DSV_DIMENSION_TEXTURE2D; + desc->ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D; desc->u.Texture2D.MipSlice = 0; } else { - desc->ViewDimension = D3D10_DSV_DIMENSION_TEXTURE2DMS; + desc->ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2DMS; } } else { if (texture_desc.SampleDesc.Count == 1) { - desc->ViewDimension = D3D10_DSV_DIMENSION_TEXTURE2DARRAY; + desc->ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2DARRAY; desc->u.Texture2DArray.MipSlice = 0; desc->u.Texture2DArray.FirstArraySlice = 0; desc->u.Texture2DArray.ArraySize = 1; } else { - desc->ViewDimension = D3D10_DSV_DIMENSION_TEXTURE2DMSARRAY; + desc->ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY; desc->u.Texture2DMSArray.FirstArraySlice = 0; desc->u.Texture2DMSArray.ArraySize = 1; } @@ -113,45 +115,45 @@ default: FIXME("Unhandled resource dimension %#x.\n", dimension); - case D3D10_RESOURCE_DIMENSION_BUFFER: - case D3D10_RESOURCE_DIMENSION_TEXTURE3D: + case D3D11_RESOURCE_DIMENSION_BUFFER: + case D3D11_RESOURCE_DIMENSION_TEXTURE3D: return E_INVALIDARG; } } -static HRESULT set_rtdesc_from_resource(D3D10_RENDER_TARGET_VIEW_DESC *desc, ID3D10Resource *resource) +static HRESULT set_rtdesc_from_resource(D3D11_RENDER_TARGET_VIEW_DESC *desc, ID3D11Resource *resource) { - D3D10_RESOURCE_DIMENSION dimension; + D3D11_RESOURCE_DIMENSION dimension; HRESULT hr; - ID3D10Resource_GetType(resource, &dimension); + ID3D11Resource_GetType(resource, &dimension); switch(dimension) { - case D3D10_RESOURCE_DIMENSION_TEXTURE1D: + case D3D11_RESOURCE_DIMENSION_TEXTURE1D: { - ID3D10Texture1D *texture; - D3D10_TEXTURE1D_DESC texture_desc; + ID3D11Texture1D *texture; + D3D11_TEXTURE1D_DESC texture_desc; - hr = ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture1D, (void **)&texture); + hr = ID3D11Resource_QueryInterface(resource, &IID_ID3D11Texture1D, (void **)&texture); if (FAILED(hr)) { - ERR("Resource of type TEXTURE1D doesn't implement ID3D10Texture1D?\n"); + ERR("Resource of type TEXTURE1D doesn't implement ID3D11Texture1D?\n"); return E_INVALIDARG; } - ID3D10Texture1D_GetDesc(texture, &texture_desc); - ID3D10Texture1D_Release(texture); + ID3D11Texture1D_GetDesc(texture, &texture_desc); + ID3D11Texture1D_Release(texture); desc->Format = texture_desc.Format; if (texture_desc.ArraySize == 1) { - desc->ViewDimension = D3D10_RTV_DIMENSION_TEXTURE1D; + desc->ViewDimension = D3D11_RTV_DIMENSION_TEXTURE1D; desc->u.Texture1D.MipSlice = 0; } else { - desc->ViewDimension = D3D10_RTV_DIMENSION_TEXTURE1DARRAY; + desc->ViewDimension = D3D11_RTV_DIMENSION_TEXTURE1DARRAY; desc->u.Texture1DArray.MipSlice = 0; desc->u.Texture1DArray.FirstArraySlice = 0; desc->u.Texture1DArray.ArraySize = 1; @@ -160,46 +162,46 @@ return S_OK; } - case D3D10_RESOURCE_DIMENSION_TEXTURE2D: + case D3D11_RESOURCE_DIMENSION_TEXTURE2D: { - ID3D10Texture2D *texture; - D3D10_TEXTURE2D_DESC texture_desc; + ID3D11Texture2D *texture; + D3D11_TEXTURE2D_DESC texture_desc; - hr = ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture2D, (void **)&texture); + hr = ID3D11Resource_QueryInterface(resource, &IID_ID3D11Texture2D, (void **)&texture); if (FAILED(hr)) { - ERR("Resource of type TEXTURE2D doesn't implement ID3D10Texture2D?\n"); + ERR("Resource of type TEXTURE2D doesn't implement ID3D11Texture2D?\n"); return E_INVALIDARG; } - ID3D10Texture2D_GetDesc(texture, &texture_desc); - ID3D10Texture2D_Release(texture); + ID3D11Texture2D_GetDesc(texture, &texture_desc); + ID3D11Texture2D_Release(texture); desc->Format = texture_desc.Format; if (texture_desc.ArraySize == 1) { if (texture_desc.SampleDesc.Count == 1) { - desc->ViewDimension = D3D10_RTV_DIMENSION_TEXTURE2D; + desc->ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D; desc->u.Texture2D.MipSlice = 0; } else { - desc->ViewDimension = D3D10_RTV_DIMENSION_TEXTURE2DMS; + desc->ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2DMS; } } else { if (texture_desc.SampleDesc.Count == 1) { - desc->ViewDimension = D3D10_RTV_DIMENSION_TEXTURE2DARRAY; + desc->ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2DARRAY; desc->u.Texture2DArray.MipSlice = 0; desc->u.Texture2DArray.FirstArraySlice = 0; desc->u.Texture2DArray.ArraySize = 1; } else { - desc->ViewDimension = D3D10_RTV_DIMENSION_TEXTURE2DMSARRAY; + desc->ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY; desc->u.Texture2DMSArray.FirstArraySlice = 0; desc->u.Texture2DMSArray.ArraySize = 1; } @@ -208,23 +210,23 @@ return S_OK; } - case D3D10_RESOURCE_DIMENSION_TEXTURE3D: + case D3D11_RESOURCE_DIMENSION_TEXTURE3D: { - ID3D10Texture3D *texture; - D3D10_TEXTURE3D_DESC texture_desc; + ID3D11Texture3D *texture; + D3D11_TEXTURE3D_DESC texture_desc; - hr = ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture3D, (void **)&texture); + hr = ID3D11Resource_QueryInterface(resource, &IID_ID3D11Texture3D, (void **)&texture); if (FAILED(hr)) { - ERR("Resource of type TEXTURE3D doesn't implement ID3D10Texture3D?\n"); + ERR("Resource of type TEXTURE3D doesn't implement ID3D11Texture3D?\n"); return E_INVALIDARG; } - ID3D10Texture3D_GetDesc(texture, &texture_desc); - ID3D10Texture3D_Release(texture); + ID3D11Texture3D_GetDesc(texture, &texture_desc); + ID3D11Texture3D_Release(texture); desc->Format = texture_desc.Format; - desc->ViewDimension = D3D10_RTV_DIMENSION_TEXTURE3D; + desc->ViewDimension = D3D11_RTV_DIMENSION_TEXTURE3D; desc->u.Texture3D.MipSlice = 0; desc->u.Texture3D.FirstWSlice = 0; desc->u.Texture3D.WSize = 1; @@ -238,38 +240,38 @@ } } -static HRESULT set_srdesc_from_resource(D3D10_SHADER_RESOURCE_VIEW_DESC *desc, ID3D10Resource *resource) +static HRESULT set_srdesc_from_resource(D3D11_SHADER_RESOURCE_VIEW_DESC *desc, ID3D11Resource *resource) { - D3D10_RESOURCE_DIMENSION dimension; + D3D11_RESOURCE_DIMENSION dimension; - ID3D10Resource_GetType(resource, &dimension); + ID3D11Resource_GetType(resource, &dimension); switch (dimension) { - case D3D10_RESOURCE_DIMENSION_TEXTURE1D: + case D3D11_RESOURCE_DIMENSION_TEXTURE1D: { - D3D10_TEXTURE1D_DESC texture_desc; - ID3D10Texture1D *texture; + D3D11_TEXTURE1D_DESC texture_desc; + ID3D11Texture1D *texture; - if (FAILED(ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture1D, (void **)&texture))) + if (FAILED(ID3D11Resource_QueryInterface(resource, &IID_ID3D11Texture1D, (void **)&texture))) { - ERR("Resource of type TEXTURE1D doesn't implement ID3D10Texture1D.\n"); + ERR("Resource of type TEXTURE1D doesn't implement ID3D11Texture1D.\n"); return E_INVALIDARG; } - ID3D10Texture1D_GetDesc(texture, &texture_desc); - ID3D10Texture1D_Release(texture); + ID3D11Texture1D_GetDesc(texture, &texture_desc); + ID3D11Texture1D_Release(texture); desc->Format = texture_desc.Format; if (texture_desc.ArraySize == 1) { - desc->ViewDimension = D3D10_SRV_DIMENSION_TEXTURE1D; + desc->ViewDimension = D3D11_SRV_DIMENSION_TEXTURE1D; desc->u.Texture1D.MostDetailedMip = 0; desc->u.Texture1D.MipLevels = texture_desc.MipLevels; } else { - desc->ViewDimension = D3D10_SRV_DIMENSION_TEXTURE1DARRAY; + desc->ViewDimension = D3D11_SRV_DIMENSION_TEXTURE1DARRAY; desc->u.Texture1DArray.MostDetailedMip = 0; desc->u.Texture1DArray.MipLevels = texture_desc.MipLevels; desc->u.Texture1DArray.FirstArraySlice = 0; @@ -279,39 +281,39 @@ return S_OK; } - case D3D10_RESOURCE_DIMENSION_TEXTURE2D: + case D3D11_RESOURCE_DIMENSION_TEXTURE2D: { - D3D10_TEXTURE2D_DESC texture_desc; - ID3D10Texture2D *texture; + D3D11_TEXTURE2D_DESC texture_desc; + ID3D11Texture2D *texture; - if (FAILED(ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture2D, (void **)&texture))) + if (FAILED(ID3D11Resource_QueryInterface(resource, &IID_ID3D11Texture2D, (void **)&texture))) { - ERR("Resource of type TEXTURE2D doesn't implement ID3D10Texture2D.\n"); + ERR("Resource of type TEXTURE2D doesn't implement ID3D11Texture2D.\n"); return E_INVALIDARG; } - ID3D10Texture2D_GetDesc(texture, &texture_desc); - ID3D10Texture2D_Release(texture); + ID3D11Texture2D_GetDesc(texture, &texture_desc); + ID3D11Texture2D_Release(texture); desc->Format = texture_desc.Format; if (texture_desc.ArraySize == 1) { if (texture_desc.SampleDesc.Count == 1) { - desc->ViewDimension = D3D10_SRV_DIMENSION_TEXTURE2D; + desc->ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D; desc->u.Texture2D.MostDetailedMip = 0; desc->u.Texture2D.MipLevels = texture_desc.MipLevels; } else { - desc->ViewDimension = D3D10_SRV_DIMENSION_TEXTURE2DMS; + desc->ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2DMS; } } else { if (texture_desc.SampleDesc.Count == 1) { - desc->ViewDimension = D3D10_SRV_DIMENSION_TEXTURE2DARRAY; + desc->ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2DARRAY; desc->u.Texture2DArray.MostDetailedMip = 0; desc->u.Texture2DArray.MipLevels = texture_desc.MipLevels; desc->u.Texture2DArray.FirstArraySlice = 0; @@ -319,7 +321,7 @@ } else { - desc->ViewDimension = D3D10_SRV_DIMENSION_TEXTURE2DMSARRAY; + desc->ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY; desc->u.Texture2DMSArray.FirstArraySlice = 0; desc->u.Texture2DMSArray.ArraySize = texture_desc.ArraySize; } @@ -328,22 +330,22 @@ return S_OK; } - case D3D10_RESOURCE_DIMENSION_TEXTURE3D: + case D3D11_RESOURCE_DIMENSION_TEXTURE3D: { - D3D10_TEXTURE3D_DESC texture_desc; - ID3D10Texture3D *texture; + D3D11_TEXTURE3D_DESC texture_desc; + ID3D11Texture3D *texture; - if (FAILED(ID3D10Resource_QueryInterface(resource, &IID_ID3D10Texture3D, (void **)&texture))) + if (FAILED(ID3D11Resource_QueryInterface(resource, &IID_ID3D11Texture3D, (void **)&texture))) { - ERR("Resource of type TEXTURE3D doesn't implement ID3D10Texture3D.\n"); + ERR("Resource of type TEXTURE3D doesn't implement ID3D11Texture3D.\n"); return E_INVALIDARG; } - ID3D10Texture3D_GetDesc(texture, &texture_desc); - ID3D10Texture3D_Release(texture); + ID3D11Texture3D_GetDesc(texture, &texture_desc); + ID3D11Texture3D_Release(texture); desc->Format = texture_desc.Format; - desc->ViewDimension = D3D10_SRV_DIMENSION_TEXTURE3D; + desc->ViewDimension = D3D11_SRV_DIMENSION_TEXTURE3D; desc->u.Texture3D.MostDetailedMip = 0; desc->u.Texture3D.MipLevels = texture_desc.MipLevels; @@ -352,112 +354,238 @@ default: FIXME("Unhandled resource dimension %#x.\n", dimension); - case D3D10_RESOURCE_DIMENSION_BUFFER: + case D3D11_RESOURCE_DIMENSION_BUFFER: return E_INVALIDARG; } } -static inline struct d3d10_depthstencil_view *impl_from_ID3D10DepthStencilView(ID3D10DepthStencilView *iface) +/* ID3D11DepthStencilView methods */ + +static inline struct d3d_depthstencil_view *impl_from_ID3D11DepthStencilView(ID3D11DepthStencilView *iface) { - return CONTAINING_RECORD(iface, struct d3d10_depthstencil_view, ID3D10DepthStencilView_iface); + return CONTAINING_RECORD(iface, struct d3d_depthstencil_view, ID3D11DepthStencilView_iface); } -/* IUnknown methods */ - -static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_view_QueryInterface(ID3D10DepthStencilView *iface, +static HRESULT STDMETHODCALLTYPE d3d11_depthstencil_view_QueryInterface(ID3D11DepthStencilView *iface, REFIID riid, void **object) { + struct d3d_depthstencil_view *view = impl_from_ID3D11DepthStencilView(iface); + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); - if (IsEqualGUID(riid, &IID_ID3D10DepthStencilView) - || IsEqualGUID(riid, &IID_ID3D10View) - || IsEqualGUID(riid, &IID_ID3D10DeviceChild) + if (IsEqualGUID(riid, &IID_ID3D11DepthStencilView) + || IsEqualGUID(riid, &IID_ID3D11View) + || IsEqualGUID(riid, &IID_ID3D11DeviceChild) || IsEqualGUID(riid, &IID_IUnknown)) { - IUnknown_AddRef(iface); + ID3D11DepthStencilView_AddRef(iface); *object = iface; return S_OK; } + if (IsEqualGUID(riid, &IID_ID3D10DepthStencilView) + || IsEqualGUID(riid, &IID_ID3D10View) + || IsEqualGUID(riid, &IID_ID3D10DeviceChild)) + { + ID3D10DepthStencilView_AddRef(&view->ID3D10DepthStencilView_iface); + *object = &view->ID3D10DepthStencilView_iface; + return S_OK; + } + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); *object = NULL; return E_NOINTERFACE; } -static ULONG STDMETHODCALLTYPE d3d10_depthstencil_view_AddRef(ID3D10DepthStencilView *iface) +static ULONG STDMETHODCALLTYPE d3d11_depthstencil_view_AddRef(ID3D11DepthStencilView *iface) { - struct d3d10_depthstencil_view *This = impl_from_ID3D10DepthStencilView(iface); - ULONG refcount = InterlockedIncrement(&This->refcount); + struct d3d_depthstencil_view *view = impl_from_ID3D11DepthStencilView(iface); + ULONG refcount = InterlockedIncrement(&view->refcount); - TRACE("%p increasing refcount to %u.\n", This, refcount); + TRACE("%p increasing refcount to %u.\n", view, refcount); return refcount; } -static ULONG STDMETHODCALLTYPE d3d10_depthstencil_view_Release(ID3D10DepthStencilView *iface) +static ULONG STDMETHODCALLTYPE d3d11_depthstencil_view_Release(ID3D11DepthStencilView *iface) { - struct d3d10_depthstencil_view *This = impl_from_ID3D10DepthStencilView(iface); - ULONG refcount = InterlockedDecrement(&This->refcount); + struct d3d_depthstencil_view *view = impl_from_ID3D11DepthStencilView(iface); + ULONG refcount = InterlockedDecrement(&view->refcount); - TRACE("%p decreasing refcount to %u.\n", This, refcount); + TRACE("%p decreasing refcount to %u.\n", view, refcount); if (!refcount) { wined3d_mutex_lock(); - wined3d_rendertarget_view_decref(This->wined3d_view); - ID3D10Resource_Release(This->resource); - ID3D10Device1_Release(This->device); - wined3d_private_store_cleanup(&This->private_store); + wined3d_rendertarget_view_decref(view->wined3d_view); + ID3D11Resource_Release(view->resource); + ID3D11Device_Release(view->device); + wined3d_private_store_cleanup(&view->private_store); wined3d_mutex_unlock(); - HeapFree(GetProcessHeap(), 0, This); + HeapFree(GetProcessHeap(), 0, view); } return refcount; } +static void STDMETHODCALLTYPE d3d11_depthstencil_view_GetDevice(ID3D11DepthStencilView *iface, + ID3D11Device **device) +{ + struct d3d_depthstencil_view *view = impl_from_ID3D11DepthStencilView(iface); + + TRACE("iface %p, device %p.\n", iface, device); + + *device = view->device; + ID3D11Device_AddRef(*device); +} + +static HRESULT STDMETHODCALLTYPE d3d11_depthstencil_view_GetPrivateData(ID3D11DepthStencilView *iface, + REFGUID guid, UINT *data_size, void *data) +{ + struct d3d_depthstencil_view *view = impl_from_ID3D11DepthStencilView(iface); + + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_get_private_data(&view->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_depthstencil_view_SetPrivateData(ID3D11DepthStencilView *iface, + REFGUID guid, UINT data_size, const void *data) +{ + struct d3d_depthstencil_view *view = impl_from_ID3D11DepthStencilView(iface); + + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_set_private_data(&view->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_depthstencil_view_SetPrivateDataInterface(ID3D11DepthStencilView *iface, + REFGUID guid, const IUnknown *data) +{ + struct d3d_depthstencil_view *view = impl_from_ID3D11DepthStencilView(iface); + + TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); + + return d3d_set_private_data_interface(&view->private_store, guid, data); +} + +static void STDMETHODCALLTYPE d3d11_depthstencil_view_GetResource(ID3D11DepthStencilView *iface, + ID3D11Resource **resource) +{ + struct d3d_depthstencil_view *view = impl_from_ID3D11DepthStencilView(iface); + + TRACE("iface %p, resource %p.\n", iface, resource); + + *resource = view->resource; + ID3D11Resource_AddRef(*resource); +} + +static void STDMETHODCALLTYPE d3d11_depthstencil_view_GetDesc(ID3D11DepthStencilView *iface, + D3D11_DEPTH_STENCIL_VIEW_DESC *desc) +{ + struct d3d_depthstencil_view *view = impl_from_ID3D11DepthStencilView(iface); + + TRACE("iface %p, desc %p.\n", iface, desc); + + *desc = view->desc; +} + +static const struct ID3D11DepthStencilViewVtbl d3d11_depthstencil_view_vtbl = +{ + /* IUnknown methods */ + d3d11_depthstencil_view_QueryInterface, + d3d11_depthstencil_view_AddRef, + d3d11_depthstencil_view_Release, + /* ID3D11DeviceChild methods */ + d3d11_depthstencil_view_GetDevice, + d3d11_depthstencil_view_GetPrivateData, + d3d11_depthstencil_view_SetPrivateData, + d3d11_depthstencil_view_SetPrivateDataInterface, + /* ID3D11View methods */ + d3d11_depthstencil_view_GetResource, + /* ID3D11DepthStencilView methods */ + d3d11_depthstencil_view_GetDesc, +}; + +/* ID3D10DepthStencilView methods */ + +static inline struct d3d_depthstencil_view *impl_from_ID3D10DepthStencilView(ID3D10DepthStencilView *iface) +{ + return CONTAINING_RECORD(iface, struct d3d_depthstencil_view, ID3D10DepthStencilView_iface); +} + +/* IUnknown methods */ + +static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_view_QueryInterface(ID3D10DepthStencilView *iface, + REFIID riid, void **object) +{ + struct d3d_depthstencil_view *view = impl_from_ID3D10DepthStencilView(iface); + + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + + return d3d11_depthstencil_view_QueryInterface(&view->ID3D11DepthStencilView_iface, riid, object); +} + +static ULONG STDMETHODCALLTYPE d3d10_depthstencil_view_AddRef(ID3D10DepthStencilView *iface) +{ + struct d3d_depthstencil_view *view = impl_from_ID3D10DepthStencilView(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_depthstencil_view_AddRef(&view->ID3D11DepthStencilView_iface); +} + +static ULONG STDMETHODCALLTYPE d3d10_depthstencil_view_Release(ID3D10DepthStencilView *iface) +{ + struct d3d_depthstencil_view *view = impl_from_ID3D10DepthStencilView(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_depthstencil_view_Release(&view->ID3D11DepthStencilView_iface); +} + /* ID3D10DeviceChild methods */ static void STDMETHODCALLTYPE d3d10_depthstencil_view_GetDevice(ID3D10DepthStencilView *iface, ID3D10Device **device) { - struct d3d10_depthstencil_view *view = impl_from_ID3D10DepthStencilView(iface); + struct d3d_depthstencil_view *view = impl_from_ID3D10DepthStencilView(iface); TRACE("iface %p, device %p.\n", iface, device); - *device = (ID3D10Device *)view->device; - ID3D10Device_AddRef(*device); + ID3D11Device_QueryInterface(view->device, &IID_ID3D10Device, (void **)device); } static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_view_GetPrivateData(ID3D10DepthStencilView *iface, REFGUID guid, UINT *data_size, void *data) { - struct d3d10_depthstencil_view *view = impl_from_ID3D10DepthStencilView(iface); + struct d3d_depthstencil_view *view = impl_from_ID3D10DepthStencilView(iface); TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_get_private_data(&view->private_store, guid, data_size, data); + return d3d_get_private_data(&view->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_view_SetPrivateData(ID3D10DepthStencilView *iface, REFGUID guid, UINT data_size, const void *data) { - struct d3d10_depthstencil_view *view = impl_from_ID3D10DepthStencilView(iface); + struct d3d_depthstencil_view *view = impl_from_ID3D10DepthStencilView(iface); TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_set_private_data(&view->private_store, guid, data_size, data); + return d3d_set_private_data(&view->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_view_SetPrivateDataInterface(ID3D10DepthStencilView *iface, REFGUID guid, const IUnknown *data) { - struct d3d10_depthstencil_view *view = impl_from_ID3D10DepthStencilView(iface); + struct d3d_depthstencil_view *view = impl_from_ID3D10DepthStencilView(iface); TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); - return d3d10_set_private_data_interface(&view->private_store, guid, data); + return d3d_set_private_data_interface(&view->private_store, guid, data); } /* ID3D10View methods */ @@ -465,12 +593,11 @@ static void STDMETHODCALLTYPE d3d10_depthstencil_view_GetResource(ID3D10DepthStencilView *iface, ID3D10Resource **resource) { - struct d3d10_depthstencil_view *view = impl_from_ID3D10DepthStencilView(iface); + struct d3d_depthstencil_view *view = impl_from_ID3D10DepthStencilView(iface); TRACE("iface %p, resource %p.\n", iface, resource); - *resource = view->resource; - ID3D10Resource_AddRef(*resource); + ID3D11Resource_QueryInterface(view->resource, &IID_ID3D10Resource, (void **)resource); } /* ID3D10DepthStencilView methods */ @@ -478,11 +605,14 @@ static void STDMETHODCALLTYPE d3d10_depthstencil_view_GetDesc(ID3D10DepthStencilView *iface, D3D10_DEPTH_STENCIL_VIEW_DESC *desc) { - struct d3d10_depthstencil_view *view = impl_from_ID3D10DepthStencilView(iface); + struct d3d_depthstencil_view *view = impl_from_ID3D10DepthStencilView(iface); + const D3D11_DEPTH_STENCIL_VIEW_DESC *d3d11_desc = &view->desc; TRACE("iface %p, desc %p.\n", iface, desc); - *desc = view->desc; + desc->Format = d3d11_desc->Format; + desc->ViewDimension = (D3D10_DSV_DIMENSION)d3d11_desc->ViewDimension; + memcpy(&desc->u, &d3d11_desc->u, sizeof(desc->u)); } static const struct ID3D10DepthStencilViewVtbl d3d10_depthstencil_view_vtbl = @@ -502,44 +632,47 @@ d3d10_depthstencil_view_GetDesc, }; -static void wined3d_depth_stencil_view_desc_from_d3d10core(struct wined3d_rendertarget_view_desc *wined3d_desc, - const D3D10_DEPTH_STENCIL_VIEW_DESC *desc) +static void wined3d_depth_stencil_view_desc_from_d3d11(struct wined3d_rendertarget_view_desc *wined3d_desc, + const D3D11_DEPTH_STENCIL_VIEW_DESC *desc) { wined3d_desc->format_id = wined3dformat_from_dxgi_format(desc->Format); + if (desc->Flags) + FIXME("Unhandled depth stencil view flags %#x.\n", desc->Flags); + switch (desc->ViewDimension) { - case D3D10_DSV_DIMENSION_TEXTURE1D: + case D3D11_DSV_DIMENSION_TEXTURE1D: wined3d_desc->u.texture.level_idx = desc->u.Texture1D.MipSlice; wined3d_desc->u.texture.layer_idx = 0; wined3d_desc->u.texture.layer_count = 1; break; - case D3D10_DSV_DIMENSION_TEXTURE1DARRAY: + case D3D11_DSV_DIMENSION_TEXTURE1DARRAY: wined3d_desc->u.texture.level_idx = desc->u.Texture1DArray.MipSlice; wined3d_desc->u.texture.layer_idx = desc->u.Texture1DArray.FirstArraySlice; wined3d_desc->u.texture.layer_count = desc->u.Texture1DArray.ArraySize; break; - case D3D10_DSV_DIMENSION_TEXTURE2D: + case D3D11_DSV_DIMENSION_TEXTURE2D: wined3d_desc->u.texture.level_idx = desc->u.Texture2D.MipSlice; wined3d_desc->u.texture.layer_idx = 0; wined3d_desc->u.texture.layer_count = 1; break; - case D3D10_DSV_DIMENSION_TEXTURE2DARRAY: + case D3D11_DSV_DIMENSION_TEXTURE2DARRAY: wined3d_desc->u.texture.level_idx = desc->u.Texture2DArray.MipSlice; wined3d_desc->u.texture.layer_idx = desc->u.Texture2DArray.FirstArraySlice; wined3d_desc->u.texture.layer_count = desc->u.Texture2DArray.ArraySize; break; - case D3D10_DSV_DIMENSION_TEXTURE2DMS: + case D3D11_DSV_DIMENSION_TEXTURE2DMS: wined3d_desc->u.texture.level_idx = 0; wined3d_desc->u.texture.layer_idx = 0; wined3d_desc->u.texture.layer_count = 1; break; - case D3D10_DSV_DIMENSION_TEXTURE2DMSARRAY: + case D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY: wined3d_desc->u.texture.level_idx = 0; wined3d_desc->u.texture.layer_idx = desc->u.Texture2DMSArray.FirstArraySlice; wined3d_desc->u.texture.layer_count = desc->u.Texture2DMSArray.ArraySize; @@ -554,13 +687,14 @@ } } -HRESULT d3d10_depthstencil_view_init(struct d3d10_depthstencil_view *view, struct d3d_device *device, - ID3D10Resource *resource, const D3D10_DEPTH_STENCIL_VIEW_DESC *desc) +static HRESULT d3d_depthstencil_view_init(struct d3d_depthstencil_view *view, struct d3d_device *device, + ID3D11Resource *resource, const D3D11_DEPTH_STENCIL_VIEW_DESC *desc) { struct wined3d_rendertarget_view_desc wined3d_desc; struct wined3d_resource *wined3d_resource; HRESULT hr; + view->ID3D11DepthStencilView_iface.lpVtbl = &d3d11_depthstencil_view_vtbl; view->ID3D10DepthStencilView_iface.lpVtbl = &d3d10_depthstencil_view_vtbl; view->refcount = 1; @@ -575,16 +709,16 @@ } wined3d_mutex_lock(); - if (!(wined3d_resource = wined3d_resource_from_resource(resource))) + if (!(wined3d_resource = wined3d_resource_from_d3d11_resource(resource))) { wined3d_mutex_unlock(); - ERR("Failed to get wined3d resource for d3d10 resource %p.\n", resource); + ERR("Failed to get wined3d resource for d3d11 resource %p.\n", resource); return E_FAIL; } - wined3d_depth_stencil_view_desc_from_d3d10core(&wined3d_desc, &view->desc); + wined3d_depth_stencil_view_desc_from_d3d11(&wined3d_desc, &view->desc); if (FAILED(hr = wined3d_rendertarget_view_create(&wined3d_desc, wined3d_resource, - view, &d3d10_null_wined3d_parent_ops, &view->wined3d_view))) + view, &d3d_null_wined3d_parent_ops, &view->wined3d_view))) { wined3d_mutex_unlock(); WARN("Failed to create a wined3d rendertarget view, hr %#x.\n", hr); @@ -594,14 +728,45 @@ wined3d_private_store_init(&view->private_store); wined3d_mutex_unlock(); view->resource = resource; - ID3D10Resource_AddRef(resource); - view->device = &device->ID3D10Device1_iface; - ID3D10Device1_AddRef(view->device); + ID3D11Resource_AddRef(resource); + view->device = &device->ID3D11Device_iface; + ID3D11Device_AddRef(view->device); + + return S_OK; +} + +HRESULT d3d_depthstencil_view_create(struct d3d_device *device, ID3D11Resource *resource, + const D3D11_DEPTH_STENCIL_VIEW_DESC *desc, struct d3d_depthstencil_view **view) +{ + struct d3d_depthstencil_view *object; + HRESULT hr; + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + if (FAILED(hr = d3d_depthstencil_view_init(object, device, resource, desc))) + { + WARN("Failed to initialize depthstencil view, hr %#x.\n", hr); + HeapFree(GetProcessHeap(), 0, object); + return hr; + } + + TRACE("Created depthstencil view %p.\n", object); + *view = object; return S_OK; } -struct d3d10_depthstencil_view *unsafe_impl_from_ID3D10DepthStencilView(ID3D10DepthStencilView *iface) +struct d3d_depthstencil_view *unsafe_impl_from_ID3D11DepthStencilView(ID3D11DepthStencilView *iface) +{ + if (!iface) + return NULL; + assert(iface->lpVtbl == &d3d11_depthstencil_view_vtbl); + + return impl_from_ID3D11DepthStencilView(iface); +} + +struct d3d_depthstencil_view *unsafe_impl_from_ID3D10DepthStencilView(ID3D10DepthStencilView *iface) { if (!iface) return NULL; @@ -610,107 +775,233 @@ return impl_from_ID3D10DepthStencilView(iface); } -static inline struct d3d10_rendertarget_view *impl_from_ID3D10RenderTargetView(ID3D10RenderTargetView *iface) +/* ID3D11RenderTargetView methods */ + +static inline struct d3d_rendertarget_view *impl_from_ID3D11RenderTargetView(ID3D11RenderTargetView *iface) { - return CONTAINING_RECORD(iface, struct d3d10_rendertarget_view, ID3D10RenderTargetView_iface); + return CONTAINING_RECORD(iface, struct d3d_rendertarget_view, ID3D11RenderTargetView_iface); } -/* IUnknown methods */ - -static HRESULT STDMETHODCALLTYPE d3d10_rendertarget_view_QueryInterface(ID3D10RenderTargetView *iface, +static HRESULT STDMETHODCALLTYPE d3d11_rendertarget_view_QueryInterface(ID3D11RenderTargetView *iface, REFIID riid, void **object) { - TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object); + struct d3d_rendertarget_view *view = impl_from_ID3D11RenderTargetView(iface); - if (IsEqualGUID(riid, &IID_ID3D10RenderTargetView) - || IsEqualGUID(riid, &IID_ID3D10View) - || IsEqualGUID(riid, &IID_ID3D10DeviceChild) + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + + if (IsEqualGUID(riid, &IID_ID3D11RenderTargetView) + || IsEqualGUID(riid, &IID_ID3D11View) + || IsEqualGUID(riid, &IID_ID3D11DeviceChild) || IsEqualGUID(riid, &IID_IUnknown)) { - IUnknown_AddRef(iface); + ID3D11RenderTargetView_AddRef(iface); *object = iface; return S_OK; } - WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid)); + if (IsEqualGUID(riid, &IID_ID3D10RenderTargetView) + || IsEqualGUID(riid, &IID_ID3D10View) + || IsEqualGUID(riid, &IID_ID3D10DeviceChild)) + { + ID3D10RenderTargetView_AddRef(&view->ID3D10RenderTargetView_iface); + *object = &view->ID3D10RenderTargetView_iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); *object = NULL; return E_NOINTERFACE; } -static ULONG STDMETHODCALLTYPE d3d10_rendertarget_view_AddRef(ID3D10RenderTargetView *iface) +static ULONG STDMETHODCALLTYPE d3d11_rendertarget_view_AddRef(ID3D11RenderTargetView *iface) { - struct d3d10_rendertarget_view *This = impl_from_ID3D10RenderTargetView(iface); - ULONG refcount = InterlockedIncrement(&This->refcount); + struct d3d_rendertarget_view *view = impl_from_ID3D11RenderTargetView(iface); + ULONG refcount = InterlockedIncrement(&view->refcount); - TRACE("%p increasing refcount to %u\n", This, refcount); + TRACE("%p increasing refcount to %u.\n", view, refcount); return refcount; } -static ULONG STDMETHODCALLTYPE d3d10_rendertarget_view_Release(ID3D10RenderTargetView *iface) +static ULONG STDMETHODCALLTYPE d3d11_rendertarget_view_Release(ID3D11RenderTargetView *iface) { - struct d3d10_rendertarget_view *This = impl_from_ID3D10RenderTargetView(iface); - ULONG refcount = InterlockedDecrement(&This->refcount); + struct d3d_rendertarget_view *view = impl_from_ID3D11RenderTargetView(iface); + ULONG refcount = InterlockedDecrement(&view->refcount); - TRACE("%p decreasing refcount to %u\n", This, refcount); + TRACE("%p decreasing refcount to %u.\n", view, refcount); if (!refcount) { wined3d_mutex_lock(); - wined3d_rendertarget_view_decref(This->wined3d_view); - ID3D10Resource_Release(This->resource); - ID3D10Device1_Release(This->device); - wined3d_private_store_cleanup(&This->private_store); + wined3d_rendertarget_view_decref(view->wined3d_view); + ID3D11Resource_Release(view->resource); + ID3D11Device_Release(view->device); + wined3d_private_store_cleanup(&view->private_store); wined3d_mutex_unlock(); - HeapFree(GetProcessHeap(), 0, This); + HeapFree(GetProcessHeap(), 0, view); } return refcount; } +static void STDMETHODCALLTYPE d3d11_rendertarget_view_GetDevice(ID3D11RenderTargetView *iface, + ID3D11Device **device) +{ + struct d3d_rendertarget_view *view = impl_from_ID3D11RenderTargetView(iface); + + TRACE("iface %p, device %p.\n", iface, device); + + *device = view->device; + ID3D11Device_AddRef(*device); +} + +static HRESULT STDMETHODCALLTYPE d3d11_rendertarget_view_GetPrivateData(ID3D11RenderTargetView *iface, + REFGUID guid, UINT *data_size, void *data) +{ + struct d3d_rendertarget_view *view = impl_from_ID3D11RenderTargetView(iface); + + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_get_private_data(&view->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_rendertarget_view_SetPrivateData(ID3D11RenderTargetView *iface, + REFGUID guid, UINT data_size, const void *data) +{ + struct d3d_rendertarget_view *view = impl_from_ID3D11RenderTargetView(iface); + + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_set_private_data(&view->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_rendertarget_view_SetPrivateDataInterface(ID3D11RenderTargetView *iface, + REFGUID guid, const IUnknown *data) +{ + struct d3d_rendertarget_view *view = impl_from_ID3D11RenderTargetView(iface); + + TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); + + return d3d_set_private_data_interface(&view->private_store, guid, data); +} + +static void STDMETHODCALLTYPE d3d11_rendertarget_view_GetResource(ID3D11RenderTargetView *iface, + ID3D11Resource **resource) +{ + struct d3d_rendertarget_view *view = impl_from_ID3D11RenderTargetView(iface); + + TRACE("iface %p, resource %p.\n", iface, resource); + + *resource = view->resource; + ID3D11Resource_AddRef(*resource); +} + +static void STDMETHODCALLTYPE d3d11_rendertarget_view_GetDesc(ID3D11RenderTargetView *iface, + D3D11_RENDER_TARGET_VIEW_DESC *desc) +{ + struct d3d_rendertarget_view *view = impl_from_ID3D11RenderTargetView(iface); + + TRACE("iface %p, desc %p.\n", iface, desc); + + *desc = view->desc; +} + +static const struct ID3D11RenderTargetViewVtbl d3d11_rendertarget_view_vtbl = +{ + /* IUnknown methods */ + d3d11_rendertarget_view_QueryInterface, + d3d11_rendertarget_view_AddRef, + d3d11_rendertarget_view_Release, + /* ID3D11DeviceChild methods */ + d3d11_rendertarget_view_GetDevice, + d3d11_rendertarget_view_GetPrivateData, + d3d11_rendertarget_view_SetPrivateData, + d3d11_rendertarget_view_SetPrivateDataInterface, + /* ID3D11View methods */ + d3d11_rendertarget_view_GetResource, + /* ID3D11RenderTargetView methods */ + d3d11_rendertarget_view_GetDesc, +}; + +/* ID3D10RenderTargetView methods */ + +static inline struct d3d_rendertarget_view *impl_from_ID3D10RenderTargetView(ID3D10RenderTargetView *iface) +{ + return CONTAINING_RECORD(iface, struct d3d_rendertarget_view, ID3D10RenderTargetView_iface); +} + +/* IUnknown methods */ + +static HRESULT STDMETHODCALLTYPE d3d10_rendertarget_view_QueryInterface(ID3D10RenderTargetView *iface, + REFIID riid, void **object) +{ + struct d3d_rendertarget_view *view = impl_from_ID3D10RenderTargetView(iface); + + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + + return d3d11_rendertarget_view_QueryInterface(&view->ID3D11RenderTargetView_iface, riid, object); +} + +static ULONG STDMETHODCALLTYPE d3d10_rendertarget_view_AddRef(ID3D10RenderTargetView *iface) +{ + struct d3d_rendertarget_view *view = impl_from_ID3D10RenderTargetView(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_rendertarget_view_AddRef(&view->ID3D11RenderTargetView_iface); +} + +static ULONG STDMETHODCALLTYPE d3d10_rendertarget_view_Release(ID3D10RenderTargetView *iface) +{ + struct d3d_rendertarget_view *view = impl_from_ID3D10RenderTargetView(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_rendertarget_view_Release(&view->ID3D11RenderTargetView_iface); +} + /* ID3D10DeviceChild methods */ static void STDMETHODCALLTYPE d3d10_rendertarget_view_GetDevice(ID3D10RenderTargetView *iface, ID3D10Device **device) { - struct d3d10_rendertarget_view *view = impl_from_ID3D10RenderTargetView(iface); + struct d3d_rendertarget_view *view = impl_from_ID3D10RenderTargetView(iface); TRACE("iface %p, device %p.\n", iface, device); - *device = (ID3D10Device *)view->device; - ID3D10Device_AddRef(*device); + ID3D11Device_QueryInterface(view->device, &IID_ID3D10Device, (void **)device); } static HRESULT STDMETHODCALLTYPE d3d10_rendertarget_view_GetPrivateData(ID3D10RenderTargetView *iface, REFGUID guid, UINT *data_size, void *data) { - struct d3d10_rendertarget_view *view = impl_from_ID3D10RenderTargetView(iface); + struct d3d_rendertarget_view *view = impl_from_ID3D10RenderTargetView(iface); TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_get_private_data(&view->private_store, guid, data_size, data); + return d3d_get_private_data(&view->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d10_rendertarget_view_SetPrivateData(ID3D10RenderTargetView *iface, REFGUID guid, UINT data_size, const void *data) { - struct d3d10_rendertarget_view *view = impl_from_ID3D10RenderTargetView(iface); + struct d3d_rendertarget_view *view = impl_from_ID3D10RenderTargetView(iface); TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_set_private_data(&view->private_store, guid, data_size, data); + return d3d_set_private_data(&view->private_store, guid, data_size, data); } static HRESULT STDMETHODCALLTYPE d3d10_rendertarget_view_SetPrivateDataInterface(ID3D10RenderTargetView *iface, REFGUID guid, const IUnknown *data) { - struct d3d10_rendertarget_view *view = impl_from_ID3D10RenderTargetView(iface); + struct d3d_rendertarget_view *view = impl_from_ID3D10RenderTargetView(iface); TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); - return d3d10_set_private_data_interface(&view->private_store, guid, data); + return d3d_set_private_data_interface(&view->private_store, guid, data); } /* ID3D10View methods */ @@ -718,12 +1009,11 @@ static void STDMETHODCALLTYPE d3d10_rendertarget_view_GetResource(ID3D10RenderTargetView *iface, ID3D10Resource **resource) { - struct d3d10_rendertarget_view *view = impl_from_ID3D10RenderTargetView(iface); + struct d3d_rendertarget_view *view = impl_from_ID3D10RenderTargetView(iface); TRACE("iface %p, resource %p\n", iface, resource); - *resource = view->resource; - ID3D10Resource_AddRef(*resource); + ID3D11Resource_QueryInterface(view->resource, &IID_ID3D10Resource, (void **)resource); } /* ID3D10RenderTargetView methods */ @@ -731,11 +1021,11 @@ static void STDMETHODCALLTYPE d3d10_rendertarget_view_GetDesc(ID3D10RenderTargetView *iface, D3D10_RENDER_TARGET_VIEW_DESC *desc) { - struct d3d10_rendertarget_view *This = impl_from_ID3D10RenderTargetView(iface); + struct d3d_rendertarget_view *view = impl_from_ID3D10RenderTargetView(iface); TRACE("iface %p, desc %p\n", iface, desc); - *desc = This->desc; + memcpy(desc, &view->desc, sizeof(*desc)); } static const struct ID3D10RenderTargetViewVtbl d3d10_rendertarget_view_vtbl = @@ -755,55 +1045,55 @@ d3d10_rendertarget_view_GetDesc, }; -static void wined3d_rendertarget_view_desc_from_d3d10core(struct wined3d_rendertarget_view_desc *wined3d_desc, - const D3D10_RENDER_TARGET_VIEW_DESC *desc) +static void wined3d_rendertarget_view_desc_from_d3d11(struct wined3d_rendertarget_view_desc *wined3d_desc, + const D3D11_RENDER_TARGET_VIEW_DESC *desc) { wined3d_desc->format_id = wined3dformat_from_dxgi_format(desc->Format); switch (desc->ViewDimension) { - case D3D10_RTV_DIMENSION_BUFFER: - wined3d_desc->u.buffer.start_idx = desc->u.Buffer.ElementOffset; - wined3d_desc->u.buffer.count = desc->u.Buffer.ElementWidth; + case D3D11_RTV_DIMENSION_BUFFER: + wined3d_desc->u.buffer.start_idx = desc->u.Buffer.u1.FirstElement; + wined3d_desc->u.buffer.count = desc->u.Buffer.u2.NumElements; break; - case D3D10_RTV_DIMENSION_TEXTURE1D: + case D3D11_RTV_DIMENSION_TEXTURE1D: wined3d_desc->u.texture.level_idx = desc->u.Texture1D.MipSlice; wined3d_desc->u.texture.layer_idx = 0; wined3d_desc->u.texture.layer_count = 1; break; - case D3D10_RTV_DIMENSION_TEXTURE1DARRAY: + case D3D11_RTV_DIMENSION_TEXTURE1DARRAY: wined3d_desc->u.texture.level_idx = desc->u.Texture1DArray.MipSlice; wined3d_desc->u.texture.layer_idx = desc->u.Texture1DArray.FirstArraySlice; wined3d_desc->u.texture.layer_count = desc->u.Texture1DArray.ArraySize; break; - case D3D10_RTV_DIMENSION_TEXTURE2D: + case D3D11_RTV_DIMENSION_TEXTURE2D: wined3d_desc->u.texture.level_idx = desc->u.Texture2D.MipSlice; wined3d_desc->u.texture.layer_idx = 0; wined3d_desc->u.texture.layer_count = 1; break; - case D3D10_RTV_DIMENSION_TEXTURE2DARRAY: + case D3D11_RTV_DIMENSION_TEXTURE2DARRAY: wined3d_desc->u.texture.level_idx = desc->u.Texture2DArray.MipSlice; wined3d_desc->u.texture.layer_idx = desc->u.Texture2DArray.FirstArraySlice; wined3d_desc->u.texture.layer_count = desc->u.Texture2DArray.ArraySize; break; - case D3D10_RTV_DIMENSION_TEXTURE2DMS: + case D3D11_RTV_DIMENSION_TEXTURE2DMS: wined3d_desc->u.texture.level_idx = 0; wined3d_desc->u.texture.layer_idx = 0; wined3d_desc->u.texture.layer_count = 1; break; - case D3D10_RTV_DIMENSION_TEXTURE2DMSARRAY: + case D3D11_RTV_DIMENSION_TEXTURE2DMSARRAY: wined3d_desc->u.texture.level_idx = 0; wined3d_desc->u.texture.layer_idx = desc->u.Texture2DMSArray.FirstArraySlice; wined3d_desc->u.texture.layer_count = desc->u.Texture2DMSArray.ArraySize; break; - case D3D10_RTV_DIMENSION_TEXTURE3D: + case D3D11_RTV_DIMENSION_TEXTURE3D: wined3d_desc->u.texture.level_idx = desc->u.Texture3D.MipSlice; wined3d_desc->u.texture.layer_idx = desc->u.Texture3D.FirstWSlice; wined3d_desc->u.texture.layer_count = desc->u.Texture3D.WSize; @@ -818,13 +1108,14 @@ } } -HRESULT d3d10_rendertarget_view_init(struct d3d10_rendertarget_view *view, struct d3d_device *device, - ID3D10Resource *resource, const D3D10_RENDER_TARGET_VIEW_DESC *desc) +static HRESULT d3d_rendertarget_view_init(struct d3d_rendertarget_view *view, struct d3d_device *device, + ID3D11Resource *resource, const D3D11_RENDER_TARGET_VIEW_DESC *desc) { struct wined3d_rendertarget_view_desc wined3d_desc; struct wined3d_resource *wined3d_resource; HRESULT hr; + view->ID3D11RenderTargetView_iface.lpVtbl = &d3d11_rendertarget_view_vtbl; view->ID3D10RenderTargetView_iface.lpVtbl = &d3d10_rendertarget_view_vtbl; view->refcount = 1; @@ -839,16 +1130,16 @@ } wined3d_mutex_lock(); - if (!(wined3d_resource = wined3d_resource_from_resource(resource))) + if (!(wined3d_resource = wined3d_resource_from_d3d11_resource(resource))) { wined3d_mutex_unlock(); - ERR("Failed to get wined3d resource for d3d10 resource %p.\n", resource); + ERR("Failed to get wined3d resource for d3d11 resource %p.\n", resource); return E_FAIL; } - wined3d_rendertarget_view_desc_from_d3d10core(&wined3d_desc, &view->desc); + wined3d_rendertarget_view_desc_from_d3d11(&wined3d_desc, &view->desc); if (FAILED(hr = wined3d_rendertarget_view_create(&wined3d_desc, wined3d_resource, - view, &d3d10_null_wined3d_parent_ops, &view->wined3d_view))) + view, &d3d_null_wined3d_parent_ops, &view->wined3d_view))) { wined3d_mutex_unlock(); WARN("Failed to create a wined3d rendertarget view, hr %#x.\n", hr); @@ -858,14 +1149,45 @@ wined3d_private_store_init(&view->private_store); wined3d_mutex_unlock(); view->resource = resource; - ID3D10Resource_AddRef(resource); - view->device = &device->ID3D10Device1_iface; - ID3D10Device1_AddRef(view->device); + ID3D11Resource_AddRef(resource); + view->device = &device->ID3D11Device_iface; + ID3D11Device_AddRef(view->device); return S_OK; } -struct d3d10_rendertarget_view *unsafe_impl_from_ID3D10RenderTargetView(ID3D10RenderTargetView *iface) +HRESULT d3d_rendertarget_view_create(struct d3d_device *device, ID3D11Resource *resource, + const D3D11_RENDER_TARGET_VIEW_DESC *desc, struct d3d_rendertarget_view **view) +{ + struct d3d_rendertarget_view *object; + HRESULT hr; + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + if (FAILED(hr = d3d_rendertarget_view_init(object, device, resource, desc))) + { + WARN("Failed to initialize rendertarget view, hr %#x.\n", hr); + HeapFree(GetProcessHeap(), 0, object); + return hr; + } + + TRACE("Created rendertarget view %p.\n", object); + *view = object; + + return S_OK; +} + +struct d3d_rendertarget_view *unsafe_impl_from_ID3D11RenderTargetView(ID3D11RenderTargetView *iface) +{ + if (!iface) + return NULL; + assert(iface->lpVtbl == &d3d11_rendertarget_view_vtbl); + + return impl_from_ID3D11RenderTargetView(iface); +} + +struct d3d_rendertarget_view *unsafe_impl_from_ID3D10RenderTargetView(ID3D10RenderTargetView *iface) { if (!iface) return NULL; @@ -874,136 +1196,272 @@ return impl_from_ID3D10RenderTargetView(iface); } -static inline struct d3d10_shader_resource_view *impl_from_ID3D10ShaderResourceView(ID3D10ShaderResourceView *iface) +/* ID3D11ShaderResourceView methods */ + +static inline struct d3d_shader_resource_view *impl_from_ID3D11ShaderResourceView(ID3D11ShaderResourceView *iface) { - return CONTAINING_RECORD(iface, struct d3d10_shader_resource_view, ID3D10ShaderResourceView_iface); + return CONTAINING_RECORD(iface, struct d3d_shader_resource_view, ID3D11ShaderResourceView_iface); } -/* IUnknown methods */ - -static HRESULT STDMETHODCALLTYPE d3d10_shader_resource_view_QueryInterface(ID3D10ShaderResourceView *iface, +static HRESULT STDMETHODCALLTYPE d3d11_shader_resource_view_QueryInterface(ID3D11ShaderResourceView *iface, REFIID riid, void **object) { + struct d3d_shader_resource_view *view = impl_from_ID3D11ShaderResourceView(iface); + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); - if (IsEqualGUID(riid, &IID_ID3D10ShaderResourceView) - || IsEqualGUID(riid, &IID_ID3D10View) - || IsEqualGUID(riid, &IID_ID3D10DeviceChild) + if (IsEqualGUID(riid, &IID_ID3D11ShaderResourceView) + || IsEqualGUID(riid, &IID_ID3D11View) + || IsEqualGUID(riid, &IID_ID3D11DeviceChild) || IsEqualGUID(riid, &IID_IUnknown)) { - IUnknown_AddRef(iface); + ID3D11ShaderResourceView_AddRef(iface); *object = iface; return S_OK; } + if (IsEqualGUID(riid, &IID_ID3D10ShaderResourceView1) + || IsEqualGUID(riid, &IID_ID3D10ShaderResourceView) + || IsEqualGUID(riid, &IID_ID3D10View) + || IsEqualGUID(riid, &IID_ID3D10DeviceChild)) + { + ID3D10ShaderResourceView1_AddRef(&view->ID3D10ShaderResourceView1_iface); + *object = &view->ID3D10ShaderResourceView1_iface; + return S_OK; + } + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); *object = NULL; return E_NOINTERFACE; } -static ULONG STDMETHODCALLTYPE d3d10_shader_resource_view_AddRef(ID3D10ShaderResourceView *iface) +static ULONG STDMETHODCALLTYPE d3d11_shader_resource_view_AddRef(ID3D11ShaderResourceView *iface) { - struct d3d10_shader_resource_view *This = impl_from_ID3D10ShaderResourceView(iface); - ULONG refcount = InterlockedIncrement(&This->refcount); + struct d3d_shader_resource_view *view = impl_from_ID3D11ShaderResourceView(iface); + ULONG refcount = InterlockedIncrement(&view->refcount); - TRACE("%p increasing refcount to %u.\n", This, refcount); + TRACE("%p increasing refcount to %u.\n", view, refcount); return refcount; } -static ULONG STDMETHODCALLTYPE d3d10_shader_resource_view_Release(ID3D10ShaderResourceView *iface) +static ULONG STDMETHODCALLTYPE d3d11_shader_resource_view_Release(ID3D11ShaderResourceView *iface) { - struct d3d10_shader_resource_view *This = impl_from_ID3D10ShaderResourceView(iface); - ULONG refcount = InterlockedDecrement(&This->refcount); + struct d3d_shader_resource_view *view = impl_from_ID3D11ShaderResourceView(iface); + ULONG refcount = InterlockedDecrement(&view->refcount); - TRACE("%p decreasing refcount to %u.\n", This, refcount); + TRACE("%p decreasing refcount to %u.\n", view, refcount); if (!refcount) { wined3d_mutex_lock(); - wined3d_shader_resource_view_decref(This->wined3d_view); - ID3D10Resource_Release(This->resource); - ID3D10Device1_Release(This->device); - wined3d_private_store_cleanup(&This->private_store); + wined3d_shader_resource_view_decref(view->wined3d_view); + ID3D11Resource_Release(view->resource); + ID3D11Device_Release(view->device); + wined3d_private_store_cleanup(&view->private_store); wined3d_mutex_unlock(); - HeapFree(GetProcessHeap(), 0, This); + HeapFree(GetProcessHeap(), 0, view); } return refcount; } +static void STDMETHODCALLTYPE d3d11_shader_resource_view_GetDevice(ID3D11ShaderResourceView *iface, + ID3D11Device **device) +{ + struct d3d_shader_resource_view *view = impl_from_ID3D11ShaderResourceView(iface); + + TRACE("iface %p, device %p.\n", iface, device); + + *device = view->device; + ID3D11Device_AddRef(*device); +} + +static HRESULT STDMETHODCALLTYPE d3d11_shader_resource_view_GetPrivateData(ID3D11ShaderResourceView *iface, + REFGUID guid, UINT *data_size, void *data) +{ + struct d3d_shader_resource_view *view = impl_from_ID3D11ShaderResourceView(iface); + + TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_get_private_data(&view->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_shader_resource_view_SetPrivateData(ID3D11ShaderResourceView *iface, + REFGUID guid, UINT data_size, const void *data) +{ + struct d3d_shader_resource_view *view = impl_from_ID3D11ShaderResourceView(iface); + + TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); + + return d3d_set_private_data(&view->private_store, guid, data_size, data); +} + +static HRESULT STDMETHODCALLTYPE d3d11_shader_resource_view_SetPrivateDataInterface(ID3D11ShaderResourceView *iface, + REFGUID guid, const IUnknown *data) +{ + struct d3d_shader_resource_view *view = impl_from_ID3D11ShaderResourceView(iface); + + TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); + + return d3d_set_private_data_interface(&view->private_store, guid, data); +} + +static void STDMETHODCALLTYPE d3d11_shader_resource_view_GetResource(ID3D11ShaderResourceView *iface, + ID3D11Resource **resource) +{ + struct d3d_shader_resource_view *view = impl_from_ID3D11ShaderResourceView(iface); + + TRACE("iface %p, resource %p.\n", iface, resource); + + *resource = view->resource; + ID3D11Resource_AddRef(*resource); +} + +static void STDMETHODCALLTYPE d3d11_shader_resource_view_GetDesc(ID3D11ShaderResourceView *iface, + D3D11_SHADER_RESOURCE_VIEW_DESC *desc) +{ + struct d3d_shader_resource_view *view = impl_from_ID3D11ShaderResourceView(iface); + + TRACE("iface %p, desc %p.\n", iface, desc); + + *desc = view->desc; +} + +static const struct ID3D11ShaderResourceViewVtbl d3d11_shader_resource_view_vtbl = +{ + /* IUnknown methods */ + d3d11_shader_resource_view_QueryInterface, + d3d11_shader_resource_view_AddRef, + d3d11_shader_resource_view_Release, + /* ID3D11DeviceChild methods */ + d3d11_shader_resource_view_GetDevice, + d3d11_shader_resource_view_GetPrivateData, + d3d11_shader_resource_view_SetPrivateData, + d3d11_shader_resource_view_SetPrivateDataInterface, + /* ID3D11View methods */ + d3d11_shader_resource_view_GetResource, + /* ID3D11ShaderResourceView methods */ + d3d11_shader_resource_view_GetDesc, +}; + +/* ID3D10ShaderResourceView methods */ + +static inline struct d3d_shader_resource_view *impl_from_ID3D10ShaderResourceView(ID3D10ShaderResourceView1 *iface) +{ + return CONTAINING_RECORD(iface, struct d3d_shader_resource_view, ID3D10ShaderResourceView1_iface); +} + +/* IUnknown methods */ + +static HRESULT STDMETHODCALLTYPE d3d10_shader_resource_view_QueryInterface(ID3D10ShaderResourceView1 *iface, + REFIID riid, void **object) +{ + struct d3d_shader_resource_view *view = impl_from_ID3D10ShaderResourceView(iface); + + TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object); + + return d3d11_shader_resource_view_QueryInterface(&view->ID3D11ShaderResourceView_iface, riid, object); +} + +static ULONG STDMETHODCALLTYPE d3d10_shader_resource_view_AddRef(ID3D10ShaderResourceView1 *iface) +{ + struct d3d_shader_resource_view *view = impl_from_ID3D10ShaderResourceView(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_shader_resource_view_AddRef(&view->ID3D11ShaderResourceView_iface); +} + +static ULONG STDMETHODCALLTYPE d3d10_shader_resource_view_Release(ID3D10ShaderResourceView1 *iface) +{ + struct d3d_shader_resource_view *view = impl_from_ID3D10ShaderResourceView(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_shader_resource_view_Release(&view->ID3D11ShaderResourceView_iface); +} + /* ID3D10DeviceChild methods */ -static void STDMETHODCALLTYPE d3d10_shader_resource_view_GetDevice(ID3D10ShaderResourceView *iface, +static void STDMETHODCALLTYPE d3d10_shader_resource_view_GetDevice(ID3D10ShaderResourceView1 *iface, ID3D10Device **device) { - struct d3d10_shader_resource_view *view = impl_from_ID3D10ShaderResourceView(iface); + struct d3d_shader_resource_view *view = impl_from_ID3D10ShaderResourceView(iface); TRACE("iface %p, device %p.\n", iface, device); - *device = (ID3D10Device *)view->device; - ID3D10Device_AddRef(*device); + ID3D11Device_QueryInterface(view->device, &IID_ID3D10Device, (void **)device); } -static HRESULT STDMETHODCALLTYPE d3d10_shader_resource_view_GetPrivateData(ID3D10ShaderResourceView *iface, +static HRESULT STDMETHODCALLTYPE d3d10_shader_resource_view_GetPrivateData(ID3D10ShaderResourceView1 *iface, REFGUID guid, UINT *data_size, void *data) { - struct d3d10_shader_resource_view *view = impl_from_ID3D10ShaderResourceView(iface); + struct d3d_shader_resource_view *view = impl_from_ID3D10ShaderResourceView(iface); TRACE("iface %p, guid %s, data_size %p, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_get_private_data(&view->private_store, guid, data_size, data); + return d3d_get_private_data(&view->private_store, guid, data_size, data); } -static HRESULT STDMETHODCALLTYPE d3d10_shader_resource_view_SetPrivateData(ID3D10ShaderResourceView *iface, +static HRESULT STDMETHODCALLTYPE d3d10_shader_resource_view_SetPrivateData(ID3D10ShaderResourceView1 *iface, REFGUID guid, UINT data_size, const void *data) { - struct d3d10_shader_resource_view *view = impl_from_ID3D10ShaderResourceView(iface); + struct d3d_shader_resource_view *view = impl_from_ID3D10ShaderResourceView(iface); TRACE("iface %p, guid %s, data_size %u, data %p.\n", iface, debugstr_guid(guid), data_size, data); - return d3d10_set_private_data(&view->private_store, guid, data_size, data); + return d3d_set_private_data(&view->private_store, guid, data_size, data); } -static HRESULT STDMETHODCALLTYPE d3d10_shader_resource_view_SetPrivateDataInterface(ID3D10ShaderResourceView *iface, +static HRESULT STDMETHODCALLTYPE d3d10_shader_resource_view_SetPrivateDataInterface(ID3D10ShaderResourceView1 *iface, REFGUID guid, const IUnknown *data) { - struct d3d10_shader_resource_view *view = impl_from_ID3D10ShaderResourceView(iface); + struct d3d_shader_resource_view *view = impl_from_ID3D10ShaderResourceView(iface); TRACE("iface %p, guid %s, data %p.\n", iface, debugstr_guid(guid), data); - return d3d10_set_private_data_interface(&view->private_store, guid, data); + return d3d_set_private_data_interface(&view->private_store, guid, data); } /* ID3D10View methods */ -static void STDMETHODCALLTYPE d3d10_shader_resource_view_GetResource(ID3D10ShaderResourceView *iface, +static void STDMETHODCALLTYPE d3d10_shader_resource_view_GetResource(ID3D10ShaderResourceView1 *iface, ID3D10Resource **resource) { - struct d3d10_shader_resource_view *view = impl_from_ID3D10ShaderResourceView(iface); + struct d3d_shader_resource_view *view = impl_from_ID3D10ShaderResourceView(iface); TRACE("iface %p, resource %p.\n", iface, resource); - *resource = view->resource; - ID3D10Resource_AddRef(*resource); + ID3D11Resource_QueryInterface(view->resource, &IID_ID3D10Resource, (void **)resource); } /* ID3D10ShaderResourceView methods */ -static void STDMETHODCALLTYPE d3d10_shader_resource_view_GetDesc(ID3D10ShaderResourceView *iface, +static void STDMETHODCALLTYPE d3d10_shader_resource_view_GetDesc(ID3D10ShaderResourceView1 *iface, D3D10_SHADER_RESOURCE_VIEW_DESC *desc) { - struct d3d10_shader_resource_view *view = impl_from_ID3D10ShaderResourceView(iface); + struct d3d_shader_resource_view *view = impl_from_ID3D10ShaderResourceView(iface); TRACE("iface %p, desc %p.\n", iface, desc); - *desc = view->desc; + memcpy(desc, &view->desc, sizeof(*desc)); } -static const struct ID3D10ShaderResourceViewVtbl d3d10_shader_resource_view_vtbl = +static void STDMETHODCALLTYPE d3d10_shader_resource_view_GetDesc1(ID3D10ShaderResourceView1 *iface, + D3D10_SHADER_RESOURCE_VIEW_DESC1 *desc) +{ + struct d3d_shader_resource_view *view = impl_from_ID3D10ShaderResourceView(iface); + + TRACE("iface %p, desc %p.\n", iface, desc); + + memcpy(desc, &view->desc, sizeof(*desc)); +} + +static const struct ID3D10ShaderResourceView1Vtbl d3d10_shader_resource_view_vtbl = { /* IUnknown methods */ d3d10_shader_resource_view_QueryInterface, @@ -1018,15 +1476,18 @@ d3d10_shader_resource_view_GetResource, /* ID3D10ShaderResourceView methods */ d3d10_shader_resource_view_GetDesc, + /* ID3D10ShaderResourceView1 methods */ + d3d10_shader_resource_view_GetDesc1, }; -HRESULT d3d10_shader_resource_view_init(struct d3d10_shader_resource_view *view, struct d3d_device *device, - ID3D10Resource *resource, const D3D10_SHADER_RESOURCE_VIEW_DESC *desc) +static HRESULT d3d_shader_resource_view_init(struct d3d_shader_resource_view *view, struct d3d_device *device, + ID3D11Resource *resource, const D3D11_SHADER_RESOURCE_VIEW_DESC *desc) { struct wined3d_resource *wined3d_resource; HRESULT hr; - view->ID3D10ShaderResourceView_iface.lpVtbl = &d3d10_shader_resource_view_vtbl; + view->ID3D11ShaderResourceView_iface.lpVtbl = &d3d11_shader_resource_view_vtbl; + view->ID3D10ShaderResourceView1_iface.lpVtbl = &d3d10_shader_resource_view_vtbl; view->refcount = 1; if (!desc) @@ -1040,14 +1501,14 @@ } wined3d_mutex_lock(); - if (!(wined3d_resource = wined3d_resource_from_resource(resource))) + if (!(wined3d_resource = wined3d_resource_from_d3d11_resource(resource))) { ERR("Failed to get wined3d resource for d3d10 resource %p.\n", resource); return E_FAIL; } if (FAILED(hr = wined3d_shader_resource_view_create(wined3d_resource, - view, &d3d10_null_wined3d_parent_ops, &view->wined3d_view))) + view, &d3d_null_wined3d_parent_ops, &view->wined3d_view))) { WARN("Failed to create wined3d shader resource view, hr %#x.\n", hr); return hr; @@ -1056,17 +1517,47 @@ wined3d_private_store_init(&view->private_store); wined3d_mutex_unlock(); view->resource = resource; - ID3D10Resource_AddRef(resource); - view->device = &device->ID3D10Device1_iface; - ID3D10Device1_AddRef(view->device); + ID3D11Resource_AddRef(resource); + view->device = &device->ID3D11Device_iface; + ID3D11Device_AddRef(view->device); return S_OK; } -struct d3d10_shader_resource_view *unsafe_impl_from_ID3D10ShaderResourceView(ID3D10ShaderResourceView *iface) +HRESULT d3d_shader_resource_view_create(struct d3d_device *device, ID3D11Resource *resource, + const D3D11_SHADER_RESOURCE_VIEW_DESC *desc, struct d3d_shader_resource_view **view) +{ + struct d3d_shader_resource_view *object; + HRESULT hr; + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + if (FAILED(hr = d3d_shader_resource_view_init(object, device, resource, desc))) + { + WARN("Failed to initialize shader resource view, hr %#x.\n", hr); + HeapFree(GetProcessHeap(), 0, object); + return hr; + } + + TRACE("Created shader resource view %p.\n", object); + *view = object; + + return S_OK; +} + +struct d3d_shader_resource_view *unsafe_impl_from_ID3D11ShaderResourceView(ID3D11ShaderResourceView *iface) +{ + if (!iface) + return NULL; + assert(iface->lpVtbl == &d3d11_shader_resource_view_vtbl); + return impl_from_ID3D11ShaderResourceView(iface); +} + +struct d3d_shader_resource_view *unsafe_impl_from_ID3D10ShaderResourceView(ID3D10ShaderResourceView *iface) { if (!iface) return NULL; - assert(iface->lpVtbl == &d3d10_shader_resource_view_vtbl); - return CONTAINING_RECORD(iface, struct d3d10_shader_resource_view, ID3D10ShaderResourceView_iface); + assert(iface->lpVtbl == (ID3D10ShaderResourceViewVtbl *)&d3d10_shader_resource_view_vtbl); + return CONTAINING_RECORD(iface, struct d3d_shader_resource_view, ID3D10ShaderResourceView1_iface); } diff -Nru wine1.7-1.7.50/dlls/d3d8/d3d8_private.h wine1.7-1.7.55/dlls/d3d8/d3d8_private.h --- wine1.7-1.7.50/dlls/d3d8/d3d8_private.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d8/d3d8_private.h 2015-11-13 14:32:40.000000000 +0000 @@ -176,6 +176,10 @@ LONG device_state; /* Avoids recursion with nested ReleaseRef to 0 */ BOOL inDestruction; + + /* The d3d8 API supports only one implicit swapchain (no D3DCREATE_ADAPTERGROUP_DEVICE, + * no GetSwapchain, GetBackBuffer doesn't accept a swapchain number). */ + struct d3d8_swapchain *implicit_swapchain; }; HRESULT device_init(struct d3d8_device *device, struct d3d8 *parent, struct wined3d *wined3d, UINT adapter, @@ -204,12 +208,13 @@ { IDirect3DVolume8 IDirect3DVolume8_iface; struct d3d8_resource resource; - struct wined3d_volume *wined3d_volume; + struct wined3d_texture *wined3d_texture; + unsigned int sub_resource_idx; struct d3d8_texture *texture; }; -void volume_init(struct d3d8_volume *volume, struct d3d8_texture *texture, - struct wined3d_volume *wined3d_volume, const struct wined3d_parent_ops **parent_ops) DECLSPEC_HIDDEN; +void volume_init(struct d3d8_volume *volume, struct wined3d_texture *wined3d_texture, + unsigned int sub_resource_idx, const struct wined3d_parent_ops **parent_ops) DECLSPEC_HIDDEN; struct d3d8_swapchain { @@ -226,7 +231,8 @@ { IDirect3DSurface8 IDirect3DSurface8_iface; struct d3d8_resource resource; - struct wined3d_surface *wined3d_surface; + struct wined3d_texture *wined3d_texture; + unsigned int sub_resource_idx; struct list rtv_entry; struct wined3d_rendertarget_view *wined3d_rtv; IDirect3DDevice8 *parent_device; @@ -235,8 +241,8 @@ }; struct wined3d_rendertarget_view *d3d8_surface_get_rendertarget_view(struct d3d8_surface *surface) DECLSPEC_HIDDEN; -void surface_init(struct d3d8_surface *surface, IUnknown *container_parent, - struct wined3d_surface *wined3d_surface, const struct wined3d_parent_ops **parent_ops) DECLSPEC_HIDDEN; +void surface_init(struct d3d8_surface *surface, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, + const struct wined3d_parent_ops **parent_ops) DECLSPEC_HIDDEN; struct d3d8_surface *unsafe_impl_from_IDirect3DSurface8(IDirect3DSurface8 *iface) DECLSPEC_HIDDEN; struct d3d8_vertexbuffer diff -Nru wine1.7-1.7.50/dlls/d3d8/device.c wine1.7-1.7.55/dlls/d3d8/device.c --- wine1.7-1.7.50/dlls/d3d8/device.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d8/device.c 2015-11-13 14:32:40.000000000 +0000 @@ -188,9 +188,23 @@ present_parameters->FullScreen_PresentationInterval = swapchain_desc->swap_interval; } -static void wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapchain_desc *swapchain_desc, +static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapchain_desc *swapchain_desc, const D3DPRESENT_PARAMETERS *present_parameters) { + if (!present_parameters->SwapEffect || present_parameters->SwapEffect > D3DSWAPEFFECT_COPY_VSYNC) + { + WARN("Invalid swap effect %u passed.\n", present_parameters->SwapEffect); + return FALSE; + } + if (present_parameters->BackBufferCount > 3 + || ((present_parameters->SwapEffect == D3DSWAPEFFECT_COPY + || present_parameters->SwapEffect == D3DSWAPEFFECT_COPY_VSYNC) + && present_parameters->BackBufferCount > 1)) + { + WARN("Invalid backbuffer count %u.\n", present_parameters->BackBufferCount); + return FALSE; + } + swapchain_desc->backbuffer_width = present_parameters->BackBufferWidth; swapchain_desc->backbuffer_height = present_parameters->BackBufferHeight; swapchain_desc->backbuffer_format = wined3dformat_from_d3dformat(present_parameters->BackBufferFormat); @@ -207,6 +221,8 @@ swapchain_desc->refresh_rate = present_parameters->FullScreen_RefreshRateInHz; swapchain_desc->swap_interval = present_parameters->FullScreen_PresentationInterval; swapchain_desc->auto_restore_display_mode = TRUE; + + return TRUE; } /* Handle table functions */ @@ -518,7 +534,7 @@ wined3d_mutex_lock(); hr = wined3d_device_set_cursor_properties(device->wined3d_device, - hotspot_x, hotspot_y, bitmap_impl->wined3d_surface); + hotspot_x, hotspot_y, bitmap_impl->wined3d_texture, bitmap_impl->sub_resource_idx); wined3d_mutex_unlock(); return hr; @@ -585,7 +601,8 @@ } wined3d_mutex_unlock(); - wined3d_swapchain_desc_from_present_parameters(&desc, present_parameters); + if (!wined3d_swapchain_desc_from_present_parameters(&desc, present_parameters)) + return D3DERR_INVALIDCALL; if (SUCCEEDED(hr = d3d8_swapchain_create(device, &desc, &object))) *swapchain = &object->IDirect3DSwapChain8_iface; present_parameters_from_wined3d_swapchain_desc(present_parameters, &desc); @@ -650,6 +667,8 @@ WARN("App not active, returning D3DERR_DEVICELOST.\n"); return D3DERR_DEVICELOST; } + if (!wined3d_swapchain_desc_from_present_parameters(&swapchain_desc, present_parameters)) + return D3DERR_INVALIDCALL; wined3d_mutex_lock(); @@ -666,7 +685,6 @@ device->index_buffer_size = 0; } - wined3d_swapchain_desc_from_present_parameters(&swapchain_desc, present_parameters); if (SUCCEEDED(hr = wined3d_device_reset(device->wined3d_device, &swapchain_desc, NULL, reset_enum_callback, TRUE))) { @@ -687,45 +705,51 @@ const RECT *dst_rect, HWND dst_window_override, const RGNDATA *dirty_region) { struct d3d8_device *device = impl_from_IDirect3DDevice8(iface); - HRESULT hr; TRACE("iface %p, src_rect %s, dst_rect %s, dst_window_override %p, dirty_region %p.\n", iface, wine_dbgstr_rect(src_rect), wine_dbgstr_rect(dst_rect), dst_window_override, dirty_region); - if (device->device_state != D3D8_DEVICE_STATE_OK) - return D3DERR_DEVICELOST; - - wined3d_mutex_lock(); - hr = wined3d_device_present(device->wined3d_device, src_rect, dst_rect, - dst_window_override, dirty_region, 0); - wined3d_mutex_unlock(); - - return hr; + /* Fraps does not hook IDirect3DDevice8::Present regardless of the hotpatch + * attribute. It only hooks IDirect3DSwapChain8::Present. Yet it properly + * shows a framerate on Windows in applications that only call the device + * method, like e.g. the dx8 sdk samples. The conclusion is that native + * calls the swapchain's public method from the device. */ + return IDirect3DSwapChain8_Present(&device->implicit_swapchain->IDirect3DSwapChain8_iface, + src_rect, dst_rect, dst_window_override, dirty_region); } static HRESULT WINAPI d3d8_device_GetBackBuffer(IDirect3DDevice8 *iface, UINT backbuffer_idx, D3DBACKBUFFER_TYPE backbuffer_type, IDirect3DSurface8 **backbuffer) { struct d3d8_device *device = impl_from_IDirect3DDevice8(iface); - struct wined3d_surface *wined3d_surface = NULL; + struct wined3d_swapchain *wined3d_swapchain; + struct wined3d_resource *wined3d_resource; + struct wined3d_texture *wined3d_texture; struct d3d8_surface *surface_impl; - HRESULT hr; TRACE("iface %p, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n", iface, backbuffer_idx, backbuffer_type, backbuffer); + /* backbuffer_type is ignored by native. */ + + /* No need to check for backbuffer == NULL, Windows crashes in that case. */ wined3d_mutex_lock(); - hr = wined3d_device_get_back_buffer(device->wined3d_device, 0, backbuffer_idx, - (enum wined3d_backbuffer_type)backbuffer_type, &wined3d_surface); - if (SUCCEEDED(hr) && wined3d_surface && backbuffer) - { - surface_impl = wined3d_surface_get_parent(wined3d_surface); - *backbuffer = &surface_impl->IDirect3DSurface8_iface; - IDirect3DSurface8_AddRef(*backbuffer); + + wined3d_swapchain = device->implicit_swapchain->wined3d_swapchain; + if (!(wined3d_texture = wined3d_swapchain_get_back_buffer(wined3d_swapchain, backbuffer_idx))) + { + wined3d_mutex_unlock(); + *backbuffer = NULL; + return D3DERR_INVALIDCALL; } - wined3d_mutex_unlock(); - return hr; + wined3d_resource = wined3d_texture_get_sub_resource(wined3d_texture, 0); + surface_impl = wined3d_resource_get_parent(wined3d_resource); + *backbuffer = &surface_impl->IDirect3DSurface8_iface; + IDirect3DSurface8_AddRef(*backbuffer); + + wined3d_mutex_unlock(); + return D3D_OK; } static HRESULT WINAPI d3d8_device_GetRasterStatus(IDirect3DDevice8 *iface, D3DRASTER_STATUS *raster_status) @@ -1026,7 +1050,7 @@ * destination texture is in WINED3D_POOL_DEFAULT. */ wined3d_mutex_lock(); - wined3d_resource = wined3d_surface_get_resource(src->wined3d_surface); + wined3d_resource = wined3d_texture_get_sub_resource(src->wined3d_texture, src->sub_resource_idx); wined3d_resource_get_desc(wined3d_resource, &wined3d_desc); if (wined3d_desc.usage & WINED3DUSAGE_DEPTHSTENCIL) { @@ -1038,7 +1062,7 @@ src_w = wined3d_desc.width; src_h = wined3d_desc.height; - wined3d_resource = wined3d_surface_get_resource(dst->wined3d_surface); + wined3d_resource = wined3d_texture_get_sub_resource(dst->wined3d_texture, dst->sub_resource_idx); wined3d_resource_get_desc(wined3d_resource, &wined3d_desc); if (wined3d_desc.usage & WINED3DUSAGE_DEPTHSTENCIL) { @@ -1061,8 +1085,8 @@ if (!rect_count && !src_rects && !dst_points) { RECT rect = {0, 0, src_w, src_h}; - wined3d_surface_blt(dst->wined3d_surface, &rect, - src->wined3d_surface, &rect, 0, NULL, WINED3D_TEXF_POINT); + wined3d_texture_blt(dst->wined3d_texture, dst->sub_resource_idx, &rect, + src->wined3d_texture, src->sub_resource_idx, &rect, 0, NULL, WINED3D_TEXF_POINT); } else { @@ -1077,8 +1101,8 @@ RECT dst_rect = {dst_points[i].x, dst_points[i].y, dst_points[i].x + w, dst_points[i].y + h}; - wined3d_surface_blt(dst->wined3d_surface, &dst_rect, - src->wined3d_surface, &src_rects[i], 0, NULL, WINED3D_TEXF_POINT); + wined3d_texture_blt(dst->wined3d_texture, dst->sub_resource_idx, &dst_rect, + src->wined3d_texture, src->sub_resource_idx, &src_rects[i], 0, NULL, WINED3D_TEXF_POINT); } } else @@ -1089,8 +1113,8 @@ UINT h = src_rects[i].bottom - src_rects[i].top; RECT dst_rect = {0, 0, w, h}; - wined3d_surface_blt(dst->wined3d_surface, &dst_rect, - src->wined3d_surface, &src_rects[i], 0, NULL, WINED3D_TEXF_POINT); + wined3d_texture_blt(dst->wined3d_texture, dst->sub_resource_idx, &dst_rect, + src->wined3d_texture, src->sub_resource_idx, &src_rects[i], 0, NULL, WINED3D_TEXF_POINT); } } } @@ -1134,7 +1158,8 @@ } wined3d_mutex_lock(); - hr = wined3d_device_get_front_buffer_data(device->wined3d_device, 0, dst_impl->wined3d_surface); + hr = wined3d_swapchain_get_front_buffer_data(device->implicit_swapchain->wined3d_swapchain, + dst_impl->wined3d_texture, dst_impl->sub_resource_idx); wined3d_mutex_unlock(); return hr; @@ -1170,13 +1195,13 @@ return D3DERR_NOTFOUND; } original_surface = wined3d_rendertarget_view_get_sub_resource_parent(original_rtv); - wined3d_resource = wined3d_surface_get_resource(original_surface->wined3d_surface); + wined3d_resource = wined3d_texture_get_sub_resource(original_surface->wined3d_texture, original_surface->sub_resource_idx); } else - wined3d_resource = wined3d_surface_get_resource(rt_impl->wined3d_surface); + wined3d_resource = wined3d_texture_get_sub_resource(rt_impl->wined3d_texture, rt_impl->sub_resource_idx); wined3d_resource_get_desc(wined3d_resource, &rt_desc); - wined3d_resource = wined3d_surface_get_resource(ds_impl->wined3d_surface); + wined3d_resource = wined3d_texture_get_sub_resource(ds_impl->wined3d_texture, ds_impl->sub_resource_idx); wined3d_resource_get_desc(wined3d_resource, &ds_desc); if (ds_desc.width < rt_desc.width || ds_desc.height < rt_desc.height) @@ -2967,18 +2992,18 @@ } static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent *device_parent, - void *container_parent, struct wined3d_surface *surface, void **parent, + struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, struct wined3d_surface *surface, void **parent, const struct wined3d_parent_ops **parent_ops) { struct d3d8_surface *d3d_surface; - TRACE("device_parent %p, container_parent %p, surface %p, parent %p, parent_ops %p.\n", - device_parent, container_parent, surface, parent, parent_ops); + TRACE("device_parent %p, wined3d_texture %p, sub_resource_idx %u, surface %p, parent %p, parent_ops %p.\n", + device_parent, wined3d_texture, sub_resource_idx, surface, parent, parent_ops); if (!(d3d_surface = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*d3d_surface)))) return E_OUTOFMEMORY; - surface_init(d3d_surface, container_parent, surface, parent_ops); + surface_init(d3d_surface, wined3d_texture, sub_resource_idx, parent_ops); *parent = d3d_surface; TRACE("Created surface %p.\n", d3d_surface); @@ -2986,50 +3011,42 @@ } static HRESULT CDECL device_parent_volume_created(struct wined3d_device_parent *device_parent, - void *container_parent, struct wined3d_volume *volume, void **parent, - const struct wined3d_parent_ops **parent_ops) + struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, + void **parent, const struct wined3d_parent_ops **parent_ops) { struct d3d8_volume *d3d_volume; - TRACE("device_parent %p, container_parent %p, volume %p, parent %p, parent_ops %p.\n", - device_parent, container_parent, volume, parent, parent_ops); + TRACE("device_parent %p, texture %p, sub_resource_idx %u, parent %p, parent_ops %p.\n", + device_parent, wined3d_texture, sub_resource_idx, parent, parent_ops); if (!(d3d_volume = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*d3d_volume)))) return E_OUTOFMEMORY; - volume_init(d3d_volume, container_parent, volume, parent_ops); + volume_init(d3d_volume, wined3d_texture, sub_resource_idx, parent_ops); *parent = d3d_volume; TRACE("Created volume %p.\n", d3d_volume); return D3D_OK; } -static HRESULT CDECL device_parent_create_swapchain_surface(struct wined3d_device_parent *device_parent, - void *container_parent, const struct wined3d_resource_desc *desc, struct wined3d_surface **surface) +static HRESULT CDECL device_parent_create_swapchain_texture(struct wined3d_device_parent *device_parent, + void *container_parent, const struct wined3d_resource_desc *desc, struct wined3d_texture **texture) { struct d3d8_device *device = device_from_device_parent(device_parent); - struct wined3d_resource_desc texture_desc; struct d3d8_surface *d3d_surface; - struct wined3d_texture *texture; HRESULT hr; - TRACE("device_parent %p, container_parent %p, desc %p, surface %p.\n", - device_parent, container_parent, desc, surface); + TRACE("device_parent %p, container_parent %p, desc %p, texture %p.\n", + device_parent, container_parent, desc, texture); - texture_desc = *desc; - texture_desc.resource_type = WINED3D_RTYPE_TEXTURE; - if (FAILED(hr = wined3d_texture_create(device->wined3d_device, &texture_desc, 1, - WINED3D_SURFACE_MAPPABLE, NULL, &device->IDirect3DDevice8_iface, &d3d8_null_wined3d_parent_ops, &texture))) + if (FAILED(hr = wined3d_texture_create(device->wined3d_device, desc, 1, + WINED3D_SURFACE_MAPPABLE, NULL, &device->IDirect3DDevice8_iface, &d3d8_null_wined3d_parent_ops, texture))) { WARN("Failed to create texture, hr %#x.\n", hr); return hr; } - *surface = wined3d_surface_from_resource(wined3d_texture_get_sub_resource(texture, 0)); - wined3d_surface_incref(*surface); - wined3d_texture_decref(texture); - - d3d_surface = wined3d_surface_get_parent(*surface); + d3d_surface = wined3d_resource_get_parent(wined3d_texture_get_sub_resource(*texture, 0)); d3d_surface->parent_device = &device->IDirect3DDevice8_iface; return hr; @@ -3065,7 +3082,7 @@ device_parent_activate, device_parent_surface_created, device_parent_volume_created, - device_parent_create_swapchain_surface, + device_parent_create_swapchain_texture, device_parent_create_swapchain, }; @@ -3090,6 +3107,7 @@ D3DDEVTYPE device_type, HWND focus_window, DWORD flags, D3DPRESENT_PARAMETERS *parameters) { struct wined3d_swapchain_desc swapchain_desc; + struct wined3d_swapchain *wined3d_swapchain; HRESULT hr; device->IDirect3DDevice8_iface.lpVtbl = &d3d8_device_vtbl; @@ -3142,7 +3160,14 @@ if (flags & D3DCREATE_MULTITHREADED) wined3d_device_set_multithreaded(device->wined3d_device); - wined3d_swapchain_desc_from_present_parameters(&swapchain_desc, parameters); + if (!wined3d_swapchain_desc_from_present_parameters(&swapchain_desc, parameters)) + { + wined3d_device_release_focus_window(device->wined3d_device); + wined3d_device_decref(device->wined3d_device); + wined3d_mutex_unlock(); + HeapFree(GetProcessHeap(), 0, device->handle_table.entries); + return D3DERR_INVALIDCALL; + } hr = wined3d_device_init_3d(device->wined3d_device, &swapchain_desc); if (FAILED(hr)) @@ -3169,6 +3194,9 @@ goto err; } + wined3d_swapchain = wined3d_device_get_swapchain(device->wined3d_device, 0); + device->implicit_swapchain = wined3d_swapchain_get_parent(wined3d_swapchain); + device->d3d_parent = &parent->IDirect3D8_iface; IDirect3D8_AddRef(device->d3d_parent); diff -Nru wine1.7-1.7.50/dlls/d3d8/surface.c wine1.7-1.7.55/dlls/d3d8/surface.c --- wine1.7-1.7.50/dlls/d3d8/surface.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d8/surface.c 2015-11-13 14:32:40.000000000 +0000 @@ -30,7 +30,7 @@ static HRESULT WINAPI d3d8_surface_QueryInterface(IDirect3DSurface8 *iface, REFIID riid, void **out) { - TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), out); + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); if (IsEqualGUID(riid, &IID_IDirect3DSurface8) || IsEqualGUID(riid, &IID_IDirect3DResource8) @@ -70,7 +70,7 @@ wined3d_mutex_lock(); if (surface->wined3d_rtv) wined3d_rendertarget_view_incref(surface->wined3d_rtv); - wined3d_surface_incref(surface->wined3d_surface); + wined3d_texture_incref(surface->wined3d_texture); wined3d_mutex_unlock(); } @@ -100,7 +100,7 @@ wined3d_mutex_lock(); if (surface->wined3d_rtv) wined3d_rendertarget_view_decref(surface->wined3d_rtv); - wined3d_surface_decref(surface->wined3d_surface); + wined3d_texture_decref(surface->wined3d_texture); wined3d_mutex_unlock(); if (parent_device) @@ -176,13 +176,13 @@ { struct d3d8_surface *surface = impl_from_IDirect3DSurface8(iface); struct wined3d_resource_desc wined3d_desc; - struct wined3d_resource *wined3d_resource; + struct wined3d_resource *sub_resource; TRACE("iface %p, desc %p.\n", iface, desc); wined3d_mutex_lock(); - wined3d_resource = wined3d_surface_get_resource(surface->wined3d_surface); - wined3d_resource_get_desc(wined3d_resource, &wined3d_desc); + sub_resource = wined3d_texture_get_sub_resource(surface->wined3d_texture, surface->sub_resource_idx); + wined3d_resource_get_desc(sub_resource, &wined3d_desc); wined3d_mutex_unlock(); desc->Format = d3dformat_from_wined3dformat(wined3d_desc.format); @@ -201,6 +201,7 @@ D3DLOCKED_RECT *locked_rect, const RECT *rect, DWORD flags) { struct d3d8_surface *surface = impl_from_IDirect3DSurface8(iface); + struct wined3d_box box; struct wined3d_map_desc map_desc; HRESULT hr; @@ -225,9 +226,16 @@ return D3DERR_INVALIDCALL; } + box.left = rect->left; + box.top = rect->top; + box.right = rect->right; + box.bottom = rect->bottom; + box.front = 0; + box.back = 1; } - hr = wined3d_surface_map(surface->wined3d_surface, &map_desc, rect, flags); + hr = wined3d_resource_map(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx, + &map_desc, rect ? &box : NULL, flags); wined3d_mutex_unlock(); if (SUCCEEDED(hr)) @@ -252,7 +260,7 @@ TRACE("iface %p.\n", iface); wined3d_mutex_lock(); - hr = wined3d_surface_unmap(surface->wined3d_surface); + hr = wined3d_resource_unmap(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx); wined3d_mutex_unlock(); switch(hr) @@ -292,19 +300,20 @@ surface_wined3d_object_destroyed, }; -void surface_init(struct d3d8_surface *surface, IUnknown *container_parent, - struct wined3d_surface *wined3d_surface, const struct wined3d_parent_ops **parent_ops) +void surface_init(struct d3d8_surface *surface, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, + const struct wined3d_parent_ops **parent_ops) { IDirect3DBaseTexture8 *texture; surface->IDirect3DSurface8_iface.lpVtbl = &d3d8_surface_vtbl; d3d8_resource_init(&surface->resource); surface->resource.refcount = 0; - surface->wined3d_surface = wined3d_surface; list_init(&surface->rtv_entry); - surface->container = container_parent; + surface->container = wined3d_texture_get_parent(wined3d_texture); + surface->wined3d_texture = wined3d_texture; + surface->sub_resource_idx = sub_resource_idx; - if (container_parent && SUCCEEDED(IUnknown_QueryInterface(container_parent, + if (surface->container && SUCCEEDED(IUnknown_QueryInterface(surface->container, &IID_IDirect3DBaseTexture8, (void **)&texture))) { surface->texture = unsafe_impl_from_IDirect3DBaseTexture8(texture); @@ -343,8 +352,8 @@ if (surface->wined3d_rtv) return surface->wined3d_rtv; - if (FAILED(hr = wined3d_rendertarget_view_create_from_surface(surface->wined3d_surface, - surface, &d3d8_view_wined3d_parent_ops, &surface->wined3d_rtv))) + if (FAILED(hr = wined3d_rendertarget_view_create_from_sub_resource(surface->wined3d_texture, + surface->sub_resource_idx, surface, &d3d8_view_wined3d_parent_ops, &surface->wined3d_rtv))) { ERR("Failed to create rendertarget view, hr %#x.\n", hr); return NULL; diff -Nru wine1.7-1.7.50/dlls/d3d8/swapchain.c wine1.7-1.7.55/dlls/d3d8/swapchain.c --- wine1.7-1.7.50/dlls/d3d8/swapchain.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d8/swapchain.c 2015-11-13 14:32:40.000000000 +0000 @@ -112,23 +112,33 @@ UINT backbuffer_idx, D3DBACKBUFFER_TYPE backbuffer_type, IDirect3DSurface8 **backbuffer) { struct d3d8_swapchain *swapchain = impl_from_IDirect3DSwapChain8(iface); - struct wined3d_surface *wined3d_surface = NULL; + struct wined3d_resource *wined3d_resource; + struct wined3d_texture *wined3d_texture; struct d3d8_surface *surface_impl; HRESULT hr = D3D_OK; TRACE("iface %p, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n", iface, backbuffer_idx, backbuffer_type, backbuffer); + /* backbuffer_type is ignored by native. */ + + if (!backbuffer) + { + WARN("The output pointer is NULL, returning D3DERR_INVALIDCALL.\n"); + return D3DERR_INVALIDCALL; + } + wined3d_mutex_lock(); - if ((wined3d_surface = wined3d_swapchain_get_back_buffer(swapchain->wined3d_swapchain, - backbuffer_idx, (enum wined3d_backbuffer_type)backbuffer_type))) + if ((wined3d_texture = wined3d_swapchain_get_back_buffer(swapchain->wined3d_swapchain, backbuffer_idx))) { - surface_impl = wined3d_surface_get_parent(wined3d_surface); + wined3d_resource = wined3d_texture_get_sub_resource(wined3d_texture, 0); + surface_impl = wined3d_resource_get_parent(wined3d_resource); *backbuffer = &surface_impl->IDirect3DSurface8_iface; IDirect3DSurface8_AddRef(*backbuffer); } else { + /* Do not set *backbuffer = NULL, see tests/device.c, test_swapchain(). */ hr = D3DERR_INVALIDCALL; } wined3d_mutex_unlock(); diff -Nru wine1.7-1.7.50/dlls/d3d8/tests/device.c wine1.7-1.7.55/dlls/d3d8/tests/device.c --- wine1.7-1.7.50/dlls/d3d8/tests/device.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d8/tests/device.c 2015-11-13 14:32:40.000000000 +0000 @@ -257,7 +257,7 @@ IDirect3DSwapChain8 *swapchain1; IDirect3DSwapChain8 *swapchain2; IDirect3DSwapChain8 *swapchain3; - IDirect3DSurface8 *backbuffer; + IDirect3DSurface8 *backbuffer, *stereo_buffer; D3DPRESENT_PARAMETERS d3dpp; IDirect3DDevice8 *device; IDirect3D8 *d3d; @@ -280,6 +280,30 @@ goto cleanup; } + backbuffer = (void *)0xdeadbeef; + /* IDirect3DDevice8::GetBackBuffer crashes if a NULL output pointer is passed. */ + hr = IDirect3DDevice8_GetBackBuffer(device, 1, D3DBACKBUFFER_TYPE_MONO, &backbuffer); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + ok(!backbuffer, "The back buffer pointer is %p, expected NULL.\n", backbuffer); + + hr = IDirect3DDevice8_GetBackBuffer(device, 0, D3DBACKBUFFER_TYPE_MONO, &backbuffer); + ok(SUCCEEDED(hr), "Failed to get back buffer, hr %#x.\n", hr); + IDirect3DSurface8_Release(backbuffer); + + /* The back buffer type value is ignored. */ + hr = IDirect3DDevice8_GetBackBuffer(device, 0, D3DBACKBUFFER_TYPE_LEFT, &stereo_buffer); + ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr); + ok(stereo_buffer == backbuffer, "Expected left back buffer = %p, got %p.\n", backbuffer, stereo_buffer); + IDirect3DSurface8_Release(stereo_buffer); + hr = IDirect3DDevice8_GetBackBuffer(device, 0, D3DBACKBUFFER_TYPE_RIGHT, &stereo_buffer); + ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr); + ok(stereo_buffer == backbuffer, "Expected right back buffer = %p, got %p.\n", backbuffer, stereo_buffer); + IDirect3DSurface8_Release(stereo_buffer); + hr = IDirect3DDevice8_GetBackBuffer(device, 0, (D3DBACKBUFFER_TYPE)0xdeadbeef, &stereo_buffer); + ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr); + ok(stereo_buffer == backbuffer, "Expected unknown buffer = %p, got %p.\n", backbuffer, stereo_buffer); + IDirect3DSurface8_Release(stereo_buffer); + memset(&d3dpp, 0, sizeof(d3dpp)); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; @@ -300,12 +324,29 @@ ok(SUCCEEDED(hr), "Failed to create a swapchain (%#08x)\n", hr); if(SUCCEEDED(hr)) { /* Swapchain 3, created with backbuffercount 2 */ + hr = IDirect3DSwapChain8_GetBackBuffer(swapchain3, 0, 0, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + backbuffer = (void *) 0xdeadbeef; hr = IDirect3DSwapChain8_GetBackBuffer(swapchain3, 0, 0, &backbuffer); ok(SUCCEEDED(hr), "Failed to get the 1st back buffer (%#08x)\n", hr); ok(backbuffer != NULL && backbuffer != (void *) 0xdeadbeef, "The back buffer is %p\n", backbuffer); if(backbuffer && backbuffer != (void *) 0xdeadbeef) IDirect3DSurface8_Release(backbuffer); + /* The back buffer type value is ignored. */ + hr = IDirect3DSwapChain8_GetBackBuffer(swapchain3, 0, D3DBACKBUFFER_TYPE_LEFT, &stereo_buffer); + ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr); + ok(stereo_buffer == backbuffer, "Expected left back buffer = %p, got %p.\n", backbuffer, stereo_buffer); + IDirect3DSurface8_Release(stereo_buffer); + hr = IDirect3DSwapChain8_GetBackBuffer(swapchain3, 0, D3DBACKBUFFER_TYPE_RIGHT, &stereo_buffer); + ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr); + ok(stereo_buffer == backbuffer, "Expected right back buffer = %p, got %p.\n", backbuffer, stereo_buffer); + IDirect3DSurface8_Release(stereo_buffer); + hr = IDirect3DSwapChain8_GetBackBuffer(swapchain3, 0, (D3DBACKBUFFER_TYPE)0xdeadbeef, &stereo_buffer); + ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr); + ok(stereo_buffer == backbuffer, "Expected unknown buffer = %p, got %p.\n", backbuffer, stereo_buffer); + IDirect3DSurface8_Release(stereo_buffer); + backbuffer = (void *) 0xdeadbeef; hr = IDirect3DSwapChain8_GetBackBuffer(swapchain3, 1, 0, &backbuffer); ok(SUCCEEDED(hr), "Failed to get the 2nd back buffer (%#08x)\n", hr); @@ -793,12 +834,12 @@ ok(SUCCEEDED(hr), "Failed to create cursor surface, hr %#x.\n", hr); /* Initially hidden */ - hr = IDirect3DDevice8_ShowCursor(device, TRUE); - ok(hr == FALSE, "IDirect3DDevice8_ShowCursor returned %#08x\n", hr); + ret = IDirect3DDevice8_ShowCursor(device, TRUE); + ok(!ret, "IDirect3DDevice8_ShowCursor returned %d\n", ret); /* Not enabled without a surface*/ - hr = IDirect3DDevice8_ShowCursor(device, TRUE); - ok(hr == FALSE, "IDirect3DDevice8_ShowCursor returned %#08x\n", hr); + ret = IDirect3DDevice8_ShowCursor(device, TRUE); + ok(!ret, "IDirect3DDevice8_ShowCursor returned %d\n", ret); /* Fails */ hr = IDirect3DDevice8_SetCursorProperties(device, 0, 0, NULL); @@ -816,12 +857,12 @@ ok(info.hCursor == cur, "The cursor handle is %p\n", info.hCursor); /* unchanged */ /* Still hidden */ - hr = IDirect3DDevice8_ShowCursor(device, TRUE); - ok(hr == FALSE, "IDirect3DDevice8_ShowCursor returned %#08x\n", hr); + ret = IDirect3DDevice8_ShowCursor(device, TRUE); + ok(!ret, "IDirect3DDevice8_ShowCursor returned %d\n", ret); /* Enabled now*/ - hr = IDirect3DDevice8_ShowCursor(device, TRUE); - ok(hr == TRUE, "IDirect3DDevice8_ShowCursor returned %#08x\n", hr); + ret = IDirect3DDevice8_ShowCursor(device, TRUE); + ok(ret, "IDirect3DDevice8_ShowCursor returned %d\n", ret); memset(&info, 0, sizeof(info)); info.cbSize = sizeof(info); @@ -7249,6 +7290,161 @@ DestroyWindow(window); } +static void test_swapchain_parameters(void) +{ + IDirect3DDevice8 *device; + IDirect3D8 *d3d; + IDirect3DSurface8 *backbuffer; + HWND window; + HRESULT hr; + unsigned int i, j; + D3DPRESENT_PARAMETERS present_parameters, present_parameters_windowed = {0}; + static const struct + { + BOOL windowed; + UINT backbuffer_count; + D3DSWAPEFFECT swap_effect; + HRESULT hr; + } + tests[] = + { + /* Swap effect 0 is not allowed. */ + {TRUE, 1, 0, D3DERR_INVALIDCALL}, + {FALSE, 1, 0, D3DERR_INVALIDCALL}, + + /* All (non-ex) swap effects are allowed in + * windowed and fullscreen mode. */ + {TRUE, 1, D3DSWAPEFFECT_DISCARD, D3D_OK}, + {TRUE, 1, D3DSWAPEFFECT_FLIP, D3D_OK}, + {FALSE, 1, D3DSWAPEFFECT_DISCARD, D3D_OK}, + {FALSE, 1, D3DSWAPEFFECT_FLIP, D3D_OK}, + {FALSE, 1, D3DSWAPEFFECT_COPY, D3D_OK}, + + /* Only one backbuffer in copy mode. Reset allows it for + * some reason. */ + {TRUE, 0, D3DSWAPEFFECT_COPY, D3D_OK}, + {TRUE, 1, D3DSWAPEFFECT_COPY, D3D_OK}, + {TRUE, 2, D3DSWAPEFFECT_COPY, D3DERR_INVALIDCALL}, + {FALSE, 2, D3DSWAPEFFECT_COPY, D3DERR_INVALIDCALL}, + {TRUE, 0, D3DSWAPEFFECT_COPY_VSYNC, D3D_OK}, + {TRUE, 1, D3DSWAPEFFECT_COPY_VSYNC, D3D_OK}, + {TRUE, 2, D3DSWAPEFFECT_COPY_VSYNC, D3DERR_INVALIDCALL}, + {FALSE, 2, D3DSWAPEFFECT_COPY_VSYNC, D3DERR_INVALIDCALL}, + + /* Ok with the others, in fullscreen and windowed mode. */ + {TRUE, 2, D3DSWAPEFFECT_DISCARD, D3D_OK}, + {TRUE, 2, D3DSWAPEFFECT_FLIP, D3D_OK}, + {FALSE, 2, D3DSWAPEFFECT_DISCARD, D3D_OK}, + {FALSE, 2, D3DSWAPEFFECT_FLIP, D3D_OK}, + + /* Invalid swapeffects. */ + {TRUE, 1, D3DSWAPEFFECT_COPY_VSYNC + 1, D3DERR_INVALIDCALL}, + {FALSE, 1, D3DSWAPEFFECT_COPY_VSYNC + 1, D3DERR_INVALIDCALL}, + + /* 3 is the highest allowed backbuffer count. */ + {TRUE, 3, D3DSWAPEFFECT_DISCARD, D3D_OK}, + {TRUE, 4, D3DSWAPEFFECT_DISCARD, D3DERR_INVALIDCALL}, + {TRUE, 4, D3DSWAPEFFECT_FLIP, D3DERR_INVALIDCALL}, + {FALSE, 4, D3DSWAPEFFECT_DISCARD, D3DERR_INVALIDCALL}, + {FALSE, 4, D3DSWAPEFFECT_FLIP, D3DERR_INVALIDCALL}, + }; + + window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate8(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, NULL))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + IDirect3D8_Release(d3d); + DestroyWindow(window); + return; + } + IDirect3DDevice8_Release(device); + + present_parameters_windowed.BackBufferWidth = registry_mode.dmPelsWidth; + present_parameters_windowed.BackBufferHeight = registry_mode.dmPelsHeight; + present_parameters_windowed.hDeviceWindow = window; + present_parameters_windowed.BackBufferFormat = D3DFMT_X8R8G8B8; + present_parameters_windowed.SwapEffect = D3DSWAPEFFECT_COPY; + present_parameters_windowed.Windowed = TRUE; + present_parameters_windowed.BackBufferCount = 1; + + for (i = 0; i < sizeof(tests) / sizeof(*tests); ++i) + { + UINT bb_count = tests[i].backbuffer_count ? tests[i].backbuffer_count : 1; + + memset(&present_parameters, 0, sizeof(present_parameters)); + present_parameters.BackBufferWidth = registry_mode.dmPelsWidth; + present_parameters.BackBufferHeight = registry_mode.dmPelsHeight; + present_parameters.hDeviceWindow = window; + present_parameters.BackBufferFormat = D3DFMT_X8R8G8B8; + + present_parameters.SwapEffect = tests[i].swap_effect; + present_parameters.Windowed = tests[i].windowed; + present_parameters.BackBufferCount = tests[i].backbuffer_count; + + hr = IDirect3D8_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window, + D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device); + ok(hr == tests[i].hr, "Expected hr %x, got %x, test %u.\n", tests[i].hr, hr, i); + if (SUCCEEDED(hr)) + { + for (j = 0; j < bb_count; ++j) + { + hr = IDirect3DDevice8_GetBackBuffer(device, j, D3DBACKBUFFER_TYPE_MONO, &backbuffer); + ok(SUCCEEDED(hr), "Failed to get backbuffer %u, hr %#x, test %u.\n", j, hr, i); + IDirect3DSurface8_Release(backbuffer); + } + hr = IDirect3DDevice8_GetBackBuffer(device, j, D3DBACKBUFFER_TYPE_MONO, &backbuffer); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %x, test %u.\n", hr, i); + + IDirect3DDevice8_Release(device); + } + + hr = IDirect3D8_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window, + D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters_windowed, &device); + ok(SUCCEEDED(hr), "Failed to create device, hr %#x, test %u.\n", hr, i); + + memset(&present_parameters, 0, sizeof(present_parameters)); + present_parameters.BackBufferWidth = registry_mode.dmPelsWidth; + present_parameters.BackBufferHeight = registry_mode.dmPelsHeight; + present_parameters.hDeviceWindow = window; + present_parameters.BackBufferFormat = D3DFMT_X8R8G8B8; + + present_parameters.SwapEffect = tests[i].swap_effect; + present_parameters.Windowed = tests[i].windowed; + present_parameters.BackBufferCount = tests[i].backbuffer_count; + + hr = IDirect3DDevice8_Reset(device, &present_parameters); + ok(hr == tests[i].hr, "Expected hr %x, got %x, test %u.\n", tests[i].hr, hr, i); + + if (FAILED(hr)) + { + hr = IDirect3DDevice8_Reset(device, &present_parameters_windowed); + ok(SUCCEEDED(hr), "Failed to reset device, hr %#x, test %u.\n", hr, i); + } + else + { + for (j = 0; j < bb_count; ++j) + { + hr = IDirect3DDevice8_GetBackBuffer(device, j, D3DBACKBUFFER_TYPE_MONO, &backbuffer); + if (j) + todo_wine ok(SUCCEEDED(hr), "Failed to get backbuffer %u, hr %#x, test %u.\n", j, hr, i); + else + ok(SUCCEEDED(hr), "Failed to get backbuffer %u, hr %#x, test %u.\n", j, hr, i); + if (SUCCEEDED(hr)) + IDirect3DSurface8_Release(backbuffer); + } + hr = IDirect3DDevice8_GetBackBuffer(device, j, D3DBACKBUFFER_TYPE_MONO, &backbuffer); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %x, test %u.\n", hr, i); + } + IDirect3DDevice8_Release(device); + } + + IDirect3D8_Release(d3d); + DestroyWindow(window); +} + START_TEST(device) { HMODULE d3d8_handle = LoadLibraryA( "d3d8.dll" ); @@ -7347,6 +7543,7 @@ test_writeonly_resource(); test_lost_device(); test_resource_priority(); + test_swapchain_parameters(); UnregisterClassA("d3d8_test_wc", GetModuleHandleA(NULL)); } diff -Nru wine1.7-1.7.50/dlls/d3d8/tests/stateblock.c wine1.7-1.7.55/dlls/d3d8/tests/stateblock.c --- wine1.7-1.7.50/dlls/d3d8/tests/stateblock.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d8/tests/stateblock.c 2015-11-13 14:32:40.000000000 +0000 @@ -1270,7 +1270,7 @@ data->states[idx++] = TRUE; /* ALPHABLENDENABLE */ data->states[idx++] = TRUE; /* FOGENABLE */ data->states[idx++] = TRUE; /* SPECULARENABLE */ - data->states[idx++] = 1 << 31; /* FOGCOLOR */ + data->states[idx++] = 1u << 31; /* FOGCOLOR */ data->states[idx++] = D3DFOG_EXP; /* FOGTABLEMODE */ data->states[idx++] = to_dword(0.1f); /* FOGSTART */ data->states[idx++] = to_dword(0.8f); /* FOGEND */ diff -Nru wine1.7-1.7.50/dlls/d3d8/tests/visual.c wine1.7-1.7.55/dlls/d3d8/tests/visual.c --- wine1.7-1.7.50/dlls/d3d8/tests/visual.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d8/tests/visual.c 2015-11-13 14:32:40.000000000 +0000 @@ -52,66 +52,134 @@ return TRUE; } -static DWORD getPixelColor(IDirect3DDevice8 *device, UINT x, UINT y) +static BOOL adapter_is_warp(const D3DADAPTER_IDENTIFIER8 *identifier) { - DWORD ret; + return !strcmp(identifier->Driver, "d3d10warp.dll"); +} + +struct surface_readback +{ + IDirect3DSurface8 *surface; + D3DLOCKED_RECT locked_rect; +}; + +static void get_rt_readback(IDirect3DSurface8 *surface, struct surface_readback *rb) +{ + IDirect3DDevice8 *device; IDirect3DTexture8 *tex = NULL; - IDirect3DSurface8 *surf = NULL, *backbuf = NULL; HRESULT hr; - D3DLOCKED_RECT lockedRect; - RECT rectToLock = {x, y, x+1, y+1}; - hr = IDirect3DDevice8_CreateTexture(device, 640, 480, 1 /* Levels */, 0, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &tex); - if(FAILED(hr) || !tex ) /* This is not a test */ + memset(rb, 0, sizeof(*rb)); + IDirect3DSurface8_GetDevice(surface, &device); + hr = IDirect3DDevice8_CreateTexture(device, 640, 480, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &tex); + if (FAILED(hr) || !tex) { - trace("Can't create an offscreen plain surface to read the render target data, hr=%#08x\n", hr); - return 0xdeadbeef; + trace("Can't create an offscreen plain surface to read the render target data, hr %#x.\n", hr); + goto error; } - hr = IDirect3DTexture8_GetSurfaceLevel(tex, 0, &surf); - if (FAILED(hr)) /* This is not a test */ + hr = IDirect3DTexture8_GetSurfaceLevel(tex, 0, &rb->surface); + if (FAILED(hr)) { - trace("Can't get surface from texture, hr=%#08x\n", hr); - ret = 0xdeadbeee; - goto out; + trace("Can't get surface from texture, hr %#x.\n", hr); + goto error; } - - hr = IDirect3DDevice8_GetRenderTarget(device, &backbuf); - if(FAILED(hr)) + hr = IDirect3DDevice8_CopyRects(device, surface, NULL, 0, rb->surface, NULL); + if (FAILED(hr)) { - trace("Can't get the render target, hr=%#08x\n", hr); - ret = 0xdeadbeed; - goto out; + trace("Can't read the render target, hr %#x.\n", hr); + goto error; } - hr = IDirect3DDevice8_CopyRects(device, backbuf, NULL, 0, surf, NULL); - if(FAILED(hr)) + hr = IDirect3DSurface8_LockRect(rb->surface, &rb->locked_rect, NULL, D3DLOCK_READONLY); + if (FAILED(hr)) { - trace("Can't read the render target, hr=%#08x\n", hr); - ret = 0xdeadbeec; - goto out; + trace("Can't lock the offscreen surface, hr %#x.\n", hr); + goto error; } + IDirect3DTexture8_Release(tex); + IDirect3DDevice8_Release(device); + return; - hr = IDirect3DSurface8_LockRect(surf, &lockedRect, &rectToLock, D3DLOCK_READONLY); - if(FAILED(hr)) +error: + if (rb->surface) + IDirect3DSurface8_Release(rb->surface); + rb->surface = NULL; + if (tex) + IDirect3DTexture8_Release(tex); + IDirect3DDevice8_Release(device); +} + +static DWORD get_readback_color(struct surface_readback *rb, unsigned int x, unsigned int y) +{ + return rb->locked_rect.pBits + ? ((DWORD *)rb->locked_rect.pBits)[y * rb->locked_rect.Pitch / sizeof(DWORD) + x] : 0xdeadbeef; +} + +static void release_surface_readback(struct surface_readback *rb) +{ + HRESULT hr; + + if (!rb->surface) + return; + if (rb->locked_rect.pBits && FAILED(hr = IDirect3DSurface8_UnlockRect(rb->surface))) + trace("Can't unlock the offscreen surface, hr %#x.\n", hr); + IDirect3DSurface8_Release(rb->surface); +} + +static DWORD getPixelColor(IDirect3DDevice8 *device, UINT x, UINT y) +{ + DWORD ret; + IDirect3DSurface8 *rt; + struct surface_readback rb; + HRESULT hr; + + hr = IDirect3DDevice8_GetRenderTarget(device, &rt); + if (FAILED(hr)) { - trace("Can't lock the offscreen surface, hr=%#08x\n", hr); - ret = 0xdeadbeeb; - goto out; + trace("Can't get the render target, hr %#x.\n", hr); + return 0xdeadbeef; } + + get_rt_readback(rt, &rb); /* Remove the X channel for now. DirectX and OpenGL have different ideas how to treat it apparently, and it isn't * really important for these tests */ - ret = ((DWORD *) lockedRect.pBits)[0] & 0x00ffffff; - hr = IDirect3DSurface8_UnlockRect(surf); - if(FAILED(hr)) + ret = get_readback_color(&rb, x, y) & 0x00ffffff; + release_surface_readback(&rb); + + IDirect3DSurface8_Release(rt); + return ret; +} + +static D3DCOLOR get_surface_color(IDirect3DSurface8 *surface, UINT x, UINT y) +{ + DWORD color; + HRESULT hr; + D3DSURFACE_DESC desc; + RECT rectToLock = {x, y, x+1, y+1}; + D3DLOCKED_RECT lockedRect; + + hr = IDirect3DSurface8_GetDesc(surface, &desc); + ok(SUCCEEDED(hr), "Failed to get surface description, hr=%#x.\n", hr); + + hr = IDirect3DSurface8_LockRect(surface, &lockedRect, &rectToLock, D3DLOCK_READONLY); + ok(SUCCEEDED(hr), "Failed to lock surface, hr=%#x.\n", hr); + + switch(desc.Format) { - trace("Can't unlock the offscreen surface, hr=%#08x\n", hr); + case D3DFMT_A8R8G8B8: + color = ((D3DCOLOR *)lockedRect.pBits)[0]; + break; + + default: + trace("Error: unknown surface format: %u.\n", desc.Format); + color = 0xdeadbeef; + break; } -out: - if(backbuf) IDirect3DSurface8_Release(backbuf); - if(surf) IDirect3DSurface8_Release(surf); - if(tex) IDirect3DTexture8_Release(tex); - return ret; + hr = IDirect3DSurface8_UnlockRect(surface); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr=%#x.\n", hr); + + return color; } static IDirect3DDevice8 *create_device(IDirect3D8 *d3d, HWND device_window, HWND focus_window, BOOL windowed) @@ -3472,6 +3540,7 @@ static void intz_test(void) { IDirect3DSurface8 *original_rt, *rt; + struct surface_readback rb; IDirect3DTexture8 *texture; IDirect3DDevice8 *device; IDirect3DSurface8 *ds; @@ -3486,15 +3555,12 @@ static const DWORD ps_code[] = { 0xffff0101, /* ps_1_1 */ - 0x00000051, 0xa00f0000, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, /* def c0, 1.0, 0.0, 0.0, 0.0 */ + 0x00000051, 0xa00f0000, 0x3f800000, 0x00000000, 0x3f800000, 0x3f800000, /* def c0, 1.0, 0.0, 1.0, 1.0 */ 0x00000051, 0xa00f0001, 0x00000000, 0x3f800000, 0x00000000, 0x00000000, /* def c1, 0.0, 1.0, 0.0, 0.0 */ - 0x00000051, 0xa00f0002, 0x00000000, 0x00000000, 0x3f800000, 0x00000000, /* def c2, 0.0, 0.0, 1.0, 0.0 */ 0x00000042, 0xb00f0000, /* tex t0 */ 0x00000042, 0xb00f0001, /* tex t1 */ - 0x00000008, 0xb0070001, 0xa0e40000, 0xb0e40001, /* dp3 t1.xyz, c0, t1 */ - 0x00000005, 0x80070000, 0xa0e40001, 0xb0e40001, /* mul r0.xyz, c1, t1 */ - 0x00000004, 0x80070000, 0xa0e40000, 0xb0e40000, 0x80e40000, /* mad r0.xyz, c0, t0, r0 */ - 0x40000001, 0x80080000, 0xa0aa0002, /* +mov r0.w, c2.z */ + 0x00000005, 0xb00f0000, 0xa0e40000, 0xb0e40000, /* mul t0, c0, t0 */ + 0x00000004, 0x800f0000, 0xa0e40001, 0xb0e40001, 0xb0e40000, /* mad r0, c1, t1, t0 */ 0x0000ffff, /* end */ }; static const struct @@ -3531,14 +3597,14 @@ } expected_colors[] = { - { 80, 100, D3DCOLOR_ARGB(0x00, 0x20, 0x40, 0x00)}, - {240, 100, D3DCOLOR_ARGB(0x00, 0x60, 0xbf, 0x00)}, - {400, 100, D3DCOLOR_ARGB(0x00, 0x9f, 0x40, 0x00)}, - {560, 100, D3DCOLOR_ARGB(0x00, 0xdf, 0xbf, 0x00)}, - { 80, 450, D3DCOLOR_ARGB(0x00, 0x20, 0x40, 0x00)}, - {240, 450, D3DCOLOR_ARGB(0x00, 0x60, 0xbf, 0x00)}, - {400, 450, D3DCOLOR_ARGB(0x00, 0x9f, 0x40, 0x00)}, - {560, 450, D3DCOLOR_ARGB(0x00, 0xdf, 0xbf, 0x00)}, + { 80, 100, 0x20204020}, + {240, 100, 0x6060bf60}, + {400, 100, 0x9f9f409f}, + {560, 100, 0xdfdfbfdf}, + { 80, 450, 0x20204020}, + {240, 450, 0x6060bf60}, + {400, 450, 0x9f9f409f}, + {560, 450, 0xdfdfbfdf}, }; window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, @@ -3659,13 +3725,15 @@ hr = IDirect3DDevice8_EndScene(device); ok(SUCCEEDED(hr), "EndScene failed, hr %#x.\n", hr); + get_rt_readback(original_rt, &rb); for (i = 0; i < sizeof(expected_colors) / sizeof(*expected_colors); ++i) { - D3DCOLOR color = getPixelColor(device, expected_colors[i].x, expected_colors[i].y); + D3DCOLOR color = get_readback_color(&rb, expected_colors[i].x, expected_colors[i].y); ok(color_match(color, expected_colors[i].color, 1), "Expected color 0x%08x at (%u, %u), got 0x%08x.\n", expected_colors[i].color, expected_colors[i].x, expected_colors[i].y, color); } + release_surface_readback(&rb); hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed, hr %#x.\n", hr); @@ -3715,13 +3783,15 @@ hr = IDirect3DDevice8_EndScene(device); ok(SUCCEEDED(hr), "EndScene failed, hr %#x.\n", hr); + get_rt_readback(original_rt, &rb); for (i = 0; i < sizeof(expected_colors) / sizeof(*expected_colors); ++i) { - D3DCOLOR color = getPixelColor(device, expected_colors[i].x, expected_colors[i].y); + D3DCOLOR color = get_readback_color(&rb, expected_colors[i].x, expected_colors[i].y); ok(color_match(color, expected_colors[i].color, 1), "Expected color 0x%08x at (%u, %u), got 0x%08x.\n", expected_colors[i].color, expected_colors[i].x, expected_colors[i].y, color); } + release_surface_readback(&rb); hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed, hr %#x.\n", hr); @@ -3781,13 +3851,15 @@ hr = IDirect3DDevice8_EndScene(device); ok(SUCCEEDED(hr), "EndScene failed, hr %#x.\n", hr); + get_rt_readback(original_rt, &rb); for (i = 0; i < sizeof(expected_colors) / sizeof(*expected_colors); ++i) { - D3DCOLOR color = getPixelColor(device, expected_colors[i].x, expected_colors[i].y); + D3DCOLOR color = get_readback_color(&rb, expected_colors[i].x, expected_colors[i].y); ok(color_match(color, expected_colors[i].color, 1), "Expected color 0x%08x at (%u, %u), got 0x%08x.\n", expected_colors[i].color, expected_colors[i].x, expected_colors[i].y, color); } + release_surface_readback(&rb); hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed, hr %#x.\n", hr); @@ -3807,6 +3879,7 @@ static void shadow_test(void) { IDirect3DSurface8 *original_rt, *rt; + struct surface_readback rb; IDirect3DDevice8 *device; IDirect3D8 *d3d; ULONG refcount; @@ -3819,15 +3892,12 @@ static const DWORD ps_code[] = { 0xffff0101, /* ps_1_1 */ - 0x00000051, 0xa00f0000, 0x3f800000, 0x00000000, 0x00000000, 0x00000000, /* def c0, 1.0, 0.0, 0.0, 0.0 */ + 0x00000051, 0xa00f0000, 0x3f800000, 0x00000000, 0x3f800000, 0x3f800000, /* def c0, 1.0, 0.0, 1.0, 1.0 */ 0x00000051, 0xa00f0001, 0x00000000, 0x3f800000, 0x00000000, 0x00000000, /* def c1, 0.0, 1.0, 0.0, 0.0 */ - 0x00000051, 0xa00f0002, 0x00000000, 0x00000000, 0x3f800000, 0x00000000, /* def c2, 0.0, 0.0, 1.0, 0.0 */ 0x00000042, 0xb00f0000, /* tex t0 */ 0x00000042, 0xb00f0001, /* tex t1 */ - 0x00000008, 0xb0070001, 0xa0e40000, 0xb0e40001, /* dp3 t1.xyz, c0, t1 */ - 0x00000005, 0x80070000, 0xa0e40001, 0xb0e40001, /* mul r0.xyz, c1, t1 */ - 0x00000004, 0x80070000, 0xa0e40000, 0xb0e40000, 0x80e40000, /* mad r0.xyz, c0, t0, r0 */ - 0x40000001, 0x80080000, 0xa0aa0002, /* +mov r0.w, c2.z */ + 0x00000005, 0xb00f0000, 0xa0e40000, 0xb0e40000, /* mul t0, c0, t0 */ + 0x00000004, 0x800f0000, 0xa0e40001, 0xb0e40001, 0xb0e40000, /* mad r0, c1, t1, t0 */ 0x0000ffff, /* end */ }; static const struct @@ -3865,14 +3935,14 @@ } expected_colors[] = { - {400, 60, D3DCOLOR_ARGB(0x00, 0x00, 0x00, 0x00)}, - {560, 180, D3DCOLOR_ARGB(0x00, 0xff, 0x00, 0x00)}, - {560, 300, D3DCOLOR_ARGB(0x00, 0xff, 0x00, 0x00)}, - {400, 420, D3DCOLOR_ARGB(0x00, 0xff, 0xff, 0x00)}, - {240, 420, D3DCOLOR_ARGB(0x00, 0xff, 0xff, 0x00)}, - { 80, 300, D3DCOLOR_ARGB(0x00, 0x00, 0x00, 0x00)}, - { 80, 180, D3DCOLOR_ARGB(0x00, 0x00, 0x00, 0x00)}, - {240, 60, D3DCOLOR_ARGB(0x00, 0x00, 0x00, 0x00)}, + {400, 60, 0x00000000}, + {560, 180, 0xffff00ff}, + {560, 300, 0xffff00ff}, + {400, 420, 0xffffffff}, + {240, 420, 0xffffffff}, + { 80, 300, 0x00000000}, + { 80, 180, 0x00000000}, + {240, 60, 0x00000000}, }; window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, @@ -3999,14 +4069,16 @@ ok(SUCCEEDED(hr), "SetTexture failed, hr %#x.\n", hr); IDirect3DTexture8_Release(texture); + get_rt_readback(original_rt, &rb); for (j = 0; j < sizeof(expected_colors) / sizeof(*expected_colors); ++j) { - D3DCOLOR color = getPixelColor(device, expected_colors[j].x, expected_colors[j].y); + D3DCOLOR color = get_readback_color(&rb, expected_colors[j].x, expected_colors[j].y); ok(color_match(color, expected_colors[j].color, 0), "Expected color 0x%08x at (%u, %u) for format %s, got 0x%08x.\n", expected_colors[j].color, expected_colors[j].x, expected_colors[j].y, formats[i].name, color); } + release_surface_readback(&rb); hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed, hr %#x.\n", hr); @@ -6660,7 +6732,7 @@ color = getPixelColor(device, 320, 240); ok (color_match(color, 0x007f7f00, 2) || broken(tests[i].broken) - || broken(color == 0xdeadbeec), /* WARP device often just breaks down. */ + || broken(color == 0x00adbeef), /* WARP device often just breaks down. */ "Got unexpected color 0x%08x, case %u, %u.\n", color, t, i); } @@ -7134,31 +7206,36 @@ } else { - color = getPixelColor(device, 64 - size / 2 + 1, 64 - size / 2 + 1); + struct surface_readback rb; + + get_rt_readback(rt, &rb); + color = get_readback_color(&rb, 64 - size / 2 + 1, 64 - size / 2 + 1); ok(color_match(color, 0x00ff0000, 0), "Got unexpected color 0x%08x (case %u, %u, size %u).\n", color, i, j, size); - color = getPixelColor(device, 64 + size / 2 - 1, 64 - size / 2 + 1); + color = get_readback_color(&rb, 64 + size / 2 - 1, 64 - size / 2 + 1); ok(color_match(color, 0x00ffff00, 0), "Got unexpected color 0x%08x (case %u, %u, size %u).\n", color, i, j, size); - color = getPixelColor(device, 64 - size / 2 + 1, 64 + size / 2 - 1); + color = get_readback_color(&rb, 64 - size / 2 + 1, 64 + size / 2 - 1); ok(color_match(color, 0x00000000, 0), "Got unexpected color 0x%08x (case %u, %u, size %u).\n", color, i, j, size); - color = getPixelColor(device, 64 + size / 2 - 1, 64 + size / 2 - 1); + color = get_readback_color(&rb, 64 + size / 2 - 1, 64 + size / 2 - 1); ok(color_match(color, 0x0000ff00, 0), "Got unexpected color 0x%08x (case %u, %u, size %u).\n", color, i, j, size); - color = getPixelColor(device, 64 - size / 2 - 1, 64 - size / 2 - 1); - ok(color_match(color, 0x0000ffff, 0), + color = get_readback_color(&rb, 64 - size / 2 - 1, 64 - size / 2 - 1); + ok(color_match(color, 0xff00ffff, 0), "Got unexpected color 0x%08x (case %u, %u, size %u).\n", color, i, j, size); - color = getPixelColor(device, 64 + size / 2 + 1, 64 - size / 2 - 1); - ok(color_match(color, 0x0000ffff, 0), + color = get_readback_color(&rb, 64 + size / 2 + 1, 64 - size / 2 - 1); + ok(color_match(color, 0xff00ffff, 0), "Got unexpected color 0x%08x (case %u, %u, size %u).\n", color, i, j, size); - color = getPixelColor(device, 64 - size / 2 - 1, 64 + size / 2 + 1); - ok(color_match(color, 0x0000ffff, 0), + color = get_readback_color(&rb, 64 - size / 2 - 1, 64 + size / 2 + 1); + ok(color_match(color, 0xff00ffff, 0), "Got unexpected color 0x%08x (case %u, %u, size %u).\n", color, i, j, size); - color = getPixelColor(device, 64 + size / 2 + 1, 64 + size / 2 + 1); - ok(color_match(color, 0x0000ffff, 0), + color = get_readback_color(&rb, 64 + size / 2 + 1, 64 + size / 2 + 1); + ok(color_match(color, 0xff00ffff, 0), "Got unexpected color 0x%08x (case %u, %u, size %u).\n", color, i, j, size); + + release_surface_readback(&rb); } } IDirect3DDevice8_SetVertexShader(device, 0); @@ -7885,6 +7962,547 @@ DestroyWindow(window); } +static void test_flip(void) +{ + IDirect3DDevice8 *device; + IDirect3D8 *d3d; + ULONG refcount; + HWND window; + HRESULT hr; + IDirect3DSurface8 *back_buffers[3], *test_surface; + unsigned int i; + D3DCOLOR color; + D3DPRESENT_PARAMETERS present_parameters = {0}; + + window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate8(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + + present_parameters.BackBufferWidth = 640; + present_parameters.BackBufferHeight = 480; + present_parameters.BackBufferFormat = D3DFMT_A8R8G8B8; + present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD; + present_parameters.hDeviceWindow = window; + present_parameters.Windowed = TRUE; + present_parameters.BackBufferCount = 3; + present_parameters.Flags = D3DPRESENTFLAG_LOCKABLE_BACKBUFFER; + hr = IDirect3D8_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + window, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device); + if (!device) + { + skip("Failed to create a D3D device, skipping tests.\n"); + IDirect3D8_Release(d3d); + DestroyWindow(window); + return; + } + + for (i = 0; i < sizeof(back_buffers) / sizeof(*back_buffers); ++i) + { + hr = IDirect3DDevice8_GetBackBuffer(device, i, D3DBACKBUFFER_TYPE_MONO, &back_buffers[i]); + ok(SUCCEEDED(hr), "Failed to get back buffer, hr %#x.\n", hr); + } + hr = IDirect3DDevice8_GetRenderTarget(device, &test_surface); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + ok(test_surface == back_buffers[0], "Expected render target %p, got %p.\n", back_buffers[0], test_surface); + IDirect3DSurface8_Release(test_surface); + + + hr = IDirect3DDevice8_SetRenderTarget(device, back_buffers[0], NULL); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff0000, 0.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x\n", hr); + + hr = IDirect3DDevice8_SetRenderTarget(device, back_buffers[1], NULL); + ok(SUCCEEDED(hr), "Failed to set render target, 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_SetRenderTarget(device, back_buffers[2], NULL); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff0000ff, 0.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x\n", hr); + + hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); + + /* Render target is unmodified. */ + hr = IDirect3DDevice8_GetRenderTarget(device, &test_surface); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + ok(test_surface == back_buffers[2], "Expected render target %p, got %p.\n", back_buffers[2], test_surface); + IDirect3DSurface8_Release(test_surface); + + /* Backbuffer surface pointers are unmodified */ + for (i = 0; i < sizeof(back_buffers) / sizeof(*back_buffers); ++i) + { + hr = IDirect3DDevice8_GetBackBuffer(device, i, D3DBACKBUFFER_TYPE_MONO, &test_surface); + ok(SUCCEEDED(hr), "Failed to get back buffer, hr %#x.\n", hr); + ok(test_surface == back_buffers[i], "Expected back buffer %u = %p, got %p.\n", + i, back_buffers[i], test_surface); + IDirect3DSurface8_Release(test_surface); + } + + /* Contents were changed. */ + color = get_surface_color(back_buffers[0], 1, 1); + todo_wine ok(color == 0xff00ff00, "Got unexpected color 0x%08x.\n", color); + color = get_surface_color(back_buffers[1], 1, 1); + todo_wine ok(color == 0xff0000ff, "Got unexpected color 0x%08x.\n", color); + + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff808080, 0.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x\n", hr); + + hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); + + color = get_surface_color(back_buffers[0], 1, 1); + todo_wine ok(color == 0xff0000ff, "Got unexpected color 0x%08x.\n", color); + color = get_surface_color(back_buffers[1], 1, 1); + todo_wine ok(color == 0xff808080, "Got unexpected color 0x%08x.\n", color); + + hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); + + color = get_surface_color(back_buffers[0], 1, 1); + todo_wine ok(color == 0xff808080, "Got unexpected color 0x%08x.\n", color); + + for (i = 0; i < sizeof(back_buffers) / sizeof(*back_buffers); ++i) + IDirect3DSurface8_Release(back_buffers[i]); + + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D8_Release(d3d); + DestroyWindow(window); +} + +static void test_uninitialized_varyings(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(0, D3DVSDT_FLOAT3), + D3DVSD_CONST(0, 1), 0x3f000000, 0x3f000000, 0x3f000000, 0x3f000000, /* def c0, 0.5, 0.5, 0.5, 0.5 */ + D3DVSD_END() + }; + static const DWORD vs1_code[] = + { + 0xfffe0101, /* vs_1_1 */ + 0x00000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */ + 0x0000ffff + }; + static const DWORD vs1_partial_code[] = + { + 0xfffe0101, /* vs_1_1 */ + 0x00000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */ + 0x00000001, 0xd0010000, 0xa0e40000, /* mov oD0.x, c0 */ + 0x00000001, 0xd0010001, 0xa0e40000, /* mov oD1.x, c0 */ + 0x00000001, 0xe0010000, 0xa0e40000, /* mov oT0.x, c0 */ + 0x0000ffff + }; + static const DWORD ps1_diffuse_code[] = + { + 0xffff0101, /* ps_1_1 */ + 0x00000001, 0x800f0000, 0x90e40000, /* mov r0, v0 */ + 0x0000ffff + }; + static const DWORD ps1_specular_code[] = + { + 0xffff0101, /* ps_1_1 */ + 0x00000001, 0x800f0000, 0x90e40001, /* mov r0, v1 */ + 0x0000ffff + }; + static const DWORD ps1_texcoord_code[] = + { + 0xffff0101, /* ps_1_1 */ + 0x00000040, 0xb00f0000, /* texcoord t0 */ + 0x00000001, 0x800f0000, 0xb0e40000, /* mov r0, t0 */ + 0x0000ffff + }; + static const struct + { + DWORD vs_version; + const DWORD *vs; + DWORD ps_version; + const DWORD *ps; + D3DCOLOR expected; + BOOL allow_zero_alpha; + BOOL broken_warp; + } + /* On AMD specular color is generally initialized to 0x00000000 and texcoords to 0xff000000 + * while on Nvidia it's the opposite. Just allow both. */ + tests[] = + { + {D3DVS_VERSION(1, 1), vs1_code, 0, NULL, 0xffffffff}, + { 0, NULL, D3DPS_VERSION(1, 1), ps1_texcoord_code, 0xff000000, TRUE}, + {D3DVS_VERSION(1, 1), vs1_code, D3DPS_VERSION(1, 1), ps1_diffuse_code, 0xffffffff}, + {D3DVS_VERSION(1, 1), vs1_code, D3DPS_VERSION(1, 1), ps1_specular_code, 0xff000000, TRUE, TRUE}, + {D3DVS_VERSION(1, 1), vs1_code, D3DPS_VERSION(1, 1), ps1_texcoord_code, 0xff000000, TRUE}, + {D3DVS_VERSION(1, 1), vs1_partial_code, 0, NULL, 0xff7fffff, FALSE, TRUE}, + {D3DVS_VERSION(1, 1), vs1_partial_code, D3DPS_VERSION(1, 1), ps1_diffuse_code, 0xff7fffff, FALSE, TRUE}, + {D3DVS_VERSION(1, 1), vs1_partial_code, D3DPS_VERSION(1, 1), ps1_specular_code, 0xff7f0000, TRUE}, + {D3DVS_VERSION(1, 1), vs1_partial_code, D3DPS_VERSION(1, 1), ps1_texcoord_code, 0xff7f0000, TRUE}, + }; + IDirect3DDevice8 *device; + IDirect3D8 *d3d; + HWND window; + HRESULT hr; + DWORD vs, ps; + unsigned int i; + ULONG refcount; + D3DCAPS8 caps; + IDirect3DSurface8 *backbuffer; + D3DADAPTER_IDENTIFIER8 identifier; + struct surface_readback rb; + D3DCOLOR color; + BOOL warp; + + 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 = IDirect3D8_GetAdapterIdentifier(d3d, D3DADAPTER_DEFAULT, 0, &identifier); + ok(SUCCEEDED(hr), "Failed to get adapter identifier, hr %#x.\n", hr); + warp = adapter_is_warp(&identifier); + + hr = IDirect3DDevice8_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); + + hr = IDirect3DDevice8_GetBackBuffer(device, 0, D3DBACKBUFFER_TYPE_MONO, &backbuffer); + ok(SUCCEEDED(hr), "Failed to get back buffer, 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); + + 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); + hr = IDirect3DDevice8_SetVertexShader(device, vs); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); + } + else + { + vs = 0; + hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); + } + 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_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); + + get_rt_readback(backbuffer, &rb); + color = get_readback_color(&rb, 320, 240); + ok(color_match(color, tests[i].expected, 1) + || (tests[i].allow_zero_alpha && color_match(color, tests[i].expected & 0x00ffffff, 1)) + || (broken(warp && tests[i].broken_warp)), + "Got unexpected color 0x%08x, case %u.\n", color, i); + release_surface_readback(&rb); + + if (vs) + 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); + + IDirect3DSurface8_Release(backbuffer); + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D8_Release(d3d); + DestroyWindow(window); +} + +static void test_shademode(void) +{ + IDirect3DVertexBuffer8 *vb_strip; + IDirect3DVertexBuffer8 *vb_list; + IDirect3DDevice8 *device; + DWORD color0, color1; + BYTE *data = NULL; + IDirect3D8 *d3d; + ULONG refcount; + D3DCAPS8 caps; + DWORD vs, ps; + HWND window; + HRESULT hr; + UINT i; + static const DWORD decl[] = + { + D3DVSD_STREAM(0), + D3DVSD_REG(D3DVSDE_POSITION, D3DVSDT_FLOAT3), + D3DVSD_REG(D3DVSDE_DIFFUSE, D3DVSDT_D3DCOLOR), + D3DVSD_END() + }; + static const DWORD vs1_code[] = + { + 0xfffe0101, /* vs_1_1 */ + 0x00000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */ + 0x00000001, 0xd00f0000, 0x90e40005, /* mov oD0, v5 */ + 0x0000ffff + }; + static const DWORD ps1_code[] = + { + 0xffff0101, /* ps_1_1 */ + 0x00000001, 0x800f0000, 0x90e40000, /* mov r0, v0 */ + 0x0000ffff + }; + static const struct + { + struct vec3 position; + DWORD diffuse; + } + quad_strip[] = + { + {{-1.0f, -1.0f, 0.0f}, 0xffff0000}, + {{-1.0f, 1.0f, 0.0f}, 0xff00ff00}, + {{ 1.0f, -1.0f, 0.0f}, 0xff0000ff}, + {{ 1.0f, 1.0f, 0.0f}, 0xffffffff}, + }, + quad_list[] = + { + {{-1.0f, -1.0f, 0.0f}, 0xffff0000}, + {{-1.0f, 1.0f, 0.0f}, 0xff00ff00}, + {{ 1.0f, -1.0f, 0.0f}, 0xff0000ff}, + + {{ 1.0f, -1.0f, 0.0f}, 0xff0000ff}, + {{-1.0f, 1.0f, 0.0f}, 0xff00ff00}, + {{ 1.0f, 1.0f, 0.0f}, 0xffffffff}, + }; + static const struct test_shader + { + DWORD version; + const DWORD *code; + } + novs = {0, NULL}, + vs_1 = {D3DVS_VERSION(1, 1), vs1_code}, + nops = {0, NULL}, + ps_1 = {D3DPS_VERSION(1, 1), ps1_code}; + static const struct + { + const struct test_shader *vs, *ps; + DWORD primtype; + DWORD shademode; + DWORD color0, color1; + } + tests[] = + { + {&novs, &nops, D3DPT_TRIANGLESTRIP, D3DSHADE_FLAT, 0x00ff0000, 0x0000ff00}, + {&novs, &nops, D3DPT_TRIANGLESTRIP, D3DSHADE_PHONG, 0x000dca28, 0x000d45c7}, + {&novs, &nops, D3DPT_TRIANGLESTRIP, D3DSHADE_GOURAUD, 0x000dca28, 0x000d45c7}, + {&novs, &nops, D3DPT_TRIANGLESTRIP, D3DSHADE_PHONG, 0x000dca28, 0x000d45c7}, + {&novs, &nops, D3DPT_TRIANGLELIST, D3DSHADE_FLAT, 0x00ff0000, 0x000000ff}, + {&novs, &nops, D3DPT_TRIANGLELIST, D3DSHADE_GOURAUD, 0x000dca28, 0x000d45c7}, + {&vs_1, &ps_1, D3DPT_TRIANGLESTRIP, D3DSHADE_FLAT, 0x00ff0000, 0x0000ff00}, + {&vs_1, &ps_1, D3DPT_TRIANGLESTRIP, D3DSHADE_GOURAUD, 0x000dca28, 0x000d45c7}, + {&vs_1, &ps_1, D3DPT_TRIANGLELIST, D3DSHADE_FLAT, 0x00ff0000, 0x000000ff}, + {&vs_1, &ps_1, D3DPT_TRIANGLELIST, D3DSHADE_GOURAUD, 0x000dca28, 0x000d45c7}, + {&novs, &ps_1, D3DPT_TRIANGLESTRIP, D3DSHADE_FLAT, 0x00ff0000, 0x0000ff00}, + {&vs_1, &nops, D3DPT_TRIANGLESTRIP, D3DSHADE_FLAT, 0x00ff0000, 0x0000ff00}, + }; + + 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_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(hr == D3D_OK, "Failed to disable lighting, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_FOGENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable fog, hr %#x.\n", hr); + + hr = IDirect3DDevice8_CreateVertexBuffer(device, sizeof(quad_strip), 0, 0, D3DPOOL_MANAGED, &vb_strip); + ok(hr == D3D_OK, "Failed to create vertex buffer, hr %#x.\n", hr); + hr = IDirect3DVertexBuffer8_Lock(vb_strip, 0, sizeof(quad_strip), &data, 0); + ok(hr == D3D_OK, "Failed to lock vertex buffer, hr %#x.\n", hr); + memcpy(data, quad_strip, sizeof(quad_strip)); + hr = IDirect3DVertexBuffer8_Unlock(vb_strip); + ok(hr == D3D_OK, "Failed to unlock vertex buffer, hr %#x.\n", hr); + + hr = IDirect3DDevice8_CreateVertexBuffer(device, sizeof(quad_list), 0, 0, D3DPOOL_MANAGED, &vb_list); + ok(hr == D3D_OK, "Failed to create vertex buffer, hr %#x.\n", hr); + hr = IDirect3DVertexBuffer8_Lock(vb_list, 0, sizeof(quad_list), &data, 0); + ok(hr == D3D_OK, "Failed to lock vertex buffer, hr %#x.\n", hr); + memcpy(data, quad_list, sizeof(quad_list)); + hr = IDirect3DVertexBuffer8_Unlock(vb_list); + ok(hr == D3D_OK, "Failed to unlock vertex buffer, hr %#x.\n", hr); + + hr = IDirect3DDevice8_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + + /* Try it first with a TRIANGLESTRIP. Do it with different geometry because + * the color fixups we have to do for FLAT shading will be dependent on that. */ + + for (i = 0; i < sizeof(tests) / sizeof(tests[0]); ++i) + { + if (tests[i].vs->version) + { + if (caps.VertexShaderVersion >= tests[i].vs->version) + { + hr = IDirect3DDevice8_CreateVertexShader(device, decl, tests[i].vs->code, &vs, 0); + ok(hr == D3D_OK, "Failed to create vertex shader, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetVertexShader(device, vs); + ok(hr == D3D_OK, "Failed to set vertex shader, hr %#x.\n", hr); + } + else + { + skip("Shader version unsupported, skipping some tests.\n"); + continue; + } + } + else + { + vs = 0; + hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); + ok(hr == D3D_OK, "Failed to set FVF, hr %#x.\n", hr); + } + if (tests[i].ps->version) + { + if (caps.PixelShaderVersion >= tests[i].ps->version) + { + hr = IDirect3DDevice8_CreatePixelShader(device, tests[i].ps->code, &ps); + ok(hr == D3D_OK, "Failed to create pixel shader, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetPixelShader(device, ps); + ok(hr == D3D_OK, "Failed to set pixel shader, hr %#x.\n", hr); + } + else + { + skip("Shader version unsupported, skipping some tests.\n"); + if (vs) + { + IDirect3DDevice8_SetVertexShader(device, 0); + IDirect3DDevice8_DeleteVertexShader(device, vs); + } + continue; + } + } + else + { + ps = 0; + } + + hr = IDirect3DDevice8_SetStreamSource(device, 0, + tests[i].primtype == D3DPT_TRIANGLESTRIP ? vb_strip : vb_list, sizeof(quad_strip[0])); + ok(hr == D3D_OK, "Failed to set stream source, hr %#x.\n", hr); + + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); + ok(hr == D3D_OK, "Failed to clear, hr %#x.\n", hr); + + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_SHADEMODE, tests[i].shademode); + ok(hr == D3D_OK, "Failed to set shade mode, hr %#x.\n", hr); + + hr = IDirect3DDevice8_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice8_DrawPrimitive(device, tests[i].primtype, 0, 2); + 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); + + color0 = getPixelColor(device, 100, 100); /* Inside first triangle */ + color1 = getPixelColor(device, 500, 350); /* Inside second triangle */ + + /* For D3DSHADE_FLAT it should take the color of the first vertex of + * each triangle. This requires EXT_provoking_vertex or similar + * functionality being available. */ + /* PHONG should be the same as GOURAUD, since no hardware implements + * this. */ + ok(color0 == tests[i].color0, "Test %u shading has color0 %08x, expected %08x.\n", + i, color0, tests[i].color0); + ok(color1 == tests[i].color1, "Test %u shading has color1 %08x, expected %08x.\n", + i, color1, tests[i].color1); + + IDirect3DDevice8_SetVertexShader(device, 0); + IDirect3DDevice8_SetPixelShader(device, 0); + + if (ps) + IDirect3DDevice8_DeletePixelShader(device, ps); + if (vs) + IDirect3DDevice8_DeleteVertexShader(device, vs); + } + + hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); + ok(hr == D3D_OK, "Failed to present, hr %#x.\n", hr); + + IDirect3DVertexBuffer8_Release(vb_strip); + IDirect3DVertexBuffer8_Release(vb_list); + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D8_Release(d3d); + DestroyWindow(window); +} + START_TEST(visual) { D3DADAPTER_IDENTIFIER8 identifier; @@ -7946,4 +8564,7 @@ test_texcoordindex(); test_vshader_input(); test_fixed_function_fvf(); + test_flip(); + test_uninitialized_varyings(); + test_shademode(); } diff -Nru wine1.7-1.7.50/dlls/d3d8/vertexdeclaration.c wine1.7-1.7.55/dlls/d3d8/vertexdeclaration.c --- wine1.7-1.7.50/dlls/d3d8/vertexdeclaration.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d8/vertexdeclaration.c 2015-11-13 14:32:40.000000000 +0000 @@ -263,7 +263,7 @@ WORD stream = 0; int offset = 0; - TRACE("d3d8_elements %p, wined3d_elements %p\n", d3d8_elements, wined3d_elements); + TRACE("d3d8_elements %p, d3d8_elements_size %p, wined3d_elements %p\n", d3d8_elements, d3d8_elements_size, wined3d_elements); /* 128 should be enough for anyone... */ *wined3d_elements = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 128 * sizeof(**wined3d_elements)); diff -Nru wine1.7-1.7.50/dlls/d3d8/volume.c wine1.7-1.7.55/dlls/d3d8/volume.c --- wine1.7-1.7.50/dlls/d3d8/volume.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d8/volume.c 2015-11-13 14:32:40.000000000 +0000 @@ -30,7 +30,7 @@ static HRESULT WINAPI d3d8_volume_QueryInterface(IDirect3DVolume8 *iface, REFIID riid, void **out) { - TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), out); + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); if (IsEqualGUID(riid, &IID_IDirect3DVolume8) || IsEqualGUID(riid, &IID_IUnknown)) @@ -116,13 +116,13 @@ { struct d3d8_volume *volume = impl_from_IDirect3DVolume8(iface); struct wined3d_resource_desc wined3d_desc; - struct wined3d_resource *wined3d_resource; + struct wined3d_resource *sub_resource; TRACE("iface %p, desc %p.\n", iface, desc); wined3d_mutex_lock(); - wined3d_resource = wined3d_volume_get_resource(volume->wined3d_volume); - wined3d_resource_get_desc(wined3d_resource, &wined3d_desc); + sub_resource = wined3d_texture_get_sub_resource(volume->wined3d_texture, volume->sub_resource_idx); + wined3d_resource_get_desc(sub_resource, &wined3d_desc); wined3d_mutex_unlock(); desc->Format = d3dformat_from_wined3dformat(wined3d_desc.format); @@ -148,7 +148,8 @@ iface, locked_box, box, flags); wined3d_mutex_lock(); - hr = wined3d_volume_map(volume->wined3d_volume, &map_desc, (const struct wined3d_box *)box, flags); + hr = wined3d_resource_map(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx, + &map_desc, (const struct wined3d_box *)box, flags); wined3d_mutex_unlock(); locked_box->RowPitch = map_desc.row_pitch; @@ -166,7 +167,7 @@ TRACE("iface %p.\n", iface); wined3d_mutex_lock(); - hr = wined3d_volume_unmap(volume->wined3d_volume); + hr = wined3d_resource_unmap(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx); wined3d_mutex_unlock(); return hr; @@ -201,14 +202,15 @@ volume_wined3d_object_destroyed, }; -void volume_init(struct d3d8_volume *volume, struct d3d8_texture *texture, - struct wined3d_volume *wined3d_volume, const struct wined3d_parent_ops **parent_ops) +void volume_init(struct d3d8_volume *volume, struct wined3d_texture *wined3d_texture, + unsigned int sub_resource_idx, const struct wined3d_parent_ops **parent_ops) { volume->IDirect3DVolume8_iface.lpVtbl = &d3d8_volume_vtbl; d3d8_resource_init(&volume->resource); volume->resource.refcount = 0; - volume->wined3d_volume = wined3d_volume; - volume->texture = texture; + volume->texture = wined3d_texture_get_parent(wined3d_texture); + volume->wined3d_texture = wined3d_texture; + volume->sub_resource_idx = sub_resource_idx; *parent_ops = &d3d8_volume_wined3d_parent_ops; } diff -Nru wine1.7-1.7.50/dlls/d3d9/d3d9_private.h wine1.7-1.7.55/dlls/d3d9/d3d9_private.h --- wine1.7-1.7.50/dlls/d3d9/d3d9_private.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d9/d3d9_private.h 2015-11-13 14:32:40.000000000 +0000 @@ -167,6 +167,9 @@ LONG device_state; BOOL in_destruction; BOOL in_scene; + + UINT implicit_swapchain_count; + struct d3d9_swapchain **implicit_swapchains; }; HRESULT device_init(struct d3d9_device *device, struct d3d9 *parent, struct wined3d *wined3d, @@ -191,12 +194,13 @@ { IDirect3DVolume9 IDirect3DVolume9_iface; struct d3d9_resource resource; - struct wined3d_volume *wined3d_volume; + struct wined3d_texture *wined3d_texture; + unsigned int sub_resource_idx; struct d3d9_texture *texture; }; -void volume_init(struct d3d9_volume *volume, struct d3d9_texture *texture, - struct wined3d_volume *wined3d_volume, const struct wined3d_parent_ops **parent_ops) DECLSPEC_HIDDEN; +void volume_init(struct d3d9_volume *volume, struct wined3d_texture *wined3d_texture, + unsigned int sub_resource_idx, const struct wined3d_parent_ops **parent_ops) DECLSPEC_HIDDEN; struct d3d9_swapchain { @@ -213,6 +217,8 @@ { IDirect3DSurface9 IDirect3DSurface9_iface; struct d3d9_resource resource; + struct wined3d_texture *wined3d_texture; + unsigned int sub_resource_idx; struct wined3d_surface *wined3d_surface; struct list rtv_entry; struct wined3d_rendertarget_view *wined3d_rtv; @@ -223,7 +229,7 @@ }; struct wined3d_rendertarget_view *d3d9_surface_get_rendertarget_view(struct d3d9_surface *surface) DECLSPEC_HIDDEN; -void surface_init(struct d3d9_surface *surface, IUnknown *container_parent, +void surface_init(struct d3d9_surface *surface, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, struct wined3d_surface *wined3d_surface, const struct wined3d_parent_ops **parent_ops) DECLSPEC_HIDDEN; struct d3d9_surface *unsafe_impl_from_IDirect3DSurface9(IDirect3DSurface9 *iface) DECLSPEC_HIDDEN; diff -Nru wine1.7-1.7.50/dlls/d3d9/device.c wine1.7-1.7.55/dlls/d3d9/device.c --- wine1.7-1.7.50/dlls/d3d9/device.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d9/device.c 2015-11-13 14:32:40.000000000 +0000 @@ -208,9 +208,25 @@ present_parameters->PresentationInterval = swapchain_desc->swap_interval; } -static void wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapchain_desc *swapchain_desc, - const D3DPRESENT_PARAMETERS *present_parameters) +static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapchain_desc *swapchain_desc, + const D3DPRESENT_PARAMETERS *present_parameters, BOOL extended) { + D3DSWAPEFFECT highest_swapeffect = extended ? D3DSWAPEFFECT_FLIPEX : D3DSWAPEFFECT_COPY; + UINT highest_bb_count = extended ? 30 : 3; + + if (!present_parameters->SwapEffect || present_parameters->SwapEffect > highest_swapeffect) + { + WARN("Invalid swap effect %u passed.\n", present_parameters->SwapEffect); + return FALSE; + } + if (present_parameters->BackBufferCount > highest_bb_count + || (present_parameters->SwapEffect == D3DSWAPEFFECT_COPY + && present_parameters->BackBufferCount > 1)) + { + WARN("Invalid backbuffer count %u.\n", present_parameters->BackBufferCount); + return FALSE; + } + swapchain_desc->backbuffer_width = present_parameters->BackBufferWidth; swapchain_desc->backbuffer_height = present_parameters->BackBufferHeight; swapchain_desc->backbuffer_format = wined3dformat_from_d3dformat(present_parameters->BackBufferFormat); @@ -227,6 +243,8 @@ swapchain_desc->refresh_rate = present_parameters->FullScreen_RefreshRateInHz; swapchain_desc->swap_interval = present_parameters->PresentationInterval; swapchain_desc->auto_restore_display_mode = TRUE; + + return TRUE; } static HRESULT WINAPI d3d9_device_QueryInterface(IDirect3DDevice9Ex *iface, REFIID riid, void **out) @@ -304,6 +322,8 @@ if (device->index_buffer) wined3d_buffer_decref(device->index_buffer); + HeapFree(GetProcessHeap(), 0, device->implicit_swapchains); + wined3d_device_uninit_3d(device->wined3d_device); wined3d_device_release_focus_window(device->wined3d_device); wined3d_device_decref(device->wined3d_device); @@ -466,7 +486,7 @@ wined3d_mutex_lock(); hr = wined3d_device_set_cursor_properties(device->wined3d_device, - hotspot_x, hotspot_y, bitmap_impl->wined3d_surface); + hotspot_x, hotspot_y, bitmap_impl->wined3d_texture, bitmap_impl->sub_resource_idx); wined3d_mutex_unlock(); return hr; @@ -533,7 +553,9 @@ } wined3d_mutex_unlock(); - wined3d_swapchain_desc_from_present_parameters(&desc, present_parameters); + if (!wined3d_swapchain_desc_from_present_parameters(&desc, present_parameters, + device->d3d_parent->extended)) + return D3DERR_INVALIDCALL; if (SUCCEEDED(hr = d3d9_swapchain_create(device, &desc, &object))) *swapchain = (IDirect3DSwapChain9 *)&object->IDirect3DSwapChain9Ex_iface; present_parameters_from_wined3d_swapchain_desc(present_parameters, &desc); @@ -545,19 +567,16 @@ UINT swapchain_idx, IDirect3DSwapChain9 **swapchain) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); - struct wined3d_swapchain *wined3d_swapchain; - struct d3d9_swapchain *swapchain_impl; HRESULT hr; TRACE("iface %p, swapchain_idx %u, swapchain %p.\n", iface, swapchain_idx, swapchain); wined3d_mutex_lock(); - if ((wined3d_swapchain = wined3d_device_get_swapchain(device->wined3d_device, swapchain_idx))) + if (swapchain_idx < device->implicit_swapchain_count) { - swapchain_impl = wined3d_swapchain_get_parent(wined3d_swapchain); - *swapchain = (IDirect3DSwapChain9 *)&swapchain_impl->IDirect3DSwapChain9Ex_iface; - IDirect3DSwapChain9Ex_AddRef(*swapchain); - hr = D3D_OK; + *swapchain = (IDirect3DSwapChain9 *)&device->implicit_swapchains[swapchain_idx]->IDirect3DSwapChain9Ex_iface; + IDirect3DSwapChain9Ex_AddRef(*swapchain); + hr = D3D_OK; } else { @@ -626,6 +645,25 @@ return D3D_OK; } +static HRESULT d3d9_device_get_swapchains(struct d3d9_device *device) +{ + UINT i, new_swapchain_count = wined3d_device_get_swapchain_count(device->wined3d_device); + struct wined3d_swapchain *wined3d_swapchain; + + if (!(device->implicit_swapchains = HeapAlloc(GetProcessHeap(), 0, + new_swapchain_count * sizeof(*device->implicit_swapchains)))) + return E_OUTOFMEMORY; + + for (i = 0; i < new_swapchain_count; ++i) + { + wined3d_swapchain = wined3d_device_get_swapchain(device->wined3d_device, i); + device->implicit_swapchains[i] = wined3d_swapchain_get_parent(wined3d_swapchain); + } + device->implicit_swapchain_count = new_swapchain_count; + + return D3D_OK; +} + static HRESULT d3d9_device_reset(struct d3d9_device *device, D3DPRESENT_PARAMETERS *present_parameters, D3DDISPLAYMODEEX *mode) { @@ -648,6 +686,10 @@ wined3d_mode.scanline_ordering = mode->ScanLineOrdering; } + if (!wined3d_swapchain_desc_from_present_parameters(&swapchain_desc, present_parameters, + device->d3d_parent->extended)) + return D3DERR_INVALIDCALL; + wined3d_mutex_lock(); if (device->vertex_buffer) @@ -664,20 +706,25 @@ device->index_buffer_size = 0; } - wined3d_swapchain_desc_from_present_parameters(&swapchain_desc, present_parameters); if (SUCCEEDED(hr = wined3d_device_reset(device->wined3d_device, &swapchain_desc, mode ? &wined3d_mode : NULL, reset_enum_callback, !device->d3d_parent->extended))) { - struct wined3d_swapchain *wined3d_swapchain; + HeapFree(GetProcessHeap(), 0, device->implicit_swapchains); - wined3d_swapchain = wined3d_device_get_swapchain(device->wined3d_device, 0); - wined3d_swapchain_get_desc(wined3d_swapchain, &swapchain_desc); - present_parameters->BackBufferWidth = swapchain_desc.backbuffer_width; - present_parameters->BackBufferHeight = swapchain_desc.backbuffer_height; - present_parameters->BackBufferFormat = d3dformat_from_wined3dformat(swapchain_desc.backbuffer_format); - present_parameters->BackBufferCount = swapchain_desc.backbuffer_count; + if (FAILED(hr = d3d9_device_get_swapchains(device))) + { + device->device_state = D3D9_DEVICE_STATE_NOT_RESET; + } + else + { + wined3d_swapchain_get_desc(device->implicit_swapchains[0]->wined3d_swapchain, &swapchain_desc); + present_parameters->BackBufferWidth = swapchain_desc.backbuffer_width; + present_parameters->BackBufferHeight = swapchain_desc.backbuffer_height; + present_parameters->BackBufferFormat = d3dformat_from_wined3dformat(swapchain_desc.backbuffer_format); + present_parameters->BackBufferCount = swapchain_desc.backbuffer_count; - device->device_state = D3D9_DEVICE_STATE_OK; + device->device_state = D3D9_DEVICE_STATE_OK; + } } else if (!device->d3d_parent->extended) { @@ -703,6 +750,7 @@ const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, const RGNDATA *dirty_region) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); + UINT i; HRESULT hr; TRACE("iface %p, src_rect %p, dst_rect %p, dst_window_override %p, dirty_region %p.\n", @@ -712,37 +760,50 @@ return device->d3d_parent->extended ? S_PRESENT_OCCLUDED : D3DERR_DEVICELOST; wined3d_mutex_lock(); - hr = wined3d_device_present(device->wined3d_device, src_rect, dst_rect, - dst_window_override, dirty_region, 0); + for (i = 0; i < device->implicit_swapchain_count; ++i) + { + hr = wined3d_swapchain_present(device->implicit_swapchains[i]->wined3d_swapchain, src_rect, + dst_rect, dst_window_override, dirty_region, 0); + if (FAILED(hr)) + { + wined3d_mutex_unlock(); + return hr; + } + } wined3d_mutex_unlock(); - return hr; + return D3D_OK; } static HRESULT WINAPI d3d9_device_GetBackBuffer(IDirect3DDevice9Ex *iface, UINT swapchain, UINT backbuffer_idx, D3DBACKBUFFER_TYPE backbuffer_type, IDirect3DSurface9 **backbuffer) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); - struct wined3d_surface *wined3d_surface = NULL; - struct d3d9_surface *surface_impl; HRESULT hr; TRACE("iface %p, swapchain %u, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n", iface, swapchain, backbuffer_idx, backbuffer_type, backbuffer); + /* backbuffer_type is ignored by native. */ + + /* No need to check for backbuffer == NULL, Windows crashes in that case. */ + *backbuffer = NULL; + wined3d_mutex_lock(); - hr = wined3d_device_get_back_buffer(device->wined3d_device, swapchain, - backbuffer_idx, (enum wined3d_backbuffer_type)backbuffer_type, &wined3d_surface); - if (SUCCEEDED(hr) && wined3d_surface && backbuffer) - { - surface_impl = wined3d_surface_get_parent(wined3d_surface); - *backbuffer = &surface_impl->IDirect3DSurface9_iface; - IDirect3DSurface9_AddRef(*backbuffer); + if (swapchain >= device->implicit_swapchain_count) + { + wined3d_mutex_unlock(); + WARN("Swapchain index %u is out of range, returning D3DERR_INVALIDCALL.\n", swapchain); + return D3DERR_INVALIDCALL; } + + hr = IDirect3DSwapChain9Ex_GetBackBuffer(&device->implicit_swapchains[swapchain]->IDirect3DSwapChain9Ex_iface, + backbuffer_idx, backbuffer_type, backbuffer); wined3d_mutex_unlock(); return hr; } + static HRESULT WINAPI d3d9_device_GetRasterStatus(IDirect3DDevice9Ex *iface, UINT swapchain, D3DRASTER_STATUS *raster_status) { @@ -1204,12 +1265,22 @@ { struct d3d9_surface *rt_impl = unsafe_impl_from_IDirect3DSurface9(render_target); struct d3d9_surface *dst_impl = unsafe_impl_from_IDirect3DSurface9(dst_surface); + struct wined3d_resource_desc wined3d_desc; + struct wined3d_resource *sub_resource; HRESULT hr; TRACE("iface %p, render_target %p, dst_surface %p.\n", iface, render_target, dst_surface); wined3d_mutex_lock(); - hr = wined3d_surface_get_render_target_data(dst_impl->wined3d_surface, rt_impl->wined3d_surface); + sub_resource = wined3d_texture_get_sub_resource(rt_impl->wined3d_texture, rt_impl->sub_resource_idx); + wined3d_resource_get_desc(sub_resource, &wined3d_desc); + + /* TODO: Check surface sizes, pools, etc. */ + if (wined3d_desc.multisample_type) + hr = D3DERR_INVALIDCALL; + else + hr = wined3d_texture_blt(dst_impl->wined3d_texture, dst_impl->sub_resource_idx, NULL, + rt_impl->wined3d_texture, rt_impl->sub_resource_idx, NULL, 0, NULL, WINED3D_TEXF_POINT); wined3d_mutex_unlock(); return hr; @@ -1220,12 +1291,14 @@ { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); struct d3d9_surface *dst_impl = unsafe_impl_from_IDirect3DSurface9(dst_surface); - HRESULT hr; + HRESULT hr = D3DERR_INVALIDCALL; TRACE("iface %p, swapchain %u, dst_surface %p.\n", iface, swapchain, dst_surface); wined3d_mutex_lock(); - hr = wined3d_device_get_front_buffer_data(device->wined3d_device, swapchain, dst_impl->wined3d_surface); + if (swapchain < device->implicit_swapchain_count) + hr = wined3d_swapchain_get_front_buffer_data(device->implicit_swapchains[swapchain]->wined3d_swapchain, + dst_impl->wined3d_texture, dst_impl->sub_resource_idx); wined3d_mutex_unlock(); return hr; @@ -1239,17 +1312,17 @@ struct d3d9_surface *dst = unsafe_impl_from_IDirect3DSurface9(dst_surface); HRESULT hr = D3DERR_INVALIDCALL; struct wined3d_resource_desc src_desc, dst_desc; - struct wined3d_resource *wined3d_resource; + struct wined3d_resource *sub_resource; TRACE("iface %p, src_surface %p, src_rect %p, dst_surface %p, dst_rect %p, filter %#x.\n", iface, src_surface, src_rect, dst_surface, dst_rect, filter); wined3d_mutex_lock(); - wined3d_resource = wined3d_surface_get_resource(dst->wined3d_surface); - wined3d_resource_get_desc(wined3d_resource, &dst_desc); + sub_resource = wined3d_texture_get_sub_resource(dst->wined3d_texture, dst->sub_resource_idx); + wined3d_resource_get_desc(sub_resource, &dst_desc); - wined3d_resource = wined3d_surface_get_resource(src->wined3d_surface); - wined3d_resource_get_desc(wined3d_resource, &src_desc); + sub_resource = wined3d_texture_get_sub_resource(src->wined3d_texture, src->sub_resource_idx); + wined3d_resource_get_desc(sub_resource, &src_desc); if (src_desc.usage & WINED3DUSAGE_DEPTHSTENCIL) { @@ -1286,7 +1359,8 @@ } } - hr = wined3d_surface_blt(dst->wined3d_surface, dst_rect, src->wined3d_surface, src_rect, 0, NULL, filter); + hr = wined3d_texture_blt(dst->wined3d_texture, dst->sub_resource_idx, dst_rect, + src->wined3d_texture, src->sub_resource_idx, src_rect, 0, NULL, filter); if (hr == WINEDDERR_INVALIDRECT) hr = D3DERR_INVALIDCALL; @@ -1315,7 +1389,11 @@ wined3d_mutex_lock(); - wined3d_resource = wined3d_surface_get_resource(surface_impl->wined3d_surface); + if (!(wined3d_resource = wined3d_texture_get_sub_resource(surface_impl->wined3d_texture, surface_impl->sub_resource_idx))) + { + wined3d_mutex_unlock(); + return D3DERR_INVALIDCALL; + } wined3d_resource_get_desc(wined3d_resource, &desc); if (desc.pool != WINED3D_POOL_DEFAULT) @@ -3151,6 +3229,7 @@ const RGNDATA *dirty_region, DWORD flags) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); + UINT i; HRESULT hr; TRACE("iface %p, src_rect %s, dst_rect %s, dst_window_override %p, dirty_region %p, flags %#x.\n", @@ -3161,11 +3240,18 @@ return S_PRESENT_OCCLUDED; wined3d_mutex_lock(); - hr = wined3d_device_present(device->wined3d_device, src_rect, dst_rect, - dst_window_override, dirty_region, flags); + for (i = 0; i < device->implicit_swapchain_count; ++i) + { + if (FAILED(hr = wined3d_swapchain_present(device->implicit_swapchains[i]->wined3d_swapchain, src_rect, + dst_rect, dst_window_override, dirty_region, flags))) + { + wined3d_mutex_unlock(); + return hr; + } + } wined3d_mutex_unlock(); - return hr; + return D3D_OK; } static HRESULT WINAPI d3d9_device_GetGPUThreadPriority(IDirect3DDevice9Ex *iface, INT *priority) @@ -3218,13 +3304,11 @@ { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); struct wined3d_swapchain_desc swapchain_desc; - struct wined3d_swapchain *swapchain; TRACE("iface %p, dst_window %p.\n", iface, dst_window); wined3d_mutex_lock(); - swapchain = wined3d_device_get_swapchain(device->wined3d_device, 0); - wined3d_swapchain_get_desc(swapchain, &swapchain_desc); + wined3d_swapchain_get_desc(device->implicit_swapchains[0]->wined3d_swapchain, &swapchain_desc); wined3d_mutex_unlock(); if (swapchain_desc.windowed) @@ -3495,18 +3579,18 @@ } static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent *device_parent, - void *container_parent, struct wined3d_surface *surface, void **parent, + struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, struct wined3d_surface *surface, void **parent, const struct wined3d_parent_ops **parent_ops) { struct d3d9_surface *d3d_surface; - TRACE("device_parent %p, container_parent %p, surface %p, parent %p, parent_ops %p.\n", - device_parent, container_parent, surface, parent, parent_ops); + TRACE("device_parent %p, wined3d_texture %p, sub_resource_idx %u, surface %p, parent %p, parent_ops %p.\n", + device_parent, wined3d_texture, sub_resource_idx, surface, parent, parent_ops); if (!(d3d_surface = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*d3d_surface)))) return E_OUTOFMEMORY; - surface_init(d3d_surface, container_parent, surface, parent_ops); + surface_init(d3d_surface, wined3d_texture, sub_resource_idx, surface, parent_ops); *parent = d3d_surface; TRACE("Created surface %p.\n", d3d_surface); @@ -3514,53 +3598,45 @@ } static HRESULT CDECL device_parent_volume_created(struct wined3d_device_parent *device_parent, - void *container_parent, struct wined3d_volume *volume, void **parent, - const struct wined3d_parent_ops **parent_ops) + struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, + void **parent, const struct wined3d_parent_ops **parent_ops) { struct d3d9_volume *d3d_volume; - TRACE("device_parent %p, container_parent %p, volume %p, parent %p, parent_ops %p.\n", - device_parent, container_parent, volume, parent, parent_ops); + TRACE("device_parent %p, texture %p, sub_resource_idx %u, parent %p, parent_ops %p.\n", + device_parent, wined3d_texture, sub_resource_idx, parent, parent_ops); if (!(d3d_volume = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*d3d_volume)))) return E_OUTOFMEMORY; - volume_init(d3d_volume, container_parent, volume, parent_ops); + volume_init(d3d_volume, wined3d_texture, sub_resource_idx, parent_ops); *parent = d3d_volume; TRACE("Created volume %p.\n", d3d_volume); return D3D_OK; } -static HRESULT CDECL device_parent_create_swapchain_surface(struct wined3d_device_parent *device_parent, - void *container_parent, const struct wined3d_resource_desc *desc, struct wined3d_surface **surface) +static HRESULT CDECL device_parent_create_swapchain_texture(struct wined3d_device_parent *device_parent, + void *container_parent, const struct wined3d_resource_desc *desc, struct wined3d_texture **texture) { struct d3d9_device *device = device_from_device_parent(device_parent); - struct wined3d_resource_desc texture_desc; struct d3d9_surface *d3d_surface; - struct wined3d_texture *texture; HRESULT hr; - TRACE("device_parent %p, container_parent %p, desc %p, surface %p.\n", - device_parent, container_parent, desc, surface); + TRACE("device_parent %p, container_parent %p, desc %p, texture %p.\n", + device_parent, container_parent, desc, texture); if (container_parent == device_parent) container_parent = &device->IDirect3DDevice9Ex_iface; - texture_desc = *desc; - texture_desc.resource_type = WINED3D_RTYPE_TEXTURE; - if (FAILED(hr = wined3d_texture_create(device->wined3d_device, &texture_desc, 1, - WINED3D_SURFACE_MAPPABLE, NULL, container_parent, &d3d9_null_wined3d_parent_ops, &texture))) + if (FAILED(hr = wined3d_texture_create(device->wined3d_device, desc, 1, + WINED3D_SURFACE_MAPPABLE, NULL, container_parent, &d3d9_null_wined3d_parent_ops, texture))) { WARN("Failed to create texture, hr %#x.\n", hr); return hr; } - *surface = wined3d_surface_from_resource(wined3d_texture_get_sub_resource(texture, 0)); - wined3d_surface_incref(*surface); - wined3d_texture_decref(texture); - - d3d_surface = wined3d_surface_get_parent(*surface); + d3d_surface = wined3d_resource_get_parent(wined3d_texture_get_sub_resource(*texture, 0)); d3d_surface->parent_device = &device->IDirect3DDevice9Ex_iface; return hr; @@ -3597,7 +3673,7 @@ device_parent_activate, device_parent_surface_created, device_parent_volume_created, - device_parent_create_swapchain_surface, + device_parent_create_swapchain_texture, device_parent_create_swapchain, }; @@ -3683,6 +3759,7 @@ if (!swapchain_desc) { ERR("Failed to allocate wined3d parameters.\n"); + wined3d_device_release_focus_window(device->wined3d_device); wined3d_device_decref(device->wined3d_device); wined3d_mutex_unlock(); return E_OUTOFMEMORY; @@ -3690,7 +3767,15 @@ for (i = 0; i < count; ++i) { - wined3d_swapchain_desc_from_present_parameters(&swapchain_desc[i], ¶meters[i]); + if (!wined3d_swapchain_desc_from_present_parameters(&swapchain_desc[i], ¶meters[i], + parent->extended)) + { + wined3d_device_release_focus_window(device->wined3d_device); + wined3d_device_decref(device->wined3d_device); + HeapFree(GetProcessHeap(), 0, swapchain_desc); + wined3d_mutex_unlock(); + return D3DERR_INVALIDCALL; + } } hr = wined3d_device_init_3d(device->wined3d_device, swapchain_desc); @@ -3704,12 +3789,22 @@ return hr; } - wined3d_mutex_unlock(); + if (FAILED(hr = d3d9_device_get_swapchains(device))) + { + wined3d_device_uninit_3d(device->wined3d_device); + wined3d_device_release_focus_window(device->wined3d_device); + wined3d_device_decref(device->wined3d_device); + wined3d_mutex_unlock(); + return E_OUTOFMEMORY; + } for (i = 0; i < count; ++i) { present_parameters_from_wined3d_swapchain_desc(¶meters[i], &swapchain_desc[i]); } + + wined3d_mutex_unlock(); + HeapFree(GetProcessHeap(), 0, swapchain_desc); /* Initialize the converted declaration array. This creates a valid pointer @@ -3719,6 +3814,7 @@ { ERR("Failed to allocate FVF vertex declaration map memory.\n"); wined3d_mutex_lock(); + HeapFree(GetProcessHeap(), 0, device->implicit_swapchains); wined3d_device_uninit_3d(device->wined3d_device); wined3d_device_release_focus_window(device->wined3d_device); wined3d_device_decref(device->wined3d_device); diff -Nru wine1.7-1.7.50/dlls/d3d9/query.c wine1.7-1.7.55/dlls/d3d9/query.c --- wine1.7-1.7.50/dlls/d3d9/query.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d9/query.c 2015-11-13 14:32:40.000000000 +0000 @@ -32,7 +32,7 @@ static HRESULT WINAPI d3d9_query_QueryInterface(IDirect3DQuery9 *iface, REFIID riid, void **out) { - TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), out); + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); if (IsEqualGUID(riid, &IID_IDirect3DQuery9) || IsEqualGUID(riid, &IID_IUnknown)) diff -Nru wine1.7-1.7.50/dlls/d3d9/surface.c wine1.7-1.7.55/dlls/d3d9/surface.c --- wine1.7-1.7.50/dlls/d3d9/surface.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d9/surface.c 2015-11-13 14:32:40.000000000 +0000 @@ -176,7 +176,7 @@ TRACE("iface %p.\n", iface); wined3d_mutex_lock(); - wined3d_surface_preload(surface->wined3d_surface); + wined3d_texture_preload(surface->wined3d_texture); wined3d_mutex_unlock(); } @@ -208,13 +208,13 @@ { struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface); struct wined3d_resource_desc wined3d_desc; - struct wined3d_resource *wined3d_resource; + struct wined3d_resource *sub_resource; TRACE("iface %p, desc %p.\n", iface, desc); wined3d_mutex_lock(); - wined3d_resource = wined3d_surface_get_resource(surface->wined3d_surface); - wined3d_resource_get_desc(wined3d_resource, &wined3d_desc); + sub_resource = wined3d_texture_get_sub_resource(surface->wined3d_texture, surface->sub_resource_idx); + wined3d_resource_get_desc(sub_resource, &wined3d_desc); wined3d_mutex_unlock(); desc->Format = d3dformat_from_wined3dformat(wined3d_desc.format); @@ -233,14 +233,26 @@ D3DLOCKED_RECT *locked_rect, const RECT *rect, DWORD flags) { struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface); + struct wined3d_box box; struct wined3d_map_desc map_desc; HRESULT hr; TRACE("iface %p, locked_rect %p, rect %s, flags %#x.\n", iface, locked_rect, wine_dbgstr_rect(rect), flags); + if (rect) + { + box.left = rect->left; + box.top = rect->top; + box.right = rect->right; + box.bottom = rect->bottom; + box.front = 0; + box.back = 1; + } + wined3d_mutex_lock(); - hr = wined3d_surface_map(surface->wined3d_surface, &map_desc, rect, flags); + hr = wined3d_resource_map(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx, + &map_desc, rect ? &box : NULL, flags); wined3d_mutex_unlock(); if (SUCCEEDED(hr)) @@ -260,7 +272,7 @@ TRACE("iface %p.\n", iface); wined3d_mutex_lock(); - hr = wined3d_surface_unmap(surface->wined3d_surface); + hr = wined3d_resource_unmap(wined3d_texture_get_resource(surface->wined3d_texture), surface->sub_resource_idx); wined3d_mutex_unlock(); switch(hr) @@ -285,7 +297,7 @@ } wined3d_mutex_lock(); - hr = wined3d_surface_getdc(surface->wined3d_surface, dc); + hr = wined3d_texture_get_dc(surface->wined3d_texture, surface->sub_resource_idx, dc); wined3d_mutex_unlock(); return hr; @@ -299,7 +311,7 @@ TRACE("iface %p, dc %p.\n", iface, dc); wined3d_mutex_lock(); - hr = wined3d_surface_releasedc(surface->wined3d_surface, dc); + hr = wined3d_texture_release_dc(surface->wined3d_texture, surface->sub_resource_idx, dc); wined3d_mutex_unlock(); switch (hr) @@ -345,7 +357,7 @@ surface_wined3d_object_destroyed, }; -void surface_init(struct d3d9_surface *surface, IUnknown *container_parent, +void surface_init(struct d3d9_surface *surface, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, struct wined3d_surface *wined3d_surface, const struct wined3d_parent_ops **parent_ops) { struct wined3d_resource_desc desc; @@ -356,16 +368,18 @@ surface->resource.refcount = 0; surface->wined3d_surface = wined3d_surface; list_init(&surface->rtv_entry); - surface->container = container_parent; + surface->container = wined3d_texture_get_parent(wined3d_texture); + surface->wined3d_texture = wined3d_texture; + surface->sub_resource_idx = sub_resource_idx; - if (container_parent && SUCCEEDED(IUnknown_QueryInterface(container_parent, + if (surface->container && SUCCEEDED(IUnknown_QueryInterface(surface->container, &IID_IDirect3DBaseTexture9, (void **)&texture))) { surface->texture = unsafe_impl_from_IDirect3DBaseTexture9(texture); IDirect3DBaseTexture9_Release(texture); } - wined3d_resource_get_desc(wined3d_surface_get_resource(wined3d_surface), &desc); + wined3d_resource_get_desc(wined3d_texture_get_resource(wined3d_texture), &desc); switch (d3dformat_from_wined3dformat(desc.format)) { case D3DFMT_A8R8G8B8: @@ -414,8 +428,8 @@ if (surface->wined3d_rtv) return surface->wined3d_rtv; - if (FAILED(hr = wined3d_rendertarget_view_create_from_surface(surface->wined3d_surface, - surface, &d3d9_view_wined3d_parent_ops, &surface->wined3d_rtv))) + if (FAILED(hr = wined3d_rendertarget_view_create_from_sub_resource(surface->wined3d_texture, + surface->sub_resource_idx, surface, &d3d9_view_wined3d_parent_ops, &surface->wined3d_rtv))) { ERR("Failed to create rendertarget view, hr %#x.\n", hr); return NULL; diff -Nru wine1.7-1.7.50/dlls/d3d9/swapchain.c wine1.7-1.7.55/dlls/d3d9/swapchain.c --- wine1.7-1.7.50/dlls/d3d9/swapchain.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d9/swapchain.c 2015-11-13 14:32:40.000000000 +0000 @@ -142,7 +142,7 @@ TRACE("iface %p, surface %p.\n", iface, surface); wined3d_mutex_lock(); - hr = wined3d_swapchain_get_front_buffer_data(swapchain->wined3d_swapchain, dst->wined3d_surface); + hr = wined3d_swapchain_get_front_buffer_data(swapchain->wined3d_swapchain, dst->wined3d_texture, dst->sub_resource_idx); wined3d_mutex_unlock(); return hr; @@ -152,23 +152,33 @@ UINT backbuffer_idx, D3DBACKBUFFER_TYPE backbuffer_type, IDirect3DSurface9 **backbuffer) { struct d3d9_swapchain *swapchain = impl_from_IDirect3DSwapChain9Ex(iface); - struct wined3d_surface *wined3d_surface = NULL; + struct wined3d_resource *wined3d_resource; + struct wined3d_texture *wined3d_texture; struct d3d9_surface *surface_impl; HRESULT hr = D3D_OK; TRACE("iface %p, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n", iface, backbuffer_idx, backbuffer_type, backbuffer); + /* backbuffer_type is ignored by native. */ + + if (!backbuffer) + { + WARN("The output pointer is NULL, returning D3DERR_INVALIDCALL.\n"); + return D3DERR_INVALIDCALL; + } + wined3d_mutex_lock(); - if ((wined3d_surface = wined3d_swapchain_get_back_buffer(swapchain->wined3d_swapchain, - backbuffer_idx, (enum wined3d_backbuffer_type)backbuffer_type))) + if ((wined3d_texture = wined3d_swapchain_get_back_buffer(swapchain->wined3d_swapchain, backbuffer_idx))) { - surface_impl = wined3d_surface_get_parent(wined3d_surface); - *backbuffer = &surface_impl->IDirect3DSurface9_iface; - IDirect3DSurface9_AddRef(*backbuffer); + wined3d_resource = wined3d_texture_get_sub_resource(wined3d_texture, 0); + surface_impl = wined3d_resource_get_parent(wined3d_resource); + *backbuffer = &surface_impl->IDirect3DSurface9_iface; + IDirect3DSurface9_AddRef(*backbuffer); } else { + /* Do not set *backbuffer = NULL, see tests/device.c, test_swapchain(). */ hr = D3DERR_INVALIDCALL; } wined3d_mutex_unlock(); diff -Nru wine1.7-1.7.50/dlls/d3d9/tests/d3d9ex.c wine1.7-1.7.55/dlls/d3d9/tests/d3d9ex.c --- wine1.7-1.7.50/dlls/d3d9/tests/d3d9ex.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d9/tests/d3d9ex.c 2015-11-13 14:32:40.000000000 +0000 @@ -2886,6 +2886,164 @@ } } +static void test_swapchain_parameters(void) +{ + IDirect3DDevice9Ex *device; + IDirect3D9Ex *d3d9ex; + HWND window; + HRESULT hr; + unsigned int i; + D3DPRESENT_PARAMETERS present_parameters, present_parameters_windowed = {0}, present_parameters2; + IDirect3DSwapChain9 *swapchain; + D3DDISPLAYMODEEX mode = {0}; + static const struct + { + BOOL windowed; + UINT backbuffer_count; + D3DSWAPEFFECT swap_effect; + HRESULT hr; + } + tests[] = + { + /* Swap effect 0 is not allowed. */ + {TRUE, 1, 0, D3DERR_INVALIDCALL}, + {FALSE, 1, 0, D3DERR_INVALIDCALL}, + + /* All (non-ex) swap effects are allowed in + * windowed and fullscreen mode. */ + {TRUE, 1, D3DSWAPEFFECT_DISCARD, D3D_OK}, + {TRUE, 1, D3DSWAPEFFECT_FLIP, D3D_OK}, + {FALSE, 1, D3DSWAPEFFECT_DISCARD, D3D_OK}, + {FALSE, 1, D3DSWAPEFFECT_FLIP, D3D_OK}, + {FALSE, 1, D3DSWAPEFFECT_COPY, D3D_OK}, + + /* Only one backbuffer in copy mode. */ + {TRUE, 0, D3DSWAPEFFECT_COPY, D3D_OK}, + {TRUE, 1, D3DSWAPEFFECT_COPY, D3D_OK}, + {TRUE, 2, D3DSWAPEFFECT_COPY, D3DERR_INVALIDCALL}, + {FALSE, 2, D3DSWAPEFFECT_COPY, D3DERR_INVALIDCALL}, + + /* Ok with the others, in fullscreen and windowed mode. */ + {TRUE, 2, D3DSWAPEFFECT_DISCARD, D3D_OK}, + {TRUE, 2, D3DSWAPEFFECT_FLIP, D3D_OK}, + {FALSE, 2, D3DSWAPEFFECT_DISCARD, D3D_OK}, + {FALSE, 2, D3DSWAPEFFECT_FLIP, D3D_OK}, + + /* D3D9Ex swap effects. Flipex works, Overlay is complicated + * and depends on HW features, pixel format, etc. */ + {TRUE, 1, D3DSWAPEFFECT_FLIPEX, D3D_OK}, + {TRUE, 1, D3DSWAPEFFECT_FLIPEX + 1, D3DERR_INVALIDCALL}, + {FALSE, 1, D3DSWAPEFFECT_FLIPEX, D3D_OK}, + {FALSE, 1, D3DSWAPEFFECT_FLIPEX + 1, D3DERR_INVALIDCALL}, + + /* 30 is the highest allowed backbuffer count. */ + {TRUE, 30, D3DSWAPEFFECT_DISCARD, D3D_OK}, + {TRUE, 31, D3DSWAPEFFECT_DISCARD, D3DERR_INVALIDCALL}, + {TRUE, 30, D3DSWAPEFFECT_FLIP, D3D_OK}, + {TRUE, 31, D3DSWAPEFFECT_FLIP, D3DERR_INVALIDCALL}, + {FALSE, 30, D3DSWAPEFFECT_DISCARD, D3D_OK}, + {FALSE, 31, D3DSWAPEFFECT_DISCARD, D3DERR_INVALIDCALL}, + {FALSE, 30, D3DSWAPEFFECT_FLIP, D3D_OK}, + {FALSE, 31, D3DSWAPEFFECT_FLIP, D3DERR_INVALIDCALL}, + }; + + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + hr = pDirect3DCreate9Ex(D3D_SDK_VERSION, &d3d9ex); + if (FAILED(hr)) + { + skip("Direct3D9Ex is not available (%#x)\n", hr); + return; + } + + if (!(device = create_device(window, NULL))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + IDirect3D9Ex_Release(d3d9ex); + DestroyWindow(window); + return; + } + IDirect3DDevice9Ex_Release(device); + + present_parameters_windowed.BackBufferWidth = registry_mode.dmPelsWidth; + present_parameters_windowed.BackBufferHeight = registry_mode.dmPelsHeight; + present_parameters_windowed.hDeviceWindow = window; + present_parameters_windowed.BackBufferFormat = D3DFMT_X8R8G8B8; + present_parameters_windowed.SwapEffect = D3DSWAPEFFECT_COPY; + present_parameters_windowed.Windowed = TRUE; + present_parameters_windowed.BackBufferCount = 1; + + mode.Size = sizeof(mode); + mode.Width = registry_mode.dmPelsWidth; + mode.Height = registry_mode.dmPelsHeight; + mode.RefreshRate = 0; + mode.Format = D3DFMT_X8R8G8B8; + mode.ScanLineOrdering = 0; + + for (i = 0; i < sizeof(tests) / sizeof(*tests); ++i) + { + memset(&present_parameters, 0, sizeof(present_parameters)); + present_parameters.BackBufferWidth = registry_mode.dmPelsWidth; + present_parameters.BackBufferHeight = registry_mode.dmPelsHeight; + present_parameters.hDeviceWindow = window; + present_parameters.BackBufferFormat = D3DFMT_X8R8G8B8; + + present_parameters.SwapEffect = tests[i].swap_effect; + present_parameters.Windowed = tests[i].windowed; + present_parameters.BackBufferCount = tests[i].backbuffer_count; + + hr = IDirect3D9Ex_CreateDeviceEx(d3d9ex, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window, + D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, + tests[i].windowed ? NULL : &mode, &device); + ok(hr == tests[i].hr, "Expected hr %x, got %x, test %u.\n", tests[i].hr, hr, i); + if (SUCCEEDED(hr)) + { + UINT bb_count = tests[i].backbuffer_count ? tests[i].backbuffer_count : 1; + + hr = IDirect3DDevice9Ex_GetSwapChain(device, 0, &swapchain); + ok(SUCCEEDED(hr), "Failed to get swapchain, hr %#x, test %u.\n", hr, i); + + hr = IDirect3DSwapChain9_GetPresentParameters(swapchain, &present_parameters2); + ok(SUCCEEDED(hr), "Failed to get present parameters, hr %#x, test %u.\n", hr, i); + ok(present_parameters2.SwapEffect == tests[i].swap_effect, "Swap effect changed from %u to %u, test %u.\n", + tests[i].swap_effect, present_parameters2.SwapEffect, i); + ok(present_parameters2.BackBufferCount == bb_count, "Backbuffer count changed from %u to %u, test %u.\n", + bb_count, present_parameters2.BackBufferCount, i); + ok(present_parameters2.Windowed == tests[i].windowed, "Windowed changed from %u to %u, test %u.\n", + tests[i].windowed, present_parameters2.Windowed, i); + + IDirect3DSwapChain9_Release(swapchain); + IDirect3DDevice9Ex_Release(device); + } + + hr = IDirect3D9Ex_CreateDeviceEx(d3d9ex, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window, + D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters_windowed, NULL, &device); + ok(SUCCEEDED(hr), "Failed to create device, hr %#x, test %u.\n", hr, i); + + memset(&present_parameters, 0, sizeof(present_parameters)); + present_parameters.BackBufferWidth = registry_mode.dmPelsWidth; + present_parameters.BackBufferHeight = registry_mode.dmPelsHeight; + present_parameters.hDeviceWindow = window; + present_parameters.BackBufferFormat = D3DFMT_X8R8G8B8; + + present_parameters.SwapEffect = tests[i].swap_effect; + present_parameters.Windowed = tests[i].windowed; + present_parameters.BackBufferCount = tests[i].backbuffer_count; + + hr = IDirect3DDevice9Ex_ResetEx(device, &present_parameters, tests[i].windowed ? NULL : &mode); + ok(hr == tests[i].hr, "Expected hr %x, got %x, test %u.\n", tests[i].hr, hr, i); + + if (FAILED(hr)) + { + hr = IDirect3DDevice9Ex_ResetEx(device, &present_parameters_windowed, NULL); + ok(SUCCEEDED(hr), "Failed to reset device, hr %#x, test %u.\n", hr, i); + } + IDirect3DDevice9Ex_Release(device); + } + + IDirect3D9Ex_Release(d3d9ex); + DestroyWindow(window); +} START_TEST(d3d9ex) { DEVMODEW current_mode; @@ -2930,4 +3088,5 @@ test_wndproc(); test_wndproc_windowed(); test_window_style(); + test_swapchain_parameters(); } diff -Nru wine1.7-1.7.50/dlls/d3d9/tests/device.c wine1.7-1.7.55/dlls/d3d9/tests/device.c --- wine1.7-1.7.50/dlls/d3d9/tests/device.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d9/tests/device.c 2015-11-13 14:32:40.000000000 +0000 @@ -1053,7 +1053,7 @@ IDirect3DSwapChain9 *swapchain2; IDirect3DSwapChain9 *swapchain3; IDirect3DSwapChain9 *swapchainX; - IDirect3DSurface9 *backbuffer; + IDirect3DSurface9 *backbuffer, *stereo_buffer; D3DPRESENT_PARAMETERS d3dpp; IDirect3DDevice9 *device; IDirect3D9 *d3d; @@ -1085,12 +1085,51 @@ ok(d3dpp.BackBufferCount == 1, "Got unexpected back buffer count %u.\n", d3dpp.BackBufferCount); IDirect3DSwapChain9_Release(swapchain0); + hr = IDirect3DSwapChain9_GetBackBuffer(swapchain0, 0, D3DBACKBUFFER_TYPE_MONO, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + /* IDirect3DDevice9::GetBackBuffer crashes if a NULL output pointer is passed. */ + backbuffer = (void *)0xdeadbeef; + hr = IDirect3DDevice9_GetBackBuffer(device, 1, 0, D3DBACKBUFFER_TYPE_MONO, &backbuffer); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + ok(!backbuffer, "The back buffer pointer is %p, expected NULL.\n", backbuffer); + backbuffer = (void *)0xdeadbeef; + hr = IDirect3DDevice9_GetBackBuffer(device, 0, 1, D3DBACKBUFFER_TYPE_MONO, &backbuffer); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + ok(!backbuffer, "The back buffer pointer is %p, expected NULL.\n", backbuffer); + /* Check if there is a back buffer */ hr = IDirect3DSwapChain9_GetBackBuffer(swapchain0, 0, D3DBACKBUFFER_TYPE_MONO, &backbuffer); ok(SUCCEEDED(hr), "Failed to get the back buffer (%08x)\n", hr); ok(backbuffer != NULL, "The back buffer is NULL\n"); if(backbuffer) IDirect3DSurface9_Release(backbuffer); + /* The back buffer type value is ignored. */ + hr = IDirect3DSwapChain9_GetBackBuffer(swapchain0, 0, D3DBACKBUFFER_TYPE_LEFT, &stereo_buffer); + ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr); + ok(stereo_buffer == backbuffer, "Expected left back buffer = %p, got %p.\n", backbuffer, stereo_buffer); + IDirect3DSurface9_Release(stereo_buffer); + hr = IDirect3DSwapChain9_GetBackBuffer(swapchain0, 0, D3DBACKBUFFER_TYPE_RIGHT, &stereo_buffer); + ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr); + ok(stereo_buffer == backbuffer, "Expected right back buffer = %p, got %p.\n", backbuffer, stereo_buffer); + IDirect3DSurface9_Release(stereo_buffer); + hr = IDirect3DSwapChain9_GetBackBuffer(swapchain0, 0, (D3DBACKBUFFER_TYPE)0xdeadbeef, &stereo_buffer); + ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr); + ok(stereo_buffer == backbuffer, "Expected unknown buffer = %p, got %p.\n", backbuffer, stereo_buffer); + IDirect3DSurface9_Release(stereo_buffer); + + hr = IDirect3DDevice9_GetBackBuffer(device, 0, 0, D3DBACKBUFFER_TYPE_LEFT, &stereo_buffer); + ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr); + ok(stereo_buffer == backbuffer, "Expected left back buffer = %p, got %p.\n", backbuffer, stereo_buffer); + IDirect3DSurface9_Release(stereo_buffer); + hr = IDirect3DDevice9_GetBackBuffer(device, 0, 0, D3DBACKBUFFER_TYPE_RIGHT, &stereo_buffer); + ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr); + ok(stereo_buffer == backbuffer, "Expected right back buffer = %p, got %p.\n", backbuffer, stereo_buffer); + IDirect3DSurface9_Release(stereo_buffer); + hr = IDirect3DDevice9_GetBackBuffer(device, 0, 0, (D3DBACKBUFFER_TYPE)0xdeadbeef, &stereo_buffer); + ok(SUCCEEDED(hr), "Failed to get the back buffer, hr %#x.\n", hr); + ok(stereo_buffer == backbuffer, "Expected unknown buffer = %p, got %p.\n", backbuffer, stereo_buffer); + IDirect3DSurface9_Release(stereo_buffer); + /* Try to get a nonexistent swapchain */ hr = IDirect3DDevice9_GetSwapChain(device, 1, &swapchainX); ok(hr == D3DERR_INVALIDCALL, "GetSwapChain on an nonexistent swapchain returned (%08x)\n", hr); @@ -1599,12 +1638,12 @@ ok(SUCCEEDED(hr), "Failed to create cursor surface, hr %#x.\n", hr); /* Initially hidden */ - hr = IDirect3DDevice9_ShowCursor(device, TRUE); - ok(hr == FALSE, "IDirect3DDevice9_ShowCursor returned %08x\n", hr); + ret = IDirect3DDevice9_ShowCursor(device, TRUE); + ok(!ret, "IDirect3DDevice9_ShowCursor returned %d\n", ret); /* Not enabled without a surface*/ - hr = IDirect3DDevice9_ShowCursor(device, TRUE); - ok(hr == FALSE, "IDirect3DDevice9_ShowCursor returned %08x\n", hr); + ret = IDirect3DDevice9_ShowCursor(device, TRUE); + ok(!ret, "IDirect3DDevice9_ShowCursor returned %d\n", ret); /* Fails */ hr = IDirect3DDevice9_SetCursorProperties(device, 0, 0, NULL); @@ -1622,12 +1661,12 @@ ok(info.hCursor == cur, "The cursor handle is %p\n", info.hCursor); /* unchanged */ /* Still hidden */ - hr = IDirect3DDevice9_ShowCursor(device, TRUE); - ok(hr == FALSE, "IDirect3DDevice9_ShowCursor returned %08x\n", hr); + ret = IDirect3DDevice9_ShowCursor(device, TRUE); + ok(!ret, "IDirect3DDevice9_ShowCursor returned %d\n", ret); /* Enabled now*/ - hr = IDirect3DDevice9_ShowCursor(device, TRUE); - ok(hr == TRUE, "IDirect3DDevice9_ShowCursor returned %08x\n", hr); + ret = IDirect3DDevice9_ShowCursor(device, TRUE); + ok(ret, "IDirect3DDevice9_ShowCursor returned %d\n", ret); memset(&info, 0, sizeof(info)); info.cbSize = sizeof(info); @@ -10170,6 +10209,149 @@ DestroyWindow(window); } +static void test_swapchain_parameters(void) +{ + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + HWND window; + HRESULT hr; + unsigned int i; + D3DPRESENT_PARAMETERS present_parameters, present_parameters_windowed = {0}, present_parameters2; + IDirect3DSwapChain9 *swapchain; + static const struct + { + BOOL windowed; + UINT backbuffer_count; + D3DSWAPEFFECT swap_effect; + HRESULT hr; + } + tests[] = + { + /* Swap effect 0 is not allowed. */ + {TRUE, 1, 0, D3DERR_INVALIDCALL}, + {FALSE, 1, 0, D3DERR_INVALIDCALL}, + + /* All (non-ex) swap effects are allowed in + * windowed and fullscreen mode. */ + {TRUE, 1, D3DSWAPEFFECT_DISCARD, D3D_OK}, + {TRUE, 1, D3DSWAPEFFECT_FLIP, D3D_OK}, + {FALSE, 1, D3DSWAPEFFECT_DISCARD, D3D_OK}, + {FALSE, 1, D3DSWAPEFFECT_FLIP, D3D_OK}, + {FALSE, 1, D3DSWAPEFFECT_COPY, D3D_OK}, + + /* Only one backbuffer in copy mode. */ + {TRUE, 0, D3DSWAPEFFECT_COPY, D3D_OK}, + {TRUE, 1, D3DSWAPEFFECT_COPY, D3D_OK}, + {TRUE, 2, D3DSWAPEFFECT_COPY, D3DERR_INVALIDCALL}, + {FALSE, 2, D3DSWAPEFFECT_COPY, D3DERR_INVALIDCALL}, + + /* Ok with the others, in fullscreen and windowed mode. */ + {TRUE, 2, D3DSWAPEFFECT_DISCARD, D3D_OK}, + {TRUE, 2, D3DSWAPEFFECT_FLIP, D3D_OK}, + {FALSE, 2, D3DSWAPEFFECT_DISCARD, D3D_OK}, + {FALSE, 2, D3DSWAPEFFECT_FLIP, D3D_OK}, + + /* D3D9Ex swap effects. */ + {TRUE, 1, D3DSWAPEFFECT_OVERLAY, D3DERR_INVALIDCALL}, + {TRUE, 1, D3DSWAPEFFECT_FLIPEX, D3DERR_INVALIDCALL}, + {TRUE, 1, D3DSWAPEFFECT_FLIPEX + 1, D3DERR_INVALIDCALL}, + {FALSE, 1, D3DSWAPEFFECT_OVERLAY, D3DERR_INVALIDCALL}, + {FALSE, 1, D3DSWAPEFFECT_FLIPEX, D3DERR_INVALIDCALL}, + {FALSE, 1, D3DSWAPEFFECT_FLIPEX + 1, D3DERR_INVALIDCALL}, + + /* 3 is the highest allowed backbuffer count. */ + {TRUE, 3, D3DSWAPEFFECT_DISCARD, D3D_OK}, + {TRUE, 4, D3DSWAPEFFECT_DISCARD, D3DERR_INVALIDCALL}, + {TRUE, 4, D3DSWAPEFFECT_FLIP, D3DERR_INVALIDCALL}, + {FALSE, 4, D3DSWAPEFFECT_DISCARD, D3DERR_INVALIDCALL}, + {FALSE, 4, D3DSWAPEFFECT_FLIP, D3DERR_INVALIDCALL}, + }; + + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, NULL))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + IDirect3D9_Release(d3d); + DestroyWindow(window); + return; + } + IDirect3DDevice9_Release(device); + + present_parameters_windowed.BackBufferWidth = registry_mode.dmPelsWidth; + present_parameters_windowed.BackBufferHeight = registry_mode.dmPelsHeight; + present_parameters_windowed.hDeviceWindow = window; + present_parameters_windowed.BackBufferFormat = D3DFMT_X8R8G8B8; + present_parameters_windowed.SwapEffect = D3DSWAPEFFECT_COPY; + present_parameters_windowed.Windowed = TRUE; + present_parameters_windowed.BackBufferCount = 1; + + for (i = 0; i < sizeof(tests) / sizeof(*tests); ++i) + { + memset(&present_parameters, 0, sizeof(present_parameters)); + present_parameters.BackBufferWidth = registry_mode.dmPelsWidth; + present_parameters.BackBufferHeight = registry_mode.dmPelsHeight; + present_parameters.hDeviceWindow = window; + present_parameters.BackBufferFormat = D3DFMT_X8R8G8B8; + + present_parameters.SwapEffect = tests[i].swap_effect; + present_parameters.Windowed = tests[i].windowed; + present_parameters.BackBufferCount = tests[i].backbuffer_count; + + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window, + D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device); + ok(hr == tests[i].hr, "Expected hr %x, got %x, test %u.\n", tests[i].hr, hr, i); + if (SUCCEEDED(hr)) + { + UINT bb_count = tests[i].backbuffer_count ? tests[i].backbuffer_count : 1; + + hr = IDirect3DDevice9_GetSwapChain(device, 0, &swapchain); + ok(SUCCEEDED(hr), "Failed to get swapchain, hr %#x, test %u.\n", hr, i); + + hr = IDirect3DSwapChain9_GetPresentParameters(swapchain, &present_parameters2); + ok(SUCCEEDED(hr), "Failed to get present parameters, hr %#x, test %u.\n", hr, i); + ok(present_parameters2.SwapEffect == tests[i].swap_effect, "Swap effect changed from %u to %u, test %u.\n", + tests[i].swap_effect, present_parameters2.SwapEffect, i); + ok(present_parameters2.BackBufferCount == bb_count, "Backbuffer count changed from %u to %u, test %u.\n", + bb_count, present_parameters2.BackBufferCount, i); + ok(present_parameters2.Windowed == tests[i].windowed, "Windowed changed from %u to %u, test %u.\n", + tests[i].windowed, present_parameters2.Windowed, i); + + IDirect3DSwapChain9_Release(swapchain); + IDirect3DDevice9_Release(device); + } + + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window, + D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters_windowed, &device); + ok(SUCCEEDED(hr), "Failed to create device, hr %#x, test %u.\n", hr, i); + + memset(&present_parameters, 0, sizeof(present_parameters)); + present_parameters.BackBufferWidth = registry_mode.dmPelsWidth; + present_parameters.BackBufferHeight = registry_mode.dmPelsHeight; + present_parameters.hDeviceWindow = window; + present_parameters.BackBufferFormat = D3DFMT_X8R8G8B8; + + present_parameters.SwapEffect = tests[i].swap_effect; + present_parameters.Windowed = tests[i].windowed; + present_parameters.BackBufferCount = tests[i].backbuffer_count; + + hr = IDirect3DDevice9_Reset(device, &present_parameters); + ok(hr == tests[i].hr, "Expected hr %x, got %x, test %u.\n", tests[i].hr, hr, i); + + if (FAILED(hr)) + { + hr = IDirect3DDevice9_Reset(device, &present_parameters_windowed); + ok(SUCCEEDED(hr), "Failed to reset device, hr %#x, test %u.\n", hr, i); + } + IDirect3DDevice9_Release(device); + } + + IDirect3D9_Release(d3d); + DestroyWindow(window); +} + START_TEST(device) { WNDCLASSA wc = {0}; @@ -10280,6 +10462,7 @@ test_writeonly_resource(); test_lost_device(); test_resource_priority(); + test_swapchain_parameters(); UnregisterClassA("d3d9_test_wc", GetModuleHandleA(NULL)); } diff -Nru wine1.7-1.7.50/dlls/d3d9/tests/stateblock.c wine1.7-1.7.55/dlls/d3d9/tests/stateblock.c --- wine1.7-1.7.50/dlls/d3d9/tests/stateblock.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d9/tests/stateblock.c 2015-11-13 14:32:40.000000000 +0000 @@ -1384,7 +1384,7 @@ data->states[idx++] = TRUE; /* ALPHABLENDENABLE */ data->states[idx++] = TRUE; /* FOGENABLE */ data->states[idx++] = TRUE; /* SPECULARENABLE */ - data->states[idx++] = 1 << 31; /* FOGCOLOR */ + data->states[idx++] = 1u << 31; /* FOGCOLOR */ data->states[idx++] = D3DFOG_EXP; /* FOGTABLEMODE */ data->states[idx++] = to_dword(0.1f); /* FOGSTART */ data->states[idx++] = to_dword(0.8f); /* FOGEND */ diff -Nru wine1.7-1.7.50/dlls/d3d9/tests/visual.c wine1.7-1.7.55/dlls/d3d9/tests/visual.c --- wine1.7-1.7.50/dlls/d3d9/tests/visual.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d9/tests/visual.c 2015-11-13 14:32:40.000000000 +0000 @@ -65,16 +65,21 @@ static BOOL color_match(D3DCOLOR c1, D3DCOLOR c2, BYTE max_diff) { - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (abs((int)(c1 & 0xff) - (int)(c2 & 0xff)) > max_diff) return FALSE; c1 >>= 8; c2 >>= 8; - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (abs((int)(c1 & 0xff) - (int)(c2 & 0xff)) > max_diff) return FALSE; c1 >>= 8; c2 >>= 8; - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (abs((int)(c1 & 0xff) - (int)(c2 & 0xff)) > max_diff) return FALSE; c1 >>= 8; c2 >>= 8; - if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; + if (abs((int)(c1 & 0xff) - (int)(c2 & 0xff)) > max_diff) return FALSE; return TRUE; } +static BOOL adapter_is_warp(const D3DADAPTER_IDENTIFIER9 *identifier) +{ + return !strcmp(identifier->Driver, "d3d10warp.dll"); +} + /* Locks a given surface and returns the color at (x,y). It's the caller's * responsibility to only pass in lockable surfaces and valid x,y coordinates */ static DWORD getPixelColorFromSurface(IDirect3DSurface9 *surface, UINT x, UINT y) @@ -117,59 +122,90 @@ return color; } -static DWORD getPixelColor(IDirect3DDevice9 *device, UINT x, UINT y) +struct surface_readback { - DWORD ret; - IDirect3DSurface9 *surf = NULL, *target = NULL; + IDirect3DSurface9 *surface; + D3DLOCKED_RECT locked_rect; +}; + +static void get_rt_readback(IDirect3DSurface9 *surface, struct surface_readback *rb) +{ + IDirect3DDevice9 *device; HRESULT hr; - D3DLOCKED_RECT lockedRect; - RECT rectToLock = {x, y, x+1, y+1}; + memset(rb, 0, sizeof(*rb)); + IDirect3DSurface9_GetDevice(surface, &device); hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 640, 480, - D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &surf, NULL); - if (FAILED(hr) || !surf) + D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &rb->surface, NULL); + if (FAILED(hr) || !rb->surface) { - trace("Can't create an offscreen plain surface to read the render target data, hr=%08x\n", hr); - return 0xdeadbeef; + trace("Can't create an offscreen plain surface to read the render target data, hr %#x.\n", hr); + goto error; } - hr = IDirect3DDevice9_GetRenderTarget(device, 0, &target); - if(FAILED(hr)) + hr = IDirect3DDevice9_GetRenderTargetData(device, surface, rb->surface); + if (FAILED(hr)) { - trace("Can't get the render target, hr=%08x\n", hr); - ret = 0xdeadbeed; - goto out; + trace("Can't read the render target data, hr %#x.\n", hr); + goto error; } - hr = IDirect3DDevice9_GetRenderTargetData(device, target, surf); + hr = IDirect3DSurface9_LockRect(rb->surface, &rb->locked_rect, NULL, D3DLOCK_READONLY); if (FAILED(hr)) { - trace("Can't read the render target data, hr=%08x\n", hr); - ret = 0xdeadbeec; - goto out; + trace("Can't lock the offscreen surface, hr %#x.\n", hr); + goto error; } + IDirect3DDevice9_Release(device); + + return; - hr = IDirect3DSurface9_LockRect(surf, &lockedRect, &rectToLock, D3DLOCK_READONLY); +error: + if (rb->surface) + IDirect3DSurface9_Release(rb->surface); + rb->surface = NULL; + IDirect3DDevice9_Release(device); +} + +static DWORD get_readback_color(struct surface_readback *rb, unsigned int x, unsigned int y) +{ + return rb->locked_rect.pBits + ? ((DWORD *)rb->locked_rect.pBits)[y * rb->locked_rect.Pitch / sizeof(DWORD) + x] : 0xdeadbeef; +} + +static void release_surface_readback(struct surface_readback *rb) +{ + HRESULT hr; + + if (!rb->surface) + return; + if (rb->locked_rect.pBits && FAILED(hr = IDirect3DSurface9_UnlockRect(rb->surface))) + trace("Can't unlock the offscreen surface, hr %#x.\n", hr); + IDirect3DSurface9_Release(rb->surface); +} + +static DWORD getPixelColor(IDirect3DDevice9 *device, UINT x, UINT y) +{ + DWORD ret; + IDirect3DSurface9 *rt; + struct surface_readback rb; + HRESULT hr; + + hr = IDirect3DDevice9_GetRenderTarget(device, 0, &rt); if(FAILED(hr)) { - trace("Can't lock the offscreen surface, hr=%08x\n", hr); - ret = 0xdeadbeeb; - goto out; + trace("Can't get the render target, hr %#x.\n", hr); + return 0xdeadbeed; } + get_rt_readback(rt, &rb); /* Remove the X channel for now. DirectX and OpenGL have different ideas how to treat it apparently, and it isn't * really important for these tests */ - ret = ((DWORD *) lockedRect.pBits)[0] & 0x00ffffff; - hr = IDirect3DSurface9_UnlockRect(surf); - if(FAILED(hr)) - { - trace("Can't unlock the offscreen surface, hr=%08x\n", hr); - } + ret = get_readback_color(&rb, x, y) & 0x00ffffff; + release_surface_readback(&rb); -out: - if(target) IDirect3DSurface9_Release(target); - if(surf) IDirect3DSurface9_Release(surf); + IDirect3DSurface9_Release(rt); return ret; } @@ -7020,6 +7056,20 @@ 0x0000ffff /* end */ }; /* sample: fails */ + static const DWORD texcoord1_code[] = + { + 0xffff0300, /* ps_3_0 */ + 0x0200001f, 0x80010005, 0x900f0000, /* dcl_texcoord1, v0 */ + 0x02000001, 0x800f0800, 0x90e40000, /* mov oC0, v0 */ + 0x0000ffff /* end */ + }; + static const DWORD texcoord1_alpha_code[] = + { + 0xffff0300, /* ps_3_0 */ + 0x0200001f, 0x80010005, 0x900f0000, /* dcl_texcoord1, v0 */ + 0x02000001, 0x800f0800, 0x90ff0000, /* mov oC0, v0.w */ + 0x0000ffff /* end */ + }; static const struct { @@ -7027,19 +7077,22 @@ const DWORD *shader_code; DWORD color; BOOL todo; + BOOL broken_warp; } tests[] = { - {"blendweight", blendweight_code, 0x00191919, TRUE }, - {"blendindices", blendindices_code, 0x00333333, TRUE }, - {"normal", normal_code, 0x004c4c4c, TRUE }, - {"texcoord0", texcoord0_code, 0x00808c8c, FALSE}, - {"tangent", tangent_code, 0x00999999, TRUE }, - {"binormal", binormal_code, 0x00b2b2b2, TRUE }, - {"color", color_code, 0x00e6e6e6, FALSE}, - {"fog", fog_code, 0x00666666, TRUE }, - {"depth", depth_code, 0x00cccccc, TRUE }, - {"specular", specular_code, 0x004488ff, FALSE}, + {"blendweight", blendweight_code, 0x00191919, TRUE }, + {"blendindices", blendindices_code, 0x00333333, TRUE }, + {"normal", normal_code, 0x004c4c4c, TRUE }, + {"texcoord0", texcoord0_code, 0x00808c8c, FALSE}, + {"tangent", tangent_code, 0x00999999, TRUE }, + {"binormal", binormal_code, 0x00b2b2b2, TRUE }, + {"color", color_code, 0x00e6e6e6, FALSE}, + {"fog", fog_code, 0x00666666, TRUE }, + {"depth", depth_code, 0x00cccccc, TRUE }, + {"specular", specular_code, 0x004488ff, FALSE}, + {"texcoord1", texcoord1_code, 0x00000000, FALSE}, + {"texcoord1 alpha", texcoord1_alpha_code, 0x00000000, FALSE, TRUE}, }; /* Declare a monster vertex type :-) */ static const D3DVERTEXELEMENT9 decl_elements[] = { @@ -7126,6 +7179,7 @@ 0x224488ff, /* Nothing special */ }, }; + D3DADAPTER_IDENTIFIER9 identifier; IDirect3DVertexDeclaration9 *decl; IDirect3DDevice9 *device; IDirect3D9 *d3d; @@ -7135,6 +7189,7 @@ DWORD color; HWND window; HRESULT hr; + BOOL warp; window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 0, 0, 640, 480, NULL, NULL, NULL, NULL); @@ -7155,6 +7210,10 @@ goto done; } + hr = IDirect3D9_GetAdapterIdentifier(d3d, D3DADAPTER_DEFAULT, 0, &identifier); + ok(SUCCEEDED(hr), "Failed to get adapter identifier, hr %#x.\n", hr); + warp = adapter_is_warp(&identifier); + hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements, &decl); ok(hr == D3D_OK, "IDirect3DDevice9_CreateVertexDeclaration returned %08x\n", hr); hr = IDirect3DDevice9_SetVertexDeclaration(device, decl); @@ -7190,7 +7249,7 @@ "Test %s returned color 0x%08x, expected 0x%08x (todo).\n", tests[i].name, color, tests[i].color); else - ok(color_match(color, tests[i].color, 1), + ok(color_match(color, tests[i].color, 1) || broken(warp && tests[i].broken_warp), "Test %s returned color 0x%08x, expected 0x%08x.\n", tests[i].name, color, tests[i].color); @@ -7664,7 +7723,7 @@ hr = IDirect3D9_GetAdapterIdentifier(d3d, D3DADAPTER_DEFAULT, 0, &identifier); ok(SUCCEEDED(hr), "Failed to get adapter identifier, hr %#x.\n", hr); - warp = !strcmp(identifier.Description, "Microsoft Basic Render Driver"); + warp = adapter_is_warp(&identifier); hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements_twotexcrd, &decl_twotexcrd); ok(hr == D3D_OK, "IDirect3DDevice9_CreateVertexDeclaration returned %08x\n", hr); @@ -8036,23 +8095,70 @@ DestroyWindow(window); } -static void shademode_test(void) +static void test_shademode(void) { - /* Render a quad and try all of the different fixed function shading models. */ - DWORD color0_gouraud = 0, color1_gouraud = 0; - DWORD primtype = D3DPT_TRIANGLESTRIP; IDirect3DVertexBuffer9 *vb_strip; IDirect3DVertexBuffer9 *vb_list; - DWORD shademode = D3DSHADE_FLAT; + IDirect3DVertexShader9 *vs; + IDirect3DPixelShader9 *ps; IDirect3DDevice9 *device; DWORD color0, color1; void *data = NULL; IDirect3D9 *d3d; ULONG refcount; + D3DCAPS9 caps; HWND window; HRESULT hr; - UINT i, j; - + UINT i; + static const DWORD vs1_code[] = + { + 0xfffe0101, /* vs_1_1 */ + 0x0000001f, 0x80000000, 0x900f0000, /* dcl_position v0 */ + 0x0000001f, 0x8000000a, 0x900f0001, /* dcl_color0 v1 */ + 0x00000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */ + 0x00000001, 0xd00f0000, 0x90e40001, /* mov oD0, v1 */ + 0x0000ffff + }; + static const DWORD vs2_code[] = + { + 0xfffe0200, /* vs_2_0 */ + 0x0200001f, 0x80000000, 0x900f0000, /* dcl_position v0 */ + 0x0200001f, 0x8000000a, 0x900f0001, /* dcl_color0 v1 */ + 0x02000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */ + 0x02000001, 0xd00f0000, 0x90e40001, /* mov oD0, v1 */ + 0x0000ffff + }; + static const DWORD vs3_code[] = + { + 0xfffe0300, /* vs_3_0 */ + 0x0200001f, 0x80000000, 0x900f0000, /* dcl_position v0 */ + 0x0200001f, 0x8000000a, 0x900f0001, /* dcl_color0 v1 */ + 0x0200001f, 0x80000000, 0xe00f0000, /* dcl_position o0 */ + 0x0200001f, 0x8000000a, 0xe00f0001, /* dcl_color0 o1 */ + 0x02000001, 0xe00f0000, 0x90e40000, /* mov o0, v0 */ + 0x02000001, 0xe00f0001, 0x90e40001, /* mov o1, v1 */ + 0x0000ffff + }; + static const DWORD ps1_code[] = + { + 0xffff0101, /* ps_1_1 */ + 0x00000001, 0x800f0000, 0x90e40000, /* mov r0, v0 */ + 0x0000ffff + }; + static const DWORD ps2_code[] = + { + 0xffff0200, /* ps_2_0 */ + 0x0200001f, 0x80000000, 0x900f0000, /* dcl v0 */ + 0x02000001, 0x800f0800, 0x90e40000, /* mov oC0, v0 */ + 0x0000ffff + }; + static const DWORD ps3_code[] = + { + 0xffff0300, /* ps_3_0 */ + 0x0200001f, 0x8000000a, 0x900f0000, /* dcl_color0 v0 */ + 0x02000001, 0x800f0800, 0x90e40000, /* mov oC0, v0 */ + 0x0000ffff + }; static const struct { struct vec3 position; @@ -8075,6 +8181,46 @@ {{-1.0f, 1.0f, 0.0f}, 0xff00ff00}, {{ 1.0f, 1.0f, 0.0f}, 0xffffffff}, }; + static const struct test_shader + { + DWORD version; + const DWORD *code; + } + novs = {0, NULL}, + vs_1 = {D3DVS_VERSION(1, 1), vs1_code}, + vs_2 = {D3DVS_VERSION(2, 0), vs2_code}, + vs_3 = {D3DVS_VERSION(3, 0), vs3_code}, + nops = {0, NULL}, + ps_1 = {D3DPS_VERSION(1, 1), ps1_code}, + ps_2 = {D3DPS_VERSION(2, 0), ps2_code}, + ps_3 = {D3DPS_VERSION(3, 0), ps3_code}; + static const struct + { + const struct test_shader *vs, *ps; + DWORD primtype; + DWORD shademode; + DWORD color0, color1; + BOOL todo; + } + tests[] = + { + {&novs, &nops, D3DPT_TRIANGLESTRIP, D3DSHADE_FLAT, 0x00ff0000, 0x0000ff00, FALSE}, + {&novs, &nops, D3DPT_TRIANGLESTRIP, D3DSHADE_PHONG, 0x000dca28, 0x000d45c7, FALSE}, + {&novs, &nops, D3DPT_TRIANGLESTRIP, D3DSHADE_GOURAUD, 0x000dca28, 0x000d45c7, FALSE}, + {&novs, &nops, D3DPT_TRIANGLESTRIP, D3DSHADE_PHONG, 0x000dca28, 0x000d45c7, FALSE}, + {&novs, &nops, D3DPT_TRIANGLELIST, D3DSHADE_FLAT, 0x00ff0000, 0x000000ff, FALSE}, + {&novs, &nops, D3DPT_TRIANGLELIST, D3DSHADE_GOURAUD, 0x000dca28, 0x000d45c7, FALSE}, + {&vs_1, &ps_1, D3DPT_TRIANGLESTRIP, D3DSHADE_FLAT, 0x00ff0000, 0x0000ff00, FALSE}, + {&vs_1, &ps_1, D3DPT_TRIANGLESTRIP, D3DSHADE_GOURAUD, 0x000dca28, 0x000d45c7, FALSE}, + {&vs_1, &ps_1, D3DPT_TRIANGLELIST, D3DSHADE_FLAT, 0x00ff0000, 0x000000ff, FALSE}, + {&vs_1, &ps_1, D3DPT_TRIANGLELIST, D3DSHADE_GOURAUD, 0x000dca28, 0x000d45c7, FALSE}, + {&novs, &ps_1, D3DPT_TRIANGLESTRIP, D3DSHADE_FLAT, 0x00ff0000, 0x0000ff00, FALSE}, + {&vs_1, &nops, D3DPT_TRIANGLESTRIP, D3DSHADE_FLAT, 0x00ff0000, 0x0000ff00, FALSE}, + {&vs_2, &ps_2, D3DPT_TRIANGLESTRIP, D3DSHADE_FLAT, 0x00ff0000, 0x0000ff00, FALSE}, + {&vs_2, &ps_2, D3DPT_TRIANGLESTRIP, D3DSHADE_GOURAUD, 0x000dca28, 0x000d45c7, FALSE}, + {&vs_3, &ps_3, D3DPT_TRIANGLESTRIP, D3DSHADE_FLAT, 0x00ff0000, 0x0000ff00, TRUE}, + {&vs_3, &ps_3, D3DPT_TRIANGLESTRIP, D3DSHADE_GOURAUD, 0x000dca28, 0x000d45c7, FALSE}, + }; window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 0, 0, 640, 480, NULL, NULL, NULL, NULL); @@ -8088,6 +8234,8 @@ hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable fog, hr %#x.\n", hr); hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF failed with %08x\n", hr); @@ -8108,84 +8256,109 @@ hr = IDirect3DVertexBuffer9_Unlock(vb_list); ok(hr == D3D_OK, "IDirect3DVertexBuffer9_Unlock failed with %08x\n", hr); + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + /* Try it first with a TRIANGLESTRIP. Do it with different geometry because * the color fixups we have to do for FLAT shading will be dependent on that. */ - hr = IDirect3DDevice9_SetStreamSource(device, 0, vb_strip, 0, sizeof(quad_strip[0])); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSource failed with %08x\n", hr); - - /* First loop uses a TRIANGLESTRIP geometry, 2nd uses a TRIANGLELIST */ - for (j=0; j<2; j++) { - /* Inner loop just changes the D3DRS_SHADEMODE */ - for (i=0; i<3; i++) { - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0); - ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); + for (i = 0; i < sizeof(tests) / sizeof(tests[0]); ++i) + { + if (tests[i].vs->version) + { + if (caps.VertexShaderVersion >= tests[i].vs->version) + { + hr = IDirect3DDevice9_CreateVertexShader(device, tests[i].vs->code, &vs); + ok(hr == D3D_OK, "Failed to create vertex shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetVertexShader(device, vs); + ok(hr == D3D_OK, "Failed to set vertex shader, hr %#x.\n", hr); + } + else + { + skip("Shader version unsupported, skipping some tests.\n"); + continue; + } + } + else + { + vs = NULL; + } + if (tests[i].ps->version) + { + if (caps.PixelShaderVersion >= tests[i].ps->version) + { + hr = IDirect3DDevice9_CreatePixelShader(device, tests[i].ps->code, &ps); + ok(hr == D3D_OK, "Failed to create pixel shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetPixelShader(device, ps); + ok(hr == D3D_OK, "Failed to set pixel shader, hr %#x.\n", hr); + } + else + { + skip("Shader version unsupported, skipping some tests.\n"); + if (vs) + { + IDirect3DDevice9_SetVertexShader(device, NULL); + IDirect3DVertexShader9_Release(vs); + } + continue; + } + } + else + { + ps = NULL; + } - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SHADEMODE, shademode); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); + hr = IDirect3DDevice9_SetStreamSource(device, 0, + tests[i].primtype == D3DPT_TRIANGLESTRIP ? vb_strip : vb_list, 0, sizeof(quad_strip[0])); + ok(hr == D3D_OK, "Failed to set stream source, hr %#x.\n", hr); - hr = IDirect3DDevice9_BeginScene(device); - ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - hr = IDirect3DDevice9_DrawPrimitive(device, primtype, 0, 2); - 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); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); + ok(hr == D3D_OK, "Failed to clear, hr %#x.\n", hr); - /* Sample two spots from the output */ - color0 = getPixelColor(device, 100, 100); /* Inside first triangle */ - color1 = getPixelColor(device, 500, 350); /* Inside second triangle */ - switch(shademode) { - case D3DSHADE_FLAT: - /* Should take the color of the first vertex of each triangle */ - if (0) - { - /* This test depends on EXT_provoking_vertex being - * available. This extension is currently (20090810) - * not common enough to let the test fail if it isn't - * present. */ - ok(color0 == 0x00ff0000, "FLAT shading has color0 %08x, expected 0x00ff0000\n", color0); - ok(color1 == 0x0000ff00, "FLAT shading has color1 %08x, expected 0x0000ff00\n", color1); - } - shademode = D3DSHADE_GOURAUD; - break; - case D3DSHADE_GOURAUD: - /* Should be an interpolated blend */ + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SHADEMODE, tests[i].shademode); + ok(hr == D3D_OK, "Failed to set shade mode, hr %#x.\n", hr); - ok(color_match(color0, D3DCOLOR_ARGB(0x00, 0x0d, 0xca, 0x28), 2), - "GOURAUD shading has color0 %08x, expected 0x00dca28\n", color0); - ok(color_match(color1, D3DCOLOR_ARGB(0x00, 0x0d, 0x45, 0xc7), 2), - "GOURAUD shading has color1 %08x, expected 0x000d45c7\n", color1); + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitive(device, tests[i].primtype, 0, 2); + 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); - color0_gouraud = color0; - color1_gouraud = color1; + color0 = getPixelColor(device, 100, 100); /* Inside first triangle */ + color1 = getPixelColor(device, 500, 350); /* Inside second triangle */ - shademode = D3DSHADE_PHONG; - break; - case D3DSHADE_PHONG: - /* Should be the same as GOURAUD, since no hardware implements this */ - ok(color_match(color0, D3DCOLOR_ARGB(0x00, 0x0d, 0xca, 0x28), 2), - "PHONG shading has color0 %08x, expected 0x000dca28\n", color0); - ok(color_match(color1, D3DCOLOR_ARGB(0x00, 0x0d, 0x45, 0xc7), 2), - "PHONG shading has color1 %08x, expected 0x000d45c7\n", color1); - - ok(color0 == color0_gouraud, "difference between GOURAUD and PHONG shading detected: %08x %08x\n", - color0_gouraud, color0); - ok(color1 == color1_gouraud, "difference between GOURAUD and PHONG shading detected: %08x %08x\n", - color1_gouraud, color1); - break; - } + /* For D3DSHADE_FLAT it should take the color of the first vertex of + * each triangle. This requires EXT_provoking_vertex or similar + * functionality being available. */ + /* PHONG should be the same as GOURAUD, since no hardware implements + * this. */ + if (tests[i].todo) + { + todo_wine ok(color0 == tests[i].color0, "Test %u shading has color0 %08x, expected %08x.\n", + i, color0, tests[i].color0); + todo_wine ok(color1 == tests[i].color1, "Test %u shading has color1 %08x, expected %08x.\n", + i, color1, tests[i].color1); } + else + { + ok(color0 == tests[i].color0, "Test %u shading has color0 %08x, expected %08x.\n", + i, color0, tests[i].color0); + ok(color1 == tests[i].color1, "Test %u shading has color1 %08x, expected %08x.\n", + i, color1, tests[i].color1); + } + IDirect3DDevice9_SetVertexShader(device, NULL); + IDirect3DDevice9_SetPixelShader(device, NULL); - hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr); - - /* Now, do it all over again with a TRIANGLELIST */ - hr = IDirect3DDevice9_SetStreamSource(device, 0, vb_list, 0, sizeof(quad_list[0])); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSource failed with %08x\n", hr); - primtype = D3DPT_TRIANGLELIST; - shademode = D3DSHADE_FLAT; + if (ps) + IDirect3DPixelShader9_Release(ps); + if (vs) + IDirect3DVertexShader9_Release(vs); } + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(hr == D3D_OK, "Failed to present, hr %#x.\n", hr); + IDirect3DVertexBuffer9_Release(vb_strip); IDirect3DVertexBuffer9_Release(vb_list); refcount = IDirect3DDevice9_Release(device); @@ -10141,7 +10314,7 @@ return TRUE; } -static void pointsize_test(void) +static void test_pointsize(void) { static const float a = 1.0f, b = 1.0f, c = 1.0f; float ptsize, ptsizemax_orig, ptsizemin_orig; @@ -10664,35 +10837,40 @@ } else { + struct surface_readback rb; + + get_rt_readback(backbuffer, &rb); /* On AMD apparently only the first texcoord is modified by the point coordinates * when using SM2/3 pixel shaders. */ - color = getPixelColor(device, 64 - size / 2 + 1, 64 - size / 2 + 1); + color = get_readback_color(&rb, 64 - size / 2 + 1, 64 - size / 2 + 1); ok(color_match(color, 0x00ff0000, 0), "Got unexpected color 0x%08x (case %u, %u, size %u).\n", color, i, j, size); - color = getPixelColor(device, 64 + size / 2 - 1, 64 - size / 2 + 1); + color = get_readback_color(&rb, 64 + size / 2 - 1, 64 - size / 2 + 1); ok(color_match(color, test_setups[i].gives_0_0_texcoord ? 0x00ff0000 : 0x00ffff00, 0) || (allow_broken && broken(color_match(color, 0x00ff0000, 0))), "Got unexpected color 0x%08x (case %u, %u, size %u).\n", color, i, j, size); - color = getPixelColor(device, 64 - size / 2 + 1, 64 + size / 2 - 1); + color = get_readback_color(&rb, 64 - size / 2 + 1, 64 + size / 2 - 1); ok(color_match(color, test_setups[i].gives_0_0_texcoord ? 0x00ff0000 : 0x00000000, 0), "Got unexpected color 0x%08x (case %u, %u, size %u).\n", color, i, j, size); - color = getPixelColor(device, 64 + size / 2 - 1, 64 + size / 2 - 1); + color = get_readback_color(&rb, 64 + size / 2 - 1, 64 + size / 2 - 1); ok(color_match(color, test_setups[i].gives_0_0_texcoord ? 0x00ff0000 : 0x0000ff00, 0) || (allow_broken && broken(color_match(color, 0x00000000, 0))), "Got unexpected color 0x%08x (case %u, %u, size %u).\n", color, i, j, size); - color = getPixelColor(device, 64 - size / 2 - 1, 64 - size / 2 - 1); - ok(color_match(color, 0x0000ffff, 0), + color = get_readback_color(&rb, 64 - size / 2 - 1, 64 - size / 2 - 1); + ok(color_match(color, 0xff00ffff, 0), "Got unexpected color 0x%08x (case %u, %u, size %u).\n", color, i, j, size); - color = getPixelColor(device, 64 + size / 2 + 1, 64 - size / 2 - 1); - ok(color_match(color, 0x0000ffff, 0), + color = get_readback_color(&rb, 64 + size / 2 + 1, 64 - size / 2 - 1); + ok(color_match(color, 0xff00ffff, 0), "Got unexpected color 0x%08x (case %u, %u, size %u).\n", color, i, j, size); - color = getPixelColor(device, 64 - size / 2 - 1, 64 + size / 2 + 1); - ok(color_match(color, 0x0000ffff, 0), + color = get_readback_color(&rb, 64 - size / 2 - 1, 64 + size / 2 + 1); + ok(color_match(color, 0xff00ffff, 0), "Got unexpected color 0x%08x (case %u, %u, size %u).\n", color, i, j, size); - color = getPixelColor(device, 64 + size / 2 + 1, 64 + size / 2 + 1); - ok(color_match(color, 0x0000ffff, 0), + color = get_readback_color(&rb, 64 + size / 2 + 1, 64 + size / 2 + 1); + ok(color_match(color, 0xff00ffff, 0), "Got unexpected color 0x%08x (case %u, %u, size %u).\n", color, i, j, size); + + release_surface_readback(&rb); } } IDirect3DDevice9_SetVertexShader(device, NULL); @@ -13878,10 +14056,9 @@ 0x05000051, 0xa00f0000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, /* def c0, 0.0, 0.0, 0.0, 1.0 */ 0x02000001, 0x800f0001, 0xa0e40000, /* mov r1, c0 */ 0x03000042, 0x800f0000, 0xb0e40000, 0xa0e40800, /* texld r0, t0, s0 */ - 0x02000001, 0x80010001, 0x80e40000, /* mov r1.x, r0 */ - 0x03010042, 0x800f0000, 0xb0e40000, 0xa0e40800, /* texldp r0, t0, s0 */ - 0x02000001, 0x80020001, 0x80000000, /* mov r1.y, r0.x */ - 0x02000001, 0x800f0800, 0x80e40001, /* mov oC0, r1 */ + 0x03010042, 0x800f0001, 0xb0e40000, 0xa0e40800, /* texldp r1, t0, s0 */ + 0x02000001, 0x80020000, 0x80000001, /* mov r0.y, r1.x */ + 0x02000001, 0x800f0800, 0x80e40000, /* mov oC0, r0 */ 0x0000ffff, /* end */ }; struct @@ -13917,17 +14094,18 @@ } expected_colors[] = { - { 80, 100, D3DCOLOR_ARGB(0x00, 0x20, 0x40, 0x00)}, - {240, 100, D3DCOLOR_ARGB(0x00, 0x60, 0xbf, 0x00)}, - {400, 100, D3DCOLOR_ARGB(0x00, 0x9f, 0x40, 0x00)}, - {560, 100, D3DCOLOR_ARGB(0x00, 0xdf, 0xbf, 0x00)}, - { 80, 450, D3DCOLOR_ARGB(0x00, 0x20, 0x40, 0x00)}, - {240, 450, D3DCOLOR_ARGB(0x00, 0x60, 0xbf, 0x00)}, - {400, 450, D3DCOLOR_ARGB(0x00, 0x9f, 0x40, 0x00)}, - {560, 450, D3DCOLOR_ARGB(0x00, 0xdf, 0xbf, 0x00)}, + { 80, 100, 0x20204020}, + {240, 100, 0x6060bf60}, + {400, 100, 0x9f9f409f}, + {560, 100, 0xdfdfbfdf}, + { 80, 450, 0x20204020}, + {240, 450, 0x6060bf60}, + {400, 450, 0x9f9f409f}, + {560, 450, 0xdfdfbfdf}, }; IDirect3DSurface9 *original_rt, *rt; + struct surface_readback rb; IDirect3DTexture9 *texture; IDirect3DPixelShader9 *ps; IDirect3DDevice9 *device; @@ -14043,13 +14221,15 @@ hr = IDirect3DDevice9_EndScene(device); ok(SUCCEEDED(hr), "EndScene failed, hr %#x.\n", hr); + get_rt_readback(original_rt, &rb); for (i = 0; i < sizeof(expected_colors) / sizeof(*expected_colors); ++i) { - D3DCOLOR color = getPixelColor(device, expected_colors[i].x, expected_colors[i].y); + D3DCOLOR color = get_readback_color(&rb, expected_colors[i].x, expected_colors[i].y); ok(color_match(color, expected_colors[i].color, 1), "Expected color 0x%08x at (%u, %u), got 0x%08x.\n", expected_colors[i].color, expected_colors[i].x, expected_colors[i].y, color); } + release_surface_readback(&rb); hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed, hr %#x.\n", hr); @@ -14095,13 +14275,15 @@ hr = IDirect3DDevice9_EndScene(device); ok(SUCCEEDED(hr), "EndScene failed, hr %#x.\n", hr); + get_rt_readback(original_rt, &rb); for (i = 0; i < sizeof(expected_colors) / sizeof(*expected_colors); ++i) { - D3DCOLOR color = getPixelColor(device, expected_colors[i].x, expected_colors[i].y); + D3DCOLOR color = get_readback_color(&rb, expected_colors[i].x, expected_colors[i].y); ok(color_match(color, expected_colors[i].color, 1), "Expected color 0x%08x at (%u, %u), got 0x%08x.\n", expected_colors[i].color, expected_colors[i].x, expected_colors[i].y, color); } + release_surface_readback(&rb); hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed, hr %#x.\n", hr); @@ -14160,13 +14342,15 @@ hr = IDirect3DDevice9_EndScene(device); ok(SUCCEEDED(hr), "EndScene failed, hr %#x.\n", hr); + get_rt_readback(original_rt, &rb); for (i = 0; i < sizeof(expected_colors) / sizeof(*expected_colors); ++i) { - D3DCOLOR color = getPixelColor(device, expected_colors[i].x, expected_colors[i].y); + D3DCOLOR color = get_readback_color(&rb, expected_colors[i].x, expected_colors[i].y); ok(color_match(color, expected_colors[i].color, 1), "Expected color 0x%08x at (%u, %u), got 0x%08x.\n", expected_colors[i].color, expected_colors[i].x, expected_colors[i].y, color); } + release_surface_readback(&rb); hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed, hr %#x.\n", hr); @@ -14192,10 +14376,9 @@ 0x05000051, 0xa00f0000, 0x00000000, 0x00000000, 0x00000000, 0x3f800000, /* def c0, 0.0, 0.0, 0.0, 1.0 */ 0x02000001, 0x800f0001, 0xa0e40000, /* mov r1, c0 */ 0x03000042, 0x800f0000, 0xb0e40000, 0xa0e40800, /* texld r0, t0, s0 */ - 0x02000001, 0x80010001, 0x80e40000, /* mov r1.x, r0 */ - 0x03010042, 0x800f0000, 0xb0e40000, 0xa0e40800, /* texldp r0, t0, s0 */ - 0x02000001, 0x80020001, 0x80000000, /* mov r1.y, r0.x */ - 0x02000001, 0x800f0800, 0x80e40001, /* mov 0C0, r1 */ + 0x03010042, 0x800f0001, 0xb0e40000, 0xa0e40800, /* texldp r1, t0, s0 */ + 0x02000001, 0x80020000, 0x80000001, /* mov r0.y, r1.x */ + 0x02000001, 0x800f0800, 0x80e40000, /* mov oC0, r0 */ 0x0000ffff, /* end */ }; struct @@ -14234,17 +14417,18 @@ } expected_colors[] = { - {400, 60, D3DCOLOR_ARGB(0x00, 0x00, 0x00, 0x00)}, - {560, 180, D3DCOLOR_ARGB(0x00, 0xff, 0x00, 0x00)}, - {560, 300, D3DCOLOR_ARGB(0x00, 0xff, 0x00, 0x00)}, - {400, 420, D3DCOLOR_ARGB(0x00, 0xff, 0xff, 0x00)}, - {240, 420, D3DCOLOR_ARGB(0x00, 0xff, 0xff, 0x00)}, - { 80, 300, D3DCOLOR_ARGB(0x00, 0x00, 0x00, 0x00)}, - { 80, 180, D3DCOLOR_ARGB(0x00, 0x00, 0x00, 0x00)}, - {240, 60, D3DCOLOR_ARGB(0x00, 0x00, 0x00, 0x00)}, + {400, 60, 0x00000000}, + {560, 180, 0xffff00ff}, + {560, 300, 0xffff00ff}, + {400, 420, 0xffffffff}, + {240, 420, 0xffffffff}, + { 80, 300, 0x00000000}, + { 80, 180, 0x00000000}, + {240, 60, 0x00000000}, }; IDirect3DSurface9 *original_ds, *original_rt, *rt; + struct surface_readback rb; IDirect3DPixelShader9 *ps; IDirect3DDevice9 *device; IDirect3D9 *d3d; @@ -14369,14 +14553,16 @@ ok(SUCCEEDED(hr), "SetTexture failed, hr %#x.\n", hr); IDirect3DTexture9_Release(texture); + get_rt_readback(original_rt, &rb); for (j = 0; j < sizeof(expected_colors) / sizeof(*expected_colors); ++j) { - D3DCOLOR color = getPixelColor(device, expected_colors[j].x, expected_colors[j].y); + D3DCOLOR color = get_readback_color(&rb, expected_colors[j].x, expected_colors[j].y); ok(color_match(color, expected_colors[j].color, 0), "Expected color 0x%08x at (%u, %u) for format %s, got 0x%08x.\n", expected_colors[j].color, expected_colors[j].x, expected_colors[j].y, formats[i].name, color); } + release_surface_readback(&rb); hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed, hr %#x.\n", hr); @@ -16152,6 +16338,7 @@ IDirect3DSurface9_Release(ds); hr = IDirect3DDevice9_CreateDepthStencilSurface(device, 640, 480, D3DFMT_D24S8, D3DMULTISAMPLE_NONE, 0, TRUE, &ds, NULL); + ok(SUCCEEDED(hr), "Failed to create depth stencil surface, hr %#x.\n", hr); hr = IDirect3DDevice9_SetRenderTarget(device, 0, readback); ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); @@ -19263,9 +19450,6 @@ hr = IDirect3DDevice9_EndScene(device); ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); - hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr); - point = tests[i].quad_points; while (point->x != -1 && point->y != -1) { @@ -19281,6 +19465,9 @@ ok(color_match(color, 0x00000000, 1), "Unexpected quad at %dx%d.\n", point->x, point->y); ++point; } + + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); } refcount = IDirect3DDevice9_Release(device); @@ -19610,7 +19797,7 @@ color = getPixelColor(device, 320, 240); ok (color_match(color, 0x007f7f00, 2) || broken(tests[i].broken) - || broken(color == 0xdeadbeec), /* WARP device often just breaks down. */ + || broken(color == 0x00adbeef), /* WARP device often just breaks down. */ "Got unexpected color 0x%08x, case %u, %u.\n", color, t, i); } @@ -19710,6 +19897,7 @@ hr = IDirect3DDevice9_CreateDepthStencilSurface(device, 640, 480, formats[i], D3DMULTISAMPLE_NONE, 0, FALSE, &ds, NULL); + ok(SUCCEEDED(hr), "Failed to create depth stencil surface, hr %#x.\n", hr); hr = IDirect3DDevice9_SetDepthStencilSurface(device, ds); ok(SUCCEEDED(hr), "Failed to set depth stencil surface, hr %#x.\n", hr); hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00000000, 0.5f, 0); @@ -19796,6 +19984,413 @@ DestroyWindow(window); } +static void test_flip(void) +{ + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + HWND window; + HRESULT hr; + IDirect3DSurface9 *back_buffers[3], *test_surface; + unsigned int i; + D3DCOLOR color; + D3DPRESENT_PARAMETERS present_parameters = {0}; + + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + + present_parameters.BackBufferWidth = 640; + present_parameters.BackBufferHeight = 480; + present_parameters.BackBufferFormat = D3DFMT_A8R8G8B8; + present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD; + present_parameters.hDeviceWindow = window; + present_parameters.Windowed = TRUE; + present_parameters.BackBufferCount = 3; + present_parameters.Flags = D3DPRESENTFLAG_LOCKABLE_BACKBUFFER; + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + window, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device); + if (!device) + { + skip("Failed to create a D3D device, skipping tests.\n"); + IDirect3D9_Release(d3d); + DestroyWindow(window); + return; + } + + for (i = 0; i < sizeof(back_buffers) / sizeof(*back_buffers); ++i) + { + hr = IDirect3DDevice9_GetBackBuffer(device, 0, i, D3DBACKBUFFER_TYPE_MONO, &back_buffers[i]); + ok(SUCCEEDED(hr), "Failed to get back buffer, hr %#x.\n", hr); + } + hr = IDirect3DDevice9_GetRenderTarget(device, 0, &test_surface); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + ok(test_surface == back_buffers[0], "Expected render target %p, got %p.\n", back_buffers[0], test_surface); + IDirect3DSurface9_Release(test_surface); + + hr = IDirect3DDevice9_SetRenderTarget(device, 0, back_buffers[2]); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + + hr = IDirect3DDevice9_ColorFill(device, back_buffers[0], NULL, 0xffff0000); + ok(SUCCEEDED(hr), "Failed to color fill, hr %#x.\n", hr); + hr = IDirect3DDevice9_ColorFill(device, back_buffers[1], NULL, 0xff00ff00); + ok(SUCCEEDED(hr), "Failed to color fill, hr %#x.\n", hr); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff0000ff, 0.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x\n", hr); + + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); + + /* Render target is unmodified. */ + hr = IDirect3DDevice9_GetRenderTarget(device, 0, &test_surface); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + ok(test_surface == back_buffers[2], "Expected render target %p, got %p.\n", back_buffers[2], test_surface); + IDirect3DSurface9_Release(test_surface); + + /* Backbuffer surface pointers are unmodified */ + for (i = 0; i < sizeof(back_buffers) / sizeof(*back_buffers); ++i) + { + hr = IDirect3DDevice9_GetBackBuffer(device, 0, i, D3DBACKBUFFER_TYPE_MONO, &test_surface); + ok(SUCCEEDED(hr), "Failed to get back buffer, hr %#x.\n", hr); + ok(test_surface == back_buffers[i], "Expected back buffer %u = %p, got %p.\n", + i, back_buffers[i], test_surface); + IDirect3DSurface9_Release(test_surface); + } + + /* Contents were changed. */ + color = getPixelColorFromSurface(back_buffers[0], 1, 1); + todo_wine ok(color == 0xff00ff00, "Got unexpected color 0x%08x.\n", color); + color = getPixelColorFromSurface(back_buffers[1], 1, 1); + todo_wine ok(color == 0xff0000ff, "Got unexpected color 0x%08x.\n", color); + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff808080, 0.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x\n", hr); + + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); + + color = getPixelColorFromSurface(back_buffers[0], 1, 1); + todo_wine ok(color == 0xff0000ff, "Got unexpected color 0x%08x.\n", color); + color = getPixelColorFromSurface(back_buffers[1], 1, 1); + todo_wine ok(color == 0xff808080, "Got unexpected color 0x%08x.\n", color); + + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); + + color = getPixelColorFromSurface(back_buffers[0], 1, 1); + todo_wine ok(color == 0xff808080, "Got unexpected color 0x%08x.\n", color); + + for (i = 0; i < sizeof(back_buffers) / sizeof(*back_buffers); ++i) + IDirect3DSurface9_Release(back_buffers[i]); + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D9_Release(d3d); + DestroyWindow(window); +} + +static void test_uninitialized_varyings(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 */ + 0x00000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */ + 0x0000ffff + }; + static const DWORD vs1_partial_code[] = + { + 0xfffe0101, /* vs_1_1 */ + 0x0000001f, 0x80000000, 0x900f0000, /* dcl_position v0 */ + 0x00000051, 0xa00f0000, 0x3f000000, 0x3f000000, 0x3f000000, 0x3f000000, /* def c0, 0.5, 0.5, 0.5, 0.5 */ + 0x00000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */ + 0x00000001, 0xd0010000, 0xa0e40000, /* mov oD0.x, c0 */ + 0x00000001, 0xd0010001, 0xa0e40000, /* mov oD1.x, c0 */ + 0x00000001, 0xe0010000, 0xa0e40000, /* mov oT0.x, c0 */ + 0x0000ffff + }; + static const DWORD vs2_code[] = + { + 0xfffe0200, /* vs_2_0 */ + 0x0200001f, 0x80000000, 0x900f0000, /* dcl_position v0 */ + 0x02000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */ + 0x0000ffff + }; + static const DWORD vs2_partial_code[] = + { + 0xfffe0200, /* vs_2_0 */ + 0x0200001f, 0x80000000, 0x900f0000, /* dcl_position v0 */ + 0x05000051, 0xa00f0000, 0x3f000000, 0x3f000000, 0x3f000000, 0x3f000000, /* def c0, 0.5, 0.5, 0.5, 0.5 */ + 0x02000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */ + 0x02000001, 0xd0010000, 0xa0e40000, /* mov oD0.x, c0 */ + 0x02000001, 0xd0010001, 0xa0e40000, /* mov oD1.x, c0 */ + 0x02000001, 0xe0010000, 0xa0e40000, /* mov oT0.x, c0 */ + 0x0000ffff + }; + static const DWORD vs3_code[] = + { + 0xfffe0300, /* vs_3_0 */ + 0x0200001f, 0x80000000, 0x900f0000, /* dcl_position v0 */ + 0x0200001f, 0x80000000, 0xe00f0000, /* dcl_position o0 */ + 0x02000001, 0xe00f0000, 0x90e40000, /* mov o0, v0 */ + 0x0000ffff + }; + static const DWORD vs3_partial_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 */ + 0x0200001f, 0x80000005, 0xe00f0003, /* dcl_texcoord0 o3 */ + 0x05000051, 0xa00f0000, 0x3f000000, 0x3f000000, 0x3f000000, 0x3f000000, /* def c0, 0.5, 0.5, 0.5, 0.5 */ + 0x02000001, 0xe00f0000, 0x90e40000, /* mov o0, v0 */ + 0x02000001, 0xe0010001, 0xa0e40000, /* mov o1.x, c0 */ + 0x02000001, 0xe0010002, 0xa0e40000, /* mov o2.x, c0 */ + 0x02000001, 0xe0010003, 0xa0e40000, /* mov o3.x, c0 */ + 0x0000ffff + }; + static const DWORD ps1_diffuse_code[] = + { + 0xffff0101, /* ps_1_1 */ + 0x00000001, 0x800f0000, 0x90e40000, /* mov r0, v0 */ + 0x0000ffff + }; + static const DWORD ps1_specular_code[] = + { + 0xffff0101, /* ps_1_1 */ + 0x00000001, 0x800f0000, 0x90e40001, /* mov r0, v1 */ + 0x0000ffff + }; + static const DWORD ps1_texcoord_code[] = + { + 0xffff0101, /* ps_1_1 */ + 0x00000040, 0xb00f0000, /* texcoord t0 */ + 0x00000001, 0x800f0000, 0xb0e40000, /* mov r0, t0 */ + 0x0000ffff + }; + static const DWORD ps2_diffuse_code[] = + { + 0xffff0200, /* ps_2_0 */ + 0x0200001f, 0x80000000, 0x900f0000, /* dcl v0 */ + 0x02000001, 0x800f0800, 0x90e40000, /* mov oC0, v0 */ + 0x0000ffff + }; + static const DWORD ps2_specular_code[] = + { + 0xffff0200, /* ps_2_0 */ + 0x0200001f, 0x80000000, 0x900f0001, /* dcl v1 */ + 0x02000001, 0x800f0800, 0x90e40001, /* mov oC0, v1 */ + 0x0000ffff + }; + static const DWORD ps2_texcoord_code[] = + { + 0xffff0200, /* ps_2_0 */ + 0x0200001f, 0x80000000, 0xb00f0000, /* dcl t0 */ + 0x02000001, 0x800f0800, 0xb0e40000, /* mov oC0, t0 */ + 0x0000ffff + }; + static const DWORD ps3_diffuse_code[] = + { + 0xffff0300, /* ps_3_0 */ + 0x0200001f, 0x8000000a, 0x900f0000, /* dcl_color0 v0 */ + 0x02000001, 0x800f0800, 0x90e40000, /* mov oC0, v0 */ + 0x0000ffff + }; + static const DWORD ps3_specular_code[] = + { + 0xffff0300, /* ps_3_0 */ + 0x0200001f, 0x8001000a, 0x900f0001, /* dcl_color1 v1 */ + 0x02000001, 0x800f0800, 0x90e40001, /* mov oC0, v1 */ + 0x0000ffff + }; + static const DWORD ps3_texcoord_code[] = + { + 0xffff0300, /* ps_3_0 */ + 0x0200001f, 0x80000005, 0x900f0000, /* dcl_texcoord0 v0 */ + 0x02000001, 0x800f0800, 0x90e40000, /* mov oC0, v0 */ + 0x0000ffff + }; + static const struct + { + DWORD vs_version; + const DWORD *vs; + DWORD ps_version; + const DWORD *ps; + D3DCOLOR expected; + BOOL allow_zero_alpha; + BOOL allow_zero; + BOOL broken_warp; + } + /* On AMD specular color is generally initialized to 0x00000000 and texcoords to 0xff000000 + * while on Nvidia it's the opposite. Just allow both. */ + tests[] = + { + {D3DVS_VERSION(1, 1), vs1_code, 0, NULL, 0xffffffff}, + { 0, NULL, D3DPS_VERSION(1, 1), ps1_texcoord_code, 0xff000000, TRUE}, + { 0, NULL, D3DPS_VERSION(2, 0), ps2_texcoord_code, 0xff000000, TRUE}, + {D3DVS_VERSION(1, 1), vs1_code, D3DPS_VERSION(1, 1), ps1_diffuse_code, 0xffffffff}, + {D3DVS_VERSION(1, 1), vs1_code, D3DPS_VERSION(1, 1), ps1_specular_code, 0xff000000, TRUE, FALSE, TRUE}, + {D3DVS_VERSION(1, 1), vs1_code, D3DPS_VERSION(1, 1), ps1_texcoord_code, 0xff000000, TRUE}, + {D3DVS_VERSION(2, 0), vs2_code, D3DPS_VERSION(2, 0), ps2_diffuse_code, 0xffffffff}, + {D3DVS_VERSION(2, 0), vs2_code, D3DPS_VERSION(2, 0), ps2_specular_code, 0xff000000, TRUE, FALSE, TRUE}, + {D3DVS_VERSION(2, 0), vs2_code, D3DPS_VERSION(2, 0), ps2_texcoord_code, 0xff000000, TRUE}, + {D3DVS_VERSION(3, 0), vs3_code, D3DPS_VERSION(3, 0), ps3_diffuse_code, 0xffffffff, FALSE, TRUE}, + {D3DVS_VERSION(3, 0), vs3_code, D3DPS_VERSION(3, 0), ps3_specular_code, 0x00000000, FALSE, FALSE, TRUE}, + {D3DVS_VERSION(3, 0), vs3_code, D3DPS_VERSION(3, 0), ps3_texcoord_code, 0x00000000, FALSE, FALSE, TRUE}, + {D3DVS_VERSION(1, 1), vs1_partial_code, 0, NULL, 0xff7fffff, FALSE, FALSE, TRUE}, + {D3DVS_VERSION(1, 1), vs1_partial_code, D3DPS_VERSION(1, 1), ps1_diffuse_code, 0xff7fffff, FALSE, FALSE, TRUE}, + {D3DVS_VERSION(1, 1), vs1_partial_code, D3DPS_VERSION(1, 1), ps1_specular_code, 0xff7f0000, TRUE}, + {D3DVS_VERSION(1, 1), vs1_partial_code, D3DPS_VERSION(1, 1), ps1_texcoord_code, 0xff7f0000, TRUE}, + {D3DVS_VERSION(2, 0), vs2_partial_code, D3DPS_VERSION(2, 0), ps2_diffuse_code, 0xff7fffff, FALSE, FALSE, TRUE}, + {D3DVS_VERSION(2, 0), vs2_partial_code, D3DPS_VERSION(2, 0), ps2_specular_code, 0xff7f0000, TRUE}, + {D3DVS_VERSION(2, 0), vs2_partial_code, D3DPS_VERSION(2, 0), ps2_texcoord_code, 0xff7f0000, TRUE}, + /* Fails on Radeon HD 2600 with 0x008000ff aka nonsensical color. */ + /* {D3DVS_VERSION(3, 0), vs3_partial_code, D3DPS_VERSION(3, 0), ps3_diffuse_code, 0xff7fffff, TRUE}, */ + /* Randomly fails on Radeon HD 2600. */ + /* {D3DVS_VERSION(3, 0), vs3_partial_code, D3DPS_VERSION(3, 0), ps3_specular_code, 0x007f0000}, */ + {D3DVS_VERSION(3, 0), vs3_partial_code, D3DPS_VERSION(3, 0), ps3_texcoord_code, 0xff7f0000, TRUE}, + }; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + HWND window; + HRESULT hr; + D3DADAPTER_IDENTIFIER9 identifier; + IDirect3DSurface9 *backbuffer; + struct surface_readback rb; + IDirect3DVertexShader9 *vs; + IDirect3DPixelShader9 *ps; + unsigned int i; + ULONG refcount; + D3DCAPS9 caps; + D3DCOLOR color; + BOOL warp; + + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + IDirect3D9_Release(d3d); + DestroyWindow(window); + return; + } + + hr = IDirect3D9_GetAdapterIdentifier(d3d, D3DADAPTER_DEFAULT, 0, &identifier); + ok(SUCCEEDED(hr), "Failed to get adapter identifier, hr %#x.\n", hr); + warp = adapter_is_warp(&identifier); + + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); + + hr = IDirect3DDevice9_GetRenderTarget(device, 0, &backbuffer); + ok(SUCCEEDED(hr), "Failed to get backbuffer, 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_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.0, 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); + + get_rt_readback(backbuffer, &rb); + color = get_readback_color(&rb, 320, 240); + ok(color_match(color, tests[i].expected, 1) + || (tests[i].allow_zero_alpha && color_match(color, tests[i].expected & 0x00ffffff, 1)) + || (tests[i].allow_zero && !color) || (broken(warp && tests[i].broken_warp)), + "Got unexpected color 0x%08x, case %u.\n", color, i); + release_surface_readback(&rb); + + 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); + + IDirect3DSurface9_Release(backbuffer); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D9_Release(d3d); + DestroyWindow(window); +} + START_TEST(visual) { D3DADAPTER_IDENTIFIER9 identifier; @@ -19837,7 +20432,7 @@ offscreen_test(); ds_size_test(); test_blend(); - shademode_test(); + test_shademode(); srgbtexture_test(); release_buffer_test(); float_texture_test(); @@ -19848,7 +20443,7 @@ fixed_function_decl_test(); conditional_np2_repeat_test(); fixed_function_bumpmap_test(); - pointsize_test(); + test_pointsize(); tssargtemp_test(); np2_stretch_rect_test(); yuv_color_test(); @@ -19914,4 +20509,6 @@ test_vertex_blending(); test_updatetexture(); test_depthbias(); + test_flip(); + test_uninitialized_varyings(); } diff -Nru wine1.7-1.7.50/dlls/d3d9/vertexdeclaration.c wine1.7-1.7.55/dlls/d3d9/vertexdeclaration.c --- wine1.7-1.7.50/dlls/d3d9/vertexdeclaration.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d9/vertexdeclaration.c 2015-11-13 14:32:40.000000000 +0000 @@ -326,7 +326,7 @@ UINT count = 1; UINT i; - TRACE("d3d9_elements %p, wined3d_elements %p\n", d3d9_elements, wined3d_elements); + TRACE("d3d9_elements %p, wined3d_elements %p, element_count %p\n", d3d9_elements, wined3d_elements, element_count); element = d3d9_elements; while (element++->Stream != 0xff && count++ < 128); diff -Nru wine1.7-1.7.50/dlls/d3d9/volume.c wine1.7-1.7.55/dlls/d3d9/volume.c --- wine1.7-1.7.50/dlls/d3d9/volume.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3d9/volume.c 2015-11-13 14:32:40.000000000 +0000 @@ -117,13 +117,13 @@ { struct d3d9_volume *volume = impl_from_IDirect3DVolume9(iface); struct wined3d_resource_desc wined3d_desc; - struct wined3d_resource *wined3d_resource; + struct wined3d_resource *sub_resource; TRACE("iface %p, desc %p.\n", iface, desc); wined3d_mutex_lock(); - wined3d_resource = wined3d_volume_get_resource(volume->wined3d_volume); - wined3d_resource_get_desc(wined3d_resource, &wined3d_desc); + sub_resource = wined3d_texture_get_sub_resource(volume->wined3d_texture, volume->sub_resource_idx); + wined3d_resource_get_desc(sub_resource, &wined3d_desc); wined3d_mutex_unlock(); desc->Format = d3dformat_from_wined3dformat(wined3d_desc.format); @@ -148,7 +148,8 @@ iface, locked_box, box, flags); wined3d_mutex_lock(); - hr = wined3d_volume_map(volume->wined3d_volume, &map_desc, (const struct wined3d_box *)box, flags); + hr = wined3d_resource_map(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx, + &map_desc, (const struct wined3d_box *)box, flags); wined3d_mutex_unlock(); locked_box->RowPitch = map_desc.row_pitch; @@ -166,7 +167,7 @@ TRACE("iface %p.\n", iface); wined3d_mutex_lock(); - hr = wined3d_volume_unmap(volume->wined3d_volume); + hr = wined3d_resource_unmap(wined3d_texture_get_resource(volume->wined3d_texture), volume->sub_resource_idx); wined3d_mutex_unlock(); return hr; @@ -201,14 +202,15 @@ volume_wined3d_object_destroyed, }; -void volume_init(struct d3d9_volume *volume, struct d3d9_texture *texture, - struct wined3d_volume *wined3d_volume, const struct wined3d_parent_ops **parent_ops) +void volume_init(struct d3d9_volume *volume, struct wined3d_texture *wined3d_texture, + unsigned int sub_resource_idx, const struct wined3d_parent_ops **parent_ops) { volume->IDirect3DVolume9_iface.lpVtbl = &d3d9_volume_vtbl; d3d9_resource_init(&volume->resource); volume->resource.refcount = 0; - volume->wined3d_volume = wined3d_volume; - volume->texture = texture; + volume->texture = wined3d_texture_get_parent(wined3d_texture); + volume->wined3d_texture = wined3d_texture; + volume->sub_resource_idx = sub_resource_idx; *parent_ops = &d3d9_volume_wined3d_parent_ops; } diff -Nru wine1.7-1.7.50/dlls/d3dcompiler_43/blob.c wine1.7-1.7.55/dlls/d3dcompiler_43/blob.c --- wine1.7-1.7.50/dlls/d3dcompiler_43/blob.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3dcompiler_43/blob.c 2015-11-13 14:32:40.000000000 +0000 @@ -463,3 +463,17 @@ return d3dcompiler_strip_shader(data, data_size, flags, blob); } + +HRESULT WINAPI D3DReadFileToBlob(const WCHAR *filename, ID3DBlob **contents) +{ + FIXME("filename %s, contents %p\n", debugstr_w(filename), contents); + + return E_NOTIMPL; +} + +HRESULT WINAPI D3DWriteBlobToFile(ID3DBlob* blob, const WCHAR *filename, BOOL overwrite) +{ + FIXME("blob %p, filename %s, overwrite %d\n", blob, debugstr_w(filename), overwrite); + + return E_NOTIMPL; +} diff -Nru wine1.7-1.7.50/dlls/d3dcompiler_43/bytecodewriter.c wine1.7-1.7.55/dlls/d3dcompiler_43/bytecodewriter.c --- wine1.7-1.7.50/dlls/d3dcompiler_43/bytecodewriter.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3dcompiler_43/bytecodewriter.c 2015-11-13 14:32:40.000000000 +0000 @@ -602,7 +602,7 @@ put_dword(buffer, instr_dcl); /* Write the usage and index */ - token = (1 << 31); /* Bit 31 of non-instruction opcodes is 1 */ + token = (1u << 31); /* Bit 31 of non-instruction opcodes is 1 */ token |= (decls[i].usage << D3DSP_DCL_USAGE_SHIFT) & D3DSP_DCL_USAGE_MASK; token |= (decls[i].usage_idx << D3DSP_DCL_USAGEINDEX_SHIFT) & D3DSP_DCL_USAGEINDEX_MASK; put_dword(buffer, token); @@ -618,7 +618,7 @@ static void write_const(struct constant **consts, int num, DWORD opcode, DWORD reg_type, struct bytecode_buffer *buffer, BOOL len) { int i; DWORD instr_def = opcode; - const DWORD reg = (1<<31) | d3dsp_register( reg_type, 0 ) | D3DSP_WRITEMASK_ALL; + const DWORD reg = (1u << 31) | d3dsp_register( reg_type, 0 ) | D3DSP_WRITEMASK_ALL; if(len) { if(opcode == D3DSIO_DEFB) @@ -889,7 +889,7 @@ static void vs_12_dstreg(struct bc_writer *This, const struct shader_reg *reg, struct bytecode_buffer *buffer, DWORD shift, DWORD mod) { - DWORD token = (1 << 31); /* Bit 31 of registers is 1 */ + DWORD token = (1u << 31); /* Bit 31 of registers is 1 */ DWORD has_wmask; if(reg->rel_reg) { @@ -963,7 +963,7 @@ static void vs_1_x_srcreg(struct bc_writer *This, const struct shader_reg *reg, struct bytecode_buffer *buffer) { - DWORD token = (1 << 31); /* Bit 31 of registers is 1 */ + DWORD token = (1u << 31); /* Bit 31 of registers is 1 */ DWORD has_swizzle; DWORD component; @@ -1074,7 +1074,7 @@ static void ps_1_0123_srcreg(struct bc_writer *This, const struct shader_reg *reg, struct bytecode_buffer *buffer) { - DWORD token = (1 << 31); /* Bit 31 of registers is 1 */ + DWORD token = (1u << 31); /* Bit 31 of registers is 1 */ if(reg->rel_reg) { WARN("Relative addressing not supported in <= ps_3_0\n"); This->state = E_INVALIDARG; @@ -1120,7 +1120,7 @@ static void ps_1_0123_dstreg(struct bc_writer *This, const struct shader_reg *reg, struct bytecode_buffer *buffer, DWORD shift, DWORD mod) { - DWORD token = (1 << 31); /* Bit 31 of registers is 1 */ + DWORD token = (1u << 31); /* Bit 31 of registers is 1 */ if(reg->rel_reg) { WARN("Relative addressing not supported for destination registers\n"); @@ -1382,7 +1382,7 @@ static void ps_1_4_srcreg(struct bc_writer *This, const struct shader_reg *reg, struct bytecode_buffer *buffer) { - DWORD token = (1 << 31); /* Bit 31 of registers is 1 */ + DWORD token = (1u << 31); /* Bit 31 of registers is 1 */ if(reg->rel_reg) { WARN("Relative addressing not supported in <= ps_3_0\n"); This->state = E_INVALIDARG; @@ -1421,7 +1421,7 @@ static void ps_1_4_dstreg(struct bc_writer *This, const struct shader_reg *reg, struct bytecode_buffer *buffer, DWORD shift, DWORD mod) { - DWORD token = (1 << 31); /* Bit 31 of registers is 1 */ + DWORD token = (1u << 31); /* Bit 31 of registers is 1 */ if(reg->rel_reg) { WARN("Relative addressing not supported for destination registers\n"); @@ -1568,7 +1568,7 @@ static void vs_2_srcreg(struct bc_writer *This, const struct shader_reg *reg, struct bytecode_buffer *buffer) { - DWORD token = (1 << 31); /* Bit 31 of registers is 1 */ + DWORD token = (1u << 31); /* Bit 31 of registers is 1 */ DWORD has_swizzle; DWORD component; DWORD d3d9reg; @@ -1803,12 +1803,12 @@ DWORD i; DWORD instr_dcl = D3DSIO_DCL | (2 << D3DSI_INSTLENGTH_SHIFT); DWORD token; - const DWORD reg = (1<<31) | d3dsp_register( D3DSPR_SAMPLER, 0 ) | D3DSP_WRITEMASK_ALL; + const DWORD reg = (1u << 31) | d3dsp_register( D3DSPR_SAMPLER, 0 ) | D3DSP_WRITEMASK_ALL; for(i = 0; i < shader->num_samplers; i++) { /* Write the DCL instruction */ put_dword(buffer, instr_dcl); - token = (1<<31); + token = (1u << 31); /* Already shifted */ token |= (d3d9_sampler(shader->samplers[i].type)) & D3DSP_TEXTURETYPE_MASK; put_dword(buffer, token); @@ -1835,7 +1835,7 @@ static void ps_2_srcreg(struct bc_writer *This, const struct shader_reg *reg, struct bytecode_buffer *buffer) { - DWORD token = (1 << 31); /* Bit 31 of registers is 1 */ + DWORD token = (1u << 31); /* Bit 31 of registers is 1 */ DWORD d3d9reg; if(reg->rel_reg) { WARN("Relative addressing not supported in <= ps_3_0\n"); @@ -1890,7 +1890,7 @@ const struct shader_reg *reg, struct bytecode_buffer *buffer, DWORD shift, DWORD mod) { - DWORD token = (1 << 31); /* Bit 31 of registers is 1 */ + DWORD token = (1u << 31); /* Bit 31 of registers is 1 */ DWORD d3d9reg; if(reg->rel_reg) { @@ -2063,7 +2063,7 @@ static void sm_3_srcreg(struct bc_writer *This, const struct shader_reg *reg, struct bytecode_buffer *buffer) { - DWORD token = (1 << 31); /* Bit 31 of registers is 1 */ + DWORD token = (1u << 31); /* Bit 31 of registers is 1 */ DWORD d3d9reg; d3d9reg = d3d9_register(reg->type); @@ -2102,7 +2102,7 @@ const struct shader_reg *reg, struct bytecode_buffer *buffer, DWORD shift, DWORD mod) { - DWORD token = (1 << 31); /* Bit 31 of registers is 1 */ + DWORD token = (1u << 31); /* Bit 31 of registers is 1 */ DWORD d3d9reg; if(reg->rel_reg) { diff -Nru wine1.7-1.7.50/dlls/d3dcompiler_46/d3dcompiler_46.spec wine1.7-1.7.55/dlls/d3dcompiler_46/d3dcompiler_46.spec --- wine1.7-1.7.50/dlls/d3dcompiler_46/d3dcompiler_46.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3dcompiler_46/d3dcompiler_46.spec 2015-11-13 14:32:40.000000000 +0000 @@ -16,10 +16,10 @@ @ stdcall D3DGetOutputSignatureBlob(ptr long ptr) @ stub D3DGetTraceInstructionOffsets @ stdcall D3DPreprocess(ptr long str ptr ptr ptr ptr) -@ stub D3DReadFileToBlob +@ stdcall D3DReadFileToBlob(wstr ptr) @ stdcall D3DReflect(ptr long ptr ptr) @ stub D3DReturnFailure1 @ stub D3DSetBlobPart @ stdcall D3DStripShader(ptr long long ptr) -@ stub D3DWriteBlobToFile +@ stdcall D3DWriteBlobToFile(ptr wstr long) @ stub DebugSetMute diff -Nru wine1.7-1.7.50/dlls/d3dcompiler_47/d3dcompiler_47.spec wine1.7-1.7.55/dlls/d3dcompiler_47/d3dcompiler_47.spec --- wine1.7-1.7.50/dlls/d3dcompiler_47/d3dcompiler_47.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3dcompiler_47/d3dcompiler_47.spec 2015-11-13 14:32:40.000000000 +0000 @@ -19,11 +19,11 @@ @ stub D3DGetTraceInstructionOffsets @ stub D3DLoadModule @ stdcall D3DPreprocess(ptr long str ptr ptr ptr ptr) -@ stub D3DReadFileToBlob +@ stdcall D3DReadFileToBlob(wstr ptr) @ stdcall D3DReflect(ptr long ptr ptr) @ stub D3DReflectLibrary @ stub D3DReturnFailure1 @ stub D3DSetBlobPart @ stdcall D3DStripShader(ptr long long ptr) -@ stub D3DWriteBlobToFile +@ stdcall D3DWriteBlobToFile(ptr wstr long) @ stub DebugSetMute diff -Nru wine1.7-1.7.50/dlls/d3drm/frame.c wine1.7-1.7.55/dlls/d3drm/frame.c --- wine1.7-1.7.50/dlls/d3drm/frame.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3drm/frame.c 2015-11-13 14:32:40.000000000 +0000 @@ -1073,7 +1073,7 @@ { FIXME("iface %p stub!\n", iface); - return E_NOTIMPL; + return FALSE; } static HRESULT WINAPI d3drm_frame2_GetAxes(IDirect3DRMFrame2 *iface, D3DVECTOR *dir, D3DVECTOR *up) @@ -1094,7 +1094,7 @@ { FIXME("iface %p stub!\n", iface); - return E_NOTIMPL; + return FALSE; } static HRESULT WINAPI d3drm_frame2_GetHierarchyBox(IDirect3DRMFrame2 *iface, D3DRMBOX *box) @@ -2014,7 +2014,7 @@ { FIXME("iface %p stub!\n", iface); - return E_NOTIMPL; + return FALSE; } static HRESULT WINAPI d3drm_frame3_GetAxes(IDirect3DRMFrame3 *iface, D3DVECTOR *dir, D3DVECTOR *up) @@ -2035,7 +2035,7 @@ { FIXME("iface %p stub!\n", iface); - return E_NOTIMPL; + return FALSE; } static HRESULT WINAPI d3drm_frame3_GetHierarchyBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box) diff -Nru wine1.7-1.7.50/dlls/d3drm/tests/d3drm.c wine1.7-1.7.55/dlls/d3drm/tests/d3drm.c --- wine1.7-1.7.50/dlls/d3drm/tests/d3drm.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3drm/tests/d3drm.c 2015-11-13 14:32:40.000000000 +0000 @@ -2075,6 +2075,7 @@ IDirect3DRM3_Release(d3drm3); IDirect3DRM2_Release(d3drm2); IDirect3DRM_Release(d3drm1); + DestroyWindow(window); } static HRESULT CALLBACK surface_callback(IDirectDrawSurface *surface, DDSURFACEDESC *desc, void *context) diff -Nru wine1.7-1.7.50/dlls/d3drm/texture.c wine1.7-1.7.55/dlls/d3drm/texture.c --- wine1.7-1.7.50/dlls/d3drm/texture.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3drm/texture.c 2015-11-13 14:32:40.000000000 +0000 @@ -31,12 +31,18 @@ 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); +} + static inline struct d3drm_texture *impl_from_IDirect3DRMTexture2(IDirect3DRMTexture2 *iface) { return CONTAINING_RECORD(iface, struct d3drm_texture, IDirect3DRMTexture2_iface); @@ -47,62 +53,337 @@ return CONTAINING_RECORD(iface, struct d3drm_texture, IDirect3DRMTexture3_iface); } +static HRESULT WINAPI d3drm_texture1_QueryInterface(IDirect3DRMTexture *iface, REFIID riid, void **out) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + + return IDirect3DRMTexture3_QueryInterface(&texture->IDirect3DRMTexture3_iface, riid, out); +} + +static ULONG WINAPI d3drm_texture1_AddRef(IDirect3DRMTexture *iface) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMTexture3_AddRef(&texture->IDirect3DRMTexture3_iface); +} + +static ULONG WINAPI d3drm_texture1_Release(IDirect3DRMTexture *iface) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMTexture3_Release(&texture->IDirect3DRMTexture3_iface); +} + +static HRESULT WINAPI d3drm_texture1_Clone(IDirect3DRMTexture *iface, + IUnknown *outer, REFIID iid, void **out) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p, outer %p, iid %s, out %p.\n", iface, outer, debugstr_guid(iid), out); + + return IDirect3DRMTexture3_Clone(&texture->IDirect3DRMTexture3_iface, outer, iid, out); +} + +static HRESULT WINAPI d3drm_texture1_AddDestroyCallback(IDirect3DRMTexture *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture1_DeleteDestroyCallback(IDirect3DRMTexture *iface, + D3DRMOBJECTCALLBACK cb, void *ctx) +{ + FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture1_SetAppData(IDirect3DRMTexture *iface, DWORD data) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p, data %#x.\n", iface, data); + + return IDirect3DRMTexture3_SetAppData(&texture->IDirect3DRMTexture3_iface, data); +} + +static DWORD WINAPI d3drm_texture1_GetAppData(IDirect3DRMTexture *iface) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMTexture3_GetAppData(&texture->IDirect3DRMTexture3_iface); +} + +static HRESULT WINAPI d3drm_texture1_SetName(IDirect3DRMTexture *iface, const char *name) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p, name %s.\n", iface, debugstr_a(name)); + + return IDirect3DRMTexture3_SetName(&texture->IDirect3DRMTexture3_iface, name); +} + +static HRESULT WINAPI d3drm_texture1_GetName(IDirect3DRMTexture *iface, DWORD *size, char *name) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p, size %p, name %p.\n", iface, size, name); + + return IDirect3DRMTexture3_GetName(&texture->IDirect3DRMTexture3_iface, size, name); +} + +static HRESULT WINAPI d3drm_texture1_GetClassName(IDirect3DRMTexture *iface, DWORD *size, char *name) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p, size %p, name %p.\n", iface, size, name); + + return IDirect3DRMTexture3_GetClassName(&texture->IDirect3DRMTexture3_iface, size, name); +} + +static HRESULT WINAPI d3drm_texture1_InitFromFile(IDirect3DRMTexture *iface, const char *filename) +{ + FIXME("iface %p, filename %s stub!\n", iface, debugstr_a(filename)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture1_InitFromSurface(IDirect3DRMTexture *iface, + IDirectDrawSurface *surface) +{ + FIXME("iface %p, surface %p stub!\n", iface, surface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture1_InitFromResource(IDirect3DRMTexture *iface, HRSRC resource) +{ + FIXME("iface %p, resource %p stub!\n", iface, resource); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture1_Changed(IDirect3DRMTexture *iface, BOOL pixels, BOOL palette) +{ + FIXME("iface %p, pixels %#x, palette %#x stub!\n", iface, pixels, palette); + + return E_NOTIMPL; +} + +static HRESULT WINAPI d3drm_texture1_SetColors(IDirect3DRMTexture *iface, DWORD max_colors) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p, max_colors %u.\n", iface, max_colors); + + return IDirect3DRMTexture3_SetColors(&texture->IDirect3DRMTexture3_iface, max_colors); +} + +static HRESULT WINAPI d3drm_texture1_SetShades(IDirect3DRMTexture *iface, DWORD max_shades) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p, max_shades %u.\n", iface, max_shades); + + return IDirect3DRMTexture3_SetShades(&texture->IDirect3DRMTexture3_iface, max_shades); +} + +static HRESULT WINAPI d3drm_texture1_SetDecalSize(IDirect3DRMTexture *iface, D3DVALUE width, D3DVALUE height) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p, width %.8e, height %.8e stub!\n", iface, width, height); + + return IDirect3DRMTexture3_SetDecalSize(&texture->IDirect3DRMTexture3_iface, width, height); +} + +static HRESULT WINAPI d3drm_texture1_SetDecalOrigin(IDirect3DRMTexture *iface, LONG x, LONG y) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p, x %d, y %d.\n", iface, x, y); + + return IDirect3DRMTexture3_SetDecalOrigin(&texture->IDirect3DRMTexture3_iface, x, y); +} + +static HRESULT WINAPI d3drm_texture1_SetDecalScale(IDirect3DRMTexture *iface, DWORD scale) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p, scale %u.\n", iface, scale); + + return IDirect3DRMTexture3_SetDecalScale(&texture->IDirect3DRMTexture3_iface, scale); +} + +static HRESULT WINAPI d3drm_texture1_SetDecalTransparency(IDirect3DRMTexture *iface, BOOL transparency) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p, transparency %#x.\n", iface, transparency); + + return IDirect3DRMTexture3_SetDecalTransparency(&texture->IDirect3DRMTexture3_iface, transparency); +} + +static HRESULT WINAPI d3drm_texture1_SetDecalTransparentColor(IDirect3DRMTexture *iface, D3DCOLOR color) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p, color 0x%08x.\n", iface, color); + + return IDirect3DRMTexture3_SetDecalTransparentColor(&texture->IDirect3DRMTexture3_iface, color); +} + +static HRESULT WINAPI d3drm_texture1_GetDecalSize(IDirect3DRMTexture *iface, D3DVALUE *width, D3DVALUE *height) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p, width %p, height %p.\n", iface, width, height); + + return IDirect3DRMTexture3_GetDecalSize(&texture->IDirect3DRMTexture3_iface, width, height); +} + +static HRESULT WINAPI d3drm_texture1_GetDecalOrigin(IDirect3DRMTexture *iface, LONG *x, LONG *y) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p, x %p, y %p.\n", iface, x, y); + + return IDirect3DRMTexture3_GetDecalOrigin(&texture->IDirect3DRMTexture3_iface, x, y); +} + +static D3DRMIMAGE * WINAPI d3drm_texture1_GetImage(IDirect3DRMTexture *iface) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMTexture3_GetImage(&texture->IDirect3DRMTexture3_iface); +} + +static DWORD WINAPI d3drm_texture1_GetShades(IDirect3DRMTexture *iface) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMTexture3_GetShades(&texture->IDirect3DRMTexture3_iface); +} + +static DWORD WINAPI d3drm_texture1_GetColors(IDirect3DRMTexture *iface) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMTexture3_GetColors(&texture->IDirect3DRMTexture3_iface); +} + +static DWORD WINAPI d3drm_texture1_GetDecalScale(IDirect3DRMTexture *iface) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMTexture3_GetDecalScale(&texture->IDirect3DRMTexture3_iface); +} + +static BOOL WINAPI d3drm_texture1_GetDecalTransparency(IDirect3DRMTexture *iface) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMTexture3_GetDecalTransparency(&texture->IDirect3DRMTexture3_iface); +} + +static D3DCOLOR WINAPI d3drm_texture1_GetDecalTransparentColor(IDirect3DRMTexture *iface) +{ + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + + TRACE("iface %p.\n", iface); + + return IDirect3DRMTexture3_GetDecalTransparentColor(&texture->IDirect3DRMTexture3_iface); +} + +static const struct IDirect3DRMTextureVtbl d3drm_texture1_vtbl = +{ + d3drm_texture1_QueryInterface, + d3drm_texture1_AddRef, + d3drm_texture1_Release, + d3drm_texture1_Clone, + d3drm_texture1_AddDestroyCallback, + d3drm_texture1_DeleteDestroyCallback, + d3drm_texture1_SetAppData, + d3drm_texture1_GetAppData, + d3drm_texture1_SetName, + d3drm_texture1_GetName, + d3drm_texture1_GetClassName, + d3drm_texture1_InitFromFile, + d3drm_texture1_InitFromSurface, + d3drm_texture1_InitFromResource, + d3drm_texture1_Changed, + d3drm_texture1_SetColors, + d3drm_texture1_SetShades, + d3drm_texture1_SetDecalSize, + d3drm_texture1_SetDecalOrigin, + d3drm_texture1_SetDecalScale, + d3drm_texture1_SetDecalTransparency, + d3drm_texture1_SetDecalTransparentColor, + d3drm_texture1_GetDecalSize, + d3drm_texture1_GetDecalOrigin, + d3drm_texture1_GetImage, + d3drm_texture1_GetShades, + d3drm_texture1_GetColors, + d3drm_texture1_GetDecalScale, + d3drm_texture1_GetDecalTransparency, + d3drm_texture1_GetDecalTransparentColor, +}; + static HRESULT WINAPI d3drm_texture2_QueryInterface(IDirect3DRMTexture2 *iface, REFIID riid, void **out) { struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); - if (IsEqualGUID(riid, &IID_IDirect3DRMTexture2) - || IsEqualGUID(riid, &IID_IDirect3DRMTexture) - || IsEqualGUID(riid, &IID_IUnknown)) - { - *out = &texture->IDirect3DRMTexture2_iface; - } - else if (IsEqualGUID(riid, &IID_IDirect3DRMTexture3)) - { - *out = &texture->IDirect3DRMTexture3_iface; - } - else - { - *out = NULL; - WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); - return E_NOINTERFACE; - } - - IUnknown_AddRef((IUnknown *)*out); - return S_OK; + return IDirect3DRMTexture3_QueryInterface(&texture->IDirect3DRMTexture3_iface, riid, out); } static ULONG WINAPI d3drm_texture2_AddRef(IDirect3DRMTexture2 *iface) { struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); - ULONG refcount = InterlockedIncrement(&texture->ref); - TRACE("%p increasing refcount to %u.\n", iface, refcount); + TRACE("iface %p.\n", iface); - return refcount; + return IDirect3DRMTexture3_AddRef(&texture->IDirect3DRMTexture3_iface); } static ULONG WINAPI d3drm_texture2_Release(IDirect3DRMTexture2 *iface) { struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); - ULONG refcount = InterlockedDecrement(&texture->ref); - - TRACE("%p decreasing refcount to %u.\n", iface, refcount); - if (!refcount) - HeapFree(GetProcessHeap(), 0, texture); + TRACE("iface %p.\n", iface); - return refcount; + return IDirect3DRMTexture3_Release(&texture->IDirect3DRMTexture3_iface); } static HRESULT WINAPI d3drm_texture2_Clone(IDirect3DRMTexture2 *iface, IUnknown *outer, REFIID iid, void **out) { - FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); - return E_NOTIMPL; + TRACE("iface %p, outer %p, iid %s, out %p.\n", iface, outer, debugstr_guid(iid), out); + + return IDirect3DRMTexture3_Clone(&texture->IDirect3DRMTexture3_iface, outer, iid, out); } static HRESULT WINAPI d3drm_texture2_AddDestroyCallback(IDirect3DRMTexture2 *iface, @@ -141,16 +422,20 @@ static HRESULT WINAPI d3drm_texture2_SetName(IDirect3DRMTexture2 *iface, const char *name) { - FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name)); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); - return E_NOTIMPL; + TRACE("iface %p, name %s.\n", iface, debugstr_a(name)); + + return IDirect3DRMTexture3_SetName(&texture->IDirect3DRMTexture3_iface, name); } static HRESULT WINAPI d3drm_texture2_GetName(IDirect3DRMTexture2 *iface, DWORD *size, char *name) { - FIXME("iface %p, size %p, name %p stub!\n", iface, size, name); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); - return E_NOTIMPL; + TRACE("iface %p, size %p, name %p.\n", iface, size, name); + + return IDirect3DRMTexture3_GetName(&texture->IDirect3DRMTexture3_iface, size, name); } static HRESULT WINAPI d3drm_texture2_GetClassName(IDirect3DRMTexture2 *iface, DWORD *size, char *name) @@ -193,107 +478,137 @@ static HRESULT WINAPI d3drm_texture2_SetColors(IDirect3DRMTexture2 *iface, DWORD max_colors) { - FIXME("iface %p, max_colors %u stub!\n", iface, max_colors); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); - return E_NOTIMPL; + TRACE("iface %p, max_colors %u.\n", iface, max_colors); + + return IDirect3DRMTexture3_SetColors(&texture->IDirect3DRMTexture3_iface, max_colors); } static HRESULT WINAPI d3drm_texture2_SetShades(IDirect3DRMTexture2 *iface, DWORD max_shades) { - FIXME("iface %p, max_shades %u stub!\n", iface, max_shades); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); - return E_NOTIMPL; + TRACE("iface %p, max_shades %u.\n", iface, max_shades); + + return IDirect3DRMTexture3_SetShades(&texture->IDirect3DRMTexture3_iface, max_shades); } static HRESULT WINAPI d3drm_texture2_SetDecalSize(IDirect3DRMTexture2 *iface, D3DVALUE width, D3DVALUE height) { - FIXME("iface %p, width %.8e, height %.8e stub!\n", iface, width, height); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); - return E_NOTIMPL; + TRACE("iface %p, width %.8e, height %.8e stub!\n", iface, width, height); + + return IDirect3DRMTexture3_SetDecalSize(&texture->IDirect3DRMTexture3_iface, width, height); } static HRESULT WINAPI d3drm_texture2_SetDecalOrigin(IDirect3DRMTexture2 *iface, LONG x, LONG y) { - FIXME("iface %p, x %d, y %d stub!\n", iface, x, y); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); - return E_NOTIMPL; + TRACE("iface %p, x %d, y %d.\n", iface, x, y); + + return IDirect3DRMTexture3_SetDecalOrigin(&texture->IDirect3DRMTexture3_iface, x, y); } static HRESULT WINAPI d3drm_texture2_SetDecalScale(IDirect3DRMTexture2 *iface, DWORD scale) { - FIXME("iface %p, scale %u stub!\n", iface, scale); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); - return E_NOTIMPL; + TRACE("iface %p, scale %u.\n", iface, scale); + + return IDirect3DRMTexture3_SetDecalScale(&texture->IDirect3DRMTexture3_iface, scale); } static HRESULT WINAPI d3drm_texture2_SetDecalTransparency(IDirect3DRMTexture2 *iface, BOOL transparency) { - FIXME("iface %p, transparency %#x stub!\n", iface, transparency); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); - return E_NOTIMPL; + TRACE("iface %p, transparency %#x.\n", iface, transparency); + + return IDirect3DRMTexture3_SetDecalTransparency(&texture->IDirect3DRMTexture3_iface, transparency); } static HRESULT WINAPI d3drm_texture2_SetDecalTransparentColor(IDirect3DRMTexture2 *iface, D3DCOLOR color) { - FIXME("iface %p, color 0x%08x stub!\n", iface, color); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); - return E_NOTIMPL; + TRACE("iface %p, color 0x%08x.\n", iface, color); + + return IDirect3DRMTexture3_SetDecalTransparentColor(&texture->IDirect3DRMTexture3_iface, color); } static HRESULT WINAPI d3drm_texture2_GetDecalSize(IDirect3DRMTexture2 *iface, D3DVALUE *width, D3DVALUE *height) { - FIXME("iface %p, width %p, height %p stub!\n", iface, width, height); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); - return E_NOTIMPL; + TRACE("iface %p, width %p, height %p.\n", iface, width, height); + + return IDirect3DRMTexture3_GetDecalSize(&texture->IDirect3DRMTexture3_iface, width, height); } static HRESULT WINAPI d3drm_texture2_GetDecalOrigin(IDirect3DRMTexture2 *iface, LONG *x, LONG *y) { - FIXME("iface %p, x %p, y %p stub!\n", iface, x, y); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); - return E_NOTIMPL; + TRACE("iface %p, x %p, y %p.\n", iface, x, y); + + return IDirect3DRMTexture3_GetDecalOrigin(&texture->IDirect3DRMTexture3_iface, x, y); } static D3DRMIMAGE * WINAPI d3drm_texture2_GetImage(IDirect3DRMTexture2 *iface) { - FIXME("iface %p stub!\n", iface); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); - return NULL; + TRACE("iface %p.\n", iface); + + return IDirect3DRMTexture3_GetImage(&texture->IDirect3DRMTexture3_iface); } static DWORD WINAPI d3drm_texture2_GetShades(IDirect3DRMTexture2 *iface) { - FIXME("iface %p stub!\n", iface); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); - return 0; + TRACE("iface %p.\n", iface); + + return IDirect3DRMTexture3_GetShades(&texture->IDirect3DRMTexture3_iface); } static DWORD WINAPI d3drm_texture2_GetColors(IDirect3DRMTexture2 *iface) { - FIXME("iface %p stub!\n", iface); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); - return 0; + TRACE("iface %p.\n", iface); + + return IDirect3DRMTexture3_GetColors(&texture->IDirect3DRMTexture3_iface); } static DWORD WINAPI d3drm_texture2_GetDecalScale(IDirect3DRMTexture2 *iface) { - FIXME("iface %p stub!\n", iface); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); - return 0; + TRACE("iface %p.\n", iface); + + return IDirect3DRMTexture3_GetDecalScale(&texture->IDirect3DRMTexture3_iface); } static BOOL WINAPI d3drm_texture2_GetDecalTransparency(IDirect3DRMTexture2 *iface) { - FIXME("iface %p stub!\n", iface); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); - return FALSE; + TRACE("iface %p.\n", iface); + + return IDirect3DRMTexture3_GetDecalTransparency(&texture->IDirect3DRMTexture3_iface); } static D3DCOLOR WINAPI d3drm_texture2_GetDecalTransparentColor(IDirect3DRMTexture2 *iface) { - FIXME("iface %p stub!\n", iface); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); - return 0; + TRACE("iface %p.\n", iface); + + return IDirect3DRMTexture3_GetDecalTransparentColor(&texture->IDirect3DRMTexture3_iface); } static HRESULT WINAPI d3drm_texture2_InitFromImage(IDirect3DRMTexture2 *iface, D3DRMIMAGE *image) @@ -314,9 +629,11 @@ static HRESULT WINAPI d3drm_texture2_GenerateMIPMap(IDirect3DRMTexture2 *iface, DWORD flags) { - FIXME("iface %p, flags %#x stub!\n", iface, flags); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); - return E_NOTIMPL; + TRACE("iface %p, flags %#x.\n", iface, flags); + + return IDirect3DRMTexture3_GenerateMIPMap(&texture->IDirect3DRMTexture3_iface, flags); } static const struct IDirect3DRMTexture2Vtbl d3drm_texture2_vtbl = @@ -719,20 +1036,20 @@ HRESULT Direct3DRMTexture_create(REFIID riid, IUnknown **out) { struct d3drm_texture *object; + HRESULT hr; TRACE("riid %s, out %p.\n", debugstr_guid(riid), out); if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) return E_OUTOFMEMORY; + object->IDirect3DRMTexture_iface.lpVtbl = &d3drm_texture1_vtbl; object->IDirect3DRMTexture2_iface.lpVtbl = &d3drm_texture2_vtbl; object->IDirect3DRMTexture3_iface.lpVtbl = &d3drm_texture3_vtbl; object->ref = 1; - if (IsEqualGUID(riid, &IID_IDirect3DRMTexture3)) - *out = (IUnknown *)&object->IDirect3DRMTexture3_iface; - else - *out = (IUnknown *)&object->IDirect3DRMTexture2_iface; + hr = IDirect3DRMTexture3_QueryInterface(&object->IDirect3DRMTexture3_iface, riid, (void **)out); + IDirect3DRMTexture3_Release(&object->IDirect3DRMTexture3_iface); - return S_OK; + return hr; } diff -Nru wine1.7-1.7.50/dlls/d3drm/viewport.c wine1.7-1.7.55/dlls/d3drm/viewport.c --- wine1.7-1.7.50/dlls/d3drm/viewport.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3drm/viewport.c 2015-11-13 14:32:40.000000000 +0000 @@ -307,7 +307,7 @@ { FIXME("iface %p stub!\n", iface); - return E_NOTIMPL; + return FALSE; } static LONG WINAPI d3drm_viewport1_GetX(IDirect3DRMViewport *iface) @@ -672,7 +672,7 @@ { FIXME("iface %p stub!\n", iface); - return E_NOTIMPL; + return FALSE; } static LONG WINAPI d3drm_viewport2_GetX(IDirect3DRMViewport2 *iface) diff -Nru wine1.7-1.7.50/dlls/d3dx10_43/d3dx10_43_main.c wine1.7-1.7.55/dlls/d3dx10_43/d3dx10_43_main.c --- wine1.7-1.7.50/dlls/d3dx10_43/d3dx10_43_main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3dx10_43/d3dx10_43_main.c 2015-11-13 14:32:40.000000000 +0000 @@ -21,6 +21,8 @@ #include "config.h" #include "wine/port.h" +#include "wine/debug.h" +#include "wine/unicode.h" #include @@ -32,6 +34,9 @@ #include "objbase.h" #include "d3d10.h" +#include "d3dx10core.h" + +WINE_DEFAULT_DEBUG_CHANNEL(d3dx); BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { @@ -59,3 +64,55 @@ return FALSE; } + +HRESULT WINAPI D3DX10CreateEffectFromFileA(const char *filename, const D3D10_SHADER_MACRO *defines, + ID3D10Include *include, const char *profile, UINT hlslflags, UINT fxflags, ID3D10Device *device, + ID3D10EffectPool *effectpool, ID3DX10ThreadPump *pump, ID3D10Effect **effect, ID3D10Blob **errors, + HRESULT *hresult) +{ + FIXME("filename %s, defines %p, include %p, profile %s, hlslflags %#x, fxflags %#x, " + "device %p, effectpool %p, pump %p, effect %p, errors %p, hresult %p\n", + debugstr_a(filename), defines, include, debugstr_a(profile), hlslflags, fxflags, + device, effectpool, pump, effect, errors, hresult); + + return E_NOTIMPL; +} + +HRESULT WINAPI D3DX10CreateEffectFromFileW(const WCHAR *filename, const D3D10_SHADER_MACRO *defines, + ID3D10Include *include, const char *profile, UINT hlslflags, UINT fxflags, ID3D10Device *device, + ID3D10EffectPool *effectpool, ID3DX10ThreadPump *pump, ID3D10Effect **effect, ID3D10Blob **errors, + HRESULT *hresult) +{ + FIXME("filename %s, defines %p, include %p, profile %s, hlslflags %#x, fxflags %#x, " + "device %p, effectpool %p, pump %p, effect %p, errors %p, hresult %p\n", + debugstr_w(filename), defines, include, debugstr_a(profile), hlslflags, fxflags, device, + effectpool, pump, effect, errors, hresult); + + return E_NOTIMPL; +} + +HRESULT WINAPI D3DX10CreateEffectFromMemory(const void *data, SIZE_T datasize, const char *filename, + const D3D10_SHADER_MACRO *defines, ID3D10Include *include, const char *profile, UINT hlslflags, + UINT fxflags, ID3D10Device *device, ID3D10EffectPool *effectpool, ID3DX10ThreadPump *pump, + ID3D10Effect **effect, ID3D10Blob **errors, HRESULT *hresult) +{ + FIXME("data %p, datasize %lu, filename %s, defines %p, include %p, profile %s, hlslflags %#x, fxflags %#x, " + "device %p, effectpool %p, pump %p, effect %p, errors %p, hresult %p\n", + data, datasize, debugstr_a(filename), defines, include, debugstr_a(profile), hlslflags, fxflags, device, + effectpool, pump, effect, errors, hresult); + + return E_NOTIMPL; +} + +HRESULT WINAPI D3DX10CreateEffectPoolFromMemory(const void *data, SIZE_T datasize, const char *filename, + const D3D10_SHADER_MACRO *defines, ID3D10Include *include, const char *profile, UINT hlslflags, + UINT fxflags, ID3D10Device *device, ID3DX10ThreadPump *pump, ID3D10EffectPool **effectpool, + ID3D10Blob **errors, HRESULT *hresult) +{ + FIXME("data %p, datasize %lu, filename %s, defines %p, include %p, profile %s, hlslflags %#x, fxflags %#x, " + "device %p, pump %p, effectpool %p, errors %p, hresult %p.\n", + data, datasize, debugstr_a(filename), defines, include, debugstr_a(profile), hlslflags, fxflags, device, + pump, effectpool, errors, hresult); + + return E_NOTIMPL; +} diff -Nru wine1.7-1.7.50/dlls/d3dx10_43/d3dx10_43.spec wine1.7-1.7.55/dlls/d3dx10_43/d3dx10_43.spec --- wine1.7-1.7.50/dlls/d3dx10_43/d3dx10_43.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3dx10_43/d3dx10_43.spec 2015-11-13 14:32:40.000000000 +0000 @@ -20,14 +20,14 @@ @ stub D3DX10CreateAsyncTextureProcessor(ptr ptr ptr) @ stub D3DX10CreateDevice(ptr long long long ptr) @ stub D3DX10CreateDeviceAndSwapChain(ptr long long long ptr ptr ptr) -@ stub D3DX10CreateEffectFromFileA(str ptr ptr str long long ptr ptr ptr ptr ptr ptr) -@ stub D3DX10CreateEffectFromFileW(wstr ptr ptr str long long ptr ptr ptr ptr ptr ptr) -@ stub D3DX10CreateEffectFromMemory(ptr long str ptr ptr str long long ptr ptr ptr ptr ptr ptr) +@ stdcall D3DX10CreateEffectFromFileA(str ptr ptr str long long ptr ptr ptr ptr ptr ptr) +@ stdcall D3DX10CreateEffectFromFileW(wstr ptr ptr str long long ptr ptr ptr ptr ptr ptr) +@ stdcall D3DX10CreateEffectFromMemory(ptr long str ptr ptr str long long ptr ptr ptr ptr ptr ptr) @ stub D3DX10CreateEffectFromResourceA(long str str ptr ptr str long long ptr ptr ptr ptr ptr ptr) @ stub D3DX10CreateEffectFromResourceW(long wstr wstr ptr ptr str long long ptr ptr ptr ptr ptr ptr) @ stub D3DX10CreateEffectPoolFromFileA(str ptr ptr str long long ptr ptr ptr ptr ptr) @ stub D3DX10CreateEffectPoolFromFileW(wstr ptr ptr str long long ptr ptr ptr ptr ptr) -@ stub D3DX10CreateEffectPoolFromMemory(ptr long str ptr ptr str long long ptr ptr ptr ptr ptr) +@ stdcall D3DX10CreateEffectPoolFromMemory(ptr long str ptr ptr str long long ptr ptr ptr ptr ptr) @ stub D3DX10CreateEffectPoolFromResourceA(long str str ptr ptr str long long ptr ptr ptr ptr ptr) @ stub D3DX10CreateEffectPoolFromResourceW(long wstr wstr ptr ptr str long long ptr ptr ptr ptr ptr) @ stub D3DX10CreateFontA(ptr long long long long long long long long long str ptr) diff -Nru wine1.7-1.7.50/dlls/d3dx9_36/effect.c wine1.7-1.7.55/dlls/d3dx9_36/effect.c --- wine1.7-1.7.50/dlls/d3dx9_36/effect.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3dx9_36/effect.c 2015-11-13 14:32:40.000000000 +0000 @@ -5064,7 +5064,7 @@ HRESULT hr = E_FAIL; read_dword(ptr, &technique_index); - TRACE("techn: %u\n", technique_index); + TRACE("technique_index: %u\n", technique_index); read_dword(ptr, &index); TRACE("index: %u\n", index); diff -Nru wine1.7-1.7.50/dlls/d3dx9_36/mesh.c wine1.7-1.7.55/dlls/d3dx9_36/mesh.c --- wine1.7-1.7.50/dlls/d3dx9_36/mesh.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3dx9_36/mesh.c 2015-11-13 14:32:40.000000000 +0000 @@ -3912,11 +3912,9 @@ if (!memory || !memory_size || !device || !frame_hierarchy || !alloc_hier) return D3DERR_INVALIDCALL; - if (load_user_data || anim_controller) { - if (load_user_data) - FIXME("Loading user data not implemented\n"); - if (anim_controller) - FIXME("Animation controller creation not implemented\n"); + if (load_user_data) + { + FIXME("Loading user data not implemented.\n"); return E_NOTIMPL; } @@ -3986,6 +3984,12 @@ hr = D3D_OK; } + if (anim_controller) + { + *anim_controller = NULL; + FIXME("Animation controller creation not implemented.\n"); + } + cleanup: if (FAILED(hr) && first_frame) D3DXFrameDestroy(first_frame, alloc_hier); if (filedata) filedata->lpVtbl->Release(filedata); @@ -4986,12 +4990,6 @@ return D3DERR_INVALIDCALL; } - if (adjacency) - { - FIXME("Case of adjacency != NULL not implemented.\n"); - return E_NOTIMPL; - } - number_of_vertices = 2 + (slices * (3 + stacks)); number_of_faces = 2 * slices + stacks * (2 * slices); @@ -5143,6 +5141,23 @@ free_sincos_table(&theta); cylinder->lpVtbl->UnlockIndexBuffer(cylinder); cylinder->lpVtbl->UnlockVertexBuffer(cylinder); + + if (adjacency) + { + if (FAILED(hr = D3DXCreateBuffer(number_of_faces * sizeof(DWORD) * 3, adjacency))) + { + cylinder->lpVtbl->Release(cylinder); + return hr; + } + + if (FAILED(hr = cylinder->lpVtbl->GenerateAdjacency(cylinder, 0.0f, (*adjacency)->lpVtbl->GetBufferPointer(*adjacency)))) + { + (*adjacency)->lpVtbl->Release(*adjacency); + cylinder->lpVtbl->Release(cylinder); + return hr; + } + } + *mesh = cylinder; return D3D_OK; @@ -7001,7 +7016,6 @@ DWORD *point_reps = NULL; struct d3dx9_mesh *This = impl_from_ID3DXMesh(mesh); DWORD *vertex_face_map = NULL; - ID3DXBuffer *vertex_remap = NULL; BYTE *vertices = NULL; TRACE("mesh %p, flags %#x, epsilons %p, adjacency %p, adjacency_out %p, face_remap_out %p, vertex_remap_out %p.\n", @@ -7168,7 +7182,6 @@ HeapFree(GetProcessHeap(), 0, vertex_face_map); if (attributes) mesh->lpVtbl->UnlockAttributeBuffer(mesh); if (indices) mesh->lpVtbl->UnlockIndexBuffer(mesh); - if (vertex_remap) ID3DXBuffer_Release(vertex_remap); if (vertices) mesh->lpVtbl->UnlockVertexBuffer(mesh); return hr; diff -Nru wine1.7-1.7.50/dlls/d3dx9_36/shader.c wine1.7-1.7.55/dlls/d3dx9_36/shader.c --- wine1.7-1.7.50/dlls/d3dx9_36/shader.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3dx9_36/shader.c 2015-11-13 14:32:40.000000000 +0000 @@ -1096,7 +1096,7 @@ offset = min(desc->Elements - 1, offset); last = offset * desc->Rows * desc->Columns; - if ((is_pointer || (!is_pointer && inclass == D3DXPC_MATRIX_ROWS)) && desc->RegisterSet != D3DXRS_BOOL) + if ((is_pointer || inclass == D3DXPC_MATRIX_ROWS) && desc->RegisterSet != D3DXRS_BOOL) { set(table, device, &constant->constants[0], NULL, intype, size, incol, inclass, 0, is_pointer); } @@ -1136,7 +1136,7 @@ * E.g.: struct {int i; int n} s; * SetValue(device, "s", [1, 2], 8) => s = {1, 0}; */ - else if ((is_pointer || (!is_pointer && inclass == D3DXPC_MATRIX_ROWS)) && desc->RegisterSet != D3DXRS_BOOL) + else if ((is_pointer || inclass == D3DXPC_MATRIX_ROWS) && desc->RegisterSet != D3DXRS_BOOL) { last = set(table, device, &constant->constants[0], indata, intype, size, incol, inclass, index + last, is_pointer); diff -Nru wine1.7-1.7.50/dlls/d3dx9_36/surface.c wine1.7-1.7.55/dlls/d3dx9_36/surface.c --- wine1.7-1.7.50/dlls/d3dx9_36/surface.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3dx9_36/surface.c 2015-11-13 14:32:40.000000000 +0000 @@ -77,7 +77,7 @@ /* dds_header.flags */ #define DDS_CAPS 0x1 #define DDS_HEIGHT 0x2 -#define DDS_WIDTH 0x2 +#define DDS_WIDTH 0x4 #define DDS_PITCH 0x8 #define DDS_PIXELFORMAT 0x1000 #define DDS_MIPMAPCOUNT 0x20000 @@ -146,15 +146,15 @@ { unsigned int i; static const DWORD known_fourcc[] = { - MAKEFOURCC('U','Y','V','Y'), - MAKEFOURCC('Y','U','Y','2'), - MAKEFOURCC('R','G','B','G'), - MAKEFOURCC('G','R','G','B'), - MAKEFOURCC('D','X','T','1'), - MAKEFOURCC('D','X','T','2'), - MAKEFOURCC('D','X','T','3'), - MAKEFOURCC('D','X','T','4'), - MAKEFOURCC('D','X','T','5'), + D3DFMT_UYVY, + D3DFMT_YUY2, + D3DFMT_R8G8_B8G8, + D3DFMT_G8R8_G8B8, + D3DFMT_DXT1, + D3DFMT_DXT2, + D3DFMT_DXT3, + D3DFMT_DXT4, + D3DFMT_DXT5, D3DFMT_R16F, D3DFMT_G16R16F, D3DFMT_A16B16G16R16F, @@ -390,7 +390,7 @@ info->Width = header->width; info->Height = header->height; info->Depth = 1; - info->MipLevels = (header->flags & DDS_MIPMAPCOUNT) ? header->miplevels : 1; + info->MipLevels = header->miplevels ? header->miplevels : 1; info->Format = dds_pixel_format_to_d3dformat(&header->pixel_format); if (info->Format == D3DFMT_UNKNOWN) diff -Nru wine1.7-1.7.50/dlls/d3dx9_36/tests/core.c wine1.7-1.7.55/dlls/d3dx9_36/tests/core.c --- wine1.7-1.7.50/dlls/d3dx9_36/tests/core.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3dx9_36/tests/core.c 2015-11-13 14:32:40.000000000 +0000 @@ -1184,7 +1184,7 @@ todo_wine ok(hr == D3DERR_INVALIDCALL, "ID3DXRenderToEnvMap::BeginParabolic returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL); hr = ID3DXRenderToEnvMap_BeginSphere(render, NULL); - todo_wine ok(hr == D3DERR_INVALIDCALL, "ID3DXRenderToEnvMap::BeginSphere returned %#x, exected %#x\n", hr, D3DERR_INVALIDCALL); + todo_wine ok(hr == D3DERR_INVALIDCALL, "ID3DXRenderToEnvMap::BeginSphere returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL); check_release((IUnknown *)render, 0); } else skip("Failed to create ID3DXRenderToEnvMap\n"); diff -Nru wine1.7-1.7.50/dlls/d3dx9_36/tests/mesh.c wine1.7-1.7.55/dlls/d3dx9_36/tests/mesh.c --- wine1.7-1.7.50/dlls/d3dx9_36/tests/mesh.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3dx9_36/tests/mesh.c 2015-11-13 14:32:40.000000000 +0000 @@ -1487,8 +1487,8 @@ return; if (mesh_fvf == fvf) { - DWORD vertex_size = D3DXGetFVFVertexSize(fvf); - int i; + DWORD vertex_size = D3DXGetFVFVertexSize(fvf), i; + for (i = 0; i < min(num_vertices, mesh_num_vertices); i++) { const FLOAT *exp_float = vertices; @@ -2205,6 +2205,127 @@ (char *)"texture.jpg", /* pTextureFilename */ }, }; + static const char box_anim_xfile[] = + "xof 0303txt 0032" + "Mesh CubeMesh {" + "8;" /* DWORD nVertices; */ + /* array Vector vertices[nVertices]; */ + "0.0; 0.0; 0.0;," + "0.0; 0.0; 1.0;," + "0.0; 1.0; 0.0;," + "0.0; 1.0; 1.0;," + "1.0; 0.0; 0.0;," + "1.0; 0.0; 1.0;," + "1.0; 1.0; 0.0;," + "1.0; 1.0; 1.0;;" + "6;" /* DWORD nFaces; */ + /* array MeshFace faces[nFaces]; */ + "4; 0, 1, 3, 2;," /* left side */ + "4; 2, 3, 7, 6;," /* top side */ + "4; 6, 7, 5, 4;," /* right side */ + "4; 1, 0, 4, 5;," /* bottom side */ + "4; 1, 5, 7, 3;," /* back side */ + "4; 0, 2, 6, 4;;" /* front side */ + "MeshNormals {" + "6;" /* DWORD nNormals; */ + /* array Vector normals[nNormals]; */ + "-1.0; 0.0; 0.0;," + "0.0; 1.0; 0.0;," + "1.0; 0.0; 0.0;," + "0.0; -1.0; 0.0;," + "0.0; 0.0; 1.0;," + "0.0; 0.0; -1.0;;" + "6;" /* DWORD nFaceNormals; */ + /* array MeshFace faceNormals[nFaceNormals]; */ + "4; 0, 0, 0, 0;," + "4; 1, 1, 1, 1;," + "4; 2, 2, 2, 2;," + "4; 3, 3, 3, 3;," + "4; 4, 4, 4, 4;," + "4; 5, 5, 5, 5;;" + "}" + "MeshMaterialList materials {" + "2;" /* DWORD nMaterials; */ + "6;" /* DWORD nFaceIndexes; */ + /* array DWORD faceIndexes[nFaceIndexes]; */ + "0, 0, 0, 1, 1, 1;;" + "Material {" + /* ColorRGBA faceColor; */ + "0.0; 0.0; 1.0; 1.0;;" + /* FLOAT power; */ + "0.5;" + /* ColorRGB specularColor; */ + "1.0; 1.0; 1.0;;" + /* ColorRGB emissiveColor; */ + "0.0; 0.0; 0.0;;" + "}" + "Material {" + /* ColorRGBA faceColor; */ + "1.0; 1.0; 1.0; 1.0;;" + /* FLOAT power; */ + "1.0;" + /* ColorRGB specularColor; */ + "1.0; 1.0; 1.0;;" + /* ColorRGB emissiveColor; */ + "0.0; 0.0; 0.0;;" + "TextureFilename { \"texture.jpg\"; }" + "}" + "}" + "MeshVertexColors {" + "8;" /* DWORD nVertexColors; */ + /* array IndexedColor vertexColors[nVertexColors]; */ + "0; 0.0; 0.0; 0.0; 0.0;;" + "1; 0.0; 0.0; 1.0; 0.1;;" + "2; 0.0; 1.0; 0.0; 0.2;;" + "3; 0.0; 1.0; 1.0; 0.3;;" + "4; 1.0; 0.0; 0.0; 0.4;;" + "5; 1.0; 0.0; 1.0; 0.5;;" + "6; 1.0; 1.0; 0.0; 0.6;;" + "7; 1.0; 1.0; 1.0; 0.7;;" + "}" + "MeshTextureCoords {" + "8;" /* DWORD nTextureCoords; */ + /* array Coords2d textureCoords[nTextureCoords]; */ + "0.0; 1.0;," + "1.0; 1.0;," + "0.0; 0.0;," + "1.0; 0.0;," + "1.0; 1.0;," + "0.0; 1.0;," + "1.0; 0.0;," + "0.0; 0.0;;" + "}" + "}" + "Frame CubeFrame {" + "FrameTransformMatrix {" + /* Matrix4x4 frameMatrix; */ + "1.0, 0.0, 0.0, 0.0," + "0.0, 1.0, 0.0, 0.0," + "0.0, 0.0, 1.0, 0.0," + "0.0, 0.0, 0.0, 1.0;;" + "}" + "{CubeMesh}" + "}" + "AnimationSet AnimationSet0 {" + "Animation Animation0 {" + "{CubeFrame}" + "AnimationKey {" + "2;" /* DWORD keyType; */ + "9;" /* DWORD nKeys; */ + /* array TimedFloatKeys keys[nKeys]; */ + "10; 3; -100.0, 0.0, 0.0;;," + "20; 3; -75.0, 0.0, 0.0;;," + "30; 3; -50.0, 0.0, 0.0;;," + "40; 3; -25.5, 0.0, 0.0;;," + "50; 3; 0.0, 0.0, 0.0;;," + "60; 3; 25.5, 0.0, 0.0;;," + "70; 3; 50.0, 0.0, 0.0;;," + "80; 3; 75.5, 0.0, 0.0;;," + "90; 3; 100.0, 0.0, 0.0;;;" + "}" + "}" + "}"; + const DWORD box_fvf = D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE | D3DFVF_TEX1; /*________________________*/ static const D3DXMATERIAL default_materials[] = { @@ -2225,6 +2346,7 @@ D3DXFRAME *frame_hier = NULL; D3DXMATRIX transform; struct test_context *test_context; + ID3DXAnimationController *controller; if (!(test_context = new_test_context())) { @@ -2281,12 +2403,31 @@ frame_hier = NULL; } + controller = (ID3DXAnimationController *)0xdeadbeef; + hr = D3DXLoadMeshHierarchyFromXInMemory(box_anim_xfile, sizeof(box_anim_xfile) - 1, + D3DXMESH_MANAGED, device, &alloc_hier, NULL, &frame_hier, &controller); + todo_wine ok(hr == D3D_OK, "Expected D3D_OK, got %#x.\n", hr); + if (SUCCEEDED(hr)) + { + ok(controller != NULL, "Animation Controller NULL.\n"); + + hr = D3DXFrameDestroy(frame_hier, &alloc_hier); + ok(hr == D3D_OK, "Expected D3D_OK, got %#x.\n", hr); + if (controller) + controller->lpVtbl->Release(controller); + + frame_hier = NULL; + } + + controller = (ID3DXAnimationController *)0xdeadbeef; hr = D3DXLoadMeshHierarchyFromXInMemory(box_xfile, sizeof(box_xfile) - 1, - D3DXMESH_MANAGED, device, &alloc_hier, NULL, &frame_hier, NULL); + D3DXMESH_MANAGED, device, &alloc_hier, NULL, &frame_hier, &controller); ok(hr == D3D_OK, "Expected D3D_OK, got %#x\n", hr); - if (SUCCEEDED(hr)) { + if (SUCCEEDED(hr)) + { D3DXMESHCONTAINER *container = frame_hier->pMeshContainer; + ok(!controller, "Animation Controller returned.\n"); ok(frame_hier->Name == NULL, "Expected NULL, got '%s'\n", frame_hier->Name); D3DXMatrixIdentity(&transform); check_matrix(&frame_hier->TransformationMatrix, &transform); @@ -2568,7 +2709,7 @@ mesh.fvf = D3DFVF_XYZ | D3DFVF_NORMAL; - sprintf(name, "polygon (%g, %d)", length, sides); + sprintf(name, "polygon (%g, %u)", length, sides); compare_mesh(name, polygon, &mesh); free_mesh(&mesh); diff -Nru wine1.7-1.7.50/dlls/d3dx9_36/tests/surface.c wine1.7-1.7.55/dlls/d3dx9_36/tests/surface.c --- wine1.7-1.7.50/dlls/d3dx9_36/tests/surface.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3dx9_36/tests/surface.c 2015-11-13 14:32:40.000000000 +0000 @@ -171,6 +171,7 @@ #define DDS_WIDTH 0x00000004 #define DDS_PITCH 0x00000008 #define DDS_PIXELFORMAT 0x00001000 +#define DDS_MIPMAPCOUNT 0x00020000 #define DDS_LINEARSIZE 0x00080000 /* dds_header.caps */ @@ -278,8 +279,8 @@ struct { struct dds_header header; - BYTE data[256]; - } dds; + BYTE data[4096 * 1024]; + } *dds; struct { @@ -288,71 +289,135 @@ DWORD width; DWORD height; DWORD pitch; + DWORD miplevels; DWORD pixel_data_size; - HRESULT expected_result; + struct + { + HRESULT hr; + UINT miplevels; + } + expected; } tests[] = { /* pitch is ignored */ - { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, 0, 4, 4, 0, - 63 /* pixel data size */, D3DXERR_INVALIDDATA }, - { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, DDS_PITCH, 4, 4, 0 /* pitch */, - 64, D3D_OK }, - { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, DDS_PITCH, 4, 4, 1 /* pitch */, - 64, D3D_OK }, - { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, DDS_PITCH, 4, 4, 2 /* pitch */, - 64, D3D_OK }, - { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, DDS_PITCH, 4, 4, 3 /* pitch */, - 64, D3D_OK }, - { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, DDS_PITCH, 4, 4, 4 /* pitch */, - 64, D3D_OK }, - { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, DDS_PITCH, 4, 4, 16 /* pitch */, - 64, D3D_OK }, - { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, DDS_PITCH, 4, 4, 1024 /* pitch */, - 64, D3D_OK }, - { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, DDS_PITCH, 4, 4, -1 /* pitch */, - 64, D3D_OK }, + { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, 0, 4, 4, 0, 0, + 63 /* pixel data size */, { D3DXERR_INVALIDDATA, 0 } }, + { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, DDS_PITCH, 4, 4, 0 /* pitch */, 0, + 64, { D3D_OK, 1 } }, + { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, DDS_PITCH, 4, 4, 1 /* pitch */, 0, + 64, { D3D_OK, 1 } }, + { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, DDS_PITCH, 4, 4, 2 /* pitch */, 0, + 64, { D3D_OK, 1 } }, + { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, DDS_PITCH, 4, 4, 3 /* pitch */, 0, + 64, { D3D_OK, 1 } }, + { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, DDS_PITCH, 4, 4, 4 /* pitch */, 0, + 64, { D3D_OK, 1 } }, + { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, DDS_PITCH, 4, 4, 16 /* pitch */, 0, + 64, { D3D_OK, 1 } }, + { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, DDS_PITCH, 4, 4, 1024 /* pitch */, 0, + 64, { D3D_OK, 1 } }, + { { 32, DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, DDS_PITCH, 4, 4, -1 /* pitch */, 0, + 64, { D3D_OK, 1 } }, /* linear size is ignored */ - { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','1'), 0, 0, 0, 0, 0 }, 0, 4, 4, 0, - 7 /* pixel data size */, D3DXERR_INVALIDDATA }, - { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','1'), 0, 0, 0, 0, 0 }, DDS_LINEARSIZE, 4, 4, 0 /* linear size */, - 8, D3D_OK }, - { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','1'), 0, 0, 0, 0, 0 }, DDS_LINEARSIZE, 4, 4, 1 /* linear size */, - 8, D3D_OK }, - { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','1'), 0, 0, 0, 0, 0 }, DDS_LINEARSIZE, 4, 4, 2 /* linear size */, - 8, D3D_OK }, - { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','1'), 0, 0, 0, 0, 0 }, DDS_LINEARSIZE, 4, 4, 9 /* linear size */, - 8, D3D_OK }, - { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','1'), 0, 0, 0, 0, 0 }, DDS_LINEARSIZE, 4, 4, 16 /* linear size */, - 8, D3D_OK }, - { { 32, DDS_PF_FOURCC, MAKEFOURCC('D','X','T','1'), 0, 0, 0, 0, 0 }, DDS_LINEARSIZE, 4, 4, -1 /* linear size */, - 8, D3D_OK }, + { { 32, DDS_PF_FOURCC, D3DFMT_DXT1, 0, 0, 0, 0, 0 }, 0, 4, 4, 0, 0, + 7 /* pixel data size */, { D3DXERR_INVALIDDATA, 1 } }, + { { 32, DDS_PF_FOURCC, D3DFMT_DXT1, 0, 0, 0, 0, 0 }, DDS_LINEARSIZE, 4, 4, 0 /* linear size */, 0, + 8, { D3D_OK, 1 } }, + { { 32, DDS_PF_FOURCC, D3DFMT_DXT1, 0, 0, 0, 0, 0 }, DDS_LINEARSIZE, 4, 4, 1 /* linear size */, 0, + 8, { D3D_OK, 1 } }, + { { 32, DDS_PF_FOURCC, D3DFMT_DXT1, 0, 0, 0, 0, 0 }, DDS_LINEARSIZE, 4, 4, 2 /* linear size */, 0, + 8, { D3D_OK, 1 } }, + { { 32, DDS_PF_FOURCC, D3DFMT_DXT1, 0, 0, 0, 0, 0 }, DDS_LINEARSIZE, 4, 4, 9 /* linear size */, 0, + 8, { D3D_OK, 1 } }, + { { 32, DDS_PF_FOURCC, D3DFMT_DXT1, 0, 0, 0, 0, 0 }, DDS_LINEARSIZE, 4, 4, 16 /* linear size */, 0, + 8, { D3D_OK, 1 } }, + { { 32, DDS_PF_FOURCC, D3DFMT_DXT1, 0, 0, 0, 0, 0 }, DDS_LINEARSIZE, 4, 4, -1 /* linear size */, 0, + 8, { D3D_OK, 1 } }, /* integer overflows */ - { { 32, DDS_PF_RGB, 0, 32, 0xff0000, 0x00ff00, 0x0000ff, 0 }, 0, 0x80000000, 0x80000000 /* 0x80000000 * 0x80000000 * 4 = 0 */, 0, - 64, D3D_OK }, - { { 32, DDS_PF_RGB, 0, 32, 0xff0000, 0x00ff00, 0x0000ff, 0 }, 0, 0x8000100, 0x800100 /* 0x8000100 * 0x800100 * 4 = 262144 */, 0, - 64, D3DXERR_INVALIDDATA }, - { { 32, DDS_PF_RGB, 0, 32, 0xff0000, 0x00ff00, 0x0000ff, 0 }, 0, 0x80000001, 0x80000001 /* 0x80000001 * 0x80000001 * 4 = 4 */, 0, - 4, D3D_OK }, - { { 32, DDS_PF_RGB, 0, 32, 0xff0000, 0x00ff00, 0x0000ff, 0 }, 0, 0x80000001, 0x80000001 /* 0x80000001 * 0x80000001 * 4 = 4 */, 0, - 3 /* pixel data size */, D3DXERR_INVALIDDATA } + { { 32, DDS_PF_RGB, 0, 32, 0xff0000, 0x00ff00, 0x0000ff, 0 }, 0, 0x80000000, 0x80000000 /* 0x80000000 * 0x80000000 * 4 = 0 */, 0, 0, + 64, { D3D_OK, 1 } }, + { { 32, DDS_PF_RGB, 0, 32, 0xff0000, 0x00ff00, 0x0000ff, 0 }, 0, 0x8000100, 0x800100 /* 0x8000100 * 0x800100 * 4 = 262144 */, 0, 0, + 64, { D3DXERR_INVALIDDATA, 0 } }, + { { 32, DDS_PF_RGB, 0, 32, 0xff0000, 0x00ff00, 0x0000ff, 0 }, 0, 0x80000001, 0x80000001 /* 0x80000001 * 0x80000001 * 4 = 4 */, 0, 0, + 4, { D3D_OK, 1 } }, + { { 32, DDS_PF_RGB, 0, 32, 0xff0000, 0x00ff00, 0x0000ff, 0 }, 0, 0x80000001, 0x80000001 /* 0x80000001 * 0x80000001 * 4 = 4 */, 0, 0, + 3 /* pixel data size */, { D3DXERR_INVALIDDATA, 0 } }, + /* file size is validated */ + { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 64, 0, 0, 49151, { D3DXERR_INVALIDDATA, 0 } }, + { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 64, 0, 0, 49152, { D3D_OK, 1 } }, + { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, DDS_MIPMAPCOUNT, 256, 64, 0, 4, 65279, { D3DXERR_INVALIDDATA, 0 } }, + { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, DDS_MIPMAPCOUNT, 256, 64, 0, 4, 65280, { D3D_OK, 4 } }, + { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, DDS_MIPMAPCOUNT, 256, 64, 0, 9, 65540, { D3DXERR_INVALIDDATA, 0 } }, + { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, DDS_MIPMAPCOUNT, 256, 64, 0, 9, 65541, { D3D_OK, 9 } }, + { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 256, 0, 0, 196607, { D3DXERR_INVALIDDATA, 0 } }, + { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 256, 0, 0, 196608, { D3D_OK, 1 } }, + { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 256, 0, 0, 196609, { D3D_OK, 1 } }, + { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, DDS_MIPMAPCOUNT, 256, 256, 0, 1, 196607, { D3DXERR_INVALIDDATA, 0 } }, + { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, DDS_MIPMAPCOUNT, 256, 256, 0, 1, 196608, { D3D_OK, 1 } }, + { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, DDS_MIPMAPCOUNT, 256, 256, 0, 0, 196607, { D3DXERR_INVALIDDATA, 0 } }, + { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, DDS_MIPMAPCOUNT, 256, 256, 0, 0, 196608, { D3D_OK, 1 } }, + { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, DDS_MIPMAPCOUNT, 256, 256, 0, 0, 400000, { D3D_OK, 1 } }, + { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, DDS_MIPMAPCOUNT, 256, 256, 0, 9, 262142, { D3DXERR_INVALIDDATA, 0 } }, + { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, DDS_MIPMAPCOUNT, 256, 256, 0, 9, 262143, { D3D_OK, 9 } }, + { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, DDS_MIPMAPCOUNT, 256, 256, 0, 10, 262145, { D3DXERR_INVALIDDATA, 0 } }, + { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, DDS_MIPMAPCOUNT, 256, 256, 0, 10, 262146, { D3D_OK, 10 } }, + { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, DDS_MIPMAPCOUNT, 256, 256, 0, 20, 262175, { D3DXERR_INVALIDDATA, 0 } }, + { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, DDS_MIPMAPCOUNT, 256, 256, 0, 20, 262176, { D3D_OK, 20 } }, + { { 32, DDS_PF_FOURCC, D3DFMT_DXT1, 0, 0, 0, 0, 0 }, 0, 256, 256, 0, 0, 32767, { D3DXERR_INVALIDDATA, 0 } }, + { { 32, DDS_PF_FOURCC, D3DFMT_DXT1, 0, 0, 0, 0, 0 }, 0, 256, 256, 0, 0, 32768, { D3D_OK, 1 } }, + { { 32, DDS_PF_FOURCC, D3DFMT_DXT1, 0, 0, 0, 0, 0 }, DDS_MIPMAPCOUNT, 256, 256, 0, 0, 32767, { D3DXERR_INVALIDDATA, 0 } }, + { { 32, DDS_PF_FOURCC, D3DFMT_DXT1, 0, 0, 0, 0, 0 }, DDS_MIPMAPCOUNT, 256, 256, 0, 0, 32768, { D3D_OK, 1 } }, + { { 32, DDS_PF_FOURCC, D3DFMT_DXT1, 0, 0, 0, 0, 0 }, DDS_MIPMAPCOUNT, 256, 256, 0, 9, 43703, { D3DXERR_INVALIDDATA, 0 } }, + { { 32, DDS_PF_FOURCC, D3DFMT_DXT1, 0, 0, 0, 0, 0 }, DDS_MIPMAPCOUNT, 256, 256, 0, 9, 43704, { D3D_OK, 9 } }, + { { 32, DDS_PF_FOURCC, D3DFMT_DXT1, 0, 0, 0, 0, 0 }, DDS_MIPMAPCOUNT, 256, 256, 0, 20, 43791, { D3DXERR_INVALIDDATA, 0 } }, + { { 32, DDS_PF_FOURCC, D3DFMT_DXT1, 0, 0, 0, 0, 0 }, DDS_MIPMAPCOUNT, 256, 256, 0, 20, 43792, { D3D_OK, 20 } }, + { { 32, DDS_PF_FOURCC, D3DFMT_DXT4, 0, 0, 0, 0, 0 }, 0, 256, 256, 0, 0, 65535, { D3DXERR_INVALIDDATA, 0 } }, + { { 32, DDS_PF_FOURCC, D3DFMT_DXT4, 0, 0, 0, 0, 0 }, 0, 256, 256, 0, 0, 65536, { D3D_OK, 1 } }, + { { 32, DDS_PF_FOURCC, D3DFMT_DXT4, 0, 0, 0, 0, 0 }, DDS_MIPMAPCOUNT, 256, 256, 0, 0, 65535, { D3DXERR_INVALIDDATA, 0 } }, + { { 32, DDS_PF_FOURCC, D3DFMT_DXT4, 0, 0, 0, 0, 0 }, DDS_MIPMAPCOUNT, 256, 256, 0, 0, 65536, { D3D_OK, 1 } }, + { { 32, DDS_PF_FOURCC, D3DFMT_DXT4, 0, 0, 0, 0, 0 }, DDS_MIPMAPCOUNT, 256, 256, 0, 9, 87407, { D3DXERR_INVALIDDATA, 0 } }, + { { 32, DDS_PF_FOURCC, D3DFMT_DXT4, 0, 0, 0, 0, 0 }, DDS_MIPMAPCOUNT, 256, 256, 0, 9, 87408, { D3D_OK, 9 } }, + { { 32, DDS_PF_FOURCC, D3DFMT_DXT4, 0, 0, 0, 0, 0 }, DDS_MIPMAPCOUNT, 256, 256, 0, 20, 87583, { D3DXERR_INVALIDDATA, 0 } }, + { { 32, DDS_PF_FOURCC, D3DFMT_DXT4, 0, 0, 0, 0, 0 }, DDS_MIPMAPCOUNT, 256, 256, 0, 20, 87584, { D3D_OK, 20 } }, + { { 32, DDS_PF_FOURCC, D3DFMT_DXT4, 0, 0, 0, 0, 0 }, DDS_MIPMAPCOUNT, 256, 64, 0, 4, 21759, { D3DXERR_INVALIDDATA, 0 } }, + { { 32, DDS_PF_FOURCC, D3DFMT_DXT4, 0, 0, 0, 0, 0 }, DDS_MIPMAPCOUNT, 256, 64, 0, 4, 21760, { D3D_OK, 4 } }, + /* DDS_MIPMAPCOUNT is ignored */ + { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 256, 0, 0, 262146, { D3D_OK, 1 } }, + { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 256, 0, 2, 262146, { D3D_OK, 2 } }, + { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 256, 0, 9, 262146, { D3D_OK, 9 } }, + { { 32, DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000 }, 0, 256, 256, 0, 10, 262146, { D3D_OK, 10 } }, }; - memset(&dds, 0, sizeof(dds)); + dds = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*dds)); + if (!dds) + { + skip("Failed to allocate memory.\n"); + return; + } for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) { - DWORD file_size = sizeof(dds.header) + tests[i].pixel_data_size; - assert(file_size <= sizeof(dds)); - - fill_dds_header(&dds.header); - dds.header.flags |= tests[i].flags; - dds.header.width = tests[i].width; - dds.header.height = tests[i].height; - dds.header.pitch_or_linear_size = tests[i].pitch; - dds.header.pixel_format = tests[i].pixel_format; + DWORD file_size = sizeof(dds->header) + tests[i].pixel_data_size; + assert(file_size <= sizeof(*dds)); - hr = D3DXGetImageInfoFromFileInMemory(&dds, file_size, &info); - ok(hr == tests[i].expected_result, "%d: D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n", i, hr, tests[i].expected_result); + fill_dds_header(&dds->header); + dds->header.flags |= tests[i].flags; + dds->header.width = tests[i].width; + dds->header.height = tests[i].height; + dds->header.pitch_or_linear_size = tests[i].pitch; + dds->header.miplevels = tests[i].miplevels; + dds->header.pixel_format = tests[i].pixel_format; + + hr = D3DXGetImageInfoFromFileInMemory(dds, file_size, &info); + ok(hr == tests[i].expected.hr, "%d: D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x\n", + i, hr, tests[i].expected.hr); + if (SUCCEEDED(hr)) + { + ok(info.MipLevels == tests[i].expected.miplevels, "%d: Got MipLevels %u, expected %u\n", + i, info.MipLevels, tests[i].expected.miplevels); + } } + + HeapFree(GetProcessHeap(), 0, dds); } static void test_D3DXGetImageInfo(void) @@ -545,15 +610,15 @@ ok(info.ImageFileFormat == D3DXIFF_DDS, "Got image file format %#x, expected %#x\n", info.ImageFileFormat, D3DXIFF_DDS); } else skip("Couldn't get image info from volume map in memory\n"); - check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('D','X','T','1'), 0, 0, 0, 0, 0, D3DFMT_DXT1); - check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('D','X','T','2'), 0, 0, 0, 0, 0, D3DFMT_DXT2); - check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('D','X','T','3'), 0, 0, 0, 0, 0, D3DFMT_DXT3); - check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('D','X','T','4'), 0, 0, 0, 0, 0, D3DFMT_DXT4); - check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('D','X','T','5'), 0, 0, 0, 0, 0, D3DFMT_DXT5); - check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('R','G','B','G'), 0, 0, 0, 0, 0, D3DFMT_R8G8_B8G8); - check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('G','R','G','B'), 0, 0, 0, 0, 0, D3DFMT_G8R8_G8B8); - check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('U','Y','V','Y'), 0, 0, 0, 0, 0, D3DFMT_UYVY); - check_dds_pixel_format(DDS_PF_FOURCC, MAKEFOURCC('Y','U','Y','2'), 0, 0, 0, 0, 0, D3DFMT_YUY2); + check_dds_pixel_format(DDS_PF_FOURCC, D3DFMT_DXT1, 0, 0, 0, 0, 0, D3DFMT_DXT1); + check_dds_pixel_format(DDS_PF_FOURCC, D3DFMT_DXT2, 0, 0, 0, 0, 0, D3DFMT_DXT2); + check_dds_pixel_format(DDS_PF_FOURCC, D3DFMT_DXT3, 0, 0, 0, 0, 0, D3DFMT_DXT3); + check_dds_pixel_format(DDS_PF_FOURCC, D3DFMT_DXT4, 0, 0, 0, 0, 0, D3DFMT_DXT4); + check_dds_pixel_format(DDS_PF_FOURCC, D3DFMT_DXT5, 0, 0, 0, 0, 0, D3DFMT_DXT5); + check_dds_pixel_format(DDS_PF_FOURCC, D3DFMT_R8G8_B8G8, 0, 0, 0, 0, 0, D3DFMT_R8G8_B8G8); + check_dds_pixel_format(DDS_PF_FOURCC, D3DFMT_G8R8_G8B8, 0, 0, 0, 0, 0, D3DFMT_G8R8_G8B8); + check_dds_pixel_format(DDS_PF_FOURCC, D3DFMT_UYVY, 0, 0, 0, 0, 0, D3DFMT_UYVY); + check_dds_pixel_format(DDS_PF_FOURCC, D3DFMT_YUY2, 0, 0, 0, 0, 0, D3DFMT_YUY2); check_dds_pixel_format(DDS_PF_RGB, 0, 16, 0xf800, 0x07e0, 0x001f, 0, D3DFMT_R5G6B5); check_dds_pixel_format(DDS_PF_RGB | DDS_PF_ALPHA, 0, 16, 0x7c00, 0x03e0, 0x001f, 0x8000, D3DFMT_A1R5G5B5); check_dds_pixel_format(DDS_PF_RGB | DDS_PF_ALPHA, 0, 16, 0x0f00, 0x00f0, 0x000f, 0xf000, D3DFMT_A4R4G4B4); @@ -567,6 +632,7 @@ check_dds_pixel_format(DDS_PF_RGB | DDS_PF_ALPHA, 0, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000, D3DFMT_A8B8G8R8); check_dds_pixel_format(DDS_PF_RGB, 0, 32, 0xff0000, 0x00ff00, 0x0000ff, 0, D3DFMT_X8R8G8B8); check_dds_pixel_format(DDS_PF_RGB, 0, 32, 0x0000ff, 0x00ff00, 0xff0000, 0, D3DFMT_X8B8G8R8); + check_dds_pixel_format(DDS_PF_RGB, 0, 24, 0xff0000, 0x00ff00, 0x0000ff, 0, D3DFMT_R8G8B8); check_dds_pixel_format(DDS_PF_RGB, 0, 32, 0x0000ffff, 0xffff0000, 0, 0, D3DFMT_G16R16); check_dds_pixel_format(DDS_PF_LUMINANCE, 0, 8, 0xff, 0, 0, 0, D3DFMT_L8); check_dds_pixel_format(DDS_PF_LUMINANCE, 0, 16, 0xffff, 0, 0, 0, D3DFMT_L16); diff -Nru wine1.7-1.7.50/dlls/d3dx9_36/tests/xfile.c wine1.7-1.7.55/dlls/d3dx9_36/tests/xfile.c --- wine1.7-1.7.50/dlls/d3dx9_36/tests/xfile.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/d3dx9_36/tests/xfile.c 2015-11-13 14:32:40.000000000 +0000 @@ -343,7 +343,7 @@ goto exit; } - printf("Load templates file (%d bytes)\n", size); + printf("Load templates file (%u bytes)\n", size); ret = D3DXFileCreate(&xfile); ok(ret == S_OK, "D3DXCreateFile failed with %#x\n", ret); diff -Nru wine1.7-1.7.50/dlls/dbghelp/dwarf.c wine1.7-1.7.55/dlls/dbghelp/dwarf.c --- wine1.7-1.7.50/dlls/dbghelp/dwarf.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dbghelp/dwarf.c 2015-11-13 14:32:40.000000000 +0000 @@ -1843,6 +1843,9 @@ case DW_TAG_subroutine_type: dwarf2_parse_subroutine_type(subpgm->ctx, di); break; + case DW_TAG_const_type: + dwarf2_parse_const_type(subpgm->ctx, di); + break; case DW_TAG_lexical_block: dwarf2_parse_subprogram_block(subpgm, block, child); break; @@ -1975,6 +1978,9 @@ case DW_TAG_pointer_type: dwarf2_parse_pointer_type(subpgm.ctx, di); break; + case DW_TAG_const_type: + dwarf2_parse_const_type(subpgm.ctx, di); + break; case DW_TAG_subprogram: /* FIXME: likely a declaration (to be checked) * skip it for now diff -Nru wine1.7-1.7.50/dlls/dbghelp/macho_module.c wine1.7-1.7.55/dlls/dbghelp/macho_module.c --- wine1.7-1.7.50/dlls/dbghelp/macho_module.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dbghelp/macho_module.c 2015-11-13 14:32:40.000000000 +0000 @@ -58,6 +58,7 @@ #include #include #include +#include #ifdef HAVE_MACH_O_DYLD_IMAGES_H #include @@ -1301,6 +1302,57 @@ HeapFree(GetProcessHeap(), 0, modfmt); } + +/****************************************************************** + * get_dyld_image_info_address + */ +static ULONG_PTR get_dyld_image_info_address(struct process* pcs) +{ + NTSTATUS status; + PROCESS_BASIC_INFORMATION pbi; + ULONG_PTR dyld_image_info_address = 0; + + /* Get address of PEB */ + status = NtQueryInformationProcess(pcs->handle, ProcessBasicInformation, &pbi, sizeof(pbi), NULL); + if (status == STATUS_SUCCESS) + { + /* Read dyld image info address from PEB */ + if (ReadProcessMemory(pcs->handle, &pbi.PebBaseAddress->Reserved[0], + &dyld_image_info_address, sizeof(dyld_image_info_address), NULL)) + { + TRACE("got dyld_image_info_address 0x%08lx from PEB %p MacDyldImageInfo %p\n", + (unsigned long)dyld_image_info_address, pbi.PebBaseAddress, &pbi.PebBaseAddress->Reserved); + } + } + +#ifndef __LP64__ /* No reading the symtab with nlist(3) in LP64 */ + if (!dyld_image_info_address) + { + static void* dyld_all_image_infos_addr; + + /* Our next best guess is that dyld was loaded at its base address + and we can find the dyld image infos address by looking up its symbol. */ + if (!dyld_all_image_infos_addr) + { + struct nlist nl[2]; + memset(nl, 0, sizeof(nl)); + nl[0].n_un.n_name = (char*)"_dyld_all_image_infos"; + if (!nlist("/usr/lib/dyld", nl)) + dyld_all_image_infos_addr = (void*)nl[0].n_value; + } + + if (dyld_all_image_infos_addr) + { + TRACE("got dyld_image_info_address %p from /usr/lib/dyld symbol table\n", + dyld_all_image_infos_addr); + dyld_image_info_address = (ULONG_PTR)dyld_all_image_infos_addr; + } + } +#endif + + return dyld_image_info_address; +} + /****************************************************************** * macho_load_file * @@ -1328,54 +1380,8 @@ */ if (macho_info->flags & MACHO_INFO_DEBUG_HEADER) { - PROCESS_BASIC_INFORMATION pbi; - NTSTATUS status; - - ret = FALSE; - - /* Get address of PEB */ - status = NtQueryInformationProcess(pcs->handle, ProcessBasicInformation, - &pbi, sizeof(pbi), NULL); - if (status == STATUS_SUCCESS) - { - ULONG_PTR dyld_image_info; - - /* Read dyld image info address from PEB */ - if (ReadProcessMemory(pcs->handle, &pbi.PebBaseAddress->Reserved[0], - &dyld_image_info, sizeof(dyld_image_info), NULL)) - { - TRACE("got dyld_image_info 0x%08lx from PEB %p MacDyldImageInfo %p\n", - (unsigned long)dyld_image_info, pbi.PebBaseAddress, &pbi.PebBaseAddress->Reserved); - macho_info->dbg_hdr_addr = dyld_image_info; - ret = TRUE; - } - } - -#ifndef __LP64__ /* No reading the symtab with nlist(3) in LP64 */ - if (!ret) - { - static void* dyld_all_image_infos_addr; - - /* Our next best guess is that dyld was loaded at its base address - and we can find the dyld image infos address by looking up its symbol. */ - if (!dyld_all_image_infos_addr) - { - struct nlist nl[2]; - memset(nl, 0, sizeof(nl)); - nl[0].n_un.n_name = (char*)"_dyld_all_image_infos"; - if (!nlist("/usr/lib/dyld", nl)) - dyld_all_image_infos_addr = (void*)nl[0].n_value; - } - - if (dyld_all_image_infos_addr) - { - TRACE("got dyld_image_info %p from /usr/lib/dyld symbol table\n", - dyld_all_image_infos_addr); - macho_info->dbg_hdr_addr = (unsigned long)dyld_all_image_infos_addr; - ret = TRUE; - } - } -#endif + macho_info->dbg_hdr_addr = (unsigned long)get_dyld_image_info_address(pcs); + ret = TRUE; } if (macho_info->flags & MACHO_INFO_MODULE) @@ -1545,7 +1551,7 @@ if (strstrW(filename, S_libstdcPPW)) return FALSE; /* We know we can't do it */ - /* If has no directories, try LD_LIBRARY_PATH first. */ + /* If has no directories, try PATH first. */ if (!strchrW(filename, '/')) { ret = macho_load_file_from_path(pcs, filename, load_addr, @@ -1565,8 +1571,10 @@ /* Try DYLD_FALLBACK_LIBRARY_PATH, with just the filename (no directories). */ if (!ret) { - ret = macho_load_file_from_path(pcs, p, load_addr, - getenv("DYLD_FALLBACK_LIBRARY_PATH"), macho_info); + const char* fallback = getenv("DYLD_FALLBACK_LIBRARY_PATH"); + if (!fallback) + fallback = "/usr/local/lib:/lib:/usr/lib"; + ret = macho_load_file_from_path(pcs, p, load_addr, fallback, macho_info); } if (!ret && !strchrW(filename, '/')) ret = macho_load_file_from_dll_path(pcs, filename, load_addr, macho_info); @@ -1695,7 +1703,62 @@ */ static BOOL macho_search_loader(struct process* pcs, struct macho_info* macho_info) { - return macho_search_and_load_file(pcs, get_wine_loader_name(), 0, macho_info); + BOOL ret = FALSE; + ULONG_PTR dyld_image_info_address; + struct dyld_all_image_infos image_infos; + struct dyld_image_info image_info; + uint32_t len; + char path[PATH_MAX]; + BOOL got_path = FALSE; + + dyld_image_info_address = get_dyld_image_info_address(pcs); + if (dyld_image_info_address && + ReadProcessMemory(pcs->handle, (void*)dyld_image_info_address, &image_infos, sizeof(image_infos), NULL) && + image_infos.infoArray && image_infos.infoArrayCount && + ReadProcessMemory(pcs->handle, image_infos.infoArray, &image_info, sizeof(image_info), NULL) && + image_info.imageFilePath) + { + for (len = sizeof(path); len > 0; len /= 2) + { + if (ReadProcessMemory(pcs->handle, image_info.imageFilePath, path, len, NULL)) + { + path[len - 1] = 0; + got_path = TRUE; + TRACE("got executable path from target's dyld image info: %s\n", debugstr_a(path)); + break; + } + } + } + + /* If we couldn't get the executable path from the target process, try our + own. It will almost always be the same. */ + if (!got_path) + { + len = sizeof(path); + if (!_NSGetExecutablePath(path, &len)) + { + got_path = TRUE; + TRACE("using own executable path: %s\n", debugstr_a(path)); + } + } + + if (got_path) + { + WCHAR* pathW; + + len = MultiByteToWideChar(CP_UNIXCP, 0, path, -1, NULL, 0); + pathW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + if (pathW) + { + MultiByteToWideChar(CP_UNIXCP, 0, path, -1, pathW, len); + ret = macho_load_file(pcs, pathW, 0, macho_info); + HeapFree(GetProcessHeap(), 0, pathW); + } + } + + if (!ret) + ret = macho_search_and_load_file(pcs, get_wine_loader_name(), 0, macho_info); + return ret; } /****************************************************************** diff -Nru wine1.7-1.7.50/dlls/dbghelp/Makefile.in wine1.7-1.7.55/dlls/dbghelp/Makefile.in --- wine1.7-1.7.50/dlls/dbghelp/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dbghelp/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -1,6 +1,6 @@ MODULE = dbghelp.dll IMPORTLIB = dbghelp -EXTRADEFS = -D_IMAGEHLP_SOURCE_ -DDLLPREFIX='"$(DLLPREFIX)"' +EXTRADEFS = -D_IMAGEHLP_SOURCE_ IMPORTS = psapi DELAYIMPORTS = version EXTRALIBS = $(Z_LIBS) $(CORESERVICES_LIBS) $(COREFOUNDATION_LIBS) diff -Nru wine1.7-1.7.50/dlls/dbghelp/module.c wine1.7-1.7.55/dlls/dbghelp/module.c --- wine1.7-1.7.50/dlls/dbghelp/module.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dbghelp/module.c 2015-11-13 14:32:40.000000000 +0000 @@ -422,16 +422,6 @@ size_t len; struct module* module; PCWSTR filename, modname; - static WCHAR* dll_prefix; - static int dll_prefix_len; - - if (!dll_prefix) - { - dll_prefix_len = MultiByteToWideChar( CP_UNIXCP, 0, DLLPREFIX, -1, NULL, 0 ); - dll_prefix = HeapAlloc( GetProcessHeap(), 0, dll_prefix_len * sizeof(WCHAR) ); - MultiByteToWideChar( CP_UNIXCP, 0, DLLPREFIX, -1, dll_prefix, dll_prefix_len ); - dll_prefix_len--; - } if (!base) return FALSE; filename = get_filename(ImageName, NULL); @@ -444,7 +434,6 @@ base < module->module.BaseOfImage + module->module.ImageSize) { modname = get_filename(module->module.LoadedImageName, NULL); - if (dll_prefix_len && !strncmpW( modname, dll_prefix, dll_prefix_len )) modname += dll_prefix_len; if (!strncmpiW(modname, filename, len) && !memcmp(modname + len, S_DotSoW, 3 * sizeof(WCHAR))) { diff -Nru wine1.7-1.7.50/dlls/dbghelp/msc.c wine1.7-1.7.55/dlls/dbghelp/msc.c --- wine1.7-1.7.50/dlls/dbghelp/msc.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dbghelp/msc.c 2015-11-13 14:32:40.000000000 +0000 @@ -228,6 +228,31 @@ cv_basic_types[T_64PINT8] = &symt_new_pointer(module, cv_basic_types[T_INT8], 8)->symt; cv_basic_types[T_64PUINT8] = &symt_new_pointer(module, cv_basic_types[T_UINT8], 8)->symt; cv_basic_types[T_64PHRESULT]= &symt_new_pointer(module, cv_basic_types[T_HRESULT], 8)->symt; + + cv_basic_types[T_PVOID] = &symt_new_pointer(module, cv_basic_types[T_VOID], sizeof(void*))->symt; + cv_basic_types[T_PCHAR] = &symt_new_pointer(module, cv_basic_types[T_CHAR], sizeof(void*))->symt; + cv_basic_types[T_PSHORT] = &symt_new_pointer(module, cv_basic_types[T_SHORT], sizeof(void*))->symt; + cv_basic_types[T_PLONG] = &symt_new_pointer(module, cv_basic_types[T_LONG], sizeof(void*))->symt; + cv_basic_types[T_PQUAD] = &symt_new_pointer(module, cv_basic_types[T_QUAD], sizeof(void*))->symt; + cv_basic_types[T_PUCHAR] = &symt_new_pointer(module, cv_basic_types[T_UCHAR], sizeof(void*))->symt; + cv_basic_types[T_PUSHORT] = &symt_new_pointer(module, cv_basic_types[T_USHORT], sizeof(void*))->symt; + cv_basic_types[T_PULONG] = &symt_new_pointer(module, cv_basic_types[T_ULONG], sizeof(void*))->symt; + cv_basic_types[T_PUQUAD] = &symt_new_pointer(module, cv_basic_types[T_UQUAD], sizeof(void*))->symt; + cv_basic_types[T_PBOOL08] = &symt_new_pointer(module, cv_basic_types[T_BOOL08], sizeof(void*))->symt; + cv_basic_types[T_PBOOL16] = &symt_new_pointer(module, cv_basic_types[T_BOOL16], sizeof(void*))->symt; + cv_basic_types[T_PBOOL32] = &symt_new_pointer(module, cv_basic_types[T_BOOL32], sizeof(void*))->symt; + cv_basic_types[T_PBOOL64] = &symt_new_pointer(module, cv_basic_types[T_BOOL64], sizeof(void*))->symt; + cv_basic_types[T_PREAL32] = &symt_new_pointer(module, cv_basic_types[T_REAL32], sizeof(void*))->symt; + cv_basic_types[T_PREAL64] = &symt_new_pointer(module, cv_basic_types[T_REAL64], sizeof(void*))->symt; + cv_basic_types[T_PREAL80] = &symt_new_pointer(module, cv_basic_types[T_REAL80], sizeof(void*))->symt; + cv_basic_types[T_PRCHAR] = &symt_new_pointer(module, cv_basic_types[T_RCHAR], sizeof(void*))->symt; + cv_basic_types[T_PWCHAR] = &symt_new_pointer(module, cv_basic_types[T_WCHAR], sizeof(void*))->symt; + cv_basic_types[T_PINT2] = &symt_new_pointer(module, cv_basic_types[T_INT2], sizeof(void*))->symt; + cv_basic_types[T_PUINT2] = &symt_new_pointer(module, cv_basic_types[T_UINT2], sizeof(void*))->symt; + cv_basic_types[T_PINT4] = &symt_new_pointer(module, cv_basic_types[T_INT4], sizeof(void*))->symt; + cv_basic_types[T_PUINT4] = &symt_new_pointer(module, cv_basic_types[T_UINT4], sizeof(void*))->symt; + cv_basic_types[T_PINT8] = &symt_new_pointer(module, cv_basic_types[T_INT8], sizeof(void*))->symt; + cv_basic_types[T_PUINT8] = &symt_new_pointer(module, cv_basic_types[T_UINT8], sizeof(void*))->symt; } static int leaf_as_variant(VARIANT* v, const unsigned short int* leaf) @@ -1980,24 +2005,24 @@ break; /* the symbols we can safely ignore for now */ - case 0x112c: + case S_TRAMPOLINE: case S_FRAMEINFO_V2: case S_SECUCOOKIE_V3: case S_SECTINFO_V3: case S_SUBSECTINFO_V3: case S_ENTRYPOINT_V3: - case 0x113e: - case 0x1139: - case 0x1141: - case 0x1142: - case 0x1143: - case 0x1144: - case 0x114c: - case 0x114d: - case 0x114e: - case 0x1145: - case 0x115a: - case 0x1153: + case S_LOCAL_VS2013: + case S_CALLSITEINFO: + case S_DEFRANGE_REGISTER: + case S_DEFRANGE_FRAMEPOINTER_REL: + case S_DEFRANGE_SUBFIELD_REGISTER: + case S_FPOFF_VS2013: + case S_DEFRANGE_REGISTER_REL: + case S_BUILDINFO: + case S_INLINESITE: + case S_INLINESITE_END: + case S_FILESTATIC: + case S_CALLEES: TRACE("Unsupported symbol id %x\n", sym->generic.id); break; diff -Nru wine1.7-1.7.50/dlls/dbghelp/path.c wine1.7-1.7.55/dlls/dbghelp/path.c --- wine1.7-1.7.50/dlls/dbghelp/path.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dbghelp/path.c 2015-11-13 14:32:40.000000000 +0000 @@ -490,7 +490,13 @@ if ((mapping = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) != NULL) { IMAGE_NT_HEADERS* nth = RtlImageNtHeader(mapping); - + if (!nth) + { + UnmapViewOfFile(mapping); + CloseHandle(hMap); + CloseHandle(hFile); + return FALSE; + } matched++; timestamp = nth->FileHeader.TimeDateStamp; size = nth->OptionalHeader.SizeOfImage; diff -Nru wine1.7-1.7.50/dlls/dbghelp/version.rc wine1.7-1.7.55/dlls/dbghelp/version.rc --- wine1.7-1.7.50/dlls/dbghelp/version.rc 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dbghelp/version.rc 2015-11-13 14:32:40.000000000 +0000 @@ -18,9 +18,9 @@ #define WINE_FILEDESCRIPTION_STR "Wine Image Helper" #define WINE_FILENAME_STR "dbghelp.dll" -#define WINE_FILEVERSION 5,1,2600,3264 -#define WINE_FILEVERSION_STR "5.1.2600.3264" -#define WINE_PRODUCTVERSION 5,1,2600,3264 -#define WINE_PRODUCTVERSION_STR "5.1.2600.3264" +#define WINE_FILEVERSION 6,1,7601,17514 +#define WINE_FILEVERSION_STR "6.1.7601.17514" +#define WINE_PRODUCTVERSION 6,1,7601,17514 +#define WINE_PRODUCTVERSION_STR "6.1.7601.17514" #include "wine/wine_common_ver.rc" diff -Nru wine1.7-1.7.50/dlls/ddraw/ddraw.c wine1.7-1.7.55/dlls/ddraw/ddraw.c --- wine1.7-1.7.50/dlls/ddraw/ddraw.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ddraw/ddraw.c 2015-11-13 14:32:40.000000000 +0000 @@ -4712,17 +4712,17 @@ } static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent *device_parent, - void *container_parent, struct wined3d_surface *surface, + struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, struct wined3d_surface *surface, void **parent, const struct wined3d_parent_ops **parent_ops) { struct ddraw *ddraw = ddraw_from_device_parent(device_parent); struct ddraw_surface *ddraw_surface; - TRACE("device_parent %p, container_parent %p, surface %p, parent %p, parent_ops %p.\n", - device_parent, container_parent, surface, parent, parent_ops); + TRACE("device_parent %p, wined3d_texture %p, sub_resource_idx %u, surface %p, parent %p, parent_ops %p.\n", + device_parent, wined3d_texture, sub_resource_idx, surface, parent, parent_ops); /* We have a swapchain or wined3d internal texture. */ - if (!container_parent || container_parent == ddraw) + if (!wined3d_texture_get_parent(wined3d_texture) || wined3d_texture_get_parent(wined3d_texture) == ddraw) { *parent = NULL; *parent_ops = &ddraw_null_wined3d_parent_ops; @@ -4736,7 +4736,7 @@ return DDERR_OUTOFVIDEOMEMORY; } - ddraw_surface_init(ddraw_surface, ddraw, container_parent, surface, parent_ops); + ddraw_surface_init(ddraw_surface, ddraw, wined3d_texture_get_parent(wined3d_texture), surface, parent_ops); *parent = ddraw_surface; list_add_head(&ddraw->surface_list, &ddraw_surface->surface_list_entry); @@ -4746,11 +4746,11 @@ } static HRESULT CDECL device_parent_volume_created(struct wined3d_device_parent *device_parent, - void *container_parent, struct wined3d_volume *volume, + struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, void **parent, const struct wined3d_parent_ops **parent_ops) { - TRACE("device_parent %p, container_parent %p, volume %p, parent %p, parent_ops %p.\n", - device_parent, container_parent, volume, parent, parent_ops); + TRACE("device_parent %p, texture %p, sub_resource_idx %u, parent %p, parent_ops %p.\n", + device_parent, wined3d_texture, sub_resource_idx, parent, parent_ops); *parent = NULL; *parent_ops = &ddraw_null_wined3d_parent_ops; @@ -4769,16 +4769,14 @@ ddraw_frontbuffer_destroyed, }; -static HRESULT CDECL device_parent_create_swapchain_surface(struct wined3d_device_parent *device_parent, - void *container_parent, const struct wined3d_resource_desc *desc, struct wined3d_surface **surface) +static HRESULT CDECL device_parent_create_swapchain_texture(struct wined3d_device_parent *device_parent, + void *container_parent, const struct wined3d_resource_desc *desc, struct wined3d_texture **texture) { struct ddraw *ddraw = ddraw_from_device_parent(device_parent); - struct wined3d_resource_desc texture_desc; - struct wined3d_texture *texture; HRESULT hr; - TRACE("device_parent %p, container_parent %p, desc %p, surface %p.\n", - device_parent, container_parent, desc, surface); + TRACE("device_parent %p, container_parent %p, desc %p, texture %p.\n", + device_parent, container_parent, desc, texture); if (ddraw->wined3d_frontbuffer) { @@ -4786,19 +4784,14 @@ return E_FAIL; } - texture_desc = *desc; - texture_desc.resource_type = WINED3D_RTYPE_TEXTURE; - if (FAILED(hr = wined3d_texture_create(ddraw->wined3d_device, &texture_desc, 1, - WINED3D_SURFACE_MAPPABLE, NULL, ddraw, &ddraw_frontbuffer_parent_ops, &texture))) + if (FAILED(hr = wined3d_texture_create(ddraw->wined3d_device, desc, 1, + WINED3D_SURFACE_MAPPABLE, NULL, ddraw, &ddraw_frontbuffer_parent_ops, texture))) { WARN("Failed to create texture, hr %#x.\n", hr); return hr; } - *surface = wined3d_surface_from_resource(wined3d_texture_get_sub_resource(texture, 0)); - ddraw->wined3d_frontbuffer = *surface; - wined3d_surface_incref(*surface); - wined3d_texture_decref(texture); + ddraw->wined3d_frontbuffer = wined3d_surface_from_resource(wined3d_texture_get_sub_resource(*texture, 0)); return hr; } @@ -4831,7 +4824,7 @@ device_parent_activate, device_parent_surface_created, device_parent_volume_created, - device_parent_create_swapchain_surface, + device_parent_create_swapchain_texture, device_parent_create_swapchain, }; diff -Nru wine1.7-1.7.50/dlls/ddraw/ddraw_private.h wine1.7-1.7.55/dlls/ddraw/ddraw_private.h --- wine1.7-1.7.50/dlls/ddraw/ddraw_private.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ddraw/ddraw_private.h 2015-11-13 14:32:40.000000000 +0000 @@ -185,9 +185,6 @@ /* Surface description, for GetAttachedSurface */ DDSURFACEDESC2 surface_desc; - /* Misc things */ - UINT mipmap_level; - /* Clipper objects */ struct ddraw_clipper *clipper; struct ddraw_palette *palette; diff -Nru wine1.7-1.7.50/dlls/ddraw/main.c wine1.7-1.7.55/dlls/ddraw/main.c --- wine1.7-1.7.50/dlls/ddraw/main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ddraw/main.c 2015-11-13 14:32:40.000000000 +0000 @@ -48,7 +48,7 @@ }; /* Enumeration callback for converting DirectDrawEnumerateA to DirectDrawEnumerateExA */ -static HRESULT CALLBACK enum_callback(GUID *guid, char *description, char *driver_name, +static BOOL CALLBACK enum_callback(GUID *guid, char *description, char *driver_name, void *context, HMONITOR monitor) { const struct callback_info *info = context; diff -Nru wine1.7-1.7.50/dlls/ddraw/surface.c wine1.7-1.7.55/dlls/ddraw/surface.c --- wine1.7-1.7.50/dlls/ddraw/surface.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ddraw/surface.c 2015-11-13 14:32:40.000000000 +0000 @@ -777,7 +777,6 @@ */ TRACE("(%p): Returning surface %p\n", This, surf); - TRACE("(%p): mipmapcount=%d\n", This, surf->mipmap_level); *Surface = &surf->IDirectDrawSurface7_iface; ddraw_surface7_AddRef(*Surface); wined3d_mutex_unlock(); @@ -954,6 +953,7 @@ static HRESULT surface_lock(struct ddraw_surface *This, RECT *Rect, DDSURFACEDESC2 *DDSD, DWORD Flags, HANDLE h) { + struct wined3d_box box; struct wined3d_map_desc map_desc; HRESULT hr = DD_OK; @@ -985,12 +985,18 @@ wined3d_mutex_unlock(); return DDERR_INVALIDPARAMS; } + box.left = Rect->left; + box.top = Rect->top; + box.right = Rect->right; + box.bottom = Rect->bottom; + box.front = 0; + box.back = 1; } if (This->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) hr = ddraw_surface_update_frontbuffer(This, Rect, TRUE); if (SUCCEEDED(hr)) - hr = wined3d_surface_map(This->wined3d_surface, &map_desc, Rect, Flags); + hr = wined3d_surface_map(This->wined3d_surface, &map_desc, Rect ? &box : NULL, Flags); if (FAILED(hr)) { wined3d_mutex_unlock(); @@ -2945,18 +2951,16 @@ *****************************************************************************/ static HRESULT WINAPI ddraw_surface7_GetBltStatus(IDirectDrawSurface7 *iface, DWORD Flags) { - struct ddraw_surface *surface = impl_from_IDirectDrawSurface7(iface); - HRESULT hr; - TRACE("iface %p, flags %#x.\n", iface, Flags); - wined3d_mutex_lock(); - hr = wined3d_surface_get_blt_status(surface->wined3d_surface, Flags); - wined3d_mutex_unlock(); - switch(hr) + switch (Flags) { - case WINED3DERR_INVALIDCALL: return DDERR_INVALIDPARAMS; - default: return hr; + case WINEDDGBS_CANBLT: + case WINEDDGBS_ISBLTDONE: + return DD_OK; + + default: + return DDERR_INVALIDPARAMS; } } @@ -3119,19 +3123,18 @@ *****************************************************************************/ static HRESULT WINAPI ddraw_surface7_GetFlipStatus(IDirectDrawSurface7 *iface, DWORD Flags) { - struct ddraw_surface *surface = impl_from_IDirectDrawSurface7(iface); - HRESULT hr; - TRACE("iface %p, flags %#x.\n", iface, Flags); - wined3d_mutex_lock(); - hr = wined3d_surface_get_flip_status(surface->wined3d_surface, Flags); - wined3d_mutex_unlock(); + /* XXX: DDERR_INVALIDSURFACETYPE */ - switch(hr) + switch (Flags) { - case WINED3DERR_INVALIDCALL: return DDERR_INVALIDPARAMS; - default: return hr; + case WINEDDGFS_CANFLIP: + case WINEDDGFS_ISFLIPDONE: + return DD_OK; + + default: + return DDERR_INVALIDPARAMS; } } @@ -4641,15 +4644,21 @@ DDCOLORKEY fixed_color_key; HRESULT hr = WINED3D_OK; + if (flags & DDCKEY_COLORSPACE) + { + if (color_key && color_key->dwColorSpaceLowValue != color_key->dwColorSpaceHighValue) + { + WARN("Range color keys are not supported, returning DDERR_NOCOLORKEYHW.\n"); + return DDERR_NOCOLORKEYHW; + } + flags &= ~DDCKEY_COLORSPACE; + } + wined3d_mutex_lock(); if (color_key) { - fixed_color_key = *color_key; - /* Handle case where dwColorSpaceHighValue < dwColorSpaceLowValue */ - if (fixed_color_key.dwColorSpaceHighValue < fixed_color_key.dwColorSpaceLowValue) - fixed_color_key.dwColorSpaceHighValue = fixed_color_key.dwColorSpaceLowValue; - + fixed_color_key.dwColorSpaceLowValue = fixed_color_key.dwColorSpaceHighValue = color_key->dwColorSpaceLowValue; switch (flags & ~DDCKEY_COLORSPACE) { case DDCKEY_DESTBLT: @@ -5098,8 +5107,7 @@ struct ddraw_palette *dst_pal, *src_pal; DDSURFACEDESC *src_desc, *dst_desc; - TRACE("Copying surface %p to surface %p (mipmap level %d).\n", - src_surface, dst_surface, src_surface->mipmap_level); + TRACE("Copying surface %p to surface %p.\n", src_surface, dst_surface); /* Suppress the ALLOCONLOAD flag */ dst_surface->surface_desc.ddsCaps.dwCaps &= ~DDSCAPS_ALLOCONLOAD; @@ -6027,6 +6035,20 @@ } } + if (((desc->dwFlags & DDSD_CKDESTOVERLAY) + && desc->u3.ddckCKDestOverlay.dwColorSpaceLowValue != desc->u3.ddckCKDestOverlay.dwColorSpaceHighValue) + || ((desc->dwFlags & DDSD_CKDESTBLT) + && desc->ddckCKDestBlt.dwColorSpaceLowValue != desc->ddckCKDestBlt.dwColorSpaceHighValue) + || ((desc->dwFlags & DDSD_CKSRCOVERLAY) + && desc->ddckCKSrcOverlay.dwColorSpaceLowValue != desc->ddckCKSrcOverlay.dwColorSpaceHighValue) + || ((desc->dwFlags & DDSD_CKSRCBLT) + && desc->ddckCKSrcBlt.dwColorSpaceLowValue != desc->ddckCKSrcBlt.dwColorSpaceHighValue)) + { + WARN("Range color keys not supported, returning DDERR_NOCOLORKEYHW.\n"); + HeapFree(GetProcessHeap(), 0, texture); + return DDERR_NOCOLORKEYHW; + } + if (desc->ddsCaps.dwCaps & (DDSCAPS_OVERLAY)) wined3d_desc.usage |= WINED3DUSAGE_OVERLAY; diff -Nru wine1.7-1.7.50/dlls/ddraw/tests/ddraw1.c wine1.7-1.7.55/dlls/ddraw/tests/ddraw1.c --- wine1.7-1.7.50/dlls/ddraw/tests/ddraw1.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ddraw/tests/ddraw1.c 2015-11-13 14:32:40.000000000 +0000 @@ -5492,6 +5492,7 @@ if (!(device = create_device(ddraw, window, DDSCL_NORMAL))) { skip("Failed to create a 3D device, skipping test.\n"); + IDirectDraw_Release(ddraw); DestroyWindow(window); return; } @@ -7279,6 +7280,598 @@ DestroyWindow(window); } +static void test_colorkey_precision(void) +{ + static D3DTLVERTEX quad[] = + { + {{ 0.0f}, {480.0f}, {0.0f}, {1.0f}, {0x00000000}, {0x00000000}, {0.0f}, {1.0f}}, + {{ 0.0f}, { 0.0f}, {0.0f}, {1.0f}, {0x00000000}, {0x00000000}, {0.0f}, {0.0f}}, + {{640.0f}, {480.0f}, {0.0f}, {1.0f}, {0x00000000}, {0x00000000}, {1.0f}, {1.0f}}, + {{640.0f}, { 0.0f}, {0.0f}, {1.0f}, {0x00000000}, {0x00000000}, {1.0f}, {0.0f}}, + }; + static D3DRECT clear_rect = {{0}, {0}, {640}, {480}}; + IDirect3DDevice *device; + IDirectDraw *ddraw; + IDirectDrawSurface *rt; + IDirect3DViewport *viewport; + IDirect3DExecuteBuffer *execute_buffer; + D3DEXECUTEBUFFERDESC exec_desc; + UINT inst_length; + void *ptr; + HWND window; + HRESULT hr; + IDirectDrawSurface *src, *dst, *texture; + D3DTEXTUREHANDLE handle; + IDirect3DTexture *d3d_texture; + IDirect3DMaterial *green; + DDSURFACEDESC surface_desc, lock_desc; + ULONG refcount; + D3DCOLOR color; + unsigned int t, c; + DDCOLORKEY ckey; + DDBLTFX fx; + DWORD data[4] = {0}, color_mask; + D3DDEVICEDESC device_desc, hel_desc; + BOOL warp; + static const struct + { + unsigned int max, shift, bpp, clear; + const char *name; + DDPIXELFORMAT fmt; + } + tests[] = + { + { + 255, 0, 4, 0x00345678, "D3DFMT_X8R8G8B8", + { + sizeof(DDPIXELFORMAT), DDPF_RGB, 0, + {32}, {0x00ff0000}, {0x0000ff00}, {0x000000ff}, {0x00000000} + } + + }, + { + 63, 5, 2, 0x5678, "D3DFMT_R5G6B5, G channel", + { + sizeof(DDPIXELFORMAT), DDPF_RGB, 0, + {16}, {0xf800}, {0x07e0}, {0x001f}, {0x0000} + } + + }, + { + 31, 0, 2, 0x5678, "D3DFMT_R5G6B5, B channel", + { + sizeof(DDPIXELFORMAT), DDPF_RGB, 0, + {16}, {0xf800}, {0x07e0}, {0x001f}, {0x0000} + } + + }, + { + 15, 0, 2, 0x0678, "D3DFMT_A4R4G4B4", + { + sizeof(DDPIXELFORMAT), DDPF_RGB | DDPF_ALPHAPIXELS, 0, + {16}, {0x0f00}, {0x00f0}, {0x000f}, {0xf000} + } + + }, + }; + + 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"); + DestroyWindow(window); + IDirectDraw_Release(ddraw); + return; + } + hr = IDirect3DDevice_QueryInterface(device, &IID_IDirectDrawSurface, (void **)&rt); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + + /* The Windows 8 WARP driver has plenty of false negatives in X8R8G8B8 + * (color key doesn't match although the values are equal), and a false + * positive when the color key is 0 and the texture contains the value 1. + * I don't want to mark this broken unconditionally since this would + * essentially disable the test on Windows. Try to detect WARP (and I + * guess mismatch other SW renderers) by its ability to texture from + * system memory. Also on random occasions 254 == 255 and 255 != 255.*/ + memset(&device_desc, 0, sizeof(device_desc)); + device_desc.dwSize = sizeof(device_desc); + memset(&hel_desc, 0, sizeof(hel_desc)); + hel_desc.dwSize = sizeof(hel_desc); + hr = IDirect3DDevice_GetCaps(device, &device_desc, &hel_desc); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + warp = !!(device_desc.dwDevCaps & D3DDEVCAPS_TEXTURESYSTEMMEMORY); + + green = create_diffuse_material(device, 0.0f, 1.0f, 0.0f, 0.0f); + viewport = create_viewport(device, 0, 0, 640, 480); + viewport_set_background(device, viewport, green); + + memset(&exec_desc, 0, sizeof(exec_desc)); + exec_desc.dwSize = sizeof(exec_desc); + exec_desc.dwFlags = D3DDEB_BUFSIZE | D3DDEB_CAPS; + exec_desc.dwBufferSize = 1024; + exec_desc.dwCaps = D3DDEBCAPS_SYSTEMMEMORY; + hr = IDirect3DDevice_CreateExecuteBuffer(device, &exec_desc, &execute_buffer, NULL); + ok(SUCCEEDED(hr), "Failed to create execute buffer, hr %#x.\n", hr); + + memset(&fx, 0, sizeof(fx)); + fx.dwSize = sizeof(fx); + memset(&lock_desc, 0, sizeof(lock_desc)); + lock_desc.dwSize = sizeof(lock_desc); + + for (t = 0; t < sizeof(tests) / sizeof(*tests); ++t) + { + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + surface_desc.dwWidth = 4; + surface_desc.dwHeight = 1; + surface_desc.ddpfPixelFormat = tests[t].fmt; + /* Windows XP (at least with the r200 driver, other drivers untested) produces + * garbage when doing color keyed texture->texture blits. */ + hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &src, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &dst, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + fx.dwFillColor = tests[t].clear; + /* On the w8 testbot (WARP driver) the blit result has different values in the + * X channel. */ + color_mask = U2(tests[t].fmt).dwRBitMask + | U3(tests[t].fmt).dwGBitMask + | U4(tests[t].fmt).dwBBitMask; + + for (c = 0; c <= tests[t].max; ++c) + { + /* The idiotic Nvidia Windows driver can't change the color key on a d3d + * texture after it has been set once... */ + surface_desc.dwFlags |= DDSD_CKSRCBLT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE; + surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = c << tests[t].shift; + surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = c << tests[t].shift; + hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &texture, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface_QueryInterface(texture, &IID_IDirect3DTexture, (void **)&d3d_texture); + ok(SUCCEEDED(hr), "Failed to get texture interface, hr %#x.\n", hr); + hr = IDirect3DTexture_GetHandle(d3d_texture, device, &handle); + ok(SUCCEEDED(hr), "Failed to get texture handle, hr %#x.\n", hr); + IDirect3DTexture_Release(d3d_texture); + + hr = IDirect3DExecuteBuffer_Lock(execute_buffer, &exec_desc); + ok(SUCCEEDED(hr), "Failed to lock execute buffer, hr %#x.\n", hr); + + memcpy(exec_desc.lpData, quad, sizeof(quad)); + + ptr = ((BYTE *)exec_desc.lpData) + sizeof(quad); + emit_process_vertices(&ptr, D3DPROCESSVERTICES_COPY, 0, 8); + emit_set_rs(&ptr, D3DRENDERSTATE_ZENABLE, D3DZB_FALSE); + emit_set_rs(&ptr, D3DRENDERSTATE_TEXTUREHANDLE, handle); + emit_set_rs(&ptr, D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_MODULATEALPHA); + /* D3DRENDERSTATE_COLORKEYENABLE is supposed to be on by default on version + * 1 devices, but for some reason it randomly defaults to FALSE on the W8 + * testbot. This is either the fault of Windows 8 or the WARP driver. + * Also D3DRENDERSTATE_COLORKEYENABLE was introduced in D3D 5 aka version 2 + * devices only, which might imply this doesn't actually do anything on + * WARP. */ + emit_set_rs(&ptr, D3DRENDERSTATE_COLORKEYENABLE, TRUE); + + emit_tquad(&ptr, 0); + emit_tquad(&ptr, 4); + emit_set_rs(&ptr, D3DRENDERSTATE_TEXTUREHANDLE, 0); + emit_end(&ptr); + + inst_length = (BYTE *)ptr - (BYTE *)exec_desc.lpData; + inst_length -= sizeof(quad); + hr = IDirect3DExecuteBuffer_Unlock(execute_buffer); + ok(SUCCEEDED(hr), "Failed to unlock execute buffer, hr %#x.\n", hr); + set_execute_data(execute_buffer, 8, sizeof(quad), inst_length); + + hr = IDirectDrawSurface_Blt(dst, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); + ok(SUCCEEDED(hr), "Failed to clear destination surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface_Lock(src, NULL, &lock_desc, DDLOCK_WAIT, NULL); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + switch (tests[t].bpp) + { + case 4: + ((DWORD *)lock_desc.lpSurface)[0] = (c ? c - 1 : 0) << tests[t].shift; + ((DWORD *)lock_desc.lpSurface)[1] = c << tests[t].shift; + ((DWORD *)lock_desc.lpSurface)[2] = min(c + 1, tests[t].max) << tests[t].shift; + ((DWORD *)lock_desc.lpSurface)[3] = 0xffffffff; + break; + + case 2: + ((WORD *)lock_desc.lpSurface)[0] = (c ? c - 1 : 0) << tests[t].shift; + ((WORD *)lock_desc.lpSurface)[1] = c << tests[t].shift; + ((WORD *)lock_desc.lpSurface)[2] = min(c + 1, tests[t].max) << tests[t].shift; + ((WORD *)lock_desc.lpSurface)[3] = 0xffff; + break; + } + hr = IDirectDrawSurface_Unlock(src, 0); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + hr = IDirectDrawSurface_Blt(texture, NULL, src, NULL, DDBLT_WAIT, NULL); + ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + + ckey.dwColorSpaceLowValue = c << tests[t].shift; + ckey.dwColorSpaceHighValue = c << tests[t].shift; + hr = IDirectDrawSurface_SetColorKey(src, DDCKEY_SRCBLT, &ckey); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + + hr = IDirectDrawSurface_Blt(dst, NULL, src, NULL, DDBLT_KEYSRC | DDBLT_WAIT, NULL); + ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + + /* Don't make this read only, it somehow breaks the detection of the Nvidia bug below. */ + hr = IDirectDrawSurface_Lock(dst, NULL, &lock_desc, DDLOCK_WAIT, NULL); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + switch (tests[t].bpp) + { + case 4: + data[0] = ((DWORD *)lock_desc.lpSurface)[0] & color_mask; + data[1] = ((DWORD *)lock_desc.lpSurface)[1] & color_mask; + data[2] = ((DWORD *)lock_desc.lpSurface)[2] & color_mask; + data[3] = ((DWORD *)lock_desc.lpSurface)[3] & color_mask; + break; + + case 2: + data[0] = ((WORD *)lock_desc.lpSurface)[0] & color_mask; + data[1] = ((WORD *)lock_desc.lpSurface)[1] & color_mask; + data[2] = ((WORD *)lock_desc.lpSurface)[2] & color_mask; + data[3] = ((WORD *)lock_desc.lpSurface)[3] & color_mask; + break; + } + hr = IDirectDrawSurface_Unlock(dst, 0); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + + if (!c) + { + ok(data[0] == tests[t].clear, "Expected surface content %#x, got %#x, format %s, c=%u.\n", + tests[t].clear, data[0], tests[t].name, c); + + if (data[3] == tests[t].clear) + { + /* My Geforce GTX 460 on Windows 7 misbehaves when A4R4G4B4 is blitted with color + * keying: The blit takes ~0.5 seconds, and subsequent color keying draws are broken, + * even when a different surface is used. The blit itself doesn't draw anything, + * so we can detect the bug by looking at the otherwise unused 4th texel. It should + * never be masked out by the key. + * + * Also appears to affect the testbot in some way with R5G6B5. Color keying is + * terrible on WARP. */ + skip("Nvidia A4R4G4B4 color keying blit bug detected, skipping.\n"); + IDirectDrawSurface_Release(texture); + IDirectDrawSurface_Release(src); + IDirectDrawSurface_Release(dst); + goto done; + } + } + else + ok(data[0] == (c - 1) << tests[t].shift, "Expected surface content %#x, got %#x, format %s, c=%u.\n", + (c - 1) << tests[t].shift, data[0], tests[t].name, c); + + ok(data[1] == tests[t].clear, "Expected surface content %#x, got %#x, format %s, c=%u.\n", + tests[t].clear, data[1], tests[t].name, c); + + if (c == tests[t].max) + ok(data[2] == tests[t].clear, "Expected surface content %#x, got %#x, format %s, c=%u.\n", + tests[t].clear, data[2], tests[t].name, c); + else + ok(data[2] == (c + 1) << tests[t].shift, "Expected surface content %#x, got %#x, format %s, c=%u.\n", + (c + 1) << tests[t].shift, data[2], tests[t].name, c); + + hr = IDirect3DViewport_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + + hr = IDirect3DDevice_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice_Execute(device, execute_buffer, viewport, D3DEXECUTE_UNCLIPPED); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + + color = get_surface_color(rt, 80, 240); + if (!c) + ok(compare_color(color, 0x0000ff00, 1) || broken(warp && compare_color(color, 0x00000000, 1)), + "Got unexpected color 0x%08x, format %s, c=%u.\n", + color, tests[t].name, c); + else + ok(compare_color(color, 0x00000000, 1) || broken(warp && compare_color(color, 0x0000ff00, 1)), + "Got unexpected color 0x%08x, format %s, c=%u.\n", + color, tests[t].name, c); + + color = get_surface_color(rt, 240, 240); + ok(compare_color(color, 0x0000ff00, 1) || broken(warp && compare_color(color, 0x00000000, 1)), + "Got unexpected color 0x%08x, format %s, c=%u.\n", + color, tests[t].name, c); + + color = get_surface_color(rt, 400, 240); + if (c == tests[t].max) + ok(compare_color(color, 0x0000ff00, 1) || broken(warp && compare_color(color, 0x00000000, 1)), + "Got unexpected color 0x%08x, format %s, c=%u.\n", + color, tests[t].name, c); + else + ok(compare_color(color, 0x00000000, 1) || broken(warp && compare_color(color, 0x0000ff00, 1)), + "Got unexpected color 0x%08x, format %s, c=%u.\n", + color, tests[t].name, c); + + IDirectDrawSurface_Release(texture); + } + IDirectDrawSurface_Release(src); + IDirectDrawSurface_Release(dst); + } +done: + + destroy_viewport(device, viewport); + destroy_material(green); + IDirectDrawSurface_Release(rt); + IDirect3DExecuteBuffer_Release(execute_buffer); + IDirect3DDevice_Release(device); + refcount = IDirectDraw_Release(ddraw); + ok(refcount == 0, "Ddraw object not properly released, refcount %u.\n", refcount); + DestroyWindow(window); +} + +static void test_range_colorkey(void) +{ + IDirectDraw *ddraw; + HWND window; + HRESULT hr; + IDirectDrawSurface *surface; + DDSURFACEDESC surface_desc; + ULONG refcount; + DDCOLORKEY ckey; + + window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, 0, 0, 0, 0); + ddraw = create_ddraw(); + ok(!!ddraw, "Failed to create a ddraw object.\n"); + hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | DDSD_CKSRCBLT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE; + surface_desc.dwWidth = 1; + surface_desc.dwHeight = 1; + surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB; + U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32; + U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000; + U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00; + U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff; + U5(surface_desc.ddpfPixelFormat).dwRGBAlphaBitMask = 0x00000000; + + /* Creating a surface with a range color key fails with DDERR_NOCOLORKEY. */ + surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000000; + surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000001; + hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + + surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000001; + surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000000; + hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + + /* Same for DDSCAPS_OFFSCREENPLAIN. */ + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000000; + surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000001; + hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + + surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000001; + surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000000; + hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + + surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000000; + surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000000; + hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + /* Setting a range color key without DDCKEY_COLORSPACE collapses the key. */ + ckey.dwColorSpaceLowValue = 0x00000000; + ckey.dwColorSpaceHighValue = 0x00000001; + hr = IDirectDrawSurface_SetColorKey(surface, DDCKEY_SRCBLT, &ckey); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + + hr = IDirectDrawSurface_GetColorKey(surface, DDCKEY_SRCBLT, &ckey); + ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr); + ok(!ckey.dwColorSpaceLowValue, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceLowValue); + ok(!ckey.dwColorSpaceHighValue, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceHighValue); + + ckey.dwColorSpaceLowValue = 0x00000001; + ckey.dwColorSpaceHighValue = 0x00000000; + hr = IDirectDrawSurface_SetColorKey(surface, DDCKEY_SRCBLT, &ckey); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + + hr = IDirectDrawSurface_GetColorKey(surface, DDCKEY_SRCBLT, &ckey); + ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr); + ok(ckey.dwColorSpaceLowValue == 0x00000001, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceLowValue); + ok(ckey.dwColorSpaceHighValue == 0x00000001, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceHighValue); + + /* DDCKEY_COLORSPACE is ignored if the key is a single value. */ + ckey.dwColorSpaceLowValue = 0x00000000; + ckey.dwColorSpaceHighValue = 0x00000000; + hr = IDirectDrawSurface_SetColorKey(surface, DDCKEY_SRCBLT | DDCKEY_COLORSPACE, &ckey); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + + /* Using it with a range key results in DDERR_NOCOLORKEYHW. */ + ckey.dwColorSpaceLowValue = 0x00000001; + ckey.dwColorSpaceHighValue = 0x00000000; + hr = IDirectDrawSurface_SetColorKey(surface, DDCKEY_SRCBLT | DDCKEY_COLORSPACE, &ckey); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + ckey.dwColorSpaceLowValue = 0x00000000; + ckey.dwColorSpaceHighValue = 0x00000001; + hr = IDirectDrawSurface_SetColorKey(surface, DDCKEY_SRCBLT | DDCKEY_COLORSPACE, &ckey); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + /* Range destination keys don't work either. */ + hr = IDirectDrawSurface_SetColorKey(surface, DDCKEY_DESTBLT | DDCKEY_COLORSPACE, &ckey); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + + /* Just to show it's not because of A, R, and G having equal values. */ + ckey.dwColorSpaceLowValue = 0x00000000; + ckey.dwColorSpaceHighValue = 0x01010101; + hr = IDirectDrawSurface_SetColorKey(surface, DDCKEY_SRCBLT | DDCKEY_COLORSPACE, &ckey); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + + /* None of these operations modified the key. */ + hr = IDirectDrawSurface_GetColorKey(surface, DDCKEY_SRCBLT, &ckey); + ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr); + ok(!ckey.dwColorSpaceLowValue, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceLowValue); + ok(!ckey.dwColorSpaceHighValue, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceHighValue); + + IDirectDrawSurface_Release(surface), + refcount = IDirectDraw_Release(ddraw); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + DestroyWindow(window); +} + +static void test_shademode(void) +{ + static D3DRECT clear_rect = {{0}, {0}, {640}, {480}}; + IDirect3DExecuteBuffer *execute_buffer; + D3DEXECUTEBUFFERDESC exec_desc; + IDirect3DMaterial *background; + IDirect3DViewport *viewport; + IDirect3DDevice *device; + IDirectDrawSurface *rt; + const D3DLVERTEX *quad; + DWORD color0, color1; + UINT i, inst_length; + IDirectDraw *ddraw; + IDirect3D *d3d; + ULONG refcount; + HWND window; + HRESULT hr; + void *ptr; + static const D3DLVERTEX quad_strip[] = + { + {{-1.0f}, {-1.0f}, {0.0f}, 0, {0xffff0000}}, + {{-1.0f}, { 1.0f}, {0.0f}, 0, {0xff00ff00}}, + {{ 1.0f}, {-1.0f}, {0.0f}, 0, {0xff0000ff}}, + {{ 1.0f}, { 1.0f}, {0.0f}, 0, {0xffffffff}}, + }, + quad_list[] = + { + {{ 1.0f}, {-1.0f}, {0.0f}, 0, {0xff0000ff}}, + {{-1.0f}, {-1.0f}, {0.0f}, 0, {0xffff0000}}, + {{-1.0f}, { 1.0f}, {0.0f}, 0, {0xff00ff00}}, + {{ 1.0f}, { 1.0f}, {0.0f}, 0, {0xffffffff}}, + }; + static const struct + { + DWORD primtype; + DWORD shademode; + DWORD color0, color1; + } + tests[] = + { + {D3DPT_TRIANGLESTRIP, D3DSHADE_FLAT, 0x00ff0000, 0x000000ff}, + {D3DPT_TRIANGLESTRIP, D3DSHADE_PHONG, 0x000dca28, 0x000d45c7}, + {D3DPT_TRIANGLESTRIP, D3DSHADE_GOURAUD, 0x000dca28, 0x000d45c7}, + {D3DPT_TRIANGLESTRIP, D3DSHADE_PHONG, 0x000dca28, 0x000d45c7}, + {D3DPT_TRIANGLELIST, D3DSHADE_FLAT, 0x000000ff, 0x0000ff00}, + {D3DPT_TRIANGLELIST, D3DSHADE_GOURAUD, 0x000dca28, 0x000d45c7}, + }; + + 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_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); + + background = create_diffuse_material(device, 1.0f, 1.0f, 1.0f, 1.0f); + viewport = create_viewport(device, 0, 0, 640, 480); + viewport_set_background(device, viewport, background); + + memset(&exec_desc, 0, sizeof(exec_desc)); + exec_desc.dwSize = sizeof(exec_desc); + exec_desc.dwFlags = D3DDEB_BUFSIZE | D3DDEB_CAPS; + exec_desc.dwBufferSize = 1024; + exec_desc.dwCaps = D3DDEBCAPS_SYSTEMMEMORY; + + hr = IDirect3DDevice_CreateExecuteBuffer(device, &exec_desc, &execute_buffer, NULL); + ok(SUCCEEDED(hr), "Failed to create execute buffer, hr %#x.\n", hr); + + /* Try it first with a TRIANGLESTRIP. Do it with different geometry because + * the color fixups we have to do for FLAT shading will be dependent on that. */ + + for (i = 0; i < sizeof(tests) / sizeof(tests[0]); ++i) + { + hr = IDirect3DViewport_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + + hr = IDirect3DExecuteBuffer_Lock(execute_buffer, &exec_desc); + ok(SUCCEEDED(hr), "Failed to lock execute buffer, hr %#x.\n", hr); + + quad = tests[i].primtype == D3DPT_TRIANGLESTRIP ? quad_strip : quad_list; + memcpy(exec_desc.lpData, quad, sizeof(quad_strip)); + ptr = ((BYTE *)exec_desc.lpData) + sizeof(quad_strip); + emit_set_rs(&ptr, D3DRENDERSTATE_CLIPPING, FALSE); + emit_set_rs(&ptr, D3DRENDERSTATE_ZENABLE, FALSE); + emit_set_rs(&ptr, D3DRENDERSTATE_FOGENABLE, FALSE); + emit_set_rs(&ptr, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE); + emit_set_rs(&ptr, D3DRENDERSTATE_SHADEMODE, tests[i].shademode); + + emit_process_vertices(&ptr, D3DPROCESSVERTICES_TRANSFORM, 0, 4); + if (tests[i].primtype == D3DPT_TRIANGLESTRIP) + emit_tquad(&ptr, 0); + else + emit_tquad_tlist(&ptr, 0); + emit_end(&ptr); + inst_length = (BYTE *)ptr - (BYTE *)exec_desc.lpData; + inst_length -= sizeof(quad_strip); + + hr = IDirect3DExecuteBuffer_Unlock(execute_buffer); + ok(SUCCEEDED(hr), "Failed to unlock execute buffer, hr %#x.\n", hr); + + hr = IDirect3DDevice2_BeginScene(device); + set_execute_data(execute_buffer, 4, sizeof(quad_strip), inst_length); + hr = IDirect3DDevice_Execute(device, execute_buffer, viewport, D3DEXECUTE_CLIPPED); + ok(SUCCEEDED(hr), "Failed to execute exec buffer, hr %#x.\n", hr); + hr = IDirect3DDevice2_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + + color0 = get_surface_color(rt, 100, 100); /* Inside first triangle */ + color1 = get_surface_color(rt, 500, 350); /* Inside second triangle */ + + /* For D3DSHADE_FLAT it should take the color of the first vertex of + * each triangle. This requires EXT_provoking_vertex or similar + * functionality being available. */ + /* PHONG should be the same as GOURAUD, since no hardware implements + * this. */ + ok(color0 == tests[i].color0, "Test %u shading has color0 %08x, expected %08x.\n", + i, color0, tests[i].color0); + ok(color1 == tests[i].color1, "Test %u shading has color1 %08x, expected %08x.\n", + i, color1, tests[i].color1); + } + + IDirect3DExecuteBuffer_Release(execute_buffer); + 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); + DestroyWindow(window); +} + START_TEST(ddraw1) { IDirectDraw *ddraw; @@ -7348,4 +7941,7 @@ test_texturemapblend(); test_viewport_clear_rect(); test_color_fill(); + test_colorkey_precision(); + test_range_colorkey(); + test_shademode(); } diff -Nru wine1.7-1.7.50/dlls/ddraw/tests/ddraw2.c wine1.7-1.7.55/dlls/ddraw/tests/ddraw2.c --- wine1.7-1.7.50/dlls/ddraw/tests/ddraw2.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ddraw/tests/ddraw2.c 2015-11-13 14:32:40.000000000 +0000 @@ -8435,6 +8435,547 @@ DestroyWindow(window); } +static void test_colorkey_precision(void) +{ + static D3DLVERTEX quad[] = + { + {{-1.0f}, {-1.0f}, {0.0f}, 0, {0xff000000}, {0}, {0.0f}, {0.0f}}, + {{-1.0f}, { 1.0f}, {0.0f}, 0, {0xff000000}, {0}, {0.0f}, {1.0f}}, + {{ 1.0f}, {-1.0f}, {0.0f}, 0, {0xff000000}, {0}, {1.0f}, {0.0f}}, + {{ 1.0f}, { 1.0f}, {0.0f}, 0, {0xff000000}, {0}, {1.0f}, {1.0f}}, + }; + static D3DRECT clear_rect = {{0}, {0}, {640}, {480}}; + IDirect3DDevice2 *device; + IDirectDraw2 *ddraw; + IDirectDrawSurface *rt; + IDirect3DViewport2 *viewport; + HWND window; + HRESULT hr; + IDirectDrawSurface *src, *dst, *texture; + D3DTEXTUREHANDLE handle; + IDirect3DTexture2 *d3d_texture; + IDirect3DMaterial2 *green; + DDSURFACEDESC surface_desc, lock_desc; + ULONG refcount; + D3DCOLOR color; + unsigned int t, c; + DDCOLORKEY ckey; + DDBLTFX fx; + DWORD data[4] = {0}, color_mask; + D3DDEVICEDESC device_desc, hel_desc; + BOOL warp; + static const struct + { + unsigned int max, shift, bpp, clear; + const char *name; + DDPIXELFORMAT fmt; + } + tests[] = + { + { + 255, 0, 4, 0x00345678, "D3DFMT_X8R8G8B8", + { + sizeof(DDPIXELFORMAT), DDPF_RGB, 0, + {32}, {0x00ff0000}, {0x0000ff00}, {0x000000ff}, {0x00000000} + } + + }, + { + 63, 5, 2, 0x5678, "D3DFMT_R5G6B5, G channel", + { + sizeof(DDPIXELFORMAT), DDPF_RGB, 0, + {16}, {0xf800}, {0x07e0}, {0x001f}, {0x0000} + } + + }, + { + 31, 0, 2, 0x5678, "D3DFMT_R5G6B5, B channel", + { + sizeof(DDPIXELFORMAT), DDPF_RGB, 0, + {16}, {0xf800}, {0x07e0}, {0x001f}, {0x0000} + } + + }, + { + 15, 0, 2, 0x0678, "D3DFMT_A4R4G4B4", + { + sizeof(DDPIXELFORMAT), DDPF_RGB | DDPF_ALPHAPIXELS, 0, + {16}, {0x0f00}, {0x00f0}, {0x000f}, {0xf000} + } + + }, + }; + + 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"); + DestroyWindow(window); + IDirectDraw2_Release(ddraw); + return; + } + hr = IDirect3DDevice2_GetRenderTarget(device, &rt); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + + /* The Windows 8 WARP driver has plenty of false negatives in X8R8G8B8 + * (color key doesn't match although the values are equal), and a false + * positive when the color key is 0 and the texture contains the value 1. + * I don't want to mark this broken unconditionally since this would + * essentially disable the test on Windows. Try to detect WARP (and I + * guess mismatch other SW renderers) by its ability to texture from + * system memory. Also on random occasions 254 == 255 and 255 != 255.*/ + memset(&device_desc, 0, sizeof(device_desc)); + device_desc.dwSize = sizeof(device_desc); + memset(&hel_desc, 0, sizeof(hel_desc)); + hel_desc.dwSize = sizeof(hel_desc); + hr = IDirect3DDevice2_GetCaps(device, &device_desc, &hel_desc); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + warp = !!(device_desc.dwDevCaps & D3DDEVCAPS_TEXTURESYSTEMMEMORY); + + green = create_diffuse_material(device, 0.0f, 1.0f, 0.0f, 0.0f); + viewport = create_viewport(device, 0, 0, 640, 480); + viewport_set_background(device, viewport, green); + hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); + ok(SUCCEEDED(hr), "Failed to activate the viewport, hr %#x.\n", hr); + + hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_ZENABLE, D3DZB_FALSE); + ok(SUCCEEDED(hr), "Failed to disable z-buffering, hr %#x.\n", hr); + hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_COLORKEYENABLE, TRUE); + ok(SUCCEEDED(hr), "Failed to enable color keying, hr %#x.\n", hr); + /* There's no way to ignore the texture color in d3d2, so multiply the texture color + * with a black vertex color. */ + hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_MODULATEALPHA); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + + memset(&fx, 0, sizeof(fx)); + fx.dwSize = sizeof(fx); + memset(&lock_desc, 0, sizeof(lock_desc)); + lock_desc.dwSize = sizeof(lock_desc); + + for (t = 0; t < sizeof(tests) / sizeof(*tests); ++t) + { + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + surface_desc.dwWidth = 4; + surface_desc.dwHeight = 1; + surface_desc.ddpfPixelFormat = tests[t].fmt; + /* Windows XP (at least with the r200 driver, other drivers untested) produces + * garbage when doing color keyed texture->texture blits. */ + hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &src, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &dst, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + fx.dwFillColor = tests[t].clear; + /* On the w8 testbot (WARP driver) the blit result has different values in the + * X channel. */ + color_mask = U2(tests[t].fmt).dwRBitMask + | U3(tests[t].fmt).dwGBitMask + | U4(tests[t].fmt).dwBBitMask; + + for (c = 0; c <= tests[t].max; ++c) + { + /* The idiotic Nvidia Windows driver can't change the color key on a d3d + * texture after it has been set once... */ + surface_desc.dwFlags |= DDSD_CKSRCBLT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE; + surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = c << tests[t].shift; + surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = c << tests[t].shift; + hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &texture, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface4_QueryInterface(texture, &IID_IDirect3DTexture2, (void **)&d3d_texture); + ok(SUCCEEDED(hr), "Failed to get texture interface, hr %#x.\n", hr); + hr = IDirect3DTexture2_GetHandle(d3d_texture, device, &handle); + ok(SUCCEEDED(hr), "Failed to get texture handle, hr %#x.\n", hr); + hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_TEXTUREHANDLE, handle); + ok(SUCCEEDED(hr), "Failed to set texture handle, hr %#x.\n", hr); + IDirect3DTexture2_Release(d3d_texture); + + hr = IDirectDrawSurface_Blt(dst, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); + ok(SUCCEEDED(hr), "Failed to clear destination surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface_Lock(src, NULL, &lock_desc, DDLOCK_WAIT, NULL); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + switch (tests[t].bpp) + { + case 4: + ((DWORD *)lock_desc.lpSurface)[0] = (c ? c - 1 : 0) << tests[t].shift; + ((DWORD *)lock_desc.lpSurface)[1] = c << tests[t].shift; + ((DWORD *)lock_desc.lpSurface)[2] = min(c + 1, tests[t].max) << tests[t].shift; + ((DWORD *)lock_desc.lpSurface)[3] = 0xffffffff; + break; + + case 2: + ((WORD *)lock_desc.lpSurface)[0] = (c ? c - 1 : 0) << tests[t].shift; + ((WORD *)lock_desc.lpSurface)[1] = c << tests[t].shift; + ((WORD *)lock_desc.lpSurface)[2] = min(c + 1, tests[t].max) << tests[t].shift; + ((WORD *)lock_desc.lpSurface)[3] = 0xffff; + break; + } + hr = IDirectDrawSurface_Unlock(src, 0); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + hr = IDirectDrawSurface_Blt(texture, NULL, src, NULL, DDBLT_WAIT, NULL); + ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + + ckey.dwColorSpaceLowValue = c << tests[t].shift; + ckey.dwColorSpaceHighValue = c << tests[t].shift; + hr = IDirectDrawSurface_SetColorKey(src, DDCKEY_SRCBLT, &ckey); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + + hr = IDirectDrawSurface_Blt(dst, NULL, src, NULL, DDBLT_KEYSRC | DDBLT_WAIT, NULL); + ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + + /* Don't make this read only, it somehow breaks the detection of the Nvidia bug below. */ + hr = IDirectDrawSurface_Lock(dst, NULL, &lock_desc, DDLOCK_WAIT, NULL); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + switch (tests[t].bpp) + { + case 4: + data[0] = ((DWORD *)lock_desc.lpSurface)[0] & color_mask; + data[1] = ((DWORD *)lock_desc.lpSurface)[1] & color_mask; + data[2] = ((DWORD *)lock_desc.lpSurface)[2] & color_mask; + data[3] = ((DWORD *)lock_desc.lpSurface)[3] & color_mask; + break; + + case 2: + data[0] = ((WORD *)lock_desc.lpSurface)[0] & color_mask; + data[1] = ((WORD *)lock_desc.lpSurface)[1] & color_mask; + data[2] = ((WORD *)lock_desc.lpSurface)[2] & color_mask; + data[3] = ((WORD *)lock_desc.lpSurface)[3] & color_mask; + break; + } + hr = IDirectDrawSurface_Unlock(dst, 0); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + + if (!c) + { + ok(data[0] == tests[t].clear, "Expected surface content %#x, got %#x, format %s, c=%u.\n", + tests[t].clear, data[0], tests[t].name, c); + + if (data[3] == tests[t].clear) + { + /* My Geforce GTX 460 on Windows 7 misbehaves when A4R4G4B4 is blitted with color + * keying: The blit takes ~0.5 seconds, and subsequent color keying draws are broken, + * even when a different surface is used. The blit itself doesn't draw anything, + * so we can detect the bug by looking at the otherwise unused 4th texel. It should + * never be masked out by the key. + * + * Also appears to affect the testbot in some way with R5G6B5. Color keying is + * terrible on WARP. */ + skip("Nvidia A4R4G4B4 color keying blit bug detected, skipping.\n"); + IDirectDrawSurface_Release(texture); + IDirectDrawSurface_Release(src); + IDirectDrawSurface_Release(dst); + goto done; + } + } + else + ok(data[0] == (c - 1) << tests[t].shift, "Expected surface content %#x, got %#x, format %s, c=%u.\n", + (c - 1) << tests[t].shift, data[0], tests[t].name, c); + + ok(data[1] == tests[t].clear, "Expected surface content %#x, got %#x, format %s, c=%u.\n", + tests[t].clear, data[1], tests[t].name, c); + + if (c == tests[t].max) + ok(data[2] == tests[t].clear, "Expected surface content %#x, got %#x, format %s, c=%u.\n", + tests[t].clear, data[2], tests[t].name, c); + else + ok(data[2] == (c + 1) << tests[t].shift, "Expected surface content %#x, got %#x, format %s, c=%u.\n", + (c + 1) << tests[t].shift, data[2], tests[t].name, c); + + hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + + hr = IDirect3DDevice2_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DVT_LVERTEX, quad, 4, 0); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice2_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + + color = get_surface_color(rt, 80, 240); + if (!c) + ok(compare_color(color, 0x0000ff00, 1) || broken(warp && compare_color(color, 0x00000000, 1)), + "Got unexpected color 0x%08x, format %s, c=%u.\n", + color, tests[t].name, c); + else + ok(compare_color(color, 0x00000000, 1) || broken(warp && compare_color(color, 0x0000ff00, 1)), + "Got unexpected color 0x%08x, format %s, c=%u.\n", + color, tests[t].name, c); + + color = get_surface_color(rt, 240, 240); + ok(compare_color(color, 0x0000ff00, 1) || broken(warp && compare_color(color, 0x00000000, 1)), + "Got unexpected color 0x%08x, format %s, c=%u.\n", + color, tests[t].name, c); + + color = get_surface_color(rt, 400, 240); + if (c == tests[t].max) + ok(compare_color(color, 0x0000ff00, 1) || broken(warp && compare_color(color, 0x00000000, 1)), + "Got unexpected color 0x%08x, format %s, c=%u.\n", + color, tests[t].name, c); + else + ok(compare_color(color, 0x00000000, 1) || broken(warp && compare_color(color, 0x0000ff00, 1)), + "Got unexpected color 0x%08x, format %s, c=%u.\n", + color, tests[t].name, c); + + hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_TEXTUREHANDLE, 0); + ok(SUCCEEDED(hr), "Failed to set texture handle, hr %#x.\n", hr); + IDirectDrawSurface_Release(texture); + } + IDirectDrawSurface_Release(src); + IDirectDrawSurface_Release(dst); + } +done: + + destroy_viewport(device, viewport); + destroy_material(green); + IDirectDrawSurface_Release(rt); + IDirect3DDevice2_Release(device); + refcount = IDirectDraw2_Release(ddraw); + ok(refcount == 0, "Ddraw object not properly released, refcount %u.\n", refcount); + DestroyWindow(window); +} + +static void test_range_colorkey(void) +{ + IDirectDraw2 *ddraw; + HWND window; + HRESULT hr; + IDirectDrawSurface *surface; + DDSURFACEDESC surface_desc; + ULONG refcount; + DDCOLORKEY ckey; + + window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, 0, 0, 0, 0); + ddraw = create_ddraw(); + ok(!!ddraw, "Failed to create a ddraw object.\n"); + hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | DDSD_CKSRCBLT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE; + surface_desc.dwWidth = 1; + surface_desc.dwHeight = 1; + surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB; + U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 32; + U2(surface_desc.ddpfPixelFormat).dwRBitMask = 0x00ff0000; + U3(surface_desc.ddpfPixelFormat).dwGBitMask = 0x0000ff00; + U4(surface_desc.ddpfPixelFormat).dwBBitMask = 0x000000ff; + U5(surface_desc.ddpfPixelFormat).dwRGBAlphaBitMask = 0x00000000; + + /* Creating a surface with a range color key fails with DDERR_NOCOLORKEY. */ + surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000000; + surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000001; + hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + + surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000001; + surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000000; + hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + + /* Same for DDSCAPS_OFFSCREENPLAIN. */ + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000000; + surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000001; + hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + + surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000001; + surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000000; + hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + + surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000000; + surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000000; + hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + /* Setting a range color key without DDCKEY_COLORSPACE collapses the key. */ + ckey.dwColorSpaceLowValue = 0x00000000; + ckey.dwColorSpaceHighValue = 0x00000001; + hr = IDirectDrawSurface_SetColorKey(surface, DDCKEY_SRCBLT, &ckey); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + + hr = IDirectDrawSurface_GetColorKey(surface, DDCKEY_SRCBLT, &ckey); + ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr); + ok(!ckey.dwColorSpaceLowValue, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceLowValue); + ok(!ckey.dwColorSpaceHighValue, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceHighValue); + + ckey.dwColorSpaceLowValue = 0x00000001; + ckey.dwColorSpaceHighValue = 0x00000000; + hr = IDirectDrawSurface_SetColorKey(surface, DDCKEY_SRCBLT, &ckey); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + + hr = IDirectDrawSurface_GetColorKey(surface, DDCKEY_SRCBLT, &ckey); + ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr); + ok(ckey.dwColorSpaceLowValue == 0x00000001, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceLowValue); + ok(ckey.dwColorSpaceHighValue == 0x00000001, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceHighValue); + + /* DDCKEY_COLORSPACE is ignored if the key is a single value. */ + ckey.dwColorSpaceLowValue = 0x00000000; + ckey.dwColorSpaceHighValue = 0x00000000; + hr = IDirectDrawSurface_SetColorKey(surface, DDCKEY_SRCBLT | DDCKEY_COLORSPACE, &ckey); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + + /* Using it with a range key results in DDERR_NOCOLORKEYHW. */ + ckey.dwColorSpaceLowValue = 0x00000001; + ckey.dwColorSpaceHighValue = 0x00000000; + hr = IDirectDrawSurface_SetColorKey(surface, DDCKEY_SRCBLT | DDCKEY_COLORSPACE, &ckey); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + ckey.dwColorSpaceLowValue = 0x00000000; + ckey.dwColorSpaceHighValue = 0x00000001; + hr = IDirectDrawSurface_SetColorKey(surface, DDCKEY_SRCBLT | DDCKEY_COLORSPACE, &ckey); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + /* Range destination keys don't work either. */ + hr = IDirectDrawSurface_SetColorKey(surface, DDCKEY_DESTBLT | DDCKEY_COLORSPACE, &ckey); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + + /* Just to show it's not because of A, R, and G having equal values. */ + ckey.dwColorSpaceLowValue = 0x00000000; + ckey.dwColorSpaceHighValue = 0x01010101; + hr = IDirectDrawSurface_SetColorKey(surface, DDCKEY_SRCBLT | DDCKEY_COLORSPACE, &ckey); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + + /* None of these operations modified the key. */ + hr = IDirectDrawSurface_GetColorKey(surface, DDCKEY_SRCBLT, &ckey); + ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr); + ok(!ckey.dwColorSpaceLowValue, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceLowValue); + ok(!ckey.dwColorSpaceHighValue, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceHighValue); + + IDirectDrawSurface_Release(surface), + refcount = IDirectDraw2_Release(ddraw); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + DestroyWindow(window); +} + +static void test_shademode(void) +{ + static D3DRECT clear_rect = {{0}, {0}, {640}, {480}}; + IDirect3DMaterial2 *background; + IDirect3DViewport2 *viewport; + IDirect3DDevice2 *device; + IDirectDrawSurface *rt; + DWORD color0, color1; + IDirectDraw2 *ddraw; + D3DLVERTEX *quad; + IDirect3D2 *d3d; + ULONG refcount; + UINT i, count; + HWND window; + HRESULT hr; + static D3DLVERTEX quad_strip[] = + { + {{-1.0f}, {-1.0f}, {0.0f}, 0, {0xffff0000}}, + {{-1.0f}, { 1.0f}, {0.0f}, 0, {0xff00ff00}}, + {{ 1.0f}, {-1.0f}, {0.0f}, 0, {0xff0000ff}}, + {{ 1.0f}, { 1.0f}, {0.0f}, 0, {0xffffffff}}, + }, + quad_list[] = + { + {{-1.0f}, {-1.0f}, {0.0f}, 0, {0xffff0000}}, + {{-1.0f}, { 1.0f}, {0.0f}, 0, {0xff00ff00}}, + {{ 1.0f}, {-1.0f}, {0.0f}, 0, {0xff0000ff}}, + + {{ 1.0f}, {-1.0f}, {0.0f}, 0, {0xff0000ff}}, + {{-1.0f}, { 1.0f}, {0.0f}, 0, {0xff00ff00}}, + {{ 1.0f}, { 1.0f}, {0.0f}, 0, {0xffffffff}}, + }; + static const struct + { + DWORD primtype; + DWORD shademode; + DWORD color0, color1; + } + tests[] = + { + {D3DPT_TRIANGLESTRIP, D3DSHADE_FLAT, 0x00ff0000, 0x0000ff00}, + {D3DPT_TRIANGLESTRIP, D3DSHADE_PHONG, 0x000dca28, 0x000d45c7}, + {D3DPT_TRIANGLESTRIP, D3DSHADE_GOURAUD, 0x000dca28, 0x000d45c7}, + {D3DPT_TRIANGLESTRIP, D3DSHADE_PHONG, 0x000dca28, 0x000d45c7}, + {D3DPT_TRIANGLELIST, D3DSHADE_FLAT, 0x00ff0000, 0x000000ff}, + {D3DPT_TRIANGLELIST, D3DSHADE_GOURAUD, 0x000dca28, 0x000d45c7}, + }; + + 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_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); + + background = create_diffuse_material(device, 1.0f, 1.0f, 1.0f, 1.0f); + viewport = create_viewport(device, 0, 0, 640, 480); + viewport_set_background(device, viewport, background); + hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); + ok(SUCCEEDED(hr), "Failed to activate the viewport, hr %#x.\n", hr); + + hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_FOGENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable fog, hr %#x.\n", hr); + + /* Try it first with a TRIANGLESTRIP. Do it with different geometry because + * the color fixups we have to do for FLAT shading will be dependent on that. */ + + for (i = 0; i < sizeof(tests) / sizeof(tests[0]); ++i) + { + hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + + hr = IDirect3DDevice2_SetRenderState(device, D3DRENDERSTATE_SHADEMODE, tests[i].shademode); + ok(hr == D3D_OK, "Failed to set shade mode, hr %#x.\n", hr); + + hr = IDirect3DDevice2_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + quad = tests[i].primtype == D3DPT_TRIANGLESTRIP ? quad_strip : quad_list; + count = tests[i].primtype == D3DPT_TRIANGLESTRIP ? 4 : 6; + hr = IDirect3DDevice2_DrawPrimitive(device, tests[i].primtype, D3DVT_LVERTEX, quad, count, 0); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice2_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + + color0 = get_surface_color(rt, 100, 100); /* Inside first triangle */ + color1 = get_surface_color(rt, 500, 350); /* Inside second triangle */ + + /* For D3DSHADE_FLAT it should take the color of the first vertex of + * each triangle. This requires EXT_provoking_vertex or similar + * functionality being available. */ + /* PHONG should be the same as GOURAUD, since no hardware implements + * this. */ + ok(color0 == tests[i].color0, "Test %u shading has color0 %08x, expected %08x.\n", + i, color0, tests[i].color0); + ok(color1 == tests[i].color1, "Test %u shading has color1 %08x, expected %08x.\n", + i, color1, tests[i].color1); + } + + 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); + DestroyWindow(window); +} + START_TEST(ddraw2) { IDirectDraw2 *ddraw; @@ -8511,4 +9052,7 @@ test_texturemapblend(); test_viewport_clear_rect(); test_color_fill(); + test_colorkey_precision(); + test_range_colorkey(); + test_shademode(); } diff -Nru wine1.7-1.7.50/dlls/ddraw/tests/ddraw4.c wine1.7-1.7.55/dlls/ddraw/tests/ddraw4.c --- wine1.7-1.7.50/dlls/ddraw/tests/ddraw4.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ddraw/tests/ddraw4.c 2015-11-13 14:32:40.000000000 +0000 @@ -9415,7 +9415,7 @@ } hr = IDirect3DDevice3_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get Direct3D7 interface, hr %#x.\n", hr); + 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); @@ -9545,16 +9545,594 @@ color = get_surface_color(rt, 480, 360); ok(compare_color(color, 0x00ffff00, 2), "Got unexpected color 0x%08x.\n", color); - IDirectDrawSurface7_Release(texture1); - IDirectDrawSurface7_Release(texture2); + IDirect3DTexture2_Release(texture2); + IDirect3DTexture2_Release(texture1); + IDirectDrawSurface4_Release(surface2); + IDirectDrawSurface4_Release(surface1); - IDirectDrawSurface7_Release(rt); + destroy_viewport(device, viewport); + + IDirectDrawSurface4_Release(rt); IDirectDraw_Release(ddraw); refcount = IDirect3DDevice3_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); DestroyWindow(window); } +static void test_colorkey_precision(void) +{ + static struct + { + struct vec3 pos; + struct vec2 texcoord; + } + quad[] = + { + {{-1.0f, -1.0f, 0.0f}, {0.0f, 1.0f}}, + {{-1.0f, 1.0f, 0.0f}, {0.0f, 0.0f}}, + {{ 1.0f, -1.0f, 0.0f}, {1.0f, 1.0f}}, + {{ 1.0f, 1.0f, 0.0f}, {1.0f, 0.0f}}, + }; + IDirect3DDevice3 *device; + IDirect3D3 *d3d; + IDirectDraw4 *ddraw; + IDirectDrawSurface4 *rt; + IDirect3DViewport3 *viewport; + HWND window; + HRESULT hr; + IDirectDrawSurface4 *src, *dst, *texture; + IDirect3DTexture2 *d3d_texture; + DDSURFACEDESC2 surface_desc, lock_desc; + ULONG refcount; + D3DCOLOR color; + unsigned int t, c; + DDCOLORKEY ckey; + DDBLTFX fx; + DWORD data[4] = {0}, color_mask; + D3DRECT clear_rect = {{0}, {0}, {640}, {480}}; + D3DDEVICEDESC device_desc, hel_desc; + BOOL warp; + static const struct + { + unsigned int max, shift, bpp, clear; + const char *name; + DDPIXELFORMAT fmt; + } + tests[] = + { + { + 255, 0, 4, 0x00345678, "D3DFMT_X8R8G8B8", + { + sizeof(DDPIXELFORMAT), DDPF_RGB, 0, + {32}, {0x00ff0000}, {0x0000ff00}, {0x000000ff}, {0x00000000} + } + + }, + { + 63, 5, 2, 0x5678, "D3DFMT_R5G6B5, G channel", + { + sizeof(DDPIXELFORMAT), DDPF_RGB, 0, + {16}, {0xf800}, {0x07e0}, {0x001f}, {0x0000} + } + + }, + { + 31, 0, 2, 0x5678, "D3DFMT_R5G6B5, B channel", + { + sizeof(DDPIXELFORMAT), DDPF_RGB, 0, + {16}, {0xf800}, {0x07e0}, {0x001f}, {0x0000} + } + + }, + { + 15, 0, 2, 0x0678, "D3DFMT_A4R4G4B4", + { + sizeof(DDPIXELFORMAT), DDPF_RGB | DDPF_ALPHAPIXELS, 0, + {16}, {0x0f00}, {0x00f0}, {0x000f}, {0xf000} + } + + }, + }; + + 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; + } + + /* The Windows 8 WARP driver has plenty of false negatives in X8R8G8B8 + * (color key doesn't match although the values are equal), and a false + * positive when the color key is 0 and the texture contains the value 1. + * I don't want to mark this broken unconditionally since this would + * essentially disable the test on Windows. Try to detect WARP (and I + * guess mismatch other SW renderers) by its ability to texture from + * system memory. Also on random occasions 254 == 255 and 255 != 255.*/ + memset(&device_desc, 0, sizeof(device_desc)); + device_desc.dwSize = sizeof(device_desc); + memset(&hel_desc, 0, sizeof(hel_desc)); + hel_desc.dwSize = sizeof(hel_desc); + hr = IDirect3DDevice3_GetCaps(device, &device_desc, &hel_desc); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + warp = !!(device_desc.dwDevCaps & D3DDEVCAPS_TEXTURESYSTEMMEMORY); + + 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); + + viewport = create_viewport(device, 0, 0, 640, 480); + hr = IDirect3DDevice3_SetCurrentViewport(device, viewport); + ok(SUCCEEDED(hr), "Failed to set current viewport, 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_ZENABLE, D3DZB_FALSE); + ok(SUCCEEDED(hr), "Failed to disable z-buffering, hr %#x.\n", hr); + hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_COLORKEYENABLE, TRUE); + ok(SUCCEEDED(hr), "Failed to enable color keying, hr %#x.\n", hr); + /* Multiply the texture read result with 0, that way the result color if the key doesn't + * match is constant. In theory color keying works without reading the texture result + * (meaning we could just op=arg1, arg1=tfactor), but the Geforce7 Windows driver begs + * to differ. */ + hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_MODULATE); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + hr = IDirect3DDevice3_SetTextureStageState(device, 0, D3DTSS_COLORARG2, D3DTA_TFACTOR); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_TEXTUREFACTOR, 0x00000000); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + + memset(&fx, 0, sizeof(fx)); + fx.dwSize = sizeof(fx); + memset(&lock_desc, 0, sizeof(lock_desc)); + lock_desc.dwSize = sizeof(lock_desc); + + for (t = 0; t < sizeof(tests) / sizeof(*tests); ++t) + { + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + surface_desc.dwWidth = 4; + surface_desc.dwHeight = 1; + U4(surface_desc).ddpfPixelFormat = tests[t].fmt; + /* Windows XP (at least with the r200 driver, other drivers untested) produces + * garbage when doing color keyed texture->texture blits. */ + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &src, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &dst, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + fx.dwFillColor = tests[t].clear; + /* On the w8 testbot (WARP driver) the blit result has different values in the + * X channel. */ + color_mask = U2(tests[t].fmt).dwRBitMask + | U3(tests[t].fmt).dwGBitMask + | U4(tests[t].fmt).dwBBitMask; + + for (c = 0; c <= tests[t].max; ++c) + { + /* The idiotic Nvidia Windows driver can't change the color key on a d3d + * texture after it has been set once... */ + surface_desc.dwFlags |= DDSD_CKSRCBLT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE; + surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = c << tests[t].shift; + surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = c << tests[t].shift; + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &texture, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + hr = IDirectDrawSurface4_QueryInterface(texture, &IID_IDirect3DTexture2, (void **)&d3d_texture); + ok(SUCCEEDED(hr), "Failed to get texture interface, hr %#x.\n", hr); + hr = IDirect3DDevice3_SetTexture(device, 0, d3d_texture); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + + hr = IDirectDrawSurface4_Blt(dst, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); + ok(SUCCEEDED(hr), "Failed to clear destination surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface4_Lock(src, NULL, &lock_desc, DDLOCK_WAIT, NULL); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + switch (tests[t].bpp) + { + case 4: + ((DWORD *)lock_desc.lpSurface)[0] = (c ? c - 1 : 0) << tests[t].shift; + ((DWORD *)lock_desc.lpSurface)[1] = c << tests[t].shift; + ((DWORD *)lock_desc.lpSurface)[2] = min(c + 1, tests[t].max) << tests[t].shift; + ((DWORD *)lock_desc.lpSurface)[3] = 0xffffffff; + break; + + case 2: + ((WORD *)lock_desc.lpSurface)[0] = (c ? c - 1 : 0) << tests[t].shift; + ((WORD *)lock_desc.lpSurface)[1] = c << tests[t].shift; + ((WORD *)lock_desc.lpSurface)[2] = min(c + 1, tests[t].max) << tests[t].shift; + ((WORD *)lock_desc.lpSurface)[3] = 0xffff; + break; + } + hr = IDirectDrawSurface4_Unlock(src, 0); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + hr = IDirectDrawSurface4_Blt(texture, NULL, src, NULL, DDBLT_WAIT, NULL); + ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + + ckey.dwColorSpaceLowValue = c << tests[t].shift; + ckey.dwColorSpaceHighValue = c << tests[t].shift; + hr = IDirectDrawSurface4_SetColorKey(src, DDCKEY_SRCBLT, &ckey); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + + hr = IDirectDrawSurface4_Blt(dst, NULL, src, NULL, DDBLT_KEYSRC | DDBLT_WAIT, NULL); + ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + + /* Don't make this read only, it somehow breaks the detection of the Nvidia bug below. */ + hr = IDirectDrawSurface4_Lock(dst, NULL, &lock_desc, DDLOCK_WAIT, NULL); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + switch (tests[t].bpp) + { + case 4: + data[0] = ((DWORD *)lock_desc.lpSurface)[0] & color_mask; + data[1] = ((DWORD *)lock_desc.lpSurface)[1] & color_mask; + data[2] = ((DWORD *)lock_desc.lpSurface)[2] & color_mask; + data[3] = ((DWORD *)lock_desc.lpSurface)[3] & color_mask; + break; + + case 2: + data[0] = ((WORD *)lock_desc.lpSurface)[0] & color_mask; + data[1] = ((WORD *)lock_desc.lpSurface)[1] & color_mask; + data[2] = ((WORD *)lock_desc.lpSurface)[2] & color_mask; + data[3] = ((WORD *)lock_desc.lpSurface)[3] & color_mask; + break; + } + hr = IDirectDrawSurface4_Unlock(dst, 0); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + + if (!c) + { + ok(data[0] == tests[t].clear, "Expected surface content %#x, got %#x, format %s, c=%u.\n", + tests[t].clear, data[0], tests[t].name, c); + + if (data[3] == tests[t].clear) + { + /* My Geforce GTX 460 on Windows 7 misbehaves when A4R4G4B4 is blitted with color + * keying: The blit takes ~0.5 seconds, and subsequent color keying draws are broken, + * even when a different surface is used. The blit itself doesn't draw anything, + * so we can detect the bug by looking at the otherwise unused 4th texel. It should + * never be masked out by the key. + * + * Also appears to affect the testbot in some way with R5G6B5. Color keying is + * terrible on WARP. */ + skip("Nvidia A4R4G4B4 color keying blit bug detected, skipping.\n"); + IDirect3DTexture2_Release(d3d_texture); + IDirectDrawSurface4_Release(texture); + IDirectDrawSurface4_Release(src); + IDirectDrawSurface4_Release(dst); + goto done; + } + } + else + ok(data[0] == (c - 1) << tests[t].shift, "Expected surface content %#x, got %#x, format %s, c=%u.\n", + (c - 1) << tests[t].shift, data[0], tests[t].name, c); + + ok(data[1] == tests[t].clear, "Expected surface content %#x, got %#x, format %s, c=%u.\n", + tests[t].clear, data[1], tests[t].name, c); + + if (c == tests[t].max) + ok(data[2] == tests[t].clear, "Expected surface content %#x, got %#x, format %s, c=%u.\n", + tests[t].clear, data[2], tests[t].name, c); + else + ok(data[2] == (c + 1) << tests[t].shift, "Expected surface content %#x, got %#x, format %s, c=%u.\n", + (c + 1) << tests[t].shift, data[2], tests[t].name, c); + + hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0x0000ff00, 1.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, 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 | D3DFVF_TEX1, 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, 80, 240); + if (!c) + ok(compare_color(color, 0x0000ff00, 1) || broken(warp && compare_color(color, 0x00000000, 1)), + "Got unexpected color 0x%08x, format %s, c=%u.\n", + color, tests[t].name, c); + else + ok(compare_color(color, 0x00000000, 1) || broken(warp && compare_color(color, 0x0000ff00, 1)), + "Got unexpected color 0x%08x, format %s, c=%u.\n", + color, tests[t].name, c); + + color = get_surface_color(rt, 240, 240); + ok(compare_color(color, 0x0000ff00, 1) || broken(warp && compare_color(color, 0x00000000, 1)), + "Got unexpected color 0x%08x, format %s, c=%u.\n", + color, tests[t].name, c); + + color = get_surface_color(rt, 400, 240); + if (c == tests[t].max) + ok(compare_color(color, 0x0000ff00, 1) || broken(warp && compare_color(color, 0x00000000, 1)), + "Got unexpected color 0x%08x, format %s, c=%u.\n", + color, tests[t].name, c); + else + ok(compare_color(color, 0x00000000, 1) || broken(warp && compare_color(color, 0x0000ff00, 1)), + "Got unexpected color 0x%08x, format %s, c=%u.\n", + color, tests[t].name, c); + + IDirect3DTexture2_Release(d3d_texture); + IDirectDrawSurface4_Release(texture); + } + IDirectDrawSurface4_Release(src); + IDirectDrawSurface4_Release(dst); + } + done: + + destroy_viewport(device, viewport); + IDirectDrawSurface4_Release(rt); + IDirectDraw4_Release(ddraw); + refcount = IDirect3DDevice3_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + DestroyWindow(window); +} + +static void test_range_colorkey(void) +{ + IDirectDraw4 *ddraw; + HWND window; + HRESULT hr; + IDirectDrawSurface4 *surface; + DDSURFACEDESC2 surface_desc; + ULONG refcount; + DDCOLORKEY ckey; + + window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, 0, 0, 0, 0); + ddraw = create_ddraw(); + ok(!!ddraw, "Failed to create a ddraw object.\n"); + hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | DDSD_CKSRCBLT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE; + surface_desc.dwWidth = 1; + surface_desc.dwHeight = 1; + U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_RGB; + U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount = 32; + U2(U4(surface_desc).ddpfPixelFormat).dwRBitMask = 0x00ff0000; + U3(U4(surface_desc).ddpfPixelFormat).dwGBitMask = 0x0000ff00; + U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; + U5(U4(surface_desc).ddpfPixelFormat).dwRGBAlphaBitMask = 0x00000000; + + /* Creating a surface with a range color key fails with DDERR_NOCOLORKEY. */ + surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000000; + surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000001; + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + + surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000001; + surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000000; + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + + /* Same for DDSCAPS_OFFSCREENPLAIN. */ + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000000; + surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000001; + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + + surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000001; + surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000000; + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + + surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000000; + surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000000; + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + /* Setting a range color key without DDCKEY_COLORSPACE collapses the key. */ + ckey.dwColorSpaceLowValue = 0x00000000; + ckey.dwColorSpaceHighValue = 0x00000001; + hr = IDirectDrawSurface4_SetColorKey(surface, DDCKEY_SRCBLT, &ckey); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + + hr = IDirectDrawSurface4_GetColorKey(surface, DDCKEY_SRCBLT, &ckey); + ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr); + ok(!ckey.dwColorSpaceLowValue, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceLowValue); + ok(!ckey.dwColorSpaceHighValue, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceHighValue); + + ckey.dwColorSpaceLowValue = 0x00000001; + ckey.dwColorSpaceHighValue = 0x00000000; + hr = IDirectDrawSurface4_SetColorKey(surface, DDCKEY_SRCBLT, &ckey); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + + hr = IDirectDrawSurface4_GetColorKey(surface, DDCKEY_SRCBLT, &ckey); + ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr); + ok(ckey.dwColorSpaceLowValue == 0x00000001, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceLowValue); + ok(ckey.dwColorSpaceHighValue == 0x00000001, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceHighValue); + + /* DDCKEY_COLORSPACE is ignored if the key is a single value. */ + ckey.dwColorSpaceLowValue = 0x00000000; + ckey.dwColorSpaceHighValue = 0x00000000; + hr = IDirectDrawSurface4_SetColorKey(surface, DDCKEY_SRCBLT | DDCKEY_COLORSPACE, &ckey); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + + /* Using it with a range key results in DDERR_NOCOLORKEYHW. */ + ckey.dwColorSpaceLowValue = 0x00000001; + ckey.dwColorSpaceHighValue = 0x00000000; + hr = IDirectDrawSurface4_SetColorKey(surface, DDCKEY_SRCBLT | DDCKEY_COLORSPACE, &ckey); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + ckey.dwColorSpaceLowValue = 0x00000000; + ckey.dwColorSpaceHighValue = 0x00000001; + hr = IDirectDrawSurface4_SetColorKey(surface, DDCKEY_SRCBLT | DDCKEY_COLORSPACE, &ckey); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + /* Range destination keys don't work either. */ + hr = IDirectDrawSurface4_SetColorKey(surface, DDCKEY_DESTBLT | DDCKEY_COLORSPACE, &ckey); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + + /* Just to show it's not because of A, R, and G having equal values. */ + ckey.dwColorSpaceLowValue = 0x00000000; + ckey.dwColorSpaceHighValue = 0x01010101; + hr = IDirectDrawSurface4_SetColorKey(surface, DDCKEY_SRCBLT | DDCKEY_COLORSPACE, &ckey); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + + /* None of these operations modified the key. */ + hr = IDirectDrawSurface4_GetColorKey(surface, DDCKEY_SRCBLT, &ckey); + ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr); + ok(!ckey.dwColorSpaceLowValue, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceLowValue); + ok(!ckey.dwColorSpaceHighValue, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceHighValue); + + IDirectDrawSurface4_Release(surface), + refcount = IDirectDraw4_Release(ddraw); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + DestroyWindow(window); +} + +static void test_shademode(void) +{ + IDirect3DVertexBuffer *vb_strip, *vb_list, *buffer; + D3DRECT clear_rect = {{0}, {0}, {640}, {480}}; + IDirect3DViewport3 *viewport; + IDirect3DDevice3 *device; + D3DVERTEXBUFFERDESC desc; + IDirectDrawSurface4 *rt; + DWORD color0, color1; + void *data = NULL; + IDirect3D3 *d3d; + ULONG refcount; + UINT i, count; + HWND window; + HRESULT hr; + static const struct + { + struct vec3 position; + DWORD diffuse; + } + quad_strip[] = + { + {{-1.0f, -1.0f, 0.0f}, 0xffff0000}, + {{-1.0f, 1.0f, 0.0f}, 0xff00ff00}, + {{ 1.0f, -1.0f, 0.0f}, 0xff0000ff}, + {{ 1.0f, 1.0f, 0.0f}, 0xffffffff}, + }, + quad_list[] = + { + {{-1.0f, -1.0f, 0.0f}, 0xffff0000}, + {{-1.0f, 1.0f, 0.0f}, 0xff00ff00}, + {{ 1.0f, -1.0f, 0.0f}, 0xff0000ff}, + + {{ 1.0f, -1.0f, 0.0f}, 0xff0000ff}, + {{-1.0f, 1.0f, 0.0f}, 0xff00ff00}, + {{ 1.0f, 1.0f, 0.0f}, 0xffffffff}, + }; + static const struct + { + DWORD primtype; + DWORD shademode; + DWORD color0, color1; + } + tests[] = + { + {D3DPT_TRIANGLESTRIP, D3DSHADE_FLAT, 0x00ff0000, 0x0000ff00}, + {D3DPT_TRIANGLESTRIP, D3DSHADE_PHONG, 0x000dca28, 0x000d45c7}, + {D3DPT_TRIANGLESTRIP, D3DSHADE_GOURAUD, 0x000dca28, 0x000d45c7}, + {D3DPT_TRIANGLESTRIP, D3DSHADE_PHONG, 0x000dca28, 0x000d45c7}, + {D3DPT_TRIANGLELIST, D3DSHADE_FLAT, 0x00ff0000, 0x000000ff}, + {D3DPT_TRIANGLELIST, D3DSHADE_GOURAUD, 0x000dca28, 0x000d45c7}, + }; + + 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 d3d interface, hr %#x.\n", hr); + 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_SetRenderState(device, D3DRENDERSTATE_FOGENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable fog, hr %#x.\n", hr); + + memset(&desc, 0, sizeof(desc)); + desc.dwSize = sizeof(desc); + desc.dwCaps = D3DVBCAPS_WRITEONLY; + desc.dwFVF = D3DFVF_XYZ | D3DFVF_DIFFUSE; + desc.dwNumVertices = sizeof(quad_strip) / sizeof(*quad_strip); + hr = IDirect3D3_CreateVertexBuffer(d3d, &desc, &vb_strip, 0, NULL); + ok(hr == D3D_OK, "Failed to create vertex buffer, hr %#x.\n", hr); + hr = IDirect3DVertexBuffer_Lock(vb_strip, 0, &data, NULL); + ok(hr == D3D_OK, "Failed to lock vertex buffer, hr %#x.\n", hr); + memcpy(data, quad_strip, sizeof(quad_strip)); + hr = IDirect3DVertexBuffer_Unlock(vb_strip); + ok(hr == D3D_OK, "Failed to unlock vertex buffer, hr %#x.\n", hr); + + desc.dwNumVertices = sizeof(quad_list) / sizeof(*quad_list); + hr = IDirect3D3_CreateVertexBuffer(d3d, &desc, &vb_list, 0, NULL); + ok(hr == D3D_OK, "Failed to create vertex buffer, hr %#x.\n", hr); + hr = IDirect3DVertexBuffer_Lock(vb_list, 0, &data, NULL); + ok(hr == D3D_OK, "Failed to lock vertex buffer, hr %#x.\n", hr); + memcpy(data, quad_list, sizeof(quad_list)); + hr = IDirect3DVertexBuffer_Unlock(vb_list); + ok(hr == D3D_OK, "Failed to unlock vertex buffer, hr %#x.\n", hr); + + /* Try it first with a TRIANGLESTRIP. Do it with different geometry because + * the color fixups we have to do for FLAT shading will be dependent on that. */ + + for (i = 0; i < sizeof(tests) / sizeof(tests[0]); ++i) + { + hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + + hr = IDirect3DDevice3_SetRenderState(device, D3DRENDERSTATE_SHADEMODE, tests[i].shademode); + ok(hr == D3D_OK, "Failed to set shade mode, hr %#x.\n", hr); + + hr = IDirect3DDevice3_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + buffer = tests[i].primtype == D3DPT_TRIANGLESTRIP ? vb_strip : vb_list; + count = tests[i].primtype == D3DPT_TRIANGLESTRIP ? 4 : 6; + hr = IDirect3DDevice3_DrawPrimitiveVB(device, tests[i].primtype, buffer, 0, count, 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); + + color0 = get_surface_color(rt, 100, 100); /* Inside first triangle */ + color1 = get_surface_color(rt, 500, 350); /* Inside second triangle */ + + /* For D3DSHADE_FLAT it should take the color of the first vertex of + * each triangle. This requires EXT_provoking_vertex or similar + * functionality being available. */ + /* PHONG should be the same as GOURAUD, since no hardware implements + * this. */ + ok(color0 == tests[i].color0, "Test %u shading has color0 %08x, expected %08x.\n", + i, color0, tests[i].color0); + ok(color1 == tests[i].color1, "Test %u shading has color1 %08x, expected %08x.\n", + i, color1, tests[i].color1); + } + + IDirect3DVertexBuffer_Release(vb_strip); + IDirect3DVertexBuffer_Release(vb_list); + destroy_viewport(device, viewport); + IDirectDrawSurface4_Release(rt); + IDirect3D3_Release(d3d); + refcount = IDirect3DDevice3_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + DestroyWindow(window); +} + START_TEST(ddraw4) { IDirectDraw4 *ddraw; @@ -9638,4 +10216,7 @@ test_signed_formats(); test_color_fill(); test_texcoordindex(); + test_colorkey_precision(); + test_range_colorkey(); + test_shademode(); } diff -Nru wine1.7-1.7.50/dlls/ddraw/tests/ddraw7.c wine1.7-1.7.55/dlls/ddraw/tests/ddraw7.c --- wine1.7-1.7.50/dlls/ddraw/tests/ddraw7.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ddraw/tests/ddraw7.c 2015-11-13 14:32:40.000000000 +0000 @@ -8690,6 +8690,7 @@ ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, tests[i].pos_type | D3DFVF_DIFFUSE, tests[i].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); @@ -9740,6 +9741,559 @@ DestroyWindow(window); } +static void test_colorkey_precision(void) +{ + static struct + { + struct vec3 pos; + struct vec2 texcoord; + } + quad[] = + { + {{-1.0f, -1.0f, 0.0f}, {0.0f, 1.0f}}, + {{-1.0f, 1.0f, 0.0f}, {0.0f, 0.0f}}, + {{ 1.0f, -1.0f, 0.0f}, {1.0f, 1.0f}}, + {{ 1.0f, 1.0f, 0.0f}, {1.0f, 0.0f}}, + }; + IDirect3DDevice7 *device; + IDirect3D7 *d3d; + IDirectDraw7 *ddraw; + IDirectDrawSurface7 *rt; + HWND window; + HRESULT hr; + IDirectDrawSurface7 *src, *dst, *texture; + DDSURFACEDESC2 surface_desc, lock_desc; + ULONG refcount; + D3DCOLOR color; + unsigned int t, c; + DDCOLORKEY ckey; + DDBLTFX fx; + DWORD data[4] = {0}, color_mask; + D3DDEVICEDESC7 device_desc; + BOOL warp; + static const struct + { + unsigned int max, shift, bpp, clear; + const char *name; + DDPIXELFORMAT fmt; + } + tests[] = + { + { + 255, 0, 4, 0x00345678, "D3DFMT_X8R8G8B8", + { + sizeof(DDPIXELFORMAT), DDPF_RGB, 0, + {32}, {0x00ff0000}, {0x0000ff00}, {0x000000ff}, {0x00000000} + } + + }, + { + 63, 5, 2, 0x5678, "D3DFMT_R5G6B5, G channel", + { + sizeof(DDPIXELFORMAT), DDPF_RGB, 0, + {16}, {0xf800}, {0x07e0}, {0x001f}, {0x0000} + } + + }, + { + 31, 0, 2, 0x5678, "D3DFMT_R5G6B5, B channel", + { + sizeof(DDPIXELFORMAT), DDPF_RGB, 0, + {16}, {0xf800}, {0x07e0}, {0x001f}, {0x0000} + } + + }, + { + 15, 0, 2, 0x0678, "D3DFMT_A4R4G4B4", + { + sizeof(DDPIXELFORMAT), DDPF_RGB | DDPF_ALPHAPIXELS, 0, + {16}, {0x0f00}, {0x00f0}, {0x000f}, {0xf000} + } + + }, + }; + + 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; + } + + /* The Windows 8 WARP driver has plenty of false negatives in X8R8G8B8 + * (color key doesn't match although the values are equal), and a false + * positive when the color key is 0 and the texture contains the value 1. + * I don't want to mark this broken unconditionally since this would + * essentially disable the test on Windows. Try to detect WARP (and I + * guess mismatch other SW renderers) by its ability to texture from + * system memory. Also on random occasions 254 == 255 and 255 != 255.*/ + hr = IDirect3DDevice7_GetCaps(device, &device_desc); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + warp = !!(device_desc.dwDevCaps & D3DDEVCAPS_TEXTURESYSTEMMEMORY); + + 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); + + hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); + hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ZENABLE, D3DZB_FALSE); + ok(SUCCEEDED(hr), "Failed to disable z-buffering, hr %#x.\n", hr); + hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_COLORKEYENABLE, TRUE); + ok(SUCCEEDED(hr), "Failed to enable color keying, hr %#x.\n", hr); + /* Multiply the texture read result with 0, that way the result color if the key doesn't + * match is constant. In theory color keying works without reading the texture result + * (meaning we could just op=arg1, arg1=tfactor), but the Geforce7 Windows driver begs + * to differ. */ + hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_MODULATE); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + hr = IDirect3DDevice7_SetTextureStageState(device, 0, D3DTSS_COLORARG2, D3DTA_TFACTOR); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_TEXTUREFACTOR, 0x00000000); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + + memset(&fx, 0, sizeof(fx)); + fx.dwSize = sizeof(fx); + memset(&lock_desc, 0, sizeof(lock_desc)); + lock_desc.dwSize = sizeof(lock_desc); + + for (t = 0; t < sizeof(tests) / sizeof(*tests); ++t) + { + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + surface_desc.dwWidth = 4; + surface_desc.dwHeight = 1; + U4(surface_desc).ddpfPixelFormat = tests[t].fmt; + /* Windows XP (at least with the r200 driver, other drivers untested) produces + * garbage when doing color keyed texture->texture blits. */ + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &src, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &dst, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + fx.dwFillColor = tests[t].clear; + /* On the w8 testbot (WARP driver) the blit result has different values in the + * X channel. */ + color_mask = U2(tests[t].fmt).dwRBitMask + | U3(tests[t].fmt).dwGBitMask + | U4(tests[t].fmt).dwBBitMask; + + for (c = 0; c <= tests[t].max; ++c) + { + /* The idiotic Nvidia Windows driver can't change the color key on a d3d + * texture after it has been set once... */ + surface_desc.dwFlags |= DDSD_CKSRCBLT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE; + surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = c << tests[t].shift; + surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = c << tests[t].shift; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &texture, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + hr = IDirect3DDevice7_SetTexture(device, 0, texture); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + + hr = IDirectDrawSurface7_Blt(dst, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx); + ok(SUCCEEDED(hr), "Failed to clear destination surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface7_Lock(src, NULL, &lock_desc, DDLOCK_WAIT, NULL); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + switch (tests[t].bpp) + { + case 4: + ((DWORD *)lock_desc.lpSurface)[0] = (c ? c - 1 : 0) << tests[t].shift; + ((DWORD *)lock_desc.lpSurface)[1] = c << tests[t].shift; + ((DWORD *)lock_desc.lpSurface)[2] = min(c + 1, tests[t].max) << tests[t].shift; + ((DWORD *)lock_desc.lpSurface)[3] = 0xffffffff; + break; + + case 2: + ((WORD *)lock_desc.lpSurface)[0] = (c ? c - 1 : 0) << tests[t].shift; + ((WORD *)lock_desc.lpSurface)[1] = c << tests[t].shift; + ((WORD *)lock_desc.lpSurface)[2] = min(c + 1, tests[t].max) << tests[t].shift; + ((WORD *)lock_desc.lpSurface)[3] = 0xffff; + break; + } + hr = IDirectDrawSurface7_Unlock(src, 0); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + hr = IDirectDrawSurface7_Blt(texture, NULL, src, NULL, DDBLT_WAIT, NULL); + ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + + ckey.dwColorSpaceLowValue = c << tests[t].shift; + ckey.dwColorSpaceHighValue = c << tests[t].shift; + hr = IDirectDrawSurface7_SetColorKey(src, DDCKEY_SRCBLT, &ckey); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + + hr = IDirectDrawSurface7_Blt(dst, NULL, src, NULL, DDBLT_KEYSRC | DDBLT_WAIT, NULL); + ok(SUCCEEDED(hr), "Failed to blit, hr %#x.\n", hr); + + /* Don't make this read only, it somehow breaks the detection of the Nvidia bug below. */ + hr = IDirectDrawSurface7_Lock(dst, NULL, &lock_desc, DDLOCK_WAIT, NULL); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + switch (tests[t].bpp) + { + case 4: + data[0] = ((DWORD *)lock_desc.lpSurface)[0] & color_mask; + data[1] = ((DWORD *)lock_desc.lpSurface)[1] & color_mask; + data[2] = ((DWORD *)lock_desc.lpSurface)[2] & color_mask; + data[3] = ((DWORD *)lock_desc.lpSurface)[3] & color_mask; + break; + + case 2: + data[0] = ((WORD *)lock_desc.lpSurface)[0] & color_mask; + data[1] = ((WORD *)lock_desc.lpSurface)[1] & color_mask; + data[2] = ((WORD *)lock_desc.lpSurface)[2] & color_mask; + data[3] = ((WORD *)lock_desc.lpSurface)[3] & color_mask; + break; + } + hr = IDirectDrawSurface7_Unlock(dst, 0); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + + if (!c) + { + ok(data[0] == tests[t].clear, "Expected surface content %#x, got %#x, format %s, c=%u.\n", + tests[t].clear, data[0], tests[t].name, c); + + if (data[3] == tests[t].clear) + { + /* My Geforce GTX 460 on Windows 7 misbehaves when A4R4G4B4 is blitted with color + * keying: The blit takes ~0.5 seconds, and subsequent color keying draws are broken, + * even when a different surface is used. The blit itself doesn't draw anything, + * so we can detect the bug by looking at the otherwise unused 4th texel. It should + * never be masked out by the key. + * + * Also appears to affect the testbot in some way with R5G6B5. Color keying is + * terrible on WARP. */ + skip("Nvidia A4R4G4B4 color keying blit bug detected, skipping.\n"); + IDirectDrawSurface7_Release(texture); + IDirectDrawSurface7_Release(src); + IDirectDrawSurface7_Release(dst); + goto done; + } + } + else + ok(data[0] == (c - 1) << tests[t].shift, "Expected surface content %#x, got %#x, format %s, c=%u.\n", + (c - 1) << tests[t].shift, data[0], tests[t].name, c); + + ok(data[1] == tests[t].clear, "Expected surface content %#x, got %#x, format %s, c=%u.\n", + tests[t].clear, data[1], tests[t].name, c); + + if (c == tests[t].max) + ok(data[2] == tests[t].clear, "Expected surface content %#x, got %#x, format %s, c=%u.\n", + tests[t].clear, data[2], tests[t].name, c); + else + ok(data[2] == (c + 1) << tests[t].shift, "Expected surface content %#x, got %#x, format %s, c=%u.\n", + (c + 1) << tests[t].shift, data[2], tests[t].name, c); + + hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x0000ff00, 1.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 | D3DFVF_TEX1, 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, 80, 240); + if (!c) + ok(compare_color(color, 0x0000ff00, 1) || broken(warp && compare_color(color, 0x00000000, 1)), + "Got unexpected color 0x%08x, format %s, c=%u.\n", + color, tests[t].name, c); + else + ok(compare_color(color, 0x00000000, 1) || broken(warp && compare_color(color, 0x0000ff00, 1)), + "Got unexpected color 0x%08x, format %s, c=%u.\n", + color, tests[t].name, c); + + color = get_surface_color(rt, 240, 240); + ok(compare_color(color, 0x0000ff00, 1) || broken(warp && compare_color(color, 0x00000000, 1)), + "Got unexpected color 0x%08x, format %s, c=%u.\n", + color, tests[t].name, c); + + color = get_surface_color(rt, 400, 240); + if (c == tests[t].max) + ok(compare_color(color, 0x0000ff00, 1) || broken(warp && compare_color(color, 0x00000000, 1)), + "Got unexpected color 0x%08x, format %s, c=%u.\n", + color, tests[t].name, c); + else + ok(compare_color(color, 0x00000000, 1) || broken(warp && compare_color(color, 0x0000ff00, 1)), + "Got unexpected color 0x%08x, format %s, c=%u.\n", + color, tests[t].name, c); + + IDirectDrawSurface7_Release(texture); + } + IDirectDrawSurface7_Release(src); + IDirectDrawSurface7_Release(dst); + } +done: + + IDirectDrawSurface7_Release(rt); + IDirectDraw7_Release(ddraw); + refcount = IDirect3DDevice7_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + DestroyWindow(window); +} + +static void test_range_colorkey(void) +{ + IDirectDraw7 *ddraw; + HWND window; + HRESULT hr; + IDirectDrawSurface7 *surface; + DDSURFACEDESC2 surface_desc; + ULONG refcount; + DDCOLORKEY ckey; + + window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, 0, 0, 0, 0); + ddraw = create_ddraw(); + ok(!!ddraw, "Failed to create a ddraw object.\n"); + hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | DDSD_CKSRCBLT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE; + surface_desc.dwWidth = 1; + surface_desc.dwHeight = 1; + U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_RGB; + U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount = 32; + U2(U4(surface_desc).ddpfPixelFormat).dwRBitMask = 0x00ff0000; + U3(U4(surface_desc).ddpfPixelFormat).dwGBitMask = 0x0000ff00; + U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; + U5(U4(surface_desc).ddpfPixelFormat).dwRGBAlphaBitMask = 0x00000000; + + /* Creating a surface with a range color key fails with DDERR_NOCOLORKEY. */ + surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000000; + surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000001; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + + surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000001; + surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000000; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + + /* Same for DDSCAPS_OFFSCREENPLAIN. */ + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000000; + surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000001; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + + surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000001; + surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000000; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + + surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue = 0x00000000; + surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue = 0x00000000; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + /* Setting a range color key without DDCKEY_COLORSPACE collapses the key. */ + ckey.dwColorSpaceLowValue = 0x00000000; + ckey.dwColorSpaceHighValue = 0x00000001; + hr = IDirectDrawSurface7_SetColorKey(surface, DDCKEY_SRCBLT, &ckey); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + + hr = IDirectDrawSurface7_GetColorKey(surface, DDCKEY_SRCBLT, &ckey); + ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr); + ok(!ckey.dwColorSpaceLowValue, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceLowValue); + ok(!ckey.dwColorSpaceHighValue, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceHighValue); + + ckey.dwColorSpaceLowValue = 0x00000001; + ckey.dwColorSpaceHighValue = 0x00000000; + hr = IDirectDrawSurface7_SetColorKey(surface, DDCKEY_SRCBLT, &ckey); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + + hr = IDirectDrawSurface7_GetColorKey(surface, DDCKEY_SRCBLT, &ckey); + ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr); + ok(ckey.dwColorSpaceLowValue == 0x00000001, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceLowValue); + ok(ckey.dwColorSpaceHighValue == 0x00000001, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceHighValue); + + /* DDCKEY_COLORSPACE is ignored if the key is a single value. */ + ckey.dwColorSpaceLowValue = 0x00000000; + ckey.dwColorSpaceHighValue = 0x00000000; + hr = IDirectDrawSurface7_SetColorKey(surface, DDCKEY_SRCBLT | DDCKEY_COLORSPACE, &ckey); + ok(SUCCEEDED(hr), "Failed to set color key, hr %#x.\n", hr); + + /* Using it with a range key results in DDERR_NOCOLORKEYHW. */ + ckey.dwColorSpaceLowValue = 0x00000001; + ckey.dwColorSpaceHighValue = 0x00000000; + hr = IDirectDrawSurface7_SetColorKey(surface, DDCKEY_SRCBLT | DDCKEY_COLORSPACE, &ckey); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + ckey.dwColorSpaceLowValue = 0x00000000; + ckey.dwColorSpaceHighValue = 0x00000001; + hr = IDirectDrawSurface7_SetColorKey(surface, DDCKEY_SRCBLT | DDCKEY_COLORSPACE, &ckey); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + /* Range destination keys don't work either. */ + hr = IDirectDrawSurface7_SetColorKey(surface, DDCKEY_DESTBLT | DDCKEY_COLORSPACE, &ckey); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + + /* Just to show it's not because of A, R, and G having equal values. */ + ckey.dwColorSpaceLowValue = 0x00000000; + ckey.dwColorSpaceHighValue = 0x01010101; + hr = IDirectDrawSurface7_SetColorKey(surface, DDCKEY_SRCBLT | DDCKEY_COLORSPACE, &ckey); + ok(hr == DDERR_NOCOLORKEYHW, "Got unexpected hr %#x.\n", hr); + + /* None of these operations modified the key. */ + hr = IDirectDrawSurface7_GetColorKey(surface, DDCKEY_SRCBLT, &ckey); + ok(SUCCEEDED(hr), "Failed to get color key, hr %#x.\n", hr); + ok(!ckey.dwColorSpaceLowValue, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceLowValue); + ok(!ckey.dwColorSpaceHighValue, "Got unexpected value 0x%08x.\n", ckey.dwColorSpaceHighValue); + + IDirectDrawSurface7_Release(surface), + refcount = IDirectDraw7_Release(ddraw); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + DestroyWindow(window); +} + +static void test_shademode(void) +{ + IDirect3DVertexBuffer7 *vb_strip, *vb_list, *buffer; + IDirect3DDevice7 *device; + D3DVERTEXBUFFERDESC desc; + IDirectDrawSurface7 *rt; + DWORD color0, color1; + void *data = NULL; + IDirect3D7 *d3d; + ULONG refcount; + UINT i, count; + HWND window; + HRESULT hr; + static const struct + { + struct vec3 position; + DWORD diffuse; + } + quad_strip[] = + { + {{-1.0f, -1.0f, 0.0f}, 0xffff0000}, + {{-1.0f, 1.0f, 0.0f}, 0xff00ff00}, + {{ 1.0f, -1.0f, 0.0f}, 0xff0000ff}, + {{ 1.0f, 1.0f, 0.0f}, 0xffffffff}, + }, + quad_list[] = + { + {{-1.0f, -1.0f, 0.0f}, 0xffff0000}, + {{-1.0f, 1.0f, 0.0f}, 0xff00ff00}, + {{ 1.0f, -1.0f, 0.0f}, 0xff0000ff}, + + {{ 1.0f, -1.0f, 0.0f}, 0xff0000ff}, + {{-1.0f, 1.0f, 0.0f}, 0xff00ff00}, + {{ 1.0f, 1.0f, 0.0f}, 0xffffffff}, + }; + static const struct + { + DWORD primtype; + DWORD shademode; + DWORD color0, color1; + } + tests[] = + { + {D3DPT_TRIANGLESTRIP, D3DSHADE_FLAT, 0x00ff0000, 0x0000ff00}, + {D3DPT_TRIANGLESTRIP, D3DSHADE_PHONG, 0x000dca28, 0x000d45c7}, + {D3DPT_TRIANGLESTRIP, D3DSHADE_GOURAUD, 0x000dca28, 0x000d45c7}, + {D3DPT_TRIANGLESTRIP, D3DSHADE_PHONG, 0x000dca28, 0x000d45c7}, + {D3DPT_TRIANGLELIST, D3DSHADE_FLAT, 0x00ff0000, 0x000000ff}, + {D3DPT_TRIANGLELIST, D3DSHADE_GOURAUD, 0x000dca28, 0x000d45c7}, + }; + + 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 d3d interface, hr %#x.\n", hr); + hr = IDirect3DDevice7_GetRenderTarget(device, &rt); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + + hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_LIGHTING, FALSE); + ok(hr == D3D_OK, "Failed to disable lighting, hr %#x.\n", hr); + hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_FOGENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable fog, hr %#x.\n", hr); + + memset(&desc, 0, sizeof(desc)); + desc.dwSize = sizeof(desc); + desc.dwCaps = D3DVBCAPS_WRITEONLY; + desc.dwFVF = D3DFVF_XYZ | D3DFVF_DIFFUSE; + desc.dwNumVertices = sizeof(quad_strip) / sizeof(*quad_strip); + hr = IDirect3D7_CreateVertexBuffer(d3d, &desc, &vb_strip, 0); + ok(hr == D3D_OK, "Failed to create vertex buffer, hr %#x.\n", hr); + hr = IDirect3DVertexBuffer7_Lock(vb_strip, 0, &data, NULL); + ok(hr == D3D_OK, "Failed to lock vertex buffer, hr %#x.\n", hr); + memcpy(data, quad_strip, sizeof(quad_strip)); + hr = IDirect3DVertexBuffer7_Unlock(vb_strip); + ok(hr == D3D_OK, "Failed to unlock vertex buffer, hr %#x.\n", hr); + + desc.dwNumVertices = sizeof(quad_list) / sizeof(*quad_list); + hr = IDirect3D7_CreateVertexBuffer(d3d, &desc, &vb_list, 0); + ok(hr == D3D_OK, "Failed to create vertex buffer, hr %#x.\n", hr); + hr = IDirect3DVertexBuffer7_Lock(vb_list, 0, &data, NULL); + ok(hr == D3D_OK, "Failed to lock vertex buffer, hr %#x.\n", hr); + memcpy(data, quad_list, sizeof(quad_list)); + hr = IDirect3DVertexBuffer7_Unlock(vb_list); + ok(hr == D3D_OK, "Failed to unlock vertex buffer, hr %#x.\n", hr); + + /* Try it first with a TRIANGLESTRIP. Do it with different geometry because + * the color fixups we have to do for FLAT shading will be dependent on that. */ + + for (i = 0; i < sizeof(tests) / sizeof(tests[0]); ++i) + { + hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); + ok(hr == D3D_OK, "Failed to clear, hr %#x.\n", hr); + + hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_SHADEMODE, tests[i].shademode); + ok(hr == D3D_OK, "Failed to set shade mode, hr %#x.\n", hr); + + hr = IDirect3DDevice7_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + buffer = tests[i].primtype == D3DPT_TRIANGLESTRIP ? vb_strip : vb_list; + count = tests[i].primtype == D3DPT_TRIANGLESTRIP ? 4 : 6; + hr = IDirect3DDevice7_DrawPrimitiveVB(device, tests[i].primtype, buffer, 0, count, 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); + + color0 = get_surface_color(rt, 100, 100); /* Inside first triangle */ + color1 = get_surface_color(rt, 500, 350); /* Inside second triangle */ + + /* For D3DSHADE_FLAT it should take the color of the first vertex of + * each triangle. This requires EXT_provoking_vertex or similar + * functionality being available. */ + /* PHONG should be the same as GOURAUD, since no hardware implements + * this. */ + ok(color0 == tests[i].color0, "Test %u shading has color0 %08x, expected %08x.\n", + i, color0, tests[i].color0); + ok(color1 == tests[i].color1, "Test %u shading has color1 %08x, expected %08x.\n", + i, color1, tests[i].color1); + } + + IDirect3DVertexBuffer7_Release(vb_strip); + IDirect3DVertexBuffer7_Release(vb_list); + IDirectDrawSurface7_Release(rt); + IDirect3D7_Release(d3d); + refcount = IDirect3DDevice7_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + DestroyWindow(window); +} + START_TEST(ddraw7) { HMODULE module = GetModuleHandleA("ddraw.dll"); @@ -9834,4 +10388,7 @@ test_signed_formats(); test_color_fill(); test_texcoordindex(); + test_colorkey_precision(); + test_range_colorkey(); + test_shademode(); } diff -Nru wine1.7-1.7.50/dlls/ddraw/tests/ddrawmodes.c wine1.7-1.7.55/dlls/ddraw/tests/ddrawmodes.c --- wine1.7-1.7.50/dlls/ddraw/tests/ddrawmodes.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ddraw/tests/ddrawmodes.c 2015-11-13 14:32:40.000000000 +0000 @@ -567,13 +567,13 @@ scrn.right, scrn.bottom, virt.left, virt.top, virt.right, virt.bottom); if (!EqualRect(&scrn, &orig_rect)) { - HRESULT rect_result; + BOOL rect_result, ret; /* Check that the client rect was resized */ - rc = GetClientRect(hwnd, &test); - ok(rc!=0, "GetClientRect returned %x\n", rc); - rc = EqualRect(&scrn, &test); - todo_wine ok(rc!=0, "Fullscreen window has wrong size\n"); + ret = GetClientRect(hwnd, &test); + ok(ret, "GetClientRect returned %d\n", ret); + ret = EqualRect(&scrn, &test); + todo_wine ok(ret, "Fullscreen window has wrong size\n"); /* Check that switching to normal cooperative level does not restore the display mode */ @@ -932,8 +932,8 @@ /* rect_before_create is assumed to hold the screen rect */ GetClientRect(hwnd, &window_rect); - rc = EqualRect(&rect_before_create, &window_rect); - ok(rc, "Fullscreen window has wrong size.\n"); + success = EqualRect(&rect_before_create, &window_rect); + ok(success, "Fullscreen window has wrong size.\n"); /* Set the focus window. Should fail */ rc = IDirectDraw_SetCooperativeLevel(lpDD, diff -Nru wine1.7-1.7.50/dlls/dinput/device.c wine1.7-1.7.55/dlls/dinput/device.c --- wine1.7-1.7.50/dlls/dinput/device.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dinput/device.c 2015-11-13 14:32:40.000000000 +0000 @@ -1631,8 +1631,9 @@ IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W(iface); if (!This->acquired) return DIERR_NOTACQUIRED; - /* Because wine devices do not need to be polled, just return DI_NOEFFECT */ - return DI_NOEFFECT; + + check_dinput_events(); + return DI_OK; } HRESULT WINAPI IDirectInputDevice2AImpl_Poll(LPDIRECTINPUTDEVICE8A iface) diff -Nru wine1.7-1.7.50/dlls/dinput/dinput_main.c wine1.7-1.7.55/dlls/dinput/dinput_main.c --- wine1.7-1.7.50/dlls/dinput/dinput_main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dinput/dinput_main.c 2015-11-13 14:32:40.000000000 +0000 @@ -1632,6 +1632,20 @@ LeaveCriticalSection(&dinput_hook_crit); } +void check_dinput_events(void) +{ + /* Windows does not do that, but our current implementation of winex11 + * requires periodic event polling to forward events to the wineserver. + * + * We have to call this function from multiple places, because: + * - some games do not explicitly poll for mouse events + * (for example Culpa Innata) + * - some games only poll the device, and neither keyboard nor mouse + * (for example Civilization: Call to Power 2) + */ + MsgWaitForMultipleObjectsEx(0, NULL, 0, QS_ALLINPUT, 0); +} + BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved) { switch(reason) diff -Nru wine1.7-1.7.50/dlls/dinput/dinput_private.h wine1.7-1.7.55/dlls/dinput/dinput_private.h --- wine1.7-1.7.50/dlls/dinput/dinput_private.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dinput/dinput_private.h 2015-11-13 14:32:40.000000000 +0000 @@ -63,6 +63,7 @@ extern const struct dinput_device joystick_osx_device DECLSPEC_HIDDEN; extern void check_dinput_hooks(LPDIRECTINPUTDEVICE8W) DECLSPEC_HIDDEN; +extern void check_dinput_events(void) DECLSPEC_HIDDEN; typedef int (*DI_EVENT_PROC)(LPDIRECTINPUTDEVICE8A, WPARAM, LPARAM); extern void _copy_diactionformatAtoW(LPDIACTIONFORMATW, LPDIACTIONFORMATA) DECLSPEC_HIDDEN; diff -Nru wine1.7-1.7.50/dlls/dinput/keyboard.c wine1.7-1.7.55/dlls/dinput/keyboard.c --- wine1.7-1.7.50/dlls/dinput/keyboard.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dinput/keyboard.c 2015-11-13 14:32:40.000000000 +0000 @@ -335,6 +335,8 @@ if (len != This->base.data_format.user_df->dwDataSize ) return DIERR_INVALIDPARAM; + check_dinput_events(); + EnterCriticalSection(&This->base.crit); if (TRACE_ON(dinput)) { diff -Nru wine1.7-1.7.50/dlls/dinput/Makefile.in wine1.7-1.7.55/dlls/dinput/Makefile.in --- wine1.7-1.7.50/dlls/dinput/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dinput/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -16,8 +16,6 @@ keyboard.c \ mouse.c -IMPLIB_SRCS = data_formats.c - IDL_SRCS = dinput_classes.idl RC_SRCS = dinput.rc diff -Nru wine1.7-1.7.50/dlls/dinput/mouse.c wine1.7-1.7.55/dlls/dinput/mouse.c --- wine1.7-1.7.50/dlls/dinput/mouse.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dinput/mouse.c 2015-11-13 14:32:40.000000000 +0000 @@ -549,13 +549,15 @@ static HRESULT WINAPI SysMouseWImpl_GetDeviceState(LPDIRECTINPUTDEVICE8W iface, DWORD len, LPVOID ptr) { SysMouseImpl *This = impl_from_IDirectInputDevice8W(iface); + TRACE("(%p)->(%u,%p)\n", This, len, ptr); if(This->base.acquired == 0) return DIERR_NOTACQUIRED; - TRACE("(this=%p,0x%08x,%p):\n", This, len, ptr); - _dump_mouse_state(&This->m_state); + check_dinput_events(); EnterCriticalSection(&This->base.crit); + _dump_mouse_state(&This->m_state); + /* Copy the current mouse state */ fill_DataFormat(ptr, len, &This->m_state, &This->base.data_format); diff -Nru wine1.7-1.7.50/dlls/dinput/tests/mouse.c wine1.7-1.7.55/dlls/dinput/tests/mouse.c --- wine1.7-1.7.50/dlls/dinput/tests/mouse.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dinput/tests/mouse.c 2015-11-13 14:32:40.000000000 +0000 @@ -93,6 +93,7 @@ DIPROPDWORD di_op; DIDEVICEOBJECTDATA mouse_state; DWORD cnt; + MSG msg; int i; if (! SetForegroundWindow(hwnd)) @@ -130,6 +131,8 @@ * loose mouse input */ hwnd2 = CreateWindowA("static", "Temporary", WS_VISIBLE, 10, 210, 200, 200, NULL, NULL, NULL, NULL); + ok(hwnd2 != NULL, "CreateWindowA failed with %u\n", GetLastError()); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); hr = IDirectInputDevice_GetDeviceState(pMouse, sizeof(m_state), &m_state); ok(hr == DIERR_NOTACQUIRED, "GetDeviceState() should have failed: %08x\n", hr); diff -Nru wine1.7-1.7.50/dlls/dnsapi/dnsapi.spec wine1.7-1.7.55/dlls/dnsapi/dnsapi.spec --- wine1.7-1.7.50/dlls/dnsapi/dnsapi.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dnsapi/dnsapi.spec 2015-11-13 14:32:40.000000000 +0000 @@ -79,7 +79,7 @@ @ stub DnsNotifyResolver @ stdcall DnsQuery_A(str long long ptr ptr ptr) @ stdcall DnsQueryConfig(long long wstr ptr ptr ptr) -@ stub DnsQueryEx +@ stdcall DnsQueryEx(ptr ptr ptr) @ stdcall DnsQuery_UTF8(str long long ptr ptr ptr) @ stdcall DnsQuery_W(wstr long long ptr ptr ptr) @ stub DnsRecordBuild_UTF8 diff -Nru wine1.7-1.7.50/dlls/dnsapi/query.c wine1.7-1.7.55/dlls/dnsapi/query.c --- wine1.7-1.7.50/dlls/dnsapi/query.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dnsapi/query.c 2015-11-13 14:32:40.000000000 +0000 @@ -641,6 +641,27 @@ #endif /* HAVE_RESOLV */ +static const char *debugstr_query_request(const DNS_QUERY_REQUEST *req) +{ + if (!req) + return "(null)"; + + return wine_dbg_sprintf("{%d %s %s %x%08x %p %d %p %p}", req->Version, + debugstr_w(req->QueryName), dns_type_to_str(req->QueryType), + (UINT32)(req->QueryOptions>>32u), (UINT32)req->QueryOptions, req->pDnsServerList, + req->InterfaceIndex, req->pQueryCompletionCallback, req->pQueryContext); +} + +/****************************************************************************** + * DnsQueryEx [DNSAPI.@] + * + */ +DNS_STATUS WINAPI DnsQueryEx(DNS_QUERY_REQUEST *request, DNS_QUERY_RESULT *result, DNS_QUERY_CANCEL *cancel) +{ + FIXME("(%s %p %p)\n", debugstr_query_request(request), result, cancel); + return DNS_ERROR_RCODE_NOT_IMPLEMENTED; +} + /****************************************************************************** * DnsQuery_A [DNSAPI.@] * diff -Nru wine1.7-1.7.50/dlls/dplayx/dplay.c wine1.7-1.7.55/dlls/dplayx/dplay.c --- wine1.7-1.7.50/dlls/dplayx/dplay.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dplayx/dplay.c 2015-11-13 14:32:40.000000000 +0000 @@ -5821,7 +5821,7 @@ guid_cache = HeapAlloc(GetProcessHeap(), 0, sizeof(GUID) * dwIndex); if (!guid_cache) { - ERR(": failed to alloc required memory.\n"); + ERR(": failed to allocate required memory.\n"); return DPERR_EXCEPTION; } cache_count = dwIndex; diff -Nru wine1.7-1.7.50/dlls/dplayx/dplobby.c wine1.7-1.7.55/dlls/dplayx/dplobby.c --- wine1.7-1.7.50/dlls/dplayx/dplobby.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dplayx/dplobby.c 2015-11-13 14:32:40.000000000 +0000 @@ -762,8 +762,6 @@ DWORD dwAtIndex; LPCSTR atKey = "Address Types"; LPCSTR guidDataSubKey = "Guid"; - FILETIME filetime; - TRACE(" this time through: %s\n", subKeyName ); diff -Nru wine1.7-1.7.50/dlls/dpnet/address.c wine1.7-1.7.55/dlls/dpnet/address.c --- wine1.7-1.7.50/dlls/dpnet/address.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dpnet/address.c 2015-11-13 14:32:40.000000000 +0000 @@ -159,6 +159,7 @@ break; } + heap_free(entry->name); heap_free(entry); } diff -Nru wine1.7-1.7.50/dlls/dwmapi/dwmapi_main.c wine1.7-1.7.55/dlls/dwmapi/dwmapi_main.c --- wine1.7-1.7.50/dlls/dwmapi/dwmapi_main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dwmapi/dwmapi_main.c 2015-11-13 14:32:40.000000000 +0000 @@ -250,3 +250,12 @@ FIXME("(%p) stub\n", hwnd); return E_NOTIMPL; } + +/********************************************************************** + * DwmUpdateThumbnailProperties (DWMAPI.@) + */ +HRESULT WINAPI DwmUpdateThumbnailProperties(HTHUMBNAIL thumbnail, const DWM_THUMBNAIL_PROPERTIES *props) +{ + FIXME("(%p, %p) stub\n", thumbnail, props); + return E_NOTIMPL; +} diff -Nru wine1.7-1.7.50/dlls/dwmapi/dwmapi.spec wine1.7-1.7.55/dlls/dwmapi/dwmapi.spec --- wine1.7-1.7.50/dlls/dwmapi/dwmapi.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dwmapi/dwmapi.spec 2015-11-13 14:32:40.000000000 +0000 @@ -42,4 +42,4 @@ @ stub DwmSetPresentParameters @ stdcall DwmSetWindowAttribute(long long ptr long) @ stdcall DwmUnregisterThumbnail(long) -@ stub DwmUpdateThumbnailProperties +@ stdcall DwmUpdateThumbnailProperties(ptr ptr) diff -Nru wine1.7-1.7.50/dlls/dwrite/analyzer.c wine1.7-1.7.55/dlls/dwrite/analyzer.c --- wine1.7-1.7.50/dlls/dwrite/analyzer.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dwrite/analyzer.c 2015-11-13 14:32:40.000000000 +0000 @@ -45,6 +45,8 @@ static const struct dwritescript_properties dwritescripts_properties[Script_LastId+1] = { { /* Zzzz */ { 0x7a7a7a5a, 999, 15, 0x0020, 0, 0, 0, 0, 0, 0, 0 } }, { /* Zyyy */ { 0x7979795a, 998, 1, 0x0020, 0, 1, 1, 0, 0, 0, 0 } }, + { /* Ahom */ { 0x6d6f6841, 338, 1, 0x0020, 0, 0, 0, 0, 0, 0, 0 } }, + { /* Hluw */ { 0x77756c48, 80, 1, 0x0020, 0, 0, 0, 0, 0, 0, 0 } }, { /* Arab */ { 0x62617241, 160, 8, 0x0640, 0, 1, 0, 0, 0, 1, 1 }, _OT('a','r','a','b'), 0, TRUE }, { /* Armn */ { 0x6e6d7241, 230, 1, 0x0020, 0, 1, 1, 0, 0, 0, 0 }, _OT('a','r','m','n') }, { /* Avst */ { 0x74737641, 134, 8, 0x0020, 0, 1, 1, 0, 0, 0, 0 }, _OT('a','v','s','t') }, @@ -84,6 +86,7 @@ { /* Hani */ { 0x696e6148, 500, 8, 0x0020, 0, 0, 1, 1, 0, 0, 0 }, _OT('h','a','n','i') }, { /* Hang */ { 0x676e6148, 286, 8, 0x0020, 1, 1, 1, 1, 0, 0, 0 }, _OT('h','a','n','g'), 0, TRUE }, { /* Hano */ { 0x6f6e6148, 371, 8, 0x0020, 0, 0, 1, 0, 0, 0, 0 }, _OT('h','a','n','o') }, + { /* Hatr */ { 0x72746148, 127, 1, 0x0020, 0, 0, 0, 0, 0, 0, 0 } }, { /* Hebr */ { 0x72626548, 125, 8, 0x0020, 1, 1, 1, 0, 0, 0, 0 }, _OT('h','e','b','r'), 0, TRUE }, { /* Hira */ { 0x61726948, 410, 8, 0x0020, 0, 0, 1, 1, 0, 0, 0 }, _OT('k','a','n','a') }, { /* Armi */ { 0x696d7241, 124, 1, 0x0020, 0, 1, 1, 0, 0, 0, 0 }, _OT('a','r','m','i') }, @@ -119,12 +122,14 @@ { /* Modi */ { 0x69646f4d, 324, 1, 0x0020, 0, 0, 0, 0, 0, 0, 0 } }, { /* Mong */ { 0x676e6f4d, 145, 8, 0x0020, 0, 1, 0, 0, 0, 1, 1 }, _OT('m','o','n','g'), 0, TRUE }, { /* Mroo */ { 0x6f6f724d, 199, 1, 0x0020, 0, 0, 0, 0, 0, 0, 0 } }, + { /* Mult */ { 0x746c754d, 323, 1, 0x0020, 0, 0, 0, 0, 0, 0, 0 } }, { /* Mymr */ { 0x726d794d, 350, 15, 0x0020, 1, 1, 1, 0, 0, 0, 0 }, _OT('m','y','m','r'), 0, TRUE }, { /* Nbat */ { 0x7461624e, 159, 1, 0x0020, 0, 0, 0, 0, 0, 0, 0 } }, { /* Talu */ { 0x756c6154, 354, 8, 0x0020, 1, 1, 1, 0, 0, 0, 0 }, _OT('t','a','l','u'), 0, TRUE }, { /* Nkoo */ { 0x6f6f6b4e, 165, 8, 0x0020, 0, 1, 0, 0, 0, 1, 1 }, _OT('n','k','o',' '), 0, TRUE }, { /* Ogam */ { 0x6d61674f, 212, 1, 0x1680, 0, 1, 0, 0, 0, 1, 0 }, _OT('o','g','a','m'), 0, TRUE }, { /* Olck */ { 0x6b636c4f, 261, 1, 0x0020, 0, 1, 1, 0, 0, 0, 0 }, _OT('o','l','c','k') }, + { /* Hung */ { 0x676e7548, 176, 1, 0x0020, 0, 0, 0, 0, 0, 0, 0 } }, { /* Ital */ { 0x6c617449, 210, 1, 0x0020, 0, 1, 1, 0, 0, 0, 0 }, _OT('i','t','a','l') }, { /* Narb */ { 0x6272614e, 106, 1, 0x0020, 0, 0, 0, 0, 0, 0, 0 } }, { /* Perm */ { 0x6d726550, 227, 1, 0x0020, 0, 0, 0, 0, 0, 0, 0 } }, @@ -146,6 +151,7 @@ { /* Shrd */ { 0x64726853, 319, 1, 0x0020, 0, 0, 0, 0, 0, 0, 0 }, _OT('s','h','r','d') }, { /* Shaw */ { 0x77616853, 281, 1, 0x0020, 0, 1, 1, 0, 0, 0, 0 }, _OT('s','h','a','w') }, { /* Sidd */ { 0x64646953, 302, 1, 0x0020, 0, 0, 0, 0, 0, 0, 0 } }, + { /* Sgnw */ { 0x776e6753, 95, 1, 0x0020, 0, 0, 0, 0, 0, 0, 0 } }, { /* Sinh */ { 0x686e6953, 348, 8, 0x0020, 1, 1, 1, 0, 0, 0, 0 }, _OT('s','i','n','h'), 0, TRUE }, { /* Sora */ { 0x61726f53, 398, 1, 0x0020, 0, 0, 0, 0, 0, 0, 0 }, _OT('s','o','r','a') }, { /* Sund */ { 0x646e7553, 362, 8, 0x0020, 1, 1, 1, 0, 0, 0, 0 }, _OT('s','u','n','d') }, @@ -1192,9 +1198,11 @@ advance += trailing_spacing; modified_advances[end-1] += trailing_spacing; } - if (advance < min_advance_width) { + + advance = min_advance_width - advance; + if (advance > 0.0f) { /* additional spacing is only applied to leading and trailing glyph */ - FLOAT half = (min_advance_width - advance) / 2.0; + FLOAT half = advance / 2.0f; if (!reduced) { origin -= half; @@ -1207,13 +1215,11 @@ modified_advances[end-1] += half; } else if (leading_spacing < 0.0) { - origin -= min_advance_width - advance; - modified_advances[start] += min_advance_width - advance; + origin -= advance; + modified_advances[start] += advance; } else - modified_advances[end-1] += min_advance_width - advance; - - advance = min_advance_width; + modified_advances[end-1] += advance; } /* now apply positive spacing adjustments */ @@ -1311,7 +1317,6 @@ return S_OK; } - start = 0; for (start = 0; start < len;) { UINT32 length = get_cluster_length(clustermap, start, len); diff -Nru wine1.7-1.7.50/dlls/dwrite/bracket.c wine1.7-1.7.55/dlls/dwrite/bracket.c --- wine1.7-1.7.50/dlls/dwrite/bracket.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dwrite/bracket.c 2015-11-13 14:32:40.000000000 +0000 @@ -1,5 +1,5 @@ /* Unicode Bidirectional Bracket table */ -/* generated from http://www.unicode.org/Public/7.0.0/ucd/BidiBrackets.txt */ +/* generated from http://www.unicode.org/Public/8.0.0/ucd/BidiBrackets.txt */ /* DO NOT EDIT!! */ const unsigned short bidi_bracket_table[768] = diff -Nru wine1.7-1.7.50/dlls/dwrite/dwrite_private.h wine1.7-1.7.55/dlls/dwrite/dwrite_private.h --- wine1.7-1.7.50/dlls/dwrite/dwrite_private.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dwrite/dwrite_private.h 2015-11-13 14:32:40.000000000 +0000 @@ -122,6 +122,7 @@ 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_textanalyzer(IDWriteTextAnalyzer**) DECLSPEC_HIDDEN; @@ -129,8 +130,8 @@ extern HRESULT create_localfontfileloader(IDWriteLocalFontFileLoader** iface) DECLSPEC_HIDDEN; extern HRESULT create_fontface(DWRITE_FONT_FACE_TYPE,UINT32,IDWriteFontFile* const*,UINT32,DWRITE_FONT_SIMULATIONS,IDWriteFontFace2**) DECLSPEC_HIDDEN; extern HRESULT create_font_collection(IDWriteFactory2*,IDWriteFontFileEnumerator*,BOOL,IDWriteFontCollection**) DECLSPEC_HIDDEN; -extern HRESULT create_glyphrunanalysis(DWRITE_RENDERING_MODE,DWRITE_MEASURING_MODE,DWRITE_GLYPH_RUN const*,FLOAT,DWRITE_GRID_FIT_MODE, - DWRITE_TEXT_ANTIALIAS_MODE,FLOAT,FLOAT,IDWriteGlyphRunAnalysis**) 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; extern HRESULT get_local_refkey(const WCHAR*,const FILETIME*,void**,UINT32*) DECLSPEC_HIDDEN; extern HRESULT get_filestream_from_file(IDWriteFontFile*,IDWriteFontFileStream**) DECLSPEC_HIDDEN; @@ -191,6 +192,18 @@ extern HRESULT new_glyph_outline(UINT32,struct glyph_outline**) DECLSPEC_HIDDEN; /* FreeType integration */ +struct dwrite_glyphbitmap { + IDWriteFontFace2 *fontface; + FLOAT emsize; + BOOL nohint; + UINT16 index; + INT pitch; + RECT bbox; + BYTE *buf; + DWRITE_TEXTURE_TYPE type; + DWRITE_MATRIX *m; +}; + extern BOOL init_freetype(void) DECLSPEC_HIDDEN; extern void release_freetype(void) DECLSPEC_HIDDEN; extern HRESULT freetype_get_design_glyph_metrics(IDWriteFontFace2*,UINT16,UINT16,DWRITE_GLYPH_METRICS*) DECLSPEC_HIDDEN; @@ -201,9 +214,10 @@ extern UINT16 freetype_get_glyphindex(IDWriteFontFace2*,UINT32,INT) DECLSPEC_HIDDEN; extern BOOL freetype_has_kerning_pairs(IDWriteFontFace2*) DECLSPEC_HIDDEN; extern INT32 freetype_get_kerning_pair_adjustment(IDWriteFontFace2*,UINT16,UINT16) DECLSPEC_HIDDEN; -extern void freetype_get_glyph_bbox(IDWriteFontFace2*,FLOAT,UINT16,BOOL,RECT*) DECLSPEC_HIDDEN; -extern void freetype_get_glyph_bitmap(IDWriteFontFace2*,FLOAT,UINT16,const RECT*,BYTE*) DECLSPEC_HIDDEN; +extern void freetype_get_glyph_bbox(struct dwrite_glyphbitmap*) DECLSPEC_HIDDEN; +extern BOOL freetype_get_glyph_bitmap(struct dwrite_glyphbitmap*) DECLSPEC_HIDDEN; extern INT freetype_get_charmap_index(IDWriteFontFace2*,BOOL*) DECLSPEC_HIDDEN; +extern INT32 freetype_get_glyph_advance(IDWriteFontFace2*,FLOAT,UINT16,DWRITE_MEASURING_MODE) DECLSPEC_HIDDEN; /* Glyph shaping */ enum SCRIPT_JUSTIFY diff -Nru wine1.7-1.7.50/dlls/dwrite/font.c wine1.7-1.7.55/dlls/dwrite/font.c --- wine1.7-1.7.50/dlls/dwrite/font.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dwrite/font.c 2015-11-13 14:32:40.000000000 +0000 @@ -2,7 +2,7 @@ * Font and collections * * Copyright 2011 Huw Davies - * Copyright 2012, 2014 Nikolay Sivov for CodeWeavers + * Copyright 2012, 2014-2015 Nikolay Sivov for CodeWeavers * Copyright 2014 Aric Stewart for CodeWeavers * * This library is free software; you can redistribute it and/or @@ -42,11 +42,23 @@ static const FLOAT RECOMMENDED_OUTLINE_A_THRESHOLD = 350.0f; static const FLOAT RECOMMENDED_NATURAL_PPEM = 20.0f; -/* common modifiers used in names */ static const WCHAR extraW[] = {'e','x','t','r','a',0}; static const WCHAR ultraW[] = {'u','l','t','r','a',0}; static const WCHAR semiW[] = {'s','e','m','i',0}; static const WCHAR extW[] = {'e','x','t',0}; +static const WCHAR thinW[] = {'t','h','i','n',0}; +static const WCHAR lightW[] = {'l','i','g','h','t',0}; +static const WCHAR mediumW[] = {'m','e','d','i','u','m',0}; +static const WCHAR blackW[] = {'b','l','a','c','k',0}; +static const WCHAR condensedW[] = {'c','o','n','d','e','n','s','e','d',0}; +static const WCHAR expandedW[] = {'e','x','p','a','n','d','e','d',0}; +static const WCHAR italicW[] = {'i','t','a','l','i','c',0}; +static const WCHAR boldW[] = {'B','o','l','d',0}; +static const WCHAR obliqueW[] = {'O','b','l','i','q','u','e',0}; +static const WCHAR regularW[] = {'R','e','g','u','l','a','r',0}; +static const WCHAR demiW[] = {'d','e','m','i',0}; +static const WCHAR spaceW[] = {' ',0}; +static const WCHAR enusW[] = {'e','n','-','u','s',0}; struct dwrite_font_propvec { FLOAT stretch; @@ -74,6 +86,21 @@ UINT32 face_index; WCHAR *facename; + + USHORT simulations; + + /* used to mark font as tested when scanning for simulation candidate */ + BOOL bold_sim_tested : 1; + BOOL oblique_sim_tested : 1; +}; + +struct dwrite_fontlist { + IDWriteFontList IDWriteFontList_iface; + LONG ref; + + IDWriteFontFamily *family; + struct dwrite_font_data **fonts; + UINT32 font_count; }; struct dwrite_fontfamily_data { @@ -84,6 +111,9 @@ struct dwrite_font_data **fonts; UINT32 font_count; UINT32 font_alloc; + BOOL has_normal_face : 1; + BOOL has_oblique_face : 1; + BOOL has_italic_face : 1; }; struct dwrite_fontcollection { @@ -111,7 +141,6 @@ IDWriteFontFamily *family; - USHORT simulations; DWRITE_FONT_STYLE style; struct dwrite_font_data *data; }; @@ -123,9 +152,10 @@ BOOL exists; }; -enum runanalysis_readystate { - RUNANALYSIS_BOUNDS = 1 << 0, - RUNANALYSIS_BITMAP = 1 << 1, +enum runanalysis_flags { + RUNANALYSIS_BOUNDS_READY = 1 << 0, + RUNANALYSIS_BITMAP_READY = 1 << 1, + RUNANALYSIS_USE_TRANSFORM = 1 << 2 }; struct dwrite_glyphrunanalysis { @@ -133,15 +163,16 @@ LONG ref; DWRITE_RENDERING_MODE rendering_mode; - DWRITE_GLYPH_RUN run; + DWRITE_GLYPH_RUN run; /* glyphAdvances and glyphOffsets are not used */ + DWRITE_MATRIX m; FLOAT ppdip; - FLOAT originX; - FLOAT originY; UINT16 *glyphs; - FLOAT *advances; - DWRITE_GLYPH_OFFSET *offsets; + D2D_POINT_2F origin; + D2D_POINT_2F *advances; + D2D_POINT_2F *advanceoffsets; + D2D_POINT_2F *ascenderoffsets; - UINT8 ready; + UINT8 flags; RECT bounds; BYTE *bitmap; }; @@ -224,9 +255,14 @@ return CONTAINING_RECORD(iface, struct dwrite_colorglyphenum, IDWriteColorGlyphRunEnumerator_iface); } +static inline struct dwrite_fontlist *impl_from_IDWriteFontList(IDWriteFontList *iface) +{ + return CONTAINING_RECORD(iface, struct dwrite_fontlist, IDWriteFontList_iface); +} + static inline const char *debugstr_tag(UINT32 tag) { - return wine_dbg_sprintf("%c%c%c%c", tag & 0xff, (tag >> 8) & 0xff, (tag >> 16) & 0xff, tag >> 24); + return debugstr_an((char*)&tag, 4); } static HRESULT get_cached_glyph_metrics(struct dwrite_fontface *fontface, UINT16 glyph, DWRITE_GLYPH_METRICS *metrics) @@ -397,6 +433,8 @@ if (This->files[i]) IDWriteFontFile_Release(This->files[i]); } + heap_free(This->streams); + heap_free(This->files); for (i = 0; i < sizeof(This->glyphs)/sizeof(This->glyphs[0]); i++) heap_free(This->glyphs[i]); @@ -532,7 +570,7 @@ { struct dwrite_fontface *This = impl_from_IDWriteFontFace2(iface); - TRACE("(%p)->(%u %p %p %p %p)\n", This, table_tag, table_data, table_size, context, exists); + TRACE("(%p)->(%s %p %p %p %p)\n", This, debugstr_tag(table_tag), table_data, table_size, context, exists); return opentype_get_font_table(This->streams[0], This->type, This->index, table_tag, table_data, context, table_size, exists); } @@ -751,7 +789,8 @@ DWRITE_GLYPH_METRICS *metrics, BOOL is_sideways) { struct dwrite_fontface *This = impl_from_IDWriteFontFace2(iface); - FLOAT scale; + DWRITE_MEASURING_MODE mode; + FLOAT scale, size; HRESULT hr; UINT32 i; @@ -761,7 +800,9 @@ if (m && memcmp(m, &identity, sizeof(*m))) FIXME("transform is not supported, %s\n", debugstr_matrix(m)); - scale = emSize * ppdip / This->metrics.designUnitsPerEm; + size = emSize * ppdip; + scale = size / This->metrics.designUnitsPerEm; + mode = use_gdi_natural ? DWRITE_MEASURING_MODE_GDI_NATURAL : DWRITE_MEASURING_MODE_GDI_CLASSIC; for (i = 0; i < glyph_count; i++) { DWRITE_GLYPH_METRICS *ret = metrics + i; @@ -771,9 +812,11 @@ if (FAILED(hr)) return hr; + ret->advanceWidth = freetype_get_glyph_advance(iface, size, glyphs[i], mode); + ret->advanceWidth = round_metric(ret->advanceWidth * This->metrics.designUnitsPerEm / size); + #define SCALE_METRIC(x) ret->x = round_metric(round_metric((design.x) * scale) / scale) SCALE_METRIC(leftSideBearing); - SCALE_METRIC(advanceWidth); SCALE_METRIC(rightSideBearing); SCALE_METRIC(topSideBearing); SCALE_METRIC(advanceHeight); @@ -884,16 +927,11 @@ TRACE("(%p)->(%u %p %p %d)\n", This, glyph_count, glyphs, advances, is_sideways); - for (i = 0; i < glyph_count; i++) { - DWRITE_GLYPH_METRICS metrics = { 0 }; - HRESULT hr; - - hr = IDWriteFontFace2_GetDesignGlyphMetrics(iface, glyphs + i, 1, &metrics, is_sideways); - if (FAILED(hr)) - return hr; + if (is_sideways) + FIXME("sideways mode not supported\n"); - advances[i] = is_sideways ? metrics.advanceHeight : metrics.advanceWidth; - } + for (i = 0; i < glyph_count; i++) + advances[i] = freetype_get_glyph_advance(iface, This->metrics.designUnitsPerEm, glyphs[i], DWRITE_MEASURING_MODE_NATURAL); return S_OK; } @@ -903,8 +941,7 @@ BOOL is_sideways, UINT32 glyph_count, UINT16 const *glyphs, INT32 *advances) { struct dwrite_fontface *This = impl_from_IDWriteFontFace2(iface); - FLOAT scale; - HRESULT hr; + DWRITE_MEASURING_MODE mode; UINT32 i; TRACE("(%p)->(%.2f %.2f %p %d %d %u %p %p)\n", This, em_size, ppdip, m, @@ -915,8 +952,8 @@ return E_INVALIDARG; } - scale = em_size * ppdip / This->metrics.designUnitsPerEm; - if (scale == 0.0) { + em_size *= ppdip; + if (em_size == 0.0) { memset(advances, 0, sizeof(*advances) * glyph_count); return S_OK; } @@ -924,14 +961,10 @@ if (m && memcmp(m, &identity, sizeof(*m))) FIXME("transform is not supported, %s\n", debugstr_matrix(m)); + mode = use_gdi_natural ? DWRITE_MEASURING_MODE_GDI_NATURAL : DWRITE_MEASURING_MODE_GDI_CLASSIC; for (i = 0; i < glyph_count; i++) { - hr = IDWriteFontFace2_GetDesignGlyphAdvances(iface, 1, glyphs + i, advances + i, is_sideways); - if (FAILED(hr)) - return hr; - -#define SCALE_METRIC(x) x = round_metric(round_metric((x) * scale) / scale) - SCALE_METRIC(advances[i]); -#undef SCALE_METRIC + advances[i] = freetype_get_glyph_advance(iface, em_size, glyphs[i], mode); + advances[i] = round_metric(advances[i] * This->metrics.designUnitsPerEm / em_size); } return S_OK; @@ -1039,6 +1072,8 @@ if (is_sideways) FIXME("sideways mode not supported\n"); + emSize *= max(dpiX, dpiY) / 96.0f; + *renderingmode = DWRITE_RENDERING_MODE_DEFAULT; *gridfitmode = DWRITE_GRID_FIT_MODE_DEFAULT; if (params) { @@ -1126,7 +1161,7 @@ *fontface = NULL; hr = IDWriteFactory2_CreateFontFace(data->factory, data->face_type, 1, &data->file, - data->face_index, font->simulations, &face); + data->face_index, font->data->simulations, &face); if (FAILED(hr)) return hr; @@ -1221,57 +1256,16 @@ hr = get_fontface_from_font(This, &fontface); if (FAILED(hr)) - return hr; + return FALSE; return IDWriteFontFace2_IsSymbolFont(fontface); } static HRESULT WINAPI dwritefont_GetFaceNames(IDWriteFont2 *iface, IDWriteLocalizedStrings **names) { - static const WCHAR boldobliqueW[] = {'B','o','l','d',' ','O','b','l','i','q','u','e',0}; - static const WCHAR obliqueW[] = {'O','b','l','i','q','u','e',0}; - static const WCHAR boldW[] = {'B','o','l','d',0}; - static const WCHAR enusW[] = {'e','n','-','u','s',0}; - struct dwrite_font *This = impl_from_IDWriteFont2(iface); - IDWriteLocalizedStrings *strings; - const WCHAR *name; - HRESULT hr; - TRACE("(%p)->(%p)\n", This, names); - - *names = NULL; - - if (This->simulations == DWRITE_FONT_SIMULATIONS_NONE) - return clone_localizedstring(This->data->names, names); - - switch (This->simulations) { - case DWRITE_FONT_SIMULATIONS_BOLD|DWRITE_FONT_SIMULATIONS_OBLIQUE: - name = boldobliqueW; - break; - case DWRITE_FONT_SIMULATIONS_BOLD: - name = boldW; - break; - case DWRITE_FONT_SIMULATIONS_OBLIQUE: - name = obliqueW; - break; - default: - ERR("unknown simulations %d\n", This->simulations); - return E_FAIL; - } - - hr = create_localizedstrings(&strings); - if (FAILED(hr)) return hr; - - hr = add_localizedstring(strings, enusW, name); - if (FAILED(hr)) { - IDWriteLocalizedStrings_Release(strings); - return hr; - } - - *names = strings; - - return S_OK; + return clone_localizedstring(This->data->names, names); } static HRESULT WINAPI dwritefont_GetInformationalStrings(IDWriteFont2 *iface, @@ -1325,7 +1319,7 @@ { struct dwrite_font *This = impl_from_IDWriteFont2(iface); TRACE("(%p)\n", This); - return This->simulations; + return This->data->simulations; } static void WINAPI dwritefont_GetMetrics(IDWriteFont2 *iface, DWRITE_FONT_METRICS *metrics) @@ -1413,7 +1407,7 @@ hr = get_fontface_from_font(This, &fontface); if (FAILED(hr)) - return hr; + return FALSE; return IDWriteFontFace2_IsMonospacedFont(fontface); } @@ -1455,8 +1449,7 @@ dwritefont2_IsColorFont }; -static HRESULT create_font(struct dwrite_font_data *data, IDWriteFontFamily *family, DWRITE_FONT_SIMULATIONS simulations, - IDWriteFont **font) +static HRESULT create_font(struct dwrite_font_data *data, IDWriteFontFamily *family, IDWriteFont **font) { struct dwrite_font *This; *font = NULL; @@ -1468,20 +1461,100 @@ This->ref = 1; This->family = family; IDWriteFontFamily_AddRef(family); - This->simulations = simulations; This->style = data->style; This->data = data; InterlockedIncrement(&This->data->ref); - /* set oblique style from requested simulation */ - if ((simulations & DWRITE_FONT_SIMULATIONS_OBLIQUE) && data->style == DWRITE_FONT_STYLE_NORMAL) - This->style = DWRITE_FONT_STYLE_OBLIQUE; - *font = (IDWriteFont*)&This->IDWriteFont2_iface; return S_OK; } +/* IDWriteFontList */ +static HRESULT WINAPI dwritefontlist_QueryInterface(IDWriteFontList *iface, REFIID riid, void **obj) +{ + struct dwrite_fontlist *This = impl_from_IDWriteFontList(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj); + + if (IsEqualIID(riid, &IID_IDWriteFontList) || + IsEqualIID(riid, &IID_IUnknown)) + { + *obj = iface; + IDWriteFontList_AddRef(iface); + return S_OK; + } + + *obj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI dwritefontlist_AddRef(IDWriteFontList *iface) +{ + struct dwrite_fontlist *This = impl_from_IDWriteFontList(iface); + ULONG ref = InterlockedIncrement(&This->ref); + TRACE("(%p)->(%d)\n", This, ref); + return ref; +} + +static ULONG WINAPI dwritefontlist_Release(IDWriteFontList *iface) +{ + struct dwrite_fontlist *This = impl_from_IDWriteFontList(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p)->(%d)\n", This, ref); + + if (!ref) { + UINT32 i; + + for (i = 0; i < This->font_count; i++) + release_font_data(This->fonts[i]); + IDWriteFontFamily_Release(This->family); + heap_free(This); + } + + return ref; +} + +static HRESULT WINAPI dwritefontlist_GetFontCollection(IDWriteFontList *iface, IDWriteFontCollection **collection) +{ + struct dwrite_fontlist *This = impl_from_IDWriteFontList(iface); + return IDWriteFontFamily_GetFontCollection(This->family, collection); +} + +static UINT32 WINAPI dwritefontlist_GetFontCount(IDWriteFontList *iface) +{ + struct dwrite_fontlist *This = impl_from_IDWriteFontList(iface); + TRACE("(%p)\n", This); + return This->font_count; +} + +static HRESULT WINAPI dwritefontlist_GetFont(IDWriteFontList *iface, UINT32 index, IDWriteFont **font) +{ + struct dwrite_fontlist *This = impl_from_IDWriteFontList(iface); + + TRACE("(%p)->(%u %p)\n", This, index, font); + + *font = NULL; + + if (This->font_count == 0) + return S_FALSE; + + if (index >= This->font_count) + return E_INVALIDARG; + + return create_font(This->fonts[index], This->family, font); +} + +static const IDWriteFontListVtbl dwritefontlistvtbl = { + dwritefontlist_QueryInterface, + dwritefontlist_AddRef, + dwritefontlist_Release, + dwritefontlist_GetFontCollection, + dwritefontlist_GetFontCount, + dwritefontlist_GetFont +}; + static HRESULT WINAPI dwritefontfamily_QueryInterface(IDWriteFontFamily *iface, REFIID riid, void **obj) { struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface); @@ -1556,7 +1629,7 @@ if (index >= This->data->font_count) return E_INVALIDARG; - return create_font(This->data->fonts[index], iface, DWRITE_FONT_SIMULATIONS_NONE, font); + return create_font(This->data->fonts[index], iface, font); } static HRESULT WINAPI dwritefontfamily_GetFamilyNames(IDWriteFontFamily *iface, IDWriteLocalizedStrings **names) @@ -1610,7 +1683,6 @@ DWRITE_FONT_STRETCH stretch, DWRITE_FONT_STYLE style, IDWriteFont **font) { struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface); - DWRITE_FONT_SIMULATIONS simulations; struct dwrite_font_propvec req; struct dwrite_font_data *match; UINT32 i; @@ -1630,21 +1702,97 @@ match = This->data->fonts[i]; } - simulations = DWRITE_FONT_SIMULATIONS_NONE; - if (((style == DWRITE_FONT_STYLE_ITALIC) || (style == DWRITE_FONT_STYLE_OBLIQUE)) && - match->style == DWRITE_FONT_STYLE_NORMAL) { - simulations = DWRITE_FONT_SIMULATIONS_OBLIQUE; - } + return create_font(match, iface, font); +} + +typedef BOOL (*matching_filter_func)(const struct dwrite_font_data*); + +static BOOL is_font_acceptable_for_normal(const struct dwrite_font_data *font) +{ + return font->style == DWRITE_FONT_STYLE_NORMAL || font->style == DWRITE_FONT_STYLE_ITALIC; +} - return create_font(match, iface, simulations, font); +static BOOL is_font_acceptable_for_oblique_italic(const struct dwrite_font_data *font) +{ + return font->style == DWRITE_FONT_STYLE_OBLIQUE || font->style == DWRITE_FONT_STYLE_ITALIC; +} + +static void matchingfonts_sort(struct dwrite_fontlist *fonts, const struct dwrite_font_propvec *req) +{ + UINT32 b = fonts->font_count - 1, j, t; + + while (1) { + t = b; + + for (j = 0; j < b; j++) { + if (is_better_font_match(&fonts->fonts[j+1]->propvec, &fonts->fonts[j]->propvec, req)) { + struct dwrite_font_data *s = fonts->fonts[j]; + fonts->fonts[j] = fonts->fonts[j+1]; + fonts->fonts[j+1] = s; + t = j; + } + } + + if (t == b) + break; + b = t; + }; } static HRESULT WINAPI dwritefontfamily_GetMatchingFonts(IDWriteFontFamily *iface, DWRITE_FONT_WEIGHT weight, - DWRITE_FONT_STRETCH stretch, DWRITE_FONT_STYLE style, IDWriteFontList **fonts) + DWRITE_FONT_STRETCH stretch, DWRITE_FONT_STYLE style, IDWriteFontList **ret) { struct dwrite_fontfamily *This = impl_from_IDWriteFontFamily(iface); - FIXME("(%p)->(%d %d %d %p): stub\n", This, weight, stretch, style, fonts); - return E_NOTIMPL; + matching_filter_func func = NULL; + struct dwrite_font_propvec req; + struct dwrite_fontlist *fonts; + UINT32 i; + + TRACE("(%p)->(%d %d %d %p)\n", This, weight, stretch, style, ret); + + *ret = NULL; + + fonts = heap_alloc(sizeof(*fonts)); + if (!fonts) + return E_OUTOFMEMORY; + + /* Allocate as many as family has, not all of them will be necessary used. */ + fonts->fonts = heap_alloc(sizeof(*fonts->fonts) * This->data->font_count); + if (!fonts->fonts) { + heap_free(fonts); + return E_OUTOFMEMORY; + } + + fonts->IDWriteFontList_iface.lpVtbl = &dwritefontlistvtbl; + fonts->ref = 1; + fonts->family = iface; + IDWriteFontFamily_AddRef(fonts->family); + fonts->font_count = 0; + + /* Normal style accepts Normal or Italic, Oblique and Italic - both Oblique and Italic styles */ + if (style == DWRITE_FONT_STYLE_NORMAL) { + if (This->data->has_normal_face || This->data->has_italic_face) + func = is_font_acceptable_for_normal; + } + else /* requested oblique or italic */ { + if (This->data->has_oblique_face || This->data->has_italic_face) + func = is_font_acceptable_for_oblique_italic; + } + + for (i = 0; i < This->data->font_count; i++) { + if (!func || func(This->data->fonts[i])) { + fonts->fonts[fonts->font_count] = This->data->fonts[i]; + InterlockedIncrement(&This->data->fonts[i]->ref); + fonts->font_count++; + } + } + + /* now potential matches are sorted using same criteria GetFirstMatchingFont uses */ + init_font_prop_vec(weight, stretch, style, &req); + matchingfonts_sort(fonts, &req); + + *ret = &fonts->IDWriteFontList_iface; + return S_OK; } static const IDWriteFontFamilyVtbl fontfamilyvtbl = { @@ -1810,7 +1958,6 @@ struct dwrite_fontcollection *This = impl_from_IDWriteFontCollection(iface); struct dwrite_fontfamily_data *found_family = NULL; struct dwrite_font_data *found_font = NULL; - DWRITE_FONT_SIMULATIONS simulations; IDWriteFontFamily *family; UINT32 i, j, face_index; IDWriteFontFile *file; @@ -1849,8 +1996,7 @@ if (FAILED(hr)) return hr; - simulations = IDWriteFontFace_GetSimulations(face); - hr = create_font(found_font, family, simulations, font); + hr = create_font(found_font, family, font); IDWriteFontFamily_Release(family); return hr; } @@ -1881,6 +2027,12 @@ family_data->fonts[family_data->font_count] = font_data; family_data->font_count++; + if (font_data->style == DWRITE_FONT_STYLE_NORMAL) + family_data->has_normal_face = TRUE; + else if (font_data->style == DWRITE_FONT_STYLE_OBLIQUE) + family_data->has_oblique_face = TRUE; + else + family_data->has_italic_face = TRUE; return S_OK; } @@ -1910,10 +2062,10 @@ collection->IDWriteFontCollection_iface.lpVtbl = &fontcollectionvtbl; collection->ref = 1; collection->family_count = 0; - collection->family_alloc = 2; + collection->family_alloc = is_system ? 30 : 5; collection->is_system = is_system; - collection->family_data = heap_alloc(sizeof(*collection->family_data)*2); + collection->family_data = heap_alloc(sizeof(*collection->family_data) * collection->family_alloc); if (!collection->family_data) return E_OUTOFMEMORY; @@ -1947,7 +2099,6 @@ static void fontstrings_get_en_string(IDWriteLocalizedStrings *strings, WCHAR *buffer, UINT32 size) { - static const WCHAR enusW[] = {'e','n','-','U','S',0}; BOOL exists = FALSE; UINT32 index; HRESULT hr; @@ -1983,7 +2134,8 @@ struct name_token { struct list entry; const WCHAR *ptr; - INT len; + INT len; /* token length */ + INT fulllen; /* full length including following separators */ }; static inline BOOL is_name_separator_char(WCHAR ch) @@ -1996,13 +2148,13 @@ const WCHAR *part2; /* optional, if not NULL should point to non-empty string */ }; -static BOOL match_pattern_list(struct list *tokens, const struct name_pattern *patterns) +static BOOL match_pattern_list(struct list *tokens, const struct name_pattern *patterns, struct name_token *match) { const struct name_pattern *pattern; struct name_token *token; int i = 0; - while ((pattern = &patterns[++i])->part1) { + while ((pattern = &patterns[i++])->part1) { int len_part1 = strlenW(pattern->part1); int len_part2 = pattern->part2 ? strlenW(pattern->part2) : 0; @@ -2013,6 +2165,7 @@ continue; if (!strncmpiW(token->ptr, pattern->part1, len_part1)) { + if (match) *match = *token; list_remove(&token->entry); heap_free(token); return TRUE; @@ -2035,6 +2188,7 @@ continue; /* combined string match */ + if (match) *match = *token; list_remove(&token->entry); heap_free(token); return TRUE; @@ -2057,6 +2211,10 @@ continue; /* both parts matched, remove tokens */ + if (match) { + match->ptr = next_token->ptr; + match->len = (token->ptr - next_token->ptr) + token->len; + } list_remove(&token->entry); list_remove(&next_token->entry); heap_free(next_token); @@ -2067,19 +2225,21 @@ } } + if (match) { + match->ptr = NULL; + match->len = 0; + } return FALSE; } -static DWRITE_FONT_STYLE font_extract_style(struct list *tokens, DWRITE_FONT_STYLE style) +static DWRITE_FONT_STYLE font_extract_style(struct list *tokens, DWRITE_FONT_STYLE style, struct name_token *match) { static const WCHAR itaW[] = {'i','t','a',0}; static const WCHAR italW[] = {'i','t','a','l',0}; - static const WCHAR italicW[] = {'i','t','a','l','i','c',0}; static const WCHAR cursiveW[] = {'c','u','r','s','i','v','e',0}; static const WCHAR kursivW[] = {'k','u','r','s','i','v',0}; static const WCHAR inclinedW[] = {'i','n','c','l','i','n','e','d',0}; - static const WCHAR obliqueW[] = {'o','b','l','i','q','u','e',0}; static const WCHAR backslantedW[] = {'b','a','c','k','s','l','a','n','t','e','d',0}; static const WCHAR backslantW[] = {'b','a','c','k','s','l','a','n','t',0}; static const WCHAR slantedW[] = {'s','l','a','n','t','e','d',0}; @@ -2103,21 +2263,20 @@ }; /* italic patterns first */ - if (match_pattern_list(tokens, italic_patterns)) + if (match_pattern_list(tokens, italic_patterns, match)) return DWRITE_FONT_STYLE_ITALIC; /* oblique patterns */ - if (match_pattern_list(tokens, oblique_patterns)) + if (match_pattern_list(tokens, oblique_patterns, match)) return DWRITE_FONT_STYLE_OBLIQUE; return style; } -static DWRITE_FONT_STRETCH font_extract_stretch(struct list *tokens, DWRITE_FONT_STRETCH stretch) +static DWRITE_FONT_STRETCH font_extract_stretch(struct list *tokens, DWRITE_FONT_STRETCH stretch, + struct name_token *match) { static const WCHAR compressedW[] = {'c','o','m','p','r','e','s','s','e','d',0}; - static const WCHAR condensedW[] = {'c','o','n','d','e','n','s','e','d',0}; - static const WCHAR expandedW[] = {'e','x','p','a','n','d','e','d',0}; static const WCHAR extendedW[] = {'e','x','t','e','n','d','e','d',0}; static const WCHAR compactW[] = {'c','o','m','p','a','c','t',0}; static const WCHAR narrowW[] = {'n','a','r','r','o','w',0}; @@ -2183,42 +2342,37 @@ { NULL } }; - if (match_pattern_list(tokens, ultracondensed_patterns)) + if (match_pattern_list(tokens, ultracondensed_patterns, match)) return DWRITE_FONT_STRETCH_ULTRA_CONDENSED; - if (match_pattern_list(tokens, extracondensed_patterns)) + if (match_pattern_list(tokens, extracondensed_patterns, match)) return DWRITE_FONT_STRETCH_EXTRA_CONDENSED; - if (match_pattern_list(tokens, semicondensed_patterns)) + if (match_pattern_list(tokens, semicondensed_patterns, match)) return DWRITE_FONT_STRETCH_SEMI_CONDENSED; - if (match_pattern_list(tokens, semiexpanded_patterns)) + if (match_pattern_list(tokens, semiexpanded_patterns, match)) return DWRITE_FONT_STRETCH_SEMI_EXPANDED; - if (match_pattern_list(tokens, extraexpanded_patterns)) + if (match_pattern_list(tokens, extraexpanded_patterns, match)) return DWRITE_FONT_STRETCH_EXTRA_EXPANDED; - if (match_pattern_list(tokens, ultraexpanded_patterns)) + if (match_pattern_list(tokens, ultraexpanded_patterns, match)) return DWRITE_FONT_STRETCH_ULTRA_EXPANDED; - if (match_pattern_list(tokens, condensed_patterns)) + if (match_pattern_list(tokens, condensed_patterns, match)) return DWRITE_FONT_STRETCH_CONDENSED; - if (match_pattern_list(tokens, expanded_patterns)) + if (match_pattern_list(tokens, expanded_patterns, match)) return DWRITE_FONT_STRETCH_EXPANDED; return stretch; } -static DWRITE_FONT_WEIGHT font_extract_weight(struct list *tokens, DWRITE_FONT_WEIGHT weight) +static DWRITE_FONT_WEIGHT font_extract_weight(struct list *tokens, DWRITE_FONT_WEIGHT weight, + struct name_token *match) { - static const WCHAR mediumW[] = {'m','e','d','i','u','m',0}; - static const WCHAR blackW[] = {'b','l','a','c','k',0}; static const WCHAR heavyW[] = {'h','e','a','v','y',0}; - static const WCHAR lightW[] = {'l','i','g','h','t',0}; - static const WCHAR boldW[] = {'b','o','l','d',0}; - static const WCHAR demiW[] = {'d','e','m','i',0}; - static const WCHAR thinW[] = {'t','h','i','n',0}; static const WCHAR nordW[] = {'n','o','r','d',0}; static const struct name_pattern thin_patterns[] = { @@ -2235,6 +2389,11 @@ { NULL } }; + static const struct name_pattern semilight_patterns[] = { + { semiW, lightW }, + { NULL } + }; + static const struct name_pattern demibold_patterns[] = { { semiW, boldW }, { demiW, boldW }, @@ -2295,43 +2454,46 @@ /* FIXME: allow optional 'face' suffix, separated or not. It's removed together with matching pattern. */ - if (match_pattern_list(tokens, thin_patterns)) + if (match_pattern_list(tokens, thin_patterns, match)) return DWRITE_FONT_WEIGHT_THIN; - if (match_pattern_list(tokens, extralight_patterns)) + if (match_pattern_list(tokens, extralight_patterns, match)) return DWRITE_FONT_WEIGHT_EXTRA_LIGHT; - if (match_pattern_list(tokens, demibold_patterns)) + if (match_pattern_list(tokens, semilight_patterns, match)) + return DWRITE_FONT_WEIGHT_SEMI_LIGHT; + + if (match_pattern_list(tokens, demibold_patterns, match)) return DWRITE_FONT_WEIGHT_DEMI_BOLD; - if (match_pattern_list(tokens, extrabold_patterns)) + if (match_pattern_list(tokens, extrabold_patterns, match)) return DWRITE_FONT_WEIGHT_EXTRA_BOLD; - if (match_pattern_list(tokens, extrablack_patterns)) + if (match_pattern_list(tokens, extrablack_patterns, match)) return DWRITE_FONT_WEIGHT_EXTRA_BLACK; - if (match_pattern_list(tokens, bold_patterns)) + if (match_pattern_list(tokens, bold_patterns, match)) return DWRITE_FONT_WEIGHT_BOLD; - if (match_pattern_list(tokens, thin2_patterns)) + if (match_pattern_list(tokens, thin2_patterns, match)) return DWRITE_FONT_WEIGHT_THIN; - if (match_pattern_list(tokens, light_patterns)) + if (match_pattern_list(tokens, light_patterns, match)) return DWRITE_FONT_WEIGHT_LIGHT; - if (match_pattern_list(tokens, medium_patterns)) + if (match_pattern_list(tokens, medium_patterns, match)) return DWRITE_FONT_WEIGHT_MEDIUM; - if (match_pattern_list(tokens, black_patterns)) + if (match_pattern_list(tokens, black_patterns, match)) return DWRITE_FONT_WEIGHT_BLACK; - if (match_pattern_list(tokens, black_patterns)) + if (match_pattern_list(tokens, black_patterns, match)) return DWRITE_FONT_WEIGHT_BLACK; - if (match_pattern_list(tokens, demibold2_patterns)) + if (match_pattern_list(tokens, demibold2_patterns, match)) return DWRITE_FONT_WEIGHT_DEMI_BOLD; - if (match_pattern_list(tokens, extrabold2_patterns)) + if (match_pattern_list(tokens, extrabold2_patterns, match)) return DWRITE_FONT_WEIGHT_EXTRA_BOLD; /* FIXME: use abbreviated names to extract weight */ @@ -2339,7 +2501,66 @@ return weight; } -static void font_apply_differentiation_rules(struct dwrite_font_data *font, WCHAR *familyW, WCHAR *faceW) +struct knownweight_entry { + const WCHAR *nameW; + DWRITE_FONT_WEIGHT weight; +}; + +static int compare_knownweights(const void *a, const void* b) +{ + DWRITE_FONT_WEIGHT target = *(DWRITE_FONT_WEIGHT*)a; + const struct knownweight_entry *entry = (struct knownweight_entry*)b; + int ret = 0; + + if (target > entry->weight) + ret = 1; + else if (target < entry->weight) + ret = -1; + + return ret; +} + +static BOOL is_known_weight_value(DWRITE_FONT_WEIGHT weight, WCHAR *nameW) +{ + static const WCHAR extralightW[] = {'E','x','t','r','a',' ','L','i','g','h','t',0}; + static const WCHAR semilightW[] = {'S','e','m','i',' ','L','i','g','h','t',0}; + static const WCHAR extrablackW[] = {'E','x','t','r','a',' ','B','l','a','c','k',0}; + static const WCHAR extraboldW[] = {'E','x','t','r','a',' ','B','o','l','d',0}; + static const WCHAR demiboldW[] = {'D','e','m','i',' ','B','o','l','d',0}; + const struct knownweight_entry *ptr; + + static const struct knownweight_entry knownweights[] = { + { thinW, DWRITE_FONT_WEIGHT_THIN }, + { extralightW, DWRITE_FONT_WEIGHT_EXTRA_LIGHT }, + { lightW, DWRITE_FONT_WEIGHT_LIGHT }, + { semilightW, DWRITE_FONT_WEIGHT_SEMI_LIGHT }, + { mediumW, DWRITE_FONT_WEIGHT_MEDIUM }, + { demiboldW, DWRITE_FONT_WEIGHT_DEMI_BOLD }, + { boldW, DWRITE_FONT_WEIGHT_BOLD }, + { extraboldW, DWRITE_FONT_WEIGHT_EXTRA_BOLD }, + { blackW, DWRITE_FONT_WEIGHT_BLACK }, + { extrablackW, DWRITE_FONT_WEIGHT_EXTRA_BLACK } + }; + + ptr = bsearch(&weight, knownweights, sizeof(knownweights)/sizeof(knownweights[0]), sizeof(knownweights[0]), + compare_knownweights); + if (!ptr) { + nameW[0] = 0; + return FALSE; + } + + strcpyW(nameW, ptr->nameW); + return TRUE; +} + +static inline void font_name_token_to_str(const struct name_token *name, WCHAR *strW) +{ + memcpy(strW, name->ptr, name->len * sizeof(WCHAR)); + strW[name->len] = 0; +} + +/* Modifies facenameW string, and returns pointer to regular term that was removed */ +static const WCHAR *facename_remove_regular_term(WCHAR *facenameW, INT len) { static const WCHAR bookW[] = {'B','o','o','k',0}; static const WCHAR normalW[] = {'N','o','r','m','a','l',0}; @@ -2356,24 +2577,16 @@ NULL }; - static const WCHAR spaceW[] = {' ',0}; - WCHAR familynameW[255], facenameW[255]; - struct name_token *token, *token2; - DWRITE_FONT_STRETCH stretch; - DWRITE_FONT_WEIGHT weight; - BOOL found = FALSE; - struct list tokens; - const WCHAR *ptr; - int len, i = 0; + const WCHAR *regular_ptr = NULL, *ptr; + int i = 0; - /* remove leading and trailing spaces from family and face name */ - trim_spaces(familyW, familynameW); - len = trim_spaces(faceW, facenameW); + if (len == -1) + len = strlenW(facenameW); /* remove rightmost regular variant from face name */ - while (!found && (ptr = regular_patterns[i++])) { - WCHAR *src; + while (!regular_ptr && (ptr = regular_patterns[i++])) { int pattern_len = strlenW(ptr); + WCHAR *src; if (pattern_len > len) continue; @@ -2383,7 +2596,7 @@ if (!strncmpiW(src, ptr, pattern_len)) { memmove(src, src + pattern_len, (len - pattern_len - (src - facenameW) + 1)*sizeof(WCHAR)); len = strlenW(facenameW); - found = TRUE; + regular_ptr = ptr; break; } else @@ -2391,41 +2604,91 @@ } } - /* append face name to family name, FIXME check if face name is a substring of family name */ - if (*facenameW) { - strcatW(familynameW, spaceW); - strcatW(familynameW, facenameW); - } + return regular_ptr; +} - /* tokenize with " .-_" */ - list_init(&tokens); - ptr = familynameW; +static void fontname_tokenize(struct list *tokens, const WCHAR *nameW) +{ + const WCHAR *ptr; + + list_init(tokens); + ptr = nameW; while (*ptr) { struct name_token *token = heap_alloc(sizeof(*token)); token->ptr = ptr; token->len = 0; + token->fulllen = 0; while (*ptr && !is_name_separator_char(*ptr)) { token->len++; + token->fulllen++; ptr++; } /* skip separators */ - while (is_name_separator_char(*ptr)) + while (is_name_separator_char(*ptr)) { + token->fulllen++; ptr++; + } + + list_add_head(tokens, &token->entry); + } +} + +static void fontname_tokens_to_str(struct list *tokens, WCHAR *nameW) +{ + struct name_token *token, *token2; + LIST_FOR_EACH_ENTRY_SAFE_REV(token, token2, tokens, struct name_token, entry) { + int len; + + list_remove(&token->entry); + + /* don't include last separator */ + len = list_empty(tokens) ? token->len : token->fulllen; + memcpy(nameW, token->ptr, len * sizeof(WCHAR)); + nameW += len; + + heap_free(token); + } + *nameW = 0; +} + +static BOOL font_apply_differentiation_rules(struct dwrite_font_data *font, WCHAR *familyW, WCHAR *faceW) +{ + struct name_token stretch_name, weight_name, style_name; + WCHAR familynameW[255], facenameW[255], finalW[255]; + WCHAR weightW[32], stretchW[32], styleW[32]; + const WCHAR *regular_ptr = NULL; + DWRITE_FONT_STRETCH stretch; + DWRITE_FONT_WEIGHT weight; + struct list tokens; + int len; + + /* remove leading and trailing spaces from family and face name */ + trim_spaces(familyW, familynameW); + len = trim_spaces(faceW, facenameW); - list_add_head(&tokens, &token->entry); + /* remove rightmost regular variant from face name */ + regular_ptr = facename_remove_regular_term(facenameW, len); + + /* append face name to family name, FIXME check if face name is a substring of family name */ + if (*facenameW) { + strcatW(familynameW, spaceW); + strcatW(familynameW, facenameW); } + /* tokenize with " .-_" */ + fontname_tokenize(&tokens, familynameW); + /* extract and resolve style */ - font->style = font_extract_style(&tokens, font->style); + font->style = font_extract_style(&tokens, font->style, &style_name); /* extract stretch */ - stretch = font_extract_stretch(&tokens, font->stretch); + stretch = font_extract_stretch(&tokens, font->stretch, &stretch_name); /* extract weight */ - weight = font_extract_weight(&tokens, font->weight); + weight = font_extract_weight(&tokens, font->weight, &weight_name); /* resolve weight */ if (weight != font->weight) { @@ -2454,13 +2717,95 @@ } } - /* FIXME: cleanup face name from possible 2-3 digit prefixes, compose final family/face names */ + /* FIXME: cleanup face name from possible 2-3 digit prefixes */ - /* release tokens */ - LIST_FOR_EACH_ENTRY_SAFE(token, token2, &tokens, struct name_token, entry) { - list_remove(&token->entry); - heap_free(token); + /* get final combined string from what's left in token list, list is released */ + fontname_tokens_to_str(&tokens, finalW); + + if (!strcmpW(familyW, finalW)) + return FALSE; + + /* construct face name */ + strcpyW(familyW, finalW); + + /* resolved weight name */ + if (weight_name.ptr) + font_name_token_to_str(&weight_name, weightW); + /* ignore normal weight */ + else if (font->weight == DWRITE_FONT_WEIGHT_NORMAL) + weightW[0] = 0; + /* for known weight values use appropriate names */ + else if (is_known_weight_value(font->weight, weightW)) { + } + /* use Wnnn format as a fallback in case weight is not one of defined values */ + else { + static const WCHAR fmtW[] = {'W','%','d',0}; + sprintfW(weightW, fmtW, font->weight); + } + + /* resolved stretch name */ + if (stretch_name.ptr) + font_name_token_to_str(&stretch_name, stretchW); + /* ignore normal stretch */ + else if (font->stretch == DWRITE_FONT_STRETCH_NORMAL) + stretchW[0] = 0; + /* use predefined stretch names */ + else { + static const WCHAR ultracondensedW[] = {'U','l','t','r','a',' ','C','o','n','d','e','n','s','e','d',0}; + static const WCHAR extracondensedW[] = {'E','x','t','r','a',' ','C','o','n','d','e','n','s','e','d',0}; + static const WCHAR semicondensedW[] = {'S','e','m','i',' ','C','o','n','d','e','n','s','e','d',0}; + static const WCHAR semiexpandedW[] = {'S','e','m','i',' ','E','x','p','a','n','d','e','d',0}; + static const WCHAR extraexpandedW[] = {'E','x','t','r','a',' ','E','x','p','a','n','d','e','d',0}; + static const WCHAR ultraexpandedW[] = {'U','l','t','r','a',' ','E','x','p','a','n','d','e','d',0}; + + static const WCHAR *stretchnamesW[] = { + ultracondensedW, + extracondensedW, + condensedW, + semicondensedW, + NULL, /* DWRITE_FONT_STRETCH_NORMAL */ + semiexpandedW, + expandedW, + extraexpandedW, + ultraexpandedW + }; + strcpyW(stretchW, stretchnamesW[font->stretch]); + } + + /* resolved style name */ + if (style_name.ptr) + font_name_token_to_str(&style_name, styleW); + else if (font->style == DWRITE_FONT_STYLE_NORMAL) + styleW[0] = 0; + /* use predefined names */ + else { + if (font->style == DWRITE_FONT_STYLE_ITALIC) + strcpyW(styleW, italicW); + else + strcpyW(styleW, obliqueW); } + + /* use Regular match if it was found initially */ + if (!*weightW && !*stretchW && !*styleW) + strcpyW(faceW, regular_ptr ? regular_ptr : regularW); + else { + faceW[0] = 0; + if (*stretchW) + strcpyW(faceW, stretchW); + if (*weightW) { + if (*faceW) + strcatW(faceW, spaceW); + strcatW(faceW, weightW); + } + if (*styleW) { + if (*faceW) + strcatW(faceW, spaceW); + strcatW(faceW, styleW); + } + } + + TRACE("resolved family %s, face %s\n", debugstr_w(familyW), debugstr_w(faceW)); + return TRUE; } static HRESULT init_font_data(IDWriteFactory2 *factory, IDWriteFontFile *file, DWRITE_FONT_FACE_TYPE face_type, UINT32 face_index, @@ -2488,6 +2833,9 @@ data->file = file; data->face_index = face_index; data->face_type = face_type; + data->simulations = DWRITE_FONT_SIMULATIONS_NONE; + data->bold_sim_tested = FALSE; + data->oblique_sim_tested = FALSE; IDWriteFontFile_AddRef(file); IDWriteFactory2_AddRef(factory); @@ -2511,7 +2859,10 @@ fontstrings_get_en_string(*family_name, familyW, sizeof(familyW)/sizeof(WCHAR)); fontstrings_get_en_string(data->names, faceW, sizeof(faceW)/sizeof(WCHAR)); - font_apply_differentiation_rules(data, familyW, faceW); + if (font_apply_differentiation_rules(data, familyW, faceW)) { + set_en_localizedstring(*family_name, familyW); + set_en_localizedstring(data->names, faceW); + } init_font_prop_vec(data->weight, data->stretch, data->style, &data->propvec); @@ -2519,6 +2870,37 @@ return S_OK; } +static HRESULT init_font_data_from_font(const struct dwrite_font_data *src, DWRITE_FONT_SIMULATIONS sim, const WCHAR *facenameW, + struct dwrite_font_data **ret) +{ + struct dwrite_font_data *data; + + *ret = NULL; + data = heap_alloc_zero(sizeof(*data)); + if (!data) + return E_OUTOFMEMORY; + + *data = *src; + data->ref = 1; + data->simulations |= sim; + if (sim == DWRITE_FONT_SIMULATIONS_BOLD) + data->weight = DWRITE_FONT_WEIGHT_BOLD; + else if (sim == DWRITE_FONT_SIMULATIONS_OBLIQUE) + data->style = DWRITE_FONT_STYLE_OBLIQUE; + memset(data->info_strings, 0, sizeof(data->info_strings)); + data->names = NULL; + IDWriteFactory2_AddRef(data->factory); + IDWriteFontFile_AddRef(data->file); + + create_localizedstrings(&data->names); + add_localizedstring(data->names, enusW, facenameW); + + init_font_prop_vec(data->weight, data->stretch, data->style, &data->propvec); + + *ret = data; + return S_OK; +}; + static HRESULT init_fontfamily_data(IDWriteLocalizedStrings *familyname, struct dwrite_fontfamily_data **ret) { struct dwrite_fontfamily_data *data; @@ -2530,6 +2912,9 @@ data->ref = 1; data->font_count = 0; data->font_alloc = 2; + data->has_normal_face = FALSE; + data->has_oblique_face = FALSE; + data->has_italic_face = FALSE; data->fonts = heap_alloc(sizeof(*data->fonts)*data->font_alloc); if (!data->fonts) { @@ -2544,11 +2929,152 @@ return S_OK; } +static void fontfamily_add_bold_simulated_face(struct dwrite_fontfamily_data *family) +{ + UINT32 i, j, heaviest; + + for (i = 0; i < family->font_count; i++) { + DWRITE_FONT_WEIGHT weight = family->fonts[i]->weight; + heaviest = i; + + if (family->fonts[i]->bold_sim_tested) + continue; + + family->fonts[i]->bold_sim_tested = TRUE; + for (j = i; j < family->font_count; j++) { + if (family->fonts[j]->bold_sim_tested) + continue; + + if ((family->fonts[i]->style == family->fonts[j]->style) && + (family->fonts[i]->stretch == family->fonts[j]->stretch)) { + if (family->fonts[j]->weight > weight) { + weight = family->fonts[j]->weight; + heaviest = j; + } + family->fonts[j]->bold_sim_tested = TRUE; + } + } + + if (weight >= DWRITE_FONT_WEIGHT_SEMI_LIGHT && weight <= 550) { + static const struct name_pattern weightsim_patterns[] = { + { extraW, lightW }, + { extW, lightW }, + { ultraW, lightW }, + { semiW, lightW }, + { semiW, boldW }, + { demiW, boldW }, + { boldW }, + { thinW }, + { lightW }, + { mediumW }, + { demiW }, + { NULL } + }; + + WCHAR facenameW[255], initialW[255]; + struct dwrite_font_data *boldface; + struct list tokens; + + /* add Bold simulation based on heaviest face data */ + + /* Simulated face name should only contain Bold as weight term, + so remove existing regular and weight terms. */ + fontstrings_get_en_string(family->fonts[heaviest]->names, initialW, sizeof(initialW)/sizeof(WCHAR)); + facename_remove_regular_term(initialW, -1); + + /* remove current weight pattern */ + fontname_tokenize(&tokens, initialW); + match_pattern_list(&tokens, weightsim_patterns, NULL); + fontname_tokens_to_str(&tokens, facenameW); + + /* Bold suffix for new name */ + if (*facenameW) + strcatW(facenameW, spaceW); + strcatW(facenameW, boldW); + + if (init_font_data_from_font(family->fonts[heaviest], DWRITE_FONT_SIMULATIONS_BOLD, facenameW, &boldface) == S_OK) { + boldface->bold_sim_tested = TRUE; + fontfamily_add_font(family, boldface); + } + } + } +} + +static void fontfamily_add_oblique_simulated_face(struct dwrite_fontfamily_data *family) +{ + UINT32 i, j; + + for (i = 0; i < family->font_count; i++) { + UINT32 regular = ~0u, oblique = ~0u; + struct dwrite_font_data *obliqueface; + WCHAR facenameW[255]; + + if (family->fonts[i]->oblique_sim_tested) + continue; + + family->fonts[i]->oblique_sim_tested = TRUE; + if (family->fonts[i]->style == DWRITE_FONT_STYLE_NORMAL) + regular = i; + else if (family->fonts[i]->style == DWRITE_FONT_STYLE_OBLIQUE) + oblique = i; + + /* find regular style with same weight/stretch values */ + for (j = i; j < family->font_count; j++) { + if (family->fonts[j]->oblique_sim_tested) + continue; + + if ((family->fonts[i]->weight == family->fonts[j]->weight) && + (family->fonts[i]->stretch == family->fonts[j]->stretch)) { + + family->fonts[j]->oblique_sim_tested = TRUE; + if (regular == ~0 && family->fonts[j]->style == DWRITE_FONT_STYLE_NORMAL) + regular = j; + + if (oblique == ~0 && family->fonts[j]->style == DWRITE_FONT_STYLE_OBLIQUE) + oblique = j; + } + + if (regular != ~0u && oblique != ~0u) + break; + } + + /* no regular variant for this weight/stretch pair, nothing to base simulated face on */ + if (regular == ~0u) + continue; + + /* regular face exists, and corresponding oblique is present as well, nothing to do */ + if (oblique != ~0u) + continue; + + /* add oblique simulation based on this regular face */ + + /* remove regular term if any, append 'Oblique' */ + fontstrings_get_en_string(family->fonts[regular]->names, facenameW, sizeof(facenameW)/sizeof(WCHAR)); + facename_remove_regular_term(facenameW, -1); + + if (*facenameW) + strcatW(facenameW, spaceW); + strcatW(facenameW, obliqueW); + + if (init_font_data_from_font(family->fonts[regular], DWRITE_FONT_SIMULATIONS_OBLIQUE, facenameW, &obliqueface) == S_OK) { + obliqueface->oblique_sim_tested = TRUE; + fontfamily_add_font(family, obliqueface); + } + } +} + HRESULT create_font_collection(IDWriteFactory2* factory, IDWriteFontFileEnumerator *enumerator, BOOL is_system, IDWriteFontCollection **ret) { + struct fontfile_enum { + struct list entry; + IDWriteFontFile *file; + }; + struct fontfile_enum *fileenum, *fileenum2; struct dwrite_fontcollection *collection; + struct list scannedfiles; BOOL current = FALSE; HRESULT hr = S_OK; + UINT32 i; *ret = NULL; @@ -2565,12 +3091,13 @@ TRACE("building font collection:\n"); + list_init(&scannedfiles); while (hr == S_OK) { DWRITE_FONT_FACE_TYPE face_type; DWRITE_FONT_FILE_TYPE file_type; + BOOL supported, same = FALSE; IDWriteFontFile *file; - UINT32 face_count, i; - BOOL supported; + UINT32 face_count; current = FALSE; hr = IDWriteFontFileEnumerator_MoveNext(enumerator, ¤t); @@ -2581,6 +3108,17 @@ if (FAILED(hr)) break; + /* check if we've scanned this file already */ + LIST_FOR_EACH_ENTRY(fileenum, &scannedfiles, struct fontfile_enum, entry) { + if ((same = is_same_fontfile(fileenum->file, file))) + break; + } + + if (same) { + IDWriteFontFile_Release(file); + continue; + } + /* failed font files are skipped */ hr = IDWriteFontFile_Analyze(file, &supported, &file_type, &face_type, &face_count); if (FAILED(hr) || !supported || face_count == 0) { @@ -2590,6 +3128,11 @@ continue; } + /* add to scanned list */ + fileenum = heap_alloc(sizeof(*fileenum)); + fileenum->file = file; + list_add_tail(&scannedfiles, &fileenum->entry); + for (i = 0; i < face_count; i++) { IDWriteLocalizedStrings *family_name = NULL; struct dwrite_font_data *font_data; @@ -2627,9 +3170,18 @@ if (FAILED(hr)) break; } + } - IDWriteFontFile_Release(file); - }; + LIST_FOR_EACH_ENTRY_SAFE(fileenum, fileenum2, &scannedfiles, struct fontfile_enum, entry) { + IDWriteFontFile_Release(fileenum->file); + list_remove(&fileenum->entry); + heap_free(fileenum); + } + + for (i = 0; i < collection->family_count; i++) { + fontfamily_add_bold_simulated_face(collection->family_data[i]); + fontfamily_add_oblique_simulated_face(collection->family_data[i]); + } return hr; } @@ -3491,7 +4043,8 @@ IDWriteFontFace_Release(This->run.fontFace); heap_free(This->glyphs); heap_free(This->advances); - heap_free(This->offsets); + heap_free(This->advanceoffsets); + heap_free(This->ascenderoffsets); heap_free(This->bitmap); heap_free(This); } @@ -3501,13 +4054,14 @@ static void glyphrunanalysis_get_texturebounds(struct dwrite_glyphrunanalysis *analysis, RECT *bounds) { + struct dwrite_glyphbitmap glyph_bitmap; IDWriteFontFace2 *fontface2; - BOOL nohint, is_rtl; - FLOAT origin_x; + D2D_POINT_2F origin; + BOOL is_rtl; HRESULT hr; UINT32 i; - if (analysis->ready & RUNANALYSIS_BOUNDS) { + if (analysis->flags & RUNANALYSIS_BOUNDS_READY) { *bounds = analysis->bounds; return; } @@ -3519,38 +4073,50 @@ if (FAILED(hr)) WARN("failed to get IDWriteFontFace2, 0x%08x\n", hr); - nohint = analysis->rendering_mode == DWRITE_RENDERING_MODE_NATURAL || analysis->rendering_mode == DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC; - /* Start with empty bounds at (0,0) origin, returned bounds are not translated back to (0,0), e.g. for RTL run negative left bound is returned, same goes for vertical direction - top bound will be negative for any non-zero glyph ascender */ - origin_x = 0.0; + origin.x = origin.y = 0.0f; is_rtl = analysis->run.bidiLevel & 1; + + memset(&glyph_bitmap, 0, sizeof(glyph_bitmap)); + glyph_bitmap.fontface = fontface2; + glyph_bitmap.emsize = analysis->run.fontEmSize * analysis->ppdip; + glyph_bitmap.nohint = analysis->rendering_mode == DWRITE_RENDERING_MODE_NATURAL || + analysis->rendering_mode == DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC; + if (analysis->flags & RUNANALYSIS_USE_TRANSFORM) + glyph_bitmap.m = &analysis->m; + for (i = 0; i < analysis->run.glyphCount; i++) { - const DWRITE_GLYPH_OFFSET *offset = analysis->offsets ? &analysis->offsets[i] : NULL; - FLOAT advance = analysis->advances[i]; - RECT bbox; + const D2D_POINT_2F *advanceoffset = analysis->advanceoffsets ? analysis->advanceoffsets + i : NULL; + const D2D_POINT_2F *ascenderoffset = analysis->ascenderoffsets ? analysis->ascenderoffsets + i : NULL; + const D2D_POINT_2F *advance = analysis->advances + i; + RECT *bbox = &glyph_bitmap.bbox; - freetype_get_glyph_bbox(fontface2, analysis->run.fontEmSize * analysis->ppdip, analysis->run.glyphIndices[i], nohint, &bbox); + glyph_bitmap.index = analysis->run.glyphIndices[i]; + freetype_get_glyph_bbox(&glyph_bitmap); if (is_rtl) - OffsetRect(&bbox, origin_x - advance, 0); + OffsetRect(bbox, origin.x + advance->x, origin.y + advance->y); else - OffsetRect(&bbox, origin_x, 0); + OffsetRect(bbox, origin.x, origin.y); - if (offset) - OffsetRect(&bbox, is_rtl ? -offset->advanceOffset : offset->advanceOffset, is_rtl ? -offset->ascenderOffset : offset->ascenderOffset); + if (advanceoffset) + OffsetRect(bbox, advanceoffset->x + ascenderoffset->x, advanceoffset->y + ascenderoffset->y); - UnionRect(&analysis->bounds, &analysis->bounds, &bbox); - origin_x += is_rtl ? -advance : advance; + UnionRect(&analysis->bounds, &analysis->bounds, bbox); + origin.x += advance->x; + origin.y += advance->y; } IDWriteFontFace2_Release(fontface2); /* translate to given run origin */ - OffsetRect(&analysis->bounds, analysis->originX, analysis->originY); + OffsetRect(&analysis->bounds, analysis->origin.x, analysis->origin.y); + if (analysis->flags & RUNANALYSIS_USE_TRANSFORM) + OffsetRect(&analysis->bounds, analysis->m.dx, analysis->m.dy); - analysis->ready |= RUNANALYSIS_BOUNDS; + analysis->flags |= RUNANALYSIS_BOUNDS_READY; *bounds = analysis->bounds; } @@ -3593,95 +4159,134 @@ static void glyphrunanalysis_render(struct dwrite_glyphrunanalysis *analysis, DWRITE_TEXTURE_TYPE type) { static const BYTE masks[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}; + struct dwrite_glyphbitmap glyph_bitmap; IDWriteFontFace2 *fontface2; - BOOL is_rtl, nohint; - FLOAT origin_x; + D2D_POINT_2F origin; UINT32 i, size; + BOOL is_rtl; + HRESULT hr; + RECT *bbox; - IDWriteFontFace_QueryInterface(analysis->run.fontFace, &IID_IDWriteFontFace2, (void**)&fontface2); - - nohint = analysis->rendering_mode == DWRITE_RENDERING_MODE_NATURAL || analysis->rendering_mode == DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC; + hr = IDWriteFontFace_QueryInterface(analysis->run.fontFace, &IID_IDWriteFontFace2, (void**)&fontface2); + if (FAILED(hr)) { + WARN("failed to get IDWriteFontFace2, 0x%08x\n", hr); + return; + } size = (analysis->bounds.right - analysis->bounds.left)*(analysis->bounds.bottom - analysis->bounds.top); if (type == DWRITE_TEXTURE_CLEARTYPE_3x1) size *= 3; analysis->bitmap = heap_alloc_zero(size); - origin_x = 0.0; + origin.x = origin.y = 0.0f; is_rtl = analysis->run.bidiLevel & 1; + + memset(&glyph_bitmap, 0, sizeof(glyph_bitmap)); + glyph_bitmap.fontface = fontface2; + glyph_bitmap.emsize = analysis->run.fontEmSize * analysis->ppdip; + glyph_bitmap.nohint = analysis->rendering_mode == DWRITE_RENDERING_MODE_NATURAL || + analysis->rendering_mode == DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC; + glyph_bitmap.type = type; + if (analysis->flags & RUNANALYSIS_USE_TRANSFORM) + glyph_bitmap.m = &analysis->m; + bbox = &glyph_bitmap.bbox; + for (i = 0; i < analysis->run.glyphCount; i++) { - const DWRITE_GLYPH_OFFSET *offset = analysis->offsets ? &analysis->offsets[i] : NULL; - FLOAT advance = analysis->advances[i]; - int pitch, x, y, width, height; - BYTE *glyph, *src, *dst; - RECT bbox; + const D2D_POINT_2F *advanceoffset = analysis->advanceoffsets ? analysis->advanceoffsets + i : NULL; + const D2D_POINT_2F *ascenderoffset = analysis->ascenderoffsets ? analysis->ascenderoffsets + i : NULL; + const D2D_POINT_2F *advance = analysis->advances + i; + int x, y, width, height; + BYTE *src, *dst; + BOOL is_1bpp; - freetype_get_glyph_bbox(fontface2, analysis->run.fontEmSize * analysis->ppdip, analysis->run.glyphIndices[i], nohint, &bbox); + glyph_bitmap.index = analysis->run.glyphIndices[i]; + freetype_get_glyph_bbox(&glyph_bitmap); - if (IsRectEmpty(&bbox)) { - origin_x += is_rtl ? -advance : advance; + if (IsRectEmpty(bbox)) { + origin.x += advance->x; + origin.y += advance->y; continue; } - width = bbox.right - bbox.left; - height = bbox.bottom - bbox.top; - pitch = ((width + 31) >> 5) << 2; + width = bbox->right - bbox->left; + height = bbox->bottom - bbox->top; + + if (type == DWRITE_TEXTURE_CLEARTYPE_3x1) + glyph_bitmap.pitch = (width + 3) / 4 * 4; + else + glyph_bitmap.pitch = ((width + 31) >> 5) << 2; - src = glyph = heap_alloc_zero((bbox.bottom - bbox.top) * pitch); - freetype_get_glyph_bitmap(fontface2, analysis->run.fontEmSize * analysis->ppdip, analysis->run.glyphIndices[i], &bbox, glyph); + glyph_bitmap.buf = src = heap_alloc_zero(height * glyph_bitmap.pitch); + is_1bpp = freetype_get_glyph_bitmap(&glyph_bitmap); if (is_rtl) - OffsetRect(&bbox, origin_x - advance, 0); + OffsetRect(bbox, origin.x + advance->x, origin.y + advance->y); else - OffsetRect(&bbox, origin_x, 0); + OffsetRect(bbox, origin.x, origin.y); - if (offset) - OffsetRect(&bbox, is_rtl ? -offset->advanceOffset : offset->advanceOffset, is_rtl ? -offset->ascenderOffset : offset->ascenderOffset); + if (advanceoffset) + OffsetRect(bbox, advanceoffset->x + ascenderoffset->x, advanceoffset->y + ascenderoffset->y); - OffsetRect(&bbox, analysis->originX, analysis->originY); + OffsetRect(bbox, analysis->origin.x, analysis->origin.y); + if (analysis->flags & RUNANALYSIS_USE_TRANSFORM) + OffsetRect(bbox, analysis->m.dx, analysis->m.dy); /* blit to analysis bitmap */ - dst = get_pixel_ptr(analysis->bitmap, type, &bbox, &analysis->bounds); + dst = get_pixel_ptr(analysis->bitmap, type, bbox, &analysis->bounds); - /* convert 1bpp to 8bpp/24bpp */ - if (type == DWRITE_TEXTURE_CLEARTYPE_3x1) { - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) - dst[3*x] = dst[3*x+1] = dst[3*x+2] = (src[x / 8] & masks[x % 8]) ? DWRITE_ALPHA_MAX : 0; - src += get_dib_stride(width, 1); - dst += (analysis->bounds.right - analysis->bounds.left) * 3; + if (is_1bpp) { + /* convert 1bpp to 8bpp/24bpp */ + if (type == DWRITE_TEXTURE_CLEARTYPE_3x1) { + for (y = 0; y < height; y++) { + for (x = 0; x < width; x++) + if (src[x / 8] & masks[x % 8]) + dst[3*x] = dst[3*x+1] = dst[3*x+2] = DWRITE_ALPHA_MAX; + src += glyph_bitmap.pitch; + dst += (analysis->bounds.right - analysis->bounds.left) * 3; + } + } + else { + for (y = 0; y < height; y++) { + for (x = 0; x < width; x++) + if (src[x / 8] & masks[x % 8]) + dst[x] = DWRITE_ALPHA_MAX; + src += get_dib_stride(width, 1); + dst += analysis->bounds.right - analysis->bounds.left; + } } } else { + /* at this point it's DWRITE_TEXTURE_CLEARTYPE_3x1 with 8bpp src bitmap */ for (y = 0; y < height; y++) { for (x = 0; x < width; x++) - dst[x] = (src[x / 8] & masks[x % 8]) ? DWRITE_ALPHA_MAX : 0; - src += get_dib_stride(width, 1); - dst += analysis->bounds.right - analysis->bounds.left; + dst[3*x] = dst[3*x+1] = dst[3*x+2] = src[x] | dst[3*x]; + src += glyph_bitmap.pitch; + dst += (analysis->bounds.right - analysis->bounds.left) * 3; } } - heap_free(glyph); + heap_free(glyph_bitmap.buf); - origin_x += is_rtl ? -advance : advance; + origin.x += advance->x; + origin.y += advance->y; } IDWriteFontFace2_Release(fontface2); - analysis->ready |= RUNANALYSIS_BITMAP; + analysis->flags |= RUNANALYSIS_BITMAP_READY; /* we don't need this anymore */ heap_free(analysis->glyphs); heap_free(analysis->advances); - heap_free(analysis->offsets); + heap_free(analysis->advanceoffsets); + heap_free(analysis->ascenderoffsets); IDWriteFontFace_Release(analysis->run.fontFace); analysis->glyphs = NULL; analysis->advances = NULL; - analysis->offsets = NULL; + analysis->advanceoffsets = NULL; + analysis->ascenderoffsets = NULL; analysis->run.glyphIndices = NULL; - analysis->run.glyphAdvances = NULL; - analysis->run.glyphOffsets = NULL; analysis->run.fontFace = NULL; } @@ -3733,7 +4338,7 @@ BYTE *src, *dst; int y; - if (!(This->ready & RUNANALYSIS_BITMAP)) + if (!(This->flags & RUNANALYSIS_BITMAP_READY)) glyphrunanalysis_render(This, type); src = get_pixel_ptr(This->bitmap, type, &runbounds, &This->bounds); @@ -3794,10 +4399,33 @@ glyphrunanalysis_GetAlphaBlendParams }; +static inline void init_2d_vec(D2D_POINT_2F *vec, FLOAT length, BOOL is_vertical) +{ + if (is_vertical) { + vec->x = 0.0f; + vec->y = length; + } + else { + vec->x = length; + vec->y = 0.0f; + } +} + +static inline void transform_2d_vec(D2D_POINT_2F *vec, const DWRITE_MATRIX *m) +{ + D2D_POINT_2F ret; + ret.x = vec->x * m->m11 + vec->y * m->m21; + ret.y = vec->x * m->m12 + vec->y * m->m22; + *vec = ret; +} + HRESULT create_glyphrunanalysis(DWRITE_RENDERING_MODE rendering_mode, DWRITE_MEASURING_MODE measuring_mode, DWRITE_GLYPH_RUN const *run, - FLOAT ppdip, DWRITE_GRID_FIT_MODE gridfit_mode, DWRITE_TEXT_ANTIALIAS_MODE aa_mode, FLOAT originX, FLOAT originY, IDWriteGlyphRunAnalysis **ret) + FLOAT ppdip, const DWRITE_MATRIX *transform, DWRITE_GRID_FIT_MODE gridfit_mode, DWRITE_TEXT_ANTIALIAS_MODE aa_mode, + FLOAT originX, FLOAT originY, IDWriteGlyphRunAnalysis **ret) { struct dwrite_glyphrunanalysis *analysis; + FLOAT rtl_factor; + UINT32 i; *ret = NULL; @@ -3812,42 +4440,69 @@ analysis->IDWriteGlyphRunAnalysis_iface.lpVtbl = &glyphrunanalysisvtbl; analysis->ref = 1; analysis->rendering_mode = rendering_mode; - analysis->ready = 0; + analysis->flags = 0; analysis->bitmap = NULL; analysis->ppdip = ppdip; - analysis->originX = originX; - analysis->originY = originY; + analysis->origin.x = originX * ppdip; + analysis->origin.y = originY * ppdip; SetRectEmpty(&analysis->bounds); analysis->run = *run; IDWriteFontFace_AddRef(analysis->run.fontFace); analysis->glyphs = heap_alloc(run->glyphCount*sizeof(*run->glyphIndices)); - analysis->advances = heap_alloc(run->glyphCount*sizeof(*run->glyphAdvances)); - analysis->offsets = run->glyphOffsets ? heap_alloc(run->glyphCount*sizeof(*run->glyphOffsets)) : NULL; - if (!analysis->glyphs || !analysis->advances || (!analysis->offsets && run->glyphOffsets)) { + analysis->advances = heap_alloc(run->glyphCount*sizeof(*analysis->advances)); + if (run->glyphOffsets) { + analysis->advanceoffsets = heap_alloc(run->glyphCount*sizeof(*analysis->advanceoffsets)); + analysis->ascenderoffsets = heap_alloc(run->glyphCount*sizeof(*analysis->ascenderoffsets)); + } + else { + analysis->advanceoffsets = NULL; + analysis->ascenderoffsets = NULL; + } + + if (!analysis->glyphs || !analysis->advances || ((!analysis->advanceoffsets || !analysis->ascenderoffsets) && run->glyphOffsets)) { heap_free(analysis->glyphs); heap_free(analysis->advances); - heap_free(analysis->offsets); + heap_free(analysis->advanceoffsets); + heap_free(analysis->ascenderoffsets); analysis->glyphs = NULL; analysis->advances = NULL; - analysis->offsets = NULL; + analysis->advanceoffsets = NULL; + analysis->ascenderoffsets = NULL; IDWriteGlyphRunAnalysis_Release(&analysis->IDWriteGlyphRunAnalysis_iface); return E_OUTOFMEMORY; } + /* check if transform is usable */ + if (transform && memcmp(transform, &identity, sizeof(*transform))) { + analysis->m = *transform; + analysis->flags |= RUNANALYSIS_USE_TRANSFORM; + } + else + memset(&analysis->m, 0, sizeof(analysis->m)); + analysis->run.glyphIndices = analysis->glyphs; - analysis->run.glyphAdvances = analysis->advances; - analysis->run.glyphOffsets = analysis->offsets; + analysis->run.glyphAdvances = NULL; + analysis->run.glyphOffsets = NULL; + + rtl_factor = run->bidiLevel & 1 ? -1.0f : 1.0f; + + if (analysis->flags & RUNANALYSIS_USE_TRANSFORM) + transform_2d_vec(&analysis->origin, &analysis->m); memcpy(analysis->glyphs, run->glyphIndices, run->glyphCount*sizeof(*run->glyphIndices)); - if (run->glyphAdvances) - memcpy(analysis->advances, run->glyphAdvances, run->glyphCount*sizeof(*run->glyphAdvances)); + if (run->glyphAdvances) { + for (i = 0; i < run->glyphCount; i++) { + init_2d_vec(analysis->advances + i, rtl_factor * run->glyphAdvances[i] * ppdip, run->isSideways); + if (analysis->flags & RUNANALYSIS_USE_TRANSFORM) + transform_2d_vec(analysis->advances + i, &analysis->m); + } + } else { DWRITE_FONT_METRICS metrics; IDWriteFontFace1 *fontface1; - UINT32 i; IDWriteFontFace_GetMetrics(run->fontFace, &metrics); IDWriteFontFace_QueryInterface(run->fontFace, &IID_IDWriteFontFace1, (void**)&fontface1); @@ -3862,27 +4517,41 @@ hr = IDWriteFontFace1_GetDesignGlyphAdvances(fontface1, 1, run->glyphIndices + i, &a, run->isSideways); if (FAILED(hr)) a = 0; - analysis->advances[i] = get_scaled_advance_width(a, run->fontEmSize, &metrics); + init_2d_vec(analysis->advances + i, rtl_factor * get_scaled_advance_width(a, run->fontEmSize, &metrics) * ppdip, + run->isSideways); break; case DWRITE_MEASURING_MODE_GDI_CLASSIC: case DWRITE_MEASURING_MODE_GDI_NATURAL: - hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, run->fontEmSize, ppdip, NULL /* FIXME */, + hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, run->fontEmSize, ppdip, transform, measuring_mode == DWRITE_MEASURING_MODE_GDI_NATURAL, run->isSideways, 1, run->glyphIndices + i, &a); if (FAILED(hr)) - analysis->advances[i] = 0.0; + init_2d_vec(analysis->advances + i, 0.0f, FALSE); else - analysis->advances[i] = floorf(a * run->fontEmSize * ppdip / metrics.designUnitsPerEm + 0.5f) / ppdip; + init_2d_vec(analysis->advances + i, rtl_factor * floorf(a * run->fontEmSize * ppdip / metrics.designUnitsPerEm + 0.5f), + run->isSideways); break; default: ; } + + if (analysis->flags & RUNANALYSIS_USE_TRANSFORM) + transform_2d_vec(analysis->advances + i, &analysis->m); } IDWriteFontFace1_Release(fontface1); } - if (run->glyphOffsets) - memcpy(analysis->offsets, run->glyphOffsets, run->glyphCount*sizeof(*run->glyphOffsets)); + if (run->glyphOffsets) { + for (i = 0; i < run->glyphCount; i++) { + init_2d_vec(analysis->advanceoffsets + i, rtl_factor * run->glyphOffsets[i].advanceOffset * ppdip, run->isSideways); + /* Positive ascender offset moves glyph up. Keep it orthogonal to advance direction. */ + init_2d_vec(analysis->ascenderoffsets + i, -run->glyphOffsets[i].ascenderOffset * ppdip, !run->isSideways); + if (analysis->flags & RUNANALYSIS_USE_TRANSFORM) { + transform_2d_vec(analysis->advanceoffsets + i, &analysis->m); + transform_2d_vec(analysis->ascenderoffsets + i, &analysis->m); + } + } + } *ret = &analysis->IDWriteGlyphRunAnalysis_iface; return S_OK; @@ -3954,8 +4623,23 @@ DWRITE_MEASURING_MODE mode, const DWRITE_MATRIX *transform, UINT32 palette, IDWriteColorGlyphRunEnumerator **ret) { struct dwrite_colorglyphenum *colorglyphenum; + IDWriteFontFace2 *fontface2; + BOOL colorfont; + HRESULT hr; *ret = NULL; + + hr = IDWriteFontFace_QueryInterface(run->fontFace, &IID_IDWriteFontFace2, (void**)&fontface2); + if (FAILED(hr)) { + WARN("failed to get IDWriteFontFace2, 0x%08x\n", hr); + return hr; + } + + colorfont = IDWriteFontFace2_IsColorFont(fontface2); + IDWriteFontFace2_Release(fontface2); + if (!colorfont) + return DWRITE_E_NOCOLOR; + colorglyphenum = heap_alloc(sizeof(*colorglyphenum)); if (!colorglyphenum) return E_OUTOFMEMORY; diff -Nru wine1.7-1.7.50/dlls/dwrite/freetype.c wine1.7-1.7.55/dlls/dwrite/freetype.c --- wine1.7-1.7.50/dlls/dwrite/freetype.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dwrite/freetype.c 2015-11-13 14:32:40.000000000 +0000 @@ -65,10 +65,13 @@ #define MAKE_FUNCPTR(f) static typeof(f) * p##f = NULL MAKE_FUNCPTR(FT_Done_FreeType); +MAKE_FUNCPTR(FT_Done_Glyph); MAKE_FUNCPTR(FT_Get_First_Char); MAKE_FUNCPTR(FT_Get_Kerning); MAKE_FUNCPTR(FT_Get_Sfnt_Table); +MAKE_FUNCPTR(FT_Glyph_Copy); MAKE_FUNCPTR(FT_Glyph_Get_CBox); +MAKE_FUNCPTR(FT_Glyph_Transform); MAKE_FUNCPTR(FT_Init_FreeType); MAKE_FUNCPTR(FT_Library_Version); MAKE_FUNCPTR(FT_Load_Glyph); @@ -148,10 +151,13 @@ #define LOAD_FUNCPTR(f) if((p##f = wine_dlsym(ft_handle, #f, NULL, 0)) == NULL){WARN("Can't find symbol %s\n", #f); goto sym_not_found;} LOAD_FUNCPTR(FT_Done_FreeType) + LOAD_FUNCPTR(FT_Done_Glyph) LOAD_FUNCPTR(FT_Get_First_Char) LOAD_FUNCPTR(FT_Get_Kerning) LOAD_FUNCPTR(FT_Get_Sfnt_Table) + LOAD_FUNCPTR(FT_Glyph_Copy) LOAD_FUNCPTR(FT_Glyph_Get_CBox) + LOAD_FUNCPTR(FT_Glyph_Transform) LOAD_FUNCPTR(FT_Init_FreeType) LOAD_FUNCPTR(FT_Library_Version) LOAD_FUNCPTR(FT_Load_Glyph) @@ -399,7 +405,7 @@ EnterCriticalSection(&freetype_cs); if (pFTC_Manager_LookupSize(cache_manager, &scaler, &size) == 0) { - if (pFT_Load_Glyph(size->face, index, FT_LOAD_DEFAULT) == 0) { + if (pFT_Load_Glyph(size->face, index, FT_LOAD_NO_BITMAP) == 0) { FT_Outline *outline = &size->face->glyph->outline; short count; FT_Matrix m; @@ -487,84 +493,206 @@ return adjustment; } -void freetype_get_glyph_bbox(IDWriteFontFace2 *fontface, FLOAT emSize, UINT16 index, BOOL nohint, RECT *ret) +static inline void ft_matrix_from_dwrite_matrix(const DWRITE_MATRIX *m, FT_Matrix *ft_matrix) +{ + ft_matrix->xx = m->m11 * 0x10000; + ft_matrix->xy = -m->m21 * 0x10000; + ft_matrix->yx = -m->m12 * 0x10000; + ft_matrix->yy = m->m22 * 0x10000; +} + +/* Should be used only while holding 'freetype_cs' */ +static BOOL is_face_scalable(IDWriteFontFace2 *fontface) +{ + FT_Face face; + if (pFTC_Manager_LookupFace(cache_manager, fontface, &face) == 0) + return FT_IS_SCALABLE(face); + else + return FALSE; +} + +void freetype_get_glyph_bbox(struct dwrite_glyphbitmap *bitmap) { FTC_ImageTypeRec imagetype; FT_BBox bbox = { 0 }; FT_Glyph glyph; - imagetype.face_id = fontface; + EnterCriticalSection(&freetype_cs); + + /* Some fonts provide mostly bitmaps and very few outlines, for example for .notdef, + disable transform if that's the case. */ + if (bitmap->m) { + if (!is_face_scalable(bitmap->fontface)) + bitmap->m = NULL; + } + + imagetype.face_id = bitmap->fontface; imagetype.width = 0; - imagetype.height = emSize; - imagetype.flags = FT_LOAD_DEFAULT; + imagetype.height = bitmap->emsize; + imagetype.flags = bitmap->m ? FT_LOAD_NO_BITMAP : FT_LOAD_DEFAULT; + + if (pFTC_ImageCache_Lookup(image_cache, &imagetype, bitmap->index, &glyph, NULL) == 0) { + if (bitmap->m) { + FT_Glyph glyph_copy; + + if (pFT_Glyph_Copy(glyph, &glyph_copy) == 0) { + FT_Matrix ft_matrix; + + ft_matrix_from_dwrite_matrix(bitmap->m, &ft_matrix); + pFT_Glyph_Transform(glyph_copy, &ft_matrix, NULL); + pFT_Glyph_Get_CBox(glyph_copy, FT_GLYPH_BBOX_PIXELS, &bbox); + pFT_Done_Glyph(glyph_copy); + } + } + else + pFT_Glyph_Get_CBox(glyph, FT_GLYPH_BBOX_PIXELS, &bbox); + } - EnterCriticalSection(&freetype_cs); - if (pFTC_ImageCache_Lookup(image_cache, &imagetype, index, &glyph, NULL) == 0) - pFT_Glyph_Get_CBox(glyph, FT_GLYPH_BBOX_PIXELS, &bbox); LeaveCriticalSection(&freetype_cs); /* flip Y axis */ - ret->left = bbox.xMin; - ret->right = bbox.xMax; - ret->top = -bbox.yMax; - ret->bottom = -bbox.yMin; + bitmap->bbox.left = bbox.xMin; + bitmap->bbox.right = bbox.xMax; + bitmap->bbox.top = -bbox.yMax; + bitmap->bbox.bottom = -bbox.yMin; +} + +static BOOL freetype_get_aliased_glyph_bitmap(struct dwrite_glyphbitmap *bitmap, FT_Glyph glyph) +{ + const RECT *bbox = &bitmap->bbox; + int width = bbox->right - bbox->left; + int height = bbox->bottom - bbox->top; + + if (glyph->format == FT_GLYPH_FORMAT_OUTLINE) { + FT_OutlineGlyph outline = (FT_OutlineGlyph)glyph; + const FT_Outline *src = &outline->outline; + FT_Bitmap ft_bitmap; + FT_Outline copy; + + ft_bitmap.width = width; + ft_bitmap.rows = height; + ft_bitmap.pitch = bitmap->pitch; + ft_bitmap.pixel_mode = FT_PIXEL_MODE_MONO; + ft_bitmap.buffer = bitmap->buf; + + /* Note: FreeType will only set 'black' bits for us. */ + if (pFT_Outline_New(library, src->n_points, src->n_contours, ©) == 0) { + pFT_Outline_Copy(src, ©); + pFT_Outline_Translate(©, -bbox->left << 6, bbox->bottom << 6); + pFT_Outline_Get_Bitmap(library, ©, &ft_bitmap); + pFT_Outline_Done(library, ©); + } + } + else if (glyph->format == FT_GLYPH_FORMAT_BITMAP) { + FT_Bitmap *ft_bitmap = &((FT_BitmapGlyph)glyph)->bitmap; + BYTE *src = ft_bitmap->buffer, *dst = bitmap->buf; + int w = min(bitmap->pitch, (ft_bitmap->width + 7) >> 3); + int h = min(height, ft_bitmap->rows); + + while (h--) { + memcpy(dst, src, w); + src += ft_bitmap->pitch; + dst += bitmap->pitch; + } + } + else + FIXME("format %x not handled\n", glyph->format); + + return TRUE; +} + +static BOOL freetype_get_aa_glyph_bitmap(struct dwrite_glyphbitmap *bitmap, FT_Glyph glyph) +{ + const RECT *bbox = &bitmap->bbox; + int width = bbox->right - bbox->left; + int height = bbox->bottom - bbox->top; + BOOL ret = FALSE; + + if (glyph->format == FT_GLYPH_FORMAT_OUTLINE) { + FT_OutlineGlyph outline = (FT_OutlineGlyph)glyph; + const FT_Outline *src = &outline->outline; + FT_Bitmap ft_bitmap; + FT_Outline copy; + + ft_bitmap.width = width; + ft_bitmap.rows = height; + ft_bitmap.pitch = bitmap->pitch; + ft_bitmap.pixel_mode = FT_PIXEL_MODE_GRAY; + ft_bitmap.buffer = bitmap->buf; + + /* Note: FreeType will only set 'black' bits for us. */ + if (pFT_Outline_New(library, src->n_points, src->n_contours, ©) == 0) { + pFT_Outline_Copy(src, ©); + pFT_Outline_Translate(©, -bbox->left << 6, bbox->bottom << 6); + pFT_Outline_Get_Bitmap(library, ©, &ft_bitmap); + pFT_Outline_Done(library, ©); + } + } + else if (glyph->format == FT_GLYPH_FORMAT_BITMAP) { + FT_Bitmap *ft_bitmap = &((FT_BitmapGlyph)glyph)->bitmap; + BYTE *src = ft_bitmap->buffer, *dst = bitmap->buf; + int w = min(bitmap->pitch, (ft_bitmap->width + 7) >> 3); + int h = min(height, ft_bitmap->rows); + + while (h--) { + memcpy(dst, src, w); + src += ft_bitmap->pitch; + dst += bitmap->pitch; + } + + ret = TRUE; + } + else + FIXME("format %x not handled\n", glyph->format); + + return ret; } -void freetype_get_glyph_bitmap(IDWriteFontFace2 *fontface, FLOAT emSize, UINT16 index, const RECT *bbox, BYTE *buf) +BOOL freetype_get_glyph_bitmap(struct dwrite_glyphbitmap *bitmap) { FTC_ImageTypeRec imagetype; + BOOL ret = FALSE; FT_Glyph glyph; - imagetype.face_id = fontface; + EnterCriticalSection(&freetype_cs); + + if (bitmap->m) { + if (!is_face_scalable(bitmap->fontface)) + bitmap->m = NULL; + } + + imagetype.face_id = bitmap->fontface; imagetype.width = 0; - imagetype.height = emSize; - imagetype.flags = FT_LOAD_DEFAULT; + imagetype.height = bitmap->emsize; + imagetype.flags = bitmap->m ? FT_LOAD_NO_BITMAP : FT_LOAD_DEFAULT; - EnterCriticalSection(&freetype_cs); - if (pFTC_ImageCache_Lookup(image_cache, &imagetype, index, &glyph, NULL) == 0) { - int width = bbox->right - bbox->left; - int pitch = ((width + 31) >> 5) << 2; - int height = bbox->bottom - bbox->top; - - if (glyph->format == FT_GLYPH_FORMAT_OUTLINE) { - FT_OutlineGlyph outline = (FT_OutlineGlyph)glyph; - const FT_Outline *src = &outline->outline; - FT_Bitmap ft_bitmap; - FT_Outline copy; - - ft_bitmap.width = width; - ft_bitmap.rows = height; - ft_bitmap.pitch = pitch; - ft_bitmap.pixel_mode = FT_PIXEL_MODE_MONO; - ft_bitmap.buffer = buf; - - /* Note: FreeType will only set 'black' bits for us. */ - memset(buf, 0, height*pitch); - if (pFT_Outline_New(library, src->n_points, src->n_contours, ©) == 0) { - pFT_Outline_Copy(src, ©); - pFT_Outline_Translate(©, -bbox->left << 6, bbox->bottom << 6); - pFT_Outline_Get_Bitmap(library, ©, &ft_bitmap); - pFT_Outline_Done(library, ©); - } - } - else if (glyph->format == FT_GLYPH_FORMAT_BITMAP) { - FT_Bitmap *bitmap = &((FT_BitmapGlyph)glyph)->bitmap; - BYTE *src = bitmap->buffer, *dst = buf; - int w = min(pitch, (bitmap->width + 7) >> 3); - int h = min(height, bitmap->rows); - - memset(buf, 0, height*pitch); - - while (h--) { - memcpy(dst, src, w); - src += bitmap->pitch; - dst += pitch; + if (pFTC_ImageCache_Lookup(image_cache, &imagetype, bitmap->index, &glyph, NULL) == 0) { + FT_Glyph glyph_copy; + + if (bitmap->m) { + if (pFT_Glyph_Copy(glyph, &glyph_copy) == 0) { + FT_Matrix ft_matrix; + + ft_matrix_from_dwrite_matrix(bitmap->m, &ft_matrix); + pFT_Glyph_Transform(glyph_copy, &ft_matrix, NULL); + glyph = glyph_copy; } } else - FIXME("format %d not handled\n", glyph->format); + glyph_copy = NULL; + + if (bitmap->type == DWRITE_TEXTURE_CLEARTYPE_3x1) + ret = freetype_get_aa_glyph_bitmap(bitmap, glyph); + else + ret = freetype_get_aliased_glyph_bitmap(bitmap, glyph); + + if (glyph_copy) + pFT_Done_Glyph(glyph_copy); } + LeaveCriticalSection(&freetype_cs); + + return ret; } INT freetype_get_charmap_index(IDWriteFontFace2 *fontface, BOOL *is_symbol) @@ -584,7 +712,7 @@ if (os2->version == 0) *is_symbol = pFT_Get_First_Char(face, &dummy) >= 0x100; else - *is_symbol = os2->ulCodePageRange1 & FS_SYMBOL; + *is_symbol = !!(os2->ulCodePageRange1 & FS_SYMBOL); } for (i = 0; i < face->num_charmaps; i++) @@ -599,6 +727,29 @@ return charmap_index; } +INT32 freetype_get_glyph_advance(IDWriteFontFace2 *fontface, FLOAT emSize, UINT16 index, DWRITE_MEASURING_MODE mode) +{ + FTC_ImageTypeRec imagetype; + FT_Glyph glyph; + INT32 advance; + + imagetype.face_id = fontface; + imagetype.width = 0; + imagetype.height = emSize; + imagetype.flags = FT_LOAD_DEFAULT; + if (mode == DWRITE_MEASURING_MODE_NATURAL) + imagetype.flags |= FT_LOAD_NO_HINTING; + + EnterCriticalSection(&freetype_cs); + if (pFTC_ImageCache_Lookup(image_cache, &imagetype, index, &glyph, NULL) == 0) + advance = glyph->advance.x >> 16; + else + advance = 0; + LeaveCriticalSection(&freetype_cs); + + return advance; +} + #else /* HAVE_FREETYPE */ BOOL init_freetype(void) @@ -650,15 +801,14 @@ return 0; } -void freetype_get_glyph_bbox(IDWriteFontFace2 *fontface, FLOAT emSize, UINT16 index, BOOL nohint, RECT *ret) +void freetype_get_glyph_bbox(struct dwrite_glyphbitmap *bitmap) { - ret->left = ret->right = ret->top = ret->bottom = 0; + memset(&bitmap->bbox, 0, sizeof(bitmap->bbox)); } -void freetype_get_glyph_bitmap(IDWriteFontFace2 *fontface, FLOAT emSize, UINT16 index, const RECT *bbox, BYTE *buf) +BOOL freetype_get_glyph_bitmap(struct dwrite_glyphbitmap *bitmap) { - UINT32 size = (bbox->right - bbox->left)*(bbox->bottom - bbox->top); - memset(buf, 0, size); + return FALSE; } INT freetype_get_charmap_index(IDWriteFontFace2 *fontface, BOOL *is_symbol) @@ -667,4 +817,9 @@ return -1; } +INT32 freetype_get_glyph_advance(IDWriteFontFace2 *fontface, FLOAT emSize, UINT16 index, DWRITE_MEASURING_MODE mode) +{ + return 0; +} + #endif /* HAVE_FREETYPE */ diff -Nru wine1.7-1.7.50/dlls/dwrite/gdiinterop.c wine1.7-1.7.55/dlls/dwrite/gdiinterop.c --- wine1.7-1.7.50/dlls/dwrite/gdiinterop.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dwrite/gdiinterop.c 2015-11-13 14:32:40.000000000 +0000 @@ -299,6 +299,11 @@ } } +static inline DWORD colorref_to_pixel_888(COLORREF color) +{ + return (((color >> 16) & 0xff) | (color & 0xff00) | ((color << 16) & 0xff0000)); +} + static HRESULT WINAPI rendertarget_DrawGlyphRun(IDWriteBitmapRenderTarget1 *iface, FLOAT originX, FLOAT originY, DWRITE_MEASURING_MODE measuring_mode, DWRITE_GLYPH_RUN const *run, IDWriteRenderingParams *params, COLORREF color, @@ -401,6 +406,11 @@ hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &bounds); if (FAILED(hr) || IsRectEmpty(&bounds)) { hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_CLEARTYPE_3x1, &bounds); + if (FAILED(hr)) { + WARN("GetAlphaTextureBounds() failed, 0x%08x\n", hr); + IDWriteGlyphRunAnalysis_Release(analysis); + return hr; + } texturetype = DWRITE_TEXTURE_CLEARTYPE_3x1; } @@ -408,6 +418,7 @@ UINT32 size = (target.right - target.left) * (target.bottom - target.top); BYTE *bitmap; + color = colorref_to_pixel_888(color); if (texturetype == DWRITE_TEXTURE_CLEARTYPE_3x1) size *= 3; bitmap = heap_alloc_zero(size); @@ -557,7 +568,7 @@ } target->m = identity; - target->ppdip = 1.0; + target->ppdip = GetDeviceCaps(target->hdc, LOGPIXELSX) / 96.0f; target->antialiasmode = DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE; target->factory = factory; IDWriteFactory_AddRef(factory); @@ -767,31 +778,87 @@ return hr; } +struct font_realization_info { + DWORD size; + DWORD flags; + DWORD cache_num; + DWORD instance_id; + DWORD unk; + WORD face_index; + WORD simulations; +}; + +struct font_fileinfo { + FILETIME writetime; + LARGE_INTEGER size; + WCHAR path[1]; +}; + +/* Undocumented gdi32 exports, used to access actually selected font information */ +extern BOOL WINAPI GetFontRealizationInfo(HDC hdc, struct font_realization_info *info); +extern BOOL WINAPI GetFontFileInfo(DWORD instance_id, DWORD unknown, struct font_fileinfo *info, DWORD size, DWORD *needed); + static HRESULT WINAPI gdiinterop_CreateFontFaceFromHdc(IDWriteGdiInterop *iface, HDC hdc, IDWriteFontFace **fontface) { struct gdiinterop *This = impl_from_IDWriteGdiInterop(iface); - IDWriteFont *font; - LOGFONTW logfont; - HFONT hfont; + struct font_realization_info info; + struct font_fileinfo *fileinfo; + DWRITE_FONT_FILE_TYPE filetype; + DWRITE_FONT_FACE_TYPE facetype; + IDWriteFontFile *file; + BOOL is_supported; + UINT32 facenum; + DWORD needed; HRESULT hr; TRACE("(%p)->(%p %p)\n", This, hdc, fontface); *fontface = NULL; - hfont = GetCurrentObject(hdc, OBJ_FONT); - if (!hfont) + if (!hdc) return E_INVALIDARG; - GetObjectW(hfont, sizeof(logfont), &logfont); - hr = IDWriteGdiInterop_CreateFontFromLOGFONT(iface, &logfont, &font); + /* get selected font id */ + info.size = sizeof(info); + if (!GetFontRealizationInfo(hdc, &info)) { + WARN("failed to get selected font id\n"); + return E_FAIL; + } + + needed = 0; + GetFontFileInfo(info.instance_id, 0, NULL, 0, &needed); + if (needed == 0) { + WARN("failed to get font file info size\n"); + return E_FAIL; + } + + fileinfo = heap_alloc(needed); + if (!fileinfo) + return E_OUTOFMEMORY; + + if (!GetFontFileInfo(info.instance_id, 0, fileinfo, needed, &needed)) { + heap_free(fileinfo); + return E_FAIL; + } + + hr = IDWriteFactory2_CreateFontFileReference(This->factory, fileinfo->path, &fileinfo->writetime, + &file); + heap_free(fileinfo); if (FAILED(hr)) return hr; - hr = IDWriteFont_CreateFontFace(font, fontface); - IDWriteFont_Release(font); + is_supported = FALSE; + hr = IDWriteFontFile_Analyze(file, &is_supported, &filetype, &facetype, &facenum); + if (FAILED(hr) || !is_supported) { + IDWriteFontFile_Release(file); + return hr; + } + /* Simulations flags values match DWRITE_FONT_SIMULATIONS */ + hr = IDWriteFactory2_CreateFontFace(This->factory, facetype, 1, &file, info.face_index, info.simulations, + fontface); + IDWriteFontFile_Release(file); return hr; } diff -Nru wine1.7-1.7.50/dlls/dwrite/linebreak.c wine1.7-1.7.55/dlls/dwrite/linebreak.c --- wine1.7-1.7.50/dlls/dwrite/linebreak.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dwrite/linebreak.c 2015-11-13 14:32:40.000000000 +0000 @@ -1,8 +1,8 @@ /* Unicode Line Break Properties */ -/* generated from http://www.unicode.org/Public/7.0.0/ucd/LineBreak.txt */ +/* generated from http://www.unicode.org/Public/8.0.0/ucd/LineBreak.txt */ /* DO NOT EDIT!! */ -const unsigned short wine_linebreak_table[7232] = +const unsigned short wine_linebreak_table[7216] = { /* level 1 offsets */ 0x0100, 0x0110, 0x0120, 0x0130, 0x0140, 0x0150, 0x0160, 0x0170, @@ -96,19 +96,19 @@ 0x0860, 0x0860, 0x0860, 0x0860, 0x0a30, 0x10a0, 0x10b0, 0x10c0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x0580, 0x0580, 0x0580, 0x10d0, - 0x05b0, 0x10e0, 0x05b0, 0x05b0, 0x10e0, 0x10f0, 0x05b0, 0x1100, - 0x05b0, 0x05b0, 0x05b0, 0x1110, 0x1110, 0x1120, 0x05b0, 0x1130, - 0x1140, 0x1150, 0x1160, 0x1170, 0x1180, 0x1190, 0x11a0, 0x11b0, - 0x11c0, 0x0ce0, 0x11d0, 0x11e0, 0x11f0, 0x0580, 0x0580, 0x1200, - 0x1210, 0x1220, 0x1230, 0x05b0, 0x05b0, 0x1240, 0x1250, 0x1260, - 0x1270, 0x1260, 0x05b0, 0x05b0, 0x05b0, 0x1280, 0x05b0, 0x05b0, - 0x1290, 0x12a0, 0x12b0, 0x12c0, 0x12d0, 0x12e0, 0x12f0, 0x05b0, - 0x1300, 0x1310, 0x1320, 0x1330, 0x05b0, 0x05b0, 0x05b0, 0x05b0, + 0x05b0, 0x0e40, 0x05b0, 0x05b0, 0x0e40, 0x10e0, 0x05b0, 0x10f0, + 0x05b0, 0x05b0, 0x05b0, 0x1100, 0x1100, 0x1110, 0x05b0, 0x1120, + 0x1130, 0x1140, 0x1150, 0x1160, 0x1170, 0x1180, 0x1190, 0x11a0, + 0x11b0, 0x0ce0, 0x11c0, 0x11d0, 0x11e0, 0x0580, 0x0580, 0x11f0, + 0x1200, 0x1210, 0x1220, 0x05b0, 0x05b0, 0x1230, 0x1240, 0x1250, + 0x1260, 0x1250, 0x05b0, 0x05b0, 0x05b0, 0x1270, 0x05b0, 0x05b0, + 0x1280, 0x1290, 0x12a0, 0x12b0, 0x12c0, 0x12d0, 0x12e0, 0x05b0, + 0x12f0, 0x1300, 0x1310, 0x1320, 0x05b0, 0x05b0, 0x1330, 0x05b0, 0x1340, 0x1350, 0x1360, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1370, 0x05b0, 0x05b0, 0x1380, 0x0860, 0x1390, 0x0860, 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x13b0, - 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x1250, 0x13a0, 0x13a0, 0x13c0, + 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x1240, 0x13a0, 0x13a0, 0x13c0, 0x13a0, 0x13d0, 0x13e0, 0x13f0, 0x1400, 0x1410, 0x1420, 0x05b0, 0x1430, 0x1440, 0x05b0, 0x1450, 0x1460, 0x05b0, 0x1470, 0x1480, 0x05b0, 0x1490, 0x05b0, 0x14a0, 0x14b0, 0x14c0, 0x14d0, 0x14e0, @@ -117,41 +117,41 @@ 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1560, 0x1570, 0x05b0, 0x05b0, 0x05b0, 0x1340, 0x05b0, 0x1580, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1590, 0x05b0, 0x15a0, - 0x05b0, 0x15b0, 0x05b0, 0x15c0, 0x08f0, 0x15d0, 0x0860, 0x0860, + 0x05b0, 0x15b0, 0x05b0, 0x15c0, 0x08f0, 0x15d0, 0x15e0, 0x0860, 0x05b0, 0x05b0, 0x0840, 0x05b0, 0x05b0, 0x0840, 0x05b0, 0x05b0, - 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x15e0, 0x15f0, - 0x05b0, 0x05b0, 0x0d70, 0x05b0, 0x05b0, 0x05b0, 0x1600, 0x1610, - 0x05b0, 0x1380, 0x1620, 0x1620, 0x1620, 0x1620, 0x0580, 0x0580, - 0x1630, 0x1640, 0x1650, 0x1660, 0x1670, 0x0860, 0x0860, 0x0860, - 0x1680, 0x1690, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x16a0, - 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, - 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x16b0, 0x0860, 0x16c0, - 0x16d0, 0x16e0, 0x16f0, 0x1700, 0x1710, 0x1680, 0x1720, 0x1680, - 0x1730, 0x1740, 0x1750, 0x1680, 0x1720, 0x1680, 0x1730, 0x1760, - 0x1770, 0x1680, 0x1780, 0x1790, 0x1680, 0x1680, 0x1680, 0x1680, - 0x17a0, 0x1680, 0x1680, 0x17b0, 0x1680, 0x1680, 0x16a0, 0x17c0, - 0x1680, 0x17a0, 0x1680, 0x1680, 0x17d0, 0x1680, 0x1680, 0x1680, - 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x17a0, - 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, - 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, - 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, - 0x1680, 0x1680, 0x1680, 0x1680, 0x05b0, 0x05b0, 0x05b0, 0x05b0, - 0x1680, 0x17e0, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, - 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, - 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, - 0x17f0, 0x1680, 0x1680, 0x1680, 0x1800, 0x05b0, 0x05b0, 0x1090, - 0x1810, 0x05b0, 0x1820, 0x0860, 0x05b0, 0x05b0, 0x15e0, 0x1830, - 0x05b0, 0x1840, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1850, + 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x15f0, 0x1600, + 0x05b0, 0x05b0, 0x0d70, 0x05b0, 0x05b0, 0x05b0, 0x1610, 0x1620, + 0x05b0, 0x1380, 0x1630, 0x1630, 0x1630, 0x1630, 0x0580, 0x0580, + 0x1640, 0x1650, 0x1660, 0x1670, 0x1680, 0x0860, 0x0860, 0x0860, + 0x1690, 0x16a0, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x16b0, + 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, + 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x16c0, 0x0860, 0x16d0, + 0x16e0, 0x16f0, 0x1700, 0x1710, 0x1720, 0x1690, 0x1730, 0x1690, + 0x1740, 0x1750, 0x1760, 0x1690, 0x1730, 0x1690, 0x1740, 0x1770, + 0x1780, 0x1690, 0x1790, 0x17a0, 0x1690, 0x1690, 0x1690, 0x1690, + 0x17b0, 0x1690, 0x1690, 0x17c0, 0x1690, 0x1690, 0x16b0, 0x17d0, + 0x1690, 0x17b0, 0x1690, 0x1690, 0x17e0, 0x1690, 0x1690, 0x1690, + 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x17b0, + 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, + 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, + 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, + 0x1690, 0x1690, 0x1690, 0x1690, 0x05b0, 0x05b0, 0x05b0, 0x05b0, + 0x1690, 0x17f0, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, + 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, + 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, + 0x1800, 0x1690, 0x1690, 0x1690, 0x1810, 0x05b0, 0x05b0, 0x1090, + 0x1820, 0x05b0, 0x1830, 0x0860, 0x05b0, 0x05b0, 0x15f0, 0x1840, + 0x05b0, 0x1850, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1860, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, - 0x0840, 0x05b0, 0x1100, 0x15d0, 0x0860, 0x0860, 0x0860, 0x1860, - 0x1870, 0x05b0, 0x1880, 0x1890, 0x05b0, 0x05b0, 0x05b0, 0x18a0, - 0x18b0, 0x05b0, 0x05b0, 0x0ff0, 0x18c0, 0x0ef0, 0x0580, 0x18d0, - 0x07b0, 0x05b0, 0x18e0, 0x05b0, 0x18f0, 0x1900, 0x0d80, 0x1910, - 0x0890, 0x05b0, 0x05b0, 0x1920, 0x1930, 0x1940, 0x0c00, 0x1950, - 0x05b0, 0x05b0, 0x1960, 0x1970, 0x1980, 0x1990, 0x0c00, 0x0c00, - 0x0c00, 0x0c00, 0x0c00, 0x0c00, 0x19a0, 0x19b0, 0x0760, 0x19c0, - 0x19d0, 0x19e0, 0x1620, 0x05b0, 0x05b0, 0x05b0, 0x19f0, 0x0860, - 0x0860, 0x0860, 0x0860, 0x0860, 0x05b0, 0x05b0, 0x1a00, 0x0ef0, + 0x05b0, 0x05b0, 0x10f0, 0x0a30, 0x0860, 0x0860, 0x0860, 0x1870, + 0x1880, 0x05b0, 0x1890, 0x18a0, 0x05b0, 0x05b0, 0x05b0, 0x18b0, + 0x18c0, 0x05b0, 0x05b0, 0x0ff0, 0x18d0, 0x0ef0, 0x0580, 0x18e0, + 0x07b0, 0x05b0, 0x18f0, 0x05b0, 0x1900, 0x1910, 0x0d80, 0x1920, + 0x0890, 0x05b0, 0x05b0, 0x1930, 0x1940, 0x1950, 0x0c00, 0x1960, + 0x05b0, 0x05b0, 0x1970, 0x1980, 0x1990, 0x19a0, 0x0c00, 0x0c00, + 0x0c00, 0x0c00, 0x0c00, 0x0c00, 0x19b0, 0x19c0, 0x0760, 0x19d0, + 0x19e0, 0x19f0, 0x1630, 0x05b0, 0x05b0, 0x05b0, 0x0f20, 0x05b0, + 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1a00, 0x0ef0, 0x1a10, 0x1a20, 0x1a30, 0x1a40, 0x1a30, 0x1a50, 0x1a30, 0x1a10, 0x1a20, 0x1a30, 0x1a40, 0x1a30, 0x1a50, 0x1a30, 0x1a10, 0x1a20, 0x1a30, 0x1a40, 0x1a30, 0x1a50, 0x1a30, 0x1a10, 0x1a20, 0x1a30, @@ -176,10 +176,10 @@ 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x15d0, 0x1ae0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1af0, 0x0860, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1b00, 0x05b0, 0x05b0, 0x0a30, 0x0860, 0x0860, 0x1b10, - 0x0580, 0x1b20, 0x1b30, 0x1b40, 0x1b50, 0x1b60, 0x1b70, 0x1110, - 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1b80, - 0x1b90, 0x1ba0, 0x1680, 0x1bb0, 0x1680, 0x1bc0, 0x1bd0, 0x1be0, - 0x05b0, 0x1bf0, 0x05b0, 0x0840, 0x1c00, 0x1c10, 0x1c20, 0x1c30, + 0x0580, 0x1b20, 0x0580, 0x1b30, 0x1b40, 0x1b50, 0x1b60, 0x1100, + 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1b70, + 0x1b80, 0x1b90, 0x1690, 0x1ba0, 0x1690, 0x1bb0, 0x1bc0, 0x1bd0, + 0x05b0, 0x1be0, 0x05b0, 0x0840, 0x1bf0, 0x1c00, 0x1c10, 0x1c20, /* values */ 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0022, 0x0003, 0x0001, 0x0001, 0x0002, 0x0004, 0x0004, @@ -277,9 +277,9 @@ 0x001d, 0x0004, 0x0004, 0x0004, 0x0011, 0x0011, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, - 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, + 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, - 0x0011, 0x0011, 0x0011, 0x0011, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0011, 0x0011, 0x0011, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, @@ -326,7 +326,7 @@ 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x001d, 0x001a, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, - 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, + 0x0011, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0004, 0x0004, 0x0004, 0x0011, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x001d, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0011, 0x0011, 0x0004, @@ -358,7 +358,7 @@ 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0011, 0x0004, 0x0004, 0x0004, 0x0011, 0x0004, 0x0004, 0x0004, 0x0004, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0004, 0x0004, 0x0011, - 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, + 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0004, 0x0004, 0x0004, 0x0011, 0x001d, 0x001d, 0x001d, @@ -374,7 +374,7 @@ 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0011, 0x0004, 0x0004, 0x0004, 0x0011, 0x0004, 0x0004, 0x0004, 0x0004, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0004, - 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, + 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, 0x001b, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x0004, 0x0004, 0x0011, 0x001d, 0x001d, 0x001d, @@ -463,8 +463,8 @@ 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, - 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, - 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, + 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, + 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x0022, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, @@ -547,8 +547,6 @@ 0x0004, 0x0004, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0004, 0x0004, 0x0004, 0x0004, - 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, - 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x001d, 0x0011, 0x001d, 0x0011, 0x001d, 0x0011, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, @@ -580,7 +578,7 @@ 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001b, 0x001a, - 0x001a, 0x001a, 0x001a, 0x001b, 0x001a, 0x001a, 0x001a, 0x001a, + 0x001a, 0x001a, 0x001a, 0x001b, 0x001a, 0x001a, 0x001b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x0004, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, @@ -598,7 +596,7 @@ 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, - 0x001d, 0x0024, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, + 0x001d, 0x0024, 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x001d, 0x001d, 0x0024, 0x001d, 0x0024, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0024, 0x001d, 0x0024, 0x0024, 0x001d, 0x001d, 0x001d, 0x0024, @@ -624,6 +622,8 @@ 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0024, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, + 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001f, + 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0012, 0x0013, 0x0012, 0x0013, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0024, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001e, 0x001e, 0x001d, 0x001d, 0x001d, 0x001d, @@ -707,6 +707,8 @@ 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, + 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, + 0x0011, 0x0011, 0x0011, 0x0011, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0004, 0x0004, 0x0004, 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, @@ -784,7 +786,7 @@ 0x0004, 0x0004, 0x0004, 0x001d, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, - 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0004, + 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0004, 0x0004, 0x0004, 0x0004, 0x001d, 0x0022, 0x0022, 0x0022, 0x0022, 0x0022, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x001d, @@ -802,7 +804,7 @@ 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0022, 0x0022, 0x0004, 0x0004, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, - 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, + 0x001d, 0x001d, 0x001d, 0x001d, 0x0021, 0x001d, 0x0011, 0x0011, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0022, 0x0022, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0004, @@ -837,8 +839,6 @@ 0x0011, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, - 0x0011, 0x0011, 0x0011, 0x0011, 0x001d, 0x001d, 0x0011, 0x0011, - 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x001d, 0x001d, 0x001d, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0022, 0x0004, 0x0004, 0x0011, 0x0011, 0x000f, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, @@ -877,8 +877,6 @@ 0x001d, 0x001d, 0x001d, 0x001d, 0x001b, 0x001d, 0x0011, 0x0011, 0x0019, 0x0013, 0x0013, 0x0019, 0x0019, 0x0017, 0x0017, 0x0012, 0x0013, 0x001f, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, - 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, - 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0011, 0x0011, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x0012, 0x0013, 0x0012, 0x0013, 0x0012, 0x0013, 0x0012, 0x0013, 0x0012, 0x0013, 0x0012, 0x0013, 0x0012, 0x0013, 0x0012, 0x0013, 0x001e, 0x001e, 0x0012, diff -Nru wine1.7-1.7.50/dlls/dwrite/main.c wine1.7-1.7.55/dlls/dwrite/main.c --- wine1.7-1.7.50/dlls/dwrite/main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dwrite/main.c 2015-11-13 14:32:40.000000000 +0000 @@ -438,7 +438,7 @@ } HRESULT clone_localizedstring(IDWriteLocalizedStrings *iface, IDWriteLocalizedStrings **ret) - { +{ struct localizedstrings *strings, *strings_clone; int i; @@ -471,6 +471,21 @@ return S_OK; } +void set_en_localizedstring(IDWriteLocalizedStrings *iface, const WCHAR *string) +{ + static const WCHAR enusW[] = {'e','n','-','U','S',0}; + struct localizedstrings *This = impl_from_IDWriteLocalizedStrings(iface); + UINT32 i; + + for (i = 0; i < This->count; i++) { + if (!strcmpiW(This->data[i].locale, enusW)) { + heap_free(This->data[i].string); + This->data[i].string = heap_strdupW(string); + break; + } + } +} + struct collectionloader { struct list entry; @@ -803,9 +818,12 @@ if (FAILED(hr)) return hr; - if (!is_supported || (face_type != req_facetype)) + if (!is_supported) return E_FAIL; + if (face_type != req_facetype) + return DWRITE_E_FILEFORMAT; + hr = IDWriteFontFile_GetReferenceKey(*font_files, &key, &key_size); if (FAILED(hr)) return hr; @@ -1079,7 +1097,12 @@ TRACE("(%p)->(%p %.2f %p %d %d %.2f %.2f %p)\n", This, run, ppdip, transform, rendering_mode, measuring_mode, originX, originY, analysis); - return create_glyphrunanalysis(rendering_mode, measuring_mode, run, 1.0f, DWRITE_GRID_FIT_MODE_DEFAULT, + if (ppdip <= 0.0f) { + *analysis = NULL; + return E_INVALIDARG; + } + + return create_glyphrunanalysis(rendering_mode, measuring_mode, run, ppdip, transform, DWRITE_GRID_FIT_MODE_DEFAULT, DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE, originX, originY, analysis); } @@ -1165,7 +1188,7 @@ 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); - return create_glyphrunanalysis(rendering_mode, measuring_mode, run, 1.0f, gridfit_mode, aa_mode, originX, originY, analysis); + return create_glyphrunanalysis(rendering_mode, measuring_mode, run, 1.0f, transform, gridfit_mode, aa_mode, originX, originY, analysis); } static const struct IDWriteFactory2Vtbl dwritefactoryvtbl = { diff -Nru wine1.7-1.7.50/dlls/dwrite/mirror.c wine1.7-1.7.55/dlls/dwrite/mirror.c --- wine1.7-1.7.50/dlls/dwrite/mirror.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dwrite/mirror.c 2015-11-13 14:32:40.000000000 +0000 @@ -1,5 +1,5 @@ /* Unicode BiDi mirroring */ -/* generated from http://www.unicode.org/Public/7.0.0/ucd/BidiMirroring.txt */ +/* generated from http://www.unicode.org/Public/8.0.0/ucd/BidiMirroring.txt */ /* DO NOT EDIT!! */ #include "wine/unicode.h" diff -Nru wine1.7-1.7.50/dlls/dwrite/opentype.c wine1.7-1.7.55/dlls/dwrite/opentype.c --- wine1.7-1.7.50/dlls/dwrite/opentype.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dwrite/opentype.c 2015-11-13 14:32:40.000000000 +0000 @@ -960,7 +960,9 @@ USHORT version = GET_BE_WORD(tt_os2->version); metrics->ascent = GET_BE_WORD(tt_os2->usWinAscent); - metrics->descent = GET_BE_WORD(tt_os2->usWinDescent); + /* Some fonts have usWinDescent value stored as signed short, which could be wrongly + interpreted as large unsigned value. */ + metrics->descent = abs((SHORT)GET_BE_WORD(tt_os2->usWinDescent)); /* line gap is estimated using two sets of ascender/descender values and 'hhea' line gap */ if (tt_hhea) { @@ -1196,7 +1198,7 @@ } } -HRESULT opentype_get_font_strings_from_id(const void *table_data, enum OPENTYPE_STRING_ID id, IDWriteLocalizedStrings **strings) +static HRESULT opentype_get_font_strings_from_id(const void *table_data, enum OPENTYPE_STRING_ID id, IDWriteLocalizedStrings **strings) { const TT_NAME_V0 *header; BYTE *storage_area = 0; diff -Nru wine1.7-1.7.50/dlls/dwrite/scripts.c wine1.7-1.7.55/dlls/dwrite/scripts.c --- wine1.7-1.7.50/dlls/dwrite/scripts.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dwrite/scripts.c 2015-11-13 14:32:40.000000000 +0000 @@ -1,8 +1,8 @@ /* Unicode Script IDs */ -/* generated from http://www.unicode.org/Public/7.0.0/ucd/Scripts.txt */ +/* generated from http://www.unicode.org/Public/8.0.0/ucd/Scripts.txt */ /* DO NOT EDIT!! */ -const unsigned short wine_scripts_table[5872] = +const unsigned short wine_scripts_table[5808] = { /* level 1 offsets */ 0x0100, 0x0110, 0x0120, 0x0130, 0x0140, 0x0150, 0x0160, 0x0170, @@ -24,721 +24,713 @@ 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, - 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, 0x03b0, - 0x03c0, 0x03c0, 0x03c0, 0x03c0, 0x03d0, 0x03e0, 0x03f0, 0x0400, - 0x0410, 0x0420, 0x0430, 0x0440, 0x0210, 0x0210, 0x0210, 0x0210, + 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, 0x0390, 0x0340, + 0x03b0, 0x03b0, 0x03b0, 0x03b0, 0x03c0, 0x03d0, 0x03e0, 0x03f0, + 0x0400, 0x0410, 0x0420, 0x0430, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, - 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0450, + 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0210, 0x0440, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, 0x0240, - 0x0240, 0x0390, 0x0460, 0x0470, 0x0480, 0x0490, 0x04a0, 0x04b0, + 0x0240, 0x0390, 0x0450, 0x0460, 0x0470, 0x0480, 0x0490, 0x04a0, /* level 2 offsets */ - 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04d0, 0x04e0, 0x04d0, 0x04e0, - 0x04c0, 0x04c0, 0x04f0, 0x04f0, 0x0500, 0x0510, 0x0500, 0x0510, - 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, - 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, - 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, - 0x0500, 0x0500, 0x0500, 0x0520, 0x04c0, 0x04c0, 0x0530, 0x04c0, - 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x0540, - 0x0550, 0x0560, 0x0570, 0x0560, 0x0560, 0x0560, 0x0580, 0x0560, - 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, - 0x05a0, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, 0x0590, - 0x0590, 0x0590, 0x0590, 0x05b0, 0x05c0, 0x05d0, 0x05b0, 0x05c0, - 0x05e0, 0x05f0, 0x0600, 0x0600, 0x0610, 0x0600, 0x0620, 0x0630, - 0x0640, 0x0650, 0x0660, 0x0660, 0x0670, 0x0680, 0x0690, 0x06a0, - 0x0660, 0x0660, 0x0660, 0x0660, 0x0660, 0x06b0, 0x0660, 0x0660, - 0x06c0, 0x06d0, 0x06d0, 0x06d0, 0x06e0, 0x0660, 0x0660, 0x0660, - 0x06f0, 0x06f0, 0x06f0, 0x0700, 0x0710, 0x0710, 0x0710, 0x0720, - 0x0730, 0x0730, 0x0740, 0x0750, 0x0760, 0x0770, 0x04c0, 0x04c0, - 0x04c0, 0x04c0, 0x0660, 0x0780, 0x04c0, 0x04c0, 0x0790, 0x0660, - 0x07a0, 0x07a0, 0x07a0, 0x07a0, 0x07a0, 0x07b0, 0x07c0, 0x07a0, - 0x07d0, 0x07e0, 0x07f0, 0x0800, 0x0810, 0x0820, 0x0830, 0x0840, - 0x0850, 0x0860, 0x0870, 0x0880, 0x0890, 0x08a0, 0x08b0, 0x08c0, - 0x08d0, 0x08e0, 0x08f0, 0x0900, 0x0910, 0x0920, 0x0930, 0x0940, - 0x0950, 0x0960, 0x0970, 0x0980, 0x0990, 0x09a0, 0x09b0, 0x09c0, - 0x09d0, 0x09e0, 0x09f0, 0x0a00, 0x0a10, 0x0a20, 0x0a30, 0x0a40, - 0x0a50, 0x0a60, 0x0a70, 0x0a80, 0x0a90, 0x0aa0, 0x0ab0, 0x0ac0, - 0x0ad0, 0x0ae0, 0x0af0, 0x0b00, 0x0b10, 0x0b20, 0x0b30, 0x0b40, - 0x0b50, 0x0b60, 0x0b70, 0x0b80, 0x0b90, 0x0ba0, 0x0bb0, 0x0bc0, - 0x0bd0, 0x0be0, 0x0bf0, 0x0c00, 0x0c10, 0x0c20, 0x0c30, 0x0c40, - 0x0c50, 0x0c60, 0x0c60, 0x0c70, 0x0c60, 0x0c80, 0x04c0, 0x04c0, - 0x0c90, 0x0ca0, 0x0cb0, 0x0cc0, 0x0cd0, 0x0ce0, 0x04c0, 0x04c0, - 0x0cf0, 0x0cf0, 0x0cf0, 0x0cf0, 0x0d00, 0x0cf0, 0x0d10, 0x0d20, - 0x0cf0, 0x0d00, 0x0cf0, 0x0d30, 0x0d30, 0x0d40, 0x04c0, 0x04c0, - 0x0d50, 0x0d50, 0x0d50, 0x0d50, 0x0d50, 0x0d50, 0x0d50, 0x0d50, - 0x0d50, 0x0d50, 0x0d60, 0x0d60, 0x0d70, 0x0d60, 0x0d60, 0x0d80, - 0x0d90, 0x0d90, 0x0d90, 0x0d90, 0x0d90, 0x0d90, 0x0d90, 0x0d90, - 0x0d90, 0x0d90, 0x0d90, 0x0d90, 0x0d90, 0x0d90, 0x0d90, 0x0d90, - 0x0da0, 0x0da0, 0x0da0, 0x0da0, 0x0db0, 0x0dc0, 0x0da0, 0x0da0, - 0x0db0, 0x0da0, 0x0da0, 0x0dd0, 0x0de0, 0x0df0, 0x0da0, 0x0da0, - 0x0da0, 0x0de0, 0x0da0, 0x0da0, 0x0da0, 0x0e00, 0x0da0, 0x0e10, - 0x0da0, 0x0e20, 0x0e30, 0x0e30, 0x0e30, 0x0e30, 0x0e30, 0x0e40, - 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, - 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, - 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, - 0x0e50, 0x0e60, 0x0e70, 0x0e70, 0x0e70, 0x0e70, 0x0e80, 0x0e90, - 0x0ea0, 0x0eb0, 0x0ec0, 0x0ed0, 0x0ee0, 0x0ef0, 0x0f00, 0x0f10, - 0x0f20, 0x0f20, 0x0f20, 0x0f20, 0x0f20, 0x0f30, 0x0f40, 0x0f40, - 0x0f50, 0x0f60, 0x0f70, 0x0f70, 0x0f70, 0x0f70, 0x0f70, 0x0f80, - 0x0f70, 0x0f70, 0x0f90, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, - 0x0fa0, 0x0fb0, 0x0fc0, 0x0fc0, 0x0fd0, 0x04c0, 0x04c0, 0x04c0, - 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x0f20, 0x0f20, - 0x0fe0, 0x0ff0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, - 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, - 0x1000, 0x1000, 0x1000, 0x1000, 0x1010, 0x1000, 0x1000, 0x1020, - 0x1030, 0x1030, 0x1030, 0x1030, 0x1040, 0x1040, 0x1040, 0x1050, - 0x1060, 0x1060, 0x1060, 0x1070, 0x1080, 0x04c0, 0x04c0, 0x04c0, - 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x1090, 0x04c0, 0x04c0, 0x04c0, - 0x0500, 0x0500, 0x10a0, 0x0500, 0x0500, 0x10b0, 0x10c0, 0x10d0, - 0x0500, 0x0500, 0x0500, 0x10e0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, - 0x0560, 0x10f0, 0x0560, 0x0560, 0x10f0, 0x1100, 0x0560, 0x1110, - 0x0560, 0x0560, 0x0560, 0x1120, 0x1120, 0x1130, 0x0560, 0x1140, - 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x1150, - 0x04c0, 0x1160, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, - 0x04c0, 0x04c0, 0x1170, 0x1180, 0x1190, 0x04c0, 0x0500, 0x0500, - 0x0520, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, - 0x11a0, 0x11a0, 0x11a0, 0x11a0, 0x11a0, 0x11a0, 0x11a0, 0x11a0, - 0x11a0, 0x11a0, 0x11a0, 0x11a0, 0x11a0, 0x11a0, 0x11a0, 0x11a0, - 0x11b0, 0x11b0, 0x11c0, 0x11b0, 0x11b0, 0x11c0, 0x0500, 0x0500, - 0x11d0, 0x11d0, 0x11d0, 0x11d0, 0x11d0, 0x11d0, 0x11d0, 0x11e0, - 0x0d60, 0x0d60, 0x0d70, 0x11f0, 0x11f0, 0x11f0, 0x1200, 0x1210, - 0x0da0, 0x1220, 0x1230, 0x1230, 0x1230, 0x1230, 0x0590, 0x0590, - 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, - 0x1240, 0x1250, 0x1240, 0x1240, 0x1240, 0x1240, 0x1240, 0x1260, - 0x1240, 0x1240, 0x1240, 0x1240, 0x1240, 0x1240, 0x1240, 0x1240, - 0x1240, 0x1240, 0x1240, 0x1240, 0x1240, 0x1270, 0x04c0, 0x04c0, - 0x1280, 0x04c0, 0x1290, 0x12a0, 0x12b0, 0x12c0, 0x12c0, 0x12c0, - 0x12c0, 0x12d0, 0x12e0, 0x12f0, 0x12f0, 0x12f0, 0x12f0, 0x1300, - 0x1310, 0x1320, 0x1330, 0x1340, 0x0d90, 0x0d90, 0x0d90, 0x0d90, - 0x1350, 0x04c0, 0x1320, 0x1360, 0x04c0, 0x04c0, 0x04c0, 0x12f0, - 0x0d90, 0x1350, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x0d90, 0x1350, - 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x12f0, 0x12f0, 0x1370, - 0x12f0, 0x12f0, 0x12f0, 0x12f0, 0x12f0, 0x1380, 0x04c0, 0x04c0, - 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, - 0x1240, 0x1240, 0x1240, 0x1240, 0x1240, 0x1240, 0x1240, 0x1240, - 0x1240, 0x1240, 0x1240, 0x1240, 0x1240, 0x1240, 0x1240, 0x1240, - 0x1240, 0x1240, 0x1240, 0x1240, 0x1240, 0x1240, 0x1240, 0x1240, - 0x1240, 0x1240, 0x1240, 0x1270, 0x04c0, 0x04c0, 0x04c0, 0x04c0, - 0x1240, 0x1240, 0x1240, 0x1240, 0x1240, 0x1240, 0x1240, 0x1240, - 0x1240, 0x1240, 0x1240, 0x1240, 0x1390, 0x04c0, 0x04c0, 0x04c0, - 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x13a0, - 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x13a0, - 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x13a0, - 0x13b0, 0x13a0, 0x13a0, 0x13a0, 0x13c0, 0x13d0, 0x13d0, 0x13d0, - 0x13e0, 0x13e0, 0x13e0, 0x13e0, 0x13e0, 0x13e0, 0x13e0, 0x13e0, - 0x13e0, 0x13e0, 0x13e0, 0x13e0, 0x13e0, 0x13e0, 0x13e0, 0x13e0, - 0x13e0, 0x13e0, 0x13f0, 0x04c0, 0x0590, 0x0590, 0x0590, 0x0590, - 0x0590, 0x1400, 0x1410, 0x1410, 0x1410, 0x1410, 0x1410, 0x1420, - 0x04c0, 0x04c0, 0x1430, 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, - 0x1440, 0x0500, 0x1450, 0x1460, 0x04c0, 0x04c0, 0x04c0, 0x1470, - 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, - 0x1480, 0x1480, 0x1480, 0x1480, 0x1490, 0x14a0, 0x07a0, 0x14b0, - 0x04c0, 0x04c0, 0x04c0, 0x14c0, 0x14c0, 0x14d0, 0x0d90, 0x14e0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x1500, 0x1510, 0x0d50, 0x1520, - 0x1530, 0x1530, 0x1530, 0x1540, 0x1550, 0x1560, 0x0d50, 0x0d50, - 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, - 0x1570, 0x1580, 0x1230, 0x0500, 0x0500, 0x1590, 0x15a0, 0x04c0, - 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, - 0x0d90, 0x0d90, 0x0d90, 0x0d90, 0x0d90, 0x0d90, 0x0d90, 0x0d90, - 0x0d90, 0x0d90, 0x15b0, 0x0d90, 0x15c0, 0x0d90, 0x0d90, 0x15d0, - 0x1240, 0x1240, 0x1240, 0x1240, 0x1240, 0x1240, 0x15e0, 0x1240, - 0x1240, 0x1240, 0x1240, 0x1240, 0x1240, 0x15f0, 0x04c0, 0x04c0, - 0x1600, 0x1610, 0x0600, 0x1620, 0x1630, 0x0660, 0x0660, 0x0660, - 0x0660, 0x0660, 0x0660, 0x0660, 0x1640, 0x1650, 0x0660, 0x0660, - 0x0660, 0x0660, 0x0660, 0x0660, 0x0660, 0x0660, 0x0660, 0x0660, - 0x0660, 0x0660, 0x0660, 0x0660, 0x0660, 0x0660, 0x0660, 0x0660, - 0x0660, 0x0660, 0x0660, 0x1660, 0x04c0, 0x0660, 0x0660, 0x0660, - 0x0660, 0x1670, 0x0660, 0x0660, 0x1680, 0x04c0, 0x04c0, 0x1660, - 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x04c0, 0x1690, - 0x0660, 0x0660, 0x0660, 0x0660, 0x0660, 0x0660, 0x0660, 0x16a0, - 0x04c0, 0x04c0, 0x04d0, 0x04e0, 0x04d0, 0x04e0, 0x16b0, 0x12e0, - 0x12f0, 0x16c0, 0x0d90, 0x1350, 0x16d0, 0x16e0, 0x04c0, 0x04c0, + 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04c0, 0x04d0, 0x04c0, 0x04d0, + 0x04b0, 0x04b0, 0x04e0, 0x04e0, 0x04f0, 0x0500, 0x04f0, 0x0500, + 0x04f0, 0x04f0, 0x04f0, 0x04f0, 0x04f0, 0x04f0, 0x04f0, 0x04f0, + 0x04f0, 0x04f0, 0x04f0, 0x04f0, 0x04f0, 0x04f0, 0x04f0, 0x04f0, + 0x04f0, 0x04f0, 0x04f0, 0x04f0, 0x04f0, 0x04f0, 0x04f0, 0x04f0, + 0x04f0, 0x04f0, 0x04f0, 0x0510, 0x04b0, 0x04b0, 0x0520, 0x04b0, + 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x0530, + 0x0540, 0x0550, 0x0560, 0x0550, 0x0550, 0x0550, 0x0570, 0x0550, + 0x0580, 0x0580, 0x0580, 0x0580, 0x0580, 0x0580, 0x0580, 0x0580, + 0x0590, 0x0580, 0x0580, 0x0580, 0x0580, 0x0580, 0x0580, 0x0580, + 0x0580, 0x0580, 0x0580, 0x05a0, 0x05b0, 0x05c0, 0x05a0, 0x05b0, + 0x05d0, 0x05e0, 0x05f0, 0x05f0, 0x0600, 0x05f0, 0x0610, 0x0620, + 0x0630, 0x0640, 0x0650, 0x0650, 0x0660, 0x0670, 0x0650, 0x0680, + 0x0650, 0x0650, 0x0650, 0x0650, 0x0650, 0x0690, 0x0650, 0x0650, + 0x06a0, 0x06b0, 0x06b0, 0x06b0, 0x06c0, 0x0650, 0x0650, 0x0650, + 0x06d0, 0x06d0, 0x06d0, 0x06e0, 0x06f0, 0x06f0, 0x06f0, 0x0700, + 0x0710, 0x0710, 0x0720, 0x0730, 0x0740, 0x0750, 0x04b0, 0x04b0, + 0x04b0, 0x04b0, 0x0650, 0x0760, 0x04b0, 0x04b0, 0x0770, 0x0650, + 0x0780, 0x0780, 0x0780, 0x0780, 0x0780, 0x0790, 0x07a0, 0x0780, + 0x07b0, 0x07c0, 0x07d0, 0x07e0, 0x07f0, 0x0800, 0x0810, 0x0820, + 0x0830, 0x0840, 0x0850, 0x0860, 0x0870, 0x0880, 0x0890, 0x08a0, + 0x08b0, 0x08c0, 0x08d0, 0x08e0, 0x08f0, 0x0900, 0x0910, 0x0920, + 0x0930, 0x0940, 0x0950, 0x0960, 0x0970, 0x0980, 0x0990, 0x09a0, + 0x09b0, 0x09c0, 0x09d0, 0x09e0, 0x09f0, 0x0a00, 0x0a10, 0x0a20, + 0x0a30, 0x0a40, 0x0a50, 0x0a60, 0x0a70, 0x0a80, 0x0a90, 0x0aa0, + 0x0ab0, 0x0ac0, 0x0ad0, 0x0ae0, 0x0af0, 0x0b00, 0x0b10, 0x0b20, + 0x0b30, 0x0b40, 0x0b50, 0x0b60, 0x0b70, 0x0b80, 0x0b90, 0x0ba0, + 0x0bb0, 0x0bc0, 0x0bd0, 0x0be0, 0x0bf0, 0x0c00, 0x0c10, 0x0c20, + 0x0c30, 0x0c40, 0x0c40, 0x0c50, 0x0c40, 0x0c60, 0x04b0, 0x04b0, + 0x0c70, 0x0c80, 0x0c90, 0x0ca0, 0x0cb0, 0x0cc0, 0x04b0, 0x04b0, + 0x0cd0, 0x0cd0, 0x0cd0, 0x0cd0, 0x0ce0, 0x0cd0, 0x0cf0, 0x0d00, + 0x0cd0, 0x0ce0, 0x0cd0, 0x0d10, 0x0d10, 0x0d20, 0x04b0, 0x04b0, + 0x0d30, 0x0d30, 0x0d30, 0x0d30, 0x0d30, 0x0d30, 0x0d30, 0x0d30, + 0x0d30, 0x0d30, 0x0d40, 0x0d40, 0x0d50, 0x0d40, 0x0d40, 0x0d60, + 0x0d70, 0x0d70, 0x0d70, 0x0d70, 0x0d70, 0x0d70, 0x0d70, 0x0d70, + 0x0d70, 0x0d70, 0x0d70, 0x0d70, 0x0d70, 0x0d70, 0x0d70, 0x0d70, + 0x0d80, 0x0d80, 0x0d80, 0x0d80, 0x0d90, 0x0da0, 0x0d80, 0x0d80, + 0x0d90, 0x0d80, 0x0d80, 0x0db0, 0x0dc0, 0x0dd0, 0x0d80, 0x0d80, + 0x0d80, 0x0dc0, 0x0d80, 0x0d80, 0x0d80, 0x0de0, 0x0d80, 0x0df0, + 0x0d80, 0x0e00, 0x0e10, 0x0e10, 0x0e10, 0x0e10, 0x0e10, 0x0e20, + 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, + 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, + 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, + 0x0e30, 0x0e40, 0x0e50, 0x0e50, 0x0e50, 0x0e50, 0x0e60, 0x0e70, + 0x0e80, 0x0e90, 0x0ea0, 0x0eb0, 0x0ec0, 0x0ed0, 0x0ee0, 0x0ef0, + 0x0f00, 0x0f00, 0x0f00, 0x0f00, 0x0f00, 0x0f10, 0x0f20, 0x0f20, + 0x0f30, 0x0f40, 0x0f50, 0x0f50, 0x0f50, 0x0f50, 0x0f50, 0x0f60, + 0x0f50, 0x0f50, 0x0f70, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, + 0x0f80, 0x0f90, 0x0fa0, 0x0fa0, 0x0fb0, 0x04b0, 0x04b0, 0x04b0, + 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x0f00, 0x0f00, + 0x0fc0, 0x0fd0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, + 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, + 0x0fe0, 0x0fe0, 0x0fe0, 0x0fe0, 0x0ff0, 0x0fe0, 0x0fe0, 0x1000, + 0x1010, 0x1010, 0x1010, 0x1010, 0x1020, 0x1020, 0x1020, 0x1030, + 0x1040, 0x1040, 0x1040, 0x1050, 0x1060, 0x04b0, 0x04b0, 0x04b0, + 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x1070, 0x04b0, 0x04b0, 0x04b0, + 0x04f0, 0x04f0, 0x1080, 0x04f0, 0x04f0, 0x1090, 0x10a0, 0x10b0, + 0x04f0, 0x04f0, 0x04f0, 0x10c0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, + 0x0550, 0x10d0, 0x0550, 0x0550, 0x10d0, 0x10e0, 0x0550, 0x10f0, + 0x0550, 0x0550, 0x0550, 0x1100, 0x1100, 0x1110, 0x0550, 0x1120, + 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x1130, + 0x04b0, 0x1140, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, + 0x04b0, 0x04b0, 0x1150, 0x1160, 0x1170, 0x04b0, 0x04f0, 0x04f0, + 0x0510, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, + 0x1180, 0x1180, 0x1180, 0x1180, 0x1180, 0x1180, 0x1180, 0x1180, + 0x1180, 0x1180, 0x1180, 0x1180, 0x1180, 0x1180, 0x1180, 0x1180, + 0x1190, 0x1190, 0x11a0, 0x1190, 0x1190, 0x11a0, 0x04f0, 0x04f0, + 0x11b0, 0x11b0, 0x11b0, 0x11b0, 0x11b0, 0x11b0, 0x11b0, 0x11c0, + 0x0d40, 0x0d40, 0x0d50, 0x11d0, 0x11d0, 0x11d0, 0x11e0, 0x11f0, + 0x0d80, 0x1200, 0x1210, 0x1210, 0x1210, 0x1210, 0x0580, 0x0580, + 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, + 0x1220, 0x1230, 0x1220, 0x1220, 0x1220, 0x1220, 0x1220, 0x1240, + 0x1220, 0x1220, 0x1220, 0x1220, 0x1220, 0x1220, 0x1220, 0x1220, + 0x1220, 0x1220, 0x1220, 0x1220, 0x1220, 0x1250, 0x04b0, 0x04b0, + 0x1260, 0x04b0, 0x1270, 0x1280, 0x1290, 0x12a0, 0x12a0, 0x12a0, + 0x12a0, 0x12b0, 0x12c0, 0x12d0, 0x12d0, 0x12d0, 0x12d0, 0x12e0, + 0x12f0, 0x1300, 0x1310, 0x1320, 0x0d70, 0x0d70, 0x0d70, 0x0d70, + 0x1330, 0x04b0, 0x1300, 0x1340, 0x04b0, 0x04b0, 0x04b0, 0x12d0, + 0x0d70, 0x1330, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x0d70, 0x1330, + 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x12d0, 0x12d0, 0x1350, + 0x12d0, 0x12d0, 0x12d0, 0x12d0, 0x12d0, 0x1360, 0x04b0, 0x04b0, + 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, + 0x1220, 0x1220, 0x1220, 0x1220, 0x1220, 0x1220, 0x1220, 0x1220, + 0x1220, 0x1220, 0x1220, 0x1220, 0x1220, 0x1220, 0x1220, 0x1220, + 0x1220, 0x1220, 0x1220, 0x1220, 0x1220, 0x1220, 0x1220, 0x1220, + 0x1220, 0x1220, 0x1220, 0x1250, 0x04b0, 0x04b0, 0x04b0, 0x04b0, + 0x1370, 0x1370, 0x1370, 0x1370, 0x1370, 0x1370, 0x1370, 0x1370, + 0x1370, 0x1370, 0x1370, 0x1370, 0x1370, 0x1370, 0x1370, 0x1370, + 0x1370, 0x1370, 0x1370, 0x1370, 0x1370, 0x1370, 0x1370, 0x1370, + 0x1380, 0x1370, 0x1370, 0x1370, 0x1390, 0x13a0, 0x13a0, 0x13a0, + 0x13b0, 0x13b0, 0x13b0, 0x13b0, 0x13b0, 0x13b0, 0x13b0, 0x13b0, + 0x13b0, 0x13b0, 0x13b0, 0x13b0, 0x13b0, 0x13b0, 0x13b0, 0x13b0, + 0x13b0, 0x13b0, 0x13c0, 0x04b0, 0x0580, 0x0580, 0x0580, 0x0580, + 0x0580, 0x0580, 0x13d0, 0x13d0, 0x13d0, 0x13d0, 0x13d0, 0x13e0, + 0x04b0, 0x04b0, 0x13f0, 0x04f0, 0x04f0, 0x04f0, 0x04f0, 0x04f0, + 0x1400, 0x04f0, 0x1410, 0x1420, 0x04b0, 0x04b0, 0x04b0, 0x1430, + 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, + 0x1440, 0x1440, 0x1440, 0x1440, 0x1450, 0x1460, 0x0780, 0x1470, + 0x04b0, 0x04b0, 0x04b0, 0x1480, 0x1480, 0x1490, 0x0d70, 0x14a0, + 0x14b0, 0x14b0, 0x14b0, 0x14b0, 0x14c0, 0x14d0, 0x0d30, 0x14e0, + 0x14f0, 0x14f0, 0x14f0, 0x1500, 0x1510, 0x1520, 0x0d30, 0x0d30, + 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x04b0, + 0x1530, 0x1540, 0x1210, 0x04f0, 0x04f0, 0x1550, 0x1560, 0x0e10, + 0x0e10, 0x0e10, 0x0e10, 0x0e10, 0x04b0, 0x04b0, 0x04b0, 0x04b0, + 0x0d70, 0x0d70, 0x0d70, 0x0d70, 0x0d70, 0x0d70, 0x0d70, 0x0d70, + 0x0d70, 0x0d70, 0x1570, 0x0d70, 0x1580, 0x0d70, 0x0d70, 0x1590, + 0x1220, 0x1220, 0x1220, 0x1220, 0x1220, 0x1220, 0x15a0, 0x1220, + 0x1220, 0x1220, 0x1220, 0x1220, 0x1220, 0x15b0, 0x04b0, 0x04b0, + 0x15c0, 0x15d0, 0x05f0, 0x15e0, 0x15f0, 0x0650, 0x0650, 0x0650, + 0x0650, 0x0650, 0x0650, 0x0650, 0x1600, 0x0770, 0x0650, 0x0650, + 0x0650, 0x0650, 0x0650, 0x0650, 0x0650, 0x0650, 0x0650, 0x0650, + 0x0650, 0x0650, 0x0650, 0x0650, 0x0650, 0x0650, 0x0650, 0x0650, + 0x0650, 0x0650, 0x0650, 0x1610, 0x04b0, 0x0650, 0x0650, 0x0650, + 0x0650, 0x1620, 0x0650, 0x0650, 0x1630, 0x04b0, 0x04b0, 0x1610, + 0x04b0, 0x04b0, 0x1640, 0x04b0, 0x04b0, 0x04b0, 0x04b0, 0x1650, + 0x0650, 0x0650, 0x0650, 0x0650, 0x0650, 0x0650, 0x0650, 0x1660, + 0x04b0, 0x04b0, 0x04c0, 0x04d0, 0x04c0, 0x04d0, 0x1670, 0x12c0, + 0x12d0, 0x1680, 0x0d70, 0x1330, 0x1690, 0x16a0, 0x04b0, 0x04b0, /* values */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, - 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, - 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, - 0x0038, 0x0038, 0x0038, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0038, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, - 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, - 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0000, - 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, - 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, - 0x0038, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x000a, 0x000a, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0023, 0x0023, 0x0023, 0x0023, 0x0000, 0x0023, 0x0023, 0x0023, - 0x0000, 0x0000, 0x0023, 0x0023, 0x0023, 0x0023, 0x0000, 0x0023, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0023, 0x0000, 0x0023, 0x0000, - 0x0023, 0x0023, 0x0023, 0x0000, 0x0023, 0x0000, 0x0023, 0x0023, - 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, - 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, - 0x0023, 0x0023, 0x0000, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, - 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, - 0x0023, 0x0023, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, - 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, - 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, - 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, - 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0000, 0x0000, 0x0018, - 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, - 0x0000, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, - 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, - 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, - 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, - 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0000, - 0x0000, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, - 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, - 0x0000, 0x0000, 0x0003, 0x0000, 0x0000, 0x0003, 0x0003, 0x0003, - 0x0000, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, - 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, - 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, - 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, - 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, - 0x0029, 0x0029, 0x0029, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0000, 0x0002, 0x0002, - 0x0002, 0x0002, 0x0002, 0x0002, 0x0000, 0x0002, 0x0002, 0x0002, - 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, - 0x0002, 0x0002, 0x0002, 0x0000, 0x0000, 0x0000, 0x0002, 0x0000, - 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, - 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, - 0x0000, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, - 0x0002, 0x0002, 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0002, - 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, - 0x0000, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, - 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, - 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, - 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0000, 0x0002, 0x0002, - 0x006b, 0x006b, 0x006b, 0x006b, 0x006b, 0x006b, 0x006b, 0x006b, - 0x006b, 0x006b, 0x006b, 0x006b, 0x006b, 0x006b, 0x0000, 0x006b, - 0x006b, 0x006b, 0x006b, 0x006b, 0x006b, 0x006b, 0x006b, 0x006b, - 0x006b, 0x006b, 0x006b, 0x006b, 0x006b, 0x006b, 0x006b, 0x006b, - 0x006b, 0x006b, 0x006b, 0x006b, 0x006b, 0x006b, 0x006b, 0x006b, - 0x006b, 0x006b, 0x006b, 0x0000, 0x0000, 0x006b, 0x006b, 0x006b, - 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, - 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, - 0x0074, 0x0074, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x004f, 0x004f, 0x004f, 0x004f, 0x004f, 0x004f, 0x004f, 0x004f, - 0x004f, 0x004f, 0x004f, 0x004f, 0x004f, 0x004f, 0x004f, 0x004f, - 0x004f, 0x004f, 0x004f, 0x004f, 0x004f, 0x004f, 0x004f, 0x004f, - 0x004f, 0x004f, 0x004f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0062, 0x0062, 0x0062, 0x0062, 0x0062, 0x0062, 0x0062, 0x0062, - 0x0062, 0x0062, 0x0062, 0x0062, 0x0062, 0x0062, 0x0062, 0x0062, - 0x0062, 0x0062, 0x0062, 0x0062, 0x0062, 0x0062, 0x0062, 0x0062, - 0x0062, 0x0062, 0x0062, 0x0062, 0x0062, 0x0062, 0x0000, 0x0000, - 0x0062, 0x0062, 0x0062, 0x0062, 0x0062, 0x0062, 0x0062, 0x0062, - 0x0062, 0x0062, 0x0062, 0x0062, 0x0062, 0x0062, 0x0062, 0x0000, - 0x0042, 0x0042, 0x0042, 0x0042, 0x0042, 0x0042, 0x0042, 0x0042, - 0x0042, 0x0042, 0x0042, 0x0042, 0x0042, 0x0042, 0x0042, 0x0042, - 0x0042, 0x0042, 0x0042, 0x0042, 0x0042, 0x0042, 0x0042, 0x0042, - 0x0042, 0x0042, 0x0042, 0x0042, 0x0000, 0x0000, 0x0042, 0x0000, - 0x0002, 0x0002, 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0002, 0x0002, 0x0002, - 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, - 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, - 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, - 0x001a, 0x0000, 0x0000, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, - 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, - 0x001a, 0x001a, 0x001a, 0x001a, 0x0000, 0x0000, 0x001a, 0x001a, - 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, - 0x0009, 0x0009, 0x0009, 0x0009, 0x0000, 0x0009, 0x0009, 0x0009, - 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0000, 0x0000, 0x0009, - 0x0009, 0x0000, 0x0000, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, - 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, - 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, - 0x0009, 0x0000, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, - 0x0009, 0x0000, 0x0009, 0x0000, 0x0000, 0x0000, 0x0009, 0x0009, - 0x0009, 0x0009, 0x0000, 0x0000, 0x0009, 0x0009, 0x0009, 0x0009, - 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0000, 0x0000, 0x0009, - 0x0009, 0x0000, 0x0000, 0x0009, 0x0009, 0x0009, 0x0009, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0009, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0009, 0x0009, 0x0000, 0x0009, - 0x0009, 0x0009, 0x0009, 0x0009, 0x0000, 0x0000, 0x0009, 0x0009, - 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, - 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, 0x0009, - 0x0009, 0x0009, 0x0009, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0025, 0x0025, 0x0025, 0x0000, 0x0025, 0x0025, 0x0025, - 0x0025, 0x0025, 0x0025, 0x0000, 0x0000, 0x0000, 0x0000, 0x0025, - 0x0025, 0x0000, 0x0000, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, + 0x0000, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, + 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, + 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, + 0x003b, 0x003b, 0x003b, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x003b, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, + 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, + 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x0000, + 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, + 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, + 0x003b, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x000c, 0x000c, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0025, 0x0025, 0x0025, 0x0025, 0x0000, 0x0025, 0x0025, 0x0025, + 0x0000, 0x0000, 0x0025, 0x0025, 0x0025, 0x0025, 0x0000, 0x0025, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0025, 0x0000, 0x0025, 0x0000, + 0x0025, 0x0025, 0x0025, 0x0000, 0x0025, 0x0000, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, - 0x0025, 0x0000, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, - 0x0025, 0x0000, 0x0025, 0x0025, 0x0000, 0x0025, 0x0025, 0x0000, - 0x0025, 0x0025, 0x0000, 0x0000, 0x0025, 0x0000, 0x0025, 0x0025, - 0x0025, 0x0025, 0x0025, 0x0000, 0x0000, 0x0000, 0x0000, 0x0025, - 0x0025, 0x0000, 0x0000, 0x0025, 0x0025, 0x0025, 0x0000, 0x0000, - 0x0000, 0x0025, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0025, 0x0025, 0x0025, 0x0025, 0x0000, 0x0025, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0025, 0x0025, + 0x0025, 0x0025, 0x0000, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, - 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0024, 0x0024, 0x0024, 0x0000, 0x0024, 0x0024, 0x0024, - 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x0000, 0x0024, - 0x0024, 0x0024, 0x0000, 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, - 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, - 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, - 0x0024, 0x0000, 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, - 0x0024, 0x0000, 0x0024, 0x0024, 0x0000, 0x0024, 0x0024, 0x0024, - 0x0024, 0x0024, 0x0000, 0x0000, 0x0024, 0x0024, 0x0024, 0x0024, - 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x0000, 0x0024, - 0x0024, 0x0024, 0x0000, 0x0024, 0x0024, 0x0024, 0x0000, 0x0000, - 0x0024, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0024, 0x0024, 0x0024, 0x0024, 0x0000, 0x0000, 0x0024, 0x0024, - 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, - 0x0024, 0x0024, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0058, 0x0058, 0x0058, 0x0000, 0x0058, 0x0058, 0x0058, - 0x0058, 0x0058, 0x0058, 0x0058, 0x0058, 0x0000, 0x0000, 0x0058, - 0x0058, 0x0000, 0x0000, 0x0058, 0x0058, 0x0058, 0x0058, 0x0058, - 0x0058, 0x0058, 0x0058, 0x0058, 0x0058, 0x0058, 0x0058, 0x0058, - 0x0058, 0x0058, 0x0058, 0x0058, 0x0058, 0x0058, 0x0058, 0x0058, - 0x0058, 0x0000, 0x0058, 0x0058, 0x0058, 0x0058, 0x0058, 0x0058, - 0x0058, 0x0000, 0x0058, 0x0058, 0x0000, 0x0058, 0x0058, 0x0058, - 0x0058, 0x0058, 0x0000, 0x0000, 0x0058, 0x0058, 0x0058, 0x0058, - 0x0058, 0x0058, 0x0058, 0x0058, 0x0058, 0x0000, 0x0000, 0x0058, - 0x0058, 0x0000, 0x0000, 0x0058, 0x0058, 0x0058, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0058, 0x0058, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0058, 0x0058, 0x0000, 0x0058, - 0x0058, 0x0058, 0x0058, 0x0058, 0x0000, 0x0000, 0x0058, 0x0058, - 0x0058, 0x0058, 0x0058, 0x0058, 0x0058, 0x0058, 0x0058, 0x0058, - 0x0058, 0x0058, 0x0058, 0x0058, 0x0058, 0x0058, 0x0058, 0x0058, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0072, 0x0072, 0x0000, 0x0072, 0x0072, 0x0072, - 0x0072, 0x0072, 0x0072, 0x0000, 0x0000, 0x0000, 0x0072, 0x0072, - 0x0072, 0x0000, 0x0072, 0x0072, 0x0072, 0x0072, 0x0000, 0x0000, - 0x0000, 0x0072, 0x0072, 0x0000, 0x0072, 0x0000, 0x0072, 0x0072, - 0x0000, 0x0000, 0x0000, 0x0072, 0x0072, 0x0000, 0x0000, 0x0000, - 0x0072, 0x0072, 0x0072, 0x0000, 0x0000, 0x0000, 0x0072, 0x0072, - 0x0072, 0x0072, 0x0072, 0x0072, 0x0072, 0x0072, 0x0072, 0x0072, - 0x0072, 0x0072, 0x0000, 0x0000, 0x0000, 0x0000, 0x0072, 0x0072, - 0x0072, 0x0072, 0x0072, 0x0000, 0x0000, 0x0000, 0x0072, 0x0072, - 0x0072, 0x0000, 0x0072, 0x0072, 0x0072, 0x0072, 0x0000, 0x0000, - 0x0072, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0072, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0072, 0x0072, - 0x0072, 0x0072, 0x0072, 0x0072, 0x0072, 0x0072, 0x0072, 0x0072, - 0x0072, 0x0072, 0x0072, 0x0072, 0x0072, 0x0072, 0x0072, 0x0072, - 0x0072, 0x0072, 0x0072, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0073, 0x0073, 0x0073, 0x0073, 0x0000, 0x0073, 0x0073, 0x0073, - 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, 0x0000, 0x0073, 0x0073, - 0x0073, 0x0000, 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, - 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, - 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, - 0x0073, 0x0000, 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, - 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, - 0x0073, 0x0073, 0x0000, 0x0000, 0x0000, 0x0073, 0x0073, 0x0073, - 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, 0x0000, 0x0073, 0x0073, - 0x0073, 0x0000, 0x0073, 0x0073, 0x0073, 0x0073, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0073, 0x0073, 0x0000, - 0x0073, 0x0073, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0073, 0x0073, 0x0073, 0x0073, 0x0000, 0x0000, 0x0073, 0x0073, - 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, + 0x0025, 0x0025, 0x0017, 0x0017, 0x0017, 0x0017, 0x0017, 0x0017, + 0x0017, 0x0017, 0x0017, 0x0017, 0x0017, 0x0017, 0x0017, 0x0017, + 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, + 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, + 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x0000, 0x0000, 0x001a, + 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, + 0x0000, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0000, + 0x0000, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0000, 0x0000, 0x0005, 0x0000, 0x0000, 0x0005, 0x0005, 0x0005, + 0x0000, 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, + 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, + 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, + 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, + 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, + 0x002c, 0x002c, 0x002c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0000, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0000, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0000, 0x0000, 0x0000, 0x0004, 0x0000, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0000, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0000, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0000, 0x0004, 0x0004, + 0x0071, 0x0071, 0x0071, 0x0071, 0x0071, 0x0071, 0x0071, 0x0071, + 0x0071, 0x0071, 0x0071, 0x0071, 0x0071, 0x0071, 0x0000, 0x0071, + 0x0071, 0x0071, 0x0071, 0x0071, 0x0071, 0x0071, 0x0071, 0x0071, + 0x0071, 0x0071, 0x0071, 0x0071, 0x0071, 0x0071, 0x0071, 0x0071, + 0x0071, 0x0071, 0x0071, 0x0071, 0x0071, 0x0071, 0x0071, 0x0071, + 0x0071, 0x0071, 0x0071, 0x0000, 0x0000, 0x0071, 0x0071, 0x0071, + 0x007a, 0x007a, 0x007a, 0x007a, 0x007a, 0x007a, 0x007a, 0x007a, + 0x007a, 0x007a, 0x007a, 0x007a, 0x007a, 0x007a, 0x007a, 0x007a, + 0x007a, 0x007a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, - 0x0000, 0x0030, 0x0030, 0x0030, 0x0000, 0x0030, 0x0030, 0x0030, - 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0000, 0x0030, 0x0030, - 0x0030, 0x0000, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, - 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, - 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, - 0x0030, 0x0000, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, - 0x0030, 0x0030, 0x0030, 0x0030, 0x0000, 0x0030, 0x0030, 0x0030, - 0x0030, 0x0030, 0x0000, 0x0000, 0x0030, 0x0030, 0x0030, 0x0030, - 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0000, 0x0030, 0x0030, - 0x0030, 0x0000, 0x0030, 0x0030, 0x0030, 0x0030, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0030, 0x0030, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0030, 0x0000, - 0x0030, 0x0030, 0x0030, 0x0030, 0x0000, 0x0000, 0x0030, 0x0030, - 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, 0x0030, - 0x0000, 0x0030, 0x0030, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0041, 0x0041, 0x0041, 0x0000, 0x0041, 0x0041, 0x0041, - 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0000, 0x0041, 0x0041, - 0x0041, 0x0000, 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, - 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, - 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, - 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, - 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, - 0x0041, 0x0041, 0x0041, 0x0000, 0x0000, 0x0041, 0x0041, 0x0041, - 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0000, 0x0041, 0x0041, - 0x0041, 0x0000, 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0041, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0041, 0x0041, 0x0041, 0x0041, 0x0000, 0x0000, 0x0041, 0x0041, - 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, - 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0000, 0x0000, - 0x0000, 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, 0x0041, - 0x0000, 0x0000, 0x0067, 0x0067, 0x0000, 0x0067, 0x0067, 0x0067, - 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, - 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0000, - 0x0000, 0x0000, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, + 0x0053, 0x0053, 0x0053, 0x0053, 0x0053, 0x0053, 0x0053, 0x0053, + 0x0053, 0x0053, 0x0053, 0x0053, 0x0053, 0x0053, 0x0053, 0x0053, + 0x0053, 0x0053, 0x0053, 0x0053, 0x0053, 0x0053, 0x0053, 0x0053, + 0x0053, 0x0053, 0x0053, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, - 0x0067, 0x0067, 0x0000, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, - 0x0067, 0x0067, 0x0067, 0x0067, 0x0000, 0x0067, 0x0000, 0x0000, - 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0000, - 0x0000, 0x0000, 0x0067, 0x0000, 0x0000, 0x0000, 0x0000, 0x0067, - 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0000, 0x0067, 0x0000, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0067, 0x0067, + 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0000, 0x0000, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, - 0x0000, 0x0000, 0x0067, 0x0067, 0x0067, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, - 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, - 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, - 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, - 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, - 0x0075, 0x0075, 0x0075, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, - 0x0075, 0x0075, 0x0075, 0x0075, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0037, 0x0037, 0x0000, 0x0037, 0x0000, 0x0000, 0x0037, - 0x0037, 0x0000, 0x0037, 0x0000, 0x0000, 0x0037, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0037, 0x0037, 0x0037, 0x0037, - 0x0000, 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, - 0x0000, 0x0037, 0x0037, 0x0037, 0x0000, 0x0037, 0x0000, 0x0037, - 0x0000, 0x0000, 0x0037, 0x0037, 0x0000, 0x0037, 0x0037, 0x0037, - 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, - 0x0037, 0x0037, 0x0000, 0x0037, 0x0037, 0x0037, 0x0000, 0x0000, - 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, 0x0000, 0x0037, 0x0000, - 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, 0x0000, 0x0000, - 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, - 0x0037, 0x0037, 0x0000, 0x0000, 0x0037, 0x0037, 0x0037, 0x0037, - 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, - 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, - 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, - 0x0000, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, - 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, - 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, - 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, - 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, - 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0000, 0x0076, 0x0076, - 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0076, 0x0076, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x004c, 0x004c, 0x004c, 0x004c, 0x004c, 0x004c, 0x004c, 0x004c, - 0x004c, 0x004c, 0x004c, 0x004c, 0x004c, 0x004c, 0x004c, 0x004c, - 0x001f, 0x001f, 0x001f, 0x001f, 0x001f, 0x001f, 0x001f, 0x001f, - 0x001f, 0x001f, 0x001f, 0x001f, 0x001f, 0x001f, 0x001f, 0x001f, - 0x001f, 0x001f, 0x001f, 0x001f, 0x001f, 0x001f, 0x0000, 0x001f, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x001f, 0x0000, 0x0000, - 0x001f, 0x001f, 0x001f, 0x001f, 0x001f, 0x001f, 0x001f, 0x001f, - 0x001f, 0x001f, 0x001f, 0x0000, 0x001f, 0x001f, 0x001f, 0x001f, + 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0000, + 0x0045, 0x0045, 0x0045, 0x0045, 0x0045, 0x0045, 0x0045, 0x0045, + 0x0045, 0x0045, 0x0045, 0x0045, 0x0045, 0x0045, 0x0045, 0x0045, + 0x0045, 0x0045, 0x0045, 0x0045, 0x0045, 0x0045, 0x0045, 0x0045, + 0x0045, 0x0045, 0x0045, 0x0045, 0x0000, 0x0000, 0x0045, 0x0000, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, + 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, + 0x001c, 0x0000, 0x0000, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, + 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, + 0x001c, 0x001c, 0x001c, 0x001c, 0x0000, 0x0000, 0x001c, 0x001c, + 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, + 0x000b, 0x000b, 0x000b, 0x000b, 0x0000, 0x000b, 0x000b, 0x000b, + 0x000b, 0x000b, 0x000b, 0x000b, 0x000b, 0x0000, 0x0000, 0x000b, + 0x000b, 0x0000, 0x0000, 0x000b, 0x000b, 0x000b, 0x000b, 0x000b, + 0x000b, 0x000b, 0x000b, 0x000b, 0x000b, 0x000b, 0x000b, 0x000b, + 0x000b, 0x000b, 0x000b, 0x000b, 0x000b, 0x000b, 0x000b, 0x000b, + 0x000b, 0x0000, 0x000b, 0x000b, 0x000b, 0x000b, 0x000b, 0x000b, + 0x000b, 0x0000, 0x000b, 0x0000, 0x0000, 0x0000, 0x000b, 0x000b, + 0x000b, 0x000b, 0x0000, 0x0000, 0x000b, 0x000b, 0x000b, 0x000b, + 0x000b, 0x000b, 0x000b, 0x000b, 0x000b, 0x0000, 0x0000, 0x000b, + 0x000b, 0x0000, 0x0000, 0x000b, 0x000b, 0x000b, 0x000b, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000b, + 0x0000, 0x0000, 0x0000, 0x0000, 0x000b, 0x000b, 0x0000, 0x000b, + 0x000b, 0x000b, 0x000b, 0x000b, 0x0000, 0x0000, 0x000b, 0x000b, + 0x000b, 0x000b, 0x000b, 0x000b, 0x000b, 0x000b, 0x000b, 0x000b, + 0x000b, 0x000b, 0x000b, 0x000b, 0x000b, 0x000b, 0x000b, 0x000b, + 0x000b, 0x000b, 0x000b, 0x000b, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0027, 0x0027, 0x0027, 0x0000, 0x0027, 0x0027, 0x0027, + 0x0027, 0x0027, 0x0027, 0x0000, 0x0000, 0x0000, 0x0000, 0x0027, + 0x0027, 0x0000, 0x0000, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, - 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, - 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, - 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, - 0x001e, 0x0000, 0x001e, 0x001e, 0x001e, 0x001e, 0x0000, 0x0000, - 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x0000, - 0x001e, 0x0000, 0x001e, 0x001e, 0x001e, 0x001e, 0x0000, 0x0000, - 0x001e, 0x0000, 0x001e, 0x001e, 0x001e, 0x001e, 0x0000, 0x0000, - 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x0000, - 0x001e, 0x0000, 0x001e, 0x001e, 0x001e, 0x001e, 0x0000, 0x0000, - 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, - 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x0000, - 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, - 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, - 0x001e, 0x001e, 0x001e, 0x0000, 0x0000, 0x001e, 0x001e, 0x001e, - 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, - 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x0000, 0x0000, 0x0000, - 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, - 0x001e, 0x001e, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0014, 0x0014, 0x0014, 0x0014, 0x0014, 0x0014, 0x0014, 0x0014, - 0x0014, 0x0014, 0x0014, 0x0014, 0x0014, 0x0014, 0x0014, 0x0014, - 0x0014, 0x0014, 0x0014, 0x0014, 0x0014, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, - 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, - 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, - 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0000, 0x0000, 0x0000, - 0x0061, 0x0061, 0x0061, 0x0061, 0x0061, 0x0061, 0x0061, 0x0061, - 0x0061, 0x0061, 0x0061, 0x0061, 0x0061, 0x0061, 0x0061, 0x0061, - 0x0061, 0x0061, 0x0061, 0x0061, 0x0061, 0x0061, 0x0061, 0x0061, - 0x0061, 0x0061, 0x0061, 0x0000, 0x0000, 0x0000, 0x0061, 0x0061, - 0x0061, 0x0061, 0x0061, 0x0061, 0x0061, 0x0061, 0x0061, 0x0061, - 0x0061, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x006c, 0x006c, 0x006c, 0x006c, 0x006c, 0x006c, 0x006c, 0x006c, - 0x006c, 0x006c, 0x006c, 0x006c, 0x006c, 0x0000, 0x006c, 0x006c, - 0x006c, 0x006c, 0x006c, 0x006c, 0x006c, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, - 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, - 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0000, 0x0000, 0x0000, + 0x0027, 0x0000, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, + 0x0027, 0x0000, 0x0027, 0x0027, 0x0000, 0x0027, 0x0027, 0x0000, + 0x0027, 0x0027, 0x0000, 0x0000, 0x0027, 0x0000, 0x0027, 0x0027, + 0x0027, 0x0027, 0x0027, 0x0000, 0x0000, 0x0000, 0x0000, 0x0027, + 0x0027, 0x0000, 0x0000, 0x0027, 0x0027, 0x0027, 0x0000, 0x0000, + 0x0000, 0x0027, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0027, 0x0027, 0x0027, 0x0027, 0x0000, 0x0027, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0027, 0x0027, + 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, + 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x000e, 0x000e, 0x000e, 0x000e, 0x000e, 0x000e, 0x000e, 0x000e, - 0x000e, 0x000e, 0x000e, 0x000e, 0x000e, 0x000e, 0x000e, 0x000e, - 0x000e, 0x000e, 0x000e, 0x000e, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0026, 0x0026, 0x0026, 0x0000, 0x0026, 0x0026, 0x0026, + 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0000, 0x0026, + 0x0026, 0x0026, 0x0000, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, + 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, + 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, + 0x0026, 0x0000, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, + 0x0026, 0x0000, 0x0026, 0x0026, 0x0000, 0x0026, 0x0026, 0x0026, + 0x0026, 0x0026, 0x0000, 0x0000, 0x0026, 0x0026, 0x0026, 0x0026, + 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0000, 0x0026, + 0x0026, 0x0026, 0x0000, 0x0026, 0x0026, 0x0026, 0x0000, 0x0000, + 0x0026, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0026, 0x0026, 0x0026, 0x0026, 0x0000, 0x0000, 0x0026, 0x0026, + 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, + 0x0026, 0x0026, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0026, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x005d, 0x005d, 0x005d, 0x0000, 0x005d, 0x005d, 0x005d, + 0x005d, 0x005d, 0x005d, 0x005d, 0x005d, 0x0000, 0x0000, 0x005d, + 0x005d, 0x0000, 0x0000, 0x005d, 0x005d, 0x005d, 0x005d, 0x005d, + 0x005d, 0x005d, 0x005d, 0x005d, 0x005d, 0x005d, 0x005d, 0x005d, + 0x005d, 0x005d, 0x005d, 0x005d, 0x005d, 0x005d, 0x005d, 0x005d, + 0x005d, 0x0000, 0x005d, 0x005d, 0x005d, 0x005d, 0x005d, 0x005d, + 0x005d, 0x0000, 0x005d, 0x005d, 0x0000, 0x005d, 0x005d, 0x005d, + 0x005d, 0x005d, 0x0000, 0x0000, 0x005d, 0x005d, 0x005d, 0x005d, + 0x005d, 0x005d, 0x005d, 0x005d, 0x005d, 0x0000, 0x0000, 0x005d, + 0x005d, 0x0000, 0x0000, 0x005d, 0x005d, 0x005d, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x005d, 0x005d, + 0x0000, 0x0000, 0x0000, 0x0000, 0x005d, 0x005d, 0x0000, 0x005d, + 0x005d, 0x005d, 0x005d, 0x005d, 0x0000, 0x0000, 0x005d, 0x005d, + 0x005d, 0x005d, 0x005d, 0x005d, 0x005d, 0x005d, 0x005d, 0x005d, + 0x005d, 0x005d, 0x005d, 0x005d, 0x005d, 0x005d, 0x005d, 0x005d, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0078, 0x0078, 0x0000, 0x0078, 0x0078, 0x0078, + 0x0078, 0x0078, 0x0078, 0x0000, 0x0000, 0x0000, 0x0078, 0x0078, + 0x0078, 0x0000, 0x0078, 0x0078, 0x0078, 0x0078, 0x0000, 0x0000, + 0x0000, 0x0078, 0x0078, 0x0000, 0x0078, 0x0000, 0x0078, 0x0078, + 0x0000, 0x0000, 0x0000, 0x0078, 0x0078, 0x0000, 0x0000, 0x0000, + 0x0078, 0x0078, 0x0078, 0x0000, 0x0000, 0x0000, 0x0078, 0x0078, + 0x0078, 0x0078, 0x0078, 0x0078, 0x0078, 0x0078, 0x0078, 0x0078, + 0x0078, 0x0078, 0x0000, 0x0000, 0x0000, 0x0000, 0x0078, 0x0078, + 0x0078, 0x0078, 0x0078, 0x0000, 0x0000, 0x0000, 0x0078, 0x0078, + 0x0078, 0x0000, 0x0078, 0x0078, 0x0078, 0x0078, 0x0000, 0x0000, + 0x0078, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0078, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0078, 0x0078, + 0x0078, 0x0078, 0x0078, 0x0078, 0x0078, 0x0078, 0x0078, 0x0078, + 0x0078, 0x0078, 0x0078, 0x0078, 0x0078, 0x0078, 0x0078, 0x0078, + 0x0078, 0x0078, 0x0078, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0079, 0x0079, 0x0079, 0x0079, 0x0000, 0x0079, 0x0079, 0x0079, + 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, 0x0000, 0x0079, 0x0079, + 0x0079, 0x0000, 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, + 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, + 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, + 0x0079, 0x0000, 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, + 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, + 0x0079, 0x0079, 0x0000, 0x0000, 0x0000, 0x0079, 0x0079, 0x0079, + 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, 0x0000, 0x0079, 0x0079, + 0x0079, 0x0000, 0x0079, 0x0079, 0x0079, 0x0079, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0079, 0x0079, 0x0000, + 0x0079, 0x0079, 0x0079, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0079, 0x0079, 0x0079, 0x0079, 0x0000, 0x0000, 0x0079, 0x0079, + 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, + 0x0000, 0x0033, 0x0033, 0x0033, 0x0000, 0x0033, 0x0033, 0x0033, + 0x0033, 0x0033, 0x0033, 0x0033, 0x0033, 0x0000, 0x0033, 0x0033, + 0x0033, 0x0000, 0x0033, 0x0033, 0x0033, 0x0033, 0x0033, 0x0033, + 0x0033, 0x0033, 0x0033, 0x0033, 0x0033, 0x0033, 0x0033, 0x0033, + 0x0033, 0x0033, 0x0033, 0x0033, 0x0033, 0x0033, 0x0033, 0x0033, + 0x0033, 0x0000, 0x0033, 0x0033, 0x0033, 0x0033, 0x0033, 0x0033, + 0x0033, 0x0033, 0x0033, 0x0033, 0x0000, 0x0033, 0x0033, 0x0033, + 0x0033, 0x0033, 0x0000, 0x0000, 0x0033, 0x0033, 0x0033, 0x0033, + 0x0033, 0x0033, 0x0033, 0x0033, 0x0033, 0x0000, 0x0033, 0x0033, + 0x0033, 0x0000, 0x0033, 0x0033, 0x0033, 0x0033, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0033, 0x0033, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0033, 0x0000, + 0x0033, 0x0033, 0x0033, 0x0033, 0x0000, 0x0000, 0x0033, 0x0033, + 0x0033, 0x0033, 0x0033, 0x0033, 0x0033, 0x0033, 0x0033, 0x0033, + 0x0000, 0x0033, 0x0033, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0044, 0x0044, 0x0044, 0x0000, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0000, 0x0044, 0x0044, + 0x0044, 0x0000, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0000, 0x0000, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0000, 0x0044, 0x0044, + 0x0044, 0x0000, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0044, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0000, 0x0000, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0000, 0x0000, + 0x0000, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, 0x0044, + 0x0000, 0x0000, 0x006d, 0x006d, 0x0000, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, - 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x0000, 0x006d, 0x006d, - 0x006d, 0x0000, 0x006d, 0x006d, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, - 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, - 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, - 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0000, 0x0000, - 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, - 0x0034, 0x0034, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x004a, 0x004a, 0x0000, 0x0000, 0x004a, 0x0000, 0x004a, 0x004a, - 0x004a, 0x004a, 0x004a, 0x004a, 0x004a, 0x004a, 0x004a, 0x0000, - 0x004a, 0x004a, 0x004a, 0x004a, 0x004a, 0x004a, 0x004a, 0x004a, - 0x004a, 0x004a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x004a, 0x004a, 0x004a, 0x004a, 0x004a, 0x004a, 0x004a, 0x004a, - 0x004a, 0x004a, 0x004a, 0x004a, 0x004a, 0x004a, 0x004a, 0x004a, - 0x004a, 0x004a, 0x004a, 0x004a, 0x004a, 0x004a, 0x004a, 0x004a, + 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x0000, + 0x0000, 0x0000, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, + 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, + 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, + 0x006d, 0x006d, 0x0000, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, + 0x006d, 0x006d, 0x006d, 0x006d, 0x0000, 0x006d, 0x0000, 0x0000, + 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x0000, + 0x0000, 0x0000, 0x006d, 0x0000, 0x0000, 0x0000, 0x0000, 0x006d, + 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x0000, 0x006d, 0x0000, + 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x006d, 0x006d, + 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, 0x006d, + 0x0000, 0x0000, 0x006d, 0x006d, 0x006d, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x004a, 0x004a, 0x004a, 0x004a, 0x004a, 0x004a, 0x004a, 0x004a, - 0x004a, 0x004a, 0x004a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, - 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, + 0x0000, 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, + 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, + 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, + 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, + 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, + 0x007b, 0x007b, 0x007b, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, + 0x007b, 0x007b, 0x007b, 0x007b, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x003a, 0x003a, 0x0000, 0x003a, 0x0000, 0x0000, 0x003a, + 0x003a, 0x0000, 0x003a, 0x0000, 0x0000, 0x003a, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x003a, 0x003a, 0x003a, 0x003a, + 0x0000, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, + 0x0000, 0x003a, 0x003a, 0x003a, 0x0000, 0x003a, 0x0000, 0x003a, + 0x0000, 0x0000, 0x003a, 0x003a, 0x0000, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, - 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x0000, + 0x003a, 0x003a, 0x0000, 0x003a, 0x003a, 0x003a, 0x0000, 0x0000, + 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x0000, 0x003a, 0x0000, + 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x0000, 0x0000, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, - 0x003a, 0x003a, 0x003a, 0x003a, 0x0000, 0x0000, 0x0000, 0x0000, - 0x003a, 0x0000, 0x0000, 0x0000, 0x003a, 0x003a, 0x003a, 0x003a, - 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, 0x003a, - 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, - 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, - 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, - 0x000d, 0x000d, 0x000d, 0x000d, 0x0000, 0x0000, 0x000d, 0x000d, - 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, - 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, - 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, - 0x0005, 0x0005, 0x0005, 0x0005, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, - 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, 0x0000, 0x0000, 0x0000, - 0x0069, 0x0069, 0x0069, 0x0069, 0x0069, 0x0069, 0x0069, 0x0069, - 0x0069, 0x0069, 0x0069, 0x0069, 0x0069, 0x0069, 0x0069, 0x0069, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0008, 0x0008, 0x0008, - 0x0039, 0x0039, 0x0039, 0x0039, 0x0039, 0x0039, 0x0039, 0x0039, - 0x0039, 0x0039, 0x0039, 0x0039, 0x0039, 0x0039, 0x0039, 0x0039, - 0x0039, 0x0039, 0x0039, 0x0039, 0x0039, 0x0039, 0x0039, 0x0039, - 0x0000, 0x0000, 0x0000, 0x0039, 0x0039, 0x0039, 0x0039, 0x0039, - 0x0039, 0x0039, 0x0039, 0x0039, 0x0039, 0x0039, 0x0039, 0x0039, - 0x0039, 0x0039, 0x0000, 0x0000, 0x0000, 0x0039, 0x0039, 0x0039, - 0x0069, 0x0069, 0x0069, 0x0069, 0x0069, 0x0069, 0x0069, 0x0069, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0023, 0x0023, - 0x0023, 0x0023, 0x0023, 0x0018, 0x0038, 0x0038, 0x0038, 0x0038, - 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, - 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0023, 0x0023, 0x0023, - 0x0023, 0x0023, 0x0038, 0x0038, 0x0038, 0x0038, 0x0023, 0x0023, - 0x0023, 0x0023, 0x0023, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, - 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, - 0x0018, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, - 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, - 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0023, - 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0000, 0x0000, - 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0000, 0x0000, - 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, - 0x0000, 0x0023, 0x0000, 0x0023, 0x0000, 0x0023, 0x0000, 0x0023, - 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, - 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0000, 0x0000, - 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0000, 0x0023, 0x0023, - 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, - 0x0023, 0x0023, 0x0023, 0x0023, 0x0000, 0x0000, 0x0023, 0x0023, - 0x0023, 0x0023, 0x0023, 0x0023, 0x0000, 0x0023, 0x0023, 0x0023, - 0x0000, 0x0000, 0x0023, 0x0023, 0x0023, 0x0000, 0x0023, 0x0023, - 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0023, 0x0000, - 0x0000, 0x0038, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0038, - 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, - 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0023, 0x0000, - 0x0000, 0x0000, 0x0038, 0x0038, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0038, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0038, 0x0000, - 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, - 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, + 0x003a, 0x003a, 0x0000, 0x0000, 0x003a, 0x003a, 0x003a, 0x003a, + 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, + 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, + 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, + 0x0000, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, + 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, + 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x0000, 0x0000, 0x0000, + 0x0000, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, + 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, + 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, + 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x0000, 0x007c, 0x007c, + 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x0000, 0x0000, 0x0000, + 0x0000, 0x007c, 0x007c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, + 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, + 0x0021, 0x0021, 0x0021, 0x0021, 0x0021, 0x0021, 0x0021, 0x0021, + 0x0021, 0x0021, 0x0021, 0x0021, 0x0021, 0x0021, 0x0021, 0x0021, + 0x0021, 0x0021, 0x0021, 0x0021, 0x0021, 0x0021, 0x0000, 0x0021, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0021, 0x0000, 0x0000, + 0x0021, 0x0021, 0x0021, 0x0021, 0x0021, 0x0021, 0x0021, 0x0021, + 0x0021, 0x0021, 0x0021, 0x0000, 0x0021, 0x0021, 0x0021, 0x0021, + 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, + 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + 0x0020, 0x0000, 0x0020, 0x0020, 0x0020, 0x0020, 0x0000, 0x0000, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0000, - 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, - 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, - 0x0015, 0x0015, 0x0015, 0x0015, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, - 0x0077, 0x0077, 0x0077, 0x0077, 0x0077, 0x0077, 0x0077, 0x0077, - 0x0077, 0x0077, 0x0077, 0x0077, 0x0077, 0x0077, 0x0077, 0x0077, - 0x0077, 0x0077, 0x0077, 0x0077, 0x0077, 0x0077, 0x0077, 0x0077, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0077, - 0x0077, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0077, - 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x0000, + 0x0020, 0x0000, 0x0020, 0x0020, 0x0020, 0x0020, 0x0000, 0x0000, + 0x0020, 0x0000, 0x0020, 0x0020, 0x0020, 0x0020, 0x0000, 0x0000, + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0000, + 0x0020, 0x0000, 0x0020, 0x0020, 0x0020, 0x0020, 0x0000, 0x0000, + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0000, + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + 0x0020, 0x0020, 0x0020, 0x0000, 0x0000, 0x0020, 0x0020, 0x0020, + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0000, 0x0000, 0x0000, + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, + 0x0020, 0x0020, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0016, 0x0016, 0x0016, 0x0016, 0x0016, 0x0016, 0x0016, 0x0016, + 0x0016, 0x0016, 0x0016, 0x0016, 0x0016, 0x0016, 0x0016, 0x0016, + 0x0016, 0x0016, 0x0016, 0x0016, 0x0016, 0x0016, 0x0000, 0x0000, + 0x0016, 0x0016, 0x0016, 0x0016, 0x0016, 0x0016, 0x0000, 0x0000, + 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, + 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, + 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, + 0x0054, 0x0054, 0x0054, 0x0054, 0x0054, 0x0000, 0x0000, 0x0000, + 0x0066, 0x0066, 0x0066, 0x0066, 0x0066, 0x0066, 0x0066, 0x0066, + 0x0066, 0x0066, 0x0066, 0x0066, 0x0066, 0x0066, 0x0066, 0x0066, + 0x0066, 0x0066, 0x0066, 0x0066, 0x0066, 0x0066, 0x0066, 0x0066, + 0x0066, 0x0066, 0x0066, 0x0000, 0x0000, 0x0000, 0x0066, 0x0066, + 0x0066, 0x0066, 0x0066, 0x0066, 0x0066, 0x0066, 0x0066, 0x0066, + 0x0066, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0072, 0x0072, 0x0072, 0x0072, 0x0072, 0x0072, 0x0072, 0x0072, + 0x0072, 0x0072, 0x0072, 0x0072, 0x0072, 0x0000, 0x0072, 0x0072, + 0x0072, 0x0072, 0x0072, 0x0072, 0x0072, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x0000, - 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x0000, - 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, - 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, - 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, - 0x0026, 0x0026, 0x0000, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, - 0x0026, 0x0026, 0x0026, 0x0026, 0x0000, 0x0000, 0x0000, 0x0000, + 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, + 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, + 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0000, 0x0000, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0026, 0x0000, 0x0026, + 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, + 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, 0x0000, 0x0073, 0x0073, + 0x0073, 0x0000, 0x0073, 0x0073, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, - 0x0026, 0x0026, 0x0000, 0x0000, 0x0000, 0x0000, 0x0027, 0x0027, + 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, + 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, + 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, + 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, 0x0000, 0x0000, + 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, 0x0037, + 0x0037, 0x0037, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x004d, 0x004d, 0x0000, 0x0000, 0x004d, 0x0000, 0x004d, 0x004d, + 0x004d, 0x004d, 0x004d, 0x004d, 0x004d, 0x004d, 0x004d, 0x0000, + 0x004d, 0x004d, 0x004d, 0x004d, 0x004d, 0x004d, 0x004d, 0x004d, + 0x004d, 0x004d, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x004d, 0x004d, 0x004d, 0x004d, 0x004d, 0x004d, 0x004d, 0x004d, + 0x004d, 0x004d, 0x004d, 0x004d, 0x004d, 0x004d, 0x004d, 0x004d, + 0x004d, 0x004d, 0x004d, 0x004d, 0x004d, 0x004d, 0x004d, 0x004d, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0026, 0x0026, 0x0026, 0x0026, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, - 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, - 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, - 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, - 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, 0x002a, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x002a, 0x002a, 0x002a, - 0x0000, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, - 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, - 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, - 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, - 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, - 0x0031, 0x0031, 0x0031, 0x0000, 0x0000, 0x0031, 0x0031, 0x0031, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000a, 0x000a, 0x000a, - 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, - 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, - 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, + 0x004d, 0x004d, 0x004d, 0x004d, 0x004d, 0x004d, 0x004d, 0x004d, + 0x004d, 0x004d, 0x004d, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, + 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, + 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, + 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, 0x0000, + 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, + 0x003d, 0x003d, 0x003d, 0x003d, 0x0000, 0x0000, 0x0000, 0x0000, + 0x003d, 0x0000, 0x0000, 0x0000, 0x003d, 0x003d, 0x003d, 0x003d, + 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, + 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, + 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, + 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, + 0x000f, 0x000f, 0x000f, 0x000f, 0x0000, 0x0000, 0x000f, 0x000f, + 0x0007, 0x0007, 0x0007, 0x0007, 0x0007, 0x0007, 0x0007, 0x0007, + 0x0007, 0x0007, 0x0007, 0x0007, 0x0007, 0x0007, 0x0007, 0x0007, + 0x0007, 0x0007, 0x0007, 0x0007, 0x0007, 0x0007, 0x0007, 0x0007, + 0x0007, 0x0007, 0x0007, 0x0007, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0007, 0x0007, 0x0007, 0x0007, 0x0007, 0x0007, 0x0007, 0x0007, + 0x0007, 0x0007, 0x0007, 0x0007, 0x0007, 0x0000, 0x0000, 0x0000, + 0x006f, 0x006f, 0x006f, 0x006f, 0x006f, 0x006f, 0x006f, 0x006f, + 0x006f, 0x006f, 0x006f, 0x006f, 0x006f, 0x006f, 0x006f, 0x006f, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, - 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x0000, 0x0000, - 0x0000, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, - 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, - 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, - 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0000, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, - 0x000a, 0x000a, 0x000a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, - 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0000, - 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, + 0x000a, 0x000a, 0x000a, 0x000a, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x000a, 0x000a, 0x000a, 0x000a, + 0x003c, 0x003c, 0x003c, 0x003c, 0x003c, 0x003c, 0x003c, 0x003c, + 0x003c, 0x003c, 0x003c, 0x003c, 0x003c, 0x003c, 0x003c, 0x003c, + 0x003c, 0x003c, 0x003c, 0x003c, 0x003c, 0x003c, 0x003c, 0x003c, + 0x0000, 0x0000, 0x0000, 0x003c, 0x003c, 0x003c, 0x003c, 0x003c, + 0x003c, 0x003c, 0x003c, 0x003c, 0x003c, 0x003c, 0x003c, 0x003c, + 0x003c, 0x003c, 0x0000, 0x0000, 0x0000, 0x003c, 0x003c, 0x003c, + 0x006f, 0x006f, 0x006f, 0x006f, 0x006f, 0x006f, 0x006f, 0x006f, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x0025, 0x0025, + 0x0025, 0x0025, 0x0025, 0x001a, 0x003b, 0x003b, 0x003b, 0x003b, + 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, + 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x0025, 0x0025, 0x0025, + 0x0025, 0x0025, 0x003b, 0x003b, 0x003b, 0x003b, 0x0025, 0x0025, + 0x0025, 0x0025, 0x0025, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, + 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, + 0x001a, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, + 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, + 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x0025, + 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0000, 0x0000, + 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0000, 0x0000, + 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, + 0x0000, 0x0025, 0x0000, 0x0025, 0x0000, 0x0025, 0x0000, 0x0025, + 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, + 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0000, 0x0000, + 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0000, 0x0025, 0x0025, + 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, + 0x0025, 0x0025, 0x0025, 0x0025, 0x0000, 0x0000, 0x0025, 0x0025, + 0x0025, 0x0025, 0x0025, 0x0025, 0x0000, 0x0025, 0x0025, 0x0025, + 0x0000, 0x0000, 0x0025, 0x0025, 0x0025, 0x0000, 0x0025, 0x0025, + 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0025, 0x0000, + 0x0000, 0x003b, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x003b, + 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, + 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0025, 0x0000, + 0x0000, 0x0000, 0x003b, 0x003b, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x003b, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, - 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0000, 0x0000, 0x0000, - 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, - 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, - 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, - 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x0000, 0x0000, 0x0000, - 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, - 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, 0x003d, - 0x007a, 0x007a, 0x007a, 0x007a, 0x007a, 0x007a, 0x007a, 0x007a, - 0x007a, 0x007a, 0x007a, 0x007a, 0x007a, 0x007a, 0x007a, 0x007a, - 0x007a, 0x007a, 0x007a, 0x007a, 0x007a, 0x007a, 0x007a, 0x007a, - 0x007a, 0x007a, 0x007a, 0x007a, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, - 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0018, 0x0000, 0x0018, - 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, - 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, - 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, - 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, - 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, - 0x0000, 0x0000, 0x0000, 0x0038, 0x0038, 0x0038, 0x0038, 0x0000, - 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, - 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0000, 0x0000, - 0x0038, 0x0038, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0038, - 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, - 0x0063, 0x0063, 0x0063, 0x0063, 0x0063, 0x0063, 0x0063, 0x0063, - 0x0063, 0x0063, 0x0063, 0x0063, 0x0063, 0x0063, 0x0063, 0x0063, - 0x0063, 0x0063, 0x0063, 0x0063, 0x0063, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0063, 0x0063, - 0x0063, 0x0063, 0x0063, 0x0063, 0x0063, 0x0063, 0x0063, 0x0063, - 0x0063, 0x0063, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, - 0x001a, 0x001a, 0x001a, 0x001a, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, - 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, 0x0060, - 0x0060, 0x0060, 0x0060, 0x0060, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0060, - 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, - 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0000, 0x0000, 0x0000, - 0x002e, 0x002e, 0x002e, 0x002e, 0x002e, 0x002e, 0x002e, 0x002e, - 0x002e, 0x002e, 0x002e, 0x002e, 0x002e, 0x002e, 0x002e, 0x002e, - 0x002e, 0x002e, 0x002e, 0x002e, 0x002e, 0x002e, 0x002e, 0x002e, - 0x002e, 0x002e, 0x002e, 0x002e, 0x002e, 0x002e, 0x0000, 0x0000, - 0x002e, 0x002e, 0x002e, 0x002e, 0x002e, 0x002e, 0x002e, 0x002e, - 0x002e, 0x002e, 0x0000, 0x0000, 0x0000, 0x0000, 0x002e, 0x002e, - 0x004c, 0x004c, 0x004c, 0x004c, 0x004c, 0x004c, 0x004c, 0x004c, - 0x004c, 0x004c, 0x004c, 0x004c, 0x004c, 0x004c, 0x004c, 0x0000, - 0x0013, 0x0013, 0x0013, 0x0013, 0x0013, 0x0013, 0x0013, 0x0013, - 0x0013, 0x0013, 0x0013, 0x0013, 0x0013, 0x0013, 0x0013, 0x0013, - 0x0013, 0x0013, 0x0013, 0x0013, 0x0013, 0x0013, 0x0013, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0013, 0x0013, 0x0013, 0x0013, 0x0013, 0x0013, 0x0013, 0x0013, - 0x0013, 0x0013, 0x0013, 0x0013, 0x0013, 0x0013, 0x0000, 0x0000, - 0x0013, 0x0013, 0x0013, 0x0013, 0x0013, 0x0013, 0x0013, 0x0013, - 0x0013, 0x0013, 0x0000, 0x0000, 0x0013, 0x0013, 0x0013, 0x0013, - 0x0000, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x0000, - 0x0000, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x0000, - 0x0000, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, - 0x0038, 0x0038, 0x0038, 0x0000, 0x0038, 0x0038, 0x0038, 0x0038, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0038, 0x0023, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x003b, 0x0000, + 0x000e, 0x000e, 0x000e, 0x000e, 0x000e, 0x000e, 0x000e, 0x000e, + 0x000e, 0x000e, 0x000e, 0x000e, 0x000e, 0x000e, 0x000e, 0x000e, + 0x0022, 0x0022, 0x0022, 0x0022, 0x0022, 0x0022, 0x0022, 0x0022, + 0x0022, 0x0022, 0x0022, 0x0022, 0x0022, 0x0022, 0x0022, 0x0022, + 0x0022, 0x0022, 0x0022, 0x0022, 0x0022, 0x0022, 0x0022, 0x0022, + 0x0022, 0x0022, 0x0022, 0x0022, 0x0022, 0x0022, 0x0022, 0x0000, + 0x0017, 0x0017, 0x0017, 0x0017, 0x0017, 0x0017, 0x0017, 0x0017, + 0x0017, 0x0017, 0x0017, 0x0017, 0x0017, 0x0017, 0x0017, 0x0017, + 0x0017, 0x0017, 0x0017, 0x0017, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0017, 0x0017, 0x0017, 0x0017, 0x0017, 0x0017, 0x0017, + 0x007d, 0x007d, 0x007d, 0x007d, 0x007d, 0x007d, 0x007d, 0x007d, + 0x007d, 0x007d, 0x007d, 0x007d, 0x007d, 0x007d, 0x007d, 0x007d, + 0x007d, 0x007d, 0x007d, 0x007d, 0x007d, 0x007d, 0x007d, 0x007d, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x007d, + 0x007d, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x007d, + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0027, 0x0027, 0x0027, 0x0027, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0000, + 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0000, + 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, + 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, + 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, + 0x0028, 0x0028, 0x0000, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, + 0x0028, 0x0028, 0x0028, 0x0028, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, - 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, - 0x0027, 0x0027, 0x0027, 0x0027, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, - 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0000, 0x0000, - 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, 0x0026, - 0x0026, 0x0026, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0038, 0x0000, + 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0029, 0x0029, 0x0029, - 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0000, - 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0000, 0x0029, 0x0000, - 0x0029, 0x0029, 0x0000, 0x0029, 0x0029, 0x0000, 0x0029, 0x0029, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0028, 0x0000, 0x0028, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, + 0x0028, 0x0028, 0x0000, 0x0000, 0x0000, 0x0000, 0x0029, 0x0029, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0028, 0x0028, 0x0028, 0x0028, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x002d, 0x002d, 0x002d, 0x002d, 0x002d, 0x002d, 0x002d, + 0x002d, 0x002d, 0x002d, 0x002d, 0x002d, 0x002d, 0x002d, 0x002d, + 0x002d, 0x002d, 0x002d, 0x002d, 0x002d, 0x002d, 0x002d, 0x002d, + 0x002d, 0x002d, 0x002d, 0x002d, 0x002d, 0x002d, 0x002d, 0x002d, + 0x002d, 0x002d, 0x002d, 0x002d, 0x002d, 0x002d, 0x002d, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x002d, 0x002d, 0x002d, + 0x0000, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, + 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, + 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, + 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, + 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, + 0x0034, 0x0034, 0x0034, 0x0000, 0x0000, 0x0034, 0x0034, 0x0034, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000c, 0x000c, 0x000c, + 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, + 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, + 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, + 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, + 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x0000, 0x0000, + 0x0000, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, + 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, - 0x0002, 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0000, + 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, 0x000c, + 0x000c, 0x000c, 0x000c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, + 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0000, + 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, - 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, - 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, - 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, - 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, - 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0000, 0x0002, 0x0002, - 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, - 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, - 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0031, 0x0031, + 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, + 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, + 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, + 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, 0x0000, 0x0000, 0x0000, + 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, 0x0082, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0040, 0x0040, 0x0040, 0x0040, 0x0040, 0x0040, 0x0040, 0x0040, + 0x0040, 0x0040, 0x0040, 0x0040, 0x0040, 0x0040, 0x0040, 0x0040, + 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, + 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, + 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, + 0x0080, 0x0080, 0x0080, 0x0080, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, + 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, + 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, + 0x0000, 0x0000, 0x0000, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, + 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, + 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x0000, 0x0000, + 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x003b, + 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, + 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, + 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, + 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0068, 0x0068, + 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, 0x0068, + 0x0068, 0x0068, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, + 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x0000, 0x0000, + 0x0065, 0x0065, 0x0065, 0x0065, 0x0065, 0x0065, 0x0065, 0x0065, + 0x0065, 0x0065, 0x0065, 0x0065, 0x0065, 0x0065, 0x0065, 0x0065, + 0x0065, 0x0065, 0x0065, 0x0065, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0065, + 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, + 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0000, 0x0000, 0x0000, + 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, - 0x0000, 0x0000, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, - 0x0000, 0x0000, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, 0x0027, - 0x0000, 0x0000, 0x0027, 0x0027, 0x0027, 0x0000, 0x0000, 0x0000 + 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, 0x0031, + 0x0031, 0x0031, 0x0000, 0x0000, 0x0000, 0x0000, 0x0031, 0x0031, + 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, + 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0050, 0x0000, + 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, + 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, + 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, + 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0000, 0x0000, + 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, 0x0015, + 0x0015, 0x0015, 0x0000, 0x0000, 0x0015, 0x0015, 0x0015, 0x0015, + 0x0000, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0000, + 0x0000, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0000, + 0x0000, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0020, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, + 0x003b, 0x003b, 0x003b, 0x0000, 0x003b, 0x003b, 0x003b, 0x003b, + 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x0025, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0029, 0x0029, 0x0029, 0x0029, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, + 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, + 0x0029, 0x0029, 0x0029, 0x0029, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, + 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0000, 0x0000, + 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, 0x0028, + 0x0028, 0x0028, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x003b, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0005, 0x0005, 0x0005, 0x0005, 0x0005, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x002c, 0x002c, 0x002c, + 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, 0x0000, + 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, 0x0000, 0x002c, 0x0000, + 0x002c, 0x002c, 0x0000, 0x002c, 0x002c, 0x0000, 0x002c, 0x002c, + 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, 0x002c, + 0x0004, 0x0004, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x001a, 0x001a, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0000, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0034, 0x0034, + 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, + 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, + 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0034, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, + 0x0000, 0x0000, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, + 0x0000, 0x0000, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, 0x0029, + 0x0000, 0x0000, 0x0029, 0x0029, 0x0029, 0x0000, 0x0000, 0x0000 }; diff -Nru wine1.7-1.7.50/dlls/dwrite/scripts.h wine1.7-1.7.55/dlls/dwrite/scripts.h --- wine1.7-1.7.50/dlls/dwrite/scripts.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dwrite/scripts.h 2015-11-13 14:32:40.000000000 +0000 @@ -1,132 +1,138 @@ /* Unicode Script IDs */ -/* generated from http://www.unicode.org/Public/7.0.0/ucd/Scripts.txt */ +/* generated from http://www.unicode.org/Public/8.0.0/ucd/Scripts.txt */ /* DO NOT EDIT!! */ enum unicode_script_id { Script_Unknown = 0, Script_Common = 1, - Script_Arabic = 2, - Script_Armenian = 3, - Script_Avestan = 4, - Script_Balinese = 5, - Script_Bamum = 6, - Script_Bassa_Vah = 7, - Script_Batak = 8, - Script_Bengali = 9, - Script_Bopomofo = 10, - Script_Brahmi = 11, - Script_Braille = 12, - Script_Buginese = 13, - Script_Buhid = 14, - Script_Canadian_Aboriginal = 15, - Script_Carian = 16, - Script_Caucasian_Albanian = 17, - Script_Chakma = 18, - Script_Cham = 19, - Script_Cherokee = 20, - Script_Coptic = 21, - Script_Cuneiform = 22, - Script_Cypriot = 23, - Script_Cyrillic = 24, - Script_Deseret = 25, - Script_Devanagari = 26, - Script_Duployan = 27, - Script_Egyptian_Hieroglyphs = 28, - Script_Elbasan = 29, - Script_Ethiopic = 30, - Script_Georgian = 31, - Script_Glagolitic = 32, - Script_Gothic = 33, - Script_Grantha = 34, - Script_Greek = 35, - Script_Gujarati = 36, - Script_Gurmukhi = 37, - Script_Han = 38, - Script_Hangul = 39, - Script_Hanunoo = 40, - Script_Hebrew = 41, - Script_Hiragana = 42, - Script_Imperial_Aramaic = 43, - Script_Inscriptional_Pahlavi = 44, - Script_Inscriptional_Parthian = 45, - Script_Javanese = 46, - Script_Kaithi = 47, - Script_Kannada = 48, - Script_Katakana = 49, - Script_Kayah_Li = 50, - Script_Kharoshthi = 51, - Script_Khmer = 52, - Script_Khojki = 53, - Script_Khudawadi = 54, - Script_Lao = 55, - Script_Latin = 56, - Script_Lepcha = 57, - Script_Limbu = 58, - Script_Linear_A = 59, - Script_Linear_B = 60, - Script_Lisu = 61, - Script_Lycian = 62, - Script_Lydian = 63, - Script_Mahajani = 64, - Script_Malayalam = 65, - Script_Mandaic = 66, - Script_Manichaean = 67, - Script_Meetei_Mayek = 68, - Script_Mende_Kikakui = 69, - Script_Meroitic_Cursive = 70, - Script_Meroitic_Hieroglyphs = 71, - Script_Miao = 72, - Script_Modi = 73, - Script_Mongolian = 74, - Script_Mro = 75, - Script_Myanmar = 76, - Script_Nabataean = 77, - Script_New_Tai_Lue = 78, - Script_Nko = 79, - Script_Ogham = 80, - Script_Ol_Chiki = 81, - Script_Old_Italic = 82, - Script_Old_North_Arabian = 83, - Script_Old_Permic = 84, - Script_Old_Persian = 85, - Script_Old_South_Arabian = 86, - Script_Old_Turkic = 87, - Script_Oriya = 88, - Script_Osmanya = 89, - Script_Pahawh_Hmong = 90, - Script_Palmyrene = 91, - Script_Pau_Cin_Hau = 92, - Script_Phags_Pa = 93, - Script_Phoenician = 94, - Script_Psalter_Pahlavi = 95, - Script_Rejang = 96, - Script_Runic = 97, - Script_Samaritan = 98, - Script_Saurashtra = 99, - Script_Sharada = 100, - Script_Shavian = 101, - Script_Siddham = 102, - Script_Sinhala = 103, - Script_Sora_Sompeng = 104, - Script_Sundanese = 105, - Script_Syloti_Nagri = 106, - Script_Syriac = 107, - Script_Tagalog = 108, - Script_Tagbanwa = 109, - Script_Tai_Le = 110, - Script_Tai_Tham = 111, - Script_Tai_Viet = 112, - Script_Takri = 113, - Script_Tamil = 114, - Script_Telugu = 115, - Script_Thaana = 116, - Script_Thai = 117, - Script_Tibetan = 118, - Script_Tifinagh = 119, - Script_Tirhuta = 120, - Script_Ugaritic = 121, - Script_Vai = 122, - Script_Warang_Citi = 123, - Script_Yi = 124, - Script_LastId = 124 + Script_Ahom = 2, + Script_Anatolian_Hieroglyphs = 3, + Script_Arabic = 4, + Script_Armenian = 5, + Script_Avestan = 6, + Script_Balinese = 7, + Script_Bamum = 8, + Script_Bassa_Vah = 9, + Script_Batak = 10, + Script_Bengali = 11, + Script_Bopomofo = 12, + Script_Brahmi = 13, + Script_Braille = 14, + Script_Buginese = 15, + Script_Buhid = 16, + Script_Canadian_Aboriginal = 17, + Script_Carian = 18, + Script_Caucasian_Albanian = 19, + Script_Chakma = 20, + Script_Cham = 21, + Script_Cherokee = 22, + Script_Coptic = 23, + Script_Cuneiform = 24, + Script_Cypriot = 25, + Script_Cyrillic = 26, + Script_Deseret = 27, + Script_Devanagari = 28, + Script_Duployan = 29, + Script_Egyptian_Hieroglyphs = 30, + Script_Elbasan = 31, + Script_Ethiopic = 32, + Script_Georgian = 33, + Script_Glagolitic = 34, + Script_Gothic = 35, + Script_Grantha = 36, + Script_Greek = 37, + Script_Gujarati = 38, + Script_Gurmukhi = 39, + Script_Han = 40, + Script_Hangul = 41, + Script_Hanunoo = 42, + Script_Hatran = 43, + Script_Hebrew = 44, + Script_Hiragana = 45, + Script_Imperial_Aramaic = 46, + Script_Inscriptional_Pahlavi = 47, + Script_Inscriptional_Parthian = 48, + Script_Javanese = 49, + Script_Kaithi = 50, + Script_Kannada = 51, + Script_Katakana = 52, + Script_Kayah_Li = 53, + Script_Kharoshthi = 54, + Script_Khmer = 55, + Script_Khojki = 56, + Script_Khudawadi = 57, + Script_Lao = 58, + Script_Latin = 59, + Script_Lepcha = 60, + Script_Limbu = 61, + Script_Linear_A = 62, + Script_Linear_B = 63, + Script_Lisu = 64, + Script_Lycian = 65, + Script_Lydian = 66, + Script_Mahajani = 67, + Script_Malayalam = 68, + Script_Mandaic = 69, + Script_Manichaean = 70, + Script_Meetei_Mayek = 71, + Script_Mende_Kikakui = 72, + Script_Meroitic_Cursive = 73, + Script_Meroitic_Hieroglyphs = 74, + Script_Miao = 75, + Script_Modi = 76, + Script_Mongolian = 77, + Script_Mro = 78, + Script_Multani = 79, + Script_Myanmar = 80, + Script_Nabataean = 81, + Script_New_Tai_Lue = 82, + Script_Nko = 83, + Script_Ogham = 84, + Script_Ol_Chiki = 85, + Script_Old_Hungarian = 86, + Script_Old_Italic = 87, + Script_Old_North_Arabian = 88, + Script_Old_Permic = 89, + Script_Old_Persian = 90, + Script_Old_South_Arabian = 91, + Script_Old_Turkic = 92, + Script_Oriya = 93, + Script_Osmanya = 94, + Script_Pahawh_Hmong = 95, + Script_Palmyrene = 96, + Script_Pau_Cin_Hau = 97, + Script_Phags_Pa = 98, + Script_Phoenician = 99, + Script_Psalter_Pahlavi = 100, + Script_Rejang = 101, + Script_Runic = 102, + Script_Samaritan = 103, + Script_Saurashtra = 104, + Script_Sharada = 105, + Script_Shavian = 106, + Script_Siddham = 107, + Script_SignWriting = 108, + Script_Sinhala = 109, + Script_Sora_Sompeng = 110, + Script_Sundanese = 111, + Script_Syloti_Nagri = 112, + Script_Syriac = 113, + Script_Tagalog = 114, + Script_Tagbanwa = 115, + Script_Tai_Le = 116, + Script_Tai_Tham = 117, + Script_Tai_Viet = 118, + Script_Takri = 119, + Script_Tamil = 120, + Script_Telugu = 121, + Script_Thaana = 122, + Script_Thai = 123, + Script_Tibetan = 124, + Script_Tifinagh = 125, + Script_Tirhuta = 126, + Script_Ugaritic = 127, + Script_Vai = 128, + Script_Warang_Citi = 129, + Script_Yi = 130, + Script_LastId = 130 }; diff -Nru wine1.7-1.7.50/dlls/dwrite/tests/font.c wine1.7-1.7.55/dlls/dwrite/tests/font.c --- wine1.7-1.7.50/dlls/dwrite/tests/font.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dwrite/tests/font.c 2015-11-13 14:32:40.000000000 +0000 @@ -98,6 +98,7 @@ static const WCHAR tahomaUppercaseW[] = {'T','A','H','O','M','A',0}; static const WCHAR tahomaStrangecaseW[] = {'t','A','h','O','m','A',0}; static const WCHAR blahW[] = {'B','l','a','h','!',0}; +static const WCHAR emojiW[] = {'S','e','g','o','e',' ','U','I',' ','E','m','o','j','i',0}; static IDWriteFactory *create_factory(void) { @@ -1307,12 +1308,11 @@ /* try mismatching face type, the one that's not supported */ hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_CFF, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface); -todo_wine ok(hr == DWRITE_E_FILEFORMAT, "got 0x%08x\n", hr); hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface); - ok(hr == E_FAIL, "got 0x%08x\n", hr); + ok(hr == DWRITE_E_FILEFORMAT || broken(hr == E_FAIL) /* < win10 */, "got 0x%08x\n", hr); hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_RAW_CFF, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface); todo_wine @@ -1328,7 +1328,14 @@ ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); hr = IDWriteFactory_CreateFontFace(factory, DWRITE_FONT_FACE_TYPE_UNKNOWN, 1, &file, 0, DWRITE_FONT_SIMULATIONS_NONE, &fontface); - ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); +todo_wine + ok(hr == S_OK || broken(hr == E_INVALIDARG) /* < win10 */, "got 0x%08x\n", hr); + if (hr == S_OK) { + ok(fontface != NULL, "got %p\n", fontface); + face_type = IDWriteFontFace_GetType(fontface); + ok(face_type == DWRITE_FONT_FACE_TYPE_TRUETYPE, "got %d\n", face_type); + IDWriteFontFace_Release(fontface); + } IDWriteFontFile_Release(file); IDWriteFactory_Release(factory); @@ -1839,6 +1846,7 @@ ok(hr == S_OK, "got 0x%08x\n", hr); ok(exists, "got %d\n", exists); EXPECT_REF(string, 1); + IDWriteLocalizedStrings_Release(string); family3 = NULL; hr = IDWriteFont_GetFontFamily(idfont, &family3); @@ -1954,8 +1962,10 @@ factory = create_factory(); factory2 = create_factory(); +if (0) { /* crashes on win10 */ hr = IDWriteFactory_RegisterFontFileLoader(factory, NULL); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); +} hr = IDWriteFactory_RegisterFontFileLoader(factory, &floader); ok(hr == S_OK, "got 0x%08x\n", hr); hr = IDWriteFactory_RegisterFontFileLoader(factory, &floader2); @@ -2860,6 +2870,7 @@ ok(writetime != 0, "got %08x%08x\n", (UINT)(writetime >> 32), (UINT)writetime); IDWriteFontFileStream_Release(stream); + IDWriteFontFile_Release(file); IDWriteLocalFontFileLoader_Release(localloader); IDWriteFactory_Release(factory); @@ -2938,6 +2949,7 @@ ok(fragment == fragment2, "got %p, %p\n", fragment, fragment2); IDWriteFontFileStream_ReleaseFileFragment(stream, context); + IDWriteFontFile_Release(file); IDWriteFontFileStream_Release(stream); IDWriteLocalFontFileLoader_Release(localloader); IDWriteFactory_Release(factory); @@ -3094,6 +3106,7 @@ advance = 0; hr = IDWriteFontFace1_GetDesignGlyphAdvances(fontface1, 1, &index, &advance, TRUE); ok(hr == S_OK, "got 0x%08x\n", hr); + todo_wine ok(advance == 2048, "got %i\n", advance); IDWriteFontFace1_Release(fontface1); @@ -3482,18 +3495,19 @@ DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC, }; - IDWriteGlyphRunAnalysis *analysis; + IDWriteGlyphRunAnalysis *analysis, *analysis2; IDWriteFactory *factory; DWRITE_GLYPH_RUN run; IDWriteFontFace *face; UINT16 glyph, glyphs[10]; - FLOAT advance; + FLOAT advances[2]; HRESULT hr; UINT32 ch; RECT rect, rect2; - DWRITE_GLYPH_OFFSET offset; + DWRITE_GLYPH_OFFSET offsets[2]; DWRITE_GLYPH_METRICS metrics; DWRITE_FONT_METRICS fm; + DWRITE_MATRIX m; int i; factory = create_factory(); @@ -3507,31 +3521,51 @@ hr = IDWriteFontFace_GetDesignGlyphMetrics(face, &glyph, 1, &metrics, FALSE); ok(hr == S_OK, "got 0x%08x\n", hr); - advance = metrics.advanceWidth; + advances[0] = metrics.advanceWidth; - offset.advanceOffset = 0.0; - offset.ascenderOffset = 0.0; + offsets[0].advanceOffset = 0.0; + offsets[0].ascenderOffset = 0.0; run.fontFace = face; run.fontEmSize = 24.0; run.glyphCount = 1; run.glyphIndices = &glyph; - run.glyphAdvances = &advance; - run.glyphOffsets = &offset; + run.glyphAdvances = advances; + run.glyphOffsets = offsets; run.isSideways = FALSE; run.bidiLevel = 0; + /* zero ppdip */ + analysis = (void*)0xdeadbeef; + hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 0.0, NULL, + DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL, + 0.0, 0.0, &analysis); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(analysis == NULL, "got %p\n", analysis); + + /* negative ppdip */ + analysis = (void*)0xdeadbeef; + hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, -1.0, NULL, + DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL, + 0.0, 0.0, &analysis); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(analysis == NULL, "got %p\n", analysis); + /* default mode is not allowed */ + analysis = (void*)0xdeadbeef; hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL, DWRITE_RENDERING_MODE_DEFAULT, DWRITE_MEASURING_MODE_NATURAL, 0.0, 0.0, &analysis); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(analysis == NULL, "got %p\n", analysis); /* outline too */ + analysis = (void*)0xdeadbeef; hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL, DWRITE_RENDERING_MODE_OUTLINE, DWRITE_MEASURING_MODE_NATURAL, 0.0, 0.0, &analysis); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(analysis == NULL, "got %p\n", analysis); hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL, DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL, @@ -3552,6 +3586,18 @@ ok(!IsRectEmpty(&rect), "got empty rect\n"); IDWriteGlyphRunAnalysis_Release(analysis); + /* doubled ppdip */ + hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 2.0, NULL, + DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL, + 0.0, 0.0, &analysis); + ok(hr == S_OK, "got 0x%08x\n", hr); + memset(&rect2, 0, sizeof(rect2)); + hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect2); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(rect.right - rect.left < rect2.right - rect2.left, "expected wider rect\n"); + ok(rect.bottom - rect.top < rect2.bottom - rect2.top, "expected taller rect\n"); + IDWriteGlyphRunAnalysis_Release(analysis); + hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL, DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL, 10.0, -5.0, &analysis); @@ -3638,7 +3684,7 @@ run.fontEmSize = 24.0; run.glyphCount = 1; run.glyphIndices = &glyph; - run.glyphAdvances = &advance; + run.glyphAdvances = advances; run.glyphOffsets = NULL; run.isSideways = FALSE; run.bidiLevel = 0; @@ -3677,12 +3723,14 @@ IDWriteGlyphRunAnalysis_Release(analysis); + /* test that advances are scaled according to ppdip too */ glyphs[0] = glyphs[1] = glyph; + advances[0] = advances[1] = 100.0f; run.fontFace = face; run.fontEmSize = 24.0; run.glyphCount = 2; run.glyphIndices = glyphs; - run.glyphAdvances = NULL; + run.glyphAdvances = advances; run.glyphOffsets = NULL; run.isSideways = FALSE; run.bidiLevel = 0; @@ -3697,6 +3745,52 @@ ok(hr == S_OK, "got 0x%08x\n", hr); ok(!IsRectEmpty(&rect2), "got empty bounds\n"); ok(!EqualRect(&rect, &rect2), "got wrong rect2\n"); + ok((rect2.right - rect.left) > advances[0], "got rect width %d for advance %f\n", rect.right - rect.left, advances[0]); + IDWriteGlyphRunAnalysis_Release(analysis); + + hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 2.0, NULL, + DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL, + 0.0, 0.0, &analysis); + ok(hr == S_OK, "got 0x%08x\n", hr); + + SetRectEmpty(&rect); + hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok((rect.right - rect.left) > 2 * advances[0], "got rect width %d for advance %f\n", rect.right - rect.left, advances[0]); + IDWriteGlyphRunAnalysis_Release(analysis); + + /* with scaling transform */ + hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, NULL, + DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL, + 0.0, 0.0, &analysis); + ok(hr == S_OK, "got 0x%08x\n", hr); + + SetRectEmpty(&rect); + hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(!IsRectEmpty(&rect), "got rect width %d\n", rect.right - rect.left); + IDWriteGlyphRunAnalysis_Release(analysis); + + memset(&m, 0, sizeof(m)); + m.m11 = 2.0; + m.m22 = 1.0; + hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, &m, + DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL, + 0.0, 0.0, &analysis); + ok(hr == S_OK, "got 0x%08x\n", hr); + + SetRectEmpty(&rect2); + hr = IDWriteGlyphRunAnalysis_GetAlphaTextureBounds(analysis, DWRITE_TEXTURE_ALIASED_1x1, &rect2); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok((rect2.right - rect2.left) > (rect.right - rect.left), "got rect width %d\n", rect2.right - rect2.left); + + /* instances are not reused for same runs */ + hr = IDWriteFactory_CreateGlyphRunAnalysis(factory, &run, 1.0, &m, + DWRITE_RENDERING_MODE_ALIASED, DWRITE_MEASURING_MODE_NATURAL, + 0.0, 0.0, &analysis2); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(analysis2 != analysis, "got %p, previous instance %p\n", analysis2, analysis); + IDWriteGlyphRunAnalysis_Release(analysis2); IDWriteGlyphRunAnalysis_Release(analysis); @@ -4215,12 +4309,7 @@ /* advance is in design units */ advance = (int)floorf(emsize * advance / fm.designUnitsPerEm + 0.5f); - - /* allow 1 pixel difference for large sizes, for Tahoma this happens for 16 sizes in [1, 2048] range */ - if (emsize > 150.0) - ok((advance - gdi_advance) <= 1, "%.0f: got advance %d, expected %d\n", emsize, advance, gdi_advance); - else - ok(gdi_advance == advance, "%.0f: got advance %d, expected %d\n", emsize, advance, gdi_advance); + ok((advance - gdi_advance) <= 2, "%.0f: got advance %d, expected %d\n", emsize, advance, gdi_advance); } DeleteObject(hdc); @@ -4228,7 +4317,7 @@ IDWriteFactory_Release(factory); } -static WORD get_gasp_flags(IDWriteFontFace *fontface, FLOAT emsize) +static WORD get_gasp_flags(IDWriteFontFace *fontface, FLOAT emsize, FLOAT ppdip) { WORD num_recs, version; const WORD *ptr; @@ -4238,6 +4327,8 @@ void *ctxt; HRESULT hr; + emsize *= ppdip; + exists = FALSE; hr = IDWriteFontFace_TryGetFontTable(fontface, MS_GASP_TAG, (const void**)&ptr, &size, &ctxt, &exists); @@ -4386,27 +4477,129 @@ g_is_vista = fontface1 == NULL; for (emsize = 1.0; emsize < 500.0; emsize += 1.0) { - WORD gasp = get_gasp_flags(fontface, emsize); DWRITE_RENDERING_MODE expected; + FLOAT ppdip; + WORD gasp; int i; for (i = 0; i < sizeof(recmode_tests)/sizeof(recmode_tests[0]); i++) { + ppdip = 1.0f; + mode = 10; + gasp = get_gasp_flags(fontface, emsize, ppdip); + expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests[i].measuring, recmode_tests[i].threshold); + hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, emsize, ppdip, recmode_tests[i].measuring, params, &mode); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(mode == expected, "%.2f/%d: got %d, ppdip %f, flags 0x%04x, expected %d\n", emsize, i, mode, ppdip, gasp, expected); + + /* some ppdip variants */ + ppdip = 0.5f; mode = 10; - expected = get_expected_rendering_mode(emsize, gasp, recmode_tests[i].measuring, recmode_tests[i].threshold); - hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, emsize, 1.0, recmode_tests[i].measuring, params, &mode); + gasp = get_gasp_flags(fontface, emsize, ppdip); + expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests[i].measuring, recmode_tests[i].threshold); + hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, emsize, ppdip, recmode_tests[i].measuring, params, &mode); ok(hr == S_OK, "got 0x%08x\n", hr); - ok(mode == expected, "%.2f/%d: got %d, flags 0x%04x, expected %d\n", emsize, i, mode, gasp, expected); + ok(mode == expected, "%.2f/%d: got %d, ppdip %f, flags 0x%04x, expected %d\n", emsize, i, mode, ppdip, gasp, expected); + + /* Only test larger sizes to workaround Win7 differences, where unscaled natural emsize threshold is used; + Win8 and Win10 handle this as expected. */ + if (emsize > 20.0f) { + ppdip = 1.5f; + mode = 10; + gasp = get_gasp_flags(fontface, emsize, ppdip); + expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests[i].measuring, recmode_tests[i].threshold); + hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, emsize, ppdip, recmode_tests[i].measuring, params, &mode); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(mode == expected, "%.2f/%d: got %d, ppdip %f, flags 0x%04x, expected %d\n", emsize, i, mode, ppdip, gasp, expected); + + ppdip = 2.0f; + mode = 10; + gasp = get_gasp_flags(fontface, emsize, ppdip); + expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests[i].measuring, recmode_tests[i].threshold); + hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, emsize, ppdip, recmode_tests[i].measuring, params, &mode); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(mode == expected, "%.2f/%d: got %d, ppdip %f, flags 0x%04x, expected %d\n", emsize, i, mode, ppdip, gasp, expected); + } } /* IDWriteFontFace1 offers another variant of this method */ if (fontface1) { for (i = 0; i < sizeof(recmode_tests1)/sizeof(recmode_tests1[0]); i++) { + FLOAT dpi; + + ppdip = 1.0f; + dpi = 96.0f * ppdip; mode = 10; - expected = get_expected_rendering_mode(emsize, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold); - hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize, 96.0, 96.0, + gasp = get_gasp_flags(fontface, emsize, ppdip); + expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold); + hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize, dpi, dpi, NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, &mode); ok(hr == S_OK, "got 0x%08x\n", hr); - ok(mode == expected, "%.2f/%d: got %d, flags 0x%04x, expected %d\n", emsize, i, mode, gasp, expected); + ok(mode == expected, "%.2f/%d: got %d, dpi %f, flags 0x%04x, expected %d\n", emsize, i, mode, dpi, gasp, expected); + + /* Only test larger sizes to workaround Win7 differences, where unscaled natural emsize threshold is used; + Win8 and Win10 handle this as expected. */ + if (emsize > 20.0f) { + ppdip = 2.0f; + dpi = 96.0f * ppdip; + mode = 10; + gasp = get_gasp_flags(fontface, emsize, ppdip); + expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold); + hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize, dpi, dpi, + NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, &mode); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(mode == expected, "%.2f/%d: got %d, dpi %f, flags 0x%04x, expected %d\n", emsize, i, mode, dpi, gasp, expected); + + ppdip = 0.5f; + dpi = 96.0f * ppdip; + mode = 10; + gasp = get_gasp_flags(fontface, emsize, ppdip); + expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold); + hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize, dpi, dpi, + NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, &mode); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(mode == expected, "%.2f/%d: got %d, dpi %f, flags 0x%04x, expected %d\n", emsize, i, mode, dpi, gasp, expected); + + /* try different dpis for X and Y direction */ + ppdip = 1.0f; + dpi = 96.0f * ppdip; + mode = 10; + gasp = get_gasp_flags(fontface, emsize, ppdip); + expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold); + hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize, dpi * 0.5f, dpi, + NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, &mode); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(mode == expected, "%.2f/%d: got %d, dpi %f, flags 0x%04x, expected %d\n", emsize, i, mode, dpi, gasp, expected); + + ppdip = 1.0f; + dpi = 96.0f * ppdip; + mode = 10; + gasp = get_gasp_flags(fontface, emsize, ppdip); + expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold); + hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize, dpi, dpi * 0.5f, + NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, &mode); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(mode == expected, "%.2f/%d: got %d, dpi %f, flags 0x%04x, expected %d\n", emsize, i, mode, dpi, gasp, expected); + + ppdip = 2.0f; + dpi = 96.0f * ppdip; + mode = 10; + gasp = get_gasp_flags(fontface, emsize, ppdip); + expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold); + hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize, dpi * 0.5f, dpi, + NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, &mode); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(mode == expected, "%.2f/%d: got %d, dpi %f, flags 0x%04x, expected %d\n", emsize, i, mode, dpi, gasp, expected); + + ppdip = 2.0f; + dpi = 96.0f * ppdip; + mode = 10; + gasp = get_gasp_flags(fontface, emsize, ppdip); + expected = get_expected_rendering_mode(emsize * ppdip, gasp, recmode_tests1[i].measuring, recmode_tests1[i].threshold); + hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize, dpi, dpi * 0.5f, + NULL, FALSE, recmode_tests1[i].threshold, recmode_tests1[i].measuring, &mode); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(mode == expected, "%.2f/%d: got %d, dpi %f, flags 0x%04x, expected %d\n", emsize, i, mode, dpi, gasp, expected); + } } } @@ -4414,6 +4607,7 @@ if (fontface2) { DWRITE_GRID_FIT_MODE gridfit, expected_gridfit; + gasp = get_gasp_flags(fontface, emsize, 1.0f); for (i = 0; i < sizeof(recmode_tests1)/sizeof(recmode_tests1[0]); i++) { mode = 10; expected = get_expected_rendering_mode(emsize, gasp, recmode_tests1[0].measuring, recmode_tests1[0].threshold); @@ -4789,7 +4983,6 @@ static void test_GetPaletteEntries(void) { - static const WCHAR emojiW[] = {'S','e','g','o','e',' ','U','I',' ','E','m','o','j','i',0}; IDWriteFontFace2 *fontface2; IDWriteFontFace *fontface; IDWriteFactory *factory; @@ -4830,6 +5023,7 @@ IDWriteFont_Release(font); hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace2, (void**)&fontface2); + ok(hr == S_OK, "got 0x%08x\n", hr); IDWriteFontFace_Release(fontface); palettecount = IDWriteFontFace2_GetColorPaletteCount(fontface2); @@ -4876,6 +5070,125 @@ IDWriteFactory_Release(factory); } +static void test_TranslateColorGlyphRun(void) +{ + IDWriteColorGlyphRunEnumerator *layers; + const DWRITE_COLOR_GLYPH_RUN *colorrun; + IDWriteFontFace *fontface; + IDWriteFactory2 *factory2; + IDWriteFactory *factory; + DWRITE_GLYPH_RUN run; + UINT32 codepoints[2]; + IDWriteFont *font; + UINT16 glyphs[2]; + BOOL hasrun; + HRESULT hr; + + factory = create_factory(); + + hr = IDWriteFactory_QueryInterface(factory, &IID_IDWriteFactory2, (void**)&factory2); + IDWriteFactory_Release(factory); + if (hr != S_OK) { + win_skip("TranslateColorGlyphRun() is not supported.\n"); + return; + } + + /* Tahoma, no color support */ + fontface = create_fontface((IDWriteFactory*)factory2); + + codepoints[0] = 'A'; + hr = IDWriteFontFace_GetGlyphIndices(fontface, codepoints, 1, glyphs); + ok(hr == S_OK, "got 0x%08x\n", hr); + + run.fontFace = fontface; + run.fontEmSize = 20.0f; + run.glyphCount = 1; + run.glyphIndices = glyphs; + run.glyphAdvances = NULL; + run.glyphOffsets = NULL; + run.isSideways = FALSE; + run.bidiLevel = 0; + + layers = (void*)0xdeadbeef; + hr = IDWriteFactory2_TranslateColorGlyphRun(factory2, 0.0, 0.0, &run, NULL, + DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers); + ok(hr == DWRITE_E_NOCOLOR, "got 0x%08x\n", hr); + ok(layers == NULL, "got %p\n", layers); + IDWriteFontFace_Release(fontface); + + /* Segoe UI Emoji, with color support */ + font = get_font((IDWriteFactory*)factory2, emojiW, DWRITE_FONT_STYLE_NORMAL); + if (!font) { + IDWriteFactory2_Release(factory2); + skip("Segoe UI Emoji font not found.\n"); + return; + } + + hr = IDWriteFont_CreateFontFace(font, &fontface); + ok(hr == S_OK, "got 0x%08x\n", hr); + IDWriteFont_Release(font); + + codepoints[0] = 0x26c4; + hr = IDWriteFontFace_GetGlyphIndices(fontface, codepoints, 1, glyphs); + ok(hr == S_OK, "got 0x%08x\n", hr); + + run.fontFace = fontface; + + layers = NULL; + hr = IDWriteFactory2_TranslateColorGlyphRun(factory2, 0.0, 0.0, &run, NULL, + DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(layers != NULL, "got %p\n", layers); + + while (1) { + hasrun = FALSE; + hr = IDWriteColorGlyphRunEnumerator_MoveNext(layers, &hasrun); + todo_wine + ok(hr == S_OK, "got 0x%08x\n", hr); + + if (!hasrun) + break; + } + + /* iterated all way through */ + hr = IDWriteColorGlyphRunEnumerator_GetCurrentRun(layers, &colorrun); +todo_wine + ok(hr == E_NOT_VALID_STATE, "got 0x%08x\n", hr); + + IDWriteColorGlyphRunEnumerator_Release(layers); + + /* color font, glyph without color info */ + codepoints[0] = 'A'; + hr = IDWriteFontFace_GetGlyphIndices(fontface, codepoints, 1, glyphs); + ok(hr == S_OK, "got 0x%08x\n", hr); + + layers = (void*)0xdeadbeef; + hr = IDWriteFactory2_TranslateColorGlyphRun(factory2, 0.0, 0.0, &run, NULL, + DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers); +todo_wine { + ok(hr == DWRITE_E_NOCOLOR, "got 0x%08x\n", hr); + ok(layers == NULL, "got %p\n", layers); +} + /* one glyph with, one without */ + codepoints[0] = 'A'; + codepoints[1] = 0x26c4; + + hr = IDWriteFontFace_GetGlyphIndices(fontface, codepoints, 2, glyphs); + ok(hr == S_OK, "got 0x%08x\n", hr); + + run.glyphCount = 2; + + layers = NULL; + hr = IDWriteFactory2_TranslateColorGlyphRun(factory2, 0.0, 0.0, &run, NULL, + DWRITE_MEASURING_MODE_NATURAL, NULL, 0, &layers); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(layers != NULL, "got %p\n", layers); + IDWriteColorGlyphRunEnumerator_Release(layers); + + IDWriteFontFace_Release(fontface); + IDWriteFactory2_Release(factory2); +} + START_TEST(font) { IDWriteFactory *factory; @@ -4927,6 +5240,7 @@ test_CreateAlphaTexture(); test_IsSymbolFont(); test_GetPaletteEntries(); + test_TranslateColorGlyphRun(); IDWriteFactory_Release(factory); } diff -Nru wine1.7-1.7.50/dlls/dxdiagn/fil_data.idl wine1.7-1.7.55/dlls/dxdiagn/fil_data.idl --- wine1.7-1.7.50/dlls/dxdiagn/fil_data.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dxdiagn/fil_data.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep header + import "objidl.idl"; import "strmif.idl"; import "unknwn.idl"; diff -Nru wine1.7-1.7.50/dlls/dxdiagn/provider.c wine1.7-1.7.55/dlls/dxdiagn/provider.c --- wine1.7-1.7.50/dlls/dxdiagn/provider.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dxdiagn/provider.c 2015-11-13 14:32:40.000000000 +0000 @@ -335,7 +335,7 @@ return E_OUTOFMEMORY; V_VT(&prop->vProp) = VT_BOOL; - V_BOOL(&prop->vProp) = data; + V_BOOL(&prop->vProp) = data ? VARIANT_TRUE : VARIANT_FALSE; list_add_tail(&node->properties, &prop->entry); ++node->nProperties; diff -Nru wine1.7-1.7.50/dlls/dxgi/adapter.c wine1.7-1.7.55/dlls/dxgi/adapter.c --- wine1.7-1.7.50/dlls/dxgi/adapter.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dxgi/adapter.c 2015-11-13 14:32:40.000000000 +0000 @@ -153,9 +153,9 @@ adapter_id.description_size = sizeof(description); adapter_id.device_name_size = 0; - EnterCriticalSection(&dxgi_cs); + wined3d_mutex_lock(); hr = wined3d_get_adapter_identifier(adapter->parent->wined3d, adapter->ordinal, 0, &adapter_id); - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); if (FAILED(hr)) return hr; @@ -200,9 +200,39 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_CheckInterfaceSupport(IDXGIAdapter1 *iface, REFGUID guid, LARGE_INTEGER *umd_version) { - FIXME("iface %p, guid %s, umd_version %p stub!\n", iface, debugstr_guid(guid), umd_version); + struct dxgi_adapter *adapter = impl_from_IDXGIAdapter1(iface); + struct wined3d_adapter_identifier adapter_id; + HRESULT hr; + + TRACE("iface %p, guid %s, umd_version %p.\n", iface, debugstr_guid(guid), umd_version); + + /* This method works only for D3D10 interfaces. */ + if (!(IsEqualGUID(guid, &IID_ID3D10Device) + || IsEqualGUID(guid, &IID_ID3D10Device1))) + { + WARN("Returning DXGI_ERROR_UNSUPPORTED for %s.\n", debugstr_guid(guid)); + return DXGI_ERROR_UNSUPPORTED; + } + + if (FAILED(hr = dxgi_check_d3d10_support(adapter->parent, adapter))) + return DXGI_ERROR_UNSUPPORTED; + + if (umd_version) + { + adapter_id.driver_size = 0; + adapter_id.description_size = 0; + adapter_id.device_name_size = 0; + + wined3d_mutex_lock(); + hr = wined3d_get_adapter_identifier(adapter->parent->wined3d, adapter->ordinal, 0, &adapter_id); + wined3d_mutex_unlock(); + if (FAILED(hr)) + return hr; + + *umd_version = adapter_id.driver_version; + } - return E_NOTIMPL; + return S_OK; } static const struct IDXGIAdapter1Vtbl dxgi_adapter_vtbl = diff -Nru wine1.7-1.7.50/dlls/dxgi/device.c wine1.7-1.7.55/dlls/dxgi/device.c --- wine1.7-1.7.50/dlls/dxgi/device.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dxgi/device.c 2015-11-13 14:32:40.000000000 +0000 @@ -40,6 +40,7 @@ if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDXGIObject) || IsEqualGUID(riid, &IID_IDXGIDevice) + || IsEqualGUID(riid, &IID_IDXGIDevice1) || IsEqualGUID(riid, &IID_IWineDXGIDevice)) { IUnknown_AddRef(iface); @@ -49,11 +50,11 @@ if (This->child_layer) { - TRACE("forwarding to child layer %p\n", This->child_layer); + TRACE("forwarding to child layer %p.\n", This->child_layer); return IUnknown_QueryInterface(This->child_layer, riid, object); } - WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid)); + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); *object = NULL; return E_NOINTERFACE; @@ -79,10 +80,10 @@ if (!refcount) { if (This->child_layer) IUnknown_Release(This->child_layer); - EnterCriticalSection(&dxgi_cs); + wined3d_mutex_lock(); wined3d_device_uninit_3d(This->wined3d_device); wined3d_device_decref(This->wined3d_device); - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); IDXGIFactory1_Release(This->factory); wined3d_private_store_cleanup(&This->private_store); HeapFree(GetProcessHeap(), 0, This); @@ -152,9 +153,9 @@ TRACE("iface %p, adapter %p\n", iface, adapter); - EnterCriticalSection(&dxgi_cs); + wined3d_mutex_lock(); wined3d_device_get_creation_parameters(This->wined3d_device, &create_parameters); - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); return IDXGIFactory1_EnumAdapters(This->factory, create_parameters.adapter_idx, adapter); } @@ -194,22 +195,23 @@ surface_desc.depth = 1; surface_desc.size = 0; + wined3d_mutex_lock(); memset(surface, 0, surface_count * sizeof(*surface)); for (i = 0; i < surface_count; ++i) { - struct wined3d_surface *wined3d_surface; + struct wined3d_texture *wined3d_texture; IUnknown *parent; - if (FAILED(hr = device_parent->ops->create_swapchain_surface(device_parent, - NULL, &surface_desc, &wined3d_surface))) + if (FAILED(hr = device_parent->ops->create_swapchain_texture(device_parent, + NULL, &surface_desc, &wined3d_texture))) { ERR("Failed to create surface, hr %#x.\n", hr); goto fail; } - parent = wined3d_surface_get_parent(wined3d_surface); + parent = wined3d_texture_get_parent(wined3d_texture); hr = IUnknown_QueryInterface(parent, &IID_IDXGISurface, (void **)&surface[i]); - wined3d_surface_decref(wined3d_surface); + wined3d_texture_decref(wined3d_texture); if (FAILED(hr)) { ERR("Surface should implement IDXGISurface\n"); @@ -218,11 +220,13 @@ TRACE("Created IDXGISurface %p (%u/%u)\n", surface[i], i + 1, surface_count); } + wined3d_mutex_unlock(); IWineDXGIDeviceParent_Release(dxgi_device_parent); return S_OK; fail: + wined3d_mutex_unlock(); for (j = 0; j < i; ++j) { IDXGISurface_Release(surface[i]); @@ -254,6 +258,26 @@ return E_NOTIMPL; } +static HRESULT STDMETHODCALLTYPE dxgi_device_SetMaximumFrameLatency(IWineDXGIDevice *iface, UINT max_latency) +{ + FIXME("iface %p, max_latency %u stub!\n", iface, max_latency); + + if (max_latency > DXGI_FRAME_LATENCY_MAX) + return DXGI_ERROR_INVALID_CALL; + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE dxgi_device_GetMaximumFrameLatency(IWineDXGIDevice *iface, UINT *max_latency) +{ + FIXME("iface %p, max_latency %p stub!\n", iface, max_latency); + + if (max_latency) + *max_latency = DXGI_FRAME_LATENCY_DEFAULT; + + return E_NOTIMPL; +} + /* IWineDXGIDevice methods */ static HRESULT STDMETHODCALLTYPE dxgi_device_create_surface(IWineDXGIDevice *iface, @@ -333,6 +357,9 @@ dxgi_device_QueryResourceResidency, dxgi_device_SetGPUThreadPriority, dxgi_device_GetGPUThreadPriority, + /* IDXGIDevice1 methods */ + dxgi_device_SetMaximumFrameLatency, + dxgi_device_GetMaximumFrameLatency, /* IWineDXGIDevice methods */ dxgi_device_create_surface, dxgi_device_create_swapchain, @@ -348,7 +375,6 @@ struct dxgi_factory *dxgi_factory; void *layer_base; HRESULT hr; - WINED3DCAPS caps; if (!(dxgi_factory = unsafe_impl_from_IDXGIFactory1((IDXGIFactory1 *)factory))) { @@ -364,6 +390,7 @@ device->IWineDXGIDevice_iface.lpVtbl = &dxgi_device_vtbl; device->refcount = 1; + wined3d_mutex_lock(); wined3d_private_store_init(&device->private_store); layer_base = device + 1; @@ -373,6 +400,7 @@ { WARN("Failed to create device, returning %#x.\n", hr); wined3d_private_store_cleanup(&device->private_store); + wined3d_mutex_unlock(); return hr; } @@ -382,33 +410,30 @@ ERR("DXGI device should implement IWineD3DDeviceParent.\n"); IUnknown_Release(device->child_layer); wined3d_private_store_cleanup(&device->private_store); + wined3d_mutex_unlock(); return hr; } wined3d_device_parent = IWineDXGIDeviceParent_get_wined3d_device_parent(dxgi_device_parent); IWineDXGIDeviceParent_Release(dxgi_device_parent); - FIXME("Ignoring adapter type.\n"); - - hr = wined3d_get_device_caps(dxgi_factory->wined3d, dxgi_adapter->ordinal, WINED3D_DEVICE_TYPE_HAL, &caps); - if (FAILED(hr) || caps.VertexShaderVersion < 4 || caps.PixelShaderVersion < 4) + if (FAILED(hr = dxgi_check_d3d10_support(dxgi_factory, dxgi_adapter))) { - WARN("Direct3D 10 is not supported on this GPU with the current shader backend.\n"); - if (SUCCEEDED(hr)) - hr = E_FAIL; IUnknown_Release(device->child_layer); wined3d_private_store_cleanup(&device->private_store); + wined3d_mutex_unlock(); return hr; } - EnterCriticalSection(&dxgi_cs); + FIXME("Ignoring adapter type.\n"); + hr = wined3d_device_create(dxgi_factory->wined3d, dxgi_adapter->ordinal, WINED3D_DEVICE_TYPE_HAL, NULL, 0, 4, wined3d_device_parent, &device->wined3d_device); - LeaveCriticalSection(&dxgi_cs); if (FAILED(hr)) { WARN("Failed to create a wined3d device, returning %#x.\n", hr); IUnknown_Release(device->child_layer); wined3d_private_store_cleanup(&device->private_store); + wined3d_mutex_unlock(); return hr; } @@ -422,8 +447,10 @@ wined3d_device_decref(device->wined3d_device); IUnknown_Release(device->child_layer); wined3d_private_store_cleanup(&device->private_store); + wined3d_mutex_unlock(); return hr; } + wined3d_mutex_unlock(); device->factory = &dxgi_factory->IDXGIFactory1_iface; IDXGIFactory1_AddRef(device->factory); diff -Nru wine1.7-1.7.50/dlls/dxgi/dxgi_main.c wine1.7-1.7.55/dlls/dxgi/dxgi_main.c --- wine1.7-1.7.50/dlls/dxgi/dxgi_main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dxgi/dxgi_main.c 2015-11-13 14:32:40.000000000 +0000 @@ -25,15 +25,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(dxgi); -static CRITICAL_SECTION_DEBUG dxgi_cs_debug = -{ - 0, 0, &dxgi_cs, - {&dxgi_cs_debug.ProcessLocksList, - &dxgi_cs_debug.ProcessLocksList}, - 0, 0, {(DWORD_PTR)(__FILE__ ": dxgi_cs")} -}; -CRITICAL_SECTION dxgi_cs = {&dxgi_cs_debug, -1, 0, 0, 0, 0}; - struct dxgi_main { HMODULE d3d10core; @@ -46,7 +37,6 @@ { HeapFree(GetProcessHeap(), 0, dxgi_main.device_layers); FreeLibrary(dxgi_main.d3d10core); - DeleteCriticalSection(&dxgi_cs); } BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved) @@ -84,25 +74,25 @@ { UINT i; - EnterCriticalSection(&dxgi_cs); + wined3d_mutex_lock(); for (i = 0; i < dxgi_main.layer_count; ++i) { if (dxgi_main.device_layers[i].id == id) { *layer = dxgi_main.device_layers[i]; - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); return TRUE; } } - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); return FALSE; } static HRESULT register_d3d10core_layers(HMODULE d3d10core) { - EnterCriticalSection(&dxgi_cs); + wined3d_mutex_lock(); if (!dxgi_main.d3d10core) { @@ -113,7 +103,7 @@ if (!(ret = GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (const char *)d3d10core, &mod))) { - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); return E_FAIL; } @@ -122,14 +112,14 @@ if (FAILED(hr)) { ERR("Failed to register d3d11 layers, returning %#x\n", hr); - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); return hr; } dxgi_main.d3d10core = mod; } - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); return S_OK; } @@ -210,7 +200,7 @@ TRACE("layers %p, layer_count %u\n", layers, layer_count); - EnterCriticalSection(&dxgi_cs); + wined3d_mutex_lock(); if (!dxgi_main.layer_count) new_layers = HeapAlloc(GetProcessHeap(), 0, layer_count * sizeof(*new_layers)); @@ -220,7 +210,7 @@ if (!new_layers) { - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); ERR("Failed to allocate layer memory\n"); return E_OUTOFMEMORY; } @@ -238,7 +228,7 @@ dxgi_main.device_layers = new_layers; dxgi_main.layer_count += layer_count; - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); return S_OK; } diff -Nru wine1.7-1.7.50/dlls/dxgi/dxgi_private.h wine1.7-1.7.55/dlls/dxgi/dxgi_private.h --- wine1.7-1.7.50/dlls/dxgi/dxgi_private.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dxgi/dxgi_private.h 2015-11-13 14:32:40.000000000 +0000 @@ -30,14 +30,18 @@ #include "objbase.h" #include "winnls.h" -#include "dxgi.h" +#include "d3d10_1.h" #ifdef DXGI_INIT_GUID #include "initguid.h" #endif #include "wine/wined3d.h" #include "wine/winedxgi.h" -extern CRITICAL_SECTION dxgi_cs DECLSPEC_HIDDEN; +enum dxgi_frame_latency +{ + DXGI_FRAME_LATENCY_DEFAULT = 3, + DXGI_FRAME_LATENCY_MAX = 16, +}; /* Layered device */ enum dxgi_device_layer_id @@ -170,4 +174,6 @@ HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device, IUnknown *outer, struct wined3d_resource *wined3d_resource) DECLSPEC_HIDDEN; +HRESULT dxgi_check_d3d10_support(struct dxgi_factory *factory, struct dxgi_adapter *adapter) DECLSPEC_HIDDEN; + #endif /* __WINE_DXGI_PRIVATE_H */ diff -Nru wine1.7-1.7.50/dlls/dxgi/factory.c wine1.7-1.7.55/dlls/dxgi/factory.c --- wine1.7-1.7.50/dlls/dxgi/factory.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dxgi/factory.c 2015-11-13 14:32:40.000000000 +0000 @@ -80,9 +80,9 @@ } HeapFree(GetProcessHeap(), 0, factory->adapters); - EnterCriticalSection(&dxgi_cs); + wined3d_mutex_lock(); wined3d_decref(factory->wined3d); - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); wined3d_private_store_cleanup(&factory->private_store); HeapFree(GetProcessHeap(), 0, factory); } @@ -190,21 +190,43 @@ struct wined3d_swapchain_desc wined3d_desc; IWineDXGIDevice *dxgi_device; HRESULT hr; + UINT min_buffer_count; FIXME("iface %p, device %p, desc %p, swapchain %p partial stub!\n", iface, device, desc, swapchain); - hr = IUnknown_QueryInterface(device, &IID_IWineDXGIDevice, (void **)&dxgi_device); - if (FAILED(hr)) + switch (desc->SwapEffect) { - ERR("This is not the device we're looking for\n"); - return hr; + case DXGI_SWAP_EFFECT_DISCARD: + case DXGI_SWAP_EFFECT_SEQUENTIAL: + min_buffer_count = 1; + break; + + case DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL: + min_buffer_count = 2; + break; + + default: + WARN("Invalid swap effect %u used, returning DXGI_ERROR_INVALID_CALL.\n", desc->SwapEffect); + return DXGI_ERROR_INVALID_CALL; } + if (desc->BufferCount < min_buffer_count || desc->BufferCount > 16) + { + WARN("BufferCount is %u, returning DXGI_ERROR_INVALID_CALL.\n", desc->BufferCount); + return DXGI_ERROR_INVALID_CALL; + } if (!desc->OutputWindow) { FIXME("No output window, should use factory output window\n"); } + hr = IUnknown_QueryInterface(device, &IID_IWineDXGIDevice, (void **)&dxgi_device); + if (FAILED(hr)) + { + ERR("This is not the device we're looking for\n"); + return hr; + } + FIXME("Ignoring SwapEffect and Flags\n"); wined3d_desc.backbuffer_width = desc->BufferDesc.Width; @@ -231,7 +253,9 @@ return hr; } + wined3d_mutex_lock(); *swapchain = wined3d_swapchain_get_parent(wined3d_swapchain); + wined3d_mutex_unlock(); return S_OK; } @@ -286,17 +310,17 @@ factory->refcount = 1; wined3d_private_store_init(&factory->private_store); - EnterCriticalSection(&dxgi_cs); + wined3d_mutex_lock(); factory->wined3d = wined3d_create(0); if (!factory->wined3d) { - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); wined3d_private_store_cleanup(&factory->private_store); return DXGI_ERROR_UNSUPPORTED; } factory->adapter_count = wined3d_get_adapter_count(factory->wined3d); - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); factory->adapters = HeapAlloc(GetProcessHeap(), 0, factory->adapter_count * sizeof(*factory->adapters)); if (!factory->adapters) { @@ -345,9 +369,9 @@ fail: HeapFree(GetProcessHeap(), 0, factory->adapters); - EnterCriticalSection(&dxgi_cs); + wined3d_mutex_lock(); wined3d_decref(factory->wined3d); - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); wined3d_private_store_cleanup(&factory->private_store); return hr; } @@ -377,21 +401,21 @@ HWND dxgi_factory_get_device_window(struct dxgi_factory *factory) { - EnterCriticalSection(&dxgi_cs); + wined3d_mutex_lock(); if (!factory->device_window) { if (!(factory->device_window = CreateWindowA("static", "DXGI device window", WS_DISABLED, 0, 0, 0, 0, NULL, NULL, NULL, NULL))) { - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); ERR("Failed to create a window.\n"); return NULL; } TRACE("Created device window %p for factory %p.\n", factory->device_window, factory); } - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); return factory->device_window; } diff -Nru wine1.7-1.7.50/dlls/dxgi/output.c wine1.7-1.7.55/dlls/dxgi/output.c --- wine1.7-1.7.50/dlls/dxgi/output.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dxgi/output.c 2015-11-13 14:32:40.000000000 +0000 @@ -150,20 +150,20 @@ wined3d = This->adapter->parent->wined3d; wined3d_format = wined3dformat_from_dxgi_format(format); - EnterCriticalSection(&dxgi_cs); + wined3d_mutex_lock(); max_count = wined3d_get_adapter_mode_count(wined3d, This->adapter->ordinal, wined3d_format, WINED3D_SCANLINE_ORDERING_UNKNOWN); if (!desc) { - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); *mode_count = max_count; return S_OK; } if (max_count > *mode_count) { - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); return DXGI_ERROR_MORE_DATA; } @@ -179,7 +179,7 @@ if (FAILED(hr)) { WARN("EnumAdapterModes failed, hr %#x.\n", hr); - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); return hr; } @@ -191,7 +191,7 @@ desc[i].ScanlineOrdering = mode.scanline_ordering; desc[i].Scaling = DXGI_MODE_SCALING_UNSPECIFIED; /* FIXME */ } - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); return S_OK; } diff -Nru wine1.7-1.7.50/dlls/dxgi/surface.c wine1.7-1.7.55/dlls/dxgi/surface.c --- wine1.7-1.7.50/dlls/dxgi/surface.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dxgi/surface.c 2015-11-13 14:32:40.000000000 +0000 @@ -168,7 +168,9 @@ TRACE("iface %p, desc %p.\n", iface, desc); + wined3d_mutex_lock(); wined3d_resource_get_desc(surface->wined3d_resource, &wined3d_desc); + wined3d_mutex_unlock(); desc->Width = wined3d_desc.width; desc->Height = wined3d_desc.height; desc->Format = dxgi_format_from_wined3dformat(wined3d_desc.format); diff -Nru wine1.7-1.7.50/dlls/dxgi/swapchain.c wine1.7-1.7.55/dlls/dxgi/swapchain.c --- wine1.7-1.7.50/dlls/dxgi/swapchain.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dxgi/swapchain.c 2015-11-13 14:32:40.000000000 +0000 @@ -59,7 +59,11 @@ TRACE("%p increasing refcount to %u\n", This, refcount); if (refcount == 1) + { + wined3d_mutex_lock(); wined3d_swapchain_incref(This->wined3d_swapchain); + wined3d_mutex_unlock(); + } return refcount; } @@ -72,7 +76,11 @@ TRACE("%p decreasing refcount to %u\n", This, refcount); if (!refcount) + { + wined3d_mutex_lock(); wined3d_swapchain_decref(This->wined3d_swapchain); + wined3d_mutex_unlock(); + } return refcount; } @@ -130,46 +138,50 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_Present(IDXGISwapChain *iface, UINT sync_interval, UINT flags) { struct dxgi_swapchain *This = impl_from_IDXGISwapChain(iface); + HRESULT hr; TRACE("iface %p, sync_interval %u, flags %#x\n", iface, sync_interval, flags); if (sync_interval) FIXME("Unimplemented sync interval %u\n", sync_interval); if (flags) FIXME("Unimplemented flags %#x\n", flags); - return wined3d_swapchain_present(This->wined3d_swapchain, NULL, NULL, NULL, NULL, 0); + wined3d_mutex_lock(); + hr = wined3d_swapchain_present(This->wined3d_swapchain, NULL, NULL, NULL, NULL, 0); + wined3d_mutex_unlock(); + + return hr; } static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetBuffer(IDXGISwapChain *iface, UINT buffer_idx, REFIID riid, void **surface) { struct dxgi_swapchain *This = impl_from_IDXGISwapChain(iface); - struct wined3d_surface *backbuffer; + struct wined3d_texture *texture; IUnknown *parent; HRESULT hr; TRACE("iface %p, buffer_idx %u, riid %s, surface %p\n", iface, buffer_idx, debugstr_guid(riid), surface); - EnterCriticalSection(&dxgi_cs); + wined3d_mutex_lock(); - if (!(backbuffer = wined3d_swapchain_get_back_buffer(This->wined3d_swapchain, - buffer_idx, WINED3D_BACKBUFFER_TYPE_MONO))) + if (!(texture = wined3d_swapchain_get_back_buffer(This->wined3d_swapchain, buffer_idx))) { - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); return DXGI_ERROR_INVALID_CALL; } - parent = wined3d_surface_get_parent(backbuffer); + parent = wined3d_texture_get_parent(texture); hr = IUnknown_QueryInterface(parent, riid, surface); - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); return hr; } -static HRESULT STDMETHODCALLTYPE dxgi_swapchain_SetFullscreenState(IDXGISwapChain *iface, +static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH dxgi_swapchain_SetFullscreenState(IDXGISwapChain *iface, BOOL fullscreen, IDXGIOutput *target) { - FIXME("iface %p, fullscreen %u, target %p stub!\n", iface, fullscreen, target); + FIXME("iface %p, fullscreen %#x, target %p stub!\n", iface, fullscreen, target); return E_NOTIMPL; } @@ -192,9 +204,9 @@ if (desc == NULL) return E_INVALIDARG; - EnterCriticalSection(&dxgi_cs); + wined3d_mutex_lock(); wined3d_swapchain_get_desc(swapchain->wined3d_swapchain, &wined3d_desc); - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); FIXME("Ignoring ScanlineOrdering, Scaling, SwapEffect and Flags\n"); @@ -220,7 +232,7 @@ { struct dxgi_swapchain *swapchain = impl_from_IDXGISwapChain(iface); struct wined3d_swapchain_desc wined3d_desc; - struct wined3d_surface *surface; + struct wined3d_texture *texture; IUnknown *parent; unsigned int i; HRESULT hr; @@ -231,17 +243,16 @@ if (flags) FIXME("Ignoring flags %#x.\n", flags); - EnterCriticalSection(&dxgi_cs); + wined3d_mutex_lock(); wined3d_swapchain_get_desc(swapchain->wined3d_swapchain, &wined3d_desc); for (i = 0; i < wined3d_desc.backbuffer_count; ++i) { - surface = wined3d_swapchain_get_back_buffer(swapchain->wined3d_swapchain, - i, WINED3D_BACKBUFFER_TYPE_MONO); - parent = wined3d_surface_get_parent(surface); + texture = wined3d_swapchain_get_back_buffer(swapchain->wined3d_swapchain, i); + parent = wined3d_texture_get_parent(texture); IUnknown_AddRef(parent); if (IUnknown_Release(parent)) { - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); return DXGI_ERROR_INVALID_CALL; } } @@ -249,7 +260,7 @@ wined3d_desc.backbuffer_format = wined3dformat_from_dxgi_format(format); hr = wined3d_swapchain_resize_buffers(swapchain->wined3d_swapchain, buffer_count, width, height, wined3d_desc.backbuffer_format, wined3d_desc.multisample_type, wined3d_desc.multisample_quality); - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); return hr; } @@ -329,6 +340,7 @@ swapchain->IDXGISwapChain_iface.lpVtbl = &dxgi_swapchain_vtbl; swapchain->refcount = 1; + wined3d_mutex_lock(); wined3d_private_store_init(&swapchain->private_store); if (FAILED(hr = wined3d_swapchain_create(device->wined3d_device, desc, swapchain, @@ -336,8 +348,10 @@ { WARN("Failed to create wined3d swapchain, hr %#x.\n", hr); wined3d_private_store_cleanup(&swapchain->private_store); + wined3d_mutex_unlock(); return hr; } + wined3d_mutex_unlock(); return S_OK; } diff -Nru wine1.7-1.7.50/dlls/dxgi/tests/device.c wine1.7-1.7.55/dlls/dxgi/tests/device.c --- wine1.7-1.7.50/dlls/dxgi/tests/device.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dxgi/tests/device.c 2015-11-13 14:32:40.000000000 +0000 @@ -21,6 +21,14 @@ #include "d3d11.h" #include "wine/test.h" +enum frame_latency +{ + DEFAULT_FRAME_LATENCY = 3, + MAX_FRAME_LATENCY = 16, +}; + +static DEVMODEW registry_mode; + static HRESULT (WINAPI *pCreateDXGIFactory1)(REFIID iid, void **factory); static ULONG get_refcount(IUnknown *iface) @@ -52,53 +60,6 @@ return dxgi_device; } -static void test_device_interfaces(void) -{ - IDXGIDevice *device; - IUnknown *iface; - ULONG refcount; - HRESULT hr; - - if (!(device = create_device())) - { - skip("Failed to create device, skipping tests.\n"); - return; - } - - hr = IDXGIDevice_QueryInterface(device, &IID_IUnknown, (void **)&iface); - ok(SUCCEEDED(hr), "Failed to query IUnknown interface, hr %#x.\n", hr); - IUnknown_Release(iface); - - hr = IDXGIDevice_QueryInterface(device, &IID_IDXGIObject, (void **)&iface); - ok(SUCCEEDED(hr), "Failed to query IDXGIObject interface, hr %#x.\n", hr); - IUnknown_Release(iface); - - hr = IDXGIDevice_QueryInterface(device, &IID_IDXGIDevice, (void **)&iface); - ok(SUCCEEDED(hr), "Failed to query IDXGIDevice interface, hr %#x.\n", hr); - IUnknown_Release(iface); - - hr = IDXGIDevice_QueryInterface(device, &IID_ID3D10Device, (void **)&iface); - ok(SUCCEEDED(hr), "Failed to query ID3D10Device interface, hr %#x.\n", hr); - IUnknown_Release(iface); - - hr = IDXGIDevice_QueryInterface(device, &IID_ID3D10Multithread, (void **)&iface); - ok(SUCCEEDED(hr), "Failed to query ID3D10Multithread interface, hr %#x.\n", hr); - IUnknown_Release(iface); - - if (SUCCEEDED(hr = IDXGIDevice_QueryInterface(device, &IID_ID3D10Device1, (void **)&iface))) - IUnknown_Release(iface); - ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, - "Failed to query ID3D10Device1 interface, hr %#x.\n", hr); - - if (SUCCEEDED(hr = IDXGIDevice_QueryInterface(device, &IID_ID3D11Device, (void **)&iface))) - IUnknown_Release(iface); - ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, - "Failed to query ID3D11Device interface, hr %#x.\n", hr); - - refcount = IDXGIDevice_Release(device); - ok(!refcount, "Device has %u references left.\n", refcount); -} - static void test_adapter_desc(void) { DXGI_ADAPTER_DESC1 desc1; @@ -168,12 +129,66 @@ ok(!refcount, "Device has %u references left.\n", refcount); } +static void test_check_interface_support(void) +{ + LARGE_INTEGER driver_version; + IDXGIAdapter *adapter; + IDXGIDevice *device; + IUnknown *iface; + ULONG refcount; + HRESULT hr; + + if (!(device = create_device())) + { + skip("Failed to create device.\n"); + return; + } + + hr = IDXGIDevice_GetAdapter(device, &adapter); + ok(SUCCEEDED(hr), "GetAdapter failed, hr %#x.\n", hr); + + hr = IDXGIAdapter_CheckInterfaceSupport(adapter, &IID_ID3D10Device, NULL); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = IDXGIAdapter_CheckInterfaceSupport(adapter, &IID_ID3D10Device, &driver_version); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + trace("UMD version: %u.%u.%u.%u.\n", + HIWORD(U(driver_version).HighPart), LOWORD(U(driver_version).HighPart), + HIWORD(U(driver_version).LowPart), LOWORD(U(driver_version).LowPart)); + + hr = IDXGIDevice_QueryInterface(device, &IID_ID3D10Device1, (void **)&iface); + if (SUCCEEDED(hr)) + { + IUnknown_Release(iface); + hr = IDXGIAdapter_CheckInterfaceSupport(adapter, &IID_ID3D10Device1, NULL); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = IDXGIAdapter_CheckInterfaceSupport(adapter, &IID_ID3D10Device1, &driver_version); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + } + else + { + win_skip("D3D10.1 is not supported.\n"); + } + + hr = IDXGIAdapter_CheckInterfaceSupport(adapter, &IID_ID3D11Device, NULL); + ok(hr == DXGI_ERROR_UNSUPPORTED, "Got unexpected hr %#x.\n", hr); + driver_version.HighPart = driver_version.LowPart = 0xdeadbeef; + hr = IDXGIAdapter_CheckInterfaceSupport(adapter, &IID_ID3D11Device, &driver_version); + ok(hr == DXGI_ERROR_UNSUPPORTED, "Got unexpected hr %#x.\n", hr); + ok(driver_version.HighPart == 0xdeadbeef, "Got unexpected driver version %#x.\n", driver_version.HighPart); + ok(driver_version.LowPart == 0xdeadbeef, "Got unexpected driver version %#x.\n", driver_version.LowPart); + + IDXGIAdapter_Release(adapter); + refcount = IDXGIDevice_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + static void test_create_surface(void) { - ID3D10Texture2D *texture; - IDXGISurface *surface; DXGI_SURFACE_DESC desc; + IDXGISurface *surface; IDXGIDevice *device; + IUnknown *texture; ULONG refcount; HRESULT hr; @@ -194,7 +209,12 @@ hr = IDXGISurface_QueryInterface(surface, &IID_ID3D10Texture2D, (void **)&texture); ok(SUCCEEDED(hr), "Surface should implement ID3D10Texture2D\n"); - if (SUCCEEDED(hr)) ID3D10Texture2D_Release(texture); + IUnknown_Release(texture); + + hr = IDXGISurface_QueryInterface(surface, &IID_ID3D11Texture2D, (void **)&texture); + ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */, + "Surface should implement ID3D11Texture2D.\n"); + if (SUCCEEDED(hr)) IUnknown_Release(texture); IDXGISurface_Release(surface); refcount = IDXGIDevice_Release(device); @@ -396,7 +416,6 @@ IDXGISwapChain *swapchain; DXGI_SWAP_CHAIN_DESC creation_desc, result_desc; HRESULT hr; - WNDCLASSA wc = {0}; UINT i; const struct refresh_rates refresh_list[] = @@ -414,11 +433,6 @@ return; } - wc.lpfnWndProc = DefWindowProcA; - wc.lpszClassName = "dxgi_test_wc"; - - RegisterClassA(&wc); - creation_desc.OutputWindow = 0; creation_desc.BufferDesc.Width = 800; creation_desc.BufferDesc.Height = 600; @@ -431,7 +445,7 @@ creation_desc.SampleDesc.Quality = 0; creation_desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; creation_desc.BufferCount = 1; - creation_desc.OutputWindow = CreateWindowA("dxgi_test_wc", "dxgi_test", 0, 0, 0, 0, 0, 0, 0, 0, 0); + creation_desc.OutputWindow = CreateWindowA("static", "dxgi_test", 0, 0, 0, 0, 0, 0, 0, 0, 0); creation_desc.Windowed = TRUE; creation_desc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; creation_desc.Flags = 0; @@ -519,6 +533,7 @@ IUnknown_Release(obj); refcount = IDXGIDevice_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); + DestroyWindow(creation_desc.OutputWindow); } static void test_create_factory(void) @@ -1024,12 +1039,247 @@ DestroyWindow(window); } +static void test_swapchain_parameters(void) +{ + IDXGISwapChain *swapchain; + IUnknown *obj; + IDXGIAdapter *adapter; + IDXGIFactory *factory; + IDXGIDevice *device; + IDXGIResource *resource; + DXGI_SWAP_CHAIN_DESC desc; + HRESULT hr; + unsigned int i, j; + ULONG refcount; + DXGI_USAGE usage, expected_usage; + HWND window; + static const struct + { + BOOL windowed; + UINT buffer_count; + DXGI_SWAP_EFFECT swap_effect; + HRESULT hr, vista_hr; + UINT highest_accessible_buffer; + } + tests[] = + { + {TRUE, 0, DXGI_SWAP_EFFECT_DISCARD, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + {TRUE, 1, DXGI_SWAP_EFFECT_DISCARD, S_OK, S_OK, 0}, + {TRUE, 2, DXGI_SWAP_EFFECT_DISCARD, S_OK, S_OK, 0}, + {TRUE, 0, DXGI_SWAP_EFFECT_SEQUENTIAL, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + {TRUE, 1, DXGI_SWAP_EFFECT_SEQUENTIAL, S_OK, S_OK, 0}, + {TRUE, 2, DXGI_SWAP_EFFECT_SEQUENTIAL, S_OK, S_OK, 1}, + {TRUE, 3, DXGI_SWAP_EFFECT_SEQUENTIAL, S_OK, S_OK, 2}, + {TRUE, 0, 2 /* undefined */, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + {TRUE, 1, 2 /* undefined */, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + {TRUE, 2, 2 /* undefined */, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + {TRUE, 0, DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + {TRUE, 1, DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + {TRUE, 2, DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL, S_OK, DXGI_ERROR_INVALID_CALL, 1}, + {TRUE, 3, DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL, S_OK, DXGI_ERROR_INVALID_CALL, 2}, + {TRUE, 0, 4 /* undefined */, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + {TRUE, 1, 4 /* undefined */, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + {TRUE, 2, 4 /* undefined */, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + {TRUE, 16, DXGI_SWAP_EFFECT_DISCARD, S_OK, S_OK, 0}, + {TRUE, 16, DXGI_SWAP_EFFECT_SEQUENTIAL, S_OK, S_OK, 15}, + {TRUE, 16, DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL, S_OK, DXGI_ERROR_INVALID_CALL, 15}, + {TRUE, 17, DXGI_SWAP_EFFECT_DISCARD, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + {TRUE, 17, DXGI_SWAP_EFFECT_SEQUENTIAL, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + {TRUE, 17, DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + + {FALSE, 0, DXGI_SWAP_EFFECT_DISCARD, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + {FALSE, 1, DXGI_SWAP_EFFECT_DISCARD, S_OK, S_OK, 0}, + {FALSE, 2, DXGI_SWAP_EFFECT_DISCARD, S_OK, S_OK, 0}, + {FALSE, 0, DXGI_SWAP_EFFECT_SEQUENTIAL, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + {FALSE, 1, DXGI_SWAP_EFFECT_SEQUENTIAL, S_OK, S_OK, 0}, + {FALSE, 2, DXGI_SWAP_EFFECT_SEQUENTIAL, S_OK, S_OK, 1}, + {FALSE, 3, DXGI_SWAP_EFFECT_SEQUENTIAL, S_OK, S_OK, 2}, + {FALSE, 0, 2 /* undefined */, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + {FALSE, 1, 2 /* undefined */, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + {FALSE, 2, 2 /* undefined */, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + {FALSE, 0, DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + {FALSE, 1, DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + {FALSE, 2, DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL, S_OK, DXGI_ERROR_INVALID_CALL, 1}, + {FALSE, 3, DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL, S_OK, DXGI_ERROR_INVALID_CALL, 2}, + {FALSE, 0, 4 /* undefined */, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + {FALSE, 1, 4 /* undefined */, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + {FALSE, 2, 4 /* undefined */, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + {FALSE, 16, DXGI_SWAP_EFFECT_DISCARD, S_OK, S_OK, 0}, + {FALSE, 16, DXGI_SWAP_EFFECT_SEQUENTIAL, S_OK, S_OK, 15}, + {FALSE, 16, DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL, S_OK, DXGI_ERROR_INVALID_CALL, 15}, + {FALSE, 17, DXGI_SWAP_EFFECT_DISCARD, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + {FALSE, 17, DXGI_SWAP_EFFECT_SEQUENTIAL, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + {FALSE, 17, DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL, DXGI_ERROR_INVALID_CALL, DXGI_ERROR_INVALID_CALL, 0}, + }; + + if (!(device = create_device())) + { + skip("Failed to create device, skipping tests.\n"); + return; + } + window = CreateWindowA("static", "dxgi_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, 0, 0, 0, 0); + + hr = IDXGIDevice_QueryInterface(device, &IID_IUnknown, (void **)&obj); + ok(SUCCEEDED(hr), "IDXGIDevice does not implement IUnknown\n"); + + hr = IDXGIDevice_GetAdapter(device, &adapter); + ok(SUCCEEDED(hr), "GetAdapter failed, hr %#x.\n", hr); + + hr = IDXGIAdapter_GetParent(adapter, &IID_IDXGIFactory, (void **)&factory); + ok(SUCCEEDED(hr), "GetParent failed, hr %#x.\n", hr); + + for (i = 0; i < sizeof(tests) / sizeof(*tests); ++i) + { + memset(&desc, 0, sizeof(desc)); + desc.BufferDesc.Width = registry_mode.dmPelsWidth; + desc.BufferDesc.Height = registry_mode.dmPelsHeight; + desc.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + desc.SampleDesc.Count = 1; + desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; + desc.OutputWindow = window; + + desc.Windowed = tests[i].windowed; + desc.BufferCount = tests[i].buffer_count; + desc.SwapEffect = tests[i].swap_effect; + + hr = IDXGIFactory_CreateSwapChain(factory, obj, &desc, &swapchain); + ok(hr == tests[i].hr || broken(hr == tests[i].vista_hr) + || (SUCCEEDED(tests[i].hr) && hr == DXGI_STATUS_OCCLUDED), + "Got unexpected hr %#x, test %u.\n", hr, i); + if (FAILED(hr)) + continue; + + hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGIResource, (void **)&resource); + todo_wine ok(SUCCEEDED(hr), "GetBuffer(0) failed, hr %#x, test %u.\n", hr, i); + if (FAILED(hr)) + { + hr = IDXGISwapChain_SetFullscreenState(swapchain, FALSE, NULL); + todo_wine ok(SUCCEEDED(hr), "SetFullscreenState failed, hr %#x.\n", hr); + + IDXGISwapChain_Release(swapchain); + continue; + } + + expected_usage = DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_BACK_BUFFER; + if (tests[i].swap_effect == DXGI_SWAP_EFFECT_DISCARD) + expected_usage |= DXGI_USAGE_DISCARD_ON_PRESENT; + hr = IDXGIResource_GetUsage(resource, &usage); + ok(SUCCEEDED(hr), "Failed to get resource usage, hr %#x, test %u.\n", hr, i); + ok(usage == expected_usage, "Got usage %x, expected %x, test %u.\n", usage, expected_usage, i); + + IDXGIResource_Release(resource); + + hr = IDXGISwapChain_GetDesc(swapchain, &desc); + ok(SUCCEEDED(hr), "Failed to get swapchain desc, hr %#x.\n", hr); + + for (j = 1; j <= tests[i].highest_accessible_buffer; j++) + { + hr = IDXGISwapChain_GetBuffer(swapchain, j, &IID_IDXGIResource, (void **)&resource); + ok(SUCCEEDED(hr), "GetBuffer(%u) failed, hr %#x, test %u.\n", hr, i, j); + + expected_usage = DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_BACK_BUFFER; + + /* Buffers > 0 are supposed to be read only. This is the case except that in + * fullscreen mode the last backbuffer (BufferCount - 1) is writeable. This + * is not the case if an unsupported refresh rate is passed for some reason, + * probably because the invalid refresh rate triggers a kinda-sorta windowed + * mode. + * + * This last buffer acts as a shadow frontbuffer. Writing to it doesn't show + * the draw on the screen right away (Aero on or off doesn't matter), but + * Present with DXGI_PRESENT_DO_NOT_SEQUENCE will show the modifications. + * + * Note that if the application doesn't have focused creating a fullscreen + * swapchain returns DXGI_STATUS_OCCLUDED and we get a windowed swapchain, + * so use the Windowed property of the swapchain that was actually created. */ + if (desc.Windowed || j < tests[i].highest_accessible_buffer) + expected_usage |= DXGI_USAGE_READ_ONLY; + + hr = IDXGIResource_GetUsage(resource, &usage); + ok(SUCCEEDED(hr), "Failed to get resource usage, hr %#x, test %u, buffer %u.\n", hr, i, j); + ok(usage == expected_usage, "Got usage %x, expected %x, test %u, buffer %u.\n", + usage, expected_usage, i, j); + + IDXGIResource_Release(resource); + } + hr = IDXGISwapChain_GetBuffer(swapchain, j, &IID_IDXGIResource, (void **)&resource); + ok(hr == DXGI_ERROR_INVALID_CALL, "GetBuffer(%u) returned unexpected hr %#x, test %u.\n", j, hr, i); + + hr = IDXGISwapChain_SetFullscreenState(swapchain, FALSE, NULL); + todo_wine ok(SUCCEEDED(hr), "SetFullscreenState failed, hr %#x.\n", hr); + + IDXGISwapChain_Release(swapchain); + } + + IDXGIFactory_Release(factory); + IDXGIAdapter_Release(adapter); + IUnknown_Release(obj); + refcount = IDXGIDevice_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + DestroyWindow(window); +} + +static void test_maximum_frame_latency(void) +{ + IDXGIDevice1 *device1; + IDXGIDevice *device; + UINT max_latency; + ULONG refcount; + HRESULT hr; + + if (!(device = create_device())) + { + skip("Failed to create device.\n"); + return; + } + + if (SUCCEEDED(IDXGIDevice_QueryInterface(device, &IID_IDXGIDevice1, (void **)&device1))) + { + hr = IDXGIDevice1_GetMaximumFrameLatency(device1, &max_latency); + todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ok(max_latency == DEFAULT_FRAME_LATENCY, "Got unexpected maximum frame latency %u.\n", max_latency); + + hr = IDXGIDevice1_SetMaximumFrameLatency(device1, MAX_FRAME_LATENCY); + todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = IDXGIDevice1_GetMaximumFrameLatency(device1, &max_latency); + todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + todo_wine ok(max_latency == MAX_FRAME_LATENCY, "Got unexpected maximum frame latency %u.\n", max_latency); + + hr = IDXGIDevice1_SetMaximumFrameLatency(device1, MAX_FRAME_LATENCY + 1); + ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr); + hr = IDXGIDevice1_GetMaximumFrameLatency(device1, &max_latency); + todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + todo_wine ok(max_latency == MAX_FRAME_LATENCY, "Got unexpected maximum frame latency %u.\n", max_latency); + + hr = IDXGIDevice1_SetMaximumFrameLatency(device1, 0); + todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = IDXGIDevice1_GetMaximumFrameLatency(device1, &max_latency); + todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + /* 0 does not reset to the default frame latency on all Windows versions. */ + ok(max_latency == DEFAULT_FRAME_LATENCY || broken(!max_latency), + "Got unexpected maximum frame latency %u.\n", max_latency); + + IDXGIDevice1_Release(device1); + } + else + { + win_skip("IDXGIDevice1 is not implemented.\n"); + } + + refcount = IDXGIDevice_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + START_TEST(device) { pCreateDXGIFactory1 = (void *)GetProcAddress(GetModuleHandleA("dxgi.dll"), "CreateDXGIFactory1"); + registry_mode.dmSize = sizeof(registry_mode); + ok(EnumDisplaySettingsW(NULL, ENUM_REGISTRY_SETTINGS, ®istry_mode), "Failed to get display mode.\n"); + test_adapter_desc(); - test_device_interfaces(); + test_check_interface_support(); test_create_surface(); test_parents(); test_output(); @@ -1037,4 +1287,6 @@ test_create_factory(); test_private_data(); test_swapchain_resize(); + test_swapchain_parameters(); + test_maximum_frame_latency(); } diff -Nru wine1.7-1.7.50/dlls/dxgi/utils.c wine1.7-1.7.55/dlls/dxgi/utils.c --- wine1.7-1.7.50/dlls/dxgi/utils.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/dxgi/utils.c 2015-11-13 14:32:40.000000000 +0000 @@ -23,6 +23,7 @@ #include "dxgi_private.h" WINE_DEFAULT_DEBUG_CHANNEL(dxgi); +WINE_DECLARE_DEBUG_CHANNEL(winediag); #define WINE_DXGI_TO_STR(x) case x: return #x @@ -357,7 +358,7 @@ if (!data_size) return E_INVALIDARG; - EnterCriticalSection(&dxgi_cs); + wined3d_mutex_lock(); if (!(stored_data = wined3d_private_store_get_private_data(store, guid))) { hr = DXGI_ERROR_NOT_FOUND; @@ -384,7 +385,7 @@ hr = S_OK; done: - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); return hr; } @@ -397,22 +398,22 @@ if (!data) { - EnterCriticalSection(&dxgi_cs); + wined3d_mutex_lock(); if (!(entry = wined3d_private_store_get_private_data(store, guid))) { - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); return S_FALSE; } wined3d_private_store_free_private_data(store, entry); - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); return S_OK; } - EnterCriticalSection(&dxgi_cs); + wined3d_mutex_lock(); hr = wined3d_private_store_set_private_data(store, guid, data, data_size, 0); - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); return hr; } @@ -425,10 +426,32 @@ if (!object) return dxgi_set_private_data(store, guid, sizeof(object), &object); - EnterCriticalSection(&dxgi_cs); + wined3d_mutex_lock(); hr = wined3d_private_store_set_private_data(store, guid, object, sizeof(object), WINED3DSPD_IUNKNOWN); - LeaveCriticalSection(&dxgi_cs); + wined3d_mutex_unlock(); return hr; } + +HRESULT dxgi_check_d3d10_support(struct dxgi_factory *factory, struct dxgi_adapter *adapter) +{ + WINED3DCAPS caps; + HRESULT hr; + + FIXME("Ignoring adapter type.\n"); + + wined3d_mutex_lock(); + hr = wined3d_get_device_caps(factory->wined3d, adapter->ordinal, WINED3D_DEVICE_TYPE_HAL, &caps); + if (FAILED(hr) || caps.VertexShaderVersion < 4 || caps.PixelShaderVersion < 4) + { + FIXME_(winediag)("Direct3D 10 is not supported on this GPU with the current shader backend.\n"); + if (SUCCEEDED(hr)) + hr = E_FAIL; + wined3d_mutex_unlock(); + return hr; + } + wined3d_mutex_unlock(); + + return S_OK; +} diff -Nru wine1.7-1.7.50/dlls/esent/esent_main.c wine1.7-1.7.55/dlls/esent/esent_main.c --- wine1.7-1.7.50/dlls/esent/esent_main.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/esent/esent_main.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,37 @@ +/* + * Copyright 2015 Jacek Caban for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "windows.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(esent); + +BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) +{ + TRACE("(%p, %u, %p)\n", instance, reason, reserved); + + switch(reason) { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(instance); + break; + } + + return TRUE; +} diff -Nru wine1.7-1.7.50/dlls/esent/esent.spec wine1.7-1.7.55/dlls/esent/esent.spec --- wine1.7-1.7.50/dlls/esent/esent.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/esent/esent.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,336 @@ +@ stub DebugExtensionInitialize +@ stub DebugExtensionNotify +@ stub DebugExtensionUninitialize +@ stub JetAddColumn +@ stub JetAddColumnA +@ stub JetAddColumnW +@ stub JetAttachDatabase2 +@ stub JetAttachDatabase2A +@ stub JetAttachDatabase2W +@ stub JetAttachDatabase +@ stub JetAttachDatabaseA +@ stub JetAttachDatabaseW +@ stub JetAttachDatabaseWithStreaming +@ stub JetAttachDatabaseWithStreamingA +@ stub JetAttachDatabaseWithStreamingW +@ stub JetBackup +@ stub JetBackupA +@ stub JetBackupInstance +@ stub JetBackupInstanceA +@ stub JetBackupInstanceW +@ stub JetBackupW +@ stub JetBeginDatabaseIncrementalReseed +@ stub JetBeginDatabaseIncrementalReseedA +@ stub JetBeginDatabaseIncrementalReseedW +@ stub JetBeginExternalBackup +@ stub JetBeginExternalBackupInstance +@ stub JetBeginSession +@ stub JetBeginSessionA +@ stub JetBeginSessionW +@ stub JetBeginSurrogateBackup +@ stub JetBeginTransaction2 +@ stub JetBeginTransaction +@ stub JetCloseDatabase +@ stub JetCloseFile +@ stub JetCloseFileInstance +@ stub JetCloseTable +@ stub JetCommitTransaction +@ stub JetCompact +@ stub JetCompactA +@ stub JetCompactW +@ stub JetComputeStats +@ stub JetConfigureProcessForCrashDump +@ stub JetConvertDDL +@ stub JetConvertDDLA +@ stub JetConvertDDLW +@ stub JetCreateDatabase2 +@ stub JetCreateDatabase2A +@ stub JetCreateDatabase2W +@ stub JetCreateDatabase +@ stub JetCreateDatabaseA +@ stub JetCreateDatabaseW +@ stub JetCreateDatabaseWithStreaming +@ stub JetCreateDatabaseWithStreamingA +@ stub JetCreateDatabaseWithStreamingW +@ stub JetCreateIndex2 +@ stub JetCreateIndex2A +@ stub JetCreateIndex2W +@ stub JetCreateIndex3A +@ stub JetCreateIndex3W +@ stub JetCreateIndex +@ stub JetCreateIndexA +@ stub JetCreateIndexW +@ stub JetCreateInstance2 +@ stub JetCreateInstance2A +@ stub JetCreateInstance2W +@ stub JetCreateInstance +@ stub JetCreateInstanceA +@ stub JetCreateInstanceW +@ stub JetCreateTable +@ stub JetCreateTableA +@ stub JetCreateTableColumnIndex2 +@ stub JetCreateTableColumnIndex2A +@ stub JetCreateTableColumnIndex2W +@ stub JetCreateTableColumnIndex3A +@ stub JetCreateTableColumnIndex3W +@ stub JetCreateTableColumnIndex +@ stub JetCreateTableColumnIndexA +@ stub JetCreateTableColumnIndexW +@ stub JetCreateTableW +@ stub JetDBUtilities +@ stub JetDBUtilitiesA +@ stub JetDBUtilitiesW +@ stub JetDatabaseScan +@ stub JetDefragment2 +@ stub JetDefragment2A +@ stub JetDefragment2W +@ stub JetDefragment3 +@ stub JetDefragment3A +@ stub JetDefragment3W +@ stub JetDefragment +@ stub JetDefragmentA +@ stub JetDefragmentW +@ stub JetDelete +@ stub JetDeleteColumn2 +@ stub JetDeleteColumn2A +@ stub JetDeleteColumn2W +@ stub JetDeleteColumn +@ stub JetDeleteColumnA +@ stub JetDeleteColumnW +@ stub JetDeleteIndex +@ stub JetDeleteIndexA +@ stub JetDeleteIndexW +@ stub JetDeleteTable +@ stub JetDeleteTableA +@ stub JetDeleteTableW +@ stub JetDetachDatabase2 +@ stub JetDetachDatabase2A +@ stub JetDetachDatabase2W +@ stub JetDetachDatabase +@ stub JetDetachDatabaseA +@ stub JetDetachDatabaseW +@ stub JetDupCursor +@ stub JetDupSession +@ stub JetEnableFaultInjection +@ stub JetEnableMultiInstance +@ stub JetEnableMultiInstanceA +@ stub JetEnableMultiInstanceW +@ stub JetEndDatabaseIncrementalReseed +@ stub JetEndDatabaseIncrementalReseedA +@ stub JetEndDatabaseIncrementalReseedW +@ stub JetEndExternalBackup +@ stub JetEndExternalBackupInstance2 +@ stub JetEndExternalBackupInstance +@ stub JetEndSession +@ stub JetEndSurrogateBackup +@ stub JetEnumerateColumns +@ stub JetEscrowUpdate +@ stub JetExternalRestore2 +@ stub JetExternalRestore2A +@ stub JetExternalRestore2W +@ stub JetExternalRestore +@ stub JetExternalRestoreA +@ stub JetExternalRestoreW +@ stub JetFreeBuffer +@ stub JetGetAttachInfo +@ stub JetGetAttachInfoA +@ stub JetGetAttachInfoInstance +@ stub JetGetAttachInfoInstanceA +@ stub JetGetAttachInfoInstanceW +@ stub JetGetAttachInfoW +@ stub JetGetBookmark +@ stub JetGetColumnInfo +@ stub JetGetColumnInfoA +@ stub JetGetColumnInfoW +@ stub JetGetCounter +@ stub JetGetCurrentIndex +@ stub JetGetCurrentIndexA +@ stub JetGetCurrentIndexW +@ stub JetGetCursorInfo +@ stub JetGetDatabaseFileInfo +@ stub JetGetDatabaseFileInfoA +@ stub JetGetDatabaseFileInfoW +@ stub JetGetDatabaseInfo +@ stub JetGetDatabaseInfoA +@ stub JetGetDatabaseInfoW +@ stub JetGetDatabasePages +@ stub JetGetIndexInfo +@ stub JetGetIndexInfoA +@ stub JetGetIndexInfoW +@ stub JetGetInstanceInfo +@ stub JetGetInstanceInfoA +@ stub JetGetInstanceInfoW +@ stub JetGetInstanceMiscInfo +@ stub JetGetLS +@ stub JetGetLock +@ stub JetGetLogFileInfo +@ stub JetGetLogFileInfoA +@ stub JetGetLogFileInfoW +@ stub JetGetLogInfo +@ stub JetGetLogInfoA +@ stub JetGetLogInfoInstance2 +@ stub JetGetLogInfoInstance2A +@ stub JetGetLogInfoInstance2W +@ stub JetGetLogInfoInstance +@ stub JetGetLogInfoInstanceA +@ stub JetGetLogInfoInstanceW +@ stub JetGetLogInfoW +@ stub JetGetMaxDatabaseSize +@ stub JetGetObjectInfo +@ stub JetGetObjectInfoA +@ stub JetGetObjectInfoW +@ stub JetGetPageInfo2 +@ stub JetGetPageInfo +@ stub JetGetRecordPosition +@ stub JetGetRecordSize2 +@ stub JetGetRecordSize +@ stub JetGetResourceParam +@ stub JetGetSecondaryIndexBookmark +@ stub JetGetSessionInfo +@ stub JetGetSystemParameter +@ stub JetGetSystemParameterA +@ stub JetGetSystemParameterW +@ stub JetGetTableColumnInfo +@ stub JetGetTableColumnInfoA +@ stub JetGetTableColumnInfoW +@ stub JetGetTableIndexInfo +@ stub JetGetTableIndexInfoA +@ stub JetGetTableIndexInfoW +@ stub JetGetTableInfo +@ stub JetGetTableInfoA +@ stub JetGetTableInfoW +@ stub JetGetThreadStats +@ stub JetGetTruncateLogInfoInstance +@ stub JetGetTruncateLogInfoInstanceA +@ stub JetGetTruncateLogInfoInstanceW +@ stub JetGetVersion +@ stub JetGotoBookmark +@ stub JetGotoPosition +@ stub JetGotoSecondaryIndexBookmark +@ stub JetGrowDatabase +@ stub JetIdle +@ stub JetIndexRecordCount +@ stub JetInit2 +@ stub JetInit3 +@ stub JetInit3A +@ stub JetInit3W +@ stub JetInit +@ stub JetIntersectIndexes +@ stub JetMakeKey +@ stub JetMove +@ stub JetOSSnapshotAbort +@ stub JetOSSnapshotEnd +@ stub JetOSSnapshotFreeze +@ stub JetOSSnapshotFreezeA +@ stub JetOSSnapshotFreezeW +@ stub JetOSSnapshotGetFreezeInfo +@ stub JetOSSnapshotGetFreezeInfoA +@ stub JetOSSnapshotGetFreezeInfoW +@ stub JetOSSnapshotPrepare +@ stub JetOSSnapshotPrepareInstance +@ stub JetOSSnapshotThaw +@ stub JetOSSnapshotTruncateLog +@ stub JetOSSnapshotTruncateLogInstance +@ stub JetOpenDatabase +@ stub JetOpenDatabaseA +@ stub JetOpenDatabaseW +@ stub JetOpenFile +@ stub JetOpenFileA +@ stub JetOpenFileInstance +@ stub JetOpenFileInstanceA +@ stub JetOpenFileInstanceW +@ stub JetOpenFileSectionInstance +@ stub JetOpenFileSectionInstanceA +@ stub JetOpenFileSectionInstanceW +@ stub JetOpenFileW +@ stub JetOpenTable +@ stub JetOpenTableA +@ stub JetOpenTableW +@ stub JetOpenTempTable2 +@ stub JetOpenTempTable3 +@ stub JetOpenTempTable +@ stub JetOpenTemporaryTable +@ stub JetPatchDatabasePages +@ stub JetPatchDatabasePagesA +@ stub JetPatchDatabasePagesW +@ stub JetPrepareToCommitTransaction +@ stub JetPrepareUpdate +@ stub JetPrereadKeys +@ stub JetReadFile +@ stub JetReadFileInstance +@ stub JetRegisterCallback +@ stub JetRemoveLogfileA +@ stub JetRemoveLogfileW +@ stub JetRenameColumn +@ stub JetRenameColumnA +@ stub JetRenameColumnW +@ stub JetRenameTable +@ stub JetRenameTableA +@ stub JetRenameTableW +@ stub JetResetCounter +@ stub JetResetSessionContext +@ stub JetResetTableSequential +@ stub JetRestore2 +@ stub JetRestore2A +@ stub JetRestore2W +@ stub JetRestore +@ stub JetRestoreA +@ stub JetRestoreInstance +@ stub JetRestoreInstanceA +@ stub JetRestoreInstanceW +@ stub JetRestoreW +@ stub JetRetrieveColumn +@ stub JetRetrieveColumns +@ stub JetRetrieveKey +@ stub JetRetrieveTaggedColumnList +@ stub JetRollback +@ stub JetSeek +@ stub JetSetColumn +@ stub JetSetColumnDefaultValue +@ stub JetSetColumnDefaultValueA +@ stub JetSetColumnDefaultValueW +@ stub JetSetColumns +@ stub JetSetCurrentIndex2 +@ stub JetSetCurrentIndex2A +@ stub JetSetCurrentIndex2W +@ stub JetSetCurrentIndex3 +@ stub JetSetCurrentIndex3A +@ stub JetSetCurrentIndex3W +@ stub JetSetCurrentIndex4 +@ stub JetSetCurrentIndex4A +@ stub JetSetCurrentIndex4W +@ stub JetSetCurrentIndex +@ stub JetSetCurrentIndexA +@ stub JetSetCurrentIndexW +@ stub JetSetDatabaseSize +@ stub JetSetDatabaseSizeA +@ stub JetSetDatabaseSizeW +@ stub JetSetIndexRange +@ stub JetSetLS +@ stub JetSetMaxDatabaseSize +@ stub JetSetResourceParam +@ stub JetSetSessionContext +@ stub JetSetSystemParameter +@ stub JetSetSystemParameterA +@ stub JetSetSystemParameterW +@ stub JetSetTableSequential +@ stub JetSnapshotStart +@ stub JetSnapshotStartA +@ stub JetSnapshotStartW +@ stub JetSnapshotStop +@ stub JetStopBackup +@ stub JetStopBackupInstance +@ stub JetStopService +@ stub JetStopServiceInstance +@ stub JetTerm2 +@ stub JetTerm +@ stub JetTest +@ stub JetTracing +@ stub JetTruncateLog +@ stub JetTruncateLogInstance +@ stub JetUnregisterCallback +@ stub JetUpdate2 +@ stub JetUpdate +@ stub JetUpgradeDatabase +@ stub JetUpgradeDatabaseA +@ stub JetUpgradeDatabaseW diff -Nru wine1.7-1.7.50/dlls/esent/Makefile.in wine1.7-1.7.55/dlls/esent/Makefile.in --- wine1.7-1.7.50/dlls/esent/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/esent/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,4 @@ +MODULE = esent.dll + +C_SRCS = \ + esent_main.c diff -Nru wine1.7-1.7.50/dlls/explorerframe/nstc.c wine1.7-1.7.55/dlls/explorerframe/nstc.c --- wine1.7-1.7.50/dlls/explorerframe/nstc.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/explorerframe/nstc.c 2015-11-13 14:32:40.000000000 +0000 @@ -686,9 +686,9 @@ psi = shellitem_from_treeitem(This, tvhit.hItem); hr = events_OnItemClick(This, psi, tvhit.flags, NSTCECT_LBUTTON); - /* The expando should not be expanded unless + /* The label should not be expanded unless * double-clicked. */ - if(tvhit.flags == TVHT_ONITEMBUTTON) + if(tvhit.flags == TVHT_ONITEMLABEL) return TRUE; if(SUCCEEDED(hr)) diff -Nru wine1.7-1.7.50/dlls/fltmgr.sys/fltmgr.sys.spec wine1.7-1.7.55/dlls/fltmgr.sys/fltmgr.sys.spec --- wine1.7-1.7.50/dlls/fltmgr.sys/fltmgr.sys.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/fltmgr.sys/fltmgr.sys.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,163 @@ +@ stub FltAcquirePushLockExclusive +@ stub FltAcquirePushLockShared +@ stub FltAcquireResourceExclusive +@ stub FltAcquireResourceShared +@ stub FltAllocateCallbackData +@ stub FltAllocateContext +@ stub FltAllocateDeferredIoWorkItem +@ stub FltAllocateFileLock +@ stub FltAllocateGenericWorkItem +@ stub FltAllocatePoolAlignedWithTag +@ stub FltAttachVolume +@ stub FltAttachVolumeAtAltitude +@ stub FltBuildDefaultSecurityDescriptor +@ stub FltCancelFileOpen +@ stub FltCancelIo +@ stub FltCbdqDisable +@ stub FltCbdqEnable +@ stub FltCbdqInitialize +@ stub FltCbdqInsertIo +@ stub FltCbdqRemoveIo +@ stub FltCbdqRemoveNextIo +@ stub FltCheckAndGrowNameControl +@ stub FltCheckLockForReadAccess +@ stub FltCheckLockForWriteAccess +@ stub FltCheckOplock +@ stub FltClearCallbackDataDirty +@ stub FltClearCancelCompletion +@ stub FltClose +@ stub FltCloseClientPort +@ stub FltCloseCommunicationPort +@ stub FltCompareInstanceAltitudes +@ stub FltCompletePendedPostOperation +@ stub FltCompletePendedPreOperation +@ stub FltCreateCommunicationPort +@ stub FltCreateFile +@ stub FltCreateFileEx +@ stub FltCreateSystemVolumeInformationFolder +@ stub FltCurrentBatchOplock +@ stub FltDecodeParameters +@ stub FltDeleteContext +@ stub FltDeleteFileContext +@ stub FltDeleteInstanceContext +@ stub FltDeletePushLock +@ stub FltDeleteStreamContext +@ stub FltDeleteStreamHandleContext +@ stub FltDeleteVolumeContext +@ stub FltDetachVolume +@ stub FltDeviceIoControlFile +@ stub FltDoCompletionProcessingWhenSafe +@ stub FltEnumerateFilterInformation +@ stub FltEnumerateFilters +@ stub FltEnumerateInstanceInformationByFilter +@ stub FltEnumerateInstanceInformationByVolume +@ stub FltEnumerateInstances +@ stub FltEnumerateVolumeInformation +@ stub FltEnumerateVolumes +@ stub FltFlushBuffers +@ stub FltFreeCallbackData +@ stub FltFreeDeferredIoWorkItem +@ stub FltFreeFileLock +@ stub FltFreeGenericWorkItem +@ stub FltFreePoolAlignedWithTag +@ stub FltFreeSecurityDescriptor +@ stub FltFsControlFile +@ stub FltGetBottomInstance +@ stub FltGetContexts +@ stub FltGetDestinationFileNameInformation +@ stub FltGetDeviceObject +@ stub FltGetDiskDeviceObject +@ stub FltGetFileContext +@ stub FltGetFileNameInformation +@ stub FltGetFileNameInformationUnsafe +@ stub FltGetFilterFromInstance +@ stub FltGetFilterFromName +@ stub FltGetFilterInformation +@ stub FltGetInstanceContext +@ stub FltGetInstanceInformation +@ stub FltGetIrpName +@ stub FltGetLowerInstance +@ stub FltGetRequestorProcess +@ stub FltGetRequestorProcessId +@ stub FltGetRoutineAddress +@ stub FltGetStreamContext +@ stub FltGetStreamHandleContext +@ stub FltGetSwappedBufferMdlAddress +@ stub FltGetTopInstance +@ stub FltGetTunneledName +@ stub FltGetUpperInstance +@ stub FltGetVolumeContext +@ stub FltGetVolumeFromDeviceObject +@ stub FltGetVolumeFromFileObject +@ stub FltGetVolumeFromInstance +@ stub FltGetVolumeFromName +@ stub FltGetVolumeGuidName +@ stub FltGetVolumeInstanceFromName +@ stub FltGetVolumeName +@ stub FltGetVolumeProperties +@ stub FltInitializeFileLock +@ stub FltInitializeOplock +@ stdcall FltInitializePushLock(ptr) +@ stub FltIs32bitProcess +@ stub FltIsCallbackDataDirty +@ stub FltIsDirectory +@ stub FltIsIoCanceled +@ stub FltIsOperationSynchronous +@ stub FltIsVolumeWritable +@ stub FltLoadFilter +@ stub FltLockUserBuffer +@ stub FltNotifyFilterChangeDirectory +@ stub FltObjectDereference +@ stub FltObjectReference +@ stub FltOpenVolume +@ stub FltOplockFsctrl +@ stub FltOplockIsFastIoPossible +@ stub FltParseFileName +@ stub FltParseFileNameInformation +@ stub FltPerformAsynchronousIo +@ stub FltPerformSynchronousIo +@ stub FltProcessFileLock +@ stub FltPurgeFileNameInformationCache +@ stub FltQueryEaFile +@ stub FltQueryInformationFile +@ stub FltQuerySecurityObject +@ stub FltQueryVolumeInformation +@ stub FltQueryVolumeInformationFile +@ stub FltQueueDeferredIoWorkItem +@ stub FltQueueGenericWorkItem +@ stub FltReadFile +@ stub FltReferenceContext +@ stub FltReferenceFileNameInformation +@ stub FltRegisterFilter +@ stub FltReissueSynchronousIo +@ stub FltReleaseContext +@ stub FltReleaseContexts +@ stub FltReleaseFileNameInformation +@ stub FltReleasePushLock +@ stub FltReleaseResource +@ stub FltRequestOperationStatusCallback +@ stub FltRetainSwappedBufferMdlAddress +@ stub FltReuseCallbackData +@ stub FltSendMessage +@ stub FltSetCallbackDataDirty +@ stub FltSetCancelCompletion +@ stub FltSetEaFile +@ stub FltSetFileContext +@ stub FltSetInformationFile +@ stub FltSetInstanceContext +@ stub FltSetSecurityObject +@ stub FltSetStreamContext +@ stub FltSetStreamHandleContext +@ stub FltSetVolumeContext +@ stub FltSetVolumeInformation +@ stub FltStartFiltering +@ stub FltSupportsFileContexts +@ stub FltSupportsStreamContexts +@ stub FltSupportsStreamHandleContexts +@ stub FltTagFile +@ stub FltUninitializeFileLock +@ stub FltUninitializeOplock +@ stub FltUnloadFilter +@ stub FltUnregisterFilter +@ stub FltUntagFile +@ stub FltWriteFile diff -Nru wine1.7-1.7.50/dlls/fltmgr.sys/main.c wine1.7-1.7.55/dlls/fltmgr.sys/main.c --- wine1.7-1.7.50/dlls/fltmgr.sys/main.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/fltmgr.sys/main.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,45 @@ +/* + * fltmgr.sys + * + * Copyright 2015 Austin English + * + * 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 "ntstatus.h" +#define WIN32_NO_STATUS +#include "windef.h" +#include "winbase.h" +#include "winternl.h" +#include "ddk/ntddk.h" +#include "ddk/ntifs.h" +#include "ddk/wdm.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(fltmgr); + +NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path ) +{ + TRACE( "(%p, %s)\n", driver, debugstr_w(path->Buffer) ); + + return STATUS_SUCCESS; +} + +void WINAPI FltInitializePushLock( EX_PUSH_LOCK *lock ) +{ + FIXME( "(%p): stub\n", lock ); +} diff -Nru wine1.7-1.7.50/dlls/fltmgr.sys/Makefile.in wine1.7-1.7.55/dlls/fltmgr.sys/Makefile.in --- wine1.7-1.7.50/dlls/fltmgr.sys/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/fltmgr.sys/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,5 @@ +MODULE = fltmgr.sys +EXTRADLLFLAGS = -Wb,--subsystem,native + +C_SRCS = \ + main.c diff -Nru wine1.7-1.7.50/dlls/gameux/gamestatistics.c wine1.7-1.7.55/dlls/gameux/gamestatistics.c --- wine1.7-1.7.50/dlls/gameux/gamestatistics.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gameux/gamestatistics.c 2015-11-13 14:32:40.000000000 +0000 @@ -264,7 +264,7 @@ } if(SUCCEEDED(hr)) - hr = IXMLDOMNode_appendChild(categoryNode, statisticsNode, &statisticsNode); + hr = IXMLDOMNode_appendChild(categoryNode, statisticsNode, NULL); IXMLDOMElement_Release(statisticsElement); IXMLDOMNode_Release(statisticsNode); @@ -578,6 +578,8 @@ } } + IXMLDOMNodeList_Release(categoryChildren); + if(SUCCEEDED(hr)) hr = S_OK; } diff -Nru wine1.7-1.7.50/dlls/gdi32/bitblt.c wine1.7-1.7.55/dlls/gdi32/bitblt.c --- wine1.7-1.7.50/dlls/gdi32/bitblt.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdi32/bitblt.c 2015-11-13 14:32:40.000000000 +0000 @@ -224,20 +224,21 @@ /* helper to retrieve either both colors or only the background color for monochrome blits */ static void get_mono_dc_colors( HDC hdc, BITMAPINFO *info, int count ) { + RGBQUAD *colors = info->bmiColors; COLORREF color = GetBkColor( hdc ); - info->bmiColors[count - 1].rgbRed = GetRValue( color ); - info->bmiColors[count - 1].rgbGreen = GetGValue( color ); - info->bmiColors[count - 1].rgbBlue = GetBValue( color ); - info->bmiColors[count - 1].rgbReserved = 0; + colors[count - 1].rgbRed = GetRValue( color ); + colors[count - 1].rgbGreen = GetGValue( color ); + colors[count - 1].rgbBlue = GetBValue( color ); + colors[count - 1].rgbReserved = 0; if (count > 1) { color = GetTextColor( hdc ); - info->bmiColors[0].rgbRed = GetRValue( color ); - info->bmiColors[0].rgbGreen = GetGValue( color ); - info->bmiColors[0].rgbBlue = GetBValue( color ); - info->bmiColors[0].rgbReserved = 0; + colors[0].rgbRed = GetRValue( color ); + colors[0].rgbGreen = GetGValue( color ); + colors[0].rgbBlue = GetBValue( color ); + colors[0].rgbReserved = 0; } info->bmiHeader.biClrUsed = count; } @@ -558,8 +559,8 @@ /*********************************************************************** * BitBlt (GDI32.@) */ -BOOL WINAPI BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width, - INT height, HDC hdcSrc, INT xSrc, INT ySrc, DWORD rop ) +BOOL WINAPI DECLSPEC_HOTPATCH BitBlt( HDC hdcDst, INT xDst, INT yDst, INT width, + INT height, HDC hdcSrc, INT xSrc, INT ySrc, DWORD rop ) { if (!rop_uses_src( rop )) return PatBlt( hdcDst, xDst, yDst, width, height, rop ); else return StretchBlt( hdcDst, xDst, yDst, width, height, @@ -799,6 +800,7 @@ /* combine both using the mask as a pattern brush */ SelectObject(hDC2, hbrMask); + SetBrushOrgEx(hDC2, -xMask, -yMask, NULL); BitBlt(hDC2, 0, 0, nWidth, nHeight, hDC1, 0, 0, 0xac0744 ); /* (D & P) | (S & ~P) */ SelectObject(hDC2, hbrTmp); diff -Nru wine1.7-1.7.50/dlls/gdi32/dib.c wine1.7-1.7.55/dlls/gdi32/dib.c --- wine1.7-1.7.50/dlls/gdi32/dib.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdi32/dib.c 2015-11-13 14:32:40.000000000 +0000 @@ -59,6 +59,8 @@ Search for "Bitmap Structures" in MSDN */ +#include "config.h" + #include #include #include @@ -602,9 +604,10 @@ /*********************************************************************** * StretchDIBits (GDI32.@) */ -INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst, INT heightDst, - INT xSrc, INT ySrc, INT widthSrc, INT heightSrc, const void *bits, - const BITMAPINFO *bmi, UINT coloruse, DWORD rop ) +INT WINAPI DECLSPEC_HOTPATCH StretchDIBits( HDC hdc, INT xDst, INT yDst, INT widthDst, INT heightDst, + INT xSrc, INT ySrc, INT widthSrc, INT heightSrc, + const void *bits, const BITMAPINFO *bmi, UINT coloruse, + DWORD rop ) { char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )]; BITMAPINFO *info = (BITMAPINFO *)buffer; diff -Nru wine1.7-1.7.50/dlls/gdi32/dibdrv/dc.c wine1.7-1.7.55/dlls/gdi32/dibdrv/dc.c --- wine1.7-1.7.50/dlls/gdi32/dibdrv/dc.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdi32/dibdrv/dc.c 2015-11-13 14:32:40.000000000 +0000 @@ -429,7 +429,6 @@ NULL, /* pFontIsLinked */ NULL, /* pFrameRgn */ NULL, /* pGdiComment */ - NULL, /* pGdiRealizationInfo */ NULL, /* pGetBoundsRect */ NULL, /* pGetCharABCWidths */ NULL, /* pGetCharABCWidthsI */ @@ -437,6 +436,7 @@ NULL, /* pGetDeviceCaps */ NULL, /* pGetDeviceGammaRamp */ NULL, /* pGetFontData */ + NULL, /* pGetFontRealizationInfo */ NULL, /* pGetFontUnicodeRanges */ NULL, /* pGetGlyphIndices */ NULL, /* pGetGlyphOutline */ @@ -1049,7 +1049,6 @@ NULL, /* pFontIsLinked */ NULL, /* pFrameRgn */ NULL, /* pGdiComment */ - NULL, /* pGdiRealizationInfo */ NULL, /* pGetBoundsRect */ NULL, /* pGetCharABCWidths */ NULL, /* pGetCharABCWidthsI */ @@ -1057,6 +1056,7 @@ NULL, /* pGetDeviceCaps */ NULL, /* pGetDeviceGammaRamp */ NULL, /* pGetFontData */ + NULL, /* pGetFontRealizationInfo */ NULL, /* pGetFontUnicodeRanges */ NULL, /* pGetGlyphIndices */ NULL, /* pGetGlyphOutline */ diff -Nru wine1.7-1.7.50/dlls/gdi32/driver.c wine1.7-1.7.55/dlls/gdi32/driver.c --- wine1.7-1.7.50/dlls/gdi32/driver.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdi32/driver.c 2015-11-13 14:32:40.000000000 +0000 @@ -276,11 +276,6 @@ return FALSE; } -static BOOL nulldrv_GdiRealizationInfo( PHYSDEV dev, void *info ) -{ - return FALSE; -} - static UINT nulldrv_GetBoundsRect( PHYSDEV dev, RECT *rect, UINT flags ) { return DCB_RESET; @@ -334,6 +329,11 @@ return FALSE; } +static BOOL nulldrv_GetFontRealizationInfo( PHYSDEV dev, void *info ) +{ + return FALSE; +} + static DWORD nulldrv_GetFontUnicodeRanges( PHYSDEV dev, LPGLYPHSET glyphs ) { return 0; @@ -371,11 +371,6 @@ return 0; } -static UINT nulldrv_GetSystemPaletteEntries( PHYSDEV dev, UINT start, UINT count, PALETTEENTRY *entries ) -{ - return 0; -} - static UINT nulldrv_GetTextCharsetInfo( PHYSDEV dev, LPFONTSIGNATURE fs, DWORD flags ) { return DEFAULT_CHARSET; @@ -668,7 +663,6 @@ nulldrv_FontIsLinked, /* pFontIsLinked */ nulldrv_FrameRgn, /* pFrameRgn */ nulldrv_GdiComment, /* pGdiComment */ - nulldrv_GdiRealizationInfo, /* pGdiRealizationInfo */ nulldrv_GetBoundsRect, /* pGetBoundsRect */ nulldrv_GetCharABCWidths, /* pGetCharABCWidths */ nulldrv_GetCharABCWidthsI, /* pGetCharABCWidthsI */ @@ -676,6 +670,7 @@ nulldrv_GetDeviceCaps, /* pGetDeviceCaps */ nulldrv_GetDeviceGammaRamp, /* pGetDeviceGammaRamp */ nulldrv_GetFontData, /* pGetFontData */ + nulldrv_GetFontRealizationInfo, /* pGetFontRealizationInfo */ nulldrv_GetFontUnicodeRanges, /* pGetFontUnicodeRanges */ nulldrv_GetGlyphIndices, /* pGetGlyphIndices */ nulldrv_GetGlyphOutline, /* pGetGlyphOutline */ diff -Nru wine1.7-1.7.50/dlls/gdi32/enhmfdrv/init.c wine1.7-1.7.55/dlls/gdi32/enhmfdrv/init.c --- wine1.7-1.7.50/dlls/gdi32/enhmfdrv/init.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdi32/enhmfdrv/init.c 2015-11-13 14:32:40.000000000 +0000 @@ -69,7 +69,6 @@ NULL, /* pFontIsLinked */ EMFDRV_FrameRgn, /* pFrameRgn */ EMFDRV_GdiComment, /* pGdiComment */ - NULL, /* pGdiRealizationInfo */ NULL, /* pGetBoundsRect */ NULL, /* pGetCharABCWidths */ NULL, /* pGetCharABCWidthsI */ @@ -77,6 +76,7 @@ EMFDRV_GetDeviceCaps, /* pGetDeviceCaps */ NULL, /* pGetDeviceGammaRamp */ NULL, /* pGetFontData */ + NULL, /* pGetFontRealizationInfo */ NULL, /* pGetFontUnicodeRanges */ NULL, /* pGetGlyphIndices */ NULL, /* pGetGlyphOutline */ diff -Nru wine1.7-1.7.50/dlls/gdi32/font.c wine1.7-1.7.55/dlls/gdi32/font.c --- wine1.7-1.7.50/dlls/gdi32/font.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdi32/font.c 2015-11-13 14:32:40.000000000 +0000 @@ -3846,19 +3846,51 @@ } /************************************************************* - * GdiRealizationInfo (GDI32.@) - * - * Returns a structure that contains some font information. + * GetFontRealizationInfo (GDI32.@) */ -BOOL WINAPI GdiRealizationInfo(HDC hdc, realization_info_t *info) +BOOL WINAPI GetFontRealizationInfo(HDC hdc, struct font_realization_info *info) { - DC *dc = get_dc_ptr(hdc); + BOOL is_v0 = info->size == FIELD_OFFSET(struct font_realization_info, unk); PHYSDEV dev; BOOL ret; + DC *dc; + if (info->size != sizeof(*info) && !is_v0) + return FALSE; + + dc = get_dc_ptr(hdc); if (!dc) return FALSE; - dev = GET_DC_PHYSDEV( dc, pGdiRealizationInfo ); - ret = dev->funcs->pGdiRealizationInfo( dev, info ); + dev = GET_DC_PHYSDEV( dc, pGetFontRealizationInfo ); + ret = dev->funcs->pGetFontRealizationInfo( dev, info ); release_dc_ptr(dc); return ret; } + +struct realization_info +{ + DWORD flags; /* 1 for bitmap fonts, 3 for scalable fonts */ + DWORD cache_num; /* keeps incrementing - num of fonts that have been created allowing for caching?? */ + DWORD instance_id; /* identifies a realized font instance */ +}; + +/************************************************************* + * GdiRealizationInfo (GDI32.@) + * + * Returns a structure that contains some font information. + */ +BOOL WINAPI GdiRealizationInfo(HDC hdc, struct realization_info *info) +{ + struct font_realization_info ri; + BOOL ret; + + ri.size = sizeof(ri); + ret = GetFontRealizationInfo( hdc, &ri ); + if (ret) + { + info->flags = ri.flags; + info->cache_num = ri.cache_num; + info->instance_id = ri.instance_id; + } + + return ret; +} diff -Nru wine1.7-1.7.50/dlls/gdi32/freetype.c wine1.7-1.7.55/dlls/gdi32/freetype.c --- wine1.7-1.7.50/dlls/gdi32/freetype.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdi32/freetype.c 2015-11-13 14:32:40.000000000 +0000 @@ -296,12 +296,80 @@ typedef struct tagGdiFont GdiFont; +#define FIRST_FONT_HANDLE 1 +#define MAX_FONT_HANDLES 256 + +struct font_handle_entry +{ + void *obj; + WORD generation; /* generation count for reusing handle values */ +}; + +static struct font_handle_entry font_handles[MAX_FONT_HANDLES]; +static struct font_handle_entry *next_free; +static struct font_handle_entry *next_unused = font_handles; + +static inline DWORD entry_to_handle( struct font_handle_entry *entry ) +{ + unsigned int idx = entry - font_handles + FIRST_FONT_HANDLE; + return idx | (entry->generation << 16); +} + +static inline struct font_handle_entry *handle_entry( DWORD handle ) +{ + unsigned int idx = LOWORD(handle) - FIRST_FONT_HANDLE; + + if (idx < MAX_FONT_HANDLES) + { + if (!HIWORD( handle ) || HIWORD( handle ) == font_handles[idx].generation) + return &font_handles[idx]; + } + if (handle) WARN( "invalid handle 0x%08x\n", handle ); + return NULL; +} + +static DWORD alloc_font_handle( void *obj ) +{ + struct font_handle_entry *entry; + + entry = next_free; + if (entry) + next_free = entry->obj; + else if (next_unused < font_handles + MAX_FONT_HANDLES) + entry = next_unused++; + else + { + ERR( "out of realized font handles\n" ); + return 0; + } + entry->obj = obj; + if (++entry->generation == 0xffff) entry->generation = 1; + return entry_to_handle( entry ); +} + +static void free_font_handle( DWORD handle ) +{ + struct font_handle_entry *entry; + + if ((entry = handle_entry( handle ))) + { + entry->obj = next_free; + next_free = entry; + } +} + typedef struct { struct list entry; Face *face; GdiFont *font; } CHILD_FONT; +struct font_fileinfo { + FILETIME writetime; + LARGE_INTEGER size; + WCHAR path[1]; +}; + struct tagGdiFont { struct list entry; struct list unused_entry; @@ -337,6 +405,8 @@ VOID *GSUB_Table; const VOID *vert_feature; DWORD cache_num; + DWORD instance_id; + struct font_fileinfo *fileinfo; }; typedef struct { @@ -503,6 +573,7 @@ static UINT default_aa_flags; static HKEY hkey_font_cache; +static BOOL antialias_fakes = TRUE; static CRITICAL_SECTION freetype_cs; static CRITICAL_SECTION_DEBUG critsect_debug = @@ -3768,6 +3839,82 @@ RegDeleteTreeA(HKEY_LOCAL_MACHINE, font_assoc_reg_key); } +static void set_multi_value_key(HKEY hkey, const WCHAR *name, const WCHAR *value, DWORD len) +{ + if (value) + RegSetValueExW(hkey, name, 0, REG_MULTI_SZ, (const BYTE *)value, len); + else if (name) + RegDeleteValueW(hkey, name); +} + +static void update_font_system_link_info(UINT current_ansi_codepage) +{ + static const WCHAR system_link_simplified_chinese[] = + {'S','I','M','S','U','N','.','T','T','C',',','S','i','m','S','u','n','\0', + 'M','I','N','G','L','I','U','.','T','T','C',',','P','M','i','n','g','L','i','u','\0', + 'M','S','G','O','T','H','I','C','.','T','T','C',',','M','S',' ','U','I',' ','G','o','t','h','i','c','\0', + 'B','A','T','A','N','G','.','T','T','C',',','B','a','t','a','n','g','\0', + '\0'}; + static const WCHAR system_link_traditional_chinese[] = + {'M','I','N','G','L','I','U','.','T','T','C',',','P','M','i','n','g','L','i','u','\0', + 'S','I','M','S','U','N','.','T','T','C',',','S','i','m','S','u','n','\0', + 'M','S','G','O','T','H','I','C','.','T','T','C',',','M','S',' ','U','I',' ','G','o','t','h','i','c','\0', + 'B','A','T','A','N','G','.','T','T','C',',','B','a','t','a','n','g','\0', + '\0'}; + static const WCHAR system_link_japanese[] = + {'M','S','G','O','T','H','I','C','.','T','T','C',',','M','S',' ','U','I',' ','G','o','t','h','i','c','\0', + 'M','I','N','G','L','I','U','.','T','T','C',',','P','M','i','n','g','L','i','U','\0', + 'S','I','M','S','U','N','.','T','T','C',',','S','i','m','S','u','n','\0', + 'G','U','L','I','M','.','T','T','C',',','G','u','l','i','m','\0', + '\0'}; + static const WCHAR system_link_korean[] = + {'G','U','L','I','M','.','T','T','C',',','G','u','l','i','m','\0', + 'M','S','G','O','T','H','I','C','.','T','T','C',',','M','S',' ','U','I',' ','G','o','t','h','i','c','\0', + 'M','I','N','G','L','I','U','.','T','T','C',',','P','M','i','n','g','L','i','U','\0', + 'S','I','M','S','U','N','.','T','T','C',',','S','i','m','S','u','n','\0', + '\0'}; + static const WCHAR system_link_non_cjk[] = + {'M','S','G','O','T','H','I','C','.','T','T','C',',','M','S',' ','U','I',' ','G','o','t','h','i','c','\0', + 'M','I','N','G','L','I','U','.','T','T','C',',','P','M','i','n','g','L','i','U','\0', + 'S','I','M','S','U','N','.','T','T','C',',','S','i','m','S','u','n','\0', + 'G','U','L','I','M','.','T','T','C',',','G','u','l','i','m','\0', + '\0'}; + HKEY hkey; + + if (RegCreateKeyW(HKEY_LOCAL_MACHINE, system_link, &hkey) == ERROR_SUCCESS) + { + const WCHAR *link; + DWORD len; + + switch (current_ansi_codepage) + { + case 932: + link = system_link_japanese; + len = sizeof(system_link_japanese); + break; + case 936: + link = system_link_simplified_chinese; + len = sizeof(system_link_simplified_chinese); + break; + case 949: + link = system_link_korean; + len = sizeof(system_link_korean); + break; + case 950: + link = system_link_traditional_chinese; + len = sizeof(system_link_traditional_chinese); + break; + default: + link = system_link_non_cjk; + len = sizeof(system_link_non_cjk); + } + set_multi_value_key(hkey, Lucida_Sans_Unicode, link, len); + set_multi_value_key(hkey, Microsoft_Sans_Serif, link, len); + set_multi_value_key(hkey, Tahoma, link, len); + RegCloseKey(hkey); + } +} + static void update_font_info(void) { static const WCHAR logpixels[] = { 'L','o','g','P','i','x','e','l','s',0 }; @@ -3880,10 +4027,13 @@ if (!done) FIXME("there is no font defaults for codepages %u,%u\n", ansi_cp, oem_cp); - /* update locale dependent font association info in registry. + /* update locale dependent font association info and font system link info in registry. update only when codepages changed, not logpixels. */ if (strcmp(buf, cpbuf) != 0) + { update_font_association_info(ansi_cp); + update_font_system_link_info(ansi_cp); + } } static BOOL init_freetype(void) @@ -4143,6 +4293,7 @@ */ BOOL WineEngInit(void) { + HKEY hkey; DWORD disposition; HANDLE font_mutex; @@ -4155,6 +4306,23 @@ init_fontconfig(); #endif + if (!RegOpenKeyExW(HKEY_CURRENT_USER, wine_fonts_key, 0, KEY_READ, &hkey)) + { + static const WCHAR antialias_fake_bold_or_italic[] = { 'A','n','t','i','a','l','i','a','s','F','a','k','e', + 'B','o','l','d','O','r','I','t','a','l','i','c',0 }; + static const WCHAR true_options[] = { 'y','Y','t','T','1',0 }; + DWORD type, size; + WCHAR buffer[20]; + + size = sizeof(buffer); + if (!RegQueryValueExW(hkey, antialias_fake_bold_or_italic, NULL, &type, (BYTE*)buffer, &size) && + type == REG_SZ && size >= 1) + { + antialias_fakes = (strchrW(true_options, buffer[0]) != NULL); + } + RegCloseKey(hkey); + } + if((font_mutex = CreateMutexW(NULL, FALSE, font_mutex_nameW)) == NULL) { ERR("Failed to create font mutex\n"); @@ -4185,6 +4353,13 @@ return TRUE; } +/* Some fonts have large usWinDescent values, as a result of storing signed short + in unsigned field. That's probably caused by sTypoDescent vs usWinDescent confusion in + some font generation tools. */ +static inline USHORT get_fixed_windescent(USHORT windescent) +{ + return abs((SHORT)windescent); +} static LONG calc_ppem_for_height(FT_Face ft_face, LONG height) { @@ -4214,12 +4389,13 @@ */ if(height > 0) { - if(pOS2->usWinAscent + pOS2->usWinDescent == 0) + USHORT windescent = get_fixed_windescent(pOS2->usWinDescent); + if(pOS2->usWinAscent + windescent == 0) ppem = MulDiv(ft_face->units_per_EM, height, pHori->Ascender - pHori->Descender); else ppem = MulDiv(ft_face->units_per_EM, height, - pOS2->usWinAscent + pOS2->usWinDescent); + pOS2->usWinAscent + windescent); if(ppem > MAX_PPEM) { WARN("Ignoring too large height %d, ppem %d\n", height, ppem); ppem = 1; @@ -4396,6 +4572,7 @@ ret->font_desc.matrix.eM11 = ret->font_desc.matrix.eM22 = 1.0; ret->total_kern_pairs = (DWORD)-1; ret->kern_pairs = NULL; + ret->instance_id = alloc_font_handle(ret); list_init(&ret->child_fonts); return ret; } @@ -4414,6 +4591,8 @@ HeapFree(GetProcessHeap(), 0, child); } + HeapFree(GetProcessHeap(), 0, font->fileinfo); + free_font_handle(font->instance_id); if (font->ft_face) pFT_Done_Face(font->ft_face); if (font->mapping) unmap_font_file( font->mapping ); HeapFree(GetProcessHeap(), 0, font->kern_pairs); @@ -5069,6 +5248,29 @@ return feature; } +static void fill_fileinfo_from_face( GdiFont *font, Face *face ) +{ + WIN32_FILE_ATTRIBUTE_DATA info; + int len; + + if (!face->file) + { + font->fileinfo = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*font->fileinfo)); + return; + } + + len = strlenW(face->file); + font->fileinfo = HeapAlloc(GetProcessHeap(), 0, sizeof(*font->fileinfo) + len * sizeof(WCHAR)); + if (GetFileAttributesExW(face->file, GetFileExInfoStandard, &info)) + { + font->fileinfo->writetime = info.ftLastWriteTime; + font->fileinfo->size.QuadPart = (LONGLONG)info.nFileSizeHigh << 32 | info.nFileSizeLow; + strcpyW(font->fileinfo->path, face->file); + } + else + memset(font->fileinfo, 0, sizeof(*font->fileinfo) + len * sizeof(WCHAR)); +} + /************************************************************* * freetype_SelectFont */ @@ -5463,6 +5665,7 @@ goto done; } + fill_fileinfo_from_face( ret, face ); ret->ntmFlags = face->ntmFlags; pick_charmap( ret->ft_face, ret->charset ); @@ -5526,7 +5729,7 @@ case GGO_GRAY4_BITMAP: case GGO_GRAY8_BITMAP: case WINE_GGO_GRAY16_BITMAP: - if (is_hinting_enabled()) + if ((!antialias_fakes || (!ret->fake_bold && !ret->fake_italic)) && is_hinting_enabled()) { WORD gasp_flags; if (get_gasp_flags( ret, &gasp_flags ) && !(gasp_flags & GASP_DOGRAY)) @@ -7340,6 +7543,7 @@ WCHAR *family_nameW, *style_nameW, *face_nameW, *full_nameW; char *cp; INT ascent, descent; + USHORT windescent; TRACE("font=%p\n", font); @@ -7408,7 +7612,7 @@ pPost = pFT_Get_Sfnt_Table(ft_face, ft_sfnt_post); /* we can live with this failing */ - TRACE("OS/2 winA = %d winD = %d typoA = %d typoD = %d typoLG = %d avgW %d FT_Face a = %d, d = %d, h = %d: HORZ a = %d, d = %d lg = %d maxY = %ld minY = %ld\n", + TRACE("OS/2 winA = %u winD = %u typoA = %d typoD = %d typoLG = %d avgW %d FT_Face a = %d, d = %d, h = %d: HORZ a = %d, d = %d lg = %d maxY = %ld minY = %ld\n", pOS2->usWinAscent, pOS2->usWinDescent, pOS2->sTypoAscender, pOS2->sTypoDescender, pOS2->sTypoLineGap, pOS2->xAvgCharWidth, @@ -7421,12 +7625,13 @@ #define TM font->potm->otmTextMetrics - if(pOS2->usWinAscent + pOS2->usWinDescent == 0) { + windescent = get_fixed_windescent(pOS2->usWinDescent); + if(pOS2->usWinAscent + windescent == 0) { ascent = pHori->Ascender; descent = -pHori->Descender; } else { ascent = pOS2->usWinAscent; - descent = pOS2->usWinDescent; + descent = windescent; } font->ntmCellHeight = ascent + descent; @@ -8131,27 +8336,65 @@ } /************************************************************* - * freetype_GdiRealizationInfo + * freetype_GetFontRealizationInfo */ -static BOOL freetype_GdiRealizationInfo( PHYSDEV dev, void *ptr ) +static BOOL freetype_GetFontRealizationInfo( PHYSDEV dev, void *ptr ) { struct freetype_physdev *physdev = get_freetype_dev( dev ); - realization_info_t *info = ptr; + struct font_realization_info *info = ptr; if (!physdev->font) { - dev = GET_NEXT_PHYSDEV( dev, pGdiRealizationInfo ); - return dev->funcs->pGdiRealizationInfo( dev, ptr ); + dev = GET_NEXT_PHYSDEV( dev, pGetFontRealizationInfo ); + return dev->funcs->pGetFontRealizationInfo( dev, ptr ); } - FIXME("(%p, %p): stub!\n", physdev->font, info); + TRACE("(%p, %p)\n", physdev->font, info); info->flags = 1; if(FT_IS_SCALABLE(physdev->font->ft_face)) info->flags |= 2; info->cache_num = physdev->font->cache_num; - info->instance_id = -1; + info->instance_id = physdev->font->instance_id; + if (info->size == sizeof(*info)) + { + info->unk = 0; + info->face_index = physdev->font->ft_face->face_index; + info->simulations = 0; + if (physdev->font->fake_bold) + info->simulations |= 0x1; + if (physdev->font->fake_italic) + info->simulations |= 0x2; + } + + return TRUE; +} + +/************************************************************************* + * GetFontFileInfo (GDI32.@) + */ +BOOL WINAPI GetFontFileInfo( DWORD instance_id, DWORD unknown, struct font_fileinfo *info, DWORD size, DWORD *needed ) +{ + struct font_handle_entry *entry = handle_entry( instance_id ); + const GdiFont *font; + + if (!entry) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + font = entry->obj; + *needed = sizeof(*info) + strlenW(font->fileinfo->path) * sizeof(WCHAR); + if (*needed > size) + { + SetLastError(ERROR_INSUFFICIENT_BUFFER); + return FALSE; + } + + /* path is included too */ + memcpy(info, font->fileinfo, *needed); return TRUE; } @@ -8445,7 +8688,6 @@ freetype_FontIsLinked, /* pFontIsLinked */ NULL, /* pFrameRgn */ NULL, /* pGdiComment */ - freetype_GdiRealizationInfo, /* pGdiRealizationInfo */ NULL, /* pGetBoundsRect */ freetype_GetCharABCWidths, /* pGetCharABCWidths */ freetype_GetCharABCWidthsI, /* pGetCharABCWidthsI */ @@ -8453,6 +8695,7 @@ NULL, /* pGetDeviceCaps */ NULL, /* pGetDeviceGammaRamp */ freetype_GetFontData, /* pGetFontData */ + freetype_GetFontRealizationInfo, /* pGetFontRealizationInfo */ freetype_GetFontUnicodeRanges, /* pGetFontUnicodeRanges */ freetype_GetGlyphIndices, /* pGetGlyphIndices */ freetype_GetGlyphOutline, /* pGetGlyphOutline */ @@ -8544,6 +8787,8 @@ #else /* HAVE_FREETYPE */ +struct font_fileinfo; + /*************************************************************************/ BOOL WineEngInit(void) @@ -8587,4 +8832,13 @@ return TRUE; } +/************************************************************************* + * GetFontFileInfo (GDI32.@) + */ +BOOL WINAPI GetFontFileInfo( DWORD instance_id, DWORD unknown, struct font_fileinfo *info, DWORD size, DWORD *needed) +{ + *needed = 0; + return FALSE; +} + #endif /* HAVE_FREETYPE */ diff -Nru wine1.7-1.7.50/dlls/gdi32/gdi32.spec wine1.7-1.7.55/dlls/gdi32/gdi32.spec --- wine1.7-1.7.50/dlls/gdi32/gdi32.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdi32/gdi32.spec 2015-11-13 14:32:40.000000000 +0000 @@ -279,7 +279,9 @@ @ stdcall GetEnhMetaFileW(wstr) # @ stub GetFontAssocStatus @ stdcall GetFontData(long long long ptr long) +@ stdcall GetFontFileInfo(long long ptr long ptr) @ stdcall GetFontLanguageInfo(long) +@ stdcall GetFontRealizationInfo(long ptr) @ stub GetFontResourceInfo @ stdcall GetFontResourceInfoW(wstr ptr ptr long) @ stdcall GetFontUnicodeRanges(ptr ptr) diff -Nru wine1.7-1.7.50/dlls/gdi32/gdiobj.c wine1.7-1.7.55/dlls/gdi32/gdiobj.c --- wine1.7-1.7.50/dlls/gdi32/gdiobj.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdi32/gdiobj.c 2015-11-13 14:32:40.000000000 +0000 @@ -867,7 +867,7 @@ */ void GDI_CheckNotLock(void) { - if (gdi_section.OwningThread == ULongToHandle(GetCurrentThreadId()) && gdi_section.RecursionCount) + if (RtlIsCriticalSectionLockedByThread(&gdi_section)) { ERR( "BUG: holding GDI lock\n" ); DebugBreak(); diff -Nru wine1.7-1.7.50/dlls/gdi32/gdi_private.h wine1.7-1.7.55/dlls/gdi32/gdi_private.h --- wine1.7-1.7.50/dlls/gdi32/gdi_private.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdi32/gdi_private.h 2015-11-13 14:32:40.000000000 +0000 @@ -276,14 +276,17 @@ /* freetype.c */ -/* Undocumented structure filled in by GdiRealizationInfo */ -typedef struct +/* Undocumented structure filled in by GetFontRealizationInfo */ +struct font_realization_info { + DWORD size; /* could be 16 or 24 */ DWORD flags; /* 1 for bitmap fonts, 3 for scalable fonts */ DWORD cache_num; /* keeps incrementing - num of fonts that have been created allowing for caching?? */ DWORD instance_id; /* identifies a realized font instance */ -} realization_info_t; - + DWORD unk; /* unknown */ + WORD face_index; /* face index in case of font collections */ + WORD simulations; /* 0 bit - bold simulation, 1 bit - oblique simulation */ +}; extern INT WineEngAddFontResourceEx(LPCWSTR, DWORD, PVOID) DECLSPEC_HIDDEN; extern HANDLE WineEngAddFontMemResourceEx(PVOID, DWORD, PVOID, LPDWORD) DECLSPEC_HIDDEN; @@ -367,6 +370,7 @@ extern LONG nulldrv_GetBitmapBits( HBITMAP bitmap, void *bits, LONG size ) DECLSPEC_HIDDEN; extern COLORREF nulldrv_GetNearestColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; extern COLORREF nulldrv_GetPixel( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; +extern UINT nulldrv_GetSystemPaletteEntries( PHYSDEV dev, UINT start, UINT count, PALETTEENTRY *entries ) DECLSPEC_HIDDEN; extern BOOL nulldrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert, void * grad_array, ULONG ngrad, ULONG mode ) DECLSPEC_HIDDEN; extern INT nulldrv_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN; diff -Nru wine1.7-1.7.50/dlls/gdi32/mfdrv/init.c wine1.7-1.7.55/dlls/gdi32/mfdrv/init.c --- wine1.7-1.7.50/dlls/gdi32/mfdrv/init.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdi32/mfdrv/init.c 2015-11-13 14:32:40.000000000 +0000 @@ -132,7 +132,6 @@ NULL, /* pFontIsLinked */ MFDRV_FrameRgn, /* pFrameRgn */ NULL, /* pGdiComment */ - NULL, /* pGdiRealizationInfo */ MFDRV_GetBoundsRect, /* pGetBoundsRect */ NULL, /* pGetCharABCWidths */ NULL, /* pGetCharABCWidthsI */ @@ -140,6 +139,7 @@ MFDRV_GetDeviceCaps, /* pGetDeviceCaps */ NULL, /* pGetDeviceGammaRamp */ NULL, /* pGetFontData */ + NULL, /* pGetFontRealizationInfo */ NULL, /* pGetFontUnicodeRanges */ NULL, /* pGetGlyphIndices */ NULL, /* pGetGlyphOutline */ diff -Nru wine1.7-1.7.50/dlls/gdi32/palette.c wine1.7-1.7.55/dlls/gdi32/palette.c --- wine1.7-1.7.50/dlls/gdi32/palette.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdi32/palette.c 2015-11-13 14:32:40.000000000 +0000 @@ -426,6 +426,37 @@ } +/* null driver fallback implementation for GetSystemPaletteEntries */ +UINT nulldrv_GetSystemPaletteEntries( PHYSDEV dev, UINT start, UINT count, PALETTEENTRY *entries ) +{ + if (entries && start < 256) + { + UINT i; + const RGBQUAD *default_entries; + + if (start + count > 256) count = 256 - start; + + default_entries = get_default_color_table( 8 ); + for (i = 0; i < count; ++i) + { + if (start + i < 10 || start + i >= 246) + { + entries[i].peRed = default_entries[start + i].rgbRed; + entries[i].peGreen = default_entries[start + i].rgbGreen; + entries[i].peBlue = default_entries[start + i].rgbBlue; + } + else + { + entries[i].peRed = 0; + entries[i].peGreen = 0; + entries[i].peBlue = 0; + } + entries[i].peFlags = 0; + } + } + return 0; +} + /*********************************************************************** * GetNearestPaletteIndex [GDI32.@] * diff -Nru wine1.7-1.7.50/dlls/gdi32/path.c wine1.7-1.7.55/dlls/gdi32/path.c --- wine1.7-1.7.50/dlls/gdi32/path.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdi32/path.c 2015-11-13 14:32:40.000000000 +0000 @@ -2251,7 +2251,6 @@ NULL, /* pFontIsLinked */ NULL, /* pFrameRgn */ NULL, /* pGdiComment */ - NULL, /* pGdiRealizationInfo */ NULL, /* pGetBoundsRect */ NULL, /* pGetCharABCWidths */ NULL, /* pGetCharABCWidthsI */ @@ -2259,6 +2258,7 @@ NULL, /* pGetDeviceCaps */ NULL, /* pGetDeviceGammaRamp */ NULL, /* pGetFontData */ + NULL, /* pGetFontRealizationInfo */ NULL, /* pGetFontUnicodeRanges */ NULL, /* pGetGlyphIndices */ NULL, /* pGetGlyphOutline */ diff -Nru wine1.7-1.7.50/dlls/gdi32/tests/font.c wine1.7-1.7.55/dlls/gdi32/tests/font.c --- wine1.7-1.7.50/dlls/gdi32/tests/font.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdi32/tests/font.c 2015-11-13 14:32:40.000000000 +0000 @@ -753,6 +753,7 @@ #define FH_SCALE 0x80000000 static void test_bitmap_font_metrics(void) { + static const WORD skip_rtl[] = {LANG_ARABIC, LANG_HEBREW, 0}; static const struct font_data { const char face_name[LF_FACESIZE]; @@ -760,19 +761,19 @@ int ave_char_width, max_char_width, dpi; BYTE first_char, last_char, def_char, break_char; DWORD ansi_bitfield; - WORD skip_lang_id; + const WORD *skip_lang_id; int scaled_height; } fd[] = { - { "MS Sans Serif", FW_NORMAL, FH_SCALE | 6, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2, LANG_ARABIC, 13 }, + { "MS Sans Serif", FW_NORMAL, FH_SCALE | 6, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2, skip_rtl, 13 }, { "MS Sans Serif", FW_NORMAL, FH_SCALE | 6, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC, 0, 13 }, - { "MS Sans Serif", FW_NORMAL, FH_SCALE | 8, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2, LANG_ARABIC, 13 }, + { "MS Sans Serif", FW_NORMAL, FH_SCALE | 8, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2, skip_rtl, 13 }, { "MS Sans Serif", FW_NORMAL, FH_SCALE | 8, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC, 0, 13 }, - { "MS Sans Serif", FW_NORMAL, FH_SCALE | 10, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2, LANG_ARABIC, 13 }, + { "MS Sans Serif", FW_NORMAL, FH_SCALE | 10, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2, skip_rtl, 13 }, { "MS Sans Serif", FW_NORMAL, FH_SCALE | 10, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC, 0, 13 }, - { "MS Sans Serif", FW_NORMAL, FH_SCALE | 14, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2, LANG_ARABIC, 13 }, + { "MS Sans Serif", FW_NORMAL, FH_SCALE | 14, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2, skip_rtl, 13 }, { "MS Sans Serif", FW_NORMAL, FH_SCALE | 14, 11, 2, 2, 0, 5, 11, 96, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC, 0, 13 }, - { "MS Sans Serif", FW_NORMAL, FH_SCALE | 18, 13, 3, 3, 0, 7, 14, 96, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2, LANG_ARABIC, 16 }, + { "MS Sans Serif", FW_NORMAL, FH_SCALE | 18, 13, 3, 3, 0, 7, 14, 96, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2, skip_rtl, 16 }, { "MS Sans Serif", FW_NORMAL, FH_SCALE | 18, 13, 3, 3, 0, 7, 14, 96, 0x20, 0xff, 0x7f, 0x20, FS_CYRILLIC, 0, 16 }, { "MS Sans Serif", FW_NORMAL, FH_SCALE | 6, 13, 3, 3, 0, 7, 14, 120, 0x20, 0xff, 0x81, 0x20, FS_LATIN1 | FS_LATIN2, 0, 16 }, @@ -864,22 +865,22 @@ { "Small Fonts", FW_NORMAL, 3, 2, 1, 0, 0, 1, 2, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 }, { "Small Fonts", FW_NORMAL, 3, 2, 1, 0, 0, 1, 8, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN2 | FS_CYRILLIC }, { "Small Fonts", FW_NORMAL, 3, 2, 1, 0, 0, 2, 4, 96, 0x20, 0xff, 0x80, 0x20, FS_JISJAPAN }, - { "Small Fonts", FW_NORMAL, 5, 4, 1, 1, 0, 3, 4, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1, LANG_ARABIC }, + { "Small Fonts", FW_NORMAL, 5, 4, 1, 1, 0, 3, 4, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1, skip_rtl}, { "Small Fonts", FW_NORMAL, 5, 4, 1, 1, 0, 2, 8, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN2 | FS_CYRILLIC }, { "Small Fonts", FW_NORMAL, 5, 4, 1, 0, 0, 3, 6, 96, 0x20, 0xff, 0x80, 0x20, FS_JISJAPAN }, - { "Small Fonts", FW_NORMAL, 6, 5, 1, 1, 0, 3, 13, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1, LANG_ARABIC }, + { "Small Fonts", FW_NORMAL, 6, 5, 1, 1, 0, 3, 13, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1, skip_rtl}, { "Small Fonts", FW_NORMAL, 6, 5, 1, 1, 0, 3, 8, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN2 | FS_CYRILLIC }, { "Small Fonts", FW_NORMAL, 6, 5, 1, 1, 0, 3, 8, 96, 0x00, 0xff, 0x60, 0x00, FS_ARABIC }, { "Small Fonts", FW_NORMAL, 6, 5, 1, 0, 0, 4, 8, 96, 0x20, 0xff, 0x80, 0x20, FS_JISJAPAN }, - { "Small Fonts", FW_NORMAL, 8, 7, 1, 1, 0, 4, 7, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1, LANG_ARABIC }, + { "Small Fonts", FW_NORMAL, 8, 7, 1, 1, 0, 4, 7, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1, skip_rtl}, { "Small Fonts", FW_NORMAL, 8, 7, 1, 1, 0, 4, 8, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN2 | FS_CYRILLIC }, { "Small Fonts", FW_NORMAL, 8, 7, 1, 1, 0, 4, 8, 96, 0x00, 0xff, 0x60, 0x00, FS_ARABIC }, { "Small Fonts", FW_NORMAL, 8, 7, 1, 0, 0, 5, 10, 96, 0x20, 0xff, 0x80, 0x20, FS_JISJAPAN }, - { "Small Fonts", FW_NORMAL, 10, 8, 2, 2, 0, 4, 8, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_LATIN2, LANG_ARABIC }, + { "Small Fonts", FW_NORMAL, 10, 8, 2, 2, 0, 4, 8, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_LATIN2, skip_rtl}, { "Small Fonts", FW_NORMAL, 10, 8, 2, 2, 0, 5, 8, 96, 0x20, 0xff, 0x80, 0x20, FS_CYRILLIC }, { "Small Fonts", FW_NORMAL, 10, 8, 2, 2, 0, 4, 9, 96, 0x00, 0xff, 0x60, 0x00, FS_ARABIC }, { "Small Fonts", FW_NORMAL, 10, 8, 2, 0, 0, 6, 12, 96, 0x20, 0xff, 0x80, 0x20, FS_JISJAPAN }, - { "Small Fonts", FW_NORMAL, 11, 9, 2, 2, 0, 5, 9, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC, LANG_ARABIC }, + { "Small Fonts", FW_NORMAL, 11, 9, 2, 2, 0, 5, 9, 96, 0x20, 0xff, 0x80, 0x20, FS_LATIN1 | FS_LATIN2 | FS_CYRILLIC, skip_rtl}, { "Small Fonts", FW_NORMAL, 11, 9, 2, 2, 0, 4, 10, 96, 0x00, 0xff, 0x60, 0x00, FS_ARABIC }, { "Small Fonts", FW_NORMAL, 11, 9, 2, 0, 0, 7, 14, 96, 0x20, 0xff, 0x80, 0x20, FS_JISJAPAN }, @@ -1021,8 +1022,17 @@ if(fd[i].dpi == tm.tmDigitizedAspectX) { + int skipme = 0; trace("matched %s, height %d charset %x dpi %d\n", lf.lfFaceName, lf.lfHeight, lf.lfCharSet, fd[i].dpi); - if (fd[i].skip_lang_id == 0 || system_lang_id != fd[i].skip_lang_id) + if (fd[i].skip_lang_id) + { + int si = 0; + skipme = 0; + while(!skipme && fd[i].skip_lang_id[si]) + if (fd[i].skip_lang_id[si++] == system_lang_id) + skipme = 1; + } + if (!skipme) { ok(tm.tmWeight == fd[i].weight, "%s(%d): tm.tmWeight %d != %d\n", fd[i].face_name, height, tm.tmWeight, fd[i].weight); if (fd[i].height & FH_SCALE) @@ -2391,12 +2401,12 @@ if (charset == SYMBOL_CHARSET) { ok(strcmp("Arial", name), "face name should NOT be Arial\n"); - ok(fs.fsCsb[0] & (1 << 31), "symbol encoding should be available\n"); + ok(fs.fsCsb[0] & (1u << 31), "symbol encoding should be available\n"); } else { ok(!strcmp("Arial", name), "face name should be Arial, not %s\n", name); - ok(!(fs.fsCsb[0] & (1 << 31)), "symbol encoding should NOT be available\n"); + ok(!(fs.fsCsb[0] & (1u << 31)), "symbol encoding should NOT be available\n"); } if (!TranslateCharsetInfo((DWORD *)(INT_PTR)cs, &csi, TCI_SRCCHARSET)) @@ -3188,9 +3198,14 @@ USHORT usDefaultChar; USHORT usBreakChar; USHORT usMaxContext; -} TT_OS2_V2; + /* version 4 (OpenType 1.6) */ + USHORT usLowerOpticalPointSize; + USHORT usUpperOpticalPointSize; +} TT_OS2_V4; #include "poppack.h" +#define TT_OS2_V0_SIZE (FIELD_OFFSET(TT_OS2_V4, ulCodePageRange1)) + typedef struct { USHORT version; @@ -3242,7 +3257,7 @@ USHORT id_range_offset; } cmap_format_4_seg; -static void expect_ff(const TEXTMETRICA *tmA, const TT_OS2_V2 *os2, WORD family, const char *name) +static void expect_ff(const TEXTMETRICA *tmA, const TT_OS2_V4 *os2, WORD family, const char *name) { ok((tmA->tmPitchAndFamily & 0xf0) == family || broken(PRIMARYLANGID(GetSystemDefaultLangID()) != LANG_ENGLISH), @@ -3662,7 +3677,7 @@ HDC hdc; HFONT hfont, hfont_old; TEXTMETRICA tmA; - TT_OS2_V2 tt_os2; + TT_OS2_V4 tt_os2; LONG size, ret; const char *font_name = lf->lfFaceName; DWORD cmap_first = 0, cmap_last = 0; @@ -3693,7 +3708,8 @@ memset(&tt_os2, 0, sizeof(tt_os2)); ret = GetFontData(hdc, MS_OS2_TAG, 0, &tt_os2, size); - ok(ret == size, "GetFontData should return %u not %u\n", size, ret); + ok(ret >= TT_OS2_V0_SIZE && ret <= size, "GetFontData should return size from [%u,%u] not %u\n", TT_OS2_V0_SIZE, + size, ret); SetLastError(0xdeadbeef); ret = GetTextMetricsA(hdc, &tmA); @@ -3712,7 +3728,7 @@ TEXTMETRICW tmW; ascent = GET_BE_WORD(tt_os2.usWinAscent); - descent = GET_BE_WORD(tt_os2.usWinDescent); + descent = abs((SHORT)GET_BE_WORD(tt_os2.usWinDescent)); cell_height = ascent + descent; ok(ntm->ntmCellHeight == cell_height, "%s: ntmCellHeight %u != %u, os2.usWinAscent/os2.usWinDescent %u/%u\n", font_name, ntm->ntmCellHeight, cell_height, ascent, descent); @@ -4114,6 +4130,23 @@ static void test_RealizationInfo(void) { + struct font_realization_info { + DWORD size; + DWORD flags; + DWORD cache_num; + DWORD instance_id; + DWORD unk; + WORD face_index; + WORD simulations; + }; + + struct realization_info_t + { + DWORD flags; + DWORD cache_num; + DWORD instance_id; + }; + HDC hdc; DWORD info[4], info2[10]; BOOL r, have_file = FALSE; @@ -4145,16 +4178,17 @@ ok((info[0] & 0xf) == 1, "info[0] = %x for the system font\n", info[0]); ok(info[3] == 0xcccccccc, "structure longer than 3 dwords\n"); - if (!is_truetype_font_installed("Arial")) + if (!is_truetype_font_installed("Tahoma")) { skip("skipping GdiRealizationInfo with truetype font\n"); goto end; } memset(&lf, 0, sizeof(lf)); - strcpy(lf.lfFaceName, "Arial"); + strcpy(lf.lfFaceName, "Tahoma"); lf.lfHeight = 20; - lf.lfWeight = FW_NORMAL; + lf.lfWeight = FW_BOLD; + lf.lfItalic = 1; hfont = CreateFontIndirectA(&lf); hfont_old = SelectObject(hdc, hfont); @@ -4166,6 +4200,9 @@ if (pGetFontRealizationInfo) { + struct font_realization_info *fri = (struct font_realization_info*)info2; + struct realization_info_t *ri = (struct realization_info_t*)info; + /* The first DWORD represents a struct size. On a newly rebooted system setting this to < 16 results in GetFontRealizationInfo failing. However there @@ -4180,9 +4217,11 @@ ok(r != 0, "ret 0\n"); /* We may get the '24' version here if that has been previously requested. */ - ok(info2[0] == 16 || info2[0] == 24, "got %d\n", info2[0]); - ok(!memcmp(info2 + 1, info, 3 * sizeof(DWORD)), "mismatch\n"); - ok(info2[6] == 0xcccccccc, "structure longer than 6 dwords\n"); + ok(fri->size == 16 || fri->size == 24, "got %d\n", info2[0]); + ok(fri->flags == ri->flags, "flags mismatch\n"); + ok(fri->cache_num == ri->cache_num, "cache_num mismatch\n"); + ok(fri->instance_id == ri->instance_id, "instance id mismatch\n"); + ok(info2[6] == 0xcccccccc, "got wrong dword 6, 0x%08x\n", info2[6]); memset(info2, 0xcc, sizeof(info2)); info2[0] = 28; @@ -4193,16 +4232,28 @@ info2[0] = 24; r = pGetFontRealizationInfo(hdc, info2); ok(r != 0, "ret 0\n"); - ok(info2[0] == 24, "got %d\n", info2[0]); - ok(!memcmp(info2 + 1, info, 3 * sizeof(DWORD)), "mismatch\n"); + ok(fri->size == 24, "got %d\n", fri->size); + ok(fri->flags == ri->flags, "flags mismatch\n"); + ok(fri->cache_num == ri->cache_num, "cache_num mismatch\n"); + ok(fri->instance_id == ri->instance_id, "instance id mismatch\n"); + ok(fri->simulations == 0x2, "got simulations flags 0x%04x\n", fri->simulations); + ok(fri->face_index == 0, "got wrong face index %u\n", fri->face_index); ok(info2[6] == 0xcccccccc, "structure longer than 6 dwords\n"); /* Test GetFontFileInfo() */ - r = pGetFontFileInfo(info2[3], 0, &file_info, sizeof(file_info), &needed); + /* invalid font id */ + SetLastError(0xdeadbeef); + r = pGetFontFileInfo(0xabababab, 0, &file_info, sizeof(file_info), &needed); + ok(r == 0 && GetLastError() == ERROR_INVALID_PARAMETER, "ret %d gle %d\n", r, GetLastError()); + + needed = 0; + r = pGetFontFileInfo(fri->instance_id, 0, &file_info, sizeof(file_info), &needed); ok(r != 0 || GetLastError() == ERROR_NOACCESS, "ret %d gle %d\n", r, GetLastError()); if (r) { + ok(needed > 0 && needed < sizeof(file_info), "got needed size %u\n", needed); + h = CreateFileW(file_info.path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); ok(h != INVALID_HANDLE_VALUE, "Unable to open file %d\n", GetLastError()); @@ -4215,14 +4266,23 @@ ReadFile(h, file, sizeof(file), &read, NULL); CloseHandle(h); have_file = TRUE; + + /* shorter buffer */ + SetLastError(0xdeadbeef); + r = pGetFontFileInfo(fri->instance_id, 0, &file_info, needed - 1, &needed); + ok(r == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "ret %d gle %d\n", r, GetLastError()); } + if (pGetFontFileData) { /* Get bytes 2 - 16 using GetFontFileData */ - r = pGetFontFileData(info2[3], 0, 2, data, sizeof(data)); + r = pGetFontFileData(fri->instance_id, 0, 2, data, sizeof(data)); ok(r != 0, "ret 0 gle %d\n", GetLastError()); if (have_file) ok(!memcmp(data, file + 2, sizeof(data)), "mismatch\n"); + else + win_skip("GetFontFileInfo() failed, skipping\n"); + } } DeleteObject(SelectObject(hdc, hfont_old)); @@ -5914,6 +5974,7 @@ { { /* ANSI_FIXED_FONT */ { ANSI_CHARSET, FW_NORMAL, 12, 12, 96, "Courier", LANG_ARABIC }, + { ANSI_CHARSET, FW_NORMAL, 12, 12, 96, "Courier", LANG_HEBREW}, { DEFAULT_CHARSET, FW_NORMAL, 12, 13, 96, "Courier" }, { DEFAULT_CHARSET, FW_NORMAL, 12, 13, 120, "Courier" }, { 0 } diff -Nru wine1.7-1.7.50/dlls/gdi32/tests/metafile.c wine1.7-1.7.55/dlls/gdi32/tests/metafile.c --- wine1.7-1.7.50/dlls/gdi32/tests/metafile.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdi32/tests/metafile.c 2015-11-13 14:32:40.000000000 +0000 @@ -3361,6 +3361,39 @@ DeleteEnhMetaFile(hemf); } +static void test_emf_GetPath(void) +{ + HDC hdcMetafile; + HENHMETAFILE hemf; + BOOL ret; + int size; + + SetLastError(0xdeadbeef); + hdcMetafile = CreateEnhMetaFileA(GetDC(0), NULL, NULL, NULL); + ok(hdcMetafile != 0, "CreateEnhMetaFileA error %d\n", GetLastError()); + + BeginPath(hdcMetafile); + ret = MoveToEx(hdcMetafile, 50, 50, NULL); + ok( ret, "MoveToEx error %d.\n", GetLastError()); + ret = LineTo(hdcMetafile, 50, 150); + ok( ret, "LineTo error %d.\n", GetLastError()); + ret = LineTo(hdcMetafile, 150, 150); + ok( ret, "LineTo error %d.\n", GetLastError()); + ret = LineTo(hdcMetafile, 150, 50); + ok( ret, "LineTo error %d.\n", GetLastError()); + ret = LineTo(hdcMetafile, 50, 50); + ok( ret, "LineTo error %d.\n", GetLastError()); + EndPath(hdcMetafile); + + size = GetPath(hdcMetafile, NULL, NULL, 0); + todo_wine ok( size == 5, "GetPath returned %d.\n", size); + + hemf = CloseEnhMetaFile(hdcMetafile); + ok(hemf != 0, "CloseEnhMetaFile error %d\n", GetLastError()); + + DeleteEnhMetaFile(hemf); +} + START_TEST(metafile) { init_function_pointers(); @@ -3374,6 +3407,7 @@ test_emf_ExtTextOut_on_path(); test_emf_clipping(); test_emf_polybezier(); + test_emf_GetPath(); /* For win-format metafiles (mfdrv) */ test_mf_SaveDC(); diff -Nru wine1.7-1.7.50/dlls/gdi32/tests/palette.c wine1.7-1.7.55/dlls/gdi32/tests/palette.c --- wine1.7-1.7.50/dlls/gdi32/tests/palette.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdi32/tests/palette.c 2015-11-13 14:32:40.000000000 +0000 @@ -191,9 +191,135 @@ ReleaseDC( 0, hdc ); } +static void check_system_palette_entries(HDC hdc) +{ + PALETTEENTRY entries[256]; + PALETTEENTRY defpal[20]; + int i, count; + + memset( defpal, 0xaa, sizeof(defpal) ); + count = GetPaletteEntries( GetStockObject(DEFAULT_PALETTE), 0, 20, defpal ); + ok( count == 20, "wrong size %u\n", count ); + + memset( entries, 0x55, sizeof(entries) ); + count = GetSystemPaletteEntries( hdc, 0, 256, entries ); + ok( count == 0, "wrong size %u\n", count); + for (i = 0; i < 10; i++) + { + ok( entries[i].peRed == defpal[i].peRed && + entries[i].peGreen == defpal[i].peGreen && + entries[i].peBlue == defpal[i].peBlue && + !entries[i].peFlags, + "%u: wrong color %02x,%02x,%02x,%02x instead of %02x,%02x,%02x\n", i, + entries[i].peRed, entries[i].peGreen, entries[i].peBlue, entries[i].peFlags, + defpal[i].peRed, defpal[i].peGreen, defpal[i].peBlue ); + } + for (i = 10; i < 246; ++i) + { + ok( !entries[i].peRed && + !entries[i].peGreen && + !entries[i].peBlue && + !entries[i].peFlags, + "%u: wrong color %02x,%02x,%02x,%02x instead of 0,0,0\n", i, + entries[i].peRed, entries[i].peGreen, entries[i].peBlue, entries[i].peFlags); + } + for (i = 246; i < 256; i++) + { + int idx = i - 246 + 10; + ok( entries[i].peRed == defpal[idx].peRed && + entries[i].peGreen == defpal[idx].peGreen && + entries[i].peBlue == defpal[idx].peBlue && + !entries[i].peFlags, + "%u: wrong color %02x,%02x,%02x,%02x instead of %02x,%02x,%02x\n", i, + entries[i].peRed, entries[i].peGreen, entries[i].peBlue, entries[i].peFlags, + defpal[idx].peRed, defpal[idx].peGreen, defpal[idx].peBlue ); + } + + memset( entries, 0x55, sizeof(entries) ); + count = GetSystemPaletteEntries( hdc, 0, 10, entries ); + ok( count == 0, "wrong size %u\n", count); + for (i = 0; i < 10; i++) + { + ok( entries[i].peRed == defpal[i].peRed && + entries[i].peGreen == defpal[i].peGreen && + entries[i].peBlue == defpal[i].peBlue && + !entries[i].peFlags, + "%u: wrong color %02x,%02x,%02x,%02x instead of %02x,%02x,%02x\n", i, + entries[i].peRed, entries[i].peGreen, entries[i].peBlue, entries[i].peFlags, + defpal[i].peRed, defpal[i].peGreen, defpal[i].peBlue ); + } + + memset( entries, 0x55, sizeof(entries) ); + count = GetSystemPaletteEntries( hdc, 10, 246, entries ); + ok( count == 0, "wrong size %u\n", count); + for (i = 0; i < 236; ++i) + { + ok( !entries[i].peRed && + !entries[i].peGreen && + !entries[i].peBlue && + !entries[i].peFlags, + "%u: wrong color %02x,%02x,%02x,%02x instead of 0,0,0\n", i, + entries[i].peRed, entries[i].peGreen, entries[i].peBlue, entries[i].peFlags); + } + for (i = 236; i < 246; i++) + { + int idx = i - 236 + 10; + ok( entries[i].peRed == defpal[idx].peRed && + entries[i].peGreen == defpal[idx].peGreen && + entries[i].peBlue == defpal[idx].peBlue && + !entries[i].peFlags, + "%u: wrong color %02x,%02x,%02x,%02x instead of %02x,%02x,%02x\n", i, + entries[i].peRed, entries[i].peGreen, entries[i].peBlue, entries[i].peFlags, + defpal[idx].peRed, defpal[idx].peGreen, defpal[idx].peBlue ); + } + + memset( entries, 0x55, sizeof(entries) ); + count = GetSystemPaletteEntries( hdc, 246, 10, entries ); + ok( count == 0, "wrong size %u\n", count); + for (i = 0; i < 10; i++) + { + int idx = i + 10; + ok( entries[i].peRed == defpal[idx].peRed && + entries[i].peGreen == defpal[idx].peGreen && + entries[i].peBlue == defpal[idx].peBlue && + !entries[i].peFlags, + "%u: wrong color %02x,%02x,%02x,%02x instead of %02x,%02x,%02x\n", i, + entries[i].peRed, entries[i].peGreen, entries[i].peBlue, entries[i].peFlags, + defpal[idx].peRed, defpal[idx].peGreen, defpal[idx].peBlue ); + } +} + +static void test_system_palette_entries(void) +{ + HDC hdc; + HDC metafile_dc; + HMETAFILE metafile; + + hdc = GetDC(0); + + if (!(GetDeviceCaps( hdc, RASTERCAPS ) & RC_PALETTE)) + { + check_system_palette_entries(hdc); + } + else + { + skip( "device is palette-based, skipping test\n" ); + } + + ReleaseDC( 0, hdc ); + + metafile_dc = CreateMetaFileA(NULL); + + check_system_palette_entries(metafile_dc); + + metafile = CloseMetaFile(metafile_dc); + DeleteMetaFile(metafile); +} + START_TEST(palette) { test_DIB_PAL_COLORS(); test_palette_entries(); test_halftone_palette(); + test_system_palette_entries(); } diff -Nru wine1.7-1.7.50/dlls/gdi.exe16/printdrv.c wine1.7-1.7.55/dlls/gdi.exe16/printdrv.c --- wine1.7-1.7.50/dlls/gdi.exe16/printdrv.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdi.exe16/printdrv.c 2015-11-13 14:32:40.000000000 +0000 @@ -160,7 +160,7 @@ { struct hpq *queueItem = HeapAlloc(GetProcessHeap(), 0, sizeof(struct hpq)); if(queueItem == NULL) { - ERR("Memory exausted!\n"); + ERR("Memory exhausted!\n"); return FALSE; } queueItem->next = hpqueue; @@ -366,7 +366,7 @@ { pPrintJob = HeapAlloc(GetProcessHeap(), 0, sizeof(PRINTJOB)); if(pPrintJob == NULL) { - WARN("Memory exausted!\n"); + WARN("Memory exhausted!\n"); return hHandle; } diff -Nru wine1.7-1.7.50/dlls/gdiplus/brush.c wine1.7-1.7.55/dlls/gdiplus/brush.c --- wine1.7-1.7.50/dlls/gdiplus/brush.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdiplus/brush.c 2015-11-13 14:32:40.000000000 +0000 @@ -47,7 +47,7 @@ switch(brush->bt){ case BrushTypeSolidColor: { - *clone = GdipAlloc(sizeof(GpSolidFill)); + *clone = heap_alloc_zero(sizeof(GpSolidFill)); if (!*clone) return OutOfMemory; memcpy(*clone, brush, sizeof(GpSolidFill)); break; @@ -63,7 +63,7 @@ INT count, pcount; GpStatus stat; - *clone = GdipAlloc(sizeof(GpPathGradient)); + *clone = heap_alloc_zero(sizeof(GpPathGradient)); if (!*clone) return OutOfMemory; src = (GpPathGradient*) brush, @@ -74,7 +74,7 @@ stat = GdipClonePath(src->path, &dest->path); if(stat != Ok){ - GdipFree(dest); + heap_free(dest); return stat; } @@ -83,25 +83,25 @@ /* blending */ count = src->blendcount; dest->blendcount = count; - dest->blendfac = GdipAlloc(count * sizeof(REAL)); - dest->blendpos = GdipAlloc(count * sizeof(REAL)); - dest->surroundcolors = GdipAlloc(dest->surroundcolorcount * sizeof(ARGB)); + dest->blendfac = heap_alloc_zero(count * sizeof(REAL)); + dest->blendpos = heap_alloc_zero(count * sizeof(REAL)); + dest->surroundcolors = heap_alloc_zero(dest->surroundcolorcount * sizeof(ARGB)); pcount = dest->pblendcount; if (pcount) { - dest->pblendcolor = GdipAlloc(pcount * sizeof(ARGB)); - dest->pblendpos = GdipAlloc(pcount * sizeof(REAL)); + dest->pblendcolor = heap_alloc_zero(pcount * sizeof(ARGB)); + dest->pblendpos = heap_alloc_zero(pcount * sizeof(REAL)); } if(!dest->blendfac || !dest->blendpos || !dest->surroundcolors || (pcount && (!dest->pblendcolor || !dest->pblendpos))){ GdipDeletePath(dest->path); - GdipFree(dest->blendfac); - GdipFree(dest->blendpos); - GdipFree(dest->surroundcolors); - GdipFree(dest->pblendcolor); - GdipFree(dest->pblendpos); - GdipFree(dest); + heap_free(dest->blendfac); + heap_free(dest->blendpos); + heap_free(dest->surroundcolors); + heap_free(dest->pblendcolor); + heap_free(dest->pblendpos); + heap_free(dest); return OutOfMemory; } @@ -121,7 +121,7 @@ GpLineGradient *dest, *src; INT count, pcount; - dest = GdipAlloc(sizeof(GpLineGradient)); + dest = heap_alloc_zero(sizeof(GpLineGradient)); if(!dest) return OutOfMemory; src = (GpLineGradient*)brush; @@ -129,23 +129,23 @@ memcpy(dest, src, sizeof(GpLineGradient)); count = dest->blendcount; - dest->blendfac = GdipAlloc(count * sizeof(REAL)); - dest->blendpos = GdipAlloc(count * sizeof(REAL)); + dest->blendfac = heap_alloc_zero(count * sizeof(REAL)); + dest->blendpos = heap_alloc_zero(count * sizeof(REAL)); pcount = dest->pblendcount; if (pcount) { - dest->pblendcolor = GdipAlloc(pcount * sizeof(ARGB)); - dest->pblendpos = GdipAlloc(pcount * sizeof(REAL)); + dest->pblendcolor = heap_alloc_zero(pcount * sizeof(ARGB)); + dest->pblendpos = heap_alloc_zero(pcount * sizeof(REAL)); } if (!dest->blendfac || !dest->blendpos || (pcount && (!dest->pblendcolor || !dest->pblendpos))) { - GdipFree(dest->blendfac); - GdipFree(dest->blendpos); - GdipFree(dest->pblendcolor); - GdipFree(dest->pblendpos); - GdipFree(dest); + heap_free(dest->blendfac); + heap_free(dest->blendpos); + heap_free(dest->pblendcolor); + heap_free(dest->pblendpos); + heap_free(dest); return OutOfMemory; } @@ -247,7 +247,7 @@ if(!brush) return InvalidParameter; - *brush = GdipAlloc(sizeof(GpHatch)); + *brush = heap_alloc_zero(sizeof(GpHatch)); if (!*brush) return OutOfMemory; (*brush)->brush.bt = BrushTypeHatchFill; @@ -275,7 +275,7 @@ if (startpoint->X == endpoint->X && startpoint->Y == endpoint->Y) return OutOfMemory; - *line = GdipAlloc(sizeof(GpLineGradient)); + *line = heap_alloc_zero(sizeof(GpLineGradient)); if(!*line) return OutOfMemory; (*line)->brush.bt = BrushTypeLinearGradient; @@ -306,14 +306,14 @@ } (*line)->blendcount = 1; - (*line)->blendfac = GdipAlloc(sizeof(REAL)); - (*line)->blendpos = GdipAlloc(sizeof(REAL)); + (*line)->blendfac = heap_alloc_zero(sizeof(REAL)); + (*line)->blendpos = heap_alloc_zero(sizeof(REAL)); if (!(*line)->blendfac || !(*line)->blendpos) { - GdipFree((*line)->blendfac); - GdipFree((*line)->blendpos); - GdipFree(*line); + heap_free((*line)->blendfac); + heap_free((*line)->blendpos); + heap_free(*line); *line = NULL; return OutOfMemory; } @@ -514,7 +514,7 @@ GdipGetPathWorldBounds(path, &bounds, NULL, NULL); - *grad = GdipAlloc(sizeof(GpPathGradient)); + *grad = heap_alloc_zero(sizeof(GpPathGradient)); if (!*grad) { return OutOfMemory; @@ -522,14 +522,14 @@ GdipSetMatrixElements(&(*grad)->transform, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0); - (*grad)->blendfac = GdipAlloc(sizeof(REAL)); - (*grad)->blendpos = GdipAlloc(sizeof(REAL)); - (*grad)->surroundcolors = GdipAlloc(sizeof(ARGB)); + (*grad)->blendfac = heap_alloc_zero(sizeof(REAL)); + (*grad)->blendpos = heap_alloc_zero(sizeof(REAL)); + (*grad)->surroundcolors = heap_alloc_zero(sizeof(ARGB)); if(!(*grad)->blendfac || !(*grad)->blendpos || !(*grad)->surroundcolors){ - GdipFree((*grad)->blendfac); - GdipFree((*grad)->blendpos); - GdipFree((*grad)->surroundcolors); - GdipFree(*grad); + heap_free((*grad)->blendfac); + heap_free((*grad)->blendpos); + heap_free((*grad)->surroundcolors); + heap_free(*grad); *grad = NULL; return OutOfMemory; } @@ -661,7 +661,7 @@ if(!sf) return InvalidParameter; - *sf = GdipAlloc(sizeof(GpSolidFill)); + *sf = heap_alloc_zero(sizeof(GpSolidFill)); if (!*sf) return OutOfMemory; (*sf)->brush.bt = BrushTypeSolidColor; @@ -770,7 +770,7 @@ if (status != Ok) return status; - *texture = GdipAlloc(sizeof(GpTexture)); + *texture = heap_alloc_zero(sizeof(GpTexture)); if (!*texture){ status = OutOfMemory; goto exit; @@ -804,7 +804,7 @@ if (*texture) { GdipDisposeImageAttributes((*texture)->imageattributes); - GdipFree(*texture); + heap_free(*texture); *texture = NULL; } GdipDisposeImage(new_image); @@ -902,28 +902,28 @@ { case BrushTypePathGradient: GdipDeletePath(((GpPathGradient*) brush)->path); - GdipFree(((GpPathGradient*) brush)->blendfac); - GdipFree(((GpPathGradient*) brush)->blendpos); - GdipFree(((GpPathGradient*) brush)->surroundcolors); - GdipFree(((GpPathGradient*) brush)->pblendcolor); - GdipFree(((GpPathGradient*) brush)->pblendpos); + heap_free(((GpPathGradient*) brush)->blendfac); + heap_free(((GpPathGradient*) brush)->blendpos); + heap_free(((GpPathGradient*) brush)->surroundcolors); + heap_free(((GpPathGradient*) brush)->pblendcolor); + heap_free(((GpPathGradient*) brush)->pblendpos); break; case BrushTypeLinearGradient: - GdipFree(((GpLineGradient*)brush)->blendfac); - GdipFree(((GpLineGradient*)brush)->blendpos); - GdipFree(((GpLineGradient*)brush)->pblendcolor); - GdipFree(((GpLineGradient*)brush)->pblendpos); + heap_free(((GpLineGradient*)brush)->blendfac); + heap_free(((GpLineGradient*)brush)->blendpos); + heap_free(((GpLineGradient*)brush)->pblendcolor); + heap_free(((GpLineGradient*)brush)->pblendpos); break; case BrushTypeTextureFill: GdipDisposeImage(((GpTexture*)brush)->image); GdipDisposeImageAttributes(((GpTexture*)brush)->imageattributes); - GdipFree(((GpTexture*)brush)->bitmap_bits); + heap_free(((GpTexture*)brush)->bitmap_bits); break; default: break; } - GdipFree(brush); + heap_free(brush); return Ok; } @@ -1278,21 +1278,21 @@ (count >= 2 && (positions[0] != 0.0f || positions[count-1] != 1.0f))) return InvalidParameter; - new_blendfac = GdipAlloc(count * sizeof(REAL)); - new_blendpos = GdipAlloc(count * sizeof(REAL)); + new_blendfac = heap_alloc_zero(count * sizeof(REAL)); + new_blendpos = heap_alloc_zero(count * sizeof(REAL)); if (!new_blendfac || !new_blendpos) { - GdipFree(new_blendfac); - GdipFree(new_blendpos); + heap_free(new_blendfac); + heap_free(new_blendpos); return OutOfMemory; } memcpy(new_blendfac, factors, count * sizeof(REAL)); memcpy(new_blendpos, positions, count * sizeof(REAL)); - GdipFree(brush->blendfac); - GdipFree(brush->blendpos); + heap_free(brush->blendfac); + heap_free(brush->blendpos); brush->blendcount = count; brush->blendfac = new_blendfac; @@ -1423,21 +1423,21 @@ (count >= 2 && (pos[0] != 0.0f || pos[count-1] != 1.0f))) return InvalidParameter; - new_blendfac = GdipAlloc(count * sizeof(REAL)); - new_blendpos = GdipAlloc(count * sizeof(REAL)); + new_blendfac = heap_alloc_zero(count * sizeof(REAL)); + new_blendpos = heap_alloc_zero(count * sizeof(REAL)); if (!new_blendfac || !new_blendpos) { - GdipFree(new_blendfac); - GdipFree(new_blendpos); + heap_free(new_blendfac); + heap_free(new_blendpos); return OutOfMemory; } memcpy(new_blendfac, blend, count * sizeof(REAL)); memcpy(new_blendpos, pos, count * sizeof(REAL)); - GdipFree(brush->blendfac); - GdipFree(brush->blendpos); + heap_free(brush->blendfac); + heap_free(brush->blendpos); brush->blendcount = count; brush->blendfac = new_blendfac; @@ -1492,20 +1492,20 @@ return InvalidParameter; } - new_color = GdipAlloc(count * sizeof(ARGB)); - new_pos = GdipAlloc(count * sizeof(REAL)); + new_color = heap_alloc_zero(count * sizeof(ARGB)); + new_pos = heap_alloc_zero(count * sizeof(REAL)); if (!new_color || !new_pos) { - GdipFree(new_color); - GdipFree(new_pos); + heap_free(new_color); + heap_free(new_pos); return OutOfMemory; } memcpy(new_color, blend, sizeof(ARGB) * count); memcpy(new_pos, pos, sizeof(REAL) * count); - GdipFree(brush->pblendcolor); - GdipFree(brush->pblendpos); + heap_free(brush->pblendcolor); + heap_free(brush->pblendpos); brush->pblendcolor = new_color; brush->pblendpos = new_pos; @@ -1704,13 +1704,13 @@ num_colors = 1; } - new_surroundcolors = GdipAlloc(num_colors * sizeof(ARGB)); + new_surroundcolors = heap_alloc_zero(num_colors * sizeof(ARGB)); if (!new_surroundcolors) return OutOfMemory; memcpy(new_surroundcolors, argb, num_colors * sizeof(ARGB)); - GdipFree(grad->surroundcolors); + heap_free(grad->surroundcolors); grad->surroundcolors = new_surroundcolors; grad->surroundcolorcount = num_colors; @@ -1941,20 +1941,20 @@ return InvalidParameter; } - new_color = GdipAlloc(count * sizeof(ARGB)); - new_pos = GdipAlloc(count * sizeof(REAL)); + new_color = heap_alloc_zero(count * sizeof(ARGB)); + new_pos = heap_alloc_zero(count * sizeof(REAL)); if (!new_color || !new_pos) { - GdipFree(new_color); - GdipFree(new_pos); + heap_free(new_color); + heap_free(new_pos); return OutOfMemory; } memcpy(new_color, blend, sizeof(ARGB) * count); memcpy(new_pos, positions, sizeof(REAL) * count); - GdipFree(brush->pblendcolor); - GdipFree(brush->pblendpos); + heap_free(brush->pblendcolor); + heap_free(brush->pblendpos); brush->pblendcolor = new_color; brush->pblendpos = new_pos; diff -Nru wine1.7-1.7.50/dlls/gdiplus/customlinecap.c wine1.7-1.7.55/dlls/gdiplus/customlinecap.c --- wine1.7-1.7.50/dlls/gdiplus/customlinecap.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdiplus/customlinecap.c 2015-11-13 14:32:40.000000000 +0000 @@ -38,18 +38,18 @@ if(!from || !to) return InvalidParameter; - *to = GdipAlloc(sizeof(GpCustomLineCap)); + *to = heap_alloc_zero(sizeof(GpCustomLineCap)); if(!*to) return OutOfMemory; memcpy(*to, from, sizeof(GpCustomLineCap)); - (*to)->pathdata.Points = GdipAlloc(from->pathdata.Count * sizeof(PointF)); - (*to)->pathdata.Types = GdipAlloc(from->pathdata.Count); + (*to)->pathdata.Points = heap_alloc_zero(from->pathdata.Count * sizeof(PointF)); + (*to)->pathdata.Types = heap_alloc_zero(from->pathdata.Count); if((!(*to)->pathdata.Types || !(*to)->pathdata.Points) && (*to)->pathdata.Count){ - GdipFree((*to)->pathdata.Points); - GdipFree((*to)->pathdata.Types); - GdipFree(*to); + heap_free((*to)->pathdata.Points); + heap_free((*to)->pathdata.Types); + heap_free(*to); return OutOfMemory; } @@ -74,7 +74,7 @@ if(!customCap || !(fillPath || strokePath)) return InvalidParameter; - *customCap = GdipAlloc(sizeof(GpCustomLineCap)); + *customCap = heap_alloc_zero(sizeof(GpCustomLineCap)); if(!*customCap) return OutOfMemory; if(strokePath){ @@ -86,14 +86,14 @@ pathdata = &fillPath->pathdata; } - (*customCap)->pathdata.Points = GdipAlloc(pathdata->Count * sizeof(PointF)); - (*customCap)->pathdata.Types = GdipAlloc(pathdata->Count); + (*customCap)->pathdata.Points = heap_alloc_zero(pathdata->Count * sizeof(PointF)); + (*customCap)->pathdata.Types = heap_alloc_zero(pathdata->Count); if((!(*customCap)->pathdata.Types || !(*customCap)->pathdata.Points) && pathdata->Count){ - GdipFree((*customCap)->pathdata.Points); - GdipFree((*customCap)->pathdata.Types); - GdipFree(*customCap); + heap_free((*customCap)->pathdata.Points); + heap_free((*customCap)->pathdata.Types); + heap_free(*customCap); return OutOfMemory; } @@ -119,9 +119,9 @@ if(!customCap) return InvalidParameter; - GdipFree(customCap->pathdata.Points); - GdipFree(customCap->pathdata.Types); - GdipFree(customCap); + heap_free(customCap->pathdata.Points); + heap_free(customCap->pathdata.Types); + heap_free(customCap); return Ok; } diff -Nru wine1.7-1.7.50/dlls/gdiplus/font.c wine1.7-1.7.55/dlls/gdiplus/font.c --- wine1.7-1.7.50/dlls/gdiplus/font.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdiplus/font.c 2015-11-13 14:32:40.000000000 +0000 @@ -178,7 +178,7 @@ if (!ret) return NotTrueTypeFont; - *font = GdipAlloc(sizeof(GpFont)); + *font = heap_alloc_zero(sizeof(GpFont)); if (!*font) return OutOfMemory; (*font)->unit = unit; @@ -188,7 +188,7 @@ stat = clone_font_family(fontFamily, &(*font)->family); if (stat != Ok) { - GdipFree(*font); + heap_free(*font); return stat; } @@ -224,7 +224,7 @@ if (!ret) return NotTrueTypeFont; - *font = GdipAlloc(sizeof(GpFont)); + *font = heap_alloc_zero(sizeof(GpFont)); if (!*font) return OutOfMemory; (*font)->unit = UnitWorld; @@ -234,7 +234,7 @@ stat = GdipCreateFontFamilyFromName(facename, NULL, &(*font)->family); if (stat != Ok) { - GdipFree(*font); + heap_free(*font); return NotTrueTypeFont; } @@ -275,7 +275,7 @@ return InvalidParameter; GdipDeleteFontFamily(font->family); - GdipFree(font); + heap_free(font); return Ok; } @@ -526,12 +526,12 @@ if(!font || !cloneFont) return InvalidParameter; - *cloneFont = GdipAlloc(sizeof(GpFont)); + *cloneFont = heap_alloc_zero(sizeof(GpFont)); if(!*cloneFont) return OutOfMemory; **cloneFont = *font; stat = GdipCloneFontFamily(font->family, &(*cloneFont)->family); - if (stat != Ok) GdipFree(*cloneFont); + if (stat != Ok) heap_free(*cloneFont); return stat; } @@ -759,7 +759,7 @@ stat = find_installed_font(name, &fm); if (stat != Ok) return stat; - ffamily = GdipAlloc(sizeof (GpFontFamily)); + ffamily = heap_alloc_zero(sizeof (GpFontFamily)); if (!ffamily) return OutOfMemory; lstrcpyW(ffamily->FamilyName, fm.facename); @@ -778,7 +778,7 @@ static GpStatus clone_font_family(const GpFontFamily *family, GpFontFamily **clone) { - *clone = GdipAlloc(sizeof(GpFontFamily)); + *clone = heap_alloc_zero(sizeof(GpFontFamily)); if (!*clone) return OutOfMemory; **clone = *family; @@ -870,7 +870,7 @@ return InvalidParameter; TRACE("Deleting %p (%s)\n", FontFamily, debugstr_w(FontFamily->FamilyName)); - GdipFree (FontFamily); + heap_free (FontFamily); return Ok; } @@ -1098,7 +1098,7 @@ if (!fontCollection) return InvalidParameter; - *fontCollection = GdipAlloc(sizeof(GpFontCollection)); + *fontCollection = heap_alloc_zero(sizeof(GpFontCollection)); if (!*fontCollection) return OutOfMemory; (*fontCollection)->FontFamilies = NULL; @@ -1122,8 +1122,8 @@ if (!fontCollection) return InvalidParameter; - for (i = 0; i < (*fontCollection)->count; i++) GdipFree((*fontCollection)->FontFamilies[i]); - GdipFree(*fontCollection); + for (i = 0; i < (*fontCollection)->count; i++) heap_free((*fontCollection)->FontFamilies[i]); + heap_free(*fontCollection); return Ok; } @@ -1590,7 +1590,7 @@ { while (installedFontCollection.count) GdipDeleteFontFamily(installedFontCollection.FontFamilies[--installedFontCollection.count]); - HeapFree(GetProcessHeap(), 0, installedFontCollection.FontFamilies); + heap_free(installedFontCollection.FontFamilies); installedFontCollection.FontFamilies = NULL; installedFontCollection.allocated = 0; } @@ -1612,13 +1612,13 @@ if (fonts->allocated == fonts->count) { INT new_alloc_count = fonts->allocated+50; - GpFontFamily** new_family_list = HeapAlloc(GetProcessHeap(), 0, new_alloc_count*sizeof(void*)); + GpFontFamily** new_family_list = heap_alloc(new_alloc_count*sizeof(void*)); if (!new_family_list) return 0; memcpy(new_family_list, fonts->FontFamilies, fonts->count*sizeof(void*)); - HeapFree(GetProcessHeap(), 0, fonts->FontFamilies); + heap_free(fonts->FontFamilies); fonts->FontFamilies = new_family_list; fonts->allocated = new_alloc_count; } diff -Nru wine1.7-1.7.50/dlls/gdiplus/gdiplus.c wine1.7-1.7.55/dlls/gdiplus/gdiplus.c --- wine1.7-1.7.50/dlls/gdiplus/gdiplus.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdiplus/gdiplus.c 2015-11-13 14:32:40.000000000 +0000 @@ -406,12 +406,12 @@ if(path->datalen == 0){ path->datalen = len * 2; - path->pathdata.Points = GdipAlloc(path->datalen * sizeof(PointF)); + path->pathdata.Points = heap_alloc_zero(path->datalen * sizeof(PointF)); if(!path->pathdata.Points) return FALSE; - path->pathdata.Types = GdipAlloc(path->datalen); + path->pathdata.Types = heap_alloc_zero(path->datalen); if(!path->pathdata.Types){ - GdipFree(path->pathdata.Points); + heap_free(path->pathdata.Points); return FALSE; } } @@ -420,12 +420,10 @@ while(path->datalen - path->pathdata.Count < len) path->datalen *= 2; - path->pathdata.Points = HeapReAlloc(GetProcessHeap(), 0, - path->pathdata.Points, path->datalen * sizeof(PointF)); + path->pathdata.Points = heap_realloc(path->pathdata.Points, path->datalen * sizeof(PointF)); if(!path->pathdata.Points) return FALSE; - path->pathdata.Types = HeapReAlloc(GetProcessHeap(), 0, - path->pathdata.Types, path->datalen); + path->pathdata.Types = heap_realloc(path->pathdata.Types, path->datalen); if(!path->pathdata.Types) return FALSE; } @@ -467,8 +465,8 @@ default: delete_element(element->elementdata.combine.left); delete_element(element->elementdata.combine.right); - GdipFree(element->elementdata.combine.left); - GdipFree(element->elementdata.combine.right); + heap_free(element->elementdata.combine.left); + heap_free(element->elementdata.combine.right); break; } } diff -Nru wine1.7-1.7.50/dlls/gdiplus/gdiplus_private.h wine1.7-1.7.55/dlls/gdiplus/gdiplus_private.h --- wine1.7-1.7.50/dlls/gdiplus/gdiplus_private.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdiplus/gdiplus_private.h 2015-11-13 14:32:40.000000000 +0000 @@ -48,6 +48,29 @@ #define GIF_DISPOSE_RESTORE_TO_BKGND 2 #define GIF_DISPOSE_RESTORE_TO_PREV 3 +static void *heap_alloc(size_t len) __WINE_ALLOC_SIZE(1); +static inline void *heap_alloc(size_t len) +{ + return HeapAlloc(GetProcessHeap(), 0, len); +} + +static void *heap_alloc_zero(size_t len) __WINE_ALLOC_SIZE(1); +static inline void *heap_alloc_zero(size_t len) +{ + return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); +} + +static void *heap_realloc(void *mem, size_t len) __WINE_ALLOC_SIZE(2); +static inline void *heap_realloc(void *mem, size_t len) +{ + return HeapReAlloc(GetProcessHeap(), 0, mem, len); +} + +static inline BOOL heap_free(void *mem) +{ + return HeapFree(GetProcessHeap(), 0, mem); +} + COLORREF ARGB2COLORREF(ARGB color) DECLSPEC_HIDDEN; HBITMAP ARGB2BMP(ARGB color) DECLSPEC_HIDDEN; extern INT arc2polybezier(GpPointF * points, REAL x1, REAL y1, REAL x2, REAL y2, diff -Nru wine1.7-1.7.50/dlls/gdiplus/gdiplus.spec wine1.7-1.7.55/dlls/gdiplus/gdiplus.spec --- wine1.7-1.7.50/dlls/gdiplus/gdiplus.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdiplus/gdiplus.spec 2015-11-13 14:32:40.000000000 +0000 @@ -610,7 +610,7 @@ 610 stdcall GdipFindFirstImageItem(ptr ptr) 611 stub GdipFindNextImageItem 612 stdcall GdipGetImageItemData(ptr ptr) -613 stub GdipCreateEffect +613 stdcall GdipCreateEffect(int128 ptr) 614 stdcall GdipDeleteEffect(ptr) 615 stub GdipGetEffectParameterSize 616 stub GdipGetEffectParameters @@ -620,7 +620,7 @@ 620 stdcall GdipBitmapApplyEffect(ptr ptr ptr long ptr ptr) 621 stub GdipBitmapGetHistogram 622 stub GdipBitmapGetHistogramSize -623 stub GdipBitmapConvertFormat +623 stdcall GdipBitmapConvertFormat(ptr long long long ptr float) 624 stdcall GdipImageSetAbort(ptr ptr) 625 stub GdipGraphicsSetAbort 626 stub GdipDrawImageFX diff -Nru wine1.7-1.7.50/dlls/gdiplus/graphics.c wine1.7-1.7.55/dlls/gdiplus/graphics.c --- wine1.7-1.7.50/dlls/gdiplus/graphics.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdiplus/graphics.c 2015-11-13 14:32:40.000000000 +0000 @@ -458,7 +458,7 @@ size = GetRegionData(hrgn, 0, NULL); - rgndata = GdipAlloc(size); + rgndata = heap_alloc_zero(size); if (!rgndata) { DeleteObject(hrgn); @@ -477,7 +477,7 @@ src_stride, fmt); } - GdipFree(rgndata); + heap_free(rgndata); DeleteObject(hrgn); @@ -1234,7 +1234,7 @@ { BitmapData lockeddata; - fill->bitmap_bits = GdipAlloc(sizeof(ARGB) * bitmap->width * bitmap->height); + fill->bitmap_bits = heap_alloc_zero(sizeof(ARGB) * bitmap->width * bitmap->height); if (!fill->bitmap_bits) stat = OutOfMemory; @@ -1260,7 +1260,7 @@ if (stat != Ok) { - GdipFree(fill->bitmap_bits); + heap_free(fill->bitmap_bits); fill->bitmap_bits = NULL; } } @@ -1656,9 +1656,9 @@ break; count = custom->pathdata.Count; - custptf = GdipAlloc(count * sizeof(PointF)); - custpt = GdipAlloc(count * sizeof(POINT)); - tp = GdipAlloc(count); + custptf = heap_alloc_zero(count * sizeof(PointF)); + custpt = heap_alloc_zero(count * sizeof(POINT)); + tp = heap_alloc_zero(count); if(!custptf || !custpt || !tp) goto custend; @@ -1687,9 +1687,9 @@ PolyDraw(graphics->hdc, custpt, tp, count); custend: - GdipFree(custptf); - GdipFree(custpt); - GdipFree(tp); + heap_free(custptf); + heap_free(custpt); + heap_free(tp); break; default: break; @@ -1791,9 +1791,9 @@ static GpStatus draw_poly(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF * pt, GDIPCONST BYTE * types, INT count, BOOL caps) { - POINT *pti = GdipAlloc(count * sizeof(POINT)); - BYTE *tp = GdipAlloc(count); - GpPointF *ptcopy = GdipAlloc(count * sizeof(GpPointF)); + POINT *pti = heap_alloc_zero(count * sizeof(POINT)); + BYTE *tp = heap_alloc_zero(count); + GpPointF *ptcopy = heap_alloc_zero(count * sizeof(GpPointF)); INT i, j; GpStatus status = GenericError; @@ -1906,9 +1906,9 @@ status = Ok; end: - GdipFree(pti); - GdipFree(ptcopy); - GdipFree(tp); + heap_free(pti); + heap_free(ptcopy); + heap_free(tp); return status; } @@ -1946,7 +1946,7 @@ GDIPCONST GpGraphics* graphics){ GpStatus sts; - *container = GdipAlloc(sizeof(GraphicsContainerItem)); + *container = heap_alloc_zero(sizeof(GraphicsContainerItem)); if(!(*container)) return OutOfMemory; @@ -1967,7 +1967,7 @@ sts = GdipCloneRegion(graphics->clip, &(*container)->clip); if(sts != Ok){ - GdipFree(*container); + heap_free(*container); *container = NULL; return sts; } @@ -1978,7 +1978,7 @@ static void delete_container(GraphicsContainerItem* container) { GdipDeleteRegion(container->clip); - GdipFree(container); + heap_free(container); } static GpStatus restore_container(GpGraphics* graphics, @@ -2216,13 +2216,13 @@ if(graphics == NULL) return InvalidParameter; - *graphics = GdipAlloc(sizeof(GpGraphics)); + *graphics = heap_alloc_zero(sizeof(GpGraphics)); if(!*graphics) return OutOfMemory; GdipSetMatrixElements(&(*graphics)->worldtrans, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0); if((retval = GdipCreateRegion(&(*graphics)->clip)) != Ok){ - GdipFree(*graphics); + heap_free(*graphics); return retval; } @@ -2259,13 +2259,13 @@ { GpStatus retval; - *graphics = GdipAlloc(sizeof(GpGraphics)); + *graphics = heap_alloc_zero(sizeof(GpGraphics)); if(!*graphics) return OutOfMemory; GdipSetMatrixElements(&(*graphics)->worldtrans, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0); if((retval = GdipCreateRegion(&(*graphics)->clip)) != Ok){ - GdipFree(*graphics); + heap_free(*graphics); return retval; } @@ -2378,7 +2378,7 @@ * accessing freed memory. */ graphics->busy = TRUE; - GdipFree(graphics); + heap_free(graphics); return Ok; } @@ -2492,7 +2492,7 @@ if(graphics->busy) return ObjectBusy; - pts = GdipAlloc(sizeof(GpPointF) * count); + pts = heap_alloc_zero(sizeof(GpPointF) * count); if(!pts) return OutOfMemory; @@ -2503,7 +2503,7 @@ ret = GdipDrawBeziers(graphics,pen,pts,count); - GdipFree(pts); + heap_free(pts); return ret; } @@ -2562,7 +2562,7 @@ if(!points || count <= 0) return InvalidParameter; - ptf = GdipAlloc(sizeof(GpPointF)*count); + ptf = heap_alloc_zero(sizeof(GpPointF)*count); if(!ptf) return OutOfMemory; @@ -2573,7 +2573,7 @@ stat = GdipDrawClosedCurve2(graphics, pen, ptf, count, tension); - GdipFree(ptf); + heap_free(ptf); return stat; } @@ -2598,7 +2598,7 @@ if(!points) return InvalidParameter; - pointsF = GdipAlloc(sizeof(GpPointF)*count); + pointsF = heap_alloc_zero(sizeof(GpPointF)*count); if(!pointsF) return OutOfMemory; @@ -2608,7 +2608,7 @@ } ret = GdipDrawCurve(graphics,pen,pointsF,count); - GdipFree(pointsF); + heap_free(pointsF); return ret; } @@ -2654,7 +2654,7 @@ if(!points) return InvalidParameter; - pointsF = GdipAlloc(sizeof(GpPointF)*count); + pointsF = heap_alloc_zero(sizeof(GpPointF)*count); if(!pointsF) return OutOfMemory; @@ -2664,7 +2664,7 @@ } ret = GdipDrawCurve2(graphics,pen,pointsF,count,tension); - GdipFree(pointsF); + heap_free(pointsF); return ret; } @@ -3004,7 +3004,7 @@ TRACE("src_area: %d x %d\n", src_area.Width, src_area.Height); - src_data = GdipAlloc(sizeof(ARGB) * src_area.Width * src_area.Height); + src_data = heap_alloc_zero(sizeof(ARGB) * src_area.Width * src_area.Height); if (!src_data) return OutOfMemory; src_stride = sizeof(ARGB) * src_area.Width; @@ -3027,7 +3027,7 @@ if (stat != Ok) { - GdipFree(src_data); + heap_free(src_data); return stat; } @@ -3038,10 +3038,10 @@ if (do_resampling) { /* Transform the bits as needed to the destination. */ - dst_data = dst_dyn_data = GdipAlloc(sizeof(ARGB) * (dst_area.right - dst_area.left) * (dst_area.bottom - dst_area.top)); + dst_data = dst_dyn_data = heap_alloc_zero(sizeof(ARGB) * (dst_area.right - dst_area.left) * (dst_area.bottom - dst_area.top)); if (!dst_data) { - GdipFree(src_data); + heap_free(src_data); return OutOfMemory; } @@ -3084,9 +3084,9 @@ dst_data, dst_area.right - dst_area.left, dst_area.bottom - dst_area.top, dst_stride, lockeddata.PixelFormat); - GdipFree(src_data); + heap_free(src_data); - GdipFree(dst_dyn_data); + heap_free(dst_dyn_data); return stat; } @@ -3353,7 +3353,7 @@ TRACE("(%p, %p, %p, %d)\n", graphics, pen, points, count); - ptf = GdipAlloc(count * sizeof(GpPointF)); + ptf = heap_alloc_zero(count * sizeof(GpPointF)); if(!ptf) return OutOfMemory; for(i = 0; i < count; i ++){ @@ -3363,7 +3363,7 @@ retval = GdipDrawLines(graphics, pen, ptf, count); - GdipFree(ptf); + heap_free(ptf); return retval; } @@ -3512,7 +3512,7 @@ if(!rects || count<=0) return InvalidParameter; - rectsF = GdipAlloc(sizeof(GpRectF) * count); + rectsF = heap_alloc_zero(sizeof(GpRectF) * count); if(!rectsF) return OutOfMemory; @@ -3524,7 +3524,7 @@ } ret = GdipDrawRectangles(graphics, pen, rectsF, count); - GdipFree(rectsF); + heap_free(rectsF); return ret; } @@ -3574,7 +3574,7 @@ if(count == 1) /* Do nothing */ return Ok; - ptf = GdipAlloc(sizeof(GpPointF)*count); + ptf = heap_alloc_zero(sizeof(GpPointF)*count); if(!ptf) return OutOfMemory; @@ -3585,7 +3585,7 @@ stat = GdipFillClosedCurve2(graphics, brush, ptf, count, tension, fill); - GdipFree(ptf); + heap_free(ptf); return stat; } @@ -3917,7 +3917,7 @@ if(!rects || count <= 0) return InvalidParameter; - rectsF = GdipAlloc(sizeof(GpRectF)*count); + rectsF = heap_alloc_zero(sizeof(GpRectF)*count); if(!rectsF) return OutOfMemory; @@ -3929,7 +3929,7 @@ } ret = GdipFillRectangles(graphics,brush,rectsF,count); - GdipFree(rectsF); + heap_free(rectsF); return ret; } @@ -4020,7 +4020,7 @@ gp_bound_rect.Width = bound_rect.right - bound_rect.left; gp_bound_rect.Height = bound_rect.bottom - bound_rect.top; - pixel_data = GdipAlloc(sizeof(*pixel_data) * gp_bound_rect.Width * gp_bound_rect.Height); + pixel_data = heap_alloc_zero(sizeof(*pixel_data) * gp_bound_rect.Width * gp_bound_rect.Height); if (!pixel_data) stat = OutOfMemory; @@ -4035,7 +4035,7 @@ gp_bound_rect.Height, gp_bound_rect.Width * 4, hregion, PixelFormat32bppARGB); - GdipFree(pixel_data); + heap_free(pixel_data); } DeleteObject(hregion); @@ -4500,7 +4500,7 @@ if(length == -1) length = lstrlenW(string); - stringdup = GdipAlloc((length + 1) * sizeof(WCHAR)); + stringdup = heap_alloc_zero((length + 1) * sizeof(WCHAR)); if(!stringdup) return OutOfMemory; if (!format) @@ -4508,7 +4508,7 @@ stat = GdipStringFormatGetGenericDefault(&dyn_format); if (stat != Ok) { - GdipFree(stringdup); + heap_free(stringdup); return stat; } format = dyn_format; @@ -4534,7 +4534,7 @@ } if (hotkeyprefix_count) - hotkeyprefix_offsets = GdipAlloc(sizeof(INT) * hotkeyprefix_count); + hotkeyprefix_offsets = heap_alloc_zero(sizeof(INT) * hotkeyprefix_count); hotkeyprefix_count = 0; @@ -4660,8 +4660,8 @@ break; } - GdipFree(stringdup); - GdipFree(hotkeyprefix_offsets); + heap_free(stringdup); + heap_free(hotkeyprefix_offsets); GdipDeleteStringFormat(dyn_format); return stat; @@ -5636,7 +5636,7 @@ return Ok; } - pti = GdipAlloc(sizeof(POINT) * count); + pti = heap_alloc_zero(sizeof(POINT) * count); save_state = prepare_dc(graphics, pen); SelectObject(graphics->hdc, GetStockObject(NULL_BRUSH)); @@ -5645,7 +5645,7 @@ Polygon(graphics->hdc, pti, count); restore_dc(graphics, save_state); - GdipFree(pti); + heap_free(pti); return Ok; } @@ -5660,7 +5660,7 @@ TRACE("(%p, %p, %p, %d)\n", graphics, pen, points, count); if(count<=0) return InvalidParameter; - ptf = GdipAlloc(sizeof(GpPointF) * count); + ptf = heap_alloc_zero(sizeof(GpPointF) * count); for(i = 0;i < count; i++){ ptf[i].X = (REAL)points[i].X; @@ -5668,7 +5668,7 @@ } ret = GdipDrawPolygon(graphics,pen,ptf,count); - GdipFree(ptf); + heap_free(ptf); return ret; } @@ -5882,7 +5882,7 @@ /* free everything except root node and header */ delete_element(®ion->node); memcpy(region, clip, sizeof(GpRegion)); - GdipFree(clip); + heap_free(clip); return Ok; } @@ -5974,7 +5974,7 @@ if(count <= 0) return InvalidParameter; - pointsF = GdipAlloc(sizeof(GpPointF) * count); + pointsF = heap_alloc_zero(sizeof(GpPointF) * count); if(!pointsF) return OutOfMemory; @@ -5990,7 +5990,7 @@ points[i].X = gdip_round(pointsF[i].X); points[i].Y = gdip_round(pointsF[i].Y); } - GdipFree(pointsF); + heap_free(pointsF); return ret; } @@ -6103,7 +6103,7 @@ if (flags & DriverStringOptionsCmapLookup) { - glyph_indices = dynamic_glyph_indices = GdipAlloc(sizeof(WORD) * length); + glyph_indices = dynamic_glyph_indices = heap_alloc_zero(sizeof(WORD) * length); if (!glyph_indices) { DeleteDC(hdc); @@ -6145,7 +6145,7 @@ if (max_x < x) max_x = x; } - GdipFree(dynamic_glyph_indices); + heap_free(dynamic_glyph_indices); DeleteDC(hdc); DeleteObject(hfont); @@ -6227,7 +6227,7 @@ if (flags & unsupported_flags) FIXME("Ignoring flags %x\n", flags & unsupported_flags); - pti = GdipAlloc(sizeof(POINT) * length); + pti = heap_alloc_zero(sizeof(POINT) * length); if (!pti) return OutOfMemory; @@ -6239,10 +6239,10 @@ } else { - real_positions = GdipAlloc(sizeof(PointF) * length); + real_positions = heap_alloc_zero(sizeof(PointF) * length); if (!real_positions) { - GdipFree(pti); + heap_free(pti); return OutOfMemory; } @@ -6250,7 +6250,7 @@ transform_and_round_points(graphics, pti, real_positions, length); - GdipFree(real_positions); + heap_free(real_positions); } get_font_hfont(graphics, font, format, &hfont, matrix); @@ -6270,7 +6270,7 @@ if (glyphsize == GDI_ERROR) { ERR("GetGlyphOutlineW failed\n"); - GdipFree(pti); + heap_free(pti); DeleteDC(hdc); DeleteObject(hfont); return GenericError; @@ -6303,15 +6303,15 @@ /* Nothing to draw. */ return Ok; - glyph_mask = GdipAlloc(max_glyphsize); - text_mask = GdipAlloc((max_x - min_x) * (max_y - min_y)); + glyph_mask = heap_alloc_zero(max_glyphsize); + text_mask = heap_alloc_zero((max_x - min_x) * (max_y - min_y)); text_mask_stride = max_x - min_x; if (!(glyph_mask && text_mask)) { - GdipFree(glyph_mask); - GdipFree(text_mask); - GdipFree(pti); + heap_free(glyph_mask); + heap_free(text_mask); + heap_free(pti); DeleteDC(hdc); DeleteObject(hfont); return OutOfMemory; @@ -6346,16 +6346,16 @@ } } - GdipFree(pti); + heap_free(pti); DeleteDC(hdc); DeleteObject(hfont); - GdipFree(glyph_mask); + heap_free(glyph_mask); /* get the brush data */ - pixel_data = GdipAlloc(4 * (max_x - min_x) * (max_y - min_y)); + pixel_data = heap_alloc_zero(4 * (max_x - min_x) * (max_y - min_y)); if (!pixel_data) { - GdipFree(text_mask); + heap_free(text_mask); return OutOfMemory; } @@ -6368,8 +6368,8 @@ stat = brush_fill_pixels(graphics, (GpBrush*)brush, (DWORD*)pixel_data, &pixel_area, pixel_area.Width); if (stat != Ok) { - GdipFree(text_mask); - GdipFree(pixel_data); + heap_free(text_mask); + heap_free(pixel_data); return stat; } @@ -6386,13 +6386,13 @@ } } - GdipFree(text_mask); + heap_free(text_mask); /* draw the result */ stat = alpha_blend_pixels(graphics, min_x, min_y, pixel_data, pixel_area.Width, pixel_area.Height, pixel_data_stride, PixelFormat32bppARGB); - GdipFree(pixel_data); + heap_free(pixel_data); return stat; } diff -Nru wine1.7-1.7.50/dlls/gdiplus/graphicspath.c wine1.7-1.7.55/dlls/gdiplus/graphicspath.c --- wine1.7-1.7.50/dlls/gdiplus/graphicspath.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdiplus/graphicspath.c 2015-11-13 14:32:40.000000000 +0000 @@ -43,7 +43,7 @@ /* init list */ static BOOL init_path_list(path_list_node_t **node, REAL x, REAL y) { - *node = GdipAlloc(sizeof(path_list_node_t)); + *node = heap_alloc_zero(sizeof(path_list_node_t)); if(!*node) return FALSE; @@ -62,7 +62,7 @@ while(n){ n = n->next; - GdipFree(node); + heap_free(node); node = n; } } @@ -77,7 +77,7 @@ { path_list_node_t *new; - new = GdipAlloc(sizeof(path_list_node_t)); + new = heap_alloc_zero(sizeof(path_list_node_t)); if(!new) return NULL; @@ -293,7 +293,7 @@ if(!points || ((count - 1) % 3)) return InvalidParameter; - ptsF = GdipAlloc(sizeof(GpPointF) * count); + ptsF = heap_alloc_zero(sizeof(GpPointF) * count); if(!ptsF) return OutOfMemory; @@ -303,7 +303,7 @@ } ret = GdipAddPathBeziers(path, ptsF, count); - GdipFree(ptsF); + heap_free(ptsF); return ret; } @@ -338,11 +338,11 @@ if(!path || !points || count <= 1) return InvalidParameter; - pt = GdipAlloc(len_pt * sizeof(GpPointF)); - pts = GdipAlloc((count + 1)*sizeof(GpPointF)); + pt = heap_alloc_zero(len_pt * sizeof(GpPointF)); + pts = heap_alloc_zero((count + 1)*sizeof(GpPointF)); if(!pt || !pts){ - GdipFree(pt); - GdipFree(pts); + heap_free(pt); + heap_free(pts); return OutOfMemory; } @@ -388,8 +388,8 @@ path->newfigure = TRUE; } - GdipFree(pts); - GdipFree(pt); + heap_free(pts); + heap_free(pt); return stat; } @@ -406,7 +406,7 @@ if(!path || !points || count <= 1) return InvalidParameter; - ptf = GdipAlloc(sizeof(GpPointF)*count); + ptf = heap_alloc_zero(sizeof(GpPointF)*count); if(!ptf) return OutOfMemory; @@ -417,7 +417,7 @@ stat = GdipAddPathClosedCurve2(path, ptf, count, tension); - GdipFree(ptf); + heap_free(ptf); return stat; } @@ -455,7 +455,7 @@ if(!path || !points || count <= 1) return InvalidParameter; - pt = GdipAlloc(len_pt * sizeof(GpPointF)); + pt = heap_alloc_zero(len_pt * sizeof(GpPointF)); if(!pt) return OutOfMemory; @@ -490,7 +490,7 @@ stat = GdipAddPathBeziers(path, pt, len_pt); - GdipFree(pt); + heap_free(pt); return stat; } @@ -507,7 +507,7 @@ if(!path || !points || count <= 1) return InvalidParameter; - ptf = GdipAlloc(sizeof(GpPointF)*count); + ptf = heap_alloc_zero(sizeof(GpPointF)*count); if(!ptf) return OutOfMemory; @@ -518,7 +518,7 @@ stat = GdipAddPathCurve2(path, ptf, count, tension); - GdipFree(ptf); + heap_free(ptf); return stat; } @@ -627,7 +627,7 @@ if(count <= 0) return InvalidParameter; - pointsF = GdipAlloc(sizeof(GpPointF) * count); + pointsF = heap_alloc_zero(sizeof(GpPointF) * count); if(!pointsF) return OutOfMemory; for(i = 0;i < count; i++){ @@ -637,7 +637,7 @@ stat = GdipAddPathLine2(path, pointsF, count); - GdipFree(pointsF); + heap_free(pointsF); return stat; } @@ -738,7 +738,7 @@ if(count == 0) return Ok; - ptf = GdipAlloc(sizeof(GpPointF)*count); + ptf = heap_alloc_zero(sizeof(GpPointF)*count); if(!ptf) return OutOfMemory; @@ -746,12 +746,12 @@ status = GdipAddPathLine(path, x + width/2, y + height/2, ptf[0].X, ptf[0].Y); if(status != Ok){ - GdipFree(ptf); + heap_free(ptf); return status; } /* one spline is already added as a line endpoint */ if(!lengthen_path(path, count - 1)){ - GdipFree(ptf); + heap_free(ptf); return OutOfMemory; } @@ -763,7 +763,7 @@ GdipClosePathFigure(path); - GdipFree(ptf); + heap_free(ptf); return status; } @@ -814,7 +814,7 @@ if(!points || count < 3) return InvalidParameter; - ptf = GdipAlloc(sizeof(GpPointF) * count); + ptf = heap_alloc_zero(sizeof(GpPointF) * count); if(!ptf) return OutOfMemory; @@ -825,7 +825,7 @@ status = GdipAddPathPolygon(path, ptf, count); - GdipFree(ptf); + heap_free(ptf); return status; } @@ -877,7 +877,7 @@ status = GenericError; break; } - origph = ph = GdipAlloc(len); + origph = ph = heap_alloc_zero(len); start = (char *)ph; if (!ph || !lengthen_path(path, len / sizeof(POINTFX))) { @@ -931,7 +931,7 @@ x += gm.gmCellIncX * args->scale; y += gm.gmCellIncY * args->scale; - GdipFree(origph); + heap_free(origph); if (status != Ok) break; } @@ -1017,10 +1017,10 @@ if (status != Ok) /* free backup */ { - GdipFree(path->pathdata.Points); - GdipFree(path->pathdata.Types); + heap_free(path->pathdata.Points); + heap_free(path->pathdata.Types); *path = *backup; - GdipFree(backup); + heap_free(backup); return status; } if (format && format->vertalign == StringAlignmentCenter && layoutRect->Y + args.maxY < layoutRect->Height) @@ -1060,17 +1060,17 @@ if(!path || !clone) return InvalidParameter; - *clone = GdipAlloc(sizeof(GpPath)); + *clone = heap_alloc_zero(sizeof(GpPath)); if(!*clone) return OutOfMemory; **clone = *path; - (*clone)->pathdata.Points = GdipAlloc(path->datalen * sizeof(PointF)); - (*clone)->pathdata.Types = GdipAlloc(path->datalen); + (*clone)->pathdata.Points = heap_alloc_zero(path->datalen * sizeof(PointF)); + (*clone)->pathdata.Types = heap_alloc_zero(path->datalen); if(!(*clone)->pathdata.Points || !(*clone)->pathdata.Types){ - GdipFree((*clone)->pathdata.Points); - GdipFree((*clone)->pathdata.Types); - GdipFree(*clone); + heap_free((*clone)->pathdata.Points); + heap_free((*clone)->pathdata.Types); + heap_free(*clone); return OutOfMemory; } @@ -1122,7 +1122,7 @@ if(!path) return InvalidParameter; - *path = GdipAlloc(sizeof(GpPath)); + *path = heap_alloc_zero(sizeof(GpPath)); if(!*path) return OutOfMemory; (*path)->fill = fill; @@ -1139,16 +1139,16 @@ if(!path) return InvalidParameter; - *path = GdipAlloc(sizeof(GpPath)); + *path = heap_alloc_zero(sizeof(GpPath)); if(!*path) return OutOfMemory; - (*path)->pathdata.Points = GdipAlloc(count * sizeof(PointF)); - (*path)->pathdata.Types = GdipAlloc(count); + (*path)->pathdata.Points = heap_alloc_zero(count * sizeof(PointF)); + (*path)->pathdata.Types = heap_alloc_zero(count); if(!(*path)->pathdata.Points || !(*path)->pathdata.Types){ - GdipFree((*path)->pathdata.Points); - GdipFree((*path)->pathdata.Types); - GdipFree(*path); + heap_free((*path)->pathdata.Points); + heap_free((*path)->pathdata.Types); + heap_free(*path); return OutOfMemory; } @@ -1172,7 +1172,7 @@ TRACE("(%p, %p, %d, %d, %p)\n", points, types, count, fill, path); - ptF = GdipAlloc(sizeof(GpPointF)*count); + ptF = heap_alloc_zero(sizeof(GpPointF)*count); for(i = 0;i < count; i++){ ptF[i].X = (REAL)points[i].X; @@ -1181,7 +1181,7 @@ ret = GdipCreatePath2(ptF, types, count, fill, path); - GdipFree(ptF); + heap_free(ptF); return ret; } @@ -1193,9 +1193,9 @@ if(!path) return InvalidParameter; - GdipFree(path->pathdata.Points); - GdipFree(path->pathdata.Types); - GdipFree(path); + heap_free(path->pathdata.Points); + heap_free(path->pathdata.Types); + heap_free(path); return Ok; } @@ -1368,7 +1368,7 @@ if(count <= 0) return InvalidParameter; - ptf = GdipAlloc(sizeof(GpPointF)*count); + ptf = heap_alloc_zero(sizeof(GpPointF)*count); if(!ptf) return OutOfMemory; ret = GdipGetPathPoints(path,ptf,count); @@ -1377,7 +1377,7 @@ points[i].X = gdip_round(ptf[i].X); points[i].Y = gdip_round(ptf[i].Y); }; - GdipFree(ptf); + heap_free(ptf); return ret; } @@ -1531,12 +1531,12 @@ if(count == 0) return Ok; - revpath.Points = GdipAlloc(sizeof(GpPointF)*count); - revpath.Types = GdipAlloc(sizeof(BYTE)*count); + revpath.Points = heap_alloc_zero(sizeof(GpPointF)*count); + revpath.Types = heap_alloc_zero(sizeof(BYTE)*count); revpath.Count = count; if(!revpath.Points || !revpath.Types){ - GdipFree(revpath.Points); - GdipFree(revpath.Types); + heap_free(revpath.Points); + heap_free(revpath.Types); return OutOfMemory; } @@ -1566,8 +1566,8 @@ memcpy(path->pathdata.Points, revpath.Points, sizeof(GpPointF)*count); memcpy(path->pathdata.Types, revpath.Types, sizeof(BYTE)*count); - GdipFree(revpath.Points); - GdipFree(revpath.Types); + heap_free(revpath.Points); + heap_free(revpath.Types); return Ok; } @@ -1971,7 +1971,7 @@ break; } - tmp_points = GdipAlloc((end - start + 2) * sizeof(GpPoint)); + tmp_points = heap_alloc_zero((end - start + 2) * sizeof(GpPoint)); if (!tmp_points) return; /* FIXME */ if (!closed) @@ -2051,7 +2051,7 @@ closed ? LineCapFlat : pen->endcap, pen->customend, last_point); } - GdipFree(tmp_points); + heap_free(tmp_points); } GpStatus WINGDIPAPI GdipWidenPath(GpPath *path, GpPen *pen, GpMatrix *matrix, @@ -2189,10 +2189,10 @@ fail: /* reverting */ - GdipFree(path->pathdata.Points); - GdipFree(path->pathdata.Types); + heap_free(path->pathdata.Points); + heap_free(path->pathdata.Types); memcpy(path, backup, sizeof(*path)); - GdipFree(backup); + heap_free(backup); return retstat; } @@ -2235,10 +2235,10 @@ fail: /* reverting */ - GdipFree(path->pathdata.Points); - GdipFree(path->pathdata.Types); + heap_free(path->pathdata.Points); + heap_free(path->pathdata.Types); memcpy(path, backup, sizeof(*path)); - GdipFree(backup); + heap_free(backup); return retstat; } @@ -2257,7 +2257,7 @@ if(count < 0) return OutOfMemory; - rectsF = GdipAlloc(sizeof(GpRectF)*count); + rectsF = heap_alloc_zero(sizeof(GpRectF)*count); for(i = 0;i < count;i++){ rectsF[i].X = (REAL)rects[i].X; @@ -2267,7 +2267,7 @@ } retstat = GdipAddPathRectangles(path, rectsF, count); - GdipFree(rectsF); + heap_free(rectsF); return retstat; } diff -Nru wine1.7-1.7.50/dlls/gdiplus/imageattributes.c wine1.7-1.7.55/dlls/gdiplus/imageattributes.c --- wine1.7-1.7.50/dlls/gdiplus/imageattributes.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdiplus/imageattributes.c 2015-11-13 14:32:40.000000000 +0000 @@ -50,7 +50,7 @@ if(!imageattr) return InvalidParameter; - *imageattr = GdipAlloc(sizeof(GpImageAttributes)); + *imageattr = heap_alloc_zero(sizeof(GpImageAttributes)); if(!*imageattr) return OutOfMemory; (*imageattr)->wrap = WrapModeClamp; @@ -70,9 +70,9 @@ return InvalidParameter; for (i=0; icolorremaptables[i].colormap); + heap_free(imageattr->colorremaptables[i].colormap); - GdipFree(imageattr); + heap_free(imageattr); return Ok; } @@ -222,21 +222,21 @@ if(!map || !mapSize) return InvalidParameter; - new_map = GdipAlloc(sizeof(*map) * mapSize); + new_map = heap_alloc_zero(sizeof(*map) * mapSize); if (!new_map) return OutOfMemory; memcpy(new_map, map, sizeof(*map) * mapSize); - GdipFree(imageAttr->colorremaptables[type].colormap); + heap_free(imageAttr->colorremaptables[type].colormap); imageAttr->colorremaptables[type].mapsize = mapSize; imageAttr->colorremaptables[type].colormap = new_map; } else { - GdipFree(imageAttr->colorremaptables[type].colormap); + heap_free(imageAttr->colorremaptables[type].colormap); imageAttr->colorremaptables[type].colormap = NULL; } diff -Nru wine1.7-1.7.50/dlls/gdiplus/image.c wine1.7-1.7.55/dlls/gdiplus/image.c --- wine1.7-1.7.50/dlls/gdiplus/image.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdiplus/image.c 2015-11-13 14:32:40.000000000 +0000 @@ -92,7 +92,7 @@ UINT count; IWICPalette_GetColorCount(wic_palette, &count); - palette = HeapAlloc(GetProcessHeap(), 0, 2 * sizeof(UINT) + count * sizeof(ARGB)); + palette = heap_alloc(2 * sizeof(UINT) + count * sizeof(ARGB)); IWICPalette_GetColors(wic_palette, count, palette->Entries, &palette->Count); IWICPalette_GetType(wic_palette, &type); @@ -1128,7 +1128,7 @@ { lockeddata->Stride = (((act_rect.Width * bitspp + 7) / 8) + 3) & ~3; - bitmap->bitmapbits = GdipAlloc(lockeddata->Stride * act_rect.Height); + bitmap->bitmapbits = heap_alloc_zero(lockeddata->Stride * act_rect.Height); if (!bitmap->bitmapbits) return OutOfMemory; @@ -1153,7 +1153,7 @@ if (stat != Ok) { - GdipFree(bitmap->bitmapbits); + heap_free(bitmap->bitmapbits); bitmap->bitmapbits = NULL; return stat; } @@ -1198,7 +1198,7 @@ if(!(--bitmap->numlocks)) bitmap->lockmode = 0; - GdipFree(bitmap->bitmapbits); + heap_free(bitmap->bitmapbits); bitmap->bitmapbits = NULL; return Ok; } @@ -1228,7 +1228,7 @@ ERR("failed to convert pixels; this should never happen\n"); } - GdipFree(bitmap->bitmapbits); + heap_free(bitmap->bitmapbits); bitmap->bitmapbits = NULL; bitmap->lockmode = 0; bitmap->numlocks = 0; @@ -1274,7 +1274,7 @@ src_palette = srcBitmap->image.palette; - dst_palette = GdipAlloc(sizeof(UINT) * 2 + sizeof(ARGB) * src_palette->Count); + dst_palette = heap_alloc_zero(sizeof(UINT) * 2 + sizeof(ARGB) * src_palette->Count); if (dst_palette) { @@ -1282,7 +1282,7 @@ dst_palette->Count = src_palette->Count; memcpy(dst_palette->Entries, src_palette->Entries, sizeof(ARGB) * src_palette->Count); - GdipFree((*dstBitmap)->image.palette); + heap_free((*dstBitmap)->image.palette); (*dstBitmap)->image.palette = dst_palette; } else @@ -1360,7 +1360,7 @@ metafile = (GpMetafile*)image; - result = GdipAlloc(sizeof(*result)); + result = heap_alloc_zero(sizeof(*result)); if (!result) return OutOfMemory; @@ -1377,7 +1377,7 @@ if (!result->hemf) { - GdipFree(result); + heap_free(result); return OutOfMemory; } @@ -1692,7 +1692,7 @@ { if (iinfo.hbmMask) { - BYTE *bits = HeapAlloc(GetProcessHeap(), 0, height * stride); + BYTE *bits = heap_alloc(height * stride); /* read alpha data from the mask */ if (iinfo.hbmColor) @@ -1716,7 +1716,7 @@ dst_row += lockeddata.Stride; } - HeapFree(GetProcessHeap(), 0, bits); + heap_free(bits); } else { @@ -1857,7 +1857,7 @@ { INT size = abs(stride) * height; - own_bits = bits = GdipAlloc(size); + own_bits = bits = heap_alloc_zero(size); if (!own_bits) return OutOfMemory; if (stride < 0) @@ -1865,11 +1865,11 @@ } } - *bitmap = GdipAlloc(sizeof(GpBitmap)); + *bitmap = heap_alloc_zero(sizeof(GpBitmap)); if(!*bitmap) { DeleteObject(hbitmap); - GdipFree(own_bits); + heap_free(own_bits); return OutOfMemory; } @@ -1903,7 +1903,7 @@ format == PixelFormat4bppIndexed || format == PixelFormat8bppIndexed) { - (*bitmap)->image.palette = GdipAlloc(sizeof(UINT) * 2 + sizeof(ARGB) * (1 << PIXELFORMATBPP(format))); + (*bitmap)->image.palette = heap_alloc_zero(sizeof(UINT) * 2 + sizeof(ARGB) * (1 << PIXELFORMATBPP(format))); if (!(*bitmap)->image.palette) { @@ -1975,13 +1975,13 @@ if(!bitmap || !graphics || !cachedbmp) return InvalidParameter; - *cachedbmp = GdipAlloc(sizeof(GpCachedBitmap)); + *cachedbmp = heap_alloc_zero(sizeof(GpCachedBitmap)); if(!*cachedbmp) return OutOfMemory; stat = GdipCloneImage(&(bitmap->image), &(*cachedbmp)->image); if(stat != Ok){ - GdipFree(*cachedbmp); + heap_free(*cachedbmp); return stat; } @@ -2009,7 +2009,7 @@ xorstride = lockeddata.Width*4; bitssize = (andstride + xorstride) * lockeddata.Height; - andbits = GdipAlloc(bitssize); + andbits = heap_alloc_zero(bitssize); if (andbits) { @@ -2031,7 +2031,7 @@ *hicon = CreateIcon(NULL, lockeddata.Width, lockeddata.Height, 1, 32, andbits, xorbits); - GdipFree(andbits); + heap_free(andbits); } else stat = OutOfMemory; @@ -2050,7 +2050,7 @@ return InvalidParameter; GdipDisposeImage(cachedbmp->image); - GdipFree(cachedbmp); + heap_free(cachedbmp); return Ok; } @@ -2073,18 +2073,18 @@ assert(src->image.type == ImageTypeBitmap); assert(dst->image.type == ImageTypeBitmap); - GdipFree(dst->bitmapbits); - GdipFree(dst->own_bits); + heap_free(dst->bitmapbits); + heap_free(dst->own_bits); DeleteDC(dst->hdc); DeleteObject(dst->hbitmap); if (clobber_palette) { - GdipFree(dst->image.palette); + heap_free(dst->image.palette); dst->image.palette = src->image.palette; } else - GdipFree(src->image.palette); + heap_free(src->image.palette); dst->image.xres = src->image.xres; dst->image.yres = src->image.yres; @@ -2099,7 +2099,7 @@ if (dst->metadata_reader) IWICMetadataReader_Release(dst->metadata_reader); dst->metadata_reader = src->metadata_reader; - GdipFree(dst->prop_item); + heap_free(dst->prop_item); dst->prop_item = src->prop_item; dst->prop_count = src->prop_count; if (dst->image.decoder) @@ -2110,7 +2110,7 @@ dst->image.format = src->image.format; src->image.type = ~0; - GdipFree(src); + heap_free(src); } static GpStatus free_image_data(GpImage *image) @@ -2120,18 +2120,18 @@ if (image->type == ImageTypeBitmap) { - GdipFree(((GpBitmap*)image)->bitmapbits); - GdipFree(((GpBitmap*)image)->own_bits); + heap_free(((GpBitmap*)image)->bitmapbits); + heap_free(((GpBitmap*)image)->own_bits); DeleteDC(((GpBitmap*)image)->hdc); DeleteObject(((GpBitmap*)image)->hbitmap); if (((GpBitmap*)image)->metadata_reader) IWICMetadataReader_Release(((GpBitmap*)image)->metadata_reader); - GdipFree(((GpBitmap*)image)->prop_item); + heap_free(((GpBitmap*)image)->prop_item); } else if (image->type == ImageTypeMetafile) { GpMetafile *metafile = (GpMetafile*)image; - GdipFree(metafile->comment_data); + heap_free(metafile->comment_data); DeleteEnhMetaFile(CloseEnhMetaFile(metafile->record_dc)); if (!metafile->preserve_hemf) DeleteEnhMetaFile(metafile->hemf); @@ -2152,7 +2152,7 @@ IPicture_Release(image->picture); if (image->decoder) IWICBitmapDecoder_Release(image->decoder); - GdipFree(image->palette); + heap_free(image->palette); return Ok; } @@ -2166,7 +2166,7 @@ status = free_image_data(image); if (status != Ok) return status; image->type = ~0; - GdipFree(image); + heap_free(image); return Ok; } @@ -2874,7 +2874,7 @@ item_size = propvariant_size(&value); if (item_size) { - item = HeapAlloc(GetProcessHeap(), 0, item_size + sizeof(*item)); + item = heap_alloc(item_size + sizeof(*item)); propvariant_to_item(&value, item, item_size + sizeof(*item), id.u.uiVal); buf[i].id = item->id; @@ -2884,7 +2884,7 @@ memcpy(item_value, item->value, item_size); item_value += item_size; - HeapFree(GetProcessHeap(), 0, item); + heap_free(item); } PropVariantClear(&id); @@ -3015,7 +3015,7 @@ if (bitmap->prop_item == NULL) { prop_size = prop_count = 0; - prop_item = GdipAlloc(item->length + sizeof(PropertyItem)); + prop_item = heap_alloc_zero(item->length + sizeof(PropertyItem)); if (!prop_item) return; } else @@ -3025,7 +3025,7 @@ GdipGetPropertySize((GpImage *)bitmap, &prop_size, &prop_count); - prop_item = GdipAlloc(prop_size + item->length + sizeof(PropertyItem)); + prop_item = heap_alloc_zero(prop_size + item->length + sizeof(PropertyItem)); if (!prop_item) return; memcpy(prop_item, bitmap->prop_item, sizeof(PropertyItem) * bitmap->prop_count); prop_size -= sizeof(PropertyItem) * bitmap->prop_count; @@ -3046,7 +3046,7 @@ prop_item[prop_count].value = (char *)(prop_item + prop_count + 1) + prop_size; memcpy(prop_item[prop_count].value, item->value, item->length); - GdipFree(bitmap->prop_item); + heap_free(bitmap->prop_item); bitmap->prop_item = prop_item; bitmap->prop_count++; } @@ -3065,7 +3065,7 @@ PropVariantInit(&value); id.vt = VT_LPWSTR; - id.u.pwszVal = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(prop_name) + 1) * sizeof(WCHAR)); + id.u.pwszVal = CoTaskMemAlloc((lstrlenW(prop_name) + 1) * sizeof(WCHAR)); if (!id.u.pwszVal) return FALSE; lstrcpyW(id.u.pwszVal, prop_name); hr = IWICMetadataReader_GetValue(reader, NULL, &id, &value); @@ -3092,7 +3092,7 @@ PropVariantInit(&value); id.vt = VT_LPWSTR; - id.u.pwszVal = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(prop_name) + 1) * sizeof(WCHAR)); + id.u.pwszVal = CoTaskMemAlloc((lstrlenW(prop_name) + 1) * sizeof(WCHAR)); if (!id.u.pwszVal) return NULL; lstrcpyW(id.u.pwszVal, prop_name); hr = IWICMetadataReader_GetValue(reader, NULL, &id, &value); @@ -3102,10 +3102,10 @@ if (item_size) { item_size += sizeof(*item); - item = GdipAlloc(item_size); + item = heap_alloc_zero(item_size); if (propvariant_to_item(&value, item, item_size, 0) != Ok) { - GdipFree(item); + heap_free(item); item = NULL; } } @@ -3149,7 +3149,7 @@ BYTE *data = appdata->value; if (data[0] == 3 && data[1] == 1) { - loop = GdipAlloc(sizeof(*loop) + sizeof(SHORT)); + loop = heap_alloc_zero(sizeof(*loop) + sizeof(SHORT)); if (loop) { loop->type = PropertyTagTypeShort; @@ -3164,8 +3164,8 @@ } } - GdipFree(appext); - GdipFree(appdata); + heap_free(appext); + heap_free(appdata); return loop; } @@ -3215,7 +3215,7 @@ UINT i; BYTE *rgb; - pal = GdipAlloc(sizeof(*pal) + count * 3); + pal = heap_alloc_zero(sizeof(*pal) + count * 3); if (!pal) return NULL; pal->type = PropertyTagTypeByte; pal->id = PropertyTagGlobalPalette; @@ -3280,7 +3280,7 @@ else if (prop->type == PropertyTagTypeShort && prop->length == 2) value = *(SHORT *)prop->value; - GdipFree(prop); + heap_free(prop); } IWICMetadataReader_Release(reader); } @@ -3306,7 +3306,7 @@ IWICBitmapDecoder_GetFrameCount(decoder, &frame_count); if (frame_count > 1) { - delay = GdipAlloc(sizeof(*delay) + frame_count * sizeof(LONG)); + delay = heap_alloc_zero(sizeof(*delay) + frame_count * sizeof(LONG)); if (delay) { LONG *value; @@ -3363,7 +3363,7 @@ if (frame_count > 1 && !loop) { - loop = GdipAlloc(sizeof(*loop) + sizeof(SHORT)); + loop = heap_alloc_zero(sizeof(*loop) + sizeof(SHORT)); if (loop) { loop->type = PropertyTagTypeShort; @@ -3380,11 +3380,11 @@ if (palette) add_property(bitmap, palette); if (background) add_property(bitmap, background); - GdipFree(delay); - GdipFree(comment); - GdipFree(loop); - GdipFree(palette); - GdipFree(background); + heap_free(delay); + heap_free(comment); + heap_free(loop); + heap_free(palette); + heap_free(background); /* Win7 gdiplus always returns transparent color index from frame 0 */ hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame); @@ -3412,7 +3412,7 @@ } if (transparent_idx) add_property(bitmap, transparent_idx); - GdipFree(transparent_idx); + heap_free(transparent_idx); IWICBitmapFrameDecode_Release(frame); } @@ -3425,10 +3425,10 @@ if (item_size) { item_size += sizeof(*item); - item = GdipAlloc(item_size); + item = heap_alloc_zero(item_size); if (propvariant_to_item(value, item, item_size, propid) != Ok) { - GdipFree(item); + heap_free(item); item = NULL; } } @@ -3518,7 +3518,7 @@ item = create_prop(keywords[j].propid, &value); if (item) add_property(bitmap, item); - GdipFree(item); + heap_free(item); } } @@ -3532,7 +3532,7 @@ if (!seen_gamma) { - item = GdipAlloc(sizeof(PropertyItem) + sizeof(ULONG) * 2); + item = heap_alloc_zero(sizeof(PropertyItem) + sizeof(ULONG) * 2); if (item) { ULONG *rational; @@ -3544,7 +3544,7 @@ rational[1] = get_ulong_by_index(reader, 0); add_property(bitmap, item); seen_gamma = TRUE; - GdipFree(item); + heap_free(item); } } } @@ -3712,7 +3712,7 @@ IWICBitmapDecoder_AddRef(decoder); if (palette) { - GdipFree(bitmap->image.palette); + heap_free(bitmap->image.palette); bitmap->image.palette = palette; } else @@ -3757,7 +3757,7 @@ else if (image->type == ImageTypeMetafile) *(GpMetafile *)image = *(GpMetafile *)new_image; new_image->type = ~0; - GdipFree(new_image); + heap_free(new_image); return Ok; } @@ -3788,14 +3788,14 @@ if(FAILED(hr)) return hr; - new_bits = GdipAlloc(width*height*4); + new_bits = heap_alloc_zero(width*height*4); if(!new_bits) return E_OUTOFMEMORY; hr = IWICBitmapSource_CopyPixels(source, NULL, width*4, width*height*4, new_bits); IWICBitmapSource_Release(source); if(FAILED(hr)) { - GdipFree(new_bits); + heap_free(new_bits); return hr; } @@ -3808,7 +3808,7 @@ *dst = *src; } } - GdipFree(new_bits); + heap_free(new_bits); return hr; } @@ -3838,7 +3838,7 @@ if(bitmap->prop_item[i].id == PropertyTagGlobalPalette) { if(bitmap->prop_item[i].length/3 > bgcolor_idx) { BYTE *color = ((BYTE*)bitmap->prop_item[i].value)+bgcolor_idx*3; - return color[2] + (color[1]<<8) + (color[0]<<16) + (0xff<<24); + return color[2] + (color[1]<<8) + (color[0]<<16) + (0xffu<<24); } break; } @@ -3971,7 +3971,7 @@ return status; if(frame_count > 1) { - GdipFree((*image)->palette); + heap_free((*image)->palette); (*image)->palette = NULL; } return Ok; @@ -3998,7 +3998,7 @@ } /* FIXME: missing initialization code */ - *image = GdipAlloc(sizeof(GpMetafile)); + *image = heap_alloc_zero(sizeof(GpMetafile)); if(!*image) return OutOfMemory; (*image)->type = ImageTypeMetafile; (*image)->decoder = NULL; @@ -4493,10 +4493,10 @@ if(!image || !palette || palette->Count > 256) return InvalidParameter; - new_palette = GdipAlloc(2 * sizeof(UINT) + palette->Count * sizeof(ARGB)); + new_palette = heap_alloc_zero(2 * sizeof(UINT) + palette->Count * sizeof(ARGB)); if (!new_palette) return OutOfMemory; - GdipFree(image->palette); + heap_free(image->palette); image->palette = new_palette; image->palette->Flags = palette->Flags; image->palette->Count = palette->Count; @@ -4977,7 +4977,7 @@ if (!num_palette_entries) retval = GenericError; - palette = GdipAlloc(sizeof(ColorPalette) + sizeof(ARGB) * (num_palette_entries-1)); + palette = heap_alloc_zero(sizeof(ColorPalette) + sizeof(ARGB) * (num_palette_entries-1)); if (!palette) retval = OutOfMemory; @@ -4995,7 +4995,7 @@ retval = GdipSetImagePalette((GpImage*)*bitmap, palette); } - GdipFree(palette); + heap_free(palette); } if (retval != Ok) @@ -5008,6 +5008,24 @@ return retval; } +/***************************************************************************** + * GdipCreateEffect [GDIPLUS.@] + */ +GpStatus WINGDIPAPI GdipCreateEffect(const GUID guid, CGpEffect **effect) +{ + FIXME("(%s, %p): stub\n", debugstr_guid(&guid), effect); + + if(!effect) + return InvalidParameter; + + *effect = NULL; + + return NotImplemented; +} + +/***************************************************************************** + * GdipDeleteEffect [GDIPLUS.@] + */ GpStatus WINGDIPAPI GdipDeleteEffect(CGpEffect *effect) { FIXME("(%p): stub\n", effect); @@ -5250,3 +5268,13 @@ FIXME("(%p, %p): stub\n", image, pabort); return NotImplemented; } + +/***************************************************************************** + * GdipBitmapConvertFormat [GDIPLUS.@] + */ +GpStatus WINGDIPAPI GdipBitmapConvertFormat(GpBitmap *bitmap, PixelFormat format, DitherType dithertype, + PaletteType palettetype, ColorPalette *palette, REAL alphathreshold) +{ + FIXME("(%p, 0x%08x, %d, %d, %p, %f): stub\n", bitmap, format, dithertype, palettetype, palette, alphathreshold); + return NotImplemented; +} diff -Nru wine1.7-1.7.50/dlls/gdiplus/matrix.c wine1.7-1.7.55/dlls/gdiplus/matrix.c --- wine1.7-1.7.50/dlls/gdiplus/matrix.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdiplus/matrix.c 2015-11-13 14:32:40.000000000 +0000 @@ -66,7 +66,7 @@ if(!matrix) return InvalidParameter; - *matrix = GdipAlloc(sizeof(GpMatrix)); + *matrix = heap_alloc_zero(sizeof(GpMatrix)); if(!*matrix) return OutOfMemory; /* first row */ @@ -129,7 +129,7 @@ if(!matrix || !clone) return InvalidParameter; - *clone = GdipAlloc(sizeof(GpMatrix)); + *clone = heap_alloc_zero(sizeof(GpMatrix)); if(!*clone) return OutOfMemory; **clone = *matrix; @@ -144,7 +144,7 @@ if(!matrix) return InvalidParameter; - *matrix = GdipAlloc(sizeof(GpMatrix)); + *matrix = heap_alloc_zero(sizeof(GpMatrix)); if(!*matrix) return OutOfMemory; (*matrix)->matrix[0] = 1.0; @@ -164,7 +164,7 @@ if(!matrix) return InvalidParameter; - GdipFree(matrix); + heap_free(matrix); return Ok; } @@ -380,7 +380,7 @@ if(count <= 0) return InvalidParameter; - ptsF = GdipAlloc(sizeof(GpPointF) * count); + ptsF = heap_alloc_zero(sizeof(GpPointF) * count); if(!ptsF) return OutOfMemory; @@ -396,7 +396,7 @@ pts[i].X = gdip_round(ptsF[i].X); pts[i].Y = gdip_round(ptsF[i].Y); } - GdipFree(ptsF); + heap_free(ptsF); return ret; } @@ -461,7 +461,7 @@ if(count <= 0) return InvalidParameter; - ptsF = GdipAlloc(sizeof(GpPointF) * count); + ptsF = heap_alloc_zero(sizeof(GpPointF) * count); if(!ptsF) return OutOfMemory; @@ -477,7 +477,7 @@ pts[i].X = gdip_round(ptsF[i].X); pts[i].Y = gdip_round(ptsF[i].Y); } - GdipFree(ptsF); + heap_free(ptsF); return ret; } @@ -513,7 +513,7 @@ if(ret == Ok) *result = isIdentity; - GdipFree(e); + heap_free(e); return ret; } diff -Nru wine1.7-1.7.50/dlls/gdiplus/metafile.c wine1.7-1.7.55/dlls/gdiplus/metafile.c --- wine1.7-1.7.50/dlls/gdiplus/metafile.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdiplus/metafile.c 2015-11-13 14:32:40.000000000 +0000 @@ -86,7 +86,7 @@ if (!metafile->comment_data_size) { DWORD data_size = max(256, size * 2 + 4); - metafile->comment_data = GdipAlloc(data_size); + metafile->comment_data = heap_alloc_zero(data_size); if (!metafile->comment_data) return OutOfMemory; @@ -102,7 +102,7 @@ if (size_needed > metafile->comment_data_size) { DWORD data_size = size_needed * 2; - BYTE *new_data = GdipAlloc(data_size); + BYTE *new_data = heap_alloc_zero(data_size); if (!new_data) return OutOfMemory; @@ -110,7 +110,7 @@ memcpy(new_data, metafile->comment_data, metafile->comment_data_length); metafile->comment_data_size = data_size; - GdipFree(metafile->comment_data); + heap_free(metafile->comment_data); metafile->comment_data = new_data; } @@ -193,6 +193,7 @@ MetafileFrameUnit frameUnit, GDIPCONST WCHAR *desc, GpMetafile **metafile) { HDC record_dc; + REAL dpix, dpiy; REAL framerect_factor_x, framerect_factor_y; RECT rc; GpStatus stat; @@ -208,11 +209,14 @@ return NotImplemented; } + dpix = (REAL)GetDeviceCaps(hdc, HORZRES) / GetDeviceCaps(hdc, HORZSIZE) * 25.4; + dpiy = (REAL)GetDeviceCaps(hdc, VERTRES) / GetDeviceCaps(hdc, VERTSIZE) * 25.4; + switch (frameUnit) { case MetafileFrameUnitPixel: - framerect_factor_x = 2540.0 / GetDeviceCaps(hdc, LOGPIXELSX); - framerect_factor_y = 2540.0 / GetDeviceCaps(hdc, LOGPIXELSY); + framerect_factor_x = 2540.0 / dpix; + framerect_factor_y = 2540.0 / dpiy; break; case MetafileFrameUnitPoint: framerect_factor_x = framerect_factor_y = 2540.0 / 72.0; @@ -243,7 +247,7 @@ if (!record_dc) return GenericError; - *metafile = GdipAlloc(sizeof(GpMetafile)); + *metafile = heap_alloc_zero(sizeof(GpMetafile)); if(!*metafile) { DeleteEnhMetaFile(CloseEnhMetaFile(record_dc)); @@ -254,8 +258,8 @@ (*metafile)->image.picture = NULL; (*metafile)->image.flags = ImageFlagsNone; (*metafile)->image.palette = NULL; - (*metafile)->image.xres = 72.0; - (*metafile)->image.yres = 72.0; + (*metafile)->image.xres = dpix; + (*metafile)->image.yres = dpiy; (*metafile)->bounds = *frameRect; (*metafile)->unit = frameUnit; (*metafile)->metafile_type = type; @@ -270,7 +274,7 @@ if (stat != Ok) { DeleteEnhMetaFile(CloseEnhMetaFile(record_dc)); - GdipFree(*metafile); + heap_free(*metafile); *metafile = NULL; return OutOfMemory; } @@ -463,7 +467,7 @@ metafile->hemf = CloseEnhMetaFile(metafile->record_dc); metafile->record_dc = NULL; - GdipFree(metafile->comment_data); + heap_free(metafile->comment_data); metafile->comment_data = NULL; metafile->comment_data_size = 0; @@ -565,7 +569,7 @@ { ENHMETARECORD *record; - record = GdipAlloc(dataSize + 8); + record = heap_alloc_zero(dataSize + 8); if (record) { @@ -576,7 +580,7 @@ PlayEnhMetaFileRecord(metafile->playback_dc, metafile->handle_table, record, metafile->handle_count); - GdipFree(record); + heap_free(record); } else return OutOfMemory; @@ -634,7 +638,7 @@ EmfPlusRect *int_rects = (EmfPlusRect*)(record+1); int i; - rects = temp_rects = GdipAlloc(sizeof(GpRectF) * record->Count); + rects = temp_rects = heap_alloc_zero(sizeof(GpRectF) * record->Count); if (rects) { for (i=0; iCount; i++) @@ -658,7 +662,7 @@ } GdipDeleteBrush(temp_brush); - GdipFree(temp_rects); + heap_free(temp_rects); return stat; } @@ -883,10 +887,28 @@ return GdipEnumerateMetafileDestPoint(graphics, metafile, &ptf, callback, cb_data, attrs); } -static int CALLBACK get_metafile_type_proc(HDC hDC, HANDLETABLE *lpHTable, const ENHMETARECORD *lpEMFR, +GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile(GpMetafile * metafile, + MetafileHeader * header) +{ + static int calls; + + TRACE("(%p, %p)\n", metafile, header); + + if(!metafile || !header) + return InvalidParameter; + + if(!(calls++)) + FIXME("not implemented\n"); + + memset(header, 0, sizeof(MetafileHeader)); + + return Ok; +} + +static int CALLBACK get_emfplus_header_proc(HDC hDC, HANDLETABLE *lpHTable, const ENHMETARECORD *lpEMFR, int nObj, LPARAM lpData) { - MetafileType *result = (MetafileType*)lpData; + EmfPlusHeader *dst_header = (EmfPlusHeader*)lpData; if (lpEMFR->iType == EMR_GDICOMMENT) { @@ -896,61 +918,74 @@ { const EmfPlusRecordHeader *header = (const EmfPlusRecordHeader*)&comment->Data[4]; - if (4 + sizeof(EmfPlusRecordHeader) <= comment->cbData && + if (4 + sizeof(EmfPlusHeader) <= comment->cbData && header->Type == EmfPlusRecordTypeHeader) { - if ((header->Flags & 1) == 1) - *result = MetafileTypeEmfPlusDual; - else - *result = MetafileTypeEmfPlusOnly; + memcpy(dst_header, header, sizeof(*dst_header)); } } - else - *result = MetafileTypeEmf; } - else - *result = MetafileTypeEmf; + else if (lpEMFR->iType == EMR_HEADER) + return TRUE; return FALSE; } -static MetafileType METAFILE_GetEmfType(HENHMETAFILE hemf) -{ - MetafileType result = MetafileTypeInvalid; - EnumEnhMetaFile(NULL, hemf, get_metafile_type_proc, &result, NULL); - return result; -} - -GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile(GpMetafile * metafile, - MetafileHeader * header) +GpStatus WINGDIPAPI GdipGetMetafileHeaderFromEmf(HENHMETAFILE hemf, + MetafileHeader *header) { - static int calls; + ENHMETAHEADER3 emfheader; + EmfPlusHeader emfplusheader; + MetafileType metafile_type; - TRACE("(%p, %p)\n", metafile, header); + TRACE("(%p,%p)\n", hemf, header); - if(!metafile || !header) + if(!hemf || !header) return InvalidParameter; - if(!(calls++)) - FIXME("not implemented\n"); - - memset(header, 0, sizeof(MetafileHeader)); - - return Ok; -} + if (GetEnhMetaFileHeader(hemf, sizeof(emfheader), (ENHMETAHEADER*)&emfheader) == 0) + return GenericError; -GpStatus WINGDIPAPI GdipGetMetafileHeaderFromEmf(HENHMETAFILE hEmf, - MetafileHeader *header) -{ - static int calls; + emfplusheader.Header.Type = 0; - if(!hEmf || !header) - return InvalidParameter; + EnumEnhMetaFile(NULL, hemf, get_emfplus_header_proc, &emfplusheader, NULL); - if(!(calls++)) - FIXME("not implemented\n"); + if (emfplusheader.Header.Type == EmfPlusRecordTypeHeader) + { + if ((emfplusheader.Header.Flags & 1) == 1) + metafile_type = MetafileTypeEmfPlusDual; + else + metafile_type = MetafileTypeEmfPlusOnly; + } + else + metafile_type = MetafileTypeEmf; - memset(header, 0, sizeof(MetafileHeader)); + header->Type = metafile_type; + header->Size = emfheader.nBytes; + header->DpiX = (REAL)emfheader.szlDevice.cx * 25.4 / emfheader.szlMillimeters.cx; + header->DpiY = (REAL)emfheader.szlDevice.cy * 25.4 / emfheader.szlMillimeters.cy; + header->X = gdip_round((REAL)emfheader.rclFrame.left / 2540.0 * header->DpiX); + header->Y = gdip_round((REAL)emfheader.rclFrame.top / 2540.0 * header->DpiY); + header->Width = gdip_round((REAL)(emfheader.rclFrame.right - emfheader.rclFrame.left) / 2540.0 * header->DpiX); + header->Height = gdip_round((REAL)(emfheader.rclFrame.bottom - emfheader.rclFrame.top) / 2540.0 * header->DpiY); + header->EmfHeader = emfheader; + + if (metafile_type == MetafileTypeEmfPlusDual || metafile_type == MetafileTypeEmfPlusOnly) + { + header->Version = emfplusheader.Version; + header->EmfPlusFlags = emfplusheader.EmfPlusFlags; + header->EmfPlusHeaderSize = emfplusheader.Header.Size; + header->LogicalDpiX = emfplusheader.LogicalDpiX; + header->LogicalDpiY = emfplusheader.LogicalDpiY; + } + else + { + header->Version = emfheader.nVersion; + header->EmfPlusFlags = 0; + header->EmfPlusHeaderSize = 0; + header->LogicalDpiX = 0; + header->LogicalDpiY = 0; + } return Ok; } @@ -994,37 +1029,35 @@ GpStatus WINGDIPAPI GdipCreateMetafileFromEmf(HENHMETAFILE hemf, BOOL delete, GpMetafile **metafile) { - ENHMETAHEADER header; - MetafileType metafile_type; + GpStatus stat; + MetafileHeader header; TRACE("(%p,%i,%p)\n", hemf, delete, metafile); if(!hemf || !metafile) return InvalidParameter; - if (GetEnhMetaFileHeader(hemf, sizeof(header), &header) == 0) - return GenericError; - - metafile_type = METAFILE_GetEmfType(hemf); - - if (metafile_type == MetafileTypeInvalid) - return GenericError; + stat = GdipGetMetafileHeaderFromEmf(hemf, &header); + if (stat != Ok) + return stat; - *metafile = GdipAlloc(sizeof(GpMetafile)); + *metafile = heap_alloc_zero(sizeof(GpMetafile)); if (!*metafile) return OutOfMemory; (*metafile)->image.type = ImageTypeMetafile; (*metafile)->image.format = ImageFormatEMF; (*metafile)->image.frame_count = 1; - (*metafile)->image.xres = (REAL)header.szlDevice.cx; - (*metafile)->image.yres = (REAL)header.szlDevice.cy; - (*metafile)->bounds.X = (REAL)header.rclBounds.left; - (*metafile)->bounds.Y = (REAL)header.rclBounds.top; - (*metafile)->bounds.Width = (REAL)(header.rclBounds.right - header.rclBounds.left); - (*metafile)->bounds.Height = (REAL)(header.rclBounds.bottom - header.rclBounds.top); + (*metafile)->image.xres = header.DpiX; + (*metafile)->image.yres = header.DpiY; + (*metafile)->bounds.X = (REAL)header.EmfHeader.rclFrame.left / 2540.0 * header.DpiX; + (*metafile)->bounds.Y = (REAL)header.EmfHeader.rclFrame.top / 2540.0 * header.DpiY; + (*metafile)->bounds.Width = (REAL)(header.EmfHeader.rclFrame.right - header.EmfHeader.rclFrame.left) + / 2540.0 * header.DpiX; + (*metafile)->bounds.Height = (REAL)(header.EmfHeader.rclFrame.bottom - header.EmfHeader.rclFrame.top) + / 2540.0 * header.DpiY; (*metafile)->unit = UnitPixel; - (*metafile)->metafile_type = metafile_type; + (*metafile)->metafile_type = header.Type; (*metafile)->hemf = hemf; (*metafile)->preserve_hemf = !delete; @@ -1043,33 +1076,38 @@ TRACE("(%p, %d, %p, %p)\n", hwmf, delete, placeable, metafile); - if(!hwmf || !metafile || !placeable) + if(!hwmf || !metafile) return InvalidParameter; *metafile = NULL; read = GetMetaFileBitsEx(hwmf, 0, NULL); if(!read) return GenericError; - copy = GdipAlloc(read); + copy = heap_alloc_zero(read); GetMetaFileBitsEx(hwmf, read, copy); hemf = SetWinMetaFileBits(read, copy, NULL, NULL); - GdipFree(copy); + heap_free(copy); /* FIXME: We should store and use hwmf instead of converting to hemf */ retval = GdipCreateMetafileFromEmf(hemf, TRUE, metafile); if (retval == Ok) { - (*metafile)->image.xres = (REAL)placeable->Inch; - (*metafile)->image.yres = (REAL)placeable->Inch; - (*metafile)->bounds.X = ((REAL)placeable->BoundingBox.Left) / ((REAL)placeable->Inch); - (*metafile)->bounds.Y = ((REAL)placeable->BoundingBox.Top) / ((REAL)placeable->Inch); - (*metafile)->bounds.Width = (REAL)(placeable->BoundingBox.Right - - placeable->BoundingBox.Left); - (*metafile)->bounds.Height = (REAL)(placeable->BoundingBox.Bottom - - placeable->BoundingBox.Top); - (*metafile)->metafile_type = MetafileTypeWmfPlaceable; + if (placeable) + { + (*metafile)->image.xres = (REAL)placeable->Inch; + (*metafile)->image.yres = (REAL)placeable->Inch; + (*metafile)->bounds.X = ((REAL)placeable->BoundingBox.Left) / ((REAL)placeable->Inch); + (*metafile)->bounds.Y = ((REAL)placeable->BoundingBox.Top) / ((REAL)placeable->Inch); + (*metafile)->bounds.Width = (REAL)(placeable->BoundingBox.Right - + placeable->BoundingBox.Left); + (*metafile)->bounds.Height = (REAL)(placeable->BoundingBox.Bottom - + placeable->BoundingBox.Top); + (*metafile)->metafile_type = MetafileTypeWmfPlaceable; + } + else + (*metafile)->metafile_type = MetafileTypeWmf; (*metafile)->image.format = ImageFormatWMF; if (delete) DeleteMetaFile(hwmf); @@ -1108,14 +1146,9 @@ GpStatus WINGDIPAPI GdipSetMetafileDownLevelRasterizationLimit(GpMetafile *metafile, UINT limitDpi) { - static int calls; - TRACE("(%p,%u)\n", metafile, limitDpi); - if(!(calls++)) - FIXME("not implemented\n"); - - return NotImplemented; + return Ok; } GpStatus WINGDIPAPI GdipConvertToEmfPlus(const GpGraphics* ref, diff -Nru wine1.7-1.7.50/dlls/gdiplus/pathiterator.c wine1.7-1.7.55/dlls/gdiplus/pathiterator.c --- wine1.7-1.7.50/dlls/gdiplus/pathiterator.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdiplus/pathiterator.c 2015-11-13 14:32:40.000000000 +0000 @@ -40,14 +40,14 @@ if(!iterator) return InvalidParameter; - *iterator = GdipAlloc(sizeof(GpPathIterator)); + *iterator = heap_alloc_zero(sizeof(GpPathIterator)); if(!*iterator) return OutOfMemory; if(path){ size = path->pathdata.Count; - (*iterator)->pathdata.Types = GdipAlloc(size); - (*iterator)->pathdata.Points = GdipAlloc(size * sizeof(PointF)); + (*iterator)->pathdata.Types = heap_alloc_zero(size); + (*iterator)->pathdata.Points = heap_alloc_zero(size * sizeof(PointF)); memcpy((*iterator)->pathdata.Types, path->pathdata.Types, size); memcpy((*iterator)->pathdata.Points, path->pathdata.Points,size * sizeof(PointF)); @@ -73,9 +73,9 @@ if(!iter) return InvalidParameter; - GdipFree(iter->pathdata.Types); - GdipFree(iter->pathdata.Points); - GdipFree(iter); + heap_free(iter->pathdata.Types); + heap_free(iter->pathdata.Points); + heap_free(iter); return Ok; } diff -Nru wine1.7-1.7.50/dlls/gdiplus/pen.c wine1.7-1.7.55/dlls/gdiplus/pen.c --- wine1.7-1.7.50/dlls/gdiplus/pen.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdiplus/pen.c 2015-11-13 14:32:40.000000000 +0000 @@ -94,7 +94,7 @@ if(!pen || !clonepen) return InvalidParameter; - *clonepen = GdipAlloc(sizeof(GpPen)); + *clonepen = heap_alloc_zero(sizeof(GpPen)); if(!*clonepen) return OutOfMemory; **clonepen = *pen; @@ -114,7 +114,7 @@ if (stat == Ok && pen->dashes) { - (*clonepen)->dashes = GdipAlloc(pen->numdashes * sizeof(REAL)); + (*clonepen)->dashes = heap_alloc_zero(pen->numdashes * sizeof(REAL)); if ((*clonepen)->dashes) memcpy((*clonepen)->dashes, pen->dashes, pen->numdashes * sizeof(REAL)); else @@ -158,7 +158,7 @@ if(!pen || !brush) return InvalidParameter; - gp_pen = GdipAlloc(sizeof(GpPen)); + gp_pen = heap_alloc_zero(sizeof(GpPen)); if(!gp_pen) return OutOfMemory; gp_pen->style = GP_DEFAULT_PENSTYLE; @@ -174,7 +174,7 @@ if(!((gp_pen->unit == UnitWorld) || (gp_pen->unit == UnitPixel))) { FIXME("UnitWorld, UnitPixel only supported units\n"); - GdipFree(gp_pen); + heap_free(gp_pen); return NotImplemented; } @@ -197,8 +197,8 @@ GdipDeleteBrush(pen->brush); GdipDeleteCustomLineCap(pen->customstart); GdipDeleteCustomLineCap(pen->customend); - GdipFree(pen->dashes); - GdipFree(pen); + heap_free(pen->dashes); + heap_free(pen); return Ok; } @@ -628,11 +628,11 @@ if(sum == 0.0 && count) return InvalidParameter; - GdipFree(pen->dashes); + heap_free(pen->dashes); pen->dashes = NULL; if(count > 0) - pen->dashes = GdipAlloc(count * sizeof(REAL)); + pen->dashes = heap_alloc_zero(count * sizeof(REAL)); if(!pen->dashes){ pen->numdashes = 0; return OutOfMemory; @@ -678,7 +678,7 @@ return InvalidParameter; if(dash != DashStyleCustom){ - GdipFree(pen->dashes); + heap_free(pen->dashes); pen->dashes = NULL; pen->numdashes = 0; } diff -Nru wine1.7-1.7.50/dlls/gdiplus/region.c wine1.7-1.7.55/dlls/gdiplus/region.c --- wine1.7-1.7.50/dlls/gdiplus/region.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdiplus/region.c 2015-11-13 14:32:40.000000000 +0000 @@ -189,7 +189,7 @@ /* root node is allocated with GpRegion */ if(!*element2){ - *element2 = GdipAlloc(sizeof(region_element)); + *element2 = heap_alloc_zero(sizeof(region_element)); if (!*element2) return OutOfMemory; } @@ -262,7 +262,7 @@ if (!(region && clone)) return InvalidParameter; - *clone = GdipAlloc(sizeof(GpRegion)); + *clone = heap_alloc_zero(sizeof(GpRegion)); if (!*clone) return OutOfMemory; element = &(*clone)->node; @@ -293,11 +293,11 @@ if(mode == CombineModeReplace){ delete_element(®ion->node); memcpy(region, path_region, sizeof(GpRegion)); - GdipFree(path_region); + heap_free(path_region); return Ok; } - left = GdipAlloc(sizeof(region_element)); + left = heap_alloc_zero(sizeof(region_element)); if (left) { *left = region->node; @@ -312,7 +312,7 @@ else stat = OutOfMemory; - GdipFree(left); + heap_free(left); GdipDeleteRegion(path_region); return stat; } @@ -340,11 +340,11 @@ if(mode == CombineModeReplace){ delete_element(®ion->node); memcpy(region, rect_region, sizeof(GpRegion)); - GdipFree(rect_region); + heap_free(rect_region); return Ok; } - left = GdipAlloc(sizeof(region_element)); + left = heap_alloc_zero(sizeof(region_element)); if (left) { memcpy(left, ®ion->node, sizeof(region_element)); @@ -359,7 +359,7 @@ else stat = OutOfMemory; - GdipFree(left); + heap_free(left); GdipDeleteRegion(rect_region); return stat; } @@ -407,11 +407,11 @@ delete_element(®ion1->node); memcpy(region1, reg2copy, sizeof(GpRegion)); - GdipFree(reg2copy); + heap_free(reg2copy); return Ok; } - left = GdipAlloc(sizeof(region_element)); + left = heap_alloc_zero(sizeof(region_element)); if (!left) return OutOfMemory; @@ -419,7 +419,7 @@ stat = clone_element(®ion2->node, &right); if (stat != Ok) { - GdipFree(left); + heap_free(left); return OutOfMemory; } @@ -439,7 +439,7 @@ if(!region) return InvalidParameter; - *region = GdipAlloc(sizeof(GpRegion)); + *region = heap_alloc_zero(sizeof(GpRegion)); if(!*region) return OutOfMemory; @@ -477,7 +477,7 @@ if (!(path && region)) return InvalidParameter; - *region = GdipAlloc(sizeof(GpRegion)); + *region = heap_alloc_zero(sizeof(GpRegion)); if(!*region) return OutOfMemory; stat = init_region(*region, RegionDataPath); @@ -511,7 +511,7 @@ if (!(rect && region)) return InvalidParameter; - *region = GdipAlloc(sizeof(GpRegion)); + *region = heap_alloc_zero(sizeof(GpRegion)); stat = init_region(*region, RegionDataRect); if(stat != Ok) { @@ -563,32 +563,32 @@ if(!region || !(size = GetRegionData(hrgn, 0, NULL))) return InvalidParameter; - buf = GdipAlloc(size); + buf = heap_alloc_zero(size); if(!buf) return OutOfMemory; if(!GetRegionData(hrgn, size, buf)){ - GdipFree(buf); + heap_free(buf); return GenericError; } if(buf->rdh.nCount == 0){ if((stat = GdipCreateRegion(&local)) != Ok){ - GdipFree(buf); + heap_free(buf); return stat; } if((stat = GdipSetEmpty(local)) != Ok){ - GdipFree(buf); + heap_free(buf); GdipDeleteRegion(local); return stat; } *region = local; - GdipFree(buf); + heap_free(buf); return Ok; } if((stat = GdipCreatePath(FillModeAlternate, &path)) != Ok){ - GdipFree(buf); + heap_free(buf); return stat; } @@ -596,7 +596,7 @@ for(i = 0; i < buf->rdh.nCount; i++){ if((stat = GdipAddPathRectangle(path, (REAL)rect->left, (REAL)rect->top, (REAL)(rect->right - rect->left), (REAL)(rect->bottom - rect->top))) != Ok){ - GdipFree(buf); + heap_free(buf); GdipDeletePath(path); return stat; } @@ -605,7 +605,7 @@ stat = GdipCreateRegionPath(path, region); - GdipFree(buf); + heap_free(buf); GdipDeletePath(path); return stat; } @@ -621,7 +621,7 @@ return InvalidParameter; delete_element(®ion->node); - GdipFree(region); + heap_free(region); return Ok; } @@ -906,12 +906,12 @@ { region_element *left, *right; - left = GdipAlloc(sizeof(region_element)); + left = heap_alloc_zero(sizeof(region_element)); if (!left) return OutOfMemory; - right = GdipAlloc(sizeof(region_element)); + right = heap_alloc_zero(sizeof(region_element)); if (!right) { - GdipFree(left); + heap_free(left); return OutOfMemory; } @@ -928,8 +928,8 @@ } } - GdipFree(left); - GdipFree(right); + heap_free(left); + heap_free(right); return status; } @@ -1525,7 +1525,7 @@ { /* Steal the element from the created region. */ memcpy(element, &new_region->node, sizeof(region_element)); - GdipFree(new_region); + heap_free(new_region); } else return stat; @@ -1631,7 +1631,7 @@ { data_size = GetRegionData(hrgn, 0, NULL); - *data = GdipAlloc(data_size); + *data = heap_alloc_zero(data_size); if (*data) GetRegionData(hrgn, data_size, *data); @@ -1644,7 +1644,7 @@ { data_size = sizeof(RGNDATAHEADER) + sizeof(RECT); - *data = GdipAlloc(data_size); + *data = heap_alloc_zero(data_size); if (*data) { @@ -1683,7 +1683,7 @@ if (stat == Ok) { *count = data->rdh.nCount; - GdipFree(data); + heap_free(data); } return stat; @@ -1717,7 +1717,7 @@ } } - GdipFree(data); + heap_free(data); } return Ok; @@ -1751,7 +1751,7 @@ } } - GdipFree(data); + heap_free(data); } return Ok; diff -Nru wine1.7-1.7.50/dlls/gdiplus/stringformat.c wine1.7-1.7.55/dlls/gdiplus/stringformat.c --- wine1.7-1.7.50/dlls/gdiplus/stringformat.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdiplus/stringformat.c 2015-11-13 14:32:40.000000000 +0000 @@ -40,7 +40,7 @@ if(!format) return InvalidParameter; - *format = GdipAlloc(sizeof(GpStringFormat)); + *format = heap_alloc_zero(sizeof(GpStringFormat)); if(!*format) return OutOfMemory; (*format)->attr = attr; @@ -66,9 +66,9 @@ if(!format) return InvalidParameter; - GdipFree(format->character_ranges); - GdipFree(format->tabs); - GdipFree(format); + heap_free(format->character_ranges); + heap_free(format->tabs); + heap_free(format); return Ok; } @@ -260,11 +260,11 @@ TRACE("%p, %d, %p\n", format, rangeCount, ranges); - new_ranges = GdipAlloc(rangeCount * sizeof(CharacterRange)); + new_ranges = heap_alloc_zero(rangeCount * sizeof(CharacterRange)); if (!new_ranges) return OutOfMemory; - GdipFree(format->character_ranges); + heap_free(format->character_ranges); format->character_ranges = new_ranges; memcpy(format->character_ranges, ranges, sizeof(CharacterRange) * rangeCount); format->range_count = rangeCount; @@ -284,14 +284,14 @@ if(firsttab < 0.0) return NotImplemented; /* first time allocation */ if(format->tabcount == 0){ - format->tabs = GdipAlloc(sizeof(REAL)*count); + format->tabs = heap_alloc_zero(sizeof(REAL)*count); if(!format->tabs) return OutOfMemory; } /* reallocation */ if((format->tabcount < count) && (format->tabcount > 0)){ REAL *ptr; - ptr = HeapReAlloc(GetProcessHeap(), 0, format->tabs, sizeof(REAL)*count); + ptr = heap_realloc(format->tabs, sizeof(REAL)*count); if(!ptr) return OutOfMemory; format->tabs = ptr; @@ -334,15 +334,15 @@ if(!format || !newFormat) return InvalidParameter; - *newFormat = GdipAlloc(sizeof(GpStringFormat)); + *newFormat = heap_alloc_zero(sizeof(GpStringFormat)); if(!*newFormat) return OutOfMemory; **newFormat = *format; if(format->tabcount > 0){ - (*newFormat)->tabs = GdipAlloc(sizeof(REAL) * format->tabcount); + (*newFormat)->tabs = heap_alloc_zero(sizeof(REAL) * format->tabcount); if(!(*newFormat)->tabs){ - GdipFree(*newFormat); + heap_free(*newFormat); return OutOfMemory; } memcpy((*newFormat)->tabs, format->tabs, sizeof(REAL) * format->tabcount); @@ -351,10 +351,10 @@ (*newFormat)->tabs = NULL; if(format->range_count > 0){ - (*newFormat)->character_ranges = GdipAlloc(sizeof(CharacterRange) * format->range_count); + (*newFormat)->character_ranges = heap_alloc_zero(sizeof(CharacterRange) * format->range_count); if(!(*newFormat)->character_ranges){ - GdipFree((*newFormat)->tabs); - GdipFree(*newFormat); + heap_free((*newFormat)->tabs); + heap_free(*newFormat); return OutOfMemory; } memcpy((*newFormat)->character_ranges, format->character_ranges, diff -Nru wine1.7-1.7.50/dlls/gdiplus/tests/image.c wine1.7-1.7.55/dlls/gdiplus/tests/image.c --- wine1.7-1.7.50/dlls/gdiplus/tests/image.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdiplus/tests/image.c 2015-11-13 14:32:40.000000000 +0000 @@ -1544,6 +1544,22 @@ GdipDisposeImage(img); } +static void test_createfromwmf_noplaceable(void) +{ + HMETAFILE hwmf; + GpImage *img; + GpStatus stat; + + hwmf = SetMetaFileBitsEx(sizeof(wmfimage)-sizeof(WmfPlaceableFileHeader), + wmfimage+sizeof(WmfPlaceableFileHeader)); + ok(hwmf != 0, "SetMetaFileBitsEx failed\n"); + + stat = GdipCreateMetafileFromWmf(hwmf, TRUE, NULL, (GpMetafile**)&img); + expect(Ok, stat); + + GdipDisposeImage(img); +} + static void test_resolution(void) { GpStatus stat; @@ -2700,6 +2716,7 @@ expect(0, color); stat = GdipImageSelectActiveFrame((GpImage*)bmp, &dimension, 3); + expect(Ok, stat); stat = GdipBitmapGetPixel(bmp, 2, 0, &color); expect(Ok, stat); ok(color==0 || broken(color==0xff0000ff), "color = %x\n", color); @@ -3998,6 +4015,50 @@ expect(Ok, status); } +static void test_DrawImage_SourceCopy(void) +{ + DWORD dst_pixels[4] = { 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff }; + DWORD src_pixels[4] = { 0, 0xffff0000, + 0, 0xff00ff }; + + GpStatus status; + union + { + GpBitmap *bitmap; + GpImage *image; + } u1, u2; + GpGraphics *graphics; + + status = GdipCreateBitmapFromScan0(2, 2, 8, PixelFormat32bppARGB, (BYTE*)dst_pixels, &u1.bitmap); + expect(Ok, status); + + status = GdipCreateBitmapFromScan0(2, 2, 8, PixelFormat32bppARGB, (BYTE*)src_pixels, &u2.bitmap); + expect(Ok, status); + status = GdipGetImageGraphicsContext(u1.image, &graphics); + expect(Ok, status); + status = GdipSetInterpolationMode(graphics, InterpolationModeNearestNeighbor); + expect(Ok, status); + + status = GdipSetCompositingMode(graphics, CompositingModeSourceCopy); + expect(Ok, status); + + status = GdipDrawImageI(graphics, u2.image, 0, 0); + expect(Ok, status); + + todo_wine expect(0, dst_pixels[0]); + expect(0xffff0000, dst_pixels[1]); + todo_wine expect(0, dst_pixels[2]); + todo_wine expect(0, dst_pixels[3]); + + status = GdipDeleteGraphics(graphics); + expect(Ok, status); + status = GdipDisposeImage(u1.image); + expect(Ok, status); + status = GdipDisposeImage(u2.image); + expect(Ok, status); +} + static void test_GdipDrawImagePointRect(void) { BYTE black_1x1[4] = { 0,0,0,0 }; @@ -4629,6 +4690,47 @@ GdipDisposeImage((GpImage *)bm); } +static void test_createeffect(void) +{ + static const GUID noneffect = { 0xcd0c3d4b, 0xe15e, 0x4cf2, { 0x9e, 0xa8, 0x6e, 0x1d, 0x65, 0x48, 0xc5, 0xa5 } }; + GpStatus (WINAPI *pGdipCreateEffect)( const GUID guid, CGpEffect **effect); + GpStatus (WINAPI *pGdipDeleteEffect)( CGpEffect *effect); + GpStatus stat; + CGpEffect *effect; + HMODULE mod = GetModuleHandleA("gdiplus.dll"); + int i; + const GUID effectlist[] = + {BlurEffectGuid, SharpenEffectGuid, ColorMatrixEffectGuid, ColorLUTEffectGuid, + BrightnessContrastEffectGuid, HueSaturationLightnessEffectGuid, LevelsEffectGuid, + TintEffectGuid, ColorBalanceEffectGuid, RedEyeCorrectionEffectGuid, ColorCurveEffectGuid}; + + pGdipCreateEffect = (void*)GetProcAddress( mod, "GdipCreateEffect"); + pGdipDeleteEffect = (void*)GetProcAddress( mod, "GdipDeleteEffect"); + if(!pGdipCreateEffect || !pGdipDeleteEffect) + { + /* GdipCreateEffect/GdipDeleteEffect was introduced in Windows Vista. */ + win_skip("GDIPlus version 1.1 not available\n"); + return; + } + + stat = pGdipCreateEffect(BlurEffectGuid, NULL); + expect(InvalidParameter, stat); + + stat = pGdipCreateEffect(noneffect, &effect); + todo_wine expect(Win32Error, stat); + + for(i=0; i < sizeof(effectlist) / sizeof(GUID); i++) + { + stat = pGdipCreateEffect(effectlist[i], &effect); + todo_wine expect(Ok, stat); + if(stat == Ok) + { + stat = pGdipDeleteEffect(effect); + expect(Ok, stat); + } + } +} + START_TEST(image) { struct GdiplusStartupInput gdiplusStartupInput; @@ -4647,6 +4749,7 @@ test_DrawImage_scale(); test_image_format(); test_DrawImage(); + test_DrawImage_SourceCopy(); test_GdipDrawImagePointRect(); test_bitmapbits(); test_tiff_palette(); @@ -4671,6 +4774,7 @@ test_getrawformat(); test_loadwmf(); test_createfromwmf(); + test_createfromwmf_noplaceable(); test_resolution(); test_createhbitmap(); test_getthumbnail(); @@ -4683,6 +4787,7 @@ test_remaptable(); test_colorkey(); test_dispose(); + test_createeffect(); GdiplusShutdown(gdiplusToken); } diff -Nru wine1.7-1.7.50/dlls/gdiplus/tests/metafile.c wine1.7-1.7.55/dlls/gdiplus/tests/metafile.c --- wine1.7-1.7.50/dlls/gdiplus/tests/metafile.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/gdiplus/tests/metafile.c 2015-11-13 14:32:40.000000000 +0000 @@ -25,7 +25,8 @@ #include "wine/test.h" #define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got) -#define expectf(expected, got) ok(fabs((expected) - (got)) < 0.0001, "Expected %f, got %f\n", (expected), (got)) +#define expectf_(expected, got, precision) ok(fabs((expected) - (got)) <= (precision), "Expected %f, got %f\n", (expected), (got)) +#define expectf(expected, got) expectf_((expected), (got), 0.001) static BOOL save_metafiles; @@ -287,8 +288,11 @@ GpMetafile *metafile; GpGraphics *graphics; HDC hdc; + GpRectF bounds; + GpUnit unit; + REAL xres, yres; HENHMETAFILE hemf, dummy; - BOOL ret; + MetafileHeader header; static const GpRectF frame = {0.0, 0.0, 100.0, 100.0}; static const GpPointF dst_points[3] = {{0.0,0.0},{100.0,0.0},{0.0,100.0}}; static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; @@ -337,6 +341,20 @@ save_metafile(metafile, "empty.emf"); + stat = GdipGetImageBounds((GpImage*)metafile, &bounds, &unit); + expect(Ok, stat); + expectf(0.0, bounds.X); + expectf(0.0, bounds.Y); + expectf_(100.0, bounds.Width, 0.05); + expectf_(100.0, bounds.Height, 0.05); + expect(UnitPixel, unit); + + stat = GdipGetImageHorizontalResolution((GpImage*)metafile, &xres); + expect(Ok, stat); + + stat = GdipGetImageVerticalResolution((GpImage*)metafile, &yres); + expect(Ok, stat); + stat = GdipGetHemfFromMetafile(metafile, &hemf); expect(Ok, stat); @@ -348,8 +366,55 @@ check_emfplus(hemf, empty_records, "empty emf"); - ret = DeleteEnhMetaFile(hemf); - ok(ret != 0, "Failed to delete enhmetafile %p\n", hemf); + memset(&header, 0xaa, sizeof(header)); + stat = GdipGetMetafileHeaderFromEmf(hemf, &header); + expect(Ok, stat); + expect(MetafileTypeEmfPlusOnly, header.Type); + expect(U(header).EmfHeader.nBytes, header.Size); + ok(header.Version == 0xdbc01001 || header.Version == 0xdbc01002, "Unexpected version %x\n", header.Version); + expect(1, header.EmfPlusFlags); /* reference device was display, not printer */ + expectf(xres, header.DpiX); + expectf(xres, U(header).EmfHeader.szlDevice.cx / (REAL)U(header).EmfHeader.szlMillimeters.cx * 25.4); + expectf(yres, header.DpiY); + expectf(yres, U(header).EmfHeader.szlDevice.cy / (REAL)U(header).EmfHeader.szlMillimeters.cy * 25.4); + expect(0, header.X); + expect(0, header.Y); + expect(100, header.Width); + expect(100, header.Height); + expect(28, header.EmfPlusHeaderSize); + expect(96, header.LogicalDpiX); + expect(96, header.LogicalDpiX); + expect(EMR_HEADER, U(header).EmfHeader.iType); + expect(0, U(header).EmfHeader.rclBounds.left); + expect(0, U(header).EmfHeader.rclBounds.top); + expect(-1, U(header).EmfHeader.rclBounds.right); + expect(-1, U(header).EmfHeader.rclBounds.bottom); + expect(0, U(header).EmfHeader.rclFrame.left); + expect(0, U(header).EmfHeader.rclFrame.top); + expectf_(100.0, U(header).EmfHeader.rclFrame.right * xres / 2540.0, 2.0); + expectf_(100.0, U(header).EmfHeader.rclFrame.bottom * yres / 2540.0, 2.0); + + stat = GdipCreateMetafileFromEmf(hemf, TRUE, &metafile); + expect(Ok, stat); + + stat = GdipGetImageBounds((GpImage*)metafile, &bounds, &unit); + expect(Ok, stat); + expectf(0.0, bounds.X); + expectf(0.0, bounds.Y); + expectf_(100.0, bounds.Width, 0.05); + expectf_(100.0, bounds.Height, 0.05); + expect(UnitPixel, unit); + + stat = GdipGetImageHorizontalResolution((GpImage*)metafile, &xres); + expect(Ok, stat); + expectf(header.DpiX, xres); + + stat = GdipGetImageVerticalResolution((GpImage*)metafile, &yres); + expect(Ok, stat); + expectf(header.DpiY, yres); + + stat = GdipDisposeImage((GpImage*)metafile); + expect(Ok, stat); } static const emfplus_record getdc_records[] = { @@ -508,8 +573,11 @@ GpImage *clone; GpGraphics *graphics; HDC hdc, metafile_dc; + GpRectF bounds; + GpUnit unit; + REAL xres, yres; HENHMETAFILE hemf; - BOOL ret; + MetafileHeader header; static const GpRectF frame = {0.0, 0.0, 100.0, 100.0}; static const GpPointF dst_points[3] = {{0.0,0.0},{100.0,0.0},{0.0,100.0}}; static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; @@ -563,6 +631,20 @@ save_metafile(metafile, "emfonly.emf"); + stat = GdipGetImageBounds((GpImage*)metafile, &bounds, &unit); + expect(Ok, stat); + expectf(0.0, bounds.X); + expectf(0.0, bounds.Y); + expectf_(100.0, bounds.Width, 0.05); + expectf_(100.0, bounds.Height, 0.05); + expect(UnitPixel, unit); + + stat = GdipGetImageHorizontalResolution((GpImage*)metafile, &xres); + expect(Ok, stat); + + stat = GdipGetImageVerticalResolution((GpImage*)metafile, &yres); + expect(Ok, stat); + stat = GdipCreateBitmapFromScan0(100, 100, 0, PixelFormat32bppARGB, NULL, &bitmap); expect(Ok, stat); @@ -631,8 +713,55 @@ check_emfplus(hemf, emfonly_records, "emfonly emf"); - ret = DeleteEnhMetaFile(hemf); - ok(ret != 0, "Failed to delete enhmetafile %p\n", hemf); + memset(&header, 0xaa, sizeof(header)); + stat = GdipGetMetafileHeaderFromEmf(hemf, &header); + expect(Ok, stat); + expect(MetafileTypeEmf, header.Type); + expect(U(header).EmfHeader.nBytes, header.Size); + expect(0x10000, header.Version); + expect(0, header.EmfPlusFlags); + expectf(xres, header.DpiX); + expectf(xres, U(header).EmfHeader.szlDevice.cx / (REAL)U(header).EmfHeader.szlMillimeters.cx * 25.4); + expectf(yres, header.DpiY); + expectf(yres, U(header).EmfHeader.szlDevice.cy / (REAL)U(header).EmfHeader.szlMillimeters.cy * 25.4); + expect(0, header.X); + expect(0, header.Y); + expect(100, header.Width); + expect(100, header.Height); + expect(0, header.EmfPlusHeaderSize); + expect(0, header.LogicalDpiX); + expect(0, header.LogicalDpiX); + expect(EMR_HEADER, U(header).EmfHeader.iType); + expect(25, U(header).EmfHeader.rclBounds.left); + expect(25, U(header).EmfHeader.rclBounds.top); + expect(74, U(header).EmfHeader.rclBounds.right); + expect(74, U(header).EmfHeader.rclBounds.bottom); + expect(0, U(header).EmfHeader.rclFrame.left); + expect(0, U(header).EmfHeader.rclFrame.top); + expectf_(100.0, U(header).EmfHeader.rclFrame.right * xres / 2540.0, 2.0); + expectf_(100.0, U(header).EmfHeader.rclFrame.bottom * yres / 2540.0, 2.0); + + stat = GdipCreateMetafileFromEmf(hemf, TRUE, &metafile); + expect(Ok, stat); + + stat = GdipGetImageBounds((GpImage*)metafile, &bounds, &unit); + expect(Ok, stat); + expectf(0.0, bounds.X); + expectf(0.0, bounds.Y); + expectf_(100.0, bounds.Width, 0.05); + expectf_(100.0, bounds.Height, 0.05); + expect(UnitPixel, unit); + + stat = GdipGetImageHorizontalResolution((GpImage*)metafile, &xres); + expect(Ok, stat); + expectf(header.DpiX, xres); + + stat = GdipGetImageVerticalResolution((GpImage*)metafile, &yres); + expect(Ok, stat); + expectf(header.DpiY, yres); + + stat = GdipDisposeImage((GpImage*)metafile); + expect(Ok, stat); } static const emfplus_record fillrect_records[] = { diff -Nru wine1.7-1.7.50/dlls/hid/hidd.c wine1.7-1.7.55/dlls/hid/hidd.c --- wine1.7-1.7.50/dlls/hid/hidd.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/hid/hidd.c 2015-11-13 14:32:40.000000000 +0000 @@ -99,6 +99,12 @@ return DeviceIoControl(HidDeviceObject, IOCTL_HID_GET_PRODUCT_STRING, NULL, 0, Buffer, BufferLength, NULL, NULL); } +BOOLEAN WINAPI HidD_GetSerialNumberString(HANDLE HidDeviceObject, PVOID Buffer, ULONG BufferLength) +{ + TRACE("(%p %p %u)\n", HidDeviceObject, Buffer, BufferLength); + return DeviceIoControl(HidDeviceObject, IOCTL_HID_GET_SERIALNUMBER_STRING, NULL, 0, Buffer, BufferLength, NULL, NULL); +} + BOOLEAN WINAPI HidD_GetPreparsedData(HANDLE HidDeviceObject, PHIDP_PREPARSED_DATA *PreparsedData) { HID_COLLECTION_INFORMATION info; diff -Nru wine1.7-1.7.50/dlls/hid/hid.spec wine1.7-1.7.55/dlls/hid/hid.spec --- wine1.7-1.7.50/dlls/hid/hid.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/hid/hid.spec 2015-11-13 14:32:40.000000000 +0000 @@ -12,7 +12,7 @@ @ stub HidD_GetPhysicalDescriptor @ stdcall HidD_GetPreparsedData(ptr ptr) @ stdcall HidD_GetProductString(long ptr long) -@ stub HidD_GetSerialNumberString +@ stdcall HidD_GetSerialNumberString(long ptr long) @ stub HidD_Hello @ stub HidD_SetConfiguration @ stdcall HidD_SetFeature(long ptr long) diff -Nru wine1.7-1.7.50/dlls/hidclass.sys/buffer.c wine1.7-1.7.55/dlls/hidclass.sys/buffer.c --- wine1.7-1.7.50/dlls/hidclass.sys/buffer.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/hidclass.sys/buffer.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,198 @@ +/* Implementation of a ring buffer for reports + * + * Copyright 2015 CodeWeavers, Aric Stewart + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" +#include +#define NONAMELESSUNION +#include "hid.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(hid); + +#define BASE_BUFFER_SIZE 32 +#define MIN_BUFFER_SIZE 2 +#define MAX_BUFFER_SIZE 512 + +struct ReportRingBuffer +{ + UINT start, end, size; + + int *pointers; + UINT pointer_alloc; + UINT buffer_size; + + CRITICAL_SECTION lock; + + BYTE *buffer; +}; + +struct ReportRingBuffer* RingBuffer_Create(UINT buffer_size) +{ + struct ReportRingBuffer *ring; + TRACE("Create Ring Buffer with buffer size %i\n",buffer_size); + ring = HeapAlloc(GetProcessHeap(), 0, sizeof(*ring)); + if (!ring) + return NULL; + ring->start = ring->end = 0; + ring->size = BASE_BUFFER_SIZE; + ring->buffer_size = buffer_size; + ring->pointer_alloc = 2; + ring->pointers = HeapAlloc(GetProcessHeap(), 0, sizeof(int) * ring->pointer_alloc); + if (!ring->pointers) + { + HeapFree(GetProcessHeap(), 0, ring); + return NULL; + } + memset(ring->pointers, 0xff, sizeof(int) * ring->pointer_alloc); + ring->buffer = HeapAlloc(GetProcessHeap(), 0, buffer_size * ring->size); + if (!ring->buffer) + { + HeapFree(GetProcessHeap(), 0, ring->pointers); + HeapFree(GetProcessHeap(), 0, ring); + return NULL; + } + InitializeCriticalSection(&ring->lock); + ring->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": RingBuffer.lock"); + return ring; +} + +void RingBuffer_Destroy(struct ReportRingBuffer *ring) +{ + HeapFree(GetProcessHeap(), 0, ring->buffer); + HeapFree(GetProcessHeap(), 0, ring->pointers); + ring->lock.DebugInfo->Spare[0] = 0; + DeleteCriticalSection(&ring->lock); + HeapFree(GetProcessHeap(), 0, ring); +} + +UINT RingBuffer_GetBufferSize(struct ReportRingBuffer *ring) +{ + return ring->buffer_size; +} + +UINT RingBuffer_GetSize(struct ReportRingBuffer *ring) +{ + return ring->size; +} + +NTSTATUS RingBuffer_SetSize(struct ReportRingBuffer *ring, UINT size) +{ + BYTE* new_buffer; + int i; + + if (size < MIN_BUFFER_SIZE || size > MAX_BUFFER_SIZE || size == ring->size) + return STATUS_INVALID_PARAMETER; + + EnterCriticalSection(&ring->lock); + ring->start = ring->end = 0; + for (i = 0; i < ring->pointer_alloc; i++) + { + if (ring->pointers[i] != 0xffffffff) + ring->pointers[i] = 0; + } + new_buffer = HeapAlloc(GetProcessHeap(), 0, ring->buffer_size * size); + if (!new_buffer) + { + LeaveCriticalSection(&ring->lock); + return STATUS_NO_MEMORY; + } + HeapFree(GetProcessHeap(), 0, ring->buffer); + ring->buffer = new_buffer; + ring->size = size; + LeaveCriticalSection(&ring->lock); + return STATUS_SUCCESS; +} + +void RingBuffer_Read(struct ReportRingBuffer *ring, UINT index, void *output, UINT *size) +{ + void *ret = NULL; + + EnterCriticalSection(&ring->lock); + if (index >= ring->pointer_alloc || ring->pointers[index] == 0xffffffff) + { + LeaveCriticalSection(&ring->lock); + *size = 0; + return; + } + if (ring->pointers[index] == ring->end) + { + LeaveCriticalSection(&ring->lock); + *size = 0; + } + else + { + ret = &ring->buffer[ring->pointers[index] * ring->buffer_size]; + memcpy(output, ret, ring->buffer_size); + ring->pointers[index]++; + if (ring->pointers[index] == ring->size) + ring->pointers[index] = 0; + LeaveCriticalSection(&ring->lock); + *size = ring->buffer_size; + } +} + +UINT RingBuffer_AddPointer(struct ReportRingBuffer *ring) +{ + UINT idx; + EnterCriticalSection(&ring->lock); + for (idx = 0; idx < ring->pointer_alloc; idx++) + if (ring->pointers[idx] == -1) + break; + if (idx >= ring->pointer_alloc) + { + int count = idx = ring->pointer_alloc; + ring->pointer_alloc *= 2; + ring->pointers = HeapReAlloc(GetProcessHeap(), 0, ring->pointers, sizeof(int) * ring->pointer_alloc); + for( ;count < ring->pointer_alloc; count++) + ring->pointers[count] = -1; + } + ring->pointers[idx] = ring->start; + LeaveCriticalSection(&ring->lock); + return idx; +} + +void RingBuffer_RemovePointer(struct ReportRingBuffer *ring, UINT index) +{ + EnterCriticalSection(&ring->lock); + if (index < ring->pointer_alloc) + ring->pointers[index] = 0xffffffff; + LeaveCriticalSection(&ring->lock); +} + +void RingBuffer_Write(struct ReportRingBuffer *ring, void *data) +{ + UINT i; + + EnterCriticalSection(&ring->lock); + memcpy(&ring->buffer[ring->end * ring->buffer_size], data, ring->buffer_size); + ring->end++; + if (ring->end == ring->size) + ring->end = 0; + if (ring->start == ring->end) + { + ring->start++; + if (ring->start == ring->size) + ring->start = 0; + } + for (i = 0; i < ring->pointer_alloc; i++) + if (ring->pointers[i] == ring->end) + ring->pointers[i] = ring->start; + LeaveCriticalSection(&ring->lock); +} diff -Nru wine1.7-1.7.50/dlls/hidclass.sys/descriptor.c wine1.7-1.7.55/dlls/hidclass.sys/descriptor.c --- wine1.7-1.7.50/dlls/hidclass.sys/descriptor.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/hidclass.sys/descriptor.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,1123 @@ +/* + * HID descriptor parsing + * + * Copyright (C) 2015 Aric Stewart + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" + +#include +#include +#include +#define NONAMELESSUNION +#include "hid.h" + +#include "wine/debug.h" +#include "wine/list.h" + +WINE_DEFAULT_DEBUG_CHANNEL(hid); + +#define USAGE_MAX 10 + +/* Flags that are defined in the document + "Device Class Definition for Human Interface Devices" */ +enum { + INPUT_DATA_CONST = 0x01, /* Data (0) | Constant (1) */ + INPUT_ARRAY_VAR = 0x02, /* Array (0) | Variable (1) */ + INPUT_ABS_REL = 0x04, /* Absolute (0) | Relative (1) */ + INPUT_WRAP = 0x08, /* No Wrap (0) | Wrap (1) */ + INPUT_LINEAR = 0x10, /* Linear (0) | Non Linear (1) */ + INPUT_PREFSTATE = 0x20, /* Preferred State (0) | No Preferred (1) */ + INPUT_NULL = 0x40, /* No Null position (0) | Null state(1) */ + INPUT_VOLATILE = 0x80, /* Non Volatile (0) | Volatile (1) */ + INPUT_BITFIELD = 0x100 /* Bit Field (0) | Buffered Bytes (1) */ +}; + +enum { + TAG_TYPE_MAIN = 0x0, + TAG_TYPE_GLOBAL, + TAG_TYPE_LOCAL, + TAG_TYPE_RESERVED, +}; + +enum { + TAG_MAIN_INPUT = 0x08, + TAG_MAIN_OUTPUT = 0x09, + TAG_MAIN_FEATURE = 0x0B, + TAG_MAIN_COLLECTION = 0x0A, + TAG_MAIN_END_COLLECTION = 0x0C +}; + +enum { + TAG_GLOBAL_USAGE_PAGE = 0x0, + TAG_GLOBAL_LOGICAL_MINIMUM, + TAG_GLOBAL_LOGICAL_MAXIMUM, + TAG_GLOBAL_PHYSICAL_MINIMUM, + TAG_GLOBAL_PHYSICAL_MAXIMUM, + TAG_GLOBAL_UNIT_EXPONENT, + TAG_GLOBAL_UNIT, + TAG_GLOBAL_REPORT_SIZE, + TAG_GLOBAL_REPORT_ID, + TAG_GLOBAL_REPORT_COUNT, + TAG_GLOBAL_PUSH, + TAG_GLOBAL_POP +}; + +enum { + TAG_LOCAL_USAGE = 0x0, + TAG_LOCAL_USAGE_MINIMUM, + TAG_LOCAL_USAGE_MAXIMUM, + TAG_LOCAL_DESIGNATOR_INDEX, + TAG_LOCAL_DESIGNATOR_MINIMUM, + TAG_LOCAL_DESIGNATOR_MAXIMUM, + TAG_LOCAL_STRING_INDEX, + TAG_LOCAL_STRING_MINIMUM, + TAG_LOCAL_STRING_MAXIMUM, + TAG_LOCAL_DELIMITER +}; + + +static const char* const feature_string[] = + { "Input", "Output", "Feature" }; + +struct caps { + USAGE UsagePage; + LONG LogicalMin; + LONG LogicalMax; + LONG PhysicalMin; + LONG PhysicalMax; + ULONG UnitsExp; + ULONG Units; + USHORT BitSize; + UCHAR ReportID; + USHORT ReportCount; + + BOOLEAN IsRange; + BOOLEAN IsStringRange; + BOOLEAN IsDesignatorRange; + unsigned int usage_count; + union { + struct { + USAGE UsageMin; + USAGE UsageMax; + USHORT StringMin; + USHORT StringMax; + USHORT DesignatorMin; + USHORT DesignatorMax; + } Range; + struct { + USAGE Usage[USAGE_MAX]; + USAGE Reserved1; + USHORT StringIndex; + USHORT Reserved2; + USHORT DesignatorIndex; + USHORT Reserved3; + } NotRange; + } DUMMYUNIONNAME; + + int Delim; +}; + +struct feature { + struct list entry; + struct list col_entry; + struct caps caps; + + HIDP_REPORT_TYPE type; + BOOLEAN isData; + BOOLEAN isArray; + BOOLEAN IsAbsolute; + BOOLEAN Wrap; + BOOLEAN Linear; + BOOLEAN prefState; + BOOLEAN HasNull; + BOOLEAN Volatile; + BOOLEAN BitField; + + unsigned int index; + struct collection *collection; +}; + +static const char* const collection_string[] = { + "Physical", + "Application", + "Logical", + "Report", + "Named Array", + "Usage Switch", + "Usage Modifier", +}; + +struct collection { + struct list entry; + struct caps caps; + unsigned int index; + unsigned int type; + struct collection *parent; + struct list features; + struct list collections; +}; + +static const char* debugstr_usages(struct caps *caps) +{ + if (!caps->IsRange) + { + char out[12 * USAGE_MAX]; + unsigned int i; + if (caps->usage_count == 0) + return "[ none ]"; + out[0] = 0; + for (i = 0; i < caps->usage_count; i++) + sprintf(out + strlen(out), "0x%x ", caps->u.NotRange.Usage[i]); + return wine_dbg_sprintf("[ %s] ", out); + } + else + return wine_dbg_sprintf("[0x%x - 0x%x]", caps->u.Range.UsageMin, caps->u.Range.UsageMax); +} + +static const char* debugstr_stringindex(struct caps *caps) +{ + if (!caps->IsStringRange) + return wine_dbg_sprintf("%i", caps->u.NotRange.StringIndex); + else + return wine_dbg_sprintf("[%i - %i]", caps->u.Range.StringMin, caps->u.Range.StringMax); +} + +static const char* debugstr_designatorindex(struct caps *caps) +{ + if (!caps->IsDesignatorRange) + return wine_dbg_sprintf("%i", caps->u.NotRange.DesignatorIndex); + else + return wine_dbg_sprintf("[%i - %i]", caps->u.Range.DesignatorMin, caps->u.Range.DesignatorMax); +} + +static void debugstr_caps(const char* type, struct caps *caps) +{ + if (!caps) + return; + TRACE("(%s Caps: UsagePage 0x%x; LogicalMin %i; LogicalMax %i; PhysicalMin %i; PhysicalMax %i; UnitsExp %i; Units %i; BitSize %i; ReportID %i; ReportCount %i; Usage %s; StringIndex %s; DesignatorIndex %s; Delim %i;)\n", + type, + caps->UsagePage, + caps->LogicalMin, + caps->LogicalMax, + caps->PhysicalMin, + caps->PhysicalMax, + caps->UnitsExp, + caps->Units, + caps->BitSize, + caps->ReportID, + caps->ReportCount, + debugstr_usages(caps), + debugstr_stringindex(caps), + debugstr_designatorindex(caps), + caps->Delim); +} + +static void debug_feature(struct feature *feature) +{ + if (!feature) + return; + TRACE("[Feature type %s [%i]; %s; %s; %s; %s; %s; %s; %s; %s; %s]\n", + feature_string[feature->type], + feature->index, + (feature->isData)?"Data":"Const", + (feature->isArray)?"Array":"Var", + (feature->IsAbsolute)?"Abs":"Rel", + (feature->Wrap)?"Wrap":"NoWrap", + (feature->Linear)?"Linear":"NonLinear", + (feature->prefState)?"PrefStat":"NoPrefState", + (feature->HasNull)?"HasNull":"NoNull", + (feature->Volatile)?"Volatile":"NonVolatile", + (feature->BitField)?"BitField":"Buffered"); + + debugstr_caps("Feature", &feature->caps); +} + +static void debug_collection(struct collection *collection) +{ + struct feature *fentry; + struct collection *centry; + if (TRACE_ON(hid)) + { + TRACE("START Collection %i <<< %s, parent: %p, %i features, %i collections\n", collection->index, collection_string[collection->type], collection->parent, list_count(&collection->features), list_count(&collection->collections)); + debugstr_caps("Collection", &collection->caps); + LIST_FOR_EACH_ENTRY(fentry, &collection->features, struct feature, col_entry) + debug_feature(fentry); + LIST_FOR_EACH_ENTRY(centry, &collection->collections, struct collection, entry) + debug_collection(centry); + TRACE(">>> END Collection %i\n", collection->index); + } +} + +static void debug_print_button_cap(const CHAR * type, WINE_HID_ELEMENT *wine_element) +{ + if (!wine_element->caps.button.IsRange) + TRACE("%s Button: 0x%x/0x%04x: ReportId %i, startBit %i/1\n" , type, + wine_element->caps.button.UsagePage, + wine_element->caps.button.u.NotRange.Usage, + wine_element->caps.value.ReportID, + wine_element->valueStartBit); + else + TRACE("%s Button: 0x%x/[0x%04x-0x%04x]: ReportId %i, startBit %i/%i\n" ,type, + wine_element->caps.button.UsagePage, + wine_element->caps.button.u.Range.UsageMin, + wine_element->caps.button.u.Range.UsageMax, + wine_element->caps.value.ReportID, + wine_element->valueStartBit, + wine_element->bitCount); +} + +static void debug_print_value_cap(const CHAR * type, WINE_HID_ELEMENT *wine_element) +{ + TRACE("%s Value: 0x%x/0x%x: ReportId %i, IsAbsolute %i, HasNull %i, " + "Bit Size %i, ReportCount %i, UnitsExp %i, Units %i, " + "LogicalMin %i, Logical Max %i, PhysicalMin %i, " + "PhysicalMax %i -- StartBit %i/%i\n", type, + wine_element->caps.value.UsagePage, + wine_element->caps.value.u.NotRange.Usage, + wine_element->caps.value.ReportID, + wine_element->caps.value.IsAbsolute, + wine_element->caps.value.HasNull, + wine_element->caps.value.BitSize, + wine_element->caps.value.ReportCount, + wine_element->caps.value.UnitsExp, + wine_element->caps.value.Units, + wine_element->caps.value.LogicalMin, + wine_element->caps.value.LogicalMax, + wine_element->caps.value.PhysicalMin, + wine_element->caps.value.PhysicalMax, + wine_element->valueStartBit, + wine_element->bitCount); +} + +static void debug_print_element(const CHAR* type, WINE_HID_ELEMENT *wine_element) +{ + if (wine_element->ElementType == ButtonElement) + debug_print_button_cap(type, wine_element); + else if (wine_element->ElementType == ValueElement) + debug_print_value_cap(type, wine_element); + else + TRACE("%s: UNKNOWN\n", type); +} + +static void debug_print_report(const char* type, WINE_HID_REPORT *report) +{ + unsigned int i; + TRACE("START Report %i <<< %s report : dwSize: %i elementCount: %i\n", + report->reportID, + type, + report->dwSize, + report->elementCount); + for (i = 0; i < report->elementCount; i++) + debug_print_element(type, &report->Elements[i]); + TRACE(">>> END Report %i\n",report->reportID); +} + +static void debug_print_preparsed(WINE_HIDP_PREPARSED_DATA *data) +{ + unsigned int i; + WINE_HID_REPORT *r; + if (TRACE_ON(hid)) + { + TRACE("START PREPARSED Data <<< dwSize: %i Usage: %i, UsagePage: %i, InputReportByteLength: %i, tOutputReportByteLength: %i, FeatureReportByteLength: %i, NumberLinkCollectionNodes: %i, NumberInputButtonCaps: %i, NumberInputValueCaps: %i,NumberInputDataIndices: %i, NumberOutputButtonCaps: %i, NumberOutputValueCaps: %i, NumberOutputDataIndices: %i, NumberFeatureButtonCaps: %i, NumberFeatureValueCaps: %i, NumberFeatureDataIndices: %i, dwInputReportCount: %i, dwOutputReportCount: %i, dwFeatureReportCount: %i, dwOutputReportOffset: %i, dwFeatureReportOffset: %i\n", + data->dwSize, + data->caps.Usage, + data->caps.UsagePage, + data->caps.InputReportByteLength, + data->caps.OutputReportByteLength, + data->caps.FeatureReportByteLength, + data->caps.NumberLinkCollectionNodes, + data->caps.NumberInputButtonCaps, + data->caps.NumberInputValueCaps, + data->caps.NumberInputDataIndices, + data->caps.NumberOutputButtonCaps, + data->caps.NumberOutputValueCaps, + data->caps.NumberOutputDataIndices, + data->caps.NumberFeatureButtonCaps, + data->caps.NumberFeatureValueCaps, + data->caps.NumberFeatureDataIndices, + data->dwInputReportCount, + data->dwOutputReportCount, + data->dwFeatureReportCount, + data->dwOutputReportOffset, + data->dwFeatureReportOffset); + + r = HID_INPUT_REPORTS(data); + for (i = 0; i < data->dwInputReportCount; i++) + { + debug_print_report("INPUT", r); + r = HID_NEXT_REPORT(data, r); + } + r = HID_OUTPUT_REPORTS(data); + for (i = 0; i < data->dwOutputReportCount; i++) + { + debug_print_report("OUTPUT", r); + r = HID_NEXT_REPORT(data, r); + } + r = HID_FEATURE_REPORTS(data); + for (i = 0; i < data->dwFeatureReportCount; i++) + { + debug_print_report("FEATURE", r); + r = HID_NEXT_REPORT(data, r); + } + TRACE(">>> END Preparsed Data\n"); + } +} + +static int getValue(int bsize, int source) +{ + int mask = 0xff; + int negative = 0x80; + int outofrange = 0x100; + int value; + unsigned int i; + + if (bsize == 4) + return source; + + for (i = 1; i < bsize; i++) + { + mask = (mask<<8) + 0xff; + negative = (negative<<8); + outofrange = (outofrange<<8); + } + value = (source&mask); + if (value&negative) + value = -1 * (outofrange - value); + return value; +} + +static void parse_io_feature(unsigned int bSize, int itemVal, int bTag, + unsigned int *feature_index, + struct feature *feature) +{ + if (bSize <= 0) + { + return; + } + else + { + feature->isData = ((itemVal & INPUT_DATA_CONST) == 0); + feature->isArray = ((itemVal & INPUT_ARRAY_VAR) == 0); + feature->IsAbsolute = ((itemVal & INPUT_ABS_REL) == 0); + feature->Wrap = ((itemVal & INPUT_WRAP) != 0); + feature->Linear = ((itemVal & INPUT_LINEAR) == 0); + feature->prefState = ((itemVal & INPUT_PREFSTATE) == 0); + feature->HasNull = ((itemVal & INPUT_NULL) != 0); + + if (bTag != TAG_MAIN_INPUT) + { + feature->Volatile = ((itemVal & INPUT_VOLATILE) != 0); + } + if (bSize > 1) + { + feature->BitField = ((itemVal & INPUT_BITFIELD) == 0); + } + feature->index = *feature_index; + *feature_index = *feature_index + 1; + } +} + +static void parse_collection(unsigned int bSize, int itemVal, + struct collection *collection) +{ + if (bSize <= 0) + return; + else + { + collection->type = itemVal; + + if (itemVal >= 0x07 && itemVal <= 0x7F) { + ERR(" (Reserved 0x%x )\n", itemVal); + } + else if (itemVal >= 0x80 && itemVal <= 0xFF) { + ERR(" (Vendor Defined 0x%x )\n", itemVal); + } + } +} + +static void new_caps(struct caps *caps) +{ + caps->IsRange = 0; + caps->IsStringRange = 0; + caps->IsDesignatorRange = 0; + caps->usage_count = 0; +} + +static int parse_descriptor(BYTE *descriptor, unsigned int index, unsigned int length, unsigned int *feature_index, unsigned int *collection_index, struct collection *collection, struct caps *caps, struct list *features) +{ + unsigned int i; + for (i = index; i < length;) + { + BYTE b0 = descriptor[i++]; + int bSize = b0 & 0x03; + int bType = (b0 >> 2) & 0x03; + int bTag = (b0 >> 4) & 0x0F; + + bSize = (bSize == 3) ? 4 : bSize; + if (bType == TAG_TYPE_RESERVED && bTag == 0x0F && bSize == 2 && + i + 2 < length) + { + /* Long data items: Should be unused */ + ERR("Long Data Item, should be unused\n"); + } + else + { + int bSizeActual = 0; + int itemVal = 0; + unsigned int j; + + for (j = 0; j < bSize; j++) + { + if (i + j < length) + { + itemVal += descriptor[i + j] << (8 * j); + bSizeActual++; + } + } + TRACE(" 0x%x[%i], type %i , tag %i, size %i, val %i\n",b0,i-1,bType, bTag, bSize, itemVal ); + + if (bType == TAG_TYPE_MAIN) + { + struct feature *feature; + switch(bTag) + { + case TAG_MAIN_INPUT: + feature = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*feature)); + list_add_tail(&collection->features, &feature->col_entry); + list_add_tail(features, &feature->entry); + feature->type = HidP_Input; + parse_io_feature(bSize, itemVal, bTag, feature_index, feature); + feature->caps = *caps; + feature->collection = collection; + new_caps(caps); + break; + case TAG_MAIN_OUTPUT: + feature = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*feature)); + list_add_tail(&collection->features, &feature->col_entry); + list_add_tail(features, &feature->entry); + feature->type = HidP_Output; + parse_io_feature(bSize, itemVal, bTag, feature_index, feature); + feature->caps = *caps; + feature->collection = collection; + new_caps(caps); + break; + case TAG_MAIN_FEATURE: + feature = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*feature)); + list_add_tail(&collection->features, &feature->col_entry); + list_add_tail(features, &feature->entry); + feature->type = HidP_Feature; + parse_io_feature(bSize, itemVal, bTag, feature_index, feature); + feature->caps = *caps; + feature->collection = collection; + new_caps(caps); + break; + case TAG_MAIN_COLLECTION: + { + struct collection *subcollection = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct collection)); + list_add_tail(&collection->collections, &subcollection->entry); + subcollection->parent = collection; + /* Only set our collection once... + We do not properly handle composite devices yet. */ + if (*collection_index == 0) + collection->caps = *caps; + subcollection->caps = *caps; + subcollection->index = *collection_index; + *collection_index = *collection_index + 1; + list_init(&subcollection->features); + list_init(&subcollection->collections); + new_caps(caps); + + parse_collection(bSize, itemVal, subcollection); + + i = parse_descriptor(descriptor, i+1, length, feature_index, collection_index, subcollection, caps, features); + continue; + } + case TAG_MAIN_END_COLLECTION: + return i; + default: + ERR("Unknown (bTag: 0x%x, bType: 0x%x)\n", bTag, bType); + } + } + else if (bType == TAG_TYPE_GLOBAL) + { + switch(bTag) + { + case TAG_GLOBAL_USAGE_PAGE: + caps->UsagePage = getValue(bSize, itemVal); + break; + case TAG_GLOBAL_LOGICAL_MINIMUM: + caps->LogicalMin = getValue(bSize, itemVal); + break; + case TAG_GLOBAL_LOGICAL_MAXIMUM: + caps->LogicalMax = getValue(bSize, itemVal); + break; + case TAG_GLOBAL_PHYSICAL_MINIMUM: + caps->PhysicalMin = getValue(bSize, itemVal); + break; + case TAG_GLOBAL_PHYSICAL_MAXIMUM: + caps->PhysicalMax = getValue(bSize, itemVal); + break; + case TAG_GLOBAL_UNIT_EXPONENT: + caps->UnitsExp = getValue(bSize, itemVal); + break; + case TAG_GLOBAL_UNIT: + caps->Units = getValue(bSize, itemVal); + break; + case TAG_GLOBAL_REPORT_SIZE: + caps->BitSize = getValue(bSize, itemVal); + break; + case TAG_GLOBAL_REPORT_ID: + caps->ReportID = getValue(bSize, itemVal); + break; + case TAG_GLOBAL_REPORT_COUNT: + caps->ReportCount = getValue(bSize, itemVal); + break; + case TAG_GLOBAL_PUSH: + FIXME("Unhandled Push\n"); + break; + case TAG_GLOBAL_POP: + FIXME("Unhandled Pop\n"); + break; + default: + ERR("Unknown (bTag: 0x%x, bType: 0x%x)\n", bTag, bType); + } + } + else if (bType == TAG_TYPE_LOCAL) + { + switch(bTag) + { + case TAG_LOCAL_USAGE: + if (caps->usage_count >= USAGE_MAX) + FIXME("More than %i individual usages defined\n",USAGE_MAX); + else + { + caps->u.NotRange.Usage[caps->usage_count++] = getValue(bSize, itemVal); + caps->IsRange = FALSE; + } + break; + case TAG_LOCAL_USAGE_MINIMUM: + caps->usage_count = 1; + caps->u.Range.UsageMin = getValue(bSize, itemVal); + caps->IsRange = TRUE; + break; + case TAG_LOCAL_USAGE_MAXIMUM: + caps->usage_count = 1; + caps->u.Range.UsageMax = getValue(bSize, itemVal); + caps->IsRange = TRUE; + break; + case TAG_LOCAL_DESIGNATOR_INDEX: + caps->u.NotRange.DesignatorIndex = getValue(bSize, itemVal); + caps->IsDesignatorRange = FALSE; + break; + case TAG_LOCAL_DESIGNATOR_MINIMUM: + caps->u.Range.DesignatorMin = getValue(bSize, itemVal); + caps->IsDesignatorRange = TRUE; + break; + case TAG_LOCAL_DESIGNATOR_MAXIMUM: + caps->u.Range.DesignatorMax = getValue(bSize, itemVal); + caps->IsDesignatorRange = TRUE; + break; + case TAG_LOCAL_STRING_INDEX: + caps->u.NotRange.StringIndex = getValue(bSize, itemVal); + caps->IsStringRange = FALSE; + break; + case TAG_LOCAL_STRING_MINIMUM: + caps->u.Range.StringMin = getValue(bSize, itemVal); + caps->IsStringRange = TRUE; + break; + case TAG_LOCAL_STRING_MAXIMUM: + caps->u.Range.StringMax = getValue(bSize, itemVal); + caps->IsStringRange = TRUE; + break; + case TAG_LOCAL_DELIMITER: + caps->Delim = getValue(bSize, itemVal); + break; + default: + ERR("Unknown (bTag: 0x%x, bType: 0x%x)\n", bTag, bType); + } + } + else + ERR("Unknown (bTag: 0x%x, bType: 0x%x)\n", bTag, bType); + + i += bSize; + } + } + return i; +} + +static inline void new_report(WINE_HID_REPORT *wine_report, struct feature* feature) +{ + wine_report->reportID = feature->caps.ReportID; + wine_report->dwSize = sizeof(*wine_report) - sizeof(WINE_HID_ELEMENT); + wine_report->elementCount = 0; +} + +static void build_elements(WINE_HID_REPORT *wine_report, struct feature* feature, DWORD *bitOffset) +{ + unsigned int i; + + if (!feature->isData) + { + *bitOffset = *bitOffset + (feature->caps.BitSize * feature->caps.ReportCount); + return; + } + + for (i = 0; i < feature->caps.usage_count; i++) + { + WINE_HID_ELEMENT *wine_element = &wine_report->Elements[wine_report->elementCount]; + + wine_element->valueStartBit = *bitOffset; + if (feature->caps.UsagePage == HID_USAGE_PAGE_BUTTON) + { + wine_element->ElementType = ButtonElement; + wine_element->caps.button.UsagePage = feature->caps.UsagePage; + wine_element->caps.button.ReportID = feature->caps.ReportID; + wine_element->caps.button.BitField = feature->BitField; + wine_element->caps.button.IsRange = feature->caps.IsRange; + wine_element->caps.button.IsStringRange = feature->caps.IsStringRange; + wine_element->caps.button.IsDesignatorRange = feature->caps.IsDesignatorRange; + wine_element->caps.button.IsAbsolute = feature->IsAbsolute; + if (wine_element->caps.button.IsRange) + { + wine_element->bitCount = (feature->caps.u.Range.UsageMax - feature->caps.u.Range.UsageMin) + 1; + *bitOffset = *bitOffset + wine_element->bitCount; + wine_element->caps.button.u.Range.UsageMin = feature->caps.u.Range.UsageMin; + wine_element->caps.button.u.Range.UsageMax = feature->caps.u.Range.UsageMax; + wine_element->caps.button.u.Range.StringMin = feature->caps.u.Range.StringMin; + wine_element->caps.button.u.Range.StringMax = feature->caps.u.Range.StringMax; + wine_element->caps.button.u.Range.DesignatorMin = feature->caps.u.Range.DesignatorMin; + wine_element->caps.button.u.Range.DesignatorMax = feature->caps.u.Range.DesignatorMax; + } + else + { + *bitOffset = *bitOffset + 1; + wine_element->bitCount = 1; + wine_element->caps.button.u.NotRange.Usage = feature->caps.u.NotRange.Usage[i]; + wine_element->caps.button.u.NotRange.StringIndex = feature->caps.u.NotRange.StringIndex; + wine_element->caps.button.u.NotRange.DesignatorIndex = feature->caps.u.NotRange.DesignatorIndex; + } + } + else + { + wine_element->ElementType = ValueElement; + wine_element->caps.value.UsagePage = feature->caps.UsagePage; + wine_element->caps.value.ReportID = feature->caps.ReportID; + wine_element->caps.value.BitField = feature->BitField; + wine_element->caps.value.IsRange = feature->caps.IsRange; + wine_element->caps.value.IsStringRange = feature->caps.IsStringRange; + wine_element->caps.value.IsDesignatorRange = feature->caps.IsDesignatorRange; + wine_element->caps.value.IsAbsolute = feature->IsAbsolute; + wine_element->caps.value.HasNull = feature->HasNull; + wine_element->caps.value.BitSize = feature->caps.BitSize; + if (feature->caps.usage_count > 1) + wine_element->caps.value.ReportCount = 1; + else + wine_element->caps.value.ReportCount = feature->caps.ReportCount; + wine_element->bitCount = (feature->caps.BitSize * wine_element->caps.value.ReportCount); + *bitOffset = *bitOffset + wine_element->bitCount; + wine_element->caps.value.UnitsExp = feature->caps.UnitsExp; + wine_element->caps.value.Units = feature->caps.Units; + wine_element->caps.value.LogicalMin = feature->caps.LogicalMin; + wine_element->caps.value.LogicalMax = feature->caps.LogicalMax; + wine_element->caps.value.PhysicalMin = feature->caps.PhysicalMin; + wine_element->caps.value.PhysicalMax = feature->caps.PhysicalMax; + if (wine_element->caps.value.IsRange) + { + wine_element->caps.value.u.Range.UsageMin = feature->caps.u.Range.UsageMin; + wine_element->caps.value.u.Range.UsageMax = feature->caps.u.Range.UsageMax; + wine_element->caps.value.u.Range.StringMin = feature->caps.u.Range.StringMin; + wine_element->caps.value.u.Range.StringMax = feature->caps.u.Range.StringMax; + wine_element->caps.value.u.Range.DesignatorMin = feature->caps.u.Range.DesignatorMin; + wine_element->caps.value.u.Range.DesignatorMax = feature->caps.u.Range.DesignatorMax; + } + else + { + wine_element->caps.value.u.NotRange.Usage = feature->caps.u.NotRange.Usage[i]; + wine_element->caps.value.u.NotRange.StringIndex = feature->caps.u.NotRange.StringIndex; + wine_element->caps.value.u.NotRange.DesignatorIndex = feature->caps.u.NotRange.DesignatorIndex; + } + } + + wine_report->elementCount++; + } +} + +static void count_elements(struct feature* feature, USHORT *buttons, USHORT *values) +{ + if (feature->caps.UsagePage == HID_USAGE_PAGE_BUTTON) + { + if (feature->caps.IsRange) + *buttons = *buttons + 1; + else + *buttons = *buttons + feature->caps.usage_count; + } + else + { + if (feature->caps.IsRange) + *values = *values + 1; + else + *values = *values + feature->caps.usage_count; + } +} + +static WINE_HIDP_PREPARSED_DATA* build_PreparseData( + struct feature **features, int feature_count, + struct feature **input_features, int i_count, + struct feature **output_features, int o_count, + struct feature **feature_features, int f_count, + struct collection *base_collection) +{ + WINE_HIDP_PREPARSED_DATA *data; + WINE_HID_REPORT *wine_report = NULL; + DWORD bitOffset, bitLength; + unsigned int report_count = 1; + unsigned int i; + unsigned int element_count; + unsigned int size = 0; + + if (features[0]->caps.ReportID != 0) + { + unsigned int *report_ids; + unsigned int cnt = max(i_count, o_count); + cnt = max(cnt, f_count); + report_ids = HeapAlloc(GetProcessHeap(), 0 , sizeof(*report_ids) * cnt); + + if (i_count) + { + report_ids[0] = input_features[0]->caps.ReportID; + for (i = 1; i < i_count; i++) + { + unsigned int j; + unsigned int found = FALSE; + for (j = 0; !found && j < i_count; j++) + { + if (report_ids[j] == input_features[i]->caps.ReportID) + found = TRUE; + } + if (!found) + { + report_ids[report_count] = input_features[i]->caps.ReportID; + report_count++; + } + } + } + if (o_count) + { + report_count++; + report_ids[0] = output_features[0]->caps.ReportID; + for (i = 1; i < o_count; i++) + { + unsigned int j; + unsigned int found = FALSE; + for (j = 0; !found && j < o_count; j++) + { + if (report_ids[j] == output_features[i]->caps.ReportID) + found = TRUE; + } + if (!found) + { + report_ids[report_count] = output_features[i]->caps.ReportID; + report_count++; + } + } + } + if (f_count) + { + report_count++; + report_ids[0] = feature_features[0]->caps.ReportID; + for (i = 1; i < f_count; i++) + { + unsigned int j; + unsigned int found = FALSE; + for (j = 0; !found && j < f_count; j++) + { + if (report_ids[j] == feature_features[i]->caps.ReportID) + found = TRUE; + } + if (!found) + { + report_ids[report_count] = feature_features[i]->caps.ReportID; + report_count++; + } + } + } + HeapFree(GetProcessHeap(), 0, report_ids); + } + else + { + if (o_count) report_count++; + if (f_count) report_count++; + } + + element_count = 0; + for (i = 0; i < feature_count; i++) + element_count += features[i]->caps.usage_count; + + size = sizeof(WINE_HIDP_PREPARSED_DATA) + + (element_count * sizeof(WINE_HID_ELEMENT)) + + (report_count * sizeof(WINE_HID_REPORT)); + + TRACE("%i reports %i elements -> size %i\n",report_count, element_count, size); + + data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); + data->magic = HID_MAGIC; + data->dwSize = size; + data->caps.Usage = base_collection->caps.u.NotRange.Usage[0]; + data->caps.UsagePage = base_collection->caps.UsagePage; + + wine_report = data->InputReports; + if (i_count) + { + bitLength = 0; + new_report(wine_report, input_features[0]); + data->dwInputReportCount++; + + if (input_features[0]->caps.ReportID != 0) + bitOffset = 8; + else + bitOffset = 0; + + for (i = 0; i < i_count; i++) + { + if (input_features[i]->caps.ReportID != wine_report->reportID) + { + wine_report->dwSize += (sizeof(WINE_HID_ELEMENT) * wine_report->elementCount); + wine_report = (WINE_HID_REPORT*)(((BYTE*)wine_report)+wine_report->dwSize); + new_report(wine_report, input_features[i]); + data->dwInputReportCount++; + bitLength = max(bitOffset, bitLength); + if (input_features[i]->caps.ReportID != 0) + bitOffset = 8; + else + bitOffset = 0; + } + build_elements(wine_report, input_features[i], &bitOffset); + count_elements(input_features[i], &data->caps.NumberInputButtonCaps, + &data->caps.NumberInputValueCaps); + } + wine_report->dwSize += (sizeof(WINE_HID_ELEMENT) * wine_report->elementCount); + bitLength = max(bitOffset, bitLength); + data->caps.InputReportByteLength = ((bitLength + 7) & ~7)/8; + } + + if (o_count) + { + bitLength = 0; + wine_report = (WINE_HID_REPORT*)(((BYTE*)wine_report)+wine_report->dwSize); + data->dwOutputReportOffset = (BYTE*)wine_report - (BYTE*)data->InputReports; + new_report(wine_report, output_features[0]); + data->dwOutputReportCount++; + if (output_features[0]->caps.ReportID != 0) + bitOffset = 8; + else + bitOffset = 0; + + for (i = 0; i < o_count; i++) + { + if (output_features[i]->caps.ReportID != wine_report->reportID) + { + wine_report->dwSize += (sizeof(WINE_HID_ELEMENT) * wine_report->elementCount); + wine_report = (WINE_HID_REPORT*)(((BYTE*)wine_report)+wine_report->dwSize); + new_report(wine_report, output_features[i]); + data->dwOutputReportCount++; + bitLength = max(bitOffset, bitLength); + if (output_features[0]->caps.ReportID != 0) + bitOffset = 8; + else + bitOffset = 0; + } + build_elements(wine_report, output_features[i], &bitOffset); + count_elements(output_features[i], &data->caps.NumberOutputButtonCaps, + &data->caps.NumberOutputValueCaps); + } + wine_report->dwSize += (sizeof(WINE_HID_ELEMENT) * wine_report->elementCount); + bitLength = max(bitOffset, bitLength); + data->caps.OutputReportByteLength = ((bitLength + 7) & ~7)/8; + } + + if (f_count) + { + bitLength = 0; + wine_report = (WINE_HID_REPORT*)(((BYTE*)wine_report)+wine_report->dwSize); + data->dwFeatureReportOffset = (BYTE*)wine_report - (BYTE*)data->InputReports; + new_report(wine_report, feature_features[0]); + data->dwFeatureReportCount++; + if (feature_features[0]->caps.ReportID != 0) + bitOffset = 8; + else + bitOffset = 0; + + for (i = 0; i < f_count; i++) + { + if (feature_features[i]->caps.ReportID != wine_report->reportID) + { + wine_report->dwSize += (sizeof(WINE_HID_ELEMENT) * wine_report->elementCount); + wine_report = (WINE_HID_REPORT*)((BYTE*)wine_report+wine_report->dwSize); + new_report(wine_report, feature_features[i]); + data->dwFeatureReportCount++; + bitLength = max(bitOffset, bitLength); + if (feature_features[0]->caps.ReportID != 0) + bitOffset = 8; + else + bitOffset = 0; + } + build_elements(wine_report, feature_features[i], &bitOffset); + count_elements(feature_features[i], &data->caps.NumberFeatureButtonCaps, + &data->caps.NumberFeatureValueCaps); + } + bitLength = max(bitOffset, bitLength); + data->caps.FeatureReportByteLength = ((bitLength + 7) & ~7)/8; + } + + return data; +} + +static void free_collection(struct collection *collection) +{ + struct feature *fentry, *fnext; + struct collection *centry, *cnext; + LIST_FOR_EACH_ENTRY_SAFE(centry, cnext, &collection->collections, struct collection, entry) + { + list_remove(¢ry->entry); + free_collection(centry); + } + LIST_FOR_EACH_ENTRY_SAFE(fentry, fnext, &collection->features, struct feature, col_entry) + { + list_remove(&fentry->col_entry); + HeapFree(GetProcessHeap(), 0, fentry); + } + HeapFree(GetProcessHeap(), 0, collection); +} + +static int compare_reports(const void *a, const void* b) +{ + struct feature *f1 = *(struct feature **)a; + struct feature *f2 = *(struct feature **)b; + int c = (f1->caps.ReportID - f2->caps.ReportID); + if (c) return c; + return (f1->index - f2->index); +} + +WINE_HIDP_PREPARSED_DATA* ParseDescriptor(BYTE *descriptor, unsigned int length) +{ + WINE_HIDP_PREPARSED_DATA *data = NULL; + struct collection *base; + struct caps caps; + + struct list features; + + unsigned int feature_count = 0; + unsigned int cidx; + + if (TRACE_ON(hid)) + { + TRACE("Descriptor[%i]: ", length); + for (cidx = 0; cidx < length; cidx++) + TRACE("%x ",descriptor[cidx]); + TRACE("\n"); + } + + list_init(&features); + + base = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*base)); + base->index = 1; + list_init(&base->features); + list_init(&base->collections); + memset(&caps, 0, sizeof(caps)); + + cidx = 0; + parse_descriptor(descriptor, 0, length, &feature_count, &cidx, base, &caps, &features); + + debug_collection(base); + + cidx = 2; + if (feature_count) + { + struct feature *entry; + struct feature** sorted_features; + struct feature** input_features; + struct feature** output_features; + struct feature** feature_features; + unsigned int i_count, o_count, f_count; + unsigned int i; + + i_count = o_count = f_count = 0; + + sorted_features = HeapAlloc(GetProcessHeap(), 0, sizeof(*sorted_features) * feature_count); + input_features = HeapAlloc(GetProcessHeap(), 0, sizeof(*input_features) * feature_count); + output_features = HeapAlloc(GetProcessHeap(), 0, sizeof(*output_features) * feature_count); + feature_features = HeapAlloc(GetProcessHeap(), 0, sizeof(*feature_features) * feature_count); + + i = 0; + LIST_FOR_EACH_ENTRY(entry, &features, struct feature, entry) + sorted_features[i++] = entry; + + /* Sort features base on report if there are multiple reports */ + if (sorted_features[0]->caps.ReportID != 0) + qsort(sorted_features, feature_count, sizeof(struct feature*), compare_reports); + + for (i = 0; i < feature_count; i++) + { + switch (sorted_features[i]->type) + { + case HidP_Input: + input_features[i_count] = sorted_features[i]; + i_count++; + break; + case HidP_Output: + output_features[o_count] = sorted_features[i]; + o_count++; + break; + case HidP_Feature: + feature_features[f_count] = sorted_features[i]; + f_count++; + break; + default: + ERR("Unknown type %i\n",sorted_features[i]->type); + } + } + + if (TRACE_ON(hid)) + { + TRACE("DUMP FEATURES:\n"); + TRACE("----INPUT----\n"); + for (cidx = 0; cidx < i_count; cidx++) + debug_feature(input_features[cidx]); + TRACE("----OUTPUT----\n"); + for (cidx = 0; cidx < o_count; cidx++) + debug_feature(output_features[cidx]); + TRACE("----FEATURE----\n"); + for (cidx = 0; cidx < f_count; cidx++) + debug_feature(feature_features[cidx]); + } + + data = build_PreparseData(sorted_features, feature_count, input_features, i_count, output_features, o_count, feature_features, f_count, base); + + debug_print_preparsed(data); + + HeapFree(GetProcessHeap(), 0, sorted_features); + HeapFree(GetProcessHeap(), 0, input_features); + HeapFree(GetProcessHeap(), 0, output_features); + HeapFree(GetProcessHeap(), 0, feature_features); + } + + free_collection(base); + /* We do not have to free the list as free_collection does all the work */ + + return data; +} diff -Nru wine1.7-1.7.50/dlls/hidclass.sys/device.c wine1.7-1.7.55/dlls/hidclass.sys/device.c --- wine1.7-1.7.50/dlls/hidclass.sys/device.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/hidclass.sys/device.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,642 @@ +/* + * HIDClass device functions + * + * Copyright (C) 2015 Aric Stewart + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" + +#include +#define NONAMELESSUNION +#include "hid.h" +#include "wine/unicode.h" +#include "winreg.h" +#include "winuser.h" +#include "setupapi.h" + +#include "wine/debug.h" +#include "ddk/hidsdi.h" +#include "ddk/hidtypes.h" + +#include "initguid.h" +#include "devguid.h" + +WINE_DEFAULT_DEBUG_CHANNEL(hid); +WINE_DECLARE_DEBUG_CHANNEL(hid_report); + +static const WCHAR device_name_fmtW[] = {'\\','D','e','v','i','c','e', + '\\','H','I','D','#','%','p','&','%','p',0}; +static const WCHAR device_regname_fmtW[] = {'H','I','D','\\', + 'v','i','d','_','%','0','4','x','&','p','i','d','_','%', + '0','4','x','&','%','s','\\','%','i','&','%','s',0}; +static const WCHAR device_link_fmtW[] = {'\\','?','?','\\','h','i','d','#', + 'v','i','d','_','%','0','4','x','&','p','i','d','_','%', + '0','4','x','&','%','s','#','%','i','&','%','s','#','%','s',0}; +/* GUID_DEVINTERFACE_HID */ +static const WCHAR class_guid[] = {'{','4','D','1','E','5','5','B','2', + '-','F','1','6','F','-','1','1','C','F','-','8','8','C','B','-','0','0', + '1','1','1','1','0','0','0','0','3','0','}',0}; + + +NTSTATUS HID_CreateDevice(DEVICE_OBJECT *native_device, HID_MINIDRIVER_REGISTRATION *driver, DEVICE_OBJECT **device) +{ + WCHAR dev_name[255]; + UNICODE_STRING nameW; + NTSTATUS status; + BASE_DEVICE_EXTENSION *ext; + + sprintfW(dev_name, device_name_fmtW, driver->DriverObject, native_device); + RtlInitUnicodeString( &nameW, dev_name ); + + TRACE("Create base hid device %s\n", debugstr_w(dev_name)); + + status = IoCreateDevice(driver->DriverObject, driver->DeviceExtensionSize + sizeof(BASE_DEVICE_EXTENSION), &nameW, 0, 0, FALSE, device); + if (status) + { + FIXME( "failed to create device error %x\n", status ); + return status; + } + + ext = (*device)->DeviceExtension; + + ext->deviceExtension.MiniDeviceExtension = ext + 1; + ext->deviceExtension.PhysicalDeviceObject = *device; + ext->deviceExtension.NextDeviceObject = native_device; + ext->device_name = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(dev_name) + 1) * sizeof(WCHAR)); + lstrcpyW(ext->device_name, dev_name); + ext->link_name = NULL; + + return S_OK; +} + +NTSTATUS HID_LinkDevice(DEVICE_OBJECT *device, LPCWSTR serial, LPCWSTR index) +{ + WCHAR regname[255]; + WCHAR dev_link[255]; + SP_DEVINFO_DATA Data; + UNICODE_STRING nameW, linkW; + NTSTATUS status; + HDEVINFO devinfo; + GUID hidGuid; + BASE_DEVICE_EXTENSION *ext; + + HidD_GetHidGuid(&hidGuid); + ext = device->DeviceExtension; + + sprintfW(dev_link, device_link_fmtW, ext->information.VendorID, + ext->information.ProductID, index, ext->information.VersionNumber, serial, + class_guid); + struprW(dev_link); + + RtlInitUnicodeString( &nameW, ext->device_name); + RtlInitUnicodeString( &linkW, dev_link ); + + TRACE("Create link %s\n", debugstr_w(dev_link)); + + ext->link_name = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * (lstrlenW(dev_link) + 1)); + lstrcpyW(ext->link_name, dev_link); + + status = IoCreateSymbolicLink( &linkW, &nameW ); + if (status) + { + FIXME( "failed to create link error %x\n", status ); + return status; + } + + sprintfW(regname, device_regname_fmtW, ext->information.VendorID, ext->information.ProductID, index, ext->information.VersionNumber, serial); + + devinfo = SetupDiGetClassDevsW(&GUID_DEVCLASS_HIDCLASS, NULL, NULL, DIGCF_DEVICEINTERFACE); + if (!devinfo) + { + FIXME( "failed to get ClassDevs %x\n", GetLastError()); + return GetLastError(); + } + Data.cbSize = sizeof(Data); + if (!SetupDiCreateDeviceInfoW(devinfo, regname, &GUID_DEVCLASS_HIDCLASS, NULL, NULL, DICD_INHERIT_CLASSDRVS, &Data)) + { + if (GetLastError() == ERROR_DEVINST_ALREADY_EXISTS) + { + SetupDiDestroyDeviceInfoList(devinfo); + return ERROR_SUCCESS; + } + FIXME( "failed to Create Device Info %x\n", GetLastError()); + return GetLastError(); + } + if (!SetupDiRegisterDeviceInfo( devinfo, &Data, 0, NULL, NULL, NULL )) + { + FIXME( "failed to Register Device Info %x\n", GetLastError()); + return GetLastError(); + } + if (!SetupDiCreateDeviceInterfaceW( devinfo, &Data, &hidGuid, NULL, 0, NULL)) + { + FIXME( "failed to Create Device Interface %x\n", GetLastError()); + return GetLastError(); + } + SetupDiDestroyDeviceInfoList(devinfo); + + return S_OK; +} + +void HID_DeleteDevice(HID_MINIDRIVER_REGISTRATION *driver, DEVICE_OBJECT *device) +{ + NTSTATUS status; + BASE_DEVICE_EXTENSION *ext; + UNICODE_STRING linkW; + LIST_ENTRY *entry; + IRP *irp; + + ext = device->DeviceExtension; + + if (ext->link_name) + { + TRACE("Delete link %s\n", debugstr_w(ext->link_name)); + RtlInitUnicodeString(&linkW, ext->link_name); + + status = IoDeleteSymbolicLink(&linkW); + if (status != STATUS_SUCCESS) + ERR("Delete Symbolic Link failed (%x)\n",status); + } + + if (ext->thread) + { + SetEvent(ext->halt_event); + WaitForSingleObject(ext->thread, INFINITE); + } + CloseHandle(ext->halt_event); + + HeapFree(GetProcessHeap(), 0, ext->preparseData); + if (ext->ring_buffer) + RingBuffer_Destroy(ext->ring_buffer); + + entry = RemoveHeadList(&ext->irp_queue); + while(entry != &ext->irp_queue) + { + irp = CONTAINING_RECORD(entry, IRP, Tail.Overlay.ListEntry); + irp->IoStatus.u.Status = STATUS_DEVICE_REMOVED; + IoCompleteRequest(irp, IO_NO_INCREMENT); + entry = RemoveHeadList(&ext->irp_queue); + } + + TRACE("Delete device(%p) %s\n", device, debugstr_w(ext->device_name)); + HeapFree(GetProcessHeap(), 0, ext->device_name); + HeapFree(GetProcessHeap(), 0, ext->link_name); + + IoDeleteDevice(device); +} + +static void HID_Device_processQueue(DEVICE_OBJECT *device) +{ + LIST_ENTRY *entry; + IRP *irp; + BASE_DEVICE_EXTENSION *ext = device->DeviceExtension; + UINT buffer_size = RingBuffer_GetBufferSize(ext->ring_buffer); + HID_XFER_PACKET *packet; + + packet = HeapAlloc(GetProcessHeap(), 0, buffer_size); + + entry = RemoveHeadList(&ext->irp_queue); + while(entry != &ext->irp_queue) + { + int ptr; + irp = CONTAINING_RECORD(entry, IRP, Tail.Overlay.ListEntry); + ptr = PtrToUlong( irp->Tail.Overlay.OriginalFileObject->FsContext ); + + RingBuffer_Read(ext->ring_buffer, ptr, packet, &buffer_size); + if (buffer_size) + { + IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation(irp); + TRACE_(hid_report)("Processing Request (%i)\n",ptr); + if (irpsp->Parameters.Read.Length >= packet->reportBufferLen) + { + memcpy(irp->AssociatedIrp.SystemBuffer, packet->reportBuffer, packet->reportBufferLen); + irp->IoStatus.Information = packet->reportBufferLen; + irp->IoStatus.u.Status = STATUS_SUCCESS; + } + else + { + irp->IoStatus.Information = 0; + irp->IoStatus.u.Status = STATUS_BUFFER_OVERFLOW; + } + } + else + { + irp->IoStatus.Information = 0; + irp->IoStatus.u.Status = STATUS_UNSUCCESSFUL; + } + IoCompleteRequest( irp, IO_NO_INCREMENT ); + entry = RemoveHeadList(&ext->irp_queue); + } + HeapFree(GetProcessHeap(), 0, packet); +} + +static NTSTATUS WINAPI read_Completion(DEVICE_OBJECT *deviceObject, IRP *irp, void *context ) +{ + SetEvent(irp->UserEvent); + return STATUS_MORE_PROCESSING_REQUIRED; +} + +static DWORD CALLBACK hid_device_thread(void *args) +{ + DEVICE_OBJECT *device = (DEVICE_OBJECT*)args; + + IRP *irp; + IO_STATUS_BLOCK irp_status; + IO_STACK_LOCATION *irpsp; + DWORD rc; + HANDLE events[2]; + NTSTATUS ntrc; + + BASE_DEVICE_EXTENSION *ext = device->DeviceExtension; + events[0] = CreateEventA(NULL, FALSE, FALSE, NULL); + events[1] = ext->halt_event; + + if (ext->information.Polled) + { + while(1) + { + HID_XFER_PACKET *packet; + ResetEvent(events[0]); + + packet = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*packet) + ext->preparseData->caps.InputReportByteLength); + packet->reportBufferLen = ext->preparseData->caps.InputReportByteLength; + packet->reportBuffer = ((BYTE*)packet) + sizeof(*packet); + packet->reportId = 0; + + irp = IoBuildDeviceIoControlRequest(IOCTL_HID_GET_INPUT_REPORT, + device, NULL, 0, packet, sizeof(*packet), TRUE, events[0], + &irp_status); + + irpsp = IoGetNextIrpStackLocation(irp); + irpsp->CompletionRoutine = read_Completion; + irpsp->Control = SL_INVOKE_ON_SUCCESS | SL_INVOKE_ON_ERROR; + + ntrc = IoCallDriver(device, irp); + + if (ntrc == STATUS_PENDING) + WaitForMultipleObjects(2, events, FALSE, INFINITE); + + if (irp->IoStatus.u.Status == STATUS_SUCCESS) + { + RingBuffer_Write(ext->ring_buffer, packet); + HID_Device_processQueue(device); + } + + IoCompleteRequest(irp, IO_NO_INCREMENT ); + + rc = WaitForSingleObject(ext->halt_event, ext->poll_interval); + + if (rc == WAIT_OBJECT_0) + break; + else if (rc != WAIT_TIMEOUT) + ERR("Wait returned unexpected value %x\n",rc); + } + } + else + { + INT exit_now = FALSE; + + HID_XFER_PACKET *packet; + packet = HeapAlloc(GetProcessHeap(), 0, sizeof(*packet) + ext->preparseData->caps.InputReportByteLength); + packet->reportBufferLen = ext->preparseData->caps.InputReportByteLength; + packet->reportBuffer = ((BYTE*)packet) + sizeof(*packet); + packet->reportId = 0; + + while(1) + { + BYTE *buffer; + + buffer = HeapAlloc(GetProcessHeap(), 0, ext->preparseData->caps.InputReportByteLength); + + ResetEvent(events[0]); + + irp = IoBuildDeviceIoControlRequest(IOCTL_HID_READ_REPORT, + device, NULL, 0, buffer, + ext->preparseData->caps.InputReportByteLength, TRUE, events[0], + &irp_status); + + irpsp = IoGetNextIrpStackLocation(irp); + irpsp->CompletionRoutine = read_Completion; + irpsp->Control = SL_INVOKE_ON_SUCCESS | SL_INVOKE_ON_ERROR; + + ntrc = IoCallDriver(device, irp); + + if (ntrc == STATUS_PENDING) + { + rc = WaitForMultipleObjects(2, events, FALSE, INFINITE); + + if (rc == WAIT_OBJECT_0 + 1) + exit_now = TRUE; + } + + if (!exit_now && irp->IoStatus.u.Status == STATUS_SUCCESS) + { + packet->reportId = buffer[0]; + memcpy(packet->reportBuffer, buffer, ext->preparseData->caps.InputReportByteLength); + RingBuffer_Write(ext->ring_buffer, packet); + HID_Device_processQueue(device); + } + + IoCompleteRequest(irp, IO_NO_INCREMENT ); + + if (exit_now) + break; + } + + HeapFree(GetProcessHeap(), 0, packet); + } + + CloseHandle(events[0]); + + TRACE("Device thread exiting\n"); + return 1; +} + +void HID_StartDeviceThread(DEVICE_OBJECT *device) +{ + BASE_DEVICE_EXTENSION *ext = device->DeviceExtension; + ext->halt_event = CreateEventA(NULL, FALSE, FALSE, NULL); + ext->thread = CreateThread(NULL, 0, hid_device_thread, device, 0, NULL); +} + +static NTSTATUS handle_IOCTL_HID_GET_COLLECTION_INFORMATION(IRP *irp, BASE_DEVICE_EXTENSION *base) +{ + IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation( irp ); + if (irpsp->Parameters.DeviceIoControl.OutputBufferLength < sizeof(HID_COLLECTION_INFORMATION)) + { + irp->IoStatus.u.Status = STATUS_BUFFER_OVERFLOW; + irp->IoStatus.Information = 0; + } + else + { + memcpy(irp->AssociatedIrp.SystemBuffer, &base->information, sizeof(HID_COLLECTION_INFORMATION)); + irp->IoStatus.Information = sizeof(HID_COLLECTION_INFORMATION); + irp->IoStatus.u.Status = STATUS_SUCCESS; + } + return STATUS_SUCCESS; +} + +static NTSTATUS handle_IOCTL_HID_GET_COLLECTION_DESCRIPTOR(IRP *irp, BASE_DEVICE_EXTENSION *base) +{ + IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation( irp ); + + if (irpsp->Parameters.DeviceIoControl.OutputBufferLength < base->preparseData->dwSize) + { + irp->IoStatus.u.Status = STATUS_INVALID_BUFFER_SIZE; + irp->IoStatus.Information = 0; + } + else + { + memcpy(irp->UserBuffer, base->preparseData, base->preparseData->dwSize); + irp->IoStatus.Information = base->preparseData->dwSize; + irp->IoStatus.u.Status = STATUS_SUCCESS; + } + return STATUS_SUCCESS; +} + +static NTSTATUS handle_minidriver_string(DEVICE_OBJECT *device, IRP *irp, SHORT index) +{ + IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation( irp ); + WCHAR buffer[127]; + NTSTATUS status; + ULONG InputBuffer; + + InputBuffer = MAKELONG(index, 0); + status = call_minidriver(IOCTL_HID_GET_STRING, device, ULongToPtr(InputBuffer), sizeof(InputBuffer), buffer, sizeof(buffer)); + + if (status == STATUS_SUCCESS) + { + WCHAR *out_buffer = (WCHAR*)(((BYTE*)irp->MdlAddress->StartVa) + irp->MdlAddress->ByteOffset); + int length = irpsp->Parameters.DeviceIoControl.OutputBufferLength/sizeof(WCHAR); + TRACE("got string %s from minidriver\n",debugstr_w(buffer)); + lstrcpynW(out_buffer, buffer, length); + irp->IoStatus.Information = (lstrlenW(buffer)+1) * sizeof(WCHAR); + } + irp->IoStatus.u.Status = status; + + return STATUS_SUCCESS; +} + +NTSTATUS WINAPI HID_Device_ioctl(DEVICE_OBJECT *device, IRP *irp) +{ + NTSTATUS rc = STATUS_SUCCESS; + IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation( irp ); + BASE_DEVICE_EXTENSION *extension = device->DeviceExtension; + + irp->IoStatus.Information = 0; + + TRACE("device %p ioctl(%x)\n", device, irpsp->Parameters.DeviceIoControl.IoControlCode); + + switch (irpsp->Parameters.DeviceIoControl.IoControlCode) + { + case IOCTL_HID_GET_POLL_FREQUENCY_MSEC: + TRACE("IOCTL_HID_GET_POLL_FREQUENCY_MSEC\n"); + if (irpsp->Parameters.DeviceIoControl.OutputBufferLength < sizeof(ULONG)) + { + irp->IoStatus.u.Status = STATUS_BUFFER_OVERFLOW; + irp->IoStatus.Information = 0; + break; + } + *((ULONG*)irp->AssociatedIrp.SystemBuffer) = extension->poll_interval; + irp->IoStatus.Information = sizeof(ULONG); + irp->IoStatus.u.Status = STATUS_SUCCESS; + break; + case IOCTL_HID_SET_POLL_FREQUENCY_MSEC: + { + ULONG poll_interval; + TRACE("IOCTL_HID_SET_POLL_FREQUENCY_MSEC\n"); + if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(ULONG)) + { + irp->IoStatus.u.Status = STATUS_BUFFER_TOO_SMALL; + break; + } + poll_interval = *(ULONG *)irp->AssociatedIrp.SystemBuffer; + if (poll_interval == 0) + FIXME("Handle opportunistic reads\n"); + else if (poll_interval <= MAX_POLL_INTERVAL_MSEC) + { + extension->poll_interval = poll_interval; + irp->IoStatus.u.Status = STATUS_SUCCESS; + } + else + irp->IoStatus.u.Status = STATUS_INVALID_PARAMETER; + break; + } + case IOCTL_HID_GET_PRODUCT_STRING: + { + rc = handle_minidriver_string(device, irp, HID_STRING_ID_IPRODUCT); + break; + } + case IOCTL_HID_GET_SERIALNUMBER_STRING: + { + rc = handle_minidriver_string(device, irp, HID_STRING_ID_ISERIALNUMBER); + break; + } + case IOCTL_HID_GET_MANUFACTURER_STRING: + { + rc = handle_minidriver_string(device, irp, HID_STRING_ID_IMANUFACTURER); + break; + } + case IOCTL_HID_GET_COLLECTION_INFORMATION: + { + rc = handle_IOCTL_HID_GET_COLLECTION_INFORMATION(irp, extension); + break; + } + case IOCTL_HID_GET_COLLECTION_DESCRIPTOR: + { + rc = handle_IOCTL_HID_GET_COLLECTION_DESCRIPTOR(irp, extension); + break; + } + case IOCTL_HID_GET_INPUT_REPORT: + { + HID_XFER_PACKET packet; + BYTE* buffer = ((BYTE*)irp->MdlAddress->StartVa) + irp->MdlAddress->ByteOffset; + + if (extension->preparseData->InputReports[0].reportID) + packet.reportId = buffer[0]; + else + packet.reportId = 0; + packet.reportBuffer = buffer; + packet.reportBufferLen = irpsp->Parameters.DeviceIoControl.OutputBufferLength; + + call_minidriver(IOCTL_HID_GET_INPUT_REPORT, device, NULL, 0, &packet, sizeof(packet)); + irp->IoStatus.Information = packet.reportBufferLen; + irp->IoStatus.u.Status = STATUS_SUCCESS; + break; + } + case IOCTL_SET_NUM_DEVICE_INPUT_BUFFERS: + { + irp->IoStatus.Information = 0; + + if (irpsp->Parameters.DeviceIoControl.InputBufferLength != sizeof(ULONG)) + { + irp->IoStatus.u.Status = rc = STATUS_BUFFER_OVERFLOW; + } + else + { + rc = RingBuffer_SetSize(extension->ring_buffer, *(ULONG*)irp->AssociatedIrp.SystemBuffer); + irp->IoStatus.u.Status = rc; + } + break; + } + case IOCTL_GET_NUM_DEVICE_INPUT_BUFFERS: + { + if (irpsp->Parameters.DeviceIoControl.OutputBufferLength < sizeof(ULONG)) + { + irp->IoStatus.u.Status = rc = STATUS_BUFFER_TOO_SMALL; + } + else + { + *(ULONG*)irp->AssociatedIrp.SystemBuffer = RingBuffer_GetSize(extension->ring_buffer); + rc = irp->IoStatus.u.Status = STATUS_SUCCESS; + } + break; + } + default: + { + ULONG code = irpsp->Parameters.DeviceIoControl.IoControlCode; + FIXME("Unsupported ioctl %x (device=%x access=%x func=%x method=%x)\n", + code, code >> 16, (code >> 14) & 3, (code >> 2) & 0xfff, code & 3); + irp->IoStatus.u.Status = STATUS_NOT_SUPPORTED; + rc = STATUS_UNSUCCESSFUL; + break; + } + } + + if (rc != STATUS_PENDING) + IoCompleteRequest( irp, IO_NO_INCREMENT ); + + return rc; +} + +NTSTATUS WINAPI HID_Device_read(DEVICE_OBJECT *device, IRP *irp) +{ + HID_XFER_PACKET *packet; + BASE_DEVICE_EXTENSION *ext = device->DeviceExtension; + UINT buffer_size = RingBuffer_GetBufferSize(ext->ring_buffer); + NTSTATUS rc = STATUS_SUCCESS; + int ptr = -1; + + packet = HeapAlloc(GetProcessHeap(), 0, buffer_size); + ptr = PtrToUlong( irp->Tail.Overlay.OriginalFileObject->FsContext ); + + irp->IoStatus.Information = 0; + RingBuffer_Read(ext->ring_buffer, ptr, packet, &buffer_size); + + if (buffer_size) + { + IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation( irp ); + TRACE_(hid_report)("Got Packet %p %i\n", packet->reportBuffer, packet->reportBufferLen); + if (irpsp->Parameters.Read.Length >= packet->reportBufferLen) + { + memcpy(irp->AssociatedIrp.SystemBuffer, packet->reportBuffer, packet->reportBufferLen); + irp->IoStatus.Information = packet->reportBufferLen; + irp->IoStatus.u.Status = STATUS_SUCCESS; + } + else + { + irp->IoStatus.Information = 0; + irp->IoStatus.u.Status = STATUS_BUFFER_OVERFLOW; + } + IoCompleteRequest( irp, IO_NO_INCREMENT ); + } + else + { + TRACE_(hid_report)("Queue irp\n"); + InsertTailList(&ext->irp_queue, &irp->Tail.Overlay.ListEntry); + rc = STATUS_PENDING; + } + HeapFree(GetProcessHeap(), 0, packet); + + return rc; +} + +NTSTATUS WINAPI HID_Device_write(DEVICE_OBJECT *device, IRP *irp) +{ + IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation( irp ); + + irp->IoStatus.Information = 0; + + TRACE("Buffer length %i\n", irpsp->Parameters.Write.Length); + + FIXME("device %p\n", device); + + irp->IoStatus.u.Status = STATUS_SUCCESS; + IoCompleteRequest( irp, IO_NO_INCREMENT ); + return STATUS_SUCCESS; +} + +NTSTATUS WINAPI HID_Device_create(DEVICE_OBJECT *device, IRP *irp) +{ + BASE_DEVICE_EXTENSION *ext = device->DeviceExtension; + + TRACE("Open handle on device %p\n", device); + irp->Tail.Overlay.OriginalFileObject->FsContext = UlongToPtr(RingBuffer_AddPointer(ext->ring_buffer)); + irp->IoStatus.u.Status = STATUS_SUCCESS; + IoCompleteRequest( irp, IO_NO_INCREMENT ); + return STATUS_SUCCESS; +} + +NTSTATUS WINAPI HID_Device_close(DEVICE_OBJECT *device, IRP *irp) +{ + BASE_DEVICE_EXTENSION *ext = device->DeviceExtension; + int ptr = PtrToUlong(irp->Tail.Overlay.OriginalFileObject->FsContext); + TRACE("Close handle on device %p\n", device); + RingBuffer_RemovePointer(ext->ring_buffer, ptr); + irp->IoStatus.u.Status = STATUS_SUCCESS; + IoCompleteRequest( irp, IO_NO_INCREMENT ); + return STATUS_SUCCESS; +} diff -Nru wine1.7-1.7.50/dlls/hidclass.sys/hid.h wine1.7-1.7.55/dlls/hidclass.sys/hid.h --- wine1.7-1.7.50/dlls/hidclass.sys/hid.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/hidclass.sys/hid.h 2015-11-13 14:32:40.000000000 +0000 @@ -21,9 +21,50 @@ #include "windef.h" #include "winbase.h" #include "winternl.h" +#include "winioctl.h" #include "ddk/wdm.h" +#include "hidusage.h" #include "ddk/hidport.h" +#include "ddk/hidclass.h" +#include "ddk/hidpi.h" #include "wine/list.h" +#include "parse.h" + +#define DEFAULT_POLL_INTERVAL 200 +#define MAX_POLL_INTERVAL_MSEC 10000 + +typedef NTSTATUS (WINAPI *pAddDevice)(DRIVER_OBJECT *DriverObject, DEVICE_OBJECT *PhysicalDeviceObject); + +/* Ring buffer functions */ +struct ReportRingBuffer; + +typedef struct _BASE_DEVICE_EXTENSTION { + HID_DEVICE_EXTENSION deviceExtension; + + HID_COLLECTION_INFORMATION information; + WINE_HIDP_PREPARSED_DATA *preparseData; + + ULONG poll_interval; + WCHAR *device_name; + WCHAR *link_name; + struct ReportRingBuffer *ring_buffer; + HANDLE halt_event; + HANDLE thread; + + LIST_ENTRY irp_queue; + + /* Minidriver Specific stuff will end up here */ +} BASE_DEVICE_EXTENSION; + +void RingBuffer_Write(struct ReportRingBuffer *buffer, void *data) DECLSPEC_HIDDEN; +UINT RingBuffer_AddPointer(struct ReportRingBuffer *buffer) DECLSPEC_HIDDEN; +void RingBuffer_RemovePointer(struct ReportRingBuffer *ring, UINT index) DECLSPEC_HIDDEN; +void RingBuffer_Read(struct ReportRingBuffer *buffer, UINT index, void *output, UINT *size) DECLSPEC_HIDDEN; +UINT RingBuffer_GetBufferSize(struct ReportRingBuffer *buffer) DECLSPEC_HIDDEN; +UINT RingBuffer_GetSize(struct ReportRingBuffer *buffer) DECLSPEC_HIDDEN; +void RingBuffer_Destroy(struct ReportRingBuffer *buffer) DECLSPEC_HIDDEN; +struct ReportRingBuffer* RingBuffer_Create(UINT buffer_size) DECLSPEC_HIDDEN; +NTSTATUS RingBuffer_SetSize(struct ReportRingBuffer *buffer, UINT size) DECLSPEC_HIDDEN; typedef struct _minidriver { @@ -32,4 +73,28 @@ HID_MINIDRIVER_REGISTRATION minidriver; PDRIVER_UNLOAD DriverUnload; + + pAddDevice AddDevice; } minidriver; + +NTSTATUS call_minidriver(ULONG code, DEVICE_OBJECT *device, void *in_buff, ULONG in_size, void *out_buff, ULONG out_size) DECLSPEC_HIDDEN; +minidriver* find_minidriver(DRIVER_OBJECT* driver) DECLSPEC_HIDDEN; + +/* Internal device functions */ +NTSTATUS HID_CreateDevice(DEVICE_OBJECT *native_device, HID_MINIDRIVER_REGISTRATION *driver, DEVICE_OBJECT **device) DECLSPEC_HIDDEN; +NTSTATUS HID_LinkDevice(DEVICE_OBJECT *device, LPCWSTR serial, LPCWSTR index) DECLSPEC_HIDDEN; +void HID_DeleteDevice(HID_MINIDRIVER_REGISTRATION *driver, DEVICE_OBJECT *device) DECLSPEC_HIDDEN; +void HID_StartDeviceThread(DEVICE_OBJECT *device) DECLSPEC_HIDDEN; + +NTSTATUS WINAPI HID_Device_ioctl(DEVICE_OBJECT *device, IRP *irp) DECLSPEC_HIDDEN; +NTSTATUS WINAPI HID_Device_read(DEVICE_OBJECT *device, IRP *irp) DECLSPEC_HIDDEN; +NTSTATUS WINAPI HID_Device_write(DEVICE_OBJECT *device, IRP *irp) DECLSPEC_HIDDEN; +NTSTATUS WINAPI HID_Device_create(DEVICE_OBJECT *device, IRP *irp) DECLSPEC_HIDDEN; +NTSTATUS WINAPI HID_Device_close(DEVICE_OBJECT *device, IRP *irp) DECLSPEC_HIDDEN; + +/* Pseudo-Plug and Play support*/ +NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT* PDO) DECLSPEC_HIDDEN; +void PNP_CleanupPNP(DRIVER_OBJECT *driver) DECLSPEC_HIDDEN; + +/* Parsing HID Report Descriptors into preparsed data */ +WINE_HIDP_PREPARSED_DATA* ParseDescriptor(BYTE *descriptor, unsigned int length) DECLSPEC_HIDDEN; diff -Nru wine1.7-1.7.50/dlls/hidclass.sys/main.c wine1.7-1.7.55/dlls/hidclass.sys/main.c --- wine1.7-1.7.50/dlls/hidclass.sys/main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/hidclass.sys/main.c 2015-11-13 14:32:40.000000000 +0000 @@ -30,7 +30,7 @@ static struct list minidriver_list = LIST_INIT(minidriver_list); -static minidriver* find_minidriver(DRIVER_OBJECT *driver) +minidriver* find_minidriver(DRIVER_OBJECT *driver) { minidriver *md; LIST_FOR_EACH_ENTRY(md, &minidriver_list, minidriver, entry) @@ -51,6 +51,7 @@ { if (md->DriverUnload) md->DriverUnload(md->minidriver.DriverObject); + PNP_CleanupPNP(md->minidriver.DriverObject); list_remove(&md->entry); HeapFree( GetProcessHeap(), 0, md ); } @@ -67,8 +68,61 @@ driver->DriverUnload = registration->DriverObject->DriverUnload; registration->DriverObject->DriverUnload = UnloadDriver; + registration->DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = HID_Device_ioctl; + registration->DriverObject->MajorFunction[IRP_MJ_READ] = HID_Device_read; + registration->DriverObject->MajorFunction[IRP_MJ_WRITE] = HID_Device_write; + registration->DriverObject->MajorFunction[IRP_MJ_CREATE] = HID_Device_create; + registration->DriverObject->MajorFunction[IRP_MJ_CLOSE] = HID_Device_close; + + driver->AddDevice = registration->DriverObject->DriverExtension->AddDevice; + registration->DriverObject->DriverExtension->AddDevice = PNP_AddDevice; + driver->minidriver = *registration; list_add_tail(&minidriver_list, &driver->entry); return STATUS_SUCCESS; } + +static NTSTATUS WINAPI internalComplete(DEVICE_OBJECT *deviceObject, IRP *irp, + void *context ) +{ + SetEvent(irp->UserEvent); + return STATUS_MORE_PROCESSING_REQUIRED; +} + +NTSTATUS call_minidriver(ULONG code, DEVICE_OBJECT *device, void *in_buff, ULONG in_size, void *out_buff, ULONG out_size) +{ + IRP *irp; + IO_STATUS_BLOCK irp_status; + IO_STACK_LOCATION *irpsp; + NTSTATUS status; + void *buffer = NULL; + + HANDLE event = CreateEventA(NULL, FALSE, FALSE, NULL); + + if (out_size) + { + buffer = HeapAlloc(GetProcessHeap(), 0, out_size); + memcpy(buffer, out_buff, out_size); + } + + irp = IoBuildDeviceIoControlRequest(code, device, in_buff, in_size, + buffer, out_size, TRUE, event, &irp_status); + + irpsp = IoGetNextIrpStackLocation(irp); + irpsp->CompletionRoutine = internalComplete; + irpsp->Control = SL_INVOKE_ON_SUCCESS | SL_INVOKE_ON_ERROR; + + IoCallDriver(device, irp); + + if (irp->IoStatus.u.Status == STATUS_PENDING) + WaitForSingleObject(event, INFINITE); + + memcpy(out_buff, buffer, out_size); + status = irp->IoStatus.u.Status; + + IoCompleteRequest(irp, IO_NO_INCREMENT ); + CloseHandle(event); + + return status; +} diff -Nru wine1.7-1.7.50/dlls/hidclass.sys/Makefile.in wine1.7-1.7.55/dlls/hidclass.sys/Makefile.in --- wine1.7-1.7.50/dlls/hidclass.sys/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/hidclass.sys/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -4,4 +4,8 @@ DELAYIMPORTS = setupapi hid C_SRCS = \ - main.c + buffer.c \ + descriptor.c \ + device.c \ + main.c \ + pnp.c diff -Nru wine1.7-1.7.50/dlls/hidclass.sys/parse.h wine1.7-1.7.55/dlls/hidclass.sys/parse.h --- wine1.7-1.7.50/dlls/hidclass.sys/parse.h 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/hidclass.sys/parse.h 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,72 @@ +/* + * Wine internal HID structures + * + * Copyright 2015 Aric Stewart + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_PARSE_H +#define __WINE_PARSE_H + +#define HID_MAGIC 0x8491759 + +typedef enum __WINE_ELEMENT_TYPE { + UnknownElement = 0, + ButtonElement, + ValueElement, +} WINE_ELEMENT_TYPE; + +typedef struct __WINE_ELEMENT +{ + WINE_ELEMENT_TYPE ElementType; + UINT valueStartBit; + UINT bitCount; + union { + HIDP_VALUE_CAPS value; + HIDP_BUTTON_CAPS button; + } caps; +} WINE_HID_ELEMENT; + +typedef struct __WINE_HID_REPORT +{ + UCHAR reportID; + DWORD dwSize; + DWORD elementCount; + WINE_HID_ELEMENT Elements[1]; +} WINE_HID_REPORT; + +typedef struct __WINE_HIDP_PREPARSED_DATA +{ + DWORD magic; + DWORD dwSize; + HIDP_CAPS caps; + + DWORD dwInputReportCount; + DWORD dwOutputReportCount; + DWORD dwFeatureReportCount; + + DWORD dwOutputReportOffset; + DWORD dwFeatureReportOffset; + + WINE_HID_REPORT InputReports[1]; +} WINE_HIDP_PREPARSED_DATA; + +#define HID_NEXT_REPORT(d,r) ((r)?(WINE_HID_REPORT*)(((BYTE*)(r))+(r)->dwSize):(d)->InputReports) +#define HID_INPUT_REPORTS(d) ((d)->InputReports) +#define HID_OUTPUT_REPORTS(d) (WINE_HID_REPORT*)(((BYTE*)(d)->InputReports)+(d)->dwOutputReportOffset) +#define HID_FEATURE_REPORTS(d) (WINE_HID_REPORT*)(((BYTE*)(d)->InputReports)+(d)->dwFeatureReportOffset) + +#endif /* __WINE_PARSE_H */ diff -Nru wine1.7-1.7.50/dlls/hidclass.sys/pnp.c wine1.7-1.7.55/dlls/hidclass.sys/pnp.c --- wine1.7-1.7.50/dlls/hidclass.sys/pnp.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/hidclass.sys/pnp.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,262 @@ +/* + * WINE HID Pseudo-Plug and Play support + * + * Copyright 2015 Aric Stewart + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define NONAMELESSUNION +#include +#include +#include "hid.h" +#include "ddk/hidtypes.h" +#include "wine/debug.h" +#include "wine/unicode.h" +#include "wine/list.h" + +WINE_DEFAULT_DEBUG_CHANNEL(hid); + +typedef struct _NATIVE_DEVICE { + struct list entry; + + DWORD vidpid; + DEVICE_OBJECT *PDO; + DEVICE_OBJECT *FDO; + HID_MINIDRIVER_REGISTRATION *minidriver; + +} NATIVE_DEVICE; + +static struct list tracked_devices = LIST_INIT(tracked_devices); + +static NTSTATUS WINAPI internalComplete(DEVICE_OBJECT *deviceObject, IRP *irp, + void *context ) +{ + SetEvent(irp->UserEvent); + return STATUS_MORE_PROCESSING_REQUIRED; +} + +static NTSTATUS SendDeviceIRP(DEVICE_OBJECT* device, IRP *irp) +{ + NTSTATUS status; + IO_STACK_LOCATION *irpsp; + HANDLE event = CreateEventA(NULL, FALSE, FALSE, NULL); + + irp->UserEvent = event; + irpsp = IoGetNextIrpStackLocation(irp); + irpsp->CompletionRoutine = internalComplete; + irpsp->Control = SL_INVOKE_ON_SUCCESS | SL_INVOKE_ON_ERROR; + + IoCallDriver(device, irp); + + if (irp->IoStatus.u.Status == STATUS_PENDING) + WaitForSingleObject(event, INFINITE); + + status = irp->IoStatus.u.Status; + IoCompleteRequest(irp, IO_NO_INCREMENT ); + CloseHandle(event); + return status; +} + +static NTSTATUS PNP_SendPnPIRP(DEVICE_OBJECT *device, UCHAR minor) +{ + IO_STACK_LOCATION *irpsp; + IO_STATUS_BLOCK irp_status; + + IRP *irp = IoBuildSynchronousFsdRequest(IRP_MJ_PNP, device, NULL, 0, NULL, NULL, &irp_status); + + irpsp = IoGetNextIrpStackLocation(irp); + irpsp->MinorFunction = minor; + + irpsp->Parameters.StartDevice.AllocatedResources = NULL; + irpsp->Parameters.StartDevice.AllocatedResourcesTranslated = NULL; + + return SendDeviceIRP(device, irp); +} + +static NTSTATUS PNP_SendPowerIRP(DEVICE_OBJECT *device, DEVICE_POWER_STATE power) +{ + IO_STATUS_BLOCK irp_status; + IO_STACK_LOCATION *irpsp; + + IRP *irp = IoBuildSynchronousFsdRequest(IRP_MJ_POWER, device, NULL, 0, NULL, NULL, &irp_status); + + irpsp = IoGetNextIrpStackLocation(irp); + irpsp->MinorFunction = IRP_MN_SET_POWER; + + irpsp->Parameters.Power.Type = DevicePowerState; + irpsp->Parameters.Power.State.DeviceState = power; + + return SendDeviceIRP(device, irp); +} + +NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO) +{ + DEVICE_OBJECT *device = NULL; + NTSTATUS status; + minidriver *minidriver; + HID_DEVICE_ATTRIBUTES attr; + BASE_DEVICE_EXTENSION *ext = NULL; + WCHAR serial[256]; + WCHAR interface[256]; + DWORD index = HID_STRING_ID_ISERIALNUMBER; + NATIVE_DEVICE *tracked_device, *ptr; + INT interface_index = 1; + HID_DESCRIPTOR descriptor; + BYTE *reportDescriptor; + INT i; + + static const WCHAR ig_fmtW[] = {'I','G','_','%','i',0}; + static const WCHAR im_fmtW[] = {'I','M','_','%','i',0}; + + + TRACE("PDO add device(%p)\n", PDO); + minidriver = find_minidriver(driver); + + status = HID_CreateDevice(PDO, &minidriver->minidriver, &device); + if (status != STATUS_SUCCESS) + { + ERR("Failed to create HID object (%x)\n",status); + return status; + } + + TRACE("Created device %p\n",device); + status = minidriver->AddDevice(minidriver->minidriver.DriverObject, device); + if (status != STATUS_SUCCESS) + { + ERR("Minidriver AddDevice failed (%x)\n",status); + HID_DeleteDevice(&minidriver->minidriver, device); + return status; + } + + status = PNP_SendPnPIRP(device, IRP_MN_START_DEVICE); + if (status != STATUS_SUCCESS) + { + ERR("Minidriver IRP_MN_START_DEVICE failed (%x)\n",status); + HID_DeleteDevice(&minidriver->minidriver, device); + return status; + } + + status = call_minidriver(IOCTL_HID_GET_DEVICE_ATTRIBUTES, device, + NULL, 0, &attr, sizeof(attr)); + + if (status != STATUS_SUCCESS) + { + ERR("Minidriver failed to get Attributes(%x)\n",status); + PNP_SendPnPIRP(device, IRP_MN_REMOVE_DEVICE); + HID_DeleteDevice(&minidriver->minidriver, device); + return status; + } + + ext = device->DeviceExtension; + ext->information.VendorID = attr.VendorID; + ext->information.ProductID = attr.ProductID; + ext->information.VersionNumber = attr.VersionNumber; + ext->information.Polled = minidriver->minidriver.DevicesArePolled; + + tracked_device = HeapAlloc(GetProcessHeap(), 0, sizeof(*tracked_device)); + tracked_device->vidpid = MAKELONG(attr.VendorID, attr.ProductID); + tracked_device->PDO = PDO; + tracked_device->FDO = device; + tracked_device->minidriver = &minidriver->minidriver; + + LIST_FOR_EACH_ENTRY(ptr, &tracked_devices, NATIVE_DEVICE, entry) + if (ptr->vidpid == tracked_device->vidpid) interface_index++; + + list_add_tail(&tracked_devices, &tracked_device->entry); + + status = call_minidriver(IOCTL_HID_GET_DEVICE_DESCRIPTOR, device, NULL, 0, + &descriptor, sizeof(descriptor)); + if (status != STATUS_SUCCESS) + { + ERR("Cannot get Device Descriptor(%x)\n",status); + PNP_SendPnPIRP(device, IRP_MN_REMOVE_DEVICE); + HID_DeleteDevice(&minidriver->minidriver, device); + return status; + } + for (i = 0; i < descriptor.bNumDescriptors; i++) + if (descriptor.DescriptorList[i].bReportType == HID_REPORT_DESCRIPTOR_TYPE) + break; + + if (i >= descriptor.bNumDescriptors) + { + ERR("No Report Descriptor found in reply\n"); + PNP_SendPnPIRP(device, IRP_MN_REMOVE_DEVICE); + HID_DeleteDevice(&minidriver->minidriver, device); + return status; + } + + reportDescriptor = HeapAlloc(GetProcessHeap(), 0, descriptor.DescriptorList[i].wReportLength); + status = call_minidriver(IOCTL_HID_GET_REPORT_DESCRIPTOR, device, NULL, 0, + reportDescriptor, descriptor.DescriptorList[i].wReportLength); + if (status != STATUS_SUCCESS) + { + ERR("Cannot get Report Descriptor(%x)\n",status); + HID_DeleteDevice(&minidriver->minidriver, device); + HeapFree(GetProcessHeap(), 0, reportDescriptor); + return status; + } + + ext->preparseData = ParseDescriptor(reportDescriptor, descriptor.DescriptorList[0].wReportLength); + ext->information.DescriptorSize = ext->preparseData->dwSize; + HeapFree(GetProcessHeap(), 0, reportDescriptor); + + serial[0] = 0; + status = call_minidriver(IOCTL_HID_GET_STRING, device, + &index, sizeof(DWORD), serial, sizeof(serial)); + + if (serial[0] == 0) + { + static const WCHAR wZeroSerial[]= {'0','0','0','0',0}; + lstrcpyW(serial, wZeroSerial); + } + + if (ext->preparseData->caps.UsagePage == HID_USAGE_PAGE_GENERIC && + (ext->preparseData->caps.Usage == HID_USAGE_GENERIC_GAMEPAD || + ext->preparseData->caps.Usage == HID_USAGE_GENERIC_JOYSTICK)) + sprintfW(interface, ig_fmtW, interface_index); + else + sprintfW(interface, im_fmtW, interface_index); + + HID_LinkDevice(device, serial, interface); + + ext->poll_interval = DEFAULT_POLL_INTERVAL; + InitializeListHead(&ext->irp_queue); + + ext->ring_buffer = RingBuffer_Create(sizeof(HID_XFER_PACKET) + ext->preparseData->caps.InputReportByteLength); + + HID_StartDeviceThread(device); + PNP_SendPowerIRP(device, PowerDeviceD0); + + return STATUS_SUCCESS; +} + +void PNP_CleanupPNP(DRIVER_OBJECT *driver) +{ + NATIVE_DEVICE *tracked_device, *ptr; + + LIST_FOR_EACH_ENTRY_SAFE(tracked_device, ptr, &tracked_devices, + NATIVE_DEVICE, entry) + { + if (tracked_device->minidriver->DriverObject == driver) + { + list_remove(&tracked_device->entry); + PNP_SendPowerIRP(tracked_device->FDO, PowerDeviceD3); + PNP_SendPnPIRP(tracked_device->FDO, IRP_MN_REMOVE_DEVICE); + HID_DeleteDevice(tracked_device->minidriver, tracked_device->FDO); + HeapFree(GetProcessHeap(), 0, tracked_device); + } + } +} diff -Nru wine1.7-1.7.50/dlls/hnetcfg/apps.c wine1.7-1.7.55/dlls/hnetcfg/apps.c --- wine1.7-1.7.50/dlls/hnetcfg/apps.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/hnetcfg/apps.c 2015-11-13 14:32:40.000000000 +0000 @@ -109,6 +109,7 @@ &IID_INetFwAuthorizedApplications, &IID_INetFwMgr, &IID_INetFwOpenPort, + &IID_INetFwOpenPorts, &IID_INetFwPolicy, &IID_INetFwProfile }; diff -Nru wine1.7-1.7.50/dlls/hnetcfg/hnetcfg_private.h wine1.7-1.7.55/dlls/hnetcfg/hnetcfg_private.h --- wine1.7-1.7.50/dlls/hnetcfg/hnetcfg_private.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/hnetcfg/hnetcfg_private.h 2015-11-13 14:32:40.000000000 +0000 @@ -22,6 +22,7 @@ INetFwAuthorizedApplications_tid, INetFwMgr_tid, INetFwOpenPort_tid, + INetFwOpenPorts_tid, INetFwPolicy_tid, INetFwProfile_tid, last_tid diff -Nru wine1.7-1.7.50/dlls/hnetcfg/port.c wine1.7-1.7.55/dlls/hnetcfg/port.c --- wine1.7-1.7.50/dlls/hnetcfg/port.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/hnetcfg/port.c 2015-11-13 14:32:40.000000000 +0000 @@ -38,6 +38,9 @@ { INetFwOpenPort INetFwOpenPort_iface; LONG refs; + BSTR name; + NET_FW_IP_PROTOCOL protocol; + LONG port; } fw_port; static inline fw_port *impl_from_INetFwOpenPort( INetFwOpenPort *iface ) @@ -60,6 +63,7 @@ if (!refs) { TRACE("destroying %p\n", fw_port); + SysFreeString( fw_port->name ); HeapFree( GetProcessHeap(), 0, fw_port ); } return refs; @@ -179,8 +183,14 @@ { fw_port *This = impl_from_INetFwOpenPort( iface ); - FIXME("%p %s\n", This, debugstr_w(name)); - return E_NOTIMPL; + TRACE("%p %s\n", This, debugstr_w(name)); + + if (!(name = SysAllocString( name ))) + return E_OUTOFMEMORY; + + SysFreeString( This->name ); + This->name = name; + return S_OK; } static HRESULT WINAPI fw_port_get_IpVersion( @@ -219,8 +229,13 @@ { fw_port *This = impl_from_INetFwOpenPort( iface ); - FIXME("%p %u\n", This, ipProtocol); - return E_NOTIMPL; + TRACE("%p %u\n", This, ipProtocol); + + if (ipProtocol != NET_FW_IP_PROTOCOL_TCP && ipProtocol != NET_FW_IP_PROTOCOL_UDP) + return E_INVALIDARG; + + This->protocol = ipProtocol; + return S_OK; } static HRESULT WINAPI fw_port_get_Port( @@ -239,8 +254,9 @@ { fw_port *This = impl_from_INetFwOpenPort( iface ); - FIXME("%p %d\n", This, portNumber); - return E_NOTIMPL; + TRACE("%p %d\n", This, portNumber); + This->port = portNumber; + return S_OK; } static HRESULT WINAPI fw_port_get_Scope( @@ -302,7 +318,7 @@ fw_port *This = impl_from_INetFwOpenPort( iface ); FIXME("%p %d\n", This, enabled); - return E_NOTIMPL; + return S_OK; } static HRESULT WINAPI fw_port_get_BuiltIn( @@ -352,6 +368,9 @@ fp->INetFwOpenPort_iface.lpVtbl = &fw_port_vtbl; fp->refs = 1; + fp->name = NULL; + fp->protocol = NET_FW_IP_PROTOCOL_TCP; + fp->port = 0; *ppObj = &fp->INetFwOpenPort_iface; @@ -420,8 +439,9 @@ { fw_ports *This = impl_from_INetFwOpenPorts( iface ); - FIXME("%p %p\n", This, pctinfo); - return E_NOTIMPL; + TRACE("%p %p\n", This, pctinfo); + *pctinfo = 1; + return S_OK; } static HRESULT WINAPI fw_ports_GetTypeInfo( @@ -432,8 +452,8 @@ { fw_ports *This = impl_from_INetFwOpenPorts( iface ); - FIXME("%p %u %u %p\n", This, iTInfo, lcid, ppTInfo); - return E_NOTIMPL; + TRACE("%p %u %u %p\n", This, iTInfo, lcid, ppTInfo); + return get_typeinfo( INetFwOpenPorts_tid, ppTInfo ); } static HRESULT WINAPI fw_ports_GetIDsOfNames( @@ -445,9 +465,18 @@ DISPID *rgDispId ) { fw_ports *This = impl_from_INetFwOpenPorts( iface ); + ITypeInfo *typeinfo; + HRESULT hr; - FIXME("%p %s %p %u %u %p\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId); - return E_NOTIMPL; + TRACE("%p %s %p %u %u %p\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId); + + hr = get_typeinfo( INetFwOpenPorts_tid, &typeinfo ); + if (SUCCEEDED(hr)) + { + hr = ITypeInfo_GetIDsOfNames( typeinfo, rgszNames, cNames, rgDispId ); + ITypeInfo_Release( typeinfo ); + } + return hr; } static HRESULT WINAPI fw_ports_Invoke( @@ -462,10 +491,20 @@ UINT *puArgErr ) { fw_ports *This = impl_from_INetFwOpenPorts( iface ); + ITypeInfo *typeinfo; + HRESULT hr; - FIXME("%p %d %s %d %d %p %p %p %p\n", This, dispIdMember, debugstr_guid(riid), + TRACE("%p %d %s %d %d %p %p %p %p\n", This, dispIdMember, debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); - return E_NOTIMPL; + + hr = get_typeinfo( INetFwOpenPorts_tid, &typeinfo ); + if (SUCCEEDED(hr)) + { + hr = ITypeInfo_Invoke( typeinfo, &This->INetFwOpenPorts_iface, dispIdMember, + wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr ); + ITypeInfo_Release( typeinfo ); + } + return hr; } static HRESULT WINAPI fw_ports_get_Count( diff -Nru wine1.7-1.7.50/dlls/iccvid/iccvid.c wine1.7-1.7.55/dlls/iccvid/iccvid.c --- wine1.7-1.7.50/dlls/iccvid/iccvid.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/iccvid/iccvid.c 2015-11-13 14:32:40.000000000 +0000 @@ -141,6 +141,15 @@ } } +static inline long get_addr(BOOL inverted, unsigned long x, unsigned long y, + int frm_stride, int bpp, unsigned int out_height) +{ + /* Returns the starting position of a line from top-down or bottom-up */ + if (inverted) + return y * frm_stride + x * bpp; + else + return (out_height - 1 - y) * frm_stride + x * bpp; +} #define MAKECOLOUR32(r,g,b) (((r) << 16) | ((g) << 8) | (b)) /*#define MAKECOLOUR24(r,g,b) (((r) << 16) | ((g) << 8) | (b))*/ @@ -148,16 +157,18 @@ #define MAKECOLOUR15(r,g,b) (((r) >> 3) << 10)| (((g) >> 3) << 5)| (((b) >> 3) << 0) /* ------------------------------------------------------------------------ */ -static void cvid_v1_32(unsigned char *frm, unsigned char *limit, int stride, cvid_codebook *cb) +static void cvid_v1_32(unsigned char *frm, unsigned char *limit, int stride, BOOL inverted, + cvid_codebook *cb) { unsigned long *vptr = (unsigned long *)frm; -#ifndef ORIGINAL -int row_inc = -stride/4; -#else -int row_inc = stride/4; -#endif +int row_inc; int x, y; + if (!inverted) + row_inc = -stride/4; + else + row_inc = stride/4; + /* fill 4x4 block of pixels with colour values from codebook */ for (y = 0; y < 4; y++) { @@ -169,18 +180,19 @@ /* ------------------------------------------------------------------------ */ -static void cvid_v4_32(unsigned char *frm, unsigned char *limit, int stride, cvid_codebook *cb0, - cvid_codebook *cb1, cvid_codebook *cb2, cvid_codebook *cb3) +static void cvid_v4_32(unsigned char *frm, unsigned char *limit, int stride, BOOL inverted, + cvid_codebook *cb0, cvid_codebook *cb1, cvid_codebook *cb2, cvid_codebook *cb3) { unsigned long *vptr = (unsigned long *)frm; -#ifndef ORIGINAL -int row_inc = -stride/4; -#else -int row_inc = stride/4; -#endif +int row_inc; int x, y; cvid_codebook * cb[] = {cb0,cb1,cb2,cb3}; + if (!inverted) + row_inc = -stride/4; + else + row_inc = stride/4; + /* fill 4x4 block of pixels with colour values from codebooks */ for (y = 0; y < 4; y++) { @@ -192,15 +204,17 @@ /* ------------------------------------------------------------------------ */ -static void cvid_v1_24(unsigned char *vptr, unsigned char *limit, int stride, cvid_codebook *cb) +static void cvid_v1_24(unsigned char *vptr, unsigned char *limit, int stride, BOOL inverted, + cvid_codebook *cb) { -#ifndef ORIGINAL -int row_inc = -stride; -#else -int row_inc = stride; -#endif +int row_inc; int x, y; + if (!inverted) + row_inc = -stride; + else + row_inc = stride; + /* fill 4x4 block of pixels with colour values from codebook */ for (y = 0; y < 4; y++) { @@ -216,17 +230,18 @@ /* ------------------------------------------------------------------------ */ -static void cvid_v4_24(unsigned char *vptr, unsigned char *limit, int stride, cvid_codebook *cb0, - cvid_codebook *cb1, cvid_codebook *cb2, cvid_codebook *cb3) +static void cvid_v4_24(unsigned char *vptr, unsigned char *limit, int stride, BOOL inverted, + cvid_codebook *cb0, cvid_codebook *cb1, cvid_codebook *cb2, cvid_codebook *cb3) { -#ifndef ORIGINAL -int row_inc = -stride; -#else -int row_inc = stride; -#endif +int row_inc; cvid_codebook * cb[] = {cb0,cb1,cb2,cb3}; int x, y; + if (!inverted) + row_inc = -stride; + else + row_inc = stride; + /* fill 4x4 block of pixels with colour values from codebooks */ for (y = 0; y < 4; y++) { @@ -242,16 +257,18 @@ /* ------------------------------------------------------------------------ */ -static void cvid_v1_16(unsigned char *frm, unsigned char *limit, int stride, cvid_codebook *cb) +static void cvid_v1_16(unsigned char *frm, unsigned char *limit, int stride, BOOL inverted, + cvid_codebook *cb) { unsigned short *vptr = (unsigned short *)frm; -#ifndef ORIGINAL -int row_inc = -stride/2; -#else -int row_inc = stride/2; -#endif +int row_inc; int x, y; + if (!inverted) + row_inc = -stride/2; + else + row_inc = stride/2; + /* fill 4x4 block of pixels with colour values from codebook */ for (y = 0; y < 4; y++) { @@ -263,18 +280,19 @@ /* ------------------------------------------------------------------------ */ -static void cvid_v4_16(unsigned char *frm, unsigned char *limit, int stride, cvid_codebook *cb0, - cvid_codebook *cb1, cvid_codebook *cb2, cvid_codebook *cb3) +static void cvid_v4_16(unsigned char *frm, unsigned char *limit, int stride, BOOL inverted, + cvid_codebook *cb0, cvid_codebook *cb1, cvid_codebook *cb2, cvid_codebook *cb3) { unsigned short *vptr = (unsigned short *)frm; -#ifndef ORIGINAL -int row_inc = -stride/2; -#else -int row_inc = stride/2; -#endif +int row_inc; cvid_codebook * cb[] = {cb0,cb1,cb2,cb3}; int x, y; + if (!inverted) + row_inc = -stride/2; + else + row_inc = stride/2; + /* fill 4x4 block of pixels with colour values from codebooks */ for (y = 0; y < 4; y++) { @@ -285,16 +303,18 @@ } /* ------------------------------------------------------------------------ */ -static void cvid_v1_15(unsigned char *frm, unsigned char *limit, int stride, cvid_codebook *cb) +static void cvid_v1_15(unsigned char *frm, unsigned char *limit, int stride, BOOL inverted, + cvid_codebook *cb) { unsigned short *vptr = (unsigned short *)frm; -#ifndef ORIGINAL -int row_inc = -stride/2; -#else -int row_inc = stride/2; -#endif +int row_inc; int x, y; + if (!inverted) + row_inc = -stride/2; + else + row_inc = stride/2; + /* fill 4x4 block of pixels with colour values from codebook */ for (y = 0; y < 4; y++) { @@ -306,18 +326,19 @@ /* ------------------------------------------------------------------------ */ -static void cvid_v4_15(unsigned char *frm, unsigned char *limit, int stride, cvid_codebook *cb0, - cvid_codebook *cb1, cvid_codebook *cb2, cvid_codebook *cb3) +static void cvid_v4_15(unsigned char *frm, unsigned char *limit, int stride, BOOL inverted, + cvid_codebook *cb0, cvid_codebook *cb1, cvid_codebook *cb2, cvid_codebook *cb3) { unsigned short *vptr = (unsigned short *)frm; -#ifndef ORIGINAL -int row_inc = -stride/2; -#else -int row_inc = stride/2; -#endif +int row_inc; cvid_codebook * cb[] = {cb0,cb1,cb2,cb3}; int x, y; + if (!inverted) + row_inc = -stride/2; + else + row_inc = stride/2; + /* fill 4x4 block of pixels with colour values from codebooks */ for (y = 0; y < 4; y++) { @@ -365,8 +386,9 @@ } typedef void (*fn_cvid_v1)(unsigned char *frm, unsigned char *limit, - int stride, cvid_codebook *cb); -typedef void (*fn_cvid_v4)(unsigned char *frm, unsigned char *limit, int stride, + int stride, BOOL inverted, cvid_codebook *cb); +typedef void (*fn_cvid_v4)(unsigned char *frm, unsigned char *limit, + int stride, BOOL inverted, cvid_codebook *cb0, cvid_codebook *cb1, cvid_codebook *cb2, cvid_codebook *cb3); @@ -376,33 +398,42 @@ * context - the context created by decode_cinepak_init(). * buf - the input buffer to be decoded * size - the size of the input buffer - * frame - the output frame buffer (24 or 32 bit per pixel) - * width - the width of the output frame - * height - the height of the output frame + * output - the output frame buffer (24 or 32 bit per pixel) + * out_width - the width of the output frame + * out_height - the height of the output frame * bit_per_pixel - the number of bits per pixel allocated to the output * frame (only 24 or 32 bpp are supported) + * inverted - if true the output frame is written top-down */ static void decode_cinepak(cinepak_info *cvinfo, unsigned char *buf, int size, - unsigned char *frame, unsigned int width, unsigned int height, int bit_per_pixel) + unsigned char *output, unsigned int out_width, unsigned int out_height, int bit_per_pixel, BOOL inverted) { cvid_codebook *v4_codebook, *v1_codebook, *codebook = NULL; - unsigned long x, y, y_bottom, frame_flags, strips, cv_width, cv_height, - cnum, strip_id, chunk_id, x0, y0, x1, y1, ci, flag, mask; - long len, top_size, chunk_size; + unsigned long x, y, y_bottom, cnum, strip_id, chunk_id, + x0, y0, x1, y1, ci, flag, mask; + long top_size, chunk_size; unsigned char *frm_ptr; - unsigned int i, cur_strip; + unsigned int i, cur_strip, addr; int d0, d1, d2, d3, frm_stride, bpp = 3; fn_cvid_v1 cvid_v1 = cvid_v1_24; fn_cvid_v4 cvid_v4 = cvid_v4_24; + struct frame_header + { + unsigned char flags; + unsigned long length; + unsigned short width; + unsigned short height; + unsigned short strips; + } frame; y = 0; y_bottom = 0; in_buffer = buf; - frame_flags = get_byte(); - len = get_byte() << 16; - len |= get_byte() << 8; - len |= get_byte(); + frame.flags = get_byte(); + frame.length = get_byte() << 16; + frame.length |= get_byte() << 8; + frame.length |= get_byte(); switch(bit_per_pixel) { @@ -428,32 +459,32 @@ break; } - frm_stride = width * bpp; - frm_ptr = frame; + frm_stride = out_width * bpp; + frm_ptr = output; - if(len != size) + if(frame.length != size) { - if(len & 0x01) len++; /* AVIs tend to have a size mismatch */ - if(len != size) + if(frame.length & 0x01) frame.length++; /* AVIs tend to have a size mismatch */ + if(frame.length != size) { - ERR("CVID: corruption %d (QT/AVI) != %ld (CV)\n", size, len); + ERR("CVID: corruption %d (QT/AVI) != %ld (CV)\n", size, frame.length); /* return; */ } } - cv_width = get_word(); - cv_height = get_word(); - strips = get_word(); + frame.width = get_word(); + frame.height = get_word(); + frame.strips = get_word(); - if(strips > cvinfo->strip_num) + if(frame.strips > cvinfo->strip_num) { - if(strips >= MAX_STRIPS) + if(frame.strips >= MAX_STRIPS) { ERR("CVID: strip overflow (more than %d)\n", MAX_STRIPS); return; } - for(i = cvinfo->strip_num; i < strips; i++) + for(i = cvinfo->strip_num; i < frame.strips; i++) { if((cvinfo->v4_codebook[i] = heap_alloc(sizeof(cvid_codebook) * 260)) == NULL) { @@ -468,16 +499,17 @@ } } } - cvinfo->strip_num = strips; + cvinfo->strip_num = frame.strips; - TRACE("CVID: <%ld,%ld> strips %ld\n", cv_width, cv_height, strips); + TRACE("CVID: %ux%u, strips %u, length %lu\n", + frame.width, frame.height, frame.strips, frame.length); - for(cur_strip = 0; cur_strip < strips; cur_strip++) + for(cur_strip = 0; cur_strip < frame.strips; cur_strip++) { v4_codebook = cvinfo->v4_codebook[cur_strip]; v1_codebook = cvinfo->v1_codebook[cur_strip]; - if((cur_strip > 0) && (!(frame_flags & 0x01))) + if((cur_strip > 0) && (!(frame.flags & 0x01))) { memcpy(cvinfo->v4_codebook[cur_strip], cvinfo->v4_codebook[cur_strip-1], 260 * sizeof(cvid_codebook)); memcpy(cvinfo->v1_codebook[cur_strip], cvinfo->v1_codebook[cur_strip-1], 260 * sizeof(cvid_codebook)); @@ -493,8 +525,8 @@ y_bottom += y1; top_size -= 12; x = 0; - if(x1 != width) - WARN("CVID: Warning x1 (%ld) != width (%d)\n", x1, width); + if(x1 != out_width) + WARN("CVID: Warning x1 (%ld) != width (%d)\n", x1, out_width); TRACE(" %d) %04lx %04ld <%ld,%ld> <%ld,%ld> yt %ld\n", cur_strip, strip_id, top_size, x0, y0, x1, y1, y_bottom); @@ -592,24 +624,20 @@ d2 = get_byte(); d3 = get_byte(); chunk_size -= 4; -#ifdef ORIGINAL - cvid_v4(frm_ptr + (y * frm_stride + x * bpp), frm_end, frm_stride, v4_codebook+d0, v4_codebook+d1, v4_codebook+d2, v4_codebook+d3); -#else - cvid_v4(frm_ptr + ((height - 1 - y) * frm_stride + x * bpp), frame, frm_stride, v4_codebook+d0, v4_codebook+d1, v4_codebook+d2, v4_codebook+d3); -#endif + + addr = get_addr(inverted, x, y, frm_stride, bpp, out_height); + cvid_v4(frm_ptr + addr, output, frm_stride, inverted, v4_codebook+d0, v4_codebook+d1, v4_codebook+d2, v4_codebook+d3); } else /* 1 byte per block */ { -#ifdef ORIGINAL - cvid_v1(frm_ptr + (y * frm_stride + x * bpp), frm_end, frm_stride, v1_codebook + get_byte()); -#else - cvid_v1(frm_ptr + ((height - 1 - y) * frm_stride + x * bpp), frame, frm_stride, v1_codebook + get_byte()); -#endif + addr = get_addr(inverted, x, y, frm_stride, bpp, out_height); + cvid_v1(frm_ptr + addr, output, frm_stride, inverted, v1_codebook + get_byte()); + chunk_size--; } x += 4; - if(x >= width) + if(x >= out_width) { x = 0; y += 4; @@ -648,26 +676,22 @@ d2 = get_byte(); d3 = get_byte(); chunk_size -= 4; -#ifdef ORIGINAL - cvid_v4(frm_ptr + (y * frm_stride + x * bpp), frm_end, frm_stride, v4_codebook+d0, v4_codebook+d1, v4_codebook+d2, v4_codebook+d3); -#else - cvid_v4(frm_ptr + ((height - 1 - y) * frm_stride + x * bpp), frame, frm_stride, v4_codebook+d0, v4_codebook+d1, v4_codebook+d2, v4_codebook+d3); -#endif + + addr = get_addr(inverted, x, y, frm_stride, bpp, out_height); + cvid_v4(frm_ptr + addr, output, frm_stride, inverted, v4_codebook+d0, v4_codebook+d1, v4_codebook+d2, v4_codebook+d3); } else /* V1 */ { chunk_size--; -#ifdef ORIGINAL - cvid_v1(frm_ptr + (y * frm_stride + x * bpp), frm_end, frm_stride, v1_codebook + get_byte()); -#else - cvid_v1(frm_ptr + ((height - 1 - y) * frm_stride + x * bpp), frame, frm_stride, v1_codebook + get_byte()); -#endif + + addr = get_addr(inverted, x, y, frm_stride, bpp, out_height); + cvid_v1(frm_ptr + addr, output, frm_stride, inverted, v1_codebook + get_byte()); } } /* else SKIP */ mask >>= 1; x += 4; - if(x >= width) + if(x >= out_width) { x = 0; y += 4; @@ -681,14 +705,12 @@ case 0x3200: /* each byte is a V1 codebook */ while((chunk_size > 0) && (y < y_bottom)) { -#ifdef ORIGINAL - cvid_v1(frm_ptr + (y * frm_stride + x * bpp), frm_end, frm_stride, v1_codebook + get_byte()); -#else - cvid_v1(frm_ptr + ((height - 1 - y) * frm_stride + x * bpp), frame, frm_stride, v1_codebook + get_byte()); -#endif + addr = get_addr(inverted, x, y, frm_stride, bpp, out_height); + cvid_v1(frm_ptr + addr, output, frm_stride, inverted, v1_codebook + get_byte()); + chunk_size--; x += 4; - if(x >= width) + if(x >= out_width) { x = 0; y += 4; @@ -705,10 +727,10 @@ } } - if(len != size) + if(frame.length != size) { - if(len & 0x01) len++; /* AVIs tend to have a size mismatch */ - if(len != size) + if(frame.length & 0x01) frame.length++; /* AVIs tend to have a size mismatch */ + if(frame.length != size) { long xlen; skip_byte(); @@ -716,7 +738,7 @@ xlen |= get_byte() << 8; xlen |= get_byte(); /* Read Len */ WARN("CVID: END INFO chunk size %d cvid size1 %ld cvid size2 %ld\n", - size, len, xlen); + size, frame.length, xlen); } } } @@ -773,7 +795,11 @@ if( in->bmiHeader.biPlanes != out->bmiHeader.biPlanes ) return ICERR_BADFORMAT; if( in->bmiHeader.biHeight != out->bmiHeader.biHeight ) - return ICERR_BADFORMAT; + { + if( in->bmiHeader.biHeight != -out->bmiHeader.biHeight ) + return ICERR_BADFORMAT; + TRACE("Detected inverted height for video output\n"); + } if( in->bmiHeader.biWidth != out->bmiHeader.biWidth ) return ICERR_BADFORMAT; @@ -865,6 +891,7 @@ static LRESULT ICCVID_Decompress( ICCVID_Info *info, ICDECOMPRESS *icd, DWORD size ) { LONG width, height; + BOOL inverted; TRACE("ICM_DECOMPRESS %p %p %d\n", info, icd, size); @@ -878,9 +905,10 @@ width = icd->lpbiInput->biWidth; height = icd->lpbiInput->biHeight; + inverted = -icd->lpbiOutput->biHeight == height; decode_cinepak(info->cvinfo, icd->lpInput, icd->lpbiInput->biSizeImage, - icd->lpOutput, width, height, info->bits_per_pixel); + icd->lpOutput, width, height, info->bits_per_pixel, inverted); return ICERR_OK; } @@ -888,6 +916,7 @@ static LRESULT ICCVID_DecompressEx( ICCVID_Info *info, ICDECOMPRESSEX *icd, DWORD size ) { LONG width, height; + BOOL inverted; TRACE("ICM_DECOMPRESSEX %p %p %d\n", info, icd, size); @@ -903,9 +932,10 @@ width = icd->lpbiSrc->biWidth; height = icd->lpbiSrc->biHeight; + inverted = -icd->lpbiDst->biHeight == height; decode_cinepak(info->cvinfo, icd->lpSrc, icd->lpbiSrc->biSizeImage, - icd->lpDst, width, height, info->bits_per_pixel); + icd->lpDst, width, height, info->bits_per_pixel, inverted); return ICERR_OK; } diff -Nru wine1.7-1.7.50/dlls/ieframe/dochost.c wine1.7-1.7.55/dlls/ieframe/dochost.c --- wine1.7-1.7.50/dlls/ieframe/dochost.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ieframe/dochost.c 2015-11-13 14:32:40.000000000 +0000 @@ -93,20 +93,22 @@ dispparams.rgvarg = params; V_VT(params) = VT_BOOL; - V_BOOL(params) = enable; + V_BOOL(params) = enable ? VARIANT_TRUE : VARIANT_FALSE; V_VT(params+1) = VT_I4; V_I4(params+1) = command; call_sink(doc_host->cps.wbe2, DISPID_COMMANDSTATECHANGE, &dispparams); + + doc_host->container_vtbl->on_command_state_change(doc_host, command, enable); } void update_navigation_commands(DocHost *dochost) { unsigned pos = dochost->travellog.loading_pos == -1 ? dochost->travellog.position : dochost->travellog.loading_pos; - on_commandstate_change(dochost, CSC_NAVIGATEBACK, pos > 0 ? VARIANT_TRUE : VARIANT_FALSE); - on_commandstate_change(dochost, CSC_NAVIGATEFORWARD, pos < dochost->travellog.length ? VARIANT_TRUE : VARIANT_FALSE); + on_commandstate_change(dochost, CSC_NAVIGATEBACK, pos > 0); + on_commandstate_change(dochost, CSC_NAVIGATEFORWARD, pos < dochost->travellog.length); } static void notif_complete(DocHost *This, DISPID dispid) @@ -498,7 +500,7 @@ doc_view_atom = RegisterClassExW(&wndclass); } - This->container_vtbl->GetDocObjRect(This, &rect); + This->container_vtbl->get_docobj_rect(This, &rect); This->hwnd = CreateWindowExW(0, wszShell_DocObject_View, wszShell_DocObject_View, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_TABSTOP, diff -Nru wine1.7-1.7.50/dlls/ieframe/frame.c wine1.7-1.7.55/dlls/ieframe/frame.c --- wine1.7-1.7.50/dlls/ieframe/frame.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ieframe/frame.c 2015-11-13 14:32:40.000000000 +0000 @@ -141,7 +141,7 @@ { DocHost *This = impl_from_IOleInPlaceFrame(iface); TRACE("(%p)->(%s)\n", This, debugstr_w(pszStatusText)); - return This->container_vtbl->SetStatusText(This, pszStatusText); + return This->container_vtbl->set_status_text(This, pszStatusText); } static HRESULT WINAPI InPlaceFrame_EnableModeless(IOleInPlaceFrame *iface, BOOL fEnable) diff -Nru wine1.7-1.7.50/dlls/ieframe/ieframe.h wine1.7-1.7.55/dlls/ieframe/ieframe.h --- wine1.7-1.7.50/dlls/ieframe/ieframe.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ieframe/ieframe.h 2015-11-13 14:32:40.000000000 +0000 @@ -103,9 +103,10 @@ { ULONG (*addref)(DocHost*); ULONG (*release)(DocHost*); - void (WINAPI* GetDocObjRect)(DocHost*,RECT*); - HRESULT (WINAPI* SetStatusText)(DocHost*,LPCWSTR); - void (WINAPI* SetURL)(DocHost*,LPCWSTR); + void (*get_docobj_rect)(DocHost*,RECT*); + HRESULT (*set_status_text)(DocHost*,const WCHAR*); + void (*on_command_state_change)(DocHost*,LONG,BOOL); + void (*set_url)(DocHost*,const WCHAR*); } IDocHostContainerVtbl; struct DocHost { @@ -230,6 +231,7 @@ HWND frame_hwnd; HWND status_hwnd; + HWND toolbar_hwnd; HMENU menu; BOOL nohome; diff -Nru wine1.7-1.7.50/dlls/ieframe/iexplore.c wine1.7-1.7.55/dlls/ieframe/iexplore.c --- wine1.7-1.7.50/dlls/ieframe/iexplore.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ieframe/iexplore.c 2015-11-13 14:32:40.000000000 +0000 @@ -402,7 +402,7 @@ DestroyIcon(icon); } -static void add_tb_separator(HWND hwnd) +static void add_tb_separator(InternetExplorer *ie) { TBBUTTON btn; @@ -410,10 +410,10 @@ btn.iBitmap = 3; btn.fsStyle = BTNS_SEP; - SendMessageW(hwnd, TB_ADDBUTTONSW, 1, (LPARAM)&btn); + SendMessageW(ie->toolbar_hwnd, TB_ADDBUTTONSW, 1, (LPARAM)&btn); } -static void add_tb_button(HWND hwnd, int bmp, int cmd, int strId) +static void add_tb_button(InternetExplorer *ie, int bmp, int cmd, int strId) { TBBUTTON btn; WCHAR buf[30]; @@ -427,14 +427,18 @@ btn.dwData = 0; btn.iString = (INT_PTR)buf; - SendMessageW(hwnd, TB_ADDBUTTONSW, 1, (LPARAM)&btn); + SendMessageW(ie->toolbar_hwnd, TB_ADDBUTTONSW, 1, (LPARAM)&btn); } -static void create_rebar(HWND hwnd) +static void enable_toolbar_button(InternetExplorer *ie, int command, BOOL enable) +{ + SendMessageW(ie->toolbar_hwnd, TB_ENABLEBUTTON, command, enable); +} + +static void create_rebar(InternetExplorer *ie) { HWND hwndRebar; HWND hwndAddress; - HWND hwndToolbar; REBARINFO rebarinf; REBARBANDINFOW bandinf; WCHAR addr[40]; @@ -445,7 +449,7 @@ hwndRebar = CreateWindowExW(WS_EX_TOOLWINDOW, REBARCLASSNAMEW, NULL, WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|RBS_VARHEIGHT|CCS_TOP|CCS_NODIVIDER, 0, 0, 0, 0, - hwnd, (HMENU)IDC_BROWSE_REBAR, ieframe_instance, NULL); + ie->frame_hwnd, (HMENU)IDC_BROWSE_REBAR, ieframe_instance, NULL); rebarinf.cbSize = sizeof(rebarinf); rebarinf.fMask = 0; @@ -453,29 +457,29 @@ SendMessageW(hwndRebar, RB_SETBARINFO, 0, (LPARAM)&rebarinf); - hwndToolbar = CreateWindowExW(TBSTYLE_EX_MIXEDBUTTONS, TOOLBARCLASSNAMEW, NULL, TBSTYLE_FLAT | WS_CHILD | WS_VISIBLE | CCS_NORESIZE, + ie->toolbar_hwnd = CreateWindowExW(TBSTYLE_EX_MIXEDBUTTONS, TOOLBARCLASSNAMEW, NULL, TBSTYLE_FLAT | WS_CHILD | WS_VISIBLE | CCS_NORESIZE, 0, 0, 0, 0, hwndRebar, (HMENU)IDC_BROWSE_TOOLBAR, ieframe_instance, NULL); imagelist = ImageList_LoadImageW(ieframe_instance, MAKEINTRESOURCEW(IDB_IETOOLBAR), 32, 0, CLR_NONE, IMAGE_BITMAP, LR_CREATEDIBSECTION); - SendMessageW(hwndToolbar, TB_SETIMAGELIST, 0, (LPARAM)imagelist); - SendMessageW(hwndToolbar, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0); - add_tb_button(hwndToolbar, 0, ID_BROWSE_BACK, IDS_TB_BACK); - add_tb_button(hwndToolbar, 1, ID_BROWSE_FORWARD, IDS_TB_FORWARD); - add_tb_button(hwndToolbar, 2, ID_BROWSE_STOP, IDS_TB_STOP); - add_tb_button(hwndToolbar, 3, ID_BROWSE_REFRESH, IDS_TB_REFRESH); - add_tb_button(hwndToolbar, 4, ID_BROWSE_HOME, IDS_TB_HOME); - add_tb_separator(hwndToolbar); - add_tb_button(hwndToolbar, 5, ID_BROWSE_PRINT, IDS_TB_PRINT); - SendMessageW(hwndToolbar, TB_SETBUTTONSIZE, 0, MAKELPARAM(55,50)); - SendMessageW(hwndToolbar, TB_GETMAXSIZE, 0, (LPARAM)&toolbar_size); + SendMessageW(ie->toolbar_hwnd, TB_SETIMAGELIST, 0, (LPARAM)imagelist); + SendMessageW(ie->toolbar_hwnd, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0); + add_tb_button(ie, 0, ID_BROWSE_BACK, IDS_TB_BACK); + add_tb_button(ie, 1, ID_BROWSE_FORWARD, IDS_TB_FORWARD); + add_tb_button(ie, 2, ID_BROWSE_STOP, IDS_TB_STOP); + add_tb_button(ie, 3, ID_BROWSE_REFRESH, IDS_TB_REFRESH); + add_tb_button(ie, 4, ID_BROWSE_HOME, IDS_TB_HOME); + add_tb_separator(ie); + add_tb_button(ie, 5, ID_BROWSE_PRINT, IDS_TB_PRINT); + SendMessageW(ie->toolbar_hwnd, TB_SETBUTTONSIZE, 0, MAKELPARAM(55,50)); + SendMessageW(ie->toolbar_hwnd, TB_GETMAXSIZE, 0, (LPARAM)&toolbar_size); bandinf.cbSize = sizeof(bandinf); bandinf.fMask = RBBIM_STYLE | RBBIM_CHILD | RBBIM_CHILDSIZE; bandinf.fStyle = RBBS_CHILDEDGE; bandinf.cxMinChild = toolbar_size.cx; bandinf.cyMinChild = toolbar_size.cy+2; - bandinf.hwndChild = hwndToolbar; + bandinf.hwndChild = ie->toolbar_hwnd; SendMessageW(hwndRebar, RB_INSERTBANDW, -1, (LPARAM)&bandinf); @@ -497,13 +501,15 @@ InternetExplorer* This = (InternetExplorer*)lpcs->lpCreateParams; SetWindowLongPtrW(hwnd, 0, (LONG_PTR) lpcs->lpCreateParams); + This->doc_host.frame_hwnd = This->frame_hwnd = hwnd; + This->menu = create_ie_menu(); This->status_hwnd = CreateStatusWindowW(WS_VISIBLE|WS_CHILD|SBT_NOBORDERS|CCS_NODIVIDER, NULL, hwnd, IDC_BROWSE_STATUSBAR); SendMessageW(This->status_hwnd, SB_SIMPLE, TRUE, 0); - create_rebar(hwnd); + create_rebar(This); return 0; } @@ -567,9 +573,7 @@ static LRESULT iewnd_OnDestroy(InternetExplorer *This) { - HWND hwndRebar = GetDlgItem(This->frame_hwnd, IDC_BROWSE_REBAR); - HWND hwndToolbar = GetDlgItem(hwndRebar, IDC_BROWSE_TOOLBAR); - HIMAGELIST list = (HIMAGELIST)SendMessageW(hwndToolbar, TB_GETIMAGELIST, 0, 0); + HIMAGELIST list = (HIMAGELIST)SendMessageW(This->toolbar_hwnd, TB_GETIMAGELIST, 0, 0); TRACE("%p\n", This); @@ -722,7 +726,7 @@ static void create_frame_hwnd(InternetExplorer *This) { - This->frame_hwnd = CreateWindowExW( + CreateWindowExW( WS_EX_WINDOWEDGE, szIEWinFrame, wszWineInternetExplorer, WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME @@ -730,7 +734,6 @@ CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL /* FIXME */, ieframe_instance, This); - This->doc_host.frame_hwnd = This->frame_hwnd; create_doc_view_hwnd(&This->doc_host); } @@ -751,19 +754,33 @@ return IWebBrowser2_Release(&This->IWebBrowser2_iface); } -static void WINAPI DocHostContainer_GetDocObjRect(DocHost* This, RECT* rc) +static void DocHostContainer_get_docobj_rect(DocHost *This, RECT *rc) { GetClientRect(This->frame_hwnd, rc); adjust_ie_docobj_rect(This->frame_hwnd, rc); } -static HRESULT WINAPI DocHostContainer_SetStatusText(DocHost *iface, LPCWSTR text) +static HRESULT DocHostContainer_set_status_text(DocHost *iface, const WCHAR *text) { InternetExplorer *This = impl_from_DocHost(iface); return update_ie_statustext(This, text); } -static void WINAPI DocHostContainer_SetURL(DocHost* iface, LPCWSTR url) +static void DocHostContainer_on_command_state_change(DocHost *iface, LONG command, BOOL enable) +{ + InternetExplorer *This = impl_from_DocHost(iface); + + switch(command) { + case CSC_NAVIGATEBACK: + enable_toolbar_button(This, ID_BROWSE_BACK, enable); + break; + case CSC_NAVIGATEFORWARD: + enable_toolbar_button(This, ID_BROWSE_FORWARD, enable); + break; + } +} + +static void DocHostContainer_set_url(DocHost* iface, const WCHAR *url) { InternetExplorer *This = impl_from_DocHost(iface); @@ -774,9 +791,10 @@ static const IDocHostContainerVtbl DocHostContainerVtbl = { IEDocHost_addref, IEDocHost_release, - DocHostContainer_GetDocObjRect, - DocHostContainer_SetStatusText, - DocHostContainer_SetURL + DocHostContainer_get_docobj_rect, + DocHostContainer_set_status_text, + DocHostContainer_on_command_state_change, + DocHostContainer_set_url }; static HRESULT create_ie(InternetExplorer **ret_obj) diff -Nru wine1.7-1.7.50/dlls/ieframe/navigate.c wine1.7-1.7.55/dlls/ieframe/navigate.c --- wine1.7-1.7.50/dlls/ieframe/navigate.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ieframe/navigate.c 2015-11-13 14:32:40.000000000 +0000 @@ -142,7 +142,7 @@ heap_free(This->url); This->url = new_url; - This->container_vtbl->SetURL(This, This->url); + This->container_vtbl->set_url(This, This->url); return S_OK; } diff -Nru wine1.7-1.7.50/dlls/ieframe/tests/webbrowser.c wine1.7-1.7.55/dlls/ieframe/tests/webbrowser.c --- wine1.7-1.7.50/dlls/ieframe/tests/webbrowser.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ieframe/tests/webbrowser.c 2015-11-13 14:32:40.000000000 +0000 @@ -452,11 +452,14 @@ } }else if(IsEqualGUID(&CGID_ShellDocView, pguidCmdGroup)) { switch(nCmdID) { + case 63: /* win10 */ case 105: /* TODO */ + case 132: /* win10 */ case 133: /* IE11 */ case 134: /* TODO (IE10) */ case 135: /* IE11 */ case 136: /* TODO (IE10) */ + case 137: /* win10 */ case 138: /* TODO */ case 140: /* TODO (Win7) */ case 144: /* TODO */ @@ -464,6 +467,7 @@ case 179: /* IE11 */ case 180: /* IE11 */ case 181: /* IE11 */ + case 182: /* win10 */ return E_FAIL; default: ok(0, "unexpected nCmdID %d\n", nCmdID); @@ -688,6 +692,8 @@ static void test_OnBeforeNavigate(const VARIANT *disp, const VARIANT *url, const VARIANT *flags, const VARIANT *frame, const VARIANT *post_data, const VARIANT *headers, const VARIANT *cancel) { + BSTR str; + ok(V_VT(disp) == VT_DISPATCH, "V_VT(disp)=%d, expected VT_DISPATCH\n", V_VT(disp)); ok(V_DISPATCH(disp) != NULL, "V_DISPATCH(disp) == NULL\n"); ok(V_DISPATCH(disp) == (IDispatch*)wb, "V_DISPATCH(disp)=%p, wb=%p\n", V_DISPATCH(disp), wb); @@ -763,8 +769,9 @@ if(V_VARIANTREF(headers)) { ok(V_VT(V_VARIANTREF(headers)) == VT_BSTR, "V_VT(V_VARIANTREF(headers))=%d, expected VT_BSTR\n", V_VT(V_VARIANTREF(headers))); - ok(V_BSTR(V_VARIANTREF(headers)) == NULL, "V_BSTR(V_VARIANTREF(headers)) = %s, expected NULL\n", - wine_dbgstr_w(V_BSTR(V_VARIANTREF(headers)))); + str = V_BSTR(V_VARIANTREF(headers)); + ok(!str || !strcmp_wa(str, "Referer: http://test.winehq.org/tests/hello.html\r\n"), + "V_BSTR(V_VARIANTREF(headers)) = %s, expected NULL\n", wine_dbgstr_w(str)); } ok(V_VT(cancel) == (VT_BYREF|VT_BOOL), "V_VT(cancel)=%x, expected VT_BYREF|VT_BOOL\n", @@ -2926,6 +2933,7 @@ if(use_container_olecmd) SET_EXPECT(Exec_UPDATECOMMANDS); SET_EXPECT(QueryStatus_STOP); + SET_EXPECT(GetOverridesKeyPath); /* Called randomly on some VMs. */ trace("Downloading...\n"); while(!*b && GetMessageW(&msg, NULL, 0, 0)) { @@ -3015,6 +3023,7 @@ if(use_container_olecmd) CHECK_CALLED(Exec_UPDATECOMMANDS); CLEAR_CALLED(QueryStatus_STOP); + CLEAR_CALLED(GetOverridesKeyPath); } static void test_Refresh(IWebBrowser2 *webbrowser, BOOL use_refresh2) diff -Nru wine1.7-1.7.50/dlls/ieframe/webbrowser.c wine1.7-1.7.55/dlls/ieframe/webbrowser.c --- wine1.7-1.7.50/dlls/ieframe/webbrowser.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ieframe/webbrowser.c 2015-11-13 14:32:40.000000000 +0000 @@ -1194,26 +1194,31 @@ return IWebBrowser2_Release(&This->IWebBrowser2_iface); } -static void WINAPI DocHostContainer_GetDocObjRect(DocHost* This, RECT* rc) +static void DocHostContainer_get_docobj_rect(DocHost *This, RECT *rc) { GetClientRect(This->frame_hwnd, rc); } -static HRESULT WINAPI DocHostContainer_SetStatusText(DocHost* This, LPCWSTR text) +static HRESULT DocHostContainer_set_status_text(DocHost *This, const WCHAR *text) { return E_NOTIMPL; } -static void WINAPI DocHostContainer_SetURL(DocHost* This, LPCWSTR url) +static void DocHostContainer_on_command_state_change(DocHost *This, LONG command, BOOL enable) +{ +} + +static void DocHostContainer_set_url(DocHost *This, const WCHAR *url) { } static const IDocHostContainerVtbl DocHostContainerVtbl = { WebBrowser_addref, WebBrowser_release, - DocHostContainer_GetDocObjRect, - DocHostContainer_SetStatusText, - DocHostContainer_SetURL + DocHostContainer_get_docobj_rect, + DocHostContainer_set_status_text, + DocHostContainer_on_command_state_change, + DocHostContainer_set_url }; static HRESULT create_webbrowser(int version, IUnknown *outer, REFIID riid, void **ppv) diff -Nru wine1.7-1.7.50/dlls/imm32/imm.c wine1.7-1.7.55/dlls/imm32/imm.c --- wine1.7-1.7.50/dlls/imm32/imm.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/imm32/imm.c 2015-11-13 14:32:40.000000000 +0000 @@ -270,7 +270,6 @@ list_remove(&data->entry); LeaveCriticalSection(&threaddata_cs); IMM_DestroyContext(data->defaultContext); - DestroyWindow(data->hwndDefault); HeapFree(GetProcessHeap(),0,data); TRACE("Thread Data Destroyed\n"); return; diff -Nru wine1.7-1.7.50/dlls/imm32/tests/imm32.c wine1.7-1.7.55/dlls/imm32/tests/imm32.c --- wine1.7-1.7.50/dlls/imm32/tests/imm32.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/imm32/tests/imm32.c 2015-11-13 14:32:40.000000000 +0000 @@ -782,10 +782,29 @@ UnloadKeyboardLayout(hkl); } +static LRESULT (WINAPI *old_imm_wnd_proc)(HWND, UINT, WPARAM, LPARAM); +static LRESULT WINAPI imm_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + ok(msg != WM_DESTROY, "got WM_DESTROY message\n"); + return old_imm_wnd_proc(hwnd, msg, wparam, lparam); +} + +static HWND thread_ime_wnd; +static DWORD WINAPI test_ImmGetDefaultIMEWnd_thread(void *arg) +{ + CreateWindowA("static", "static", WS_POPUP, 0, 0, 1, 1, NULL, NULL, NULL, NULL); + + thread_ime_wnd = ImmGetDefaultIMEWnd(0); + ok(thread_ime_wnd != 0, "ImmGetDefaultIMEWnd returned NULL\n"); + old_imm_wnd_proc = (void*)SetWindowLongPtrW(thread_ime_wnd, GWLP_WNDPROC, (LONG_PTR)imm_wnd_proc); + return 0; +} + static void test_ImmDefaultHwnd(void) { HIMC imc1, imc2, imc3; HWND def1, def3; + HANDLE thread; HWND hwnd; hwnd = CreateWindowExA(WS_EX_CLIENTEDGE, "EDIT", "Wine imm32.dll test", @@ -813,6 +832,11 @@ ok(imc1 == imc3, "IME context should not change\n"); ImmSetOpenStatus(imc2, FALSE); + thread = CreateThread(NULL, 0, test_ImmGetDefaultIMEWnd_thread, NULL, 0, NULL); + WaitForSingleObject(thread, INFINITE); + ok(thread_ime_wnd != def1, "thread_ime_wnd == def1\n"); + ok(!IsWindow(thread_ime_wnd), "thread_ime_wnd was not destroyed\n"); + ImmReleaseContext(hwnd, imc1); ImmReleaseContext(hwnd, imc3); ImmDestroyContext(imc2); diff -Nru wine1.7-1.7.50/dlls/jscript/engine.c wine1.7-1.7.55/dlls/jscript/engine.c --- wine1.7-1.7.50/dlls/jscript/engine.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/jscript/engine.c 2015-11-13 14:32:40.000000000 +0000 @@ -1647,7 +1647,7 @@ hres = disp_delete(exprval.u.idref.disp, exprval.u.idref.id, &ret); IDispatch_Release(exprval.u.idref.disp); if(FAILED(hres)) - return ret; + return hres; break; case EXPRVAL_INVALID: ret = TRUE; diff -Nru wine1.7-1.7.50/dlls/jscript/tests/run.c wine1.7-1.7.55/dlls/jscript/tests/run.c --- wine1.7-1.7.50/dlls/jscript/tests/run.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/jscript/tests/run.c 2015-11-13 14:32:40.000000000 +0000 @@ -84,6 +84,7 @@ DEFINE_EXPECT(global_propputref_i); DEFINE_EXPECT(global_propdelete_d); DEFINE_EXPECT(global_nopropdelete_d); +DEFINE_EXPECT(global_propdeleteerror_d); DEFINE_EXPECT(global_success_d); DEFINE_EXPECT(global_success_i); DEFINE_EXPECT(global_notexists_d); @@ -110,6 +111,7 @@ DEFINE_EXPECT(invoke_func); DEFINE_EXPECT(DeleteMemberByDispID); DEFINE_EXPECT(DeleteMemberByDispID_false); +DEFINE_EXPECT(DeleteMemberByDispID_error); DEFINE_EXPECT(BindHandler); #define DISPID_GLOBAL_TESTPROPGET 0x1000 @@ -143,8 +145,9 @@ #define DISPID_GLOBAL_GETSCRIPTSTATE 0x101c #define DISPID_GLOBAL_BINDEVENTHANDLER 0x101d -#define DISPID_GLOBAL_TESTPROPDELETE 0x2000 -#define DISPID_GLOBAL_TESTNOPROPDELETE 0x2001 +#define DISPID_GLOBAL_TESTPROPDELETE 0x2000 +#define DISPID_GLOBAL_TESTNOPROPDELETE 0x2001 +#define DISPID_GLOBAL_TESTPROPDELETEERROR 0x2002 #define DISPID_TESTOBJ_PROP 0x2000 #define DISPID_TESTOBJ_ONLYDISPID 0x2001 @@ -709,6 +712,12 @@ *pid = DISPID_GLOBAL_TESTNOPROPDELETE; return S_OK; } + if(!strcmp_wa(bstrName, "testPropDeleteError")) { + CHECK_EXPECT(global_propdeleteerror_d); + test_grfdex(grfdex, fdexNameCaseSensitive); + *pid = DISPID_GLOBAL_TESTPROPDELETEERROR; + return S_OK; + } if(!strcmp_wa(bstrName, "getVT")) { test_grfdex(grfdex, fdexNameCaseSensitive); *pid = DISPID_GLOBAL_GETVT; @@ -1361,6 +1370,9 @@ case DISPID_GLOBAL_TESTNOPROPDELETE: CHECK_EXPECT(DeleteMemberByDispID_false); return S_FALSE; + case DISPID_GLOBAL_TESTPROPDELETEERROR: + CHECK_EXPECT(DeleteMemberByDispID_error); + return E_FAIL; default: ok(0, "id = %d\n", id); } @@ -1848,6 +1860,17 @@ parse_script_af(SCRIPTITEM_GLOBALMEMBERS, src); } +static void parse_script_ae(const char *src, HRESULT exhres) +{ + BSTR tmp; + HRESULT hres; + + tmp = a2bstr(src); + hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, tmp); + SysFreeString(tmp); + ok(hres == exhres, "parse_script failed: %08x, expected %08x\n", hres, exhres); +} + static void parse_script_with_error_a(const char *src, SCODE errorcode, ULONG line, LONG pos, LPCSTR source, LPCSTR desc, LPCSTR linetext) { BSTR tmp, script_source, description, line_text; @@ -2448,6 +2471,12 @@ CHECK_CALLED(global_nopropdelete_d); CHECK_CALLED(DeleteMemberByDispID_false); + SET_EXPECT(global_propdeleteerror_d); + SET_EXPECT(DeleteMemberByDispID_error); + parse_script_ae("delete testPropDeleteError;", E_FAIL); + CHECK_CALLED(global_propdeleteerror_d); + CHECK_CALLED(DeleteMemberByDispID_error); + SET_EXPECT(puredisp_prop_d); parse_script_a("ok((delete pureDisp.prop) === false, 'delete pureDisp.prop did not return true');"); CHECK_CALLED(puredisp_prop_d); diff -Nru wine1.7-1.7.50/dlls/kernel32/console.c wine1.7-1.7.55/dlls/kernel32/console.c --- wine1.7-1.7.50/dlls/kernel32/console.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/console.c 2015-11-13 14:32:40.000000000 +0000 @@ -3234,39 +3234,87 @@ return FALSE; } -BOOL WINAPI GetCurrentConsoleFont(HANDLE hConsole, BOOL maxwindow, LPCONSOLE_FONT_INFO fontinfo) +DWORD WINAPI GetNumberOfConsoleFonts(void) +{ + return 1; +} + + +BOOL WINAPI SetConsoleKeyShortcuts(BOOL set, BYTE keys, VOID *a, DWORD b) { - FIXME(": (%p, %d, %p) stub!\n", hConsole, maxwindow, fontinfo); + FIXME(": (%u %u %p %u) stub!\n", set, keys, a, b); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; } + +BOOL WINAPI GetCurrentConsoleFont(HANDLE hConsole, BOOL maxwindow, LPCONSOLE_FONT_INFO fontinfo) +{ + BOOL ret; + + memset(fontinfo, 0, sizeof(CONSOLE_FONT_INFO)); + + if (maxwindow) + { + FIXME(": (%p, %d, %p) stub!\n", hConsole, maxwindow, fontinfo); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; + } + + SERVER_START_REQ(get_console_output_info) + { + req->handle = console_handle_unmap(hConsole); + if ((ret = !wine_server_call_err(req))) + { + fontinfo->dwFontSize.X = reply->win_right - reply->win_left + 1; + fontinfo->dwFontSize.Y = reply->win_bottom - reply->win_top + 1; + } + } + SERVER_END_REQ; + return ret; +} + +static COORD get_console_font_size(HANDLE hConsole, DWORD index) +{ + COORD c = {0,0}; + + if (index >= GetNumberOfConsoleFonts()) + { + SetLastError(ERROR_INVALID_PARAMETER); + return c; + } + + SERVER_START_REQ(get_console_output_info) + { + req->handle = console_handle_unmap(hConsole); + if (!wine_server_call_err(req)) + { + c.X = reply->font_width; + c.Y = reply->font_height; + } + } + SERVER_END_REQ; + return c; +} + #ifdef __i386__ #undef GetConsoleFontSize -DWORD WINAPI GetConsoleFontSize(HANDLE hConsole, DWORD font) +DWORD WINAPI GetConsoleFontSize(HANDLE hConsole, DWORD index) { union { COORD c; DWORD w; } x; - FIXME(": (%p, %d) stub!\n", hConsole, font); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - - x.c.X = 0; - x.c.Y = 0; + x.c = get_console_font_size(hConsole, index); return x.w; } #endif /* defined(__i386__) */ #ifndef __i386__ -COORD WINAPI GetConsoleFontSize(HANDLE hConsole, DWORD font) +COORD WINAPI GetConsoleFontSize(HANDLE hConsole, DWORD index) { - COORD c; - c.X = 80; - c.Y = 24; - FIXME(": (%p, %d) stub!\n", hConsole, font); - return c; + return get_console_font_size(hConsole, index); } -#endif /* defined(__i386__) */ +#endif /* !defined(__i386__) */ diff -Nru wine1.7-1.7.50/dlls/kernel32/file.c wine1.7-1.7.55/dlls/kernel32/file.c --- wine1.7-1.7.50/dlls/kernel32/file.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/file.c 2015-11-13 14:32:40.000000000 +0000 @@ -686,6 +686,25 @@ } /*********************************************************************** + * CancelSynchronousIo (KERNEL32.@) + * + * Marks pending synchronous I/O operations issued by the specified thread as cancelled + * + * PARAMS + * handle [I] handle to the thread whose I/O operations should be cancelled + * + * RETURNS + * Success: TRUE. + * Failure: FALSE, check GetLastError(). + */ +BOOL WINAPI CancelSynchronousIo(HANDLE thread) +{ + FIXME("(%p): stub\n", thread); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +/*********************************************************************** * _hread (KERNEL32.@) */ LONG WINAPI _hread( HFILE hFile, LPVOID buffer, LONG count) @@ -1555,7 +1574,7 @@ if (sa && sa->bInheritHandle) attr.Attributes |= OBJ_INHERIT; - status = NtCreateFile( &ret, access, &attr, &io, NULL, attributes, + status = NtCreateFile( &ret, access | SYNCHRONIZE, &attr, &io, NULL, attributes, sharing, nt_disposition[creation - CREATE_NEW], options, NULL, 0 ); if (status) @@ -1664,8 +1683,7 @@ attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; - status = NtCreateFile(&hFile, GENERIC_READ | GENERIC_WRITE | DELETE, - &attr, &io, NULL, 0, + status = NtCreateFile(&hFile, SYNCHRONIZE | DELETE, &attr, &io, NULL, 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, FILE_OPEN, FILE_DELETE_ON_CLOSE | FILE_NON_DIRECTORY_FILE, NULL, 0); if (status == STATUS_SUCCESS) status = NtClose(hFile); @@ -1807,7 +1825,7 @@ } attr.ObjectName = &nt_backup_name; /* Open the backup with permissions to write over it */ - status = NtCreateFile(&hBackup, GENERIC_WRITE, + status = NtCreateFile(&hBackup, GENERIC_WRITE | SYNCHRONIZE, &attr, &io, NULL, replaced_info.FileAttributes, FILE_SHARE_WRITE, FILE_OPEN_IF, FILE_SYNCHRONOUS_IO_NONALERT|FILE_NON_DIRECTORY_FILE, @@ -2019,7 +2037,7 @@ attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; - status = NtOpenFile( &info->handle, GENERIC_READ, &attr, &io, + status = NtOpenFile( &info->handle, GENERIC_READ | SYNCHRONIZE, &attr, &io, FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT ); @@ -2421,7 +2439,7 @@ attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; - status = NtOpenFile( &handle, 0, &attr, &io, 0, FILE_SYNCHRONOUS_IO_NONALERT ); + status = NtOpenFile( &handle, SYNCHRONIZE, &attr, &io, 0, FILE_SYNCHRONOUS_IO_NONALERT ); RtlFreeUnicodeString( &nt_name ); if (status == STATUS_SUCCESS) @@ -2553,7 +2571,7 @@ attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; - status = NtOpenFile( &handle, 0, &attr, &io, 0, FILE_SYNCHRONOUS_IO_NONALERT ); + status = NtOpenFile( &handle, SYNCHRONIZE, &attr, &io, 0, FILE_SYNCHRONOUS_IO_NONALERT ); RtlFreeUnicodeString( &nt_name ); if (status == STATUS_SUCCESS) @@ -2816,7 +2834,7 @@ attr.SecurityQualityOfService = NULL; if (sec_attr && sec_attr->bInheritHandle) attr.Attributes |= OBJ_INHERIT; - status = NtCreateFile( &result, access, &attr, &io, NULL, flags, + status = NtCreateFile( &result, access | SYNCHRONIZE, &attr, &io, NULL, flags, share, OPEN_EXISTING, options, NULL, 0 ); if (status != STATUS_SUCCESS) { diff -Nru wine1.7-1.7.50/dlls/kernel32/heap.c wine1.7-1.7.55/dlls/kernel32/heap.c --- wine1.7-1.7.50/dlls/kernel32/heap.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/heap.c 2015-11-13 14:32:40.000000000 +0000 @@ -1449,6 +1449,27 @@ lpBuffer->dwTotalVirtual, lpBuffer->dwAvailVirtual ); } +/*********************************************************************** + * GetPhysicallyInstalledSystemMemory (KERNEL32.@) + */ +BOOL WINAPI GetPhysicallyInstalledSystemMemory(ULONGLONG *total_memory) +{ + MEMORYSTATUSEX memstatus; + + FIXME("stub: %p\n", total_memory); + + if (!total_memory) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + memstatus.dwLength = sizeof(memstatus); + GlobalMemoryStatusEx(&memstatus); + *total_memory = memstatus.ullTotalPhys / 1024; + return TRUE; +} + BOOL WINAPI GetSystemFileCacheSize(PSIZE_T mincache, PSIZE_T maxcache, PDWORD flags) { FIXME("stub: %p %p %p\n", mincache, maxcache, flags); @@ -1462,3 +1483,10 @@ SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; } + +BOOL WINAPI AllocateUserPhysicalPages(HANDLE process, ULONG_PTR *pages, ULONG_PTR *userarray) +{ + FIXME("stub: %p %p %p\n",process, pages, userarray); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} diff -Nru wine1.7-1.7.50/dlls/kernel32/kernel32.spec wine1.7-1.7.55/dlls/kernel32/kernel32.spec --- wine1.7-1.7.50/dlls/kernel32/kernel32.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/kernel32.spec 2015-11-13 14:32:40.000000000 +0000 @@ -154,7 +154,7 @@ @ stdcall AllocConsole() @ stub -i386 AllocLSCallback @ stdcall -i386 -private AllocSLCallback(ptr ptr) krnl386.exe16.AllocSLCallback -@ stub AllocateUserPhysicalPages +@ stdcall AllocateUserPhysicalPages(ptr ptr ptr) @ stdcall ApplicationRecoveryFinished(long) @ stdcall ApplicationRecoveryInProgress(ptr) @ stdcall AreFileApisANSI() @@ -210,7 +210,7 @@ @ stub CancelDeviceWakeupRequest @ stdcall CancelIo(long) @ stdcall CancelIoEx(long ptr) -# @ stub CancelSynchronousIo +@ stdcall CancelSynchronousIo(long) # @ stub CancelThreadpoolIo @ stdcall CancelTimerQueueTimer(ptr ptr) @ stdcall CancelWaitableTimer(long) @@ -401,7 +401,7 @@ @ stdcall EnumCalendarInfoW(ptr long long long) @ stdcall EnumDateFormatsA(ptr long long) @ stdcall EnumDateFormatsExA(ptr long long) -# @ stub EnumDateFormatsExEx +@ stdcall EnumDateFormatsExEx(ptr wstr long long) @ stdcall EnumDateFormatsExW(ptr long long) @ stdcall EnumDateFormatsW(ptr long long) @ stdcall EnumLanguageGroupLocalesA(ptr long long ptr) @@ -428,7 +428,7 @@ @ stdcall EnumSystemLocalesEx(ptr long long ptr) @ stdcall EnumSystemLocalesW(ptr long) @ stdcall EnumTimeFormatsA(ptr long long) -# @ stub EnumTimeFormatsEx +@ stdcall EnumTimeFormatsEx(ptr wstr long long) @ stdcall EnumTimeFormatsW(ptr long long) @ stdcall EnumUILanguagesA(ptr long long) @ stdcall EnumUILanguagesW(ptr long long) @@ -632,7 +632,7 @@ @ stdcall -norelay GetCurrentProcess() @ stdcall -norelay GetCurrentProcessId() @ stdcall GetCurrentProcessorNumber() ntdll.NtGetCurrentProcessorNumber -# @ stub GetCurrentProcessorNumberEx +@ stdcall GetCurrentProcessorNumberEx(ptr) ntdll.RtlGetCurrentProcessorNumberEx @ stdcall -norelay GetCurrentThread() @ stdcall -norelay GetCurrentThreadId() # @ stub -arch=x86_64 GetCurrentUmsThread @@ -753,13 +753,13 @@ @ stdcall GetNumberFormatA(long long str ptr ptr long) # @ stub GetNumberFormatEx @ stdcall GetNumberFormatW(long long wstr ptr ptr long) -@ stub GetNumberOfConsoleFonts +@ stdcall GetNumberOfConsoleFonts() @ stdcall GetNumberOfConsoleInputEvents(long ptr) @ stdcall GetNumberOfConsoleMouseButtons(ptr) @ stdcall GetOEMCP() @ stdcall GetOverlappedResult(long ptr ptr long) @ stdcall GetUserPreferredUILanguages(long ptr ptr ptr) -# @ stub GetPhysicallyInstalledSystemMemory +@ stdcall GetPhysicallyInstalledSystemMemory(ptr) @ stdcall GetPriorityClass(long) @ stdcall GetPrivateProfileIntA(str str long str) @ stdcall GetPrivateProfileIntW(wstr wstr long wstr) @@ -844,7 +844,7 @@ @ stdcall GetTempPathW(long ptr) @ stdcall GetThreadContext(long ptr) @ stdcall GetThreadErrorMode() -# @ stub GetThreadGroupAffinity +@ stdcall GetThreadGroupAffinity(long ptr) @ stdcall GetThreadId(ptr) # @ stub GetThreadIdealProcessorEx @ stdcall GetThreadIOPendingFlag(long ptr) @@ -1350,7 +1350,7 @@ @ stdcall SetConsoleIcon(ptr) @ stdcall SetConsoleInputExeNameA(ptr) @ stdcall SetConsoleInputExeNameW(ptr) -@ stub SetConsoleKeyShortcuts +@ stdcall SetConsoleKeyShortcuts(long long ptr long) @ stub SetConsoleLocalEUDC @ stub SetConsoleMaximumWindowSize @ stub SetConsoleMenuClose @@ -1443,7 +1443,7 @@ @ stdcall SetThreadContext(long ptr) @ stdcall SetThreadErrorMode(long ptr) @ stdcall SetThreadExecutionState(long) -# @ stub SetThreadGroupAffinity +@ stdcall SetThreadGroupAffinity(long ptr ptr) @ stdcall SetThreadIdealProcessor(long long) # @ stub SetThreadIdealProcessorEx @ stdcall SetThreadLocale(long) diff -Nru wine1.7-1.7.50/dlls/kernel32/lcformat.c wine1.7-1.7.55/dlls/kernel32/lcformat.c --- wine1.7-1.7.50/dlls/kernel32/lcformat.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/lcformat.c 2015-11-13 14:32:40.000000000 +0000 @@ -1742,93 +1742,131 @@ * alternate calendars is determined. */ -/************************************************************************** - * EnumDateFormatsExA (KERNEL32.@) +enum enum_callback_type { + CALLBACK_ENUMPROC, + CALLBACK_ENUMPROCEX, + CALLBACK_ENUMPROCEXEX +}; + +struct enumdateformats_context { + enum enum_callback_type type; /* callback kind */ + union { + DATEFMT_ENUMPROCW callback; /* user callback pointer */ + DATEFMT_ENUMPROCEXW callbackex; + DATEFMT_ENUMPROCEXEX callbackexex; + } u; + LCID lcid; /* locale of interest */ + DWORD flags; + LPARAM lParam; + BOOL unicode; /* A vs W callback type, only for regular and Ex callbacks */ +}; + +/****************************************************************************** + * NLS_EnumDateFormats + * Enumerates date formats for a specified locale. * - * FIXME: MSDN mentions only LOCALE_USE_CP_ACP, should we handle - * LOCALE_NOUSEROVERRIDE here as well? + * PARAMS + * ctxt [I] enumeration context, see 'struct enumdateformats_context' + * + * RETURNS + * Success: TRUE. + * Failure: FALSE. Use GetLastError() to determine the cause. */ -BOOL WINAPI EnumDateFormatsExA(DATEFMT_ENUMPROCEXA proc, LCID lcid, DWORD flags) +static BOOL NLS_EnumDateFormats(const struct enumdateformats_context *ctxt) { + WCHAR bufW[256]; + char bufA[256]; + LCTYPE lctype; CALID cal_id; - char buf[256]; + INT ret; - if (!proc) + if (!ctxt->u.callback) { SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } - if (!GetLocaleInfoW(lcid, LOCALE_ICALENDARTYPE|LOCALE_RETURN_NUMBER, (LPWSTR)&cal_id, sizeof(cal_id)/sizeof(WCHAR))) + if (!GetLocaleInfoW(ctxt->lcid, LOCALE_ICALENDARTYPE|LOCALE_RETURN_NUMBER, (LPWSTR)&cal_id, sizeof(cal_id)/sizeof(WCHAR))) return FALSE; - switch (flags & ~LOCALE_USE_CP_ACP) + switch (ctxt->flags & ~LOCALE_USE_CP_ACP) { case 0: case DATE_SHORTDATE: - if (GetLocaleInfoA(lcid, LOCALE_SSHORTDATE | (flags & LOCALE_USE_CP_ACP), buf, 256)) - proc(buf, cal_id); + lctype = LOCALE_SSHORTDATE; break; - case DATE_LONGDATE: - if (GetLocaleInfoA(lcid, LOCALE_SLONGDATE | (flags & LOCALE_USE_CP_ACP), buf, 256)) - proc(buf, cal_id); + lctype = LOCALE_SLONGDATE; break; - case DATE_YEARMONTH: - if (GetLocaleInfoA(lcid, LOCALE_SYEARMONTH | (flags & LOCALE_USE_CP_ACP), buf, 256)) - proc(buf, cal_id); + lctype = LOCALE_SYEARMONTH; break; - default: - FIXME("Unknown date format (%d)\n", flags); + FIXME("Unknown date format (0x%08x)\n", ctxt->flags); SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } + + lctype |= ctxt->flags & LOCALE_USE_CP_ACP; + if (ctxt->unicode) + ret = GetLocaleInfoW(ctxt->lcid, lctype, bufW, sizeof(bufW)/sizeof(bufW[0])); + else + ret = GetLocaleInfoA(ctxt->lcid, lctype, bufA, sizeof(bufA)/sizeof(bufA[0])); + + if (ret) + { + switch (ctxt->type) + { + case CALLBACK_ENUMPROC: + ctxt->u.callback(ctxt->unicode ? bufW : (WCHAR*)bufA); + break; + case CALLBACK_ENUMPROCEX: + ctxt->u.callbackex(ctxt->unicode ? bufW : (WCHAR*)bufA, cal_id); + break; + case CALLBACK_ENUMPROCEXEX: + ctxt->u.callbackexex(bufW, cal_id, ctxt->lParam); + break; + default: + ; + } + } + return TRUE; } /************************************************************************** - * EnumDateFormatsExW (KERNEL32.@) + * EnumDateFormatsExA (KERNEL32.@) + * + * FIXME: MSDN mentions only LOCALE_USE_CP_ACP, should we handle + * LOCALE_NOUSEROVERRIDE here as well? */ -BOOL WINAPI EnumDateFormatsExW(DATEFMT_ENUMPROCEXW proc, LCID lcid, DWORD flags) +BOOL WINAPI EnumDateFormatsExA(DATEFMT_ENUMPROCEXA proc, LCID lcid, DWORD flags) { - CALID cal_id; - WCHAR buf[256]; - - if (!proc) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } + struct enumdateformats_context ctxt; - if (!GetLocaleInfoW(lcid, LOCALE_ICALENDARTYPE|LOCALE_RETURN_NUMBER, (LPWSTR)&cal_id, sizeof(cal_id)/sizeof(WCHAR))) - return FALSE; + ctxt.type = CALLBACK_ENUMPROCEX; + ctxt.u.callbackex = (DATEFMT_ENUMPROCEXW)proc; + ctxt.lcid = lcid; + ctxt.flags = flags; + ctxt.unicode = FALSE; - switch (flags & ~LOCALE_USE_CP_ACP) - { - case 0: - case DATE_SHORTDATE: - if (GetLocaleInfoW(lcid, LOCALE_SSHORTDATE | (flags & LOCALE_USE_CP_ACP), buf, 256)) - proc(buf, cal_id); - break; + return NLS_EnumDateFormats(&ctxt); +} - case DATE_LONGDATE: - if (GetLocaleInfoW(lcid, LOCALE_SLONGDATE | (flags & LOCALE_USE_CP_ACP), buf, 256)) - proc(buf, cal_id); - break; +/************************************************************************** + * EnumDateFormatsExW (KERNEL32.@) + */ +BOOL WINAPI EnumDateFormatsExW(DATEFMT_ENUMPROCEXW proc, LCID lcid, DWORD flags) +{ + struct enumdateformats_context ctxt; - case DATE_YEARMONTH: - if (GetLocaleInfoW(lcid, LOCALE_SYEARMONTH | (flags & LOCALE_USE_CP_ACP), buf, 256)) - proc(buf, cal_id); - break; + ctxt.type = CALLBACK_ENUMPROCEX; + ctxt.u.callbackex = proc; + ctxt.lcid = lcid; + ctxt.flags = flags; + ctxt.unicode = TRUE; - default: - FIXME("Unknown date format (%d)\n", flags); - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - return TRUE; + return NLS_EnumDateFormats(&ctxt); } /************************************************************************** @@ -1839,76 +1877,109 @@ */ BOOL WINAPI EnumDateFormatsA(DATEFMT_ENUMPROCA proc, LCID lcid, DWORD flags) { - char buf[256]; + struct enumdateformats_context ctxt; - if (!proc) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } + ctxt.type = CALLBACK_ENUMPROC; + ctxt.u.callback = (DATEFMT_ENUMPROCW)proc; + ctxt.lcid = lcid; + ctxt.flags = flags; + ctxt.unicode = FALSE; - switch (flags & ~LOCALE_USE_CP_ACP) - { - case 0: - case DATE_SHORTDATE: - if (GetLocaleInfoA(lcid, LOCALE_SSHORTDATE | (flags & LOCALE_USE_CP_ACP), buf, 256)) - proc(buf); - break; + return NLS_EnumDateFormats(&ctxt); +} - case DATE_LONGDATE: - if (GetLocaleInfoA(lcid, LOCALE_SLONGDATE | (flags & LOCALE_USE_CP_ACP), buf, 256)) - proc(buf); - break; +/************************************************************************** + * EnumDateFormatsW (KERNEL32.@) + */ +BOOL WINAPI EnumDateFormatsW(DATEFMT_ENUMPROCW proc, LCID lcid, DWORD flags) +{ + struct enumdateformats_context ctxt; - case DATE_YEARMONTH: - if (GetLocaleInfoA(lcid, LOCALE_SYEARMONTH | (flags & LOCALE_USE_CP_ACP), buf, 256)) - proc(buf); - break; + ctxt.type = CALLBACK_ENUMPROC; + ctxt.u.callback = proc; + ctxt.lcid = lcid; + ctxt.flags = flags; + ctxt.unicode = TRUE; - default: - FIXME("Unknown date format (%d)\n", flags); - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - return TRUE; + return NLS_EnumDateFormats(&ctxt); } /************************************************************************** - * EnumDateFormatsW (KERNEL32.@) + * EnumDateFormatsExEx (KERNEL32.@) */ -BOOL WINAPI EnumDateFormatsW(DATEFMT_ENUMPROCW proc, LCID lcid, DWORD flags) +BOOL WINAPI EnumDateFormatsExEx(DATEFMT_ENUMPROCEXEX proc, const WCHAR *locale, DWORD flags, LPARAM lParam) +{ + struct enumdateformats_context ctxt; + + ctxt.type = CALLBACK_ENUMPROCEXEX; + ctxt.u.callbackexex = proc; + ctxt.lcid = LocaleNameToLCID(locale, 0); + ctxt.flags = flags; + ctxt.lParam = lParam; + + return NLS_EnumDateFormats(&ctxt); +} + +struct enumtimeformats_context { + enum enum_callback_type type; /* callback kind */ + union { + TIMEFMT_ENUMPROCW callback; /* user callback pointer */ + TIMEFMT_ENUMPROCEX callbackex; + } u; + LCID lcid; /* locale of interest */ + DWORD flags; + LPARAM lParam; + BOOL unicode; /* A vs W callback type, only for regular and Ex callbacks */ +}; + +static BOOL NLS_EnumTimeFormats(struct enumtimeformats_context *ctxt) { - WCHAR buf[256]; + WCHAR bufW[256]; + char bufA[256]; + LCTYPE lctype; + INT ret; - if (!proc) + if (!ctxt->u.callback) { SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } - switch (flags & ~LOCALE_USE_CP_ACP) + switch (ctxt->flags & ~LOCALE_USE_CP_ACP) { case 0: - case DATE_SHORTDATE: - if (GetLocaleInfoW(lcid, LOCALE_SSHORTDATE | (flags & LOCALE_USE_CP_ACP), buf, 256)) - proc(buf); - break; - - case DATE_LONGDATE: - if (GetLocaleInfoW(lcid, LOCALE_SLONGDATE | (flags & LOCALE_USE_CP_ACP), buf, 256)) - proc(buf); + lctype = LOCALE_STIMEFORMAT; break; - - case DATE_YEARMONTH: - if (GetLocaleInfoW(lcid, LOCALE_SYEARMONTH | (flags & LOCALE_USE_CP_ACP), buf, 256)) - proc(buf); + case TIME_NOSECONDS: + lctype = LOCALE_SSHORTTIME; break; - default: - FIXME("Unknown date format (%d)\n", flags); + FIXME("Unknown time format (%d)\n", ctxt->flags); SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } + + lctype |= ctxt->flags & LOCALE_USE_CP_ACP; + if (ctxt->unicode) + ret = GetLocaleInfoW(ctxt->lcid, lctype, bufW, sizeof(bufW)/sizeof(bufW[0])); + else + ret = GetLocaleInfoA(ctxt->lcid, lctype, bufA, sizeof(bufA)/sizeof(bufA[0])); + + if (ret) + { + switch (ctxt->type) + { + case CALLBACK_ENUMPROC: + ctxt->u.callback(ctxt->unicode ? bufW : (WCHAR*)bufA); + break; + case CALLBACK_ENUMPROCEX: + ctxt->u.callbackex(bufW, ctxt->lParam); + break; + default: + ; + } + } + return TRUE; } @@ -1920,27 +1991,22 @@ */ BOOL WINAPI EnumTimeFormatsA(TIMEFMT_ENUMPROCA proc, LCID lcid, DWORD flags) { - char buf[256]; + struct enumtimeformats_context ctxt; - if (!proc) + /* EnumTimeFormatsA doesn't support flags, EnumTimeFormatsW does. */ + if (flags & ~LOCALE_USE_CP_ACP) { - SetLastError(ERROR_INVALID_PARAMETER); + SetLastError(ERROR_INVALID_FLAGS); return FALSE; } - switch (flags & ~LOCALE_USE_CP_ACP) - { - case 0: - if (GetLocaleInfoA(lcid, LOCALE_STIMEFORMAT | (flags & LOCALE_USE_CP_ACP), buf, 256)) - proc(buf); - break; + ctxt.type = CALLBACK_ENUMPROC; + ctxt.u.callback = (TIMEFMT_ENUMPROCW)proc; + ctxt.lcid = lcid; + ctxt.flags = flags; + ctxt.unicode = FALSE; - default: - FIXME("Unknown time format (%d)\n", flags); - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - return TRUE; + return NLS_EnumTimeFormats(&ctxt); } /************************************************************************** @@ -1948,37 +2014,36 @@ */ BOOL WINAPI EnumTimeFormatsW(TIMEFMT_ENUMPROCW proc, LCID lcid, DWORD flags) { - WCHAR buf[256]; - - if (!proc) - { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } + struct enumtimeformats_context ctxt; - switch (flags & ~LOCALE_USE_CP_ACP) - { - case 0: - if (GetLocaleInfoW(lcid, LOCALE_STIMEFORMAT | (flags & LOCALE_USE_CP_ACP), buf, 256)) - proc(buf); - break; + ctxt.type = CALLBACK_ENUMPROC; + ctxt.u.callback = proc; + ctxt.lcid = lcid; + ctxt.flags = flags; + ctxt.unicode = TRUE; - default: - FIXME("Unknown time format (%d)\n", flags); - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - return TRUE; + return NLS_EnumTimeFormats(&ctxt); } -enum enumcalendar_callback_type { - CALLBACK_ENUMPROC, - CALLBACK_ENUMPROCEX, - CALLBACK_ENUMPROCEXEX -}; +/************************************************************************** + * EnumTimeFormatsEx (KERNEL32.@) + */ +BOOL WINAPI EnumTimeFormatsEx(TIMEFMT_ENUMPROCEX proc, const WCHAR *locale, DWORD flags, LPARAM lParam) +{ + struct enumtimeformats_context ctxt; + + ctxt.type = CALLBACK_ENUMPROCEX; + ctxt.u.callbackex = proc; + ctxt.lcid = LocaleNameToLCID(locale, 0); + ctxt.flags = flags; + ctxt.lParam = lParam; + ctxt.unicode = TRUE; + + return NLS_EnumTimeFormats(&ctxt); +} struct enumcalendar_context { - enum enumcalendar_callback_type type; /* callback kind */ + enum enum_callback_type type; /* callback kind */ union { CALINFO_ENUMPROCW callback; /* user callback pointer */ CALINFO_ENUMPROCEXW callbackex; diff -Nru wine1.7-1.7.50/dlls/kernel32/locale.c wine1.7-1.7.55/dlls/kernel32/locale.c --- wine1.7-1.7.50/dlls/kernel32/locale.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/locale.c 2015-11-13 14:32:40.000000000 +0000 @@ -1295,7 +1295,8 @@ SetLastError( ERROR_INVALID_PARAMETER ); return 0; } - if (lctype & LOCALE_RETURN_GENITIVE_NAMES ) + if (((lctype & ~LOCALE_LOCALEINFOFLAGSMASK) == LOCALE_SSHORTTIME) || + (lctype & LOCALE_RETURN_GENITIVE_NAMES)) { SetLastError( ERROR_INVALID_FLAGS ); return 0; @@ -2513,6 +2514,9 @@ switch (lcid) { + case LOCALE_INVARIANT: + /* keep as-is */ + break; case LOCALE_SYSTEM_DEFAULT: lcid = GetSystemDefaultLCID(); break; diff -Nru wine1.7-1.7.50/dlls/kernel32/locale_rc.rc wine1.7-1.7.55/dlls/kernel32/locale_rc.rc --- wine1.7-1.7.50/dlls/kernel32/locale_rc.rc 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/locale_rc.rc 2015-11-13 14:32:40.000000000 +0000 @@ -249,3 +249,5 @@ #include "nls/cor.nls" /* 0x0492 LANG_CORNISH, SUBLANG_DEFAULT */ #include "nls/gdv.nls" /* 0x0494 LANG_MANX_GAELIC, SUBLANG_MANX_GAELIC */ + +#include "nls/ivl.nls" /* 0x047f LANG_INVARIANT, SUBLANG_NEUTRAL */ diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/afk.nls wine1.7-1.7.55/dlls/kernel32/nls/afk.nls --- wine1.7-1.7.50/dlls/kernel32/nls/afk.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/afk.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "yyyy/MM/dd" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/ara.nls wine1.7-1.7.55/dlls/kernel32/nls/ara.nls --- wine1.7-1.7.50/dlls/kernel32/nls/ara.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/ara.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Arab;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/arb.nls wine1.7-1.7.55/dlls/kernel32/nls/arb.nls --- wine1.7-1.7.50/dlls/kernel32/nls/arb.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/arb.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Arab;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/are.nls wine1.7-1.7.55/dlls/kernel32/nls/are.nls --- wine1.7-1.7.50/dlls/kernel32/nls/are.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/are.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Arab;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/arg.nls wine1.7-1.7.55/dlls/kernel32/nls/arg.nls --- wine1.7-1.7.50/dlls/kernel32/nls/arg.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/arg.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Arab;" LOCALE_SSHORTDATE "dd-MM-yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/arh.nls wine1.7-1.7.55/dlls/kernel32/nls/arh.nls --- wine1.7-1.7.50/dlls/kernel32/nls/arh.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/arh.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Arab;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/ari.nls wine1.7-1.7.55/dlls/kernel32/nls/ari.nls --- wine1.7-1.7.50/dlls/kernel32/nls/ari.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/ari.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Arab;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/arj.nls wine1.7-1.7.55/dlls/kernel32/nls/arj.nls --- wine1.7-1.7.50/dlls/kernel32/nls/arj.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/arj.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Arab;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/ark.nls wine1.7-1.7.55/dlls/kernel32/nls/ark.nls --- wine1.7-1.7.50/dlls/kernel32/nls/ark.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/ark.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Arab;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/arl.nls wine1.7-1.7.55/dlls/kernel32/nls/arl.nls --- wine1.7-1.7.50/dlls/kernel32/nls/arl.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/arl.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Arab;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/arm.nls wine1.7-1.7.55/dlls/kernel32/nls/arm.nls --- wine1.7-1.7.50/dlls/kernel32/nls/arm.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/arm.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Arab;" LOCALE_SSHORTDATE "dd-MM-yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/aro.nls wine1.7-1.7.55/dlls/kernel32/nls/aro.nls --- wine1.7-1.7.50/dlls/kernel32/nls/aro.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/aro.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Arab;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/arq.nls wine1.7-1.7.55/dlls/kernel32/nls/arq.nls --- wine1.7-1.7.50/dlls/kernel32/nls/arq.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/arq.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Arab;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/ars.nls wine1.7-1.7.55/dlls/kernel32/nls/ars.nls --- wine1.7-1.7.50/dlls/kernel32/nls/ars.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/ars.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Arab;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/art.nls wine1.7-1.7.55/dlls/kernel32/nls/art.nls --- wine1.7-1.7.50/dlls/kernel32/nls/art.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/art.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Arab;" LOCALE_SSHORTDATE "dd-MM-yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/aru.nls wine1.7-1.7.55/dlls/kernel32/nls/aru.nls --- wine1.7-1.7.50/dlls/kernel32/nls/aru.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/aru.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Arab;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/ary.nls wine1.7-1.7.55/dlls/kernel32/nls/ary.nls --- wine1.7-1.7.50/dlls/kernel32/nls/ary.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/ary.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Arab;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/aze.nls wine1.7-1.7.55/dlls/kernel32/nls/aze.nls --- wine1.7-1.7.50/dlls/kernel32/nls/aze.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/aze.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Arab;" LOCALE_SSHORTDATE "dd.MM.yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/azl.nls wine1.7-1.7.55/dlls/kernel32/nls/azl.nls --- wine1.7-1.7.50/dlls/kernel32/nls/azl.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/azl.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd.MM.yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/bel.nls wine1.7-1.7.55/dlls/kernel32/nls/bel.nls --- wine1.7-1.7.50/dlls/kernel32/nls/bel.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/bel.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Cyrl;" LOCALE_SSHORTDATE "dd.MM.yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND " " LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/bgr.nls wine1.7-1.7.55/dlls/kernel32/nls/bgr.nls --- wine1.7-1.7.50/dlls/kernel32/nls/bgr.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/bgr.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Cyrl;" LOCALE_SSHORTDATE "dd.M.yyyy '.'" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/brf.nls wine1.7-1.7.55/dlls/kernel32/nls/brf.nls --- wine1.7-1.7.50/dlls/kernel32/nls/brf.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/brf.nls 2015-11-13 14:32:40.000000000 +0000 @@ -135,6 +135,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/cat.nls wine1.7-1.7.55/dlls/kernel32/nls/cat.nls --- wine1.7-1.7.50/dlls/kernel32/nls/cat.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/cat.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/chs.nls wine1.7-1.7.55/dlls/kernel32/nls/chs.nls --- wine1.7-1.7.50/dlls/kernel32/nls/chs.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/chs.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Hans;" LOCALE_SSHORTDATE "yyyy-M-d" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Pronunciation" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/cht.nls wine1.7-1.7.55/dlls/kernel32/nls/cht.nls --- wine1.7-1.7.50/dlls/kernel32/nls/cht.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/cht.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Hant;" LOCALE_SSHORTDATE "yyyy/M/d" + LOCALE_SSHORTTIME "tt hh:mm" LOCALE_SSORTNAME "Stroke Count" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/cor.nls wine1.7-1.7.55/dlls/kernel32/nls/cor.nls --- wine1.7-1.7.50/dlls/kernel32/nls/cor.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/cor.nls 2015-11-13 14:32:40.000000000 +0000 @@ -135,6 +135,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/csy.nls wine1.7-1.7.55/dlls/kernel32/nls/csy.nls --- wine1.7-1.7.50/dlls/kernel32/nls/csy.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/csy.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "d.M.yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/cym.nls wine1.7-1.7.55/dlls/kernel32/nls/cym.nls --- wine1.7-1.7.50/dlls/kernel32/nls/cym.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/cym.nls 2015-11-13 14:32:40.000000000 +0000 @@ -135,6 +135,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/dan.nls wine1.7-1.7.55/dlls/kernel32/nls/dan.nls --- wine1.7-1.7.50/dlls/kernel32/nls/dan.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/dan.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd-MM-yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/dea.nls wine1.7-1.7.55/dlls/kernel32/nls/dea.nls --- wine1.7-1.7.50/dlls/kernel32/nls/dea.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/dea.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd.MM.yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/dec.nls wine1.7-1.7.55/dlls/kernel32/nls/dec.nls --- wine1.7-1.7.50/dlls/kernel32/nls/dec.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/dec.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd.MM.yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "'" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/del.nls wine1.7-1.7.55/dlls/kernel32/nls/del.nls --- wine1.7-1.7.50/dlls/kernel32/nls/del.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/del.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd.MM.yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/des.nls wine1.7-1.7.55/dlls/kernel32/nls/des.nls --- wine1.7-1.7.50/dlls/kernel32/nls/des.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/des.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd.MM.yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "'" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/deu.nls wine1.7-1.7.55/dlls/kernel32/nls/deu.nls --- wine1.7-1.7.50/dlls/kernel32/nls/deu.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/deu.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd.MM.yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Dictionary" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/div.nls wine1.7-1.7.55/dlls/kernel32/nls/div.nls --- wine1.7-1.7.50/dlls/kernel32/nls/div.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/div.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Thaa;" LOCALE_SSHORTDATE "dd/MM/yy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/ell.nls wine1.7-1.7.55/dlls/kernel32/nls/ell.nls --- wine1.7-1.7.50/dlls/kernel32/nls/ell.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/ell.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Grek;" LOCALE_SSHORTDATE "d/M/yyyy" + LOCALE_SSHORTTIME "h:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/ena.nls wine1.7-1.7.55/dlls/kernel32/nls/ena.nls --- wine1.7-1.7.50/dlls/kernel32/nls/ena.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/ena.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "d/MM/yyyy" + LOCALE_SSHORTTIME "h:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/enb.nls wine1.7-1.7.55/dlls/kernel32/nls/enb.nls --- wine1.7-1.7.50/dlls/kernel32/nls/enb.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/enb.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "MM/dd/yyyy" + LOCALE_SSHORTTIME "h:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/enc.nls wine1.7-1.7.55/dlls/kernel32/nls/enc.nls --- wine1.7-1.7.50/dlls/kernel32/nls/enc.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/enc.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "h:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/eng.nls wine1.7-1.7.55/dlls/kernel32/nls/eng.nls --- wine1.7-1.7.50/dlls/kernel32/nls/eng.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/eng.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/eni.nls wine1.7-1.7.55/dlls/kernel32/nls/eni.nls --- wine1.7-1.7.50/dlls/kernel32/nls/eni.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/eni.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/enj.nls wine1.7-1.7.55/dlls/kernel32/nls/enj.nls --- wine1.7-1.7.50/dlls/kernel32/nls/enj.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/enj.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/enl.nls wine1.7-1.7.55/dlls/kernel32/nls/enl.nls --- wine1.7-1.7.50/dlls/kernel32/nls/enl.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/enl.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/enp.nls wine1.7-1.7.55/dlls/kernel32/nls/enp.nls --- wine1.7-1.7.50/dlls/kernel32/nls/enp.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/enp.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "M/d/yyyy" + LOCALE_SSHORTTIME "h:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/ens.nls wine1.7-1.7.55/dlls/kernel32/nls/ens.nls --- wine1.7-1.7.50/dlls/kernel32/nls/ens.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/ens.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "yyyy/MM/dd" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/ent.nls wine1.7-1.7.55/dlls/kernel32/nls/ent.nls --- wine1.7-1.7.50/dlls/kernel32/nls/ent.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/ent.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/enu.nls wine1.7-1.7.55/dlls/kernel32/nls/enu.nls --- wine1.7-1.7.50/dlls/kernel32/nls/enu.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/enu.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "M/d/yyyy" + LOCALE_SSHORTTIME "h:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/enw.nls wine1.7-1.7.55/dlls/kernel32/nls/enw.nls --- wine1.7-1.7.50/dlls/kernel32/nls/enw.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/enw.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "M/d/yyyy" + LOCALE_SSHORTTIME "h:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/enz.nls wine1.7-1.7.55/dlls/kernel32/nls/enz.nls --- wine1.7-1.7.50/dlls/kernel32/nls/enz.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/enz.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "d/MM/yyyy" + LOCALE_SSHORTTIME "h:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/eox.nls wine1.7-1.7.55/dlls/kernel32/nls/eox.nls --- wine1.7-1.7.50/dlls/kernel32/nls/eox.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/eox.nls 2015-11-13 14:32:40.000000000 +0000 @@ -150,6 +150,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "yyyy-mm-dd" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/esa.nls wine1.7-1.7.55/dlls/kernel32/nls/esa.nls --- wine1.7-1.7.50/dlls/kernel32/nls/esa.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/esa.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "MM/dd/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/esb.nls wine1.7-1.7.55/dlls/kernel32/nls/esb.nls --- wine1.7-1.7.50/dlls/kernel32/nls/esb.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/esb.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/esc.nls wine1.7-1.7.55/dlls/kernel32/nls/esc.nls --- wine1.7-1.7.50/dlls/kernel32/nls/esc.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/esc.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/esd.nls wine1.7-1.7.55/dlls/kernel32/nls/esd.nls --- wine1.7-1.7.50/dlls/kernel32/nls/esd.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/esd.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/ese.nls wine1.7-1.7.55/dlls/kernel32/nls/ese.nls --- wine1.7-1.7.50/dlls/kernel32/nls/ese.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/ese.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/esf.nls wine1.7-1.7.55/dlls/kernel32/nls/esf.nls --- wine1.7-1.7.50/dlls/kernel32/nls/esf.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/esf.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/esg.nls wine1.7-1.7.55/dlls/kernel32/nls/esg.nls --- wine1.7-1.7.50/dlls/kernel32/nls/esg.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/esg.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/esh.nls wine1.7-1.7.55/dlls/kernel32/nls/esh.nls --- wine1.7-1.7.50/dlls/kernel32/nls/esh.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/esh.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/esi.nls wine1.7-1.7.55/dlls/kernel32/nls/esi.nls --- wine1.7-1.7.50/dlls/kernel32/nls/esi.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/esi.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/esl.nls wine1.7-1.7.55/dlls/kernel32/nls/esl.nls --- wine1.7-1.7.50/dlls/kernel32/nls/esl.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/esl.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd-MM-yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/esm.nls wine1.7-1.7.55/dlls/kernel32/nls/esm.nls --- wine1.7-1.7.50/dlls/kernel32/nls/esm.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/esm.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/esn.nls wine1.7-1.7.55/dlls/kernel32/nls/esn.nls --- wine1.7-1.7.50/dlls/kernel32/nls/esn.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/esn.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "International" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/eso.nls wine1.7-1.7.55/dlls/kernel32/nls/eso.nls --- wine1.7-1.7.50/dlls/kernel32/nls/eso.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/eso.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/esp.nls wine1.7-1.7.55/dlls/kernel32/nls/esp.nls --- wine1.7-1.7.50/dlls/kernel32/nls/esp.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/esp.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Traditional" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/esr.nls wine1.7-1.7.55/dlls/kernel32/nls/esr.nls --- wine1.7-1.7.50/dlls/kernel32/nls/esr.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/esr.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/ess.nls wine1.7-1.7.55/dlls/kernel32/nls/ess.nls --- wine1.7-1.7.50/dlls/kernel32/nls/ess.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/ess.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/esu.nls wine1.7-1.7.55/dlls/kernel32/nls/esu.nls --- wine1.7-1.7.50/dlls/kernel32/nls/esu.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/esu.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/esv.nls wine1.7-1.7.55/dlls/kernel32/nls/esv.nls --- wine1.7-1.7.50/dlls/kernel32/nls/esv.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/esv.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/esy.nls wine1.7-1.7.55/dlls/kernel32/nls/esy.nls --- wine1.7-1.7.50/dlls/kernel32/nls/esy.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/esy.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/esz.nls wine1.7-1.7.55/dlls/kernel32/nls/esz.nls --- wine1.7-1.7.50/dlls/kernel32/nls/esz.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/esz.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/eti.nls wine1.7-1.7.55/dlls/kernel32/nls/eti.nls --- wine1.7-1.7.50/dlls/kernel32/nls/eti.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/eti.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "d.MM.yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/euq.nls wine1.7-1.7.55/dlls/kernel32/nls/euq.nls --- wine1.7-1.7.50/dlls/kernel32/nls/euq.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/euq.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "yyyy/MM/dd" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/far.nls wine1.7-1.7.55/dlls/kernel32/nls/far.nls --- wine1.7-1.7.50/dlls/kernel32/nls/far.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/far.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Arab;" LOCALE_SSHORTDATE "yyyy/MM/dd" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/fin.nls wine1.7-1.7.55/dlls/kernel32/nls/fin.nls --- wine1.7-1.7.50/dlls/kernel32/nls/fin.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/fin.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "d.M.yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/fos.nls wine1.7-1.7.55/dlls/kernel32/nls/fos.nls --- wine1.7-1.7.50/dlls/kernel32/nls/fos.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/fos.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd-MM-yyyy" + LOCALE_SSHORTTIME "HH.mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME "." diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/fra.nls wine1.7-1.7.55/dlls/kernel32/nls/fra.nls --- wine1.7-1.7.50/dlls/kernel32/nls/fra.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/fra.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/frb.nls wine1.7-1.7.55/dlls/kernel32/nls/frb.nls --- wine1.7-1.7.50/dlls/kernel32/nls/frb.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/frb.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "d/MM/yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/frc.nls wine1.7-1.7.55/dlls/kernel32/nls/frc.nls --- wine1.7-1.7.50/dlls/kernel32/nls/frc.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/frc.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "yyyy-MM-dd" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/frl.nls wine1.7-1.7.55/dlls/kernel32/nls/frl.nls --- wine1.7-1.7.50/dlls/kernel32/nls/frl.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/frl.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/frm.nls wine1.7-1.7.55/dlls/kernel32/nls/frm.nls --- wine1.7-1.7.50/dlls/kernel32/nls/frm.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/frm.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/frs.nls wine1.7-1.7.55/dlls/kernel32/nls/frs.nls --- wine1.7-1.7.50/dlls/kernel32/nls/frs.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/frs.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd.MM.yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "'" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/gae.nls wine1.7-1.7.55/dlls/kernel32/nls/gae.nls --- wine1.7-1.7.50/dlls/kernel32/nls/gae.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/gae.nls 2015-11-13 14:32:40.000000000 +0000 @@ -135,6 +135,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "d/M/yy" + LOCALE_SSHORTTIME "h:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/gdh.nls wine1.7-1.7.55/dlls/kernel32/nls/gdh.nls --- wine1.7-1.7.50/dlls/kernel32/nls/gdh.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/gdh.nls 2015-11-13 14:32:40.000000000 +0000 @@ -135,6 +135,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/gdv.nls wine1.7-1.7.55/dlls/kernel32/nls/gdv.nls --- wine1.7-1.7.50/dlls/kernel32/nls/gdv.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/gdv.nls 2015-11-13 14:32:40.000000000 +0000 @@ -135,6 +135,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/glc.nls wine1.7-1.7.55/dlls/kernel32/nls/glc.nls --- wine1.7-1.7.50/dlls/kernel32/nls/glc.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/glc.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/guj.nls wine1.7-1.7.55/dlls/kernel32/nls/guj.nls --- wine1.7-1.7.50/dlls/kernel32/nls/guj.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/guj.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Gujr;" LOCALE_SSHORTDATE "dd-MM-yy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/heb.nls wine1.7-1.7.55/dlls/kernel32/nls/heb.nls --- wine1.7-1.7.50/dlls/kernel32/nls/heb.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/heb.nls 2015-11-13 14:32:40.000000000 +0000 @@ -135,6 +135,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Hebr;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/hin.nls wine1.7-1.7.55/dlls/kernel32/nls/hin.nls --- wine1.7-1.7.50/dlls/kernel32/nls/hin.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/hin.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Deva;" LOCALE_SSHORTDATE "dd-MM-yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/hrv.nls wine1.7-1.7.55/dlls/kernel32/nls/hrv.nls --- wine1.7-1.7.50/dlls/kernel32/nls/hrv.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/hrv.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "d.M.yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/hun.nls wine1.7-1.7.55/dlls/kernel32/nls/hun.nls --- wine1.7-1.7.50/dlls/kernel32/nls/hun.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/hun.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "yyyy. MM. dd." + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/hye.nls wine1.7-1.7.55/dlls/kernel32/nls/hye.nls --- wine1.7-1.7.50/dlls/kernel32/nls/hye.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/hye.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Armn;" LOCALE_SSHORTDATE "dd.MM.yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/ind.nls wine1.7-1.7.55/dlls/kernel32/nls/ind.nls --- wine1.7-1.7.50/dlls/kernel32/nls/ind.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/ind.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/isl.nls wine1.7-1.7.55/dlls/kernel32/nls/isl.nls --- wine1.7-1.7.50/dlls/kernel32/nls/isl.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/isl.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "d.M.yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/ita.nls wine1.7-1.7.55/dlls/kernel32/nls/ita.nls --- wine1.7-1.7.50/dlls/kernel32/nls/ita.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/ita.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "H.mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME "." diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/its.nls wine1.7-1.7.55/dlls/kernel32/nls/its.nls --- wine1.7-1.7.50/dlls/kernel32/nls/its.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/its.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd.MM.yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "'" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/ivl.nls wine1.7-1.7.55/dlls/kernel32/nls/ivl.nls --- wine1.7-1.7.50/dlls/kernel32/nls/ivl.nls 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/ivl.nls 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,161 @@ +/* + * Locale definitions for Invariant + * + * Copyright 2002 Alexandre Julliard for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma code_page(1252) + +STRINGTABLE LANGUAGE LANG_INVARIANT, SUBLANG_NEUTRAL +{ + LOCALE_FONTSIGNATURE L"\x00af\x8000\x38cb\x0000\x0000\x0000\x0000\x0000\x0001\x0000\x0000\x8000\x01ff\x003f\x8000\xffff" + LOCALE_ICALENDARTYPE "1" + LOCALE_ICENTURY "1" + LOCALE_ICOUNTRY "1" + LOCALE_ICURRDIGITS "2" + LOCALE_ICURRENCY "0" + LOCALE_IDATE "0" + LOCALE_IDAYLZERO "1" + LOCALE_IDEFAULTANSICODEPAGE "1252" + LOCALE_IDEFAULTCODEPAGE "437" + LOCALE_IDEFAULTCOUNTRY "1" + LOCALE_IDEFAULTEBCDICCODEPAGE "037" + LOCALE_IDEFAULTLANGUAGE "0409" + LOCALE_IDEFAULTMACCODEPAGE "10000" + LOCALE_IDEFAULTUNIXCODEPAGE "28591" + LOCALE_IDIGITS "2" + LOCALE_IDIGITSUBSTITUTION "1" + LOCALE_IFIRSTDAYOFWEEK "6" + LOCALE_IFIRSTWEEKOFYEAR "0" + LOCALE_IINTLCURRDIGITS "2" + LOCALE_ILANGUAGE "007f" + LOCALE_ILDATE "1" + LOCALE_ILZERO "1" + LOCALE_IMEASURE "0" + LOCALE_IMONLZERO "1" + LOCALE_INEGCURR "0" + LOCALE_INEGNUMBER "1" + LOCALE_INEGSEPBYSPACE "0" + LOCALE_INEGSIGNPOSN "0" + LOCALE_INEGSYMPRECEDES "1" + LOCALE_INEUTRAL "0" + LOCALE_IOPTIONALCALENDAR "0" + LOCALE_IPAPERSIZE "9" + LOCALE_IPOSSEPBYSPACE "0" + LOCALE_IPOSSIGNPOSN "3" + LOCALE_IPOSSYMPRECEDES "1" + LOCALE_IREADINGLAYOUT "0" + LOCALE_ITIME "1" + LOCALE_ITIMEMARKPOSN "0" + LOCALE_ITLZERO "1" + LOCALE_S1159 "AM" + LOCALE_S2359 "PM" + LOCALE_SABBREVCTRYNAME "IVC" + LOCALE_SABBREVDAYNAME1 "Mon" + LOCALE_SABBREVDAYNAME2 "Tue" + LOCALE_SABBREVDAYNAME3 "Wed" + LOCALE_SABBREVDAYNAME4 "Thu" + LOCALE_SABBREVDAYNAME5 "Fri" + LOCALE_SABBREVDAYNAME6 "Sat" + LOCALE_SABBREVDAYNAME7 "Sun" + LOCALE_SABBREVLANGNAME "IVL" + LOCALE_SABBREVMONTHNAME1 "Jan" + LOCALE_SABBREVMONTHNAME2 "Feb" + LOCALE_SABBREVMONTHNAME3 "Mar" + LOCALE_SABBREVMONTHNAME4 "Apr" + LOCALE_SABBREVMONTHNAME5 "May" + LOCALE_SABBREVMONTHNAME6 "Jun" + LOCALE_SABBREVMONTHNAME7 "Jul" + LOCALE_SABBREVMONTHNAME8 "Aug" + LOCALE_SABBREVMONTHNAME9 "Sep" + LOCALE_SABBREVMONTHNAME10 "Oct" + LOCALE_SABBREVMONTHNAME11 "Nov" + LOCALE_SABBREVMONTHNAME12 "Dec" + LOCALE_SABBREVMONTHNAME13 "" + LOCALE_SCOUNTRY "Invariant Country" + LOCALE_SCURRENCY L"\x00a4" + LOCALE_SDATE "/" + LOCALE_SDAYNAME1 "Monday" + LOCALE_SDAYNAME2 "Tuesday" + LOCALE_SDAYNAME3 "Wednesday" + LOCALE_SDAYNAME4 "Thursday" + LOCALE_SDAYNAME5 "Friday" + LOCALE_SDAYNAME6 "Saturday" + LOCALE_SDAYNAME7 "Sunday" + LOCALE_SDECIMAL "." + LOCALE_SENGCOUNTRY "Invariant Country" + LOCALE_SENGCURRNAME "International Monetary Fund" + LOCALE_SENGLANGUAGE "Invariant Language" + LOCALE_SGROUPING "3;0" + LOCALE_SINTLSYMBOL "XDR" + LOCALE_SISO3166CTRYNAME "IV" + LOCALE_SISO639LANGNAME "iv" + LOCALE_SLANGUAGE "Invariant Language (Invariant Country)" + LOCALE_SLIST "," + LOCALE_SLONGDATE "dddd, dd MMMM yyyy" + LOCALE_SMONDECIMALSEP "." + LOCALE_SMONGROUPING "3;0" + LOCALE_SMONTHNAME1 "January" + LOCALE_SMONTHNAME2 "February" + LOCALE_SMONTHNAME3 "March" + LOCALE_SMONTHNAME4 "April" + LOCALE_SMONTHNAME5 "May" + LOCALE_SMONTHNAME6 "June" + LOCALE_SMONTHNAME7 "July" + LOCALE_SMONTHNAME8 "August" + LOCALE_SMONTHNAME9 "September" + LOCALE_SMONTHNAME10 "October" + LOCALE_SMONTHNAME11 "November" + LOCALE_SMONTHNAME12 "December" + LOCALE_SMONTHNAME13 "" + LOCALE_SMONTHOUSANDSEP "," + LOCALE_SNAME "" + LOCALE_SNATIVECTRYNAME "Invariant Country" + LOCALE_SNATIVECURRNAME "International Monetary Fund" + LOCALE_SNATIVEDIGITS "0123456789" + LOCALE_SNATIVEDISPLAYNAME "Invariant Language (Invariant Country)" + LOCALE_SNATIVELANGNAME "Invariant Language" + LOCALE_SNEGATIVESIGN "-" + LOCALE_SOPENTYPELANGUAGETAG "dflt" + LOCALE_SPOSITIVESIGN "+" + LOCALE_SSCRIPTS "Latn;" + LOCALE_SSHORTDATE "MM/dd/yyyy" + LOCALE_SSHORTTIME "HH:mm" + LOCALE_SSORTNAME "Math Alphanumerics" + LOCALE_STHOUSAND "," + LOCALE_STIME ":" + LOCALE_STIMEFORMAT "HH:mm:ss" + LOCALE_SYEARMONTH "yyyy MMMM" + + LGRPID_WESTERN_EUROPE+LGRPID_RES_BASE "Western Europe and United States" + LGRPID_CENTRAL_EUROPE+LGRPID_RES_BASE "Central Europe" + LGRPID_BALTIC+LGRPID_RES_BASE "Baltic" + LGRPID_GREEK+LGRPID_RES_BASE "Greek" + LGRPID_CYRILLIC+LGRPID_RES_BASE "Cyrillic" + LGRPID_TURKISH+LGRPID_RES_BASE "Turkic" + LGRPID_JAPANESE+LGRPID_RES_BASE "Japanese" + LGRPID_KOREAN+LGRPID_RES_BASE "Korean" + LGRPID_TRADITIONAL_CHINESE+LGRPID_RES_BASE "Traditional Chinese" + LGRPID_SIMPLIFIED_CHINESE+LGRPID_RES_BASE "Simplified Chinese" + LGRPID_THAI+LGRPID_RES_BASE "Thai" + LGRPID_HEBREW+LGRPID_RES_BASE "Hebrew" + LGRPID_ARABIC+LGRPID_RES_BASE "Arabic" + LGRPID_VIETNAMESE+LGRPID_RES_BASE "Vietnamese" + LGRPID_INDIC+LGRPID_RES_BASE "Indic" + LGRPID_GEORGIAN+LGRPID_RES_BASE "Georgian" + LGRPID_ARMENIAN+LGRPID_RES_BASE "Armenian" +} diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/jpn.nls wine1.7-1.7.55/dlls/kernel32/nls/jpn.nls --- wine1.7-1.7.50/dlls/kernel32/nls/jpn.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/jpn.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Hani;Hira;Kana;" LOCALE_SSHORTDATE "yyyy/MM/dd" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "XJIS" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/kan.nls wine1.7-1.7.55/dlls/kernel32/nls/kan.nls --- wine1.7-1.7.50/dlls/kernel32/nls/kan.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/kan.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Knda;" LOCALE_SSHORTDATE "dd-MM-yy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/kat.nls wine1.7-1.7.55/dlls/kernel32/nls/kat.nls --- wine1.7-1.7.50/dlls/kernel32/nls/kat.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/kat.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Geor;" LOCALE_SSHORTDATE "dd.MM.yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Traditional" LOCALE_STHOUSAND " " LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/kkz.nls wine1.7-1.7.55/dlls/kernel32/nls/kkz.nls --- wine1.7-1.7.50/dlls/kernel32/nls/kkz.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/kkz.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Cyrl;" LOCALE_SSHORTDATE "dd.MM.yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/knk.nls wine1.7-1.7.55/dlls/kernel32/nls/knk.nls --- wine1.7-1.7.50/dlls/kernel32/nls/knk.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/knk.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Deva;" LOCALE_SSHORTDATE "dd-MM-yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/kor.nls wine1.7-1.7.55/dlls/kernel32/nls/kor.nls --- wine1.7-1.7.50/dlls/kernel32/nls/kor.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/kor.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Hang;Hani;" LOCALE_SSHORTDATE "yyyy-MM-dd" + LOCALE_SSHORTTIME "tt h:mm" LOCALE_SSORTNAME "Dictionary" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/kyr.nls wine1.7-1.7.55/dlls/kernel32/nls/kyr.nls --- wine1.7-1.7.50/dlls/kernel32/nls/kyr.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/kyr.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Cyrl;" LOCALE_SSHORTDATE "dd.MM.yy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/lth.nls wine1.7-1.7.55/dlls/kernel32/nls/lth.nls --- wine1.7-1.7.50/dlls/kernel32/nls/lth.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/lth.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "yyyy.MM.dd" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/lvi.nls wine1.7-1.7.55/dlls/kernel32/nls/lvi.nls --- wine1.7-1.7.50/dlls/kernel32/nls/lvi.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/lvi.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "yyyy.MM.dd." + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/mar.nls wine1.7-1.7.55/dlls/kernel32/nls/mar.nls --- wine1.7-1.7.50/dlls/kernel32/nls/mar.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/mar.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Mlym;" LOCALE_SSHORTDATE "dd-MM-yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/mki.nls wine1.7-1.7.55/dlls/kernel32/nls/mki.nls --- wine1.7-1.7.50/dlls/kernel32/nls/mki.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/mki.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Cyrl;" LOCALE_SSHORTDATE "dd.MM.yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/mon.nls wine1.7-1.7.55/dlls/kernel32/nls/mon.nls --- wine1.7-1.7.50/dlls/kernel32/nls/mon.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/mon.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Cyrl;" LOCALE_SSHORTDATE "yy.MM.dd" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/msb.nls wine1.7-1.7.55/dlls/kernel32/nls/msb.nls --- wine1.7-1.7.50/dlls/kernel32/nls/msb.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/msb.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/msl.nls wine1.7-1.7.55/dlls/kernel32/nls/msl.nls --- wine1.7-1.7.50/dlls/kernel32/nls/msl.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/msl.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/nlb.nls wine1.7-1.7.55/dlls/kernel32/nls/nlb.nls --- wine1.7-1.7.50/dlls/kernel32/nls/nlb.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/nlb.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "d/MM/yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/nld.nls wine1.7-1.7.55/dlls/kernel32/nls/nld.nls --- wine1.7-1.7.50/dlls/kernel32/nls/nld.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/nld.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "d-M-yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/nls.nls wine1.7-1.7.55/dlls/kernel32/nls/nls.nls --- wine1.7-1.7.50/dlls/kernel32/nls/nls.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/nls.nls 2015-11-13 14:32:40.000000000 +0000 @@ -140,6 +140,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "d-M-yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/non.nls wine1.7-1.7.55/dlls/kernel32/nls/non.nls --- wine1.7-1.7.50/dlls/kernel32/nls/non.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/non.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd.MM.yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/nor.nls wine1.7-1.7.55/dlls/kernel32/nls/nor.nls --- wine1.7-1.7.50/dlls/kernel32/nls/nor.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/nor.nls 2015-11-13 14:32:40.000000000 +0000 @@ -135,6 +135,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd.MM.yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/pan.nls wine1.7-1.7.55/dlls/kernel32/nls/pan.nls --- wine1.7-1.7.50/dlls/kernel32/nls/pan.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/pan.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Guru;" LOCALE_SSHORTDATE "dd-MM-yy" + LOCALE_SSHORTTIME "tt hh:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/plk.nls wine1.7-1.7.55/dlls/kernel32/nls/plk.nls --- wine1.7-1.7.50/dlls/kernel32/nls/plk.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/plk.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "yyyy-MM-dd" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/ptb.nls wine1.7-1.7.55/dlls/kernel32/nls/ptb.nls --- wine1.7-1.7.50/dlls/kernel32/nls/ptb.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/ptb.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "d/M/yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/ptg.nls wine1.7-1.7.55/dlls/kernel32/nls/ptg.nls --- wine1.7-1.7.50/dlls/kernel32/nls/ptg.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/ptg.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd-MM-yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/rmc.nls wine1.7-1.7.55/dlls/kernel32/nls/rmc.nls --- wine1.7-1.7.50/dlls/kernel32/nls/rmc.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/rmc.nls 2015-11-13 14:32:40.000000000 +0000 @@ -145,6 +145,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd-MM-yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "'" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/rom.nls wine1.7-1.7.55/dlls/kernel32/nls/rom.nls --- wine1.7-1.7.50/dlls/kernel32/nls/rom.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/rom.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd.MM.yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/rus.nls wine1.7-1.7.55/dlls/kernel32/nls/rus.nls --- wine1.7-1.7.50/dlls/kernel32/nls/rus.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/rus.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Cyrl;" LOCALE_SSHORTDATE "dd.MM.yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND " " LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/san.nls wine1.7-1.7.55/dlls/kernel32/nls/san.nls --- wine1.7-1.7.50/dlls/kernel32/nls/san.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/san.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Deva;" LOCALE_SSHORTDATE "dd-MM-yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/sky.nls wine1.7-1.7.55/dlls/kernel32/nls/sky.nls --- wine1.7-1.7.50/dlls/kernel32/nls/sky.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/sky.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "d. M. yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/slv.nls wine1.7-1.7.55/dlls/kernel32/nls/slv.nls --- wine1.7-1.7.50/dlls/kernel32/nls/slv.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/slv.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "d.M.yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/sqi.nls wine1.7-1.7.55/dlls/kernel32/nls/sqi.nls --- wine1.7-1.7.50/dlls/kernel32/nls/sqi.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/sqi.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "yyyy-MM-dd" + LOCALE_SSHORTTIME "hh:mm.tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/srb.nls wine1.7-1.7.55/dlls/kernel32/nls/srb.nls --- wine1.7-1.7.50/dlls/kernel32/nls/srb.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/srb.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Cyrl;" LOCALE_SSHORTDATE "d.M.yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/srl.nls wine1.7-1.7.55/dlls/kernel32/nls/srl.nls --- wine1.7-1.7.50/dlls/kernel32/nls/srl.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/srl.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "d.M.yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/sve.nls wine1.7-1.7.55/dlls/kernel32/nls/sve.nls --- wine1.7-1.7.50/dlls/kernel32/nls/sve.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/sve.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "yyyy-MM-dd" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/svf.nls wine1.7-1.7.55/dlls/kernel32/nls/svf.nls --- wine1.7-1.7.50/dlls/kernel32/nls/svf.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/svf.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "d.M.yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/swk.nls wine1.7-1.7.55/dlls/kernel32/nls/swk.nls --- wine1.7-1.7.50/dlls/kernel32/nls/swk.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/swk.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "M/d/yyyy" + LOCALE_SSHORTTIME "h:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/syr.nls wine1.7-1.7.55/dlls/kernel32/nls/syr.nls --- wine1.7-1.7.50/dlls/kernel32/nls/syr.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/syr.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "+" LOCALE_SSCRIPTS "Syrc;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/tam.nls wine1.7-1.7.55/dlls/kernel32/nls/tam.nls --- wine1.7-1.7.50/dlls/kernel32/nls/tam.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/tam.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Taml;" LOCALE_SSHORTDATE "dd-MM-yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/tel.nls wine1.7-1.7.55/dlls/kernel32/nls/tel.nls --- wine1.7-1.7.50/dlls/kernel32/nls/tel.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/tel.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Telu;" LOCALE_SSHORTDATE "dd-MM-yy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/tha.nls wine1.7-1.7.55/dlls/kernel32/nls/tha.nls --- wine1.7-1.7.50/dlls/kernel32/nls/tha.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/tha.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Thai;" LOCALE_SSHORTDATE "d/M/yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/trk.nls wine1.7-1.7.55/dlls/kernel32/nls/trk.nls --- wine1.7-1.7.50/dlls/kernel32/nls/trk.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/trk.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd.MM.yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/ttt.nls wine1.7-1.7.55/dlls/kernel32/nls/ttt.nls --- wine1.7-1.7.50/dlls/kernel32/nls/ttt.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/ttt.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" /* FIXME? */ LOCALE_SSHORTDATE "dd.MM.yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/ukr.nls wine1.7-1.7.55/dlls/kernel32/nls/ukr.nls --- wine1.7-1.7.50/dlls/kernel32/nls/ukr.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/ukr.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Cyrl;" LOCALE_SSHORTDATE "dd.MM.yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/urd.nls wine1.7-1.7.55/dlls/kernel32/nls/urd.nls --- wine1.7-1.7.50/dlls/kernel32/nls/urd.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/urd.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Arab;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "hh:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/uzb.nls wine1.7-1.7.55/dlls/kernel32/nls/uzb.nls --- wine1.7-1.7.50/dlls/kernel32/nls/uzb.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/uzb.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Cyrl;" LOCALE_SSHORTDATE "dd.MM.yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/uzl.nls wine1.7-1.7.55/dlls/kernel32/nls/uzl.nls --- wine1.7-1.7.50/dlls/kernel32/nls/uzl.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/uzl.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM yyyy" + LOCALE_SSHORTTIME "HH:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "" LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/vit.nls wine1.7-1.7.55/dlls/kernel32/nls/vit.nls --- wine1.7-1.7.50/dlls/kernel32/nls/vit.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/vit.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "h:mm tt" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND "." LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/wal.nls wine1.7-1.7.55/dlls/kernel32/nls/wal.nls --- wine1.7-1.7.50/dlls/kernel32/nls/wal.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/wal.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Latn;" LOCALE_SSHORTDATE "dd/MM/yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Default" LOCALE_STHOUSAND " " LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/zhh.nls wine1.7-1.7.55/dlls/kernel32/nls/zhh.nls --- wine1.7-1.7.50/dlls/kernel32/nls/zhh.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/zhh.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Hant;" LOCALE_SSHORTDATE "d/M/yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Stroke Count" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/zhi.nls wine1.7-1.7.55/dlls/kernel32/nls/zhi.nls --- wine1.7-1.7.50/dlls/kernel32/nls/zhi.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/zhi.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Hans;" LOCALE_SSHORTDATE "d/M/yyyy" + LOCALE_SSHORTTIME "tt h:mm" LOCALE_SSORTNAME "Pronunciation" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/nls/zhm.nls wine1.7-1.7.55/dlls/kernel32/nls/zhm.nls --- wine1.7-1.7.50/dlls/kernel32/nls/zhm.nls 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/nls/zhm.nls 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ LOCALE_SPOSITIVESIGN "" LOCALE_SSCRIPTS "Hant;" LOCALE_SSHORTDATE "d/M/yyyy" + LOCALE_SSHORTTIME "H:mm" LOCALE_SSORTNAME "Pronunciation" LOCALE_STHOUSAND "," LOCALE_STIME ":" diff -Nru wine1.7-1.7.50/dlls/kernel32/path.c wine1.7-1.7.55/dlls/kernel32/path.c --- wine1.7-1.7.50/dlls/kernel32/path.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/path.c 2015-11-13 14:32:40.000000000 +0000 @@ -506,6 +506,7 @@ { tmpshortpath[sp++] = *p++; tmpshortpath[sp++] = *p++; + lp += 2; } for (; *p && *p != '/' && *p != '\\'; p++); tmplen = p - (longpath + lp); @@ -1280,7 +1281,7 @@ attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; - status = NtOpenFile( &source_handle, 0, &attr, &io, 0, FILE_SYNCHRONOUS_IO_NONALERT ); + status = NtOpenFile( &source_handle, SYNCHRONIZE, &attr, &io, 0, FILE_SYNCHRONOUS_IO_NONALERT ); if (status == STATUS_SUCCESS) status = wine_nt_to_unix_file_name( &nt_name, &source_unix, FILE_OPEN, FALSE ); RtlFreeUnicodeString( &nt_name ); @@ -1304,7 +1305,7 @@ SetLastError( ERROR_PATH_NOT_FOUND ); goto error; } - status = NtOpenFile( &dest_handle, GENERIC_READ | GENERIC_WRITE, &attr, &io, 0, + status = NtOpenFile( &dest_handle, GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE, &attr, &io, 0, FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT ); if (status == STATUS_SUCCESS) /* destination exists */ { @@ -1562,7 +1563,7 @@ attr.SecurityDescriptor = sa ? sa->lpSecurityDescriptor : NULL; attr.SecurityQualityOfService = NULL; - status = NtCreateFile( &handle, GENERIC_READ, &attr, &io, NULL, + status = NtCreateFile( &handle, GENERIC_READ | SYNCHRONIZE, &attr, &io, NULL, FILE_ATTRIBUTE_NORMAL, FILE_SHARE_READ, FILE_CREATE, FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT, NULL, 0 ); @@ -1643,7 +1644,7 @@ attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; - status = NtOpenFile( &handle, DELETE, &attr, &io, + status = NtOpenFile( &handle, DELETE | SYNCHRONIZE, &attr, &io, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT ); if (status == STATUS_SUCCESS) @@ -1996,7 +1997,7 @@ /************************************************************************* * CreateSymbolicLinkW (KERNEL32.@) */ -BOOL WINAPI CreateSymbolicLinkW(LPCWSTR link, LPCWSTR target, DWORD flags) +BOOLEAN WINAPI CreateSymbolicLinkW(LPCWSTR link, LPCWSTR target, DWORD flags) { FIXME("(%s %s %d): stub\n", debugstr_w(link), debugstr_w(target), flags); return TRUE; @@ -2005,7 +2006,7 @@ /************************************************************************* * CreateSymbolicLinkA (KERNEL32.@) */ -BOOL WINAPI CreateSymbolicLinkA(LPCSTR link, LPCSTR target, DWORD flags) +BOOLEAN WINAPI CreateSymbolicLinkA(LPCSTR link, LPCSTR target, DWORD flags) { FIXME("(%s %s %d): stub\n", debugstr_a(link), debugstr_a(target), flags); return TRUE; diff -Nru wine1.7-1.7.50/dlls/kernel32/process.c wine1.7-1.7.55/dlls/kernel32/process.c --- wine1.7-1.7.50/dlls/kernel32/process.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/process.c 2015-11-13 14:32:40.000000000 +0000 @@ -2556,7 +2556,7 @@ /*********************************************************************** * WinExec (KERNEL32.@) */ -UINT WINAPI WinExec( LPCSTR lpCmdLine, UINT nCmdShow ) +UINT WINAPI DECLSPEC_HOTPATCH WinExec( LPCSTR lpCmdLine, UINT nCmdShow ) { PROCESS_INFORMATION info; STARTUPINFOA startup; @@ -3742,10 +3742,10 @@ */ BOOL WINAPI ProcessIdToSessionId( DWORD procid, DWORD *sessionid_ptr ) { - /* According to MSDN, if the calling process is not in a terminal - * services environment, then the sessionid returned is zero. - */ - *sessionid_ptr = 0; + if (procid != GetCurrentProcessId()) + FIXME("Unsupported for other processes.\n"); + + *sessionid_ptr = NtCurrentTeb()->Peb->SessionId; return TRUE; } @@ -3876,7 +3876,8 @@ { static int once; if (!once++) FIXME("stub\n"); - return 0; + /* Return current session id. */ + return NtCurrentTeb()->Peb->SessionId; } /********************************************************************** diff -Nru wine1.7-1.7.50/dlls/kernel32/profile.c wine1.7-1.7.55/dlls/kernel32/profile.c --- wine1.7-1.7.50/dlls/kernel32/profile.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/profile.c 2015-11-13 14:32:40.000000000 +0000 @@ -1402,8 +1402,8 @@ /*********************************************************************** * WritePrivateProfileStringA (KERNEL32.@) */ -BOOL WINAPI WritePrivateProfileStringA( LPCSTR section, LPCSTR entry, - LPCSTR string, LPCSTR filename ) +BOOL WINAPI DECLSPEC_HOTPATCH WritePrivateProfileStringA( LPCSTR section, LPCSTR entry, + LPCSTR string, LPCSTR filename ) { UNICODE_STRING sectionW, entryW, stringW, filenameW; BOOL ret; diff -Nru wine1.7-1.7.50/dlls/kernel32/sync.c wine1.7-1.7.55/dlls/kernel32/sync.c --- wine1.7-1.7.50/dlls/kernel32/sync.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/sync.c 2015-11-13 14:32:40.000000000 +0000 @@ -1547,7 +1547,7 @@ pipe_dev_name.Length = sizeof(leadin); pipe_dev_name.MaximumLength = sizeof(leadin); InitializeObjectAttributes(&attr,&pipe_dev_name, OBJ_CASE_INSENSITIVE, NULL, NULL); - status = NtOpenFile( &pipe_dev, FILE_READ_ATTRIBUTES, &attr, + status = NtOpenFile( &pipe_dev, FILE_READ_ATTRIBUTES | SYNCHRONIZE, &attr, &iosb, FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_SYNCHRONOUS_IO_NONALERT); if (status != ERROR_SUCCESS) diff -Nru wine1.7-1.7.50/dlls/kernel32/term.c wine1.7-1.7.55/dlls/kernel32/term.c --- wine1.7-1.7.50/dlls/kernel32/term.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/term.c 2015-11-13 14:32:40.000000000 +0000 @@ -227,7 +227,7 @@ struct dbkey_descr descr; }; -static struct dbkey_init TERM_dbkey_init[] = { +static const struct dbkey_init TERM_dbkey_init[] = { {"kcud1", "kDN", {dbk_complex, 0x50, 0x28, 0}}, {"kcuu1", "kUP", {dbk_complex, 0x48, 0x26, 0}}, {"kcub1", "kLFT", {dbk_complex, 0x4b, 0x25, 0}}, @@ -342,7 +342,7 @@ return strcmp(kp1->string, kp2->string); } -static BOOL TERM_AddKeyDescr(const char* string, struct dbkey_descr* descr) +static BOOL TERM_AddKeyDescr(const char* string, const struct dbkey_descr* descr) { if (!string || string == (const char*)-1) return TRUE; if (!TERM_dbkey) diff -Nru wine1.7-1.7.50/dlls/kernel32/tests/codepage.c wine1.7-1.7.55/dlls/kernel32/tests/codepage.c --- wine1.7-1.7.50/dlls/kernel32/tests/codepage.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/tests/codepage.c 2015-11-13 14:32:40.000000000 +0000 @@ -276,12 +276,14 @@ static void test_string_conversion(LPBOOL bUsedDefaultChar) { char mbc; - char mbs[5]; + char mbs[15]; int ret; WCHAR wc1 = 228; /* Western Windows-1252 character */ WCHAR wc2 = 1088; /* Russian Windows-1251 character not displayable for Windows-1252 */ static const WCHAR wcs[] = {'T', 'h', 1088, 'i', 0}; /* String with ASCII characters and a Russian character */ static const WCHAR dbwcs[] = {28953, 25152, 0}; /* String with Chinese (codepage 950) characters */ + static const WCHAR dbwcs2[] = {0x7bb8, 0x3d, 0xc813, 0xac00, 0xb77d, 0}; + static const char default_char[] = {0xa3, 0xbf, 0}; SetLastError(0xdeadbeef); ret = WideCharToMultiByte(1252, 0, &wc1, 1, &mbc, 1, NULL, bUsedDefaultChar); @@ -358,6 +360,11 @@ ok(!strcmp(mbs, "??"), "mbs is %s\n", mbs); if(bUsedDefaultChar) ok(*bUsedDefaultChar == TRUE, "bUsedDefaultChar is %d\n", *bUsedDefaultChar); + ret = WideCharToMultiByte(936, WC_COMPOSITECHECK, dbwcs2, -1, mbs, sizeof(mbs), (const char *)default_char, bUsedDefaultChar); + ok(ret == 10, "ret is %d\n", ret); + ok(!strcmp(mbs, "\xf3\xe7\x3d\xa3\xbf\xa3\xbf\xa3\xbf"), "mbs is %s\n", mbs); + if(bUsedDefaultChar) ok(*bUsedDefaultChar == TRUE, "bUsedDefaultChar is %d\n", *bUsedDefaultChar); + /* Length-only tests */ SetLastError(0xdeadbeef); ret = WideCharToMultiByte(1252, 0, &wc2, 1, NULL, 0, NULL, bUsedDefaultChar); diff -Nru wine1.7-1.7.50/dlls/kernel32/tests/comm.c wine1.7-1.7.55/dlls/kernel32/tests/comm.c --- wine1.7-1.7.50/dlls/kernel32/tests/comm.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/tests/comm.c 2015-11-13 14:32:40.000000000 +0000 @@ -941,7 +941,8 @@ evtmask = 0; SetLastError(0xdeadbeef); res = WaitCommEvent(hcom, &evtmask, &ovl_wait); - ok((!res && GetLastError() == ERROR_IO_PENDING) || res /* busy system */, "%d: WaitCommEvent error %d\n", i, GetLastError()); + ok(res /* busy system */ || GetLastError() == ERROR_IO_PENDING, + "%d: WaitCommEvent error %d\n", i, GetLastError()); res = WaitForSingleObject(ovl_wait.hEvent, TIMEOUT); if (i == 0) diff -Nru wine1.7-1.7.50/dlls/kernel32/tests/console.c wine1.7-1.7.55/dlls/kernel32/tests/console.c --- wine1.7-1.7.50/dlls/kernel32/tests/console.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/tests/console.c 2015-11-13 14:32:40.000000000 +0000 @@ -2588,6 +2588,99 @@ ok(bytes == 0xdeadbeef, "expected 0xdeadbeef, got %#x\n", bytes); } +static void test_GetCurrentConsoleFont(HANDLE std_output) +{ + BOOL ret; + CONSOLE_FONT_INFO cfi; + CONSOLE_SCREEN_BUFFER_INFO csbi; + short int width, height; + COORD c; + + memset(&cfi, 0, sizeof(CONSOLE_FONT_INFO)); + SetLastError(0xdeadbeef); + ret = GetCurrentConsoleFont(NULL, FALSE, &cfi); + ok(!ret, "got %d, expected 0\n", ret); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(!cfi.dwFontSize.X, "got %d, expected 0\n", cfi.dwFontSize.X); + ok(!cfi.dwFontSize.Y, "got %d, expected 0\n", cfi.dwFontSize.Y); + + memset(&cfi, 0, sizeof(CONSOLE_FONT_INFO)); + SetLastError(0xdeadbeef); + ret = GetCurrentConsoleFont(GetStdHandle(STD_INPUT_HANDLE), FALSE, &cfi); + ok(!ret, "got %d, expected 0\n", ret); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(!cfi.dwFontSize.X, "got %d, expected 0\n", cfi.dwFontSize.X); + ok(!cfi.dwFontSize.Y, "got %d, expected 0\n", cfi.dwFontSize.Y); + + memset(&cfi, 0, sizeof(CONSOLE_FONT_INFO)); + SetLastError(0xdeadbeef); + ret = GetCurrentConsoleFont(std_output, FALSE, &cfi); + ok(ret, "got %d, expected non-zero\n", ret); + ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + GetConsoleScreenBufferInfo(std_output, &csbi); + width = csbi.srWindow.Right - csbi.srWindow.Left + 1; + height = csbi.srWindow.Bottom - csbi.srWindow.Top + 1; + c = GetConsoleFontSize(std_output, cfi.nFont); + ok(cfi.dwFontSize.X == width || cfi.dwFontSize.X == c.X /* Vista and higher */, + "got %d, expected %d\n", cfi.dwFontSize.X, width); + ok(cfi.dwFontSize.Y == height || cfi.dwFontSize.Y == c.Y /* Vista and higher */, + "got %d, expected %d\n", cfi.dwFontSize.Y, height); +} + +static void test_GetConsoleFontSize(HANDLE std_output) +{ + COORD c; + DWORD index = 0; + CONSOLE_FONT_INFO cfi; + RECT r; + CONSOLE_SCREEN_BUFFER_INFO csbi; + LONG font_width, font_height; + HMODULE hmod; + DWORD (WINAPI *pGetNumberOfConsoleFonts)(void); + + memset(&c, 10, sizeof(COORD)); + SetLastError(0xdeadbeef); + c = GetConsoleFontSize(NULL, index); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(!c.X, "got %d, expected 0\n", c.X); + ok(!c.Y, "got %d, expected 0\n", c.Y); + + memset(&c, 10, sizeof(COORD)); + SetLastError(0xdeadbeef); + c = GetConsoleFontSize(GetStdHandle(STD_INPUT_HANDLE), index); + ok(GetLastError() == ERROR_INVALID_HANDLE, "got %u, expected 6\n", GetLastError()); + ok(!c.X, "got %d, expected 0\n", c.X); + ok(!c.Y, "got %d, expected 0\n", c.Y); + + GetCurrentConsoleFont(std_output, FALSE, &cfi); + memset(&c, 10, sizeof(COORD)); + SetLastError(0xdeadbeef); + c = GetConsoleFontSize(std_output, cfi.nFont); + ok(GetLastError() == 0xdeadbeef, "got %u, expected 0xdeadbeef\n", GetLastError()); + GetClientRect(GetConsoleWindow(), &r); + GetConsoleScreenBufferInfo(std_output, &csbi); + font_width = (r.right - r.left + 1) / csbi.srWindow.Right; + font_height = (r.bottom - r.top + 1) / csbi.srWindow.Bottom; + ok(c.X == font_width, "got %d, expected %d\n", c.X, font_width); + ok(c.Y == font_height, "got %d, expected %d\n", c.Y, font_height); + + hmod = GetModuleHandleA("kernel32.dll"); + pGetNumberOfConsoleFonts = (void *)GetProcAddress(hmod, "GetNumberOfConsoleFonts"); + if (!pGetNumberOfConsoleFonts) + { + win_skip("GetNumberOfConsoleFonts is not available\n"); + return; + } + index = pGetNumberOfConsoleFonts(); + + memset(&c, 10, sizeof(COORD)); + SetLastError(0xdeadbeef); + c = GetConsoleFontSize(std_output, index); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %u, expected 87\n", GetLastError()); + ok(!c.X, "got %d, expected 0\n", c.X); + ok(!c.Y, "got %d, expected 0\n", c.Y); +} + START_TEST(console) { static const char font_name[] = "Lucida Console"; @@ -2720,4 +2813,6 @@ test_ReadConsoleOutputCharacterA(hConOut); test_ReadConsoleOutputCharacterW(hConOut); test_ReadConsoleOutputAttribute(hConOut); + test_GetCurrentConsoleFont(hConOut); + test_GetConsoleFontSize(hConOut); } diff -Nru wine1.7-1.7.50/dlls/kernel32/tests/debugger.c wine1.7-1.7.55/dlls/kernel32/tests/debugger.c --- wine1.7-1.7.50/dlls/kernel32/tests/debugger.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/tests/debugger.c 2015-11-13 14:32:40.000000000 +0000 @@ -158,7 +158,7 @@ static void doCrash(int argc, char** argv) { - char* p; + volatile char* p; /* make sure the exception gets to the debugger */ SetErrorMode( 0 ); diff -Nru wine1.7-1.7.50/dlls/kernel32/tests/file.c wine1.7-1.7.55/dlls/kernel32/tests/file.c --- wine1.7-1.7.50/dlls/kernel32/tests/file.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/tests/file.c 2015-11-13 14:32:40.000000000 +0000 @@ -361,6 +361,16 @@ status = NtCreateFile( &file, DELETE, &attr, &io, NULL, 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, FILE_OPEN, FILE_DELETE_ON_CLOSE | FILE_NON_DIRECTORY_FILE, NULL, 0 ); + ok( status == STATUS_CANNOT_DELETE, "expected STATUS_CANNOT_DELETE, got %08x\n", status ); + + status = NtCreateFile( &file, DELETE, &attr, &io, NULL, 0, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + FILE_OPEN, FILE_DELETE_ON_CLOSE | FILE_DIRECTORY_FILE, NULL, 0 ); + ok( status == STATUS_NOT_A_DIRECTORY, "expected STATUS_NOT_A_DIRECTORY, got %08x\n", status ); + + status = NtCreateFile( &file, DELETE, &attr, &io, NULL, 0, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + FILE_OPEN_IF, FILE_DELETE_ON_CLOSE | FILE_NON_DIRECTORY_FILE, NULL, 0 ); todo_wine ok( status == STATUS_CANNOT_DELETE, "expected STATUS_CANNOT_DELETE, got %08x\n", status ); if (!status) CloseHandle( file ); @@ -1784,14 +1794,12 @@ SetLastError(0xdeadbeef); ret = DeleteFileA(temp_file); -todo_wine ok(ret, "DeleteFile error %d\n", GetLastError()); SetLastError(0xdeadbeef); ret = CloseHandle(hfile); ok(ret, "CloseHandle error %d\n", GetLastError()); ret = DeleteFileA(temp_file); -todo_wine ok(!ret, "DeleteFile should fail\n"); SetLastError(0xdeadbeef); @@ -4650,6 +4658,30 @@ CloseHandle(file); } +static void test_GetFileAttributesExW(void) +{ + static const WCHAR path1[] = {'\\','\\','?','\\',0}; + static const WCHAR path2[] = {'\\','?','?','\\',0}; + static const WCHAR path3[] = {'\\','D','o','s','D','e','v','i','c','e','s','\\',0}; + WIN32_FILE_ATTRIBUTE_DATA info; + BOOL ret; + + SetLastError(0xdeadbeef); + ret = GetFileAttributesExW(path1, GetFileExInfoStandard, &info); + ok(!ret, "GetFileAttributesExW succeeded\n"); + ok(GetLastError() == ERROR_INVALID_NAME, "Expected error ERROR_INVALID_NAME, got %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = GetFileAttributesExW(path2, GetFileExInfoStandard, &info); + ok(!ret, "GetFileAttributesExW succeeded\n"); + ok(GetLastError() == ERROR_INVALID_NAME, "Expected error ERROR_INVALID_NAME, got %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = GetFileAttributesExW(path3, GetFileExInfoStandard, &info); + ok(!ret, "GetFileAttributesExW succeeded\n"); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Expected error ERROR_FILE_NOT_FOUND, got %u\n", GetLastError()); +} + START_TEST(file) { InitFunctionPointers(); @@ -4706,4 +4738,5 @@ test_GetFinalPathNameByHandleA(); test_GetFinalPathNameByHandleW(); test_SetFileInformationByHandle(); + test_GetFileAttributesExW(); } diff -Nru wine1.7-1.7.50/dlls/kernel32/tests/heap.c wine1.7-1.7.55/dlls/kernel32/tests/heap.c --- wine1.7-1.7.50/dlls/kernel32/tests/heap.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/tests/heap.c 2015-11-13 14:32:40.000000000 +0000 @@ -39,6 +39,7 @@ #define HEAP_VALIDATE_PARAMS 0x40000000 static BOOL (WINAPI *pHeapQueryInformation)(HANDLE, HEAP_INFORMATION_CLASS, PVOID, SIZE_T, PSIZE_T); +static BOOL (WINAPI *pGetPhysicallyInstalledSystemMemory)(ULONGLONG *); static ULONG (WINAPI *pRtlGetNtGlobalFlags)(void); struct heap_layout @@ -1145,6 +1146,38 @@ test_heap_checks( expect_heap ); } +static void test_GetPhysicallyInstalledSystemMemory(void) +{ + HMODULE kernel32 = GetModuleHandleA("kernel32.dll"); + MEMORYSTATUSEX memstatus; + ULONGLONG total_memory; + BOOL ret; + + pGetPhysicallyInstalledSystemMemory = (void *)GetProcAddress(kernel32, "GetPhysicallyInstalledSystemMemory"); + if (!pGetPhysicallyInstalledSystemMemory) + { + win_skip("GetPhysicallyInstalledSystemMemory is not available\n"); + return; + } + + SetLastError(0xdeadbeef); + ret = pGetPhysicallyInstalledSystemMemory(NULL); + ok(!ret, "GetPhysicallyInstalledSystemMemory should fail\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, + "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + + total_memory = 0; + ret = pGetPhysicallyInstalledSystemMemory(&total_memory); + ok(ret, "GetPhysicallyInstalledSystemMemory unexpectedly failed\n"); + ok(total_memory != 0, "expected total_memory != 0\n"); + + memstatus.dwLength = sizeof(memstatus); + ret = GlobalMemoryStatusEx(&memstatus); + ok(ret, "GlobalMemoryStatusEx unexpectedly failed\n"); + ok(total_memory >= memstatus.ullTotalPhys / 1024, + "expected total_memory >= memstatus.ullTotalPhys / 1024\n"); +} + START_TEST(heap) { int argc; @@ -1172,7 +1205,9 @@ test_sized_HeapReAlloc(1, (1 << 20)); test_sized_HeapReAlloc((1 << 20), (2 << 20)); test_sized_HeapReAlloc((1 << 20), 1); + test_HeapQueryInformation(); + test_GetPhysicallyInstalledSystemMemory(); if (pRtlGetNtGlobalFlags) { diff -Nru wine1.7-1.7.50/dlls/kernel32/tests/locale.c wine1.7-1.7.55/dlls/kernel32/tests/locale.c --- wine1.7-1.7.50/dlls/kernel32/tests/locale.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/tests/locale.c 2015-11-13 14:32:40.000000000 +0000 @@ -2420,7 +2420,7 @@ lcid = pLocaleNameToLCID(LOCALE_NAME_INVARIANT, 0); ok(lcid == 0x7F, "Expected lcid = 0x7F, got %08x, error %d\n", lcid, GetLastError()); ret = pLCIDToLocaleName(lcid, buffer, LOCALE_NAME_MAX_LENGTH, 0); - todo_wine ok(ret > 0, "Expected ret > 0, got %d, error %d\n", ret, GetLastError()); + ok(ret > 0, "Expected ret > 0, got %d, error %d\n", ret, GetLastError()); trace("%08x, %s\n", lcid, wine_dbgstr_w(buffer)); /* bad name */ @@ -3132,6 +3132,9 @@ LCID_RES(LOCALE_SYSTEM_DEFAULT, GetSystemDefaultLCID()); LCID_RES(LOCALE_USER_DEFAULT, GetUserDefaultLCID()); LCID_RES(LOCALE_NEUTRAL, GetUserDefaultLCID()); + lcid = ConvertDefaultLocale(LOCALE_INVARIANT); + ok(lcid == LOCALE_INVARIANT || broken(lcid == 0x47f) /* win2k[3]/winxp */, + "Expected lcid = %08x, got %08x\n", LOCALE_INVARIANT, lcid); } static BOOL CALLBACK langgrp_procA(LGRPID lgrpid, LPSTR lpszNum, LPSTR lpszName, @@ -3355,6 +3358,7 @@ } static char date_fmt_buf[1024]; +static WCHAR date_fmt_bufW[1024]; static BOOL CALLBACK enum_datetime_procA(LPSTR fmt) { @@ -3363,6 +3367,12 @@ return TRUE; } +static BOOL CALLBACK enum_datetime_procW(WCHAR *fmt) +{ + lstrcatW(date_fmt_bufW, fmt); + return FALSE; +} + static void test_EnumDateFormatsA(void) { char *p, buf[256]; @@ -3470,6 +3480,57 @@ ok(!lstrcmpA(date_fmt_buf, buf), "expected \"%s\" got \"%s\"\n", date_fmt_buf, buf); } +static void test_EnumTimeFormatsW(void) +{ + LCID lcid = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT); + WCHAR bufW[256]; + BOOL ret; + + date_fmt_bufW[0] = 0; + ret = EnumTimeFormatsW(enum_datetime_procW, lcid, 0); + ok(ret, "EnumTimeFormatsW(0) error %d\n", GetLastError()); + ret = GetLocaleInfoW(lcid, LOCALE_STIMEFORMAT, bufW, sizeof(bufW)/sizeof(bufW[0])); + ok(ret, "GetLocaleInfoW(LOCALE_STIMEFORMAT) error %d\n", GetLastError()); + ok(!lstrcmpW(date_fmt_bufW, bufW), "expected \"%s\" got \"%s\"\n", wine_dbgstr_w(date_fmt_bufW), + wine_dbgstr_w(bufW)); + + date_fmt_bufW[0] = 0; + ret = EnumTimeFormatsW(enum_datetime_procW, lcid, LOCALE_USE_CP_ACP); + ok(ret, "EnumTimeFormatsW(LOCALE_USE_CP_ACP) error %d\n", GetLastError()); + ret = GetLocaleInfoW(lcid, LOCALE_STIMEFORMAT, bufW, sizeof(bufW)/sizeof(bufW[0])); + ok(ret, "GetLocaleInfoW(LOCALE_STIMEFORMAT) error %d\n", GetLastError()); + ok(!lstrcmpW(date_fmt_bufW, bufW), "expected \"%s\" got \"%s\"\n", wine_dbgstr_w(date_fmt_bufW), + wine_dbgstr_w(bufW)); + + /* TIME_NOSECONDS is Win7+ feature */ + date_fmt_bufW[0] = 0; + ret = EnumTimeFormatsW(enum_datetime_procW, lcid, TIME_NOSECONDS); + if (!ret && GetLastError() == ERROR_INVALID_FLAGS) + win_skip("EnumTimeFormatsW doesn't support TIME_NOSECONDS\n"); + else { + char buf[256]; + + ok(ret, "EnumTimeFormatsW(TIME_NOSECONDS) error %d\n", GetLastError()); + ret = GetLocaleInfoW(lcid, LOCALE_SSHORTTIME, bufW, sizeof(bufW)/sizeof(bufW[0])); + ok(ret, "GetLocaleInfoW(LOCALE_SSHORTTIME) error %d\n", GetLastError()); + ok(!lstrcmpW(date_fmt_bufW, bufW), "expected \"%s\" got \"%s\"\n", wine_dbgstr_w(date_fmt_bufW), + wine_dbgstr_w(bufW)); + + /* EnumTimeFormatsA doesn't support this flag */ + ret = EnumTimeFormatsA(enum_datetime_procA, lcid, TIME_NOSECONDS); + ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, "EnumTimeFormatsA(TIME_NOSECONDS) ret %d, error %d\n", ret, + GetLastError()); + + ret = EnumTimeFormatsA(NULL, lcid, TIME_NOSECONDS); + ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, "EnumTimeFormatsA(TIME_NOSECONDS) ret %d, error %d\n", ret, + GetLastError()); + + /* And it's not supported by GetLocaleInfoA either */ + ret = GetLocaleInfoA(lcid, LOCALE_SSHORTTIME, buf, sizeof(buf)/sizeof(buf[0])); + ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, "GetLocaleInfoA(LOCALE_SSHORTTIME) ret %d, error %d\n", ret, + GetLastError()); + } +} static void test_GetCPInfo(void) { BOOL ret; @@ -4242,7 +4303,7 @@ /* try invalid type value */ SetLastError(0xdeadbeef); - ret = pGetGeoInfoA(203, GEO_PARENT + 1, NULL, 0, 0); + ret = pGetGeoInfoA(203, GEO_CURRENCYSYMBOL + 1, NULL, 0, 0); ok(ret == 0, "got %d\n", ret); ok(GetLastError() == ERROR_INVALID_FLAGS, "got %d\n", GetLastError()); } @@ -4314,11 +4375,196 @@ } } +struct invariant_entry { + const char *name; + int id; + const char *expect; +}; + +#define X(x) #x, x +static const struct invariant_entry invariant_list[] = { + { X(LOCALE_ILANGUAGE), "007f" }, + { X(LOCALE_SENGLANGUAGE), "Invariant Language" }, + { X(LOCALE_SABBREVLANGNAME), "IVL" }, + { X(LOCALE_SNATIVELANGNAME), "Invariant Language" }, + { X(LOCALE_ICOUNTRY), "1" }, + { X(LOCALE_SENGCOUNTRY), "Invariant Country" }, + { X(LOCALE_SABBREVCTRYNAME), "IVC" }, + { X(LOCALE_SNATIVECTRYNAME), "Invariant Country" }, + { X(LOCALE_IDEFAULTLANGUAGE), "0409" }, + { X(LOCALE_IDEFAULTCOUNTRY), "1" }, + { X(LOCALE_IDEFAULTCODEPAGE), "437" }, + { X(LOCALE_IDEFAULTANSICODEPAGE), "1252" }, + { X(LOCALE_IDEFAULTMACCODEPAGE), "10000" }, + { X(LOCALE_SLIST), "," }, + { X(LOCALE_IMEASURE), "0" }, + { X(LOCALE_SDECIMAL), "." }, + { X(LOCALE_STHOUSAND), "," }, + { X(LOCALE_SGROUPING), "3;0" }, + { X(LOCALE_IDIGITS), "2" }, + { X(LOCALE_ILZERO), "1" }, + { X(LOCALE_INEGNUMBER), "1" }, + { X(LOCALE_SNATIVEDIGITS), "0123456789" }, + { X(LOCALE_SCURRENCY), "\x00a4" }, + { X(LOCALE_SINTLSYMBOL), "XDR" }, + { X(LOCALE_SMONDECIMALSEP), "." }, + { X(LOCALE_SMONTHOUSANDSEP), "," }, + { X(LOCALE_SMONGROUPING), "3;0" }, + { X(LOCALE_ICURRDIGITS), "2" }, + { X(LOCALE_IINTLCURRDIGITS), "2" }, + { X(LOCALE_ICURRENCY), "0" }, + { X(LOCALE_INEGCURR), "0" }, + { X(LOCALE_SDATE), "/" }, + { X(LOCALE_STIME), ":" }, + { X(LOCALE_SSHORTDATE), "MM/dd/yyyy" }, + { X(LOCALE_SLONGDATE), "dddd, dd MMMM yyyy" }, + { X(LOCALE_STIMEFORMAT), "HH:mm:ss" }, + { X(LOCALE_IDATE), "0" }, + { X(LOCALE_ILDATE), "1" }, + { X(LOCALE_ITIME), "1" }, + { X(LOCALE_ITIMEMARKPOSN), "0" }, + { X(LOCALE_ICENTURY), "1" }, + { X(LOCALE_ITLZERO), "1" }, + { X(LOCALE_IDAYLZERO), "1" }, + { X(LOCALE_IMONLZERO), "1" }, + { X(LOCALE_S1159), "AM" }, + { X(LOCALE_S2359), "PM" }, + { X(LOCALE_ICALENDARTYPE), "1" }, + { X(LOCALE_IOPTIONALCALENDAR), "0" }, + { X(LOCALE_IFIRSTDAYOFWEEK), "6" }, + { X(LOCALE_IFIRSTWEEKOFYEAR), "0" }, + { X(LOCALE_SDAYNAME1), "Monday" }, + { X(LOCALE_SDAYNAME2), "Tuesday" }, + { X(LOCALE_SDAYNAME3), "Wednesday" }, + { X(LOCALE_SDAYNAME4), "Thursday" }, + { X(LOCALE_SDAYNAME5), "Friday" }, + { X(LOCALE_SDAYNAME6), "Saturday" }, + { X(LOCALE_SDAYNAME7), "Sunday" }, + { X(LOCALE_SABBREVDAYNAME1), "Mon" }, + { X(LOCALE_SABBREVDAYNAME2), "Tue" }, + { X(LOCALE_SABBREVDAYNAME3), "Wed" }, + { X(LOCALE_SABBREVDAYNAME4), "Thu" }, + { X(LOCALE_SABBREVDAYNAME5), "Fri" }, + { X(LOCALE_SABBREVDAYNAME6), "Sat" }, + { X(LOCALE_SABBREVDAYNAME7), "Sun" }, + { X(LOCALE_SMONTHNAME1), "January" }, + { X(LOCALE_SMONTHNAME2), "February" }, + { X(LOCALE_SMONTHNAME3), "March" }, + { X(LOCALE_SMONTHNAME4), "April" }, + { X(LOCALE_SMONTHNAME5), "May" }, + { X(LOCALE_SMONTHNAME6), "June" }, + { X(LOCALE_SMONTHNAME7), "July" }, + { X(LOCALE_SMONTHNAME8), "August" }, + { X(LOCALE_SMONTHNAME9), "September" }, + { X(LOCALE_SMONTHNAME10), "October" }, + { X(LOCALE_SMONTHNAME11), "November" }, + { X(LOCALE_SMONTHNAME12), "December" }, + { X(LOCALE_SMONTHNAME13), "" }, + { X(LOCALE_SABBREVMONTHNAME1), "Jan" }, + { X(LOCALE_SABBREVMONTHNAME2), "Feb" }, + { X(LOCALE_SABBREVMONTHNAME3), "Mar" }, + { X(LOCALE_SABBREVMONTHNAME4), "Apr" }, + { X(LOCALE_SABBREVMONTHNAME5), "May" }, + { X(LOCALE_SABBREVMONTHNAME6), "Jun" }, + { X(LOCALE_SABBREVMONTHNAME7), "Jul" }, + { X(LOCALE_SABBREVMONTHNAME8), "Aug" }, + { X(LOCALE_SABBREVMONTHNAME9), "Sep" }, + { X(LOCALE_SABBREVMONTHNAME10), "Oct" }, + { X(LOCALE_SABBREVMONTHNAME11), "Nov" }, + { X(LOCALE_SABBREVMONTHNAME12), "Dec" }, + { X(LOCALE_SABBREVMONTHNAME13), "" }, + { X(LOCALE_SPOSITIVESIGN), "+" }, + { X(LOCALE_SNEGATIVESIGN), "-" }, + { X(LOCALE_IPOSSIGNPOSN), "3" }, + { X(LOCALE_INEGSIGNPOSN), "0" }, + { X(LOCALE_IPOSSYMPRECEDES), "1" }, + { X(LOCALE_IPOSSEPBYSPACE), "0" }, + { X(LOCALE_INEGSYMPRECEDES), "1" }, + { X(LOCALE_INEGSEPBYSPACE), "0" }, + { X(LOCALE_SISO639LANGNAME), "iv" }, + { X(LOCALE_SISO3166CTRYNAME), "IV" }, + { X(LOCALE_IDEFAULTEBCDICCODEPAGE), "037" }, + { X(LOCALE_IPAPERSIZE), "9" }, + { X(LOCALE_SENGCURRNAME), "International Monetary Fund" }, + { X(LOCALE_SNATIVECURRNAME), "International Monetary Fund" }, + { X(LOCALE_SYEARMONTH), "yyyy MMMM" }, + { X(LOCALE_IDIGITSUBSTITUTION), "1" }, + { X(LOCALE_SNAME), "" }, + { X(LOCALE_SSCRIPTS), "Latn;" }, + { 0 } +}; +#undef X + +static void test_invariant(void) +{ + int ret; + int len; + char buffer[BUFFER_SIZE]; + const struct invariant_entry *ptr = invariant_list; + + if (!GetLocaleInfoA(LOCALE_INVARIANT, NUO|LOCALE_SLANGUAGE, buffer, sizeof(buffer))) + { + win_skip("GetLocaleInfoA(LOCALE_INVARIANT) not supported\n"); /* win2k */ + return; + } + + while (ptr->name) + { + ret = GetLocaleInfoA(LOCALE_INVARIANT, NUO|ptr->id, buffer, sizeof(buffer)); + if (!ret && (ptr->id == LOCALE_SNAME || ptr->id == LOCALE_SSCRIPTS)) + win_skip("not supported\n"); /* winxp/win2k3 */ + else + { + len = strlen(ptr->expect)+1; /* include \0 */ + ok(ret == len, "For id %d, expected ret == %d, got %d, error %d\n", + ptr->id, len, ret, GetLastError()); + ok(!strcmp(buffer, ptr->expect), "For id %d, Expected %s, got '%s'\n", + ptr->id, ptr->expect, buffer); + } + + ptr++; + } + + if ((PRIMARYLANGID(LANGIDFROMLCID(GetSystemDefaultLCID())) != LANG_ENGLISH) || + (PRIMARYLANGID(LANGIDFROMLCID(GetThreadLocale())) != LANG_ENGLISH)) + { + skip("Non-English locale\n"); + } + else + { + /* some locales translate these */ + static const char lang[] = "Invariant Language (Invariant Country)"; + static const char cntry[] = "Invariant Country"; + static const char sortm[] = "Math Alphanumerics"; + static const char sortd[] = "Default"; /* win2k3 */ + + ret = GetLocaleInfoA(LOCALE_INVARIANT, NUO|LOCALE_SLANGUAGE, buffer, sizeof(buffer)); + len = lstrlenA(lang) + 1; + ok(ret == len, "Expected ret == %d, got %d, error %d\n", len, ret, GetLastError()); + ok(!strcmp(buffer, lang), "Expected %s, got '%s'\n", lang, buffer); + + ret = GetLocaleInfoA(LOCALE_INVARIANT, NUO|LOCALE_SCOUNTRY, buffer, sizeof(buffer)); + len = lstrlenA(cntry) + 1; + ok(ret == len, "Expected ret == %d, got %d, error %d\n", len, ret, GetLastError()); + ok(!strcmp(buffer, cntry), "Expected %s, got '%s'\n", cntry, buffer); + + ret = GetLocaleInfoA(LOCALE_INVARIANT, NUO|LOCALE_SSORTNAME, buffer, sizeof(buffer)); + if (ret == lstrlenA(sortm)+1) + ok(!strcmp(buffer, sortm), "Expected %s, got '%s'\n", sortm, buffer); + else if (ret == lstrlenA(sortd)+1) /* win2k3 */ + ok(!strcmp(buffer, sortd), "Expected %s, got '%s'\n", sortd, buffer); + else + ok(0, "Expected ret == %d or %d, got %d, error %d\n", + lstrlenA(sortm)+1, lstrlenA(sortd)+1, ret, GetLastError()); + } +} + START_TEST(locale) { InitFunctionPointers(); test_EnumTimeFormatsA(); + test_EnumTimeFormatsW(); test_EnumDateFormatsA(); test_GetLocaleInfoA(); test_GetLocaleInfoW(); @@ -4353,6 +4599,7 @@ test_CompareStringOrdinal(); test_GetGeoInfo(); test_EnumSystemGeoID(); + test_invariant(); /* this requires collation table patch to make it MS compatible */ if (0) test_sorting(); } diff -Nru wine1.7-1.7.50/dlls/kernel32/tests/pipe.c wine1.7-1.7.55/dlls/kernel32/tests/pipe.c --- wine1.7-1.7.50/dlls/kernel32/tests/pipe.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/tests/pipe.c 2015-11-13 14:32:40.000000000 +0000 @@ -294,11 +294,14 @@ ok(written == sizeof(obuf2), "write file len 3b\n"); ok(PeekNamedPipe(hFile, ibuf, sizeof(ibuf), &readden, &avail, NULL), "Peek3\n"); if (pipemode == PIPE_TYPE_BYTE) { - todo_wine ok(readden == sizeof(obuf) + sizeof(obuf2), "peek3 got %d bytes\n", readden); + /* currently the Wine behavior depends on the kernel version */ + /* ok(readden == sizeof(obuf) + sizeof(obuf2), "peek3 got %d bytes\n", readden); */ + if (readden != sizeof(obuf) + sizeof(obuf2)) todo_wine ok(0, "peek3 got %d bytes\n", readden); } else { - ok(readden == sizeof(obuf), "peek3 got %d bytes\n", readden); + /* ok(readden == sizeof(obuf), "peek3 got %d bytes\n", readden); */ + if (readden != sizeof(obuf)) todo_wine ok(0, "peek3 got %d bytes\n", readden); } ok(avail == sizeof(obuf) + sizeof(obuf2), "peek3 got %d bytes available\n", avail); pbuf = ibuf; @@ -322,11 +325,14 @@ ok(written == sizeof(obuf2), "write file len 4b\n"); ok(PeekNamedPipe(hnp, ibuf, sizeof(ibuf), &readden, &avail, NULL), "Peek4\n"); if (pipemode == PIPE_TYPE_BYTE) { - todo_wine ok(readden == sizeof(obuf) + sizeof(obuf2), "peek4 got %d bytes\n", readden); + /* currently the Wine behavior depends on the kernel version */ + /* ok(readden == sizeof(obuf) + sizeof(obuf2), "peek4 got %d bytes\n", readden); */ + if (readden != sizeof(obuf) + sizeof(obuf2)) todo_wine ok(0, "peek4 got %d bytes\n", readden); } else { - ok(readden == sizeof(obuf), "peek4 got %d bytes\n", readden); + /* ok(readden == sizeof(obuf), "peek4 got %d bytes\n", readden); */ + if (readden != sizeof(obuf)) todo_wine ok(0, "peek4 got %d bytes\n", readden); } ok(avail == sizeof(obuf) + sizeof(obuf2), "peek4 got %d bytes available\n", avail); pbuf = ibuf; @@ -367,7 +373,10 @@ ok(WriteFile(hnp, obuf2, sizeof(obuf2), &written, NULL), " WriteFile5b\n"); ok(written == sizeof(obuf2), "write file len 3b\n"); ok(PeekNamedPipe(hFile, ibuf, sizeof(ibuf), &readden, &avail, NULL), "Peek5\n"); - ok(readden == sizeof(obuf), "peek5 got %d bytes\n", readden); + /* currently the Wine behavior depends on the kernel version */ + /* ok(readden == sizeof(obuf), "peek5 got %d bytes\n", readden); */ + if (readden != sizeof(obuf)) todo_wine ok(0, "peek5 got %d bytes\n", readden); + ok(avail == sizeof(obuf) + sizeof(obuf2), "peek5 got %d bytes available\n", avail); pbuf = ibuf; ok(memcmp(obuf, pbuf, sizeof(obuf)) == 0, "content 5a check\n"); @@ -399,7 +408,10 @@ ok(WriteFile(hFile, obuf2, sizeof(obuf2), &written, NULL), " WriteFile6b\n"); ok(written == sizeof(obuf2), "write file len 6b\n"); ok(PeekNamedPipe(hnp, ibuf, sizeof(ibuf), &readden, &avail, NULL), "Peek6\n"); - ok(readden == sizeof(obuf), "peek6 got %d bytes\n", readden); + /* currently the Wine behavior depends on the kernel version */ + /* ok(readden == sizeof(obuf), "peek6 got %d bytes\n", readden); */ + if (readden != sizeof(obuf)) todo_wine ok(0, "peek6 got %d bytes\n", readden); + ok(avail == sizeof(obuf) + sizeof(obuf2), "peek6b got %d bytes available\n", avail); pbuf = ibuf; ok(memcmp(obuf, pbuf, sizeof(obuf)) == 0, "content 6a check\n"); diff -Nru wine1.7-1.7.50/dlls/kernel32/tests/process.c wine1.7-1.7.55/dlls/kernel32/tests/process.c --- wine1.7-1.7.50/dlls/kernel32/tests/process.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/tests/process.c 2015-11-13 14:32:40.000000000 +0000 @@ -77,6 +77,8 @@ static HANDLE (WINAPI *pCreateIoCompletionPort)(HANDLE file, HANDLE existing_port, ULONG_PTR key, DWORD threads); static BOOL (WINAPI *pGetNumaProcessorNode)(UCHAR, PUCHAR); static NTSTATUS (WINAPI *pNtQueryInformationProcess)(HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG); +static BOOL (WINAPI *pProcessIdToSessionId)(DWORD,DWORD*); +static DWORD (WINAPI *pWTSGetActiveConsoleSessionId)(void); /* ############################### */ static char base[MAX_PATH]; @@ -233,6 +235,8 @@ pSetInformationJobObject = (void *)GetProcAddress(hkernel32, "SetInformationJobObject"); pCreateIoCompletionPort = (void *)GetProcAddress(hkernel32, "CreateIoCompletionPort"); pGetNumaProcessorNode = (void *)GetProcAddress(hkernel32, "GetNumaProcessorNode"); + pProcessIdToSessionId = (void *)GetProcAddress(hkernel32, "ProcessIdToSessionId"); + pWTSGetActiveConsoleSessionId = (void *)GetProcAddress(hkernel32, "WTSGetActiveConsoleSessionId"); return TRUE; } @@ -2788,6 +2792,25 @@ } } +static void test_session_info(void) +{ + DWORD session_id, active_session; + BOOL r; + + if (!pProcessIdToSessionId) + { + win_skip("ProcessIdToSessionId is missing\n"); + return; + } + + r = pProcessIdToSessionId(GetCurrentProcessId(), &session_id); + ok(r, "ProcessIdToSessionId failed: %u\n", GetLastError()); + trace("session_id = %x\n", session_id); + + active_session = pWTSGetActiveConsoleSessionId(); + trace("active_session = %x\n", active_session); +} + static void test_process_info(void) { char buf[4096]; @@ -2994,6 +3017,8 @@ test_DuplicateHandle(); test_StartupNoConsole(); test_GetNumaProcessorNode(); + test_session_info(); + /* things that can be tested: * lookup: check the way program to be executed is searched * handles: check the handle inheritance stuff (+sec options) diff -Nru wine1.7-1.7.50/dlls/kernel32/tests/sync.c wine1.7-1.7.55/dlls/kernel32/tests/sync.c --- wine1.7-1.7.50/dlls/kernel32/tests/sync.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/tests/sync.c 2015-11-13 14:32:40.000000000 +0000 @@ -56,6 +56,9 @@ static VOID (WINAPI *pReleaseSRWLockShared)(PSRWLOCK); static BOOLEAN (WINAPI *pTryAcquireSRWLockExclusive)(PSRWLOCK); static BOOLEAN (WINAPI *pTryAcquireSRWLockShared)(PSRWLOCK); + +static NTSTATUS (WINAPI *pNtAllocateVirtualMemory)(HANDLE, PVOID *, ULONG, SIZE_T *, ULONG, ULONG); +static NTSTATUS (WINAPI *pNtFreeVirtualMemory)(HANDLE, PVOID *, SIZE_T *, ULONG); static NTSTATUS (WINAPI *pNtWaitForMultipleObjects)(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*); static void test_signalandwait(void) @@ -2308,8 +2311,191 @@ trace("number of total exclusive accesses is %d\n", srwlock_protected_value); } +static DWORD WINAPI alertable_wait_thread(void *param) +{ + HANDLE *semaphores = param; + LARGE_INTEGER timeout; + NTSTATUS status; + DWORD result; + + ReleaseSemaphore(semaphores[0], 1, NULL); + result = WaitForMultipleObjectsEx(1, &semaphores[1], TRUE, 1000, TRUE); + ok(result == WAIT_IO_COMPLETION, "expected WAIT_IO_COMPLETION, got %u\n", result); + result = WaitForMultipleObjectsEx(1, &semaphores[1], TRUE, 200, TRUE); + ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", result); + + ReleaseSemaphore(semaphores[0], 1, NULL); + timeout.QuadPart = -10000000; + status = pNtWaitForMultipleObjects(1, &semaphores[1], FALSE, TRUE, &timeout); + ok(status == STATUS_USER_APC, "expected STATUS_USER_APC, got %08x\n", status); + timeout.QuadPart = -2000000; + status = pNtWaitForMultipleObjects(1, &semaphores[1], FALSE, TRUE, &timeout); + ok(status == STATUS_WAIT_0, "expected STATUS_WAIT_0, got %08x\n", status); + + ReleaseSemaphore(semaphores[0], 1, NULL); + timeout.QuadPart = -10000000; + status = pNtWaitForMultipleObjects(1, &semaphores[1], FALSE, TRUE, &timeout); + ok(status == STATUS_USER_APC, "expected STATUS_USER_APC, got %08x\n", status); + result = WaitForSingleObject(semaphores[0], 0); + ok(result == WAIT_TIMEOUT, "expected WAIT_TIMEOUT, got %u\n", result); + + return 0; +} + +static void CALLBACK alertable_wait_apc(ULONG_PTR userdata) +{ + HANDLE *semaphores = (void *)userdata; + ReleaseSemaphore(semaphores[1], 1, NULL); +} + +static void CALLBACK alertable_wait_apc2(ULONG_PTR userdata) +{ + HANDLE *semaphores = (void *)userdata; + DWORD result; + + result = WaitForSingleObject(semaphores[0], 1000); + ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", result); +} + +static void test_alertable_wait(void) +{ + HANDLE thread, semaphores[2]; + DWORD result; + + semaphores[0] = CreateSemaphoreW(NULL, 0, 2, NULL); + ok(semaphores[0] != NULL, "CreateSemaphore failed with %u\n", GetLastError()); + semaphores[1] = CreateSemaphoreW(NULL, 0, 1, NULL); + ok(semaphores[1] != NULL, "CreateSemaphore failed with %u\n", GetLastError()); + thread = CreateThread(NULL, 0, alertable_wait_thread, semaphores, 0, NULL); + ok(thread != NULL, "CreateThread failed with %u\n", GetLastError()); + + result = WaitForSingleObject(semaphores[0], 1000); + ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", result); + Sleep(100); /* ensure the thread is blocking in WaitForMultipleObjectsEx */ + result = QueueUserAPC(alertable_wait_apc, thread, (ULONG_PTR)semaphores); + ok(result != 0, "QueueUserAPC failed with %u\n", GetLastError()); + + result = WaitForSingleObject(semaphores[0], 1000); + ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", result); + Sleep(100); /* ensure the thread is blocking in NtWaitForMultipleObjects */ + result = QueueUserAPC(alertable_wait_apc, thread, (ULONG_PTR)semaphores); + ok(result != 0, "QueueUserAPC failed with %u\n", GetLastError()); + + result = WaitForSingleObject(semaphores[0], 1000); + ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", result); + Sleep(100); /* ensure the thread is blocking in NtWaitForMultipleObjects */ + result = QueueUserAPC(alertable_wait_apc2, thread, (ULONG_PTR)semaphores); + ok(result != 0, "QueueUserAPC failed with %u\n", GetLastError()); + result = QueueUserAPC(alertable_wait_apc2, thread, (ULONG_PTR)semaphores); + ok(result != 0, "QueueUserAPC failed with %u\n", GetLastError()); + ReleaseSemaphore(semaphores[0], 2, NULL); + + result = WaitForSingleObject(thread, 1000); + ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", result); + CloseHandle(thread); + CloseHandle(semaphores[0]); + CloseHandle(semaphores[1]); +} + +struct apc_deadlock_info +{ + PROCESS_INFORMATION *pi; + HANDLE event; + BOOL running; +}; + +static DWORD WINAPI apc_deadlock_thread(void *param) +{ + struct apc_deadlock_info *info = param; + PROCESS_INFORMATION *pi = info->pi; + NTSTATUS status; + SIZE_T size; + void *base; + + while (info->running) + { + base = NULL; + size = 0x1000; + status = pNtAllocateVirtualMemory(pi->hProcess, &base, 0, &size, + MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); + ok(!status, "expected STATUS_SUCCESS, got %08x\n", status); + ok(base != NULL, "expected base != NULL, got %p\n", base); + SetEvent(info->event); + + size = 0; + status = pNtFreeVirtualMemory(pi->hProcess, &base, &size, MEM_RELEASE); + ok(!status, "expected STATUS_SUCCESS, got %08x\n", status); + SetEvent(info->event); + } + + return 0; +} + +static void test_apc_deadlock(void) +{ + struct apc_deadlock_info info; + PROCESS_INFORMATION pi; + STARTUPINFOA si = { sizeof(si) }; + char cmdline[MAX_PATH]; + HANDLE event, thread; + DWORD result; + BOOL success; + char **argv; + int i; + + winetest_get_mainargs(&argv); + sprintf(cmdline, "\"%s\" sync apc_deadlock", argv[0]); + success = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + ok(success, "CreateProcess failed with %u\n", GetLastError()); + + event = CreateEventA(NULL, FALSE, FALSE, NULL); + ok(event != NULL, "CreateEvent failed with %u\n", GetLastError()); + + info.pi = π + info.event = event; + info.running = TRUE; + + thread = CreateThread(NULL, 0, apc_deadlock_thread, &info, 0, NULL); + ok(thread != NULL, "CreateThread failed with %u\n", GetLastError()); + result = WaitForSingleObject(event, 1000); + ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", result); + + for (i = 0; i < 1000 && info.running; i++) + { + result = SuspendThread(pi.hThread); + ok(result == 0, "expected 0, got %u\n", result); + + WaitForSingleObject(event, 0); /* reset event */ + result = WaitForSingleObject(event, 1000); + if (result == WAIT_TIMEOUT) + { + todo_wine + ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", result); + info.running = FALSE; + } + else + ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", result); + + result = ResumeThread(pi.hThread); + ok(result == 1, "expected 1, got %u\n", result); + Sleep(1); + } + + info.running = FALSE; + result = WaitForSingleObject(thread, 1000); + ok(result == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", result); + CloseHandle(thread); + CloseHandle(event); + + TerminateProcess(pi.hProcess, 0); + CloseHandle(pi.hThread); + CloseHandle(pi.hProcess); +} + START_TEST(sync) { + char **argv; + int argc; HMODULE hdll = GetModuleHandleA("kernel32.dll"); HMODULE hntdll = GetModuleHandleA("ntdll.dll"); @@ -2338,8 +2524,21 @@ pReleaseSRWLockShared = (void *)GetProcAddress(hdll, "ReleaseSRWLockShared"); pTryAcquireSRWLockExclusive = (void *)GetProcAddress(hdll, "TryAcquireSRWLockExclusive"); pTryAcquireSRWLockShared = (void *)GetProcAddress(hdll, "TryAcquireSRWLockShared"); + pNtAllocateVirtualMemory = (void *)GetProcAddress(hntdll, "NtAllocateVirtualMemory"); + pNtFreeVirtualMemory = (void *)GetProcAddress(hntdll, "NtFreeVirtualMemory"); pNtWaitForMultipleObjects = (void *)GetProcAddress(hntdll, "NtWaitForMultipleObjects"); + argc = winetest_get_mainargs( &argv ); + if (argc >= 3) + { + if (!strcmp(argv[2], "apc_deadlock")) + { + HANDLE handle = GetCurrentThread(); + for (;;) WaitForMultipleObjectsEx(1, &handle, FALSE, INFINITE, TRUE); + } + return; + } + test_signalandwait(); test_mutex(); test_slist(); @@ -2355,4 +2554,6 @@ test_condvars_consumer_producer(); test_srwlock_base(); test_srwlock_example(); + test_alertable_wait(); + test_apc_deadlock(); } diff -Nru wine1.7-1.7.50/dlls/kernel32/tests/thread.c wine1.7-1.7.55/dlls/kernel32/tests/thread.c --- wine1.7-1.7.50/dlls/kernel32/tests/thread.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/tests/thread.c 2015-11-13 14:32:40.000000000 +0000 @@ -99,6 +99,9 @@ static void (WINAPI *pWaitForThreadpoolWorkCallbacks)(PTP_WORK,BOOL); static void (WINAPI *pCloseThreadpoolWork)(PTP_WORK); static NTSTATUS (WINAPI *pNtQueryInformationThread)(HANDLE,THREADINFOCLASS,PVOID,ULONG,PULONG); +static BOOL (WINAPI *pGetThreadGroupAffinity)(HANDLE,GROUP_AFFINITY*); +static BOOL (WINAPI *pSetThreadGroupAffinity)(HANDLE,const GROUP_AFFINITY*,GROUP_AFFINITY*); +static NTSTATUS (WINAPI *pNtSetInformationThread)(HANDLE,THREADINFOCLASS,LPCVOID,ULONG); static HANDLE create_target_process(const char *arg) { @@ -224,9 +227,8 @@ /* Double check that all threads really did run by validating that they have all written to the shared memory. There should be no race here, since all threads were synchronized after the write.*/ - for(i=0;ithreadmem[i]==0) ; - } + for (i = 0; i < NUM_THREADS; i++) + ok(tstruct->threadmem[i] != 0, "expected threadmem[%d] != 0\n", i); /* lstrlenA contains an exception handler so this makes sure exceptions work in threads */ ok( lstrlenA( (char *)0xdeadbeef ) == 0, "lstrlenA: unexpected success\n" ); @@ -877,6 +879,15 @@ retMask = SetThreadAffinityMask(curthread,~0); ok(broken(retMask==0) || retMask==processMask, "SetThreadAffinityMask(thread,-1) failed to request all processors.\n"); + + if (retMask == processMask) + { + /* Show that the "all processors" flag is handled in ntdll */ + DWORD_PTR mask = ~0u; + NTSTATUS status = pNtSetInformationThread(curthread, ThreadAffinityMask, &mask, sizeof(mask)); + ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS in NtSetInformationThread, got %x\n", status); + } + if (retMask == processMask && sizeof(ULONG_PTR) > sizeof(ULONG)) { /* only the low 32-bits matter */ @@ -886,41 +897,99 @@ ok(retMask == processMask, "SetThreadAffinityMask failed\n"); } /* NOTE: This only works on WinNT/2000/XP) */ - if (pSetThreadIdealProcessor) { - SetLastError(0xdeadbeef); - error=pSetThreadIdealProcessor(curthread,0); - if (GetLastError()==ERROR_CALL_NOT_IMPLEMENTED) - { - win_skip("SetThreadIdealProcessor is not implemented\n"); - return; - } - ok(error!=-1, "SetThreadIdealProcessor failed\n"); + if (pSetThreadIdealProcessor) + { + SetLastError(0xdeadbeef); + error=pSetThreadIdealProcessor(curthread,0); + if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED) + { + ok(error!=-1, "SetThreadIdealProcessor failed\n"); - if (is_wow64) - { - SetLastError(0xdeadbeef); - error=pSetThreadIdealProcessor(curthread,MAXIMUM_PROCESSORS+1); - todo_wine - ok(error!=-1, "SetThreadIdealProcessor failed for %u on Wow64\n", MAXIMUM_PROCESSORS+1); - - SetLastError(0xdeadbeef); - error=pSetThreadIdealProcessor(curthread,65); - ok(error==-1, "SetThreadIdealProcessor succeeded with an illegal processor #\n"); - ok(GetLastError()==ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); - } - else - { - SetLastError(0xdeadbeef); - error=pSetThreadIdealProcessor(curthread,MAXIMUM_PROCESSORS+1); - ok(error==-1, "SetThreadIdealProcessor succeeded with an illegal processor #\n"); - ok(GetLastError()==ERROR_INVALID_PARAMETER, - "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); - } + if (is_wow64) + { + SetLastError(0xdeadbeef); + error=pSetThreadIdealProcessor(curthread,MAXIMUM_PROCESSORS+1); + todo_wine + ok(error!=-1, "SetThreadIdealProcessor failed for %u on Wow64\n", MAXIMUM_PROCESSORS+1); + + SetLastError(0xdeadbeef); + error=pSetThreadIdealProcessor(curthread,65); + ok(error==-1, "SetThreadIdealProcessor succeeded with an illegal processor #\n"); + ok(GetLastError()==ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + } + else + { + SetLastError(0xdeadbeef); + error=pSetThreadIdealProcessor(curthread,MAXIMUM_PROCESSORS+1); + ok(error==-1, "SetThreadIdealProcessor succeeded with an illegal processor #\n"); + ok(GetLastError()==ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + } - error=pSetThreadIdealProcessor(curthread,MAXIMUM_PROCESSORS); - ok(error!=-1, "SetThreadIdealProcessor failed\n"); - } + error=pSetThreadIdealProcessor(curthread,MAXIMUM_PROCESSORS); + ok(error!=-1, "SetThreadIdealProcessor failed\n"); + } + else + win_skip("SetThreadIdealProcessor is not implemented\n"); + } + + if (pGetThreadGroupAffinity && pSetThreadGroupAffinity) + { + GROUP_AFFINITY affinity, affinity_new; + NTSTATUS status; + + memset(&affinity, 0, sizeof(affinity)); + ok(pGetThreadGroupAffinity(curthread, &affinity), "GetThreadGroupAffinity failed\n"); + + SetLastError(0xdeadbeef); + ok(!pGetThreadGroupAffinity(curthread, NULL), "GetThreadGroupAffinity succeeded\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER || broken(GetLastError() == ERROR_NOACCESS), /* Win 7 and 8 */ + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + ok(affinity.Group == 0, "Expected group 0 got %u\n", affinity.Group); + + memset(&affinity_new, 0, sizeof(affinity_new)); + affinity_new.Group = 0; + affinity_new.Mask = affinity.Mask; + ok(pSetThreadGroupAffinity(curthread, &affinity_new, &affinity), "SetThreadGroupAffinity failed\n"); + ok(affinity_new.Mask == affinity.Mask, "Expected old affinity mask %lx, got %lx\n", + affinity_new.Mask, affinity.Mask); + + /* show that the "all processors" flag is not supported for SetThreadGroupAffinity */ + affinity_new.Group = 0; + affinity_new.Mask = ~0u; + SetLastError(0xdeadbeef); + ok(!pSetThreadGroupAffinity(curthread, &affinity_new, NULL), "SetThreadGroupAffinity succeeded\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + + affinity_new.Group = 1; /* assumes that you have less than 64 logical processors */ + affinity_new.Mask = 0x1; + SetLastError(0xdeadbeef); + ok(!pSetThreadGroupAffinity(curthread, &affinity_new, NULL), "SetThreadGroupAffinity succeeded\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + ok(!pSetThreadGroupAffinity(curthread, NULL, NULL), "SetThreadGroupAffinity succeeded\n"); + ok(GetLastError() == ERROR_NOACCESS, + "Expected ERROR_NOACCESS, got %d\n", GetLastError()); + + /* show that the access violation was detected in ntdll */ + status = pNtSetInformationThread(curthread, ThreadGroupInformation, NULL, sizeof(affinity_new)); + ok(status == STATUS_ACCESS_VIOLATION, + "Expected STATUS_ACCESS_VIOLATION, got %08x\n", status); + + /* restore original mask */ + affinity_new.Group = 0; + affinity_new.Mask = affinity.Mask; + SetLastError(0xdeadbeef); + ok(pSetThreadGroupAffinity(curthread, &affinity_new, &affinity), "SetThreadGroupAffinity failed\n"); + ok(affinity_new.Mask == affinity.Mask, "Expected old affinity mask %lx, got %lx\n", + affinity_new.Mask, affinity.Mask); + } + else + win_skip("Get/SetThreadGroupAffinity not available\n"); } static VOID test_GetThreadExitCode(void) @@ -1408,16 +1477,25 @@ pSetThreadErrorMode(oldmode, NULL); } -#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) +#if (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) || (defined(_MSC_VER) && defined(__i386__)) static inline void set_fpu_cw(WORD cw) { +#ifdef _MSC_VER + __asm { fnclex } + __asm { fldcw [cw] } +#else __asm__ volatile ("fnclex; fldcw %0" : : "m" (cw)); +#endif } static inline WORD get_fpu_cw(void) { WORD cw = 0; +#ifdef _MSC_VER + __asm { fnstcw [cw] } +#else __asm__ volatile ("fnstcw %0" : "=m" (cw)); +#endif return cw; } @@ -1716,7 +1794,7 @@ /* FIXME: Add remaining classes */ }; HANDLE thread; - ULONG i, status, ret_len, size; + ULONG i, status, ret_len; if (!pOpenThread) { @@ -1739,8 +1817,19 @@ for (i = 0; i < sizeof(info_size)/sizeof(info_size[0]); i++) { - size = info_size[i]; - if (!size) size = sizeof(buf); + memset(buf, 0, sizeof(buf)); + +#ifdef __i386__ + if (i == ThreadDescriptorTableEntry) + { + CONTEXT ctx; + THREAD_DESCRIPTOR_INFORMATION *tdi = (void *)buf; + + ctx.ContextFlags = CONTEXT_SEGMENTS; + GetThreadContext(GetCurrentThread(), &ctx); + tdi->Selector = ctx.SegDs; + } +#endif ret_len = 0; status = pNtQueryInformationThread(thread, i, buf, info_size[i], &ret_len); if (status == STATUS_NOT_IMPLEMENTED) continue; @@ -1755,12 +1844,18 @@ ok(status == STATUS_SUCCESS, "for info %u expected STATUS_SUCCESS, got %08x (ret_len %u)\n", i, status, ret_len); break; +#ifdef __i386__ + case ThreadDescriptorTableEntry: + ok(status == STATUS_SUCCESS || broken(status == STATUS_ACCESS_DENIED) /* testbot VM is broken */, + "for info %u expected STATUS_SUCCESS, got %08x (ret_len %u)\n", i, status, ret_len); + break; +#endif + case ThreadTimes: todo_wine ok(status == STATUS_SUCCESS, "for info %u expected STATUS_SUCCESS, got %08x (ret_len %u)\n", i, status, ret_len); break; - case ThreadDescriptorTableEntry: case ThreadAffinityMask: case ThreadQuerySetWin32StartAddress: todo_wine @@ -1807,6 +1902,9 @@ X(SubmitThreadpoolWork); X(WaitForThreadpoolWorkCallbacks); X(CloseThreadpoolWork); + + X(GetThreadGroupAffinity); + X(SetThreadGroupAffinity); #undef X #define X(f) p##f = (void*)GetProcAddress(ntdll, #f) @@ -1814,6 +1912,7 @@ { X(NtQueryInformationThread); X(RtlGetThreadErrorMode); + X(NtSetInformationThread); } #undef X } @@ -1871,7 +1970,7 @@ test_RegisterWaitForSingleObject(); test_TLS(); test_ThreadErrorMode(); -#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) +#if (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) || (defined(_MSC_VER) && defined(__i386__)) test_thread_fpu_cw(); #endif test_thread_actctx(); diff -Nru wine1.7-1.7.50/dlls/kernel32/tests/time.c wine1.7-1.7.55/dlls/kernel32/tests/time.c --- wine1.7-1.7.50/dlls/kernel32/tests/time.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/tests/time.c 2015-11-13 14:32:40.000000000 +0000 @@ -851,7 +851,8 @@ sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) * sbi.NumberOfProcessors); ok( !NtQuerySystemInformation( SystemProcessorPerformanceInformation, sppi, - sizeof(*sppi), &ReturnLength), + sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) * sbi.NumberOfProcessors, + &ReturnLength), "NtQuerySystemInformation failed\n" ); for (i = 0; i < sbi.NumberOfProcessors; i++) diff -Nru wine1.7-1.7.50/dlls/kernel32/tests/toolhelp.c wine1.7-1.7.55/dlls/kernel32/tests/toolhelp.c --- wine1.7-1.7.50/dlls/kernel32/tests/toolhelp.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/tests/toolhelp.c 2015-11-13 14:32:40.000000000 +0000 @@ -175,8 +175,8 @@ num++; } while (pThread32Next( hSnapshot, &te )); } - ok(curr_found == 1, "couldn't find self in thread list\n"); - ok(sub_found == 2, "couldn't find sub-process thread's in thread list\n"); + ok(curr_found, "couldn't find self in thread list\n"); + ok(sub_found >= 2, "couldn't find sub-process threads in thread list\n"); /* check that first really resets enumeration */ curr_found = 0; @@ -192,8 +192,8 @@ num--; } while (pThread32Next( hSnapshot, &te )); } - ok(curr_found == 1, "couldn't find self in thread list\n"); - ok(sub_found == 2, "couldn't find sub-process thread's in thread list\n"); + ok(curr_found, "couldn't find self in thread list\n"); + ok(sub_found >= 2, "couldn't find sub-process threads in thread list\n"); me.dwSize = sizeof(me); ok(!pModule32First( hSnapshot, &me ), "shouldn't return a module\n"); diff -Nru wine1.7-1.7.50/dlls/kernel32/tests/virtual.c wine1.7-1.7.55/dlls/kernel32/tests/virtual.c --- wine1.7-1.7.50/dlls/kernel32/tests/virtual.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/tests/virtual.c 2015-11-13 14:32:40.000000000 +0000 @@ -1436,12 +1436,17 @@ static void test_write_watch(void) { - char *base; - DWORD ret, size, old_prot; + static const char pipename[] = "\\\\.\\pipe\\test_write_watch_pipe"; + static const char testdata[] = "Hello World"; + DWORD ret, size, old_prot, num_bytes; MEMORY_BASIC_INFORMATION info; + HANDLE readpipe, writepipe; + OVERLAPPED overlapped; void *results[64]; ULONG_PTR count; ULONG pagesize; + BOOL success; + char *base; if (!pGetWriteWatch || !pResetWriteWatch) { @@ -1589,6 +1594,64 @@ ok( info.State == MEM_COMMIT, "wrong State 0x%x\n", info.State ); ok( info.Protect == PAGE_READWRITE, "wrong Protect 0x%x\n", info.Protect ); + /* ReadFile should trigger write watches */ + + memset( &overlapped, 0, sizeof(overlapped) ); + overlapped.hEvent = CreateEventA( NULL, TRUE, FALSE, NULL ); + + readpipe = CreateNamedPipeA( pipename, FILE_FLAG_OVERLAPPED | PIPE_ACCESS_INBOUND, + PIPE_TYPE_BYTE | PIPE_WAIT, 1, 1024, 1024, + NMPWAIT_USE_DEFAULT_WAIT, NULL ); + ok( readpipe != INVALID_HANDLE_VALUE, "CreateNamedPipeA failed %u\n", GetLastError() ); + + success = ConnectNamedPipe( readpipe, &overlapped ); + ok( !success, "ConnectNamedPipe unexpectedly succeeded\n" ); + ok( GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %u\n", GetLastError() ); + + writepipe = CreateFileA( pipename, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL ); + ok( writepipe != INVALID_HANDLE_VALUE, "CreateFileA failed %u\n", GetLastError() ); + + ret = WaitForSingleObject( overlapped.hEvent, 1000 ); + ok( ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", ret ); + + memset( base, 0, size ); + + count = 64; + ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); + ok( count == 16, "wrong count %lu\n", count ); + + success = ReadFile( readpipe, base, size, NULL, &overlapped ); + ok( !success, "ReadFile unexpectedly succeeded\n" ); + ok( GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %u\n", GetLastError() ); + + count = 64; + ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); + ok( count == 16, "wrong count %lu\n", count ); + + num_bytes = 0; + success = WriteFile( writepipe, testdata, sizeof(testdata), &num_bytes, NULL ); + ok( success, "WriteFile failed %u\n", GetLastError() ); + ok( num_bytes == sizeof(testdata), "wrong number of bytes written\n" ); + + num_bytes = 0; + success = GetOverlappedResult( readpipe, &overlapped, &num_bytes, TRUE ); + todo_wine ok( success, "GetOverlappedResult failed %u\n", GetLastError() ); + todo_wine ok( num_bytes == sizeof(testdata), "wrong number of bytes read\n" ); + todo_wine ok( !memcmp( base, testdata, sizeof(testdata)), "didn't receive expected data\n" ); + + count = 64; + memset( results, 0, sizeof(results) ); + ret = pGetWriteWatch( WRITE_WATCH_FLAG_RESET, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); + todo_wine ok( count == 1, "wrong count %lu\n", count ); + todo_wine ok( results[0] == base, "wrong result %p\n", results[0] ); + + CloseHandle( readpipe ); + CloseHandle( writepipe ); + CloseHandle( overlapped.hEvent ); + /* some invalid parameter tests */ SetLastError( 0xdeadbeef ); diff -Nru wine1.7-1.7.50/dlls/kernel32/thread.c wine1.7-1.7.55/dlls/kernel32/thread.c --- wine1.7-1.7.50/dlls/kernel32/thread.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/thread.c 2015-11-13 14:32:40.000000000 +0000 @@ -378,6 +378,52 @@ return TRUE; } +/*********************************************************************** + * GetThreadGroupAffinity (KERNEL32.@) + */ +BOOL WINAPI GetThreadGroupAffinity( HANDLE thread, GROUP_AFFINITY *affinity ) +{ + NTSTATUS status; + + if (!affinity) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return FALSE; + } + + status = NtQueryInformationThread( thread, ThreadGroupInformation, + affinity, sizeof(*affinity), NULL ); + if (status) + { + SetLastError( RtlNtStatusToDosError(status) ); + return FALSE; + } + + return TRUE; +} + +/*********************************************************************** + * SetThreadGroupAffinity (KERNEL32.@) + */ +BOOL WINAPI SetThreadGroupAffinity( HANDLE thread, const GROUP_AFFINITY *affinity_new, + GROUP_AFFINITY *affinity_old ) +{ + NTSTATUS status; + + if (affinity_old && !GetThreadGroupAffinity( thread, affinity_old )) + return FALSE; + + status = NtSetInformationThread( thread, ThreadGroupInformation, + affinity_new, sizeof(*affinity_new) ); + if (status) + { + SetLastError( RtlNtStatusToDosError(status) ); + return FALSE; + } + + return TRUE; +} + /********************************************************************** * SetThreadAffinityMask (KERNEL32.@) */ diff -Nru wine1.7-1.7.50/dlls/kernel32/volume.c wine1.7-1.7.55/dlls/kernel32/volume.c --- wine1.7-1.7.50/dlls/kernel32/volume.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/kernel32/volume.c 2015-11-13 14:32:40.000000000 +0000 @@ -171,7 +171,7 @@ attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; - status = NtOpenFile( handle, 0, &attr, &io, 0, + status = NtOpenFile( handle, SYNCHRONIZE, &attr, &io, 0, FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT ); RtlFreeUnicodeString( &nt_name ); if (status != STATUS_SUCCESS) @@ -235,7 +235,7 @@ memcpy( name.Buffer, device->Buffer, device->Length ); memcpy( name.Buffer + device->Length / sizeof(WCHAR), labelW, sizeof(labelW) ); - if (!NtOpenFile( &handle, GENERIC_READ, &attr, &io, FILE_SHARE_READ|FILE_SHARE_WRITE, + if (!NtOpenFile( &handle, GENERIC_READ | SYNCHRONIZE, &attr, &io, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT )) { char buffer[256], *p; @@ -275,7 +275,7 @@ memcpy( name.Buffer, device->Buffer, device->Length ); memcpy( name.Buffer + device->Length / sizeof(WCHAR), serialW, sizeof(serialW) ); - if (!NtOpenFile( &handle, GENERIC_READ, &attr, &io, FILE_SHARE_READ|FILE_SHARE_WRITE, + if (!NtOpenFile( &handle, GENERIC_READ | SYNCHRONIZE, &attr, &io, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_SYNCHRONOUS_IO_NONALERT )) { char buffer[32]; @@ -765,7 +765,7 @@ attr.SecurityQualityOfService = NULL; nt_name.Length -= sizeof(WCHAR); /* without trailing slash */ - status = NtOpenFile( &handle, GENERIC_READ, &attr, &io, FILE_SHARE_READ | FILE_SHARE_WRITE, + status = NtOpenFile( &handle, GENERIC_READ | SYNCHRONIZE, &attr, &io, FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT ); nt_name.Length += sizeof(WCHAR); @@ -811,7 +811,7 @@ /* we couldn't open the device, fallback to default strategy */ - status = NtOpenFile( &handle, 0, &attr, &io, 0, FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT ); + status = NtOpenFile( &handle, SYNCHRONIZE, &attr, &io, 0, FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT ); if (status != STATUS_SUCCESS) { SetLastError( RtlNtStatusToDosError(status) ); diff -Nru wine1.7-1.7.50/dlls/krnl386.exe16/dma.c wine1.7-1.7.55/dlls/krnl386.exe16/dma.c --- wine1.7-1.7.50/dlls/krnl386.exe16/dma.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/krnl386.exe16/dma.c 2015-11-13 14:32:40.000000000 +0000 @@ -342,31 +342,31 @@ channel = ((port-1)&0xC0)?(((port-1)-0xC0)>>2):(port>>1); dmachip = (channel<4) ? 0 : 1; if (!DMA_Toggle[dmachip]) - res = DMA_CurrentByteCount[channel] & 0xFF; + res = DMA_CurrentByteCount[channel]; else { - res = (DMA_CurrentByteCount[channel] & (0xFF << 8))>>8; + res = DMA_CurrentByteCount[channel] >> 8; TRACE("Read Current Count = %x.\n",DMA_CurrentByteCount[channel]); } DMA_Toggle[dmachip] = !DMA_Toggle[dmachip]; break; /* Low Page Base Address */ - case 0x87: res = (DMA_BaseAddress[0]&(0xFF<<16))>>16; break; - case 0x83: res = (DMA_BaseAddress[1]&(0xFF<<16))>>16; break; - case 0x81: res = (DMA_BaseAddress[2]&(0xFF<<16))>>16; break; - case 0x82: res = (DMA_BaseAddress[3]&(0xFF<<16))>>16; break; - case 0x8B: res = (DMA_BaseAddress[5]&(0xFF<<16))>>16; break; - case 0x89: res = (DMA_BaseAddress[6]&(0xFF<<16))>>16; break; - case 0x8A: res = (DMA_BaseAddress[7]&(0xFF<<16))>>16; break; + case 0x87: res = DMA_BaseAddress[0] >> 16; break; + case 0x83: res = DMA_BaseAddress[1] >> 16; break; + case 0x81: res = DMA_BaseAddress[2] >> 16; break; + case 0x82: res = DMA_BaseAddress[3] >> 16; break; + case 0x8B: res = DMA_BaseAddress[5] >> 16; break; + case 0x89: res = DMA_BaseAddress[6] >> 16; break; + case 0x8A: res = DMA_BaseAddress[7] >> 16; break; /* High Page Base Address */ - case 0x487: res = (DMA_BaseAddress[0]&(0xFF<<24))>>24; break; - case 0x483: res = (DMA_BaseAddress[1]&(0xFF<<24))>>24; break; - case 0x481: res = (DMA_BaseAddress[2]&(0xFF<<24))>>24; break; - case 0x482: res = (DMA_BaseAddress[3]&(0xFF<<24))>>24; break; - case 0x48B: res = (DMA_BaseAddress[5]&(0xFF<<24))>>24; break; - case 0x489: res = (DMA_BaseAddress[6]&(0xFF<<24))>>24; break; - case 0x48A: res = (DMA_BaseAddress[7]&(0xFF<<24))>>24; break; + case 0x487: res = DMA_BaseAddress[0] >> 24; break; + case 0x483: res = DMA_BaseAddress[1] >> 24; break; + case 0x481: res = DMA_BaseAddress[2] >> 24; break; + case 0x482: res = DMA_BaseAddress[3] >> 24; break; + case 0x48B: res = DMA_BaseAddress[5] >> 24; break; + case 0x489: res = DMA_BaseAddress[6] >> 24; break; + case 0x48A: res = DMA_BaseAddress[7] >> 24; break; case 0x08: case 0xD0: diff -Nru wine1.7-1.7.50/dlls/krnl386.exe16/int21.c wine1.7-1.7.55/dlls/krnl386.exe16/int21.c --- wine1.7-1.7.50/dlls/krnl386.exe16/int21.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/krnl386.exe16/int21.c 2015-11-13 14:32:40.000000000 +0000 @@ -872,7 +872,7 @@ attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; - status = NtCreateFile( &ret, GENERIC_READ|GENERIC_WRITE, &attr, &io, NULL, 0, + status = NtCreateFile( &ret, GENERIC_READ|GENERIC_WRITE|SYNCHRONIZE, &attr, &io, NULL, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN_IF, FILE_SYNCHRONOUS_IO_ALERT, NULL, 0 ); if (status) diff -Nru wine1.7-1.7.50/dlls/krnl386.exe16/resource.c wine1.7-1.7.55/dlls/krnl386.exe16/resource.c --- wine1.7-1.7.50/dlls/krnl386.exe16/resource.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/krnl386.exe16/resource.c 2015-11-13 14:32:40.000000000 +0000 @@ -596,24 +596,24 @@ p = (const DWORD *)p + 1; /* exStyle */ nbItems = get_word(&p); - p = (const DWORD *)p + 1; /* x */ - p = (const DWORD *)p + 1; /* y */ - p = (const DWORD *)p + 1; /* cx */ - p = (const DWORD *)p + 1; /* cy */ + p = (const WORD *)p + 1; /* x */ + p = (const WORD *)p + 1; /* y */ + p = (const WORD *)p + 1; /* cx */ + p = (const WORD *)p + 1; /* cy */ /* Skip menu name */ - switch (*(const DWORD *)p) + switch (*(const WORD *)p) { - case 0x0000: p = (const DWORD *)p + 1; break; - case 0xffff: p = (const DWORD *)p + 2; break; + case 0x0000: p = (const WORD *)p + 1; break; + case 0xffff: p = (const WORD *)p + 2; break; default: p = (LPCWSTR)p + strlenW( p ) + 1; break; } /* Skip class name */ - switch (*(const DWORD *)p) + switch (*(const WORD *)p) { - case 0x0000: p = (const DWORD *)p + 1; break; - case 0xffff: p = (const DWORD *)p + 2; break; + case 0x0000: p = (const WORD *)p + 1; break; + case 0xffff: p = (const WORD *)p + 2; break; default: p = (LPCWSTR)p + strlenW( p ) + 1; break; } @@ -623,11 +623,11 @@ /* Skip font info */ if (style & DS_SETFONT) { - p = (const DWORD *)p + 1; /* pointSize */ + p = (const WORD *)p + 1; /* pointSize */ if (dialogEx) { - p = (const DWORD *)p + 1; /* weight */ - p = (const DWORD *)p + 1; /* italic */ + p = (const WORD *)p + 1; /* weight */ + p = (const WORD *)p + 1; /* italic */ } p = (LPCWSTR)p + strlenW( p ) + 1; /* faceName */ } @@ -650,29 +650,29 @@ p = (const DWORD *)p + 1; /* exStyle */ } - p = (const DWORD *)p + 1; /* x */ - p = (const DWORD *)p + 1; /* y */ - p = (const DWORD *)p + 1; /* cx */ - p = (const DWORD *)p + 1; /* cy */ + p = (const WORD *)p + 1; /* x */ + p = (const WORD *)p + 1; /* y */ + p = (const WORD *)p + 1; /* cx */ + p = (const WORD *)p + 1; /* cy */ if (dialogEx) p = (const DWORD *)p + 1; /* ID */ else - p = (const DWORD *)p + 1; /* ID */ + p = (const WORD *)p + 1; /* ID */ /* Skip class name */ - switch (*(const DWORD *)p) + switch (*(const WORD *)p) { - case 0x0000: p = (const DWORD *)p + 1; break; - case 0xffff: p = (const DWORD *)p + 2; break; + case 0x0000: p = (const WORD *)p + 1; break; + case 0xffff: p = (const WORD *)p + 2; break; default: p = (LPCWSTR)p + strlenW( p ) + 1; break; } /* Skip window name */ - switch (*(const DWORD *)p) + switch (*(const WORD *)p) { - case 0x0000: p = (const DWORD *)p + 1; break; - case 0xffff: p = (const DWORD *)p + 2; break; + case 0x0000: p = (const WORD *)p + 1; break; + case 0xffff: p = (const WORD *)p + 2; break; default: p = (LPCWSTR)p + strlenW( p ) + 1; break; } diff -Nru wine1.7-1.7.50/dlls/krnl386.exe16/vxd.c wine1.7-1.7.55/dlls/krnl386.exe16/vxd.c --- wine1.7-1.7.50/dlls/krnl386.exe16/vxd.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/krnl386.exe16/vxd.c 2015-11-13 14:32:40.000000000 +0000 @@ -143,7 +143,7 @@ attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; - status = NtCreateFile( &ret, 0, &attr, &io, NULL, 0, + status = NtCreateFile( &ret, SYNCHRONIZE, &attr, &io, NULL, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN_IF, FILE_SYNCHRONOUS_IO_ALERT, NULL, 0 ); if (status) diff -Nru wine1.7-1.7.50/dlls/mciavi32/mciavi.c wine1.7-1.7.55/dlls/mciavi32/mciavi.c --- wine1.7-1.7.50/dlls/mciavi32/mciavi.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/mciavi32/mciavi.c 2015-11-13 14:32:40.000000000 +0000 @@ -393,8 +393,8 @@ { while(next_frame_us <= tc && wma->dwCurrVideoFrame < wma->dwToVideoFrame){ double dur; - ++wma->dwCurrVideoFrame; dur = MCIAVI_PaintFrame(wma, hDC); + ++wma->dwCurrVideoFrame; if(!dur) break; next_frame_us += dur; @@ -402,14 +402,19 @@ } ReleaseDC(wma->hWndPaint, hDC); } - if(wma->dwCurrVideoFrame >= wma->dwToVideoFrame) - break; + if (wma->dwCurrVideoFrame >= wma->dwToVideoFrame) + { + if (!(dwFlags & MCI_DGV_PLAY_REPEAT)) + break; + TRACE("repeat media as requested\n"); + wma->dwCurrVideoFrame = wma->dwCurrAudioBlock = 0; + } if (wma->lpWaveFormat) MCIAVI_PlayAudioBlocks(wma, nHdr, waveHdr); tc = currenttime_us(); - if(tc < next_frame_us) + if (tc < next_frame_us) delta = next_frame_us - tc; else delta = 0; @@ -532,7 +537,7 @@ if (dwFlags & MCI_DGV_PLAY_REVERSE) return MCIERR_UNSUPPORTED_FUNCTION; if (dwFlags & MCI_TEST) return 0; - if (dwFlags & (MCI_DGV_PLAY_REPEAT|MCI_MCIAVI_PLAY_WINDOW|MCI_MCIAVI_PLAY_FULLSCREEN|MCI_MCIAVI_PLAY_FULLBY2)) + if (dwFlags & (MCI_MCIAVI_PLAY_WINDOW|MCI_MCIAVI_PLAY_FULLSCREEN|MCI_MCIAVI_PLAY_FULLBY2)) FIXME("Unsupported flag %08x\n", dwFlags); EnterCriticalSection(&wma->cs); diff -Nru wine1.7-1.7.50/dlls/mciavi32/mmoutput.c wine1.7-1.7.55/dlls/mciavi32/mmoutput.c --- wine1.7-1.7.50/dlls/mciavi32/mmoutput.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/mciavi32/mmoutput.c 2015-11-13 14:32:40.000000000 +0000 @@ -190,8 +190,11 @@ */ twocc = TWOCCFromFOURCC(mmck->ckid); if (twocc == TWOCCFromFOURCC(wma->inbih->biCompression)) - twocc = cktypeDIBcompressed; - + twocc = cktypeDIBcompressed; + /* Also detect some chunks that seem to be used by Indeo videos where the chunk is named + * after the codec. */ + else if (twocc == LOWORD(wma->ash_video.fccHandler)) + twocc = cktypeDIBcompressed; switch (twocc) { case cktypeDIBbits: case cktypeDIBcompressed: @@ -398,8 +401,8 @@ mmioAscend(wma->hFile, &mmckInfo, 0); } if (alb.numVideoFrames != wma->dwPlayableVideoFrames) { - WARN("Found %d video frames (/%d), reducing playable frames\n", - alb.numVideoFrames, wma->dwPlayableVideoFrames); + WARN("AVI header says %d frames, we found %d video frames, reducing playable frames\n", + wma->dwPlayableVideoFrames, alb.numVideoFrames); wma->dwPlayableVideoFrames = alb.numVideoFrames; } wma->dwPlayableAudioBlocks = alb.numAudioBlocks; diff -Nru wine1.7-1.7.50/dlls/mcicda/mcicda.c wine1.7-1.7.55/dlls/mcicda/mcicda.c --- wine1.7-1.7.50/dlls/mcicda/mcicda.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/mcicda/mcicda.c 2015-11-13 14:32:40.000000000 +0000 @@ -79,6 +79,31 @@ typedef HRESULT(WINAPI*LPDIRECTSOUNDCREATE)(LPCGUID,LPDIRECTSOUND*,LPUNKNOWN); static LPDIRECTSOUNDCREATE pDirectSoundCreate; +static BOOL device_io(HANDLE dev, DWORD code, void *inbuffer, DWORD insize, void *outbuffer, DWORD outsize, DWORD *retsize, OVERLAPPED *overlapped) +{ + const char *str; + BOOL ret = DeviceIoControl(dev, code, inbuffer, insize, outbuffer, outsize, retsize, overlapped); + +#define XX(x) case (x): str = #x; break + switch (code) + { + XX(IOCTL_CDROM_RAW_READ); + XX(IOCTL_CDROM_READ_TOC); + XX(IOCTL_CDROM_READ_Q_CHANNEL); + XX(IOCTL_CDROM_SEEK_AUDIO_MSF); + XX(IOCTL_CDROM_PLAY_AUDIO_MSF); + XX(IOCTL_CDROM_STOP_AUDIO); + XX(IOCTL_CDROM_PAUSE_AUDIO); + XX(IOCTL_CDROM_RESUME_AUDIO); + XX(IOCTL_STORAGE_EJECT_MEDIA); + XX(IOCTL_STORAGE_LOAD_MEDIA); + default: str = wine_dbg_sprintf("UNKNOWN (0x%x)", code); + }; +#undef XX + TRACE("Device %p, Code %s -> Return %d, Bytes %u\n", dev, str, ret, *retsize); + return ret; +} + static DWORD CALLBACK MCICDA_playLoop(void *ptr) { WINE_MCICDAUDIO *wmcda = (WINE_MCICDAUDIO*)ptr; @@ -121,7 +146,7 @@ if (SUCCEEDED(hr)) { if (rdInfo.SectorCount > 0) { - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_RAW_READ, &rdInfo, sizeof(rdInfo), cdData, lockLen, &br, NULL)) + if (!device_io(wmcda->handle, IOCTL_CDROM_RAW_READ, &rdInfo, sizeof(rdInfo), cdData, lockLen, &br, NULL)) WARN("CD read failed at sector %d: 0x%x\n", wmcda->start, GetLastError()); } if (rdInfo.SectorCount*RAW_SECTOR_SIZE < lockLen) { @@ -254,7 +279,7 @@ mode = MCI_MODE_PLAY; } } - else if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_Q_CHANNEL, &fmt, sizeof(fmt), + else if (!device_io(wmcda->handle, IOCTL_CDROM_READ_Q_CHANNEL, &fmt, sizeof(fmt), &data, sizeof(data), &br, NULL)) { if (GetLastError() == ERROR_NOT_READY) mode = MCI_MODE_OPEN; } else { @@ -317,7 +342,7 @@ case MCI_FORMAT_TMSF: default: /* unknown format ! force TMSF ! ... */ wTrack = MCI_TMSF_TRACK(dwTime); - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, + if (!device_io(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL)) return 0; if (wTrack < toc.FirstTrack || wTrack > toc.LastTrack) @@ -368,7 +393,7 @@ break; case MCI_FORMAT_TMSF: default: /* unknown format ! force TMSF ! ... */ - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, + if (!device_io(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL)) return 0; if (dwFrame < FRAME_OF_TOC(toc, toc.FirstTrack) || @@ -640,7 +665,7 @@ DWORD br; static const WCHAR wszLu[] = {'%','l','u',0}; - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, + if (!device_io(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL)) { return MCICDA_GetError(wmcda); } @@ -687,7 +712,7 @@ switch (lpParms->dwItem) { case MCI_STATUS_CURRENT_TRACK: fmt.Format = IOCTL_CDROM_CURRENT_POSITION; - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_Q_CHANNEL, &fmt, sizeof(fmt), + if (!device_io(wmcda->handle, IOCTL_CDROM_READ_Q_CHANNEL, &fmt, sizeof(fmt), &data, sizeof(data), &br, NULL)) { return MCICDA_GetError(wmcda); @@ -697,7 +722,7 @@ TRACE("CURRENT_TRACK=%lu\n", lpParms->dwReturn); break; case MCI_STATUS_LENGTH: - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, + if (!device_io(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL)) { WARN("error reading TOC !\n"); return MCICDA_GetError(wmcda); @@ -739,7 +764,7 @@ ret = MCI_RESOURCE_RETURNED; break; case MCI_STATUS_NUMBER_OF_TRACKS: - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, + if (!device_io(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL)) { WARN("error reading TOC !\n"); return MCICDA_GetError(wmcda); @@ -752,7 +777,7 @@ case MCI_STATUS_POSITION: switch (dwFlags & (MCI_STATUS_START | MCI_TRACK)) { case MCI_STATUS_START: - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, + if (!device_io(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL)) { WARN("error reading TOC !\n"); return MCICDA_GetError(wmcda); @@ -761,7 +786,7 @@ TRACE("get MCI_STATUS_START !\n"); break; case MCI_TRACK: - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, + if (!device_io(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL)) { WARN("error reading TOC !\n"); return MCICDA_GetError(wmcda); @@ -773,7 +798,7 @@ break; case 0: fmt.Format = IOCTL_CDROM_CURRENT_POSITION; - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_Q_CHANNEL, &fmt, sizeof(fmt), + if (!device_io(wmcda->handle, IOCTL_CDROM_READ_Q_CHANNEL, &fmt, sizeof(fmt), &data, sizeof(data), &br, NULL)) { return MCICDA_GetError(wmcda); } @@ -810,7 +835,7 @@ if (!(dwFlags & MCI_TRACK)) ret = MCIERR_MISSING_PARAMETER; else { - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, + if (!device_io(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL)) { WARN("error reading TOC !\n"); return MCICDA_GetError(wmcda); @@ -842,7 +867,7 @@ int i; DWORD br; CDROM_TOC toc; - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, + if (!device_io(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL)) { WARN("error reading TOC !\n"); return MCICDA_GetError(wmcda); @@ -889,7 +914,7 @@ if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID; - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, + if (!device_io(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL)) { WARN("error reading TOC !\n"); return MCICDA_GetError(wmcda); @@ -902,7 +927,7 @@ TRACE("MCI_FROM=%08X -> %u\n", lpParms->dwFrom, start); } else { fmt.Format = IOCTL_CDROM_CURRENT_POSITION; - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_Q_CHANNEL, &fmt, sizeof(fmt), + if (!device_io(wmcda->handle, IOCTL_CDROM_READ_Q_CHANNEL, &fmt, sizeof(fmt), &data, sizeof(data), &br, NULL)) { return MCICDA_GetError(wmcda); } @@ -994,7 +1019,7 @@ wmcda->end-wmcda->start); rdInfo.TrackMode = CDDA; - readok = DeviceIoControl(wmcda->handle, IOCTL_CDROM_RAW_READ, + readok = device_io(wmcda->handle, IOCTL_CDROM_RAW_READ, &rdInfo, sizeof(rdInfo), cdData, lockLen, &br, NULL); IDirectSoundBuffer_Unlock(wmcda->dsBuf, cdData, lockLen, NULL, 0); @@ -1044,7 +1069,7 @@ play.EndingM = end / CDFRAMES_PERMIN; play.EndingS = (end / CDFRAMES_PERSEC) % 60; play.EndingF = end % CDFRAMES_PERSEC; - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_PLAY_AUDIO_MSF, &play, sizeof(play), + if (!device_io(wmcda->handle, IOCTL_CDROM_PLAY_AUDIO_MSF, &play, sizeof(play), NULL, 0, &br, NULL)) { wmcda->hCallback = NULL; ret = MCIERR_HARDWARE; @@ -1084,7 +1109,7 @@ IDirectSound_Release(wmcda->dsObj); wmcda->dsObj = NULL; } - else if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_STOP_AUDIO, NULL, 0, NULL, 0, &br, NULL)) + else if (!device_io(wmcda->handle, IOCTL_CDROM_STOP_AUDIO, NULL, 0, NULL, 0, &br, NULL)) return MCIERR_HARDWARE; if ((dwFlags & MCI_NOTIFY) && lpParms) @@ -1114,7 +1139,7 @@ FAILED(IDirectSoundBuffer_Stop(wmcda->dsBuf))) return MCIERR_HARDWARE; } - else if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_PAUSE_AUDIO, NULL, 0, NULL, 0, &br, NULL)) + else if (!device_io(wmcda->handle, IOCTL_CDROM_PAUSE_AUDIO, NULL, 0, NULL, 0, &br, NULL)) return MCIERR_HARDWARE; if ((dwFlags & MCI_NOTIFY) && lpParms) @@ -1140,7 +1165,7 @@ FAILED(IDirectSoundBuffer_Play(wmcda->dsBuf, 0, 0, DSBPLAY_LOOPING))) return MCIERR_HARDWARE; } - else if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_RESUME_AUDIO, NULL, 0, NULL, 0, &br, NULL)) + else if (!device_io(wmcda->handle, IOCTL_CDROM_RESUME_AUDIO, NULL, 0, NULL, 0, &br, NULL)) return MCIERR_HARDWARE; if ((dwFlags & MCI_NOTIFY) && lpParms) @@ -1173,7 +1198,7 @@ * then only checks the position flags, then stops and seeks. */ MCICDA_Stop(wDevID, MCI_WAIT, 0); - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, + if (!device_io(wmcda->handle, IOCTL_CDROM_READ_TOC, NULL, 0, &toc, sizeof(toc), &br, NULL)) { WARN("error reading TOC !\n"); return MCICDA_GetError(wmcda); @@ -1207,7 +1232,7 @@ seek.M = at / CDFRAMES_PERMIN; seek.S = (at / CDFRAMES_PERSEC) % 60; seek.F = at % CDFRAMES_PERSEC; - if (!DeviceIoControl(wmcda->handle, IOCTL_CDROM_SEEK_AUDIO_MSF, &seek, sizeof(seek), + if (!device_io(wmcda->handle, IOCTL_CDROM_SEEK_AUDIO_MSF, &seek, sizeof(seek), NULL, 0, &br, NULL)) return MCIERR_HARDWARE; } @@ -1229,7 +1254,7 @@ if (wmcda == NULL) return MCIERR_INVALID_DEVICE_ID; - if (!DeviceIoControl(wmcda->handle, + if (!device_io(wmcda->handle, (open) ? IOCTL_STORAGE_EJECT_MEDIA : IOCTL_STORAGE_LOAD_MEDIA, NULL, 0, NULL, 0, &br, NULL)) return MCIERR_HARDWARE; diff -Nru wine1.7-1.7.50/dlls/mfplat/mfplat.spec wine1.7-1.7.55/dlls/mfplat/mfplat.spec --- wine1.7-1.7.50/dlls/mfplat/mfplat.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/mfplat/mfplat.spec 2015-11-13 14:32:40.000000000 +0000 @@ -94,7 +94,7 @@ @ stub MFGetNumericNameFromSockaddr @ stub MFGetPlaneSize @ stub MFGetPlatform -@ stub MFGetPluginControl +@ stdcall MFGetPluginControl(ptr) @ stub MFGetPrivateWorkqueues @ stub MFGetSockaddrFromNumericName @ stub MFGetStrideForBitmapInfoHeader diff -Nru wine1.7-1.7.50/dlls/mmdevapi/main.c wine1.7-1.7.55/dlls/mmdevapi/main.c --- wine1.7-1.7.50/dlls/mmdevapi/main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/mmdevapi/main.c 2015-11-13 14:32:40.000000000 +0000 @@ -113,7 +113,7 @@ { static const WCHAR drv_value[] = {'A','u','d','i','o',0}; - static WCHAR default_list[] = {'a','l','s','a',',','o','s','s',',', + static WCHAR default_list[] = {'p','u','l','s','e',',','a','l','s','a',',','o','s','s',',', 'c','o','r','e','a','u','d','i','o',0}; DriverFuncs driver; diff -Nru wine1.7-1.7.50/dlls/mmdevapi/tests/capture.c wine1.7-1.7.55/dlls/mmdevapi/tests/capture.c --- wine1.7-1.7.50/dlls/mmdevapi/tests/capture.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/mmdevapi/tests/capture.c 2015-11-13 14:32:40.000000000 +0000 @@ -38,6 +38,9 @@ #define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER) +/* undocumented error code */ +#define D3D11_ERROR_4E MAKE_HRESULT(SEVERITY_ERROR, FACILITY_DIRECT3D11, 0x4e) + static IMMDevice *dev = NULL; static const LARGE_INTEGER ullZero; @@ -83,7 +86,7 @@ HRESULT hr; UINT32 frames, next, pad, sum = 0; BYTE *data; - DWORD flags, r; + DWORD flags; UINT64 pos, qpc; REFERENCE_TIME period; @@ -241,7 +244,11 @@ ok(hr == S_OK, "Valid IAudioCaptureClient_GetBuffer returns %08x\n", hr); ok(frames2 == frames, "GetBuffer after ReleaseBuffer(0) %u/%u\n", frames2, frames); ok(pos2 == pos, "Position after ReleaseBuffer(0) %u/%u\n", (UINT)pos2, (UINT)pos); - todo_wine ok(qpc2 == qpc, "HPC after ReleaseBuffer(0) %u vs. %u\n", (UINT)qpc2, (UINT)qpc); + if(qpc2 != qpc) + /* FIXME: Some drivers fail */ + todo_wine ok(qpc2 == qpc, "HPC after ReleaseBuffer(0) %u vs. %u\n", (UINT)qpc2, (UINT)qpc); + else + ok(qpc2 == qpc, "HPC after ReleaseBuffer(0) %u vs. %u\n", (UINT)qpc2, (UINT)qpc); } /* trace after the GCP test because log output to MS-DOS console disturbs timing */ @@ -304,14 +311,23 @@ if(hr == S_OK){ /* The discontinuity is reported here, but is this an old or new packet? */ - todo_wine ok(flags & AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY, "expect DISCONTINUITY %x\n", flags); + if(!(flags & AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY)){ + /* FIXME: Some drivers fail */ + todo_wine ok(flags & AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY, "expect DISCONTINUITY %x\n", flags); + todo_wine ok(pos == sum + frames, "Position %u gap %d\n", + (UINT)pos, (UINT)pos - sum); + }else{ + ok(flags & AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY, "expect DISCONTINUITY %x\n", flags); + + /* Native's position is one period further than what we read. + * Perhaps that's precisely the meaning of DATA_DISCONTINUITY: + * signal when the position jump left a gap. */ + ok(pos == sum + frames, "Position %u gap %d\n", + (UINT)pos, (UINT)pos - sum); + } + ok(pad == next, "GCP %u vs. BufferSize %u\n", (UINT32)pad, next); - /* Native's position is one period further than what we read. - * Perhaps that's precisely the meaning of DATA_DISCONTINUITY: - * signal when the position jump left a gap. */ - todo_wine ok(pos == sum + frames, "Position %u gap %d\n", - (UINT)pos, (UINT)pos - sum); if(flags & AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY) sum = pos; } @@ -417,32 +433,6 @@ IAudioCaptureClient_ReleaseBuffer(acc, frames); } - hr = IAudioClient_Stop(ac); - ok(hr == S_OK, "Stop failed: %08x\n", hr); - - ok(ResetEvent(handle), "ResetEvent\n"); - - /* Still receiving events! */ - r = WaitForSingleObject(handle, 20); - ok(r == WAIT_OBJECT_0, "Wait(event) after Stop gave %x\n", r); - - hr = IAudioClient_Reset(ac); - ok(hr == S_OK, "Reset failed: %08x\n", hr); - - ok(ResetEvent(handle), "ResetEvent\n"); - - r = WaitForSingleObject(handle, 120); - ok(r == WAIT_OBJECT_0, "Wait(event) after Reset gave %x\n", r); - - hr = IAudioClient_SetEventHandle(ac, NULL); - ok(hr == E_INVALIDARG, "SetEventHandle(NULL) returns %08x\n", hr); - - r = WaitForSingleObject(handle, 70); - ok(r == WAIT_OBJECT_0, "Wait(NULL event) gave %x\n", r); - - hr = IAudioClient_Start(ac); - ok(hr == S_OK, "Start failed: %08x\n", hr); - IAudioCaptureClient_Release(acc); } @@ -593,7 +583,8 @@ ok(hr == E_INVALIDARG, "SetEventHandle(NULL) returns %08x\n", hr); hr = IAudioClient_Start(ac); - ok(hr == AUDCLNT_E_EVENTHANDLE_NOT_SET, "Start before SetEventHandle returns %08x\n", hr); + ok(hr == AUDCLNT_E_EVENTHANDLE_NOT_SET || + hr == D3D11_ERROR_4E /* win10 */, "Start before SetEventHandle returns %08x\n", hr); hr = IAudioClient_SetEventHandle(ac, handle); ok(hr == S_OK, "SetEventHandle returns %08x\n", hr); @@ -847,7 +838,6 @@ hr = ISimpleAudioVolume_GetMasterVolume(sav, &vol); ok(hr == S_OK, "GetMasterVolume failed: %08x\n", hr); - ok(vol == 1.f, "Master volume wasn't 1: %f\n", vol); hr = ISimpleAudioVolume_SetMasterVolume(sav, -1.f, NULL); ok(hr == E_INVALIDARG, "SetMasterVolume gave wrong error: %08x\n", hr); diff -Nru wine1.7-1.7.50/dlls/mmdevapi/tests/render.c wine1.7-1.7.55/dlls/mmdevapi/tests/render.c --- wine1.7-1.7.50/dlls/mmdevapi/tests/render.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/mmdevapi/tests/render.c 2015-11-13 14:32:40.000000000 +0000 @@ -54,9 +54,13 @@ #define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER) +/* undocumented error code */ +#define D3D11_ERROR_4E MAKE_HRESULT(SEVERITY_ERROR, FACILITY_DIRECT3D11, 0x4e) + static IMMDeviceEnumerator *mme = NULL; static IMMDevice *dev = NULL; static HRESULT hexcl = S_OK; /* or AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED */ +static BOOL win10 = FALSE; static const LARGE_INTEGER ullZero; @@ -281,7 +285,8 @@ fmtex->dwChannelMask = 0xffff; hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, pwfx, NULL); - ok(hr == S_OK, "Initialize(dwChannelMask = 0xffff) returns %08x\n", hr); + ok(hr == S_OK || + hr == AUDCLNT_E_UNSUPPORTED_FORMAT /* win10 */, "Initialize(dwChannelMask = 0xffff) returns %08x\n", hr); IAudioClient_Release(ac); @@ -330,9 +335,13 @@ ok(hr == S_OK, "Valid GetStreamLatency call returns %08x\n", hr); trace("Returned latency: %u.%04u ms\n", (UINT)(t2/10000), (UINT)(t2 % 10000)); - ok(t2 >= t1 || broken(t2 >= t1/2 && pwfx->nSamplesPerSec > 48000), - "Latency < default period, delta %ldus\n", (long)((t2-t1)/10)); + ok(t2 >= t1 || broken(t2 >= t1/2 && pwfx->nSamplesPerSec > 48000) || + broken(t2 == 0) /* (!) win10 */, + "Latency < default period, delta %dus (%x%08x vs %x%08x)\n", + (LONG)((t2-t1)/10), (DWORD)(t2 >> 32), (DWORD)t2, (DWORD)(t1 >> 32), (DWORD)t1); /* Native appears to add the engine period to the HW latency in shared mode */ + if(t2 == 0) + win10 = TRUE; hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, pwfx, NULL); ok(hr == AUDCLNT_E_ALREADY_INITIALIZED, "Calling Initialize twice returns %08x\n", hr); @@ -627,13 +636,15 @@ ok(event != NULL, "CreateEvent failed\n"); hr = IAudioClient_Start(ac); - ok(hr == AUDCLNT_E_EVENTHANDLE_NOT_SET, "Start failed: %08x\n", hr); + ok(hr == AUDCLNT_E_EVENTHANDLE_NOT_SET || + hr == D3D11_ERROR_4E /* win10 */, "Start failed: %08x\n", hr); hr = IAudioClient_SetEventHandle(ac, event); ok(hr == S_OK, "SetEventHandle failed: %08x\n", hr); hr = IAudioClient_SetEventHandle(ac, event); - ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_NAME), "SetEventHandle returns %08x\n", hr); + ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_NAME) || + hr == E_UNEXPECTED /* win10 */, "SetEventHandle returns %08x\n", hr); r = WaitForSingleObject(event, 40); ok(r == WAIT_TIMEOUT, "Wait(event) before Start gave %x\n", r); @@ -733,10 +744,13 @@ hr = IAudioRenderClient_GetBuffer(arc, psize, &buf); ok(hr == S_OK, "GetBuffer failed: %08x\n", hr); ok(buf != NULL, "NULL buffer returned\n"); - for(i = 0; i < psize * pwfx->nBlockAlign; ++i){ - if(buf[i] != silence){ - ok(0, "buffer has data in it already\n"); - break; + if(!win10){ + /* win10 appears not to clear the buffer */ + for(i = 0; i < psize * pwfx->nBlockAlign; ++i){ + if(buf[i] != silence){ + ok(0, "buffer has data in it already, i: %u, valu: %f\n", i, *((float*)buf)); + break; + } } } @@ -910,7 +924,8 @@ hr = IAudioClient_GetStreamLatency(ac, &t2); ok(hr == S_OK, "GetStreamLatency failed: %08x\n", hr); trace("Latency: %u.%04u ms\n", (UINT)(t2/10000), (UINT)(t2 % 10000)); - ok(t2 >= period || broken(t2 >= period/2 && share && pwfx->nSamplesPerSec > 48000), + ok(t2 >= period || broken(t2 >= period/2 && share && pwfx->nSamplesPerSec > 48000) || + broken(t2 == 0) /* win10 */, "Latency < default period, delta %ldus\n", (long)((t2-period)/10)); /** GetBufferSize @@ -1972,7 +1987,6 @@ vol = 0.5f; hr = ISimpleAudioVolume_GetMasterVolume(cap_sav, &vol); ok(hr == S_OK, "GetMasterVolume failed: %08x\n", hr); - ok(vol == 1.f, "Got wrong volume: %f\n", vol); ISimpleAudioVolume_Release(cap_sav); IAudioSessionManager_Release(cap_sesm); @@ -2001,7 +2015,6 @@ vol = 0.5f; hr = ISimpleAudioVolume_GetMasterVolume(cap_sav, &vol); ok(hr == S_OK, "GetMasterVolume failed: %08x\n", hr); - ok(vol == 1.f, "Got wrong volume: %f\n", vol); ISimpleAudioVolume_Release(cap_sav); } diff -Nru wine1.7-1.7.50/dlls/msacm32/format.c wine1.7-1.7.55/dlls/msacm32/format.c --- wine1.7-1.7.50/dlls/msacm32/format.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msacm32/format.c 2015-11-13 14:32:40.000000000 +0000 @@ -676,6 +676,9 @@ TRACE("(%p, %p, %p, %d, %d)\n", had, pwfxSrc, pwfxDst, cbwfxDst, fdwSuggest); + if (!pwfxSrc || !pwfxDst) + return MMSYSERR_INVALPARAM; + if (fdwSuggest & ~(ACM_FORMATSUGGESTF_NCHANNELS|ACM_FORMATSUGGESTF_NSAMPLESPERSEC| ACM_FORMATSUGGESTF_WBITSPERSAMPLE|ACM_FORMATSUGGESTF_WFORMATTAG)) return MMSYSERR_INVALFLAG; diff -Nru wine1.7-1.7.50/dlls/msacm32/pcmconverter.c wine1.7-1.7.55/dlls/msacm32/pcmconverter.c --- wine1.7-1.7.50/dlls/msacm32/pcmconverter.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msacm32/pcmconverter.c 2015-11-13 14:32:40.000000000 +0000 @@ -839,28 +839,33 @@ /* some tests ... */ if (adfs->cbwfxSrc < sizeof(PCMWAVEFORMAT) || - adfs->cbwfxDst < sizeof(PCMWAVEFORMAT) || - PCM_GetFormatIndex(adfs->pwfxSrc) == 0xFFFFFFFF) { + adfs->cbwfxDst < sizeof(PCMWAVEFORMAT) || + PCM_GetFormatIndex(adfs->pwfxSrc) == 0xFFFFFFFF) { WARN("not possible\n"); return ACMERR_NOTPOSSIBLE; } /* is no suggestion for destination, then copy source value */ if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_NCHANNELS)) { - adfs->pwfxDst->nChannels = adfs->pwfxSrc->nChannels; + adfs->pwfxDst->nChannels = adfs->pwfxSrc->nChannels; } if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_NSAMPLESPERSEC)) { - adfs->pwfxDst->nSamplesPerSec = adfs->pwfxSrc->nSamplesPerSec; + adfs->pwfxDst->nSamplesPerSec = adfs->pwfxSrc->nSamplesPerSec; } if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_WBITSPERSAMPLE)) { - adfs->pwfxDst->wBitsPerSample = adfs->pwfxSrc->wBitsPerSample; + adfs->pwfxDst->wBitsPerSample = adfs->pwfxSrc->wBitsPerSample; } if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_WFORMATTAG)) { - if (adfs->pwfxSrc->wFormatTag != WAVE_FORMAT_PCM) { - WARN("not possible\n"); + if (adfs->pwfxSrc->wFormatTag != WAVE_FORMAT_PCM) { + WARN("source format 0x%x not supported\n", adfs->pwfxSrc->wFormatTag); + return ACMERR_NOTPOSSIBLE; + } + adfs->pwfxDst->wFormatTag = adfs->pwfxSrc->wFormatTag; + } else { + if (adfs->pwfxDst->wFormatTag != WAVE_FORMAT_PCM) { + WARN("destination format 0x%x not supported\n", adfs->pwfxDst->wFormatTag); return ACMERR_NOTPOSSIBLE; } - adfs->pwfxDst->wFormatTag = adfs->pwfxSrc->wFormatTag; } /* check if result is ok */ if (PCM_GetFormatIndex(adfs->pwfxDst) == 0xFFFFFFFF) { diff -Nru wine1.7-1.7.50/dlls/msacm32/tests/msacm.c wine1.7-1.7.55/dlls/msacm32/tests/msacm.c --- wine1.7-1.7.50/dlls/msacm32/tests/msacm.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msacm32/tests/msacm.c 2015-11-13 14:32:40.000000000 +0000 @@ -127,15 +127,16 @@ TODO: should it be *exactly* sizeof(dd), as tested here? */ if (rc == MMSYSERR_NOERROR) { - struct { + static const struct { const char *shortname; - const WORD mid; - const WORD pid; + WORD mid; + WORD pid; + WORD pid_alt; } *iter, expected_ids[] = { { "Microsoft IMA ADPCM", MM_MICROSOFT, MM_MSFT_ACM_IMAADPCM }, { "MS-ADPCM", MM_MICROSOFT, MM_MSFT_ACM_MSADPCM }, { "Microsoft CCITT G.711", MM_MICROSOFT, MM_MSFT_ACM_G711}, - { "MPEG Layer-3 Codec", MM_FRAUNHOFER_IIS, MM_FHGIIS_MPEGLAYER3_DECODE }, + { "MPEG Layer-3 Codec", MM_FRAUNHOFER_IIS, MM_FHGIIS_MPEGLAYER3_DECODE, MM_FHGIIS_MPEGLAYER3_PROFESSIONAL }, { "MS-PCM", MM_MICROSOFT, MM_MSFT_ACM_PCM }, { 0 } }; @@ -144,8 +145,15 @@ "acmDriverDetailsA(): cbStruct = %08x\n", dd.cbStruct); for (iter = expected_ids; iter->shortname; ++iter) { - if (dd.szShortName && !strcmp(iter->shortname, dd.szShortName)) { - ok(iter->mid == dd.wMid && iter->pid == dd.wPid, + if (!strcmp(iter->shortname, dd.szShortName)) { + /* try alternative product id on mismatch */ + if (iter->pid_alt && iter->pid != dd.wPid) + ok(iter->mid == dd.wMid && iter->pid_alt == dd.wPid, + "Got wrong manufacturer (0x%x vs 0x%x) or product (0x%x vs 0x%x)\n", + dd.wMid, iter->mid, + dd.wPid, iter->pid_alt); + else + ok(iter->mid == dd.wMid && iter->pid == dd.wPid, "Got wrong manufacturer (0x%x vs 0x%x) or product (0x%x vs 0x%x)\n", dd.wMid, iter->mid, dd.wPid, iter->pid); @@ -594,8 +602,115 @@ ok(mr == MMSYSERR_NOERROR, "close failed: 0x%x\n", mr); } +static void test_acmFormatSuggest(void) +{ + WAVEFORMATEX src, dst; + DWORD suggest; + MMRESULT rc; + + /* Test a valid PCM format */ + src.wFormatTag = WAVE_FORMAT_PCM; + src.nChannels = 1; + src.nSamplesPerSec = 8000; + src.nAvgBytesPerSec = 16000; + src.nBlockAlign = 2; + src.wBitsPerSample = 16; + src.cbSize = 0; + suggest = 0; + memset(&dst, 0, sizeof(dst)); + rc = acmFormatSuggest(NULL, &src, &dst, sizeof(dst), suggest); + ok(rc == MMSYSERR_NOERROR, "failed with error 0x%x\n", rc); +todo_wine + ok(src.wFormatTag == dst.wFormatTag, "expected %d, got %d\n", src.wFormatTag, dst.wFormatTag); + ok(src.nChannels == dst.nChannels, "expected %d, got %d\n", src.nChannels, dst.nChannels); + ok(src.nSamplesPerSec == dst.nSamplesPerSec, "expected %d, got %d\n", src.nSamplesPerSec, dst.nSamplesPerSec); +todo_wine + ok(src.nAvgBytesPerSec == dst.nAvgBytesPerSec, "expected %d, got %d\n", src.nAvgBytesPerSec, dst.nAvgBytesPerSec); +todo_wine + ok(src.nBlockAlign == dst.nBlockAlign, "expected %d, got %d\n", src.nBlockAlign, dst.nBlockAlign); +todo_wine + ok(src.wBitsPerSample == dst.wBitsPerSample, "expected %d, got %d\n", src.wBitsPerSample, dst.wBitsPerSample); + + /* All parameters from destination are valid */ + suggest = ACM_FORMATSUGGESTF_NCHANNELS + | ACM_FORMATSUGGESTF_NSAMPLESPERSEC + | ACM_FORMATSUGGESTF_WBITSPERSAMPLE + | ACM_FORMATSUGGESTF_WFORMATTAG; + dst = src; + rc = acmFormatSuggest(NULL, &src, &dst, sizeof(dst), suggest); + ok(rc == MMSYSERR_NOERROR, "failed with error 0x%x\n", rc); + ok(src.wFormatTag == dst.wFormatTag, "expected %d, got %d\n", src.wFormatTag, dst.wFormatTag); + ok(src.nChannels == dst.nChannels, "expected %d, got %d\n", src.nChannels, dst.nChannels); + ok(src.nSamplesPerSec == dst.nSamplesPerSec, "expected %d, got %d\n", src.nSamplesPerSec, dst.nSamplesPerSec); + ok(src.nAvgBytesPerSec == dst.nAvgBytesPerSec, "expected %d, got %d\n", src.nAvgBytesPerSec, dst.nAvgBytesPerSec); + ok(src.nBlockAlign == dst.nBlockAlign, "expected %d, got %d\n", src.nBlockAlign, dst.nBlockAlign); + ok(src.wBitsPerSample == dst.wBitsPerSample, "expected %d, got %d\n", src.wBitsPerSample, dst.wBitsPerSample); + + /* Test for WAVE_FORMAT_MSRT24 used in Monster Truck Madness 2 */ + src.wFormatTag = WAVE_FORMAT_MSRT24; + src.nChannels = 1; + src.nSamplesPerSec = 8000; + src.nAvgBytesPerSec = 16000; + src.nBlockAlign = 2; + src.wBitsPerSample = 16; + src.cbSize = 0; + dst = src; + suggest = ACM_FORMATSUGGESTF_NCHANNELS + | ACM_FORMATSUGGESTF_NSAMPLESPERSEC + | ACM_FORMATSUGGESTF_WBITSPERSAMPLE + | ACM_FORMATSUGGESTF_WFORMATTAG; + rc = acmFormatSuggest(NULL, &src, &dst, sizeof(dst), suggest); + ok(rc == ACMERR_NOTPOSSIBLE, "failed with error 0x%x\n", rc); + memset(&dst, 0, sizeof(dst)); + suggest = 0; + rc = acmFormatSuggest(NULL, &src, &dst, sizeof(dst), suggest); +todo_wine + ok(rc == MMSYSERR_INVALPARAM, "failed with error 0x%x\n", rc); + + /* Invalid struct size */ + src.wFormatTag = WAVE_FORMAT_PCM; + rc = acmFormatSuggest(NULL, &src, &dst, 0, suggest); +todo_wine + ok(rc == MMSYSERR_INVALPARAM, "failed with error 0x%x\n", rc); + rc = acmFormatSuggest(NULL, &src, &dst, sizeof(dst) / 2, suggest); +todo_wine + ok(rc == MMSYSERR_INVALPARAM, "failed with error 0x%x\n", rc); + /* cbSize is the last parameter and not required for PCM */ + rc = acmFormatSuggest(NULL, &src, &dst, sizeof(dst) - 1, suggest); + ok(rc == MMSYSERR_NOERROR, "failed with error 0x%x\n", rc); + rc = acmFormatSuggest(NULL, &src, &dst, sizeof(dst) - sizeof(dst.cbSize), suggest); + ok(rc == MMSYSERR_NOERROR, "failed with error 0x%x\n", rc); + rc = acmFormatSuggest(NULL, &src, &dst, sizeof(dst) - sizeof(dst.cbSize) - 1, suggest); +todo_wine + ok(rc == MMSYSERR_INVALPARAM, "failed with error 0x%x\n", rc); + /* cbSize is required for others */ + src.wFormatTag = WAVE_FORMAT_ADPCM; + rc = acmFormatSuggest(NULL, &src, &dst, sizeof(dst) - sizeof(dst.cbSize), suggest); +todo_wine + ok(rc == MMSYSERR_INVALPARAM, "failed with error 0x%x\n", rc); + rc = acmFormatSuggest(NULL, &src, &dst, sizeof(dst) - 1, suggest); +todo_wine + ok(rc == MMSYSERR_INVALPARAM, "failed with error 0x%x\n", rc); + + /* Invalid suggest flags */ + src.wFormatTag = WAVE_FORMAT_PCM; + suggest = 0xFFFFFFFF; + rc = acmFormatSuggest(NULL, &src, &dst, sizeof(dst), suggest); + ok(rc == MMSYSERR_INVALFLAG, "failed with error 0x%x\n", rc); + + /* Invalid source and destination */ + suggest = 0; + rc = acmFormatSuggest(NULL, NULL, &dst, sizeof(dst), suggest); + ok(rc == MMSYSERR_INVALPARAM, "failed with error 0x%x\n", rc); + rc = acmFormatSuggest(NULL, &src, NULL, sizeof(dst), suggest); + ok(rc == MMSYSERR_INVALPARAM, "failed with error 0x%x\n", rc); + rc = acmFormatSuggest(NULL, NULL, NULL, sizeof(dst), suggest); + ok(rc == MMSYSERR_INVALPARAM, "failed with error 0x%x\n", rc); +} + START_TEST(msacm) { driver_tests(); test_prepareheader(); + test_acmFormatSuggest(); } diff -Nru wine1.7-1.7.50/dlls/msacm32.drv/wavemap.c wine1.7-1.7.55/dlls/msacm32.drv/wavemap.c --- wine1.7-1.7.50/dlls/msacm32.drv/wavemap.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msacm32.drv/wavemap.c 2015-11-13 14:32:40.000000000 +0000 @@ -852,8 +852,8 @@ HeapFree(GetProcessHeap(), 0, wim); } else { *lpdwUser = (DWORD_PTR)wim; + TRACE("Ok (stream=%p)\n", wim->hAcmStream); } - TRACE("Ok (stream=%p)\n", wim->hAcmStream); return MMSYSERR_NOERROR; error: HeapFree(GetProcessHeap(), 0, wim); diff -Nru wine1.7-1.7.50/dlls/msadp32.acm/msadp32.c wine1.7-1.7.55/dlls/msadp32.acm/msadp32.c --- wine1.7-1.7.50/dlls/msadp32.acm/msadp32.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msadp32.acm/msadp32.c 2015-11-13 14:32:40.000000000 +0000 @@ -249,9 +249,17 @@ { const unsigned char* in_src = src; - assert(*src <= 6); + /* Catch a problem from Tomb Raider III (bug 21000) where it passes + * invalid data after a valid sequence of blocks */ + if (*src > 6 || *(src + 1) > 6) + { + /* Recalculate the amount of used output buffer. We are not changing + * nsrc, let's assume the bad data was parsed */ + *ndst -= nblock * nsamp_blk * adsi->pwfxDst->nBlockAlign; + WARN("Invalid ADPCM data, stopping conversion\n"); + break; + } coeffL = MSADPCM_CoeffSet[*src++]; - assert(*src <= 6); coeffR = MSADPCM_CoeffSet[*src++]; ideltaL = R16(src); src += 2; @@ -542,6 +550,8 @@ if (ADPCM_GetFormatIndex(adfs->pwfxDst) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE; break; case WAVE_FORMAT_ADPCM: + if (adfs->cbwfxDst < sizeof(ADPCMWAVEFORMAT) + (7 - 1) * sizeof(ADPCMCOEFSET)) + return ACMERR_NOTPOSSIBLE; init_wfx_adpcm((ADPCMWAVEFORMAT*)adfs->pwfxDst); /* check if result is ok */ if (ADPCM_GetFormatIndex(adfs->pwfxDst) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE; diff -Nru wine1.7-1.7.50/dlls/mscoree/metahost.c wine1.7-1.7.55/dlls/mscoree/metahost.c --- wine1.7-1.7.50/dlls/mscoree/metahost.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/mscoree/metahost.c 2015-11-13 14:32:40.000000000 +0000 @@ -102,6 +102,8 @@ MonoThread* (CDECL *mono_thread_attach)(MonoDomain *domain); void (CDECL *mono_thread_manage)(void); void (CDECL *mono_trace_set_assembly)(MonoAssembly *assembly); +void (CDECL *mono_trace_set_print_handler)(MonoPrintCallback callback); +void (CDECL *mono_trace_set_printerr_handler)(MonoPrintCallback callback); static BOOL get_mono_path(LPWSTR path); @@ -111,20 +113,7 @@ static void mono_shutdown_callback_fn(MonoProfiler *prof); -static void set_environment(LPCWSTR bin_path) -{ - WCHAR path_env[MAX_PATH]; - int len; - - static const WCHAR pathW[] = {'P','A','T','H',0}; - - /* We have to modify PATH as Mono loads other DLLs from this directory. */ - GetEnvironmentVariableW(pathW, path_env, sizeof(path_env)/sizeof(WCHAR)); - len = strlenW(path_env); - path_env[len++] = ';'; - strcpyW(path_env+len, bin_path); - SetEnvironmentVariableW(pathW, path_env); -} +static void mono_print_handler_fn(const char *string, INT is_stdout); static MonoImage* CDECL image_open_module_handle_dummy(HMODULE module_handle, char* fname, UINT has_entry_point, MonoImageOpenStatus* status) @@ -132,6 +121,10 @@ return mono_image_open(fname, status); } +static void CDECL set_print_handler_dummy(MonoPrintCallback callback) +{ +} + static void missing_runtime_message(void) { MESSAGE("wine: Install Mono for Windows to run .NET applications.\n"); @@ -139,10 +132,9 @@ static HRESULT load_mono(LPCWSTR mono_path) { - static const WCHAR bin[] = {'\\','b','i','n',0}; static const WCHAR lib[] = {'\\','l','i','b',0}; static const WCHAR etc[] = {'\\','e','t','c',0}; - WCHAR mono_dll_path[MAX_PATH+16], mono_bin_path[MAX_PATH+4]; + WCHAR mono_dll_path[MAX_PATH+16]; WCHAR mono_lib_path[MAX_PATH+4], mono_etc_path[MAX_PATH+4]; char mono_lib_path_a[MAX_PATH], mono_etc_path_a[MAX_PATH]; int trace_size; @@ -158,10 +150,6 @@ if (!mono_handle) { - strcpyW(mono_bin_path, mono_path); - strcatW(mono_bin_path, bin); - set_environment(mono_bin_path); - strcpyW(mono_lib_path, mono_path); strcatW(mono_lib_path, lib); WideCharToMultiByte(CP_UTF8, 0, mono_lib_path, -1, mono_lib_path_a, MAX_PATH, NULL, NULL); @@ -224,11 +212,16 @@ } while (0); LOAD_OPT_MONO_FUNCTION(mono_image_open_from_module_handle, image_open_module_handle_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); #undef LOAD_OPT_MONO_FUNCTION mono_profiler_install(NULL, mono_shutdown_callback_fn); + mono_trace_set_print_handler(mono_print_handler_fn); + mono_trace_set_printerr_handler(mono_print_handler_fn); + mono_set_dirs(mono_lib_path_a, mono_etc_path_a); mono_config_parse(NULL); @@ -264,6 +257,11 @@ is_mono_shutdown = TRUE; } +static void mono_print_handler_fn(const char *string, INT is_stdout) +{ + wine_dbg_printf("%s", string); +} + static HRESULT CLRRuntimeInfo_GetRuntimeHost(CLRRuntimeInfo *This, RuntimeHost **result) { HRESULT hr = S_OK; diff -Nru wine1.7-1.7.50/dlls/mscoree/mscoree_private.h wine1.7-1.7.55/dlls/mscoree/mscoree_private.h --- wine1.7-1.7.50/dlls/mscoree/mscoree_private.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/mscoree/mscoree_private.h 2015-11-13 14:32:40.000000000 +0000 @@ -132,6 +132,8 @@ typedef void (*MonoProfileFunc)(MonoProfiler *prof); +typedef void (*MonoPrintCallback) (const char *string, INT is_stdout); + extern BOOL is_mono_started DECLSPEC_HIDDEN; extern MonoImage* (CDECL *mono_assembly_get_image)(MonoAssembly *assembly) DECLSPEC_HIDDEN; @@ -156,6 +158,8 @@ extern MonoThread* (CDECL *mono_thread_attach)(MonoDomain *domain) DECLSPEC_HIDDEN; extern void (CDECL *mono_thread_manage)(void) DECLSPEC_HIDDEN; extern void (CDECL *mono_trace_set_assembly)(MonoAssembly *assembly) DECLSPEC_HIDDEN; +extern void (CDECL *mono_trace_set_print_handler)(MonoPrintCallback callback) DECLSPEC_HIDDEN; +extern void (CDECL *mono_trace_set_printerr_handler)(MonoPrintCallback callback) DECLSPEC_HIDDEN; /* loaded runtime interfaces */ extern void expect_no_runtimes(void) DECLSPEC_HIDDEN; diff -Nru wine1.7-1.7.50/dlls/msctf/tests/inputprocessor.c wine1.7-1.7.55/dlls/msctf/tests/inputprocessor.c --- wine1.7-1.7.50/dlls/msctf/tests/inputprocessor.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msctf/tests/inputprocessor.c 2015-11-13 14:32:40.000000000 +0000 @@ -921,6 +921,7 @@ if(IsEqualGUID(&g,&CLSID_FakeService)) found = TRUE; } + IEnumGUID_Release(ppEnum); } ok(found,"Did not find registered text service\n"); } @@ -943,6 +944,7 @@ ok(IsEqualGUID(&profile.guidProfile,&CLSID_FakeService), "guidProfile Incorrect\n"); } } + IEnumTfLanguageProfiles_Release(ppEnum); } ok(found,"Registered text service not found\n"); } diff -Nru wine1.7-1.7.50/dlls/msctf/threadmgr.c wine1.7-1.7.55/dlls/msctf/threadmgr.c --- wine1.7-1.7.50/dlls/msctf/threadmgr.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msctf/threadmgr.c 2015-11-13 14:32:40.000000000 +0000 @@ -79,7 +79,7 @@ } AssociatedWindow; typedef struct tagACLMulti { - ITfThreadMgr ITfThreadMgr_iface; + ITfThreadMgrEx ITfThreadMgrEx_iface; ITfSource ITfSource_iface; ITfKeystrokeMgr ITfKeystrokeMgr_iface; ITfMessagePump ITfMessagePump_iface; @@ -87,7 +87,7 @@ /* const ITfThreadMgrExVtbl *ThreadMgrExVtbl; */ /* const ITfConfigureSystemKeystrokeFeedVtbl *ConfigureSystemKeystrokeFeedVtbl; */ /* const ITfLangBarItemMgrVtbl *LangBarItemMgrVtbl; */ - /* const ITfUIElementMgrVtbl *UIElementMgrVtbl; */ + ITfUIElementMgr ITfUIElementMgr_iface; ITfSourceSingle ITfSourceSingle_iface; LONG refCount; @@ -127,9 +127,9 @@ static HRESULT EnumTfDocumentMgr_Constructor(struct list* head, IEnumTfDocumentMgrs **ppOut); -static inline ThreadMgr *impl_from_ITfThreadMgr(ITfThreadMgr *iface) +static inline ThreadMgr *impl_from_ITfThreadMgrEx(ITfThreadMgrEx *iface) { - return CONTAINING_RECORD(iface, ThreadMgr, ITfThreadMgr_iface); + return CONTAINING_RECORD(iface, ThreadMgr, ITfThreadMgrEx_iface); } static inline ThreadMgr *impl_from_ITfSource(ITfSource *iface) @@ -157,6 +157,11 @@ return CONTAINING_RECORD(iface, ThreadMgr, ITfThreadMgrEventSink_iface); } +static inline ThreadMgr *impl_from_ITfUIElementMgr(ITfUIElementMgr *iface) +{ + return CONTAINING_RECORD(iface, ThreadMgr, ITfUIElementMgr_iface); +} + static inline ThreadMgr *impl_from_ITfSourceSingle(ITfSourceSingle *iface) { return CONTAINING_RECORD(iface, ThreadMgr, ITfSourceSingle_iface); @@ -252,14 +257,15 @@ HeapFree(GetProcessHeap(),0,This); } -static HRESULT WINAPI ThreadMgr_QueryInterface(ITfThreadMgr *iface, REFIID iid, LPVOID *ppvOut) +static HRESULT WINAPI ThreadMgr_QueryInterface(ITfThreadMgrEx *iface, REFIID iid, LPVOID *ppvOut) { - ThreadMgr *This = impl_from_ITfThreadMgr(iface); + ThreadMgr *This = impl_from_ITfThreadMgrEx(iface); *ppvOut = NULL; - if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfThreadMgr)) + if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfThreadMgr) + || IsEqualIID(iid, &IID_ITfThreadMgrEx)) { - *ppvOut = &This->ITfThreadMgr_iface; + *ppvOut = &This->ITfThreadMgrEx_iface; } else if (IsEqualIID(iid, &IID_ITfSource)) { @@ -281,6 +287,10 @@ { *ppvOut = This->CompartmentMgr; } + else if (IsEqualIID(iid, &IID_ITfUIElementMgr)) + { + *ppvOut = &This->ITfUIElementMgr_iface; + } else if (IsEqualIID(iid, &IID_ITfSourceSingle)) { *ppvOut = &This->ITfSourceSingle_iface; @@ -288,7 +298,7 @@ if (*ppvOut) { - ITfThreadMgr_AddRef(iface); + ITfThreadMgrEx_AddRef(iface); return S_OK; } @@ -296,15 +306,15 @@ return E_NOINTERFACE; } -static ULONG WINAPI ThreadMgr_AddRef(ITfThreadMgr *iface) +static ULONG WINAPI ThreadMgr_AddRef(ITfThreadMgrEx *iface) { - ThreadMgr *This = impl_from_ITfThreadMgr(iface); + ThreadMgr *This = impl_from_ITfThreadMgrEx(iface); return InterlockedIncrement(&This->refCount); } -static ULONG WINAPI ThreadMgr_Release(ITfThreadMgr *iface) +static ULONG WINAPI ThreadMgr_Release(ITfThreadMgrEx *iface) { - ThreadMgr *This = impl_from_ITfThreadMgr(iface); + ThreadMgr *This = impl_from_ITfThreadMgrEx(iface); ULONG ret; ret = InterlockedDecrement(&This->refCount); @@ -317,9 +327,9 @@ * ITfThreadMgr functions *****************************************************/ -static HRESULT WINAPI ThreadMgr_fnActivate( ITfThreadMgr* iface, TfClientId *ptid) +static HRESULT WINAPI ThreadMgr_fnActivate(ITfThreadMgrEx *iface, TfClientId *ptid) { - ThreadMgr *This = impl_from_ITfThreadMgr(iface); + ThreadMgr *This = impl_from_ITfThreadMgrEx(iface); TRACE("(%p) %p\n",This, ptid); @@ -333,15 +343,15 @@ ITfClientId_GetClientId(&This->ITfClientId_iface, &guid, &processId); } - activate_textservices(iface); + activate_textservices((ITfThreadMgr *)iface); This->activationCount++; *ptid = processId; return S_OK; } -static HRESULT WINAPI ThreadMgr_fnDeactivate( ITfThreadMgr* iface) +static HRESULT WINAPI ThreadMgr_fnDeactivate(ITfThreadMgrEx *iface) { - ThreadMgr *This = impl_from_ITfThreadMgr(iface); + ThreadMgr *This = impl_from_ITfThreadMgrEx(iface); TRACE("(%p)\n",This); if (This->activationCount == 0) @@ -364,9 +374,9 @@ return S_OK; } -static HRESULT WINAPI ThreadMgr_CreateDocumentMgr(ITfThreadMgr* iface, ITfDocumentMgr **ppdim) +static HRESULT WINAPI ThreadMgr_CreateDocumentMgr(ITfThreadMgrEx *iface, ITfDocumentMgr **ppdim) { - ThreadMgr *This = impl_from_ITfThreadMgr(iface); + ThreadMgr *This = impl_from_ITfThreadMgrEx(iface); DocumentMgrEntry *mgrentry; HRESULT hr; @@ -388,9 +398,9 @@ return hr; } -static HRESULT WINAPI ThreadMgr_EnumDocumentMgrs( ITfThreadMgr* iface, IEnumTfDocumentMgrs **ppEnum) +static HRESULT WINAPI ThreadMgr_EnumDocumentMgrs(ITfThreadMgrEx *iface, IEnumTfDocumentMgrs **ppEnum) { - ThreadMgr *This = impl_from_ITfThreadMgr(iface); + ThreadMgr *This = impl_from_ITfThreadMgrEx(iface); TRACE("(%p) %p\n",This,ppEnum); if (!ppEnum) @@ -399,10 +409,9 @@ return EnumTfDocumentMgr_Constructor(&This->CreatedDocumentMgrs, ppEnum); } -static HRESULT WINAPI ThreadMgr_GetFocus( ITfThreadMgr* iface, ITfDocumentMgr -**ppdimFocus) +static HRESULT WINAPI ThreadMgr_GetFocus(ITfThreadMgrEx *iface, ITfDocumentMgr **ppdimFocus) { - ThreadMgr *This = impl_from_ITfThreadMgr(iface); + ThreadMgr *This = impl_from_ITfThreadMgrEx(iface); TRACE("(%p)\n",This); if (!ppdimFocus) @@ -420,9 +429,9 @@ return S_OK; } -static HRESULT WINAPI ThreadMgr_SetFocus( ITfThreadMgr* iface, ITfDocumentMgr *pdimFocus) +static HRESULT WINAPI ThreadMgr_SetFocus(ITfThreadMgrEx *iface, ITfDocumentMgr *pdimFocus) { - ThreadMgr *This = impl_from_ITfThreadMgr(iface); + ThreadMgr *This = impl_from_ITfThreadMgrEx(iface); ITfDocumentMgr *check; TRACE("(%p) %p\n",This,pdimFocus); @@ -468,7 +477,7 @@ { TRACE("Triggering Associated window focus\n"); if (This->focus != wnd->docmgr) - ThreadMgr_SetFocus((ITfThreadMgr*)This, wnd->docmgr); + ThreadMgr_SetFocus(&This->ITfThreadMgrEx_iface, wnd->docmgr); break; } } @@ -493,10 +502,10 @@ return S_FALSE; } -static HRESULT WINAPI ThreadMgr_AssociateFocus( ITfThreadMgr* iface, HWND hwnd, +static HRESULT WINAPI ThreadMgr_AssociateFocus(ITfThreadMgrEx *iface, HWND hwnd, ITfDocumentMgr *pdimNew, ITfDocumentMgr **ppdimPrev) { - ThreadMgr *This = impl_from_ITfThreadMgr(iface); + ThreadMgr *This = impl_from_ITfThreadMgrEx(iface); struct list *cursor, *cursor2; AssociatedWindow *wnd; @@ -535,9 +544,9 @@ return S_OK; } -static HRESULT WINAPI ThreadMgr_IsThreadFocus( ITfThreadMgr* iface, BOOL *pfThreadFocus) +static HRESULT WINAPI ThreadMgr_IsThreadFocus(ITfThreadMgrEx *iface, BOOL *pfThreadFocus) { - ThreadMgr *This = impl_from_ITfThreadMgr(iface); + ThreadMgr *This = impl_from_ITfThreadMgrEx(iface); HWND focus; TRACE("(%p) %p\n",This,pfThreadFocus); @@ -546,26 +555,26 @@ return S_OK; } -static HRESULT WINAPI ThreadMgr_GetFunctionProvider( ITfThreadMgr* iface, REFCLSID clsid, +static HRESULT WINAPI ThreadMgr_GetFunctionProvider(ITfThreadMgrEx *iface, REFCLSID clsid, ITfFunctionProvider **ppFuncProv) { - ThreadMgr *This = impl_from_ITfThreadMgr(iface); + ThreadMgr *This = impl_from_ITfThreadMgrEx(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } -static HRESULT WINAPI ThreadMgr_EnumFunctionProviders( ITfThreadMgr* iface, +static HRESULT WINAPI ThreadMgr_EnumFunctionProviders(ITfThreadMgrEx *iface, IEnumTfFunctionProviders **ppEnum) { - ThreadMgr *This = impl_from_ITfThreadMgr(iface); + ThreadMgr *This = impl_from_ITfThreadMgrEx(iface); FIXME("STUB:(%p)\n",This); return E_NOTIMPL; } -static HRESULT WINAPI ThreadMgr_GetGlobalCompartment( ITfThreadMgr* iface, +static HRESULT WINAPI ThreadMgr_GetGlobalCompartment(ITfThreadMgrEx *iface, ITfCompartmentMgr **ppCompMgr) { - ThreadMgr *This = impl_from_ITfThreadMgr(iface); + ThreadMgr *This = impl_from_ITfThreadMgrEx(iface); HRESULT hr; TRACE("(%p) %p\n",This, ppCompMgr); @@ -584,7 +593,23 @@ return S_OK; } -static const ITfThreadMgrVtbl ThreadMgrVtbl = +static HRESULT WINAPI ThreadMgr_ActivateEx(ITfThreadMgrEx *iface, TfClientId *id, DWORD flags) +{ + ThreadMgr *This = impl_from_ITfThreadMgrEx(iface); + + FIXME("STUB:(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI ThreadMgr_GetActiveFlags(ITfThreadMgrEx *iface, DWORD *flags) +{ + ThreadMgr *This = impl_from_ITfThreadMgrEx(iface); + + FIXME("STUB:(%p)\n", This); + return E_NOTIMPL; +} + +static const ITfThreadMgrExVtbl ThreadMgrExVtbl = { ThreadMgr_QueryInterface, ThreadMgr_AddRef, @@ -599,25 +624,28 @@ ThreadMgr_IsThreadFocus, ThreadMgr_GetFunctionProvider, ThreadMgr_EnumFunctionProviders, - ThreadMgr_GetGlobalCompartment + ThreadMgr_GetGlobalCompartment, + + ThreadMgr_ActivateEx, + ThreadMgr_GetActiveFlags }; static HRESULT WINAPI Source_QueryInterface(ITfSource *iface, REFIID iid, LPVOID *ppvOut) { ThreadMgr *This = impl_from_ITfSource(iface); - return ITfThreadMgr_QueryInterface(&This->ITfThreadMgr_iface, iid, ppvOut); + return ITfThreadMgrEx_QueryInterface(&This->ITfThreadMgrEx_iface, iid, ppvOut); } static ULONG WINAPI Source_AddRef(ITfSource *iface) { ThreadMgr *This = impl_from_ITfSource(iface); - return ITfThreadMgr_AddRef(&This->ITfThreadMgr_iface); + return ITfThreadMgrEx_AddRef(&This->ITfThreadMgrEx_iface); } static ULONG WINAPI Source_Release(ITfSource *iface) { ThreadMgr *This = impl_from_ITfSource(iface); - return ITfThreadMgr_Release(&This->ITfThreadMgr_iface); + return ITfThreadMgrEx_Release(&This->ITfThreadMgrEx_iface); } /***************************************************** @@ -694,19 +722,19 @@ static HRESULT WINAPI KeystrokeMgr_QueryInterface(ITfKeystrokeMgr *iface, REFIID iid, LPVOID *ppvOut) { ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface); - return ITfThreadMgr_QueryInterface(&This->ITfThreadMgr_iface, iid, ppvOut); + return ITfThreadMgrEx_QueryInterface(&This->ITfThreadMgrEx_iface, iid, ppvOut); } static ULONG WINAPI KeystrokeMgr_AddRef(ITfKeystrokeMgr *iface) { ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface); - return ITfThreadMgr_AddRef(&This->ITfThreadMgr_iface); + return ITfThreadMgrEx_AddRef(&This->ITfThreadMgrEx_iface); } static ULONG WINAPI KeystrokeMgr_Release(ITfKeystrokeMgr *iface) { ThreadMgr *This = impl_from_ITfKeystrokeMgr(iface); - return ITfThreadMgr_Release(&This->ITfThreadMgr_iface); + return ITfThreadMgrEx_Release(&This->ITfThreadMgrEx_iface); } static HRESULT WINAPI KeystrokeMgr_AdviseKeyEventSink(ITfKeystrokeMgr *iface, @@ -986,19 +1014,19 @@ static HRESULT WINAPI MessagePump_QueryInterface(ITfMessagePump *iface, REFIID iid, LPVOID *ppvOut) { ThreadMgr *This = impl_from_ITfMessagePump(iface); - return ITfThreadMgr_QueryInterface(&This->ITfThreadMgr_iface, iid, ppvOut); + return ITfThreadMgrEx_QueryInterface(&This->ITfThreadMgrEx_iface, iid, ppvOut); } static ULONG WINAPI MessagePump_AddRef(ITfMessagePump *iface) { ThreadMgr *This = impl_from_ITfMessagePump(iface); - return ITfThreadMgr_AddRef(&This->ITfThreadMgr_iface); + return ITfThreadMgrEx_AddRef(&This->ITfThreadMgrEx_iface); } static ULONG WINAPI MessagePump_Release(ITfMessagePump *iface) { ThreadMgr *This = impl_from_ITfMessagePump(iface); - return ITfThreadMgr_Release(&This->ITfThreadMgr_iface); + return ITfThreadMgrEx_Release(&This->ITfThreadMgrEx_iface); } static HRESULT WINAPI MessagePump_PeekMessageA(ITfMessagePump *iface, @@ -1059,19 +1087,19 @@ static HRESULT WINAPI ClientId_QueryInterface(ITfClientId *iface, REFIID iid, LPVOID *ppvOut) { ThreadMgr *This = impl_from_ITfClientId(iface); - return ITfThreadMgr_QueryInterface(&This->ITfThreadMgr_iface, iid, ppvOut); + return ITfThreadMgrEx_QueryInterface(&This->ITfThreadMgrEx_iface, iid, ppvOut); } static ULONG WINAPI ClientId_AddRef(ITfClientId *iface) { ThreadMgr *This = impl_from_ITfClientId(iface); - return ITfThreadMgr_AddRef(&This->ITfThreadMgr_iface); + return ITfThreadMgrEx_AddRef(&This->ITfThreadMgrEx_iface); } static ULONG WINAPI ClientId_Release(ITfClientId *iface) { ThreadMgr *This = impl_from_ITfClientId(iface); - return ITfThreadMgr_Release(&This->ITfThreadMgr_iface); + return ITfThreadMgrEx_Release(&This->ITfThreadMgrEx_iface); } static HRESULT WINAPI ClientId_GetClientId(ITfClientId *iface, @@ -1105,19 +1133,19 @@ static HRESULT WINAPI ThreadMgrEventSink_QueryInterface(ITfThreadMgrEventSink *iface, REFIID iid, LPVOID *ppvOut) { ThreadMgr *This = impl_from_ITfThreadMgrEventSink(iface); - return ITfThreadMgr_QueryInterface(&This->ITfThreadMgr_iface, iid, ppvOut); + return ITfThreadMgrEx_QueryInterface(&This->ITfThreadMgrEx_iface, iid, ppvOut); } static ULONG WINAPI ThreadMgrEventSink_AddRef(ITfThreadMgrEventSink *iface) { ThreadMgr *This = impl_from_ITfThreadMgrEventSink(iface); - return ITfThreadMgr_AddRef(&This->ITfThreadMgr_iface); + return ITfThreadMgrEx_AddRef(&This->ITfThreadMgrEx_iface); } static ULONG WINAPI ThreadMgrEventSink_Release(ITfThreadMgrEventSink *iface) { ThreadMgr *This = impl_from_ITfThreadMgrEventSink(iface); - return ITfThreadMgr_Release(&This->ITfThreadMgr_iface); + return ITfThreadMgrEx_Release(&This->ITfThreadMgrEx_iface); } @@ -1220,24 +1248,104 @@ }; /***************************************************** + * ITfUIElementMgr functions + *****************************************************/ +static HRESULT WINAPI UIElementMgr_QueryInterface(ITfUIElementMgr *iface, REFIID iid, void **ppvOut) +{ + ThreadMgr *This = impl_from_ITfUIElementMgr(iface); + + return ITfThreadMgrEx_QueryInterface(&This->ITfThreadMgrEx_iface, iid, *ppvOut); +} + +static ULONG WINAPI UIElementMgr_AddRef(ITfUIElementMgr *iface) +{ + ThreadMgr *This = impl_from_ITfUIElementMgr(iface); + + return ITfThreadMgrEx_AddRef(&This->ITfThreadMgrEx_iface); +} + +static ULONG WINAPI UIElementMgr_Release(ITfUIElementMgr *iface) +{ + ThreadMgr *This = impl_from_ITfUIElementMgr(iface); + + return ITfThreadMgrEx_Release(&This->ITfThreadMgrEx_iface); +} + +static HRESULT WINAPI UIElementMgr_BeginUIElement(ITfUIElementMgr *iface, ITfUIElement *element, + BOOL *show, DWORD *id) +{ + ThreadMgr *This = impl_from_ITfUIElementMgr(iface); + + FIXME("STUB:(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI UIElementMgr_UpdateUIElement(ITfUIElementMgr *iface, DWORD id) +{ + ThreadMgr *This = impl_from_ITfUIElementMgr(iface); + + FIXME("STUB:(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI UIElementMgr_EndUIElement(ITfUIElementMgr *iface, DWORD id) +{ + ThreadMgr *This = impl_from_ITfUIElementMgr(iface); + + FIXME("STUB:(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI UIElementMgr_GetUIElement(ITfUIElementMgr *iface, DWORD id, + ITfUIElement **element) +{ + ThreadMgr *This = impl_from_ITfUIElementMgr(iface); + + FIXME("STUB:(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI UIElementMgr_EnumUIElements(ITfUIElementMgr *iface, + IEnumTfUIElements **enum_elements) +{ + ThreadMgr *This = impl_from_ITfUIElementMgr(iface); + + FIXME("STUB:(%p)\n", This); + return E_NOTIMPL; +} + +static const ITfUIElementMgrVtbl ThreadMgrUIElementMgrVtbl = +{ + UIElementMgr_QueryInterface, + UIElementMgr_AddRef, + UIElementMgr_Release, + + UIElementMgr_BeginUIElement, + UIElementMgr_UpdateUIElement, + UIElementMgr_EndUIElement, + UIElementMgr_GetUIElement, + UIElementMgr_EnumUIElements +}; + +/***************************************************** * ITfSourceSingle functions *****************************************************/ static HRESULT WINAPI ThreadMgrSourceSingle_QueryInterface(ITfSourceSingle *iface, REFIID iid, LPVOID *ppvOut) { ThreadMgr *This = impl_from_ITfSourceSingle(iface); - return ITfThreadMgr_QueryInterface(&This->ITfThreadMgr_iface, iid, ppvOut); + return ITfThreadMgrEx_QueryInterface(&This->ITfThreadMgrEx_iface, iid, ppvOut); } static ULONG WINAPI ThreadMgrSourceSingle_AddRef(ITfSourceSingle *iface) { ThreadMgr *This = impl_from_ITfSourceSingle(iface); - return ITfThreadMgr_AddRef(&This->ITfThreadMgr_iface); + return ITfThreadMgrEx_AddRef(&This->ITfThreadMgrEx_iface); } static ULONG WINAPI ThreadMgrSourceSingle_Release(ITfSourceSingle *iface) { ThreadMgr *This = impl_from_ITfSourceSingle(iface); - return ITfThreadMgr_Release(&This->ITfThreadMgr_iface); + return ITfThreadMgrEx_Release(&This->ITfThreadMgrEx_iface); } static HRESULT WINAPI ThreadMgrSourceSingle_AdviseSingleSink( ITfSourceSingle *iface, @@ -1275,8 +1383,8 @@ This = TlsGetValue(tlsIndex); if (This) { - ThreadMgr_AddRef(&This->ITfThreadMgr_iface); - *ppOut = (IUnknown*)&This->ITfThreadMgr_iface; + ThreadMgr_AddRef(&This->ITfThreadMgrEx_iface); + *ppOut = (IUnknown*)&This->ITfThreadMgrEx_iface; return S_OK; } @@ -1284,12 +1392,13 @@ if (This == NULL) return E_OUTOFMEMORY; - This->ITfThreadMgr_iface.lpVtbl= &ThreadMgrVtbl; + This->ITfThreadMgrEx_iface.lpVtbl = &ThreadMgrExVtbl; This->ITfSource_iface.lpVtbl = &ThreadMgrSourceVtbl; - This->ITfKeystrokeMgr_iface.lpVtbl= &KeystrokeMgrVtbl; + This->ITfKeystrokeMgr_iface.lpVtbl = &KeystrokeMgrVtbl; This->ITfMessagePump_iface.lpVtbl = &MessagePumpVtbl; This->ITfClientId_iface.lpVtbl = &ClientIdVtbl; This->ITfThreadMgrEventSink_iface.lpVtbl = &ThreadMgrEventSinkVtbl; + This->ITfUIElementMgr_iface.lpVtbl = &ThreadMgrUIElementMgrVtbl; This->ITfSourceSingle_iface.lpVtbl = &SourceSingleVtbl; This->refCount = 1; TlsSetValue(tlsIndex,This); @@ -1308,7 +1417,7 @@ list_init(&This->ThreadMgrEventSink); TRACE("returning %p\n", This); - *ppOut = (IUnknown *)&This->ITfThreadMgr_iface; + *ppOut = (IUnknown *)&This->ITfThreadMgrEx_iface; return S_OK; } @@ -1459,7 +1568,7 @@ void ThreadMgr_OnDocumentMgrDestruction(ITfThreadMgr *iface, ITfDocumentMgr *mgr) { - ThreadMgr *This = impl_from_ITfThreadMgr(iface); + ThreadMgr *This = impl_from_ITfThreadMgrEx((ITfThreadMgrEx *)iface); struct list *cursor; LIST_FOR_EACH(cursor, &This->CreatedDocumentMgrs) { diff -Nru wine1.7-1.7.50/dlls/msdelta/Makefile.in wine1.7-1.7.55/dlls/msdelta/Makefile.in --- wine1.7-1.7.50/dlls/msdelta/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/msdelta/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,4 @@ +MODULE = msdelta.dll + +C_SRCS = \ + msdelta_main.c diff -Nru wine1.7-1.7.50/dlls/msdelta/msdelta_main.c wine1.7-1.7.55/dlls/msdelta/msdelta_main.c --- wine1.7-1.7.50/dlls/msdelta/msdelta_main.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/msdelta/msdelta_main.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,42 @@ +/* Copyright 2015 Andrew Eikum for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" + +#include + +#include "windef.h" +#include "winbase.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(msdelta); + +BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) +{ + TRACE("(%p, %u, %p)\n", instance, reason, reserved); + + switch (reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(instance); + break; + } + + return TRUE; +} diff -Nru wine1.7-1.7.50/dlls/msdelta/msdelta.spec wine1.7-1.7.55/dlls/msdelta/msdelta.spec --- wine1.7-1.7.50/dlls/msdelta/msdelta.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/msdelta/msdelta.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,15 @@ +@ stub ApplyDeltaA +@ stub ApplyDeltaB +@ stub ApplyDeltaProvidedB +@ stub ApplyDeltaW +@ stub CreateDeltaA +@ stub CreateDeltaB +@ stub CreateDeltaW +@ stub DeltaFree +@ stub DeltaNormalizeProvidedB +@ stub GetDeltaInfoA +@ stub GetDeltaInfoB +@ stub GetDeltaInfoW +@ stub GetDeltaSignatureA +@ stub GetDeltaSignatureB +@ stub GetDeltaSignatureW diff -Nru wine1.7-1.7.50/dlls/mshtml/htmldoc.c wine1.7-1.7.55/dlls/mshtml/htmldoc.c --- wine1.7-1.7.50/dlls/mshtml/htmldoc.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/mshtml/htmldoc.c 2015-11-13 14:32:40.000000000 +0000 @@ -4761,6 +4761,8 @@ IOleDocumentView_SetInPlaceSite(&This->basedoc.IOleDocumentView_iface, NULL); if(This->undomgr) IOleUndoManager_Release(This->undomgr); + if(This->editsvcs) + IHTMLEditServices_Release(This->editsvcs); if(This->tooltips_hwnd) DestroyWindow(This->tooltips_hwnd); diff -Nru wine1.7-1.7.50/dlls/mshtml/htmloption.c wine1.7-1.7.55/dlls/mshtml/htmloption.c --- wine1.7-1.7.50/dlls/mshtml/htmloption.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/mshtml/htmloption.c 2015-11-13 14:32:40.000000000 +0000 @@ -166,15 +166,53 @@ static HRESULT WINAPI HTMLOptionElement_put_defaultSelected(IHTMLOptionElement *iface, VARIANT_BOOL v) { HTMLOptionElement *This = impl_from_IHTMLOptionElement(iface); - FIXME("(%p)->(%x)\n", This, v); - return E_NOTIMPL; + cpp_bool val, selected; + nsresult nsres; + + TRACE("(%p)->(%x)\n", This, v); + + val = (v == VARIANT_TRUE); + + nsres = nsIDOMHTMLOptionElement_GetSelected(This->nsoption, &selected); + if(NS_FAILED(nsres)) { + ERR("GetSelected failed: %08x\n", nsres); + return E_FAIL; + } + + nsres = nsIDOMHTMLOptionElement_SetDefaultSelected(This->nsoption, val); + if(NS_FAILED(nsres)) { + ERR("SetDefaultSelected failed: %08x\n", nsres); + return E_FAIL; + } + + if(val != selected) { + nsres = nsIDOMHTMLOptionElement_SetSelected(This->nsoption, selected); /* WinAPI will reserve selected property */ + if(NS_FAILED(nsres)) { + ERR("SetSelected failed: %08x\n", nsres); + return E_FAIL; + } + } + + return S_OK; } static HRESULT WINAPI HTMLOptionElement_get_defaultSelected(IHTMLOptionElement *iface, VARIANT_BOOL *p) { HTMLOptionElement *This = impl_from_IHTMLOptionElement(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + cpp_bool val; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + if(!p) + return E_POINTER; + nsres = nsIDOMHTMLOptionElement_GetDefaultSelected(This->nsoption, &val); + if(NS_FAILED(nsres)) { + ERR("GetDefaultSelected failed: %08x\n", nsres); + return E_FAIL; + } + + *p = val ? VARIANT_TRUE : VARIANT_FALSE; + return S_OK; } static HRESULT WINAPI HTMLOptionElement_put_index(IHTMLOptionElement *iface, LONG v) @@ -269,8 +307,42 @@ static HRESULT WINAPI HTMLOptionElement_get_form(IHTMLOptionElement *iface, IHTMLFormElement **p) { HTMLOptionElement *This = impl_from_IHTMLOptionElement(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsIDOMHTMLFormElement *nsform; + nsIDOMNode *form_node; + HTMLDOMNode *node; + HRESULT hres; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + if(!p) + return E_POINTER; + + nsres = nsIDOMHTMLOptionElement_GetForm(This->nsoption, &nsform); + if (NS_FAILED(nsres)) { + ERR("GetForm failed: %08x, nsform: %p\n", nsres, nsform); + *p = NULL; + return E_FAIL; + } + if (nsform == NULL) { + TRACE("nsform not found\n"); + *p = NULL; + return S_OK; + } + + nsres = nsIDOMHTMLFormElement_QueryInterface(nsform, &IID_nsIDOMNode, (void**)&form_node); + nsIDOMHTMLFormElement_Release(nsform); + assert(nsres == NS_OK); + + hres = get_node(This->element.node.doc, form_node, TRUE, &node); + nsIDOMNode_Release(form_node); + if (FAILED(hres)) + return hres; + + hres = IHTMLDOMNode_QueryInterface(&node->IHTMLDOMNode_iface, &IID_IHTMLElement, (void**)p); + + node_release(node); + return hres; } static const IHTMLOptionElementVtbl HTMLOptionElementVtbl = { diff -Nru wine1.7-1.7.50/dlls/mshtml/htmlselect.c wine1.7-1.7.55/dlls/mshtml/htmlselect.c --- wine1.7-1.7.50/dlls/mshtml/htmlselect.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/mshtml/htmlselect.c 2015-11-13 14:32:40.000000000 +0000 @@ -383,7 +383,6 @@ return E_POINTER; nsres = nsIDOMHTMLSelectElement_GetForm(This->nsselect, &nsform); - FIXME("get form %08x : %p\n", nsres, nsform); if (NS_FAILED(nsres)) { ERR("GetForm failed: %08x, nsform: %p\n", nsres, nsform); *p = NULL; diff -Nru wine1.7-1.7.50/dlls/mshtml/htmlstyle.c wine1.7-1.7.55/dlls/mshtml/htmlstyle.c --- wine1.7-1.7.50/dlls/mshtml/htmlstyle.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/mshtml/htmlstyle.c 2015-11-13 14:32:40.000000000 +0000 @@ -405,7 +405,7 @@ if(value) { if(flags & ATTR_FIX_PX) val = fix_px_value(value); - if(flags & ATTR_FIX_URL) + else if(flags & ATTR_FIX_URL) val = fix_url_value(value); } diff -Nru wine1.7-1.7.50/dlls/mshtml/main.c wine1.7-1.7.55/dlls/mshtml/main.c --- wine1.7-1.7.50/dlls/mshtml/main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/mshtml/main.c 2015-11-13 14:32:40.000000000 +0000 @@ -554,6 +554,7 @@ X(IID_IHlinkTarget); X(IID_IHTMLDocument6); X(IID_IHTMLDocument7); + X(IID_IHTMLEditServices); X(IID_IHTMLFramesCollection2); X(IID_IHTMLPrivateWindow); X(IID_IHtmlLoadOptions); diff -Nru wine1.7-1.7.50/dlls/mshtml/mshtml_private.h wine1.7-1.7.55/dlls/mshtml/mshtml_private.h --- wine1.7-1.7.50/dlls/mshtml/mshtml_private.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/mshtml/mshtml_private.h 2015-11-13 14:32:40.000000000 +0000 @@ -40,7 +40,7 @@ #include "nsiface.h" #define NS_ERROR_GENERATE_FAILURE(module,code) \ - ((nsresult) (((UINT32)(1<<31)) | ((UINT32)(module+0x45)<<16) | ((UINT32)(code)))) + ((nsresult) (((UINT32)(1u<<31)) | ((UINT32)(module+0x45)<<16) | ((UINT32)(code)))) #define NS_OK ((nsresult)0x00000000L) #define NS_ERROR_FAILURE ((nsresult)0x80004005L) @@ -602,6 +602,7 @@ DOCHOSTUIINFO hostinfo; IOleUndoManager *undomgr; + IHTMLEditServices *editsvcs; HWND hwnd; HWND tooltips_hwnd; diff -Nru wine1.7-1.7.50/dlls/mshtml/navigate.c wine1.7-1.7.55/dlls/mshtml/navigate.c --- wine1.7-1.7.50/dlls/mshtml/navigate.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/mshtml/navigate.c 2015-11-13 14:32:40.000000000 +0000 @@ -1137,7 +1137,7 @@ return ref; } -static nsresult NSAPI nsAsyncVerifyRedirectCallback_AsyncOnChannelRedirect(nsIAsyncVerifyRedirectCallback *iface, nsresult result) +static nsresult NSAPI nsAsyncVerifyRedirectCallback_OnRedirectVerifyCallback(nsIAsyncVerifyRedirectCallback *iface, nsresult result) { nsRedirectCallback *This = impl_from_nsIAsyncVerifyRedirectCallback(iface); nsChannel *old_nschannel; @@ -1184,7 +1184,7 @@ nsAsyncVerifyRedirectCallback_QueryInterface, nsAsyncVerifyRedirectCallback_AddRef, nsAsyncVerifyRedirectCallback_Release, - nsAsyncVerifyRedirectCallback_AsyncOnChannelRedirect + nsAsyncVerifyRedirectCallback_OnRedirectVerifyCallback }; static HRESULT create_redirect_callback(nsChannel *nschannel, nsChannelBSC *bsc, nsRedirectCallback **ret) diff -Nru wine1.7-1.7.50/dlls/mshtml/nsembed.c wine1.7-1.7.55/dlls/mshtml/nsembed.c --- wine1.7-1.7.50/dlls/mshtml/nsembed.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/mshtml/nsembed.c 2015-11-13 14:32:40.000000000 +0000 @@ -481,6 +481,7 @@ strcpyW(path+len, gre_path); SetEnvironmentVariableW(pathW, path); } + heap_free(path); } static BOOL load_xul(const PRUnichar *gre_path) diff -Nru wine1.7-1.7.50/dlls/mshtml/nsiface.idl wine1.7-1.7.55/dlls/mshtml/nsiface.idl --- wine1.7-1.7.50/dlls/mshtml/nsiface.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/mshtml/nsiface.idl 2015-11-13 14:32:40.000000000 +0000 @@ -23,6 +23,8 @@ * compatible with XPCOM, usable in C code. */ +#pragma makedep header + cpp_quote("#define GECKO_VERSION \"2.40\"") cpp_quote("#define GECKO_VERSION_STRING \"Wine Gecko \" GECKO_VERSION") @@ -3735,12 +3737,13 @@ [ object, - uuid(c8d3b1e1-565a-427e-9d68-b109910ce9b7), + uuid(c63e9d64-490d-48bf-8013-b5d8ee4dbc25), local ] interface nsIDocShellLoadInfo : nsISupports { - typedef int nsDocShellInfoLoadType; + typedef int32_t nsDocShellInfoLoadType; + typedef uint32_t nsDocShellInfoReferrerPolicy; nsresult GetReferrer(nsIURI **aReferrer); nsresult SetReferrer(nsIURI *aReferrer); @@ -3762,6 +3765,8 @@ nsresult SetHeadersStream(nsIInputStream *aHeadersStream); nsresult GetSendReferrer(bool *aSendReferrer); nsresult SetSendReferrer(bool aSendReferrer); + nsresult GetReferrerPolicy(nsDocShellInfoReferrerPolicy *aReferrerPolicy); + nsresult SetReferrerPolicy(nsDocShellInfoReferrerPolicy aReferrerPolicy); nsresult GetIsSrcdocLoad(bool *aIsSrcdocLoad); nsresult GetSrcdocData(nsAString *aSrcdocData); nsresult SetSrcdocData(const nsAString *aSrcdocData); diff -Nru wine1.7-1.7.50/dlls/mshtml/nsio.c wine1.7-1.7.55/dlls/mshtml/nsio.c --- wine1.7-1.7.50/dlls/mshtml/nsio.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/mshtml/nsio.c 2015-11-13 14:32:40.000000000 +0000 @@ -363,7 +363,7 @@ http_header_t *iter; LIST_FOR_EACH_ENTRY(iter, headers, http_header_t, entry) { - if(!strcmpiW(iter->header, name)) + if(!strncmpiW(iter->header, name, len) && !iter->header[len]) return iter; } @@ -3545,7 +3545,7 @@ static BOOL is_gecko_special_uri(const char *spec) { - static const char *special_schemes[] = {"chrome:", "jar:", "moz-safe-about", "resource:", "javascript:", "wyciwyg:"}; + static const char *special_schemes[] = {"chrome:", "data:", "jar:", "moz-safe-about", "resource:", "javascript:", "wyciwyg:"}; unsigned int i; for(i=0; i < sizeof(special_schemes)/sizeof(*special_schemes); i++) { diff -Nru wine1.7-1.7.50/dlls/mshtml/persist.c wine1.7-1.7.55/dlls/mshtml/persist.c --- wine1.7-1.7.50/dlls/mshtml/persist.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/mshtml/persist.c 2015-11-13 14:32:40.000000000 +0000 @@ -128,8 +128,12 @@ HRESULT hres; if(This->mon) { - if(This->doc_obj && !(flags & (BINDING_REPLACE|BINDING_REFRESH))) - notify_travellog_update(This->doc_obj); + if(This->doc_obj && !(flags & (BINDING_REPLACE|BINDING_REFRESH))) { + if(This == This->doc_obj->basedoc.window) + notify_travellog_update(This->doc_obj); + else + TRACE("Skipping travellog update for frame navigation.\n"); + } IMoniker_Release(This->mon); This->mon = NULL; } diff -Nru wine1.7-1.7.50/dlls/mshtml/service.c wine1.7-1.7.55/dlls/mshtml/service.c --- wine1.7-1.7.50/dlls/mshtml/service.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/mshtml/service.c 2015-11-13 14:32:40.000000000 +0000 @@ -197,12 +197,139 @@ { UndoManager *ret = heap_alloc(sizeof(UndoManager)); + if (!ret) return NULL; + ret->IOleUndoManager_iface.lpVtbl = &OleUndoManagerVtbl; ret->ref = 1; return &ret->IOleUndoManager_iface; } +typedef struct { + IHTMLEditServices IHTMLEditServices_iface; + LONG ref; +} editsvcs; + +static inline editsvcs *impl_from_IHTMLEditServices(IHTMLEditServices *iface) +{ + return CONTAINING_RECORD(iface, editsvcs, IHTMLEditServices_iface); +} + +static HRESULT WINAPI editsvcs_QueryInterface(IHTMLEditServices *iface, REFIID riid, void **ppv) +{ + editsvcs *This = impl_from_IHTMLEditServices(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv); + + if(IsEqualGUID(riid, &IID_IUnknown)) { + *ppv = &This->IHTMLEditServices_iface; + } else if(IsEqualGUID(riid, &IID_IHTMLEditServices)) { + *ppv = &This->IHTMLEditServices_iface; + } else { + *ppv = NULL; + FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI editsvcs_AddRef(IHTMLEditServices *iface) +{ + editsvcs *This = impl_from_IHTMLEditServices(iface); + LONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + return ref; +} + +static ULONG WINAPI editsvcs_Release(IHTMLEditServices *iface) +{ + editsvcs *This = impl_from_IHTMLEditServices(iface); + LONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + if(!ref) + heap_free(This); + + return ref; +} + +static HRESULT WINAPI editsvcs_AddDesigner(IHTMLEditServices *iface, + IHTMLEditDesigner *pIDesigner) +{ + editsvcs *This = impl_from_IHTMLEditServices(iface); + FIXME("(%p)->(%p)\n", This, pIDesigner); + return E_NOTIMPL; +} + +static HRESULT WINAPI editsvcs_RemoveDesigner(IHTMLEditServices *iface, + IHTMLEditDesigner *pIDesigner) +{ + editsvcs *This = impl_from_IHTMLEditServices(iface); + FIXME("(%p)->(%p)\n", This, pIDesigner); + return E_NOTIMPL; +} + +static HRESULT WINAPI editsvcs_GetSelectionServices(IHTMLEditServices *iface, + IMarkupContainer *pIContainer, ISelectionServices **ppSelSvc) +{ + editsvcs *This = impl_from_IHTMLEditServices(iface); + FIXME("(%p)->(%p,%p)\n", This, pIContainer, ppSelSvc); + return E_NOTIMPL; +} + +static HRESULT WINAPI editsvcs_MoveToSelectionAnchor(IHTMLEditServices *iface, + IMarkupPointer *pIStartAnchor) +{ + editsvcs *This = impl_from_IHTMLEditServices(iface); + FIXME("(%p)->(%p)\n", This, pIStartAnchor); + return E_NOTIMPL; +} + +static HRESULT WINAPI editsvcs_MoveToSelectionEnd(IHTMLEditServices *iface, + IMarkupPointer *pIEndAnchor) +{ + editsvcs *This = impl_from_IHTMLEditServices(iface); + FIXME("(%p)->(%p)\n", This, pIEndAnchor); + return E_NOTIMPL; +} + +static HRESULT WINAPI editsvcs_SelectRange(IHTMLEditServices *iface, + IMarkupPointer *pStart, IMarkupPointer *pEnd, SELECTION_TYPE eType) +{ + editsvcs *This = impl_from_IHTMLEditServices(iface); + FIXME("(%p)->(%p,%p,%#x)\n", This, pStart, pEnd, eType); + return E_NOTIMPL; +} + +static const IHTMLEditServicesVtbl editsvcsVtbl = { + editsvcs_QueryInterface, + editsvcs_AddRef, + editsvcs_Release, + editsvcs_AddDesigner, + editsvcs_RemoveDesigner, + editsvcs_GetSelectionServices, + editsvcs_MoveToSelectionAnchor, + editsvcs_MoveToSelectionEnd, + editsvcs_SelectRange, +}; + +static IHTMLEditServices *create_editsvcs(void) +{ + editsvcs *ret = heap_alloc(sizeof(*ret)); + + if (ret) { + ret->IHTMLEditServices_iface.lpVtbl = &editsvcsVtbl; + ret->ref = 1; + return &ret->IHTMLEditServices_iface; + } + + return NULL; +} + /********************************************************** * IServiceProvider implementation */ @@ -246,6 +373,9 @@ if(!This->doc_obj->undomgr) This->doc_obj->undomgr = create_undomgr(); + if (!This->doc_obj->undomgr) + return E_OUTOFMEMORY; + return IOleUndoManager_QueryInterface(This->doc_obj->undomgr, riid, ppv); } @@ -259,6 +389,18 @@ return IWindowForBindingUI_QueryInterface(&This->doc_obj->IWindowForBindingUI_iface, riid, ppv); } + if(IsEqualGUID(&SID_SHTMLEditServices, guidService)) { + TRACE("SID_SHTMLEditServices\n"); + + if(!This->doc_obj->editsvcs) + This->doc_obj->editsvcs = create_editsvcs(); + + if (!This->doc_obj->editsvcs) + return E_OUTOFMEMORY; + + return IHTMLEditServices_QueryInterface(This->doc_obj->editsvcs, riid, ppv); + } + TRACE("(%p)->(%s %s %p)\n", This, debugstr_guid(guidService), debugstr_guid(riid), ppv); if(This->doc_obj->client) { diff -Nru wine1.7-1.7.50/dlls/mshtml/tests/dom.c wine1.7-1.7.55/dlls/mshtml/tests/dom.c --- wine1.7-1.7.50/dlls/mshtml/tests/dom.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/mshtml/tests/dom.c 2015-11-13 14:32:40.000000000 +0000 @@ -891,6 +891,17 @@ return select; } +#define get_option_iface(u) _get_option_iface(__LINE__,u) +static IHTMLOptionElement *_get_option_iface(unsigned line, IUnknown *unk) +{ + IHTMLOptionElement *option; + HRESULT hres; + + hres = IUnknown_QueryInterface(unk, &IID_IHTMLOptionElement, (void**)&option); + ok_(__FILE__,line) (hres == S_OK, "Could not get IHTMLOptionElement: %08x\n", hres); + return option; +} + #define get_form_iface(u) _get_form_iface(__LINE__,u) static IHTMLFormElement *_get_form_iface(unsigned line, IUnknown *unk) { @@ -1692,6 +1703,60 @@ "value = %d, expected = %d\n", val, exval); } +#define test_option_put_defaultSelected(o,d) _test_option_put_defaultSelected(__LINE__,o,d) +static void _test_option_put_defaultSelected(unsigned line, IHTMLOptionElement *option, VARIANT_BOOL b) +{ + HRESULT hres; + + hres = IHTMLOptionElement_put_defaultSelected(option, b); + ok_(__FILE__,line)(hres == S_OK, "put_defaultSelected %08x\n", hres); +} + +#define test_option_defaultSelected(o,e) _test_option_defaultSelected(__LINE__,o,e) +static void _test_option_defaultSelected(unsigned line, IHTMLOptionElement *option, VARIANT_BOOL ex) +{ + HRESULT hres; + VARIANT_BOOL b; + + hres = IHTMLOptionElement_get_defaultSelected(option, NULL); + ok_(__FILE__,line)(hres == E_POINTER, "Expect E_POINTER, got %08x\n", hres); + + b = 0x100; + hres = IHTMLOptionElement_get_defaultSelected(option, &b); + ok_(__FILE__,line)(hres == S_OK, "get_defaultSelected failed: %08x\n", hres); + ok_(__FILE__,line)(b == ex, "b = %x, expected = %x\n", b, ex); +} + +static void test_option_defaultSelected_property(IHTMLOptionElement *option) +{ + test_option_defaultSelected(option, VARIANT_FALSE); + test_option_selected(option, VARIANT_FALSE); + + test_option_put_defaultSelected(option, 0x100); /* Invalid value */ + test_option_defaultSelected(option, VARIANT_FALSE); + test_option_selected(option, VARIANT_FALSE); + + test_option_put_defaultSelected(option, VARIANT_TRUE); + test_option_defaultSelected(option, VARIANT_TRUE); + test_option_selected(option, VARIANT_FALSE); + + test_option_put_defaultSelected(option, 0x100); /* Invalid value */ + test_option_defaultSelected(option, VARIANT_FALSE); + test_option_selected(option, VARIANT_FALSE); + + test_option_put_selected(option, VARIANT_TRUE); + test_option_selected(option, VARIANT_TRUE); + test_option_defaultSelected(option, VARIANT_FALSE); + + test_option_put_defaultSelected(option, VARIANT_TRUE); + test_option_defaultSelected(option, VARIANT_TRUE); + test_option_selected(option, VARIANT_TRUE); + + /* Restore defaultSelected */ + test_option_put_defaultSelected(option, VARIANT_TRUE); + test_option_put_selected(option, VARIANT_FALSE); +} + #define test_textarea_value(t,v) _test_textarea_value(__LINE__,t,v) static void _test_textarea_value(unsigned line, IUnknown *unk, const char *exval) { @@ -5085,12 +5150,32 @@ test_option_put_text(option, "new text"); test_option_put_value(option, "new value"); test_option_get_index(option, 0); + test_option_defaultSelected_property(option); test_option_put_selected(option, VARIANT_TRUE); test_option_put_selected(option, VARIANT_FALSE); IHTMLOptionElement_Release(option); } +static void test_option_form(IUnknown *uoption, IUnknown *uform) +{ + IHTMLOptionElement *option = get_option_iface(uoption); + IHTMLFormElement *form; + HRESULT hres; + + hres = IHTMLOptionElement_get_form(option, NULL); + ok(hres == E_POINTER, "got %08x\n, expected E_POINTER\n", hres); + + hres = IHTMLOptionElement_get_form(option, &form); + ok(hres == S_OK, "get_form failed: %08x\n", hres); + ok(form != NULL, "form == NULL\n"); + + ok(iface_cmp(uform, (IUnknown*)form), "Expected %p, got %p\n", uform, form); + + IHTMLOptionElement_Release(option); + IHTMLFormElement_Release(form); +} + static void test_create_img_elem(IHTMLDocument2 *doc) { IHTMLImgElement *img; @@ -5542,6 +5627,7 @@ window = get_doc_window(doc); hres = IHTMLWindow2_get_navigator(window, &nav); + ok(hres == S_OK, "get_navigator failed: %08x\n", hres); IHTMLWindow2_Release(window); hres = IOmNavigator_get_plugins(nav, &col); @@ -8527,12 +8613,18 @@ } test_elem_set_innerhtml((IUnknown*)div, - "
"); + "
"); elem = get_elem_by_id(doc, "sform", TRUE); elem2 = get_elem_by_id(doc, "form", TRUE); if(elem && elem2) { test_select_form((IUnknown*)elem, (IUnknown*)elem2); IHTMLElement_Release(elem); + + elem = get_elem_by_id(doc, "oform", TRUE); + if(elem) { + test_option_form((IUnknown*)elem, (IUnknown*)elem2); + IHTMLElement_Release(elem); + } IHTMLElement_Release(elem2); } diff -Nru wine1.7-1.7.50/dlls/mshtml/tests/htmldoc.c wine1.7-1.7.55/dlls/mshtml/tests/htmldoc.c --- wine1.7-1.7.50/dlls/mshtml/tests/htmldoc.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/mshtml/tests/htmldoc.c 2015-11-13 14:32:40.000000000 +0000 @@ -872,7 +872,13 @@ static HRESULT WINAPI NewWindowManager_QueryInterface(INewWindowManager *iface, REFIID riid, void **ppv) { - ok(0, "unexpected call\n"); + if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(riid, &IID_INewWindowManager)) { + *ppv = iface; + return S_OK; + } + + trace("NewWindowManager_QueryInterface %s\n", wine_dbgstr_guid(riid)); + *ppv = NULL; return E_NOINTERFACE; } @@ -2639,7 +2645,7 @@ ok(pchKey != NULL, "pchKey = NULL\n"); if(pchKey) ok(!*pchKey, "*pchKey=%p, expected NULL\n", *pchKey); - ok(!dw, "dw=%d, xepected 0\n", dw); + ok(!dw, "dw=%d, expected 0\n", dw); return S_OK; } @@ -2872,8 +2878,6 @@ } if(IsEqualGUID(&CGID_ShellDocView, pguidCmdGroup)) { - if(nCmdID != 63 && nCmdID != 178 && (!is_refresh || nCmdID != 37)) - test_readyState(NULL); ok(nCmdexecopt == 0, "nCmdexecopts=%08x\n", nCmdexecopt); switch(nCmdID) { @@ -2887,6 +2891,8 @@ test_readyState(NULL); load_state = LD_LOADING; }else { + if(!is_refresh) + test_readyState(NULL); if(nav_url) test_GetCurMoniker(doc_unk, NULL, nav_serv_url, FALSE); else if(load_from_stream) @@ -2950,6 +2956,7 @@ if(pvaIn) ok(V_VT(pvaOut) == VT_EMPTY, "V_VT(pvaOut)=%d\n", V_VT(pvaOut)); + test_readyState(NULL); return E_NOTIMPL; case 103: @@ -2958,6 +2965,7 @@ ok(pvaIn == NULL, "pvaIn != NULL\n"); ok(pvaOut == NULL, "pvaOut != NULL\n"); + test_readyState(NULL); return E_NOTIMPL; case 105: @@ -2966,12 +2974,14 @@ ok(pvaIn != NULL, "pvaIn == NULL\n"); ok(pvaOut == NULL, "pvaOut != NULL\n"); + test_readyState(NULL); return E_NOTIMPL; case 138: CHECK_EXPECT2(Exec_ShellDocView_138); ok(!pvaIn, "pvaIn != NULL\n"); ok(!pvaOut, "pvaOut != NULL\n"); + test_readyState(NULL); return S_OK; case 140: @@ -2980,10 +2990,13 @@ ok(pvaIn == NULL, "pvaIn != NULL\n"); ok(pvaOut == NULL, "pvaOut != NULL\n"); + test_readyState(NULL); return E_NOTIMPL; case 83: + case 101: case 102: + case 132: case 133: case 134: /* TODO */ case 135: @@ -2997,6 +3010,7 @@ case 180: case 181: case 182: + case 183: return E_NOTIMPL; default: @@ -3453,7 +3467,8 @@ if(!testing_submit) { ok(!pPostData, "pPostData = %p\n", pPostData); ok(!cbPostData, "cbPostData = %d\n", cbPostData); - ok(!lpszHeaders, "lpszHeaders = %s\n", wine_dbgstr_w(lpszHeaders)); + ok(!lpszHeaders || !strcmp_wa(lpszHeaders, "Referer: http://test.winehq.org/tests/winehq_snapshot/\r\n"), + "lpszHeaders = %s\n", wine_dbgstr_w(lpszHeaders)); }else { ok(cbPostData == 9, "cbPostData = %d\n", cbPostData); ok(!memcmp(pPostData, "cmd=TEST", cbPostData), "pPostData = %p\n", pPostData); @@ -8497,8 +8512,12 @@ hres = IServiceProvider_QueryService(provider, &SID_SContainerDispatch, &IID_IUnknown, (void**)&unk); ok(hres == S_OK, "got 0x%08x\n", hres); ok(iface_cmp((IUnknown*)doc, unk), "got wrong pointer\n"); + IUnknown_Release(unk); + hres = IServiceProvider_QueryService(provider, &SID_SHTMLEditServices, &IID_IHTMLEditServices, (void**)&unk); + ok(hres == S_OK, "QueryService(HTMLEditServices) failed: %08x\n", hres); IUnknown_Release(unk); + IServiceProvider_Release(provider); release_document(doc); } diff -Nru wine1.7-1.7.50/dlls/mshtml/tests/xmlhttprequest.c wine1.7-1.7.55/dlls/mshtml/tests/xmlhttprequest.c --- wine1.7-1.7.50/dlls/mshtml/tests/xmlhttprequest.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/mshtml/tests/xmlhttprequest.c 2015-11-13 14:32:40.000000000 +0000 @@ -805,6 +805,9 @@ trace("abort before send() is fired\n"); create_xmlhttprequest(doc); + if(!xhr) + return; + V_VT(&var) = VT_DISPATCH; V_DISPATCH(&var) = (IDispatch*)&xmlhttprequest_onreadystatechange_obj; hres = IHTMLXMLHttpRequest_put_onreadystatechange(xhr, var); diff -Nru wine1.7-1.7.50/dlls/mshtml/txtrange.c wine1.7-1.7.55/dlls/mshtml/txtrange.c --- wine1.7-1.7.50/dlls/mshtml/txtrange.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/mshtml/txtrange.c 2015-11-13 14:32:40.000000000 +0000 @@ -1207,7 +1207,7 @@ if(!Count) { *ActualCount = 0; - return IHTMLTxtRange_collapse(&This->IHTMLTxtRange_iface, TRUE); + return IHTMLTxtRange_collapse(&This->IHTMLTxtRange_iface, VARIANT_TRUE); } switch(unit) { @@ -1219,7 +1219,7 @@ *ActualCount = move_by_chars(&start, Count); set_start_point(This, &start); - IHTMLTxtRange_collapse(&This->IHTMLTxtRange_iface, TRUE); + IHTMLTxtRange_collapse(&This->IHTMLTxtRange_iface, VARIANT_TRUE); free_rangepoint(&start); break; } @@ -1232,7 +1232,7 @@ *ActualCount = move_by_words(&start, Count); set_start_point(This, &start); - IHTMLTxtRange_collapse(&This->IHTMLTxtRange_iface, TRUE); + IHTMLTxtRange_collapse(&This->IHTMLTxtRange_iface, VARIANT_TRUE); free_rangepoint(&start); break; } diff -Nru wine1.7-1.7.50/dlls/msi/action.c wine1.7-1.7.55/dlls/msi/action.c --- wine1.7-1.7.50/dlls/msi/action.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msi/action.c 2015-11-13 14:32:40.000000000 +0000 @@ -255,8 +255,7 @@ len++; break; default: - if (!count) in_quotes = FALSE; - else in_quotes = TRUE; + if (count) in_quotes = TRUE; len++; break; } @@ -277,8 +276,7 @@ break; default: state = state_token; - if (!count) in_quotes = FALSE; - else in_quotes = TRUE; + if (count) in_quotes = TRUE; len++; break; } @@ -287,6 +285,7 @@ default: break; } if (!ignore) *out++ = *p; + if (!count) in_quotes = FALSE; } done: @@ -329,7 +328,7 @@ ptr2 = strchrW( ptr, '=' ); if (!ptr2) return ERROR_INVALID_COMMAND_LINE; - + len = ptr2 - ptr; if (!len) return ERROR_INVALID_COMMAND_LINE; @@ -2378,6 +2377,18 @@ TRACE("%s resolves to %s\n", debugstr_w(name), debugstr_w(folder->ResolvedTarget)); } +static ULONGLONG get_volume_space_required( MSIPACKAGE *package ) +{ + MSICOMPONENT *comp; + ULONGLONG ret = 0; + + LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry ) + { + if (comp->Action == INSTALLSTATE_LOCAL) ret += comp->Cost; + } + return ret; +} + static UINT ACTION_CostFinalize(MSIPACKAGE *package) { static const WCHAR query[] = @@ -2392,6 +2403,12 @@ static const WCHAR szPrimaryVolumeSpaceAvailable[] = {'P','r','i','m','a','r','y','V','o','l','u','m','e','S','p','a','c','e', 'A','v','a','i','l','a','b','l','e',0}; + static const WCHAR szPrimaryVolumeSpaceRequired[] = + {'P','r','i','m','a','r','y','V','o','l','u','m','e','S','p','a','c','e', + 'R','e','q','u','i','r','e','d',0}; + static const WCHAR szPrimaryVolumeSpaceRemaining[] = + {'P','r','i','m','a','r','y','V','o','l','u','m','e','S','p','a','c','e', + 'R','e','m','a','i','n','i','n','g',0}; static const WCHAR szOutOfNoRbDiskSpace[] = {'O','u','t','O','f','N','o','R','b','D','i','s','k','S','p','a','c','e',0}; MSICOMPONENT *comp; @@ -2442,6 +2459,8 @@ if (!level) msi_set_property( package->db, szInstallLevel, szOne, -1 ); msi_free(level); + if ((rc = MSI_SetFeatureStates( package ))) return rc; + if ((primary_key = msi_dup_property( package->db, szPrimaryFolder ))) { if ((primary_folder = msi_dup_property( package->db, primary_key ))) @@ -2449,17 +2468,23 @@ if (((primary_folder[0] >= 'A' && primary_folder[0] <= 'Z') || (primary_folder[0] >= 'a' && primary_folder[0] <= 'z')) && primary_folder[1] == ':') { + static const WCHAR fmtW[] = {'%','l','u',0}; ULARGE_INTEGER free; + ULONGLONG required; + WCHAR buf[21]; primary_folder[2] = 0; if (GetDiskFreeSpaceExW( primary_folder, &free, NULL, NULL )) { - static const WCHAR fmtW[] = {'%','l','u',0}; - WCHAR buf[21]; - sprintfW( buf, fmtW, free.QuadPart / 512 ); msi_set_property( package->db, szPrimaryVolumeSpaceAvailable, buf, -1 ); } + required = get_volume_space_required( package ); + sprintfW( buf, fmtW, required / 512 ); + msi_set_property( package->db, szPrimaryVolumeSpaceRequired, buf, -1 ); + + sprintfW( buf, fmtW, (free.QuadPart - required) / 512 ); + msi_set_property( package->db, szPrimaryVolumeSpaceRemaining, buf, -1 ); msi_set_property( package->db, szPrimaryVolumePath, primary_folder, 2 ); } msi_free( primary_folder ); @@ -2471,7 +2496,7 @@ msi_set_property( package->db, szOutOfDiskSpace, szZero, -1 ); msi_set_property( package->db, szOutOfNoRbDiskSpace, szZero, -1 ); - return MSI_SetFeatureStates(package); + return ERROR_SUCCESS; } static BYTE *parse_value( MSIPACKAGE *package, const WCHAR *value, DWORD len, DWORD *type, DWORD *size ) @@ -6922,13 +6947,13 @@ { MSIPACKAGE *package = param; LPCWSTR name, value, component; - LPWSTR data = NULL, newval = NULL, deformatted = NULL, ptr; - DWORD flags, type, size; + WCHAR *data = NULL, *newval = NULL, *deformatted = NULL, *p, *q; + DWORD flags, type, size, len, len_value = 0; UINT res; HKEY env = NULL; MSICOMPONENT *comp; MSIRECORD *uirow; - int action = 0; + int action = 0, found = 0; component = MSI_RecordGetString(rec, 4); comp = msi_get_loaded_component(package, component); @@ -6956,7 +6981,20 @@ goto done; } - value = deformatted; + if ((value = deformatted)) + { + if (flags & ENV_MOD_PREFIX) + { + p = strrchrW( value, ';' ); + len_value = p - value; + } + else if (flags & ENV_MOD_APPEND) + { + value = strchrW( value, ';' ) + 1; + len_value = strlenW( value ); + } + else len_value = strlenW( value ); + } res = open_env_key( flags, &env ); if (res != ERROR_SUCCESS) @@ -6982,10 +7020,6 @@ res = ERROR_SUCCESS; goto done; } - - /* If we are appending but the string was empty, strip ; */ - if ((flags & ENV_MOD_APPEND) && (value[0] == szSemiColon[0])) value++; - size = (lstrlenW(value) + 1) * sizeof(WCHAR); newval = strdupW(value); if (!newval) @@ -7005,15 +7039,14 @@ goto done; } - data = msi_alloc(size); - if (!data) + if (!(p = q = data = msi_alloc( size ))) { msi_free(deformatted); RegCloseKey(env); return ERROR_OUTOFMEMORY; } - res = RegQueryValueExW(env, name, NULL, &type, (LPVOID)data, &size); + res = RegQueryValueExW( env, name, NULL, &type, (BYTE *)data, &size ); if (res != ERROR_SUCCESS) goto done; @@ -7026,20 +7059,28 @@ goto done; } - size = (lstrlenW(data) + 1) * sizeof(WCHAR); - if (flags & ENV_MOD_MASK) + for (;;) { - DWORD mod_size; - int multiplier = 0; - if (flags & ENV_MOD_APPEND) multiplier++; - if (flags & ENV_MOD_PREFIX) multiplier++; - mod_size = lstrlenW(value) * multiplier; - size += mod_size * sizeof(WCHAR); + while (*q && *q != ';') q++; + len = q - p; + if (value && len == len_value && !memcmp( value, p, len * sizeof(WCHAR) ) && + (!p[len] || p[len] == ';')) + { + found = 1; + break; + } + if (!*q) break; + p = ++q; } - newval = msi_alloc(size); - ptr = newval; - if (!newval) + if (found) + { + TRACE("string already set\n"); + goto done; + } + + size = (len_value + 1 + strlenW( data ) + 1) * sizeof(WCHAR); + if (!(p = newval = msi_alloc( size ))) { res = ERROR_OUTOFMEMORY; goto done; @@ -7047,21 +7088,24 @@ if (flags & ENV_MOD_PREFIX) { - lstrcpyW(newval, value); - ptr = newval + lstrlenW(value); + memcpy( newval, value, len_value * sizeof(WCHAR) ); + newval[len_value] = ';'; + p = newval + len_value + 1; action |= 0x80000000; } - lstrcpyW(ptr, data); + strcpyW( p, data ); if (flags & ENV_MOD_APPEND) { - lstrcatW(newval, value); + p += strlenW( data ); + *p++ = ';'; + memcpy( p, value, (len_value + 1) * sizeof(WCHAR) ); action |= 0x40000000; } } TRACE("setting %s to %s\n", debugstr_w(name), debugstr_w(newval)); - res = RegSetValueExW(env, name, 0, type, (LPVOID)newval, size); + res = RegSetValueExW( env, name, 0, type, (BYTE *)newval, size ); if (res) { WARN("Failed to set %s to %s (%d)\n", debugstr_w(name), debugstr_w(newval), res); diff -Nru wine1.7-1.7.50/dlls/msi/automation.c wine1.7-1.7.55/dlls/msi/automation.c --- wine1.7-1.7.50/dlls/msi/automation.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msi/automation.c 2015-11-13 14:32:40.000000000 +0000 @@ -1437,7 +1437,7 @@ hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr); if (FAILED(hr)) return hr; V_VT(pVarResult) = VT_BOOL; - V_BOOL(pVarResult) = MsiGetMode(This->msiHandle, V_I4(&varg0)); + V_BOOL(pVarResult) = MsiGetMode(This->msiHandle, V_I4(&varg0)) ? VARIANT_TRUE : VARIANT_FALSE; } else if (wFlags & DISPATCH_PROPERTYPUT) { hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr); if (FAILED(hr)) return hr; @@ -1832,12 +1832,36 @@ EXCEPINFO* pExcepInfo, UINT* puArgErr) { - if (!(wFlags & DISPATCH_METHOD)) + UINT ret; + HRESULT hr; + MSIHANDLE hsuminfo; + IDispatch *dispatch; + VARIANTARG varg0, varg1; + + if (!(wFlags & DISPATCH_PROPERTYGET)) return DISP_E_MEMBERNOTFOUND; - FIXME("\n"); + VariantInit(&varg1); + hr = DispGetParam(pDispParams, 1, VT_I4, &varg1, puArgErr); + if (FAILED(hr)) + return hr; - VariantInit(pVarResult); + VariantInit(&varg0); + hr = DispGetParam(pDispParams, 0, VT_BSTR, &varg0, puArgErr); + if (FAILED(hr)) + return hr; + + ret = MsiGetSummaryInformationW(0, V_BSTR(&varg0), V_I4(&varg1), &hsuminfo); + VariantClear(&varg0); + if (ret != ERROR_SUCCESS) + return DISP_E_EXCEPTION; + + hr = create_summaryinfo(hsuminfo, &dispatch); + if (FAILED(hr)) + return hr; + + V_VT(pVarResult) = VT_DISPATCH; + V_DISPATCH(pVarResult) = dispatch; return S_OK; } @@ -2029,7 +2053,7 @@ /* Return VT_BOOL clarifying whether registry key exists or not. */ case VT_EMPTY: V_VT(pVarResult) = VT_BOOL; - V_BOOL(pVarResult) = (ret == ERROR_SUCCESS); + V_BOOL(pVarResult) = (ret == ERROR_SUCCESS) ? VARIANT_TRUE : VARIANT_FALSE; break; /* Return the value of specified key if it exists. */ diff -Nru wine1.7-1.7.50/dlls/msi/dialog.c wine1.7-1.7.55/dlls/msi/dialog.c --- wine1.7-1.7.50/dlls/msi/dialog.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msi/dialog.c 2015-11-13 14:32:40.000000000 +0000 @@ -2691,7 +2691,7 @@ /* create the treeview control */ style = TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT; - style |= WS_GROUP | WS_VSCROLL; + style |= WS_GROUP | WS_VSCROLL | WS_TABSTOP; control = msi_dialog_add_control( dialog, rec, WC_TREEVIEWW, style ); if (!control) { diff -Nru wine1.7-1.7.50/dlls/msi/msiquery.c wine1.7-1.7.55/dlls/msi/msiquery.c --- wine1.7-1.7.50/dlls/msi/msiquery.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msi/msiquery.c 2015-11-13 14:32:40.000000000 +0000 @@ -354,7 +354,7 @@ if ((type & MSI_DATASIZEMASK) == 2) MSI_RecordSetInteger(*rec, i, ival - (1<<15)); else - MSI_RecordSetInteger(*rec, i, ival - (1<<31)); + MSI_RecordSetInteger(*rec, i, ival - (1u<<31)); } } diff -Nru wine1.7-1.7.50/dlls/msi/package.c wine1.7-1.7.55/dlls/msi/package.c --- wine1.7-1.7.50/dlls/msi/package.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msi/package.c 2015-11-13 14:32:40.000000000 +0000 @@ -2125,6 +2125,8 @@ MSIRECORD *row; UINT rc = ERROR_FUNCTION_FAILED; + TRACE("%p %s %p %p\n", db, debugstr_w(szName), szValueBuf, pchValueBuf); + row = msi_get_property_row( db, szName ); if (*pchValueBuf > 0) diff -Nru wine1.7-1.7.50/dlls/msi/registry.c wine1.7-1.7.55/dlls/msi/registry.c --- wine1.7-1.7.50/dlls/msi/registry.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msi/registry.c 2015-11-13 14:32:40.000000000 +0000 @@ -173,6 +173,10 @@ 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\', 'I','n','s','t','a','l','l','e','r','\\','C','o','m','p','o','n','e','n','t','s','\\',0}; +static const WCHAR szInstaller_Components[] = { + 'S','o','f','t','w','a','r','e','\\','C','l','a','s','s','e','s','\\', + 'I','n','s','t','a','l','l','e','r','\\','C','o','m','p','o','n','e','n','t','s','\\',0}; + static const WCHAR szUserFeatures[] = { 'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\', 'I','n','s','t','a','l','l','e','r','\\','F','e','a','t','u','r','e','s','\\',0}; @@ -650,6 +654,7 @@ UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY *key, BOOL create) { WCHAR squished_cc[GUID_SIZE], keypath[0x200]; + UINT ret; if (!squash_guid(szComponent, squished_cc)) return ERROR_FUNCTION_FAILED; TRACE("%s squished %s\n", debugstr_w(szComponent), debugstr_w(squished_cc)); @@ -658,7 +663,12 @@ strcatW(keypath, squished_cc); if (create) return RegCreateKeyW(HKEY_CURRENT_USER, keypath, key); - return RegOpenKeyW(HKEY_CURRENT_USER, keypath, key); + ret = RegOpenKeyW(HKEY_CURRENT_USER, keypath, key); + if (ret != ERROR_FILE_NOT_FOUND) return ret; + + strcpyW(keypath, szInstaller_Components); + strcatW(keypath, squished_cc); + return RegOpenKeyW(HKEY_LOCAL_MACHINE, keypath, key); } UINT MSIREG_OpenUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid, HKEY *key, BOOL create) diff -Nru wine1.7-1.7.50/dlls/msi/tests/action.c wine1.7-1.7.55/dlls/msi/tests/action.c --- wine1.7-1.7.50/dlls/msi/tests/action.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msi/tests/action.c 2015-11-13 14:32:40.000000000 +0000 @@ -218,7 +218,8 @@ "Var23\t+-MSITESTVAR19\t1\tOne\n" "Var24\t+-MSITESTVAR19\t[~]2\tOne\n" "Var25\t+-MSITESTVAR20\t1\tOne\n" - "Var26\t+-MSITESTVAR20\t2[~]\tOne\n"; + "Var26\t+-MSITESTVAR20\t2[~]\tOne\n" + "Var27\t+-MSITESTVAR21\t[~];1\tOne\n"; static const char service_install_dat[] = "ServiceInstall\tName\tDisplayName\tServiceType\tStartType\tErrorControl\t" @@ -5145,6 +5146,7 @@ "1;;2;;", /* MSITESTVAR18 */ "1", /* MSITESTVAR19 */ "1", /* MSITESTVAR20 */ + "1", /* MSITESTVAR21 */ NULL }; UINT r; @@ -5172,6 +5174,9 @@ res = RegSetValueExA(env, "MSITESTVAR2", 0, REG_SZ, (const BYTE *)"0", 2); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + res = RegSetValueExA(env, "MSITESTVAR21", 0, REG_SZ, (const BYTE *)"1", 2); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); r = MsiInstallProductA(msifile, NULL); @@ -5264,6 +5269,7 @@ error: RegDeleteValueA(env, "MSITESTVAR1"); RegDeleteValueA(env, "MSITESTVAR2"); + RegDeleteValueA(env, "MSITESTVAR21"); RegCloseKey(env); delete_test_files(); @@ -5848,10 +5854,14 @@ { static const char keypath[] = "Software\\Microsoft\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA"; + static const char keypath2[] = + "Software\\Classes\\Installer\\Components\\0CBCFA296AC907244845745CEEB2F8AA"; UINT r; LONG res; HKEY key; + BYTE *data; + DWORD size; if (is_process_limited()) { @@ -5873,11 +5883,49 @@ } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + size = 0; + r = MsiProvideQualifiedComponentA("{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}", + "english.txt", INSTALLMODE_DEFAULT, NULL, &size); + ok(r == ERROR_SUCCESS, "MsiProvideQualifiedCompontent returned %d\n", r); + res = RegOpenKeyA(HKEY_CURRENT_USER, keypath, &key); ok(res == ERROR_SUCCESS, "components key not created %d\n", res); - res = RegQueryValueExA(key, "english.txt", NULL, NULL, NULL, NULL); + res = RegQueryValueExA(key, "english.txt", NULL, NULL, NULL, &size); ok(res == ERROR_SUCCESS, "value not found %d\n", res); + + data = HeapAlloc(GetProcessHeap(), 0, size); + res = RegQueryValueExA(key, "english.txt", NULL, NULL, data, &size); + ok(res == ERROR_SUCCESS, "value not found %d\n", res); + RegCloseKey(key); + + res = RegDeleteKeyA(HKEY_CURRENT_USER, keypath); + ok(res == ERROR_SUCCESS, "RegDeleteKey failed %d\n", res); + + res = RegCreateKeyExA(HKEY_LOCAL_MACHINE, keypath2, 0, NULL, REG_OPTION_NON_VOLATILE, + MAXIMUM_ALLOWED | KEY_WOW64_64KEY, NULL, &key, NULL ); + ok(res == ERROR_SUCCESS, "RegCreateKeyEx failed %d\n", res); + res = RegSetValueExA(key, "english.txt", 0, REG_MULTI_SZ, data, size); + ok(res == ERROR_SUCCESS, "RegSetValueEx failed %d\n", res); + RegCloseKey(key); + + size = 0; + r = MsiProvideQualifiedComponentA("{92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA}", + "english.txt", INSTALLMODE_DEFAULT, NULL, &size); + ok(r == ERROR_SUCCESS, "MsiProvideQualifiedCompontent returned %d\n", r); + + if (pRegDeleteKeyExA) + res = pRegDeleteKeyExA(HKEY_LOCAL_MACHINE, keypath2, KEY_WOW64_64KEY, 0); + else + res = RegDeleteKeyA(HKEY_LOCAL_MACHINE, keypath2); + ok(res == ERROR_SUCCESS, "RegDeleteKey failed %d\n", res); + + res = RegCreateKeyA(HKEY_CURRENT_USER, keypath, &key); + ok(res == ERROR_SUCCESS, "RegCreateKey failed %d\n", res); + + res = RegSetValueExA(key, "english.txt", 0, REG_MULTI_SZ, data, size); + ok(res == ERROR_SUCCESS, "RegSetValueEx failed %d\n", res); + HeapFree(GetProcessHeap(), 0, data); RegCloseKey(key); r = MsiInstallProductA(msifile, "REMOVE=ALL"); diff -Nru wine1.7-1.7.50/dlls/msi/tests/automation.c wine1.7-1.7.55/dlls/msi/tests/automation.c --- wine1.7-1.7.50/dlls/msi/tests/automation.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msi/tests/automation.c 2015-11-13 14:32:40.000000000 +0000 @@ -1128,6 +1128,25 @@ return invoke(pInstaller, "UILevel", DISPATCH_PROPERTYPUT, &dispparams, &varresult, VT_EMPTY); } +static HRESULT Installer_SummaryInformation(BSTR PackagePath, int UpdateCount, IDispatch **pSumInfo) +{ + VARIANT varresult; + VARIANTARG vararg[2]; + DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0}; + HRESULT hr; + + VariantInit(&vararg[1]); + V_VT(&vararg[1]) = VT_BSTR; + V_BSTR(&vararg[1]) = SysAllocString(PackagePath); + VariantInit(&vararg[0]); + V_VT(&vararg[0]) = VT_I4; + V_I4(&vararg[0]) = UpdateCount; + + hr = invoke(pInstaller, "SummaryInformation", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_DISPATCH); + *pSumInfo = V_DISPATCH(&varresult); + return hr; +} + static HRESULT Session_Installer(IDispatch *pSession, IDispatch **pInst) { VARIANT varresult; @@ -1185,7 +1204,7 @@ return hr; } -static HRESULT Session_ModeGet(IDispatch *pSession, int iFlag, BOOL *pMode) +static HRESULT Session_ModeGet(IDispatch *pSession, int iFlag, VARIANT_BOOL *mode) { VARIANT varresult; VARIANTARG vararg[1]; @@ -1197,12 +1216,12 @@ V_I4(&vararg[0]) = iFlag; hr = invoke(pSession, "Mode", DISPATCH_PROPERTYGET, &dispparams, &varresult, VT_BOOL); - *pMode = V_BOOL(&varresult); + *mode = V_BOOL(&varresult); VariantClear(&varresult); return hr; } -static HRESULT Session_ModePut(IDispatch *pSession, int iFlag, BOOL bMode) +static HRESULT Session_ModePut(IDispatch *pSession, int iFlag, VARIANT_BOOL mode) { VARIANT varresult; VARIANTARG vararg[2]; @@ -1214,7 +1233,7 @@ V_I4(&vararg[1]) = iFlag; VariantInit(&vararg[0]); V_VT(&vararg[0]) = VT_BOOL; - V_BOOL(&vararg[0]) = bMode; + V_BOOL(&vararg[0]) = mode; return invoke(pSession, "Mode", DISPATCH_PROPERTYPUT, &dispparams, &varresult, VT_EMPTY); } @@ -1857,7 +1876,7 @@ WCHAR stringw[MAX_PATH]; CHAR string[MAX_PATH]; UINT len; - BOOL bool; + VARIANT_BOOL bool; int myint; IDispatch *pDatabase = NULL, *pInst = NULL, *record = NULL; ULONG refs_before, refs_after; @@ -1925,15 +1944,15 @@ ok(!bool, "Maintenance mode is %d\n", bool); /* Session::Mode, put */ - hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTATEND, TRUE); + hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTATEND, VARIANT_TRUE); ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr); hr = Session_ModeGet(pSession, MSIRUNMODE_REBOOTATEND, &bool); ok(hr == S_OK, "Session_ModeGet failed, hresult 0x%08x\n", hr); ok(bool, "Reboot at end session mode is %d, expected 1\n", bool); - hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTATEND, FALSE); /* set it again so we don't reboot */ + hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTATEND, VARIANT_FALSE); /* set it again so we don't reboot */ ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr); - hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTNOW, TRUE); + hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTNOW, VARIANT_TRUE); ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr); ok_exception(hr, szModeFlag); @@ -1941,11 +1960,11 @@ ok(hr == S_OK, "Session_ModeGet failed, hresult 0x%08x\n", hr); ok(bool, "Reboot now mode is %d, expected 1\n", bool); - hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTNOW, FALSE); /* set it again so we don't reboot */ + hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTNOW, VARIANT_FALSE); /* set it again so we don't reboot */ ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr); ok_exception(hr, szModeFlag); - hr = Session_ModePut(pSession, MSIRUNMODE_MAINTENANCE, TRUE); + hr = Session_ModePut(pSession, MSIRUNMODE_MAINTENANCE, VARIANT_TRUE); ok(hr == DISP_E_EXCEPTION, "Session_ModePut failed, hresult 0x%08x\n", hr); ok_exception(hr, szModeFlag); @@ -2602,7 +2621,7 @@ static const WCHAR szIntegerDataException[] = { 'I','n','t','e','g','e','r','D','a','t','a',',','F','i','e','l','d',0 }; WCHAR szPath[MAX_PATH]; HRESULT hr; - IDispatch *pSession = NULL, *pDatabase = NULL, *pRecord = NULL, *pStringList = NULL; + IDispatch *pSession = NULL, *pDatabase = NULL, *pRecord = NULL, *pStringList = NULL, *pSumInfo = NULL; int iValue, iCount; if (!pInstaller) return; @@ -2678,6 +2697,18 @@ IDispatch_Release(pDatabase); } + /* Installer::SummaryInformation */ + hr = Installer_SummaryInformation(szPath, 0, &pSumInfo); + ok(hr == S_OK, "Installer_SummaryInformation failed, hresult 0x%08x\n", hr); + if (hr == S_OK) + { + test_SummaryInfo(pSumInfo, summary_info, sizeof(summary_info)/sizeof(msi_summary_info), TRUE); + IDispatch_Release(pSumInfo); + } + + hr = Installer_SummaryInformation(NULL, 0, &pSumInfo); + ok(hr == DISP_E_EXCEPTION, "Installer_SummaryInformation failed, hresult 0x%08x\n", hr); + /* Installer::RegistryValue */ test_Installer_RegistryValue(); diff -Nru wine1.7-1.7.50/dlls/msi/tests/install.c wine1.7-1.7.55/dlls/msi/tests/install.c --- wine1.7-1.7.50/dlls/msi/tests/install.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msi/tests/install.c 2015-11-13 14:32:40.000000000 +0000 @@ -1112,10 +1112,16 @@ "CustomAction\tAction\n" "TestPrimaryVolumePath0\t19\t\tPrimaryVolumePath set before CostFinalize\t\n" "TestPrimaryVolumeSpaceAvailable0\t19\t\tPrimaryVolumeSpaceAvailable set before CostFinalize\t\n" + "TestPrimaryVolumeSpaceRequired0\t19\t\tPrimaryVolumeSpaceRequired set before CostFinalize\t\n" + "TestPrimaryVolumeSpaceRemaining0\t19\t\tPrimaryVolumeSpaceRemaining set before CostFinalize\t\n" "TestPrimaryVolumePath1\t19\t\tPrimaryVolumePath set before InstallValidate\t\n" "TestPrimaryVolumeSpaceAvailable1\t19\t\tPrimaryVolumeSpaceAvailable not set before InstallValidate\t\n" + "TestPrimaryVolumeSpaceRequired1\t19\t\tPrimaryVolumeSpaceRequired not set before InstallValidate\t\n" + "TestPrimaryVolumeSpaceRemaining1\t19\t\tPrimaryVolumeSpaceRemaining not set before InstallValidate\t\n" "TestPrimaryVolumePath2\t19\t\tPrimaryVolumePath not set after InstallValidate\t\n" - "TestPrimaryVolumeSpaceAvailable2\t19\t\tPrimaryVolumeSpaceAvailable not set after InstallValidate\t\n"; + "TestPrimaryVolumeSpaceAvailable2\t19\t\tPrimaryVolumeSpaceAvailable not set after InstallValidate\t\n" + "TestPrimaryVolumeSpaceRequired2\t19\t\tPrimaryVolumeSpaceRequired not set after InstallValidate\t\n" + "TestPrimaryVolumeSpaceRemaining2\t19\t\tPrimaryVolumeSpaceRemaining not set after InstallValidate\t\n"; static const char vp_install_exec_seq_dat[] = "Action\tCondition\tSequence\n" @@ -1126,12 +1132,18 @@ "FileCost\t\t300\n" "TestPrimaryVolumePath0\tPrimaryVolumePath AND NOT REMOVE\t400\n" "TestPrimaryVolumeSpaceAvailable0\tPrimaryVolumeSpaceAvailable AND NOT REMOVE\t500\n" + "TestPrimaryVolumeSpaceRequired0\tPrimaryVolumeSpaceRequired AND NOT REMOVE\t510\n" + "TestPrimaryVolumeSpaceRemaining0\tPrimaryVolumeSpaceRemaining AND NOT REMOVE\t520\n" "CostFinalize\t\t600\n" "TestPrimaryVolumePath1\tPrimaryVolumePath AND NOT REMOVE\t600\n" "TestPrimaryVolumeSpaceAvailable1\tNOT PrimaryVolumeSpaceAvailable AND NOT REMOVE\t800\n" + "TestPrimaryVolumeSpaceRequired1\tNOT PrimaryVolumeSpaceRequired AND NOT REMOVE\t810\n" + "TestPrimaryVolumeSpaceRemaining1\tNOT PrimaryVolumeSpaceRemaining AND NOT REMOVE\t820\n" "InstallValidate\t\t900\n" "TestPrimaryVolumePath2\tNOT PrimaryVolumePath AND NOT REMOVE\t1000\n" "TestPrimaryVolumeSpaceAvailable2\tNOT PrimaryVolumeSpaceAvailable AND NOT REMOVE\t1100\n" + "TestPrimaryVolumeSpaceRequired2\tNOT PrimaryVolumeSpaceRequired AND NOT REMOVE\t1110\n" + "TestPrimaryVolumeSpaceRemaining2\tNOT PrimaryVolumeSpaceRemaining AND NOT REMOVE\t1120\n" "InstallInitialize\t\t1200\n" "ProcessComponents\t\t1300\n" "RemoveFiles\t\t1400\n" @@ -3159,6 +3171,11 @@ MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); r = MsiInstallProductA(msifile, NULL); + if (r == ERROR_INSTALL_FAILURE) + { + win_skip("unprivileged user?\n"); + goto error; + } ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); if (r == ERROR_SUCCESS) { @@ -3167,6 +3184,8 @@ ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n"); ok(delete_pf("msitest", FALSE), "Directory not created\n"); } + +error: delete_cab_files(); DeleteFileA(msifile); } @@ -3181,6 +3200,12 @@ MsiSetInternalUI(INSTALLUILEVEL_NONE | INSTALLUILEVEL_SOURCERESONLY, NULL); r = MsiInstallProductA(msifile, NULL); + if (r == ERROR_INSTALL_FAILURE) + { + win_skip("unprivileged user?\n"); + goto error; + } + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); if (r == ERROR_SUCCESS) { @@ -3189,6 +3214,8 @@ ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n"); ok(delete_pf("msitest", FALSE), "Directory not created\n"); } + +error: delete_cab_files(); DeleteFileA(msifile); } @@ -4688,6 +4715,16 @@ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n"); ok(delete_pf("msitest", FALSE), "Directory not created\n"); + + r = MsiInstallProductA(msifile, "Prop1=\"Copyright \"\"My Company\"\" 2015\" MyProp=42"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n"); + ok(delete_pf("msitest", FALSE), "Directory not created\n"); + + r = MsiInstallProductA(msifile, "Prop1=\"\"\"install.exe\"\" /Install\" MyProp=\"42\""); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r); + ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n"); + ok(delete_pf("msitest", FALSE), "Directory not created\n"); error: DeleteFileA(msifile); diff -Nru wine1.7-1.7.50/dlls/msi/tests/msi.c wine1.7-1.7.55/dlls/msi/tests/msi.c --- wine1.7-1.7.50/dlls/msi/tests/msi.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msi/tests/msi.c 2015-11-13 14:32:40.000000000 +0000 @@ -4229,12 +4229,11 @@ ok(versz == verchecksz, "Expected %d, got %d\n", verchecksz, versz); /* pcchLangBuf not big enough */ - langsz = 3; + langsz = 4; lstrcpyA(lang, "lang"); r = MsiGetFileVersionA(path, NULL, NULL, lang, &langsz); ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r); - ok(!strncmp(lang, langcheck, 2), - "Expected first character of \"%s\", got \"%s\"\n", langcheck, lang); + ok(lstrcmpA(lang, "lang"), "lang not set\n"); ok(langsz >= langchecksz, "Expected %d >= %d\n", langsz, langchecksz); /* pcchVersionBuf big enough, pcchLangBuf not big enough */ @@ -4255,7 +4254,7 @@ ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(versz == verchecksz, "Expected %d, got %d\n", verchecksz, versz); ok(langsz >= langchecksz && langsz < MAX_PATH, "Expected %d >= %d\n", langsz, langchecksz); - ok(lstrcmpA(lang, "lang"), "lang buffer not modified\n"); + ok(strstr(lang, langcheck) != NULL, "expected %s in %s\n", langcheck, lang); /* NULL pcchVersionBuf and pcchLangBuf */ r = MsiGetFileVersionA(path, version, NULL, lang, NULL); diff -Nru wine1.7-1.7.50/dlls/msrle32/msrle32.c wine1.7-1.7.55/dlls/msrle32/msrle32.c --- wine1.7-1.7.50/dlls/msrle32/msrle32.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msrle32/msrle32.c 2015-11-13 14:32:40.000000000 +0000 @@ -1596,7 +1596,7 @@ /* check input format if given */ if (lpbiIn != NULL) { - if (!isSupportedMRLE(lpbiIn)) + if (!isSupportedMRLE(lpbiIn) && !isSupportedDIB(lpbiIn)) return ICERR_BADFORMAT; } @@ -1607,11 +1607,11 @@ if (lpbiIn != NULL) { if (lpbiIn->biWidth != lpbiOut->biWidth) - hr = ICERR_UNSUPPORTED; + hr = ICERR_UNSUPPORTED; if (lpbiIn->biHeight != lpbiOut->biHeight) - hr = ICERR_UNSUPPORTED; + hr = ICERR_UNSUPPORTED; if (lpbiIn->biBitCount > lpbiOut->biBitCount) - hr = ICERR_UNSUPPORTED; + hr = ICERR_UNSUPPORTED; } } @@ -1645,49 +1645,51 @@ if (pi->bDecompress) DecompressEnd(pi); - rgbIn = (const RGBQUAD*)((const BYTE*)lpbiIn + lpbiIn->biSize); - rgbOut = (const RGBQUAD*)((const BYTE*)lpbiOut + lpbiOut->biSize); - - switch (lpbiOut->biBitCount) { - case 4: - case 8: - pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed); - if (pi->palette_map == NULL) - return ICERR_MEMORY; - - for (i = 0; i < lpbiIn->biClrUsed; i++) { - pi->palette_map[i] = MSRLE32_GetNearestPaletteIndex(lpbiOut->biClrUsed, rgbOut, rgbIn[i]); - } - break; - case 15: - case 16: - pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed * 2); - if (pi->palette_map == NULL) - return ICERR_MEMORY; - - for (i = 0; i < lpbiIn->biClrUsed; i++) { - WORD color; - - if (lpbiOut->biBitCount == 15) - color = ((rgbIn[i].rgbRed >> 3) << 10) - | ((rgbIn[i].rgbGreen >> 3) << 5) | (rgbIn[i].rgbBlue >> 3); - else - color = ((rgbIn[i].rgbRed >> 3) << 11) - | ((rgbIn[i].rgbGreen >> 3) << 5) | (rgbIn[i].rgbBlue >> 3); - - pi->palette_map[i * 2 + 1] = color >> 8; - pi->palette_map[i * 2 + 0] = color & 0xFF; + if (lpbiIn->biCompression != BI_RGB) + { + rgbIn = (const RGBQUAD*)((const BYTE*)lpbiIn + lpbiIn->biSize); + rgbOut = (const RGBQUAD*)((const BYTE*)lpbiOut + lpbiOut->biSize); + + switch (lpbiOut->biBitCount) { + case 4: + case 8: + pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed); + if (pi->palette_map == NULL) + return ICERR_MEMORY; + + for (i = 0; i < lpbiIn->biClrUsed; i++) { + pi->palette_map[i] = MSRLE32_GetNearestPaletteIndex(lpbiOut->biClrUsed, rgbOut, rgbIn[i]); + } + break; + case 15: + case 16: + pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed * 2); + if (pi->palette_map == NULL) + return ICERR_MEMORY; + + for (i = 0; i < lpbiIn->biClrUsed; i++) { + WORD color; + + if (lpbiOut->biBitCount == 15) + color = ((rgbIn[i].rgbRed >> 3) << 10) + | ((rgbIn[i].rgbGreen >> 3) << 5) | (rgbIn[i].rgbBlue >> 3); + else + color = ((rgbIn[i].rgbRed >> 3) << 11) + | ((rgbIn[i].rgbGreen >> 3) << 5) | (rgbIn[i].rgbBlue >> 3); + + pi->palette_map[i * 2 + 1] = color >> 8; + pi->palette_map[i * 2 + 0] = color & 0xFF; + }; + break; + case 24: + case 32: + pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed * sizeof(RGBQUAD)); + if (pi->palette_map == NULL) + return ICERR_MEMORY; + memcpy(pi->palette_map, rgbIn, lpbiIn->biClrUsed * sizeof(RGBQUAD)); + break; }; - break; - case 24: - case 32: - pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed * sizeof(RGBQUAD)); - if (pi->palette_map == NULL) - return ICERR_MEMORY; - memcpy(pi->palette_map, rgbIn, lpbiIn->biClrUsed * sizeof(RGBQUAD)); - break; - }; - + } pi->bDecompress = TRUE; return ICERR_OK; @@ -1718,6 +1720,14 @@ assert(pic->lpbiInput->biWidth == pic->lpbiOutput->biWidth); assert(pic->lpbiInput->biHeight == pic->lpbiOutput->biHeight); + /* Uncompressed frame? */ + if (pic->lpbiInput->biCompression == BI_RGB) + { + pic->lpbiOutput->biSizeImage = pic->lpbiInput->biSizeImage; + memcpy(pic->lpOutput, pic->lpInput, pic->lpbiOutput->biSizeImage); + return ICERR_OK; + } + pic->lpbiOutput->biSizeImage = DIBWIDTHBYTES(*pic->lpbiOutput) * pic->lpbiOutput->biHeight; if (pic->lpbiInput->biBitCount == 4) return MSRLE32_DecompressRLE4(pi, pic->lpbiOutput, pic->lpInput, pic->lpOutput); diff -Nru wine1.7-1.7.50/dlls/msrle32/tests/msrle.c wine1.7-1.7.55/dlls/msrle32/tests/msrle.c --- wine1.7-1.7.50/dlls/msrle32/tests/msrle.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msrle32/tests/msrle.c 2015-11-13 14:32:40.000000000 +0000 @@ -99,7 +99,68 @@ ICClose(hic); } +static void test_raw_decompress(void) +{ + DWORD codecs[] = {FCC('D', 'I', 'B', ' '), FCC('R', 'A', 'W', ' '), + FCC('M', 'R', 'L', 'E'), BI_RGB}, i, hr; + BITMAPINFO bi; + BITMAPINFOHEADER *bih, biho; + HIC hic; + ICINFO codec_info; + void *bits, *outbits; + + /* Create an uncompressed 200x200 bitmap */ + bih = &bi.bmiHeader; + bih->biSize = sizeof(*bih); + bih->biWidth = 200; + bih->biHeight = 200; + bih->biPlanes = 1; + bih->biBitCount = 24; + bih->biCompression = BI_RGB; + bih->biSizeImage = bih->biWidth * (bih->biBitCount / 8) * bih->biHeight; + bih->biXPelsPerMeter = 10000; + bih->biYPelsPerMeter = 10000; + bih->biClrUsed = 0; + bih->biClrImportant = 0; + biho = *bih; + + bits = HeapAlloc(GetProcessHeap(), 0, bih->biSizeImage); + ok(bits != NULL, "Expected non-NULL value\n"); + outbits = HeapAlloc(GetProcessHeap(), 0, bih->biSizeImage); + ok(outbits != NULL, "Expected non-NULL value\n"); + + for (i = 0; i < sizeof(codecs) / sizeof(codecs[0]); i++) + { + memset(bits, i + 0xAF, bih->biSizeImage); + + /* Check which codec is able to decompress uncompressed data */ + hic = ICLocate(FCC('V', 'I', 'D', 'C'), codecs[i], bih, NULL, ICMODE_DECOMPRESS); + ok(hic != NULL, "Test[%d]: Expected non-NULL return\n", i); + + /* Now wich is this codec? Windows returns MRLE for uncompressed cases */ + memset(&codec_info, 0, sizeof(codec_info)); + hr = ICGetInfo(hic, &codec_info, sizeof(codec_info)); + ok(hr == sizeof(codec_info), "Test[%d]: Incorrect amount of data returned\n", i); + ok(codec_info.fccType == FCC('v', 'i', 'd', 'c'), + "Test[%d]: Expected a video type, got 0x%x\n", i, codec_info.fccType); + ok(codec_info.fccHandler == FCC('M', 'R', 'L', 'E'), + "Test[%d]: Expected MRLE, got 0x%x\n", i, codec_info.fccHandler); + + /* Decompress the frame and check if we get the same output */ + memset(outbits, 0, bih->biSizeImage); + hr = ICDecompress(hic, 0, bih, bits, &biho, outbits); + ok(hr == ICERR_OK, "Test[%d]: Expected ICERR_OK, got %d\n", i, hr); + ok(!memcmp(bits, outbits, bih->biSizeImage), "Test[%d]: Image contents do not match!\n", i); + + hr = ICClose(hic); + ok(hr == ICERR_OK, "Test[%d]: Expected ICERR_OK, got %d\n", i, hr); + } + HeapFree(GetProcessHeap(), 0, bits); + HeapFree(GetProcessHeap(), 0, outbits); +} + START_TEST(msrle) { test_encode(); + test_raw_decompress(); } diff -Nru wine1.7-1.7.50/dlls/msscript.ocx/msscript.idl wine1.7-1.7.55/dlls/msscript.ocx/msscript.idl --- wine1.7-1.7.50/dlls/msscript.ocx/msscript.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msscript.ocx/msscript.idl 2015-11-13 14:32:40.000000000 +0000 @@ -103,7 +103,7 @@ [id(0x07d2)] HRESULT ExecuteStatement([in] BSTR Statement); - [id(0x07d3)] + [id(0x07d3), vararg] HRESULT Run( [in] BSTR ProcedureName, [in] SAFEARRAY(VARIANT) *Parameters, @@ -234,7 +234,7 @@ [id(0x07d2)] HRESULT ExecuteStatement([in] BSTR Statement); - [id(0x07d3)] + [id(0x07d3), vararg] HRESULT Run( [in] BSTR ProcedureName, [in] SAFEARRAY(VARIANT) *Parameters, diff -Nru wine1.7-1.7.50/dlls/msvcirt/msvcirt.c wine1.7-1.7.55/dlls/msvcirt/msvcirt.c --- wine1.7-1.7.50/dlls/msvcirt/msvcirt.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcirt/msvcirt.c 2015-11-13 14:32:40.000000000 +0000 @@ -106,6 +106,23 @@ filebuf* __thiscall filebuf_close(filebuf*); +/* class strstreambuf */ +typedef struct { + streambuf base; + int dynamic; + int increase; + int unknown; + int constant; + allocFunction f_alloc; + freeFunction f_free; +} strstreambuf; + +/* class stdiobuf */ +typedef struct { + streambuf base; + FILE *file; +} stdiobuf; + /* class ios */ struct _ostream; typedef struct { @@ -136,14 +153,14 @@ const vtable_ptr *vtable; } ostream; -typedef struct { - LPVOID VTable; -} class_strstreambuf; - /* ??_7streambuf@@6B@ */ extern const vtable_ptr MSVCP_streambuf_vtable; /* ??_7filebuf@@6B@ */ extern const vtable_ptr MSVCP_filebuf_vtable; +/* ??_7strstreambuf@@6B@ */ +extern const vtable_ptr MSVCP_strstreambuf_vtable; +/* ??_7stdiobuf@@6B@ */ +extern const vtable_ptr MSVCP_stdiobuf_vtable; /* ??_7ios@@6B@ */ extern const vtable_ptr MSVCP_ios_vtable; @@ -174,6 +191,30 @@ VTABLE_ADD_FUNC(filebuf_underflow) VTABLE_ADD_FUNC(streambuf_pbackfail) VTABLE_ADD_FUNC(streambuf_doallocate)); + __ASM_VTABLE(strstreambuf, + VTABLE_ADD_FUNC(strstreambuf_vector_dtor) + VTABLE_ADD_FUNC(strstreambuf_sync) + VTABLE_ADD_FUNC(strstreambuf_setbuf) + VTABLE_ADD_FUNC(strstreambuf_seekoff) + VTABLE_ADD_FUNC(streambuf_seekpos) + VTABLE_ADD_FUNC(streambuf_xsputn) + VTABLE_ADD_FUNC(streambuf_xsgetn) + VTABLE_ADD_FUNC(strstreambuf_overflow) + VTABLE_ADD_FUNC(strstreambuf_underflow) + VTABLE_ADD_FUNC(streambuf_pbackfail) + VTABLE_ADD_FUNC(strstreambuf_doallocate)); + __ASM_VTABLE(stdiobuf, + VTABLE_ADD_FUNC(stdiobuf_vector_dtor) + VTABLE_ADD_FUNC(stdiobuf_sync) + VTABLE_ADD_FUNC(streambuf_setbuf) + VTABLE_ADD_FUNC(stdiobuf_seekoff) + VTABLE_ADD_FUNC(streambuf_seekpos) + VTABLE_ADD_FUNC(streambuf_xsputn) + VTABLE_ADD_FUNC(streambuf_xsgetn) + VTABLE_ADD_FUNC(stdiobuf_overflow) + VTABLE_ADD_FUNC(stdiobuf_underflow) + VTABLE_ADD_FUNC(stdiobuf_pbackfail) + VTABLE_ADD_FUNC(streambuf_doallocate)); __ASM_VTABLE(ios, VTABLE_ADD_FUNC(ios_vector_dtor)); #ifndef __GNUC__ @@ -182,6 +223,8 @@ DEFINE_RTTI_DATA0(streambuf, 0, ".?AVstreambuf@@") DEFINE_RTTI_DATA1(filebuf, 0, &streambuf_rtti_base_descriptor, ".?AVfilebuf@@") +DEFINE_RTTI_DATA1(strstreambuf, 0, &streambuf_rtti_base_descriptor, ".?AVstrstreambuf@@") +DEFINE_RTTI_DATA1(stdiobuf, 0, &streambuf_rtti_base_descriptor, ".?AVstdiobuf@@") DEFINE_RTTI_DATA0(ios, 0, ".?AVios@@") /* ??0streambuf@@IAE@PADH@Z */ @@ -458,18 +501,6 @@ return EOF; } -/* ?pbackfail@streambuf@@UAEHH@Z */ -/* ?pbackfail@streambuf@@UEAAHH@Z */ -DEFINE_THISCALL_WRAPPER(streambuf_pbackfail, 8) -#define call_streambuf_pbackfail(this, c) CALL_VTBL_FUNC(this, 36, int, (streambuf*, int), (this, c)) -int __thiscall streambuf_pbackfail(streambuf *this, int c) -{ - TRACE("(%p %d)\n", this, c); - if (this->gptr <= this->eback) - return EOF; - return *--this->gptr = c; -} - /* ?seekoff@streambuf@@UAEJJW4seek_dir@ios@@H@Z */ /* ?seekoff@streambuf@@UEAAJJW4seek_dir@ios@@H@Z */ DEFINE_THISCALL_WRAPPER(streambuf_seekoff, 16) @@ -489,6 +520,25 @@ return call_streambuf_seekoff(this, pos, SEEKDIR_beg, mode); } +/* ?pbackfail@streambuf@@UAEHH@Z */ +/* ?pbackfail@streambuf@@UEAAHH@Z */ +DEFINE_THISCALL_WRAPPER(streambuf_pbackfail, 8) +#define call_streambuf_pbackfail(this, c) CALL_VTBL_FUNC(this, 36, int, (streambuf*, int), (this, c)) +int __thiscall streambuf_pbackfail(streambuf *this, int c) +{ + TRACE("(%p %d)\n", this, c); + if (this->gptr > this->eback) + return *--this->gptr = c; + if (call_streambuf_seekoff(this, -1, SEEKDIR_cur, OPENMODE_in) == EOF) + return EOF; + if (!this->unbuffered && this->egptr) { + /* 'c' should be the next character read */ + memmove(this->gptr + 1, this->gptr, this->egptr - this->gptr - 1); + *this->gptr = c; + } + return c; +} + /* ?setb@streambuf@@IAEXPAD0H@Z */ /* ?setb@streambuf@@IEAAXPEAD0H@Z */ DEFINE_THISCALL_WRAPPER(streambuf_setb, 16) @@ -775,8 +825,8 @@ } else { printf("_fAlloc=%d\n", this->allocated); printf(" base()=%p, ebuf()=%p, blen()=%d\n", this->base, this->ebuf, streambuf_blen(this)); - printf("pbase()=%p, pptr()=%p, epptr()=%d\n", this->pbase, this->pptr, this->epptr); - printf("eback()=%p, gptr()=%p, egptr()=%d\n", this->eback, this->gptr, this->egptr); + printf("pbase()=%p, pptr()=%p, epptr()=%p\n", this->pbase, this->pptr, this->epptr); + printf("eback()=%p, gptr()=%p, egptr()=%p\n", this->eback, this->gptr, this->egptr); } } @@ -1112,6 +1162,533 @@ return *this->base.gptr; } +/* ??0strstreambuf@@QAE@ABV0@@Z */ +/* ??0strstreambuf@@QEAA@AEBV0@@Z */ +DEFINE_THISCALL_WRAPPER(strstreambuf_copy_ctor, 8) +strstreambuf* __thiscall strstreambuf_copy_ctor(strstreambuf *this, const strstreambuf *copy) +{ + TRACE("(%p %p)\n", this, copy); + *this = *copy; + this->base.vtable = &MSVCP_strstreambuf_vtable; + return this; +} + +/* ??0strstreambuf@@QAE@H@Z */ +/* ??0strstreambuf@@QEAA@H@Z */ +DEFINE_THISCALL_WRAPPER(strstreambuf_dynamic_ctor, 8) +strstreambuf* __thiscall strstreambuf_dynamic_ctor(strstreambuf* this, int length) +{ + TRACE("(%p %d)\n", this, length); + streambuf_ctor(&this->base); + this->base.vtable = &MSVCP_strstreambuf_vtable; + this->dynamic = 1; + this->increase = length; + this->constant = 0; + this->f_alloc = NULL; + this->f_free = NULL; + return this; +} + +/* ??0strstreambuf@@QAE@P6APAXJ@ZP6AXPAX@Z@Z */ +/* ??0strstreambuf@@QEAA@P6APEAXJ@ZP6AXPEAX@Z@Z */ +DEFINE_THISCALL_WRAPPER(strstreambuf_funcs_ctor, 12) +strstreambuf* __thiscall strstreambuf_funcs_ctor(strstreambuf* this, allocFunction falloc, freeFunction ffree) +{ + TRACE("(%p %p %p)\n", this, falloc, ffree); + strstreambuf_dynamic_ctor(this, 1); + this->f_alloc = falloc; + this->f_free = ffree; + return this; +} + +/* ??0strstreambuf@@QAE@PADH0@Z */ +/* ??0strstreambuf@@QEAA@PEADH0@Z */ +DEFINE_THISCALL_WRAPPER(strstreambuf_buffer_ctor, 16) +strstreambuf* __thiscall strstreambuf_buffer_ctor(strstreambuf *this, char *buffer, int length, char *put) +{ + char *end_buffer; + + TRACE("(%p %p %d %p)\n", this, buffer, length, put); + + if (length > 0) + end_buffer = buffer + length; + else if (length == 0) + end_buffer = buffer + strlen(buffer); + else + end_buffer = (char*) -1; + + streambuf_ctor(&this->base); + streambuf_setb(&this->base, buffer, end_buffer, 0); + if (put == NULL) { + streambuf_setg(&this->base, buffer, buffer, end_buffer); + } else { + streambuf_setg(&this->base, buffer, buffer, put); + streambuf_setp(&this->base, put, end_buffer); + } + this->base.vtable = &MSVCP_strstreambuf_vtable; + this->dynamic = 0; + this->constant = 1; + return this; +} + +/* ??0strstreambuf@@QAE@PAEH0@Z */ +/* ??0strstreambuf@@QEAA@PEAEH0@Z */ +DEFINE_THISCALL_WRAPPER(strstreambuf_ubuffer_ctor, 16) +strstreambuf* __thiscall strstreambuf_ubuffer_ctor(strstreambuf *this, unsigned char *buffer, int length, unsigned char *put) +{ + TRACE("(%p %p %d %p)\n", this, buffer, length, put); + return strstreambuf_buffer_ctor(this, (char*)buffer, length, (char*)put); +} + +/* ??0strstreambuf@@QAE@XZ */ +/* ??0strstreambuf@@QEAA@XZ */ +DEFINE_THISCALL_WRAPPER(strstreambuf_ctor, 4) +strstreambuf* __thiscall strstreambuf_ctor(strstreambuf *this) +{ + TRACE("(%p)\n", this); + return strstreambuf_dynamic_ctor(this, 1); +} + +/* ??1strstreambuf@@UAE@XZ */ +/* ??1strstreambuf@@UEAA@XZ */ +DEFINE_THISCALL_WRAPPER(strstreambuf_dtor, 4) +void __thiscall strstreambuf_dtor(strstreambuf *this) +{ + TRACE("(%p)\n", this); + if (this->dynamic && this->base.base) { + if (this->f_free) + this->f_free(this->base.base); + else + MSVCRT_operator_delete(this->base.base); + } + streambuf_dtor(&this->base); +} + +/* ??4strstreambuf@@QAEAAV0@ABV0@@Z */ +/* ??4strstreambuf@@QEAAAEAV0@AEBV0@@Z */ +DEFINE_THISCALL_WRAPPER(strstreambuf_assign, 8) +strstreambuf* __thiscall strstreambuf_assign(strstreambuf *this, const strstreambuf *rhs) +{ + strstreambuf_dtor(this); + return strstreambuf_copy_ctor(this, rhs); +} + +/* ??_Estrstreambuf@@UAEPAXI@Z */ +DEFINE_THISCALL_WRAPPER(strstreambuf_vector_dtor, 8) +strstreambuf* __thiscall strstreambuf_vector_dtor(strstreambuf *this, unsigned int flags) +{ + TRACE("(%p %x)\n", this, flags); + if (flags & 2) { + /* we have an array, with the number of elements stored before the first object */ + INT_PTR i, *ptr = (INT_PTR *)this-1; + + for (i = *ptr-1; i >= 0; i--) + strstreambuf_dtor(this+i); + MSVCRT_operator_delete(ptr); + } else { + strstreambuf_dtor(this); + if (flags & 1) + MSVCRT_operator_delete(this); + } + return this; +} + +/* ??_Gstrstreambuf@@UAEPAXI@Z */ +DEFINE_THISCALL_WRAPPER(strstreambuf_scalar_dtor, 8) +strstreambuf* __thiscall strstreambuf_scalar_dtor(strstreambuf *this, unsigned int flags) +{ + TRACE("(%p %x)\n", this, flags); + strstreambuf_dtor(this); + if (flags & 1) MSVCRT_operator_delete(this); + return this; +} + +/* ?doallocate@strstreambuf@@MAEHXZ */ +/* ?doallocate@strstreambuf@@MEAAHXZ */ +DEFINE_THISCALL_WRAPPER(strstreambuf_doallocate, 4) +int __thiscall strstreambuf_doallocate(strstreambuf *this) +{ + char *prev_buffer = this->base.base, *new_buffer; + LONG prev_size = this->base.ebuf - this->base.base, new_size; + + TRACE("(%p)\n", this); + + /* calculate the size of the new buffer */ + new_size = (prev_size > 0 ? prev_size : 0) + (this->increase > 0 ? this->increase : 1); + /* get a new buffer */ + if (this->f_alloc) + new_buffer = this->f_alloc(new_size); + else + new_buffer = MSVCRT_operator_new(new_size); + if (!new_buffer) + return EOF; + if (this->base.ebuf) { + /* copy the contents and adjust the pointers */ + memcpy(new_buffer, this->base.base, prev_size); + if (this->base.egptr) { + this->base.eback += new_buffer - prev_buffer; + this->base.gptr += new_buffer - prev_buffer; + this->base.egptr += new_buffer - prev_buffer; + } + if (this->base.epptr) { + this->base.pbase += new_buffer - prev_buffer; + this->base.pptr += new_buffer - prev_buffer; + this->base.epptr += new_buffer - prev_buffer; + } + /* free the old buffer */ + if (this->f_free) + this->f_free(this->base.base); + else + MSVCRT_operator_delete(this->base.base); + } + streambuf_setb(&this->base, new_buffer, new_buffer + new_size, 0); + return 1; +} + +/* ?freeze@strstreambuf@@QAEXH@Z */ +/* ?freeze@strstreambuf@@QEAAXH@Z */ +DEFINE_THISCALL_WRAPPER(strstreambuf_freeze, 8) +void __thiscall strstreambuf_freeze(strstreambuf *this, int frozen) +{ + TRACE("(%p %d)\n", this, frozen); + if (!this->constant) + this->dynamic = !frozen; +} + +/* ?overflow@strstreambuf@@UAEHH@Z */ +/* ?overflow@strstreambuf@@UEAAHH@Z */ +DEFINE_THISCALL_WRAPPER(strstreambuf_overflow, 8) +int __thiscall strstreambuf_overflow(strstreambuf *this, int c) +{ + TRACE("(%p %d)\n", this, c); + if (this->base.pptr >= this->base.epptr) { + /* increase the buffer size if it's dynamic */ + if (!this->dynamic || call_streambuf_doallocate(&this->base) == EOF) + return EOF; + if (!this->base.epptr) + this->base.pbase = this->base.pptr = this->base.egptr ? this->base.egptr : this->base.base; + this->base.epptr = this->base.ebuf; + } + if (c != EOF) + *this->base.pptr++ = c; + return 1; +} + +/* ?seekoff@strstreambuf@@UAEJJW4seek_dir@ios@@H@Z */ +/* ?seekoff@strstreambuf@@UEAAJJW4seek_dir@ios@@H@Z */ +DEFINE_THISCALL_WRAPPER(strstreambuf_seekoff, 16) +streampos __thiscall strstreambuf_seekoff(strstreambuf *this, streamoff offset, ios_seek_dir dir, int mode) +{ + char *base[3]; + + TRACE("(%p %d %d %d)\n", this, offset, dir, mode); + + if (dir < SEEKDIR_beg || dir > SEEKDIR_end || !(mode & (OPENMODE_in|OPENMODE_out))) + return EOF; + /* read buffer */ + if (mode & OPENMODE_in) { + call_streambuf_underflow(&this->base); + base[SEEKDIR_beg] = this->base.eback; + base[SEEKDIR_cur] = this->base.gptr; + base[SEEKDIR_end] = this->base.egptr; + if (base[dir] + offset < this->base.eback || base[dir] + offset > this->base.egptr) + return EOF; + this->base.gptr = base[dir] + offset; + } + /* write buffer */ + if (mode & OPENMODE_out) { + if (!this->base.epptr && call_streambuf_overflow(&this->base, EOF) == EOF) + return EOF; + base[SEEKDIR_beg] = this->base.pbase; + base[SEEKDIR_cur] = this->base.pptr; + base[SEEKDIR_end] = this->base.epptr; + if (base[dir] + offset < this->base.pbase) + return EOF; + if (base[dir] + offset > this->base.epptr) { + /* make room if the buffer is dynamic */ + if (!this->dynamic) + return EOF; + this->increase = offset; + if (call_streambuf_doallocate(&this->base) == EOF) + return EOF; + } + this->base.pptr = base[dir] + offset; + return this->base.pptr - base[SEEKDIR_beg]; + } + return this->base.gptr - base[SEEKDIR_beg]; +} + +/* ?setbuf@strstreambuf@@UAEPAVstreambuf@@PADH@Z */ +/* ?setbuf@strstreambuf@@UEAAPEAVstreambuf@@PEADH@Z */ +DEFINE_THISCALL_WRAPPER(strstreambuf_setbuf, 12) +streambuf* __thiscall strstreambuf_setbuf(strstreambuf *this, char *buffer, int length) +{ + TRACE("(%p %p %d)\n", this, buffer, length); + if (length) + this->increase = length; + return &this->base; +} + +/* ?str@strstreambuf@@QAEPADXZ */ +/* ?str@strstreambuf@@QEAAPEADXZ */ +DEFINE_THISCALL_WRAPPER(strstreambuf_str, 4) +char* __thiscall strstreambuf_str(strstreambuf *this) +{ + TRACE("(%p)\n", this); + strstreambuf_freeze(this, 1); + return this->base.base; +} + +/* ?sync@strstreambuf@@UAEHXZ */ +/* ?sync@strstreambuf@@UEAAHXZ */ +DEFINE_THISCALL_WRAPPER(strstreambuf_sync, 4) +int __thiscall strstreambuf_sync(strstreambuf *this) +{ + TRACE("(%p)\n", this); + return 0; +} + +/* ?underflow@strstreambuf@@UAEHXZ */ +/* ?underflow@strstreambuf@@UEAAHXZ */ +DEFINE_THISCALL_WRAPPER(strstreambuf_underflow, 4) +int __thiscall strstreambuf_underflow(strstreambuf *this) +{ + TRACE("(%p)\n", this); + if (this->base.gptr < this->base.egptr) + return *this->base.gptr; + /* extend the get area to include the characters written */ + if (this->base.egptr < this->base.pptr) + this->base.egptr = this->base.pptr; + return (this->base.gptr < this->base.egptr) ? *this->base.gptr : EOF; +} + +/* ??0stdiobuf@@QAE@ABV0@@Z */ +/* ??0stdiobuf@@QEAA@AEBV0@@Z */ +DEFINE_THISCALL_WRAPPER(stdiobuf_copy_ctor, 8) +stdiobuf* __thiscall stdiobuf_copy_ctor(stdiobuf *this, const stdiobuf *copy) +{ + TRACE("(%p %p)\n", this, copy); + *this = *copy; + this->base.vtable = &MSVCP_stdiobuf_vtable; + return this; +} + +/* ??0stdiobuf@@QAE@PAU_iobuf@@@Z */ +/* ??0stdiobuf@@QEAA@PEAU_iobuf@@@Z */ +DEFINE_THISCALL_WRAPPER(stdiobuf_file_ctor, 8) +stdiobuf* __thiscall stdiobuf_file_ctor(stdiobuf *this, FILE *file) +{ + TRACE("(%p %p)\n", this, file); + streambuf_reserve_ctor(&this->base, NULL, 0); + this->base.vtable = &MSVCP_stdiobuf_vtable; + this->file = file; + return this; +} + +/* ??1stdiobuf@@UAE@XZ */ +/* ??1stdiobuf@@UEAA@XZ */ +DEFINE_THISCALL_WRAPPER(stdiobuf_dtor, 4) +void __thiscall stdiobuf_dtor(stdiobuf *this) +{ + TRACE("(%p)\n", this); + call_streambuf_sync(&this->base); + streambuf_dtor(&this->base); +} + +/* ??4stdiobuf@@QAEAAV0@ABV0@@Z */ +/* ??4stdiobuf@@QEAAAEAV0@AEBV0@@Z */ +DEFINE_THISCALL_WRAPPER(stdiobuf_assign, 8) +stdiobuf* __thiscall stdiobuf_assign(stdiobuf *this, const stdiobuf *rhs) +{ + stdiobuf_dtor(this); + return stdiobuf_copy_ctor(this, rhs); +} + +/* ??_Estdiobuf@@UAEPAXI@Z */ +DEFINE_THISCALL_WRAPPER(stdiobuf_vector_dtor, 8) +stdiobuf* __thiscall stdiobuf_vector_dtor(stdiobuf *this, unsigned int flags) +{ + TRACE("(%p %x)\n", this, flags); + if (flags & 2) { + /* we have an array, with the number of elements stored before the first object */ + INT_PTR i, *ptr = (INT_PTR *)this-1; + + for (i = *ptr-1; i >= 0; i--) + stdiobuf_dtor(this+i); + MSVCRT_operator_delete(ptr); + } else { + stdiobuf_dtor(this); + if (flags & 1) + MSVCRT_operator_delete(this); + } + return this; +} + +/* ??_Gstdiobuf@@UAEPAXI@Z */ +DEFINE_THISCALL_WRAPPER(stdiobuf_scalar_dtor, 8) +stdiobuf* __thiscall stdiobuf_scalar_dtor(stdiobuf *this, unsigned int flags) +{ + TRACE("(%p %x)\n", this, flags); + stdiobuf_dtor(this); + if (flags & 1) MSVCRT_operator_delete(this); + return this; +} + +/* ?overflow@stdiobuf@@UAEHH@Z */ +/* ?overflow@stdiobuf@@UEAAHH@Z */ +DEFINE_THISCALL_WRAPPER(stdiobuf_overflow, 8) +int __thiscall stdiobuf_overflow(stdiobuf *this, int c) +{ + TRACE("(%p %d)\n", this, c); + if (this->base.unbuffered) + return (c == EOF) ? 1 : fputc(c, this->file); + if (streambuf_allocate(&this->base) == EOF) + return EOF; + + if (!this->base.epptr) { + /* set the put area to the second half of the buffer */ + streambuf_setp(&this->base, + this->base.base + (this->base.ebuf - this->base.base) / 2, this->base.ebuf); + } else if (this->base.pptr > this->base.pbase) { + /* flush the put area */ + int count = this->base.pptr - this->base.pbase; + if (fwrite(this->base.pbase, sizeof(char), count, this->file) != count) + return EOF; + this->base.pptr = this->base.pbase; + } + if (c != EOF) { + if (this->base.pbase >= this->base.epptr) + return fputc(c, this->file); + *this->base.pptr++ = c; + } + return 1; +} + +/* ?pbackfail@stdiobuf@@UAEHH@Z */ +/* ?pbackfail@stdiobuf@@UEAAHH@Z */ +DEFINE_THISCALL_WRAPPER(stdiobuf_pbackfail, 8) +int __thiscall stdiobuf_pbackfail(stdiobuf *this, int c) +{ + TRACE("(%p %d)\n", this, c); + return streambuf_pbackfail(&this->base, c); +} + +/* ?seekoff@stdiobuf@@UAEJJW4seek_dir@ios@@H@Z */ +/* ?seekoff@stdiobuf@@UEAAJJW4seek_dir@ios@@H@Z */ +DEFINE_THISCALL_WRAPPER(stdiobuf_seekoff, 16) +streampos __thiscall stdiobuf_seekoff(stdiobuf *this, streamoff offset, ios_seek_dir dir, int mode) +{ + TRACE("(%p %d %d %d)\n", this, offset, dir, mode); + call_streambuf_overflow(&this->base, EOF); + if (fseek(this->file, offset, dir)) + return EOF; + return ftell(this->file); +} + +/* ?setrwbuf@stdiobuf@@QAEHHH@Z */ +/* ?setrwbuf@stdiobuf@@QEAAHHH@Z */ +DEFINE_THISCALL_WRAPPER(stdiobuf_setrwbuf, 12) +int __thiscall stdiobuf_setrwbuf(stdiobuf *this, int read_size, int write_size) +{ + char *reserve; + int buffer_size = read_size + write_size; + + TRACE("(%p %d %d)\n", this, read_size, write_size); + if (read_size < 0 || write_size < 0) + return 0; + if (!buffer_size) { + this->base.unbuffered = 1; + return 0; + } + /* get a new buffer */ + reserve = MSVCRT_operator_new(buffer_size); + if (!reserve) + return 0; + streambuf_setb(&this->base, reserve, reserve + buffer_size, 1); + this->base.unbuffered = 0; + /* set the get/put areas */ + if (read_size > 0) + streambuf_setg(&this->base, reserve, reserve + read_size, reserve + read_size); + else + streambuf_setg(&this->base, NULL, NULL, NULL); + if (write_size > 0) + streambuf_setp(&this->base, reserve + read_size, reserve + buffer_size); + else + streambuf_setp(&this->base, NULL, NULL); + return 1; +} + +/* ?stdiofile@stdiobuf@@QAEPAU_iobuf@@XZ */ +/* ?stdiofile@stdiobuf@@QEAAPEAU_iobuf@@XZ */ +DEFINE_THISCALL_WRAPPER(stdiobuf_stdiofile, 4) +FILE* __thiscall stdiobuf_stdiofile(stdiobuf *this) +{ + TRACE("(%p)\n", this); + return this->file; +} + +/* ?sync@stdiobuf@@UAEHXZ */ +/* ?sync@stdiobuf@@UEAAHXZ */ +DEFINE_THISCALL_WRAPPER(stdiobuf_sync, 4) +int __thiscall stdiobuf_sync(stdiobuf *this) +{ + TRACE("(%p)\n", this); + if (this->base.unbuffered) + return 0; + /* flush the put area */ + if (call_streambuf_overflow(&this->base, EOF) == EOF) + return EOF; + /* flush the get area */ + if (this->base.gptr < this->base.egptr) { + char *ptr; + int fd, mode, offset = this->base.egptr - this->base.gptr; + if ((fd = fileno(this->file)) < 0) + return EOF; + mode = _setmode(fd, _O_TEXT); + _setmode(fd, mode); + if (mode & _O_TEXT) { + /* in text mode, '\n' in the buffer means '\r\n' in the file */ + for (ptr = this->base.gptr; ptr < this->base.egptr; ptr++) + if (*ptr == '\n') + offset++; + } + if (fseek(this->file, -offset, SEEK_CUR)) + return EOF; + this->base.gptr = this->base.egptr; + } + return 0; +} + +/* ?underflow@stdiobuf@@UAEHXZ */ +/* ?underflow@stdiobuf@@UEAAHXZ */ +DEFINE_THISCALL_WRAPPER(stdiobuf_underflow, 4) +int __thiscall stdiobuf_underflow(stdiobuf *this) +{ + TRACE("(%p)\n", this); + if (!this->file) + return EOF; + if (this->base.unbuffered) + return fgetc(this->file); + if (streambuf_allocate(&this->base) == EOF) + return EOF; + + if (!this->base.egptr) { + /* set the get area to the first half of the buffer */ + char *middle = this->base.base + (this->base.ebuf - this->base.base) / 2; + streambuf_setg(&this->base, this->base.base, middle, middle); + } + if (this->base.gptr >= this->base.egptr) { + /* read characters from the file */ + int buffer_size = this->base.egptr - this->base.eback, read_bytes; + if (!this->base.eback || + (read_bytes = fread(this->base.eback, sizeof(char), buffer_size, this->file)) <= 0) + return EOF; + memmove(this->base.egptr - read_bytes, this->base.eback, read_bytes); + this->base.gptr = this->base.egptr - read_bytes; + } + return *this->base.gptr++; +} + /* ??0ios@@IAE@ABV0@@Z */ /* ??0ios@@IEAA@AEBV0@@Z */ DEFINE_THISCALL_WRAPPER(ios_copy_ctor, 8) @@ -1723,17 +2300,6 @@ return _this; } -/****************************************************************** - * ?str@strstreambuf@@QAEPADXZ (MSVCRTI.@) - * class strstreambuf & __thiscall strstreambuf::str(class strstreambuf &) - */ -DEFINE_THISCALL_WRAPPER(MSVCIRT_str_sl_void,4) -char * __thiscall MSVCIRT_str_sl_void(class_strstreambuf * _this) -{ - FIXME("(%p)->() stub\n", _this); - return 0; -} - #ifdef __i386__ #define DEFINE_VTBL_WRAPPER(off) \ @@ -1786,6 +2352,8 @@ #ifdef __x86_64__ init_streambuf_rtti(base); init_filebuf_rtti(base); + init_strstreambuf_rtti(base); + init_stdiobuf_rtti(base); init_ios_rtti(base); #endif } diff -Nru wine1.7-1.7.50/dlls/msvcirt/msvcirt.h wine1.7-1.7.55/dlls/msvcirt/msvcirt.h --- wine1.7-1.7.50/dlls/msvcirt/msvcirt.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcirt/msvcirt.h 2015-11-13 14:32:40.000000000 +0000 @@ -23,6 +23,8 @@ typedef LONG streamoff; typedef LONG streampos; typedef int filedesc; +typedef void* (__cdecl *allocFunction)(LONG); +typedef void (__cdecl *freeFunction)(void*); typedef enum { IOSTATE_goodbit = 0x0, diff -Nru wine1.7-1.7.50/dlls/msvcirt/msvcirt.spec wine1.7-1.7.55/dlls/msvcirt/msvcirt.spec --- wine1.7-1.7.50/dlls/msvcirt/msvcirt.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcirt/msvcirt.spec 2015-11-13 14:32:40.000000000 +0000 @@ -98,10 +98,10 @@ @ stub -arch=win64 ??0ostrstream@@QEAA@PEADHH@Z @ thiscall -arch=win32 ??0ostrstream@@QAE@XZ(ptr long) MSVCIRT_ostrstream_ctor @ cdecl -arch=win64 ??0ostrstream@@QEAA@XZ(ptr long) MSVCIRT_ostrstream_ctor -@ stub -arch=win32 ??0stdiobuf@@QAE@ABV0@@Z # __thiscall stdiobuf::stdiobuf(class stdiobuf const &) -@ stub -arch=win64 ??0stdiobuf@@QEAA@AEBV0@@Z -@ stub -arch=win32 ??0stdiobuf@@QAE@PAU_iobuf@@@Z # __thiscall stdiobuf::stdiobuf(struct _iobuf *) -@ stub -arch=win64 ??0stdiobuf@@QEAA@PEAU_iobuf@@@Z +@ thiscall -arch=win32 ??0stdiobuf@@QAE@ABV0@@Z(ptr ptr) stdiobuf_copy_ctor +@ cdecl -arch=win64 ??0stdiobuf@@QEAA@AEBV0@@Z(ptr ptr) stdiobuf_copy_ctor +@ thiscall -arch=win32 ??0stdiobuf@@QAE@PAU_iobuf@@@Z(ptr ptr) stdiobuf_file_ctor +@ cdecl -arch=win64 ??0stdiobuf@@QEAA@PEAU_iobuf@@@Z(ptr ptr) stdiobuf_file_ctor @ stub -arch=win32 ??0stdiostream@@QAE@ABV0@@Z # __thiscall stdiostream::stdiostream(class stdiostream const &) @ stub -arch=win64 ??0stdiostream@@QEAA@AEBV0@@Z @ stub -arch=win32 ??0stdiostream@@QAE@PAU_iobuf@@@Z # __thiscall stdiostream::stdiostream(struct _iobuf *) @@ -118,18 +118,18 @@ @ stub -arch=win64 ??0strstream@@QEAA@PEADHH@Z @ stub -arch=win32 ??0strstream@@QAE@XZ # __thiscall strstream::strstream(void) @ stub -arch=win64 ??0strstream@@QEAA@XZ -@ stub -arch=win32 ??0strstreambuf@@QAE@ABV0@@Z # __thiscall strstreambuf::strstreambuf(class strstreambuf const &) -@ stub -arch=win64 ??0strstreambuf@@QEAA@AEBV0@@Z -@ stub -arch=win32 ??0strstreambuf@@QAE@H@Z # __thiscall strstreambuf::strstreambuf(int) -@ stub -arch=win64 ??0strstreambuf@@QEAA@H@Z -@ stub -arch=win32 ??0strstreambuf@@QAE@P6APAXJ@ZP6AXPAX@Z@Z # __thiscall strstreambuf::strstreambuf(void * (__cdecl*)(long),void (__cdecl*)(void *)) -@ stub -arch=win64 ??0strstreambuf@@QEAA@P6APEAXJ@ZP6AXPEAX@Z@Z -@ stub -arch=win32 ??0strstreambuf@@QAE@PADH0@Z # __thiscall strstreambuf::strstreambuf(char *,int,char *) -@ stub -arch=win64 ??0strstreambuf@@QEAA@PEADH0@Z -@ stub -arch=win32 ??0strstreambuf@@QAE@PAEH0@Z # __thiscall strstreambuf::strstreambuf(unsigned char *,int,unsigned char *) -@ stub -arch=win64 ??0strstreambuf@@QEAA@PEAEH0@Z -@ stub -arch=win32 ??0strstreambuf@@QAE@XZ # __thiscall strstreambuf::strstreambuf(void) -@ stub -arch=win64 ??0strstreambuf@@QEAA@XZ +@ thiscall -arch=win32 ??0strstreambuf@@QAE@ABV0@@Z(ptr ptr) strstreambuf_copy_ctor +@ cdecl -arch=win64 ??0strstreambuf@@QEAA@AEBV0@@Z(ptr ptr) strstreambuf_copy_ctor +@ thiscall -arch=win32 ??0strstreambuf@@QAE@H@Z(ptr long) strstreambuf_dynamic_ctor +@ cdecl -arch=win64 ??0strstreambuf@@QEAA@H@Z(ptr long) strstreambuf_dynamic_ctor +@ thiscall -arch=win32 ??0strstreambuf@@QAE@P6APAXJ@ZP6AXPAX@Z@Z(ptr ptr ptr) strstreambuf_funcs_ctor +@ cdecl -arch=win64 ??0strstreambuf@@QEAA@P6APEAXJ@ZP6AXPEAX@Z@Z(ptr ptr ptr) strstreambuf_funcs_ctor +@ thiscall -arch=win32 ??0strstreambuf@@QAE@PADH0@Z(ptr ptr long ptr) strstreambuf_buffer_ctor +@ cdecl -arch=win64 ??0strstreambuf@@QEAA@PEADH0@Z(ptr ptr long ptr) strstreambuf_buffer_ctor +@ thiscall -arch=win32 ??0strstreambuf@@QAE@PAEH0@Z(ptr ptr long ptr) strstreambuf_ubuffer_ctor +@ cdecl -arch=win64 ??0strstreambuf@@QEAA@PEAEH0@Z(ptr ptr long ptr) strstreambuf_ubuffer_ctor +@ thiscall -arch=win32 ??0strstreambuf@@QAE@XZ(ptr) strstreambuf_ctor +@ cdecl -arch=win64 ??0strstreambuf@@QEAA@XZ(ptr) strstreambuf_ctor @ stub -arch=win32 ??1Iostream_init@@QAE@XZ # __thiscall Iostream_init::~Iostream_init(void) @ stub -arch=win64 ??1Iostream_init@@QEAA@XZ @ thiscall -arch=i386 ??1exception@@UAE@XZ(ptr) MSVCP_exception_dtor @@ -160,16 +160,16 @@ @ stub -arch=win64 ??1ostream_withassign@@UEAA@XZ @ thiscall -arch=win32 ??1ostrstream@@UAE@XZ(ptr) MSVCIRT_ostrstream_dtor @ cdecl -arch=win64 ??1ostrstream@@UEAA@XZ(ptr) MSVCIRT_ostrstream_dtor -@ stub -arch=win32 ??1stdiobuf@@UAE@XZ # virtual __thiscall stdiobuf::~stdiobuf(void) -@ stub -arch=win64 ??1stdiobuf@@UEAA@XZ +@ thiscall -arch=win32 ??1stdiobuf@@UAE@XZ(ptr) stdiobuf_dtor +@ cdecl -arch=win64 ??1stdiobuf@@UEAA@XZ(ptr) stdiobuf_dtor @ stub -arch=win32 ??1stdiostream@@UAE@XZ # virtual __thiscall stdiostream::~stdiostream(void) @ stub -arch=win64 ??1stdiostream@@UEAA@XZ @ thiscall -arch=win32 ??1streambuf@@UAE@XZ(ptr) streambuf_dtor @ cdecl -arch=win64 ??1streambuf@@UEAA@XZ(ptr) streambuf_dtor @ stub -arch=win32 ??1strstream@@UAE@XZ # virtual __thiscall strstream::~strstream(void) @ stub -arch=win64 ??1strstream@@UEAA@XZ -@ stub -arch=win32 ??1strstreambuf@@UAE@XZ # virtual __thiscall strstreambuf::~strstreambuf(void) -@ stub -arch=win64 ??1strstreambuf@@UEAA@XZ +@ thiscall -arch=win32 ??1strstreambuf@@UAE@XZ(ptr) strstreambuf_dtor +@ cdecl -arch=win64 ??1strstreambuf@@UEAA@XZ(ptr) strstreambuf_dtor @ stub -arch=win32 ??4Iostream_init@@QAEAAV0@ABV0@@Z # class Iostream_init & __thiscall Iostream_init::operator=(class Iostream_init const &) @ stub -arch=win64 ??4Iostream_init@@QEAAAEAV0@AEBV0@@Z @ thiscall -arch=i386 ??4exception@@QAEAAV0@ABV0@@Z(ptr ptr) MSVCP_exception_assign @@ -214,16 +214,16 @@ @ stub -arch=win64 ??4ostream_withassign@@QEAAAEAVostream@@PEAVstreambuf@@@Z @ stub -arch=win32 ??4ostrstream@@QAEAAV0@ABV0@@Z # class ostrstream & __thiscall ostrstream::operator=(class ostrstream const &) @ stub -arch=win64 ??4ostrstream@@QEAAAEAV0@AEBV0@@Z -@ stub -arch=win32 ??4stdiobuf@@QAEAAV0@ABV0@@Z # class stdiobuf & __thiscall stdiobuf::operator=(class stdiobuf const &) -@ stub -arch=win64 ??4stdiobuf@@QEAAAEAV0@AEBV0@@Z +@ thiscall -arch=win32 ??4stdiobuf@@QAEAAV0@ABV0@@Z(ptr ptr) stdiobuf_assign +@ cdecl -arch=win64 ??4stdiobuf@@QEAAAEAV0@AEBV0@@Z(ptr ptr) stdiobuf_assign @ stub -arch=win32 ??4stdiostream@@QAEAAV0@AAV0@@Z # class stdiostream & __thiscall stdiostream::operator=(class stdiostream &) @ stub -arch=win64 ??4stdiostream@@QEAAAEAV0@AEAV0@@Z @ thiscall -arch=win32 ??4streambuf@@QAEAAV0@ABV0@@Z(ptr ptr) streambuf_assign @ cdecl -arch=win64 ??4streambuf@@QEAAAEAV0@AEBV0@@Z(ptr ptr) streambuf_assign @ stub -arch=win32 ??4strstream@@QAEAAV0@AAV0@@Z # class strstream & __thiscall strstream::operator=(class strstream &) @ stub -arch=win64 ??4strstream@@QEAAAEAV0@AEAV0@@Z -@ stub -arch=win32 ??4strstreambuf@@QAEAAV0@ABV0@@Z # class strstreambuf & __thiscall strstreambuf::operator=(class strstreambuf const &) -@ stub -arch=win64 ??4strstreambuf@@QEAAAEAV0@AEBV0@@Z +@ thiscall -arch=win32 ??4strstreambuf@@QAEAAV0@ABV0@@Z(ptr ptr) strstreambuf_assign +@ cdecl -arch=win64 ??4strstreambuf@@QEAAAEAV0@AEBV0@@Z(ptr ptr) strstreambuf_assign @ stub -arch=win32 ??5istream@@QAEAAV0@AAC@Z # class istream & __thiscall istream::operator>>(signed char &) @ stub -arch=win64 ??5istream@@QEAAAEAV0@AEAC@Z @ stub -arch=win32 ??5istream@@QAEAAV0@AAD@Z # class istream & __thiscall istream::operator>>(char &) @@ -316,11 +316,11 @@ # @ extern ??_7ostream@@6B@ # const ostream::`vftable' # @ extern ??_7ostream_withassign@@6B@ # const ostream_withassign::`vftable' # @ extern ??_7ostrstream@@6B@ # const ostrstream::`vftable' -# @ extern ??_7stdiobuf@@6B@ # const stdiobuf::`vftable' +@ extern ??_7stdiobuf@@6B@ MSVCP_stdiobuf_vtable # @ extern ??_7stdiostream@@6B@ # const stdiostream::`vftable' @ extern ??_7streambuf@@6B@ MSVCP_streambuf_vtable # @ extern ??_7strstream@@6B@ # const strstream::`vftable' -# @ extern ??_7strstreambuf@@6B@ # const strstreambuf::`vftable' +@ extern ??_7strstreambuf@@6B@ MSVCP_strstreambuf_vtable # @ extern ??_8fstream@@7Bistream@@@ # const fstream::`vbtable'{for `istream'} # @ extern ??_8fstream@@7Bostream@@@ # const fstream::`vbtable'{for `ostream'} # @ extern ??_8ifstream@@7B@ # const ifstream::`vbtable' @@ -375,11 +375,11 @@ @ stub -arch=win32 ??_Eostream@@UAEPAXI@Z # virtual void * __thiscall ostream::`vector deleting destructor'(unsigned int) @ stub -arch=win32 ??_Eostream_withassign@@UAEPAXI@Z # virtual void * __thiscall ostream_withassign::`vector deleting destructor'(unsigned int) @ stub -arch=win32 ??_Eostrstream@@UAEPAXI@Z # virtual void * __thiscall ostrstream::`vector deleting destructor'(unsigned int) -@ stub -arch=win32 ??_Estdiobuf@@UAEPAXI@Z # virtual void * __thiscall stdiobuf::`vector deleting destructor'(unsigned int) +@ thiscall -arch=win32 ??_Estdiobuf@@UAEPAXI@Z(ptr long) stdiobuf_vector_dtor @ stub -arch=win32 ??_Estdiostream@@UAEPAXI@Z # virtual void * __thiscall stdiostream::`vector deleting destructor'(unsigned int) @ thiscall -arch=win32 ??_Estreambuf@@UAEPAXI@Z(ptr long) streambuf_vector_dtor @ stub -arch=win32 ??_Estrstream@@UAEPAXI@Z # virtual void * __thiscall strstream::`vector deleting destructor'(unsigned int) -@ stub -arch=win32 ??_Estrstreambuf@@UAEPAXI@Z # virtual void * __thiscall strstreambuf::`vector deleting destructor'(unsigned int) +@ thiscall -arch=win32 ??_Estrstreambuf@@UAEPAXI@Z(ptr long) strstreambuf_vector_dtor @ thiscall -arch=win32 ??_Gexception@@UAEPAXI@Z(ptr long) MSVCP_exception_scalar_dtor @ thiscall -arch=win32 ??_Gfilebuf@@UAEPAXI@Z(ptr long) filebuf_scalar_dtor @ stub -arch=win32 ??_Gfstream@@UAEPAXI@Z # virtual void * __thiscall fstream::`scalar deleting destructor'(unsigned int) @@ -394,11 +394,11 @@ @ stub -arch=win32 ??_Gostream@@UAEPAXI@Z # virtual void * __thiscall ostream::`scalar deleting destructor'(unsigned int) @ stub -arch=win32 ??_Gostream_withassign@@UAEPAXI@Z # virtual void * __thiscall ostream_withassign::`scalar deleting destructor'(unsigned int) @ stub -arch=win32 ??_Gostrstream@@UAEPAXI@Z # virtual void * __thiscall ostrstream::`scalar deleting destructor'(unsigned int) -@ stub -arch=win32 ??_Gstdiobuf@@UAEPAXI@Z # virtual void * __thiscall stdiobuf::`scalar deleting destructor'(unsigned int) +@ thiscall -arch=win32 ??_Gstdiobuf@@UAEPAXI@Z(ptr long) stdiobuf_scalar_dtor @ stub -arch=win32 ??_Gstdiostream@@UAEPAXI@Z # virtual void * __thiscall stdiostream::`scalar deleting destructor'(unsigned int) @ thiscall -arch=win32 ??_Gstreambuf@@UAEPAXI@Z(ptr long) streambuf_scalar_dtor @ stub -arch=win32 ??_Gstrstream@@UAEPAXI@Z # virtual void * __thiscall strstream::`scalar deleting destructor'(unsigned int) -@ stub -arch=win32 ??_Gstrstreambuf@@UAEPAXI@Z # virtual void * __thiscall strstreambuf::`scalar deleting destructor'(unsigned int) +@ thiscall -arch=win32 ??_Gstrstreambuf@@UAEPAXI@Z(ptr long) strstreambuf_scalar_dtor @ extern ?adjustfield@ios@@2JB ios_adjustfield @ thiscall -arch=win32 ?allocate@streambuf@@IAEHXZ(ptr) streambuf_allocate @ cdecl -arch=win64 ?allocate@streambuf@@IEAAHXZ(ptr) streambuf_allocate @@ -447,8 +447,8 @@ @ cdecl -arch=win64 ?delbuf@ios@@QEBAHXZ(ptr) ios_delbuf_get @ thiscall -arch=win32 ?doallocate@streambuf@@MAEHXZ(ptr) streambuf_doallocate @ cdecl -arch=win64 ?doallocate@streambuf@@MEAAHXZ(ptr) streambuf_doallocate -@ stub -arch=win32 ?doallocate@strstreambuf@@MAEHXZ # virtual int __thiscall strstreambuf::doallocate(void) -@ stub -arch=win64 ?doallocate@strstreambuf@@MEAAHXZ +@ thiscall -arch=win32 ?doallocate@strstreambuf@@MAEHXZ(ptr) strstreambuf_doallocate +@ cdecl -arch=win64 ?doallocate@strstreambuf@@MEAAHXZ(ptr) strstreambuf_doallocate @ stub -arch=win32 ?eatwhite@istream@@QAEXXZ # void __thiscall istream::eatwhite(void) @ stub -arch=win64 ?eatwhite@istream@@QEAAXXZ @ thiscall -arch=win32 ?eback@streambuf@@IBEPADXZ(ptr) streambuf_eback @@ -489,8 +489,8 @@ @ stub -arch=win64 ?flush@@YAAEAVostream@@AEAV1@@Z @ stub -arch=win32 ?flush@ostream@@QAEAAV1@XZ # class ostream & __thiscall ostream::flush(void) @ stub -arch=win64 ?flush@ostream@@QEAAAEAV1@XZ -@ stub -arch=win32 ?freeze@strstreambuf@@QAEXH@Z # void __thiscall strstreambuf::freeze(int) -@ stub -arch=win64 ?freeze@strstreambuf@@QEAAXH@Z +@ thiscall -arch=win32 ?freeze@strstreambuf@@QAEXH@Z(ptr long) strstreambuf_freeze +@ cdecl -arch=win64 ?freeze@strstreambuf@@QEAAXH@Z(ptr long) strstreambuf_freeze @ thiscall -arch=win32 ?gbump@streambuf@@IAEXH@Z(ptr long) streambuf_gbump @ cdecl -arch=win64 ?gbump@streambuf@@IEAAXH@Z(ptr long) streambuf_gbump @ stub -arch=win32 ?gcount@istream@@QBEHXZ # int __thiscall istream::gcount(void)const @@ -579,12 +579,12 @@ @ cdecl -arch=win64 ?out_waiting@streambuf@@QEBAHXZ(ptr) streambuf_out_waiting @ thiscall -arch=win32 ?overflow@filebuf@@UAEHH@Z(ptr long) filebuf_overflow @ cdecl -arch=win64 ?overflow@filebuf@@UEAAHH@Z(ptr long) filebuf_overflow -@ stub -arch=win32 ?overflow@stdiobuf@@UAEHH@Z # virtual int __thiscall stdiobuf::overflow(int) -@ stub -arch=win64 ?overflow@stdiobuf@@UEAAHH@Z -@ stub -arch=win32 ?overflow@strstreambuf@@UAEHH@Z # virtual int __thiscall strstreambuf::overflow(int) -@ stub -arch=win64 ?overflow@strstreambuf@@UEAAHH@Z -@ stub -arch=win32 ?pbackfail@stdiobuf@@UAEHH@Z # virtual int __thiscall stdiobuf::pbackfail(int) -@ stub -arch=win64 ?pbackfail@stdiobuf@@UEAAHH@Z +@ thiscall -arch=win32 ?overflow@stdiobuf@@UAEHH@Z(ptr long) stdiobuf_overflow +@ cdecl -arch=win64 ?overflow@stdiobuf@@UEAAHH@Z(ptr long) stdiobuf_overflow +@ thiscall -arch=win32 ?overflow@strstreambuf@@UAEHH@Z(ptr long) strstreambuf_overflow +@ cdecl -arch=win64 ?overflow@strstreambuf@@UEAAHH@Z(ptr long) strstreambuf_overflow +@ thiscall -arch=win32 ?pbackfail@stdiobuf@@UAEHH@Z(ptr long) stdiobuf_pbackfail +@ cdecl -arch=win64 ?pbackfail@stdiobuf@@UEAAHH@Z(ptr long) stdiobuf_pbackfail @ thiscall -arch=win32 ?pbackfail@streambuf@@UAEHH@Z(ptr long) streambuf_pbackfail @ cdecl -arch=win64 ?pbackfail@streambuf@@UEAAHH@Z(ptr long) streambuf_pbackfail @ thiscall -arch=win32 ?pbase@streambuf@@IBEPADXZ(ptr) streambuf_pbase @@ -645,12 +645,12 @@ @ stub -arch=win64 ?seekg@istream@@QEAAAEAV1@JW4seek_dir@ios@@@Z @ thiscall -arch=win32 ?seekoff@filebuf@@UAEJJW4seek_dir@ios@@H@Z(ptr long long long) filebuf_seekoff @ cdecl -arch=win64 ?seekoff@filebuf@@UEAAJJW4seek_dir@ios@@H@Z(ptr long long long) filebuf_seekoff -@ stub -arch=win32 ?seekoff@stdiobuf@@UAEJJW4seek_dir@ios@@H@Z # virtual long __thiscall stdiobuf::seekoff(long,enum ios::seek_dir,int) -@ stub -arch=win64 ?seekoff@stdiobuf@@UEAAJJW4seek_dir@ios@@H@Z +@ thiscall -arch=win32 ?seekoff@stdiobuf@@UAEJJW4seek_dir@ios@@H@Z(ptr long long long) stdiobuf_seekoff +@ cdecl -arch=win64 ?seekoff@stdiobuf@@UEAAJJW4seek_dir@ios@@H@Z(ptr long long long) stdiobuf_seekoff @ thiscall -arch=win32 ?seekoff@streambuf@@UAEJJW4seek_dir@ios@@H@Z(ptr long long long) streambuf_seekoff @ cdecl -arch=win64 ?seekoff@streambuf@@UEAAJJW4seek_dir@ios@@H@Z(ptr long long long) streambuf_seekoff -@ stub -arch=win32 ?seekoff@strstreambuf@@UAEJJW4seek_dir@ios@@H@Z # virtual long __thiscall strstreambuf::seekoff(long,enum ios::seek_dir,int) -@ stub -arch=win64 ?seekoff@strstreambuf@@UEAAJJW4seek_dir@ios@@H@Z +@ thiscall -arch=win32 ?seekoff@strstreambuf@@UAEJJW4seek_dir@ios@@H@Z(ptr long long long) strstreambuf_seekoff +@ cdecl -arch=win64 ?seekoff@strstreambuf@@UEAAJJW4seek_dir@ios@@H@Z(ptr long long long) strstreambuf_seekoff @ stub -arch=win32 ?seekp@ostream@@QAEAAV1@J@Z # class ostream & __thiscall ostream::seekp(long) @ stub -arch=win64 ?seekp@ostream@@QEAAAEAV1@J@Z @ stub -arch=win32 ?seekp@ostream@@QAEAAV1@JW4seek_dir@ios@@@Z # class ostream & __thiscall ostream::seekp(long,enum ios::seek_dir) @@ -669,8 +669,8 @@ @ stub -arch=win64 ?setbuf@ofstream@@QEAAPEAVstreambuf@@PEADH@Z @ thiscall -arch=win32 ?setbuf@streambuf@@UAEPAV1@PADH@Z(ptr ptr long) streambuf_setbuf @ cdecl -arch=win64 ?setbuf@streambuf@@UEAAPEAV1@PEADH@Z(ptr ptr long) streambuf_setbuf -@ stub -arch=win32 ?setbuf@strstreambuf@@UAEPAVstreambuf@@PADH@Z # virtual class streambuf * __thiscall strstreambuf::setbuf(char *,int) -@ stub -arch=win64 ?setbuf@strstreambuf@@UEAAPEAVstreambuf@@PEADH@Z +@ thiscall -arch=win32 ?setbuf@strstreambuf@@UAEPAVstreambuf@@PADH@Z(ptr ptr long) strstreambuf_setbuf +@ cdecl -arch=win64 ?setbuf@strstreambuf@@UEAAPEAVstreambuf@@PEADH@Z(ptr ptr long) strstreambuf_setbuf @ thiscall -arch=win32 ?setf@ios@@QAEJJ@Z(ptr long) ios_setf @ cdecl -arch=win64 ?setf@ios@@QEAAJJ@Z(ptr long) ios_setf @ thiscall -arch=win32 ?setf@ios@@QAEJJJ@Z(ptr long long) ios_setf_mask @@ -691,8 +691,8 @@ @ stub -arch=win64 ?setmode@ofstream@@QEAAHH@Z @ thiscall -arch=win32 ?setp@streambuf@@IAEXPAD0@Z(ptr ptr ptr) streambuf_setp @ cdecl -arch=win64 ?setp@streambuf@@IEAAXPEAD0@Z(ptr ptr ptr) streambuf_setp -@ stub -arch=win32 ?setrwbuf@stdiobuf@@QAEHHH@Z # int __thiscall stdiobuf::setrwbuf(int,int) -@ stub -arch=win64 ?setrwbuf@stdiobuf@@QEAAHHH@Z +@ thiscall -arch=win32 ?setrwbuf@stdiobuf@@QAEHHH@Z(ptr long long) stdiobuf_setrwbuf +@ cdecl -arch=win64 ?setrwbuf@stdiobuf@@QEAAHHH@Z(ptr long long) stdiobuf_setrwbuf @ thiscall -arch=win32 ?sgetc@streambuf@@QAEHXZ(ptr) streambuf_sgetc @ cdecl -arch=win64 ?sgetc@streambuf@@QEAAHXZ(ptr) streambuf_sgetc @ thiscall -arch=win32 ?sgetn@streambuf@@QAEHPADH@Z(ptr ptr long) streambuf_sgetn @@ -708,8 +708,8 @@ @ cdecl -arch=win64 ?sputc@streambuf@@QEAAHH@Z(ptr long) streambuf_sputc @ thiscall -arch=win32 ?sputn@streambuf@@QAEHPBDH@Z(ptr str long) streambuf_sputn @ cdecl -arch=win64 ?sputn@streambuf@@QEAAHPEBDH@Z(ptr str long) streambuf_sputn -@ stub -arch=win32 ?stdiofile@stdiobuf@@QAEPAU_iobuf@@XZ # struct _iobuf * __thiscall stdiobuf::stdiofile(void) -@ stub -arch=win64 ?stdiofile@stdiobuf@@QEAAPEAU_iobuf@@XZ +@ thiscall -arch=win32 ?stdiofile@stdiobuf@@QAEPAU_iobuf@@XZ(ptr) stdiobuf_stdiofile +@ cdecl -arch=win64 ?stdiofile@stdiobuf@@QEAAPEAU_iobuf@@XZ(ptr) stdiobuf_stdiofile @ thiscall -arch=win32 ?stossc@streambuf@@QAEXXZ(ptr) streambuf_stossc @ cdecl -arch=win64 ?stossc@streambuf@@QEAAXXZ(ptr) streambuf_stossc @ stub -arch=win32 ?str@istrstream@@QAEPADXZ # char * __thiscall istrstream::str(void) @@ -718,19 +718,19 @@ @ stub -arch=win64 ?str@ostrstream@@QEAAPEADXZ @ stub -arch=win32 ?str@strstream@@QAEPADXZ # char * __thiscall strstream::str(void) @ stub -arch=win64 ?str@strstream@@QEAAPEADXZ -@ thiscall -arch=win32 ?str@strstreambuf@@QAEPADXZ(ptr) MSVCIRT_str_sl_void # char * __thiscall strstreambuf::str(void) -@ cdecl -arch=win64 ?str@strstreambuf@@QEAAPEADXZ(ptr) MSVCIRT_str_sl_void +@ thiscall -arch=win32 ?str@strstreambuf@@QAEPADXZ(ptr) strstreambuf_str +@ cdecl -arch=win64 ?str@strstreambuf@@QEAAPEADXZ(ptr) strstreambuf_str # @ extern ?sunk_with_stdio@ios@@0HA # static int ios::sunk_with_stdio @ thiscall -arch=win32 ?sync@filebuf@@UAEHXZ(ptr) filebuf_sync @ cdecl -arch=win64 ?sync@filebuf@@UEAAHXZ(ptr) filebuf_sync @ stub -arch=win32 ?sync@istream@@QAEHXZ # int __thiscall istream::sync(void) @ stub -arch=win64 ?sync@istream@@QEAAHXZ -@ stub -arch=win32 ?sync@stdiobuf@@UAEHXZ # virtual int __thiscall stdiobuf::sync(void) -@ stub -arch=win64 ?sync@stdiobuf@@UEAAHXZ +@ thiscall -arch=win32 ?sync@stdiobuf@@UAEHXZ(ptr) stdiobuf_sync +@ cdecl -arch=win64 ?sync@stdiobuf@@UEAAHXZ(ptr) stdiobuf_sync @ thiscall -arch=win32 ?sync@streambuf@@UAEHXZ(ptr) streambuf_sync @ cdecl -arch=win64 ?sync@streambuf@@UEAAHXZ(ptr) streambuf_sync -@ stub -arch=win32 ?sync@strstreambuf@@UAEHXZ # virtual int __thiscall strstreambuf::sync(void) -@ stub -arch=win64 ?sync@strstreambuf@@UEAAHXZ +@ thiscall -arch=win32 ?sync@strstreambuf@@UAEHXZ(ptr) strstreambuf_sync +@ cdecl -arch=win64 ?sync@strstreambuf@@UEAAHXZ(ptr) strstreambuf_sync @ cdecl ?sync_with_stdio@ios@@SAXXZ() ios_sync_with_stdio @ stub -arch=win32 ?tellg@istream@@QAEJXZ # long __thiscall istream::tellg(void) @ stub -arch=win64 ?tellg@istream@@QEAAJXZ @@ -747,10 +747,10 @@ @ cdecl -arch=win64 ?unbuffered@streambuf@@IEBAHXZ(ptr) streambuf_unbuffered_get @ thiscall -arch=win32 ?underflow@filebuf@@UAEHXZ(ptr) filebuf_underflow @ cdecl -arch=win64 ?underflow@filebuf@@UEAAHXZ(ptr) filebuf_underflow -@ stub -arch=win32 ?underflow@stdiobuf@@UAEHXZ # virtual int __thiscall stdiobuf::underflow(void) -@ stub -arch=win64 ?underflow@stdiobuf@@UEAAHXZ -@ stub -arch=win32 ?underflow@strstreambuf@@UAEHXZ # virtual int __thiscall strstreambuf::underflow(void) -@ stub -arch=win64 ?underflow@strstreambuf@@UEAAHXZ +@ thiscall -arch=win32 ?underflow@stdiobuf@@UAEHXZ(ptr) stdiobuf_underflow +@ cdecl -arch=win64 ?underflow@stdiobuf@@UEAAHXZ(ptr) stdiobuf_underflow +@ thiscall -arch=win32 ?underflow@strstreambuf@@UAEHXZ(ptr) strstreambuf_underflow +@ cdecl -arch=win64 ?underflow@strstreambuf@@UEAAHXZ(ptr) strstreambuf_underflow @ cdecl -arch=win32 ?unlock@ios@@QAAXXZ(ptr) ios_unlock @ cdecl -arch=win64 ?unlock@ios@@QEAAXXZ(ptr) ios_unlock @ thiscall -arch=win32 ?unlock@streambuf@@QAEXXZ(ptr) streambuf_unlock diff -Nru wine1.7-1.7.50/dlls/msvcirt/tests/msvcirt.c wine1.7-1.7.55/dlls/msvcirt/tests/msvcirt.c --- wine1.7-1.7.50/dlls/msvcirt/tests/msvcirt.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcirt/tests/msvcirt.c 2015-11-13 14:32:40.000000000 +0000 @@ -27,6 +27,8 @@ typedef LONG streamoff; typedef LONG streampos; typedef int filedesc; +typedef void* (__cdecl *allocFunction)(LONG); +typedef void (__cdecl *freeFunction)(void*); typedef enum { IOSTATE_goodbit = 0x0, @@ -102,6 +104,23 @@ int close; } filebuf; +/* class strstreambuf */ +typedef struct { + streambuf base; + int dynamic; + int increase; + int unknown; + int constant; + allocFunction f_alloc; + freeFunction f_free; +} strstreambuf; + +/* class stdiobuf */ +typedef struct { + streambuf base; + FILE *file; +} stdiobuf; + /* class ios */ struct _ostream; typedef struct { @@ -132,6 +151,7 @@ #endif static void* (__cdecl *p_operator_new)(unsigned int); +static void (__cdecl *p_operator_delete)(void*); /* streambuf */ static streambuf* (*__thiscall p_streambuf_reserve_ctor)(streambuf*, char*, int); @@ -172,6 +192,30 @@ static int (*__thiscall p_filebuf_underflow)(filebuf*); static streampos (*__thiscall p_filebuf_seekoff)(filebuf*, streamoff, ios_seek_dir, int); +/* strstreambuf */ +static strstreambuf* (*__thiscall p_strstreambuf_dynamic_ctor)(strstreambuf*, int); +static strstreambuf* (*__thiscall p_strstreambuf_funcs_ctor)(strstreambuf*, allocFunction, freeFunction); +static strstreambuf* (*__thiscall p_strstreambuf_buffer_ctor)(strstreambuf*, char*, int, char*); +static strstreambuf* (*__thiscall p_strstreambuf_ubuffer_ctor)(strstreambuf*, unsigned char*, int, unsigned char*); +static strstreambuf* (*__thiscall p_strstreambuf_ctor)(strstreambuf*); +static void (*__thiscall p_strstreambuf_dtor)(strstreambuf*); +static int (*__thiscall p_strstreambuf_doallocate)(strstreambuf*); +static void (*__thiscall p_strstreambuf_freeze)(strstreambuf*, int); +static int (*__thiscall p_strstreambuf_overflow)(strstreambuf*, int); +static streampos (*__thiscall p_strstreambuf_seekoff)(strstreambuf*, streamoff, ios_seek_dir, int); +static streambuf* (*__thiscall p_strstreambuf_setbuf)(strstreambuf*, char*, int); +static int (*__thiscall p_strstreambuf_underflow)(strstreambuf*); + +/* stdiobuf */ +static stdiobuf* (*__thiscall p_stdiobuf_file_ctor)(stdiobuf*, FILE*); +static void (*__thiscall p_stdiobuf_dtor)(stdiobuf*); +static int (*__thiscall p_stdiobuf_overflow)(stdiobuf*, int); +static int (*__thiscall p_stdiobuf_pbackfail)(stdiobuf*, int); +static streampos (*__thiscall p_stdiobuf_seekoff)(stdiobuf*, streamoff, ios_seek_dir, int); +static int (*__thiscall p_stdiobuf_setrwbuf)(stdiobuf*, int, int); +static int (*__thiscall p_stdiobuf_sync)(stdiobuf*); +static int (*__thiscall p_stdiobuf_underflow)(stdiobuf*); + /* ios */ static ios* (*__thiscall p_ios_copy_ctor)(ios*, const ios*); static ios* (*__thiscall p_ios_ctor)(ios*); @@ -278,6 +322,7 @@ if(sizeof(void*) == 8) { /* 64-bit initialization */ p_operator_new = (void*)GetProcAddress(msvcrt, "??2@YAPEAX_K@Z"); + p_operator_delete = (void*)GetProcAddress(msvcrt, "??3@YAXPEAX@Z"); SET(p_streambuf_reserve_ctor, "??0streambuf@@IEAA@PEADH@Z"); SET(p_streambuf_ctor, "??0streambuf@@IEAA@XZ"); @@ -316,6 +361,28 @@ SET(p_filebuf_underflow, "?underflow@filebuf@@UEAAHXZ"); SET(p_filebuf_seekoff, "?seekoff@filebuf@@UEAAJJW4seek_dir@ios@@H@Z"); + SET(p_strstreambuf_dynamic_ctor, "??0strstreambuf@@QEAA@H@Z"); + SET(p_strstreambuf_funcs_ctor, "??0strstreambuf@@QEAA@P6APEAXJ@ZP6AXPEAX@Z@Z"); + SET(p_strstreambuf_buffer_ctor, "??0strstreambuf@@QEAA@PEADH0@Z"); + SET(p_strstreambuf_ubuffer_ctor, "??0strstreambuf@@QEAA@PEAEH0@Z"); + SET(p_strstreambuf_ctor, "??0strstreambuf@@QEAA@XZ"); + SET(p_strstreambuf_dtor, "??1strstreambuf@@UEAA@XZ"); + SET(p_strstreambuf_doallocate, "?doallocate@strstreambuf@@MEAAHXZ"); + SET(p_strstreambuf_freeze, "?freeze@strstreambuf@@QEAAXH@Z"); + SET(p_strstreambuf_overflow, "?overflow@strstreambuf@@UEAAHH@Z"); + SET(p_strstreambuf_seekoff, "?seekoff@strstreambuf@@UEAAJJW4seek_dir@ios@@H@Z"); + SET(p_strstreambuf_setbuf, "?setbuf@strstreambuf@@UEAAPEAVstreambuf@@PEADH@Z"); + SET(p_strstreambuf_underflow, "?underflow@strstreambuf@@UEAAHXZ"); + + SET(p_stdiobuf_file_ctor, "??0stdiobuf@@QEAA@PEAU_iobuf@@@Z"); + SET(p_stdiobuf_dtor, "??1stdiobuf@@UEAA@XZ"); + SET(p_stdiobuf_overflow, "?overflow@stdiobuf@@UEAAHH@Z"); + SET(p_stdiobuf_pbackfail, "?pbackfail@stdiobuf@@UEAAHH@Z"); + SET(p_stdiobuf_seekoff, "?seekoff@stdiobuf@@UEAAJJW4seek_dir@ios@@H@Z"); + SET(p_stdiobuf_setrwbuf, "?setrwbuf@stdiobuf@@QEAAHHH@Z"); + SET(p_stdiobuf_sync, "?sync@stdiobuf@@UEAAHXZ"); + SET(p_stdiobuf_underflow, "?underflow@stdiobuf@@UEAAHXZ"); + SET(p_ios_copy_ctor, "??0ios@@IEAA@AEBV0@@Z"); SET(p_ios_ctor, "??0ios@@IEAA@XZ"); SET(p_ios_sb_ctor, "??0ios@@QEAA@PEAVstreambuf@@@Z"); @@ -342,6 +409,7 @@ SET(p_ios_pword, "?pword@ios@@QEBAAEAPEAXH@Z"); } else { p_operator_new = (void*)GetProcAddress(msvcrt, "??2@YAPAXI@Z"); + p_operator_delete = (void*)GetProcAddress(msvcrt, "??3@YAXPAX@Z"); SET(p_streambuf_reserve_ctor, "??0streambuf@@IAE@PADH@Z"); SET(p_streambuf_ctor, "??0streambuf@@IAE@XZ"); @@ -380,6 +448,28 @@ SET(p_filebuf_underflow, "?underflow@filebuf@@UAEHXZ"); SET(p_filebuf_seekoff, "?seekoff@filebuf@@UAEJJW4seek_dir@ios@@H@Z"); + SET(p_strstreambuf_dynamic_ctor, "??0strstreambuf@@QAE@H@Z"); + SET(p_strstreambuf_funcs_ctor, "??0strstreambuf@@QAE@P6APAXJ@ZP6AXPAX@Z@Z"); + SET(p_strstreambuf_buffer_ctor, "??0strstreambuf@@QAE@PADH0@Z"); + SET(p_strstreambuf_ubuffer_ctor, "??0strstreambuf@@QAE@PAEH0@Z"); + SET(p_strstreambuf_ctor, "??0strstreambuf@@QAE@XZ"); + SET(p_strstreambuf_dtor, "??1strstreambuf@@UAE@XZ"); + SET(p_strstreambuf_doallocate, "?doallocate@strstreambuf@@MAEHXZ"); + SET(p_strstreambuf_freeze, "?freeze@strstreambuf@@QAEXH@Z"); + SET(p_strstreambuf_overflow, "?overflow@strstreambuf@@UAEHH@Z"); + SET(p_strstreambuf_seekoff, "?seekoff@strstreambuf@@UAEJJW4seek_dir@ios@@H@Z"); + SET(p_strstreambuf_setbuf, "?setbuf@strstreambuf@@UAEPAVstreambuf@@PADH@Z"); + SET(p_strstreambuf_underflow, "?underflow@strstreambuf@@UAEHXZ"); + + SET(p_stdiobuf_file_ctor, "??0stdiobuf@@QAE@PAU_iobuf@@@Z"); + SET(p_stdiobuf_dtor, "??1stdiobuf@@UAE@XZ"); + SET(p_stdiobuf_overflow, "?overflow@stdiobuf@@UAEHH@Z"); + SET(p_stdiobuf_pbackfail, "?pbackfail@stdiobuf@@UAEHH@Z"); + SET(p_stdiobuf_seekoff, "?seekoff@stdiobuf@@UAEJJW4seek_dir@ios@@H@Z"); + SET(p_stdiobuf_setrwbuf, "?setrwbuf@stdiobuf@@QAEHHH@Z"); + SET(p_stdiobuf_sync, "?sync@stdiobuf@@UAEHXZ"); + SET(p_stdiobuf_underflow, "?underflow@stdiobuf@@UAEHXZ"); + SET(p_ios_copy_ctor, "??0ios@@IAE@ABV0@@Z"); SET(p_ios_ctor, "??0ios@@IAE@XZ"); SET(p_ios_sb_ctor, "??0ios@@QAE@PAVstreambuf@@@Z"); @@ -1345,6 +1435,38 @@ ret = (int) call_func4(p_filebuf_seekoff, &fb1, 16, SEEKDIR_beg, 0); ok(ret == 16, "wrong return, expected 16 got %d\n", ret); + /* pbackfail */ + ret = (int) call_func2(p_streambuf_pbackfail, &fb1.base, 'B'); + ok(ret == 'B', "wrong return, expected 'B' got %d\n", ret); + ok(fb1.base.gptr == NULL, "wrong get pointer, expected %p got %p\n", NULL, fb1.base.gptr); + ok(fb1.base.pptr == NULL, "wrong put pointer, expected %p got %p\n", NULL, fb1.base.pptr); + ok(_tell(fb1.fd) == 15, "_tell failed\n"); + fb1.base.eback = fb1.base.gptr = fb1.base.base; + fb1.base.egptr = fb1.base.pbase = fb1.base.pptr = fb1.base.base + 256; + fb1.base.epptr = fb1.base.ebuf; + ret = (int) call_func2(p_streambuf_pbackfail, &fb1.base, 'C'); + ok(ret == EOF, "wrong return, expected EOF got %d\n", ret); + ok(fb1.base.gptr == fb1.base.base, "wrong get pointer, expected %p got %p\n", fb1.base.base, fb1.base.gptr); + ok(fb1.base.pptr == NULL, "wrong put pointer, expected %p got %p\n", NULL, fb1.base.pptr); + ok(_tell(fb1.fd) == 15, "_tell failed\n"); + fb1.base.eback = fb1.base.gptr = fb1.base.base; + fb1.base.egptr = fb1.base.base + 2; + ret = (int) call_func2(p_streambuf_pbackfail, &fb1.base, 'C'); + ok(ret == 'C', "wrong return, expected 'C' got %d\n", ret); + ok(fb1.base.gptr == NULL, "wrong get pointer, expected %p got %p\n", NULL, fb1.base.gptr); + ok(fb1.base.pptr == NULL, "wrong put pointer, expected %p got %p\n", NULL, fb1.base.pptr); + ok(_tell(fb1.fd) == 12, "_tell failed\n"); + fb1.base.eback = fb1.base.gptr = fb1.base.base; + fb1.base.egptr = fb1.base.ebuf; + *fb1.base.gptr++ = 'D'; + ret = (int) call_func2(p_streambuf_pbackfail, &fb1.base, 'C'); + ok(ret == 'C', "wrong return, expected 'C' got %d\n", ret); + ok(fb1.base.gptr == fb1.base.base, "wrong get pointer, expected %p got %p\n", fb1.base.base, fb1.base.gptr); + ok(*fb1.base.gptr == 'C', "wrong character, expected 'C' got '%c'\n", *fb1.base.gptr); + ok(fb1.base.pptr == NULL, "wrong put pointer, expected %p got %p\n", NULL, fb1.base.pptr); + ok(_tell(fb1.fd) == 12, "_tell failed\n"); + fb1.base.eback = fb1.base.gptr = fb1.base.egptr = NULL; + /* close */ pret = (filebuf*) call_func1(p_filebuf_close, &fb2); ok(pret == NULL, "wrong return, expected %p got %p\n", NULL, pret); @@ -1375,6 +1497,711 @@ CloseHandle(thread); } +static void test_strstreambuf(void) +{ + strstreambuf ssb1, ssb2; + streambuf *pret; + char buffer[64], *pbuffer; + int ret; + + memset(&ssb1, 0xab, sizeof(strstreambuf)); + memset(&ssb2, 0xab, sizeof(strstreambuf)); + + /* constructors/destructor */ + call_func2(p_strstreambuf_dynamic_ctor, &ssb1, 64); + ok(ssb1.base.allocated == 0, "wrong allocate value, expected 0 got %d\n", ssb1.base.allocated); + ok(ssb1.base.unbuffered == 0, "wrong unbuffered value, expected 0 got %d\n", ssb1.base.unbuffered); + ok(ssb1.dynamic == 1, "expected 1, got %d\n", ssb1.dynamic); + ok(ssb1.increase == 64, "expected 64, got %d\n", ssb1.increase); + ok(ssb1.constant == 0, "expected 0, got %d\n", ssb1.constant); + ok(ssb1.f_alloc == NULL, "expected %p, got %p\n", NULL, ssb1.f_alloc); + ok(ssb1.f_free == NULL, "expected %p, got %p\n", NULL, ssb1.f_free); + call_func1(p_strstreambuf_dtor, &ssb1); + call_func3(p_strstreambuf_funcs_ctor, &ssb2, (allocFunction)p_operator_new, p_operator_delete); + ok(ssb2.base.allocated == 0, "wrong allocate value, expected 0 got %d\n", ssb2.base.allocated); + ok(ssb2.base.unbuffered == 0, "wrong unbuffered value, expected 0 got %d\n", ssb2.base.unbuffered); + ok(ssb2.dynamic == 1, "expected 1, got %d\n", ssb2.dynamic); + ok(ssb2.increase == 1, "expected 1, got %d\n", ssb2.increase); + ok(ssb2.constant == 0, "expected 0, got %d\n", ssb2.constant); + ok(ssb2.f_alloc == (allocFunction)p_operator_new, "expected %p, got %p\n", p_operator_new, ssb2.f_alloc); + ok(ssb2.f_free == p_operator_delete, "expected %p, got %p\n", p_operator_delete, ssb2.f_free); + call_func1(p_strstreambuf_dtor, &ssb2); + memset(&ssb1, 0xab, sizeof(strstreambuf)); + memset(&ssb2, 0xab, sizeof(strstreambuf)); + call_func4(p_strstreambuf_buffer_ctor, &ssb1, buffer, 64, buffer + 20); + ok(ssb1.base.allocated == 0, "wrong allocate value, expected 0 got %d\n", ssb1.base.allocated); + ok(ssb1.base.unbuffered == 0, "wrong unbuffered value, expected 0 got %d\n", ssb1.base.unbuffered); + ok(ssb1.base.base == buffer, "wrong buffer, expected %p got %p\n", buffer, ssb1.base.base); + ok(ssb1.base.ebuf == buffer + 64, "wrong buffer end, expected %p got %p\n", buffer + 64, ssb1.base.ebuf); + ok(ssb1.base.eback == buffer, "wrong get base, expected %p got %p\n", buffer, ssb1.base.eback); + ok(ssb1.base.gptr == buffer, "wrong get pointer, expected %p got %p\n", buffer, ssb1.base.gptr); + ok(ssb1.base.egptr == buffer + 20, "wrong get end, expected %p got %p\n", buffer + 20, ssb1.base.egptr); + ok(ssb1.base.pbase == buffer + 20, "wrong put base, expected %p got %p\n", buffer + 20, ssb1.base.pbase); + ok(ssb1.base.pptr == buffer + 20, "wrong put pointer, expected %p got %p\n", buffer + 20, ssb1.base.pptr); + ok(ssb1.base.epptr == buffer + 64, "wrong put end, expected %p got %p\n", buffer + 64, ssb1.base.epptr); + ok(ssb1.dynamic == 0, "expected 0, got %d\n", ssb1.dynamic); + ok(ssb1.constant == 1, "expected 1, got %d\n", ssb1.constant); + call_func1(p_strstreambuf_dtor, &ssb1); + strcpy(buffer, "Test"); + call_func4(p_strstreambuf_buffer_ctor, &ssb2, buffer, 0, buffer + 20); + ok(ssb2.base.allocated == 0, "wrong allocate value, expected 0 got %d\n", ssb2.base.allocated); + ok(ssb2.base.unbuffered == 0, "wrong unbuffered value, expected 0 got %d\n", ssb2.base.unbuffered); + ok(ssb2.base.base == buffer, "wrong buffer, expected %p got %p\n", buffer, ssb2.base.base); + ok(ssb2.base.ebuf == buffer + 4, "wrong buffer end, expected %p got %p\n", buffer + 4, ssb2.base.ebuf); + ok(ssb2.base.eback == buffer, "wrong get base, expected %p got %p\n", buffer, ssb2.base.eback); + ok(ssb2.base.gptr == buffer, "wrong get pointer, expected %p got %p\n", buffer, ssb2.base.gptr); + ok(ssb2.base.egptr == buffer + 20, "wrong get end, expected %p got %p\n", buffer + 20, ssb2.base.egptr); + ok(ssb2.base.pbase == buffer + 20, "wrong put base, expected %p got %p\n", buffer + 20, ssb2.base.pbase); + ok(ssb2.base.pptr == buffer + 20, "wrong put pointer, expected %p got %p\n", buffer + 20, ssb2.base.pptr); + ok(ssb2.base.epptr == buffer + 4, "wrong put end, expected %p got %p\n", buffer + 4, ssb2.base.epptr); + ok(ssb2.dynamic == 0, "expected 0, got %d\n", ssb2.dynamic); + ok(ssb2.constant == 1, "expected 1, got %d\n", ssb2.constant); + call_func1(p_strstreambuf_dtor, &ssb2); + memset(&ssb1, 0xab, sizeof(strstreambuf)); + memset(&ssb2, 0xab, sizeof(strstreambuf)); + call_func4(p_strstreambuf_buffer_ctor, &ssb1, NULL, 16, buffer + 20); + ok(ssb1.base.allocated == 0, "wrong allocate value, expected 0 got %d\n", ssb1.base.allocated); + ok(ssb1.base.unbuffered == 0, "wrong unbuffered value, expected 0 got %d\n", ssb1.base.unbuffered); + ok(ssb1.base.base == NULL, "wrong buffer, expected %p got %p\n", NULL, ssb1.base.base); + ok(ssb1.base.ebuf == (char*)16, "wrong buffer end, expected %p got %p\n", (char*)16, ssb1.base.ebuf); + ok(ssb1.base.eback == NULL, "wrong get base, expected %p got %p\n", NULL, ssb1.base.eback); + ok(ssb1.base.gptr == NULL, "wrong get pointer, expected %p got %p\n", NULL, ssb1.base.gptr); + ok(ssb1.base.egptr == buffer + 20, "wrong get end, expected %p got %p\n", buffer + 20, ssb1.base.egptr); + ok(ssb1.base.pbase == buffer + 20, "wrong put base, expected %p got %p\n", buffer + 20, ssb1.base.pbase); + ok(ssb1.base.pptr == buffer + 20, "wrong put pointer, expected %p got %p\n", buffer + 20, ssb1.base.pptr); + ok(ssb1.base.epptr == (char*)16, "wrong put end, expected %p got %p\n", (char*)16, ssb1.base.epptr); + ok(ssb1.dynamic == 0, "expected 0, got %d\n", ssb1.dynamic); + ok(ssb1.constant == 1, "expected 1, got %d\n", ssb1.constant); + call_func1(p_strstreambuf_dtor, &ssb1); + call_func4(p_strstreambuf_buffer_ctor, &ssb2, buffer, 0, NULL); + ok(ssb2.base.allocated == 0, "wrong allocate value, expected 0 got %d\n", ssb2.base.allocated); + ok(ssb2.base.unbuffered == 0, "wrong unbuffered value, expected 0 got %d\n", ssb2.base.unbuffered); + ok(ssb2.base.base == buffer, "wrong buffer, expected %p got %p\n", buffer, ssb2.base.base); + ok(ssb2.base.ebuf == buffer + 4, "wrong buffer end, expected %p got %p\n", buffer + 4, ssb2.base.ebuf); + ok(ssb2.base.eback == buffer, "wrong get base, expected %p got %p\n", buffer, ssb2.base.eback); + ok(ssb2.base.gptr == buffer, "wrong get pointer, expected %p got %p\n", buffer, ssb2.base.gptr); + ok(ssb2.base.egptr == buffer + 4, "wrong get end, expected %p got %p\n", buffer + 4, ssb2.base.egptr); + ok(ssb2.base.pbase == NULL, "wrong put base, expected %p got %p\n", NULL, ssb2.base.pbase); + ok(ssb2.base.pptr == NULL, "wrong put pointer, expected %p got %p\n", NULL, ssb2.base.pptr); + ok(ssb2.base.epptr == NULL, "wrong put end, expected %p got %p\n", NULL, ssb2.base.epptr); + ok(ssb2.dynamic == 0, "expected 0, got %d\n", ssb2.dynamic); + ok(ssb2.constant == 1, "expected 1, got %d\n", ssb2.constant); + call_func1(p_strstreambuf_dtor, &ssb2); + memset(&ssb1, 0xab, sizeof(strstreambuf)); + memset(&ssb2, 0xab, sizeof(strstreambuf)); + call_func4(p_strstreambuf_buffer_ctor, &ssb1, buffer, -5, buffer + 20); + ok(ssb1.base.allocated == 0, "wrong allocate value, expected 0 got %d\n", ssb1.base.allocated); + ok(ssb1.base.unbuffered == 0, "wrong unbuffered value, expected 0 got %d\n", ssb1.base.unbuffered); + ok(ssb1.base.base == buffer, "wrong buffer, expected %p got %p\n", buffer, ssb1.base.base); + ok(ssb1.base.ebuf == buffer + 0x7fffffff || ssb1.base.ebuf == (char*)-1, + "wrong buffer end, expected %p + 0x7fffffff or -1, got %p\n", buffer, ssb1.base.ebuf); + ok(ssb1.base.eback == buffer, "wrong get base, expected %p got %p\n", buffer, ssb1.base.eback); + ok(ssb1.base.gptr == buffer, "wrong get pointer, expected %p got %p\n", buffer, ssb1.base.gptr); + ok(ssb1.base.egptr == buffer + 20, "wrong get end, expected %p got %p\n", buffer + 20, ssb1.base.egptr); + ok(ssb1.base.pbase == buffer + 20, "wrong put base, expected %p got %p\n", buffer + 20, ssb1.base.pbase); + ok(ssb1.base.pptr == buffer + 20, "wrong put pointer, expected %p got %p\n", buffer + 20, ssb1.base.pptr); + ok(ssb1.base.epptr == buffer + 0x7fffffff || ssb1.base.epptr == (char*)-1, + "wrong put end, expected %p + 0x7fffffff or -1, got %p\n", buffer, ssb1.base.epptr); + ok(ssb1.dynamic == 0, "expected 0, got %d\n", ssb1.dynamic); + ok(ssb1.constant == 1, "expected 1, got %d\n", ssb1.constant); + call_func1(p_strstreambuf_ctor, &ssb2); + ok(ssb2.base.allocated == 0, "wrong allocate value, expected 0 got %d\n", ssb2.base.allocated); + ok(ssb2.base.unbuffered == 0, "wrong unbuffered value, expected 0 got %d\n", ssb2.base.unbuffered); + ok(ssb2.dynamic == 1, "expected 1, got %d\n", ssb2.dynamic); + ok(ssb2.increase == 1, "expected 1, got %d\n", ssb2.increase); + ok(ssb2.constant == 0, "expected 0, got %d\n", ssb2.constant); + ok(ssb2.f_alloc == NULL, "expected %p, got %p\n", NULL, ssb2.f_alloc); + ok(ssb2.f_free == NULL, "expected %p, got %p\n", NULL, ssb2.f_free); + + /* freeze */ + call_func2(p_strstreambuf_freeze, &ssb1, 0); + ok(ssb1.dynamic == 0, "expected 0, got %d\n", ssb1.dynamic); + ssb1.constant = 0; + call_func2(p_strstreambuf_freeze, &ssb1, 0); + ok(ssb1.dynamic == 1, "expected 1, got %d\n", ssb1.dynamic); + call_func2(p_strstreambuf_freeze, &ssb1, 3); + ok(ssb1.dynamic == 0, "expected 0, got %d\n", ssb1.dynamic); + ssb1.constant = 1; + call_func2(p_strstreambuf_freeze, &ssb2, 5); + ok(ssb2.dynamic == 0, "expected 0, got %d\n", ssb2.dynamic); + call_func2(p_strstreambuf_freeze, &ssb2, 0); + ok(ssb2.dynamic == 1, "expected 1, got %d\n", ssb2.dynamic); + + /* doallocate */ + ssb2.dynamic = 0; + ssb2.increase = 5; + ret = (int) call_func1(p_strstreambuf_doallocate, &ssb2); + ok(ret == 1, "return value %d\n", ret); + ok(ssb2.base.ebuf == ssb2.base.base + 5, "expected %p, got %p\n", ssb2.base.base + 5, ssb2.base.ebuf); + ssb2.base.eback = ssb2.base.base; + ssb2.base.gptr = ssb2.base.base + 2; + ssb2.base.egptr = ssb2.base.base + 4; + strcpy(ssb2.base.base, "Check"); + ret = (int) call_func1(p_strstreambuf_doallocate, &ssb2); + ok(ret == 1, "return value %d\n", ret); + ok(ssb2.base.ebuf == ssb2.base.base + 10, "expected %p, got %p\n", ssb2.base.base + 10, ssb2.base.ebuf); + ok(ssb2.base.eback == ssb2.base.base, "wrong get base, expected %p got %p\n", ssb2.base.base, ssb2.base.eback); + ok(ssb2.base.gptr == ssb2.base.base + 2, "wrong get pointer, expected %p got %p\n", ssb2.base.base + 2, ssb2.base.gptr); + ok(ssb2.base.egptr == ssb2.base.base + 4, "wrong get end, expected %p got %p\n", ssb2.base.base + 4, ssb2.base.egptr); + ok(!strncmp(ssb2.base.base, "Check", 5), "strings are not equal\n"); + ssb2.base.pbase = ssb2.base.pptr = ssb2.base.base + 4; + ssb2.base.epptr = ssb2.base.ebuf; + ssb2.increase = -3; + ret = (int) call_func1(p_strstreambuf_doallocate, &ssb2); + ok(ret == 1, "return value %d\n", ret); + ok(ssb2.base.ebuf == ssb2.base.base + 11, "expected %p, got %p\n", ssb2.base.base + 11, ssb2.base.ebuf); + ok(ssb2.base.pbase == ssb2.base.base + 4, "wrong put base, expected %p got %p\n", ssb2.base.base + 4, ssb2.base.pbase); + ok(ssb2.base.pptr == ssb2.base.base + 4, "wrong put pointer, expected %p got %p\n", ssb2.base.base + 4, ssb2.base.pptr); + ok(ssb2.base.epptr == ssb2.base.base + 10, "wrong put end, expected %p got %p\n", ssb2.base.base + 10, ssb2.base.epptr); + ok(!strncmp(ssb2.base.base, "Check", 5), "strings are not equal\n"); + ssb2.dynamic = 1; + + /* setbuf */ + pret = (streambuf*) call_func3(p_strstreambuf_setbuf, &ssb1, buffer + 16, 16); + ok(pret == &ssb1.base, "expected %p got %p\n", &ssb1.base, pret); + ok(ssb1.base.base == buffer, "wrong buffer, expected %p got %p\n", buffer, ssb1.base.base); + ok(ssb1.increase == 16, "expected 16, got %d\n", ssb1.increase); + pret = (streambuf*) call_func3(p_strstreambuf_setbuf, &ssb2, NULL, 2); + ok(pret == &ssb2.base, "expected %p got %p\n", &ssb2.base, pret); + ok(ssb2.increase == 2, "expected 2, got %d\n", ssb2.increase); + pret = (streambuf*) call_func3(p_strstreambuf_setbuf, &ssb2, buffer, 0); + ok(pret == &ssb2.base, "expected %p got %p\n", &ssb2.base, pret); + ok(ssb2.increase == 2, "expected 2, got %d\n", ssb2.increase); + pret = (streambuf*) call_func3(p_strstreambuf_setbuf, &ssb2, NULL, -2); + ok(pret == &ssb2.base, "expected %p got %p\n", &ssb2.base, pret); + ok(ssb2.increase == -2, "expected -2, got %d\n", ssb2.increase); + + /* underflow */ + ssb1.base.epptr = ssb1.base.ebuf = ssb1.base.base + 64; + ret = (int) call_func1(p_strstreambuf_underflow, &ssb1); + ok(ret == 'T', "expected 'T' got %d\n", ret); + ssb1.base.gptr = ssb1.base.egptr; + ret = (int) call_func1(p_strstreambuf_underflow, &ssb1); + ok(ret == EOF, "expected EOF got %d\n", ret); + ret = (int) call_func3(p_streambuf_xsputn, &ssb1.base, "Gotta make you understand", 5); + ok(ret == 5, "expected 5 got %d\n", ret); + ok(ssb1.base.pptr == buffer + 25, "wrong put pointer, expected %p got %p\n", buffer + 25, ssb1.base.pptr); + ret = (int) call_func1(p_strstreambuf_underflow, &ssb1); + ok(ret == 'G', "expected 'G' got %d\n", ret); + ok(ssb1.base.egptr == buffer + 25, "wrong get end, expected %p got %p\n", buffer + 25, ssb1.base.egptr); + ssb1.base.gptr = ssb1.base.egptr = ssb1.base.pptr = ssb1.base.epptr; + ret = (int) call_func1(p_strstreambuf_underflow, &ssb1); + ok(ret == EOF, "expected EOF got %d\n", ret); + ssb2.base.eback = ssb2.base.gptr = ssb2.base.egptr = NULL; + ssb2.base.pbase = ssb2.base.pptr = ssb2.base.epptr = NULL; + ret = (int) call_func1(p_strstreambuf_underflow, &ssb2); + ok(ret == EOF, "expected EOF got %d\n", ret); + ssb2.base.eback = ssb2.base.base; + ssb2.base.gptr = ssb2.base.egptr = ssb2.base.ebuf; + ret = (int) call_func1(p_strstreambuf_underflow, &ssb2); + ok(ret == EOF, "expected EOF got %d\n", ret); + + /* overflow */ + ssb1.base.pptr = ssb1.base.epptr - 1; + ret = (int) call_func2(p_strstreambuf_overflow, &ssb1, EOF); + ok(ret == 1, "expected 1 got %d\n", ret); + ret = (int) call_func2(p_strstreambuf_overflow, &ssb1, 'A'); + ok(ret == 1, "expected 1 got %d\n", ret); + ok(ssb1.base.pptr == ssb1.base.epptr, "wrong put pointer, expected %p got %p\n", ssb1.base.epptr, ssb1.base.pptr); + ok(*(ssb1.base.pptr - 1) == 'A', "expected 'A' got %d\n", *(ssb1.base.pptr - 1)); + ret = (int) call_func2(p_strstreambuf_overflow, &ssb1, 'B'); + ok(ret == EOF, "expected EOF got %d\n", ret); + ret = (int) call_func2(p_strstreambuf_overflow, &ssb1, EOF); + ok(ret == EOF, "expected EOF got %d\n", ret); + ssb2.dynamic = 0; + ret = (int) call_func2(p_strstreambuf_overflow, &ssb2, 'C'); + ok(ret == EOF, "expected EOF got %d\n", ret); + ssb2.dynamic = 1; + ret = (int) call_func2(p_strstreambuf_overflow, &ssb2, 'C'); + ok(ret == 1, "expected 1 got %d\n", ret); + ok(ssb2.base.ebuf == ssb2.base.base + 12, "expected %p got %p\n", ssb2.base.base + 12, ssb2.base.ebuf); + ok(ssb2.base.gptr == ssb2.base.base + 11, "wrong get pointer, expected %p got %p\n", ssb2.base.base + 11, ssb2.base.gptr); + ok(ssb2.base.pbase == ssb2.base.base + 11, "wrong put base, expected %p got %p\n", ssb2.base.base + 11, ssb2.base.pbase); + ok(ssb2.base.pptr == ssb2.base.base + 12, "wrong put pointer, expected %p got %p\n", ssb2.base.base + 12, ssb2.base.pptr); + ok(ssb2.base.epptr == ssb2.base.base + 12, "wrong put end, expected %p got %p\n", ssb2.base.base + 12, ssb2.base.epptr); + ok(*(ssb2.base.pptr - 1) == 'C', "expected 'C' got %d\n", *(ssb2.base.pptr - 1)); + ssb2.increase = 4; + ssb2.base.eback = ssb2.base.gptr = ssb2.base.egptr = NULL; + ssb2.base.pbase = ssb2.base.pptr = ssb2.base.epptr = NULL; + ret = (int) call_func2(p_strstreambuf_overflow, &ssb2, 'D'); + ok(ret == 1, "expected 1 got %d\n", ret); + ok(ssb2.base.ebuf == ssb2.base.base + 16, "expected %p got %p\n", ssb2.base.base + 16, ssb2.base.ebuf); + ok(ssb2.base.gptr == NULL, "wrong get pointer, expected %p got %p\n", NULL, ssb2.base.gptr); + ok(ssb2.base.pbase == ssb2.base.base, "wrong put base, expected %p got %p\n", ssb2.base.base, ssb2.base.pbase); + ok(ssb2.base.pptr == ssb2.base.base + 1, "wrong put pointer, expected %p got %p\n", ssb2.base.base + 1, ssb2.base.pptr); + ok(ssb2.base.epptr == ssb2.base.base + 16, "wrong put end, expected %p got %p\n", ssb2.base.base + 16, ssb2.base.epptr); + ok(*(ssb2.base.pptr - 1) == 'D', "expected 'D' got %d\n", *(ssb2.base.pptr - 1)); + ssb2.base.pbase = ssb2.base.base + 3; + ssb2.base.pptr = ssb2.base.epptr + 5; + ret = (int) call_func2(p_strstreambuf_overflow, &ssb2, 'E'); + ok(ret == 1, "expected 1 got %d\n", ret); + ok(ssb2.base.ebuf == ssb2.base.base + 20, "expected %p got %p\n", ssb2.base.base + 20, ssb2.base.ebuf); + ok(ssb2.base.gptr == NULL, "wrong get pointer, expected %p got %p\n", NULL, ssb2.base.gptr); + ok(ssb2.base.pbase == ssb2.base.base + 3, "wrong put base, expected %p got %p\n", ssb2.base.base + 3, ssb2.base.pbase); + ok(ssb2.base.pptr == ssb2.base.base + 22, "wrong put pointer, expected %p got %p\n", ssb2.base.base + 22, ssb2.base.pptr); + ok(ssb2.base.epptr == ssb2.base.base + 20, "wrong put end, expected %p got %p\n", ssb2.base.base + 20, ssb2.base.epptr); + ok(*(ssb2.base.pptr - 1) == 'E', "expected 'E' got %d\n", *(ssb2.base.pptr - 1)); + ssb2.base.egptr = ssb2.base.base + 2; + ret = (int) call_func2(p_strstreambuf_overflow, &ssb2, 'F'); + ok(ret == 1, "expected 1 got %d\n", ret); + ok(ssb2.base.ebuf == ssb2.base.base + 24, "expected %p got %p\n", ssb2.base.base + 24, ssb2.base.ebuf); + ok(ssb2.base.gptr != NULL, "wrong get pointer, expected != NULL\n"); + ok(ssb2.base.pbase == ssb2.base.base + 3, "wrong put base, expected %p got %p\n", ssb2.base.base + 3, ssb2.base.pbase); + ok(ssb2.base.pptr == ssb2.base.base + 23, "wrong put pointer, expected %p got %p\n", ssb2.base.base + 23, ssb2.base.pptr); + ok(ssb2.base.epptr == ssb2.base.base + 24, "wrong put end, expected %p got %p\n", ssb2.base.base + 24, ssb2.base.epptr); + ok(*(ssb2.base.pptr - 1) == 'F', "expected 'F' got %d\n", *(ssb2.base.pptr - 1)); + ssb2.base.eback = ssb2.base.gptr = ssb2.base.base; + ssb2.base.epptr = NULL; + ret = (int) call_func2(p_strstreambuf_overflow, &ssb2, 'G'); + ok(ret == 1, "expected 1 got %d\n", ret); + ok(ssb2.base.ebuf == ssb2.base.base + 28, "expected %p got %p\n", ssb2.base.base + 28, ssb2.base.ebuf); + ok(ssb2.base.gptr == ssb2.base.base, "wrong get pointer, expected %p got %p\n", ssb2.base.base, ssb2.base.gptr); + ok(ssb2.base.pbase == ssb2.base.base + 2, "wrong put base, expected %p got %p\n", ssb2.base.base + 2, ssb2.base.pbase); + ok(ssb2.base.pptr == ssb2.base.base + 3, "wrong put pointer, expected %p got %p\n", ssb2.base.base + 3, ssb2.base.pptr); + ok(ssb2.base.epptr == ssb2.base.base + 28, "wrong put end, expected %p got %p\n", ssb2.base.base + 28, ssb2.base.epptr); + ok(*(ssb2.base.pptr - 1) == 'G', "expected 'G' got %d\n", *(ssb2.base.pptr - 1)); + + /* seekoff */ + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb1, 0, SEEKDIR_beg, OPENMODE_in); + ok(ret == 0, "expected 0 got %d\n", ret); + ok(ssb1.base.gptr == ssb1.base.eback, "wrong get pointer, expected %p got %p\n", ssb1.base.eback, ssb1.base.gptr); + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb1, 3, SEEKDIR_beg, OPENMODE_in); + ok(ret == 3, "expected 3 got %d\n", ret); + ok(ssb1.base.gptr == ssb1.base.eback + 3, "wrong get pointer, expected %p got %p\n", ssb1.base.eback + 3, ssb1.base.gptr); + ssb1.base.egptr = ssb1.base.pbase; + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb1, 25, SEEKDIR_beg, OPENMODE_in); + ok(ret == EOF, "expected EOF got %d\n", ret); + ok(ssb1.base.gptr == ssb1.base.eback + 3, "wrong get pointer, expected %p got %p\n", ssb1.base.eback + 3, ssb1.base.gptr); + ssb1.base.gptr = ssb1.base.egptr; + ssb1.base.pptr = ssb1.base.pbase + 10; + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb1, 25, SEEKDIR_beg, OPENMODE_in); + ok(ret == 25, "expected 25 got %d\n", ret); + ok(ssb1.base.gptr == ssb1.base.eback + 25, "wrong get pointer, expected %p got %p\n", ssb1.base.eback + 25, ssb1.base.gptr); + ok(ssb1.base.egptr == ssb1.base.pptr, "wrong get end, expected %p got %p\n", ssb1.base.pptr, ssb1.base.egptr); + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb1, -24, SEEKDIR_cur, OPENMODE_in); + ok(ret == 1, "expected 1 got %d\n", ret); + ok(ssb1.base.gptr == ssb1.base.eback + 1, "wrong get pointer, expected %p got %p\n", ssb1.base.eback + 1, ssb1.base.gptr); + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb1, -5, SEEKDIR_cur, OPENMODE_in); + ok(ret == EOF, "expected EOF got %d\n", ret); + ok(ssb1.base.gptr == ssb1.base.eback + 1, "wrong get pointer, expected %p got %p\n", ssb1.base.eback + 1, ssb1.base.gptr); + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb1, 0, SEEKDIR_end, OPENMODE_in); + ok(ret == 30, "expected 30 got %d\n", ret); + ok(ssb1.base.gptr == ssb1.base.egptr, "wrong get pointer, expected %p got %p\n", ssb1.base.egptr, ssb1.base.gptr); + ssb1.base.gptr = ssb1.base.eback; + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb1, -2, SEEKDIR_end, OPENMODE_in); + ok(ret == 28, "expected 28 got %d\n", ret); + ok(ssb1.base.gptr == ssb1.base.egptr - 2, "wrong get pointer, expected %p got %p\n", ssb1.base.egptr - 2, ssb1.base.gptr); + ssb1.base.gptr = ssb1.base.egptr; + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb1, -5, SEEKDIR_end, OPENMODE_in); + ok(ret == 25, "expected 25 got %d\n", ret); + ok(ssb1.base.gptr == ssb1.base.egptr - 5, "wrong get pointer, expected %p got %p\n", ssb1.base.egptr - 5, ssb1.base.gptr); + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb1, 1, SEEKDIR_end, OPENMODE_in); + ok(ret == EOF, "expected EOF got %d\n", ret); + ok(ssb1.base.gptr == ssb1.base.egptr - 5, "wrong get pointer, expected %p got %p\n", ssb1.base.egptr - 5, ssb1.base.gptr); + ssb1.base.gptr = ssb1.base.egptr; + ssb1.base.pptr = ssb1.base.egptr + 5; + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb1, 1, SEEKDIR_end, OPENMODE_in); + ok(ret == EOF, "expected EOF got %d\n", ret); + ok(ssb1.base.gptr == ssb1.base.egptr - 5, "wrong get pointer, expected %p got %p\n", ssb1.base.egptr - 5, ssb1.base.gptr); + ok(ssb1.base.egptr == ssb1.base.pptr, "wrong get end, expected %p got %p\n", ssb1.base.pptr, ssb1.base.egptr); + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb1, 3, SEEKDIR_beg, OPENMODE_out); + ok(ret == 3, "expected 3 got %d\n", ret); + ok(ssb1.base.pptr == ssb1.base.pbase + 3, "wrong put pointer, expected %p got %p\n", ssb1.base.pbase + 3, ssb1.base.pptr); + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb1, -2, SEEKDIR_beg, OPENMODE_out); + ok(ret == EOF, "expected EOF got %d\n", ret); + ok(ssb1.base.pptr == ssb1.base.pbase + 3, "wrong put pointer, expected %p got %p\n", ssb1.base.pbase + 3, ssb1.base.pptr); + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb1, 50, SEEKDIR_beg, OPENMODE_out); + ok(ret == EOF, "expected EOF got %d\n", ret); + ok(ssb1.base.pptr == ssb1.base.pbase + 3, "wrong put pointer, expected %p got %p\n", ssb1.base.pbase + 3, ssb1.base.pptr); + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb1, 5, SEEKDIR_cur, OPENMODE_out); + ok(ret == 8, "expected 8 got %d\n", ret); + ok(ssb1.base.pptr == ssb1.base.pbase + 8, "wrong put pointer, expected %p got %p\n", ssb1.base.pbase + 8, ssb1.base.pptr); + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb1, -2, SEEKDIR_end, OPENMODE_out); + ok(ret == 42, "expected 42 got %d\n", ret); + ok(ssb1.base.pptr == ssb1.base.epptr - 2, "wrong put pointer, expected %p got %p\n", ssb1.base.epptr - 2, ssb1.base.pptr); + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb1, 0, SEEKDIR_end, OPENMODE_out); + ok(ret == 44, "expected 44 got %d\n", ret); + ok(ssb1.base.pptr == ssb1.base.epptr, "wrong put pointer, expected %p got %p\n", ssb1.base.epptr, ssb1.base.pptr); + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb1, 5, SEEKDIR_beg, OPENMODE_in|OPENMODE_out); + ok(ret == 5, "expected 5 got %d\n", ret); + ok(ssb1.base.gptr == ssb1.base.eback + 5, "wrong get pointer, expected %p got %p\n", ssb1.base.eback + 5, ssb1.base.gptr); + ok(ssb1.base.pptr == ssb1.base.pbase + 5, "wrong put pointer, expected %p got %p\n", ssb1.base.pbase + 5, ssb1.base.pptr); + ssb1.base.egptr = ssb1.base.pbase; + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb1, 21, SEEKDIR_beg, OPENMODE_in|OPENMODE_out); + ok(ret == EOF, "expected EOF got %d\n", ret); + ok(ssb1.base.gptr == ssb1.base.eback + 5, "wrong get pointer, expected %p got %p\n", ssb1.base.eback + 5, ssb1.base.gptr); + ok(ssb1.base.pptr == ssb1.base.pbase + 5, "wrong put pointer, expected %p got %p\n", ssb1.base.pbase + 5, ssb1.base.pptr); + ssb1.base.egptr = ssb1.base.epptr; + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb1, 50, SEEKDIR_beg, OPENMODE_in|OPENMODE_out); + ok(ret == EOF, "expected EOF got %d\n", ret); + ok(ssb1.base.gptr == ssb1.base.eback + 50, "wrong get pointer, expected %p got %p\n", ssb1.base.eback + 50, ssb1.base.gptr); + ok(ssb1.base.pptr == ssb1.base.pbase + 5, "wrong put pointer, expected %p got %p\n", ssb1.base.pbase + 5, ssb1.base.pptr); + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb1, 2, SEEKDIR_cur, OPENMODE_in|OPENMODE_out); + ok(ret == 7, "expected 7 got %d\n", ret); + ok(ssb1.base.gptr == ssb1.base.eback + 52, "wrong get pointer, expected %p got %p\n", ssb1.base.eback + 52, ssb1.base.gptr); + ok(ssb1.base.pptr == ssb1.base.pbase + 7, "wrong put pointer, expected %p got %p\n", ssb1.base.pbase + 7, ssb1.base.pptr); + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb2, 0, SEEKDIR_beg, OPENMODE_in|OPENMODE_out); + ok(ret == 0, "expected 0 got %d\n", ret); + ok(ssb2.base.gptr == ssb2.base.eback, "wrong get pointer, expected %p got %p\n", ssb2.base.eback, ssb2.base.gptr); + ok(ssb2.base.pptr == ssb2.base.pbase, "wrong put pointer, expected %p got %p\n", ssb2.base.pbase, ssb2.base.pptr); + ssb2.base.gptr = ssb2.base.egptr; + ssb2.base.pptr += 10; + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb2, 5, SEEKDIR_cur, OPENMODE_in|OPENMODE_out); + ok(ret == 15, "expected 15 got %d\n", ret); + ok(ssb2.base.gptr == ssb2.base.eback + 7, "wrong get pointer, expected %p got %p\n", ssb2.base.eback + 7, ssb2.base.gptr); + ok(ssb2.base.egptr == ssb2.base.eback + 12, "wrong get end, expected %p got %p\n", ssb2.base.eback + 12, ssb2.base.egptr); + ok(ssb2.base.pptr == ssb2.base.pbase + 15, "wrong put pointer, expected %p got %p\n", ssb2.base.pbase + 15, ssb2.base.pptr); + ssb2.base.pptr = ssb2.base.epptr; + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb2, -1, SEEKDIR_cur, OPENMODE_in|OPENMODE_out); + ok(ret == 25, "expected 25 got %d\n", ret); + ok(ssb2.base.gptr == ssb2.base.eback + 6, "wrong get pointer, expected %p got %p\n", ssb2.base.eback + 6, ssb2.base.gptr); + ok(ssb2.base.pptr == ssb2.base.pbase + 25, "wrong put pointer, expected %p got %p\n", ssb2.base.pbase + 25, ssb2.base.pptr); + pbuffer = ssb2.base.pbase; + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb2, 50, SEEKDIR_beg, OPENMODE_out); + ok(ret == 50, "expected 50 got %d\n", ret); + ok(ssb2.base.gptr == ssb2.base.eback + 6, "wrong get pointer, expected %p got %p\n", ssb2.base.eback + 6, ssb2.base.gptr); + ok(ssb2.base.pptr == pbuffer + 50, "wrong put pointer, expected %p got %p\n", pbuffer + 50, ssb2.base.pptr); + ok(ssb2.increase == 50, "expected 50 got %d\n", ssb2.increase); + ssb2.base.epptr = NULL; + ssb2.increase = 8; + ret = (int) call_func4(p_strstreambuf_seekoff, &ssb2, 0, SEEKDIR_end, OPENMODE_out); + ok(ret == 74, "expected 74 got %d\n", ret); + ok(ssb2.base.pptr == ssb2.base.epptr, "wrong put pointer, expected %p got %p\n", ssb2.base.epptr, ssb2.base.pptr); + + /* pbackfail */ + *(ssb1.base.gptr-1) = 'A'; + ret = (int) call_func2(p_streambuf_pbackfail, &ssb1.base, 'X'); + ok(ret == 'X', "wrong return, expected 'X' got %d\n", ret); + ok(ssb1.base.gptr == ssb1.base.eback + 51, "wrong get pointer, expected %p got %p\n", ssb1.base.eback + 51, ssb1.base.gptr); + ok(*ssb1.base.gptr == 'X', "expected 'X' got '%c'\n", *ssb1.base.gptr); + ssb1.base.gptr = ssb1.base.eback; + ret = (int) call_func2(p_streambuf_pbackfail, &ssb1.base, 'Y'); + ok(ret == EOF, "wrong return, expected EOF got %d\n", ret); + ssb1.base.gptr = ssb1.base.eback + 1; + ret = (int) call_func2(p_streambuf_pbackfail, &ssb1.base, EOF); + ok(ret == EOF, "wrong return, expected EOF got %d\n", ret); + ok(ssb1.base.gptr == ssb1.base.eback, "wrong get pointer, expected %p got %p\n", ssb1.base.eback, ssb1.base.gptr); + ok((signed char)*ssb1.base.gptr == EOF, "expected EOF got '%c'\n", *ssb1.base.gptr); + + call_func1(p_strstreambuf_dtor, &ssb1); + call_func1(p_strstreambuf_dtor, &ssb2); +} + +static void test_stdiobuf(void) +{ + stdiobuf stb1, stb2; + FILE *file1, *file2; + const char filename1[] = "stdiobuf_test1"; + const char filename2[] = "stdiobuf_test2"; + int ret, last; + char buffer[64]; + + memset(&stb1, 0xab, sizeof(stdiobuf)); + memset(&stb2, 0xab, sizeof(stdiobuf)); + + file1 = fopen(filename1, "w"); + fputs("Never gonna give you up, never gonna let you down", file1); + fclose(file1); + file1 = fopen(filename1, "r"); + ok(file1 != NULL, "Couldn't open the file named '%s'\n", filename1); + file2 = fopen(filename2, "w+"); + ok(file2 != NULL, "Couldn't open the file named '%s'\n", filename2); + + /* constructors/destructor */ + call_func2(p_stdiobuf_file_ctor, &stb1, NULL); + ok(stb1.base.allocated == 0, "wrong allocate value, expected 0 got %d\n", stb1.base.allocated); + ok(stb1.base.unbuffered == 1, "wrong unbuffered value, expected 1 got %d\n", stb1.base.unbuffered); + ok(stb1.file == NULL, "wrong file pointer, expected %p got %p\n", NULL, stb1.file); + call_func1(p_stdiobuf_dtor, &stb1); + call_func2(p_stdiobuf_file_ctor, &stb1, file1); + ok(stb1.base.allocated == 0, "wrong allocate value, expected 0 got %d\n", stb1.base.allocated); + ok(stb1.base.unbuffered == 1, "wrong unbuffered value, expected 1 got %d\n", stb1.base.unbuffered); + ok(stb1.file == file1, "wrong file pointer, expected %p got %p\n", file1, stb1.file); + call_func2(p_stdiobuf_file_ctor, &stb2, file2); + ok(stb2.base.allocated == 0, "wrong allocate value, expected 0 got %d\n", stb2.base.allocated); + ok(stb2.base.unbuffered == 1, "wrong unbuffered value, expected 1 got %d\n", stb2.base.unbuffered); + ok(stb2.file == file2, "wrong file pointer, expected %p got %p\n", file2, stb2.file); + + /* overflow */ + ret = (int) call_func2(p_stdiobuf_overflow, &stb1, EOF); + ok(ret == 1, "expected 1 got %d\n", ret); + ret = (int) call_func2(p_stdiobuf_overflow, &stb1, 'a'); + ok(ret == EOF, "expected EOF got %d\n", ret); + stb1.base.unbuffered = 0; + ret = (int) call_func2(p_stdiobuf_overflow, &stb1, 'a'); + ok(ret == 1, "expected 1 got %d\n", ret); + ok(stb1.base.allocated == 1, "wrong allocate value, expected 1 got %d\n", stb1.base.allocated); + ok(stb1.base.ebuf == stb1.base.base + 512, "expected %p got %p\n", stb1.base.base + 512, stb1.base.ebuf); + ok(stb1.base.pbase == stb1.base.base + 256, "wrong put base, expected %p got %p\n", stb1.base.base + 256, stb1.base.pbase); + ok(stb1.base.pptr == stb1.base.pbase + 1, "wrong put pointer, expected %p got %p\n", stb1.base.pbase + 1, stb1.base.pptr); + ok(stb1.base.epptr == stb1.base.ebuf, "wrong put end, expected %p got %p\n", stb1.base.ebuf, stb1.base.epptr); + ok(*(stb1.base.pptr-1) == 'a', "expected 'a', got '%c'\n", *(stb1.base.pptr-1)); + ret = (int) call_func2(p_stdiobuf_overflow, &stb1, EOF); + ok(ret == EOF, "expected EOF got %d\n", ret); + ok(stb1.base.pptr == stb1.base.pbase + 1, "wrong put pointer, expected %p got %p\n", stb1.base.pbase + 1, stb1.base.pptr); + stb1.base.pptr = stb1.base.pbase; + ret = (int) call_func2(p_stdiobuf_overflow, &stb1, EOF); + ok(ret == 1, "expected 1 got %d\n", ret); + ok(stb1.base.pptr == stb1.base.pbase, "wrong put pointer, expected %p got %p\n", stb1.base.pbase, stb1.base.pptr); + ret = (int) call_func2(p_stdiobuf_overflow, &stb1, 'b'); + ok(ret == 1, "expected 1 got %d\n", ret); + ok(stb1.base.pptr == stb1.base.pbase + 1, "wrong put pointer, expected %p got %p\n", stb1.base.pbase + 1, stb1.base.pptr); + ok(*(stb1.base.pptr-1) == 'b', "expected 'b', got '%c'\n", *(stb1.base.pptr-1)); + stb1.base.unbuffered = 1; + ret = (int) call_func2(p_stdiobuf_overflow, &stb2, EOF); + ok(ret == 1, "expected 1 got %d\n", ret); + ret = (int) call_func2(p_stdiobuf_overflow, &stb2, 'a'); + ok(ret == 'a', "expected 'a' got %d\n", ret); + stb2.base.unbuffered = 0; + stb2.base.base = buffer; + stb2.base.pbase = stb2.base.pptr = buffer + 32; + stb2.base.ebuf = stb2.base.epptr = buffer + 64; + ret = (int) call_func3(p_streambuf_xsputn, &stb2.base, "Never gonna run around", 22); + ok(ret == 22, "expected 22 got %d\n", ret); + ret = (int) call_func2(p_stdiobuf_overflow, &stb2, 'c'); + ok(ret == 1, "expected 1 got %d\n", ret); + ok(stb2.base.pptr == stb2.base.pbase + 1, "wrong put pointer, expected %p got %p\n", stb2.base.pbase + 1, stb2.base.pptr); + ok(*(stb2.base.pptr-1) == 'c', "expected 'c', got '%c'\n", *(stb2.base.pptr-1)); + stb2.base.pbase = stb2.base.pptr + 3; + ret = (int) call_func2(p_stdiobuf_overflow, &stb2, 'd'); + ok(ret == 1, "expected 1 got %d\n", ret); + ok(stb2.base.pptr == stb2.base.pbase - 2, "wrong put pointer, expected %p got %p\n", stb2.base.pbase - 2, stb2.base.pptr); + ok(*(stb2.base.pptr-1) == 'd', "expected 'd', got '%c'\n", *(stb2.base.pptr-1)); + stb2.base.pbase = stb2.base.pptr = buffer + 32; + stb2.base.epptr = buffer + 30; + ret = (int) call_func2(p_stdiobuf_overflow, &stb2, 'd'); + ok(ret == 'd', "expected 'd' got %d\n", ret); + ok(stb2.base.pptr == stb2.base.pbase, "wrong put pointer, expected %p got %p\n", stb2.base.pbase, stb2.base.pptr); + stb2.base.epptr = buffer + 64; + stb2.base.unbuffered = 1; + + /* underflow */ + ret = (int) call_func1(p_stdiobuf_underflow, &stb1); + ok(ret == 'N', "expected 'N' got %d\n", ret); + stb1.base.unbuffered = 0; + ret = (int) call_func1(p_stdiobuf_underflow, &stb1); + ok(ret == 'e', "expected 'e' got %d\n", ret); + ok(stb1.base.eback == stb1.base.base, "wrong get base, expected %p got %p\n", stb1.base.base, stb1.base.eback); + ok(stb1.base.gptr == stb1.base.egptr - 47, "wrong get pointer, expected %p got %p\n", stb1.base.egptr - 47, stb1.base.gptr); + ok(stb1.base.egptr == stb1.base.base + 256, "wrong get end, expected %p got %p\n", stb1.base.base + 256, stb1.base.egptr); + ok(*stb1.base.gptr == 'v', "expected 'v' got '%c'\n", *stb1.base.gptr); + stb1.base.pbase = stb1.base.pptr = stb1.base.epptr = NULL; + ret = (int) call_func1(p_stdiobuf_underflow, &stb1); + ok(ret == 'v', "expected 'v' got %d\n", ret); + ok(stb1.base.gptr == stb1.base.egptr - 46, "wrong get pointer, expected %p got %p\n", stb1.base.egptr - 46, stb1.base.gptr); + stb1.base.gptr = stb1.base.egptr; + ret = (int) call_func1(p_stdiobuf_underflow, &stb1); + ok(ret == EOF, "expected EOF got %d\n", ret); + stb1.base.unbuffered = 1; + ret = (int) call_func1(p_stdiobuf_underflow, &stb1); + ok(ret == EOF, "expected EOF got %d\n", ret); + rewind(stb2.file); + ret = (int) call_func1(p_stdiobuf_underflow, &stb2); + ok(ret == 'a', "expected 'a' got %d\n", ret); + stb2.base.unbuffered = 0; + stb2.base.eback = stb2.base.gptr = buffer + 16; + stb2.base.egptr = buffer + 32; + strcpy(buffer + 16, "and desert you"); + ret = (int) call_func1(p_stdiobuf_underflow, &stb2); + ok(ret == 'a', "expected 'a' got %d\n", ret); + ok(stb2.base.gptr == buffer + 17, "wrong get pointer, expected %p got %p\n", buffer + 17, stb2.base.gptr); + stb2.base.eback = buffer; + stb2.base.gptr = stb2.base.egptr; + stb2.base.pbase = stb2.base.pptr = stb2.base.epptr = NULL; + ret = (int) call_func1(p_stdiobuf_underflow, &stb2); + ok(ret == 'N', "expected 'N' got %d\n", ret); + ok(stb2.base.gptr == stb2.base.egptr - 22, "wrong get pointer, expected %p got %p\n", stb2.base.egptr - 22, stb2.base.gptr); + ok(ftell(stb2.file) == 24, "ftell failed\n"); + stb2.base.gptr = stb2.base.egptr; + ret = (int) call_func1(p_stdiobuf_underflow, &stb2); + ok(ret == EOF, "expected EOF got %d\n", ret); + stb2.base.unbuffered = 1; + ret = (int) call_func1(p_stdiobuf_underflow, &stb2); + ok(ret == EOF, "expected EOF got %d\n", ret); + + /* sync */ + ret = (int) call_func1(p_stdiobuf_sync, &stb1); + ok(ret == 0, "expected 0 got %d\n", ret); + stb1.base.gptr = stb1.base.eback; + ret = (int) call_func1(p_stdiobuf_sync, &stb1); + ok(ret == 0, "expected 0 got %d\n", ret); + stb1.base.unbuffered = 0; + ret = (int) call_func1(p_stdiobuf_sync, &stb1); + ok(ret == EOF, "expected EOF got %d\n", ret); + ok(stb1.base.pbase == stb1.base.base + 256, "wrong put base, expected %p got %p\n", stb1.base.base + 256, stb1.base.pbase); + ok(stb1.base.pptr == stb1.base.base + 256, "wrong put pointer, expected %p got %p\n", stb1.base.base + 256, stb1.base.pptr); + ok(stb1.base.epptr == stb1.base.base + 512, "wrong put end, expected %p got %p\n", stb1.base.base + 512, stb1.base.epptr); + stb1.base.gptr = stb1.base.egptr; + ret = (int) call_func1(p_stdiobuf_sync, &stb1); + ok(ret == 0, "expected 0 got %d\n", ret); + stb1.base.eback = stb1.base.gptr = stb1.base.egptr = NULL; + stb1.base.pptr = stb1.base.epptr; + ret = (int) call_func1(p_stdiobuf_sync, &stb1); + ok(ret == EOF, "expected EOF got %d\n", ret); + ok(stb1.base.gptr == NULL, "wrong get pointer, expected %p got %p\n", NULL, stb1.base.gptr); + stb1.base.pptr = stb1.base.pbase; + ret = (int) call_func1(p_stdiobuf_sync, &stb1); + ok(ret == 0, "expected 0 got %d\n", ret); + ok(stb1.base.gptr == NULL, "wrong get pointer, expected %p got %p\n", NULL, stb1.base.gptr); + stb1.base.unbuffered = 1; + stb2.base.unbuffered = 0; + stb2.base.egptr = stb2.base.ebuf; + ret = (int) call_func1(p_stdiobuf_sync, &stb2); + ok(ret == EOF, "expected EOF got %d\n", ret); + ok(stb2.base.pbase == stb2.base.base + 32, "wrong put base, expected %p got %p\n", stb2.base.base + 32, stb2.base.pbase); + ok(stb2.base.pptr == stb2.base.base + 32, "wrong put pointer, expected %p got %p\n", stb2.base.base + 32, stb2.base.pptr); + ok(stb2.base.epptr == stb2.base.base + 64, "wrong put end, expected %p got %p\n", stb2.base.base + 64, stb2.base.epptr); + stb2.base.egptr = stb2.base.pbase; + stb2.base.gptr = stb2.base.egptr - 25; + ret = (int) call_func1(p_stdiobuf_sync, &stb2); + ok(ret == EOF, "expected EOF got %d\n", ret); + ret = (int) call_func3(p_streambuf_xsputn, &stb2.base, "Never gonna make you cry", 24); + ok(ret == 24, "expected 24 got %d\n", ret); + ret = (int) call_func1(p_stdiobuf_sync, &stb2); + ok(ret == 0, "expected 0 got %d\n", ret); + ok(ftell(stb2.file) == 23, "ftell failed\n"); + ok(fseek(stb2.file, 3, SEEK_SET) == 0, "fseek failed\n"); + stb2.base.gptr = stb2.base.egptr - 3; + strcpy(stb2.base.gptr, "a\nc"); + ret = (int) call_func1(p_stdiobuf_sync, &stb2); + ok(ret == EOF, "expected EOF got %d\n", ret); + ok(stb2.base.gptr == stb2.base.egptr - 3, "wrong get pointer, expected %p got %p\n", stb2.base.egptr - 3, stb2.base.gptr); + *(stb2.base.gptr+1) = 'b'; + ret = (int) call_func1(p_stdiobuf_sync, &stb2); + ok(ret == 0, "expected 0 got %d\n", ret); + ok(stb2.base.gptr == stb2.base.egptr, "wrong get pointer, expected %p got %p\n", stb2.base.egptr, stb2.base.gptr); + stb2.base.unbuffered = 1; + + /* setrwbuf */ + ret = (int) call_func3(p_stdiobuf_setrwbuf, &stb1, 100, 60); + ok(ret == 1, "expected 1 got %d\n", ret); + ok(stb1.base.allocated == 1, "wrong allocate value, expected 1 got %d\n", stb1.base.allocated); + ok(stb1.base.unbuffered == 0, "wrong unbuffered value, expected 0 got %d\n", stb1.base.unbuffered); + ok(stb1.base.ebuf == stb1.base.base + 160, "expected %p got %p\n", stb1.base.base + 160, stb1.base.ebuf); + ok(stb1.base.eback == stb1.base.base, "wrong get base, expected %p got %p\n", stb1.base.base, stb1.base.eback); + ok(stb1.base.gptr == stb1.base.base + 100, "wrong get pointer, expected %p got %p\n", stb1.base.base + 100, stb1.base.gptr); + ok(stb1.base.egptr == stb1.base.base + 100, "wrong get end, expected %p got %p\n", stb1.base.base + 100, stb1.base.egptr); + ok(stb1.base.pbase == stb1.base.base + 100, "wrong put base, expected %p got %p\n", stb1.base.base + 100, stb1.base.pbase); + ok(stb1.base.pptr == stb1.base.base + 100, "wrong put pointer, expected %p got %p\n", stb1.base.base + 100, stb1.base.pptr); + ok(stb1.base.epptr == stb1.base.base + 160, "wrong put end, expected %p got %p\n", stb1.base.base + 160, stb1.base.epptr); + ret = (int) call_func3(p_stdiobuf_setrwbuf, &stb1, -1, 64); + ok(ret == 0 || ret == 1, "expected 0 or 1, got %d\n", ret); + ret = (int) call_func3(p_stdiobuf_setrwbuf, &stb1, 32, -8); + ok(ret == 0 || ret == 1, "expected 0 or 1, got %d\n", ret); + ret = (int) call_func3(p_stdiobuf_setrwbuf, &stb1, 0, 64); + ok(ret == 1, "expected 1 got %d\n", ret); + ok(stb1.base.ebuf == stb1.base.base + 64, "expected %p got %p\n", stb1.base.base + 64, stb1.base.ebuf); + ok(stb1.base.eback == NULL, "wrong get base, expected %p got %p\n", NULL, stb1.base.eback); + ok(stb1.base.gptr == NULL, "wrong get pointer, expected %p got %p\n", NULL, stb1.base.gptr); + ok(stb1.base.egptr == NULL, "wrong get end, expected %p got %p\n", NULL, stb1.base.egptr); + ok(stb1.base.pbase == stb1.base.base, "wrong put base, expected %p got %p\n", stb1.base.base, stb1.base.pbase); + ok(stb1.base.pptr == stb1.base.base, "wrong put pointer, expected %p got %p\n", stb1.base.base, stb1.base.pptr); + ok(stb1.base.epptr == stb1.base.base + 64, "wrong put end, expected %p got %p\n", stb1.base.base + 64, stb1.base.epptr); + ret = (int) call_func3(p_stdiobuf_setrwbuf, &stb1, 0, 0); + ok(ret == 0, "expected 0 got %d\n", ret); + ok(stb1.base.unbuffered == 1, "wrong unbuffered value, expected 1 got %d\n", stb1.base.unbuffered); + + /* seekoff */ + ret = (int) call_func4(p_stdiobuf_seekoff, &stb1, 0, SEEKDIR_beg, OPENMODE_in); + ok(ret == 0, "expected 0 got %d\n", ret); + stb1.base.unbuffered = 0; + ret = (int) call_func3(p_streambuf_xsputn, &stb1.base, "Never gonna say goodbye", 22); + ok(ret == 22, "expected 22 got %d\n", ret); + ret = (int) call_func4(p_stdiobuf_seekoff, &stb1, 5, SEEKDIR_beg, OPENMODE_in); + ok(ret == 5, "expected 5 got %d\n", ret); + ok(stb1.base.pptr == stb1.base.pbase + 22, "wrong put pointer, expected %p got %p\n", stb1.base.pbase + 22, stb1.base.pptr); + ret = (int) call_func4(p_stdiobuf_seekoff, &stb1, 300, SEEKDIR_beg, OPENMODE_in); + ok(ret == 300, "expected 300 got %d\n", ret); + ret = (int) call_func4(p_stdiobuf_seekoff, &stb1, -310, SEEKDIR_cur, OPENMODE_in); + ok(ret == EOF, "expected EOF got %d\n", ret); + stb1.base.eback = stb1.base.base; + stb1.base.gptr = stb1.base.egptr = stb1.base.pbase = stb1.base.base + 10; + ret = (int) call_func4(p_stdiobuf_seekoff, &stb1, -280, SEEKDIR_cur, OPENMODE_in); + ok(ret == 20, "expected 20 got %d\n", ret); + stb1.base.gptr = stb1.base.eback; + ret = (int) call_func4(p_stdiobuf_seekoff, &stb1, 80, SEEKDIR_cur, OPENMODE_in); + ok(ret == 100, "expected 100 got %d\n", ret); + ret = (int) call_func4(p_stdiobuf_seekoff, &stb1, 0, SEEKDIR_end, OPENMODE_in); + ok(ret == 49, "expected 49 got %d\n", ret); + ret = (int) call_func4(p_stdiobuf_seekoff, &stb1, 1, SEEKDIR_end, OPENMODE_in); + ok(ret == 50, "expected 50 got %d\n", ret); + ret = (int) call_func4(p_stdiobuf_seekoff, &stb1, -60, SEEKDIR_end, OPENMODE_in); + ok(ret == EOF, "expected EOF got %d\n", ret); + ret = (int) call_func4(p_stdiobuf_seekoff, &stb1, -20, SEEKDIR_end, OPENMODE_out); + ok(ret == 29, "expected 29 got %d\n", ret); + stb1.base.eback = stb1.base.gptr = stb1.base.egptr = NULL; + stb1.base.pptr = stb1.base.pbase; + stb1.base.unbuffered = 1; + ret = (int) call_func4(p_stdiobuf_seekoff, &stb2, 0, SEEKDIR_beg, OPENMODE_in); + ok(ret == 0, "expected 0 got %d\n", ret); + stb2.base.pptr += 10; + ret = (int) call_func4(p_stdiobuf_seekoff, &stb2, 20, SEEKDIR_beg, OPENMODE_in); + ok(ret == 20, "expected 20 got %d\n", ret); + ok(stb2.base.pptr == stb2.base.pbase + 10, "wrong put pointer, expected %p got %p\n", stb2.base.pbase + 10, stb2.base.pptr); + stb2.base.unbuffered = 0; + ret = (int) call_func4(p_stdiobuf_seekoff, &stb2, 10, SEEKDIR_cur, OPENMODE_in); + ok(ret == 40, "expected 40 got %d\n", ret); + ok(stb2.base.pptr == stb2.base.pbase, "wrong put pointer, expected %p got %p\n", stb2.base.pbase, stb2.base.pptr); + stb2.base.gptr = stb2.base.eback; + stb2.base.pptr += 5; + ret = (int) call_func4(p_stdiobuf_seekoff, &stb2, -50, SEEKDIR_cur, OPENMODE_in|OPENMODE_out); + ok(ret == EOF, "expected EOF got %d\n", ret); + ok(stb2.base.pptr == stb2.base.pbase, "wrong put pointer, expected %p got %p\n", stb2.base.pbase, stb2.base.pptr); + stb2.base.pbase = stb2.base.pptr = stb2.base.epptr = NULL; + ret = (int) call_func4(p_stdiobuf_seekoff, &stb2, 0, SEEKDIR_end, OPENMODE_in|OPENMODE_out); + ok(ret == 48, "expected 48 got %d\n", ret); + ok(stb2.base.pbase == stb2.base.base + 32, "wrong put pointer, expected %p got %p\n", stb2.base.base + 32, stb2.base.pbase); + ok(stb2.base.pptr == stb2.base.base + 32, "wrong put pointer, expected %p got %p\n", stb2.base.base + 32, stb2.base.pptr); + ok(stb2.base.epptr == stb2.base.ebuf, "wrong put pointer, expected %p got %p\n", stb2.base.ebuf, stb2.base.epptr); + ret = (int) call_func4(p_stdiobuf_seekoff, &stb2, -28, SEEKDIR_end, -1); + ok(ret == 20, "expected 20 got %d\n", ret); + stb2.base.gptr = stb2.base.egptr; + stb2.base.unbuffered = 1; + + /* pbackfail */ + last = fgetc(stb1.file); + ok(last == 'r', "expected 'r' got %d\n", last); + ok(ftell(stb1.file) == 30, "ftell failed\n"); + ret = (int) call_func2(p_stdiobuf_pbackfail, &stb1, 'i'); + ok(ret == 'i', "expected 'i' got %d\n", ret); + ok(ftell(stb1.file) == 29, "ftell failed\n"); + last = fgetc(stb1.file); + ok(last == 'r', "expected 'r' got %d\n", last); + ok(ftell(stb1.file) == 30, "ftell failed\n"); + stb1.base.eback = stb1.base.base; + stb1.base.gptr = stb1.base.egptr = stb1.base.base + 9; + strcpy(stb1.base.eback, "pbackfail"); + ret = (int) call_func2(p_stdiobuf_pbackfail, &stb1, 'j'); + ok(ret == 'j', "expected 'j' got %d\n", ret); + ok(stb1.base.gptr == stb1.base.base + 8, "wrong get pointer, expected %p got %p\n", stb1.base.base + 8, stb1.base.gptr); + ok(strncmp(stb1.base.eback, "pbackfaij", 9) == 0, "strncmp failed\n"); + ok(ftell(stb1.file) == 30, "ftell failed\n"); + stb1.base.gptr = stb1.base.eback; + ret = (int) call_func2(p_stdiobuf_pbackfail, &stb1, 'k'); + ok(ret == 'k', "expected 'k' got %d\n", ret); + ok(stb1.base.gptr == stb1.base.base, "wrong get pointer, expected %p got %p\n", stb1.base.base, stb1.base.gptr); + ok(strncmp(stb1.base.eback, "pbackfaij", 9) == 0, "strncmp failed\n"); + ok(ftell(stb1.file) == 29, "ftell failed\n"); + stb1.base.unbuffered = 0; + ret = (int) call_func2(p_stdiobuf_pbackfail, &stb1, 'l'); + ok(ret == 'l', "expected 'l' got %d\n", ret); + ok(strncmp(stb1.base.eback, "lpbackfai", 9) == 0, "strncmp failed\n"); + ok(ftell(stb1.file) == 28, "ftell failed\n"); + stb1.base.egptr = NULL; + ret = (int) call_func2(p_stdiobuf_pbackfail, &stb1, 'm'); + ok(ret == 'm', "expected 'm' got %d\n", ret); + ok(strncmp(stb1.base.eback, "lpbackfai", 9) == 0, "strncmp failed\n"); + ok(ftell(stb1.file) == 27, "ftell failed\n"); + stb1.base.unbuffered = 1; + + call_func1(p_stdiobuf_dtor, &stb1); + call_func1(p_stdiobuf_dtor, &stb2); + fclose(file1); + fclose(file2); + ok(_unlink(filename1) == 0, "Couldn't unlink file named '%s'\n", filename1); + ok(_unlink(filename2) == 0, "Couldn't unlink file named '%s'\n", filename2); +} + struct ios_lock_arg { ios *ios_obj; @@ -1659,6 +2486,8 @@ test_streambuf(); test_filebuf(); + test_strstreambuf(); + test_stdiobuf(); test_ios(); FreeLibrary(msvcrt); diff -Nru wine1.7-1.7.50/dlls/msvcp100/msvcp100.spec wine1.7-1.7.55/dlls/msvcp100/msvcp100.spec --- wine1.7-1.7.50/dlls/msvcp100/msvcp100.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcp100/msvcp100.spec 2015-11-13 14:32:40.000000000 +0000 @@ -2891,17 +2891,17 @@ @ stub _Cosh @ extern _Denorm @ stub _Dnorm -@ stub _Dscale -@ stub _Dtest +@ cdecl _Dscale(ptr long) +@ cdecl _Dtest(ptr) @ extern _Eps -@ stub _Exp +@ cdecl _Exp(ptr double long) @ stub _FCosh @ extern _FDenorm @ stub _FDnorm -@ stub _FDscale -@ stub _FDtest +@ cdecl _FDscale(ptr long) +@ cdecl _FDtest(ptr) @ extern _FEps -@ stub _FExp +@ cdecl _FExp(ptr float long) @ extern _FInf @ extern _FNan # extern _FRteps @@ -2919,8 +2919,8 @@ @ extern _Inf @ stub _LCosh @ extern _LDenorm -@ stub _LDscale -@ stub _LDtest +@ cdecl _LDscale(ptr long) _Dscale +@ cdecl _LDtest(ptr) _Dtest @ extern _LEps @ stub _LExp @ extern _LInf diff -Nru wine1.7-1.7.50/dlls/msvcp110/msvcp110.spec wine1.7-1.7.55/dlls/msvcp110/msvcp110.spec --- wine1.7-1.7.50/dlls/msvcp110/msvcp110.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcp110/msvcp110.spec 2015-11-13 14:32:40.000000000 +0000 @@ -1559,12 +1559,12 @@ @ cdecl -arch=win64 ?_Iput@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@GPEAD_K@Z(ptr ptr ptr ptr long ptr long) num_put_short__Iput @ cdecl -arch=win32 ?_Iput@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AAVios_base@2@_WPADI@Z(ptr ptr long ptr ptr long ptr long) num_put_wchar__Iput @ cdecl -arch=win64 ?_Iput@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AEAVios_base@2@_WPEAD_K@Z(ptr ptr ptr ptr long ptr long) num_put_wchar__Iput -@ stub -arch=win32 ?_Last_write_time@sys@tr2@std@@YAXPBD_J@Z -@ stub -arch=win64 ?_Last_write_time@sys@tr2@std@@YAXPEBD_J@Z +@ cdecl -arch=win32 ?_Last_write_time@sys@tr2@std@@YAXPBD_J@Z(str int64) tr2_sys__Last_write_time_set +@ cdecl -arch=win64 ?_Last_write_time@sys@tr2@std@@YAXPEBD_J@Z(str int64) tr2_sys__Last_write_time_set @ stub -arch=win32 ?_Last_write_time@sys@tr2@std@@YAXPB_W_J@Z @ stub -arch=win64 ?_Last_write_time@sys@tr2@std@@YAXPEB_W_J@Z -@ stub -arch=win32 ?_Last_write_time@sys@tr2@std@@YA_JPBD@Z -@ stub -arch=win64 ?_Last_write_time@sys@tr2@std@@YA_JPEBD@Z +@ cdecl -ret64 -arch=win32 ?_Last_write_time@sys@tr2@std@@YA_JPBD@Z(str) tr2_sys__Last_write_time +@ cdecl -ret64 -arch=win64 ?_Last_write_time@sys@tr2@std@@YA_JPEBD@Z(str) tr2_sys__Last_write_time @ stub -arch=win32 ?_Last_write_time@sys@tr2@std@@YA_JPB_W@Z @ stub -arch=win64 ?_Last_write_time@sys@tr2@std@@YA_JPEB_W@Z @ stub -arch=arm ?_Launch@_Pad@std@@QAAXPAU_Thrd_imp_t@@@Z @@ -1641,8 +1641,8 @@ @ cdecl -arch=win64 ?_New_Locimp@_Locimp@locale@std@@CAPEAV123@AEBV123@@Z(ptr) locale__Locimp__New_Locimp @ cdecl -arch=win32 ?_New_Locimp@_Locimp@locale@std@@CAPAV123@_N@Z(long) locale__Locimp__New_Locimp_transparent @ cdecl -arch=win64 ?_New_Locimp@_Locimp@locale@std@@CAPEAV123@_N@Z(long) locale__Locimp__New_Locimp_transparent -@ stub -arch=win32 ?_Open_dir@sys@tr2@std@@YAPAXPADPBDAAHAAW4file_type@123@@Z -@ stub -arch=win64 ?_Open_dir@sys@tr2@std@@YAPEAXPEADPEBDAEAHAEAW4file_type@123@@Z +@ cdecl -arch=win32 ?_Open_dir@sys@tr2@std@@YAPAXPADPBDAAHAAW4file_type@123@@Z(ptr str long long) tr2_sys__Open_dir +@ cdecl -arch=win64 ?_Open_dir@sys@tr2@std@@YAPEAXAEAY0BAE@DPEBDAEAHAEAW4file_type@123@@Z(ptr str long long) tr2_sys__Open_dir @ stub -arch=win32 ?_Open_dir@sys@tr2@std@@YAPAXPA_WPB_WAAHAAW4file_type@123@@Z @ stub -arch=win64 ?_Open_dir@sys@tr2@std@@YAPEAXPEA_WPEB_WAEAHAEAW4file_type@123@@Z @ cdecl -arch=arm ?_Orphan_all@_Container_base0@std@@QAAXXZ(ptr) Container_base0_Orphan_all @@ -1761,10 +1761,10 @@ @ cdecl -arch=win64 ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PEBDAEAH@Z(str ptr) tr2_sys__Stat @ stub -arch=win32 ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PB_WAAH@Z @ stub -arch=win64 ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PEB_WAEAH@Z -@ cdecl -arch=win32 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PBD@Z(str) tr2_sys__Statvfs -@ cdecl -arch=win64 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEBD@Z(str) tr2_sys__Statvfs -@ cdecl -arch=win32 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PB_W@Z(wstr) tr2_sys__Statvfs_wchar -@ cdecl -arch=win64 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEB_W@Z(wstr) tr2_sys__Statvfs_wchar +@ cdecl -arch=win32 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PBD@Z(ptr str) tr2_sys__Statvfs +@ cdecl -arch=win64 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEBD@Z(ptr str) tr2_sys__Statvfs +@ cdecl -arch=win32 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PB_W@Z(ptr wstr) tr2_sys__Statvfs_wchar +@ cdecl -arch=win64 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEB_W@Z(ptr wstr) tr2_sys__Statvfs_wchar @ cdecl -arch=arm ?_Swap_all@_Container_base0@std@@QAAXAAU12@@Z(ptr ptr) Container_base0_Swap_all @ thiscall -arch=i386 ?_Swap_all@_Container_base0@std@@QAEXAAU12@@Z(ptr ptr) Container_base0_Swap_all @ cdecl -arch=win64 ?_Swap_all@_Container_base0@std@@QEAAXAEAU12@@Z(ptr ptr) Container_base0_Swap_all @@ -3729,36 +3729,36 @@ @ cdecl -arch=win64 ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEB_W_J@Z(ptr ptr long) basic_streambuf_wchar_xsputn @ cdecl _Call_once(ptr ptr) @ cdecl _Call_onceEx(ptr ptr ptr) -@ stub _Cnd_broadcast -@ stub _Cnd_destroy +@ cdecl _Cnd_broadcast(ptr) +@ cdecl _Cnd_destroy(ptr) @ stub _Cnd_do_broadcast_at_thread_exit -@ stub _Cnd_init +@ cdecl _Cnd_init(ptr) @ stub _Cnd_register_at_thread_exit -@ stub _Cnd_signal -@ stub _Cnd_timedwait +@ cdecl _Cnd_signal(ptr) +@ cdecl _Cnd_timedwait(ptr ptr ptr) @ stub _Cnd_unregister_at_thread_exit -@ stub _Cnd_wait +@ cdecl _Cnd_wait(ptr ptr) @ stub _Cosh @ extern _Denorm @ stub _Dint @ stub _Dnorm @ cdecl _Do_call(ptr) -@ stub _Dscale +@ cdecl _Dscale(ptr long) @ stub _Dtento -@ stub _Dtest +@ cdecl _Dtest(ptr) @ stub _Dunscale @ extern _Eps -@ stub _Exp +@ cdecl _Exp(ptr double long) @ stub _FCosh @ extern _FDenorm @ stub _FDint @ stub _FDnorm -@ stub _FDscale +@ cdecl _FDscale(ptr long) @ stub _FDtento -@ stub _FDtest +@ cdecl _FDtest(ptr) @ stub _FDunscale @ extern _FEps -@ stub _FExp +@ cdecl _FExp(ptr float long) @ extern _FInf @ extern _FNan # extern _FRteps @@ -3789,9 +3789,9 @@ @ stub _LCosh @ extern _LDenorm @ stub _LDint -@ stub _LDscale +@ cdecl _LDscale(ptr long) _Dscale @ stub _LDtento -@ stub _LDtest +@ cdecl _LDtest(ptr) _Dtest @ stub _LDunscale @ extern _LEps @ stub _LExp @@ -3856,16 +3856,16 @@ @ cdecl _Strcoll(ptr ptr ptr ptr ptr) @ stub _Strxfrm @ stub _Thrd_abort -@ stub _Thrd_create -@ stub _Thrd_current +@ cdecl _Thrd_create(ptr ptr ptr) +@ cdecl _Thrd_current() @ stub _Thrd_detach -@ stub _Thrd_equal +@ cdecl _Thrd_equal(ptr ptr) @ stub _Thrd_exit -@ stub _Thrd_join -@ stub _Thrd_lt -@ stub _Thrd_sleep +@ cdecl _Thrd_join(ptr long) +@ cdecl _Thrd_lt(ptr ptr) +@ cdecl _Thrd_sleep(ptr) @ stub _Thrd_start -@ stub _Thrd_yield +@ cdecl _Thrd_yield() @ cdecl _Tolower(long ptr) @ cdecl _Toupper(long ptr) @ cdecl _Towlower(long ptr) diff -Nru wine1.7-1.7.50/dlls/msvcp110/tests/Makefile.in wine1.7-1.7.55/dlls/msvcp110/tests/Makefile.in --- wine1.7-1.7.50/dlls/msvcp110/tests/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcp110/tests/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,5 @@ +TESTDLL = msvcp110.dll +APPMODE = -mno-cygwin + +C_SRCS = \ + msvcp110.c diff -Nru wine1.7-1.7.50/dlls/msvcp110/tests/msvcp110.c wine1.7-1.7.55/dlls/msvcp110/tests/msvcp110.c --- wine1.7-1.7.50/dlls/msvcp110/tests/msvcp110.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcp110/tests/msvcp110.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,163 @@ +/* + * Copyright 2015 YongHao Hu + * + * 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 "wine/test.h" +#include "winbase.h" + +typedef unsigned char MSVCP_bool; + +#define SECSPERDAY 86400 +/* 1601 to 1970 is 369 years plus 89 leap days */ +#define SECS_1601_TO_1970 ((369 * 365 + 89) * (ULONGLONG)SECSPERDAY) +#define TICKSPERSEC 10000000 +#define TICKS_1601_TO_1970 (SECS_1601_TO_1970 * TICKSPERSEC) + +static inline const char* debugstr_longlong(ULONGLONG ll) +{ + static char string[17]; + if (sizeof(ll) > sizeof(unsigned long) && ll >> 32) + sprintf(string, "%lx%08lx", (unsigned long)(ll >> 32), (unsigned long)ll); + else + sprintf(string, "%lx", (unsigned long)ll); + return string; +} + +static int (__cdecl *p_tr2_sys__Make_dir)(char const*); +static MSVCP_bool (__cdecl *p_tr2_sys__Remove_dir)(char const*); +static __int64 (__cdecl *p_tr2_sys__Last_write_time)(char const*); +static void (__cdecl *p_tr2_sys__Last_write_time_set)(char const*, __int64); + +static HMODULE msvcp; +#define SETNOFAIL(x,y) x = (void*)GetProcAddress(msvcp,y) +#define SET(x,y) do { SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y); } while(0) +static BOOL init(void) +{ + msvcp = LoadLibraryA("msvcp110.dll"); + if(!msvcp) + { + win_skip("msvcp110.dll not installed\n"); + return FALSE; + } + + if(sizeof(void*) == 8) { /* 64-bit initialization */ + SET(p_tr2_sys__Make_dir, + "?_Make_dir@sys@tr2@std@@YAHPEBD@Z"); + SET(p_tr2_sys__Remove_dir, + "?_Remove_dir@sys@tr2@std@@YA_NPEBD@Z"); + SET(p_tr2_sys__Last_write_time, + "?_Last_write_time@sys@tr2@std@@YA_JPEBD@Z"); + SET(p_tr2_sys__Last_write_time_set, + "?_Last_write_time@sys@tr2@std@@YAXPEBD_J@Z"); + } else { + SET(p_tr2_sys__Make_dir, + "?_Make_dir@sys@tr2@std@@YAHPBD@Z"); + SET(p_tr2_sys__Remove_dir, + "?_Remove_dir@sys@tr2@std@@YA_NPBD@Z"); + SET(p_tr2_sys__Last_write_time, + "?_Last_write_time@sys@tr2@std@@YA_JPBD@Z"); + SET(p_tr2_sys__Last_write_time_set, + "?_Last_write_time@sys@tr2@std@@YAXPBD_J@Z"); + } + return TRUE; +} + +static void test_tr2_sys__Last_write_time(void) +{ + HANDLE file; + int ret; + FILETIME lwt; + __int64 last_write_time, newtime, margin_of_error = 10 * TICKSPERSEC; + ret = p_tr2_sys__Make_dir("tr2_test_dir"); + ok(ret == 1, "test_tr2_sys__Make_dir(): expect 1 got %d\n", ret); + file = CreateFileA("tr2_test_dir/f1", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); + ok(file != INVALID_HANDLE_VALUE, "CreateFileA failed: INVALID_HANDLE_VALUE\n"); + CloseHandle(file); + + last_write_time = p_tr2_sys__Last_write_time("tr2_test_dir/f1"); + newtime = last_write_time + 222222; + p_tr2_sys__Last_write_time_set("tr2_test_dir/f1", newtime); + ok(last_write_time != p_tr2_sys__Last_write_time("tr2_test_dir/f1"), + "last_write_time before modfied should not equal to last_write_time %s\n", + debugstr_longlong(last_write_time)); + + /* test the formula */ + file = CreateFileA("tr2_test_dir/f1", 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0); + ok(file != INVALID_HANDLE_VALUE, "create file failed: INVALID_HANDLE_VALUE\n"); + ok(GetFileTime(file, 0, 0, &lwt), "GetFileTime failed\n"); + CloseHandle(file); + last_write_time = (((__int64)lwt.dwHighDateTime)<< 32) + lwt.dwLowDateTime; + last_write_time -= TICKS_1601_TO_1970; + last_write_time /= TICKSPERSEC; + ok(newtime-margin_of_error<=last_write_time && last_write_time<=newtime+margin_of_error, + "don't fit the formula, last_write_time is %s\n", debugstr_longlong(last_write_time)); + + newtime = 0; + p_tr2_sys__Last_write_time_set("tr2_test_dir/f1", newtime); + newtime = p_tr2_sys__Last_write_time("tr2_test_dir/f1"); + file = CreateFileA("tr2_test_dir/f1", 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0); + ok(file != INVALID_HANDLE_VALUE, "create file failed: INVALID_HANDLE_VALUE\n"); + ok(GetFileTime(file, 0, 0, &lwt), "GetFileTime failed\n"); + CloseHandle(file); + last_write_time = (((__int64)lwt.dwHighDateTime)<< 32) + lwt.dwLowDateTime; + last_write_time -= TICKS_1601_TO_1970; + last_write_time /= TICKSPERSEC; + ok(newtime-margin_of_error<=last_write_time && last_write_time<=newtime+margin_of_error, + "don't fit the formula, last_write_time is %s\n", debugstr_longlong(last_write_time)); + + newtime = 123456789; + p_tr2_sys__Last_write_time_set("tr2_test_dir/f1", newtime); + newtime = p_tr2_sys__Last_write_time("tr2_test_dir/f1"); + file = CreateFileA("tr2_test_dir/f1", 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0); + ok(file != INVALID_HANDLE_VALUE, "create file failed: INVALID_HANDLE_VALUE\n"); + ok(GetFileTime(file, 0, 0, &lwt), "GetFileTime failed\n"); + CloseHandle(file); + last_write_time = (((__int64)lwt.dwHighDateTime)<< 32) + lwt.dwLowDateTime; + last_write_time -= TICKS_1601_TO_1970; + last_write_time /= TICKSPERSEC; + ok(newtime-margin_of_error<=last_write_time && last_write_time<=newtime+margin_of_error, + "don't fit the formula, last_write_time is %s\n", debugstr_longlong(last_write_time)); + + errno = 0xdeadbeef; + last_write_time = p_tr2_sys__Last_write_time("not_exist"); + ok(errno == 0xdeadbeef, "tr2_sys__Last_write_time(): errno expect 0xdeadbeef, got %d\n", errno); + ok(last_write_time == 0, "expect 0 got %s\n", debugstr_longlong(last_write_time)); + last_write_time = p_tr2_sys__Last_write_time(NULL); + ok(last_write_time == 0, "expect 0 got %s\n", debugstr_longlong(last_write_time)); + + p_tr2_sys__Last_write_time_set("not_exist", newtime); + errno = 0xdeadbeef; + p_tr2_sys__Last_write_time_set(NULL, newtime); + ok(errno == 0xdeadbeef, "tr2_sys__Last_write_time(): errno expect 0xdeadbeef, got %d\n", errno); + + ok(DeleteFileA("tr2_test_dir/f1"), "expect tr2_test_dir/f1 to exist\n"); + ret = p_tr2_sys__Remove_dir("tr2_test_dir"); + ok(ret == 1, "test_tr2_sys__Remove_dir(): expect 1 got %d\n", ret); +} + +START_TEST(msvcp110) +{ + if(!init()) return; + test_tr2_sys__Last_write_time(); + FreeLibrary(msvcp); +} diff -Nru wine1.7-1.7.50/dlls/msvcp120/msvcp120.spec wine1.7-1.7.55/dlls/msvcp120/msvcp120.spec --- wine1.7-1.7.50/dlls/msvcp120/msvcp120.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcp120/msvcp120.spec 2015-11-13 14:32:40.000000000 +0000 @@ -1520,12 +1520,12 @@ @ cdecl -arch=win64 ?_Iput@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@GPEAD_K@Z(ptr ptr ptr ptr long ptr long) num_put_short__Iput @ cdecl -arch=win32 ?_Iput@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AAVios_base@2@_WPADI@Z(ptr ptr long ptr ptr long ptr long) num_put_wchar__Iput @ cdecl -arch=win64 ?_Iput@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AEAVios_base@2@_WPEAD_K@Z(ptr ptr ptr ptr long ptr long) num_put_wchar__Iput -@ stub -arch=win32 ?_Last_write_time@sys@tr2@std@@YAXPBD_J@Z -@ stub -arch=win64 ?_Last_write_time@sys@tr2@std@@YAXPEBD_J@Z +@ cdecl -arch=win32 ?_Last_write_time@sys@tr2@std@@YAXPBD_J@Z(str int64) tr2_sys__Last_write_time_set +@ cdecl -arch=win64 ?_Last_write_time@sys@tr2@std@@YAXPEBD_J@Z(str int64) tr2_sys__Last_write_time_set @ stub -arch=win32 ?_Last_write_time@sys@tr2@std@@YAXPB_W_J@Z @ stub -arch=win64 ?_Last_write_time@sys@tr2@std@@YAXPEB_W_J@Z -@ stub -arch=win32 ?_Last_write_time@sys@tr2@std@@YA_JPBD@Z -@ stub -arch=win64 ?_Last_write_time@sys@tr2@std@@YA_JPEBD@Z +@ cdecl -ret64 -arch=win32 ?_Last_write_time@sys@tr2@std@@YA_JPBD@Z(str) tr2_sys__Last_write_time +@ cdecl -ret64 -arch=win64 ?_Last_write_time@sys@tr2@std@@YA_JPEBD@Z(str) tr2_sys__Last_write_time @ stub -arch=win32 ?_Last_write_time@sys@tr2@std@@YA_JPB_W@Z @ stub -arch=win64 ?_Last_write_time@sys@tr2@std@@YA_JPEB_W@Z @ stub -arch=arm ?_Launch@_Pad@std@@QAAXPAU_Thrd_imp_t@@@Z @@ -1602,8 +1602,8 @@ @ cdecl -arch=win64 ?_New_Locimp@_Locimp@locale@std@@CAPEAV123@AEBV123@@Z(ptr) locale__Locimp__New_Locimp @ cdecl -arch=win32 ?_New_Locimp@_Locimp@locale@std@@CAPAV123@_N@Z(long) locale__Locimp__New_Locimp_transparent @ cdecl -arch=win64 ?_New_Locimp@_Locimp@locale@std@@CAPEAV123@_N@Z(long) locale__Locimp__New_Locimp_transparent -@ stub -arch=win32 ?_Open_dir@sys@tr2@std@@YAPAXAAY0BAE@DPBDAAHAAW4file_type@123@@Z -@ stub -arch=win64 ?_Open_dir@sys@tr2@std@@YAPEAXAEAY0BAE@DPEBDAEAHAEAW4file_type@123@@Z +@ cdecl -arch=win32 ?_Open_dir@sys@tr2@std@@YAPAXAAY0BAE@DPBDAAHAAW4file_type@123@@Z(ptr str long long) tr2_sys__Open_dir +@ cdecl -arch=win64 ?_Open_dir@sys@tr2@std@@YAPEAXAEAY0BAE@DPEBDAEAHAEAW4file_type@123@@Z(ptr str long long) tr2_sys__Open_dir @ stub -arch=win32 ?_Open_dir@sys@tr2@std@@YAPAXAAY0BAE@_WPB_WAAHAAW4file_type@123@@Z @ stub -arch=win64 ?_Open_dir@sys@tr2@std@@YAPEAXAEAY0BAE@_WPEB_WAEAHAEAW4file_type@123@@Z @ cdecl -arch=arm ?_Orphan_all@_Container_base0@std@@QAAXXZ(ptr) Container_base0_Orphan_all @@ -1722,10 +1722,10 @@ @ cdecl -arch=win64 ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PEBDAEAH@Z(str ptr) tr2_sys__Stat @ stub -arch=win32 ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PB_WAAH@Z @ stub -arch=win64 ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PEB_WAEAH@Z -@ cdecl -arch=win32 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PBD@Z(str) tr2_sys__Statvfs -@ cdecl -arch=win64 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEBD@Z(str) tr2_sys__Statvfs -@ cdecl -arch=win32 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PB_W@Z(wstr) tr2_sys__Statvfs_wchar -@ cdecl -arch=win64 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEB_W@Z(wstr) tr2_sys__Statvfs_wchar +@ cdecl -arch=win32 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PBD@Z(ptr str) tr2_sys__Statvfs +@ cdecl -arch=win64 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEBD@Z(ptr str) tr2_sys__Statvfs +@ cdecl -arch=win32 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PB_W@Z(ptr wstr) tr2_sys__Statvfs_wchar +@ cdecl -arch=win64 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEB_W@Z(ptr wstr) tr2_sys__Statvfs_wchar @ cdecl -arch=arm ?_Swap_all@_Container_base0@std@@QAAXAAU12@@Z(ptr ptr) Container_base0_Swap_all @ thiscall -arch=i386 ?_Swap_all@_Container_base0@std@@QAEXAAU12@@Z(ptr ptr) Container_base0_Swap_all @ cdecl -arch=win64 ?_Swap_all@_Container_base0@std@@QEAAXAEAU12@@Z(ptr ptr) Container_base0_Swap_all @@ -3670,36 +3670,36 @@ @ cdecl -arch=win64 ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEB_W_J@Z(ptr ptr long) basic_streambuf_wchar_xsputn @ cdecl _Call_once(ptr ptr) @ cdecl _Call_onceEx(ptr ptr ptr) -@ stub _Cnd_broadcast -@ stub _Cnd_destroy +@ cdecl _Cnd_broadcast(ptr) +@ cdecl _Cnd_destroy(ptr) @ stub _Cnd_do_broadcast_at_thread_exit -@ stub _Cnd_init +@ cdecl _Cnd_init(ptr) @ stub _Cnd_register_at_thread_exit -@ stub _Cnd_signal -@ stub _Cnd_timedwait +@ cdecl _Cnd_signal(ptr) +@ cdecl _Cnd_timedwait(ptr ptr ptr) @ stub _Cnd_unregister_at_thread_exit -@ stub _Cnd_wait +@ cdecl _Cnd_wait(ptr ptr) @ stub _Cosh @ extern _Denorm @ stub _Dint @ stub _Dnorm @ cdecl _Do_call(ptr) -@ stub _Dscale +@ cdecl _Dscale(ptr long) @ stub _Dtento -@ stub _Dtest +@ cdecl _Dtest(ptr) @ stub _Dunscale @ extern _Eps -@ stub _Exp +@ cdecl _Exp(ptr double long) @ stub _FCosh @ extern _FDenorm @ stub _FDint @ stub _FDnorm -@ stub _FDscale +@ cdecl _FDscale(ptr long) @ stub _FDtento -@ stub _FDtest +@ cdecl _FDtest(ptr) @ stub _FDunscale @ extern _FEps -@ stub _FExp +@ cdecl _FExp(ptr float long) @ extern _FInf @ extern _FNan @ stub _FPlsw @@ -3732,9 +3732,9 @@ @ stub _LCosh @ extern _LDenorm @ stub _LDint -@ stub _LDscale +@ cdecl _LDscale(ptr long) _Dscale @ stub _LDtento -@ stub _LDtest +@ cdecl _LDtest(ptr) _Dtest @ stub _LDunscale @ extern _LEps @ stub _LExp @@ -3803,16 +3803,16 @@ @ cdecl _Strcoll(ptr ptr ptr ptr ptr) @ stub _Strxfrm @ stub _Thrd_abort -@ stub _Thrd_create -@ stub _Thrd_current +@ cdecl _Thrd_create(ptr ptr ptr) +@ cdecl _Thrd_current() @ stub _Thrd_detach -@ stub _Thrd_equal +@ cdecl _Thrd_equal(ptr ptr) @ stub _Thrd_exit -@ stub _Thrd_join -@ stub _Thrd_lt -@ stub _Thrd_sleep +@ cdecl _Thrd_join(ptr long) +@ cdecl _Thrd_lt(ptr ptr) +@ cdecl _Thrd_sleep(ptr) @ stub _Thrd_start -@ stub _Thrd_yield +@ cdecl _Thrd_yield() @ cdecl _Tolower(long ptr) @ cdecl _Toupper(long ptr) @ cdecl _Towlower(long ptr) diff -Nru wine1.7-1.7.50/dlls/msvcp120/tests/msvcp120.c wine1.7-1.7.55/dlls/msvcp120/tests/msvcp120.c --- wine1.7-1.7.50/dlls/msvcp120/tests/msvcp120.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcp120/tests/msvcp120.c 2015-11-13 14:32:40.000000000 +0000 @@ -18,10 +18,26 @@ #include #include +#include +#include #include "wine/test.h" #include "winbase.h" +static inline float __port_infinity(void) +{ + static const unsigned __inf_bytes = 0x7f800000; + return *(const float *)&__inf_bytes; +} +#define INFINITY __port_infinity() + +static inline float __port_nan(void) +{ + static const unsigned __nan_bytes = 0x7fc00000; + return *(const float *)&__nan_bytes; +} +#define NAN __port_nan() + typedef int MSVCRT_long; typedef unsigned char MSVCP_bool; @@ -50,6 +66,22 @@ type_unknown }; +static BOOL compare_float(float f, float g, unsigned int ulps) +{ + int x = *(int *)&f; + int y = *(int *)&g; + + if (x < 0) + x = INT_MIN - x; + if (y < 0) + y = INT_MIN - y; + + if (abs(x - y) > ulps) + return FALSE; + + return TRUE; +} + static inline const char* debugstr_longlong(ULONGLONG ll) { static char string[17]; @@ -70,6 +102,9 @@ static void (CDECL *p__Call_once)(int *once, void (CDECL *func)(void)); static void (CDECL *p__Call_onceEx)(int *once, void (CDECL *func)(void*), void *argv); static void (CDECL *p__Do_call)(void *this); +static short (__cdecl *p__Dtest)(double *d); +static short (__cdecl *p__Dscale)(double *d, int exp); +static short (__cdecl *p__FExp)(float *x, float y, int exp); /* filesystem */ static ULONGLONG(__cdecl *p_tr2_sys__File_size)(char const*); @@ -88,10 +123,61 @@ static int (__cdecl *p_tr2_sys__Copy_file_wchar)(WCHAR const*, WCHAR const*, MSVCP_bool); static int (__cdecl *p_tr2_sys__Rename)(char const*, char const*); static int (__cdecl *p_tr2_sys__Rename_wchar)(WCHAR const*, WCHAR const*); -static struct space_info (__cdecl *p_tr2_sys__Statvfs)(char const*); -static struct space_info (__cdecl *p_tr2_sys__Statvfs_wchar)(WCHAR const*); +static struct space_info* (__cdecl *p_tr2_sys__Statvfs)(struct space_info*, char const*); +static struct space_info* (__cdecl *p_tr2_sys__Statvfs_wchar)(struct space_info*, WCHAR const*); static enum file_type (__cdecl *p_tr2_sys__Stat)(char const*, int *); static enum file_type (__cdecl *p_tr2_sys__Lstat)(char const*, int *); +static __int64 (__cdecl *p_tr2_sys__Last_write_time)(char const*); +static void (__cdecl *p_tr2_sys__Last_write_time_set)(char const*, __int64); + +/* thrd */ +typedef struct +{ + HANDLE hnd; + DWORD id; +} _Thrd_t; + +#define TIMEDELTA 250 /* 250 ms uncertainty allowed */ + +typedef int (__cdecl *_Thrd_start_t)(void*); + +static int (__cdecl *p__Thrd_equal)(_Thrd_t, _Thrd_t); +static int (__cdecl *p__Thrd_lt)(_Thrd_t, _Thrd_t); +static void (__cdecl *p__Thrd_sleep)(const xtime*); +static _Thrd_t (__cdecl *p__Thrd_current)(void); +static int (__cdecl *p__Thrd_create)(_Thrd_t*, _Thrd_start_t, void*); +static int (__cdecl *p__Thrd_join)(_Thrd_t, int*); + +#ifdef __i386__ +static ULONGLONG (__cdecl *p_i386_Thrd_current)(void); +_Thrd_t __cdecl i386_Thrd_current(void) +{ + union { + _Thrd_t thr; + ULONGLONG ull; + } r; + r.ull = p_i386_Thrd_current(); + return r.thr; +} +#endif + +/* mtx */ +typedef void *_Mtx_t; +static int (__cdecl *p__Mtx_init)(_Mtx_t*, int); +static void (__cdecl *p__Mtx_destroy)(_Mtx_t*); +static int (__cdecl *p__Mtx_lock)(_Mtx_t*); +static int (__cdecl *p__Mtx_unlock)(_Mtx_t*); + +/* cnd */ +typedef void *_Cnd_t; + +static int (__cdecl *p__Cnd_init)(_Cnd_t*); +static void (__cdecl *p__Cnd_destroy)(_Cnd_t*); +static int (__cdecl *p__Cnd_wait)(_Cnd_t*, _Mtx_t*); +static int (__cdecl *p__Cnd_timedwait)(_Cnd_t*, _Mtx_t*, const xtime*); +static int (__cdecl *p__Cnd_broadcast)(_Cnd_t*); +static int (__cdecl *p__Cnd_signal)(_Cnd_t*); + static HMODULE msvcp; #define SETNOFAIL(x,y) x = (void*)GetProcAddress(msvcp,y) @@ -119,6 +205,12 @@ "_Call_onceEx"); SET(p__Do_call, "_Do_call"); + SET(p__Dtest, + "_Dtest"); + SET(p__Dscale, + "_Dscale"); + SET(p__FExp, + "_FExp"); if(sizeof(void*) == 8) { /* 64-bit initialization */ SET(p_tr2_sys__File_size, "?_File_size@sys@tr2@std@@YA_KPEBD@Z"); @@ -160,6 +252,12 @@ "?_Stat@sys@tr2@std@@YA?AW4file_type@123@PEBDAEAH@Z"); SET(p_tr2_sys__Lstat, "?_Lstat@sys@tr2@std@@YA?AW4file_type@123@PEBDAEAH@Z"); + SET(p_tr2_sys__Last_write_time, + "?_Last_write_time@sys@tr2@std@@YA_JPEBD@Z"); + SET(p_tr2_sys__Last_write_time_set, + "?_Last_write_time@sys@tr2@std@@YAXPEBD_J@Z"); + SET(p__Thrd_current, + "_Thrd_current"); } else { SET(p_tr2_sys__File_size, "?_File_size@sys@tr2@std@@YA_KPBD@Z"); @@ -201,7 +299,51 @@ "?_Stat@sys@tr2@std@@YA?AW4file_type@123@PBDAAH@Z"); SET(p_tr2_sys__Lstat, "?_Lstat@sys@tr2@std@@YA?AW4file_type@123@PBDAAH@Z"); + SET(p_tr2_sys__Last_write_time, + "?_Last_write_time@sys@tr2@std@@YA_JPBD@Z"); + SET(p_tr2_sys__Last_write_time_set, + "?_Last_write_time@sys@tr2@std@@YAXPBD_J@Z"); +#ifdef __i386__ + SET(p_i386_Thrd_current, + "_Thrd_current"); + p__Thrd_current = i386_Thrd_current; +#else + SET(p__Thrd_current, + "_Thrd_current"); +#endif } + SET(p__Thrd_equal, + "_Thrd_equal"); + SET(p__Thrd_lt, + "_Thrd_lt"); + SET(p__Thrd_sleep, + "_Thrd_sleep"); + SET(p__Thrd_create, + "_Thrd_create"); + SET(p__Thrd_join, + "_Thrd_join"); + + SET(p__Mtx_init, + "_Mtx_init"); + SET(p__Mtx_destroy, + "_Mtx_destroy"); + SET(p__Mtx_lock, + "_Mtx_lock"); + SET(p__Mtx_unlock, + "_Mtx_unlock"); + + SET(p__Cnd_init, + "_Cnd_init"); + SET(p__Cnd_destroy, + "_Cnd_destroy"); + SET(p__Cnd_wait, + "_Cnd_wait"); + SET(p__Cnd_timedwait, + "_Cnd_timedwait"); + SET(p__Cnd_broadcast, + "_Cnd_broadcast"); + SET(p__Cnd_signal, + "_Cnd_signal"); msvcr = GetModuleHandleA("msvcr120.dll"); p_setlocale = (void*)GetProcAddress(msvcr, "setlocale"); @@ -407,6 +549,137 @@ ok(cnt == 1, "func was not called\n"); } +static void test__Dtest(void) +{ + double d; + short ret; + + d = 0; + ret = p__Dtest(&d); + ok(ret == FP_ZERO, "_Dtest(0) returned %x\n", ret); + + d = 1; + ret = p__Dtest(&d); + ok(ret == FP_NORMAL, "_Dtest(1) returned %x\n", ret); + + d = -1; + ret = p__Dtest(&d); + ok(ret == FP_NORMAL, "_Dtest(-1) returned %x\n", ret); + + d = INFINITY; + ret = p__Dtest(&d); + ok(ret == FP_INFINITE, "_Dtest(INF) returned %x\n", ret); + + d = NAN; + ret = p__Dtest(&d); + ok(ret == FP_NAN, "_Dtest(NAN) returned %x\n", ret); +} + +static void test__Dscale(void) +{ + double d; + short ret; + + d = 0; + ret = p__Dscale(&d, 0); + ok(d == 0, "d = %f\n", d); + ok(ret == FP_ZERO, "ret = %x\n", ret); + + d = 0; + ret = p__Dscale(&d, 1); + ok(d == 0, "d = %f\n", d); + ok(ret == FP_ZERO, "ret = %x\n", ret); + + d = 0; + ret = p__Dscale(&d, -1); + ok(d == 0, "d = %f\n", d); + ok(ret == FP_ZERO, "ret = %x\n", ret); + + d = 1; + ret = p__Dscale(&d, 0); + ok(d == 1, "d = %f\n", d); + ok(ret == FP_NORMAL, "ret = %x\n", ret); + + d = 1; + ret = p__Dscale(&d, 1); + ok(d == 2, "d = %f\n", d); + ok(ret == FP_NORMAL, "ret = %x\n", ret); + + d = 1; + ret = p__Dscale(&d, -1); + ok(d == 0.5, "d = %f\n", d); + ok(ret == FP_NORMAL, "ret = %x\n", ret); + + d = 1; + ret = p__Dscale(&d, -99999); + ok(d == 0, "d = %f\n", d); + ok(ret == FP_ZERO, "ret = %x\n", ret); + + d = 1; + ret = p__Dscale(&d, 999999); + ok(d == INFINITY, "d = %f\n", d); + ok(ret == FP_INFINITE, "ret = %x\n", ret); + + d = NAN; + ret = p__Dscale(&d, 1); + ok(ret == FP_NAN, "ret = %x\n", ret); +} + +static void test__FExp(void) +{ + float d; + short ret; + + d = 0; + ret = p__FExp(&d, 0, 0); + ok(d == 0, "d = %f\n", d); + ok(ret == FP_ZERO, "ret = %x\n", ret); + + d = 0; + ret = p__FExp(&d, 1, 0); + ok(d == 1.0, "d = %f\n", d); + ok(ret == FP_NORMAL, "ret = %x\n", ret); + + d = 0; + ret = p__FExp(&d, 1, 1); + ok(d == 2.0, "d = %f\n", d); + ok(ret == FP_NORMAL, "ret = %x\n", ret); + + d = 0; + ret = p__FExp(&d, 1, 2); + ok(d == 4.0, "d = %f\n", d); + ok(ret == FP_NORMAL, "ret = %x\n", ret); + + d = 0; + ret = p__FExp(&d, 10, 0); + ok(d == 10.0, "d = %f\n", d); + ok(ret == FP_NORMAL, "ret = %x\n", ret); + + d = 1; + ret = p__FExp(&d, 0, 0); + ok(d == 0, "d = %f\n", d); + ok(ret == FP_ZERO, "ret = %x\n", ret); + + d = 1; + ret = p__FExp(&d, 1, 0); + ok(compare_float(d, 2.7182817, 4), "d = %f\n", d); + ok(ret == FP_NORMAL, "ret = %x\n", ret); + + d = 9e20; + ret = p__FExp(&d, 0, 0); + ok(d == 0, "d = %f\n", d); + ok(ret == FP_ZERO, "ret = %x\n", ret); + + d = 90; + ret = p__FExp(&d, 1, 0); + ok(ret == FP_INFINITE, "ret = %x\n", ret); + + d = 90; + ret = p__FExp(&d, 1, -50); + ok(compare_float(d, 1.0839359e+024, 4), "d = %g\n", d); + ok(ret == FP_NORMAL, "ret = %x\n", ret); +} + static void test_tr2_sys__File_size(void) { ULONGLONG val; @@ -788,15 +1061,15 @@ memset(current_path_wchar, 0, MAX_PATH); p_tr2_sys__Current_get_wchar(current_path_wchar); - info = p_tr2_sys__Statvfs(current_path); + p_tr2_sys__Statvfs(&info, current_path); ok(info.capacity >= info.free, "test_tr2_sys__Statvfs(): info.capacity < info.free\n"); ok(info.free >= info.available, "test_tr2_sys__Statvfs(): info.free < info.available\n"); - info = p_tr2_sys__Statvfs_wchar(current_path_wchar); + p_tr2_sys__Statvfs_wchar(&info, current_path_wchar); ok(info.capacity >= info.free, "tr2_sys__Statvfs_wchar(): info.capacity < info.free\n"); ok(info.free >= info.available, "tr2_sys__Statvfs_wchar(): info.free < info.available\n"); - info = p_tr2_sys__Statvfs(NULL); + p_tr2_sys__Statvfs(&info, NULL); ok(info.available == 0, "test_tr2_sys__Statvfs(): info.available expect: %d, got %s\n", 0, debugstr_longlong(info.available)); ok(info.capacity == 0, "test_tr2_sys__Statvfs(): info.capacity expect: %d, got %s\n", @@ -804,7 +1077,7 @@ ok(info.free == 0, "test_tr2_sys__Statvfs(): info.free expect: %d, got %s\n", 0, debugstr_longlong(info.free)); - info = p_tr2_sys__Statvfs("not_exist"); + p_tr2_sys__Statvfs(&info, "not_exist"); ok(info.available == 0, "test_tr2_sys__Statvfs(): info.available expect: %d, got %s\n", 0, debugstr_longlong(info.available)); ok(info.capacity == 0, "test_tr2_sys__Statvfs(): info.capacity expect: %d, got %s\n", @@ -902,6 +1175,272 @@ ok(RemoveDirectoryA("tr2_test_dir"), "expect tr2_test_dir to exist\n"); } +static void test_tr2_sys__Last_write_time(void) +{ + HANDLE file; + int ret; + __int64 last_write_time, newtime; + ret = p_tr2_sys__Make_dir("tr2_test_dir"); + ok(ret == 1, "tr2_sys__Make_dir() expect 1 got %d\n", ret); + + file = CreateFileA("tr2_test_dir/f1", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); + ok(file != INVALID_HANDLE_VALUE, "create file failed: INVALID_HANDLE_VALUE\n"); + CloseHandle(file); + + last_write_time = p_tr2_sys__Last_write_time("tr2_test_dir/f1"); + newtime = last_write_time + 123456789; + p_tr2_sys__Last_write_time_set("tr2_test_dir/f1", newtime); + todo_wine ok(last_write_time == p_tr2_sys__Last_write_time("tr2_test_dir/f1"), + "last_write_time before modfied should not equal to last_write_time %s\n", + debugstr_longlong(last_write_time)); + + errno = 0xdeadbeef; + last_write_time = p_tr2_sys__Last_write_time("not_exist"); + ok(errno == 0xdeadbeef, "tr2_sys__Last_write_time(): errno expect 0xdeadbeef, got %d\n", errno); + ok(last_write_time == 0, "expect 0 got %s\n", debugstr_longlong(last_write_time)); + last_write_time = p_tr2_sys__Last_write_time(NULL); + ok(last_write_time == 0, "expect 0 got %s\n", debugstr_longlong(last_write_time)); + + p_tr2_sys__Last_write_time_set("not_exist", newtime); + errno = 0xdeadbeef; + p_tr2_sys__Last_write_time_set(NULL, newtime); + ok(errno == 0xdeadbeef, "tr2_sys__Last_write_time(): errno expect 0xdeadbeef, got %d\n", errno); + + ok(DeleteFileA("tr2_test_dir/f1"), "expect tr2_test_dir/f1 to exist\n"); + ret = p_tr2_sys__Remove_dir("tr2_test_dir"); + ok(ret == 1, "test_tr2_sys__Remove_dir(): expect 1 got %d\n", ret); +} + +static int __cdecl thrd_thread(void *arg) +{ + _Thrd_t *thr = arg; + + *thr = p__Thrd_current(); + return 0x42; +} + +static void test_thrd(void) +{ + int ret, i, r; + struct test { + _Thrd_t a; + _Thrd_t b; + int r; + }; + const HANDLE hnd1 = (HANDLE)0xcccccccc; + const HANDLE hnd2 = (HANDLE)0xdeadbeef; + xtime xt, before, after; + MSVCRT_long diff; + _Thrd_t ta, tb; + + struct test testeq[] = { + { {0, 0}, {0, 0}, 1 }, + { {0, 1}, {0, 0}, 0 }, + { {hnd1, 0}, {hnd1, 1}, 0 }, + { {hnd1, 0}, {hnd2, 0}, 1 } + }; + + struct test testlt[] = { + { {0, 0}, {0, 0}, 0 }, + { {0, 0}, {0, 1}, 1 }, + { {0, 1}, {0, 0}, 0 }, + { {hnd1, 0}, {hnd2, 0}, 0 }, + { {hnd1, 0}, {hnd2, 1}, 1 } + }; + + /* test for equal */ + for(i=0; i 2000 - TIMEDELTA, "got %d\n", diff); + + /* test for current */ + ta = p__Thrd_current(); + tb = p__Thrd_current(); + ok(ta.id == tb.id, "got a %d b %d\n", ta.id, tb.id); + ok(ta.id == GetCurrentThreadId(), "expected %d, got %d\n", GetCurrentThreadId(), ta.id); + /* these can be different if new threads are created at same time */ + ok(ta.hnd == tb.hnd, "got a %p b %p\n", ta.hnd, tb.hnd); + ok(!CloseHandle(ta.hnd), "handle %p not closed\n", ta.hnd); + ok(!CloseHandle(tb.hnd), "handle %p not closed\n", tb.hnd); + + /* test for create/join */ + if (0) /* crash on Windows */ + { + p__Thrd_create(NULL, thrd_thread, NULL); + p__Thrd_create(&ta, NULL, NULL); + } + r = -1; + ret = p__Thrd_create(&ta, thrd_thread, (void*)&tb); + ok(!ret, "failed to create thread, got %d\n", ret); + ret = p__Thrd_join(ta, &r); + ok(!ret, "failed to join thread, got %d\n", ret); + ok(ta.id == tb.id, "expected %d, got %d\n", ta.id, tb.id); + ok(ta.hnd != tb.hnd, "same handles, got %p\n", ta.hnd); + ok(r == 0x42, "expected 0x42, got %d\n", r); + ok(!CloseHandle(ta.hnd), "handle %p not closed\n", ta.hnd); +} + +#define NUM_THREADS 10 +struct cndmtx +{ + HANDLE initialized; + int started; + int thread_no; + + _Cnd_t cnd; + _Mtx_t mtx; + BOOL timed_wait; +}; + +static int __cdecl cnd_wait_thread(void *arg) +{ + struct cndmtx *cm = arg; + int r; + + p__Mtx_lock(&cm->mtx); + + if(InterlockedIncrement(&cm->started) == cm->thread_no) + SetEvent(cm->initialized); + + if(cm->timed_wait) { + xtime xt; + + p_xtime_get(&xt, 1); + xt.sec += 2; + r = p__Cnd_timedwait(&cm->cnd, &cm->mtx, &xt); + ok(!r, "timed wait failed\n"); + } else { + r = p__Cnd_wait(&cm->cnd, &cm->mtx); + ok(!r, "wait failed\n"); + } + + p__Mtx_unlock(&cm->mtx); + return 0; +} + +static void test_cnd(void) +{ + _Thrd_t threads[NUM_THREADS]; + xtime xt, before, after; + MSVCRT_long diff; + struct cndmtx cm; + _Cnd_t cnd; + _Mtx_t mtx; + int r, i; + + r = p__Cnd_init(&cnd); + ok(!r, "failed to init cnd\n"); + + r = p__Mtx_init(&mtx, 0); + ok(!r, "failed to init mtx\n"); + + if (0) /* crash on Windows */ + { + p__Cnd_init(NULL); + p__Cnd_wait(NULL, &mtx); + p__Cnd_wait(&cnd, NULL); + p__Cnd_timedwait(NULL, &mtx, &xt); + p__Cnd_timedwait(&cnd, &mtx, &xt); + } + p__Cnd_destroy(NULL); + + /* test _Cnd_signal/_Cnd_wait */ + cm.initialized = CreateEventW(NULL, FALSE, FALSE, NULL); + cm.started = 0; + cm.thread_no = 1; + cm.cnd = cnd; + cm.mtx = mtx; + cm.timed_wait = FALSE; + p__Thrd_create(&threads[0], cnd_wait_thread, (void*)&cm); + + WaitForSingleObject(cm.initialized, INFINITE); + p__Mtx_lock(&mtx); + p__Mtx_unlock(&mtx); + + r = p__Cnd_signal(&cm.cnd); + ok(!r, "failed to signal\n"); + p__Thrd_join(threads[0], NULL); + + /* test _Cnd_timedwait time out */ + p__Mtx_lock(&mtx); + p_xtime_get(&before, 1); + xt = before; + xt.sec += 1; + r = p__Cnd_timedwait(&cnd, &mtx, &xt); + p_xtime_get(&after, 1); + p__Mtx_unlock(&mtx); + + diff = p__Xtime_diff_to_millis2(&after, &before); + ok(r == 2, "should have timed out\n"); + ok(diff > 1000 - TIMEDELTA, "got %d\n", diff); + + /* test _Cnd_timedwait */ + cm.started = 0; + cm.timed_wait = TRUE; + p__Thrd_create(&threads[0], cnd_wait_thread, (void*)&cm); + + WaitForSingleObject(cm.initialized, INFINITE); + p__Mtx_lock(&mtx); + p__Mtx_unlock(&mtx); + + r = p__Cnd_signal(&cm.cnd); + ok(!r, "failed to signal\n"); + p__Thrd_join(threads[0], NULL); + + /* test _Cnd_broadcast */ + cm.started = 0; + cm.thread_no = NUM_THREADS; + cm.timed_wait = FALSE; + + for(i = 0; i < cm.thread_no; i++) + p__Thrd_create(&threads[i], cnd_wait_thread, (void*)&cm); + + WaitForSingleObject(cm.initialized, INFINITE); + p__Mtx_lock(&mtx); + p__Mtx_unlock(&mtx); + + r = p__Cnd_broadcast(&cnd); + ok(!r, "failed to broadcast\n"); + for(i = 0; i < cm.thread_no; i++) + p__Thrd_join(threads[i], NULL); + + /* test broadcast with _Cnd_destroy */ + cm.started = 0; + for(i = 0; i < cm.thread_no; i++) + p__Thrd_create(&threads[i], cnd_wait_thread, (void*)&cm); + + WaitForSingleObject(cm.initialized, INFINITE); + p__Mtx_lock(&mtx); + p__Mtx_unlock(&mtx); + + p__Cnd_destroy(&cnd); + for(i = 0; i < cm.thread_no; i++) + p__Thrd_join(threads[i], NULL); + + p__Mtx_destroy(&mtx); + CloseHandle(cm.initialized); +} + START_TEST(msvcp120) { if(!init()) return; @@ -910,6 +1449,9 @@ test__Getcvt(); test__Call_once(); test__Do_call(); + test__Dtest(); + test__Dscale(); + test__FExp(); test_tr2_sys__File_size(); test_tr2_sys__Equivalent(); @@ -921,5 +1463,10 @@ test_tr2_sys__Rename(); test_tr2_sys__Statvfs(); test_tr2_sys__Stat(); + test_tr2_sys__Last_write_time(); + + test_thrd(); + test_cnd(); + FreeLibrary(msvcp); } diff -Nru wine1.7-1.7.50/dlls/msvcp120_app/msvcp120_app.spec wine1.7-1.7.55/dlls/msvcp120_app/msvcp120_app.spec --- wine1.7-1.7.50/dlls/msvcp120_app/msvcp120_app.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcp120_app/msvcp120_app.spec 2015-11-13 14:32:40.000000000 +0000 @@ -1520,12 +1520,12 @@ @ cdecl -arch=win64 ?_Iput@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@GPEAD_K@Z(ptr ptr ptr ptr long ptr long) msvcp120.?_Iput@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@AEAVios_base@2@GPEAD_K@Z @ cdecl -arch=win32 ?_Iput@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AAVios_base@2@_WPADI@Z(ptr ptr long ptr ptr long ptr long) msvcp120.?_Iput@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AAVios_base@2@_WPADI@Z @ cdecl -arch=win64 ?_Iput@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AEAVios_base@2@_WPEAD_K@Z(ptr ptr ptr ptr long ptr long) msvcp120.?_Iput@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@AEAVios_base@2@_WPEAD_K@Z -@ stub -arch=win32 ?_Last_write_time@sys@tr2@std@@YAXPBD_J@Z -@ stub -arch=win64 ?_Last_write_time@sys@tr2@std@@YAXPEBD_J@Z +@ cdecl -arch=win32 ?_Last_write_time@sys@tr2@std@@YAXPBD_J@Z(str int64) msvcp120.?_Last_write_time@sys@tr2@std@@YAXPBD_J@Z +@ cdecl -arch=win64 ?_Last_write_time@sys@tr2@std@@YAXPEBD_J@Z(str int64) msvcp120.?_Last_write_time@sys@tr2@std@@YAXPEBD_J@Z @ stub -arch=win32 ?_Last_write_time@sys@tr2@std@@YAXPB_W_J@Z @ stub -arch=win64 ?_Last_write_time@sys@tr2@std@@YAXPEB_W_J@Z -@ stub -arch=win32 ?_Last_write_time@sys@tr2@std@@YA_JPBD@Z -@ stub -arch=win64 ?_Last_write_time@sys@tr2@std@@YA_JPEBD@Z +@ cdecl -ret64 -arch=win32 ?_Last_write_time@sys@tr2@std@@YA_JPBD@Z(str) msvcp120.?_Last_write_time@sys@tr2@std@@YA_JPBD@Z +@ cdecl -ret64 -arch=win64 ?_Last_write_time@sys@tr2@std@@YA_JPEBD@Z(str) msvcp120.?_Last_write_time@sys@tr2@std@@YA_JPEBD@Z @ stub -arch=win32 ?_Last_write_time@sys@tr2@std@@YA_JPB_W@Z @ stub -arch=win64 ?_Last_write_time@sys@tr2@std@@YA_JPEB_W@Z @ stub -arch=arm ?_Launch@_Pad@std@@QAAXPAU_Thrd_imp_t@@@Z @@ -1602,8 +1602,8 @@ @ cdecl -arch=win64 ?_New_Locimp@_Locimp@locale@std@@CAPEAV123@AEBV123@@Z(ptr) msvcp120.?_New_Locimp@_Locimp@locale@std@@CAPEAV123@AEBV123@@Z @ cdecl -arch=win32 ?_New_Locimp@_Locimp@locale@std@@CAPAV123@_N@Z(long) msvcp120.?_New_Locimp@_Locimp@locale@std@@CAPAV123@_N@Z @ cdecl -arch=win64 ?_New_Locimp@_Locimp@locale@std@@CAPEAV123@_N@Z(long) msvcp120.?_New_Locimp@_Locimp@locale@std@@CAPEAV123@_N@Z -@ stub -arch=win32 ?_Open_dir@sys@tr2@std@@YAPAXAAY0BAE@DPBDAAHAAW4file_type@123@@Z -@ stub -arch=win64 ?_Open_dir@sys@tr2@std@@YAPEAXAEAY0BAE@DPEBDAEAHAEAW4file_type@123@@Z +@ cdecl -arch=win32 ?_Open_dir@sys@tr2@std@@YAPAXAAY0BAE@DPBDAAHAAW4file_type@123@@Z(ptr str long long) msvcp120.?_Open_dir@sys@tr2@std@@YAPAXAAY0BAE@DPBDAAHAAW4file_type@123@@Z +@ cdecl -arch=win64 ?_Open_dir@sys@tr2@std@@YAPEAXAEAY0BAE@DPEBDAEAHAEAW4file_type@123@@Z(ptr str long long) msvcp120.?_Open_dir@sys@tr2@std@@YAPEAXAEAY0BAE@DPEBDAEAHAEAW4file_type@123@@Z @ stub -arch=win32 ?_Open_dir@sys@tr2@std@@YAPAXAAY0BAE@_WPB_WAAHAAW4file_type@123@@Z @ stub -arch=win64 ?_Open_dir@sys@tr2@std@@YAPEAXAEAY0BAE@_WPEB_WAEAHAEAW4file_type@123@@Z @ cdecl -arch=arm ?_Orphan_all@_Container_base0@std@@QAAXXZ(ptr) msvcp120.?_Orphan_all@_Container_base0@std@@QAAXXZ @@ -1722,10 +1722,10 @@ @ cdecl -arch=win64 ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PEBDAEAH@Z(str ptr) msvcp120.?_Stat@sys@tr2@std@@YA?AW4file_type@123@PEBDAEAH@Z @ stub -arch=win32 ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PB_WAAH@Z @ stub -arch=win64 ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PEB_WAEAH@Z -@ cdecl -arch=win32 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PBD@Z(str) msvcp120.?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PBD@Z -@ cdecl -arch=win64 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEBD@Z(str) msvcp120.?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEBD@Z -@ cdecl -arch=win32 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PB_W@Z(wstr) msvcp120.?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PB_W@Z -@ cdecl -arch=win64 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEB_W@Z(wstr) msvcp120.?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEB_W@Z +@ cdecl -arch=win32 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PBD@Z(ptr str) msvcp120.?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PBD@Z +@ cdecl -arch=win64 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEBD@Z(ptr str) msvcp120.?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEBD@Z +@ cdecl -arch=win32 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PB_W@Z(ptr wstr) msvcp120.?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PB_W@Z +@ cdecl -arch=win64 ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEB_W@Z(ptr wstr) msvcp120.?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEB_W@Z @ cdecl -arch=arm ?_Swap_all@_Container_base0@std@@QAAXAAU12@@Z(ptr ptr) msvcp120.?_Swap_all@_Container_base0@std@@QAAXAAU12@@Z @ thiscall -arch=i386 ?_Swap_all@_Container_base0@std@@QAEXAAU12@@Z(ptr ptr) msvcp120.?_Swap_all@_Container_base0@std@@QAEXAAU12@@Z @ cdecl -arch=win64 ?_Swap_all@_Container_base0@std@@QEAAXAEAU12@@Z(ptr ptr) msvcp120.?_Swap_all@_Container_base0@std@@QEAAXAEAU12@@Z @@ -3670,36 +3670,36 @@ @ cdecl -arch=win64 ?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEB_W_J@Z(ptr ptr long) msvcp120.?xsputn@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAA_JPEB_W_J@Z @ cdecl _Call_once(ptr ptr) msvcp120._Call_once @ cdecl _Call_onceEx(ptr ptr ptr) msvcp120._Call_onceEx -@ stub _Cnd_broadcast -@ stub _Cnd_destroy +@ cdecl _Cnd_broadcast(ptr) msvcp120._Cnd_broadcast +@ cdecl _Cnd_destroy(ptr) msvcp120._Cnd_destroy @ stub _Cnd_do_broadcast_at_thread_exit -@ stub _Cnd_init +@ cdecl _Cnd_init(ptr) msvcp120._Cnd_init @ stub _Cnd_register_at_thread_exit -@ stub _Cnd_signal -@ stub _Cnd_timedwait +@ cdecl _Cnd_signal(ptr) msvcp120._Cnd_signal +@ cdecl _Cnd_timedwait(ptr ptr ptr) msvcp120._Cnd_timedwait @ stub _Cnd_unregister_at_thread_exit -@ stub _Cnd_wait +@ cdecl _Cnd_wait(ptr ptr) msvcp120._Cnd_wait @ stub _Cosh @ extern _Denorm msvcp120._Denorm @ stub _Dint @ stub _Dnorm @ cdecl _Do_call(ptr) msvcp120._Do_call -@ stub _Dscale +@ cdecl _Dscale(ptr long) msvcp120._Dscale @ stub _Dtento -@ stub _Dtest +@ cdecl _Dtest(ptr) msvcp120._Dtest @ stub _Dunscale @ extern _Eps msvcp120._Eps -@ stub _Exp +@ cdecl _Exp(ptr double long) msvcp120._Exp @ stub _FCosh @ extern _FDenorm msvcp120._FDenorm @ stub _FDint @ stub _FDnorm -@ stub _FDscale +@ cdecl _FDscale(ptr long) msvcp120._FDscale @ stub _FDtento -@ stub _FDtest +@ cdecl _FDtest(ptr) msvcp120._FDtest @ stub _FDunscale @ extern _FEps msvcp120._FEps -@ stub _FExp +@ cdecl _FExp(ptr float long) msvcp120._FExp @ extern _FInf msvcp120._FInf @ extern _FNan msvcp120._FNan @ stub _FPlsw @@ -3732,9 +3732,9 @@ @ stub _LCosh @ extern _LDenorm msvcp120._LDenorm @ stub _LDint -@ stub _LDscale +@ cdecl _LDscale(ptr long) msvcp120._LDscale @ stub _LDtento -@ stub _LDtest +@ cdecl _LDtest(ptr) msvcp120._LDtest @ stub _LDunscale @ extern _LEps msvcp120._LEps @ stub _LExp @@ -3803,16 +3803,16 @@ @ cdecl _Strcoll(ptr ptr ptr ptr ptr) msvcp120._Strcoll @ stub _Strxfrm @ stub _Thrd_abort -@ stub _Thrd_create -@ stub _Thrd_current +@ cdecl _Thrd_create(ptr ptr ptr) msvcp120._Thrd_create +@ cdecl _Thrd_current() msvcp120._Thrd_current @ stub _Thrd_detach -@ stub _Thrd_equal +@ cdecl _Thrd_equal(ptr ptr) msvcp120._Thrd_equal @ stub _Thrd_exit -@ stub _Thrd_join -@ stub _Thrd_lt -@ stub _Thrd_sleep +@ cdecl _Thrd_join(ptr long) msvcp120._Thrd_join +@ cdecl _Thrd_lt(ptr ptr) msvcp120._Thrd_lt +@ cdecl _Thrd_sleep(ptr) msvcp120._Thrd_sleep @ stub _Thrd_start -@ stub _Thrd_yield +@ cdecl _Thrd_yield() msvcp120._Thrd_yield @ cdecl _Tolower(long ptr) msvcp120._Tolower @ cdecl _Toupper(long ptr) msvcp120._Toupper @ cdecl _Towlower(long ptr) msvcp120._Towlower diff -Nru wine1.7-1.7.50/dlls/msvcp60/msvcp60.spec wine1.7-1.7.55/dlls/msvcp60/msvcp60.spec --- wine1.7-1.7.50/dlls/msvcp60/msvcp60.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcp60/msvcp60.spec 2015-11-13 14:32:40.000000000 +0000 @@ -1535,12 +1535,12 @@ @ cdecl -arch=win64 ??9std@@YA_NPEBGAEBV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@0@@Z(ptr ptr) MSVCP_basic_string_wchar_not_equal_cstr_str @ thiscall -arch=win32 ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAADI@Z(ptr long) MSVCP_basic_string_char_operator_at @ cdecl -arch=win64 ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAD_K@Z(ptr long) MSVCP_basic_string_char_operator_at -@ thiscall -arch=win32 ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEABDI@Z(ptr long) MSVCP_basic_string_char_operator_at -@ cdecl -arch=win64 ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAAEBD_K@Z(ptr long) MSVCP_basic_string_char_operator_at +@ thiscall -arch=win32 ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEABDI@Z(ptr long) MSVCP_basic_string_char_operator_at_const +@ cdecl -arch=win64 ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAAEBD_K@Z(ptr long) MSVCP_basic_string_char_operator_at_const @ thiscall -arch=win32 ??A?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAGI@Z(ptr long) MSVCP_basic_string_wchar_operator_at @ cdecl -arch=win64 ??A?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAG_K@Z(ptr long) MSVCP_basic_string_wchar_operator_at -@ thiscall -arch=win32 ??A?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEABGI@Z(ptr long) MSVCP_basic_string_wchar_operator_at -@ cdecl -arch=win64 ??A?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBAAEBG_K@Z(ptr long) MSVCP_basic_string_wchar_operator_at +@ thiscall -arch=win32 ??A?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEABGI@Z(ptr long) MSVCP_basic_string_wchar_operator_at_const +@ cdecl -arch=win64 ??A?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBAAEBG_K@Z(ptr long) MSVCP_basic_string_wchar_operator_at_const @ thiscall -arch=win32 ??Bid@locale@std@@QAEIXZ(ptr) locale_id_operator_size_t @ cdecl -arch=win64 ??Bid@locale@std@@QEAA_KXZ(ptr) locale_id_operator_size_t @ thiscall -arch=win32 ??Bios_base@std@@QBEPAXXZ(ptr) ios_base_op_fail @@ -4257,17 +4257,17 @@ @ stub _Cosh @ extern _Denorm _Denorm @ stub _Dnorm -@ stub _Dscale -@ stub _Dtest +@ cdecl _Dscale(ptr long) +@ cdecl _Dtest(ptr) @ extern _Eps _Eps -@ stub _Exp +@ cdecl _Exp(ptr double long) @ stub _FCosh @ extern _FDenorm _FDenorm @ stub _FDnorm -@ stub _FDscale -@ stub _FDtest +@ cdecl _FDscale(ptr long) +@ cdecl _FDtest(ptr) @ extern _FEps _FEps -@ stub _FExp +@ cdecl _FExp(ptr float long) @ extern _FInf _FInf @ extern _FNan _FNan # extern _FRteps @@ -4281,8 +4281,8 @@ @ extern _Inf _Inf @ stub _LCosh @ extern _LDenorm _LDenorm -@ stub _LDscale -@ stub _LDtest +@ cdecl _LDscale(ptr long) _Dscale +@ cdecl _LDtest(ptr) _Dtest @ extern _LEps _LEps @ stub _LExp @ extern _LInf _LInf diff -Nru wine1.7-1.7.50/dlls/msvcp60/string.c wine1.7-1.7.55/dlls/msvcp60/string.c --- wine1.7-1.7.50/dlls/msvcp60/string.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcp60/string.c 2015-11-13 14:32:40.000000000 +0000 @@ -22,7 +22,6 @@ #include "msvcp.h" #include "stdio.h" -#include "assert.h" #include "windef.h" #include "winbase.h" @@ -1412,15 +1411,29 @@ /* ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAADI@Z */ /* ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAD_K@Z */ -/* ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEABDI@Z */ -/* ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAAEBD_K@Z */ DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_operator_at, 8) char* __thiscall MSVCP_basic_string_char_operator_at( basic_string_char *this, MSVCP_size_t pos) { TRACE("%p %lu\n", this, pos); - assert(this->size >= pos); + if(!this->ptr || pos>this->size) + return (char*)basic_string_char__Nullstr(); + + basic_string_char__Freeze(this); + return this->ptr+pos; +} + +/* ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEABDI@Z */ +/* ??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEBAAEBD_K@Z */ +DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_operator_at_const, 8) +const char* __thiscall MSVCP_basic_string_char_operator_at_const( + const basic_string_char *this, MSVCP_size_t pos) +{ + TRACE("%p %lu\n", this, pos); + + if(!this->ptr) + return basic_string_char__Nullstr(); return this->ptr+pos; } @@ -2935,15 +2948,29 @@ /* ??A?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAEAAGI@Z */ /* ??A?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAAAEAG_K@Z */ -/* ??A?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEABGI@Z */ -/* ??A?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBAAEBG_K@Z */ DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_operator_at, 8) wchar_t* __thiscall MSVCP_basic_string_wchar_operator_at( basic_string_wchar *this, MSVCP_size_t pos) { TRACE("%p %lu\n", this, pos); - assert(this->size >= pos); + if(!this->ptr || pos>this->size) + return (wchar_t*)basic_string_wchar__Nullstr(); + + basic_string_wchar__Freeze(this); + return this->ptr+pos; +} + +/* ??A?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QBEABGI@Z */ +/* ??A?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEBAAEBG_K@Z */ +DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_operator_at_const, 8) +const wchar_t* __thiscall MSVCP_basic_string_wchar_operator_at_const( + const basic_string_wchar *this, MSVCP_size_t pos) +{ + TRACE("%p %lu\n", this, pos); + + if(!this->ptr) + return basic_string_wchar__Nullstr(); return this->ptr+pos; } diff -Nru wine1.7-1.7.50/dlls/msvcp70/msvcp70.spec wine1.7-1.7.55/dlls/msvcp70/msvcp70.spec --- wine1.7-1.7.50/dlls/msvcp70/msvcp70.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcp70/msvcp70.spec 2015-11-13 14:32:40.000000000 +0000 @@ -5043,17 +5043,17 @@ @ stub _Cosh @ extern _Denorm @ stub _Dnorm -@ stub _Dscale -@ stub _Dtest +@ cdecl _Dscale(ptr long) +@ cdecl _Dtest(ptr) @ extern _Eps -@ stub _Exp +@ cdecl _Exp(ptr double long) @ stub _FCosh @ extern _FDenorm @ stub _FDnorm -@ stub _FDscale -@ stub _FDtest +@ cdecl _FDscale(ptr long) +@ cdecl _FDtest(ptr) @ extern _FEps -@ stub _FExp +@ cdecl _FExp(ptr float long) @ extern _FInf @ extern _FNan # extern _FRteps @@ -5068,8 +5068,8 @@ @ extern _Inf @ stub _LCosh @ extern _LDenorm -@ stub _LDscale -@ stub _LDtest +@ cdecl _LDscale(ptr long) _Dscale +@ cdecl _LDtest(ptr) _Dtest @ extern _LEps @ stub _LExp @ extern _LInf diff -Nru wine1.7-1.7.50/dlls/msvcp71/msvcp71.spec wine1.7-1.7.55/dlls/msvcp71/msvcp71.spec --- wine1.7-1.7.50/dlls/msvcp71/msvcp71.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcp71/msvcp71.spec 2015-11-13 14:32:40.000000000 +0000 @@ -5097,17 +5097,17 @@ @ stub _Cosh @ extern _Denorm @ stub _Dnorm -@ stub _Dscale -@ stub _Dtest +@ cdecl _Dscale(ptr long) +@ cdecl _Dtest(ptr) @ extern _Eps -@ stub _Exp +@ cdecl _Exp(ptr double long) @ stub _FCosh @ extern _FDenorm @ stub _FDnorm -@ stub _FDscale -@ stub _FDtest +@ cdecl _FDscale(ptr long) +@ cdecl _FDtest(ptr) @ extern _FEps -@ stub _FExp +@ cdecl _FExp(ptr float long) @ extern _FInf @ extern _FNan # extern _FRteps @@ -5124,8 +5124,8 @@ @ extern _Inf @ stub _LCosh @ extern _LDenorm -@ stub _LDscale -@ stub _LDtest +@ cdecl _LDscale(ptr long) _Dscale +@ cdecl _LDtest(ptr) _Dtest @ extern _LEps @ stub _LExp @ extern _LInf diff -Nru wine1.7-1.7.50/dlls/msvcp80/msvcp80.spec wine1.7-1.7.55/dlls/msvcp80/msvcp80.spec --- wine1.7-1.7.50/dlls/msvcp80/msvcp80.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcp80/msvcp80.spec 2015-11-13 14:32:40.000000000 +0000 @@ -5703,21 +5703,21 @@ @ stub _Cosh @ extern _Denorm @ stub _Dnorm -@ stub _Dscale +@ cdecl _Dscale(ptr long) @ stub _Dtentox -@ stub _Dtest +@ cdecl _Dtest(ptr) @ stub _Dunscale @ extern _Eps -@ stub _Exp +@ cdecl _Exp(ptr double long) @ stub _FCosh @ extern _FDenorm @ stub _FDnorm -@ stub _FDscale +@ cdecl _FDscale(ptr long) @ stub _FDtentox -@ stub _FDtest +@ cdecl _FDtest(ptr) @ stub _FDunscale @ extern _FEps -@ stub _FExp +@ cdecl _FExp(ptr float long) @ extern _FInf @ extern _FNan # extern _FRteps @@ -5734,9 +5734,9 @@ @ extern _Inf @ stub _LCosh @ extern _LDenorm -@ stub _LDscale +@ cdecl _LDscale(ptr long) _Dscale @ stub _LDtentox -@ stub _LDtest +@ cdecl _LDtest(ptr) _Dtest @ stub _LDunscale @ extern _LEps @ stub _LExp diff -Nru wine1.7-1.7.50/dlls/msvcp90/ios.c wine1.7-1.7.55/dlls/msvcp90/ios.c --- wine1.7-1.7.50/dlls/msvcp90/ios.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcp90/ios.c 2015-11-13 14:32:40.000000000 +0000 @@ -29,6 +29,12 @@ #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(msvcp); +#define SECSPERDAY 86400 +/* 1601 to 1970 is 369 years plus 89 leap days */ +#define SECS_1601_TO_1970 ((369 * 365 + 89) * (ULONGLONG)SECSPERDAY) +#define TICKSPERSEC 10000000 +#define TICKS_1601_TO_1970 (SECS_1601_TO_1970 * TICKSPERSEC) + /* ?_Index@ios_base@std@@0HA */ int ios_base_Index = 0; /* ?_Sync@ios_base@std@@0_NA */ @@ -14323,20 +14329,20 @@ /* ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PBD@Z */ /* ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEBD@Z */ -struct space_info __cdecl tr2_sys__Statvfs(const char* path) +struct space_info* __cdecl tr2_sys__Statvfs(struct space_info *ret, const char* path) { ULARGE_INTEGER available, total, free; - struct space_info info; + TRACE("(%s)\n", debugstr_a(path)); if(!path || !GetDiskFreeSpaceExA(path, &available, &total, &free)) { - info.capacity = info.free = info.available = 0; + ret->capacity = ret->free = ret->available = 0; }else { - info.capacity = total.QuadPart; - info.free = free.QuadPart; - info.available = available.QuadPart; + ret->capacity = total.QuadPart; + ret->free = free.QuadPart; + ret->available = available.QuadPart; } - return info; + return ret; } /* ?_Stat@sys@tr2@std@@YA?AW4file_type@123@PBDAAH@Z */ @@ -14380,6 +14386,98 @@ return tr2_sys__Stat(path, err_code); } +/* ?_Last_write_time@sys@tr2@std@@YA_JPBD@Z */ +/* ?_Last_write_time@sys@tr2@std@@YA_JPEBD@Z */ +__int64 __cdecl tr2_sys__Last_write_time(char const* path) +{ + HANDLE handle; + FILETIME lwt; + int ret; + __int64 last_write_time; + TRACE("(%s)\n", debugstr_a(path)); + + handle = CreateFileA(path, 0, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0); + if(handle == INVALID_HANDLE_VALUE) + return 0; + + ret = GetFileTime(handle, 0, 0, &lwt); + CloseHandle(handle); + if(!ret) + return 0; + + last_write_time = (((__int64)lwt.dwHighDateTime)<< 32) + lwt.dwLowDateTime; + last_write_time -= TICKS_1601_TO_1970; + last_write_time /= TICKSPERSEC; + return last_write_time; +} + +/* ?_Last_write_time@sys@tr2@std@@YAXPBD_J@Z */ +/* ?_Last_write_time@sys@tr2@std@@YAXPEBD_J@Z */ +void __cdecl tr2_sys__Last_write_time_set(char const* path, __int64 newtime) +{ + HANDLE handle; + FILETIME lwt; + TRACE("(%s)\n", debugstr_a(path)); + + handle = CreateFileA(path, FILE_WRITE_ATTRIBUTES, + FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0); + if(handle == INVALID_HANDLE_VALUE) + return; + + /* This is the implementation based on the test of msvcp110. + * According to the test of msvcp120, + * msvcp120's implementation does nothing. Obviously, this is a bug of windows. + */ + + newtime *= TICKSPERSEC; + newtime += TICKS_1601_TO_1970; + lwt.dwLowDateTime = (DWORD)(newtime); + lwt.dwHighDateTime = (DWORD)(newtime >> 32); + SetFileTime(handle, 0, 0, &lwt); + CloseHandle(handle); +} + +/* ?_Open_dir@sys@tr2@std@@YAPAXAAY0BAE@DPBDAAHAAW4file_type@123@@Z */ +/* ?_Open_dir@sys@tr2@std@@YAPEAXAEAY0BAE@DPEBDAEAHAEAW4file_type@123@@Z */ +void* __cdecl tr2_sys__Open_dir(char* target, char const* dest, int* err_code, enum file_type* type) +{ + HANDLE handle; + WIN32_FIND_DATAA data; + char temppath[MAX_PATH]; + + TRACE("(%p %s %p %p)\n", target, debugstr_a(dest), err_code, type); + if(strlen(dest) > MAX_PATH - 3) { + *err_code = ERROR_BAD_PATHNAME; + return NULL; + } + strcpy(temppath, dest); + strcat(temppath, "\\*"); + + handle = FindFirstFileA(temppath, &data); + if(handle == INVALID_HANDLE_VALUE) { + *err_code = GetLastError(); + return NULL; + } + while(!strcmp(data.cFileName, ".") || !strcmp(data.cFileName, "..")) { + if(!FindNextFileA(handle, &data)) { + *err_code = ERROR_SUCCESS; + *type = status_unknown; + FindClose(handle); + return NULL; + } + } + + strcpy(target, data.cFileName); + *err_code = ERROR_SUCCESS; + if(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + *type = directory_file; + else + *type = regular_file; + return handle; +} + /* ??0strstream@std@@QAE@PADHH@Z */ /* ??0strstream@std@@QEAA@PEAD_JH@Z */ #if STREAMSIZE_BITS == 64 @@ -14860,20 +14958,20 @@ /* ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PB_W@Z */ /* ?_Statvfs@sys@tr2@std@@YA?AUspace_info@123@PEB_W@Z */ -struct space_info __cdecl tr2_sys__Statvfs_wchar(const WCHAR* path) +struct space_info* __cdecl tr2_sys__Statvfs_wchar(struct space_info *ret, const WCHAR* path) { ULARGE_INTEGER available, total, free; - struct space_info info; + TRACE("(%s)\n", debugstr_w(path)); if(!path || !GetDiskFreeSpaceExW(path, &available, &total, &free)) { - info.capacity = info.free = info.available = 0; + ret->capacity = ret->free = ret->available = 0; }else { - info.capacity = total.QuadPart; - info.free = free.QuadPart; - info.available = available.QuadPart; + ret->capacity = total.QuadPart; + ret->free = free.QuadPart; + ret->available = available.QuadPart; } - return info; + return ret; } /* ??1_Winit@std@@QAE@XZ */ diff -Nru wine1.7-1.7.50/dlls/msvcp90/locale.c wine1.7-1.7.55/dlls/msvcp90/locale.c --- wine1.7-1.7.50/dlls/msvcp90/locale.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcp90/locale.c 2015-11-13 14:32:40.000000000 +0000 @@ -20,6 +20,7 @@ #include +#include "assert.h" #include "locale.h" #include "errno.h" #include "limits.h" @@ -649,33 +650,43 @@ return _Locinfo__Locinfo_Addcats(this, category, locstr); } -/* _Getcoll */ -ULONGLONG __cdecl _Getcoll(void) +static _Collvec* getcoll(_Collvec *ret) { - union { - _Collvec collvec; - ULONGLONG ull; - } ret; - TRACE("\n"); - ret.collvec.page = ___lc_collate_cp_func(); + ret->page = ___lc_collate_cp_func(); #if _MSVCP_VER < 110 - ret.collvec.handle = ___lc_handle_func()[LC_COLLATE]; + ret->handle = ___lc_handle_func()[LC_COLLATE]; #else - ret.collvec.lc_name = ___lc_locale_name_func()[LC_COLLATE]; + ret->lc_name = ___lc_locale_name_func()[LC_COLLATE]; #endif - return ret.ull; + return ret; } +/* _Getcoll */ +#if defined(__i386__) || _MSVCP_VER<110 +ULONGLONG __cdecl _Getcoll(void) +{ + ULONGLONG ret; + + C_ASSERT(sizeof(_Collvec) <= sizeof(ULONGLONG)); + + getcoll((_Collvec*)&ret); + return ret; +} +#else +_Collvec* __cdecl _Getcoll(_Collvec *ret) +{ + return getcoll(ret); +} +#endif + /* ?_Getcoll@_Locinfo@std@@QBE?AU_Collvec@@XZ */ /* ?_Getcoll@_Locinfo@std@@QEBA?AU_Collvec@@XZ */ DEFINE_THISCALL_WRAPPER(_Locinfo__Getcoll, 8) _Collvec* __thiscall _Locinfo__Getcoll(const _Locinfo *this, _Collvec *ret) { - ULONGLONG ull = _Getcoll(); - memcpy(ret, &ull, sizeof(ull)); - return ret; + return getcoll(ret); } /* _Getctype */ diff -Nru wine1.7-1.7.50/dlls/msvcp90/math.c wine1.7-1.7.55/dlls/msvcp90/math.c --- wine1.7-1.7.50/dlls/msvcp90/math.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcp90/math.c 2015-11-13 14:32:40.000000000 +0000 @@ -2226,3 +2226,93 @@ complex_double c = { 0.5, 0 }; return complex_double_pow(ret, l, &c); } + +static short dclass(double x) +{ + switch(_fpclass(x)) { + case _FPCLASS_SNAN: + case _FPCLASS_QNAN: + return FP_NAN; + case _FPCLASS_NINF: + case _FPCLASS_PINF: + return FP_INFINITE; + case _FPCLASS_ND: + case _FPCLASS_PD: + return FP_SUBNORMAL; + case _FPCLASS_NN: + case _FPCLASS_PN: + default: + return FP_NORMAL; + case _FPCLASS_NZ: + case _FPCLASS_PZ: + return FP_ZERO; + } +} + +/* _Dtest */ +short __cdecl _Dtest(double *x) +{ + return dclass(*x); +} + +/* _FDtest */ +short __cdecl _FDtest(float *x) +{ + return dclass(*x); +} + +/* _Dscale */ +short __cdecl _Dscale(double *x, int exp) +{ + *x *= pow(2, exp); + return dclass(*x); +} + +/* _FDscale */ +short __cdecl _FDscale(float *x, int exp) +{ + *x *= pow(2, exp); + return dclass(*x); +} + +/* _Exp */ +/* computes y * e^(*x) * 2^scale */ +short __cdecl _Exp(double *x, double y, int scale) +{ + double ed; + int e; + + if(y == 0) { + *x = 0; + return FP_ZERO; + } + + *x /= M_LN2; + ed = floor(*x); + *x -= ed; + e = ed; + + if(ed!=e && ed>0) + scale = INT_MAX; + else if(ed!=e && ed<0) + scale = INT_MIN; + else if(scale>0 && e>0 && scale+e<=0) + scale = INT_MAX; + else if(scale<0 && e<0 && scale+e>=0) + scale = INT_MIN; + else + scale += e; + + *x = y * pow(2.0, *x); + return _Dscale(x, scale); +} + +/* _FExp */ +short __cdecl _FExp(float *x, float y, short scale) +{ + double d = *x; + _Exp(&d, y, scale); + *x = d; + + return dclass(*x); +} diff -Nru wine1.7-1.7.50/dlls/msvcp90/misc.c wine1.7-1.7.55/dlls/msvcp90/misc.c --- wine1.7-1.7.50/dlls/msvcp90/misc.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcp90/misc.c 2015-11-13 14:32:40.000000000 +0000 @@ -25,6 +25,7 @@ #include "windef.h" #include "winbase.h" +#include "winternl.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(msvcp); @@ -398,7 +399,7 @@ } /* _Xtime_diff_to_millis2 */ -MSVCRT_long __cdecl _Xtime_diff_to_millis2(xtime *t1, xtime *t2) +MSVCRT_long __cdecl _Xtime_diff_to_millis2(const xtime *t1, const xtime *t2) { __time64_t diff_sec; MSVCRT_long diff_nsec, ret; @@ -413,7 +414,7 @@ } /* _Xtime_diff_to_millis */ -MSVCRT_long __cdecl _Xtime_diff_to_millis(xtime *t) +MSVCRT_long __cdecl _Xtime_diff_to_millis(const xtime *t) { xtime now; @@ -527,6 +528,101 @@ { return &(*mtx)->cs; } + +static inline LONG interlocked_dec_if_nonzero( LONG *dest ) +{ + LONG val, tmp; + for (val = *dest;; val = tmp) + { + if (!val || (tmp = InterlockedCompareExchange( dest, val - 1, val )) == val) + break; + } + return val; +} + +#define CND_TIMEDOUT 2 + +typedef struct +{ + CONDITION_VARIABLE cv; +} *_Cnd_t; + +static HANDLE keyed_event; + +int __cdecl _Cnd_init(_Cnd_t *cnd) +{ + *cnd = MSVCRT_operator_new(sizeof(**cnd)); + InitializeConditionVariable(&(*cnd)->cv); + + if(!keyed_event) { + HANDLE event; + + NtCreateKeyedEvent(&event, GENERIC_READ|GENERIC_WRITE, NULL, 0); + if(InterlockedCompareExchangePointer(&keyed_event, event, NULL) != NULL) + NtClose(event); + } + + return 0; +} + +int __cdecl _Cnd_wait(_Cnd_t *cnd, _Mtx_t *mtx) +{ + CONDITION_VARIABLE *cv = &(*cnd)->cv; + + InterlockedExchangeAdd( (LONG *)&cv->Ptr, 1 ); + _Mtx_unlock(mtx); + + NtWaitForKeyedEvent(keyed_event, &cv->Ptr, FALSE, NULL); + + _Mtx_lock(mtx); + return 0; +} + +int __cdecl _Cnd_timedwait(_Cnd_t *cnd, _Mtx_t *mtx, const xtime *xt) +{ + CONDITION_VARIABLE *cv = &(*cnd)->cv; + LARGE_INTEGER timeout; + NTSTATUS status; + + InterlockedExchangeAdd( (LONG *)&cv->Ptr, 1 ); + _Mtx_unlock(mtx); + + timeout.QuadPart = (ULONGLONG)_Xtime_diff_to_millis(xt) * -10000; + status = NtWaitForKeyedEvent(keyed_event, &cv->Ptr, FALSE, &timeout); + if (status) + { + if (!interlocked_dec_if_nonzero( (LONG *)&cv->Ptr )) + status = NtWaitForKeyedEvent( keyed_event, &cv->Ptr, FALSE, NULL ); + } + + _Mtx_lock(mtx); + return status ? CND_TIMEDOUT : 0; +} + +int __cdecl _Cnd_broadcast(_Cnd_t *cnd) +{ + CONDITION_VARIABLE *cv = &(*cnd)->cv; + LONG val = InterlockedExchange( (LONG *)&cv->Ptr, 0 ); + while (val-- > 0) + NtReleaseKeyedEvent( keyed_event, &cv->Ptr, FALSE, NULL ); + return 0; +} + +int __cdecl _Cnd_signal(_Cnd_t *cnd) +{ + CONDITION_VARIABLE *cv = &(*cnd)->cv; + if (interlocked_dec_if_nonzero( (LONG *)&cv->Ptr )) + NtReleaseKeyedEvent( keyed_event, &cv->Ptr, FALSE, NULL ); + return 0; +} + +void __cdecl _Cnd_destroy(_Cnd_t *cnd) +{ + if(cnd) { + _Cnd_broadcast(cnd); + MSVCRT_operator_delete(*cnd); + } +} #endif #if _MSVCP_VER == 100 @@ -683,3 +779,103 @@ iostream_category_ctor(&iostream_category); #endif } + +void free_misc(void) +{ +#if _MSVCP_VER >= 110 + if(keyed_event) + NtClose(keyed_event); +#endif +} + +#if _MSVCP_VER >= 110 +typedef struct +{ + HANDLE hnd; + DWORD id; +} _Thrd_t; + +typedef int (__cdecl *_Thrd_start_t)(void*); + +#define _THRD_ERROR 4 + +int __cdecl _Thrd_equal(_Thrd_t a, _Thrd_t b) +{ + TRACE("(%p %u %p %u)\n", a.hnd, a.id, b.hnd, b.id); + return a.id == b.id; +} + +int __cdecl _Thrd_lt(_Thrd_t a, _Thrd_t b) +{ + TRACE("(%p %u %p %u)\n", a.hnd, a.id, b.hnd, b.id); + return a.id < b.id; +} + +void __cdecl _Thrd_sleep(const xtime *t) +{ + TRACE("(%p)\n", t); + Sleep(_Xtime_diff_to_millis(t)); +} + +void __cdecl _Thrd_yield(void) +{ + TRACE("()\n"); + Sleep(0); +} + +static _Thrd_t thread_current(void) +{ + _Thrd_t ret; + + if(DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), + GetCurrentProcess(), &ret.hnd, 0, FALSE, DUPLICATE_SAME_ACCESS)) { + CloseHandle(ret.hnd); + } else { + ret.hnd = 0; + } + ret.id = GetCurrentThreadId(); + + TRACE("(%p %u)\n", ret.hnd, ret.id); + return ret; +} + +#ifndef __i386__ +_Thrd_t __cdecl _Thrd_current(void) +{ + return thread_current(); +} +#else +ULONGLONG __cdecl _Thrd_current(void) +{ + union { + _Thrd_t thr; + ULONGLONG ull; + } ret; + + C_ASSERT(sizeof(_Thrd_t) <= sizeof(ULONGLONG)); + + ret.thr = thread_current(); + return ret.ull; +} +#endif + +int __cdecl _Thrd_join(_Thrd_t thr, int *code) +{ + TRACE("(%p %u %p)\n", thr.hnd, thr.id, code); + if (WaitForSingleObject(thr.hnd, INFINITE)) + return _THRD_ERROR; + + if (code) + GetExitCodeThread(thr.hnd, (DWORD *)code); + + CloseHandle(thr.hnd); + return 0; +} + +int __cdecl _Thrd_create(_Thrd_t *thr, _Thrd_start_t proc, void *arg) +{ + TRACE("(%p %p %p)\n", thr, proc, arg); + thr->hnd = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)proc, arg, 0, &thr->id); + return !thr->hnd; +} +#endif diff -Nru wine1.7-1.7.50/dlls/msvcp90/msvcp90.h wine1.7-1.7.55/dlls/msvcp90/msvcp90.h --- wine1.7-1.7.50/dlls/msvcp90/msvcp90.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcp90/msvcp90.h 2015-11-13 14:32:40.000000000 +0000 @@ -629,3 +629,5 @@ #define mbstowcs_s( ret, wcs, size, mbs, count ) mbstowcs_wrapper( ret, wcs, size, mbs, count ) #define hypotf( x, y ) ((float)hypot( (double)(x), (double)(y) )) #endif + +void free_misc(void); diff -Nru wine1.7-1.7.50/dlls/msvcp90/msvcp90.spec wine1.7-1.7.55/dlls/msvcp90/msvcp90.spec --- wine1.7-1.7.50/dlls/msvcp90/msvcp90.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcp90/msvcp90.spec 2015-11-13 14:32:40.000000000 +0000 @@ -6479,17 +6479,17 @@ @ stub _Cosh @ extern _Denorm @ stub _Dnorm -@ stub _Dscale -@ stub _Dtest +@ cdecl _Dscale(ptr long) +@ cdecl _Dtest(ptr) @ extern _Eps -@ stub _Exp +@ cdecl _Exp(ptr double long) @ stub _FCosh @ extern _FDenorm @ stub _FDnorm -@ stub _FDscale -@ stub _FDtest +@ cdecl _FDscale(ptr long) +@ cdecl _FDtest(ptr) @ extern _FEps -@ stub _FExp +@ cdecl _FExp(ptr float long) @ extern _FInf @ extern _FNan # extern _FRteps @@ -6506,8 +6506,8 @@ @ extern _Inf @ stub _LCosh @ extern _LDenorm -@ stub _LDscale -@ stub _LDtest +@ cdecl _LDscale(ptr long) _Dscale +@ cdecl _LDtest(ptr) _Dtest @ extern _LEps @ stub _LExp @ extern _LInf diff -Nru wine1.7-1.7.50/dlls/msvcp90/msvcp_main.c wine1.7-1.7.55/dlls/msvcp90/msvcp_main.c --- wine1.7-1.7.50/dlls/msvcp90/msvcp_main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcp90/msvcp_main.c 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ free_io(); free_locale(); free_lockit(); + free_misc(); break; } diff -Nru wine1.7-1.7.50/dlls/msvcr100/msvcr100.spec wine1.7-1.7.55/dlls/msvcr100/msvcr100.spec --- wine1.7-1.7.50/dlls/msvcr100/msvcr100.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcr100/msvcr100.spec 2015-11-13 14:32:40.000000000 +0000 @@ -548,7 +548,7 @@ @ stub __CxxCallUnwindStdDelDtor @ stub __CxxCallUnwindVecDtor @ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) -@ stub __CxxExceptionFilter +@ cdecl -arch=i386,x86_64,arm __CxxExceptionFilter(ptr ptr long ptr) @ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) @ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler @ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler @@ -1525,9 +1525,9 @@ @ cdecl _wcsupr_s_l(wstr long ptr) MSVCRT__wcsupr_s_l @ cdecl _wcsxfrm_l(ptr wstr long ptr) MSVCRT__wcsxfrm_l @ cdecl _wctime32(ptr) MSVCRT__wctime32 -@ stub _wctime32_s +@ cdecl _wctime32_s(ptr long ptr) MSVCRT__wctime32_s @ cdecl _wctime64(ptr) MSVCRT__wctime64 -@ stub _wctime64_s +@ cdecl _wctime64_s(ptr long ptr) MSVCRT__wctime64_s @ cdecl _wctomb_l(ptr long ptr) MSVCRT__wctomb_l @ cdecl _wctomb_s_l(ptr ptr long long ptr) MSVCRT__wctomb_s_l # extern _wctype diff -Nru wine1.7-1.7.50/dlls/msvcr110/msvcr110.spec wine1.7-1.7.55/dlls/msvcr110/msvcr110.spec --- wine1.7-1.7.50/dlls/msvcr110/msvcr110.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcr110/msvcr110.spec 2015-11-13 14:32:40.000000000 +0000 @@ -875,7 +875,7 @@ @ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler @ cdecl -arch=i386,x86_64,arm __CppXcptFilter(long ptr) @ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) -@ stub __CxxExceptionFilter +@ cdecl -arch=i386,x86_64,arm __CxxExceptionFilter(ptr ptr long ptr) @ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) @ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler @ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler @@ -1884,9 +1884,9 @@ @ cdecl _wcsupr_s_l(wstr long ptr) MSVCRT__wcsupr_s_l @ cdecl _wcsxfrm_l(ptr wstr long ptr) MSVCRT__wcsxfrm_l @ cdecl _wctime32(ptr) MSVCRT__wctime32 -@ stub _wctime32_s +@ cdecl _wctime32_s(ptr long ptr) MSVCRT__wctime32_s @ cdecl _wctime64(ptr) MSVCRT__wctime64 -@ stub _wctime64_s +@ cdecl _wctime64_s(ptr long ptr) MSVCRT__wctime64_s @ cdecl _wctomb_l(ptr long ptr) MSVCRT__wctomb_l @ cdecl _wctomb_s_l(ptr ptr long long ptr) MSVCRT__wctomb_s_l # extern _wctype diff -Nru wine1.7-1.7.50/dlls/msvcr120/msvcr120.spec wine1.7-1.7.55/dlls/msvcr120/msvcr120.spec --- wine1.7-1.7.50/dlls/msvcr120/msvcr120.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcr120/msvcr120.spec 2015-11-13 14:32:40.000000000 +0000 @@ -291,6 +291,7 @@ @ stub -arch=i386 ??1_SpinLock@details@Concurrency@@QAE@XZ @ stub -arch=win64 ??1_SpinLock@details@Concurrency@@QEAA@XZ @ stub -arch=i386 ??1_StructuredTaskCollection@details@Concurrency@@QAE@XZ +@ stub -arch=win64 ??1_StructuredTaskCollection@details@Concurrency@@QEAA@XZ @ stub -arch=arm ??1_TaskCollection@details@Concurrency@@QAA@XZ @ stub -arch=i386 ??1_TaskCollection@details@Concurrency@@QAE@XZ @ stub -arch=win64 ??1_TaskCollection@details@Concurrency@@QEAA@XZ @@ -398,7 +399,8 @@ @ stub -arch=win32 ?Alloc@Concurrency@@YAPAXI@Z @ stub -arch=win64 ?Alloc@Concurrency@@YAPEAX_K@Z @ stub ?Block@Context@Concurrency@@SAXXZ -@ stub ?CaptureCallstack@platform@details@Concurrency@@YAIPAPAXII@Z +@ stub -arch=win32 ?CaptureCallstack@platform@details@Concurrency@@YAIPAPAXII@Z +@ stub -arch=win64 ?CaptureCallstack@platform@details@Concurrency@@YA_KPEAPEAX_K1@Z @ stub -arch=win32 ?Create@CurrentScheduler@Concurrency@@SAXABVSchedulerPolicy@2@@Z @ stub -arch=win64 ?Create@CurrentScheduler@Concurrency@@SAXAEBVSchedulerPolicy@2@@Z @ stub -arch=win32 ?Create@Scheduler@Concurrency@@SAPAV12@ABVSchedulerPolicy@2@@Z @@ -857,7 +859,7 @@ @ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler @ cdecl -arch=i386,x86_64,arm __CppXcptFilter(long ptr) @ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) -@ stub __CxxExceptionFilter +@ cdecl -arch=i386,x86_64,arm __CxxExceptionFilter(ptr ptr long ptr) @ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) @ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler @ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler @@ -1637,6 +1639,7 @@ @ stdcall -arch=i386 _seh_longjmp_unwind4(ptr) @ stdcall -arch=i386 _seh_longjmp_unwind(ptr) @ cdecl -arch=i386 _set_SSE2_enable(long) MSVCRT__set_SSE2_enable +@ stub -arch=win64 _set_FMA3_enable @ cdecl _set_abort_behavior(long long) MSVCRT__set_abort_behavior @ cdecl _set_controlfp(long long) @ cdecl _set_doserrno(long) @@ -1905,9 +1908,9 @@ @ cdecl _wcsupr_s_l(wstr long ptr) MSVCRT__wcsupr_s_l @ cdecl _wcsxfrm_l(ptr wstr long ptr) MSVCRT__wcsxfrm_l @ cdecl _wctime32(ptr) MSVCRT__wctime32 -@ stub _wctime32_s +@ cdecl _wctime32_s(ptr long ptr) MSVCRT__wctime32_s @ cdecl _wctime64(ptr) MSVCRT__wctime64 -@ stub _wctime64_s +@ cdecl _wctime64_s(ptr long ptr) MSVCRT__wctime64_s @ cdecl _wctomb_l(ptr long ptr) MSVCRT__wctomb_l @ cdecl _wctomb_s_l(ptr ptr long long ptr) MSVCRT__wctomb_s_l # extern _wctype @@ -2167,9 +2170,9 @@ @ cdecl fmax(double double) MSVCR120_fmax @ cdecl fmaxf(float float) MSVCR120_fmaxf @ cdecl fmaxl(double double) MSVCR120_fmax -@ stub fmin -@ stub fminf -@ stub fminl +@ cdecl fmin(double double) MSVCR120_fmin +@ cdecl fminf(float float) MSVCR120_fminf +@ cdecl fminl(double double) MSVCR120_fmin @ cdecl fmod(double double) MSVCRT_fmod @ cdecl -arch=arm,x86_64 fmodf(float float) MSVCRT_fmodf @ cdecl fopen(str str) MSVCRT_fopen diff -Nru wine1.7-1.7.50/dlls/msvcr120_app/msvcr120_app.spec wine1.7-1.7.55/dlls/msvcr120_app/msvcr120_app.spec --- wine1.7-1.7.50/dlls/msvcr120_app/msvcr120_app.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcr120_app/msvcr120_app.spec 2015-11-13 14:32:40.000000000 +0000 @@ -853,7 +853,7 @@ @ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) msvcr120.__C_specific_handler @ cdecl -arch=i386,x86_64,arm __CppXcptFilter(long ptr) msvcr120.__CppXcptFilter @ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) msvcr120.__CxxDetectRethrow -@ stub __CxxExceptionFilter +@ cdecl -arch=i386,x86_64,arm __CxxExceptionFilter(ptr ptr long ptr) msvcr120.__CxxExceptionFilter @ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) msvcr120.__CxxFrameHandler @ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler2(ptr ptr ptr ptr) msvcr120.__CxxFrameHandler2 @ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler3(ptr ptr ptr ptr) msvcr120.__CxxFrameHandler3 @@ -1601,9 +1601,9 @@ @ cdecl _wcsupr_s_l(wstr long ptr) msvcr120._wcsupr_s_l @ cdecl _wcsxfrm_l(ptr wstr long ptr) msvcr120._wcsxfrm_l @ cdecl _wctime32(ptr) msvcr120._wctime32 -@ stub _wctime32_s +@ cdecl _wctime32_s(ptr long ptr) msvcr120._wctime32_s @ cdecl _wctime64(ptr) msvcr120._wctime64 -@ stub _wctime64_s +@ cdecl _wctime64_s(ptr long ptr) msvcr120._wctime64_s @ cdecl _wctomb_l(ptr long ptr) msvcr120._wctomb_l @ cdecl _wctomb_s_l(ptr ptr long long ptr) msvcr120._wctomb_s_l # extern _wctype @@ -1836,9 +1836,9 @@ @ cdecl fmax(double double) msvcr120.fmax @ cdecl fmaxf(float float) msvcr120.fmaxf @ cdecl fmaxl(double double) msvcr120.fmaxl -@ stub fmin -@ stub fminf -@ stub fminl +@ cdecl fmin(double double) msvcr120.fmin +@ cdecl fminf(float float) msvcr120.fminf +@ cdecl fminl(double double) msvcr120.fminl @ cdecl fmod(double double) msvcr120.fmod @ cdecl -arch=arm,x86_64 fmodf(float float) msvcr120.fmodf @ cdecl fopen(str str) msvcr120.fopen diff -Nru wine1.7-1.7.50/dlls/msvcr70/msvcr70.spec wine1.7-1.7.55/dlls/msvcr70/msvcr70.spec --- wine1.7-1.7.50/dlls/msvcr70/msvcr70.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcr70/msvcr70.spec 2015-11-13 14:32:40.000000000 +0000 @@ -119,7 +119,7 @@ @ stub __CxxCallUnwindDtor @ stub __CxxCallUnwindVecDtor @ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) -@ stub __CxxExceptionFilter +@ cdecl -arch=i386,x86_64,arm __CxxExceptionFilter(ptr ptr long ptr) @ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) @ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) @ cdecl -arch=i386,x86_64,arm __CxxQueryExceptionSize() diff -Nru wine1.7-1.7.50/dlls/msvcr71/msvcr71.spec wine1.7-1.7.55/dlls/msvcr71/msvcr71.spec --- wine1.7-1.7.50/dlls/msvcr71/msvcr71.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcr71/msvcr71.spec 2015-11-13 14:32:40.000000000 +0000 @@ -114,7 +114,7 @@ @ stub __CxxCallUnwindDtor @ stub __CxxCallUnwindVecDtor @ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) -@ stub __CxxExceptionFilter +@ cdecl -arch=i386,x86_64,arm __CxxExceptionFilter(ptr ptr long ptr) @ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) @ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) @ cdecl -arch=i386,x86_64,arm __CxxQueryExceptionSize() diff -Nru wine1.7-1.7.50/dlls/msvcr80/msvcr80.spec wine1.7-1.7.55/dlls/msvcr80/msvcr80.spec --- wine1.7-1.7.50/dlls/msvcr80/msvcr80.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcr80/msvcr80.spec 2015-11-13 14:32:40.000000000 +0000 @@ -182,7 +182,7 @@ @ stub __CxxCallUnwindStdDelDtor @ stub __CxxCallUnwindVecDtor @ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) -@ stub __CxxExceptionFilter +@ cdecl -arch=i386,x86_64,arm __CxxExceptionFilter(ptr ptr long ptr) @ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) @ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler @ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler @@ -1205,9 +1205,9 @@ @ cdecl _wcsupr_s_l(wstr long ptr) MSVCRT__wcsupr_s_l @ cdecl _wcsxfrm_l(ptr wstr long ptr) MSVCRT__wcsxfrm_l @ cdecl _wctime32(ptr) MSVCRT__wctime32 -@ stub _wctime32_s +@ cdecl _wctime32_s(ptr long ptr) MSVCRT__wctime32_s @ cdecl _wctime64(ptr) MSVCRT__wctime64 -@ stub _wctime64_s +@ cdecl _wctime64_s(ptr long ptr) MSVCRT__wctime64_s @ cdecl _wctomb_l(ptr long ptr) MSVCRT__wctomb_l @ cdecl _wctomb_s_l(ptr ptr long long ptr) MSVCRT__wctomb_s_l # extern _wctype diff -Nru wine1.7-1.7.50/dlls/msvcr90/msvcr90.spec wine1.7-1.7.55/dlls/msvcr90/msvcr90.spec --- wine1.7-1.7.50/dlls/msvcr90/msvcr90.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcr90/msvcr90.spec 2015-11-13 14:32:40.000000000 +0000 @@ -173,7 +173,7 @@ @ stub __CxxCallUnwindStdDelDtor @ stub __CxxCallUnwindVecDtor @ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) -@ stub __CxxExceptionFilter +@ cdecl -arch=i386,x86_64,arm __CxxExceptionFilter(ptr ptr long ptr) @ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) @ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler @ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler @@ -1180,9 +1180,9 @@ @ cdecl _wcsupr_s_l(wstr long ptr) MSVCRT__wcsupr_s_l @ cdecl _wcsxfrm_l(ptr wstr long ptr) MSVCRT__wcsxfrm_l @ cdecl _wctime32(ptr) MSVCRT__wctime32 -@ stub _wctime32_s +@ cdecl _wctime32_s(ptr long ptr) MSVCRT__wctime32_s @ cdecl _wctime64(ptr) MSVCRT__wctime64 -@ stub _wctime64_s +@ cdecl _wctime64_s(ptr long ptr) MSVCRT__wctime64_s @ cdecl _wctomb_l(ptr long ptr) MSVCRT__wctomb_l @ cdecl _wctomb_s_l(ptr ptr long long ptr) MSVCRT__wctomb_s_l # extern _wctype diff -Nru wine1.7-1.7.50/dlls/msvcrt/console.c wine1.7-1.7.55/dlls/msvcrt/console.c --- wine1.7-1.7.50/dlls/msvcrt/console.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcrt/console.c 2015-11-13 14:32:40.000000000 +0000 @@ -519,7 +519,7 @@ */ int CDECL _vcprintf(const char* format, __ms_va_list valist) { - return pf_printf_a(puts_clbk_console_a, NULL, format, NULL, FALSE, FALSE, arg_clbk_valist, NULL, &valist); + return pf_printf_a(puts_clbk_console_a, NULL, format, NULL, 0, arg_clbk_valist, NULL, &valist); } /********************************************************************* @@ -543,7 +543,7 @@ */ int CDECL _vcwprintf(const MSVCRT_wchar_t* format, __ms_va_list valist) { - return pf_printf_w(puts_clbk_console_w, NULL, format, NULL, FALSE, FALSE, arg_clbk_valist, NULL, &valist); + return pf_printf_w(puts_clbk_console_w, NULL, format, NULL, 0, arg_clbk_valist, NULL, &valist); } /********************************************************************* diff -Nru wine1.7-1.7.50/dlls/msvcrt/cpp.c wine1.7-1.7.55/dlls/msvcrt/cpp.c --- wine1.7-1.7.50/dlls/msvcrt/cpp.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcrt/cpp.c 2015-11-13 14:32:40.000000000 +0000 @@ -575,6 +575,16 @@ } /****************************************************************** + * __std_type_info_compare (MSVCRT.@) + */ +int CDECL MSVCRT_type_info_compare(type_info * _this, const type_info * rhs) +{ + int ret = strcmp(_this->mangled + 1, rhs->mangled + 1); + TRACE("(%p %p) returning %d\n", _this, rhs, ret); + return ret; +} + +/****************************************************************** * ??1type_info@@UAE@XZ (MSVCRT.@) */ DEFINE_THISCALL_WRAPPER(MSVCRT_type_info_dtor,4) diff -Nru wine1.7-1.7.50/dlls/msvcrt/data.c wine1.7-1.7.55/dlls/msvcrt/data.c --- wine1.7-1.7.50/dlls/msvcrt/data.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcrt/data.c 2015-11-13 14:32:40.000000000 +0000 @@ -640,3 +640,29 @@ TRACE("(%d) %s application\n", app_type, app_type == 2 ? "Gui" : "Console"); MSVCRT_app_type = app_type; } + +/********************************************************************* + * _get_initial_narrow_environment (UCRTBASE.@) + */ +char** CDECL _get_initial_narrow_environment(void) +{ + return MSVCRT___argv; +} + +/********************************************************************* + * _configure_narrow_argv (UCRTBASE.@) + */ +int CDECL _configure_narrow_argv(int mode) +{ + TRACE("(%d)\n", mode); + return 0; +} + +/********************************************************************* + * _initialize_narrow_environment (UCRTBASE.@) + */ +int CDECL _initialize_narrow_environment(void) +{ + TRACE("\n"); + return 0; +} diff -Nru wine1.7-1.7.50/dlls/msvcrt/except_arm.c wine1.7-1.7.55/dlls/msvcrt/except_arm.c --- wine1.7-1.7.50/dlls/msvcrt/except_arm.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcrt/except_arm.c 2015-11-13 14:32:40.000000000 +0000 @@ -64,6 +64,15 @@ DWORD VirtualVfpHead; } DISPATCHER_CONTEXT; +/********************************************************************* + * __CxxExceptionFilter (MSVCRT.@) + */ +int CDECL __CxxExceptionFilter( PEXCEPTION_POINTERS ptrs, + const type_info *ti, int flags, void **copy ) +{ + FIXME( "%p %p %x %p: not implemented\n", ptrs, ti, flags, copy ); + return EXCEPTION_CONTINUE_SEARCH; +} /********************************************************************* * __CxxFrameHandler (MSVCRT.@) diff -Nru wine1.7-1.7.50/dlls/msvcrt/except_i386.c wine1.7-1.7.55/dlls/msvcrt/except_i386.c --- wine1.7-1.7.50/dlls/msvcrt/except_i386.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcrt/except_i386.c 2015-11-13 14:32:40.000000000 +0000 @@ -266,7 +266,7 @@ /* 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, - const catchblock_info *catchblock ) + const type_info *catch_ti, UINT catch_flags ) { UINT i; @@ -274,16 +274,16 @@ { const cxx_type_info *type = exc_type->type_info_table->info[i]; - if (!catchblock->type_info) return type; /* catch(...) matches any type */ - if (catchblock->type_info != type->type_info) + if (!catch_ti) return type; /* catch(...) matches any type */ + if (catch_ti != type->type_info) { - if (strcmp( catchblock->type_info->mangled, type->type_info->mangled )) continue; + if (strcmp( catch_ti->mangled, type->type_info->mangled )) continue; } /* type is the same, now check the flags */ if ((exc_type->flags & TYPE_FLAG_CONST) && - !(catchblock->flags & TYPE_FLAG_CONST)) continue; + !(catch_flags & TYPE_FLAG_CONST)) continue; if ((exc_type->flags & TYPE_FLAG_VOLATILE) && - !(catchblock->flags & TYPE_FLAG_VOLATILE)) continue; + !(catch_flags & TYPE_FLAG_VOLATILE)) continue; return type; /* it matched */ } return NULL; @@ -442,7 +442,8 @@ const catchblock_info *catchblock = &tryblock->catchblock[j]; if(info) { - const cxx_type_info *type = find_caught_type( info, catchblock ); + const cxx_type_info *type = find_caught_type( info, + catchblock->type_info, catchblock->flags ); if (!type) continue; TRACE( "matched type %p in tryblock %d catchblock %d\n", type, i, j ); @@ -491,6 +492,62 @@ } } +/********************************************************************* + * __CxxExceptionFilter (MSVCRT.@) + */ +int CDECL __CxxExceptionFilter( PEXCEPTION_POINTERS ptrs, + const type_info *ti, int flags, void **copy) +{ + const cxx_type_info *type; + PEXCEPTION_RECORD rec; + + TRACE( "%p %p %x %p\n", ptrs, ti, flags, copy ); + + if (!ptrs) return EXCEPTION_CONTINUE_SEARCH; + + /* handle catch(...) */ + if (!ti) return EXCEPTION_EXECUTE_HANDLER; + + rec = ptrs->ExceptionRecord; + if (rec->ExceptionCode != CXX_EXCEPTION || rec->NumberParameters != 3 || + rec->ExceptionInformation[0] < CXX_FRAME_MAGIC_VC6 || + rec->ExceptionInformation[0] > CXX_FRAME_MAGIC_VC8) + return EXCEPTION_CONTINUE_SEARCH; + + if (rec->ExceptionInformation[1] == 0 && rec->ExceptionInformation[2] == 0) + { + rec = msvcrt_get_thread_data()->exc_record; + if (!rec) return EXCEPTION_CONTINUE_SEARCH; + } + + type = find_caught_type( (cxx_exception_type*)rec->ExceptionInformation[2], ti, flags ); + if (!type) return EXCEPTION_CONTINUE_SEARCH; + + if (copy) + { + void *object = (void *)rec->ExceptionInformation[1]; + + if (flags & TYPE_FLAG_REFERENCE) + { + *copy = get_this_pointer( &type->offsets, object ); + } + else if (type->flags & CLASS_IS_SIMPLE_TYPE) + { + memmove( copy, object, type->size ); + /* if it is a pointer, adjust it */ + if (type->size == sizeof(void*)) *copy = get_this_pointer( &type->offsets, *copy ); + } + else /* copy the object */ + { + if (type->copy_ctor) + call_copy_ctor( type->copy_ctor, copy, get_this_pointer(&type->offsets,object), + (type->flags & CLASS_HAS_VIRTUAL_BASE_CLASS) ); + else + memmove( copy, get_this_pointer(&type->offsets,object), type->size ); + } + } + return EXCEPTION_EXECUTE_HANDLER; +} /********************************************************************* * cxx_frame_handler @@ -1070,7 +1127,7 @@ */ void __stdcall _seh_longjmp_unwind4(struct MSVCRT___JUMP_BUFFER *jmp) { - msvcrt_local_unwind4( (void *)jmp->Cookie, (MSVCRT_EXCEPTION_FRAME *)jmp->Registration, + msvcrt_local_unwind4( (ULONG *)&jmp->Cookie, (MSVCRT_EXCEPTION_FRAME *)jmp->Registration, jmp->TryLevel, (void *)jmp->Ebp ); } diff -Nru wine1.7-1.7.50/dlls/msvcrt/except_x86_64.c wine1.7-1.7.55/dlls/msvcrt/except_x86_64.c --- wine1.7-1.7.50/dlls/msvcrt/except_x86_64.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcrt/except_x86_64.c 2015-11-13 14:32:40.000000000 +0000 @@ -61,6 +61,15 @@ ULONG ScopeIndex; } DISPATCHER_CONTEXT; +/********************************************************************* + * __CxxExceptionFilter (MSVCRT.@) + */ +int CDECL __CxxExceptionFilter( PEXCEPTION_POINTERS ptrs, + const type_info *ti, int flags, void **copy ) +{ + FIXME( "%p %p %x %p: not implemented\n", ptrs, ti, flags, copy ); + return EXCEPTION_CONTINUE_SEARCH; +} /********************************************************************* * __CxxFrameHandler (MSVCRT.@) diff -Nru wine1.7-1.7.50/dlls/msvcrt/exit.c wine1.7-1.7.55/dlls/msvcrt/exit.c --- wine1.7-1.7.50/dlls/msvcrt/exit.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcrt/exit.c 2015-11-13 14:32:40.000000000 +0000 @@ -326,6 +326,15 @@ } /********************************************************************* + * _crt_atexit (UCRTBASE.@) + */ +int CDECL MSVCRT__crt_atexit(void (*func)(void)) +{ + TRACE("(%p)\n", func); + return MSVCRT__onexit((MSVCRT__onexit_t)func) == (MSVCRT__onexit_t)func ? 0 : -1; +} + +/********************************************************************* * _set_purecall_handler (MSVCR71.@) */ MSVCRT_purecall_handler CDECL _set_purecall_handler(MSVCRT_purecall_handler function) diff -Nru wine1.7-1.7.50/dlls/msvcrt/file.c wine1.7-1.7.55/dlls/msvcrt/file.c --- wine1.7-1.7.50/dlls/msvcrt/file.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcrt/file.c 2015-11-13 14:32:40.000000000 +0000 @@ -758,6 +758,14 @@ } /********************************************************************* + * __acrt_iob_func(MSVCRT.@) + */ +MSVCRT_FILE * CDECL MSVCRT___acrt_iob_func(unsigned idx) +{ + return &MSVCRT__iob[idx]; +} + +/********************************************************************* * _access (MSVCRT.@) */ int CDECL MSVCRT__access(const char *filename, int mode) @@ -4913,7 +4921,7 @@ MSVCRT__lock_file(file); tmp_buf = add_std_buffer(file); - ret = pf_printf_a(puts_clbk_file_a, file, format, NULL, FALSE, FALSE, arg_clbk_valist, NULL, &valist); + ret = pf_printf_a(puts_clbk_file_a, file, format, NULL, 0, arg_clbk_valist, NULL, &valist); if(tmp_buf) remove_std_buffer(file); MSVCRT__unlock_file(file); @@ -4932,7 +4940,8 @@ MSVCRT__lock_file(file); tmp_buf = add_std_buffer(file); - ret = pf_printf_a(puts_clbk_file_a, file, format, NULL, FALSE, TRUE, arg_clbk_valist, NULL, &valist); + ret = pf_printf_a(puts_clbk_file_a, file, format, NULL, + MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER, arg_clbk_valist, NULL, &valist); if(tmp_buf) remove_std_buffer(file); MSVCRT__unlock_file(file); @@ -4949,7 +4958,7 @@ MSVCRT__lock_file(file); tmp_buf = add_std_buffer(file); - ret = pf_printf_w(puts_clbk_file_w, file, format, NULL, FALSE, FALSE, arg_clbk_valist, NULL, &valist); + ret = pf_printf_w(puts_clbk_file_w, file, format, NULL, 0, arg_clbk_valist, NULL, &valist); if(tmp_buf) remove_std_buffer(file); MSVCRT__unlock_file(file); @@ -4968,7 +4977,32 @@ MSVCRT__lock_file(file); tmp_buf = add_std_buffer(file); - ret = pf_printf_w(puts_clbk_file_w, file, format, NULL, FALSE, TRUE, arg_clbk_valist, NULL, &valist); + ret = pf_printf_w(puts_clbk_file_w, file, format, NULL, + MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER, arg_clbk_valist, NULL, &valist); + if(tmp_buf) remove_std_buffer(file); + MSVCRT__unlock_file(file); + + return ret; +} + +/********************************************************************* + * __stdio_common_vfprintf (MSVCRT.@) + */ +int CDECL MSVCRT__stdio_common_vfprintf(unsigned __int64 options, MSVCRT_FILE *file, const char *format, + MSVCRT__locale_t locale, __ms_va_list valist) +{ + BOOL tmp_buf; + int ret; + + if (!MSVCRT_CHECK_PMT( file != NULL )) return -1; + + MSVCRT__lock_file(file); + tmp_buf = add_std_buffer(file); + + if (options & ~UCRTBASE_PRINTF_MASK) + FIXME("options %s not handled\n", wine_dbgstr_longlong(options)); + ret = pf_printf_a(puts_clbk_file_a, file, format, locale, + options & UCRTBASE_PRINTF_MASK, arg_clbk_valist, NULL, &valist); if(tmp_buf) remove_std_buffer(file); MSVCRT__unlock_file(file); @@ -4988,7 +5022,7 @@ MSVCRT__lock_file(file); tmp_buf = add_std_buffer(file); - ret = pf_printf_w(puts_clbk_file_w, file, format, locale, FALSE, FALSE, arg_clbk_valist, NULL, &valist); + ret = pf_printf_w(puts_clbk_file_w, file, format, locale, 0, arg_clbk_valist, NULL, &valist); if(tmp_buf) remove_std_buffer(file); MSVCRT__unlock_file(file); @@ -5269,3 +5303,18 @@ MSVCRT_max_streams = newmax; return MSVCRT_max_streams; } + +/********************************************************************* + * _get_stream_buffer_pointers (UCRTBASE.@) + */ +int CDECL MSVCRT__get_stream_buffer_pointers(MSVCRT_FILE *file, char*** base, + char*** ptr, int** count) +{ + if (base) + *base = &file->_base; + if (ptr) + *ptr = &file->_ptr; + if (count) + *count = &file->_cnt; + return 0; +} diff -Nru wine1.7-1.7.50/dlls/msvcrt/heap.c wine1.7-1.7.55/dlls/msvcrt/heap.c --- wine1.7-1.7.50/dlls/msvcrt/heap.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcrt/heap.c 2015-11-13 14:32:40.000000000 +0000 @@ -131,6 +131,7 @@ { void *retval; int freed; + MSVCRT_new_handler_func handler; do { @@ -141,12 +142,11 @@ return retval; } - LOCK_HEAP; - if(MSVCRT_new_handler) - freed = (*MSVCRT_new_handler)(size); + handler = MSVCRT_new_handler; + if(handler) + freed = (*handler)(size); else freed = 0; - UNLOCK_HEAP; } while(freed); TRACE("(%ld) out of memory\n", size); @@ -234,9 +234,11 @@ */ int CDECL _callnewh(MSVCRT_size_t size) { - if(MSVCRT_new_handler) - (*MSVCRT_new_handler)(size); - return 0; + int ret = 0; + MSVCRT_new_handler_func handler = MSVCRT_new_handler; + if(handler) + ret = (*handler)(size) ? 1 : 0; + return ret; } /********************************************************************* diff -Nru wine1.7-1.7.50/dlls/msvcrt/locale.c wine1.7-1.7.55/dlls/msvcrt/locale.c --- wine1.7-1.7.50/dlls/msvcrt/locale.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcrt/locale.c 2015-11-13 14:32:40.000000000 +0000 @@ -310,7 +310,7 @@ /* INTERNAL: Set lc_handle, lc_id and lc_category in threadlocinfo struct */ static BOOL update_threadlocinfo_category(LCID lcid, unsigned short cp, - MSVCRT__locale_t loc, int category) + MSVCRT_pthreadlocinfo locinfo, int category) { char buf[256], *p; int len; @@ -318,25 +318,25 @@ if(GetLocaleInfoA(lcid, LOCALE_ILANGUAGE|LOCALE_NOUSEROVERRIDE, buf, 256)) { p = buf; - loc->locinfo->lc_id[category].wLanguage = 0; + locinfo->lc_id[category].wLanguage = 0; while(*p) { - loc->locinfo->lc_id[category].wLanguage *= 16; + locinfo->lc_id[category].wLanguage *= 16; if(*p <= '9') - loc->locinfo->lc_id[category].wLanguage += *p-'0'; + locinfo->lc_id[category].wLanguage += *p-'0'; else - loc->locinfo->lc_id[category].wLanguage += *p-'a'+10; + locinfo->lc_id[category].wLanguage += *p-'a'+10; p++; } - loc->locinfo->lc_id[category].wCountry = - loc->locinfo->lc_id[category].wLanguage; + locinfo->lc_id[category].wCountry = + locinfo->lc_id[category].wLanguage; } - loc->locinfo->lc_id[category].wCodePage = cp; + locinfo->lc_id[category].wCodePage = cp; - loc->locinfo->lc_handle[category] = lcid; + locinfo->lc_handle[category] = lcid; len = 0; len += GetLocaleInfoA(lcid, LOCALE_SENGLANGUAGE @@ -348,18 +348,18 @@ sprintf(buf+len, "%d", cp); len += strlen(buf+len)+1; - loc->locinfo->lc_category[category].locale = MSVCRT_malloc(len); - loc->locinfo->lc_category[category].refcount = MSVCRT_malloc(sizeof(int)); - if(!loc->locinfo->lc_category[category].locale - || !loc->locinfo->lc_category[category].refcount) { - MSVCRT_free(loc->locinfo->lc_category[category].locale); - MSVCRT_free(loc->locinfo->lc_category[category].refcount); - loc->locinfo->lc_category[category].locale = NULL; - loc->locinfo->lc_category[category].refcount = NULL; + locinfo->lc_category[category].locale = MSVCRT_malloc(len); + locinfo->lc_category[category].refcount = MSVCRT_malloc(sizeof(int)); + if(!locinfo->lc_category[category].locale + || !locinfo->lc_category[category].refcount) { + MSVCRT_free(locinfo->lc_category[category].locale); + MSVCRT_free(locinfo->lc_category[category].refcount); + locinfo->lc_category[category].locale = NULL; + locinfo->lc_category[category].refcount = NULL; return TRUE; } - memcpy(loc->locinfo->lc_category[category].locale, buf, len); - *loc->locinfo->lc_category[category].refcount = 1; + memcpy(locinfo->lc_category[category].locale, buf, len); + *locinfo->lc_category[category].refcount = 1; return FALSE; } @@ -830,9 +830,9 @@ } #if _MSVCR_VER >= 110 -static inline BOOL set_lc_locale_name(MSVCRT__locale_t loc, int cat) +static inline BOOL set_lc_locale_name(MSVCRT_pthreadlocinfo locinfo, int cat) { - LCID lcid = loc->locinfo->lc_handle[cat]; + LCID lcid = locinfo->lc_handle[cat]; WCHAR buf[100]; int len; @@ -843,23 +843,29 @@ if(LocaleNameToLCID(buf, 0) != lcid) len = LCIDToLocaleName(lcid, buf, 100, 0); - if(!len || !(loc->locinfo->lc_name[cat] = MSVCRT_malloc(len*sizeof(MSVCRT_wchar_t)))) + if(!len || !(locinfo->lc_name[cat] = MSVCRT_malloc(len*sizeof(MSVCRT_wchar_t)))) return FALSE; - memcpy(loc->locinfo->lc_name[cat], buf, len*sizeof(MSVCRT_wchar_t)); + memcpy(locinfo->lc_name[cat], buf, len*sizeof(MSVCRT_wchar_t)); return TRUE; } #else -static inline BOOL set_lc_locale_name(MSVCRT__locale_t loc, int cat) +static inline BOOL set_lc_locale_name(MSVCRT_pthreadlocinfo locinfo, int cat) { return TRUE; } #endif -/********************************************************************* - * _create_locale (MSVCRT.@) - */ -MSVCRT__locale_t CDECL MSVCRT__create_locale(int category, const char *locale) +static inline BOOL category_needs_update(int cat, int user_cat, + MSVCRT_pthreadlocinfo locinfo, LCID lcid, unsigned short cp) +{ + if(!locinfo) return TRUE; + if(user_cat!=cat && user_cat!=MSVCRT_LC_ALL) return FALSE; + return lcid!=locinfo->lc_handle[cat] || cp!=locinfo->lc_id[cat].wCodePage; +} + +static MSVCRT_pthreadlocinfo create_locinfo(int category, + const char *locale, MSVCRT_pthreadlocinfo old_locinfo) { static const DWORD time_data[] = { LOCALE_SABBREVDAYNAME7, LOCALE_SABBREVDAYNAME1, LOCALE_SABBREVDAYNAME2, @@ -890,7 +896,7 @@ static const char cloc_time[] = "HH:mm:ss"; static const MSVCRT_wchar_t cloc_timeW[] = {'H','H',':','m','m',':','s','s',0}; - MSVCRT__locale_t loc; + MSVCRT_pthreadlocinfo locinfo; LCID lcid[6] = { 0 }, lcid_tmp; unsigned short cp[6] = { 0 }; char buf[256]; @@ -970,181 +976,184 @@ } } - loc = MSVCRT_malloc(sizeof(MSVCRT__locale_tstruct)); - if(!loc) + locinfo = MSVCRT_malloc(sizeof(MSVCRT_threadlocinfo)); + if(!locinfo) return NULL; - loc->locinfo = MSVCRT_malloc(sizeof(MSVCRT_threadlocinfo)); - if(!loc->locinfo) { - MSVCRT_free(loc); - return NULL; - } + memset(locinfo, 0, sizeof(MSVCRT_threadlocinfo)); + locinfo->refcount = 1; - loc->mbcinfo = MSVCRT_malloc(sizeof(MSVCRT_threadmbcinfo)); - if(!loc->mbcinfo) { - MSVCRT_free(loc->locinfo); - MSVCRT_free(loc); + locinfo->lconv = MSVCRT_malloc(sizeof(struct MSVCRT_lconv)); + if(!locinfo->lconv) { + free_locinfo(locinfo); return NULL; } + memset(locinfo->lconv, 0, sizeof(struct MSVCRT_lconv)); - memset(loc->locinfo, 0, sizeof(MSVCRT_threadlocinfo)); - loc->locinfo->refcount = 1; - loc->mbcinfo->refcount = 1; - - loc->locinfo->lconv = MSVCRT_malloc(sizeof(struct MSVCRT_lconv)); - if(!loc->locinfo->lconv) { - MSVCRT__free_locale(loc); + locinfo->pclmap = MSVCRT_malloc(sizeof(char[256])); + locinfo->pcumap = MSVCRT_malloc(sizeof(char[256])); + if(!locinfo->pclmap || !locinfo->pcumap) { + free_locinfo(locinfo); return NULL; } - memset(loc->locinfo->lconv, 0, sizeof(struct MSVCRT_lconv)); - loc->locinfo->pclmap = MSVCRT_malloc(sizeof(char[256])); - loc->locinfo->pcumap = MSVCRT_malloc(sizeof(char[256])); - if(!loc->locinfo->pclmap || !loc->locinfo->pcumap) { - MSVCRT__free_locale(loc); - return NULL; - } - - if(lcid[MSVCRT_LC_COLLATE] && (category==MSVCRT_LC_ALL || category==MSVCRT_LC_COLLATE)) { - if(update_threadlocinfo_category(lcid[MSVCRT_LC_COLLATE], cp[MSVCRT_LC_COLLATE], loc, MSVCRT_LC_COLLATE)) { - MSVCRT__free_locale(loc); + if(!category_needs_update(MSVCRT_LC_COLLATE, category, old_locinfo, + lcid[MSVCRT_LC_COLLATE], cp[MSVCRT_LC_COLLATE])) { + locinfo->lc_handle[MSVCRT_LC_COLLATE] = old_locinfo->lc_handle[MSVCRT_LC_COLLATE]; + locinfo->lc_id[MSVCRT_LC_COLLATE].wCodePage = old_locinfo->lc_id[MSVCRT_LC_COLLATE].wCodePage; + } else if(lcid[MSVCRT_LC_COLLATE] && (category==MSVCRT_LC_ALL || category==MSVCRT_LC_COLLATE)) { + if(update_threadlocinfo_category(lcid[MSVCRT_LC_COLLATE], + cp[MSVCRT_LC_COLLATE], locinfo, MSVCRT_LC_COLLATE)) { + free_locinfo(locinfo); return NULL; } - loc->locinfo->lc_collate_cp = loc->locinfo->lc_id[MSVCRT_LC_COLLATE].wCodePage; + locinfo->lc_collate_cp = locinfo->lc_id[MSVCRT_LC_COLLATE].wCodePage; - if(!set_lc_locale_name(loc, MSVCRT_LC_COLLATE)) { - MSVCRT__free_locale(loc); + if(!set_lc_locale_name(locinfo, MSVCRT_LC_COLLATE)) { + free_locinfo(locinfo); return NULL; } } else - loc->locinfo->lc_category[MSVCRT_LC_COLLATE].locale = MSVCRT__strdup("C"); + locinfo->lc_category[MSVCRT_LC_COLLATE].locale = MSVCRT__strdup("C"); - if(lcid[MSVCRT_LC_CTYPE] && (category==MSVCRT_LC_ALL || category==MSVCRT_LC_CTYPE)) { + if(!category_needs_update(MSVCRT_LC_CTYPE, category, old_locinfo, + lcid[MSVCRT_LC_CTYPE], cp[MSVCRT_LC_CTYPE])) { + locinfo->lc_handle[MSVCRT_LC_CTYPE] = old_locinfo->lc_handle[MSVCRT_LC_CTYPE]; + locinfo->lc_id[MSVCRT_LC_CTYPE].wCodePage = old_locinfo->lc_id[MSVCRT_LC_CTYPE].wCodePage; + } else if(lcid[MSVCRT_LC_CTYPE] && (category==MSVCRT_LC_ALL || category==MSVCRT_LC_CTYPE)) { CPINFO cp_info; int j; - if(update_threadlocinfo_category(lcid[MSVCRT_LC_CTYPE], cp[MSVCRT_LC_CTYPE], loc, MSVCRT_LC_CTYPE)) { - MSVCRT__free_locale(loc); + if(update_threadlocinfo_category(lcid[MSVCRT_LC_CTYPE], + cp[MSVCRT_LC_CTYPE], locinfo, MSVCRT_LC_CTYPE)) { + free_locinfo(locinfo); return NULL; } - loc->locinfo->lc_codepage = loc->locinfo->lc_id[MSVCRT_LC_CTYPE].wCodePage; - loc->locinfo->lc_clike = 1; - if(!GetCPInfo(loc->locinfo->lc_codepage, &cp_info)) { - MSVCRT__free_locale(loc); + locinfo->lc_codepage = locinfo->lc_id[MSVCRT_LC_CTYPE].wCodePage; + locinfo->lc_clike = 1; + if(!GetCPInfo(locinfo->lc_codepage, &cp_info)) { + free_locinfo(locinfo); return NULL; } - loc->locinfo->mb_cur_max = cp_info.MaxCharSize; + locinfo->mb_cur_max = cp_info.MaxCharSize; - loc->locinfo->ctype1_refcount = MSVCRT_malloc(sizeof(int)); - loc->locinfo->ctype1 = MSVCRT_malloc(sizeof(short[257])); - if(!loc->locinfo->ctype1_refcount || !loc->locinfo->ctype1) { - MSVCRT__free_locale(loc); + locinfo->ctype1_refcount = MSVCRT_malloc(sizeof(int)); + locinfo->ctype1 = MSVCRT_malloc(sizeof(short[257])); + if(!locinfo->ctype1_refcount || !locinfo->ctype1) { + free_locinfo(locinfo); return NULL; } - *loc->locinfo->ctype1_refcount = 1; - loc->locinfo->ctype1[0] = 0; - loc->locinfo->pctype = loc->locinfo->ctype1+1; + *locinfo->ctype1_refcount = 1; + locinfo->ctype1[0] = 0; + locinfo->pctype = locinfo->ctype1+1; buf[1] = buf[2] = '\0'; for(i=1; i<257; i++) { buf[0] = i-1; /* builtin GetStringTypeA doesn't set output to 0 on invalid input */ - loc->locinfo->ctype1[i] = 0; + locinfo->ctype1[i] = 0; GetStringTypeA(lcid[MSVCRT_LC_CTYPE], CT_CTYPE1, buf, - 1, loc->locinfo->ctype1+i); + 1, locinfo->ctype1+i); } for(i=0; cp_info.LeadByte[i+1]!=0; i+=2) for(j=cp_info.LeadByte[i]; j<=cp_info.LeadByte[i+1]; j++) - loc->locinfo->ctype1[j+1] |= MSVCRT__LEADBYTE; + locinfo->ctype1[j+1] |= MSVCRT__LEADBYTE; - if(!set_lc_locale_name(loc, MSVCRT_LC_CTYPE)) { - MSVCRT__free_locale(loc); + if(!set_lc_locale_name(locinfo, MSVCRT_LC_CTYPE)) { + free_locinfo(locinfo); return NULL; } - } else { - loc->locinfo->lc_clike = 1; - loc->locinfo->mb_cur_max = 1; - loc->locinfo->pctype = MSVCRT__ctype+1; - loc->locinfo->lc_category[MSVCRT_LC_CTYPE].locale = MSVCRT__strdup("C"); - } - - for(i=0; i<256; i++) { - if(loc->locinfo->pctype[i] & MSVCRT__LEADBYTE) - buf[i] = ' '; - else - buf[i] = i; - } + for(i=0; i<256; i++) { + if(locinfo->pctype[i] & MSVCRT__LEADBYTE) + buf[i] = ' '; + else + buf[i] = i; + } - if(lcid[MSVCRT_LC_CTYPE]) { LCMapStringA(lcid[MSVCRT_LC_CTYPE], LCMAP_LOWERCASE, buf, 256, - (char*)loc->locinfo->pclmap, 256); + (char*)locinfo->pclmap, 256); LCMapStringA(lcid[MSVCRT_LC_CTYPE], LCMAP_UPPERCASE, buf, 256, - (char*)loc->locinfo->pcumap, 256); + (char*)locinfo->pcumap, 256); } else { + locinfo->lc_clike = 1; + locinfo->mb_cur_max = 1; + locinfo->pctype = MSVCRT__ctype+1; + locinfo->lc_category[MSVCRT_LC_CTYPE].locale = MSVCRT__strdup("C"); + for(i=0; i<256; i++) { - loc->locinfo->pclmap[i] = (i>='A' && i<='Z' ? i-'A'+'a' : i); - loc->locinfo->pcumap[i] = (i>='a' && i<='z' ? i-'a'+'A' : i); + if(locinfo->pctype[i] & MSVCRT__LEADBYTE) + buf[i] = ' '; + else + buf[i] = i; } - } - _setmbcp_l(loc->locinfo->lc_id[MSVCRT_LC_CTYPE].wCodePage, lcid[MSVCRT_LC_CTYPE], loc->mbcinfo); + for(i=0; i<256; i++) { + locinfo->pclmap[i] = (i>='A' && i<='Z' ? i-'A'+'a' : i); + locinfo->pcumap[i] = (i>='a' && i<='z' ? i-'a'+'A' : i); + } + } - if(lcid[MSVCRT_LC_MONETARY] && (category==MSVCRT_LC_ALL || category==MSVCRT_LC_MONETARY)) { - if(update_threadlocinfo_category(lcid[MSVCRT_LC_MONETARY], cp[MSVCRT_LC_MONETARY], loc, MSVCRT_LC_MONETARY)) { - MSVCRT__free_locale(loc); + if(!category_needs_update(MSVCRT_LC_MONETARY, category, old_locinfo, + lcid[MSVCRT_LC_MONETARY], cp[MSVCRT_LC_MONETARY])) { + locinfo->lc_handle[MSVCRT_LC_MONETARY] = old_locinfo->lc_handle[MSVCRT_LC_MONETARY]; + locinfo->lc_id[MSVCRT_LC_MONETARY].wCodePage = old_locinfo->lc_id[MSVCRT_LC_MONETARY].wCodePage; + } else if(lcid[MSVCRT_LC_MONETARY] && (category==MSVCRT_LC_ALL || category==MSVCRT_LC_MONETARY)) { + if(update_threadlocinfo_category(lcid[MSVCRT_LC_MONETARY], + cp[MSVCRT_LC_MONETARY], locinfo, MSVCRT_LC_MONETARY)) { + free_locinfo(locinfo); return NULL; } - loc->locinfo->lconv_intl_refcount = MSVCRT_malloc(sizeof(int)); - loc->locinfo->lconv_mon_refcount = MSVCRT_malloc(sizeof(int)); - if(!loc->locinfo->lconv_intl_refcount || !loc->locinfo->lconv_mon_refcount) { - MSVCRT__free_locale(loc); + locinfo->lconv_intl_refcount = MSVCRT_malloc(sizeof(int)); + locinfo->lconv_mon_refcount = MSVCRT_malloc(sizeof(int)); + if(!locinfo->lconv_intl_refcount || !locinfo->lconv_mon_refcount) { + free_locinfo(locinfo); return NULL; } - *loc->locinfo->lconv_intl_refcount = 1; - *loc->locinfo->lconv_mon_refcount = 1; + *locinfo->lconv_intl_refcount = 1; + *locinfo->lconv_mon_refcount = 1; i = GetLocaleInfoA(lcid[MSVCRT_LC_MONETARY], LOCALE_SINTLSYMBOL |LOCALE_NOUSEROVERRIDE, buf, 256); - if(i && (loc->locinfo->lconv->int_curr_symbol = MSVCRT_malloc(i))) - memcpy(loc->locinfo->lconv->int_curr_symbol, buf, i); + if(i && (locinfo->lconv->int_curr_symbol = MSVCRT_malloc(i))) + memcpy(locinfo->lconv->int_curr_symbol, buf, i); else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } i = GetLocaleInfoA(lcid[MSVCRT_LC_MONETARY], LOCALE_SCURRENCY |LOCALE_NOUSEROVERRIDE, buf, 256); - if(i && (loc->locinfo->lconv->currency_symbol = MSVCRT_malloc(i))) - memcpy(loc->locinfo->lconv->currency_symbol, buf, i); + if(i && (locinfo->lconv->currency_symbol = MSVCRT_malloc(i))) + memcpy(locinfo->lconv->currency_symbol, buf, i); else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } i = GetLocaleInfoA(lcid[MSVCRT_LC_MONETARY], LOCALE_SMONDECIMALSEP |LOCALE_NOUSEROVERRIDE, buf, 256); - if(i && (loc->locinfo->lconv->mon_decimal_point = MSVCRT_malloc(i))) - memcpy(loc->locinfo->lconv->mon_decimal_point, buf, i); + if(i && (locinfo->lconv->mon_decimal_point = MSVCRT_malloc(i))) + memcpy(locinfo->lconv->mon_decimal_point, buf, i); else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } i = GetLocaleInfoA(lcid[MSVCRT_LC_MONETARY], LOCALE_SMONTHOUSANDSEP |LOCALE_NOUSEROVERRIDE, buf, 256); - if(i && (loc->locinfo->lconv->mon_thousands_sep = MSVCRT_malloc(i))) - memcpy(loc->locinfo->lconv->mon_thousands_sep, buf, i); + if(i && (locinfo->lconv->mon_thousands_sep = MSVCRT_malloc(i))) + memcpy(locinfo->lconv->mon_thousands_sep, buf, i); else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } @@ -1152,250 +1161,255 @@ |LOCALE_NOUSEROVERRIDE, buf, 256); if(i>1) i = i/2 + (buf[i-2]=='0'?0:1); - if(i && (loc->locinfo->lconv->mon_grouping = MSVCRT_malloc(i))) { + if(i && (locinfo->lconv->mon_grouping = MSVCRT_malloc(i))) { for(i=0; buf[i+1]==';'; i+=2) - loc->locinfo->lconv->mon_grouping[i/2] = buf[i]-'0'; - loc->locinfo->lconv->mon_grouping[i/2] = buf[i]-'0'; + locinfo->lconv->mon_grouping[i/2] = buf[i]-'0'; + locinfo->lconv->mon_grouping[i/2] = buf[i]-'0'; if(buf[i] != '0') - loc->locinfo->lconv->mon_grouping[i/2+1] = 127; + locinfo->lconv->mon_grouping[i/2+1] = 127; } else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } i = GetLocaleInfoA(lcid[MSVCRT_LC_MONETARY], LOCALE_SPOSITIVESIGN |LOCALE_NOUSEROVERRIDE, buf, 256); - if(i && (loc->locinfo->lconv->positive_sign = MSVCRT_malloc(i))) - memcpy(loc->locinfo->lconv->positive_sign, buf, i); + if(i && (locinfo->lconv->positive_sign = MSVCRT_malloc(i))) + memcpy(locinfo->lconv->positive_sign, buf, i); else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } i = GetLocaleInfoA(lcid[MSVCRT_LC_MONETARY], LOCALE_SNEGATIVESIGN |LOCALE_NOUSEROVERRIDE, buf, 256); - if(i && (loc->locinfo->lconv->negative_sign = MSVCRT_malloc(i))) - memcpy(loc->locinfo->lconv->negative_sign, buf, i); + if(i && (locinfo->lconv->negative_sign = MSVCRT_malloc(i))) + memcpy(locinfo->lconv->negative_sign, buf, i); else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } if(GetLocaleInfoA(lcid[MSVCRT_LC_MONETARY], LOCALE_IINTLCURRDIGITS |LOCALE_NOUSEROVERRIDE, buf, 256)) - loc->locinfo->lconv->int_frac_digits = atoi(buf); + locinfo->lconv->int_frac_digits = atoi(buf); else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } if(GetLocaleInfoA(lcid[MSVCRT_LC_MONETARY], LOCALE_ICURRDIGITS |LOCALE_NOUSEROVERRIDE, buf, 256)) - loc->locinfo->lconv->frac_digits = atoi(buf); + locinfo->lconv->frac_digits = atoi(buf); else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } if(GetLocaleInfoA(lcid[MSVCRT_LC_MONETARY], LOCALE_IPOSSYMPRECEDES |LOCALE_NOUSEROVERRIDE, buf, 256)) - loc->locinfo->lconv->p_cs_precedes = atoi(buf); + locinfo->lconv->p_cs_precedes = atoi(buf); else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } if(GetLocaleInfoA(lcid[MSVCRT_LC_MONETARY], LOCALE_IPOSSEPBYSPACE |LOCALE_NOUSEROVERRIDE, buf, 256)) - loc->locinfo->lconv->p_sep_by_space = atoi(buf); + locinfo->lconv->p_sep_by_space = atoi(buf); else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } if(GetLocaleInfoA(lcid[MSVCRT_LC_MONETARY], LOCALE_INEGSYMPRECEDES |LOCALE_NOUSEROVERRIDE, buf, 256)) - loc->locinfo->lconv->n_cs_precedes = atoi(buf); + locinfo->lconv->n_cs_precedes = atoi(buf); else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } if(GetLocaleInfoA(lcid[MSVCRT_LC_MONETARY], LOCALE_INEGSEPBYSPACE |LOCALE_NOUSEROVERRIDE, buf, 256)) - loc->locinfo->lconv->n_sep_by_space = atoi(buf); + locinfo->lconv->n_sep_by_space = atoi(buf); else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } if(GetLocaleInfoA(lcid[MSVCRT_LC_MONETARY], LOCALE_IPOSSIGNPOSN |LOCALE_NOUSEROVERRIDE, buf, 256)) - loc->locinfo->lconv->p_sign_posn = atoi(buf); + locinfo->lconv->p_sign_posn = atoi(buf); else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } if(GetLocaleInfoA(lcid[MSVCRT_LC_MONETARY], LOCALE_INEGSIGNPOSN |LOCALE_NOUSEROVERRIDE, buf, 256)) - loc->locinfo->lconv->n_sign_posn = atoi(buf); + locinfo->lconv->n_sign_posn = atoi(buf); else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } #if _MSVCR_VER >= 120 i = GetLocaleInfoW(lcid[MSVCRT_LC_MONETARY], LOCALE_SINTLSYMBOL |LOCALE_NOUSEROVERRIDE, wbuf, 256); - if(i && (loc->locinfo->lconv->_W_int_curr_symbol = MSVCRT_malloc(i * sizeof(MSVCRT_wchar_t)))) - memcpy(loc->locinfo->lconv->_W_int_curr_symbol, wbuf, i * sizeof(MSVCRT_wchar_t)); + if(i && (locinfo->lconv->_W_int_curr_symbol = MSVCRT_malloc(i * sizeof(MSVCRT_wchar_t)))) + memcpy(locinfo->lconv->_W_int_curr_symbol, wbuf, i * sizeof(MSVCRT_wchar_t)); else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } i = GetLocaleInfoW(lcid[MSVCRT_LC_MONETARY], LOCALE_SCURRENCY |LOCALE_NOUSEROVERRIDE, wbuf, 256); - if(i && (loc->locinfo->lconv->_W_currency_symbol = MSVCRT_malloc(i * sizeof(MSVCRT_wchar_t)))) - memcpy(loc->locinfo->lconv->_W_currency_symbol, wbuf, i * sizeof(MSVCRT_wchar_t)); + if(i && (locinfo->lconv->_W_currency_symbol = MSVCRT_malloc(i * sizeof(MSVCRT_wchar_t)))) + memcpy(locinfo->lconv->_W_currency_symbol, wbuf, i * sizeof(MSVCRT_wchar_t)); else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } i = GetLocaleInfoW(lcid[MSVCRT_LC_MONETARY], LOCALE_SMONDECIMALSEP |LOCALE_NOUSEROVERRIDE, wbuf, 256); - if(i && (loc->locinfo->lconv->_W_mon_decimal_point = MSVCRT_malloc(i * sizeof(MSVCRT_wchar_t)))) - memcpy(loc->locinfo->lconv->_W_mon_decimal_point, wbuf, i * sizeof(MSVCRT_wchar_t)); + if(i && (locinfo->lconv->_W_mon_decimal_point = MSVCRT_malloc(i * sizeof(MSVCRT_wchar_t)))) + memcpy(locinfo->lconv->_W_mon_decimal_point, wbuf, i * sizeof(MSVCRT_wchar_t)); else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } i = GetLocaleInfoW(lcid[MSVCRT_LC_MONETARY], LOCALE_SMONTHOUSANDSEP |LOCALE_NOUSEROVERRIDE, wbuf, 256); - if(i && (loc->locinfo->lconv->_W_mon_thousands_sep = MSVCRT_malloc(i * sizeof(MSVCRT_wchar_t)))) - memcpy(loc->locinfo->lconv->_W_mon_thousands_sep, wbuf, i * sizeof(MSVCRT_wchar_t)); + if(i && (locinfo->lconv->_W_mon_thousands_sep = MSVCRT_malloc(i * sizeof(MSVCRT_wchar_t)))) + memcpy(locinfo->lconv->_W_mon_thousands_sep, wbuf, i * sizeof(MSVCRT_wchar_t)); else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } i = GetLocaleInfoW(lcid[MSVCRT_LC_MONETARY], LOCALE_SPOSITIVESIGN |LOCALE_NOUSEROVERRIDE, wbuf, 256); - if(i && (loc->locinfo->lconv->_W_positive_sign = MSVCRT_malloc(i * sizeof(MSVCRT_wchar_t)))) - memcpy(loc->locinfo->lconv->_W_positive_sign, wbuf, i * sizeof(MSVCRT_wchar_t)); + if(i && (locinfo->lconv->_W_positive_sign = MSVCRT_malloc(i * sizeof(MSVCRT_wchar_t)))) + memcpy(locinfo->lconv->_W_positive_sign, wbuf, i * sizeof(MSVCRT_wchar_t)); else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } i = GetLocaleInfoW(lcid[MSVCRT_LC_MONETARY], LOCALE_SNEGATIVESIGN |LOCALE_NOUSEROVERRIDE, wbuf, 256); - if(i && (loc->locinfo->lconv->_W_negative_sign = MSVCRT_malloc(i * sizeof(MSVCRT_wchar_t)))) - memcpy(loc->locinfo->lconv->_W_negative_sign, wbuf, i * sizeof(MSVCRT_wchar_t)); + if(i && (locinfo->lconv->_W_negative_sign = MSVCRT_malloc(i * sizeof(MSVCRT_wchar_t)))) + memcpy(locinfo->lconv->_W_negative_sign, wbuf, i * sizeof(MSVCRT_wchar_t)); else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } #endif - if(!set_lc_locale_name(loc, MSVCRT_LC_MONETARY)) { - MSVCRT__free_locale(loc); + if(!set_lc_locale_name(locinfo, MSVCRT_LC_MONETARY)) { + free_locinfo(locinfo); return NULL; } } else { - loc->locinfo->lconv->int_curr_symbol = MSVCRT_malloc(sizeof(char)); - loc->locinfo->lconv->currency_symbol = MSVCRT_malloc(sizeof(char)); - loc->locinfo->lconv->mon_decimal_point = MSVCRT_malloc(sizeof(char)); - loc->locinfo->lconv->mon_thousands_sep = MSVCRT_malloc(sizeof(char)); - loc->locinfo->lconv->mon_grouping = MSVCRT_malloc(sizeof(char)); - loc->locinfo->lconv->positive_sign = MSVCRT_malloc(sizeof(char)); - loc->locinfo->lconv->negative_sign = MSVCRT_malloc(sizeof(char)); - - if(!loc->locinfo->lconv->int_curr_symbol || !loc->locinfo->lconv->currency_symbol - || !loc->locinfo->lconv->mon_decimal_point || !loc->locinfo->lconv->mon_thousands_sep - || !loc->locinfo->lconv->mon_grouping || !loc->locinfo->lconv->positive_sign - || !loc->locinfo->lconv->negative_sign) { - MSVCRT__free_locale(loc); + locinfo->lconv->int_curr_symbol = MSVCRT_malloc(sizeof(char)); + locinfo->lconv->currency_symbol = MSVCRT_malloc(sizeof(char)); + locinfo->lconv->mon_decimal_point = MSVCRT_malloc(sizeof(char)); + locinfo->lconv->mon_thousands_sep = MSVCRT_malloc(sizeof(char)); + locinfo->lconv->mon_grouping = MSVCRT_malloc(sizeof(char)); + locinfo->lconv->positive_sign = MSVCRT_malloc(sizeof(char)); + locinfo->lconv->negative_sign = MSVCRT_malloc(sizeof(char)); + + if(!locinfo->lconv->int_curr_symbol || !locinfo->lconv->currency_symbol + || !locinfo->lconv->mon_decimal_point || !locinfo->lconv->mon_thousands_sep + || !locinfo->lconv->mon_grouping || !locinfo->lconv->positive_sign + || !locinfo->lconv->negative_sign) { + free_locinfo(locinfo); return NULL; } - loc->locinfo->lconv->int_curr_symbol[0] = '\0'; - loc->locinfo->lconv->currency_symbol[0] = '\0'; - loc->locinfo->lconv->mon_decimal_point[0] = '\0'; - loc->locinfo->lconv->mon_thousands_sep[0] = '\0'; - loc->locinfo->lconv->mon_grouping[0] = '\0'; - loc->locinfo->lconv->positive_sign[0] = '\0'; - loc->locinfo->lconv->negative_sign[0] = '\0'; - loc->locinfo->lconv->int_frac_digits = 127; - loc->locinfo->lconv->frac_digits = 127; - loc->locinfo->lconv->p_cs_precedes = 127; - loc->locinfo->lconv->p_sep_by_space = 127; - loc->locinfo->lconv->n_cs_precedes = 127; - loc->locinfo->lconv->n_sep_by_space = 127; - loc->locinfo->lconv->p_sign_posn = 127; - loc->locinfo->lconv->n_sign_posn = 127; + locinfo->lconv->int_curr_symbol[0] = '\0'; + locinfo->lconv->currency_symbol[0] = '\0'; + locinfo->lconv->mon_decimal_point[0] = '\0'; + locinfo->lconv->mon_thousands_sep[0] = '\0'; + locinfo->lconv->mon_grouping[0] = '\0'; + locinfo->lconv->positive_sign[0] = '\0'; + locinfo->lconv->negative_sign[0] = '\0'; + locinfo->lconv->int_frac_digits = 127; + locinfo->lconv->frac_digits = 127; + locinfo->lconv->p_cs_precedes = 127; + locinfo->lconv->p_sep_by_space = 127; + locinfo->lconv->n_cs_precedes = 127; + locinfo->lconv->n_sep_by_space = 127; + locinfo->lconv->p_sign_posn = 127; + locinfo->lconv->n_sign_posn = 127; #if _MSVCR_VER >= 120 - loc->locinfo->lconv->_W_int_curr_symbol = MSVCRT_malloc(sizeof(MSVCRT_wchar_t)); - loc->locinfo->lconv->_W_currency_symbol = MSVCRT_malloc(sizeof(MSVCRT_wchar_t)); - loc->locinfo->lconv->_W_mon_decimal_point = MSVCRT_malloc(sizeof(MSVCRT_wchar_t)); - loc->locinfo->lconv->_W_mon_thousands_sep = MSVCRT_malloc(sizeof(MSVCRT_wchar_t)); - loc->locinfo->lconv->_W_positive_sign = MSVCRT_malloc(sizeof(MSVCRT_wchar_t)); - loc->locinfo->lconv->_W_negative_sign = MSVCRT_malloc(sizeof(MSVCRT_wchar_t)); - - if(!loc->locinfo->lconv->_W_int_curr_symbol || !loc->locinfo->lconv->_W_currency_symbol - || !loc->locinfo->lconv->_W_mon_decimal_point || !loc->locinfo->lconv->_W_mon_thousands_sep - || !loc->locinfo->lconv->positive_sign || !loc->locinfo->lconv->negative_sign) { - MSVCRT__free_locale(loc); + locinfo->lconv->_W_int_curr_symbol = MSVCRT_malloc(sizeof(MSVCRT_wchar_t)); + locinfo->lconv->_W_currency_symbol = MSVCRT_malloc(sizeof(MSVCRT_wchar_t)); + locinfo->lconv->_W_mon_decimal_point = MSVCRT_malloc(sizeof(MSVCRT_wchar_t)); + locinfo->lconv->_W_mon_thousands_sep = MSVCRT_malloc(sizeof(MSVCRT_wchar_t)); + locinfo->lconv->_W_positive_sign = MSVCRT_malloc(sizeof(MSVCRT_wchar_t)); + locinfo->lconv->_W_negative_sign = MSVCRT_malloc(sizeof(MSVCRT_wchar_t)); + + if(!locinfo->lconv->_W_int_curr_symbol || !locinfo->lconv->_W_currency_symbol + || !locinfo->lconv->_W_mon_decimal_point || !locinfo->lconv->_W_mon_thousands_sep + || !locinfo->lconv->positive_sign || !locinfo->lconv->negative_sign) { + free_locinfo(locinfo); return NULL; } - loc->locinfo->lconv->_W_int_curr_symbol[0] = '\0'; - loc->locinfo->lconv->_W_currency_symbol[0] = '\0'; - loc->locinfo->lconv->_W_mon_decimal_point[0] = '\0'; - loc->locinfo->lconv->_W_mon_thousands_sep[0] = '\0'; - loc->locinfo->lconv->_W_positive_sign[0] = '\0'; - loc->locinfo->lconv->_W_negative_sign[0] = '\0'; + locinfo->lconv->_W_int_curr_symbol[0] = '\0'; + locinfo->lconv->_W_currency_symbol[0] = '\0'; + locinfo->lconv->_W_mon_decimal_point[0] = '\0'; + locinfo->lconv->_W_mon_thousands_sep[0] = '\0'; + locinfo->lconv->_W_positive_sign[0] = '\0'; + locinfo->lconv->_W_negative_sign[0] = '\0'; #endif - loc->locinfo->lc_category[MSVCRT_LC_MONETARY].locale = MSVCRT__strdup("C"); + locinfo->lc_category[MSVCRT_LC_MONETARY].locale = MSVCRT__strdup("C"); } - if(lcid[MSVCRT_LC_NUMERIC] && (category==MSVCRT_LC_ALL || category==MSVCRT_LC_NUMERIC)) { - if(update_threadlocinfo_category(lcid[MSVCRT_LC_NUMERIC], cp[MSVCRT_LC_NUMERIC], loc, MSVCRT_LC_NUMERIC)) { - MSVCRT__free_locale(loc); + if(!category_needs_update(MSVCRT_LC_NUMERIC, category, old_locinfo, + lcid[MSVCRT_LC_NUMERIC], cp[MSVCRT_LC_NUMERIC])) { + locinfo->lc_handle[MSVCRT_LC_NUMERIC] = old_locinfo->lc_handle[MSVCRT_LC_NUMERIC]; + locinfo->lc_id[MSVCRT_LC_NUMERIC].wCodePage = old_locinfo->lc_id[MSVCRT_LC_NUMERIC].wCodePage; + } else if(lcid[MSVCRT_LC_NUMERIC] && (category==MSVCRT_LC_ALL || category==MSVCRT_LC_NUMERIC)) { + if(update_threadlocinfo_category(lcid[MSVCRT_LC_NUMERIC], + cp[MSVCRT_LC_NUMERIC], locinfo, MSVCRT_LC_NUMERIC)) { + free_locinfo(locinfo); return NULL; } - if(!loc->locinfo->lconv_intl_refcount) - loc->locinfo->lconv_intl_refcount = MSVCRT_malloc(sizeof(int)); - loc->locinfo->lconv_num_refcount = MSVCRT_malloc(sizeof(int)); - if(!loc->locinfo->lconv_intl_refcount || !loc->locinfo->lconv_num_refcount) { - MSVCRT__free_locale(loc); + if(!locinfo->lconv_intl_refcount) + locinfo->lconv_intl_refcount = MSVCRT_malloc(sizeof(int)); + locinfo->lconv_num_refcount = MSVCRT_malloc(sizeof(int)); + if(!locinfo->lconv_intl_refcount || !locinfo->lconv_num_refcount) { + free_locinfo(locinfo); return NULL; } - *loc->locinfo->lconv_intl_refcount = 1; - *loc->locinfo->lconv_num_refcount = 1; + *locinfo->lconv_intl_refcount = 1; + *locinfo->lconv_num_refcount = 1; i = GetLocaleInfoA(lcid[MSVCRT_LC_NUMERIC], LOCALE_SDECIMAL |LOCALE_NOUSEROVERRIDE, buf, 256); - if(i && (loc->locinfo->lconv->decimal_point = MSVCRT_malloc(i))) - memcpy(loc->locinfo->lconv->decimal_point, buf, i); + if(i && (locinfo->lconv->decimal_point = MSVCRT_malloc(i))) + memcpy(locinfo->lconv->decimal_point, buf, i); else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } i = GetLocaleInfoA(lcid[MSVCRT_LC_NUMERIC], LOCALE_STHOUSAND |LOCALE_NOUSEROVERRIDE, buf, 256); - if(i && (loc->locinfo->lconv->thousands_sep = MSVCRT_malloc(i))) - memcpy(loc->locinfo->lconv->thousands_sep, buf, i); + if(i && (locinfo->lconv->thousands_sep = MSVCRT_malloc(i))) + memcpy(locinfo->lconv->thousands_sep, buf, i); else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } @@ -1403,153 +1417,190 @@ |LOCALE_NOUSEROVERRIDE, buf, 256); if(i>1) i = i/2 + (buf[i-2]=='0'?0:1); - if(i && (loc->locinfo->lconv->grouping = MSVCRT_malloc(i))) { + if(i && (locinfo->lconv->grouping = MSVCRT_malloc(i))) { for(i=0; buf[i+1]==';'; i+=2) - loc->locinfo->lconv->grouping[i/2] = buf[i]-'0'; - loc->locinfo->lconv->grouping[i/2] = buf[i]-'0'; + locinfo->lconv->grouping[i/2] = buf[i]-'0'; + locinfo->lconv->grouping[i/2] = buf[i]-'0'; if(buf[i] != '0') - loc->locinfo->lconv->grouping[i/2+1] = 127; + locinfo->lconv->grouping[i/2+1] = 127; } else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } #if _MSVCR_VER >= 120 i = GetLocaleInfoW(lcid[MSVCRT_LC_NUMERIC], LOCALE_SDECIMAL |LOCALE_NOUSEROVERRIDE, wbuf, 256); - if(i && (loc->locinfo->lconv->_W_decimal_point = MSVCRT_malloc(i * sizeof(MSVCRT_wchar_t)))) - memcpy(loc->locinfo->lconv->_W_decimal_point, wbuf, i * sizeof(MSVCRT_wchar_t)); + if(i && (locinfo->lconv->_W_decimal_point = MSVCRT_malloc(i * sizeof(MSVCRT_wchar_t)))) + memcpy(locinfo->lconv->_W_decimal_point, wbuf, i * sizeof(MSVCRT_wchar_t)); else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } i = GetLocaleInfoW(lcid[MSVCRT_LC_NUMERIC], LOCALE_STHOUSAND |LOCALE_NOUSEROVERRIDE, wbuf, 256); - if(i && (loc->locinfo->lconv->_W_thousands_sep = MSVCRT_malloc(i * sizeof(MSVCRT_wchar_t)))) - memcpy(loc->locinfo->lconv->_W_thousands_sep, wbuf, i * sizeof(MSVCRT_wchar_t)); + if(i && (locinfo->lconv->_W_thousands_sep = MSVCRT_malloc(i * sizeof(MSVCRT_wchar_t)))) + memcpy(locinfo->lconv->_W_thousands_sep, wbuf, i * sizeof(MSVCRT_wchar_t)); else { - MSVCRT__free_locale(loc); + free_locinfo(locinfo); return NULL; } #endif - if(!set_lc_locale_name(loc, MSVCRT_LC_NUMERIC)) { - MSVCRT__free_locale(loc); + if(!set_lc_locale_name(locinfo, MSVCRT_LC_NUMERIC)) { + free_locinfo(locinfo); return NULL; } } else { - loc->locinfo->lconv->decimal_point = MSVCRT_malloc(sizeof(char[2])); - loc->locinfo->lconv->thousands_sep = MSVCRT_malloc(sizeof(char)); - loc->locinfo->lconv->grouping = MSVCRT_malloc(sizeof(char)); - if(!loc->locinfo->lconv->decimal_point || !loc->locinfo->lconv->thousands_sep - || !loc->locinfo->lconv->grouping) { - MSVCRT__free_locale(loc); + locinfo->lconv->decimal_point = MSVCRT_malloc(sizeof(char[2])); + locinfo->lconv->thousands_sep = MSVCRT_malloc(sizeof(char)); + locinfo->lconv->grouping = MSVCRT_malloc(sizeof(char)); + if(!locinfo->lconv->decimal_point || !locinfo->lconv->thousands_sep + || !locinfo->lconv->grouping) { + free_locinfo(locinfo); return NULL; } - loc->locinfo->lconv->decimal_point[0] = '.'; - loc->locinfo->lconv->decimal_point[1] = '\0'; - loc->locinfo->lconv->thousands_sep[0] = '\0'; - loc->locinfo->lconv->grouping[0] = '\0'; + locinfo->lconv->decimal_point[0] = '.'; + locinfo->lconv->decimal_point[1] = '\0'; + locinfo->lconv->thousands_sep[0] = '\0'; + locinfo->lconv->grouping[0] = '\0'; #if _MSVCR_VER >= 120 - loc->locinfo->lconv->_W_decimal_point = MSVCRT_malloc(sizeof(MSVCRT_wchar_t[2])); - loc->locinfo->lconv->_W_thousands_sep = MSVCRT_malloc(sizeof(MSVCRT_wchar_t)); + locinfo->lconv->_W_decimal_point = MSVCRT_malloc(sizeof(MSVCRT_wchar_t[2])); + locinfo->lconv->_W_thousands_sep = MSVCRT_malloc(sizeof(MSVCRT_wchar_t)); - if(!loc->locinfo->lconv->_W_decimal_point || !loc->locinfo->lconv->_W_thousands_sep) { - MSVCRT__free_locale(loc); + if(!locinfo->lconv->_W_decimal_point || !locinfo->lconv->_W_thousands_sep) { + free_locinfo(locinfo); return NULL; } - loc->locinfo->lconv->_W_decimal_point[0] = '.'; - loc->locinfo->lconv->_W_decimal_point[1] = '\0'; - loc->locinfo->lconv->_W_thousands_sep[0] = '\0'; + locinfo->lconv->_W_decimal_point[0] = '.'; + locinfo->lconv->_W_decimal_point[1] = '\0'; + locinfo->lconv->_W_thousands_sep[0] = '\0'; #endif - loc->locinfo->lc_category[MSVCRT_LC_NUMERIC].locale = MSVCRT__strdup("C"); + locinfo->lc_category[MSVCRT_LC_NUMERIC].locale = MSVCRT__strdup("C"); } - if(lcid[MSVCRT_LC_TIME] && (category==MSVCRT_LC_ALL || category==MSVCRT_LC_TIME)) { - if(update_threadlocinfo_category(lcid[MSVCRT_LC_TIME], cp[MSVCRT_LC_TIME], loc, MSVCRT_LC_TIME)) { - MSVCRT__free_locale(loc); - return NULL; + if(!category_needs_update(MSVCRT_LC_TIME, category, old_locinfo, + lcid[MSVCRT_LC_TIME], cp[MSVCRT_LC_TIME])) { + locinfo->lc_handle[MSVCRT_LC_TIME] = old_locinfo->lc_handle[MSVCRT_LC_TIME]; + locinfo->lc_id[MSVCRT_LC_TIME].wCodePage = old_locinfo->lc_id[MSVCRT_LC_TIME].wCodePage; + } else { + if(lcid[MSVCRT_LC_TIME] && (category==MSVCRT_LC_ALL || category==MSVCRT_LC_TIME)) { + if(update_threadlocinfo_category(lcid[MSVCRT_LC_TIME], + cp[MSVCRT_LC_TIME], locinfo, MSVCRT_LC_TIME)) { + free_locinfo(locinfo); + return NULL; + } + + if(!set_lc_locale_name(locinfo, MSVCRT_LC_TIME)) { + free_locinfo(locinfo); + return NULL; + } + } else + locinfo->lc_category[MSVCRT_LC_TIME].locale = MSVCRT__strdup("C"); + + size = sizeof(MSVCRT___lc_time_data); + lcid_tmp = lcid[MSVCRT_LC_TIME] ? lcid[MSVCRT_LC_TIME] : MAKELCID(LANG_ENGLISH, SORT_DEFAULT); + for(i=0; ilc_time_curr = MSVCRT_malloc(size); + if(!locinfo->lc_time_curr) { + free_locinfo(locinfo); return NULL; } - } else - loc->locinfo->lc_category[MSVCRT_LC_TIME].locale = MSVCRT__strdup("C"); - size = sizeof(MSVCRT___lc_time_data); - lcid_tmp = lcid[MSVCRT_LC_TIME] ? lcid[MSVCRT_LC_TIME] : MAKELCID(LANG_ENGLISH, SORT_DEFAULT); - for(i=0; ilc_time_curr->str.str[i] = &locinfo->lc_time_curr->data[ret]; + if(time_data[i]==LOCALE_SSHORTDATE && !lcid[MSVCRT_LC_TIME]) { + memcpy(&locinfo->lc_time_curr->data[ret], cloc_short_date, sizeof(cloc_short_date)); + ret += sizeof(cloc_short_date); + }else if(time_data[i]==LOCALE_SLONGDATE && !lcid[MSVCRT_LC_TIME]) { + memcpy(&locinfo->lc_time_curr->data[ret], cloc_long_date, sizeof(cloc_long_date)); + ret += sizeof(cloc_long_date); + }else if(time_data[i]==LOCALE_STIMEFORMAT && !lcid[MSVCRT_LC_TIME]) { + memcpy(&locinfo->lc_time_curr->data[ret], cloc_time, sizeof(cloc_time)); + ret += sizeof(cloc_time); + }else { + ret += GetLocaleInfoA(lcid_tmp, time_data[i]|LOCALE_NOUSEROVERRIDE, + &locinfo->lc_time_curr->data[ret], size-ret); } - size += ret; - - ret = GetLocaleInfoW(lcid_tmp, time_data[i] - |LOCALE_NOUSEROVERRIDE, NULL, 0); - if(!ret) { - MSVCRT__free_locale(loc); - return NULL; + } + for(i=0; ilc_time_curr->wstr.wstr[i] = (MSVCRT_wchar_t*)&locinfo->lc_time_curr->data[ret]; + if(time_data[i]==LOCALE_SSHORTDATE && !lcid[MSVCRT_LC_TIME]) { + memcpy(&locinfo->lc_time_curr->data[ret], cloc_short_dateW, sizeof(cloc_short_dateW)); + ret += sizeof(cloc_short_dateW); + }else if(time_data[i]==LOCALE_SLONGDATE && !lcid[MSVCRT_LC_TIME]) { + memcpy(&locinfo->lc_time_curr->data[ret], cloc_long_dateW, sizeof(cloc_long_dateW)); + ret += sizeof(cloc_long_dateW); + }else if(time_data[i]==LOCALE_STIMEFORMAT && !lcid[MSVCRT_LC_TIME]) { + memcpy(&locinfo->lc_time_curr->data[ret], cloc_timeW, sizeof(cloc_timeW)); + ret += sizeof(cloc_timeW); + }else { + ret += GetLocaleInfoW(lcid_tmp, time_data[i]|LOCALE_NOUSEROVERRIDE, + (MSVCRT_wchar_t*)&locinfo->lc_time_curr->data[ret], size-ret)*sizeof(MSVCRT_wchar_t); } - size += ret*sizeof(MSVCRT_wchar_t); } + locinfo->lc_time_curr->lcid = lcid[MSVCRT_LC_TIME]; } - loc->locinfo->lc_time_curr = MSVCRT_malloc(size); - if(!loc->locinfo->lc_time_curr) { - MSVCRT__free_locale(loc); + return locinfo; +} + +/********************************************************************* + * _create_locale (MSVCRT.@) + */ +MSVCRT__locale_t CDECL MSVCRT__create_locale(int category, const char *locale) +{ + MSVCRT__locale_t loc; + + loc = MSVCRT_malloc(sizeof(MSVCRT__locale_tstruct)); + if(!loc) + return NULL; + + loc->locinfo = create_locinfo(category, locale, NULL); + if(!loc->locinfo) { + MSVCRT_free(loc); return NULL; } - ret = 0; - for(i=0; ilocinfo->lc_time_curr->str.str[i] = &loc->locinfo->lc_time_curr->data[ret]; - if(time_data[i]==LOCALE_SSHORTDATE && !lcid[MSVCRT_LC_TIME]) { - memcpy(&loc->locinfo->lc_time_curr->data[ret], cloc_short_date, sizeof(cloc_short_date)); - ret += sizeof(cloc_short_date); - }else if(time_data[i]==LOCALE_SLONGDATE && !lcid[MSVCRT_LC_TIME]) { - memcpy(&loc->locinfo->lc_time_curr->data[ret], cloc_long_date, sizeof(cloc_long_date)); - ret += sizeof(cloc_long_date); - }else if(time_data[i]==LOCALE_STIMEFORMAT && !lcid[MSVCRT_LC_TIME]) { - memcpy(&loc->locinfo->lc_time_curr->data[ret], cloc_time, sizeof(cloc_time)); - ret += sizeof(cloc_time); - }else { - ret += GetLocaleInfoA(lcid_tmp, time_data[i]|LOCALE_NOUSEROVERRIDE, - &loc->locinfo->lc_time_curr->data[ret], size-ret); - } - } - for(i=0; ilocinfo->lc_time_curr->wstr.wstr[i] = (MSVCRT_wchar_t*)&loc->locinfo->lc_time_curr->data[ret]; - if(time_data[i]==LOCALE_SSHORTDATE && !lcid[MSVCRT_LC_TIME]) { - memcpy(&loc->locinfo->lc_time_curr->data[ret], cloc_short_dateW, sizeof(cloc_short_dateW)); - ret += sizeof(cloc_short_dateW); - }else if(time_data[i]==LOCALE_SLONGDATE && !lcid[MSVCRT_LC_TIME]) { - memcpy(&loc->locinfo->lc_time_curr->data[ret], cloc_long_dateW, sizeof(cloc_long_dateW)); - ret += sizeof(cloc_long_dateW); - }else if(time_data[i]==LOCALE_STIMEFORMAT && !lcid[MSVCRT_LC_TIME]) { - memcpy(&loc->locinfo->lc_time_curr->data[ret], cloc_timeW, sizeof(cloc_timeW)); - ret += sizeof(cloc_timeW); - }else { - ret += GetLocaleInfoW(lcid_tmp, time_data[i]|LOCALE_NOUSEROVERRIDE, - (MSVCRT_wchar_t*)&loc->locinfo->lc_time_curr->data[ret], size-ret)*sizeof(MSVCRT_wchar_t); - } + loc->mbcinfo = MSVCRT_malloc(sizeof(MSVCRT_threadmbcinfo)); + if(!loc->mbcinfo) { + free_locinfo(loc->locinfo); + MSVCRT_free(loc); + return NULL; } - loc->locinfo->lc_time_curr->lcid = lcid[MSVCRT_LC_TIME]; + loc->mbcinfo->refcount = 1; + _setmbcp_l(loc->locinfo->lc_id[MSVCRT_LC_CTYPE].wCodePage, + loc->locinfo->lc_handle[MSVCRT_LC_CTYPE], loc->mbcinfo); return loc; } @@ -1558,8 +1609,8 @@ */ char* CDECL MSVCRT_setlocale(int category, const char* locale) { - MSVCRT__locale_t loc; MSVCRT_pthreadlocinfo locinfo = get_locinfo(); + MSVCRT_pthreadlocinfo newlocinfo; if(categoryMSVCRT_LC_MAX) return NULL; @@ -1571,165 +1622,167 @@ return locinfo->lc_category[category].locale; } - loc = MSVCRT__create_locale(category, locale); - if(!loc) { + newlocinfo = create_locinfo(category, locale, locinfo); + if(!newlocinfo) { WARN("%d %s failed\n", category, locale); return NULL; } LOCK_LOCALE; - switch(category) { - case MSVCRT_LC_ALL: - case MSVCRT_LC_COLLATE: - locinfo->lc_collate_cp = loc->locinfo->lc_collate_cp; - locinfo->lc_handle[MSVCRT_LC_COLLATE] = - loc->locinfo->lc_handle[MSVCRT_LC_COLLATE]; - swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_COLLATE].locale, - (void**)&loc->locinfo->lc_category[MSVCRT_LC_COLLATE].locale); - swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_COLLATE].refcount, - (void**)&loc->locinfo->lc_category[MSVCRT_LC_COLLATE].refcount); + if(locinfo->lc_handle[MSVCRT_LC_COLLATE]!=newlocinfo->lc_handle[MSVCRT_LC_COLLATE] + || locinfo->lc_id[MSVCRT_LC_COLLATE].wCodePage!=newlocinfo->lc_id[MSVCRT_LC_COLLATE].wCodePage) { + locinfo->lc_collate_cp = newlocinfo->lc_collate_cp; + locinfo->lc_handle[MSVCRT_LC_COLLATE] = + newlocinfo->lc_handle[MSVCRT_LC_COLLATE]; + locinfo->lc_id[MSVCRT_LC_COLLATE] = + newlocinfo->lc_id[MSVCRT_LC_COLLATE]; + swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_COLLATE].locale, + (void**)&newlocinfo->lc_category[MSVCRT_LC_COLLATE].locale); + swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_COLLATE].refcount, + (void**)&newlocinfo->lc_category[MSVCRT_LC_COLLATE].refcount); #if _MSVCR_VER >= 110 - swap_pointers((void**)&locinfo->lc_name[MSVCRT_LC_COLLATE], - (void**)&loc->locinfo->lc_name[MSVCRT_LC_COLLATE]); + swap_pointers((void**)&locinfo->lc_name[MSVCRT_LC_COLLATE], + (void**)&newlocinfo->lc_name[MSVCRT_LC_COLLATE]); #endif + } - if(category != MSVCRT_LC_ALL) - break; - /* fall through */ - case MSVCRT_LC_CTYPE: - locinfo->lc_handle[MSVCRT_LC_CTYPE] = - loc->locinfo->lc_handle[MSVCRT_LC_CTYPE]; - swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_CTYPE].locale, - (void**)&loc->locinfo->lc_category[MSVCRT_LC_CTYPE].locale); - swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_CTYPE].refcount, - (void**)&loc->locinfo->lc_category[MSVCRT_LC_CTYPE].refcount); - - locinfo->lc_codepage = loc->locinfo->lc_codepage; - locinfo->lc_clike = loc->locinfo->lc_clike; - locinfo->mb_cur_max = loc->locinfo->mb_cur_max; - - swap_pointers((void**)&locinfo->ctype1_refcount, - (void**)&loc->locinfo->ctype1_refcount); - swap_pointers((void**)&locinfo->ctype1, (void**)&loc->locinfo->ctype1); - swap_pointers((void**)&locinfo->pctype, (void**)&loc->locinfo->pctype); - swap_pointers((void**)&locinfo->pclmap, (void**)&loc->locinfo->pclmap); - swap_pointers((void**)&locinfo->pcumap, (void**)&loc->locinfo->pcumap); + if(locinfo->lc_handle[MSVCRT_LC_CTYPE]!=newlocinfo->lc_handle[MSVCRT_LC_CTYPE] + || locinfo->lc_id[MSVCRT_LC_CTYPE].wCodePage!=newlocinfo->lc_id[MSVCRT_LC_CTYPE].wCodePage) { + locinfo->lc_handle[MSVCRT_LC_CTYPE] = + newlocinfo->lc_handle[MSVCRT_LC_CTYPE]; + locinfo->lc_id[MSVCRT_LC_CTYPE] = + newlocinfo->lc_id[MSVCRT_LC_CTYPE]; + swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_CTYPE].locale, + (void**)&newlocinfo->lc_category[MSVCRT_LC_CTYPE].locale); + swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_CTYPE].refcount, + (void**)&newlocinfo->lc_category[MSVCRT_LC_CTYPE].refcount); + + locinfo->lc_codepage = newlocinfo->lc_codepage; + locinfo->lc_clike = newlocinfo->lc_clike; + locinfo->mb_cur_max = newlocinfo->mb_cur_max; + + swap_pointers((void**)&locinfo->ctype1_refcount, + (void**)&newlocinfo->ctype1_refcount); + swap_pointers((void**)&locinfo->ctype1, (void**)&newlocinfo->ctype1); + swap_pointers((void**)&locinfo->pctype, (void**)&newlocinfo->pctype); + swap_pointers((void**)&locinfo->pclmap, (void**)&newlocinfo->pclmap); + swap_pointers((void**)&locinfo->pcumap, (void**)&newlocinfo->pcumap); #if _MSVCR_VER >= 110 - swap_pointers((void**)&locinfo->lc_name[MSVCRT_LC_CTYPE], - (void**)&loc->locinfo->lc_name[MSVCRT_LC_CTYPE]); + swap_pointers((void**)&locinfo->lc_name[MSVCRT_LC_CTYPE], + (void**)&newlocinfo->lc_name[MSVCRT_LC_CTYPE]); #endif + } - if(category != MSVCRT_LC_ALL) - break; - /* fall through */ - case MSVCRT_LC_MONETARY: - locinfo->lc_handle[MSVCRT_LC_MONETARY] = - loc->locinfo->lc_handle[MSVCRT_LC_MONETARY]; - swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_MONETARY].locale, - (void**)&loc->locinfo->lc_category[MSVCRT_LC_MONETARY].locale); - swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_MONETARY].refcount, - (void**)&loc->locinfo->lc_category[MSVCRT_LC_MONETARY].refcount); - - swap_pointers((void**)&locinfo->lconv->int_curr_symbol, - (void**)&loc->locinfo->lconv->int_curr_symbol); - swap_pointers((void**)&locinfo->lconv->currency_symbol, - (void**)&loc->locinfo->lconv->currency_symbol); - swap_pointers((void**)&locinfo->lconv->mon_decimal_point, - (void**)&loc->locinfo->lconv->mon_decimal_point); - swap_pointers((void**)&locinfo->lconv->mon_thousands_sep, - (void**)&loc->locinfo->lconv->mon_thousands_sep); - swap_pointers((void**)&locinfo->lconv->mon_grouping, - (void**)&loc->locinfo->lconv->mon_grouping); - swap_pointers((void**)&locinfo->lconv->positive_sign, - (void**)&loc->locinfo->lconv->positive_sign); - swap_pointers((void**)&locinfo->lconv->negative_sign, - (void**)&loc->locinfo->lconv->negative_sign); + if(locinfo->lc_handle[MSVCRT_LC_MONETARY]!=newlocinfo->lc_handle[MSVCRT_LC_MONETARY] + || locinfo->lc_id[MSVCRT_LC_MONETARY].wCodePage!=newlocinfo->lc_id[MSVCRT_LC_MONETARY].wCodePage) { + locinfo->lc_handle[MSVCRT_LC_MONETARY] = + newlocinfo->lc_handle[MSVCRT_LC_MONETARY]; + locinfo->lc_id[MSVCRT_LC_MONETARY] = + newlocinfo->lc_id[MSVCRT_LC_MONETARY]; + swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_MONETARY].locale, + (void**)&newlocinfo->lc_category[MSVCRT_LC_MONETARY].locale); + swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_MONETARY].refcount, + (void**)&newlocinfo->lc_category[MSVCRT_LC_MONETARY].refcount); + + swap_pointers((void**)&locinfo->lconv->int_curr_symbol, + (void**)&newlocinfo->lconv->int_curr_symbol); + swap_pointers((void**)&locinfo->lconv->currency_symbol, + (void**)&newlocinfo->lconv->currency_symbol); + swap_pointers((void**)&locinfo->lconv->mon_decimal_point, + (void**)&newlocinfo->lconv->mon_decimal_point); + swap_pointers((void**)&locinfo->lconv->mon_thousands_sep, + (void**)&newlocinfo->lconv->mon_thousands_sep); + swap_pointers((void**)&locinfo->lconv->mon_grouping, + (void**)&newlocinfo->lconv->mon_grouping); + swap_pointers((void**)&locinfo->lconv->positive_sign, + (void**)&newlocinfo->lconv->positive_sign); + swap_pointers((void**)&locinfo->lconv->negative_sign, + (void**)&newlocinfo->lconv->negative_sign); #if _MSVCR_VER >= 120 - swap_pointers((void**)&locinfo->lconv->_W_int_curr_symbol, - (void**)&loc->locinfo->lconv->_W_int_curr_symbol); - swap_pointers((void**)&locinfo->lconv->_W_currency_symbol, - (void**)&loc->locinfo->lconv->_W_currency_symbol); - swap_pointers((void**)&locinfo->lconv->_W_mon_decimal_point, - (void**)&loc->locinfo->lconv->_W_mon_decimal_point); - swap_pointers((void**)&locinfo->lconv->_W_mon_thousands_sep, - (void**)&loc->locinfo->lconv->_W_mon_thousands_sep); - swap_pointers((void**)&locinfo->lconv->_W_positive_sign, - (void**)&loc->locinfo->lconv->_W_positive_sign); - swap_pointers((void**)&locinfo->lconv->_W_negative_sign, - (void**)&loc->locinfo->lconv->_W_negative_sign); + swap_pointers((void**)&locinfo->lconv->_W_int_curr_symbol, + (void**)&newlocinfo->lconv->_W_int_curr_symbol); + swap_pointers((void**)&locinfo->lconv->_W_currency_symbol, + (void**)&newlocinfo->lconv->_W_currency_symbol); + swap_pointers((void**)&locinfo->lconv->_W_mon_decimal_point, + (void**)&newlocinfo->lconv->_W_mon_decimal_point); + swap_pointers((void**)&locinfo->lconv->_W_mon_thousands_sep, + (void**)&newlocinfo->lconv->_W_mon_thousands_sep); + swap_pointers((void**)&locinfo->lconv->_W_positive_sign, + (void**)&newlocinfo->lconv->_W_positive_sign); + swap_pointers((void**)&locinfo->lconv->_W_negative_sign, + (void**)&newlocinfo->lconv->_W_negative_sign); #endif - locinfo->lconv->int_frac_digits = loc->locinfo->lconv->int_frac_digits; - locinfo->lconv->frac_digits = loc->locinfo->lconv->frac_digits; - locinfo->lconv->p_cs_precedes = loc->locinfo->lconv->p_cs_precedes; - locinfo->lconv->p_sep_by_space = loc->locinfo->lconv->p_sep_by_space; - locinfo->lconv->n_cs_precedes = loc->locinfo->lconv->n_cs_precedes; - locinfo->lconv->n_sep_by_space = loc->locinfo->lconv->n_sep_by_space; - locinfo->lconv->p_sign_posn = loc->locinfo->lconv->p_sign_posn; - locinfo->lconv->n_sign_posn = loc->locinfo->lconv->n_sign_posn; + locinfo->lconv->int_frac_digits = newlocinfo->lconv->int_frac_digits; + locinfo->lconv->frac_digits = newlocinfo->lconv->frac_digits; + locinfo->lconv->p_cs_precedes = newlocinfo->lconv->p_cs_precedes; + locinfo->lconv->p_sep_by_space = newlocinfo->lconv->p_sep_by_space; + locinfo->lconv->n_cs_precedes = newlocinfo->lconv->n_cs_precedes; + locinfo->lconv->n_sep_by_space = newlocinfo->lconv->n_sep_by_space; + locinfo->lconv->p_sign_posn = newlocinfo->lconv->p_sign_posn; + locinfo->lconv->n_sign_posn = newlocinfo->lconv->n_sign_posn; #if _MSVCR_VER >= 110 - swap_pointers((void**)&locinfo->lc_name[MSVCRT_LC_MONETARY], - (void**)&loc->locinfo->lc_name[MSVCRT_LC_MONETARY]); + swap_pointers((void**)&locinfo->lc_name[MSVCRT_LC_MONETARY], + (void**)&newlocinfo->lc_name[MSVCRT_LC_MONETARY]); #endif + } - if(category != MSVCRT_LC_ALL) - break; - /* fall through */ - case MSVCRT_LC_NUMERIC: - locinfo->lc_handle[MSVCRT_LC_NUMERIC] = - loc->locinfo->lc_handle[MSVCRT_LC_NUMERIC]; - swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_NUMERIC].locale, - (void**)&loc->locinfo->lc_category[MSVCRT_LC_NUMERIC].locale); - swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_NUMERIC].refcount, - (void**)&loc->locinfo->lc_category[MSVCRT_LC_NUMERIC].refcount); - - swap_pointers((void**)&locinfo->lconv->decimal_point, - (void**)&loc->locinfo->lconv->decimal_point); - swap_pointers((void**)&locinfo->lconv->thousands_sep, - (void**)&loc->locinfo->lconv->thousands_sep); - swap_pointers((void**)&locinfo->lconv->grouping, - (void**)&loc->locinfo->lconv->grouping); + if(locinfo->lc_handle[MSVCRT_LC_NUMERIC]!=newlocinfo->lc_handle[MSVCRT_LC_NUMERIC] + || locinfo->lc_id[MSVCRT_LC_NUMERIC].wCodePage!=newlocinfo->lc_id[MSVCRT_LC_NUMERIC].wCodePage) { + locinfo->lc_handle[MSVCRT_LC_NUMERIC] = + newlocinfo->lc_handle[MSVCRT_LC_NUMERIC]; + locinfo->lc_id[MSVCRT_LC_NUMERIC] = + newlocinfo->lc_id[MSVCRT_LC_NUMERIC]; + swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_NUMERIC].locale, + (void**)&newlocinfo->lc_category[MSVCRT_LC_NUMERIC].locale); + swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_NUMERIC].refcount, + (void**)&newlocinfo->lc_category[MSVCRT_LC_NUMERIC].refcount); + + swap_pointers((void**)&locinfo->lconv->decimal_point, + (void**)&newlocinfo->lconv->decimal_point); + swap_pointers((void**)&locinfo->lconv->thousands_sep, + (void**)&newlocinfo->lconv->thousands_sep); + swap_pointers((void**)&locinfo->lconv->grouping, + (void**)&newlocinfo->lconv->grouping); #if _MSVCR_VER >= 120 - swap_pointers((void**)&locinfo->lconv->_W_decimal_point, - (void**)&loc->locinfo->lconv->_W_decimal_point); - swap_pointers((void**)&locinfo->lconv->_W_thousands_sep, - (void**)&loc->locinfo->lconv->_W_thousands_sep); + swap_pointers((void**)&locinfo->lconv->_W_decimal_point, + (void**)&newlocinfo->lconv->_W_decimal_point); + swap_pointers((void**)&locinfo->lconv->_W_thousands_sep, + (void**)&newlocinfo->lconv->_W_thousands_sep); #endif #if _MSVCR_VER >= 110 - swap_pointers((void**)&locinfo->lc_name[MSVCRT_LC_NUMERIC], - (void**)&loc->locinfo->lc_name[MSVCRT_LC_NUMERIC]); + swap_pointers((void**)&locinfo->lc_name[MSVCRT_LC_NUMERIC], + (void**)&newlocinfo->lc_name[MSVCRT_LC_NUMERIC]); #endif + } - if(category != MSVCRT_LC_ALL) - break; - /* fall through */ - case MSVCRT_LC_TIME: - locinfo->lc_handle[MSVCRT_LC_TIME] = - loc->locinfo->lc_handle[MSVCRT_LC_TIME]; - swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_TIME].locale, - (void**)&loc->locinfo->lc_category[MSVCRT_LC_TIME].locale); - swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_TIME].refcount, - (void**)&loc->locinfo->lc_category[MSVCRT_LC_TIME].refcount); - swap_pointers((void**)&locinfo->lc_time_curr, - (void**)&loc->locinfo->lc_time_curr); + if(locinfo->lc_handle[MSVCRT_LC_TIME]!=newlocinfo->lc_handle[MSVCRT_LC_TIME] + || locinfo->lc_id[MSVCRT_LC_TIME].wCodePage!=newlocinfo->lc_id[MSVCRT_LC_TIME].wCodePage) { + locinfo->lc_handle[MSVCRT_LC_TIME] = + newlocinfo->lc_handle[MSVCRT_LC_TIME]; + locinfo->lc_id[MSVCRT_LC_TIME] = + newlocinfo->lc_id[MSVCRT_LC_TIME]; + swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_TIME].locale, + (void**)&newlocinfo->lc_category[MSVCRT_LC_TIME].locale); + swap_pointers((void**)&locinfo->lc_category[MSVCRT_LC_TIME].refcount, + (void**)&newlocinfo->lc_category[MSVCRT_LC_TIME].refcount); + swap_pointers((void**)&locinfo->lc_time_curr, + (void**)&newlocinfo->lc_time_curr); #if _MSVCR_VER >= 110 - swap_pointers((void**)&locinfo->lc_name[MSVCRT_LC_TIME], - (void**)&loc->locinfo->lc_name[MSVCRT_LC_TIME]); + swap_pointers((void**)&locinfo->lc_name[MSVCRT_LC_TIME], + (void**)&newlocinfo->lc_name[MSVCRT_LC_TIME]); #endif - - if(category != MSVCRT_LC_ALL) - break; } - MSVCRT__free_locale(loc); + free_locinfo(newlocinfo); UNLOCK_LOCALE; if(locinfo == MSVCRT_locale->locinfo) { diff -Nru wine1.7-1.7.50/dlls/msvcrt/main.c wine1.7-1.7.55/dlls/msvcrt/main.c --- wine1.7-1.7.50/dlls/msvcrt/main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcrt/main.c 2015-11-13 14:32:40.000000000 +0000 @@ -68,14 +68,14 @@ if (tls) { CloseHandle(tls->handle); - HeapFree(GetProcessHeap(),0,tls->efcvt_buffer); - HeapFree(GetProcessHeap(),0,tls->asctime_buffer); - HeapFree(GetProcessHeap(),0,tls->wasctime_buffer); - HeapFree(GetProcessHeap(),0,tls->strerror_buffer); - HeapFree(GetProcessHeap(),0,tls->wcserror_buffer); - HeapFree(GetProcessHeap(),0,tls->time_buffer); - HeapFree(GetProcessHeap(),0,tls->tmpnam_buffer); - HeapFree(GetProcessHeap(),0,tls->wtmpnam_buffer); + MSVCRT_free(tls->efcvt_buffer); + MSVCRT_free(tls->asctime_buffer); + MSVCRT_free(tls->wasctime_buffer); + MSVCRT_free(tls->strerror_buffer); + MSVCRT_free(tls->wcserror_buffer); + MSVCRT_free(tls->time_buffer); + MSVCRT_free(tls->tmpnam_buffer); + MSVCRT_free(tls->wtmpnam_buffer); if(tls->have_locale) { free_locinfo(tls->locinfo); free_mbcinfo(tls->mbcinfo); diff -Nru wine1.7-1.7.50/dlls/msvcrt/math.c wine1.7-1.7.55/dlls/msvcrt/math.c --- wine1.7-1.7.50/dlls/msvcrt/math.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcrt/math.c 2015-11-13 14:32:40.000000000 +0000 @@ -2683,3 +2683,31 @@ { return signbit(x) ? 0x8000 : 0; } + +/********************************************************************* + * fminf (MSVCR120.@) + */ +float CDECL MSVCR120_fminf(float x, float y) +{ + if(isnanf(x)) + return y; + if(isnanf(y)) + return x; + if(x==0 && y==0) + return signbit(x) ? x : y; + return x=60 && _MSVCR_VER<=71 + return CompareStringA(get_mbcinfo()->mblcid, NORM_IGNORECASE, + (const char*)str, -1, (const char*)cmp, -1)-CSTR_EQUAL; +#else return _mbsnbicoll_l(str, cmp, -1, NULL); +#endif } /********************************************************************* @@ -870,7 +875,12 @@ */ int CDECL _mbscoll(const unsigned char* str, const unsigned char* cmp) { +#if _MSVCR_VER>=60 && _MSVCR_VER<=71 + return CompareStringA(get_mbcinfo()->mblcid, 0, + (const char*)str, -1, (const char*)cmp, -1)-CSTR_EQUAL; +#else return _mbsnbcoll_l(str, cmp, -1, NULL); +#endif } /********************************************************************* diff -Nru wine1.7-1.7.50/dlls/msvcrt/msvcrt.h wine1.7-1.7.55/dlls/msvcrt/msvcrt.h --- wine1.7-1.7.50/dlls/msvcrt/msvcrt.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcrt/msvcrt.h 2015-11-13 14:32:40.000000000 +0000 @@ -1082,9 +1082,9 @@ } printf_arg; typedef printf_arg (*args_clbk)(void*, int, int, __ms_va_list*); int pf_printf_a(puts_clbk_a, void*, const char*, MSVCRT__locale_t, - BOOL, BOOL, args_clbk, void*, __ms_va_list*) DECLSPEC_HIDDEN; + DWORD, args_clbk, void*, __ms_va_list*) DECLSPEC_HIDDEN; int pf_printf_w(puts_clbk_w, void*, const MSVCRT_wchar_t*, MSVCRT__locale_t, - BOOL, BOOL, args_clbk, void*, __ms_va_list*) DECLSPEC_HIDDEN; + DWORD, args_clbk, void*, __ms_va_list*) DECLSPEC_HIDDEN; printf_arg arg_clbk_valist(void*, int, int, __ms_va_list*) DECLSPEC_HIDDEN; #define MSVCRT_FLT_MIN 1.175494351e-38F @@ -1124,4 +1124,21 @@ #define UNDNAME_NO_SPECIAL_SYMS (0x4000) #define UNDNAME_NO_COMPLEX_TYPE (0x8000) +#define UCRTBASE_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION (0x0001) +#define UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR (0x0002) +#define UCRTBASE_PRINTF_LEGACY_WIDE_SPECIFIERS (0x0004) +#define UCRTBASE_PRINTF_LEGACY_MSVCRT_COMPATIBILITY (0x0008) +#define UCRTBASE_PRINTF_LEGACY_THREE_DIGIT_EXPONENTS (0x0010) + +#define UCRTBASE_PRINTF_MASK (0x001F) + +#define MSVCRT_PRINTF_POSITIONAL_PARAMS (0x0100) +#define MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER (0x0200) + +#define UCRTBASE_SCANF_SECURECRT (0x0001) +#define UCRTBASE_SCANF_LEGACY_WIDE_SPECIFIERS (0x0002) +#define UCRTBASE_SCANF_LEGACY_MSVCRT_COMPATIBILITY (0x0004) + +#define UCRTBASE_SCANF_MASK (0x0007) + #endif /* __WINE_MSVCRT_H */ diff -Nru wine1.7-1.7.50/dlls/msvcrt/msvcrt.spec wine1.7-1.7.55/dlls/msvcrt/msvcrt.spec --- wine1.7-1.7.50/dlls/msvcrt/msvcrt.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcrt/msvcrt.spec 2015-11-13 14:32:40.000000000 +0000 @@ -178,7 +178,7 @@ # stub __CxxCallUnwindDtor # stub __CxxCallUnwindVecDtor @ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) -# stub __CxxExceptionFilter +@ cdecl -arch=i386,x86_64,arm __CxxExceptionFilter(ptr ptr long ptr) @ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) @ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler @ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler @@ -1137,9 +1137,9 @@ @ cdecl _wcsxfrm_l(ptr wstr long ptr) MSVCRT__wcsxfrm_l @ cdecl _wctime(ptr) MSVCRT__wctime @ cdecl _wctime32(ptr) MSVCRT__wctime32 -# stub _wctime32_s(ptr long ptr) +@ cdecl _wctime32_s(ptr long ptr) MSVCRT__wctime32_s @ cdecl _wctime64(ptr) MSVCRT__wctime64 -# stub _wctime64_s(ptr long ptr) +@ cdecl _wctime64_s(ptr long ptr) MSVCRT__wctime64_s @ cdecl _wctomb_l(ptr long ptr) MSVCRT__wctomb_l @ cdecl _wctomb_s_l(ptr ptr long long ptr) MSVCRT__wctomb_s_l # extern _wctype diff -Nru wine1.7-1.7.50/dlls/msvcrt/printf.h wine1.7-1.7.55/dlls/msvcrt/printf.h --- wine1.7-1.7.50/dlls/msvcrt/printf.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcrt/printf.h 2015-11-13 14:32:40.000000000 +0000 @@ -34,7 +34,7 @@ { APICHAR Sign, LeftAlign, Alternate, PadZero; int FieldLength, Precision; - APICHAR IntegerLength, IntegerDouble; + APICHAR IntegerLength, IntegerDouble, IntegerNative; APICHAR WideString; APICHAR Format; } FUNC_NAME(pf_flags); @@ -82,7 +82,7 @@ { int i, r = 0, written; - if(flags->Sign && !strchr("diaeEfgG", flags->Format)) + if(flags->Sign && !strchr("diaeEfFgG", flags->Format)) flags->Sign = 0; if(left && flags->Sign) { @@ -206,8 +206,9 @@ } static inline int FUNC_NAME(pf_handle_string)(FUNC_NAME(puts_clbk) pf_puts, void *puts_ctx, - const void *str, int len, FUNC_NAME(pf_flags) *flags, MSVCRT_pthreadlocinfo locinfo) + const void *str, int len, FUNC_NAME(pf_flags) *flags, MSVCRT_pthreadlocinfo locinfo, BOOL legacy_wide) { + BOOL complement_is_narrow = legacy_wide ? (sizeof(APICHAR)==sizeof(MSVCRT_wchar_t)) : FALSE; #ifdef PRINTF_WIDE static const MSVCRT_wchar_t nullW[] = {'(','n','u','l','l',')',0}; @@ -223,7 +224,7 @@ if(flags->IntegerLength == 'h') return FUNC_NAME(pf_output_format_str)(pf_puts, puts_ctx, str, len, flags, locinfo); - if((flags->Format=='S' || flags->Format=='C') == (sizeof(APICHAR)==sizeof(MSVCRT_wchar_t))) + if((flags->Format=='S' || flags->Format=='C') == complement_is_narrow) return FUNC_NAME(pf_output_format_str)(pf_puts, puts_ctx, str, len, flags, locinfo); else return FUNC_NAME(pf_output_format_wstr)(pf_puts, puts_ctx, str, len, flags, locinfo); @@ -304,7 +305,7 @@ } } -static inline void FUNC_NAME(pf_fixup_exponent)(char *buf) +static inline void FUNC_NAME(pf_fixup_exponent)(char *buf, BOOL three_digit_exp) { char* tmp = buf; @@ -313,7 +314,11 @@ if(tmp[0] && (tmp[1]=='+' || tmp[1]=='-') && isdigit(tmp[2]) && isdigit(tmp[3])) { +#if _MSVCR_VER >= 140 + BOOL two_digit_exp = !three_digit_exp; +#else BOOL two_digit_exp = (MSVCRT__get_output_format() == MSVCRT__TWO_DIGIT_EXPONENT); +#endif tmp += 2; if(isdigit(tmp[2])) { @@ -336,7 +341,7 @@ } int FUNC_NAME(pf_printf)(FUNC_NAME(puts_clbk) pf_puts, void *puts_ctx, const APICHAR *fmt, - MSVCRT__locale_t locale, BOOL positional_params, BOOL invoke_invalid_param_handler, + MSVCRT__locale_t locale, DWORD options, args_clbk pf_args, void *args_ctx, __ms_va_list *valist) { MSVCRT_pthreadlocinfo locinfo; @@ -344,6 +349,15 @@ APICHAR buf[32]; int written = 0, pos, i; FUNC_NAME(pf_flags) flags; + BOOL positional_params = options & MSVCRT_PRINTF_POSITIONAL_PARAMS; + BOOL invoke_invalid_param_handler = options & MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER; +#if _MSVCR_VER >= 140 + BOOL legacy_wide = options & UCRTBASE_PRINTF_LEGACY_WIDE_SPECIFIERS; + BOOL legacy_msvcrt_compat = options & UCRTBASE_PRINTF_LEGACY_MSVCRT_COMPATIBILITY; + BOOL three_digit_exp = options & UCRTBASE_PRINTF_LEGACY_THREE_DIGIT_EXPONENTS; +#else + BOOL legacy_wide = TRUE, legacy_msvcrt_compat = TRUE, three_digit_exp = TRUE; +#endif TRACE("Format is: %s\n", FUNC_NAME(debugstr)(fmt)); @@ -456,10 +470,14 @@ else if(isdigit(*(p+1)) || !*(p+1)) break; else - p++; + flags.IntegerNative = *p++; } else if(*p == 'w') flags.WideString = *p++; - else if(*p == 'F') +#if _MSVCR_VER >= 140 + else if(*p == 'z') + flags.IntegerNative = *p++; +#endif + else if((*p == 'F' || *p == 'N') && legacy_msvcrt_compat) p++; /* ignore */ else break; @@ -470,14 +488,14 @@ if(flags.Format == 's' || flags.Format == 'S') { i = FUNC_NAME(pf_handle_string)(pf_puts, puts_ctx, pf_args(args_ctx, pos, VT_PTR, valist).get_ptr, - -1, &flags, locinfo); + -1, &flags, locinfo, legacy_wide); } else if(flags.Format == 'c' || flags.Format == 'C') { int ch = pf_args(args_ctx, pos, VT_INT, valist).get_int; if((ch&0xff) != ch) FIXME("multibyte characters printing not supported\n"); - i = FUNC_NAME(pf_handle_string)(pf_puts, puts_ctx, &ch, 1, &flags, locinfo); + i = FUNC_NAME(pf_handle_string)(pf_puts, puts_ctx, &ch, 1, &flags, locinfo, legacy_wide); } else if(flags.Format == 'p') { flags.Format = 'X'; flags.PadZero = '0'; @@ -519,7 +537,7 @@ if(!tmp) return -1; - if(flags.IntegerDouble) + if(flags.IntegerDouble || (flags.IntegerNative && sizeof(void*) == 8)) FUNC_NAME(pf_integer_conv)(tmp, max_len, &flags, pf_args(args_ctx, pos, VT_I8, valist).get_longlong); else if(flags.Format=='d' || flags.Format=='i') @@ -538,7 +556,7 @@ #endif if(tmp != buf) HeapFree(GetProcessHeap(), 0, tmp); - } else if(flags.Format && strchr("aeEfgG", flags.Format)) { + } else if(flags.Format && strchr("aeEfFgG", flags.Format)) { char float_fmt[20], buf_a[32], *tmp = buf_a, *decimal_point; int len = flags.Precision + 10; double val = pf_args(args_ctx, pos, VT_R8, valist).get_double; @@ -569,7 +587,7 @@ } } - if(flags.Format=='f') { + if(flags.Format=='f' || flags.Format=='F') { if(val>-10.0 && val<10.0) i = 1; else @@ -592,9 +610,24 @@ val = -val; } - sprintf(tmp, float_fmt, val); - if(toupper(flags.Format)=='E' || toupper(flags.Format)=='G') - FUNC_NAME(pf_fixup_exponent)(tmp); + if((inf || nan || ind) && !legacy_msvcrt_compat) { + static const char inf_str[] = "inf"; + static const char ind_str[] = "nan(ind)"; + static const char nan_str[] = "nan"; + if(inf) + sprintf(tmp, inf_str); + else if(ind) + sprintf(tmp, ind_str); + else + sprintf(tmp, nan_str); + if (strchr("EFG", flags.Format)) + for(i=0; tmp[i]; i++) + tmp[i] = toupper(tmp[i]); + } else { + sprintf(tmp, float_fmt, val); + if(toupper(flags.Format)=='E' || toupper(flags.Format)=='G') + FUNC_NAME(pf_fixup_exponent)(tmp, three_digit_exp); + } decimal_point = strchr(tmp, '.'); if(decimal_point) { @@ -701,8 +734,8 @@ printf_arg *args = args_ctx; int i, j; - i = FUNC_NAME(pf_printf)(FUNC_NAME(puts_clbk_str), &puts_ctx, format, NULL, TRUE, FALSE, - arg_clbk_type, args_ctx, NULL); + i = FUNC_NAME(pf_printf)(FUNC_NAME(puts_clbk_str), &puts_ctx, format, NULL, + MSVCRT_PRINTF_POSITIONAL_PARAMS, arg_clbk_type, args_ctx, NULL); if(i < 0) return i; diff -Nru wine1.7-1.7.50/dlls/msvcrt/scanf.c wine1.7-1.7.55/dlls/msvcrt/scanf.c --- wine1.7-1.7.50/dlls/msvcrt/scanf.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcrt/scanf.c 2015-11-13 14:32:40.000000000 +0000 @@ -661,6 +661,27 @@ return res; } + +/********************************************************************* + * __stdio_common_vsscanf (MSVCRT.@) + */ +int CDECL MSVCRT__stdio_common_vsscanf(unsigned __int64 options, + const char *input, MSVCRT_size_t length, + const char *format, + MSVCRT__locale_t locale, + __ms_va_list valist) +{ + /* LEGACY_WIDE_SPECIFIERS only has got an effect on the wide + * scanf. LEGACY_MSVCRT_COMPATIBILITY affects parsing of nan/inf, + * but parsing of those isn't implemented at all yet. */ + if (options & ~UCRTBASE_SCANF_MASK) + FIXME("options %s not handled\n", wine_dbgstr_longlong(options)); + if (options & UCRTBASE_SCANF_SECURECRT) + return MSVCRT_vsnscanf_s_l(input, length, format, locale, valist); + else + return MSVCRT_vsnscanf_l(input, length, format, locale, valist); +} + /********************************************************************* * _snwscanf (MSVCRT.@) */ diff -Nru wine1.7-1.7.50/dlls/msvcrt/string.c wine1.7-1.7.55/dlls/msvcrt/string.c --- wine1.7-1.7.50/dlls/msvcrt/string.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcrt/string.c 2015-11-13 14:32:40.000000000 +0000 @@ -314,6 +314,7 @@ double ret; long double lret=1, expcnt = 10; BOOL found_digit = FALSE, negexp; + int base = 10; if(err) *err = 0; @@ -339,16 +340,50 @@ } else if(*p == '+') p++; - while(isdigit(*p)) { +#if _MSVCR_VER >= 140 + if(tolower(p[0]) == 'i' && tolower(p[1]) == 'n' && tolower(p[2]) == 'f') { + if(end) + *end = (char*) &p[3]; + if(tolower(p[3]) == 'i' && tolower(p[4]) == 'n' && tolower(p[5]) == 'i' && + tolower(p[6]) == 't' && tolower(p[7]) == 'y' && end) + *end = (char*) &p[8]; + return sign*INFINITY; + } + if(tolower(p[0]) == 'n' && + tolower(p[1]) == 'a' && + tolower(p[2]) == 'n') { + if(end) + *end = (char*) &p[3]; + return NAN; + } + + if(p[0] == '0' && tolower(p[1]) == 'x') { + base = 16; + expcnt = 2; + p += 2; + } +#endif + + while(isdigit(*p) || + (base == 16 && ((*p >= 'a' && *p <= 'f') || (*p >= 'A' && *p <= 'F')))) { + char c = *p++; + int val; found_digit = TRUE; - hlp = d*10+*(p++)-'0'; - if(d>MSVCRT_UI64_MAX/10 || hlp= 'a' && c <= 'f') + val = 10 + c - 'a'; + else + val = 10 + c - 'A'; + hlp = d*base+val; + if(d>MSVCRT_UI64_MAX/base || hlp= 'a' && *p <= 'f') || (*p >= 'A' && *p <= 'F')))) { exp++; p++; } @@ -356,16 +391,25 @@ if(*p == *locinfo->lconv->decimal_point) p++; - while(isdigit(*p)) { + while(isdigit(*p) || + (base == 16 && ((*p >= 'a' && *p <= 'f') || (*p >= 'A' && *p <= 'F')))) { + char c = *p++; + int val; found_digit = TRUE; - hlp = d*10+*(p++)-'0'; - if(d>MSVCRT_UI64_MAX/10 || hlp= 'a' && c <= 'f') + val = 10 + c - 'a'; + else + val = 10 + c - 'A'; + hlp = d*base+val; + if(d>MSVCRT_UI64_MAX/base || hlp= 'a' && *p <= 'f') || (*p >= 'A' && *p <= 'F')))) p++; if(!found_digit) { @@ -374,7 +418,11 @@ return 0.0; } - if(*p=='e' || *p=='E' || *p=='d' || *p=='D') { + if(base == 16) + exp *= 4; + + if((base == 10 && (*p=='e' || *p=='E' || *p=='d' || *p=='D')) || + (base == 16 && (*p=='p' || *p=='P'))) { int e=0, s=1; p++; diff -Nru wine1.7-1.7.50/dlls/msvcrt/tests/data.c wine1.7-1.7.55/dlls/msvcrt/tests/data.c --- wine1.7-1.7.50/dlls/msvcrt/tests/data.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcrt/tests/data.c 2015-11-13 14:32:40.000000000 +0000 @@ -111,7 +111,7 @@ "Wrong value for _osver %04x expected %04x\n", osver, osvi.dwBuildNumber); ok(osplatform == osvi.dwPlatformId, - "Wrong value for _osplatform %x exprected %x\n", + "Wrong value for _osplatform %x expected %x\n", osplatform, osvi.dwPlatformId); } @@ -152,7 +152,7 @@ new_argc = *p___p___argc(); new_argv = *p___p___argv(); ok(new_argc == 4, "*__p___argc() = %d\n", new_argc); - ok(new_argv == argv, "*__p___argv() = %p, epxected %p\n", new_argv, argv); + ok(new_argv == argv, "*__p___argv() = %p, expected %p\n", new_argv, argv); }else { win_skip("__p___argc or __p___argv is not available\n"); } @@ -179,7 +179,7 @@ new_argc = *p___p___argc(); new_argv = *p___p___argv(); ok(new_argc == argc, "*__p___argc() = %d, expected %d\n", new_argc, argc); - ok(new_argv == argv, "*__p___argv() = %p, epxected %p\n", new_argv, argv); + ok(new_argv == argv, "*__p___argv() = %p, expected %p\n", new_argv, argv); } sprintf(filepath, "%swine_test/b", tmppath); diff -Nru wine1.7-1.7.50/dlls/msvcrt/tests/locale.c wine1.7-1.7.55/dlls/msvcrt/tests/locale.c --- wine1.7-1.7.50/dlls/msvcrt/tests/locale.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcrt/tests/locale.c 2015-11-13 14:32:40.000000000 +0000 @@ -676,9 +676,9 @@ * Unicode strings are only initialized on Windows 7 */ if(sizeof(void*) == 8) - ok(size==0x2c0 || broken(size==0x170), "strucure size: %x\n", size); + ok(size==0x2c0 || broken(size==0x170), "structure size: %x\n", size); else - ok(size==0x164 || broken(size==0xb8), "strucure size: %x\n", size); + ok(size==0x164 || broken(size==0xb8), "structure size: %x\n", size); ok(!strcmp(ret->str[0], "Sun"), "ret->str[0] = %s\n", ret->str[0]); ok(!strcmp(ret->str[1], "Mon"), "ret->str[1] = %s\n", ret->str[1]); diff -Nru wine1.7-1.7.50/dlls/msvcrt/tests/printf.c wine1.7-1.7.55/dlls/msvcrt/tests/printf.c --- wine1.7-1.7.50/dlls/msvcrt/tests/printf.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcrt/tests/printf.c 2015-11-13 14:32:40.000000000 +0000 @@ -321,6 +321,11 @@ ok(!strcmp(buffer,"D"),"I64D failed: %s\n",buffer); ok( r==1, "return count wrong\n"); + format = "%zx"; + r = sprintf(buffer,format,1); + ok(!strcmp(buffer, "zx"), "Problem with \"z\" interpretation\n"); + ok( r==2, "return count wrong\n"); + format = "% d"; r = sprintf(buffer,format,1); ok(!strcmp(buffer, " 1"),"Problem with sign place-holder: '%s'\n",buffer); @@ -413,10 +418,20 @@ ok(!strcmp(buffer,"0000000000000039"),"Pointer formatted incorrectly \"%s\"\n",buffer); ok( r==16, "return count wrong\n"); + format = "%Np"; + r = sprintf(buffer,format,(void *)57); + ok(!strcmp(buffer,"0000000000000039"),"Pointer formatted incorrectly \"%s\"\n",buffer); + ok( r==16, "return count wrong\n"); + format = "%#-020p"; r = sprintf(buffer,format,(void *)57); ok(!strcmp(buffer,"0X0000000000000039 "),"Pointer formatted incorrectly\n"); ok( r==20, "return count wrong\n"); + + format = "%Ix %d"; + r = sprintf(buffer,format,(size_t)0x12345678123456,1); + ok(!strcmp(buffer,"12345678123456 1"),"buffer = %s\n",buffer); + ok( r==16, "return count wrong\n"); } else { @@ -435,10 +450,20 @@ ok(!strcmp(buffer,"00000039"),"Pointer formatted incorrectly \"%s\"\n",buffer); ok( r==8, "return count wrong\n"); + format = "%Np"; + r = sprintf(buffer,format,(void *)57); + ok(!strcmp(buffer,"00000039"),"Pointer formatted incorrectly \"%s\"\n",buffer); + ok( r==8, "return count wrong\n"); + format = "%#-012p"; r = sprintf(buffer,format,(void *)57); ok(!strcmp(buffer,"0X00000039 "),"Pointer formatted incorrectly\n"); ok( r==12, "return count wrong\n"); + + format = "%Ix %d"; + r = sprintf(buffer,format,0x123456,1); + ok(!strcmp(buffer,"123456 1"),"buffer = %s\n",buffer); + ok( r==8, "return count wrong\n"); } format = "%04s"; @@ -670,6 +695,11 @@ ok(!strcmp(buffer,""), "failed\n"); ok( r==0, "return count wrong\n"); + format = "%N"; + r = sprintf(buffer, format,-1); + ok(!strcmp(buffer,""), "failed\n"); + ok( r==0, "return count wrong\n"); + format = "%H"; r = sprintf(buffer, format,-1); ok(!strcmp(buffer,"H"), "failed\n"); @@ -787,7 +817,7 @@ fmt, expect, n); ok (!memcmp (fmt, buffer, valid), "\"%s\": rendered \"%.*s\"\n", fmt, valid, buffer); - }; + } } static void test_fprintf(void) diff -Nru wine1.7-1.7.50/dlls/msvcrt/tests/string.c wine1.7-1.7.55/dlls/msvcrt/tests/string.c --- wine1.7-1.7.50/dlls/msvcrt/tests/string.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcrt/tests/string.c 2015-11-13 14:32:40.000000000 +0000 @@ -1108,7 +1108,7 @@ /* Test NULL input string and valid size. */ errno = EBADF; - ret = p_wcslwr_s(NULL, sizeof(buffer)/sizeof(wchar_t)); + ret = p_wcslwr_s(NULL, sizeof(buffer)/sizeof(buffer[0])); ok(ret == EINVAL, "expected EINVAL, got %d\n", ret); ok(errno == EINVAL, "expected errno EINVAL, got %d\n", errno); @@ -1728,6 +1728,7 @@ const char double3[] = "INF"; const char double4[] = ".21e12"; const char double5[] = "214353e-3"; + const char double6[] = "NAN"; const char overflow[] = "1d9999999999999999999"; const char white_chars[] = " d10"; @@ -1754,6 +1755,10 @@ ok(almost_equal(d, 214.353), "d = %lf\n", d); ok(end == double5+9, "incorrect end (%d)\n", (int)(end-double5)); + d = strtod(double6, &end); + ok(almost_equal(d, 0), "d = %lf\n", d); + ok(end == double6, "incorrect end (%d)\n", (int)(end-double6)); + d = strtod("12.1d2", NULL); ok(almost_equal(d, 12.1e2), "d = %lf\n", d); @@ -2603,6 +2608,7 @@ static void test_tolower(void) { + WCHAR chw, lower; char ch, lch; int ret, len; @@ -2633,7 +2639,10 @@ ch = 0xF4; errno = 0xdeadbeef; ret = p_tolower(ch); - len = LCMapStringA(0, LCMAP_LOWERCASE, &ch, 1, &lch, 1); + if(!MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, &ch, 1, &chw, 1) || + LCMapStringW(CP_ACP, LCMAP_LOWERCASE, &chw, 1, &lower, 1) != 1 || + (len = WideCharToMultiByte(CP_ACP, 0, &lower, 1, &lch, 1, NULL, NULL)) != 1) + len = 0; if(len) ok(ret==(unsigned char)lch || broken(ret==ch)/*WinXP-*/, "ret = %x\n", ret); else @@ -2644,7 +2653,10 @@ ch = 0xD0; errno = 0xdeadbeef; ret = p_tolower(ch); - len = LCMapStringA(0, LCMAP_LOWERCASE, &ch, 1, &lch, 1); + if(!MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, &ch, 1, &chw, 1) || + LCMapStringW(CP_ACP, LCMAP_LOWERCASE, &chw, 1, &lower, 1) != 1 || + (len = WideCharToMultiByte(CP_ACP, 0, &lower, 1, &lch, 1, NULL, NULL)) != 1) + len = 0; if(len) ok(ret==(unsigned char)lch || broken(ret==ch)/*WinXP-*/, "ret = %x\n", ret); else diff -Nru wine1.7-1.7.50/dlls/msvcrt/time.c wine1.7-1.7.55/dlls/msvcrt/time.c --- wine1.7-1.7.50/dlls/msvcrt/time.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcrt/time.c 2015-11-13 14:32:40.000000000 +0000 @@ -1358,7 +1358,7 @@ if (!MSVCRT_CHECK_PMT(mstm != NULL)) return MSVCRT_EINVAL; ret = MSVCRT_asctime_s(buffer, sizeof(buffer), mstm); - if(!ret) + if(ret) return ret; MultiByteToWideChar(CP_ACP, 0, buffer, -1, time, size); return 0; @@ -1469,6 +1469,51 @@ #endif /********************************************************************* + * _wctime64_s (MSVCRT.@) + */ +int CDECL MSVCRT__wctime64_s(MSVCRT_wchar_t *buf, + MSVCRT_size_t size, const MSVCRT___time64_t *time) +{ + struct MSVCRT_tm tm; + int ret; + + if(!MSVCRT_CHECK_PMT(buf != NULL)) return MSVCRT_EINVAL; + if(!MSVCRT_CHECK_PMT(size != 0)) return MSVCRT_EINVAL; + buf[0] = 0; + if(!MSVCRT_CHECK_PMT(time != NULL)) return MSVCRT_EINVAL; + if(!MSVCRT_CHECK_PMT(*time >= 0)) return MSVCRT_EINVAL; + if(!MSVCRT_CHECK_PMT(*time <= _MAX__TIME64_T)) return MSVCRT_EINVAL; + + ret = _localtime64_s(&tm, time); + if(ret != 0) + return ret; + + return MSVCRT__wasctime_s(buf, size, &tm); +} + +/********************************************************************* + * _wctime32_s (MSVCRT.@) + */ +int CDECL MSVCRT__wctime32_s(MSVCRT_wchar_t *buf, MSVCRT_size_t size, + const MSVCRT___time32_t *time) +{ + struct MSVCRT_tm tm; + int ret; + + if(!MSVCRT_CHECK_PMT(buf != NULL)) return MSVCRT_EINVAL; + if(!MSVCRT_CHECK_PMT(size != 0)) return MSVCRT_EINVAL; + buf[0] = 0; + if(!MSVCRT_CHECK_PMT(time != NULL)) return MSVCRT_EINVAL; + if(!MSVCRT_CHECK_PMT(*time >= 0)) return MSVCRT_EINVAL; + + ret = _localtime32_s(&tm, time); + if(ret != 0) + return ret; + + return MSVCRT__wasctime_s(buf, size, &tm); +} + +/********************************************************************* * _get_timezone (MSVCR100.@) */ int CDECL _get_timezone(LONG *timezone) diff -Nru wine1.7-1.7.50/dlls/msvcrt/wcs.c wine1.7-1.7.55/dlls/msvcrt/wcs.c --- wine1.7-1.7.50/dlls/msvcrt/wcs.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcrt/wcs.c 2015-11-13 14:32:40.000000000 +0000 @@ -688,12 +688,57 @@ struct _str_ctx_a ctx = {len, str}; int ret; - ret = pf_printf_a(puts_clbk_str_a, &ctx, format, NULL, FALSE, FALSE, + ret = pf_printf_a(puts_clbk_str_a, &ctx, format, NULL, 0, arg_clbk_valist, NULL, &valist); puts_clbk_str_a(&ctx, 1, &nullbyte); return ret; } +static int puts_clbk_str_c99_a(void *ctx, int len, const char *str) +{ + struct _str_ctx_a *out = ctx; + + if(!out->buf) + return len; + + if(out->len < len) { + memcpy(out->buf, str, out->len); + out->buf += out->len; + out->len = 0; + return len; + } + + memcpy(out->buf, str, len); + out->buf += len; + out->len -= len; + return len; +} + +/********************************************************************* + * __stdio_common_vsprintf (MSVCRT.@) + */ +int CDECL MSVCRT__stdio_common_vsprintf( unsigned __int64 options, char *str, MSVCRT_size_t len, const char *format, + MSVCRT__locale_t locale, __ms_va_list valist ) +{ + static const char nullbyte = '\0'; + struct _str_ctx_a ctx = {len, str}; + int ret; + + if (options & ~UCRTBASE_PRINTF_MASK) + FIXME("options %s not handled\n", wine_dbgstr_longlong(options)); + ret = pf_printf_a(puts_clbk_str_c99_a, + &ctx, format, locale, options & UCRTBASE_PRINTF_MASK, arg_clbk_valist, NULL, &valist); + puts_clbk_str_a(&ctx, 1, &nullbyte); + + if(options & UCRTBASE_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION) + return ret>len ? -1 : ret; + if(ret>=len) { + if(len) str[len-1] = 0; + return (options & UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR) ? ret : -2; + } + return ret; +} + /********************************************************************* * _vsnprintf_l (MSVCRT.@) */ @@ -704,7 +749,7 @@ struct _str_ctx_a ctx = {len, str}; int ret; - ret = pf_printf_a(puts_clbk_str_a, &ctx, format, locale, FALSE, FALSE, + ret = pf_printf_a(puts_clbk_str_a, &ctx, format, locale, 0, arg_clbk_valist, NULL, &valist); puts_clbk_str_a(&ctx, 1, &nullbyte); return ret; @@ -733,11 +778,8 @@ return retval; } -/********************************************************************* - * _vsnprintf_s_l (MSVCRT.@) - */ -int CDECL MSVCRT_vsnprintf_s_l( char *str, MSVCRT_size_t sizeOfBuffer, - MSVCRT_size_t count, const char *format, +static int CDECL MSVCRT_vsnprintf_s_l_opt( char *str, MSVCRT_size_t sizeOfBuffer, + MSVCRT_size_t count, const char *format, DWORD options, MSVCRT__locale_t locale, __ms_va_list valist ) { static const char nullbyte = '\0'; @@ -751,7 +793,7 @@ ctx.len = len; ctx.buf = str; - ret = pf_printf_a(puts_clbk_str_a, &ctx, format, locale, FALSE, TRUE, + ret = pf_printf_a(puts_clbk_str_a, &ctx, format, locale, MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER | options, arg_clbk_valist, NULL, &valist); puts_clbk_str_a(&ctx, 1, &nullbyte); @@ -769,6 +811,16 @@ } /********************************************************************* + * _vsnprintf_s_l (MSVCRT.@) + */ +int CDECL MSVCRT_vsnprintf_s_l( char *str, MSVCRT_size_t sizeOfBuffer, + MSVCRT_size_t count, const char *format, + MSVCRT__locale_t locale, __ms_va_list valist ) +{ + return MSVCRT_vsnprintf_s_l_opt(str, sizeOfBuffer, count, format, 0, locale, valist); +} + +/********************************************************************* * _vsprintf_s_l (MSVCRT.@) */ int CDECL MSVCRT_vsprintf_s_l( char *str, MSVCRT_size_t count, const char *format, @@ -801,6 +853,30 @@ } /********************************************************************* + * __stdio_common_vsnprintf_s (MSVCRT.@) + */ +int CDECL MSVCRT__stdio_common_vsnprintf_s( unsigned __int64 options, + char *str, MSVCRT_size_t sizeOfBuffer, MSVCRT_size_t count, + const char *format, MSVCRT__locale_t locale, __ms_va_list valist ) +{ + if (options & ~UCRTBASE_PRINTF_MASK) + FIXME("options %s not handled\n", wine_dbgstr_longlong(options)); + return MSVCRT_vsnprintf_s_l_opt(str, sizeOfBuffer, count, format, options & UCRTBASE_PRINTF_MASK, locale, valist); +} + +/********************************************************************* + * __stdio_common_vsprintf_s (MSVCRT.@) + */ +int CDECL MSVCRT__stdio_common_vsprintf_s( unsigned __int64 options, + char *str, MSVCRT_size_t count, const char *format, + MSVCRT__locale_t locale, __ms_va_list valist ) +{ + if (options & ~UCRTBASE_PRINTF_MASK) + FIXME("options %s not handled\n", wine_dbgstr_longlong(options)); + return MSVCRT_vsnprintf_s_l_opt(str, INT_MAX, count, format, options & UCRTBASE_PRINTF_MASK, locale, valist); +} + +/********************************************************************* * vsprintf (MSVCRT.@) */ int CDECL MSVCRT_vsprintf( char *str, const char *format, __ms_va_list valist) @@ -842,10 +918,12 @@ *MSVCRT__errno() = MSVCRT_EINVAL; return ret; } else if(ret == 0) { - ret = pf_printf_a(puts_clbk_str_a, &puts_ctx, format, locale, FALSE, TRUE, + ret = pf_printf_a(puts_clbk_str_a, &puts_ctx, format, locale, + MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER, arg_clbk_valist, NULL, &args); } else { - ret = pf_printf_a(puts_clbk_str_a, &puts_ctx, format, locale, TRUE, TRUE, + ret = pf_printf_a(puts_clbk_str_a, &puts_ctx, format, locale, + MSVCRT_PRINTF_POSITIONAL_PARAMS | MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER, arg_clbk_positional, args_ctx, NULL); } @@ -924,7 +1002,7 @@ struct _str_ctx_w ctx = {len, str}; int ret; - ret = pf_printf_w(puts_clbk_str_w, &ctx, format, NULL, FALSE, FALSE, + ret = pf_printf_w(puts_clbk_str_w, &ctx, format, NULL, 0, arg_clbk_valist, NULL, &valist); puts_clbk_str_w(&ctx, 1, &nullbyte); return ret; @@ -941,7 +1019,7 @@ struct _str_ctx_w ctx = {len, str}; int ret; - ret = pf_printf_w(puts_clbk_str_w, &ctx, format, locale, FALSE, FALSE, + ret = pf_printf_w(puts_clbk_str_w, &ctx, format, locale, 0, arg_clbk_valist, NULL, &valist); puts_clbk_str_w(&ctx, 1, &nullbyte); return ret; @@ -966,10 +1044,11 @@ *MSVCRT__errno() = MSVCRT_EINVAL; return ret; } else if(ret == 0) - ret = pf_printf_w(puts_clbk_str_w, &puts_ctx, format, locale, FALSE, TRUE, + ret = pf_printf_w(puts_clbk_str_w, &puts_ctx, format, locale, MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER, arg_clbk_valist, NULL, &args); else - ret = pf_printf_w(puts_clbk_str_w, &puts_ctx, format, locale, TRUE, TRUE, + ret = pf_printf_w(puts_clbk_str_w, &puts_ctx, format, locale, + MSVCRT_PRINTF_POSITIONAL_PARAMS | MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER, arg_clbk_positional, args_ctx, NULL); puts_clbk_str_w(&puts_ctx, 1, &nullbyte); @@ -1002,7 +1081,7 @@ ctx.len = len; ctx.buf = str; - ret = pf_printf_w(puts_clbk_str_w, &ctx, format, locale, FALSE, TRUE, + ret = pf_printf_w(puts_clbk_str_w, &ctx, format, locale, MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER, arg_clbk_valist, NULL, &valist); puts_clbk_str_w(&ctx, 1, &nullbyte); @@ -1084,6 +1163,52 @@ return retval; } +static int puts_clbk_str_c99_w(void *ctx, int len, const MSVCRT_wchar_t *str) +{ + struct _str_ctx_w *out = ctx; + + if(!out->buf) + return len; + + if(out->len < len) { + memcpy(out->buf, str, out->len*sizeof(MSVCRT_wchar_t)); + out->buf += out->len; + out->len = 0; + return len; + } + + memcpy(out->buf, str, len*sizeof(MSVCRT_wchar_t)); + out->buf += len; + out->len -= len; + return len; +} + +/********************************************************************* + * __stdio_common_vswprintf (MSVCRT.@) + */ +int CDECL MSVCRT__stdio_common_vswprintf( unsigned __int64 options, + MSVCRT_wchar_t *str, MSVCRT_size_t len, const MSVCRT_wchar_t *format, + MSVCRT__locale_t locale, __ms_va_list valist ) +{ + static const MSVCRT_wchar_t nullbyte = '\0'; + struct _str_ctx_w ctx = {len, str}; + int ret; + + if (options & ~UCRTBASE_PRINTF_MASK) + FIXME("options %s not handled\n", wine_dbgstr_longlong(options)); + ret = pf_printf_w(puts_clbk_str_c99_w, + &ctx, format, locale, options & UCRTBASE_PRINTF_MASK, arg_clbk_valist, NULL, &valist); + puts_clbk_str_w(&ctx, 1, &nullbyte); + + if(options & UCRTBASE_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION) + return ret>len ? -1 : ret; + if(ret>=len) { + if(len) str[len-1] = 0; + return (options & UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR) ? ret : -2; + } + return ret; +} + /********************************************************************* * sprintf (MSVCRT.@) */ @@ -1259,10 +1384,11 @@ *MSVCRT__errno() = MSVCRT_EINVAL; return ret; } else if(ret == 0) - ret = pf_printf_a(puts_clbk_str_a, &puts_ctx, format, locale, FALSE, TRUE, + ret = pf_printf_a(puts_clbk_str_a, &puts_ctx, format, locale, MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER, arg_clbk_valist, NULL, &args); else - ret = pf_printf_a(puts_clbk_str_a, &puts_ctx, format, locale, TRUE, TRUE, + ret = pf_printf_a(puts_clbk_str_a, &puts_ctx, format, locale, + MSVCRT_PRINTF_POSITIONAL_PARAMS | MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER, arg_clbk_positional, args_ctx, NULL); puts_clbk_str_a(&puts_ctx, 1, &nullbyte); diff -Nru wine1.7-1.7.50/dlls/msvcrt20/msvcrt20.spec wine1.7-1.7.55/dlls/msvcrt20/msvcrt20.spec --- wine1.7-1.7.50/dlls/msvcrt20/msvcrt20.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcrt20/msvcrt20.spec 2015-11-13 14:32:40.000000000 +0000 @@ -88,10 +88,10 @@ @ stub -arch=win64 ??0ostrstream@@QEAA@PEADHH@Z @ thiscall -arch=win32 ??0ostrstream@@QAE@XZ(ptr long) msvcirt.??0ostrstream@@QAE@XZ @ cdecl -arch=win64 ??0ostrstream@@QEAA@XZ(ptr long) msvcirt.??0ostrstream@@QEAA@XZ -@ stub -arch=win32 ??0stdiobuf@@QAE@ABV0@@Z -@ stub -arch=win64 ??0stdiobuf@@QEAA@AEBV0@@Z -@ stub -arch=win32 ??0stdiobuf@@QAE@PAU_iobuf@@@Z -@ stub -arch=win64 ??0stdiobuf@@QEAA@PEAU_iobuf@@@Z +@ thiscall -arch=win32 ??0stdiobuf@@QAE@ABV0@@Z(ptr ptr) msvcirt.??0stdiobuf@@QAE@ABV0@@Z +@ cdecl -arch=win64 ??0stdiobuf@@QEAA@AEBV0@@Z(ptr ptr) msvcirt.??0stdiobuf@@QEAA@AEBV0@@Z +@ thiscall -arch=win32 ??0stdiobuf@@QAE@PAU_iobuf@@@Z(ptr ptr) msvcirt.??0stdiobuf@@QAE@PAU_iobuf@@@Z +@ cdecl -arch=win64 ??0stdiobuf@@QEAA@PEAU_iobuf@@@Z(ptr ptr) msvcirt.??0stdiobuf@@QEAA@PEAU_iobuf@@@Z @ stub -arch=win32 ??0stdiostream@@QAE@ABV0@@Z @ stub -arch=win64 ??0stdiostream@@QEAA@AEBV0@@Z @ stub -arch=win32 ??0stdiostream@@QAE@PAU_iobuf@@@Z @@ -108,16 +108,16 @@ @ stub -arch=win64 ??0strstream@@QEAA@PEADHH@Z @ stub -arch=win32 ??0strstream@@QAE@XZ @ stub -arch=win64 ??0strstream@@QEAA@XZ -@ stub -arch=win32 ??0strstreambuf@@QAE@ABV0@@Z -@ stub -arch=win64 ??0strstreambuf@@QEAA@AEBV0@@Z -@ stub -arch=win32 ??0strstreambuf@@QAE@H@Z -@ stub -arch=win64 ??0strstreambuf@@QEAA@H@Z -@ stub -arch=win32 ??0strstreambuf@@QAE@P6APAXJ@ZP6AXPAX@Z@Z -@ stub -arch=win64 ??0strstreambuf@@QEAA@P6APEAXJ@ZP6AXPEAX@Z@Z -@ stub -arch=win32 ??0strstreambuf@@QAE@PADH0@Z -@ stub -arch=win64 ??0strstreambuf@@QEAA@PEADH0@Z -@ stub -arch=win32 ??0strstreambuf@@QAE@XZ -@ stub -arch=win64 ??0strstreambuf@@QEAA@XZ +@ thiscall -arch=win32 ??0strstreambuf@@QAE@ABV0@@Z(ptr ptr) msvcirt.??0strstreambuf@@QAE@ABV0@@Z +@ cdecl -arch=win64 ??0strstreambuf@@QEAA@AEBV0@@Z(ptr ptr) msvcirt.??0strstreambuf@@QEAA@AEBV0@@Z +@ thiscall -arch=win32 ??0strstreambuf@@QAE@H@Z(ptr long) msvcirt.??0strstreambuf@@QAE@H@Z +@ cdecl -arch=win64 ??0strstreambuf@@QEAA@H@Z(ptr long) msvcirt.??0strstreambuf@@QEAA@H@Z +@ thiscall -arch=win32 ??0strstreambuf@@QAE@P6APAXJ@ZP6AXPAX@Z@Z(ptr ptr ptr) msvcirt.??0strstreambuf@@QAE@P6APAXJ@ZP6AXPAX@Z@Z +@ cdecl -arch=win64 ??0strstreambuf@@QEAA@P6APEAXJ@ZP6AXPEAX@Z@Z(ptr ptr ptr) msvcirt.??0strstreambuf@@QEAA@P6APEAXJ@ZP6AXPEAX@Z@Z +@ thiscall -arch=win32 ??0strstreambuf@@QAE@PADH0@Z(ptr ptr long ptr) msvcirt.??0strstreambuf@@QAE@PADH0@Z +@ cdecl -arch=win64 ??0strstreambuf@@QEAA@PEADH0@Z(ptr ptr long ptr) msvcirt.??0strstreambuf@@QEAA@PEADH0@Z +@ thiscall -arch=win32 ??0strstreambuf@@QAE@XZ(ptr) msvcirt.??0strstreambuf@@QAE@XZ +@ cdecl -arch=win64 ??0strstreambuf@@QEAA@XZ(ptr) msvcirt.??0strstreambuf@@QEAA@XZ @ stub -arch=win32 ??1Iostream_init@@QAE@XZ @ stub -arch=win64 ??1Iostream_init@@QEAA@XZ @ thiscall -arch=win32 ??1filebuf@@UAE@XZ(ptr) msvcirt.??1filebuf@@UAE@XZ @@ -144,16 +144,16 @@ @ stub -arch=win64 ??1ostream_withassign@@UEAA@XZ @ thiscall -arch=win32 ??1ostrstream@@UAE@XZ(ptr) msvcirt.??1ostrstream@@UAE@XZ @ cdecl -arch=win64 ??1ostrstream@@UEAA@XZ(ptr) msvcirt.??1ostrstream@@UEAA@XZ -@ stub -arch=win32 ??1stdiobuf@@UAE@XZ -@ stub -arch=win64 ??1stdiobuf@@UEAA@XZ +@ thiscall -arch=win32 ??1stdiobuf@@UAE@XZ(ptr) msvcirt.??1stdiobuf@@UAE@XZ +@ cdecl -arch=win64 ??1stdiobuf@@UEAA@XZ(ptr) msvcirt.??1stdiobuf@@UEAA@XZ @ stub -arch=win32 ??1stdiostream@@UAE@XZ @ stub -arch=win64 ??1stdiostream@@UEAA@XZ @ thiscall -arch=win32 ??1streambuf@@UAE@XZ(ptr) msvcirt.??1streambuf@@UAE@XZ @ cdecl -arch=win64 ??1streambuf@@UEAA@XZ(ptr) msvcirt.??1streambuf@@UEAA@XZ @ stub -arch=win32 ??1strstream@@UAE@XZ @ stub -arch=win64 ??1strstream@@UEAA@XZ -@ stub -arch=win32 ??1strstreambuf@@UAE@XZ -@ stub -arch=win64 ??1strstreambuf@@UEAA@XZ +@ thiscall -arch=win32 ??1strstreambuf@@UAE@XZ(ptr) msvcirt.??1strstreambuf@@UAE@XZ +@ cdecl -arch=win64 ??1strstreambuf@@UEAA@XZ(ptr) msvcirt.??1strstreambuf@@UEAA@XZ @ cdecl -arch=win32 ??2@YAPAXI@Z(long) msvcrt.??2@YAPAXI@Z @ cdecl -arch=win64 ??2@YAPEAX_K@Z(long) msvcrt.??2@YAPEAX_K@Z @ cdecl -arch=win32 ??3@YAXPAX@Z(ptr) msvcrt.??3@YAXPAX@Z @@ -198,16 +198,16 @@ @ stub -arch=win64 ??4ostream_withassign@@QEAAAEAVostream@@PEAVstreambuf@@@Z @ stub -arch=win32 ??4ostrstream@@QAEAAV0@ABV0@@Z @ stub -arch=win64 ??4ostrstream@@QEAAAEAV0@AEBV0@@Z -@ stub -arch=win32 ??4stdiobuf@@QAEAAV0@ABV0@@Z -@ stub -arch=win64 ??4stdiobuf@@QEAAAEAV0@AEBV0@@Z +@ thiscall -arch=win32 ??4stdiobuf@@QAEAAV0@ABV0@@Z(ptr ptr) msvcirt.??4stdiobuf@@QAEAAV0@ABV0@@Z +@ cdecl -arch=win64 ??4stdiobuf@@QEAAAEAV0@AEBV0@@Z(ptr ptr) msvcirt.??4stdiobuf@@QEAAAEAV0@AEBV0@@Z @ stub -arch=win32 ??4stdiostream@@QAEAAV0@AAV0@@Z @ stub -arch=win64 ??4stdiostream@@QEAAAEAV0@AEAV0@@Z @ thiscall -arch=win32 ??4streambuf@@QAEAAV0@ABV0@@Z(ptr ptr) msvcirt.??4streambuf@@QAEAAV0@ABV0@@Z @ cdecl -arch=win64 ??4streambuf@@QEAAAEAV0@AEBV0@@Z(ptr ptr) msvcirt.??4streambuf@@QEAAAEAV0@AEBV0@@Z @ stub -arch=win32 ??4strstream@@QAEAAV0@AAV0@@Z @ stub -arch=win64 ??4strstream@@QEAAAEAV0@AEAV0@@Z -@ stub -arch=win32 ??4strstreambuf@@QAEAAV0@ABV0@@Z -@ stub -arch=win64 ??4strstreambuf@@QEAAAEAV0@AEBV0@@Z +@ thiscall -arch=win32 ??4strstreambuf@@QAEAAV0@ABV0@@Z(ptr ptr) msvcirt.??4strstreambuf@@QAEAAV0@ABV0@@Z +@ cdecl -arch=win64 ??4strstreambuf@@QEAAAEAV0@AEBV0@@Z(ptr ptr) msvcirt.??4strstreambuf@@QEAAAEAV0@AEBV0@@Z @ stub -arch=win32 ??5istream@@QAEAAV0@AAC@Z @ stub -arch=win64 ??5istream@@QEAAAEAV0@AEAC@Z @ stub -arch=win32 ??5istream@@QAEAAV0@AAD@Z @@ -298,11 +298,11 @@ # @ extern ??_7ostream@@6B@ # @ extern ??_7ostream_withassign@@6B@ # @ extern ??_7ostrstream@@6B@ -# @ extern ??_7stdiobuf@@6B@ +@ extern ??_7stdiobuf@@6B@ msvcirt.??_7stdiobuf@@6B@ # @ extern ??_7stdiostream@@6B@ @ extern ??_7streambuf@@6B@ msvcirt.??_7streambuf@@6B@ # @ extern ??_7strstream@@6B@ -# @ extern ??_7strstreambuf@@6B@ +@ extern ??_7strstreambuf@@6B@ msvcirt.??_7strstreambuf@@6B@ # @ extern ??_8fstream@@7Bistream@@@ # @ extern ??_8fstream@@7Bostream@@@ # @ extern ??_8ifstream@@7B@ @@ -356,11 +356,11 @@ @ stub -arch=win32 ??_Eostream@@UAEPAXI@Z @ stub -arch=win32 ??_Eostream_withassign@@UAEPAXI@Z @ stub -arch=win32 ??_Eostrstream@@UAEPAXI@Z -@ stub -arch=win32 ??_Estdiobuf@@UAEPAXI@Z +@ thiscall -arch=win32 ??_Estdiobuf@@UAEPAXI@Z(ptr long) msvcirt.??_Estdiobuf@@UAEPAXI@Z @ stub -arch=win32 ??_Estdiostream@@UAEPAXI@Z @ thiscall -arch=win32 ??_Estreambuf@@UAEPAXI@Z(ptr long) msvcirt.??_Estreambuf@@UAEPAXI@Z @ stub -arch=win32 ??_Estrstream@@UAEPAXI@Z -@ stub -arch=win32 ??_Estrstreambuf@@UAEPAXI@Z +@ thiscall -arch=win32 ??_Estrstreambuf@@UAEPAXI@Z(ptr long) msvcirt.??_Estrstreambuf@@UAEPAXI@Z @ stub -arch=win32 ??_GIostream_init@@QAEPAXI@Z @ thiscall -arch=win32 ??_Gfilebuf@@UAEPAXI@Z(ptr long) msvcirt.??_Gfilebuf@@UAEPAXI@Z @ stub -arch=win32 ??_Gfstream@@UAEPAXI@Z @@ -374,11 +374,11 @@ @ stub -arch=win32 ??_Gostream@@UAEPAXI@Z @ stub -arch=win32 ??_Gostream_withassign@@UAEPAXI@Z @ stub -arch=win32 ??_Gostrstream@@UAEPAXI@Z -@ stub -arch=win32 ??_Gstdiobuf@@UAEPAXI@Z +@ thiscall -arch=win32 ??_Gstdiobuf@@UAEPAXI@Z(ptr long) msvcirt.??_Gstdiobuf@@UAEPAXI@Z @ stub -arch=win32 ??_Gstdiostream@@UAEPAXI@Z @ thiscall -arch=win32 ??_Gstreambuf@@UAEPAXI@Z(ptr long) msvcirt.??_Gstreambuf@@UAEPAXI@Z @ stub -arch=win32 ??_Gstrstream@@UAEPAXI@Z -@ stub -arch=win32 ??_Gstrstreambuf@@UAEPAXI@Z +@ thiscall -arch=win32 ??_Gstrstreambuf@@UAEPAXI@Z(ptr long) msvcirt.??_Gstrstreambuf@@UAEPAXI@Z @ cdecl -arch=win32 ?_query_new_handler@@YAP6AHI@ZXZ() msvcrt.?_query_new_handler@@YAP6AHI@ZXZ @ cdecl -arch=win64 ?_query_new_handler@@YAP6AH_K@ZXZ() msvcrt.?_query_new_handler@@YAP6AH_K@ZXZ @ cdecl ?_query_new_mode@@YAHXZ() msvcrt.?_query_new_mode@@YAHXZ @@ -435,8 +435,8 @@ @ cdecl -arch=win64 ?delbuf@ios@@QEBAHXZ(ptr) msvcirt.?delbuf@ios@@QEBAHXZ @ thiscall -arch=win32 ?doallocate@streambuf@@MAEHXZ(ptr) msvcirt.?doallocate@streambuf@@MAEHXZ @ cdecl -arch=win64 ?doallocate@streambuf@@MEAAHXZ(ptr) msvcirt.?doallocate@streambuf@@MEAAHXZ -@ stub -arch=win32 ?doallocate@strstreambuf@@MAEHXZ -@ stub -arch=win64 ?doallocate@strstreambuf@@MEAAHXZ +@ thiscall -arch=win32 ?doallocate@strstreambuf@@MAEHXZ(ptr) msvcirt.?doallocate@strstreambuf@@MAEHXZ +@ cdecl -arch=win64 ?doallocate@strstreambuf@@MEAAHXZ(ptr) msvcirt.?doallocate@strstreambuf@@MEAAHXZ @ stub -arch=win32 ?eatwhite@istream@@QAEXXZ @ stub -arch=win64 ?eatwhite@istream@@QEAAXXZ @ thiscall -arch=win32 ?eback@streambuf@@IBEPADXZ(ptr) msvcirt.?eback@streambuf@@IBEPADXZ @@ -477,8 +477,8 @@ @ stub -arch=win64 ?flush@@YAAEAVostream@@AEAV1@@Z @ stub -arch=win32 ?flush@ostream@@QAEAAV1@XZ @ stub -arch=win64 ?flush@ostream@@QEAAAEAV1@XZ -@ stub -arch=win32 ?freeze@strstreambuf@@QAEXH@Z -@ stub -arch=win64 ?freeze@strstreambuf@@QEAAXH@Z +@ thiscall -arch=win32 ?freeze@strstreambuf@@QAEXH@Z(ptr long) msvcirt.?freeze@strstreambuf@@QAEXH@Z +@ cdecl -arch=win64 ?freeze@strstreambuf@@QEAAXH@Z(ptr long) msvcirt.?freeze@strstreambuf@@QEAAXH@Z @ thiscall -arch=win32 ?gbump@streambuf@@IAEXH@Z(ptr long) msvcirt.?gbump@streambuf@@IAEXH@Z @ cdecl -arch=win64 ?gbump@streambuf@@IEAAXH@Z(ptr long) msvcirt.?gbump@streambuf@@IEAAXH@Z @ stub -arch=win32 ?gcount@istream@@QBEHXZ @@ -565,12 +565,12 @@ @ cdecl -arch=win64 ?out_waiting@streambuf@@QEBAHXZ(ptr) msvcirt.?out_waiting@streambuf@@QEBAHXZ @ thiscall -arch=win32 ?overflow@filebuf@@UAEHH@Z(ptr long) msvcirt.?overflow@filebuf@@UAEHH@Z @ cdecl -arch=win64 ?overflow@filebuf@@UEAAHH@Z(ptr long) msvcirt.?overflow@filebuf@@UEAAHH@Z -@ stub -arch=win32 ?overflow@stdiobuf@@UAEHH@Z -@ stub -arch=win64 ?overflow@stdiobuf@@UEAAHH@Z -@ stub -arch=win32 ?overflow@strstreambuf@@UAEHH@Z -@ stub -arch=win64 ?overflow@strstreambuf@@UEAAHH@Z -@ stub -arch=win32 ?pbackfail@stdiobuf@@UAEHH@Z -@ stub -arch=win64 ?pbackfail@stdiobuf@@UEAAHH@Z +@ thiscall -arch=win32 ?overflow@stdiobuf@@UAEHH@Z(ptr long) msvcirt.?overflow@stdiobuf@@UAEHH@Z +@ cdecl -arch=win64 ?overflow@stdiobuf@@UEAAHH@Z(ptr long) msvcirt.?overflow@stdiobuf@@UEAAHH@Z +@ thiscall -arch=win32 ?overflow@strstreambuf@@UAEHH@Z(ptr long) msvcirt.?overflow@strstreambuf@@UAEHH@Z +@ cdecl -arch=win64 ?overflow@strstreambuf@@UEAAHH@Z(ptr long) msvcirt.?overflow@strstreambuf@@UEAAHH@Z +@ thiscall -arch=win32 ?pbackfail@stdiobuf@@UAEHH@Z(ptr long) msvcirt.?pbackfail@stdiobuf@@UAEHH@Z +@ cdecl -arch=win64 ?pbackfail@stdiobuf@@UEAAHH@Z(ptr long) msvcirt.?pbackfail@stdiobuf@@UEAAHH@Z @ thiscall -arch=win32 ?pbackfail@streambuf@@UAEHH@Z(ptr long) msvcirt.?pbackfail@streambuf@@UAEHH@Z @ cdecl -arch=win64 ?pbackfail@streambuf@@UEAAHH@Z(ptr long) msvcirt.?pbackfail@streambuf@@UEAAHH@Z @ thiscall -arch=win32 ?pbase@streambuf@@IBEPADXZ(ptr) msvcirt.?pbase@streambuf@@IBEPADXZ @@ -631,12 +631,12 @@ @ stub -arch=win64 ?seekg@istream@@QEAAAEAV1@JW4seek_dir@ios@@@Z @ thiscall -arch=win32 ?seekoff@filebuf@@UAEJJW4seek_dir@ios@@H@Z(ptr long long long) msvcirt.?seekoff@filebuf@@UAEJJW4seek_dir@ios@@H@Z @ cdecl -arch=win64 ?seekoff@filebuf@@UEAAJJW4seek_dir@ios@@H@Z(ptr long long long) msvcirt.?seekoff@filebuf@@UEAAJJW4seek_dir@ios@@H@Z -@ stub -arch=win32 ?seekoff@stdiobuf@@UAEJJW4seek_dir@ios@@H@Z -@ stub -arch=win64 ?seekoff@stdiobuf@@UEAAJJW4seek_dir@ios@@H@Z +@ thiscall -arch=win32 ?seekoff@stdiobuf@@UAEJJW4seek_dir@ios@@H@Z(ptr long long long) msvcirt.?seekoff@stdiobuf@@UAEJJW4seek_dir@ios@@H@Z +@ cdecl -arch=win64 ?seekoff@stdiobuf@@UEAAJJW4seek_dir@ios@@H@Z(ptr long long long) msvcirt.?seekoff@stdiobuf@@UEAAJJW4seek_dir@ios@@H@Z @ thiscall -arch=win32 ?seekoff@streambuf@@UAEJJW4seek_dir@ios@@H@Z(ptr long long long) msvcirt.?seekoff@streambuf@@UAEJJW4seek_dir@ios@@H@Z @ cdecl -arch=win64 ?seekoff@streambuf@@UEAAJJW4seek_dir@ios@@H@Z(ptr long long long) msvcirt.?seekoff@streambuf@@UEAAJJW4seek_dir@ios@@H@Z -@ stub -arch=win32 ?seekoff@strstreambuf@@UAEJJW4seek_dir@ios@@H@Z -@ stub -arch=win64 ?seekoff@strstreambuf@@UEAAJJW4seek_dir@ios@@H@Z +@ thiscall -arch=win32 ?seekoff@strstreambuf@@UAEJJW4seek_dir@ios@@H@Z(ptr long long long) msvcirt.?seekoff@strstreambuf@@UAEJJW4seek_dir@ios@@H@Z +@ cdecl -arch=win64 ?seekoff@strstreambuf@@UEAAJJW4seek_dir@ios@@H@Z(ptr long long long) msvcirt.?seekoff@strstreambuf@@UEAAJJW4seek_dir@ios@@H@Z @ stub -arch=win32 ?seekp@ostream@@QAEAAV1@J@Z @ stub -arch=win64 ?seekp@ostream@@QEAAAEAV1@J@Z @ stub -arch=win32 ?seekp@ostream@@QAEAAV1@JW4seek_dir@ios@@@Z @@ -657,8 +657,8 @@ @ stub -arch=win64 ?setbuf@ofstream@@QEAAPEAVstreambuf@@PEADH@Z @ thiscall -arch=win32 ?setbuf@streambuf@@UAEPAV1@PADH@Z(ptr ptr long) msvcirt.?setbuf@streambuf@@UAEPAV1@PADH@Z @ cdecl -arch=win64 ?setbuf@streambuf@@UEAAPEAV1@PEADH@Z(ptr ptr long) msvcirt.?setbuf@streambuf@@UEAAPEAV1@PEADH@Z -@ stub -arch=win32 ?setbuf@strstreambuf@@UAEPAVstreambuf@@PADH@Z -@ stub -arch=win64 ?setbuf@strstreambuf@@UEAAPEAVstreambuf@@PEADH@Z +@ thiscall -arch=win32 ?setbuf@strstreambuf@@UAEPAVstreambuf@@PADH@Z(ptr ptr long) msvcirt.?setbuf@strstreambuf@@UAEPAVstreambuf@@PADH@Z +@ cdecl -arch=win64 ?setbuf@strstreambuf@@UEAAPEAVstreambuf@@PEADH@Z(ptr ptr long) msvcirt.?setbuf@strstreambuf@@UEAAPEAVstreambuf@@PEADH@Z @ thiscall -arch=win32 ?setf@ios@@QAEJJ@Z(ptr long) msvcirt.?setf@ios@@QAEJJ@Z @ cdecl -arch=win64 ?setf@ios@@QEAAJJ@Z(ptr long) msvcirt.?setf@ios@@QEAAJJ@Z @ thiscall -arch=win32 ?setf@ios@@QAEJJJ@Z(ptr long long) msvcirt.?setf@ios@@QAEJJJ@Z @@ -679,8 +679,8 @@ @ stub -arch=win64 ?setmode@ofstream@@QEAAHH@Z @ thiscall -arch=win32 ?setp@streambuf@@IAEXPAD0@Z(ptr ptr ptr) msvcirt.?setp@streambuf@@IAEXPAD0@Z @ cdecl -arch=win64 ?setp@streambuf@@IEAAXPEAD0@Z(ptr ptr ptr) msvcirt.?setp@streambuf@@IEAAXPEAD0@Z -@ stub -arch=win32 ?setrwbuf@stdiobuf@@QAEHHH@Z -@ stub -arch=win64 ?setrwbuf@stdiobuf@@QEAAHHH@Z +@ thiscall -arch=win32 ?setrwbuf@stdiobuf@@QAEHHH@Z(ptr long long) msvcirt.?setrwbuf@stdiobuf@@QAEHHH@Z +@ cdecl -arch=win64 ?setrwbuf@stdiobuf@@QEAAHHH@Z(ptr long long) msvcirt.?setrwbuf@stdiobuf@@QEAAHHH@Z @ thiscall -arch=win32 ?sgetc@streambuf@@QAEHXZ(ptr) msvcirt.?sgetc@streambuf@@QAEHXZ @ cdecl -arch=win64 ?sgetc@streambuf@@QEAAHXZ(ptr) msvcirt.?sgetc@streambuf@@QEAAHXZ @ thiscall -arch=win32 ?sgetn@streambuf@@QAEHPADH@Z(ptr ptr long) msvcirt.?sgetn@streambuf@@QAEHPADH@Z @@ -696,8 +696,8 @@ @ cdecl -arch=win64 ?sputc@streambuf@@QEAAHH@Z(ptr long) msvcirt.?sputc@streambuf@@QEAAHH@Z @ thiscall -arch=win32 ?sputn@streambuf@@QAEHPBDH@Z(ptr str long) msvcirt.?sputn@streambuf@@QAEHPBDH@Z @ cdecl -arch=win64 ?sputn@streambuf@@QEAAHPEBDH@Z(ptr str long) msvcirt.?sputn@streambuf@@QEAAHPEBDH@Z -@ stub -arch=win32 ?stdiofile@stdiobuf@@QAEPAU_iobuf@@XZ -@ stub -arch=win64 ?stdiofile@stdiobuf@@QEAAPEAU_iobuf@@XZ +@ thiscall -arch=win32 ?stdiofile@stdiobuf@@QAEPAU_iobuf@@XZ(ptr) msvcirt.?stdiofile@stdiobuf@@QAEPAU_iobuf@@XZ +@ cdecl -arch=win64 ?stdiofile@stdiobuf@@QEAAPEAU_iobuf@@XZ(ptr) msvcirt.?stdiofile@stdiobuf@@QEAAPEAU_iobuf@@XZ @ thiscall -arch=win32 ?stossc@streambuf@@QAEXXZ(ptr) msvcirt.?stossc@streambuf@@QAEXXZ @ cdecl -arch=win64 ?stossc@streambuf@@QEAAXXZ(ptr) msvcirt.?stossc@streambuf@@QEAAXXZ @ stub -arch=win32 ?str@istrstream@@QAEPADXZ @@ -713,12 +713,12 @@ @ cdecl -arch=win64 ?sync@filebuf@@UEAAHXZ(ptr) msvcirt.?sync@filebuf@@UEAAHXZ @ stub -arch=win32 ?sync@istream@@QAEHXZ @ stub -arch=win64 ?sync@istream@@QEAAHXZ -@ stub -arch=win32 ?sync@stdiobuf@@UAEHXZ -@ stub -arch=win64 ?sync@stdiobuf@@UEAAHXZ +@ thiscall -arch=win32 ?sync@stdiobuf@@UAEHXZ(ptr) msvcirt.?sync@stdiobuf@@UAEHXZ +@ cdecl -arch=win64 ?sync@stdiobuf@@UEAAHXZ(ptr) msvcirt.?sync@stdiobuf@@UEAAHXZ @ thiscall -arch=win32 ?sync@streambuf@@UAEHXZ(ptr) msvcirt.?sync@streambuf@@UAEHXZ @ cdecl -arch=win64 ?sync@streambuf@@UEAAHXZ(ptr) msvcirt.?sync@streambuf@@UEAAHXZ -@ stub -arch=win32 ?sync@strstreambuf@@UAEHXZ -@ stub -arch=win64 ?sync@strstreambuf@@UEAAHXZ +@ thiscall -arch=win32 ?sync@strstreambuf@@UAEHXZ(ptr) msvcirt.?sync@strstreambuf@@UAEHXZ +@ cdecl -arch=win64 ?sync@strstreambuf@@UEAAHXZ(ptr) msvcirt.?sync@strstreambuf@@UEAAHXZ @ cdecl ?sync_with_stdio@ios@@SAXXZ() msvcirt.?sync_with_stdio@ios@@SAXXZ @ stub -arch=win32 ?tellg@istream@@QAEJXZ @ stub -arch=win64 ?tellg@istream@@QEAAJXZ @@ -736,10 +736,10 @@ @ cdecl -arch=win64 ?unbuffered@streambuf@@IEBAHXZ(ptr) msvcirt.?unbuffered@streambuf@@IEBAHXZ @ thiscall -arch=win32 ?underflow@filebuf@@UAEHXZ(ptr) msvcirt.?underflow@filebuf@@UAEHXZ @ cdecl -arch=win64 ?underflow@filebuf@@UEAAHXZ(ptr) msvcirt.?underflow@filebuf@@UEAAHXZ -@ stub -arch=win32 ?underflow@stdiobuf@@UAEHXZ -@ stub -arch=win64 ?underflow@stdiobuf@@UEAAHXZ -@ stub -arch=win32 ?underflow@strstreambuf@@UAEHXZ -@ stub -arch=win64 ?underflow@strstreambuf@@UEAAHXZ +@ thiscall -arch=win32 ?underflow@stdiobuf@@UAEHXZ(ptr) msvcirt.?underflow@stdiobuf@@UAEHXZ +@ cdecl -arch=win64 ?underflow@stdiobuf@@UEAAHXZ(ptr) msvcirt.?underflow@stdiobuf@@UEAAHXZ +@ thiscall -arch=win32 ?underflow@strstreambuf@@UAEHXZ(ptr) msvcirt.?underflow@strstreambuf@@UAEHXZ +@ cdecl -arch=win64 ?underflow@strstreambuf@@UEAAHXZ(ptr) msvcirt.?underflow@strstreambuf@@UEAAHXZ @ cdecl ?unexpected@@YAXXZ() msvcrt.?unexpected@@YAXXZ @ cdecl -arch=win32 ?unlock@ios@@QAAXXZ(ptr) msvcirt.?unlock@ios@@QAAXXZ @ cdecl -arch=win64 ?unlock@ios@@QEAAXXZ(ptr) msvcirt.?unlock@ios@@QEAAXXZ diff -Nru wine1.7-1.7.50/dlls/msvcrt40/msvcrt40.spec wine1.7-1.7.55/dlls/msvcrt40/msvcrt40.spec --- wine1.7-1.7.50/dlls/msvcrt40/msvcrt40.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvcrt40/msvcrt40.spec 2015-11-13 14:32:40.000000000 +0000 @@ -110,10 +110,10 @@ @ stub -arch=win64 ??0ostrstream@@QEAA@PEADHH@Z @ thiscall -arch=win32 ??0ostrstream@@QAE@XZ(ptr long) msvcirt.??0ostrstream@@QAE@XZ @ cdecl -arch=win64 ??0ostrstream@@QEAA@XZ(ptr long) msvcirt.??0ostrstream@@QEAA@XZ -@ stub -arch=win32 ??0stdiobuf@@QAE@ABV0@@Z -@ stub -arch=win64 ??0stdiobuf@@QEAA@AEBV0@@Z -@ stub -arch=win32 ??0stdiobuf@@QAE@PAU_iobuf@@@Z -@ stub -arch=win64 ??0stdiobuf@@QEAA@PEAU_iobuf@@@Z +@ thiscall -arch=win32 ??0stdiobuf@@QAE@ABV0@@Z(ptr ptr) msvcirt.??0stdiobuf@@QAE@ABV0@@Z +@ cdecl -arch=win64 ??0stdiobuf@@QEAA@AEBV0@@Z(ptr ptr) msvcirt.??0stdiobuf@@QEAA@AEBV0@@Z +@ thiscall -arch=win32 ??0stdiobuf@@QAE@PAU_iobuf@@@Z(ptr ptr) msvcirt.??0stdiobuf@@QAE@PAU_iobuf@@@Z +@ cdecl -arch=win64 ??0stdiobuf@@QEAA@PEAU_iobuf@@@Z(ptr ptr) msvcirt.??0stdiobuf@@QEAA@PEAU_iobuf@@@Z @ stub -arch=win32 ??0stdiostream@@QAE@ABV0@@Z @ stub -arch=win64 ??0stdiostream@@QEAA@AEBV0@@Z @ stub -arch=win32 ??0stdiostream@@QAE@PAU_iobuf@@@Z @@ -130,16 +130,16 @@ @ stub -arch=win64 ??0strstream@@QEAA@PEADHH@Z @ stub -arch=win32 ??0strstream@@QAE@XZ @ stub -arch=win64 ??0strstream@@QEAA@XZ -@ stub -arch=win32 ??0strstreambuf@@QAE@ABV0@@Z -@ stub -arch=win64 ??0strstreambuf@@QEAA@AEBV0@@Z -@ stub -arch=win32 ??0strstreambuf@@QAE@H@Z -@ stub -arch=win64 ??0strstreambuf@@QEAA@H@Z -@ stub -arch=win32 ??0strstreambuf@@QAE@P6APAXJ@ZP6AXPAX@Z@Z -@ stub -arch=win64 ??0strstreambuf@@QEAA@P6APEAXJ@ZP6AXPEAX@Z@Z -@ stub -arch=win32 ??0strstreambuf@@QAE@PADH0@Z -@ stub -arch=win64 ??0strstreambuf@@QEAA@PEADH0@Z -@ stub -arch=win32 ??0strstreambuf@@QAE@XZ -@ stub -arch=win64 ??0strstreambuf@@QEAA@XZ +@ thiscall -arch=win32 ??0strstreambuf@@QAE@ABV0@@Z(ptr ptr) msvcirt.??0strstreambuf@@QAE@ABV0@@Z +@ cdecl -arch=win64 ??0strstreambuf@@QEAA@AEBV0@@Z(ptr ptr) msvcirt.??0strstreambuf@@QEAA@AEBV0@@Z +@ thiscall -arch=win32 ??0strstreambuf@@QAE@H@Z(ptr long) msvcirt.??0strstreambuf@@QAE@H@Z +@ cdecl -arch=win64 ??0strstreambuf@@QEAA@H@Z(ptr long) msvcirt.??0strstreambuf@@QEAA@H@Z +@ thiscall -arch=win32 ??0strstreambuf@@QAE@P6APAXJ@ZP6AXPAX@Z@Z(ptr ptr ptr) msvcirt.??0strstreambuf@@QAE@P6APAXJ@ZP6AXPAX@Z@Z +@ cdecl -arch=win64 ??0strstreambuf@@QEAA@P6APEAXJ@ZP6AXPEAX@Z@Z(ptr ptr ptr) msvcirt.??0strstreambuf@@QEAA@P6APEAXJ@ZP6AXPEAX@Z@Z +@ thiscall -arch=win32 ??0strstreambuf@@QAE@PADH0@Z(ptr ptr long ptr) msvcirt.??0strstreambuf@@QAE@PADH0@Z +@ cdecl -arch=win64 ??0strstreambuf@@QEAA@PEADH0@Z(ptr ptr long ptr) msvcirt.??0strstreambuf@@QEAA@PEADH0@Z +@ thiscall -arch=win32 ??0strstreambuf@@QAE@XZ(ptr) msvcirt.??0strstreambuf@@QAE@XZ +@ cdecl -arch=win64 ??0strstreambuf@@QEAA@XZ(ptr) msvcirt.??0strstreambuf@@QEAA@XZ @ stub -arch=win32 ??1Iostream_init@@QAE@XZ @ stub -arch=win64 ??1Iostream_init@@QEAA@XZ @ thiscall -arch=i386 ??1__non_rtti_object@@UAE@XZ(ptr) msvcrt.??1__non_rtti_object@@UAE@XZ @@ -176,16 +176,16 @@ @ stub -arch=win64 ??1ostream_withassign@@UEAA@XZ @ thiscall -arch=win32 ??1ostrstream@@UAE@XZ(ptr) msvcirt.??1ostrstream@@UAE@XZ @ cdecl -arch=win64 ??1ostrstream@@UEAA@XZ(ptr) msvcirt.??1ostrstream@@UEAA@XZ -@ stub -arch=win32 ??1stdiobuf@@UAE@XZ -@ stub -arch=win64 ??1stdiobuf@@UEAA@XZ +@ thiscall -arch=win32 ??1stdiobuf@@UAE@XZ(ptr) msvcirt.??1stdiobuf@@UAE@XZ +@ cdecl -arch=win64 ??1stdiobuf@@UEAA@XZ(ptr) msvcirt.??1stdiobuf@@UEAA@XZ @ stub -arch=win32 ??1stdiostream@@UAE@XZ @ stub -arch=win64 ??1stdiostream@@UEAA@XZ @ thiscall -arch=win32 ??1streambuf@@UAE@XZ(ptr) msvcirt.??1streambuf@@UAE@XZ @ cdecl -arch=win64 ??1streambuf@@UEAA@XZ(ptr) msvcirt.??1streambuf@@UEAA@XZ @ stub -arch=win32 ??1strstream@@UAE@XZ @ stub -arch=win64 ??1strstream@@UEAA@XZ -@ stub -arch=win32 ??1strstreambuf@@UAE@XZ -@ stub -arch=win64 ??1strstreambuf@@UEAA@XZ +@ thiscall -arch=win32 ??1strstreambuf@@UAE@XZ(ptr) msvcirt.??1strstreambuf@@UAE@XZ +@ cdecl -arch=win64 ??1strstreambuf@@UEAA@XZ(ptr) msvcirt.??1strstreambuf@@UEAA@XZ @ thiscall -arch=i386 ??1type_info@@UAE@XZ(ptr) msvcrt.??1type_info@@UAE@XZ @ cdecl -arch=win64 ??1type_info@@UEAA@XZ(ptr) msvcrt.??1type_info@@UEAA@XZ @ cdecl -arch=win32 ??2@YAPAXI@Z(long) msvcrt.??2@YAPAXI@Z @@ -242,16 +242,16 @@ @ stub -arch=win64 ??4ostream_withassign@@QEAAAEAVostream@@PEAVstreambuf@@@Z @ stub -arch=win32 ??4ostrstream@@QAEAAV0@ABV0@@Z @ stub -arch=win64 ??4ostrstream@@QEAAAEAV0@AEBV0@@Z -@ stub -arch=win32 ??4stdiobuf@@QAEAAV0@ABV0@@Z -@ stub -arch=win64 ??4stdiobuf@@QEAAAEAV0@AEBV0@@Z +@ thiscall -arch=win32 ??4stdiobuf@@QAEAAV0@ABV0@@Z(ptr ptr) msvcirt.??4stdiobuf@@QAEAAV0@ABV0@@Z +@ cdecl -arch=win64 ??4stdiobuf@@QEAAAEAV0@AEBV0@@Z(ptr ptr) msvcirt.??4stdiobuf@@QEAAAEAV0@AEBV0@@Z @ stub -arch=win32 ??4stdiostream@@QAEAAV0@AAV0@@Z @ stub -arch=win64 ??4stdiostream@@QEAAAEAV0@AEAV0@@Z @ thiscall -arch=win32 ??4streambuf@@QAEAAV0@ABV0@@Z(ptr ptr) msvcirt.??4streambuf@@QAEAAV0@ABV0@@Z @ cdecl -arch=win64 ??4streambuf@@QEAAAEAV0@AEBV0@@Z(ptr ptr) msvcirt.??4streambuf@@QEAAAEAV0@AEBV0@@Z @ stub -arch=win32 ??4strstream@@QAEAAV0@AAV0@@Z @ stub -arch=win64 ??4strstream@@QEAAAEAV0@AEAV0@@Z -@ stub -arch=win32 ??4strstreambuf@@QAEAAV0@ABV0@@Z -@ stub -arch=win64 ??4strstreambuf@@QEAAAEAV0@AEBV0@@Z +@ thiscall -arch=win32 ??4strstreambuf@@QAEAAV0@ABV0@@Z(ptr ptr) msvcirt.??4strstreambuf@@QAEAAV0@ABV0@@Z +@ cdecl -arch=win64 ??4strstreambuf@@QEAAAEAV0@AEBV0@@Z(ptr ptr) msvcirt.??4strstreambuf@@QEAAAEAV0@AEBV0@@Z @ stub -arch=win32 ??5istream@@QAEAAV0@AAC@Z @ stub -arch=win64 ??5istream@@QEAAAEAV0@AEAC@Z @ stub -arch=win32 ??5istream@@QAEAAV0@AAD@Z @@ -351,11 +351,11 @@ # @ extern ??_7ostream@@6B@ # @ extern ??_7ostream_withassign@@6B@ # @ extern ??_7ostrstream@@6B@ -# @ extern ??_7stdiobuf@@6B@ +@ extern ??_7stdiobuf@@6B@ msvcirt.??_7stdiobuf@@6B@ # @ extern ??_7stdiostream@@6B@ @ extern ??_7streambuf@@6B@ msvcirt.??_7streambuf@@6B@ # @ extern ??_7strstream@@6B@ -# @ extern ??_7strstreambuf@@6B@ +@ extern ??_7strstreambuf@@6B@ msvcirt.??_7strstreambuf@@6B@ # @ extern ??_8fstream@@7Bistream@@@ # @ extern ??_8fstream@@7Bostream@@@ # @ extern ??_8ifstream@@7B@ @@ -414,11 +414,11 @@ @ stub -arch=win32 ??_Eostream@@UAEPAXI@Z @ stub -arch=win32 ??_Eostream_withassign@@UAEPAXI@Z @ stub -arch=win32 ??_Eostrstream@@UAEPAXI@Z -@ stub -arch=win32 ??_Estdiobuf@@UAEPAXI@Z +@ thiscall -arch=win32 ??_Estdiobuf@@UAEPAXI@Z(ptr long) msvcirt.??_Estdiobuf@@UAEPAXI@Z @ stub -arch=win32 ??_Estdiostream@@UAEPAXI@Z @ thiscall -arch=win32 ??_Estreambuf@@UAEPAXI@Z(ptr long) msvcirt.??_Estreambuf@@UAEPAXI@Z @ stub -arch=win32 ??_Estrstream@@UAEPAXI@Z -@ stub -arch=win32 ??_Estrstreambuf@@UAEPAXI@Z +@ thiscall -arch=win32 ??_Estrstreambuf@@UAEPAXI@Z(ptr long) msvcirt.??_Estrstreambuf@@UAEPAXI@Z @ stub -arch=win32 ??_GIostream_init@@QAEPAXI@Z @ thiscall -arch=win32 ??_G__non_rtti_object@@UAEPAXI@Z(ptr long) msvcrt.??_G__non_rtti_object@@UAEPAXI@Z @ thiscall -arch=win32 ??_Gbad_cast@@UAEPAXI@Z(ptr long) msvcrt.??_Gbad_cast@@UAEPAXI@Z @@ -437,11 +437,11 @@ @ stub -arch=win32 ??_Gostream@@UAEPAXI@Z @ stub -arch=win32 ??_Gostream_withassign@@UAEPAXI@Z @ stub -arch=win32 ??_Gostrstream@@UAEPAXI@Z -@ stub -arch=win32 ??_Gstdiobuf@@UAEPAXI@Z +@ thiscall -arch=win32 ??_Gstdiobuf@@UAEPAXI@Z(ptr long) msvcirt.??_Gstdiobuf@@UAEPAXI@Z @ stub -arch=win32 ??_Gstdiostream@@UAEPAXI@Z @ thiscall -arch=win32 ??_Gstreambuf@@UAEPAXI@Z(ptr long) msvcirt.??_Gstreambuf@@UAEPAXI@Z @ stub -arch=win32 ??_Gstrstream@@UAEPAXI@Z -@ stub -arch=win32 ??_Gstrstreambuf@@UAEPAXI@Z +@ thiscall -arch=win32 ??_Gstrstreambuf@@UAEPAXI@Z(ptr long) msvcirt.??_Gstrstreambuf@@UAEPAXI@Z @ cdecl -arch=win32 ?_query_new_handler@@YAP6AHI@ZXZ() msvcrt.?_query_new_handler@@YAP6AHI@ZXZ @ cdecl -arch=win64 ?_query_new_handler@@YAP6AH_K@ZXZ() msvcrt.?_query_new_handler@@YAP6AH_K@ZXZ @ cdecl ?_query_new_mode@@YAHXZ() msvcrt.?_query_new_mode@@YAHXZ @@ -500,8 +500,8 @@ @ cdecl -arch=win64 ?delbuf@ios@@QEBAHXZ(ptr) msvcirt.?delbuf@ios@@QEBAHXZ @ thiscall -arch=win32 ?doallocate@streambuf@@MAEHXZ(ptr) msvcirt.?doallocate@streambuf@@MAEHXZ @ cdecl -arch=win64 ?doallocate@streambuf@@MEAAHXZ(ptr) msvcirt.?doallocate@streambuf@@MEAAHXZ -@ stub -arch=win32 ?doallocate@strstreambuf@@MAEHXZ -@ stub -arch=win64 ?doallocate@strstreambuf@@MEAAHXZ +@ thiscall -arch=win32 ?doallocate@strstreambuf@@MAEHXZ(ptr) msvcirt.?doallocate@strstreambuf@@MAEHXZ +@ cdecl -arch=win64 ?doallocate@strstreambuf@@MEAAHXZ(ptr) msvcirt.?doallocate@strstreambuf@@MEAAHXZ @ stub -arch=win32 ?eatwhite@istream@@QAEXXZ @ stub -arch=win64 ?eatwhite@istream@@QEAAXXZ @ thiscall -arch=win32 ?eback@streambuf@@IBEPADXZ(ptr) msvcirt.?eback@streambuf@@IBEPADXZ @@ -542,8 +542,8 @@ @ stub -arch=win64 ?flush@@YAAEAVostream@@AEAV1@@Z @ stub -arch=win32 ?flush@ostream@@QAEAAV1@XZ @ stub -arch=win64 ?flush@ostream@@QEAAAEAV1@XZ -@ stub -arch=win32 ?freeze@strstreambuf@@QAEXH@Z -@ stub -arch=win64 ?freeze@strstreambuf@@QEAAXH@Z +@ thiscall -arch=win32 ?freeze@strstreambuf@@QAEXH@Z(ptr long) msvcirt.?freeze@strstreambuf@@QAEXH@Z +@ cdecl -arch=win64 ?freeze@strstreambuf@@QEAAXH@Z(ptr long) msvcirt.?freeze@strstreambuf@@QEAAXH@Z @ thiscall -arch=win32 ?gbump@streambuf@@IAEXH@Z(ptr long) msvcirt.?gbump@streambuf@@IAEXH@Z @ cdecl -arch=win64 ?gbump@streambuf@@IEAAXH@Z(ptr long) msvcirt.?gbump@streambuf@@IEAAXH@Z @ stub -arch=win32 ?gcount@istream@@QBEHXZ @@ -634,12 +634,12 @@ @ cdecl -arch=win64 ?out_waiting@streambuf@@QEBAHXZ(ptr) msvcirt.?out_waiting@streambuf@@QEBAHXZ @ thiscall -arch=win32 ?overflow@filebuf@@UAEHH@Z(ptr long) msvcirt.?overflow@filebuf@@UAEHH@Z @ cdecl -arch=win64 ?overflow@filebuf@@UEAAHH@Z(ptr long) msvcirt.?overflow@filebuf@@UEAAHH@Z -@ stub -arch=win32 ?overflow@stdiobuf@@UAEHH@Z -@ stub -arch=win64 ?overflow@stdiobuf@@UEAAHH@Z -@ stub -arch=win32 ?overflow@strstreambuf@@UAEHH@Z -@ stub -arch=win64 ?overflow@strstreambuf@@UEAAHH@Z -@ stub -arch=win32 ?pbackfail@stdiobuf@@UAEHH@Z -@ stub -arch=win64 ?pbackfail@stdiobuf@@UEAAHH@Z +@ thiscall -arch=win32 ?overflow@stdiobuf@@UAEHH@Z(ptr long) msvcirt.?overflow@stdiobuf@@UAEHH@Z +@ cdecl -arch=win64 ?overflow@stdiobuf@@UEAAHH@Z(ptr long) msvcirt.?overflow@stdiobuf@@UEAAHH@Z +@ thiscall -arch=win32 ?overflow@strstreambuf@@UAEHH@Z(ptr long) msvcirt.?overflow@strstreambuf@@UAEHH@Z +@ cdecl -arch=win64 ?overflow@strstreambuf@@UEAAHH@Z(ptr long) msvcirt.?overflow@strstreambuf@@UEAAHH@Z +@ thiscall -arch=win32 ?pbackfail@stdiobuf@@UAEHH@Z(ptr long) msvcirt.?pbackfail@stdiobuf@@UAEHH@Z +@ cdecl -arch=win64 ?pbackfail@stdiobuf@@UEAAHH@Z(ptr long) msvcirt.?pbackfail@stdiobuf@@UEAAHH@Z @ thiscall -arch=win32 ?pbackfail@streambuf@@UAEHH@Z(ptr long) msvcirt.?pbackfail@streambuf@@UAEHH@Z @ cdecl -arch=win64 ?pbackfail@streambuf@@UEAAHH@Z(ptr long) msvcirt.?pbackfail@streambuf@@UEAAHH@Z @ thiscall -arch=win32 ?pbase@streambuf@@IBEPADXZ(ptr) msvcirt.?pbase@streambuf@@IBEPADXZ @@ -702,12 +702,12 @@ @ stub -arch=win64 ?seekg@istream@@QEAAAEAV1@JW4seek_dir@ios@@@Z @ thiscall -arch=win32 ?seekoff@filebuf@@UAEJJW4seek_dir@ios@@H@Z(ptr long long long) msvcirt.?seekoff@filebuf@@UAEJJW4seek_dir@ios@@H@Z @ cdecl -arch=win64 ?seekoff@filebuf@@UEAAJJW4seek_dir@ios@@H@Z(ptr long long long) msvcirt.?seekoff@filebuf@@UEAAJJW4seek_dir@ios@@H@Z -@ stub -arch=win32 ?seekoff@stdiobuf@@UAEJJW4seek_dir@ios@@H@Z -@ stub -arch=win64 ?seekoff@stdiobuf@@UEAAJJW4seek_dir@ios@@H@Z +@ thiscall -arch=win32 ?seekoff@stdiobuf@@UAEJJW4seek_dir@ios@@H@Z(ptr long long long) msvcirt.?seekoff@stdiobuf@@UAEJJW4seek_dir@ios@@H@Z +@ cdecl -arch=win64 ?seekoff@stdiobuf@@UEAAJJW4seek_dir@ios@@H@Z(ptr long long long) msvcirt.?seekoff@stdiobuf@@UEAAJJW4seek_dir@ios@@H@Z @ thiscall -arch=win32 ?seekoff@streambuf@@UAEJJW4seek_dir@ios@@H@Z(ptr long long long) msvcirt.?seekoff@streambuf@@UAEJJW4seek_dir@ios@@H@Z @ cdecl -arch=win64 ?seekoff@streambuf@@UEAAJJW4seek_dir@ios@@H@Z(ptr long long long) msvcirt.?seekoff@streambuf@@UEAAJJW4seek_dir@ios@@H@Z -@ stub -arch=win32 ?seekoff@strstreambuf@@UAEJJW4seek_dir@ios@@H@Z -@ stub -arch=win64 ?seekoff@strstreambuf@@UEAAJJW4seek_dir@ios@@H@Z +@ thiscall -arch=win32 ?seekoff@strstreambuf@@UAEJJW4seek_dir@ios@@H@Z(ptr long long long) msvcirt.?seekoff@strstreambuf@@UAEJJW4seek_dir@ios@@H@Z +@ cdecl -arch=win64 ?seekoff@strstreambuf@@UEAAJJW4seek_dir@ios@@H@Z(ptr long long long) msvcirt.?seekoff@strstreambuf@@UEAAJJW4seek_dir@ios@@H@Z @ stub -arch=win32 ?seekp@ostream@@QAEAAV1@J@Z @ stub -arch=win64 ?seekp@ostream@@QEAAAEAV1@J@Z @ stub -arch=win32 ?seekp@ostream@@QAEAAV1@JW4seek_dir@ios@@@Z @@ -729,8 +729,8 @@ @ stub -arch=win64 ?setbuf@ofstream@@QEAAPEAVstreambuf@@PEADH@Z @ thiscall -arch=win32 ?setbuf@streambuf@@UAEPAV1@PADH@Z(ptr ptr long) msvcirt.?setbuf@streambuf@@UAEPAV1@PADH@Z @ cdecl -arch=win64 ?setbuf@streambuf@@UEAAPEAV1@PEADH@Z(ptr ptr long) msvcirt.?setbuf@streambuf@@UEAAPEAV1@PEADH@Z -@ stub -arch=win32 ?setbuf@strstreambuf@@UAEPAVstreambuf@@PADH@Z -@ stub -arch=win64 ?setbuf@strstreambuf@@UEAAPEAVstreambuf@@PEADH@Z +@ thiscall -arch=win32 ?setbuf@strstreambuf@@UAEPAVstreambuf@@PADH@Z(ptr ptr long) msvcirt.?setbuf@strstreambuf@@UAEPAVstreambuf@@PADH@Z +@ cdecl -arch=win64 ?setbuf@strstreambuf@@UEAAPEAVstreambuf@@PEADH@Z(ptr ptr long) msvcirt.?setbuf@strstreambuf@@UEAAPEAVstreambuf@@PEADH@Z @ thiscall -arch=win32 ?setf@ios@@QAEJJ@Z(ptr long) msvcirt.?setf@ios@@QAEJJ@Z @ cdecl -arch=win64 ?setf@ios@@QEAAJJ@Z(ptr long) msvcirt.?setf@ios@@QEAAJJ@Z @ thiscall -arch=win32 ?setf@ios@@QAEJJJ@Z(ptr long long) msvcirt.?setf@ios@@QAEJJJ@Z @@ -751,8 +751,8 @@ @ stub -arch=win64 ?setmode@ofstream@@QEAAHH@Z @ thiscall -arch=win32 ?setp@streambuf@@IAEXPAD0@Z(ptr ptr ptr) msvcirt.?setp@streambuf@@IAEXPAD0@Z @ cdecl -arch=win64 ?setp@streambuf@@IEAAXPEAD0@Z(ptr ptr ptr) msvcirt.?setp@streambuf@@IEAAXPEAD0@Z -@ stub -arch=win32 ?setrwbuf@stdiobuf@@QAEHHH@Z -@ stub -arch=win64 ?setrwbuf@stdiobuf@@QEAAHHH@Z +@ thiscall -arch=win32 ?setrwbuf@stdiobuf@@QAEHHH@Z(ptr long long) msvcirt.?setrwbuf@stdiobuf@@QAEHHH@Z +@ cdecl -arch=win64 ?setrwbuf@stdiobuf@@QEAAHHH@Z(ptr long long) msvcirt.?setrwbuf@stdiobuf@@QEAAHHH@Z @ thiscall -arch=win32 ?sgetc@streambuf@@QAEHXZ(ptr) msvcirt.?sgetc@streambuf@@QAEHXZ @ cdecl -arch=win64 ?sgetc@streambuf@@QEAAHXZ(ptr) msvcirt.?sgetc@streambuf@@QEAAHXZ @ thiscall -arch=win32 ?sgetn@streambuf@@QAEHPADH@Z(ptr ptr long) msvcirt.?sgetn@streambuf@@QAEHPADH@Z @@ -768,8 +768,8 @@ @ cdecl -arch=win64 ?sputc@streambuf@@QEAAHH@Z(ptr long) msvcirt.?sputc@streambuf@@QEAAHH@Z @ thiscall -arch=win32 ?sputn@streambuf@@QAEHPBDH@Z(ptr str long) msvcirt.?sputn@streambuf@@QAEHPBDH@Z @ cdecl -arch=win64 ?sputn@streambuf@@QEAAHPEBDH@Z(ptr str long) msvcirt.?sputn@streambuf@@QEAAHPEBDH@Z -@ stub -arch=win32 ?stdiofile@stdiobuf@@QAEPAU_iobuf@@XZ -@ stub -arch=win64 ?stdiofile@stdiobuf@@QEAAPEAU_iobuf@@XZ +@ thiscall -arch=win32 ?stdiofile@stdiobuf@@QAEPAU_iobuf@@XZ(ptr) msvcirt.?stdiofile@stdiobuf@@QAEPAU_iobuf@@XZ +@ cdecl -arch=win64 ?stdiofile@stdiobuf@@QEAAPEAU_iobuf@@XZ(ptr) msvcirt.?stdiofile@stdiobuf@@QEAAPEAU_iobuf@@XZ @ thiscall -arch=win32 ?stossc@streambuf@@QAEXXZ(ptr) msvcirt.?stossc@streambuf@@QAEXXZ @ cdecl -arch=win64 ?stossc@streambuf@@QEAAXXZ(ptr) msvcirt.?stossc@streambuf@@QEAAXXZ @ stub -arch=win32 ?str@istrstream@@QAEPADXZ @@ -785,12 +785,12 @@ @ cdecl -arch=win64 ?sync@filebuf@@UEAAHXZ(ptr) msvcirt.?sync@filebuf@@UEAAHXZ @ stub -arch=win32 ?sync@istream@@QAEHXZ @ stub -arch=win64 ?sync@istream@@QEAAHXZ -@ stub -arch=win32 ?sync@stdiobuf@@UAEHXZ -@ stub -arch=win64 ?sync@stdiobuf@@UEAAHXZ +@ thiscall -arch=win32 ?sync@stdiobuf@@UAEHXZ(ptr) msvcirt.?sync@stdiobuf@@UAEHXZ +@ cdecl -arch=win64 ?sync@stdiobuf@@UEAAHXZ(ptr) msvcirt.?sync@stdiobuf@@UEAAHXZ @ thiscall -arch=win32 ?sync@streambuf@@UAEHXZ(ptr) msvcirt.?sync@streambuf@@UAEHXZ @ cdecl -arch=win64 ?sync@streambuf@@UEAAHXZ(ptr) msvcirt.?sync@streambuf@@UEAAHXZ -@ stub -arch=win32 ?sync@strstreambuf@@UAEHXZ -@ stub -arch=win64 ?sync@strstreambuf@@UEAAHXZ +@ thiscall -arch=win32 ?sync@strstreambuf@@UAEHXZ(ptr) msvcirt.?sync@strstreambuf@@UAEHXZ +@ cdecl -arch=win64 ?sync@strstreambuf@@UEAAHXZ(ptr) msvcirt.?sync@strstreambuf@@UEAAHXZ @ cdecl ?sync_with_stdio@ios@@SAXXZ() msvcirt.?sync_with_stdio@ios@@SAXXZ @ stub -arch=win32 ?tellg@istream@@QAEJXZ @ stub -arch=win64 ?tellg@istream@@QEAAJXZ @@ -808,10 +808,10 @@ @ cdecl -arch=win64 ?unbuffered@streambuf@@IEBAHXZ(ptr) msvcirt.?unbuffered@streambuf@@IEBAHXZ @ thiscall -arch=win32 ?underflow@filebuf@@UAEHXZ(ptr) msvcirt.?underflow@filebuf@@UAEHXZ @ cdecl -arch=win64 ?underflow@filebuf@@UEAAHXZ(ptr) msvcirt.?underflow@filebuf@@UEAAHXZ -@ stub -arch=win32 ?underflow@stdiobuf@@UAEHXZ -@ stub -arch=win64 ?underflow@stdiobuf@@UEAAHXZ -@ stub -arch=win32 ?underflow@strstreambuf@@UAEHXZ -@ stub -arch=win64 ?underflow@strstreambuf@@UEAAHXZ +@ thiscall -arch=win32 ?underflow@stdiobuf@@UAEHXZ(ptr) msvcirt.?underflow@stdiobuf@@UAEHXZ +@ cdecl -arch=win64 ?underflow@stdiobuf@@UEAAHXZ(ptr) msvcirt.?underflow@stdiobuf@@UEAAHXZ +@ thiscall -arch=win32 ?underflow@strstreambuf@@UAEHXZ(ptr) msvcirt.?underflow@strstreambuf@@UAEHXZ +@ cdecl -arch=win64 ?underflow@strstreambuf@@UEAAHXZ(ptr) msvcirt.?underflow@strstreambuf@@UEAAHXZ @ cdecl ?unexpected@@YAXXZ() msvcrt.?unexpected@@YAXXZ @ cdecl -arch=win32 ?unlock@ios@@QAAXXZ(ptr) msvcirt.?unlock@ios@@QAAXXZ @ cdecl -arch=win64 ?unlock@ios@@QEAAXXZ(ptr) msvcirt.?unlock@ios@@QEAAXXZ diff -Nru wine1.7-1.7.50/dlls/msvfw32/drawdib.c wine1.7-1.7.55/dlls/msvfw32/drawdib.c --- wine1.7-1.7.50/dlls/msvfw32/drawdib.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvfw32/drawdib.c 2015-11-13 14:32:40.000000000 +0000 @@ -313,7 +313,8 @@ UINT wFlags) { WINE_HDD *whdd; - BOOL ret = TRUE; + BOOL ret; + int reopen = 0; TRACE("(%p,%p,%d,%d,%d,%d,%p,%p,%d,%d,%d,%d,0x%08x)\n", hdd, hdc, xDst, yDst, dxDst, dyDst, lpbi, lpBits, xSrc, ySrc, dxSrc, dySrc, wFlags); @@ -335,11 +336,25 @@ #define CHANGED(x) (whdd->x != x) - if ((!whdd->begun) || - (!(wFlags & DDF_SAME_HDC) && CHANGED(hdc)) || - (!(wFlags & DDF_SAME_DRAW) && (CHANGED(lpbi) || CHANGED(dxSrc) || CHANGED(dySrc) || CHANGED(dxDst) || CHANGED(dyDst)))) + /* Check if anything changed from the parameters passed and our struct. + * If anything changed we need to run DrawDibBegin again to ensure we + * can support the changes. + */ + if (!whdd->begun) + reopen = 1; + else if (!(wFlags & DDF_SAME_HDC) && CHANGED(hdc)) + reopen = 2; + else if (!(wFlags & DDF_SAME_DRAW)) { - TRACE("Something changed!\n"); + if (CHANGED(lpbi) && memcmp(lpbi, whdd->lpbi, sizeof(*lpbi))) reopen = 3; + else if (CHANGED(dxSrc)) reopen = 4; + else if (CHANGED(dySrc)) reopen = 5; + else if (CHANGED(dxDst)) reopen = 6; + else if (CHANGED(dyDst)) reopen = 7; + } + if (reopen) + { + TRACE("Something changed (reason %d)!\n", reopen); ret = DrawDibBegin(hdd, hdc, dxDst, dyDst, lpbi, dxSrc, dySrc, 0); if (!ret) return ret; @@ -347,7 +362,14 @@ #undef CHANGED - if ((dxDst == -1) && (dyDst == -1)) + /* If source dimensions are not specified derive them from bitmap header */ + if (dxSrc == -1 && dySrc == -1) + { + dxSrc = lpbi->biWidth; + dySrc = lpbi->biHeight; + } + /* If destination dimensions are not specified derive them from source */ + if (dxDst == -1 && dyDst == -1) { dxDst = dxSrc; dyDst = dySrc; @@ -381,9 +403,10 @@ SelectPalette(hdc, whdd->hpal, FALSE); } - if (!(StretchBlt(whdd->hdc, xDst, yDst, dxDst, dyDst, whdd->hMemDC, xSrc, ySrc, dxSrc, dySrc, SRCCOPY))) - ret = FALSE; - + ret = StretchBlt(whdd->hdc, xDst, yDst, dxDst, dyDst, whdd->hMemDC, xSrc, ySrc, dxSrc, dySrc, SRCCOPY); + TRACE("Painting %dx%d at %d,%d from %dx%d at %d,%d -> %d\n", + dxDst, dyDst, xDst, yDst, dxSrc, dySrc, xSrc, ySrc, ret); + return ret; } diff -Nru wine1.7-1.7.50/dlls/msvfw32/mciwnd.c wine1.7-1.7.55/dlls/msvfw32/mciwnd.c --- wine1.7-1.7.50/dlls/msvfw32/mciwnd.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvfw32/mciwnd.c 2015-11-13 14:32:40.000000000 +0000 @@ -1070,27 +1070,33 @@ case MCIWNDM_GETDEVICEA: { + int len = 0; + char *str = (char *)lParam; MCI_SYSINFO_PARMSA mci_sysinfo; - mci_sysinfo.lpstrReturn = (LPSTR)lParam; + mci_sysinfo.lpstrReturn = str; mci_sysinfo.dwRetSize = wParam; mwi->lasterror = mciSendCommandA(mwi->mci, MCI_SYSINFO, MCI_SYSINFO_INSTALLNAME, (DWORD_PTR)&mci_sysinfo); - TRACE("MCIWNDM_GETDEVICEA: %s\n", debugstr_an((LPSTR)lParam, wParam)); + while(len < wParam && str[len]) len++; + TRACE("MCIWNDM_GETDEVICEA: %s\n", debugstr_an(str, len)); return 0; } case MCIWNDM_GETDEVICEW: { + int len = 0; + WCHAR *str = (WCHAR *)lParam; MCI_SYSINFO_PARMSW mci_sysinfo; - mci_sysinfo.lpstrReturn = (LPWSTR)lParam; + mci_sysinfo.lpstrReturn = str; mci_sysinfo.dwRetSize = wParam; mwi->lasterror = mciSendCommandW(mwi->mci, MCI_SYSINFO, MCI_SYSINFO_INSTALLNAME, (DWORD_PTR)&mci_sysinfo); - TRACE("MCIWNDM_GETDEVICEW: %s\n", debugstr_wn((LPWSTR)lParam, wParam)); + while(len < wParam && str[len]) len++; + TRACE("MCIWNDM_GETDEVICEW: %s\n", debugstr_wn(str, len)); return 0; } diff -Nru wine1.7-1.7.50/dlls/msvfw32/msvideo_main.c wine1.7-1.7.55/dlls/msvfw32/msvideo_main.c --- wine1.7-1.7.50/dlls/msvfw32/msvideo_main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvfw32/msvideo_main.c 2015-11-13 14:32:40.000000000 +0000 @@ -46,11 +46,56 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvideo); +/* This one is a macro in order to work for both ASCII and Unicode */ +#define fourcc_to_string(str, fcc) do { \ + (str)[0] = LOBYTE(LOWORD(fcc)); \ + (str)[1] = HIBYTE(LOWORD(fcc)); \ + (str)[2] = LOBYTE(HIWORD(fcc)); \ + (str)[3] = HIBYTE(HIWORD(fcc)); \ + } while(0) + static inline const char *wine_dbgstr_fcc( DWORD fcc ) { - return wine_dbg_sprintf("%c%c%c%c", - LOBYTE(LOWORD(fcc)), HIBYTE(LOWORD(fcc)), - LOBYTE(HIWORD(fcc)), HIBYTE(HIWORD(fcc))); + char fcc_str[5]; + fourcc_to_string(fcc_str, fcc); + fcc_str[4] = '\0'; + /* Last byte may be ' ' in some cases like "DIB " */ + if (isalnum(fcc_str[0]) && isalnum(fcc_str[1]) && isalnum(fcc_str[2]) + && (isalnum(fcc_str[3]) || isspace(fcc_str[3]))) + return wine_dbg_sprintf("%s", fcc_str); + return wine_dbg_sprintf("0x%08x", fcc); +} + +static const char *wine_dbgstr_icerr( int ret ) +{ + const char *str; + if (ret <= ICERR_CUSTOM) + return wine_dbg_sprintf("ICERR_CUSTOM (%d)", ret); +#define XX(x) case (x): str = #x; break + switch (ret) + { + XX(ICERR_OK); + XX(ICERR_DONTDRAW); + XX(ICERR_NEWPALETTE); + XX(ICERR_GOTOKEYFRAME); + XX(ICERR_STOPDRAWING); + XX(ICERR_UNSUPPORTED); + XX(ICERR_BADFORMAT); + XX(ICERR_MEMORY); + XX(ICERR_INTERNAL); + XX(ICERR_BADFLAGS); + XX(ICERR_BADPARAM); + XX(ICERR_BADSIZE); + XX(ICERR_BADHANDLE); + XX(ICERR_CANTUPDATE); + XX(ICERR_ABORT); + XX(ICERR_ERROR); + XX(ICERR_BADBITDEPTH); + XX(ICERR_BADIMAGESIZE); + default: str = wine_dbg_sprintf("UNKNOWN (%d)", ret); + } +#undef XX + return str; } static WINE_HIC* MSVIDEO_FirstHic /* = NULL */; @@ -67,14 +112,6 @@ static reg_driver* reg_driver_list = NULL; -/* This one is a macro in order to work for both ASCII and Unicode */ -#define fourcc_to_string(str, fcc) do { \ - (str)[0] = LOBYTE(LOWORD(fcc)); \ - (str)[1] = HIBYTE(LOWORD(fcc)); \ - (str)[2] = LOBYTE(HIWORD(fcc)); \ - (str)[3] = HIBYTE(HIWORD(fcc)); \ - } while(0) - HMODULE MSVFW32_hModule; BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) @@ -173,7 +210,7 @@ ret = SendDriverMessage(whic->hdrv, msg, lParam1, lParam2); } - TRACE(" -> 0x%08lx\n", ret); + TRACE(" -> %s\n", wine_dbgstr_icerr(ret)); return ret; } @@ -290,8 +327,8 @@ */ BOOL VFWAPI ICInfo( DWORD fccType, DWORD fccHandler, ICINFO *lpicinfo) { - TRACE("(%s,%s/%08x,%p)\n", - wine_dbgstr_fcc(fccType), wine_dbgstr_fcc(fccHandler), fccHandler, lpicinfo); + TRACE("(%s,%s,%p)\n", + wine_dbgstr_fcc(fccType), wine_dbgstr_fcc(fccHandler), lpicinfo); lpicinfo->fccType = fccType; lpicinfo->fccHandler = fccHandler; @@ -399,6 +436,27 @@ TRACE("(%s,%s,0x%08x)\n", wine_dbgstr_fcc(fccType), wine_dbgstr_fcc(fccHandler), wMode); + if (!fccHandler) /* No specific handler, return the first valid for wMode */ + { + HIC local; + ICINFO info; + DWORD loop = 0; + info.dwSize = sizeof(info); + while(ICInfo(fccType, loop++, &info)) + { + /* Ensure fccHandler is not 0x0 because we will recurse on ICOpen */ + if(!info.fccHandler) + continue; + local = ICOpen(fccType, info.fccHandler, wMode); + if (local != 0) + { + TRACE("Returning %s as defult handler for %s\n", + wine_dbgstr_fcc(info.fccHandler), wine_dbgstr_fcc(fccType)); + return local; + } + } + } + /* Check if there is a registered driver that matches */ driver = reg_driver_list; while(driver) @@ -411,22 +469,22 @@ driver = driver->next; if (driver && driver->proc) - /* The driver has been registered at runtime with its driverproc */ + /* The driver has been registered at runtime with its driverproc */ return ICOpenFunction(fccType, fccHandler, wMode, driver->proc); /* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the * same layout as ICOPEN */ - icopen.dwSize = sizeof(ICOPEN); - icopen.fccType = fccType; - icopen.fccHandler = fccHandler; - icopen.dwVersion = 0x00001000; /* FIXME */ - icopen.dwFlags = wMode; - icopen.dwError = 0; - icopen.pV1Reserved = NULL; - icopen.pV2Reserved = NULL; - icopen.dnDevNode = 0; /* FIXME */ - + icopen.dwSize = sizeof(ICOPEN); + icopen.fccType = fccType; + icopen.fccHandler = fccHandler; + icopen.dwVersion = 0x00001000; /* FIXME */ + icopen.dwFlags = wMode; + icopen.dwError = 0; + icopen.pV1Reserved = NULL; + icopen.pV2Reserved = NULL; + icopen.dnDevNode = 0; /* FIXME */ + if (!driver) { /* normalize to lower case as in 'vidc' */ ((char*)&fccType)[0] = tolower(((char*)&fccType)[0]); @@ -435,13 +493,13 @@ ((char*)&fccType)[3] = tolower(((char*)&fccType)[3]); icopen.fccType = fccType; /* Seek the driver in the registry */ - fourcc_to_string(codecname, fccType); + fourcc_to_string(codecname, fccType); codecname[4] = '.'; - fourcc_to_string(codecname + 5, fccHandler); + fourcc_to_string(codecname + 5, fccHandler); codecname[9] = '\0'; hdrv = OpenDriver(codecname, drv32W, (LPARAM)&icopen); - if (!hdrv) + if (!hdrv) return 0; } else { /* The driver has been registered at runtime with its name */ @@ -480,15 +538,15 @@ TRACE("(%s,%s,%d,%p)\n", wine_dbgstr_fcc(fccType), wine_dbgstr_fcc(fccHandler), wMode, lpfnHandler); - icopen.dwSize = sizeof(ICOPEN); - icopen.fccType = fccType; - icopen.fccHandler = fccHandler; - icopen.dwVersion = ICVERSION; - icopen.dwFlags = wMode; - icopen.dwError = 0; - icopen.pV1Reserved = NULL; - icopen.pV2Reserved = NULL; - icopen.dnDevNode = 0; /* FIXME */ + icopen.dwSize = sizeof(ICOPEN); + icopen.fccType = fccType; + icopen.fccHandler = fccHandler; + icopen.dwVersion = ICVERSION; + icopen.dwFlags = wMode; + icopen.dwError = 0; + icopen.pV1Reserved = NULL; + icopen.pV2Reserved = NULL; + icopen.dnDevNode = 0; /* FIXME */ whic = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_HIC)); if (!whic) return 0; @@ -564,7 +622,7 @@ lstrcpyW(picinfo->szDriver, ii.szDriver); } - TRACE(" -> 0x%08lx\n", ret); + TRACE(" -> %s\n", wine_dbgstr_icerr(ret)); return ret; } @@ -761,7 +819,7 @@ icd.ckid = 0; ret = ICSendMessage(hic,ICM_DECOMPRESS,(DWORD_PTR)&icd,sizeof(ICDECOMPRESS)); - TRACE("-> %d\n",ret); + TRACE("-> %s\n",wine_dbgstr_icerr(ret)); return ret; } @@ -1366,7 +1424,7 @@ if (pc->lKey && pc->lKeyCount == (pc->lKey - 1)) /* No key frames if pc->lKey == 0 */ pc->lKeyCount = 0; - icComp->dwFlags = 0; + icComp->dwFlags = 0; } icComp->lpInput = lpBits; @@ -1375,46 +1433,56 @@ icComp->lpPrev = pc->lpBitsPrev; ret = ICSendMessage(pc->hic, ICM_COMPRESS, (DWORD_PTR)icComp, sizeof(*icComp)); - if (icComp->dwFlags & AVIIF_KEYFRAME) - { - pc->lKeyCount = 1; - *pfKey = TRUE; - TRACE("Key frame\n"); - } - else - *pfKey = FALSE; - - *plSize = icComp->lpbiOutput->biSizeImage; - TRACE(" -- 0x%08x\n", ret); if (ret == ICERR_OK) { - LPVOID oldprev, oldout; -/* We shift Prev and Out, so we don't have to allocate and release memory */ - oldprev = pc->lpBitsPrev; - oldout = pc->lpBitsOut; - pc->lpBitsPrev = oldout; - pc->lpBitsOut = oldprev; + LPVOID oldprev, oldout; + + if (icComp->dwFlags & AVIIF_KEYFRAME) + { + pc->lKeyCount = 1; + *pfKey = TRUE; + TRACE("Key frame\n"); + } + else + *pfKey = FALSE; - TRACE("returning: %p\n", icComp->lpOutput); - return icComp->lpOutput; + *plSize = icComp->lpbiOutput->biSizeImage; + + /* We shift Prev and Out, so we don't have to allocate and release memory */ + oldprev = pc->lpBitsPrev; + oldout = pc->lpBitsOut; + pc->lpBitsPrev = oldout; + pc->lpBitsOut = oldprev; + + TRACE("returning: %p, compressed frame size %u\n", icComp->lpOutput, *plSize); + return icComp->lpOutput; } return NULL; } -/*********************************************************************** - * ICSeqCompressFrameEnd [MSVFW32.@] - */ -void VFWAPI ICSeqCompressFrameEnd(PCOMPVARS pc) +static void clear_compvars(PCOMPVARS pc) { - DWORD ret; - TRACE("(%p)\n", pc); - ret = ICSendMessage(pc->hic, ICM_COMPRESS_END, 0, 0); - TRACE(" -- %x\n", ret); HeapFree(GetProcessHeap(), 0, pc->lpbiIn); HeapFree(GetProcessHeap(), 0, pc->lpBitsPrev); HeapFree(GetProcessHeap(), 0, pc->lpBitsOut); HeapFree(GetProcessHeap(), 0, pc->lpState); pc->lpbiIn = pc->lpBitsPrev = pc->lpBitsOut = pc->lpState = NULL; + if (pc->dwFlags & 0x80000000) + { + HeapFree(GetProcessHeap(), 0, pc->lpbiOut); + pc->lpbiOut = NULL; + pc->dwFlags &= ~0x80000000; + } +} + +/*********************************************************************** + * ICSeqCompressFrameEnd [MSVFW32.@] + */ +void VFWAPI ICSeqCompressFrameEnd(PCOMPVARS pc) +{ + TRACE("(%p)\n", pc); + ICSendMessage(pc->hic, ICM_COMPRESS_END, 0, 0); + clear_compvars(pc); } /*********************************************************************** @@ -1426,68 +1494,106 @@ * it doesn't appear to be used though */ DWORD ret; + ICCOMPRESS* icComp; pc->lpbiIn = HeapAlloc(GetProcessHeap(), 0, sizeof(BITMAPINFO)); if (!pc->lpbiIn) return FALSE; *pc->lpbiIn = *lpbiIn; - pc->lpBitsPrev = HeapAlloc(GetProcessHeap(), 0, pc->lpbiIn->bmiHeader.biSizeImage); - if (!pc->lpBitsPrev) - { - HeapFree(GetProcessHeap(), 0, pc->lpbiIn); - return FALSE; - } - pc->lpState = HeapAlloc(GetProcessHeap(), 0, sizeof(ICCOMPRESS)); + pc->lpState = HeapAlloc(GetProcessHeap(), 0, sizeof(ICCOMPRESS) + + sizeof(*icComp->lpckid) + sizeof(*icComp->lpdwFlags)); if (!pc->lpState) + goto error; + + pc->cbState = sizeof(ICCOMPRESS); + + if (!pc->lpbiOut) { - HeapFree(GetProcessHeap(), 0, pc->lpbiIn); - HeapFree(GetProcessHeap(), 0, pc->lpBitsPrev); - return FALSE; + /* Ask compressor for needed header size */ + int size = ICSendMessage(pc->hic, ICM_COMPRESS_GET_FORMAT, + (DWORD_PTR)pc->lpbiIn, 0); + if (size <= 0) + goto error; + + pc->lpbiOut = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); + if (!pc->lpbiOut) + goto error; + /* Flag to show that we allocated lpbiOut for proper cleanup */ + pc->dwFlags |= 0x80000000; + + ret = ICSendMessage(pc->hic, ICM_COMPRESS_GET_FORMAT, + (DWORD_PTR)pc->lpbiIn, (DWORD_PTR)pc->lpbiOut); + if (ret != ICERR_OK) + { + ERR("Could not get output format from compressor\n"); + goto error; + } + if (!pc->lpbiOut->bmiHeader.biSizeImage) + { + /* If we can't know the output frame size for sure at least allocate + * the same size of the input frame and also at least 8Kb to be sure + * that poor compressors will have enough memory to work if the input + * frame is too small. + */ + pc->lpbiOut->bmiHeader.biSizeImage = max(8192, pc->lpbiIn->bmiHeader.biSizeImage); + ERR("Bad codec! Invalid output frame size, guessing from input\n"); + } } - pc->cbState = sizeof(ICCOMPRESS); + TRACE("Input: %ux%u, fcc %s, bpp %u, size %u\n", + pc->lpbiIn->bmiHeader.biWidth, pc->lpbiIn->bmiHeader.biHeight, + wine_dbgstr_fcc(pc->lpbiIn->bmiHeader.biCompression), + pc->lpbiIn->bmiHeader.biBitCount, + pc->lpbiIn->bmiHeader.biSizeImage); + TRACE("Output: %ux%u, fcc %s, bpp %u, size %u\n", + pc->lpbiOut->bmiHeader.biWidth, pc->lpbiOut->bmiHeader.biHeight, + wine_dbgstr_fcc(pc->lpbiOut->bmiHeader.biCompression), + pc->lpbiOut->bmiHeader.biBitCount, + pc->lpbiOut->bmiHeader.biSizeImage); + + /* Buffer for compressed frame data */ pc->lpBitsOut = HeapAlloc(GetProcessHeap(), 0, pc->lpbiOut->bmiHeader.biSizeImage); if (!pc->lpBitsOut) - { - HeapFree(GetProcessHeap(), 0, pc->lpbiIn); - HeapFree(GetProcessHeap(), 0, pc->lpBitsPrev); - HeapFree(GetProcessHeap(), 0, pc->lpState); - return FALSE; - } + goto error; + + /* Buffer for previous compressed frame data */ + pc->lpBitsPrev = HeapAlloc(GetProcessHeap(), 0, pc->lpbiOut->bmiHeader.biSizeImage); + if (!pc->lpBitsPrev) + goto error; + TRACE("Compvars:\n" - "\tpc:\n" "\tsize: %i\n" - "\tflags: %i\n" + "\tflags: 0x%x\n" "\thic: %p\n" - "\ttype: %x\n" - "\thandler: %x\n" + "\ttype: %s\n" + "\thandler: %s\n" "\tin/out: %p/%p\n" - "key/data/quality: %i/%i/%i\n", - pc->cbSize, pc->dwFlags, pc->hic, pc->fccType, pc->fccHandler, - pc->lpbiIn, pc->lpbiOut, pc->lKey, pc->lDataRate, pc->lQ); + "\tkey/data/quality: %i/%i/%i\n", + pc->cbSize, pc->dwFlags, pc->hic, wine_dbgstr_fcc(pc->fccType), + wine_dbgstr_fcc(pc->fccHandler), pc->lpbiIn, pc->lpbiOut, pc->lKey, + pc->lDataRate, pc->lQ); ret = ICSendMessage(pc->hic, ICM_COMPRESS_BEGIN, (DWORD_PTR)pc->lpbiIn, (DWORD_PTR)pc->lpbiOut); - TRACE(" -- %x\n", ret); if (ret == ICERR_OK) { - ICCOMPRESS* icComp = pc->lpState; - /* Initialise some variables */ - pc->lFrame = 0; pc->lKeyCount = 0; - - icComp->lpbiOutput = &pc->lpbiOut->bmiHeader; - icComp->lpbiInput = &pc->lpbiIn->bmiHeader; - icComp->lpckid = NULL; - icComp->dwFrameSize = 0; - icComp->dwQuality = pc->lQ; - icComp->lpbiPrev = &pc->lpbiIn->bmiHeader; - return TRUE; + icComp = pc->lpState; + /* Initialise some variables */ + pc->lFrame = 0; pc->lKeyCount = 0; + + icComp->lpbiOutput = &pc->lpbiOut->bmiHeader; + icComp->lpbiInput = &pc->lpbiIn->bmiHeader; + icComp->lpckid = (DWORD *)(icComp + 1); + *icComp->lpckid = 0; + icComp->lpdwFlags = (DWORD *)((char *)(icComp + 1) + sizeof(*icComp->lpckid)); + *icComp->lpdwFlags = 0; + icComp->dwFrameSize = 0; + icComp->dwQuality = pc->lQ; + icComp->lpbiPrev = &pc->lpbiIn->bmiHeader; + return TRUE; } - HeapFree(GetProcessHeap(), 0, pc->lpbiIn); - HeapFree(GetProcessHeap(), 0, pc->lpBitsPrev); - HeapFree(GetProcessHeap(), 0, pc->lpState); - HeapFree(GetProcessHeap(), 0, pc->lpBitsOut); - pc->lpBitsPrev = pc->lpbiIn = pc->lpState = pc->lpBitsOut = NULL; +error: + clear_compvars(pc); return FALSE; } diff -Nru wine1.7-1.7.50/dlls/msvfw32/tests/msvfw.c wine1.7-1.7.55/dlls/msvfw32/tests/msvfw.c --- wine1.7-1.7.50/dlls/msvfw32/tests/msvfw.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvfw32/tests/msvfw.c 2015-11-13 14:32:40.000000000 +0000 @@ -28,6 +28,27 @@ static void test_OpenCase(void) { HIC h; + ICINFO info; + /* Check if default handler works */ + h = ICOpen(mmioFOURCC('v','i','d','c'),0,ICMODE_DECOMPRESS); + ok(0!=h,"ICOpen(vidc.0) failed\n"); + if (h) { + info.dwSize = sizeof(info); + info.szName[0] = 0; + ICGetInfo(h, &info, sizeof(info)); + trace("The default decompressor is %s\n", wine_dbgstr_w(info.szName)); + ok(ICClose(h)==ICERR_OK,"ICClose failed\n"); + } + h = ICOpen(mmioFOURCC('v','i','d','c'),0,ICMODE_COMPRESS); + ok(0!=h || broken(h == 0),"ICOpen(vidc.0) failed\n"); /* Not present in Win8 */ + if (h) { + info.dwSize = sizeof(info); + info.szName[0] = 0; + ICGetInfo(h, &info, sizeof(info)); + trace("The default compressor is %s\n", wine_dbgstr_w(info.szName)); + ok(ICClose(h)==ICERR_OK,"ICClose failed\n"); + } + /* Open a compressor with combinations of lowercase * and uppercase compressortype and handler. */ @@ -99,7 +120,7 @@ bo.biHeight = -bo.biHeight; err = ICDecompressQuery(h, &bi, &bo); - todo_wine ok(err == ICERR_OK, "Query cvid->RGB32 height<0: %d\n", err); + ok(err == ICERR_OK, "Query cvid->RGB32 height<0: %d\n", err); bo.biHeight = -bo.biHeight; ok(ICClose(h) == ICERR_OK,"ICClose failed\n"); @@ -120,7 +141,7 @@ if (h) ok(ICClose(h) == ICERR_OK,"ICClose failed\n"); bo.biHeight = - bo.biHeight; h = ICLocate(ICTYPE_VIDEO, 0, &bi, &bo, ICMODE_DECOMPRESS); - todo_wine ok(h != 0, "cvid->RGB16 height<0 failed\n"); + ok(h != 0, "cvid->RGB16 height<0 failed\n"); if (h) ok(ICClose(h) == ICERR_OK,"ICClose failed\n"); bo.biHeight = - bo.biHeight; @@ -130,7 +151,7 @@ if (h) ok(ICClose(h) == ICERR_OK,"ICClose failed\n"); bo.biHeight = - bo.biHeight; h = ICLocate(ICTYPE_VIDEO, 0, &bi, &bo, ICMODE_DECOMPRESS); - todo_wine ok(h != 0, "cvid->RGB32 height<0 failed\n"); + ok(h != 0, "cvid->RGB32 height<0 failed\n"); if (h) ok(ICClose(h) == ICERR_OK,"ICClose failed\n"); bo.biHeight = - bo.biHeight; @@ -191,7 +212,7 @@ bi.biCompression = BI_RGB; bo.biBitCount = bi.biBitCount = 8; h = ICLocate(ICTYPE_VIDEO, 0, &bi, &bo, ICMODE_DECOMPRESS); - todo_wine ok(h != 0, "RGB8->RGB identity failed\n"); + ok(h != 0, "RGB8->RGB identity failed\n"); if (h) ok(ICClose(h) == ICERR_OK,"ICClose failed\n"); bi.biCompression = BI_RLE8; @@ -200,8 +221,73 @@ if (h) ok(ICClose(h) == ICERR_OK,"ICClose failed\n"); } +static void test_ICSeqCompress(void) +{ + /* The purpose of this test is to validate sequential frame compressing + * functions. The MRLE codec will be used because Wine supports it and + * it is present in any Windows. + */ + HIC h; + DWORD err, vidc = mmioFOURCC('v','i','d','c'), mrle = mmioFOURCC('m', 'r', 'l', 'e'); + DWORD i; + LONG frame_len; + BOOL key_frame, ret; + char *frame; + COMPVARS pc; + struct { BITMAPINFOHEADER header; RGBQUAD map[256]; } + input_header = { {sizeof(BITMAPINFOHEADER), 32, 1, 1, 8, 0, 32*8, 0, 0, 256, 256}, + {{255,0,0}, {0,255,0}, {0,0,255}, {255,255,255}}}; + PBITMAPINFO bitmap = (PBITMAPINFO) &input_header; + static BYTE input[32] = {1,2,3,3,3,3,2,3,1}; + static const BYTE output_kf[] = {1,1,1,2,4,3,0,3,2,3,1,0,23,0,0,0,0,1}, /* key frame*/ + output_nkf[] = {0,0,0,1}; /* non key frame */ + + h = ICOpen(vidc, mrle, ICMODE_COMPRESS); + ok(h != NULL, "Expected non-NULL\n"); + + pc.cbSize = sizeof(pc); + pc.dwFlags = ICMF_COMPVARS_VALID; + pc.fccType = vidc; + pc.fccHandler = mrle; + pc.hic = h; + pc.lpbiIn = NULL; + pc.lpbiOut = NULL; + pc.lpBitsOut = pc.lpBitsPrev = pc.lpState = NULL; + pc.lQ = ICQUALITY_DEFAULT; + pc.lKey = 1; + pc.lDataRate = 300; + pc.lpState = NULL; + pc.cbState = 0; + + ret = ICSeqCompressFrameStart(&pc, bitmap); + ok(ret == TRUE, "Expected TRUE\n"); + /* Check that reserved pointers were allocated */ + ok(pc.lpbiIn != NULL, "Expected non-NULL\n"); + ok(pc.lpbiOut != NULL, "Expected non-NULL\n"); + + for(i = 0; i < 9; i++) + { + frame_len = 0; + frame = ICSeqCompressFrame(&pc, 0, input, &key_frame, &frame_len); + ok(frame != NULL, "Frame[%d]: Expected non-NULL\n", i); + if (frame_len == sizeof(output_nkf)) + ok(!memcmp(output_nkf, frame, frame_len), "Frame[%d]: Contents do not match\n", i); + else if (frame_len == sizeof(output_kf)) + ok(!memcmp(output_kf, frame, frame_len), "Frame[%d]: Contents do not match\n", i); + else + ok(0, "Unknown frame size of %d byten\n", frame_len); + } + + ICSeqCompressFrameEnd(&pc); + ICCompressorFree(&pc); + /* ICCompressorFree already closed the HIC */ + err = ICClose(h); + ok(err == ICERR_BADHANDLE, "Expected -8, got %d\n", err); +} + START_TEST(msvfw) { test_OpenCase(); test_Locate(); + test_ICSeqCompress(); } diff -Nru wine1.7-1.7.50/dlls/msvidc32/msvideo1.c wine1.7-1.7.55/dlls/msvidc32/msvideo1.c --- wine1.7-1.7.50/dlls/msvidc32/msvideo1.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvidc32/msvideo1.c 2015-11-13 14:32:40.000000000 +0000 @@ -299,16 +299,19 @@ if( (info==NULL) || (info->dwMagic!=CRAM_MAGIC) ) return ICERR_BADPARAM; - TRACE("planes = %d\n", in->bmiHeader.biPlanes ); - TRACE("bpp = %d\n", in->bmiHeader.biBitCount ); - TRACE("height = %d\n", in->bmiHeader.biHeight ); - TRACE("width = %d\n", in->bmiHeader.biWidth ); - TRACE("compr = %x\n", in->bmiHeader.biCompression ); + TRACE("in->planes = %d\n", in->bmiHeader.biPlanes ); + TRACE("in->bpp = %d\n", in->bmiHeader.biBitCount ); + TRACE("in->height = %d\n", in->bmiHeader.biHeight ); + TRACE("in->width = %d\n", in->bmiHeader.biWidth ); + TRACE("in->compr = 0x%x\n", in->bmiHeader.biCompression ); if( ( in->bmiHeader.biCompression != CRAM_MAGIC ) && ( in->bmiHeader.biCompression != MSVC_MAGIC ) && ( in->bmiHeader.biCompression != WHAM_MAGIC ) ) + { + TRACE("can't do 0x%x compression\n", in->bmiHeader.biCompression); return ICERR_BADFORMAT; + } if( ( in->bmiHeader.biBitCount != 16 ) && ( in->bmiHeader.biBitCount != 8 ) ) @@ -320,18 +323,21 @@ /* output must be same dimensions as input */ if( out ) { - if( in->bmiHeader.biBitCount != out->bmiHeader.biBitCount ) - return ICERR_BADFORMAT; - if( in->bmiHeader.biPlanes != out->bmiHeader.biPlanes ) - return ICERR_BADFORMAT; - if( in->bmiHeader.biHeight != out->bmiHeader.biHeight ) - return ICERR_BADFORMAT; - if( in->bmiHeader.biWidth != out->bmiHeader.biWidth ) + TRACE("out->planes = %d\n", out->bmiHeader.biPlanes ); + 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 ) || + ( in->bmiHeader.biHeight != out->bmiHeader.biHeight ) || + ( in->bmiHeader.biWidth != out->bmiHeader.biWidth )) + { + TRACE("incompatible output requested\n"); return ICERR_BADFORMAT; + } } TRACE("OK!\n"); - return ICERR_OK; } @@ -552,12 +558,15 @@ break; case ICM_COMPRESS_QUERY: - FIXME("compression not implemented\n"); r = ICERR_BADFORMAT; + /* fall through */ + case ICM_COMPRESS_GET_FORMAT: + case ICM_COMPRESS_END: + case ICM_COMPRESS: + FIXME("compression not implemented\n"); break; case ICM_CONFIGURE: - r = ICERR_UNSUPPORTED; break; default: diff -Nru wine1.7-1.7.50/dlls/msvideo.dll16/Makefile.in wine1.7-1.7.55/dlls/msvideo.dll16/Makefile.in --- wine1.7-1.7.50/dlls/msvideo.dll16/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvideo.dll16/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -1,5 +1,5 @@ MODULE = msvideo.dll16 -IMPORTS = msvfw32 version advapi32 +IMPORTS = msvfw32 version advapi32 user32 EXTRADLLFLAGS = -m16 -Wb,--main-module,msvfw32.dll diff -Nru wine1.7-1.7.50/dlls/msvideo.dll16/msvideo16.c wine1.7-1.7.55/dlls/msvideo.dll16/msvideo16.c --- wine1.7-1.7.50/dlls/msvideo.dll16/msvideo16.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvideo.dll16/msvideo16.c 2015-11-13 14:32:40.000000000 +0000 @@ -974,10 +974,38 @@ } /*********************************************************************** + * MCIWndRegisterClass(MSVIDEO.251) + */ +BOOL CDECL MCIWndRegisterClass16(void) +{ + return MCIWndRegisterClass(); +} + +static LRESULT (WINAPI *pMCIWndProc)(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam); + +static LRESULT WINAPI MCIWndProc16(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + switch (msg) + { + case MCIWNDM_SENDSTRINGA: + lparam = (ULONG_PTR)MapSL(lparam); + break; + + default: + break; + } + + return CallWindowProcA(pMCIWndProc, hwnd, msg, wparam, lparam); +} + +/*********************************************************************** * MCIWndCreate(MSVIDEO.250) */ -HWND16 CDECL MCIWndCreate16(HWND16 hwnd, HINSTANCE16 hinst16, - DWORD style, LPSTR file) +HWND16 CDECL MCIWndCreate16(HWND16 parent, HINSTANCE16 hinst16, + DWORD style, LPSTR file) { - return HWND_16(MCIWndCreateA(HWND_32(hwnd), 0, style, file)); + HWND hwnd = MCIWndCreateA(HWND_32(parent), 0, style, file); + if (hwnd) + pMCIWndProc = (void *)SetWindowLongPtrA(hwnd, GWLP_WNDPROC, (ULONG_PTR)MCIWndProc16); + return HWND_16(hwnd); } diff -Nru wine1.7-1.7.50/dlls/msvideo.dll16/msvideo.dll16.spec wine1.7-1.7.55/dlls/msvideo.dll16/msvideo.dll16.spec --- wine1.7-1.7.50/dlls/msvideo.dll16/msvideo.dll16.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msvideo.dll16/msvideo.dll16.spec 2015-11-13 14:32:40.000000000 +0000 @@ -63,6 +63,6 @@ 245 stub ICSEQCOMPRESSFRAMEEND 246 stub ICSEQCOMPRESSFRAME 250 cdecl _MCIWndCreate(word word long str) MCIWndCreate16 -251 stub _MCIWNDREGISTERCLASS +251 cdecl _MCIWndRegisterClass() MCIWndRegisterClass16 252 stub GETOPENFILENAMEPREVIEW 253 stub GETSAVEFILENAMEPREVIEW diff -Nru wine1.7-1.7.50/dlls/msxml3/element.c wine1.7-1.7.55/dlls/msxml3/element.c --- wine1.7-1.7.50/dlls/msxml3/element.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msxml3/element.c 2015-11-13 14:32:40.000000000 +0000 @@ -1203,7 +1203,9 @@ domelem *This = impl_from_IXMLDOMElement( iface ); xmlNodePtr element; xmlChar *xml_name, *xml_value = NULL; + xmlChar *local, *prefix; HRESULT hr = S_FALSE; + xmlNsPtr ns; TRACE("(%p)->(%s %p)\n", This, debugstr_w(name), value); @@ -1222,7 +1224,28 @@ if(!xmlValidateNameValue(xml_name)) hr = E_FAIL; else - xml_value = xmlGetNsProp(element, xml_name, NULL); + { + if ((local = xmlSplitQName2(xml_name, &prefix))) + { + if (xmlStrEqual(prefix, BAD_CAST "xmlns")) + { + ns = xmlSearchNs(element->doc, element, local); + if (ns) + xml_value = xmlStrdup(ns->href); + } + else + { + ns = xmlSearchNs(element->doc, element, prefix); + if (ns) + xml_value = xmlGetNsProp(element, local, ns->href); + } + + xmlFree(prefix); + xmlFree(local); + } + else + xml_value = xmlGetNsProp(element, xml_name, NULL); + } heap_free(xml_name); if(xml_value) diff -Nru wine1.7-1.7.50/dlls/msxml3/saxreader.c wine1.7-1.7.55/dlls/msxml3/saxreader.c --- wine1.7-1.7.50/dlls/msxml3/saxreader.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msxml3/saxreader.c 2015-11-13 14:32:40.000000000 +0000 @@ -690,12 +690,13 @@ static void update_position(saxlocator *This, BOOL fix_column) { const xmlChar *p = This->pParserCtxt->input->cur-1; + const xmlChar *baseP = This->pParserCtxt->input->base; This->line = xmlSAX2GetLineNumber(This->pParserCtxt); if(fix_column) { This->column = 1; - for(; *p!='\n' && *p!='\r' && p>=This->pParserCtxt->input->base; p--) + for(;p>=baseP && *p!='\n' && *p!='\r'; p--) This->column++; } else diff -Nru wine1.7-1.7.50/dlls/msxml3/tests/domdoc.c wine1.7-1.7.55/dlls/msxml3/tests/domdoc.c --- wine1.7-1.7.50/dlls/msxml3/tests/domdoc.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msxml3/tests/domdoc.c 2015-11-13 14:32:40.000000000 +0000 @@ -8977,6 +8977,7 @@ ok(doctype == NULL, "got %p\n", doctype); hr = IXMLDOMDocument_loadXML(doc, _bstr_(szEmailXML), &b); + ok(hr == S_OK, "got 0x%08x\n", hr); ok(b == VARIANT_TRUE, "failed to load XML string\n"); doctype = NULL; @@ -10882,6 +10883,56 @@ free_bstrs(); } +static void test_getAttribute(void) +{ + IXMLDOMDocument *doc; + IXMLDOMElement *elem; + VARIANT_BOOL v; + VARIANT var; + HRESULT hr; + + doc = create_document(&IID_IXMLDOMDocument); + + hr = IXMLDOMDocument_loadXML(doc, _bstr_(szExampleXML), &v); + EXPECT_HR(hr, S_OK); + + hr = IXMLDOMDocument_get_documentElement(doc, &elem); + EXPECT_HR(hr, S_OK); + + VariantInit(&var); + hr = IXMLDOMElement_getAttribute( elem, _bstr_("xmlns:foo"), &var ); + EXPECT_HR(hr, S_OK); + ok( V_VT(&var) == VT_BSTR, "vt = %x\n", V_VT(&var)); + ok( !lstrcmpW(V_BSTR(&var), _bstr_("urn:uuid:86B2F87F-ACB6-45cd-8B77-9BDB92A01A29")), "wrong attr value: %s\n", wine_dbgstr_w(V_BSTR(&var))); + VariantClear(&var); + + hr = IXMLDOMElement_getAttribute( elem, _bstr_("a"), &var ); + EXPECT_HR(hr, S_OK); + ok( V_VT(&var) == VT_BSTR, "vt = %x\n", V_VT(&var)); + ok( !lstrcmpW(V_BSTR(&var), _bstr_("attr a")), "wrong attr value: %s\n", wine_dbgstr_w(V_BSTR(&var))); + VariantClear(&var); + + hr = IXMLDOMElement_getAttribute( elem, _bstr_("foo:b"), &var ); + EXPECT_HR(hr, S_OK); + ok( V_VT(&var) == VT_BSTR, "vt = %x\n", V_VT(&var)); + ok( !lstrcmpW(V_BSTR(&var), _bstr_("attr b")), "wrong attr value: %s\n", wine_dbgstr_w(V_BSTR(&var))); + VariantClear(&var); + + hr = IXMLDOMElement_getAttribute( elem, _bstr_("b"), &var ); + EXPECT_HR(hr, S_FALSE); + ok( V_VT(&var) == VT_NULL, "vt = %x\n", V_VT(&var)); + VariantClear(&var); + + hr = IXMLDOMElement_getAttribute( elem, _bstr_("non-existent"), &var ); + EXPECT_HR(hr, S_FALSE); + ok( V_VT(&var) == VT_NULL, "vt = %x\n", V_VT(&var)); + VariantClear(&var); + + IXMLDOMElement_Release(elem); + IXMLDOMDocument_Release(doc); + free_bstrs(); +} + typedef struct { DOMNodeType type; const char *name; @@ -12071,6 +12122,7 @@ test_dispex(); test_parseerror(); test_getAttributeNode(); + test_getAttribute(); test_supporterrorinfo(); test_nodeValue(); test_get_namespaces(); diff -Nru wine1.7-1.7.50/dlls/msxml3/tests/saxreader.c wine1.7-1.7.55/dlls/msxml3/tests/saxreader.c --- wine1.7-1.7.50/dlls/msxml3/tests/saxreader.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msxml3/tests/saxreader.c 2015-11-13 14:32:40.000000000 +0000 @@ -2391,6 +2391,7 @@ hr = ISAXXMLReader_parse(reader, var); EXPECT_HR(hr, S_OK); ok_sequence(sequences, CONTENT_HANDLER_INDEX, test_seq, "content test attributes", TRUE); + IStream_Release(stream); hr = ISAXXMLReader_putFeature(reader, _bstr_("http://xml.org/sax/features/namespaces"), VARIANT_TRUE); EXPECT_HR(hr, S_OK); @@ -2414,6 +2415,7 @@ hr = ISAXXMLReader_parse(reader, var); EXPECT_HR(hr, S_OK); ok_sequence(sequences, CONTENT_HANDLER_INDEX, test_seq, "content test attributes", FALSE); + IStream_Release(stream); hr = ISAXXMLReader_putFeature(reader, _bstr_("http://xml.org/sax/features/namespace-prefixes"), VARIANT_TRUE); EXPECT_HR(hr, S_OK); diff -Nru wine1.7-1.7.50/dlls/msxml3/tests/xmlparser.idl wine1.7-1.7.55/dlls/msxml3/tests/xmlparser.idl --- wine1.7-1.7.50/dlls/msxml3/tests/xmlparser.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msxml3/tests/xmlparser.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep header + import "unknwn.idl"; import "objidl.idl"; import "oaidl.idl"; @@ -254,7 +256,7 @@ ] library XMLPSR { -importlib("stdole32.tlb"); +/* importlib("stdole32.tlb"); */ importlib("stdole2.tlb"); [ diff -Nru wine1.7-1.7.50/dlls/msxml3/xmlparser.idl wine1.7-1.7.55/dlls/msxml3/xmlparser.idl --- wine1.7-1.7.50/dlls/msxml3/xmlparser.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/msxml3/xmlparser.idl 2015-11-13 14:32:40.000000000 +0000 @@ -256,7 +256,7 @@ ] library XMLPSR { -importlib("stdole32.tlb"); +/* importlib("stdole32.tlb"); */ importlib("stdole2.tlb"); [ diff -Nru wine1.7-1.7.50/dlls/ndis.sys/ndis.sys.spec wine1.7-1.7.55/dlls/ndis.sys/ndis.sys.spec --- wine1.7-1.7.50/dlls/ndis.sys/ndis.sys.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ndis.sys/ndis.sys.spec 2015-11-13 14:32:40.000000000 +0000 @@ -130,7 +130,7 @@ @ stub NdisImmediateWritePortUshort @ stub NdisImmediateWriteSharedMemory @ stub NdisInitAnsiString -@ stub NdisInitUnicodeString +@ stdcall NdisInitUnicodeString(ptr wstr) ntdll.RtlInitUnicodeString @ stub NdisInitializeEvent @ stub NdisInitializeReadWriteLock @ stub NdisInitializeString diff -Nru wine1.7-1.7.50/dlls/netapi32/netapi32.c wine1.7-1.7.55/dlls/netapi32/netapi32.c --- wine1.7-1.7.50/dlls/netapi32/netapi32.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/netapi32/netapi32.c 2015-11-13 14:32:40.000000000 +0000 @@ -506,10 +506,10 @@ return ret; } -#define GENERIC_ALL_ACCESS (1 << 28) -#define GENERIC_EXECUTE_ACCESS (1 << 29) -#define GENERIC_WRITE_ACCESS (1 << 30) -#define GENERIC_READ_ACCESS (1 << 31) +#define GENERIC_ALL_ACCESS (1u << 28) +#define GENERIC_EXECUTE_ACCESS (1u << 29) +#define GENERIC_WRITE_ACCESS (1u << 30) +#define GENERIC_READ_ACCESS (1u << 31) static unsigned int access_mask_to_samba( DWORD mask ) { @@ -1627,7 +1627,12 @@ (lstrlenW(ui->wkui0_username) + 1) * sizeof(WCHAR), (LPVOID *) bufptr); if (nastatus != NERR_Success) + { + NetApiBufferFree(ui); return nastatus; + } + ui = (PWKSTA_USER_INFO_0) *bufptr; + ui->wkui0_username = (LMSTR) (*bufptr + sizeof(WKSTA_USER_INFO_0)); } break; } diff -Nru wine1.7-1.7.50/dlls/netprofm/list.c wine1.7-1.7.55/dlls/netprofm/list.c --- wine1.7-1.7.50/dlls/netprofm/list.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/netprofm/list.c 2015-11-13 14:32:40.000000000 +0000 @@ -36,16 +36,51 @@ #include "olectl.h" #include "wine/debug.h" +#include "wine/list.h" #include "netprofm_private.h" WINE_DEFAULT_DEBUG_CHANNEL(netprofm); +static inline void *heap_alloc( SIZE_T size ) +{ + return HeapAlloc( GetProcessHeap(), 0, size ); +} + +static inline BOOL heap_free( void *mem ) +{ + return HeapFree( GetProcessHeap(), 0, mem ); +} + +struct network +{ + INetwork INetwork_iface; + LONG refs; + struct list entry; + GUID id; + VARIANT_BOOL connected_to_internet; + VARIANT_BOOL connected; +}; + +struct connection +{ + INetworkConnection INetworkConnection_iface; + INetworkConnectionCost INetworkConnectionCost_iface; + LONG refs; + struct list entry; + GUID id; + INetwork *network; + VARIANT_BOOL connected_to_internet; + VARIANT_BOOL connected; +}; + struct list_manager { INetworkListManager INetworkListManager_iface; INetworkCostManager INetworkCostManager_iface; IConnectionPointContainer IConnectionPointContainer_iface; LONG refs; + struct list networks; + struct list connections; }; struct connection_point @@ -89,6 +124,7 @@ else { FIXME( "interface %s not implemented\n", debugstr_guid(riid) ); + *obj = NULL; return E_NOINTERFACE; } IConnectionPoint_AddRef( iface ); @@ -111,7 +147,7 @@ { TRACE( "destroying %p\n", cp ); IConnectionPointContainer_Release( cp->container ); - HeapFree( GetProcessHeap(), 0, cp ); + heap_free( cp ); } return refs; } @@ -199,7 +235,7 @@ struct connection_point *cp; TRACE( "%p, %s, %p\n", obj, debugstr_guid(riid), container ); - if (!(cp = HeapAlloc( GetProcessHeap(), 0, sizeof(*cp) ))) return E_OUTOFMEMORY; + if (!(cp = heap_alloc( sizeof(*cp) ))) return E_OUTOFMEMORY; cp->IConnectionPoint_iface.lpVtbl = &connection_point_vtbl; cp->container = container; cp->refs = 1; @@ -212,6 +248,271 @@ return S_OK; } +static inline struct network *impl_from_INetwork( + INetwork *iface ) +{ + return CONTAINING_RECORD( iface, struct network, INetwork_iface ); +} + +static HRESULT WINAPI network_QueryInterface( + INetwork *iface, REFIID riid, void **obj ) +{ + struct network *network = impl_from_INetwork( iface ); + + TRACE( "%p, %s, %p\n", network, debugstr_guid(riid), obj ); + + if (IsEqualIID( riid, &IID_INetwork ) || + IsEqualIID( riid, &IID_IDispatch ) || + IsEqualIID( riid, &IID_IUnknown )) + { + *obj = iface; + INetwork_AddRef( iface ); + return S_OK; + } + else + { + WARN( "interface not supported %s\n", debugstr_guid(riid) ); + *obj = NULL; + return E_NOINTERFACE; + } +} + +static ULONG WINAPI network_AddRef( + INetwork *iface ) +{ + struct network *network = impl_from_INetwork( iface ); + + TRACE( "%p\n", network ); + return InterlockedIncrement( &network->refs ); +} + +static ULONG WINAPI network_Release( + INetwork *iface ) +{ + struct network *network = impl_from_INetwork( iface ); + LONG refs; + + TRACE( "%p\n", network ); + + if (!(refs = InterlockedDecrement( &network->refs ))) + { + list_remove( &network->entry ); + heap_free( network ); + } + return refs; +} + +static HRESULT WINAPI network_GetTypeInfoCount( + INetwork *iface, + UINT *count ) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI network_GetTypeInfo( + INetwork *iface, + UINT index, + LCID lcid, + ITypeInfo **info ) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI network_GetIDsOfNames( + INetwork *iface, + REFIID riid, + LPOLESTR *names, + UINT count, + LCID lcid, + DISPID *dispid ) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI network_Invoke( + INetwork *iface, + DISPID member, + REFIID riid, + LCID lcid, + WORD flags, + DISPPARAMS *params, + VARIANT *result, + EXCEPINFO *excep_info, + UINT *arg_err ) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI network_GetName( + INetwork *iface, + BSTR *pszNetworkName ) +{ + FIXME( "%p, %p\n", iface, pszNetworkName ); + return E_NOTIMPL; +} + +static HRESULT WINAPI network_SetName( + INetwork *iface, + BSTR szNetworkNewName ) +{ + FIXME( "%p, %s\n", iface, debugstr_w(szNetworkNewName) ); + return E_NOTIMPL; +} + +static HRESULT WINAPI network_GetDescription( + INetwork *iface, + BSTR *pszDescription ) +{ + FIXME( "%p, %p\n", iface, pszDescription ); + return E_NOTIMPL; +} + +static HRESULT WINAPI network_SetDescription( + INetwork *iface, + BSTR szDescription ) +{ + FIXME( "%p, %s\n", iface, debugstr_w(szDescription) ); + return E_NOTIMPL; +} + +static HRESULT WINAPI network_GetNetworkId( + INetwork *iface, + GUID *pgdGuidNetworkId ) +{ + struct network *network = impl_from_INetwork( iface ); + + TRACE( "%p, %p\n", iface, pgdGuidNetworkId ); + + *pgdGuidNetworkId = network->id; + return S_OK; +} + +static HRESULT WINAPI network_GetDomainType( + INetwork *iface, + NLM_DOMAIN_TYPE *pDomainType ) +{ + FIXME( "%p, %p\n", iface, pDomainType ); + + *pDomainType = NLM_DOMAIN_TYPE_NON_DOMAIN_NETWORK; + return S_OK; +} + +static HRESULT WINAPI network_GetNetworkConnections( + INetwork *iface, + IEnumNetworkConnections **ppEnumNetworkConnection ) +{ + FIXME( "%p, %p\n", iface, ppEnumNetworkConnection ); + return E_NOTIMPL; +} + +static HRESULT WINAPI network_GetTimeCreatedAndConnected( + INetwork *iface, + DWORD *pdwLowDateTimeCreated, + DWORD *pdwHighDateTimeCreated, + DWORD *pdwLowDateTimeConnected, + DWORD *pdwHighDateTimeConnected ) +{ + FIXME( "%p, %p, %p, %p, %p\n", iface, pdwLowDateTimeCreated, pdwHighDateTimeCreated, + pdwLowDateTimeConnected, pdwHighDateTimeConnected ); + return E_NOTIMPL; +} + +static HRESULT WINAPI network_get_IsConnectedToInternet( + INetwork *iface, + VARIANT_BOOL *pbIsConnected ) +{ + struct network *network = impl_from_INetwork( iface ); + + TRACE( "%p, %p\n", iface, pbIsConnected ); + + *pbIsConnected = network->connected_to_internet; + return S_OK; +} + +static HRESULT WINAPI network_get_IsConnected( + INetwork *iface, + VARIANT_BOOL *pbIsConnected ) +{ + struct network *network = impl_from_INetwork( iface ); + + TRACE( "%p, %p\n", iface, pbIsConnected ); + + *pbIsConnected = network->connected; + return S_OK; +} + +static HRESULT WINAPI network_GetConnectivity( + INetwork *iface, + NLM_CONNECTIVITY *pConnectivity ) +{ + FIXME( "%p, %p\n", iface, pConnectivity ); + + *pConnectivity = NLM_CONNECTIVITY_IPV4_INTERNET; + return S_OK; +} + +static HRESULT WINAPI network_GetCategory( + INetwork *iface, + NLM_NETWORK_CATEGORY *pCategory ) +{ + FIXME( "%p, %p\n", iface, pCategory ); + + *pCategory = NLM_NETWORK_CATEGORY_PUBLIC; + return S_OK; +} + +static HRESULT WINAPI network_SetCategory( + INetwork *iface, + NLM_NETWORK_CATEGORY NewCategory ) +{ + FIXME( "%p, %u\n", iface, NewCategory ); + return E_NOTIMPL; +} + +static const struct INetworkVtbl network_vtbl = +{ + network_QueryInterface, + network_AddRef, + network_Release, + network_GetTypeInfoCount, + network_GetTypeInfo, + network_GetIDsOfNames, + network_Invoke, + network_GetName, + network_SetName, + network_GetDescription, + network_SetDescription, + network_GetNetworkId, + network_GetDomainType, + network_GetNetworkConnections, + network_GetTimeCreatedAndConnected, + network_get_IsConnectedToInternet, + network_get_IsConnected, + network_GetConnectivity, + network_GetCategory, + network_SetCategory +}; + +static struct network *create_network( const GUID *id ) +{ + struct network *ret; + + if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL; + + ret->INetwork_iface.lpVtbl = &network_vtbl; + ret->refs = 1; + ret->id = *id; + ret->connected = VARIANT_FALSE; + ret->connected_to_internet = VARIANT_FALSE; + list_init( &ret->entry ); + + return ret; +} + static HRESULT WINAPI cost_manager_QueryInterface( INetworkCostManager *iface, REFIID riid, @@ -327,73 +628,78 @@ cost_manager_SetDestinationAddresses }; -static inline struct list_manager *impl_from_INetworkListManager( - INetworkListManager *iface ) -{ - return CONTAINING_RECORD( iface, struct list_manager, INetworkListManager_iface ); -} - -static ULONG WINAPI list_manager_AddRef( - INetworkListManager *iface ) +struct networks_enum { - struct list_manager *mgr = impl_from_INetworkListManager( iface ); - return InterlockedIncrement( &mgr->refs ); -} + IEnumNetworks IEnumNetworks_iface; + LONG refs; + struct list_manager *mgr; + struct list *cursor; +}; -static ULONG WINAPI list_manager_Release( - INetworkListManager *iface ) +static inline struct networks_enum *impl_from_IEnumNetworks( + IEnumNetworks *iface ) { - struct list_manager *mgr = impl_from_INetworkListManager( iface ); - LONG refs = InterlockedDecrement( &mgr->refs ); - if (!refs) - { - TRACE( "destroying %p\n", mgr ); - HeapFree( GetProcessHeap(), 0, mgr ); - } - return refs; + return CONTAINING_RECORD( iface, struct networks_enum, IEnumNetworks_iface ); } -static HRESULT WINAPI list_manager_QueryInterface( - INetworkListManager *iface, - REFIID riid, - void **obj ) +static HRESULT WINAPI networks_enum_QueryInterface( + IEnumNetworks *iface, REFIID riid, void **obj ) { - struct list_manager *mgr = impl_from_INetworkListManager( iface ); + struct networks_enum *iter = impl_from_IEnumNetworks( iface ); - TRACE( "%p, %s, %p\n", mgr, debugstr_guid(riid), obj ); + TRACE( "%p, %s, %p\n", iter, debugstr_guid(riid), obj ); - if (IsEqualGUID( riid, &IID_INetworkListManager ) || - IsEqualGUID( riid, &IID_IUnknown )) + if (IsEqualIID( riid, &IID_IEnumNetworks ) || + IsEqualIID( riid, &IID_IDispatch ) || + IsEqualIID( riid, &IID_IUnknown )) { *obj = iface; - } - else if (IsEqualGUID( riid, &IID_INetworkCostManager )) - { - *obj = &mgr->INetworkCostManager_iface; - } - else if (IsEqualGUID( riid, &IID_IConnectionPointContainer )) - { - *obj = &mgr->IConnectionPointContainer_iface; + IEnumNetworks_AddRef( iface ); + return S_OK; } else { - FIXME( "interface %s not implemented\n", debugstr_guid(riid) ); + WARN( "interface not supported %s\n", debugstr_guid(riid) ); + *obj = NULL; return E_NOINTERFACE; } - INetworkListManager_AddRef( iface ); - return S_OK; } -static HRESULT WINAPI list_manager_GetTypeInfoCount( - INetworkListManager *iface, +static ULONG WINAPI networks_enum_AddRef( + IEnumNetworks *iface ) +{ + struct networks_enum *iter = impl_from_IEnumNetworks( iface ); + + TRACE( "%p\n", iter ); + return InterlockedIncrement( &iter->refs ); +} + +static ULONG WINAPI networks_enum_Release( + IEnumNetworks *iface ) +{ + struct networks_enum *iter = impl_from_IEnumNetworks( iface ); + LONG refs; + + TRACE( "%p\n", iter ); + + if (!(refs = InterlockedDecrement( &iter->refs ))) + { + INetworkListManager_Release( &iter->mgr->INetworkListManager_iface ); + heap_free( iter ); + } + return refs; +} + +static HRESULT WINAPI networks_enum_GetTypeInfoCount( + IEnumNetworks *iface, UINT *count ) { FIXME("\n"); return E_NOTIMPL; } -static HRESULT WINAPI list_manager_GetTypeInfo( - INetworkListManager *iface, +static HRESULT WINAPI networks_enum_GetTypeInfo( + IEnumNetworks *iface, UINT index, LCID lcid, ITypeInfo **info ) @@ -402,8 +708,8 @@ return E_NOTIMPL; } -static HRESULT WINAPI list_manager_GetIDsOfNames( - INetworkListManager *iface, +static HRESULT WINAPI networks_enum_GetIDsOfNames( + IEnumNetworks *iface, REFIID riid, LPOLESTR *names, UINT count, @@ -414,8 +720,8 @@ return E_NOTIMPL; } -static HRESULT WINAPI list_manager_Invoke( - INetworkListManager *iface, +static HRESULT WINAPI networks_enum_Invoke( + IEnumNetworks *iface, DISPID member, REFIID riid, LCID lcid, @@ -429,63 +735,561 @@ return E_NOTIMPL; } -static HRESULT WINAPI list_manager_GetNetworks( - INetworkListManager *iface, - NLM_ENUM_NETWORK Flags, - IEnumNetworks **ppEnumNetwork ) +static HRESULT WINAPI networks_enum_get__NewEnum( + IEnumNetworks *iface, IEnumVARIANT **ppEnumVar ) { - FIXME( "%p, %x, %p\n", iface, Flags, ppEnumNetwork ); + FIXME("\n"); return E_NOTIMPL; } -static HRESULT WINAPI list_manager_GetNetwork( - INetworkListManager *iface, - GUID gdNetworkId, - INetwork **ppNetwork ) +static HRESULT WINAPI networks_enum_Next( + IEnumNetworks *iface, ULONG count, INetwork **ret, ULONG *fetched ) { - FIXME( "%p, %s, %p\n", iface, debugstr_guid(&gdNetworkId), ppNetwork ); - return E_NOTIMPL; -} + struct networks_enum *iter = impl_from_IEnumNetworks( iface ); + ULONG i = 0; -static HRESULT WINAPI list_manager_GetNetworkConnections( - INetworkListManager *iface, - IEnumNetworkConnections **ppEnum ) -{ - FIXME( "%p, %p\n", iface, ppEnum ); - return E_NOTIMPL; -} + TRACE( "%p, %u %p %p\n", iter, count, ret, fetched ); -static HRESULT WINAPI list_manager_GetNetworkConnection( - INetworkListManager *iface, - GUID gdNetworkConnectionId, - INetworkConnection **ppNetworkConnection ) -{ - FIXME( "%p, %s, %p\n", iface, debugstr_guid(&gdNetworkConnectionId), - ppNetworkConnection ); - return E_NOTIMPL; + if (fetched) *fetched = 0; + if (!count) return S_OK; + + while (iter->cursor && i < count) + { + struct network *network = LIST_ENTRY( iter->cursor, struct network, entry ); + ret[i] = &network->INetwork_iface; + INetwork_AddRef( ret[i] ); + iter->cursor = list_next( &iter->mgr->networks, iter->cursor ); + i++; + } + if (fetched) *fetched = i; + + return i < count ? S_FALSE : S_OK; } -static HRESULT WINAPI list_manager_IsConnectedToInternet( - INetworkListManager *iface, - VARIANT_BOOL *pbIsConnected ) +static HRESULT WINAPI networks_enum_Skip( + IEnumNetworks *iface, ULONG count ) { - FIXME( "%p, %p\n", iface, pbIsConnected ); + struct networks_enum *iter = impl_from_IEnumNetworks( iface ); - *pbIsConnected = VARIANT_TRUE; - return S_OK; + TRACE( "%p, %u\n", iter, count); + + if (!count) return S_OK; + if (!iter->cursor) return S_FALSE; + + while (count--) + { + iter->cursor = list_next( &iter->mgr->networks, iter->cursor ); + if (!iter->cursor) break; + } + + return count ? S_FALSE : S_OK; } -static HRESULT WINAPI list_manager_IsConnected( - INetworkListManager *iface, - VARIANT_BOOL *pbIsConnected ) +static HRESULT WINAPI networks_enum_Reset( + IEnumNetworks *iface ) { - FIXME( "%p, %p\n", iface, pbIsConnected ); + struct networks_enum *iter = impl_from_IEnumNetworks( iface ); - *pbIsConnected = VARIANT_TRUE; + TRACE( "%p\n", iter ); + + iter->cursor = list_head( &iter->mgr->networks ); return S_OK; } -static HRESULT WINAPI list_manager_GetConnectivity( +static HRESULT create_networks_enum( + struct list_manager *, IEnumNetworks** ); + +static HRESULT WINAPI networks_enum_Clone( + IEnumNetworks *iface, IEnumNetworks **ret ) +{ + struct networks_enum *iter = impl_from_IEnumNetworks( iface ); + + TRACE( "%p, %p\n", iter, ret ); + return create_networks_enum( iter->mgr, ret ); +} + +static const IEnumNetworksVtbl networks_enum_vtbl = +{ + networks_enum_QueryInterface, + networks_enum_AddRef, + networks_enum_Release, + networks_enum_GetTypeInfoCount, + networks_enum_GetTypeInfo, + networks_enum_GetIDsOfNames, + networks_enum_Invoke, + networks_enum_get__NewEnum, + networks_enum_Next, + networks_enum_Skip, + networks_enum_Reset, + networks_enum_Clone +}; + +static HRESULT create_networks_enum( + struct list_manager *mgr, IEnumNetworks **ret ) +{ + struct networks_enum *iter; + + *ret = NULL; + if (!(iter = heap_alloc( sizeof(*iter) ))) return E_OUTOFMEMORY; + + iter->IEnumNetworks_iface.lpVtbl = &networks_enum_vtbl; + iter->cursor = list_head( &mgr->networks ); + iter->mgr = mgr; + INetworkListManager_AddRef( &mgr->INetworkListManager_iface ); + iter->refs = 1; + + *ret = &iter->IEnumNetworks_iface; + return S_OK; +} + +static inline struct list_manager *impl_from_INetworkListManager( + INetworkListManager *iface ) +{ + return CONTAINING_RECORD( iface, struct list_manager, INetworkListManager_iface ); +} + +struct connections_enum +{ + IEnumNetworkConnections IEnumNetworkConnections_iface; + LONG refs; + struct list_manager *mgr; + struct list *cursor; +}; + +static inline struct connections_enum *impl_from_IEnumNetworkConnections( + IEnumNetworkConnections *iface ) +{ + return CONTAINING_RECORD( iface, struct connections_enum, IEnumNetworkConnections_iface ); +} + +static HRESULT WINAPI connections_enum_QueryInterface( + IEnumNetworkConnections *iface, REFIID riid, void **obj ) +{ + struct connections_enum *iter = impl_from_IEnumNetworkConnections( iface ); + + TRACE( "%p, %s, %p\n", iter, debugstr_guid(riid), obj ); + + if (IsEqualIID( riid, &IID_IEnumNetworkConnections ) || + IsEqualIID( riid, &IID_IDispatch ) || + IsEqualIID( riid, &IID_IUnknown )) + { + *obj = iface; + IEnumNetworkConnections_AddRef( iface ); + return S_OK; + } + else + { + WARN( "interface not supported %s\n", debugstr_guid(riid) ); + *obj = NULL; + return E_NOINTERFACE; + } +} + +static ULONG WINAPI connections_enum_AddRef( + IEnumNetworkConnections *iface ) +{ + struct connections_enum *iter = impl_from_IEnumNetworkConnections( iface ); + + TRACE( "%p\n", iter ); + return InterlockedIncrement( &iter->refs ); +} + +static ULONG WINAPI connections_enum_Release( + IEnumNetworkConnections *iface ) +{ + struct connections_enum *iter = impl_from_IEnumNetworkConnections( iface ); + LONG refs; + + TRACE( "%p\n", iter ); + + if (!(refs = InterlockedDecrement( &iter->refs ))) + { + INetworkListManager_Release( &iter->mgr->INetworkListManager_iface ); + heap_free( iter ); + } + return refs; +} + +static HRESULT WINAPI connections_enum_GetTypeInfoCount( + IEnumNetworkConnections *iface, + UINT *count ) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI connections_enum_GetTypeInfo( + IEnumNetworkConnections *iface, + UINT index, + LCID lcid, + ITypeInfo **info ) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI connections_enum_GetIDsOfNames( + IEnumNetworkConnections *iface, + REFIID riid, + LPOLESTR *names, + UINT count, + LCID lcid, + DISPID *dispid ) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI connections_enum_Invoke( + IEnumNetworkConnections *iface, + DISPID member, + REFIID riid, + LCID lcid, + WORD flags, + DISPPARAMS *params, + VARIANT *result, + EXCEPINFO *excep_info, + UINT *arg_err ) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI connections_enum_get__NewEnum( + IEnumNetworkConnections *iface, IEnumVARIANT **ppEnumVar ) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI connections_enum_Next( + IEnumNetworkConnections *iface, ULONG count, INetworkConnection **ret, ULONG *fetched ) +{ + struct connections_enum *iter = impl_from_IEnumNetworkConnections( iface ); + ULONG i = 0; + + TRACE( "%p, %u %p %p\n", iter, count, ret, fetched ); + + if (fetched) *fetched = 0; + if (!count) return S_OK; + + while (iter->cursor && i < count) + { + struct connection *connection = LIST_ENTRY( iter->cursor, struct connection, entry ); + ret[i] = &connection->INetworkConnection_iface; + INetworkConnection_AddRef( ret[i] ); + iter->cursor = list_next( &iter->mgr->connections, iter->cursor ); + i++; + } + if (fetched) *fetched = i; + + return i < count ? S_FALSE : S_OK; +} + +static HRESULT WINAPI connections_enum_Skip( + IEnumNetworkConnections *iface, ULONG count ) +{ + struct connections_enum *iter = impl_from_IEnumNetworkConnections( iface ); + + TRACE( "%p, %u\n", iter, count); + + if (!count) return S_OK; + if (!iter->cursor) return S_FALSE; + + while (count--) + { + iter->cursor = list_next( &iter->mgr->connections, iter->cursor ); + if (!iter->cursor) break; + } + + return count ? S_FALSE : S_OK; +} + +static HRESULT WINAPI connections_enum_Reset( + IEnumNetworkConnections *iface ) +{ + struct connections_enum *iter = impl_from_IEnumNetworkConnections( iface ); + + TRACE( "%p\n", iter ); + + iter->cursor = list_head( &iter->mgr->connections ); + return S_OK; +} + +static HRESULT create_connections_enum( + struct list_manager *, IEnumNetworkConnections** ); + +static HRESULT WINAPI connections_enum_Clone( + IEnumNetworkConnections *iface, IEnumNetworkConnections **ret ) +{ + struct connections_enum *iter = impl_from_IEnumNetworkConnections( iface ); + + TRACE( "%p, %p\n", iter, ret ); + return create_connections_enum( iter->mgr, ret ); +} + +static const IEnumNetworkConnectionsVtbl connections_enum_vtbl = +{ + connections_enum_QueryInterface, + connections_enum_AddRef, + connections_enum_Release, + connections_enum_GetTypeInfoCount, + connections_enum_GetTypeInfo, + connections_enum_GetIDsOfNames, + connections_enum_Invoke, + connections_enum_get__NewEnum, + connections_enum_Next, + connections_enum_Skip, + connections_enum_Reset, + connections_enum_Clone +}; + +static HRESULT create_connections_enum( + struct list_manager *mgr, IEnumNetworkConnections **ret ) +{ + struct connections_enum *iter; + + *ret = NULL; + if (!(iter = heap_alloc( sizeof(*iter) ))) return E_OUTOFMEMORY; + + iter->IEnumNetworkConnections_iface.lpVtbl = &connections_enum_vtbl; + iter->mgr = mgr; + INetworkListManager_AddRef( &mgr->INetworkListManager_iface ); + iter->cursor = list_head( &iter->mgr->connections ); + iter->refs = 1; + + *ret = &iter->IEnumNetworkConnections_iface; + return S_OK; +} + +static ULONG WINAPI list_manager_AddRef( + INetworkListManager *iface ) +{ + struct list_manager *mgr = impl_from_INetworkListManager( iface ); + return InterlockedIncrement( &mgr->refs ); +} + +static ULONG WINAPI list_manager_Release( + INetworkListManager *iface ) +{ + struct list_manager *mgr = impl_from_INetworkListManager( iface ); + LONG refs = InterlockedDecrement( &mgr->refs ); + if (!refs) + { + struct list *ptr; + + TRACE( "destroying %p\n", mgr ); + + while ((ptr = list_head( &mgr->networks ))) + { + struct network *network = LIST_ENTRY( ptr, struct network, entry ); + list_remove( &network->entry ); + INetwork_Release( &network->INetwork_iface ); + } + while ((ptr = list_head( &mgr->connections ))) + { + struct connection *connection = LIST_ENTRY( ptr, struct connection, entry ); + list_remove( &connection->entry ); + INetworkConnection_Release( &connection->INetworkConnection_iface ); + } + heap_free( mgr ); + } + return refs; +} + +static HRESULT WINAPI list_manager_QueryInterface( + INetworkListManager *iface, + REFIID riid, + void **obj ) +{ + struct list_manager *mgr = impl_from_INetworkListManager( iface ); + + TRACE( "%p, %s, %p\n", mgr, debugstr_guid(riid), obj ); + + if (IsEqualGUID( riid, &IID_INetworkListManager ) || + IsEqualGUID( riid, &IID_IDispatch ) || + IsEqualGUID( riid, &IID_IUnknown )) + { + *obj = iface; + } + else if (IsEqualGUID( riid, &IID_INetworkCostManager )) + { + *obj = &mgr->INetworkCostManager_iface; + } + else if (IsEqualGUID( riid, &IID_IConnectionPointContainer )) + { + *obj = &mgr->IConnectionPointContainer_iface; + } + else + { + FIXME( "interface %s not implemented\n", debugstr_guid(riid) ); + *obj = NULL; + return E_NOINTERFACE; + } + INetworkListManager_AddRef( iface ); + return S_OK; +} + +static HRESULT WINAPI list_manager_GetTypeInfoCount( + INetworkListManager *iface, + UINT *count ) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI list_manager_GetTypeInfo( + INetworkListManager *iface, + UINT index, + LCID lcid, + ITypeInfo **info ) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI list_manager_GetIDsOfNames( + INetworkListManager *iface, + REFIID riid, + LPOLESTR *names, + UINT count, + LCID lcid, + DISPID *dispid ) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI list_manager_Invoke( + INetworkListManager *iface, + DISPID member, + REFIID riid, + LCID lcid, + WORD flags, + DISPPARAMS *params, + VARIANT *result, + EXCEPINFO *excep_info, + UINT *arg_err ) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI list_manager_GetNetworks( + INetworkListManager *iface, + NLM_ENUM_NETWORK Flags, + IEnumNetworks **ppEnumNetwork ) +{ + struct list_manager *mgr = impl_from_INetworkListManager( iface ); + + TRACE( "%p, %x, %p\n", iface, Flags, ppEnumNetwork ); + if (Flags) FIXME( "flags %08x not supported\n", Flags ); + + return create_networks_enum( mgr, ppEnumNetwork ); +} + +static HRESULT WINAPI list_manager_GetNetwork( + INetworkListManager *iface, + GUID gdNetworkId, + INetwork **ppNetwork ) +{ + struct list_manager *mgr = impl_from_INetworkListManager( iface ); + struct network *network; + + TRACE( "%p, %s, %p\n", iface, debugstr_guid(&gdNetworkId), ppNetwork ); + + LIST_FOR_EACH_ENTRY( network, &mgr->networks, struct network, entry ) + { + if (IsEqualGUID( &network->id, &gdNetworkId )) + { + *ppNetwork = &network->INetwork_iface; + INetwork_AddRef( *ppNetwork ); + return S_OK; + } + } + + return S_FALSE; +} + +static HRESULT WINAPI list_manager_GetNetworkConnections( + INetworkListManager *iface, + IEnumNetworkConnections **ppEnum ) +{ + struct list_manager *mgr = impl_from_INetworkListManager( iface ); + + TRACE( "%p, %p\n", iface, ppEnum ); + return create_connections_enum( mgr, ppEnum ); +} + +static HRESULT WINAPI list_manager_GetNetworkConnection( + INetworkListManager *iface, + GUID gdNetworkConnectionId, + INetworkConnection **ppNetworkConnection ) +{ + struct list_manager *mgr = impl_from_INetworkListManager( iface ); + struct connection *connection; + + TRACE( "%p, %s, %p\n", iface, debugstr_guid(&gdNetworkConnectionId), + ppNetworkConnection ); + + LIST_FOR_EACH_ENTRY( connection, &mgr->connections, struct connection, entry ) + { + if (IsEqualGUID( &connection->id, &gdNetworkConnectionId )) + { + *ppNetworkConnection = &connection->INetworkConnection_iface; + INetworkConnection_AddRef( *ppNetworkConnection ); + return S_OK; + } + } + + return S_FALSE; +} + +static HRESULT WINAPI list_manager_IsConnectedToInternet( + INetworkListManager *iface, + VARIANT_BOOL *pbIsConnected ) +{ + struct list_manager *mgr = impl_from_INetworkListManager( iface ); + struct network *network; + + TRACE( "%p, %p\n", iface, pbIsConnected ); + + LIST_FOR_EACH_ENTRY( network, &mgr->networks, struct network, entry ) + { + if (network->connected_to_internet) + { + *pbIsConnected = VARIANT_TRUE; + return S_OK; + } + } + + *pbIsConnected = VARIANT_FALSE; + return S_OK; +} + +static HRESULT WINAPI list_manager_IsConnected( + INetworkListManager *iface, + VARIANT_BOOL *pbIsConnected ) +{ + struct list_manager *mgr = impl_from_INetworkListManager( iface ); + struct network *network; + + TRACE( "%p, %p\n", iface, pbIsConnected ); + + LIST_FOR_EACH_ENTRY( network, &mgr->networks, struct network, entry ) + { + if (network->connected) + { + *pbIsConnected = VARIANT_TRUE; + return S_OK; + } + } + + *pbIsConnected = VARIANT_FALSE; + return S_OK; +} + +static HRESULT WINAPI list_manager_GetConnectivity( INetworkListManager *iface, NLM_CONNECTIVITY *pConnectivity ) { @@ -570,16 +1374,368 @@ ConnectionPointContainer_FindConnectionPoint }; +static inline struct connection *impl_from_INetworkConnection( + INetworkConnection *iface ) +{ + return CONTAINING_RECORD( iface, struct connection, INetworkConnection_iface ); +} + +static HRESULT WINAPI connection_QueryInterface( + INetworkConnection *iface, REFIID riid, void **obj ) +{ + struct connection *connection = impl_from_INetworkConnection( iface ); + + TRACE( "%p, %s, %p\n", connection, debugstr_guid(riid), obj ); + + if (IsEqualIID( riid, &IID_INetworkConnection ) || + IsEqualIID( riid, &IID_IDispatch ) || + IsEqualIID( riid, &IID_IUnknown )) + { + *obj = iface; + } + else if (IsEqualIID( riid, &IID_INetworkConnectionCost )) + { + *obj = &connection->INetworkConnectionCost_iface; + } + else + { + WARN( "interface not supported %s\n", debugstr_guid(riid) ); + *obj = NULL; + return E_NOINTERFACE; + } + INetworkConnection_AddRef( iface ); + return S_OK; +} + +static ULONG WINAPI connection_AddRef( + INetworkConnection *iface ) +{ + struct connection *connection = impl_from_INetworkConnection( iface ); + + TRACE( "%p\n", connection ); + return InterlockedIncrement( &connection->refs ); +} + +static ULONG WINAPI connection_Release( + INetworkConnection *iface ) +{ + struct connection *connection = impl_from_INetworkConnection( iface ); + LONG refs; + + TRACE( "%p\n", connection ); + + if (!(refs = InterlockedDecrement( &connection->refs ))) + { + INetwork_Release( connection->network ); + list_remove( &connection->entry ); + heap_free( connection ); + } + return refs; +} + +static HRESULT WINAPI connection_GetTypeInfoCount( + INetworkConnection *iface, + UINT *count ) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI connection_GetTypeInfo( + INetworkConnection *iface, + UINT index, + LCID lcid, + ITypeInfo **info ) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI connection_GetIDsOfNames( + INetworkConnection *iface, + REFIID riid, + LPOLESTR *names, + UINT count, + LCID lcid, + DISPID *dispid ) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI connection_Invoke( + INetworkConnection *iface, + DISPID member, + REFIID riid, + LCID lcid, + WORD flags, + DISPPARAMS *params, + VARIANT *result, + EXCEPINFO *excep_info, + UINT *arg_err ) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI connection_GetNetwork( + INetworkConnection *iface, + INetwork **ppNetwork ) +{ + struct connection *connection = impl_from_INetworkConnection( iface ); + + TRACE( "%p, %p\n", iface, ppNetwork ); + + *ppNetwork = connection->network; + INetwork_AddRef( *ppNetwork ); + return S_OK; +} + +static HRESULT WINAPI connection_get_IsConnectedToInternet( + INetworkConnection *iface, + VARIANT_BOOL *pbIsConnected ) +{ + struct connection *connection = impl_from_INetworkConnection( iface ); + + TRACE( "%p, %p\n", iface, pbIsConnected ); + + *pbIsConnected = connection->connected_to_internet; + return S_OK; +} + +static HRESULT WINAPI connection_get_IsConnected( + INetworkConnection *iface, + VARIANT_BOOL *pbIsConnected ) +{ + struct connection *connection = impl_from_INetworkConnection( iface ); + + TRACE( "%p, %p\n", iface, pbIsConnected ); + + *pbIsConnected = connection->connected; + return S_OK; +} + +static HRESULT WINAPI connection_GetConnectivity( + INetworkConnection *iface, + NLM_CONNECTIVITY *pConnectivity ) +{ + FIXME( "%p, %p\n", iface, pConnectivity ); + + *pConnectivity = NLM_CONNECTIVITY_IPV4_INTERNET; + return S_OK; +} + +static HRESULT WINAPI connection_GetConnectionId( + INetworkConnection *iface, + GUID *pgdConnectionId ) +{ + struct connection *connection = impl_from_INetworkConnection( iface ); + + TRACE( "%p, %p\n", iface, pgdConnectionId ); + + *pgdConnectionId = connection->id; + return S_OK; +} + +static HRESULT WINAPI connection_GetAdapterId( + INetworkConnection *iface, + GUID *pgdAdapterId ) +{ + struct connection *connection = impl_from_INetworkConnection( iface ); + + FIXME( "%p, %p\n", iface, pgdAdapterId ); + + *pgdAdapterId = connection->id; + return S_OK; +} + +static HRESULT WINAPI connection_GetDomainType( + INetworkConnection *iface, + NLM_DOMAIN_TYPE *pDomainType ) +{ + FIXME( "%p, %p\n", iface, pDomainType ); + + *pDomainType = NLM_DOMAIN_TYPE_NON_DOMAIN_NETWORK; + return S_OK; +} + +static const struct INetworkConnectionVtbl connection_vtbl = +{ + connection_QueryInterface, + connection_AddRef, + connection_Release, + connection_GetTypeInfoCount, + connection_GetTypeInfo, + connection_GetIDsOfNames, + connection_Invoke, + connection_GetNetwork, + connection_get_IsConnectedToInternet, + connection_get_IsConnected, + connection_GetConnectivity, + connection_GetConnectionId, + connection_GetAdapterId, + connection_GetDomainType +}; + +static inline struct connection *impl_from_INetworkConnectionCost( + INetworkConnectionCost *iface ) +{ + return CONTAINING_RECORD( iface, struct connection, INetworkConnectionCost_iface ); +} + +static HRESULT WINAPI connection_cost_QueryInterface( + INetworkConnectionCost *iface, + REFIID riid, + void **obj ) +{ + struct connection *conn = impl_from_INetworkConnectionCost( iface ); + return INetworkConnection_QueryInterface( &conn->INetworkConnection_iface, riid, obj ); +} + +static ULONG WINAPI connection_cost_AddRef( + INetworkConnectionCost *iface ) +{ + struct connection *conn = impl_from_INetworkConnectionCost( iface ); + return INetworkConnection_AddRef( &conn->INetworkConnection_iface ); +} + +static ULONG WINAPI connection_cost_Release( + INetworkConnectionCost *iface ) +{ + struct connection *conn = impl_from_INetworkConnectionCost( iface ); + return INetworkConnection_Release( &conn->INetworkConnection_iface ); +} + +static HRESULT WINAPI connection_cost_GetCost( + INetworkConnectionCost *iface, DWORD *pCost ) +{ + FIXME( "%p, %p\n", iface, pCost ); + + if (!pCost) return E_POINTER; + + *pCost = NLM_CONNECTION_COST_UNRESTRICTED; + return S_OK; +} + +static HRESULT WINAPI connection_cost_GetDataPlanStatus( + INetworkConnectionCost *iface, NLM_DATAPLAN_STATUS *pDataPlanStatus ) +{ + struct connection *conn = impl_from_INetworkConnectionCost( iface ); + + FIXME( "%p, %p\n", iface, pDataPlanStatus ); + + if (!pDataPlanStatus) return E_POINTER; + + memcpy( &pDataPlanStatus->InterfaceGuid, &conn->id, sizeof(conn->id) ); + pDataPlanStatus->UsageData.UsageInMegabytes = NLM_UNKNOWN_DATAPLAN_STATUS; + memset( &pDataPlanStatus->UsageData.LastSyncTime, 0, sizeof(pDataPlanStatus->UsageData.LastSyncTime) ); + pDataPlanStatus->DataLimitInMegabytes = NLM_UNKNOWN_DATAPLAN_STATUS; + pDataPlanStatus->InboundBandwidthInKbps = NLM_UNKNOWN_DATAPLAN_STATUS; + pDataPlanStatus->OutboundBandwidthInKbps = NLM_UNKNOWN_DATAPLAN_STATUS; + memset( &pDataPlanStatus->NextBillingCycle, 0, sizeof(pDataPlanStatus->NextBillingCycle) ); + pDataPlanStatus->MaxTransferSizeInMegabytes = NLM_UNKNOWN_DATAPLAN_STATUS; + pDataPlanStatus->Reserved = 0; + + return S_OK; +} + +static const INetworkConnectionCostVtbl connection_cost_vtbl = +{ + connection_cost_QueryInterface, + connection_cost_AddRef, + connection_cost_Release, + connection_cost_GetCost, + connection_cost_GetDataPlanStatus +}; + +static struct connection *create_connection( const GUID *id ) +{ + struct connection *ret; + + if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL; + + ret->INetworkConnection_iface.lpVtbl = &connection_vtbl; + ret->INetworkConnectionCost_iface.lpVtbl = &connection_cost_vtbl; + ret->refs = 1; + ret->id = *id; + ret->network = NULL; + ret->connected = VARIANT_FALSE; + ret->connected_to_internet = VARIANT_FALSE; + list_init( &ret->entry ); + + return ret; +} + +static void init_networks( struct list_manager *mgr ) +{ + DWORD size = 0; + IP_ADAPTER_ADDRESSES *buf, *aa; + GUID id; + ULONG ret, flags = GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_MULTICAST | + GAA_FLAG_SKIP_DNS_SERVER | GAA_FLAG_INCLUDE_ALL_GATEWAYS; + + list_init( &mgr->networks ); + list_init( &mgr->connections ); + + ret = GetAdaptersAddresses( WS_AF_UNSPEC, flags, NULL, NULL, &size ); + if (ret != ERROR_BUFFER_OVERFLOW) return; + + if (!(buf = heap_alloc( size ))) return; + if (GetAdaptersAddresses( WS_AF_UNSPEC, flags, NULL, buf, &size )) + { + heap_free( buf ); + return; + } + + memset( &id, 0, sizeof(id) ); + for (aa = buf; aa; aa = aa->Next) + { + struct network *network; + struct connection *connection; + + id.Data1 = aa->IfIndex; + + /* assume a one-to-one mapping between networks and connections */ + if (!(network = create_network( &id ))) goto done; + if (!(connection = create_connection( &id ))) + { + INetwork_Release( &network->INetwork_iface ); + goto done; + } + + if (aa->FirstUnicastAddress) + { + network->connected = VARIANT_TRUE; + connection->connected = VARIANT_TRUE; + } + if (aa->FirstGatewayAddress) + { + network->connected_to_internet = VARIANT_TRUE; + connection->connected_to_internet = VARIANT_TRUE; + } + + connection->network = &network->INetwork_iface; + INetwork_AddRef( connection->network ); + + list_add_tail( &mgr->networks, &network->entry ); + list_add_tail( &mgr->connections, &connection->entry ); + } + +done: + heap_free( buf ); +} + HRESULT list_manager_create( void **obj ) { struct list_manager *mgr; TRACE( "%p\n", obj ); - if (!(mgr = HeapAlloc( GetProcessHeap(), 0, sizeof(*mgr) ))) return E_OUTOFMEMORY; + if (!(mgr = heap_alloc( sizeof(*mgr) ))) return E_OUTOFMEMORY; mgr->INetworkListManager_iface.lpVtbl = &list_manager_vtbl; mgr->INetworkCostManager_iface.lpVtbl = &cost_manager_vtbl; mgr->IConnectionPointContainer_iface.lpVtbl = &cpc_vtbl; + init_networks( mgr ); mgr->refs = 1; *obj = &mgr->INetworkListManager_iface; diff -Nru wine1.7-1.7.50/dlls/netprofm/tests/list.c wine1.7-1.7.55/dlls/netprofm/tests/list.c --- wine1.7-1.7.50/dlls/netprofm/tests/list.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/netprofm/tests/list.c 2015-11-13 14:32:40.000000000 +0000 @@ -25,6 +25,138 @@ #include "netlistmgr.h" #include "wine/test.h" +static void test_INetwork( INetwork *network ) +{ + NLM_NETWORK_CATEGORY category; + NLM_CONNECTIVITY connectivity; + NLM_DOMAIN_TYPE domain_type; + VARIANT_BOOL connected; + GUID id; + BSTR str; + HRESULT hr; + + str = NULL; + hr = INetwork_GetName( network, &str ); + todo_wine ok( hr == S_OK, "got %08x\n", hr ); + todo_wine ok( str != NULL, "str not set\n" ); + if (str) trace( "name %s\n", wine_dbgstr_w(str) ); + SysFreeString( str ); + + str = NULL; + hr = INetwork_GetDescription( network, &str ); + todo_wine ok( hr == S_OK, "got %08x\n", hr ); + todo_wine ok( str != NULL, "str not set\n" ); + if (str) trace( "description %s\n", wine_dbgstr_w(str) ); + SysFreeString( str ); + + memset( &id, 0, sizeof(id) ); + hr = INetwork_GetNetworkId( network, &id ); + ok( hr == S_OK, "got %08x\n", hr ); + trace("network id %s\n", wine_dbgstr_guid(&id)); + + domain_type = 0xdeadbeef; + hr = INetwork_GetDomainType( network, &domain_type ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( domain_type != 0xdeadbeef, "domain_type not set\n" ); + trace( "domain type %08x\n", domain_type ); + + category = 0xdeadbeef; + hr = INetwork_GetCategory( network, &category ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( category != 0xdeadbeef, "category not set\n" ); + trace( "category %08x\n", category ); + + connectivity = 0xdeadbeef; + hr = INetwork_GetConnectivity( network, &connectivity ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( connectivity != 0xdeadbeef, "connectivity not set\n" ); + trace( "connectivity %08x\n", connectivity ); + + connected = 0xdead; + hr = INetwork_get_IsConnected( network, &connected ); + ok( hr == S_OK, "got %08x\n", hr ); + trace("connected %d\n", connected); + + connected = 0xdead; + hr = INetwork_get_IsConnectedToInternet( network, &connected ); + ok( hr == S_OK, "got %08x\n", hr ); + trace("connected to internet %d\n", connected); +} + +static void test_INetworkConnection( INetworkConnection *conn ) +{ + INetwork *network; + INetworkConnectionCost *conn_cost; + NLM_CONNECTIVITY connectivity; + NLM_DOMAIN_TYPE domain_type; + VARIANT_BOOL connected; + GUID id; + HRESULT hr; + + memset( &id, 0, sizeof(id) ); + hr = INetworkConnection_GetAdapterId( conn, &id ); + ok( hr == S_OK, "got %08x\n", hr ); + trace("adapter id %s\n", wine_dbgstr_guid(&id)); + + memset( &id, 0, sizeof(id) ); + hr = INetworkConnection_GetConnectionId( conn, &id ); + ok( hr == S_OK, "got %08x\n", hr ); + trace("connection id %s\n", wine_dbgstr_guid(&id)); + + connectivity = 0xdeadbeef; + hr = INetworkConnection_GetConnectivity( conn, &connectivity ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( connectivity != 0xdeadbeef, "connectivity not set\n" ); + trace( "connectivity %08x\n", connectivity ); + + domain_type = 0xdeadbeef; + hr = INetworkConnection_GetDomainType( conn, &domain_type ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( domain_type != 0xdeadbeef, "domain_type not set\n" ); + trace( "domain type %08x\n", domain_type ); + + connected = 0xdead; + hr = INetworkConnection_get_IsConnected( conn, &connected ); + ok( hr == S_OK, "got %08x\n", hr ); + trace("connected %d\n", connected); + + connected = 0xdead; + hr = INetworkConnection_get_IsConnectedToInternet( conn, &connected ); + ok( hr == S_OK, "got %08x\n", hr ); + trace("connected to internet %d\n", connected); + + network = NULL; + hr = INetworkConnection_GetNetwork( conn, &network ); + ok( hr == S_OK, "got %08x\n", hr ); + if (network) + { + test_INetwork( network ); + INetwork_Release( network ); + } + + conn_cost = NULL; + hr = INetworkConnection_QueryInterface( conn, &IID_INetworkConnectionCost, (void **)&conn_cost ); + ok( hr == S_OK || broken(hr == E_NOINTERFACE), "got %08x\n", hr ); + if (conn_cost) + { + DWORD cost; + NLM_DATAPLAN_STATUS status; + + cost = 0xdeadbeef; + hr = INetworkConnectionCost_GetCost( conn_cost, &cost ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( cost != 0xdeadbeef, "cost not set\n" ); + trace("cost %08x\n", cost); + + memset( &status, 0,sizeof(status) ); + hr = INetworkConnectionCost_GetDataPlanStatus( conn_cost, &status ); + ok( hr == S_OK, "got %08x\n", hr ); + trace("InterfaceGuid %s\n", wine_dbgstr_guid(&status.InterfaceGuid)); + + INetworkConnectionCost_Release( conn_cost ); + } +} + static void test_INetworkListManager( void ) { IConnectionPointContainer *cpc, *cpc2; @@ -33,6 +165,10 @@ NLM_CONNECTIVITY connectivity; VARIANT_BOOL connected; IConnectionPoint *pt; + IEnumNetworks *network_iter; + INetwork *network; + IEnumNetworkConnections *conn_iter; + INetworkConnection *conn; HRESULT hr; ULONG ref1, ref2; IID iid; @@ -62,9 +198,10 @@ ok( connected == VARIANT_TRUE || connected == VARIANT_FALSE, "expected boolean value\n" ); /* INetworkCostManager is supported starting Win8 */ + cost_mgr = NULL; hr = INetworkListManager_QueryInterface( mgr, &IID_INetworkCostManager, (void **)&cost_mgr ); ok( hr == S_OK || broken(hr == E_NOINTERFACE), "got %08x\n", hr ); - if (hr == S_OK) + if (cost_mgr) { DWORD cost; NLM_DATAPLAN_STATUS status; @@ -119,8 +256,33 @@ hr = IConnectionPointContainer_FindConnectionPoint( cpc, &IID_INetworkConnectionEvents, &pt ); ok( hr == S_OK || hr == CO_E_FAILEDTOIMPERSONATE, "got %08x\n", hr ); if (hr == S_OK) IConnectionPoint_Release( pt ); - IConnectionPointContainer_Release( cpc ); + + network_iter = NULL; + hr = INetworkListManager_GetNetworks( mgr, NLM_ENUM_NETWORK_ALL, &network_iter ); + ok( hr == S_OK, "got %08x\n", hr ); + if (network_iter) + { + while ((hr = IEnumNetworks_Next( network_iter, 1, &network, NULL )) == S_OK) + { + test_INetwork( network ); + INetwork_Release( network ); + } + IEnumNetworks_Release( network_iter ); + } + + conn_iter = NULL; + hr = INetworkListManager_GetNetworkConnections( mgr, &conn_iter ); + ok( hr == S_OK, "got %08x\n", hr ); + if (conn_iter) + { + while ((hr = IEnumNetworkConnections_Next( conn_iter, 1, &conn, NULL )) == S_OK) + { + test_INetworkConnection( conn ); + INetworkConnection_Release( conn ); + } + IEnumNetworkConnections_Release( conn_iter ); + } INetworkListManager_Release( mgr ); } diff -Nru wine1.7-1.7.50/dlls/netprofm/tests/Makefile.in wine1.7-1.7.55/dlls/netprofm/tests/Makefile.in --- wine1.7-1.7.50/dlls/netprofm/tests/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/netprofm/tests/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -1,5 +1,5 @@ TESTDLL = netprofm.dll -IMPORTS = ole32 +IMPORTS = oleaut32 ole32 C_SRCS = \ list.c diff -Nru wine1.7-1.7.50/dlls/newdev/main.c wine1.7-1.7.55/dlls/newdev/main.c --- wine1.7-1.7.50/dlls/newdev/main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/newdev/main.c 2015-11-13 14:32:40.000000000 +0000 @@ -18,8 +18,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include + #include "windef.h" #include "winerror.h" +#include "winbase.h" +#include "winuser.h" +#include "winreg.h" +#include "setupapi.h" #include "wine/unicode.h" #include "wine/debug.h" @@ -35,6 +41,14 @@ return TRUE; } +/*********************************************************************** + * InstallSelectedDriver (NEWDEV.@) + */ +BOOL WINAPI InstallSelectedDriver(HWND parent, HDEVINFO info, const WCHAR *reserved, BOOL backup, DWORD *reboot) +{ + FIXME("Stub! %p %p %s %u %p\n", parent, info, debugstr_w(reserved), backup, reboot); + return TRUE; +} /*********************************************************************** * UpdateDriverForPlugAndPlayDevicesA (NEWDEV.@) diff -Nru wine1.7-1.7.50/dlls/newdev/newdev.spec wine1.7-1.7.55/dlls/newdev/newdev.spec --- wine1.7-1.7.50/dlls/newdev/newdev.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/newdev/newdev.spec 2015-11-13 14:32:40.000000000 +0000 @@ -1,3 +1,18 @@ +@ stub DeviceInternetSettingUiW +@ stub DiInstallDevice +@ stub DiInstallDriverA +@ stub DiInstallDriverW +@ stub DiRollbackDriver +@ stub DiShowUpdateDevice +@ stub DiUninstallDevice @ stdcall InstallNewDevice(long ptr ptr) +@ stdcall InstallSelectedDriver(long ptr wstr long ptr) +@ stub InstallWindowsUpdateDriver +@ stub SetInternetPolicies @ stdcall UpdateDriverForPlugAndPlayDevicesA(long str str long ptr) @ stdcall UpdateDriverForPlugAndPlayDevicesW(long wstr wstr long ptr) +@ stub pDiDeviceInstallActionW +@ stub pDiDeviceInstallNotificationW +@ stub pDiDoDeviceInstallAsAdmin +@ stub pDiDoFinishInstallAsAdmin +@ stub pDiDoNullDriverInstall diff -Nru wine1.7-1.7.50/dlls/ntdll/critsection.c wine1.7-1.7.55/dlls/ntdll/critsection.c --- wine1.7-1.7.50/dlls/ntdll/critsection.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntdll/critsection.c 2015-11-13 14:32:40.000000000 +0000 @@ -610,6 +610,43 @@ /*********************************************************************** + * RtlIsCriticalSectionLocked (NTDLL.@) + * + * Checks if the critical section is locked by any thread. + * + * PARAMS + * crit [I/O] Critical section to check. + * + * RETURNS + * Success: TRUE. The critical section is locked. + * Failure: FALSE. The critical section is not locked. + */ +BOOL WINAPI RtlIsCriticalSectionLocked( RTL_CRITICAL_SECTION *crit ) +{ + return crit->RecursionCount != 0; +} + + +/*********************************************************************** + * RtlIsCriticalSectionLockedByThread (NTDLL.@) + * + * Checks if the critical section is locked by the current thread. + * + * PARAMS + * crit [I/O] Critical section to check. + * + * RETURNS + * Success: TRUE. The critical section is locked. + * Failure: FALSE. The critical section is not locked. + */ +BOOL WINAPI RtlIsCriticalSectionLockedByThread( RTL_CRITICAL_SECTION *crit ) +{ + return crit->OwningThread == ULongToHandle(GetCurrentThreadId()) && + crit->RecursionCount; +} + + +/*********************************************************************** * RtlLeaveCriticalSection (NTDLL.@) * * Leaves a critical section. diff -Nru wine1.7-1.7.50/dlls/ntdll/debugtools.c wine1.7-1.7.55/dlls/ntdll/debugtools.c --- wine1.7-1.7.50/dlls/ntdll/debugtools.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntdll/debugtools.c 2015-11-13 14:32:40.000000000 +0000 @@ -39,6 +39,7 @@ #include "ntdll_misc.h" WINE_DECLARE_DEBUG_CHANNEL(tid); +WINE_DECLARE_DEBUG_CHANNEL(pid); WINE_DECLARE_DEBUG_CHANNEL(timestamp); static struct __wine_debug_functions default_funcs; @@ -170,6 +171,8 @@ ULONG ticks = NtGetTickCount(); ret = wine_dbg_printf( "%3u.%03u:", ticks / 1000, ticks % 1000 ); } + if (TRACE_ON(pid)) + ret += wine_dbg_printf( "%04x:", GetCurrentProcessId() ); if (TRACE_ON(tid)) ret += wine_dbg_printf( "%04x:", GetCurrentThreadId() ); if (cls < sizeof(classes)/sizeof(classes[0])) diff -Nru wine1.7-1.7.50/dlls/ntdll/directory.c wine1.7-1.7.55/dlls/ntdll/directory.c --- wine1.7-1.7.50/dlls/ntdll/directory.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntdll/directory.c 2015-11-13 14:32:40.000000000 +0000 @@ -48,7 +48,22 @@ #include #endif #ifdef HAVE_SYS_VNODE_H +/* Work around a conflict with Solaris' system list defined in sys/list.h. */ +#define list SYSLIST +#define list_next SYSLIST_NEXT +#define list_prev SYSLIST_PREV +#define list_head SYSLIST_HEAD +#define list_tail SYSLIST_TAIL +#define list_move_tail SYSLIST_MOVE_TAIL +#define list_remove SYSLIST_REMOVE #include +#undef list +#undef list_next +#undef list_prev +#undef list_head +#undef list_tail +#undef list_move_tail +#undef list_remove #endif #ifdef HAVE_SYS_IOCTL_H #include @@ -2762,11 +2777,11 @@ static const WCHAR nt_prefixW[] = {'\\','?','?','\\'}; static const WCHAR dosdev_prefixW[] = {'\\','D','o','s','D','e','v','i','c','e','s','\\'}; - if (name->Length > sizeof(nt_prefixW) && + if (name->Length >= sizeof(nt_prefixW) && !memcmp( name->Buffer, nt_prefixW, sizeof(nt_prefixW) )) return sizeof(nt_prefixW) / sizeof(WCHAR); - if (name->Length > sizeof(dosdev_prefixW) && + if (name->Length >= sizeof(dosdev_prefixW) && !memicmpW( name->Buffer, dosdev_prefixW, sizeof(dosdev_prefixW)/sizeof(WCHAR) )) return sizeof(dosdev_prefixW) / sizeof(WCHAR); @@ -3132,6 +3147,8 @@ name += pos; name_len -= pos; + if (!name_len) return STATUS_OBJECT_NAME_INVALID; + /* check for sub-directory */ for (pos = 0; pos < name_len; pos++) { diff -Nru wine1.7-1.7.50/dlls/ntdll/file.c wine1.7-1.7.55/dlls/ntdll/file.c --- wine1.7-1.7.50/dlls/ntdll/file.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntdll/file.c 2015-11-13 14:32:40.000000000 +0000 @@ -61,7 +61,22 @@ # include #endif #ifdef HAVE_SYS_VFS_H +/* Work around a conflict with Solaris' system list defined in sys/list.h. */ +#define list SYSLIST +#define list_next SYSLIST_NEXT +#define list_prev SYSLIST_PREV +#define list_head SYSLIST_HEAD +#define list_tail SYSLIST_TAIL +#define list_move_tail SYSLIST_MOVE_TAIL +#define list_remove SYSLIST_REMOVE # include +#undef list +#undef list_next +#undef list_prev +#undef list_head +#undef list_tail +#undef list_move_tail +#undef list_remove #endif #ifdef HAVE_SYS_MOUNT_H # include @@ -1780,6 +1795,11 @@ } break; } + case FSCTL_SET_SPARSE: + TRACE("FSCTL_SET_SPARSE: Ignoring request\n"); + io->Information = 0; + status = STATUS_SUCCESS; + break; case FSCTL_PIPE_LISTEN: case FSCTL_PIPE_WAIT: default: diff -Nru wine1.7-1.7.50/dlls/ntdll/loader.c wine1.7-1.7.55/dlls/ntdll/loader.c --- wine1.7-1.7.50/dlls/ntdll/loader.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntdll/loader.c 2015-11-13 14:32:40.000000000 +0000 @@ -49,6 +49,7 @@ WINE_DECLARE_DEBUG_CHANNEL(snoop); WINE_DECLARE_DEBUG_CHANNEL(loaddll); WINE_DECLARE_DEBUG_CHANNEL(imports); +WINE_DECLARE_DEBUG_CHANNEL(pid); #ifdef _WIN64 #define DEFAULT_SECURITY_COOKIE_64 (((ULONGLONG)0x00002b99 << 32) | 0x2ddfa232) @@ -1036,8 +1037,12 @@ for (callback = (const PIMAGE_TLS_CALLBACK *)dir->AddressOfCallBacks; *callback; callback++) { if (TRACE_ON(relay)) + { + if (TRACE_ON(pid)) + DPRINTF( "%04x:", GetCurrentProcessId() ); DPRINTF("%04x:Call TLS callback (proc=%p,module=%p,reason=%s,reserved=0)\n", GetCurrentThreadId(), *callback, module, reason_names[reason] ); + } __TRY { call_dll_entry_point( (DLLENTRYPROC)*callback, module, reason, NULL ); @@ -1045,14 +1050,22 @@ __EXCEPT_ALL { if (TRACE_ON(relay)) + { + if (TRACE_ON(pid)) + DPRINTF( "%04x:", GetCurrentProcessId() ); DPRINTF("%04x:exception in TLS callback (proc=%p,module=%p,reason=%s,reserved=0)\n", GetCurrentThreadId(), callback, module, reason_names[reason] ); + } return; } __ENDTRY if (TRACE_ON(relay)) + { + if (TRACE_ON(pid)) + DPRINTF( "%04x:", GetCurrentProcessId() ); DPRINTF("%04x:Ret TLS callback (proc=%p,module=%p,reason=%s,reserved=0)\n", GetCurrentThreadId(), *callback, module, reason_names[reason] ); + } } } @@ -1079,6 +1092,8 @@ size_t len = min( wm->ldr.BaseDllName.Length, sizeof(mod_name)-sizeof(WCHAR) ); memcpy( mod_name, wm->ldr.BaseDllName.Buffer, len ); mod_name[len / sizeof(WCHAR)] = 0; + if (TRACE_ON(pid)) + DPRINTF( "%04x:", GetCurrentProcessId() ); DPRINTF("%04x:Call PE DLL (proc=%p,module=%p %s,reason=%s,res=%p)\n", GetCurrentThreadId(), entry, module, debugstr_w(mod_name), reason_names[reason], lpReserved ); @@ -1095,8 +1110,12 @@ __EXCEPT_ALL { if (TRACE_ON(relay)) + { + if (TRACE_ON(pid)) + DPRINTF( "%04x:", GetCurrentProcessId() ); DPRINTF("%04x:exception in PE entry point (proc=%p,module=%p,reason=%s,res=%p)\n", GetCurrentThreadId(), entry, module, reason_names[reason], lpReserved ); + } status = GetExceptionCode(); } __ENDTRY @@ -1105,9 +1124,13 @@ to the dll. We cannot assume that this module has not been deleted. */ if (TRACE_ON(relay)) + { + if (TRACE_ON(pid)) + DPRINTF( "%04x:", GetCurrentProcessId() ); DPRINTF("%04x:Ret PE DLL (proc=%p,module=%p %s,reason=%s,res=%p) retval=%x\n", GetCurrentThreadId(), entry, module, debugstr_w(mod_name), reason_names[reason], lpReserved, retv ); + } else TRACE("(%p,%s,%p) - RETURN %d\n", module, reason_names[reason], lpReserved, retv ); return status; @@ -2185,7 +2208,7 @@ static NTSTATUS load_dll( LPCWSTR load_path, LPCWSTR libname, DWORD flags, WINE_MODREF** pwm ) { enum loadorder loadorder; - WCHAR buffer[32]; + WCHAR buffer[64]; WCHAR *filename; ULONG size; WINE_MODREF *main_exe; diff -Nru wine1.7-1.7.50/dlls/ntdll/nt.c wine1.7-1.7.55/dlls/ntdll/nt.c --- wine1.7-1.7.50/dlls/ntdll/nt.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntdll/nt.c 2015-11-13 14:32:40.000000000 +0000 @@ -971,15 +971,15 @@ if(regs2[3] & (1 << 26)) info->FeatureSet |= CPU_FEATURE_SSE2; user_shared_data->ProcessorFeatures[PF_FLOATING_POINT_EMULATED] = !(regs2[3] & 1); - user_shared_data->ProcessorFeatures[PF_RDTSC_INSTRUCTION_AVAILABLE] = (regs2[3] & (1 << 4 )) >> 4; - user_shared_data->ProcessorFeatures[PF_PAE_ENABLED] = (regs2[3] & (1 << 6 )) >> 6; - user_shared_data->ProcessorFeatures[PF_COMPARE_EXCHANGE_DOUBLE] = (regs2[3] & (1 << 8 )) >> 8; - user_shared_data->ProcessorFeatures[PF_MMX_INSTRUCTIONS_AVAILABLE] = (regs2[3] & (1 << 23)) >> 23; - user_shared_data->ProcessorFeatures[PF_XMMI_INSTRUCTIONS_AVAILABLE] = (regs2[3] & (1 << 25)) >> 25; - user_shared_data->ProcessorFeatures[PF_XMMI64_INSTRUCTIONS_AVAILABLE] = (regs2[3] & (1 << 26)) >> 26; + user_shared_data->ProcessorFeatures[PF_RDTSC_INSTRUCTION_AVAILABLE] = (regs2[3] >> 4) & 1; + user_shared_data->ProcessorFeatures[PF_PAE_ENABLED] = (regs2[3] >> 6) & 1; + user_shared_data->ProcessorFeatures[PF_COMPARE_EXCHANGE_DOUBLE] = (regs2[3] >> 8) & 1; + user_shared_data->ProcessorFeatures[PF_MMX_INSTRUCTIONS_AVAILABLE] = (regs2[3] >> 23) & 1; + user_shared_data->ProcessorFeatures[PF_XMMI_INSTRUCTIONS_AVAILABLE] = (regs2[3] >> 25) & 1; + user_shared_data->ProcessorFeatures[PF_XMMI64_INSTRUCTIONS_AVAILABLE] = (regs2[3] >> 26) & 1; user_shared_data->ProcessorFeatures[PF_SSE3_INSTRUCTIONS_AVAILABLE] = regs2[2] & 1; - user_shared_data->ProcessorFeatures[PF_XSAVE_ENABLED] = (regs2[2] & (1 << 27)) >> 27; - user_shared_data->ProcessorFeatures[PF_COMPARE_EXCHANGE128] = (regs2[2] & (1 << 13)) >> 13; + user_shared_data->ProcessorFeatures[PF_XSAVE_ENABLED] = (regs2[2] >> 27) & 1; + user_shared_data->ProcessorFeatures[PF_COMPARE_EXCHANGE128] = (regs2[2] >> 13) & 1; if((regs2[3] & (1 << 26)) && (regs2[3] & (1 << 24))) /* has SSE2 and FXSAVE/FXRSTOR */ user_shared_data->ProcessorFeatures[PF_SSE_DAZ_MODE_AVAILABLE] = have_sse_daz_mode(); @@ -999,10 +999,10 @@ if (regs[0] >= 0x80000001) { do_cpuid(0x80000001, regs2); /* get vendor features */ - user_shared_data->ProcessorFeatures[PF_VIRT_FIRMWARE_ENABLED] = (regs2[2] & (1 << 2 )) >> 2; - user_shared_data->ProcessorFeatures[PF_NX_ENABLED] = (regs2[3] & (1 << 20 )) >> 20; - user_shared_data->ProcessorFeatures[PF_3DNOW_INSTRUCTIONS_AVAILABLE] = (regs2[3] & (1 << 31 )) >> 31; - if(regs2[3] & (1 << 31)) info->FeatureSet |= CPU_FEATURE_3DNOW; + user_shared_data->ProcessorFeatures[PF_VIRT_FIRMWARE_ENABLED] = (regs2[2] >> 2) & 1; + user_shared_data->ProcessorFeatures[PF_NX_ENABLED] = (regs2[3] >> 20) & 1; + user_shared_data->ProcessorFeatures[PF_3DNOW_INSTRUCTIONS_AVAILABLE] = (regs2[3] >> 31) & 1; + if (regs2[3] >> 31) info->FeatureSet |= CPU_FEATURE_3DNOW; } } else if (regs[1] == GENU && regs[3] == INEI && regs[2] == NTEL) @@ -1016,13 +1016,13 @@ info->Revision |= regs2[0] & 0xf; /* stepping */ if(regs2[3] & (1 << 21)) info->FeatureSet |= CPU_FEATURE_DS; - user_shared_data->ProcessorFeatures[PF_VIRT_FIRMWARE_ENABLED] = (regs2[2] & (1 << 5 )) >> 5; + user_shared_data->ProcessorFeatures[PF_VIRT_FIRMWARE_ENABLED] = (regs2[2] >> 5) & 1; do_cpuid(0x80000000, regs); /* get vendor cpuid level */ if (regs[0] >= 0x80000001) { do_cpuid(0x80000001, regs2); /* get vendor features */ - user_shared_data->ProcessorFeatures[PF_NX_ENABLED] = (regs2[3] & (1 << 20 )) >> 20; + user_shared_data->ProcessorFeatures[PF_NX_ENABLED] = (regs2[3] >> 20) & 1; } } else @@ -1307,9 +1307,9 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION **data, DWORD *max_len) { - static const char core_info[] = "/sys/devices/system/cpu/cpu%d/%s"; - static const char cache_info[] = "/sys/devices/system/cpu/cpu%d/cache/index%d/%s"; - static const char numa_info[] = "/sys/devices/system/node/node%d/cpumap"; + static const char core_info[] = "/sys/devices/system/cpu/cpu%u/%s"; + static const char cache_info[] = "/sys/devices/system/cpu/cpu%u/cache/index%u/%s"; + static const char numa_info[] = "/sys/devices/system/node/node%u/cpumap"; FILE *fcpu_list, *fnuma_list, *f; DWORD len = 0, beg, end, i, j, r; diff -Nru wine1.7-1.7.50/dlls/ntdll/ntdll.spec wine1.7-1.7.55/dlls/ntdll/ntdll.spec --- wine1.7-1.7.50/dlls/ntdll/ntdll.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntdll/ntdll.spec 2015-11-13 14:32:40.000000000 +0000 @@ -130,6 +130,7 @@ @ stdcall NtCreateJobObject(ptr long ptr) # @ stub NtCreateJobSet @ stdcall NtCreateKey(ptr long ptr long ptr long long) +@ stdcall NtCreateKeyTransacted(ptr long ptr long ptr long long ptr) @ stdcall NtCreateKeyedEvent(ptr long ptr long) @ stdcall NtCreateMailslotFile(long long long long long long long long) @ stdcall NtCreateMutant(ptr long ptr long) @@ -162,9 +163,9 @@ @ stdcall NtDuplicateToken(long long long long long long) # @ stub NtEnumerateBootEntries @ stub NtEnumerateBus -@ stdcall NtEnumerateKey (long long long long long long) +@ stdcall NtEnumerateKey(long long long ptr long ptr) # @ stub NtEnumerateSystemEnvironmentValuesEx -@ stdcall NtEnumerateValueKey (long long long long long long) +@ stdcall NtEnumerateValueKey(long long long ptr long ptr) @ stub NtExtendSection # @ stub NtFilterToken @ stdcall NtFindAtom(ptr long ptr) @@ -205,7 +206,7 @@ # @ stub NtModifyBootEntry @ stdcall NtNotifyChangeDirectoryFile(long long ptr ptr ptr ptr long long long) @ stdcall NtNotifyChangeKey(long long ptr ptr ptr long long ptr long long) -# @ stub NtNotifyChangeMultipleKeys +@ stdcall NtNotifyChangeMultipleKeys(long long ptr long ptr ptr ptr long long ptr long long) @ stdcall NtOpenDirectoryObject(long long long) @ stdcall NtOpenEvent(long long long) @ stub NtOpenEventPair @@ -213,6 +214,9 @@ @ stdcall NtOpenIoCompletion(ptr long ptr) @ stdcall NtOpenJobObject(ptr long ptr) @ stdcall NtOpenKey(ptr long ptr) +@ stdcall NtOpenKeyEx(ptr long ptr long) +@ stdcall NtOpenKeyTransacted(ptr long ptr long) +@ stdcall NtOpenKeyTransactedEx(ptr long ptr long long) @ stdcall NtOpenKeyedEvent(ptr long ptr) @ stdcall NtOpenMutant(ptr long ptr) @ stub NtOpenObjectAuditAlarm @@ -273,7 +277,7 @@ @ stdcall NtQuerySystemTime(ptr) @ stdcall NtQueryTimer(ptr long ptr long ptr) @ stdcall NtQueryTimerResolution(long long long) -@ stdcall NtQueryValueKey(long long long long long long) +@ stdcall NtQueryValueKey(long ptr long ptr long ptr) @ stdcall NtQueryVirtualMemory(long ptr long ptr long ptr) @ stdcall NtQueryVolumeInformationFile(long ptr ptr long long) @ stdcall NtQueueApcThread(long ptr long long long) @@ -291,7 +295,7 @@ @ stdcall NtReleaseSemaphore(long long ptr) @ stdcall NtRemoveIoCompletion(ptr ptr ptr ptr ptr) # @ stub NtRemoveProcessDebug -# @ stub NtRenameKey +@ stdcall NtRenameKey(long ptr) @ stdcall NtReplaceKey(ptr long ptr) @ stub NtReplyPort @ stdcall NtReplyWaitReceivePort(ptr ptr ptr ptr) @@ -627,6 +631,7 @@ @ stdcall RtlGetControlSecurityDescriptor(ptr ptr ptr) @ stdcall RtlGetCurrentDirectory_U(long ptr) @ stdcall RtlGetCurrentPeb() +@ stdcall RtlGetCurrentProcessorNumberEx(ptr) @ stdcall RtlGetCurrentTransaction() @ stdcall RtlGetDaclSecurityDescriptor(ptr ptr ptr ptr) @ stub RtlGetElementGenericTable @@ -719,6 +724,8 @@ # @ stub RtlIpv6StringToAddressExW # @ stub RtlIpv6StringToAddressW @ stdcall RtlIsActivationContextActive(ptr) +@ stdcall RtlIsCriticalSectionLocked(ptr) +@ stdcall RtlIsCriticalSectionLockedByThread(ptr) @ stdcall RtlIsDosDeviceName_U(wstr) @ stub RtlIsGenericTableEmpty # @ stub RtlIsGenericTableEmptyAvl @@ -936,7 +943,7 @@ @ stub RtlUsageHeap @ cdecl -i386 -norelay RtlUshortByteSwap() NTDLL_RtlUshortByteSwap @ stdcall RtlValidAcl(ptr) -# @ stub RtlValidRelativeSecurityDescriptor +@ stdcall RtlValidRelativeSecurityDescriptor(ptr long long) @ stdcall RtlValidSecurityDescriptor(ptr) @ stdcall RtlValidSid(ptr) @ stdcall RtlValidateHeap(long long ptr) @@ -1010,7 +1017,7 @@ # @ stub ZwAccessCheckByTypeResultListAndAuditAlarmByHandle @ stdcall ZwAddAtom(ptr long ptr) NtAddAtom # @ stub ZwAddBootEntry -@ stdcall ZwAdjustGroupsToken(long long long long long long) NtAdjustGroupsToken +@ stdcall ZwAdjustGroupsToken(long long ptr long ptr ptr) NtAdjustGroupsToken @ stdcall ZwAdjustPrivilegesToken(long long long long long long) NtAdjustPrivilegesToken @ stdcall ZwAlertResumeThread(long ptr) NtAlertResumeThread @ stdcall ZwAlertThread(long) NtAlertThread @@ -1043,12 +1050,13 @@ @ stdcall ZwCreateJobObject(ptr long ptr) NtCreateJobObject # @ stub ZwCreateJobSet @ stdcall ZwCreateKey(ptr long ptr long ptr long long) NtCreateKey +@ stdcall ZwCreateKeyTransacted(ptr long ptr long ptr long long ptr) NtCreateKeyTransacted @ stdcall ZwCreateKeyedEvent(ptr long ptr long) NtCreateKeyedEvent @ stdcall ZwCreateMailslotFile(long long long long long long long long) NtCreateMailslotFile @ stdcall ZwCreateMutant(ptr long ptr long) NtCreateMutant @ stdcall ZwCreateNamedPipeFile(ptr long ptr ptr long long long long long long long long long ptr) NtCreateNamedPipeFile @ stdcall ZwCreatePagingFile(long long long long) NtCreatePagingFile -@ stdcall ZwCreatePort(ptr ptr long long long) NtCreatePort +@ stdcall ZwCreatePort(ptr ptr long long ptr) NtCreatePort @ stub ZwCreateProcess # @ stub ZwCreateProcessEx @ stub ZwCreateProfile @@ -1089,11 +1097,12 @@ @ stdcall ZwFreeVirtualMemory(long ptr ptr long) NtFreeVirtualMemory @ stdcall ZwFsControlFile(long long long long long long long long long long) NtFsControlFile @ stdcall ZwGetContextThread(long ptr) NtGetContextThread +@ stdcall ZwGetCurrentProcessorNumber() NtGetCurrentProcessorNumber # @ stub ZwGetDevicePowerState @ stub ZwGetPlugPlayEvent @ stdcall ZwGetTickCount() NtGetTickCount @ stdcall ZwGetWriteWatch(long long ptr long ptr ptr ptr) NtGetWriteWatch -# @ stub ZwImpersonateAnonymousToken +@ stdcall ZwImpersonateAnonymousToken(long) NtImpersonateAnonymousToken @ stub ZwImpersonateClientOfPort @ stub ZwImpersonateThread @ stub ZwInitializeRegistry @@ -1116,7 +1125,7 @@ # @ stub ZwModifyBootEntry @ stdcall ZwNotifyChangeDirectoryFile(long long ptr ptr ptr ptr long long long) NtNotifyChangeDirectoryFile @ stdcall ZwNotifyChangeKey(long long ptr ptr ptr long long ptr long long) NtNotifyChangeKey -# @ stub ZwNotifyChangeMultipleKeys +@ stdcall ZwNotifyChangeMultipleKeys(long long ptr long ptr ptr ptr long long ptr long long) NtNotifyChangeMultipleKeys @ stdcall ZwOpenDirectoryObject(long long long) NtOpenDirectoryObject @ stdcall ZwOpenEvent(long long long) NtOpenEvent @ stub ZwOpenEventPair @@ -1124,6 +1133,9 @@ @ stdcall ZwOpenIoCompletion(ptr long ptr) NtOpenIoCompletion @ stdcall ZwOpenJobObject(ptr long ptr) NtOpenJobObject @ stdcall ZwOpenKey(ptr long ptr) NtOpenKey +@ stdcall ZwOpenKeyEx(ptr long ptr long) NtOpenKeyEx +@ stdcall ZwOpenKeyTransacted(ptr long ptr long) NtOpenKeyTransacted +@ stdcall ZwOpenKeyTransactedEx(ptr long ptr long long) NtOpenKeyTransactedEx @ stdcall ZwOpenKeyedEvent(ptr long ptr) NtOpenKeyedEvent @ stdcall ZwOpenMutant(ptr long ptr) NtOpenMutant @ stub ZwOpenObjectAuditAlarm @@ -1171,15 +1183,15 @@ @ stdcall ZwQueryMutant(long long ptr long ptr) NtQueryMutant @ stdcall ZwQueryObject(long long long long long) NtQueryObject @ stub ZwQueryOpenSubKeys -@ stdcall ZwQueryPerformanceCounter (long long) NtQueryPerformanceCounter +@ stdcall ZwQueryPerformanceCounter(ptr ptr) NtQueryPerformanceCounter # @ stub ZwQueryPortInformationProcess # @ stub ZwQueryQuotaInformationFile @ stdcall ZwQuerySection (long long long long long) NtQuerySection @ stdcall ZwQuerySecurityObject (long long long long long) NtQuerySecurityObject -@ stdcall ZwQuerySemaphore (long long long long long) NtQuerySemaphore +@ stdcall ZwQuerySemaphore(long long ptr long ptr) NtQuerySemaphore @ stdcall ZwQuerySymbolicLinkObject(long ptr ptr) NtQuerySymbolicLinkObject -@ stub ZwQuerySystemEnvironmentValue -# @ stub ZwQuerySystemEnvironmentValueEx +@ stdcall ZwQuerySystemEnvironmentValue(ptr ptr long ptr) NtQuerySystemEnvironmentValue +@ stdcall ZwQuerySystemEnvironmentValueEx(ptr ptr ptr ptr ptr) NtQuerySystemEnvironmentValueEx @ stdcall ZwQuerySystemInformation(long long long long) NtQuerySystemInformation @ stdcall ZwQuerySystemTime(ptr) NtQuerySystemTime @ stdcall ZwQueryTimer(ptr long ptr long ptr) NtQueryTimer @@ -1189,7 +1201,7 @@ @ stdcall ZwQueryVolumeInformationFile(long ptr ptr long long) NtQueryVolumeInformationFile @ stdcall ZwQueueApcThread(long ptr long long long) NtQueueApcThread @ stdcall ZwRaiseException(ptr ptr long) NtRaiseException -@ stub ZwRaiseHardError +@ stdcall ZwRaiseHardError(long long ptr ptr long long) NtRaiseHardError @ stdcall ZwReadFile(long long ptr ptr ptr ptr long ptr ptr) NtReadFile @ stdcall ZwReadFileScatter(long long ptr ptr ptr ptr long ptr ptr) NtReadFileScatter @ stub ZwReadRequestData @@ -1202,11 +1214,11 @@ @ stdcall ZwReleaseSemaphore(long long ptr) NtReleaseSemaphore @ stdcall ZwRemoveIoCompletion(ptr ptr ptr ptr ptr) NtRemoveIoCompletion # @ stub ZwRemoveProcessDebug -# @ stub ZwRenameKey +@ stdcall ZwRenameKey(long ptr) NtRenameKey @ stdcall ZwReplaceKey(ptr long ptr) NtReplaceKey @ stub ZwReplyPort @ stdcall ZwReplyWaitReceivePort(ptr ptr ptr ptr) NtReplyWaitReceivePort -# @ stub ZwReplyWaitReceivePortEx +@ stub ZwReplyWaitReceivePortEx @ stub ZwReplyWaitReplyPort # @ stub ZwRequestDeviceWakeup @ stub ZwRequestPort @@ -1224,7 +1236,7 @@ # @ stub ZwSetBootEntryOrder # @ stub ZwSetBootOptions @ stdcall ZwSetContextThread(long ptr) NtSetContextThread -# @ stub ZwSetDebugFilterState +@ stub ZwSetDebugFilterState @ stub ZwSetDefaultHardErrorPort @ stdcall ZwSetDefaultLocale(long long) NtSetDefaultLocale @ stdcall ZwSetDefaultUILanguage(long) NtSetDefaultUILanguage diff -Nru wine1.7-1.7.50/dlls/ntdll/path.c wine1.7-1.7.55/dlls/ntdll/path.c --- wine1.7-1.7.50/dlls/ntdll/path.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntdll/path.c 2015-11-13 14:32:40.000000000 +0000 @@ -869,7 +869,7 @@ if (oem->Length > 12) return FALSE; /* a starting . is invalid, except for . and .. */ - if (oem->Buffer[0] == '.') + if (oem->Length > 0 && oem->Buffer[0] == '.') { if (oem->Length != 1 && (oem->Length != 2 || oem->Buffer[1] != '.')) return FALSE; if (spaces) *spaces = FALSE; diff -Nru wine1.7-1.7.50/dlls/ntdll/reg.c wine1.7-1.7.55/dlls/ntdll/reg.c --- wine1.7-1.7.50/dlls/ntdll/reg.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntdll/reg.c 2015-11-13 14:32:40.000000000 +0000 @@ -84,6 +84,21 @@ return ret; } +NTSTATUS WINAPI NtCreateKeyTransacted( PHANDLE retkey, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, + ULONG TitleIndex, const UNICODE_STRING *class, ULONG options, + HANDLE transacted, ULONG *dispos ) +{ + FIXME( "(%p,%s,%s,%x,%x,%p,%p)\n", attr->RootDirectory, debugstr_us(attr->ObjectName), + debugstr_us(class), options, access, transacted, retkey ); + return STATUS_NOT_IMPLEMENTED; +} + +NTSTATUS WINAPI NtRenameKey( HANDLE handle, UNICODE_STRING *name ) +{ + FIXME( "(%p %s)\n", handle, debugstr_us(name) ); + return STATUS_NOT_IMPLEMENTED; +} + /****************************************************************************** * RtlpNtCreateKey [NTDLL.@] * @@ -106,14 +121,10 @@ } /****************************************************************************** - * NtOpenKey [NTDLL.@] - * ZwOpenKey [NTDLL.@] - * - * OUT HANDLE retkey (returns 0 when failure) - * IN ACCESS_MASK access - * IN POBJECT_ATTRIBUTES attr + * NtOpenKeyEx [NTDLL.@] + * ZwOpenKeyEx [NTDLL.@] */ -NTSTATUS WINAPI NtOpenKey( PHANDLE retkey, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) +NTSTATUS WINAPI NtOpenKeyEx( PHANDLE retkey, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, ULONG options ) { NTSTATUS ret; DWORD len; @@ -123,6 +134,8 @@ len = attr->ObjectName->Length; TRACE( "(%p,%s,%x,%p)\n", attr->RootDirectory, debugstr_us(attr->ObjectName), access, retkey ); + if (options) + FIXME("options %x not implemented\n", options); if (len > MAX_NAME_LENGTH) return STATUS_BUFFER_OVERFLOW; @@ -141,6 +154,32 @@ } /****************************************************************************** + * NtOpenKey [NTDLL.@] + * ZwOpenKey [NTDLL.@] + * + * OUT HANDLE retkey (returns 0 when failure) + * IN ACCESS_MASK access + * IN POBJECT_ATTRIBUTES attr + */ +NTSTATUS WINAPI NtOpenKey( PHANDLE retkey, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr ) +{ + return NtOpenKeyEx( retkey, access, attr, 0 ); +} + +NTSTATUS WINAPI NtOpenKeyTransactedEx( PHANDLE retkey, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, + ULONG options, HANDLE transaction ) +{ + FIXME( "(%p %x %p %x %p)\n", retkey, access, attr, options, transaction ); + return STATUS_NOT_IMPLEMENTED; +} + +NTSTATUS WINAPI NtOpenKeyTransacted( PHANDLE retkey, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr, + HANDLE transaction ) +{ + return NtOpenKeyTransactedEx( retkey, access, attr, 0, transaction ); +} + +/****************************************************************************** * RtlpNtOpenKey [NTDLL.@] * * See NtOpenKey. @@ -218,10 +257,11 @@ switch(info_class) { - case KeyBasicInformation: data_ptr = ((KEY_BASIC_INFORMATION *)info)->Name; break; - case KeyFullInformation: data_ptr = ((KEY_FULL_INFORMATION *)info)->Class; break; - case KeyNodeInformation: data_ptr = ((KEY_NODE_INFORMATION *)info)->Name; break; - case KeyNameInformation: data_ptr = ((KEY_NAME_INFORMATION *)info)->Name; break; + case KeyBasicInformation: data_ptr = ((KEY_BASIC_INFORMATION *)info)->Name; break; + case KeyFullInformation: data_ptr = ((KEY_FULL_INFORMATION *)info)->Class; break; + case KeyNodeInformation: data_ptr = ((KEY_NODE_INFORMATION *)info)->Name; break; + case KeyNameInformation: data_ptr = ((KEY_NAME_INFORMATION *)info)->Name; break; + case KeyCachedInformation: data_ptr = ((KEY_CACHED_INFORMATION *)info)+1; break; default: FIXME( "Information class %d not implemented\n", info_class ); return STATUS_INVALID_PARAMETER; @@ -293,6 +333,23 @@ memcpy( info, &keyinfo, min( length, fixed_size ) ); } break; + case KeyCachedInformation: + { + KEY_CACHED_INFORMATION keyinfo; + fixed_size = sizeof(keyinfo); + keyinfo.LastWriteTime.QuadPart = reply->modif; + keyinfo.TitleIndex = 0; + keyinfo.SubKeys = reply->subkeys; + keyinfo.MaxNameLen = reply->max_subkey; + keyinfo.Values = reply->values; + keyinfo.MaxValueNameLen = reply->max_value; + keyinfo.MaxValueDataLen = reply->max_data; + keyinfo.NameLength = reply->namelen; + memcpy( info, &keyinfo, min( length, fixed_size ) ); + } + break; + default: + break; } *result_len = fixed_size + reply->total; if (length < *result_len) ret = STATUS_BUFFER_OVERFLOW; @@ -622,28 +679,30 @@ } /****************************************************************************** - * NtNotifyChangeKey [NTDLL.@] - * ZwNotifyChangeKey [NTDLL.@] + * NtNotifyChangeMultipleKeys [NTDLL.@] + * ZwNotifyChangeMultipleKeys [NTDLL.@] */ -NTSTATUS WINAPI NtNotifyChangeKey( - IN HANDLE KeyHandle, - IN HANDLE Event, - IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, - IN PVOID ApcContext OPTIONAL, - OUT PIO_STATUS_BLOCK IoStatusBlock, - IN ULONG CompletionFilter, - IN BOOLEAN Asynchronous, - OUT PVOID ChangeBuffer, - IN ULONG Length, - IN BOOLEAN WatchSubtree) +NTSTATUS WINAPI NtNotifyChangeMultipleKeys( + HANDLE KeyHandle, + ULONG Count, + OBJECT_ATTRIBUTES *SubordinateObjects, + HANDLE Event, + PIO_APC_ROUTINE ApcRoutine, + PVOID ApcContext, + PIO_STATUS_BLOCK IoStatusBlock, + ULONG CompletionFilter, + BOOLEAN WatchSubtree, + PVOID ChangeBuffer, + ULONG Length, + BOOLEAN Asynchronous) { NTSTATUS ret; - TRACE("(%p,%p,%p,%p,%p,0x%08x, 0x%08x,%p,0x%08x,0x%08x)\n", - KeyHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, CompletionFilter, + TRACE("(%p,%u,%p,%p,%p,%p,%p,0x%08x, 0x%08x,%p,0x%08x,0x%08x)\n", + KeyHandle, Count, SubordinateObjects, Event, ApcRoutine, ApcContext, IoStatusBlock, CompletionFilter, Asynchronous, ChangeBuffer, Length, WatchSubtree); - if (ApcRoutine || ApcContext || ChangeBuffer || Length) + if (Count || SubordinateObjects || ApcRoutine || ApcContext || ChangeBuffer || Length) FIXME("Unimplemented optional parameter\n"); if (!Asynchronous) @@ -667,12 +726,33 @@ if (!Asynchronous) { - if (ret == STATUS_SUCCESS) - NtWaitForSingleObject( Event, FALSE, NULL ); + if (ret == STATUS_PENDING) + ret = NtWaitForSingleObject( Event, FALSE, NULL ); NtClose( Event ); } - return STATUS_SUCCESS; + return ret; +} + +/****************************************************************************** + * NtNotifyChangeKey [NTDLL.@] + * ZwNotifyChangeKey [NTDLL.@] + */ +NTSTATUS WINAPI NtNotifyChangeKey( + IN HANDLE KeyHandle, + IN HANDLE Event, + IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, + IN PVOID ApcContext OPTIONAL, + OUT PIO_STATUS_BLOCK IoStatusBlock, + IN ULONG CompletionFilter, + IN BOOLEAN WatchSubtree, + OUT PVOID ChangeBuffer, + IN ULONG Length, + IN BOOLEAN Asynchronous) +{ + return NtNotifyChangeMultipleKeys(KeyHandle, 0, NULL, Event, ApcRoutine, ApcContext, + IoStatusBlock, CompletionFilter, WatchSubtree, + ChangeBuffer, Length, Asynchronous); } /****************************************************************************** diff -Nru wine1.7-1.7.50/dlls/ntdll/relay.c wine1.7-1.7.55/dlls/ntdll/relay.c --- wine1.7-1.7.50/dlls/ntdll/relay.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntdll/relay.c 2015-11-13 14:32:40.000000000 +0000 @@ -41,6 +41,7 @@ #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) WINE_DECLARE_DEBUG_CHANNEL(timestamp); +WINE_DECLARE_DEBUG_CHANNEL(pid); struct relay_descr /* descriptor for a module */ { @@ -340,6 +341,9 @@ { if (TRACE_ON(timestamp)) print_timestamp(); + if (TRACE_ON(pid)) + DPRINTF( "%04x:", GetCurrentProcessId() ); + if (entry_point->name) DPRINTF( "%04x:Call %s.%s(", GetCurrentThreadId(), data->dllname, entry_point->name ); else @@ -365,6 +369,9 @@ if (TRACE_ON(timestamp)) print_timestamp(); + if (TRACE_ON(pid)) + DPRINTF( "%04x:", GetCurrentProcessId() ); + if (entry_point->name) DPRINTF( "%04x:Ret %s.%s()", GetCurrentThreadId(), data->dllname, entry_point->name ); else @@ -1078,6 +1085,8 @@ context->Eip = (DWORD)fun->origfun; + if (!TRACE_ON(snoop)) return; + if (TRACE_ON(timestamp)) print_timestamp(); if (fun->name) DPRINTF("%04x:CALL %s.%s(",GetCurrentThreadId(),dll->name,fun->name); @@ -1114,6 +1123,12 @@ if (ret->dll->funs[ret->ordinal].nrofargs<0) ret->dll->funs[ret->ordinal].nrofargs=(context->Esp - ret->origESP-4)/4; context->Eip = (DWORD)ret->origreturn; + + if (!TRACE_ON(snoop)) { + ret->origreturn = NULL; /* mark as empty */ + return; + } + if (TRACE_ON(timestamp)) print_timestamp(); if (ret->args) { diff -Nru wine1.7-1.7.50/dlls/ntdll/rtl.c wine1.7-1.7.55/dlls/ntdll/rtl.c --- wine1.7-1.7.50/dlls/ntdll/rtl.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntdll/rtl.c 2015-11-13 14:32:40.000000000 +0000 @@ -1584,3 +1584,14 @@ FIXME("(%p) :stub\n", new_transaction); return FALSE; } + +/********************************************************************** + * RtlGetCurrentProcessorNumberEx [NTDLL.@] + */ +void WINAPI RtlGetCurrentProcessorNumberEx(PROCESSOR_NUMBER *processor) +{ + FIXME("(%p) :semi-stub\n", processor); + processor->Group = 0; + processor->Number = NtGetCurrentProcessorNumber(); + processor->Reserved = 0; +} diff -Nru wine1.7-1.7.50/dlls/ntdll/sec.c wine1.7-1.7.55/dlls/ntdll/sec.c --- wine1.7-1.7.50/dlls/ntdll/sec.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntdll/sec.c 2015-11-13 14:32:40.000000000 +0000 @@ -558,6 +558,16 @@ } /************************************************************************** + * RtlValidRelativeSecurityDescriptor [NTDLL.@] + */ +BOOLEAN WINAPI RtlValidRelativeSecurityDescriptor(PSECURITY_DESCRIPTOR descriptor, + ULONG length, SECURITY_INFORMATION info) +{ + FIXME("%p,%u,%d: semi-stub\n", descriptor, length, info); + return RtlValidSecurityDescriptor(descriptor) == STATUS_SUCCESS; +} + +/************************************************************************** * RtlLengthSecurityDescriptor [NTDLL.@] */ ULONG WINAPI RtlLengthSecurityDescriptor( diff -Nru wine1.7-1.7.50/dlls/ntdll/server.c wine1.7-1.7.55/dlls/ntdll/server.c --- wine1.7-1.7.50/dlls/ntdll/server.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntdll/server.c 2015-11-13 14:32:40.000000000 +0000 @@ -614,10 +614,11 @@ if (ret != STATUS_USER_APC) break; if (invoke_apc( &call, &result )) { - /* if we ran a user apc we have to check once more if an object got signaled, + /* if we ran a user apc we have to check once more if additional apcs are queued, * but we don't want to wait */ abs_timeout = 0; user_apc = TRUE; + size = 0; } /* don't signal multiple times */ @@ -676,7 +677,6 @@ SERVER_END_REQ; if (!ret && result->type == APC_NONE) continue; /* APC didn't run, try again */ - if (ret) NtClose( handle ); } return ret; } diff -Nru wine1.7-1.7.50/dlls/ntdll/signal_x86_64.c wine1.7-1.7.55/dlls/ntdll/signal_x86_64.c --- wine1.7-1.7.50/dlls/ntdll/signal_x86_64.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntdll/signal_x86_64.c 2015-11-13 14:32:40.000000000 +0000 @@ -3288,6 +3288,64 @@ } +/********************************************************************** + * call_consolidate_callback + * + * Wrapper function to call a consolidate callback from a fake frame. + * If the callback executes RtlUnwindEx (like for example done in C++ handlers), + * we have to skip all frames which were already processed. To do that we + * trick the unwinding functions into thinking the call came from somewhere + * else. All CFI instructions are either DW_CFA_def_cfa_expression or + * DW_CFA_expression, and the expressions have the following format: + * + * DW_OP_breg6; sleb128 0x10 | Load %rbp + 0x10 + * DW_OP_deref | Get *(%rbp + 0x10) == context + * DW_OP_plus_uconst; uleb128 | Add offset to get struct member + * [DW_OP_deref] | Dereference, only for CFA + */ +extern void * WINAPI call_consolidate_callback( CONTEXT *context, + void *(CALLBACK *callback)(EXCEPTION_RECORD *), + EXCEPTION_RECORD *rec ); +__ASM_GLOBAL_FUNC( call_consolidate_callback, + "pushq %rbp\n\t" + __ASM_CFI(".cfi_adjust_cfa_offset 8\n\t") + __ASM_CFI(".cfi_rel_offset %rbp,0\n\t") + "movq %rsp,%rbp\n\t" + __ASM_CFI(".cfi_def_cfa_register %rbp\n\t") + "subq $0x20,%rsp\n\t" + "movq %rcx,0x10(%rbp)\n\t" + __ASM_CFI(".cfi_remember_state\n\t") + __ASM_CFI(".cfi_escape 0x0f,0x07,0x76,0x10,0x06,0x23,0x98,0x01,0x06\n\t") /* CFA */ + __ASM_CFI(".cfi_escape 0x10,0x03,0x06,0x76,0x10,0x06,0x23,0x90,0x01\n\t") /* %rbx */ + __ASM_CFI(".cfi_escape 0x10,0x04,0x06,0x76,0x10,0x06,0x23,0xa8,0x01\n\t") /* %rsi */ + __ASM_CFI(".cfi_escape 0x10,0x05,0x06,0x76,0x10,0x06,0x23,0xb0,0x01\n\t") /* %rdi */ + __ASM_CFI(".cfi_escape 0x10,0x06,0x06,0x76,0x10,0x06,0x23,0xa0,0x01\n\t") /* %rbp */ + __ASM_CFI(".cfi_escape 0x10,0x0c,0x06,0x76,0x10,0x06,0x23,0xd8,0x01\n\t") /* %r12 */ + __ASM_CFI(".cfi_escape 0x10,0x0d,0x06,0x76,0x10,0x06,0x23,0xe0,0x01\n\t") /* %r13 */ + __ASM_CFI(".cfi_escape 0x10,0x0e,0x06,0x76,0x10,0x06,0x23,0xe8,0x01\n\t") /* %r14 */ + __ASM_CFI(".cfi_escape 0x10,0x0f,0x06,0x76,0x10,0x06,0x23,0xf0,0x01\n\t") /* %r15 */ + __ASM_CFI(".cfi_escape 0x10,0x10,0x06,0x76,0x10,0x06,0x23,0xf8,0x01\n\t") /* %rip */ + __ASM_CFI(".cfi_escape 0x10,0x17,0x06,0x76,0x10,0x06,0x23,0x80,0x04\n\t") /* %xmm6 */ + __ASM_CFI(".cfi_escape 0x10,0x18,0x06,0x76,0x10,0x06,0x23,0x90,0x04\n\t") /* %xmm7 */ + __ASM_CFI(".cfi_escape 0x10,0x19,0x06,0x76,0x10,0x06,0x23,0xa0,0x04\n\t") /* %xmm8 */ + __ASM_CFI(".cfi_escape 0x10,0x1a,0x06,0x76,0x10,0x06,0x23,0xb0,0x04\n\t") /* %xmm9 */ + __ASM_CFI(".cfi_escape 0x10,0x1b,0x06,0x76,0x10,0x06,0x23,0xc0,0x04\n\t") /* %xmm10 */ + __ASM_CFI(".cfi_escape 0x10,0x1c,0x06,0x76,0x10,0x06,0x23,0xd0,0x04\n\t") /* %xmm11 */ + __ASM_CFI(".cfi_escape 0x10,0x1d,0x06,0x76,0x10,0x06,0x23,0xe0,0x04\n\t") /* %xmm12 */ + __ASM_CFI(".cfi_escape 0x10,0x1e,0x06,0x76,0x10,0x06,0x23,0xf0,0x04\n\t") /* %xmm13 */ + __ASM_CFI(".cfi_escape 0x10,0x1f,0x06,0x76,0x10,0x06,0x23,0x80,0x05\n\t") /* %xmm14 */ + __ASM_CFI(".cfi_escape 0x10,0x20,0x06,0x76,0x10,0x06,0x23,0x90,0x05\n\t") /* %xmm15 */ + "movq %r8,%rcx\n\t" + "callq *%rdx\n\t" + __ASM_CFI(".cfi_restore_state\n\t") + "movq %rbp,%rsp\n\t" + __ASM_CFI(".cfi_def_cfa_register %rsp\n\t") + "popq %rbp\n\t" + __ASM_CFI(".cfi_adjust_cfa_offset -8\n\t") + __ASM_CFI(".cfi_same_value %rbp\n\t") + "ret") + + /******************************************************************* * RtlUnwindEx (NTDLL.@) */ @@ -3474,8 +3532,9 @@ else if (rec->ExceptionCode == STATUS_UNWIND_CONSOLIDATE && rec->NumberParameters >= 1) { PVOID (CALLBACK *consolidate)(EXCEPTION_RECORD *) = (void *)rec->ExceptionInformation[0]; - TRACE( "calling consolidate callback %p\n", consolidate ); - target_ip = consolidate( rec ); + TRACE( "calling consolidate callback %p (rec=%p)\n", consolidate, rec ); + target_ip = call_consolidate_callback( context, consolidate, rec ); + TRACE( "-> target=%p\n", target_ip ); } context->Rax = (ULONG64)retval; context->Rip = (ULONG64)target_ip; diff -Nru wine1.7-1.7.50/dlls/ntdll/string.c wine1.7-1.7.55/dlls/ntdll/string.c --- wine1.7-1.7.50/dlls/ntdll/string.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntdll/string.c 2015-11-13 14:32:40.000000000 +0000 @@ -24,6 +24,7 @@ #include "wine/port.h" #include +#include #include #include #include @@ -774,16 +775,601 @@ } +/* helper function for *scanf. Returns the value of character c in the + * given base, or -1 if the given character is not a digit of the base. + */ +static int char2digit( char c, int base ) +{ + if ((c >= '0' && c <= '9') && (c <= '0'+base-1)) return (c-'0'); + if (base <= 10) return -1; + if ((c >= 'A') && (c <= 'Z') && (c <= 'A'+base-11)) return (c-'A'+10); + if ((c >= 'a') && (c <= 'z') && (c <= 'a'+base-11)) return (c-'a'+10); + return -1; +} + + +static int NTDLL_vsscanf( const char *str, const char *format, __ms_va_list ap) +{ + int rd = 0, consumed = 0; + int nch; + if (!*format) return 0; + + nch = (consumed++, *str++); + if (nch == '\0') + return EOF; + + while (*format) + { + if (isspace( *format )) + { + /* skip whitespace */ + while ((nch != '\0') && isspace( nch )) + nch = (consumed++, *str++); + } + else if (*format == '%') + { + int st = 0; + BOOLEAN suppress = 0; + int width = 0; + int base; + int h_prefix = 0; + BOOLEAN l_prefix = FALSE; + BOOLEAN L_prefix = FALSE; + BOOLEAN w_prefix = FALSE; + BOOLEAN I64_prefix = FALSE; + BOOLEAN prefix_finished = FALSE; + format++; + /* a leading asterisk means 'suppress assignment of this field' */ + if (*format == '*') + { + format++; + suppress = TRUE; + } + /* look for width specification */ + while (isdigit( *format )) + { + width *= 10; + width += *format++ - '0'; + } + if (width == 0) width = -1; /* no width spec seen */ + /* read prefix (if any) */ + while (!prefix_finished) + { + switch (*format) + { + case 'h': h_prefix++; break; + case 'l': + if (*(format+1) == 'l') + { + I64_prefix = TRUE; + format++; + } + l_prefix = TRUE; + break; + case 'w': w_prefix = TRUE; break; + case 'L': L_prefix = TRUE; break; + case 'I': + if (*(format + 1) == '6' && + *(format + 2) == '4') + { + I64_prefix = TRUE; + format += 2; + } + break; + default: + prefix_finished = TRUE; + } + if (!prefix_finished) format++; + } + /* read type */ + switch (*format) + { + case 'p': + case 'P': /* pointer. */ + if (sizeof(void *) == sizeof(LONGLONG)) I64_prefix = TRUE; + /* fall through */ + case 'x': + case 'X': /* hexadecimal integer. */ + base = 16; + goto number; + case 'o': /* octal integer */ + base = 8; + goto number; + case 'u': /* unsigned decimal integer */ + base = 10; + goto number; + case 'd': /* signed decimal integer */ + base = 10; + goto number; + case 'i': /* generic integer */ + base = 0; + number: + { + /* read an integer */ + ULONGLONG cur = 0; + BOOLEAN negative = FALSE; + BOOLEAN seendigit = FALSE; + /* skip initial whitespace */ + while ((nch != '\0') && isspace( nch )) + nch = (consumed++, *str++); + /* get sign */ + if (nch == '-' || nch == '+') + { + negative = (nch == '-'); + nch = (consumed++, *str++); + if (width > 0) width--; + } + /* look for leading indication of base */ + if (width != 0 && nch == '0' && *format != 'p' && *format != 'P') + { + nch = (consumed++, *str++); + if (width > 0) width--; + seendigit = TRUE; + if (width != 0 && (nch == 'x' || nch == 'X')) + { + if (base == 0) + base = 16; + if (base == 16) + { + nch = (consumed++, *str++); + if (width > 0) width--; + seendigit = FALSE; + } + } else if (base == 0) + base = 8; + } + /* format %i without indication of base */ + if (base == 0) + base = 10; + /* throw away leading zeros */ + while (width != 0 && nch == '0') + { + nch = (consumed++, *str++); + if (width > 0) width--; + seendigit = TRUE; + } + if (width != 0 && char2digit( nch, base ) != -1) + { + cur = char2digit( nch, base ); + nch = (consumed++, *str++); + if (width > 0) width--; + seendigit = TRUE; + } + /* read until no more digits */ + while (width != 0 && nch != '\0' && char2digit( nch, base ) != -1) + { + cur = cur*base + char2digit( nch, base ); + nch = (consumed++, *str++); + if (width > 0) width--; + seendigit = TRUE; + } + /* okay, done! */ + if (!seendigit) break; /* not a valid number */ + st = 1; + if (!suppress) + { +#define _SET_NUMBER_( type ) *va_arg( ap, type* ) = negative ? -cur : cur + if (I64_prefix) _SET_NUMBER_( LONGLONG ); + else if (l_prefix) _SET_NUMBER_( LONG ); + else if (h_prefix == 1) _SET_NUMBER_( short int ); + else _SET_NUMBER_( int ); + } + } + break; + case 'e': + case 'E': + case 'f': + case 'g': + case 'G': + { /* read a float */ + long double cur = 1, expcnt = 10; + ULONGLONG d, hlp; + int exp = 0; + BOOLEAN negative = FALSE; + /*unsigned fpcontrol;*/ + BOOLEAN negexp; + + /* skip initial whitespace */ + while (nch != '\0' && isspace( nch )) + nch = (consumed++, *str++); + + /* get sign */ + if (nch == '-' || nch == '+') + { + negative = (nch == '-'); + if (width > 0) width--; + if (width == 0) break; + nch = (consumed++, *str++); + } + + /* get first digit */ + if ('.' != nch) + { + if (!isdigit( nch )) break; + d = nch - '0'; + nch = (consumed++, *str++); + if (width > 0) width--; + /* read until no more digits */ + while (width != 0 && nch != '\0' && isdigit( nch )) + { + hlp = d * 10 + nch - '0'; + nch = (consumed++, *str++); + if (width > 0) width--; + if(d > (ULONGLONG)-1/10 || hlp < d) + { + exp++; + break; + } + else + d = hlp; + } + while (width != 0 && nch != '\0' && isdigit( nch )) + { + exp++; + nch = (consumed++, *str++); + if (width > 0) width--; + } + } + else + d = 0; /* Fix: .8 -> 0.8 */ + + /* handle decimals */ + if (width != 0 && nch == '.') + { + nch = (consumed++, *str++); + if (width > 0) width--; + + while (width != 0 && nch != '\0' && isdigit( nch )) + { + hlp = d * 10 + nch - '0'; + nch = (consumed++, *str++); + if (width > 0) width--; + if(d > (ULONGLONG)-1/10 || hlp < d) + break; + + d = hlp; + exp--; + } + while (width != 0 && nch != '\0' && isdigit( nch )) + { + nch = (consumed++, *str++); + if (width > 0) width--; + } + } + + /* handle exponent */ + if (width != 0 && (nch == 'e' || nch == 'E')) + { + int sign = 1, e = 0; + + nch = (consumed++, *str++); + if (width > 0) width--; + if (width != 0 && (nch == '+' || nch == '-')) + { + if(nch == '-') + sign = -1; + nch = (consumed++, *str++); + if (width > 0) width--; + } + + /* exponent digits */ + while (width != 0 && nch != '\0' && isdigit( nch )) + { + if (e > INT_MAX/10 || (e = e * 10 + nch - '0') < 0) + e = INT_MAX; + nch = (consumed++, *str++); + if (width > 0) width--; + } + e *= sign; + + if(exp < 0 && e < 0 && e+exp > 0) exp = INT_MIN; + else if(exp > 0 && e > 0 && e+exp < 0) exp = INT_MAX; + else exp += e; + } + + /*fpcontrol = _control87(0, 0); + _control87(MSVCRT__EM_DENORMAL|MSVCRT__EM_INVALID|MSVCRT__EM_ZERODIVIDE + |MSVCRT__EM_OVERFLOW|MSVCRT__EM_UNDERFLOW|MSVCRT__EM_INEXACT, 0xffffffff);*/ + + negexp = (exp < 0); + if (negexp) + exp = -exp; + /* update 'cur' with this exponent. */ + while (exp) + { + if(exp & 1) + cur *= expcnt; + exp /= 2; + expcnt = expcnt*expcnt; + } + cur = (negexp ? d/cur : d*cur); + + /*_control87(fpcontrol, 0xffffffff);*/ + + st = 1; + if (!suppress) + { + if (L_prefix || l_prefix) _SET_NUMBER_( double ); + else _SET_NUMBER_( float ); + } + } + break; + /* According to msdn, + * 's' reads a character string in a call to fscanf + * and 'S' a wide character string and vice versa in a + * call to fwscanf. The 'h', 'w' and 'l' prefixes override + * this behaviour. 'h' forces reading char * but 'l' and 'w' + * force reading WCHAR. */ + case 's': + if (w_prefix || l_prefix) goto widecharstring; + else if (h_prefix) goto charstring; + else goto charstring; + case 'S': + if (w_prefix || l_prefix) goto widecharstring; + else if (h_prefix) goto charstring; + else goto widecharstring; + charstring: + { /* read a word into a char */ + char *sptr = suppress ? NULL : va_arg( ap, char * ); + char *sptr_beg = sptr; + unsigned size = UINT_MAX; + /* skip initial whitespace */ + while (nch != '\0' && isspace( nch )) + nch = (consumed++, *str++); + /* read until whitespace */ + while (width != 0 && nch != '\0' && !isspace( nch )) + { + if (!suppress) + { + *sptr++ = nch; + if(size > 1) size--; + else + { + *sptr_beg = 0; + return rd; + } + } + st++; + nch = (consumed++, *str++); + if (width > 0) width--; + } + /* terminate */ + if (st && !suppress) *sptr = 0; + } + break; + widecharstring: + { /* read a word into a WCHAR * */ + WCHAR *sptr = suppress ? NULL : va_arg( ap, WCHAR * ); + WCHAR *sptr_beg = sptr; + unsigned size = UINT_MAX; + /* skip initial whitespace */ + while (nch != '\0' && isspace( nch )) + nch = (consumed++, *str++); + /* read until whitespace */ + while (width != 0 && nch != '\0' && !isspace( nch )) + { + if (!suppress) + { + *sptr++ = nch; + if (size > 1) size--; + else + { + *sptr_beg = 0; + return rd; + } + } + st++; + nch = (consumed++, *str++); + if (width > 0) width--; + } + /* terminate */ + if (st && !suppress) *sptr = 0; + } + break; + /* 'c' and 'C work analogously to 's' and 'S' as described + * above */ + case 'c': + if (w_prefix || l_prefix) goto widecharacter; + else if (h_prefix) goto character; + else goto character; + case 'C': + if (w_prefix || l_prefix) goto widecharacter; + else if (h_prefix) goto character; + else goto widecharacter; + character: + { /* read single character into char */ + char *str = suppress ? NULL : va_arg( ap, char * ); + char *pstr = str; + unsigned size = UINT_MAX; + if (width == -1) width = 1; + while (width && nch != '\0') + { + if (!suppress) + { + *str++ = nch; + if(size) size--; + else + { + *pstr = 0; + return rd; + } + } + st++; + width--; + nch = (consumed++, *str++); + } + } + break; + widecharacter: + { /* read single character into a WCHAR */ + WCHAR *str = suppress ? NULL : va_arg( ap, WCHAR * ); + WCHAR *pstr = str; + unsigned size = UINT_MAX; + if (width == -1) width = 1; + while (width && nch != '\0') + { + if (!suppress) + { + *str++ = nch; + if (size) size--; + else + { + *pstr = 0; + return rd; + } + } + st++; + width--; + nch = (consumed++, *str++); + } + } + break; + case 'n': + { + if (!suppress) + { + int *n = va_arg( ap, int * ); + *n = consumed - 1; + } + /* This is an odd one: according to the standard, + * "Execution of a %n directive does not increment the + * assignment count returned at the completion of + * execution" even if it wasn't suppressed with the + * '*' flag. The Corrigendum to the standard seems + * to contradict this (comment out the assignment to + * suppress below if you want to implement these + * alternate semantics) but the windows program I'm + * looking at expects the behavior I've coded here + * (which happens to be what glibc does as well). + */ + suppress = TRUE; + st = 1; + } + break; + case '[': + { + char *str = suppress ? NULL : va_arg( ap, char * ); + char *sptr = str; + RTL_BITMAP bitMask; + ULONG Mask[8]; + BOOLEAN invert = FALSE; /* Set if we are NOT to find the chars */ + unsigned size = UINT_MAX; + + RtlInitializeBitMap( &bitMask, Mask, sizeof(Mask) * 8 ); + + /* Read the format */ + format++; + if (*format == '^') + { + invert = TRUE; + format++; + } + if (*format == ']') + { + RtlSetBits( &bitMask, ']', 1 ); + format++; + } + while (*format && (*format != ']')) + { + /* According to msdn: + * "Note that %[a-z] and %[z-a] are interpreted as equivalent to %[abcde...z]." */ + if ((*format == '-') && (*(format + 1) != ']')) + { + if ((*(format - 1)) < *(format + 1)) + RtlSetBits( &bitMask, *(format - 1) +1 , *(format + 1) - *(format - 1) ); + else + RtlSetBits( &bitMask, *(format + 1) , *(format - 1) - *(format + 1) ); + format++; + } + else + RtlSetBits( &bitMask, *format, 1 ); + format++; + } + /* read until char is not suitable */ + while (width != 0 && nch != '\0') + { + if (!invert) + { + if(RtlAreBitsSet( &bitMask, nch, 1 )) + { + if (!suppress) *sptr++ = nch; + } + else + break; + } + else + { + if (RtlAreBitsClear( &bitMask, nch, 1 )) + { + if (!suppress) *sptr++ = nch; + } + else + break; + } + st++; + nch = (consumed++, *str++); + if (width > 0) width--; + if(size > 1) size--; + else + { + *str = 0; + return rd; + } + } + /* terminate */ + if (!suppress) *sptr = 0; + } + break; + default: + /* From spec: "if a percent sign is followed by a character + * that has no meaning as a format-control character, that + * character and the following characters are treated as + * an ordinary sequence of characters, that is, a sequence + * of characters that must match the input. For example, + * to specify that a percent-sign character is to be input, + * use %%." */ + while (nch != '\0' && isspace( nch )) + nch = (consumed++, *str++); + if (nch == *format) + { + suppress = TRUE; /* whoops no field to be read */ + st = 1; /* but we got what we expected */ + nch = (consumed++, *str++); + } + break; + } + if (st && !suppress) rd++; + else if (!st) break; + } + /* A non-white-space character causes scanf to read, but not store, + * a matching non-white-space character. */ + else + { + if (nch == *format) + nch = (consumed++, *str++); + else break; + } + format++; + } + if (nch != '\0') + { + consumed--, str--; + } + + return rd; +} + + /********************************************************************* * sscanf (NTDLL.@) */ int __cdecl NTDLL_sscanf( const char *str, const char *format, ... ) { int ret; - va_list valist; - va_start( valist, format ); - ret = vsscanf( str, format, valist ); - va_end( valist ); + __ms_va_list valist; + __ms_va_start( valist, format ); + ret = NTDLL_vsscanf( str, format, valist ); + __ms_va_end( valist ); return ret; } diff -Nru wine1.7-1.7.50/dlls/ntdll/sync.c wine1.7-1.7.55/dlls/ntdll/sync.c --- wine1.7-1.7.50/dlls/ntdll/sync.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntdll/sync.c 2015-11-13 14:32:40.000000000 +0000 @@ -990,12 +990,9 @@ /* wait operations */ -/****************************************************************** - * NtWaitForMultipleObjects (NTDLL.@) - */ -NTSTATUS WINAPI NtWaitForMultipleObjects( DWORD count, const HANDLE *handles, - BOOLEAN wait_any, BOOLEAN alertable, - const LARGE_INTEGER *timeout ) +static NTSTATUS wait_objects( DWORD count, const HANDLE *handles, + BOOLEAN wait_any, BOOLEAN alertable, + const LARGE_INTEGER *timeout ) { select_op_t select_op; UINT i, flags = SELECT_INTERRUPTIBLE; @@ -1010,11 +1007,22 @@ /****************************************************************** + * NtWaitForMultipleObjects (NTDLL.@) + */ +NTSTATUS WINAPI NtWaitForMultipleObjects( DWORD count, const HANDLE *handles, + BOOLEAN wait_any, BOOLEAN alertable, + const LARGE_INTEGER *timeout ) +{ + return wait_objects( count, handles, wait_any, alertable, timeout ); +} + + +/****************************************************************** * NtWaitForSingleObject (NTDLL.@) */ NTSTATUS WINAPI NtWaitForSingleObject(HANDLE handle, BOOLEAN alertable, const LARGE_INTEGER *timeout ) { - return NtWaitForMultipleObjects( 1, &handle, FALSE, alertable, timeout ); + return wait_objects( 1, &handle, FALSE, alertable, timeout ); } diff -Nru wine1.7-1.7.50/dlls/ntdll/tests/env.c wine1.7-1.7.55/dlls/ntdll/tests/env.c --- wine1.7-1.7.50/dlls/ntdll/tests/env.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntdll/tests/env.c 2015-11-13 14:32:40.000000000 +0000 @@ -111,7 +111,7 @@ pRtlMultiByteToUnicodeN( bn, sizeof(bn), NULL, test->val, strlen(test->val)+1 ); ok( value.Length == strlen(test->val) * sizeof(WCHAR), "Wrong length %d for %s\n", value.Length, test->var ); - ok((value.Length == strlen(test->val) * sizeof(WCHAR) && memcmp(bv, bn, test->len*sizeof(WCHAR)) == 0) || + ok((value.Length == strlen(test->val) * sizeof(WCHAR) && memcmp(bv, bn, value.Length) == 0) || lstrcmpW(bv, bn) == 0, "Wrong result for %s/%d\n", test->var, test->len); ok(bv[test->len] == '@', "Writing too far away in the buffer for %s/%d\n", test->var, test->len); diff -Nru wine1.7-1.7.50/dlls/ntdll/tests/file.c wine1.7-1.7.55/dlls/ntdll/tests/file.c --- wine1.7-1.7.50/dlls/ntdll/tests/file.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntdll/tests/file.c 2015-11-13 14:32:40.000000000 +0000 @@ -78,6 +78,7 @@ static NTSTATUS (WINAPI *pNtQueryDirectoryFile)(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK, PVOID,ULONG,FILE_INFORMATION_CLASS,BOOLEAN,PUNICODE_STRING,BOOLEAN); static NTSTATUS (WINAPI *pNtQueryVolumeInformationFile)(HANDLE,PIO_STATUS_BLOCK,PVOID,ULONG,FS_INFORMATION_CLASS); +static NTSTATUS (WINAPI *pNtQueryFullAttributesFile)(const OBJECT_ATTRIBUTES*, FILE_NETWORK_OPEN_INFORMATION*); static inline BOOL is_signaled( HANDLE obj ) { @@ -173,12 +174,20 @@ '\\','f','a','i','l','i','n','g',0}; static const WCHAR questionmarkInvalidNameW[] = {'a','f','i','l','e','?',0}; static const WCHAR pipeInvalidNameW[] = {'a','|','b',0}; + static const WCHAR pathInvalidNtW[] = {'\\','\\','?','\\',0}; + static const WCHAR pathInvalidNt2W[] = {'\\','?','?','\\',0}; + static const WCHAR pathInvalidDosW[] = {'\\','D','o','s','D','e','v','i','c','e','s','\\',0}; + static const char testdata[] = "Hello World"; + FILE_NETWORK_OPEN_INFORMATION info; NTSTATUS status; HANDLE dir, file; WCHAR path[MAX_PATH]; OBJECT_ATTRIBUTES attr; IO_STATUS_BLOCK io; UNICODE_STRING nameW; + LARGE_INTEGER offset; + char buf[32]; + DWORD ret; GetCurrentDirectoryW( MAX_PATH, path ); pRtlDosPathNameToNtPathName_U( path, &nameW, NULL, NULL ); @@ -190,9 +199,36 @@ attr.SecurityQualityOfService = NULL; /* try various open modes and options on directories */ - status = pNtCreateFile( &dir, GENERIC_READ, &attr, &io, NULL, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, - FILE_OPEN, FILE_DIRECTORY_FILE, NULL, 0 ); + status = pNtCreateFile( &dir, GENERIC_READ|GENERIC_WRITE, &attr, &io, NULL, 0, + FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, FILE_DIRECTORY_FILE, NULL, 0 ); ok( !status, "open %s failed %x\n", wine_dbgstr_w(nameW.Buffer), status ); + + U(io).Status = 0xdeadbeef; + offset.QuadPart = 0; + status = pNtReadFile( dir, NULL, NULL, NULL, &io, buf, sizeof(buf), &offset, NULL ); + todo_wine + ok( status == STATUS_INVALID_DEVICE_REQUEST || status == STATUS_PENDING, "NtReadFile error %08x\n", status ); + if (status == STATUS_PENDING) + { + ret = WaitForSingleObject( dir, 1000 ); + ok( ret == WAIT_OBJECT_0, "WaitForSingleObject error %u\n", ret ); + ok( U(io).Status == STATUS_INVALID_DEVICE_REQUEST, + "expected STATUS_INVALID_DEVICE_REQUEST, got %08x\n", U(io).Status ); + } + + U(io).Status = 0xdeadbeef; + offset.QuadPart = 0; + status = pNtWriteFile( dir, NULL, NULL, NULL, &io, testdata, sizeof(testdata), &offset, NULL); + todo_wine + ok( status == STATUS_INVALID_DEVICE_REQUEST || status == STATUS_PENDING, "NtWriteFile error %08x\n", status ); + if (status == STATUS_PENDING) + { + ret = WaitForSingleObject( dir, 1000 ); + ok( ret == WAIT_OBJECT_0, "WaitForSingleObject error %u\n", ret ); + ok( U(io).Status == STATUS_INVALID_DEVICE_REQUEST, + "expected STATUS_INVALID_DEVICE_REQUEST, got %08x\n", U(io).Status ); + } + CloseHandle( dir ); status = pNtCreateFile( &dir, GENERIC_READ, &attr, &io, NULL, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, @@ -293,6 +329,39 @@ ok(status == STATUS_OBJECT_NAME_INVALID, "open %s failed %x\n", wine_dbgstr_w(nameW.Buffer), status); pRtlFreeUnicodeString(&nameW); + + pRtlInitUnicodeString( &nameW, pathInvalidNtW ); + status = pNtCreateFile( &dir, GENERIC_READ|SYNCHRONIZE, &attr, &io, NULL, 0, + FILE_SHARE_READ, FILE_CREATE, + FILE_DIRECTORY_FILE|FILE_SYNCHRONOUS_IO_NONALERT, NULL, 0 ); + ok( status == STATUS_OBJECT_NAME_INVALID, + "open %s failed %x\n", wine_dbgstr_w(nameW.Buffer), status ); + + status = pNtQueryFullAttributesFile( &attr, &info ); + todo_wine ok( status == STATUS_OBJECT_NAME_INVALID, + "query %s failed %x\n", wine_dbgstr_w(nameW.Buffer), status ); + + pRtlInitUnicodeString( &nameW, pathInvalidNt2W ); + status = pNtCreateFile( &dir, GENERIC_READ|SYNCHRONIZE, &attr, &io, NULL, 0, + FILE_SHARE_READ, FILE_CREATE, + FILE_DIRECTORY_FILE|FILE_SYNCHRONOUS_IO_NONALERT, NULL, 0 ); + ok( status == STATUS_OBJECT_NAME_INVALID, + "open %s failed %x\n", wine_dbgstr_w(nameW.Buffer), status ); + + status = pNtQueryFullAttributesFile( &attr, &info ); + ok( status == STATUS_OBJECT_NAME_INVALID, + "query %s failed %x\n", wine_dbgstr_w(nameW.Buffer), status ); + + pRtlInitUnicodeString( &nameW, pathInvalidDosW ); + status = pNtCreateFile( &dir, GENERIC_READ|SYNCHRONIZE, &attr, &io, NULL, 0, + FILE_SHARE_READ, FILE_CREATE, + FILE_DIRECTORY_FILE|FILE_SYNCHRONOUS_IO_NONALERT, NULL, 0 ); + ok( status == STATUS_OBJECT_NAME_INVALID, + "open %s failed %x\n", wine_dbgstr_w(nameW.Buffer), status ); + + status = pNtQueryFullAttributesFile( &attr, &info ); + ok( status == STATUS_OBJECT_NAME_INVALID, + "query %s failed %x\n", wine_dbgstr_w(nameW.Buffer), status ); } static void open_file_test(void) @@ -4158,6 +4227,7 @@ pNtQueryInformationFile = (void *)GetProcAddress(hntdll, "NtQueryInformationFile"); pNtQueryDirectoryFile = (void *)GetProcAddress(hntdll, "NtQueryDirectoryFile"); pNtQueryVolumeInformationFile = (void *)GetProcAddress(hntdll, "NtQueryVolumeInformationFile"); + pNtQueryFullAttributesFile = (void *)GetProcAddress(hntdll, "NtQueryFullAttributesFile"); test_read_write(); test_NtCreateFile(); diff -Nru wine1.7-1.7.50/dlls/ntdll/tests/reg.c wine1.7-1.7.55/dlls/ntdll/tests/reg.c --- wine1.7-1.7.50/dlls/ntdll/tests/reg.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntdll/tests/reg.c 2015-11-13 14:32:40.000000000 +0000 @@ -123,6 +123,7 @@ static NTSTATUS (WINAPI * pRtlCheckRegistryKey)(IN ULONG,IN PWSTR); static NTSTATUS (WINAPI * pRtlOpenCurrentUser)(IN ACCESS_MASK, PHANDLE); static NTSTATUS (WINAPI * pNtOpenKey)(PHANDLE, IN ACCESS_MASK, IN POBJECT_ATTRIBUTES); +static NTSTATUS (WINAPI * pNtOpenKeyEx)(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, ULONG); static NTSTATUS (WINAPI * pNtClose)(IN HANDLE); static NTSTATUS (WINAPI * pNtFlushKey)(HANDLE); static NTSTATUS (WINAPI * pNtDeleteKey)(HANDLE); @@ -145,6 +146,10 @@ static LPVOID (WINAPI * pRtlAllocateHeap)(PVOID,ULONG,ULONG); static NTSTATUS (WINAPI * pRtlZeroMemory)(PVOID, ULONG); static NTSTATUS (WINAPI * pRtlpNtQueryValueKey)(HANDLE,ULONG*,PBYTE,DWORD*,void *); +static NTSTATUS (WINAPI * pNtNotifyChangeKey)(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN); +static NTSTATUS (WINAPI * pNtNotifyChangeMultipleKeys)(HANDLE,ULONG,OBJECT_ATTRIBUTES*,HANDLE,PIO_APC_ROUTINE, + void*,IO_STATUS_BLOCK*,ULONG,BOOLEAN,void*,ULONG,BOOLEAN); +static NTSTATUS (WINAPI * pNtWaitForSingleObject)(HANDLE,BOOLEAN,const LARGE_INTEGER*); static HMODULE hntdll = 0; static int CurrentTest = 0; @@ -182,6 +187,7 @@ NTDLL_GET_PROC(NtQueryInformationProcess) NTDLL_GET_PROC(NtSetValueKey) NTDLL_GET_PROC(NtOpenKey) + NTDLL_GET_PROC(NtNotifyChangeKey) NTDLL_GET_PROC(RtlFormatCurrentUserKeyPath) NTDLL_GET_PROC(RtlCompareUnicodeString) NTDLL_GET_PROC(RtlReAllocateHeap) @@ -192,9 +198,12 @@ NTDLL_GET_PROC(RtlZeroMemory) NTDLL_GET_PROC(RtlpNtQueryValueKey) NTDLL_GET_PROC(RtlOpenCurrentUser) + NTDLL_GET_PROC(NtWaitForSingleObject) /* optional functions */ pNtQueryLicenseValue = (void *)GetProcAddress(hntdll, "NtQueryLicenseValue"); + pNtOpenKeyEx = (void *)GetProcAddress(hntdll, "NtOpenKeyEx"); + pNtNotifyChangeMultipleKeys = (void *)GetProcAddress(hntdll, "NtNotifyChangeMultipleKeys"); return TRUE; } @@ -351,6 +360,18 @@ attr.Length *= 2; status = pNtOpenKey(&key, am, &attr); ok(status == STATUS_INVALID_PARAMETER, "Expected STATUS_INVALID_PARAMETER, got: 0x%08x\n", status); + + if (!pNtOpenKeyEx) + { + win_skip("NtOpenKeyEx not available\n"); + return; + } + + InitializeObjectAttributes(&attr, &winetestpath, 0, 0, 0); + status = pNtOpenKeyEx(&key, KEY_WRITE|KEY_READ, &attr, 0); + ok(status == STATUS_SUCCESS, "NtOpenKeyEx Failed: 0x%08x\n", status); + + pNtClose(key); } static void test_NtCreateKey(void) @@ -509,14 +530,14 @@ OBJECT_ATTRIBUTES attr; UNICODE_STRING ValName; KEY_VALUE_BASIC_INFORMATION *basic_info; - KEY_VALUE_PARTIAL_INFORMATION *partial_info; + KEY_VALUE_PARTIAL_INFORMATION *partial_info, pi; KEY_VALUE_FULL_INFORMATION *full_info; DWORD len, expected; pRtlCreateUnicodeStringFromAsciiz(&ValName, "deletetest"); InitializeObjectAttributes(&attr, &winetestpath, 0, 0, 0); - status = pNtOpenKey(&key, KEY_READ, &attr); + status = pNtOpenKey(&key, KEY_READ|KEY_SET_VALUE, &attr); ok(status == STATUS_SUCCESS, "NtOpenKey Failed: 0x%08x\n", status); len = FIELD_OFFSET(KEY_VALUE_BASIC_INFORMATION, Name[0]); @@ -611,8 +632,18 @@ ok(len == expected, "NtQueryValueKey wrong len %u\n", len); HeapFree(GetProcessHeap(), 0, partial_info); + pRtlFreeUnicodeString(&ValName); + + pRtlCreateUnicodeStringFromAsciiz(&ValName, "custtest"); + status = pNtSetValueKey(key, &ValName, 0, 0xff00ff00, NULL, 0); + ok(status == STATUS_SUCCESS, "NtSetValueKey Failed: 0x%08x\n", status); + status = pNtQueryValueKey(key, &ValName, KeyValuePartialInformation, &pi, sizeof(pi), &len); + ok(status == STATUS_SUCCESS, "NtQueryValueKey should have returned STATUS_BUFFER_TOO_SMALL instead of 0x%08x\n", status); + ok(pi.Type == 0xff00ff00, "Type=%x\n", pi.Type); + ok(pi.DataLength == 0, "DataLength=%u\n", pi.DataLength); pRtlFreeUnicodeString(&ValName); + pNtClose(key); } @@ -1445,12 +1476,14 @@ static void test_NtQueryKey(void) { - HANDLE key; + HANDLE key, subkey, subkey2; NTSTATUS status; OBJECT_ATTRIBUTES attr; ULONG length, len; KEY_NAME_INFORMATION *info = NULL; + KEY_CACHED_INFORMATION cached_info; UNICODE_STRING str; + DWORD dw; InitializeObjectAttributes(&attr, &winetestpath, 0, 0, 0); status = pNtOpenKey(&key, KEY_READ, &attr); @@ -1485,7 +1518,164 @@ wine_dbgstr_wn(winetestpath.Buffer, winetestpath.Length/sizeof(WCHAR))); HeapFree(GetProcessHeap(), 0, info); + + attr.RootDirectory = key; + attr.ObjectName = &str; + pRtlCreateUnicodeStringFromAsciiz(&str, "test_subkey"); + status = pNtCreateKey(&subkey, GENERIC_ALL, &attr, 0, 0, 0, 0); + ok(status == STATUS_SUCCESS, "NtCreateKey failed: 0x%08x\n", status); + + status = pNtQueryKey(subkey, KeyCachedInformation, &cached_info, sizeof(cached_info), &len); + ok(status == STATUS_SUCCESS, "NtQueryKey Failed: 0x%08x\n", status); + + if (status == STATUS_SUCCESS) + { + ok(len == sizeof(cached_info), "got unexpected length %d\n", len); + ok(cached_info.SubKeys == 0, "cached_info.SubKeys = %u\n", cached_info.SubKeys); + ok(cached_info.MaxNameLen == 0, "cached_info.MaxNameLen = %u\n", cached_info.MaxNameLen); + ok(cached_info.Values == 0, "cached_info.Values = %u\n", cached_info.Values); + ok(cached_info.MaxValueNameLen == 0, "cached_info.MaxValueNameLen = %u\n", cached_info.MaxValueNameLen); + ok(cached_info.MaxValueDataLen == 0, "cached_info.MaxValueDataLen = %u\n", cached_info.MaxValueDataLen); + ok(cached_info.NameLength == 22, "cached_info.NameLength = %u\n", cached_info.NameLength); + } + + attr.RootDirectory = subkey; + attr.ObjectName = &str; + pRtlCreateUnicodeStringFromAsciiz(&str, "test_subkey2"); + status = pNtCreateKey(&subkey2, GENERIC_ALL, &attr, 0, 0, 0, 0); + ok(status == STATUS_SUCCESS, "NtCreateKey failed: 0x%08x\n", status); + + pRtlCreateUnicodeStringFromAsciiz(&str, "val"); + dw = 64; + status = pNtSetValueKey( subkey, &str, 0, REG_DWORD, &dw, sizeof(dw) ); + ok( status == STATUS_SUCCESS, "NtSetValueKey failed: 0x%08x\n", status ); + + status = pNtQueryKey(subkey, KeyCachedInformation, &cached_info, sizeof(cached_info), &len); + ok(status == STATUS_SUCCESS, "NtQueryKey Failed: 0x%08x\n", status); + + if (status == STATUS_SUCCESS) + { + ok(len == sizeof(cached_info), "got unexpected length %d\n", len); + ok(cached_info.SubKeys == 1, "cached_info.SubKeys = %u\n", cached_info.SubKeys); + ok(cached_info.MaxNameLen == 24, "cached_info.MaxNameLen = %u\n", cached_info.MaxNameLen); + ok(cached_info.Values == 1, "cached_info.Values = %u\n", cached_info.Values); + ok(cached_info.MaxValueNameLen == 6, "cached_info.MaxValueNameLen = %u\n", cached_info.MaxValueNameLen); + ok(cached_info.MaxValueDataLen == 4, "cached_info.MaxValueDataLen = %u\n", cached_info.MaxValueDataLen); + ok(cached_info.NameLength == 22, "cached_info.NameLength = %u\n", cached_info.NameLength); + } + + status = pNtDeleteKey(subkey2); + ok(status == STATUS_SUCCESS, "NtDeleteSubkey failed: %x\n", status); + status = pNtDeleteKey(subkey); + ok(status == STATUS_SUCCESS, "NtDeleteSubkey failed: %x\n", status); + + pNtClose(subkey2); + pNtClose(subkey); + pNtClose(key); +} + +static void test_notify(void) +{ + OBJECT_ATTRIBUTES attr; + LARGE_INTEGER timeout; + IO_STATUS_BLOCK iosb; + UNICODE_STRING str; + HANDLE key, events[2], subkey; + NTSTATUS status; + + InitializeObjectAttributes(&attr, &winetestpath, 0, 0, 0); + status = pNtOpenKey(&key, KEY_ALL_ACCESS, &attr); + ok(status == STATUS_SUCCESS, "NtOpenKey Failed: 0x%08x\n", status); + + events[0] = CreateEventW(NULL, FALSE, TRUE, NULL); + ok(events[0] != NULL, "CreateEvent failed: %u\n", GetLastError()); + events[1] = CreateEventW(NULL, FALSE, TRUE, NULL); + ok(events[1] != NULL, "CreateEvent failed: %u\n", GetLastError()); + + status = pNtNotifyChangeKey(key, events[0], NULL, NULL, &iosb, REG_NOTIFY_CHANGE_NAME, FALSE, NULL, 0, TRUE); + ok(status == STATUS_PENDING, "NtNotifyChangeKey returned %x\n", status); + status = pNtNotifyChangeKey(key, events[1], NULL, NULL, &iosb, REG_NOTIFY_CHANGE_NAME, FALSE, NULL, 0, TRUE); + ok(status == STATUS_PENDING, "NtNotifyChangeKey returned %x\n", status); + + timeout.QuadPart = 0; + status = pNtWaitForSingleObject(events[0], FALSE, &timeout); + ok(status == STATUS_TIMEOUT, "NtWaitForSingleObject returned %x\n", status); + status = pNtWaitForSingleObject(events[1], FALSE, &timeout); + ok(status == STATUS_TIMEOUT, "NtWaitForSingleObject returned %x\n", status); + + attr.RootDirectory = key; + attr.ObjectName = &str; + + pRtlCreateUnicodeStringFromAsciiz(&str, "test_subkey"); + status = pNtCreateKey(&subkey, GENERIC_ALL, &attr, 0, 0, 0, 0); + ok(status == STATUS_SUCCESS, "NtCreateKey failed: 0x%08x\n", status); + + status = pNtWaitForSingleObject(events[0], FALSE, &timeout); + todo_wine ok(status == STATUS_SUCCESS, "NtWaitForSingleObject returned %x\n", status); + status = pNtWaitForSingleObject(events[1], FALSE, &timeout); + ok(status == STATUS_SUCCESS, "NtWaitForSingleObject returned %x\n", status); + + status = pNtNotifyChangeKey(key, events[0], NULL, NULL, &iosb, 0, FALSE, NULL, 0, TRUE); + ok(status == STATUS_PENDING, "NtNotifyChangeKey returned %x\n", status); + status = pNtNotifyChangeKey(key, events[1], NULL, NULL, &iosb, 0, FALSE, NULL, 0, TRUE); + ok(status == STATUS_PENDING, "NtNotifyChangeKey returned %x\n", status); + + status = pNtDeleteKey(subkey); + ok(status == STATUS_SUCCESS, "NtDeleteSubkey failed: %x\n", status); + + status = pNtWaitForSingleObject(events[0], FALSE, &timeout); + todo_wine ok(status == STATUS_SUCCESS, "NtWaitForSingleObject returned %x\n", status); + status = pNtWaitForSingleObject(events[1], FALSE, &timeout); + ok(status == STATUS_SUCCESS, "NtWaitForSingleObject returned %x\n", status); + + pNtClose(subkey); + + status = pNtNotifyChangeKey(key, events[0], NULL, NULL, &iosb, 0, FALSE, NULL, 0, TRUE); + ok(status == STATUS_PENDING, "NtNotifyChangeKey returned %x\n", status); + status = pNtNotifyChangeKey(key, events[1], NULL, NULL, &iosb, 0, FALSE, NULL, 0, TRUE); + ok(status == STATUS_PENDING, "NtNotifyChangeKey returned %x\n", status); + pNtClose(key); + + status = pNtWaitForSingleObject(events[0], FALSE, &timeout); + todo_wine ok(status == STATUS_SUCCESS, "NtWaitForSingleObject returned %x\n", status); + status = pNtWaitForSingleObject(events[1], FALSE, &timeout); + ok(status == STATUS_SUCCESS, "NtWaitForSingleObject returned %x\n", status); + + if (pNtNotifyChangeMultipleKeys) + { + InitializeObjectAttributes(&attr, &winetestpath, 0, 0, 0); + status = pNtOpenKey(&key, KEY_ALL_ACCESS, &attr); + ok(status == STATUS_SUCCESS, "NtOpenKey Failed: 0x%08x\n", status); + + status = pNtNotifyChangeMultipleKeys(key, 0, NULL, events[0], NULL, NULL, &iosb, REG_NOTIFY_CHANGE_NAME, FALSE, NULL, 0, TRUE); + ok(status == STATUS_PENDING, "NtNotifyChangeKey returned %x\n", status); + + timeout.QuadPart = 0; + status = pNtWaitForSingleObject(events[0], FALSE, &timeout); + ok(status == STATUS_TIMEOUT, "NtWaitForSingleObject returned %x\n", status); + + attr.RootDirectory = key; + attr.ObjectName = &str; + pRtlCreateUnicodeStringFromAsciiz(&str, "test_subkey"); + status = pNtCreateKey(&subkey, GENERIC_ALL, &attr, 0, 0, 0, 0); + ok(status == STATUS_SUCCESS, "NtCreateKey failed: 0x%08x\n", status); + + status = pNtWaitForSingleObject(events[0], FALSE, &timeout); + ok(status == STATUS_SUCCESS, "NtWaitForSingleObject returned %x\n", status); + + status = pNtDeleteKey(subkey); + ok(status == STATUS_SUCCESS, "NtDeleteSubkey failed: %x\n", status); + pNtClose(subkey); + pNtClose(key); + } + else + { + win_skip("NtNotifyChangeMultipleKeys not available\n"); + } + + pNtClose(events[0]); + pNtClose(events[1]); } START_TEST(reg) @@ -1512,6 +1702,7 @@ test_NtQueryLicenseKey(); test_NtQueryValueKey(); test_long_value_name(); + test_notify(); test_NtDeleteKey(); test_symlinks(); test_redirection(); diff -Nru wine1.7-1.7.50/dlls/ntdll/tests/rtl.c wine1.7-1.7.55/dlls/ntdll/tests/rtl.c --- wine1.7-1.7.50/dlls/ntdll/tests/rtl.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntdll/tests/rtl.c 2015-11-13 14:32:40.000000000 +0000 @@ -96,6 +96,8 @@ static NTSTATUS (WINAPI *pRtlDecompressBuffer)(USHORT, PUCHAR, ULONG, const UCHAR*, ULONG, PULONG); static NTSTATUS (WINAPI *pRtlDecompressFragment)(USHORT, PUCHAR, ULONG, const UCHAR*, ULONG, ULONG, PULONG, PVOID); static NTSTATUS (WINAPI *pRtlCompressBuffer)(USHORT, const UCHAR*, ULONG, PUCHAR, ULONG, ULONG, PULONG, PVOID); +static BOOL (WINAPI *pRtlIsCriticalSectionLocked)(RTL_CRITICAL_SECTION *); +static BOOL (WINAPI *pRtlIsCriticalSectionLockedByThread)(RTL_CRITICAL_SECTION *); static HMODULE hkernel32 = 0; static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL); @@ -147,6 +149,8 @@ pRtlDecompressBuffer = (void *)GetProcAddress(hntdll, "RtlDecompressBuffer"); pRtlDecompressFragment = (void *)GetProcAddress(hntdll, "RtlDecompressFragment"); pRtlCompressBuffer = (void *)GetProcAddress(hntdll, "RtlCompressBuffer"); + pRtlIsCriticalSectionLocked = (void *)GetProcAddress(hntdll, "RtlIsCriticalSectionLocked"); + pRtlIsCriticalSectionLockedByThread = (void *)GetProcAddress(hntdll, "RtlIsCriticalSectionLockedByThread"); } hkernel32 = LoadLibraryA("kernel32.dll"); ok(hkernel32 != 0, "LoadLibrary failed\n"); @@ -657,46 +661,11 @@ } -static ULONG my_RtlRandom(PULONG seed) -{ - static ULONG saved_value[128] = - { /* 0 */ 0x4c8bc0aa, 0x4c022957, 0x2232827a, 0x2f1e7626, 0x7f8bdafb, 0x5c37d02a, 0x0ab48f72, 0x2f0c4ffa, - /* 8 */ 0x290e1954, 0x6b635f23, 0x5d3885c0, 0x74b49ff8, 0x5155fa54, 0x6214ad3f, 0x111e9c29, 0x242a3a09, - /* 16 */ 0x75932ae1, 0x40ac432e, 0x54f7ba7a, 0x585ccbd5, 0x6df5c727, 0x0374dad1, 0x7112b3f1, 0x735fc311, - /* 24 */ 0x404331a9, 0x74d97781, 0x64495118, 0x323e04be, 0x5974b425, 0x4862e393, 0x62389c1d, 0x28a68b82, - /* 32 */ 0x0f95da37, 0x7a50bbc6, 0x09b0091c, 0x22cdb7b4, 0x4faaed26, 0x66417ccd, 0x189e4bfa, 0x1ce4e8dd, - /* 40 */ 0x5274c742, 0x3bdcf4dc, 0x2d94e907, 0x32eac016, 0x26d33ca3, 0x60415a8a, 0x31f57880, 0x68c8aa52, - /* 48 */ 0x23eb16da, 0x6204f4a1, 0x373927c1, 0x0d24eb7c, 0x06dd7379, 0x2b3be507, 0x0f9c55b1, 0x2c7925eb, - /* 56 */ 0x36d67c9a, 0x42f831d9, 0x5e3961cb, 0x65d637a8, 0x24bb3820, 0x4d08e33d, 0x2188754f, 0x147e409e, - /* 64 */ 0x6a9620a0, 0x62e26657, 0x7bd8ce81, 0x11da0abb, 0x5f9e7b50, 0x23e444b6, 0x25920c78, 0x5fc894f0, - /* 72 */ 0x5e338cbb, 0x404237fd, 0x1d60f80f, 0x320a1743, 0x76013d2b, 0x070294ee, 0x695e243b, 0x56b177fd, - /* 80 */ 0x752492e1, 0x6decd52f, 0x125f5219, 0x139d2e78, 0x1898d11e, 0x2f7ee785, 0x4db405d8, 0x1a028a35, - /* 88 */ 0x63f6f323, 0x1f6d0078, 0x307cfd67, 0x3f32a78a, 0x6980796c, 0x462b3d83, 0x34b639f2, 0x53fce379, - /* 96 */ 0x74ba50f4, 0x1abc2c4b, 0x5eeaeb8d, 0x335a7a0d, 0x3973dd20, 0x0462d66b, 0x159813ff, 0x1e4643fd, - /* 104 */ 0x06bc5c62, 0x3115e3fc, 0x09101613, 0x47af2515, 0x4f11ec54, 0x78b99911, 0x3db8dd44, 0x1ec10b9b, - /* 112 */ 0x5b5506ca, 0x773ce092, 0x567be81a, 0x5475b975, 0x7a2cde1a, 0x494536f5, 0x34737bb4, 0x76d9750b, - /* 120 */ 0x2a1f6232, 0x2e49644d, 0x7dddcbe7, 0x500cebdb, 0x619dab9e, 0x48c626fe, 0x1cda3193, 0x52dabe9d }; - ULONG rand; - int pos; - ULONG result; - - rand = (*seed * 0x7fffffed + 0x7fffffc3) % 0x7fffffff; - *seed = (rand * 0x7fffffed + 0x7fffffc3) % 0x7fffffff; - pos = *seed & 0x7f; - result = saved_value[pos]; - saved_value[pos] = rand; - return(result); -} - - static void test_RtlRandom(void) { - ULONGLONG num; + int i, j; ULONG seed; - ULONG seed_bak; - ULONG seed_expected; - ULONG result; - ULONG result_expected; + ULONG res[512]; if (!pRtlRandom) { @@ -704,185 +673,14 @@ return; } -/* - * Unlike RtlUniform, RtlRandom is not documented. We guess that for - * RtlRandom D.H. Lehmer's 1948 algorithm is used like stated in - * the documentation of the RtlUniform function. This algorithm is: - * - * seed = (seed * const_1 + const_2) % const_3; - * - * According to the RtlUniform documentation the random number is - * distributed over [0..MAXLONG], but in reality it is distributed - * over [0..MAXLONG-1]. Therefore const_3 might be MAXLONG + 1 or - * MAXLONG: - * - * seed = (seed * const_1 + const_2) % (MAXLONG + 1); - * - * or - * - * seed = (seed * const_1 + const_2) % MAXLONG; - * - * To find out const_2 we just call RtlRandom with seed set to 0: - */ seed = 0; - result_expected = 0x320a1743; - seed_expected =0x44b; - result = pRtlRandom(&seed); - -/* - * Windows Vista uses different algorithms, so skip the rest of the tests - * until that is figured out. Trace output for the failures is about 10.5 MB! - */ - - if (seed == 0x3fc) { - skip("Most likely running on Windows Vista which uses a different algorithm\n"); - return; + for (i = 0; i < sizeof(res) / sizeof(res[0]); i++) + { + res[i] = pRtlRandom(&seed); + ok(seed != res[i], "%i: seed is same as res %x\n", i, seed); + for (j = 0; j < i; j++) + ok(res[i] != res[j], "res[%i] (%x) is same as res[%i] (%x)\n", j, res[j], i, res[i]); } - - ok(result == result_expected, - "pRtlRandom(&seed (seed == 0)) returns %x, expected %x\n", - result, result_expected); - ok(seed == seed_expected, - "pRtlRandom(&seed (seed == 0)) sets seed to %x, expected %x\n", - seed, seed_expected); -/* - * Seed is not equal to result as with RtlUniform. To see more we - * call RtlRandom again with seed set to 0: - */ - seed = 0; - result_expected = 0x7fffffc3; - seed_expected =0x44b; - result = pRtlRandom(&seed); - ok(result == result_expected, - "RtlRandom(&seed (seed == 0)) returns %x, expected %x\n", - result, result_expected); - ok(seed == seed_expected, - "RtlRandom(&seed (seed == 0)) sets seed to %x, expected %x\n", - seed, seed_expected); -/* - * Seed is set to the same value as before but the result is different. - * To see more we call RtlRandom again with seed set to 0: - */ - seed = 0; - result_expected = 0x7fffffc3; - seed_expected =0x44b; - result = pRtlRandom(&seed); - ok(result == result_expected, - "RtlRandom(&seed (seed == 0)) returns %x, expected %x\n", - result, result_expected); - ok(seed == seed_expected, - "RtlRandom(&seed (seed == 0)) sets seed to %x, expected %x\n", - seed, seed_expected); -/* - * Seed is again set to the same value as before. This time we also - * have the same result as before. Interestingly the value of the - * result is 0x7fffffc3 which is the same value used in RtlUniform - * as const_2. If we do - * - * seed = 0; - * result = RtlUniform(&seed); - * - * we get the same result (0x7fffffc3) as with - * - * seed = 0; - * RtlRandom(&seed); - * seed = 0; - * result = RtlRandom(&seed); - * - * And there is another interesting thing. If we do - * - * seed = 0; - * RtlUniform(&seed); - * RtlUniform(&seed); - * - * seed is set to the value 0x44b which ist the same value that - * - * seed = 0; - * RtlRandom(&seed); - * - * assigns to seed. Putting these two findings together leads to - * the conclusion that RtlRandom saves the value in some variable, - * like in the following algorithm: - * - * result = saved_value; - * saved_value = RtlUniform(&seed); - * RtlUniform(&seed); - * return(result); - * - * Now we do further tests with seed set to 1: - */ - seed = 1; - result_expected = 0x7a50bbc6; - seed_expected =0x5a1; - result = pRtlRandom(&seed); - ok(result == result_expected, - "RtlRandom(&seed (seed == 1)) returns %x, expected %x\n", - result, result_expected); - ok(seed == seed_expected, - "RtlRandom(&seed (seed == 1)) sets seed to %x, expected %x\n", - seed, seed_expected); -/* - * If there is just one saved_value the result now would be - * 0x7fffffc3. From this test we can see that there is more than - * one saved_value, like with this algorithm: - * - * result = saved_value[pos]; - * saved_value[pos] = RtlUniform(&seed); - * RtlUniform(&seed); - * return(result); - * - * But how is the value of pos determined? The calls to RtlUniform - * create a sequence of random numbers. Every second random number - * is put into the saved_value array and is used in some later call - * of RtlRandom as result. The only reasonable source to determine - * pos are the random numbers generated by RtlUniform which are not - * put into the saved_value array. This are the values of seed - * between the two calls of RtlUniform as in this algorithm: - * - * rand = RtlUniform(&seed); - * RtlUniform(&seed); - * pos = position(seed); - * result = saved_value[pos]; - * saved_value[pos] = rand; - * return(result); - * - * What remains to be determined is: The size of the saved_value array, - * the initial values of the saved_value array and the function - * position(seed). These tests are not shown here. - * The result of these tests is: The size of the saved_value array - * is 128, the initial values can be seen in the my_RtlRandom - * function and the position(seed) function is (seed & 0x7f). - * - * For a full test of RtlRandom use one of the following loop heads: - * - * for (num = 0; num <= 0xffffffff; num++) { - * seed = num; - * ... - * - * seed = 0; - * for (num = 0; num <= 0xffffffff; num++) { - * ... - */ - seed = 0; - for (num = 0; num <= 100000; num++) { - seed_bak = seed; - seed_expected = seed; - result_expected = my_RtlRandom(&seed_expected); - /* The following corrections are necessary because the */ - /* previous tests changed the saved_value array */ - if (num == 0) { - result_expected = 0x7fffffc3; - } else if (num == 81) { - result_expected = 0x7fffffb1; - } /* if */ - result = pRtlRandom(&seed); - ok(result == result_expected, - "test: 0x%x%08x RtlUniform(&seed (seed == %x)) returns %x, expected %x\n", - (DWORD)(num >> 32), (DWORD)num, seed_bak, result, result_expected); - ok(seed == seed_expected, - "test: 0x%x%08x RtlUniform(&seed (seed == %x)) sets seed to %x, expected %x\n", - (DWORD)(num >> 32), (DWORD)num, seed_bak, result, seed_expected); - } /* for */ } @@ -2162,6 +1960,102 @@ #undef DECOMPRESS_BROKEN_FRAGMENT #undef DECOMPRESS_BROKEN_TRUNCATED +struct critsect_locked_info +{ + CRITICAL_SECTION crit; + HANDLE semaphores[2]; +}; + +static DWORD WINAPI critsect_locked_thread(void *param) +{ + struct critsect_locked_info *info = param; + DWORD ret; + + ret = pRtlIsCriticalSectionLocked(&info->crit); + ok(ret == TRUE, "expected TRUE, got %u\n", ret); + ret = pRtlIsCriticalSectionLockedByThread(&info->crit); + ok(ret == FALSE, "expected FALSE, got %u\n", ret); + + ReleaseSemaphore(info->semaphores[0], 1, NULL); + ret = WaitForSingleObject(info->semaphores[1], 1000); + ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", ret); + + ret = pRtlIsCriticalSectionLocked(&info->crit); + ok(ret == FALSE, "expected FALSE, got %u\n", ret); + ret = pRtlIsCriticalSectionLockedByThread(&info->crit); + ok(ret == FALSE, "expected FALSE, got %u\n", ret); + + EnterCriticalSection(&info->crit); + + ret = pRtlIsCriticalSectionLocked(&info->crit); + ok(ret == TRUE, "expected TRUE, got %u\n", ret); + ret = pRtlIsCriticalSectionLockedByThread(&info->crit); + ok(ret == TRUE, "expected TRUE, got %u\n", ret); + + ReleaseSemaphore(info->semaphores[0], 1, NULL); + ret = WaitForSingleObject(info->semaphores[1], 1000); + ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", ret); + + LeaveCriticalSection(&info->crit); + return 0; +} + +static void test_RtlIsCriticalSectionLocked(void) +{ + struct critsect_locked_info info; + HANDLE thread; + BOOL ret; + + if (!pRtlIsCriticalSectionLocked || !pRtlIsCriticalSectionLockedByThread) + { + win_skip("skipping RtlIsCriticalSectionLocked tests, required functions not available\n"); + return; + } + + InitializeCriticalSection(&info.crit); + info.semaphores[0] = CreateSemaphoreW(NULL, 0, 1, NULL); + ok(info.semaphores[0] != NULL, "CreateSemaphore failed with %u\n", GetLastError()); + info.semaphores[1] = CreateSemaphoreW(NULL, 0, 1, NULL); + ok(info.semaphores[1] != NULL, "CreateSemaphore failed with %u\n", GetLastError()); + + ret = pRtlIsCriticalSectionLocked(&info.crit); + ok(ret == FALSE, "expected FALSE, got %u\n", ret); + ret = pRtlIsCriticalSectionLockedByThread(&info.crit); + ok(ret == FALSE, "expected FALSE, got %u\n", ret); + + EnterCriticalSection(&info.crit); + + ret = pRtlIsCriticalSectionLocked(&info.crit); + ok(ret == TRUE, "expected TRUE, got %u\n", ret); + ret = pRtlIsCriticalSectionLockedByThread(&info.crit); + ok(ret == TRUE, "expected TRUE, got %u\n", ret); + + thread = CreateThread(NULL, 0, critsect_locked_thread, &info, 0, NULL); + ok(thread != NULL, "CreateThread failed with %u\n", GetLastError()); + ret = WaitForSingleObject(info.semaphores[0], 1000); + ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", ret); + + LeaveCriticalSection(&info.crit); + + ReleaseSemaphore(info.semaphores[1], 1, NULL); + ret = WaitForSingleObject(info.semaphores[0], 1000); + ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", ret); + + ret = pRtlIsCriticalSectionLocked(&info.crit); + ok(ret == TRUE, "expected TRUE, got %u\n", ret); + ret = pRtlIsCriticalSectionLockedByThread(&info.crit); + ok(ret == FALSE, "expected FALSE, got %u\n", ret); + + ReleaseSemaphore(info.semaphores[1], 1, NULL); + ret = WaitForSingleObject(thread, 1000); + ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", ret); + + CloseHandle(thread); + CloseHandle(info.semaphores[0]); + CloseHandle(info.semaphores[1]); + DeleteCriticalSection(&info.crit); +} + START_TEST(rtl) { InitFunctionPtrs(); @@ -2191,4 +2085,5 @@ test_RtlCompressBuffer(); test_RtlGetCompressionWorkSpaceSize(); test_RtlDecompressBuffer(); + test_RtlIsCriticalSectionLocked(); } diff -Nru wine1.7-1.7.50/dlls/ntdll/tests/threadpool.c wine1.7-1.7.55/dlls/ntdll/tests/threadpool.c --- wine1.7-1.7.50/dlls/ntdll/tests/threadpool.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntdll/tests/threadpool.c 2015-11-13 14:32:40.000000000 +0000 @@ -143,6 +143,323 @@ CloseHandle(semaphore); } +struct rtl_wait_info +{ + HANDLE semaphore1; + HANDLE semaphore2; + DWORD wait_result; + DWORD threadid; + LONG userdata; +}; + +static void CALLBACK rtl_wait_cb(void *userdata, BOOLEAN timeout) +{ + struct rtl_wait_info *info = userdata; + DWORD result; + + trace("Running rtl_wait callback\n"); + + if (!timeout) + InterlockedIncrement(&info->userdata); + else + InterlockedExchangeAdd(&info->userdata, 0x10000); + info->threadid = GetCurrentThreadId(); + ReleaseSemaphore(info->semaphore1, 1, NULL); + + if (info->semaphore2) + { + result = WaitForSingleObject(info->semaphore2, 200); + ok(result == info->wait_result, "expected %u, got %u\n", info->wait_result, result); + ReleaseSemaphore(info->semaphore1, 1, NULL); + } +} + +static HANDLE rtl_wait_apc_semaphore; + +static void CALLBACK rtl_wait_apc_cb(ULONG_PTR userdata) +{ + trace("Running rtl_wait_apc callback\n"); + if (rtl_wait_apc_semaphore) + ReleaseSemaphore(rtl_wait_apc_semaphore, 1, NULL); +} + +static void test_RtlRegisterWait(void) +{ + HANDLE wait1, event, thread; + struct rtl_wait_info info; + HANDLE semaphores[2]; + NTSTATUS status; + DWORD result; + + semaphores[0] = CreateSemaphoreW(NULL, 0, 2, NULL); + ok(semaphores[0] != NULL, "failed to create semaphore\n"); + semaphores[1] = CreateSemaphoreW(NULL, 0, 1, NULL); + ok(semaphores[1] != NULL, "failed to create semaphore\n"); + info.semaphore1 = semaphores[0]; + info.semaphore2 = NULL; + + event = CreateEventW(NULL, FALSE, FALSE, NULL); + ok(event != NULL, "failed to create event\n"); + + /* basic test for RtlRegisterWait and RtlDeregisterWait */ + wait1 = NULL; + info.userdata = 0; + status = RtlRegisterWait(&wait1, semaphores[1], rtl_wait_cb, &info, INFINITE, WT_EXECUTEDEFAULT); + ok(!status, "RtlRegisterWait failed with status %x\n", status); + ok(wait1 != NULL, "expected wait1 != NULL\n"); + status = RtlDeregisterWait(wait1); + ok(!status, "RtlDeregisterWait failed with status %x\n", status); + ok(info.userdata == 0, "expected info.userdata = 0, got %u\n", info.userdata); + + /* infinite timeout, signal the semaphore two times */ + info.userdata = 0; + status = RtlRegisterWait(&wait1, semaphores[1], rtl_wait_cb, &info, INFINITE, WT_EXECUTEDEFAULT); + ok(!status, "RtlRegisterWait failed with status %x\n", status); + ReleaseSemaphore(semaphores[1], 1, NULL); + result = WaitForSingleObject(semaphores[0], 100); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + ok(info.userdata == 1, "expected info.userdata = 1, got %u\n", info.userdata); + ReleaseSemaphore(semaphores[1], 1, NULL); + result = WaitForSingleObject(semaphores[0], 100); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + ok(info.userdata == 2, "expected info.userdata = 2, got %u\n", info.userdata); + result = WaitForSingleObject(semaphores[1], 0); + ok(result == WAIT_TIMEOUT, "WaitForSingleObject returned %u\n", result); + Sleep(50); + status = RtlDeregisterWait(wait1); + ok(!status, "RtlDeregisterWait failed with status %x\n", status); + + /* repeat test with WT_EXECUTEONLYONCE */ + info.userdata = 0; + status = RtlRegisterWait(&wait1, semaphores[1], rtl_wait_cb, &info, INFINITE, WT_EXECUTEONLYONCE); + ok(!status, "RtlRegisterWait failed with status %x\n", status); + ReleaseSemaphore(semaphores[1], 1, NULL); + result = WaitForSingleObject(semaphores[0], 100); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + ok(info.userdata == 1, "expected info.userdata = 1, got %u\n", info.userdata); + ReleaseSemaphore(semaphores[1], 1, NULL); + result = WaitForSingleObject(semaphores[0], 100); + ok(result == WAIT_TIMEOUT, "WaitForSingleObject returned %u\n", result); + ok(info.userdata == 1, "expected info.userdata = 1, got %u\n", info.userdata); + result = WaitForSingleObject(semaphores[1], 0); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + Sleep(50); + status = RtlDeregisterWait(wait1); + ok(!status, "RtlDeregisterWait failed with status %x\n", status); + + /* finite timeout, no event */ + info.userdata = 0; + status = RtlRegisterWait(&wait1, semaphores[1], rtl_wait_cb, &info, 200, WT_EXECUTEDEFAULT); + ok(!status, "RtlRegisterWait failed with status %x\n", status); + result = WaitForSingleObject(semaphores[0], 100); + ok(result == WAIT_TIMEOUT, "WaitForSingleObject returned %u\n", result); + ok(info.userdata == 0, "expected info.userdata = 0, got %u\n", info.userdata); + result = WaitForSingleObject(semaphores[0], 200); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + ok(info.userdata == 0x10000, "expected info.userdata = 0x10000, got %u\n", info.userdata); + result = WaitForSingleObject(semaphores[1], 0); + ok(result == WAIT_TIMEOUT, "WaitForSingleObject returned %u\n", result); + Sleep(50); + status = RtlDeregisterWait(wait1); + ok(!status, "RtlDeregisterWait failed with status %x\n", status); + + /* finite timeout, with event */ + info.userdata = 0; + status = RtlRegisterWait(&wait1, semaphores[1], rtl_wait_cb, &info, 200, WT_EXECUTEDEFAULT); + ok(!status, "RtlRegisterWait failed with status %x\n", status); + result = WaitForSingleObject(semaphores[0], 100); + ok(result == WAIT_TIMEOUT, "WaitForSingleObject returned %u\n", result); + ok(info.userdata == 0, "expected info.userdata = 0, got %u\n", info.userdata); + ReleaseSemaphore(semaphores[1], 1, NULL); + result = WaitForSingleObject(semaphores[0], 100); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + ok(info.userdata == 1, "expected info.userdata = 1, got %u\n", info.userdata); + result = WaitForSingleObject(semaphores[1], 0); + ok(result == WAIT_TIMEOUT, "WaitForSingleObject returned %u\n", result); + Sleep(50); + status = RtlDeregisterWait(wait1); + ok(!status, "RtlDeregisterWait failed with status %x\n", status); + + /* test for IO threads */ + info.userdata = 0; + info.threadid = 0; + status = RtlRegisterWait(&wait1, semaphores[1], rtl_wait_cb, &info, INFINITE, WT_EXECUTEINIOTHREAD); + ok(!status, "RtlRegisterWait failed with status %x\n", status); + ReleaseSemaphore(semaphores[1], 1, NULL); + result = WaitForSingleObject(semaphores[0], 100); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + ok(info.userdata == 1, "expected info.userdata = 1, got %u\n", info.userdata); + ok(info.threadid != 0, "expected info.threadid != 0, got %u\n", info.threadid); + thread = OpenThread(THREAD_SET_CONTEXT, FALSE, info.threadid); + ok(thread != NULL, "OpenThread failed with %u\n", GetLastError()); + rtl_wait_apc_semaphore = semaphores[0]; + result = QueueUserAPC(rtl_wait_apc_cb, thread, 0); + ok(result != 0, "QueueUserAPC failed with %u\n", GetLastError()); + result = WaitForSingleObject(semaphores[0], 200); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + rtl_wait_apc_semaphore = 0; + CloseHandle(thread); + ReleaseSemaphore(semaphores[1], 1, NULL); + result = WaitForSingleObject(semaphores[0], 100); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + ok(info.userdata == 2, "expected info.userdata = 2, got %u\n", info.userdata); + Sleep(50); + status = RtlDeregisterWait(wait1); + ok(!status, "RtlDeregisterWait failed with status %x\n", status); + + info.userdata = 0; + info.threadid = 0; + status = RtlRegisterWait(&wait1, semaphores[1], rtl_wait_cb, &info, INFINITE, WT_EXECUTEDEFAULT); + ok(!status, "RtlRegisterWait failed with status %x\n", status); + ReleaseSemaphore(semaphores[1], 1, NULL); + result = WaitForSingleObject(semaphores[0], 100); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + ok(info.userdata == 1, "expected info.userdata = 1, got %u\n", info.userdata); + ok(info.threadid != 0, "expected info.threadid != 0, got %u\n", info.threadid); + thread = OpenThread(THREAD_SET_CONTEXT, FALSE, info.threadid); + ok(thread != NULL, "OpenThread failed with %u\n", GetLastError()); + rtl_wait_apc_semaphore = semaphores[0]; + result = QueueUserAPC(rtl_wait_apc_cb, thread, 0); + ok(result != 0, "QueueUserAPC failed with %u\n", GetLastError()); + result = WaitForSingleObject(semaphores[0], 200); + ok(result == WAIT_TIMEOUT || broken(result == WAIT_OBJECT_0) /* >= Win Vista */, + "WaitForSingleObject returned %u\n", result); + rtl_wait_apc_semaphore = 0; + CloseHandle(thread); + ReleaseSemaphore(semaphores[1], 1, NULL); + result = WaitForSingleObject(semaphores[0], 100); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + ok(info.userdata == 2, "expected info.userdata = 2, got %u\n", info.userdata); + Sleep(50); + status = RtlDeregisterWait(wait1); + ok(!status, "RtlDeregisterWait failed with status %x\n", status); + + /* test RtlDeregisterWaitEx before wait expired */ + info.userdata = 0; + status = RtlRegisterWait(&wait1, semaphores[1], rtl_wait_cb, &info, INFINITE, WT_EXECUTEDEFAULT); + ok(!status, "RtlRegisterWait failed with status %x\n", status); + status = RtlDeregisterWaitEx(wait1, NULL); + ok(!status, "RtlDeregisterWaitEx failed with status %x\n", status); + ok(info.userdata == 0, "expected info.userdata = 0, got %u\n", info.userdata); + + info.userdata = 0; + status = RtlRegisterWait(&wait1, semaphores[1], rtl_wait_cb, &info, INFINITE, WT_EXECUTEDEFAULT); + ok(!status, "RtlRegisterWait failed with status %x\n", status); + status = RtlDeregisterWaitEx(wait1, INVALID_HANDLE_VALUE); + ok(!status, "RtlDeregisterWaitEx failed with status %x\n", status); + ok(info.userdata == 0, "expected info.userdata = 0, got %u\n", info.userdata); + + info.userdata = 0; + status = RtlRegisterWait(&wait1, semaphores[1], rtl_wait_cb, &info, INFINITE, WT_EXECUTEDEFAULT); + ok(!status, "RtlRegisterWait failed with status %x\n", status); + status = RtlDeregisterWaitEx(wait1, event); + ok(!status, "RtlDeregisterWaitEx failed with status %x\n", status); + ok(info.userdata == 0, "expected info.userdata = 0, got %u\n", info.userdata); + result = WaitForSingleObject(event, 200); + todo_wine + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + + /* test RtlDeregisterWaitEx after wait expired */ + info.userdata = 0; + status = RtlRegisterWait(&wait1, semaphores[1], rtl_wait_cb, &info, 0, WT_EXECUTEONLYONCE); + ok(!status, "RtlRegisterWait failed with status %x\n", status); + result = WaitForSingleObject(semaphores[0], 100); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + ok(info.userdata == 0x10000, "expected info.userdata = 0x10000, got %u\n", info.userdata); + Sleep(50); + status = RtlDeregisterWaitEx(wait1, NULL); + ok(!status, "RtlDeregisterWaitEx failed with status %x\n", status); + ok(info.userdata == 0x10000, "expected info.userdata = 0x10000, got %u\n", info.userdata); + + info.userdata = 0; + status = RtlRegisterWait(&wait1, semaphores[1], rtl_wait_cb, &info, 0, WT_EXECUTEONLYONCE); + ok(!status, "RtlRegisterWait failed with status %x\n", status); + result = WaitForSingleObject(semaphores[0], 100); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + ok(info.userdata == 0x10000, "expected info.userdata = 0x10000, got %u\n", info.userdata); + Sleep(50); + status = RtlDeregisterWaitEx(wait1, INVALID_HANDLE_VALUE); + ok(!status, "RtlDeregisterWaitEx failed with status %x\n", status); + ok(info.userdata == 0x10000, "expected info.userdata = 0x10000, got %u\n", info.userdata); + + info.userdata = 0; + status = RtlRegisterWait(&wait1, semaphores[1], rtl_wait_cb, &info, 0, WT_EXECUTEONLYONCE); + ok(!status, "RtlRegisterWait failed with status %x\n", status); + result = WaitForSingleObject(semaphores[0], 100); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + ok(info.userdata == 0x10000, "expected info.userdata = 0x10000, got %u\n", info.userdata); + Sleep(50); + status = RtlDeregisterWaitEx(wait1, event); + ok(!status, "RtlDeregisterWaitEx failed with status %x\n", status); + ok(info.userdata == 0x10000, "expected info.userdata = 0x10000, got %u\n", info.userdata); + result = WaitForSingleObject(event, 200); + todo_wine + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + + /* test RtlDeregisterWaitEx while callback is running */ + info.semaphore2 = semaphores[1]; + info.wait_result = WAIT_OBJECT_0; + + info.userdata = 0; + status = RtlRegisterWait(&wait1, semaphores[1], rtl_wait_cb, &info, INFINITE, WT_EXECUTEONLYONCE); + ok(!status, "RtlRegisterWait failed with status %x\n", status); + ReleaseSemaphore(semaphores[1], 1, NULL); + result = WaitForSingleObject(semaphores[0], 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + ok(info.userdata == 1, "expected info.userdata = 1, got %u\n", info.userdata); + status = RtlDeregisterWait(wait1); + ok(status == STATUS_PENDING, "expected STATUS_PENDING, got %x\n", status); + ReleaseSemaphore(semaphores[1], 1, NULL); + result = WaitForSingleObject(semaphores[0], 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + + info.userdata = 0; + status = RtlRegisterWait(&wait1, semaphores[1], rtl_wait_cb, &info, INFINITE, WT_EXECUTEONLYONCE); + ok(!status, "RtlRegisterWait failed with status %x\n", status); + ReleaseSemaphore(semaphores[1], 1, NULL); + result = WaitForSingleObject(semaphores[0], 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + ok(info.userdata == 1, "expected info.userdata = 1, got %u\n", info.userdata); + status = RtlDeregisterWaitEx(wait1, NULL); + ok(status == STATUS_PENDING, "expected STATUS_PENDING, got %x\n", status); + ReleaseSemaphore(semaphores[1], 1, NULL); + result = WaitForSingleObject(semaphores[0], 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + + info.wait_result = WAIT_TIMEOUT; + info.userdata = 0; + status = RtlRegisterWait(&wait1, semaphores[1], rtl_wait_cb, &info, INFINITE, WT_EXECUTEONLYONCE); + ok(!status, "RtlRegisterWait failed with status %x\n", status); + ReleaseSemaphore(semaphores[1], 1, NULL); + result = WaitForSingleObject(semaphores[0], 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + ok(info.userdata == 1, "expected info.userdata = 1, got %u\n", info.userdata); + status = RtlDeregisterWaitEx(wait1, INVALID_HANDLE_VALUE); + ok(!status, "RtlDeregisterWaitEx failed with status %x\n", status); + result = WaitForSingleObject(semaphores[0], 0); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + + info.wait_result = WAIT_OBJECT_0; + info.userdata = 0; + status = RtlRegisterWait(&wait1, semaphores[1], rtl_wait_cb, &info, INFINITE, WT_EXECUTEONLYONCE); + ok(!status, "RtlRegisterWait failed with status %x\n", status); + ReleaseSemaphore(semaphores[1], 1, NULL); + result = WaitForSingleObject(semaphores[0], 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + ok(info.userdata == 1, "expected info.userdata = 1, got %u\n", info.userdata); + status = RtlDeregisterWaitEx(wait1, event); + ok(status == STATUS_PENDING, "expected STATUS_PENDING, got %x\n", status); + ReleaseSemaphore(semaphores[1], 1, NULL); + result = WaitForSingleObject(event, 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + result = WaitForSingleObject(semaphores[0], 0); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + + CloseHandle(semaphores[0]); + CloseHandle(semaphores[1]); + CloseHandle(event); +} + static void CALLBACK simple_cb(TP_CALLBACK_INSTANCE *instance, void *userdata) { HANDLE semaphore = userdata; @@ -228,6 +545,7 @@ /* test cancellation of pending simple callbacks */ userdata = 0; + pTpSetPoolMaxThreads(pool, 10); memset(&environment, 0, sizeof(environment)); environment.Version = 1; environment.Pool = pool; @@ -867,6 +1185,7 @@ NTSTATUS status; TP_POOL *pool; DWORD result; + BOOL merged; semaphore = CreateSemaphoreA(NULL, 0, 2, NULL); ok(semaphore != NULL, "CreateSemaphoreA failed %u\n", GetLastError()); @@ -929,8 +1248,8 @@ result = WaitForSingleObject(semaphore, 1000); ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); ok(info1.ticks != 0 && info2.ticks != 0, "expected that ticks are nonzero\n"); - ok(info2.ticks >= info1.ticks - 50 && info2.ticks <= info1.ticks + 50, - "expected that timers are merged\n"); + merged = info2.ticks >= info1.ticks - 50 && info2.ticks <= info1.ticks + 50; + ok(merged || broken(!merged) /* Win 10 */, "expected that timers are merged\n"); /* on Windows the timers also get merged in this case */ info1.ticks = 0; @@ -948,9 +1267,9 @@ result = WaitForSingleObject(semaphore, 1000); ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); ok(info1.ticks != 0 && info2.ticks != 0, "expected that ticks are nonzero\n"); + merged = info2.ticks >= info1.ticks - 50 && info2.ticks <= info1.ticks + 50; todo_wine - ok(info2.ticks >= info1.ticks - 50 && info2.ticks <= info1.ticks + 50, - "expected that timers are merged\n"); + ok(merged || broken(!merged) /* Win 10 */, "expected that timers are merged\n"); /* cleanup */ pTpReleaseTimer(timer1); @@ -1338,6 +1657,7 @@ START_TEST(threadpool) { test_RtlQueueWorkItem(); + test_RtlRegisterWait(); if (!init_threadpool()) return; diff -Nru wine1.7-1.7.50/dlls/ntdll/thread.c wine1.7-1.7.55/dlls/ntdll/thread.c --- wine1.7-1.7.50/dlls/ntdll/thread.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntdll/thread.c 2015-11-13 14:32:40.000000000 +0000 @@ -280,6 +280,12 @@ #endif #endif + /* + * Starting with Vista, the first user to log on has session id 1. + * Session id 0 is for processes that don't interact with the user (like services). + */ + peb->SessionId = 1; + /* allocate and initialize the initial TEB */ signal_alloc_thread( &teb ); @@ -1014,7 +1020,7 @@ status = STATUS_INFO_LENGTH_MISMATCH; else if (!(tdi->Selector & 4)) /* GDT selector */ { - unsigned sel = tdi->Selector & ~3; /* ignore RPL */ + unsigned sel = LOWORD(tdi->Selector) & ~3; /* ignore RPL */ status = STATUS_SUCCESS; if (!sel) /* null selector */ memset( &tdi->Entry, 0, sizeof(tdi->Entry) ); @@ -1045,7 +1051,7 @@ SERVER_START_REQ( get_selector_entry ) { req->handle = wine_server_obj_handle( handle ); - req->entry = tdi->Selector >> 3; + req->entry = LOWORD(tdi->Selector) >> 3; status = wine_server_call( req ); if (!status) { @@ -1103,6 +1109,29 @@ SERVER_END_REQ; return status; } + case ThreadGroupInformation: + { + const ULONG_PTR affinity_mask = get_system_affinity_mask(); + GROUP_AFFINITY affinity; + + memset(&affinity, 0, sizeof(affinity)); + affinity.Group = 0; /* Wine only supports max 64 processors */ + + SERVER_START_REQ( get_thread_info ) + { + req->handle = wine_server_obj_handle( handle ); + req->tid_in = 0; + if (!(status = wine_server_call( req ))) + affinity.Mask = reply->affinity & affinity_mask; + } + SERVER_END_REQ; + if (status == STATUS_SUCCESS) + { + if (data) memcpy( data, &affinity, min( length, sizeof(affinity) )); + if (ret_len) *ret_len = min( length, sizeof(affinity) ); + } + } + return status; case ThreadPriority: case ThreadBasePriority: case ThreadImpersonationToken: @@ -1231,6 +1260,33 @@ status = wine_server_call( req ); } SERVER_END_REQ; + } + return status; + case ThreadGroupInformation: + { + const ULONG_PTR affinity_mask = get_system_affinity_mask(); + const GROUP_AFFINITY *req_aff; + + if (length != sizeof(*req_aff)) return STATUS_INVALID_PARAMETER; + if (!data) return STATUS_ACCESS_VIOLATION; + req_aff = data; + + /* On Windows the request fails if the reserved fields are set */ + if (req_aff->Reserved[0] || req_aff->Reserved[1] || req_aff->Reserved[2]) + return STATUS_INVALID_PARAMETER; + + /* Wine only supports max 64 processors */ + if (req_aff->Group) return STATUS_INVALID_PARAMETER; + if (req_aff->Mask & ~affinity_mask) return STATUS_INVALID_PARAMETER; + if (!req_aff->Mask) return STATUS_INVALID_PARAMETER; + SERVER_START_REQ( set_thread_info ) + { + req->handle = wine_server_obj_handle( handle ); + req->affinity = req_aff->Mask; + req->mask = SET_THREAD_INFO_AFFINITY; + status = wine_server_call( req ); + } + SERVER_END_REQ; } return status; case ThreadBasicInformation: diff -Nru wine1.7-1.7.50/dlls/ntdll/threadpool.c wine1.7-1.7.55/dlls/ntdll/threadpool.c --- wine1.7-1.7.50/dlls/ntdll/threadpool.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntdll/threadpool.c 2015-11-13 14:32:40.000000000 +0000 @@ -537,7 +537,7 @@ if (wait_work_item->Flags & WT_EXECUTEONLYONCE) break; } - else + else if (status != STATUS_USER_APC) break; } diff -Nru wine1.7-1.7.50/dlls/ntdsapi/ntdsapi.c wine1.7-1.7.55/dlls/ntdsapi/ntdsapi.c --- wine1.7-1.7.50/dlls/ntdsapi/ntdsapi.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntdsapi/ntdsapi.c 2015-11-13 14:32:40.000000000 +0000 @@ -225,7 +225,7 @@ p = buf + strlenW(class); *p++ = '/'; memcpy(p, name, strlenW(name) * sizeof(WCHAR)); - buf[len] = 0; + buf[len - 1] = 0; return ERROR_SUCCESS; } diff -Nru wine1.7-1.7.50/dlls/ntoskrnl.exe/ntoskrnl.c wine1.7-1.7.55/dlls/ntoskrnl.exe/ntoskrnl.c --- wine1.7-1.7.50/dlls/ntoskrnl.exe/ntoskrnl.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntoskrnl.exe/ntoskrnl.c 2015-11-13 14:32:40.000000000 +0000 @@ -1271,13 +1271,11 @@ handle = (HANDLE)irp->UserIosb; if (handle) { - HANDLE manager = get_device_manager(); void *out_buff = irp->UserBuffer; FILE_OBJECT *file = irp->Tail.Overlay.OriginalFileObject; SERVER_START_REQ( set_irp_result ) { - req->manager = wine_server_obj_handle( manager ); req->handle = wine_server_obj_handle( handle ); req->status = irp->IoStatus.u.Status; req->file_ptr = wine_server_client_ptr( file ); @@ -1433,6 +1431,24 @@ /*********************************************************************** + * ExDeleteNPagedLookasideList (NTOSKRNL.EXE.@) + */ +void WINAPI ExDeleteNPagedLookasideList( PNPAGED_LOOKASIDE_LIST lookaside ) +{ + FIXME("(%p) stub\n", lookaside); +} + + +/*********************************************************************** + * ExDeletePagedLookasideList (NTOSKRNL.EXE.@) + */ +void WINAPI ExDeletePagedLookasideList( PPAGED_LOOKASIDE_LIST lookaside ) +{ + FIXME("(%p) stub\n", lookaside); +} + + +/*********************************************************************** * ExFreePool (NTOSKRNL.EXE.@) */ void WINAPI ExFreePool( void *ptr ) @@ -2282,6 +2298,24 @@ return STATUS_SUCCESS; } +/*********************************************************************** + * ExAcquireResourceExclusiveLite (NTOSKRNL.EXE.@) + */ +BOOLEAN WINAPI ExAcquireResourceExclusiveLite( PERESOURCE resource, BOOLEAN wait ) +{ + FIXME( ":%p %u stub\n", resource, wait ); + return TRUE; +} + +/*********************************************************************** + * ExDeleteResourceLite (NTOSKRNL.EXE.@) + */ +NTSTATUS WINAPI ExDeleteResourceLite(PERESOURCE resource) +{ + FIXME("(%p): stub\n", resource); + return STATUS_NOT_IMPLEMENTED; +} + /***************************************************** * ExInterlockedRemoveHeadList (NTOSKRNL.EXE.@) */ @@ -2304,3 +2338,43 @@ FIXME("(%p %p) stub\n", head, lock); return ExInterlockedRemoveHeadList( head, lock ); } + +/*********************************************************************** + * ExReleaseResourceForThreadLite (NTOSKRNL.EXE.@) + */ +void WINAPI ExReleaseResourceForThreadLite( PERESOURCE resource, ERESOURCE_THREAD tid ) +{ + FIXME( "stub: %p %lu\n", resource, tid ); +} + +/*********************************************************************** + * KeEnterCriticalRegion (NTOSKRNL.EXE.@) + */ +void WINAPI KeEnterCriticalRegion(void) +{ + FIXME(": stub\n"); +} + +/*********************************************************************** + * KeLeaveCriticalRegion (NTOSKRNL.EXE.@) + */ +void WINAPI KeLeaveCriticalRegion(void) +{ + FIXME(": stub\n"); +} + +/*********************************************************************** + * ProbeForRead (NTOSKRNL.EXE.@) + */ +void WINAPI ProbeForRead(void *address, SIZE_T length, ULONG alignment) +{ + FIXME("(%p %lu %u) stub\n", address, length, alignment); +} + +/*********************************************************************** + * ProbeForWrite (NTOSKRNL.EXE.@) + */ +void WINAPI ProbeForWrite(void *address, SIZE_T length, ULONG alignment) +{ + FIXME("(%p %lu %u) stub\n", address, length, alignment); +} diff -Nru wine1.7-1.7.50/dlls/ntoskrnl.exe/ntoskrnl.exe.spec wine1.7-1.7.55/dlls/ntoskrnl.exe/ntoskrnl.exe.spec --- wine1.7-1.7.50/dlls/ntoskrnl.exe/ntoskrnl.exe.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ntoskrnl.exe/ntoskrnl.exe.spec 2015-11-13 14:32:40.000000000 +0000 @@ -111,7 +111,7 @@ @ stub DbgPrompt @ stub DbgQueryDebugFilterState @ stub DbgSetDebugFilterState -@ stub ExAcquireResourceExclusiveLite +@ stdcall ExAcquireResourceExclusiveLite(ptr long) @ stub ExAcquireResourceSharedLite @ stub ExAcquireSharedStarveExclusive @ stub ExAcquireSharedWaitForExclusive @@ -123,9 +123,9 @@ @ stub ExAllocatePoolWithTagPriority @ stub ExConvertExclusiveToSharedLite @ stdcall ExCreateCallback(ptr ptr long long) -@ stub ExDeleteNPagedLookasideList -@ stub ExDeletePagedLookasideList -@ stub ExDeleteResourceLite +@ stdcall ExDeleteNPagedLookasideList(ptr) +@ stdcall ExDeletePagedLookasideList(ptr) +@ stdcall ExDeleteResourceLite(ptr) @ stub ExDesktopObjectType @ stub ExDisableResourceBoostLite @ stub ExEnumHandleTable @@ -168,7 +168,7 @@ @ stub ExRaiseStatus @ stub ExRegisterCallback @ stub ExReinitializeResourceLite -@ stub ExReleaseResourceForThreadLite +@ stdcall ExReleaseResourceForThreadLite(ptr long) @ stub ExSemaphoreObjectType @ stub ExSetResourceOwnerPointer @ stub ExSetTimerResolution @@ -523,7 +523,7 @@ @ stub KeDeregisterBugCheckReasonCallback @ stub KeDetachProcess @ stub KeDisconnectInterrupt -@ stub KeEnterCriticalRegion +@ stdcall KeEnterCriticalRegion() @ stub KeEnterKernelDebugger @ stub KeFindConfigurationEntry @ stub KeFindConfigurationNextEntry @@ -563,7 +563,7 @@ @ stub KeInsertQueueDpc @ stub KeIsAttachedProcess @ stub KeIsExecutingDpc -@ stub KeLeaveCriticalRegion +@ stdcall KeLeaveCriticalRegion() @ stub KeLoaderBlock @ stub KeNumberProcessors @ stub KeProfileInterrupt @@ -835,8 +835,8 @@ @ stub PoShutdownBugCheck @ stub PoStartNextPowerIrp @ stub PoUnregisterSystemState -@ stub ProbeForRead -@ stub ProbeForWrite +@ stdcall ProbeForRead(ptr long long) +@ stdcall ProbeForWrite(ptr long long) @ stub PsAssignImpersonationToken @ stub PsChargePoolQuota @ stub PsChargeProcessNonPagedPoolQuota @@ -1191,7 +1191,7 @@ @ stdcall RtlUpcaseUnicodeToOemN(ptr long ptr ptr long) ntdll.RtlUpcaseUnicodeToOemN @ stdcall RtlUpperChar(long) ntdll.RtlUpperChar @ stdcall RtlUpperString(ptr ptr) ntdll.RtlUpperString -@ stub RtlValidRelativeSecurityDescriptor +@ stdcall RtlValidRelativeSecurityDescriptor(ptr long long) ntdll.RtlValidRelativeSecurityDescriptor @ stdcall RtlValidSecurityDescriptor(ptr) ntdll.RtlValidSecurityDescriptor @ stdcall RtlValidSid(ptr) ntdll.RtlValidSid @ stdcall RtlVerifyVersionInfo(ptr long int64) ntdll.RtlVerifyVersionInfo diff -Nru wine1.7-1.7.50/dlls/odbccp32/odbccp32.c wine1.7-1.7.55/dlls/odbccp32/odbccp32.c --- wine1.7-1.7.50/dlls/odbccp32/odbccp32.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/odbccp32/odbccp32.c 2015-11-13 14:32:40.000000000 +0000 @@ -37,6 +37,7 @@ /* Registry key names */ static const WCHAR drivers_key[] = {'S','o','f','t','w','a','r','e','\\','O','D','B','C','\\','O','D','B','C','I','N','S','T','.','I','N','I','\\','O','D','B','C',' ','D','r','i','v','e','r','s',0}; +static const WCHAR odbcW[] = {'S','o','f','t','w','a','r','e','\\','O','D','B','C',0}; /* This config mode is known to be process-wide. * MSDN documentation suggests that the value is hidden somewhere in the registry but I haven't found it yet. @@ -399,28 +400,176 @@ return ret; } -int WINAPI SQLGetPrivateProfileStringW(LPCWSTR lpszSection, LPCWSTR lpszEntry, - LPCWSTR lpszDefault, LPCWSTR RetBuffer, int cbRetBuffer, - LPCWSTR lpszFilename) +static HKEY get_privateprofile_sectionkey(LPCWSTR section, LPCWSTR filename) { + HKEY hkey, hkeyfilename, hkeysection; + LONG ret; + + if (RegOpenKeyW(HKEY_CURRENT_USER, odbcW, &hkey)) + return NULL; + + ret = RegOpenKeyW(hkey, filename, &hkeyfilename); + RegCloseKey(hkey); + if (ret) + return NULL; + + ret = RegOpenKeyW(hkeyfilename, section, &hkeysection); + RegCloseKey(hkeyfilename); + + return ret ? NULL : hkeysection; +} + +int WINAPI SQLGetPrivateProfileStringW(LPCWSTR section, LPCWSTR entry, + LPCWSTR defvalue, LPWSTR buff, int buff_len, LPCWSTR filename) +{ + BOOL usedefault = TRUE; + HKEY sectionkey; + LONG ret = 0; + + TRACE("%s %s %s %p %d %s\n", debugstr_w(section), debugstr_w(entry), + debugstr_w(defvalue), buff, buff_len, debugstr_w(filename)); + clear_errors(); - FIXME("%s %s %s %p %d %s\n", debugstr_w(lpszSection), debugstr_w(lpszEntry), - debugstr_w(lpszDefault), RetBuffer, cbRetBuffer, - debugstr_w(lpszFilename)); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + + if (buff_len <= 0 || !section) + return 0; + + if(buff) + buff[0] = 0; + + if (!defvalue || !buff) + return 0; + + sectionkey = get_privateprofile_sectionkey(section, filename); + if (sectionkey) + { + DWORD type, size; + + if (entry) + { + size = buff_len * sizeof(*buff); + if (RegGetValueW(sectionkey, NULL, entry, RRF_RT_REG_SZ, &type, buff, &size) == ERROR_SUCCESS) + { + usedefault = FALSE; + ret = (size / sizeof(*buff)) - 1; + } + } + else + { + WCHAR name[MAX_PATH]; + DWORD index = 0; + DWORD namelen; + + usedefault = FALSE; + + memset(buff, 0, buff_len); + + namelen = sizeof(name); + while (RegEnumValueW(sectionkey, index, name, &namelen, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) + { + if ((ret + namelen+1) > buff_len) + break; + + lstrcpyW(buff+ret, name); + ret += namelen+1; + namelen = sizeof(name); + index++; + } + } + + RegCloseKey(sectionkey); + } + else + usedefault = entry != NULL; + + if (usedefault) + { + lstrcpynW(buff, defvalue, buff_len); + ret = lstrlenW(buff); + } + + return ret; } -int WINAPI SQLGetPrivateProfileString(LPCSTR lpszSection, LPCSTR lpszEntry, - LPCSTR lpszDefault, LPCSTR RetBuffer, int cbRetBuffer, - LPCSTR lpszFilename) +int WINAPI SQLGetPrivateProfileString(LPCSTR section, LPCSTR entry, + LPCSTR defvalue, LPSTR buff, int buff_len, LPCSTR filename) { + WCHAR *sectionW, *filenameW; + BOOL usedefault = TRUE; + HKEY sectionkey; + LONG ret = 0; + + TRACE("%s %s %s %p %d %s\n", debugstr_a(section), debugstr_a(entry), + debugstr_a(defvalue), buff, buff_len, debugstr_a(filename)); + clear_errors(); - FIXME("%s %s %s %p %d %s\n", debugstr_a(lpszSection), debugstr_a(lpszEntry), - debugstr_a(lpszDefault), RetBuffer, cbRetBuffer, - debugstr_a(lpszFilename)); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + + if (buff_len <= 0) + return 0; + + if (buff) + buff[0] = 0; + + if (!section || !defvalue || !buff) + return 0; + + sectionW = heap_strdupAtoW(section); + filenameW = heap_strdupAtoW(filename); + + sectionkey = get_privateprofile_sectionkey(sectionW, filenameW); + + heap_free(sectionW); + heap_free(filenameW); + + if (sectionkey) + { + DWORD type, size; + + if (entry) + { + size = buff_len * sizeof(*buff); + if (RegGetValueA(sectionkey, NULL, entry, RRF_RT_REG_SZ, &type, buff, &size) == ERROR_SUCCESS) + { + usedefault = FALSE; + ret = (size / sizeof(*buff)) - 1; + } + } + else + { + char name[MAX_PATH] = {0}; + DWORD index = 0; + DWORD namelen; + + usedefault = FALSE; + + memset(buff, 0, buff_len); + + namelen = sizeof(name); + while (RegEnumValueA(sectionkey, index, name, &namelen, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) + { + if ((ret + namelen+1) > buff_len) + break; + + lstrcpyA(buff+ret, name); + + ret += namelen+1; + namelen = sizeof(name); + index++; + } + } + + RegCloseKey(sectionkey); + } + else + usedefault = entry != NULL; + + if (usedefault) + { + lstrcpynA(buff, defvalue, buff_len); + ret = strlen(buff); + } + + return ret; } BOOL WINAPI SQLGetTranslatorW(HWND hwndParent, LPWSTR lpszName, WORD cbNameMax, @@ -1016,7 +1165,6 @@ { LONG ret; HKEY hkey; - WCHAR softwareodbc[] = {'S','o','f','t','w','a','r','e','\\','O','D','B','C',0}; clear_errors(); TRACE("%s %s %s %s\n", debugstr_w(lpszSection), debugstr_w(lpszEntry), @@ -1028,7 +1176,7 @@ return FALSE; } - if ((ret = RegCreateKeyW(HKEY_CURRENT_USER, softwareodbc, &hkey)) == ERROR_SUCCESS) + if ((ret = RegCreateKeyW(HKEY_CURRENT_USER, odbcW, &hkey)) == ERROR_SUCCESS) { HKEY hkeyfilename; diff -Nru wine1.7-1.7.50/dlls/odbccp32/tests/misc.c wine1.7-1.7.55/dlls/odbccp32/tests/misc.c --- wine1.7-1.7.50/dlls/odbccp32/tests/misc.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/odbccp32/tests/misc.c 2015-11-13 14:32:40.000000000 +0000 @@ -24,6 +24,10 @@ #include "winreg.h" #include "odbcinst.h" +static const WCHAR abcd_key[] = {'S','o','f','t','w','a','r','e','\\','O','D','B','C','\\','a','b','c','d','.','I','N','I','\\','w','i','n','e','o','d','b','c',0}; +static const WCHAR abcdini_key[] = {'S','o','f','t','w','a','r','e','\\','O','D','B','C','\\','a','b','c','d','.','I','N','I',0 }; + + static void test_SQLConfigMode(void) { BOOL bool_ret; @@ -133,8 +137,6 @@ static void test_SQLWritePrivateProfileString(void) { static const WCHAR odbc_key[] = {'S','o','f','t','w','a','r','e','\\','O','D','B','C','\\','O','D','B','C','.','I','N','I','\\','w','i','n','e','o','d','b','c',0}; - static const WCHAR abcd_key[] = {'S','o','f','t','w','a','r','e','\\','O','D','B','C','\\','a','b','c','d','.','I','N','I','\\','w','i','n','e','o','d','b','c',0}; - static const WCHAR abcdini_key[] = {'S','o','f','t','w','a','r','e','\\','O','D','B','C','\\','a','b','c','d','.','I','N','I',0 }; BOOL ret; LONG reg_ret; DWORD error_code; @@ -188,10 +190,229 @@ } } +static void test_SQLGetPrivateProfileString(void) +{ + int ret; + char buffer[256] = {0}; + LONG reg_ret; + + strcpy(buffer, "wine"); + ret = SQLGetPrivateProfileString(NULL, "testing" , "default", buffer, 256, "ODBC.INI"); + ok(ret == 0, "SQLGetPrivateProfileString returned %d\n", ret); + ok(!strcmp(buffer, ""), "incorrect string '%s'\n", buffer); + + strcpy(buffer, "wine"); + ret = SQLGetPrivateProfileString("wineodbc", NULL , "default", buffer, 256, "ODBC.INI"); + ok(ret == 0, "SQLGetPrivateProfileString returned %d\n", ret); + ok(!strcmp(buffer, ""), "incorrect string '%s'\n", buffer); + + strcpy(buffer, "value"); + ret = SQLGetPrivateProfileString("wineodbc", "testing" , NULL, buffer, 256, "ODBC.INI"); + ok(ret == 0, "SQLGetPrivateProfileString returned %d\n", ret); + ok(!strcmp(buffer, ""), "incorrect string '%s'\n", buffer); + + ret = SQLGetPrivateProfileString("wineodbc", "testing" , "defaultX", buffer, 256, "ODBC.INI"); + ok(ret == strlen("defaultX"), "SQLGetPrivateProfileString returned %d\n", ret); + ok(!strcmp(buffer, "defaultX"), "incorrect string '%s'\n", buffer); + + ret = SQLGetPrivateProfileString("wineodbc", "testing" , "defaultX", buffer, 4, "ODBC.INI"); + ok(ret == strlen("def"), "SQLGetPrivateProfileString returned %d\n", ret); + ok(!strcmp(buffer, "def"), "incorrect string '%s'\n", buffer); + + ret = SQLGetPrivateProfileString("wineodbc", "testing" , "defaultX", buffer, 8, "ODBC.INI"); + ok(ret == strlen("default"), "SQLGetPrivateProfileString returned %d\n", ret); + ok(!strcmp(buffer, "default"), "incorrect string '%s'\n", buffer); + + ret = SQLGetPrivateProfileString("wineodbc", "testing" , "defaultX", NULL, 256, "ODBC.INI"); + ok(ret == 0, "SQLGetPrivateProfileString returned %d\n", ret); + + strcpy(buffer, "value"); + ret = SQLGetPrivateProfileString("wineodbc", "testing" , "defaultX", buffer, 0, "ODBC.INI"); + ok(ret == 0, "SQLGetPrivateProfileString returned %d\n", ret); + ok(!strcmp(buffer, "value"), "incorrect string '%s'\n", buffer); + + ret = SQLWritePrivateProfileString("wineodbc", "testing" , "value0123456789", "abcd.ini"); + ok(ret, "SQLWritePrivateProfileString failed\n"); + if(ret) + { + HKEY hkey; + + ret = SQLGetPrivateProfileString("wineodbc", "testing" , "defaultY", buffer, 256, "abcd.ini"); + ok(ret == strlen("value0123456789"), "SQLGetPrivateProfileString returned %d\n", ret); + ok(!strcmp(buffer, "value0123456789"), "incorrect string '%s'\n", buffer); + + ret = SQLGetPrivateProfileString("wineodbc", "testing" , "defaultY", NULL, 0, "abcd.ini"); + ok(ret == 0, "SQLGetPrivateProfileString returned %d\n", ret); + + ret = SQLGetPrivateProfileString("wineodbc", "testing" , "defaultY", buffer, 7, "abcd.ini"); + ok(ret == 6, "SQLGetPrivateProfileString returned %d\n", ret); + + strcpy(buffer, "wine"); + ret = SQLGetPrivateProfileString("wineodbc", NULL , "", buffer, 10, "abcd.ini"); + ok(ret == (strlen("testing")+1), "SQLGetPrivateProfileString returned %d\n", ret); + ok(!strcmp(buffer, "testing"), "incorrect string '%s'\n", buffer); + + ret = SQLWritePrivateProfileString("wineodbc", "value" , "0", "abcd.ini"); + ok(ret, "SQLWritePrivateProfileString failed\n"); + + strcpy(buffer, "wine"); + ret = SQLGetPrivateProfileString("wineodbc", NULL , "", buffer, 256, "abcd.ini"); + ok(ret == (strlen("testing") + strlen("value")+2), "SQLGetPrivateProfileString returned %d\n", ret); + if(ret >= (strlen("testing") + strlen("value")+2)) + { + ok(memcmp(buffer, "testing\0value\0", 14) == 0, "incorrect string '%s'\n", buffer); + } + + strcpy(buffer, "XXXXXXXXXXXXXXX"); + ret = SQLGetPrivateProfileString("wineodbc", NULL , "", buffer, 10, "abcd.ini"); + ok(ret == (strlen("testing")+1), "SQLGetPrivateProfileString returned %d\n", ret); + if(ret >= (strlen("testing")+1)) + { + ok(!strcmp(buffer, "testing"), "incorrect string '%s'\n", buffer); + /* Show that the buffer is cleared and partial enteries aren't added */ + ok(memcmp(buffer, "testing\0X", 9) != 0, "incorrect string '%s'\n", buffer); + } + + strcpy(buffer, "wine"); + ret = SQLGetPrivateProfileString("wineodbc", NULL , "", buffer, 2, "abcd.ini"); + ok(ret == 0, "SQLGetPrivateProfileString returned %d\n", ret); + + reg_ret = RegOpenKeyExW(HKEY_CURRENT_USER, abcd_key, 0, KEY_READ, &hkey); + ok(reg_ret == ERROR_SUCCESS, "RegOpenKeyExW failed\n"); + if(reg_ret == ERROR_SUCCESS) + { + reg_ret = RegDeleteKeyW(HKEY_CURRENT_USER, abcd_key); + ok(reg_ret == ERROR_SUCCESS, "RegDeleteKeyW failed\n"); + + RegCloseKey(hkey); + } + + /* Cleanup key */ + reg_ret = RegDeleteKeyW(HKEY_CURRENT_USER, abcdini_key); + ok(reg_ret == ERROR_SUCCESS, "RegDeleteKeyW failed\n"); + } +} + +static void test_SQLGetPrivateProfileStringW(void) +{ + static WCHAR testing[] = {'t','e','s','t','i','n','g',0}; + static WCHAR wineodbc[] = {'w','i','n','e','o','d','b','c',0}; + static WCHAR defaultval[] = {'d','e','f','a','u','l','t',0}; + static WCHAR odbcini[] = {'O','D','B','C','.','I','N','I',0}; + static WCHAR abcdini[] = {'a','b','c','d','.','I','N','I',0}; + static WCHAR wine[] = {'w','i','n','e',0}; + static WCHAR value[] = {'v','a','l','u','e',0}; + static WCHAR empty[] = {0}; + static WCHAR defaultX[] = {'d','e','f','a','u','l','t',0}; + static WCHAR def[] = {'d','e','f',0}; + static WCHAR value0[] = {'v','a','l','u','e','0','1','2','3','4','5','6','7','8','9',0}; + static WCHAR testingvalue[] = {'t','e','s','t','i','n','g',0,'v','a','l','u','e',0}; + int ret; + WCHAR buffer[256] = {0}; + LONG reg_ret; + + lstrcpyW(buffer, wine); + ret = SQLGetPrivateProfileStringW(NULL, testing , defaultval, buffer, 256, odbcini); + ok(ret == 0, "SQLGetPrivateProfileStringW returned %d\n", ret); + ok(!lstrcmpW(buffer, wine), "incorrect string '%s'\n", wine_dbgstr_w(buffer)); + + lstrcpyW(buffer, wine); + ret = SQLGetPrivateProfileStringW(wineodbc, NULL , defaultval, buffer, 256, odbcini); + ok(ret == 0, "SQLGetPrivateProfileStringW returned %d\n", ret); + ok(!lstrcmpW(buffer, empty), "incorrect string '%s'\n", wine_dbgstr_w(buffer)); + + lstrcpyW(buffer, value); + ret = SQLGetPrivateProfileStringW(wineodbc, testing , NULL, buffer, 256, odbcini); + ok(ret == 0, "SQLGetPrivateProfileStringW returned %d\n", ret); + ok(!lstrcmpW(buffer, empty), "incorrect string '%s'\n", wine_dbgstr_w(buffer)); + + ret = SQLGetPrivateProfileStringW(wineodbc, testing , defaultX, buffer, 256, odbcini); + ok(ret == lstrlenW(defaultX), "SQLGetPrivateProfileStringW returned %d\n", ret); + ok(!lstrcmpW(buffer, defaultX), "incorrect string '%s'\n", wine_dbgstr_w(buffer)); + + ret = SQLGetPrivateProfileStringW(wineodbc, testing , defaultX, buffer, 4, odbcini); + ok(ret == lstrlenW(def), "SQLGetPrivateProfileStringW returned %d\n", ret); + ok(!lstrcmpW(buffer, def), "incorrect string '%s'\n", wine_dbgstr_w(buffer)); + + ret = SQLGetPrivateProfileStringW(wineodbc, testing , defaultX, buffer, 8, odbcini); + ok(ret == lstrlenW(defaultX), "SQLGetPrivateProfileStringW returned %d\n", ret); + ok(!lstrcmpW(buffer, defaultX), "incorrect string '%s'\n", wine_dbgstr_w(buffer)); + + ret = SQLGetPrivateProfileStringW(wineodbc, testing , defaultX, NULL, 256, odbcini); + ok(ret == 0, "SQLGetPrivateProfileStringW returned %d\n", ret); + + lstrcpyW(buffer, value); + ret = SQLGetPrivateProfileStringW(wineodbc, testing , defaultX, buffer, 0, odbcini); + ok(ret == 0, "SQLGetPrivateProfileStringW returned %d\n", ret); + ok(!lstrcmpW(buffer, value), "incorrect string '%s'\n", wine_dbgstr_w(buffer)); + + ret = SQLWritePrivateProfileString("wineodbc", "testing" , "value0123456789", "abcd.ini"); + ok(ret, "SQLWritePrivateProfileString failed\n"); + if(ret) + { + HKEY hkey; + + ret = SQLGetPrivateProfileStringW(wineodbc, testing , defaultX, buffer, 256, abcdini); + ok(ret == lstrlenW(value0), "SQLGetPrivateProfileStringW returned %d\n", ret); + ok(!lstrcmpW(buffer, value0), "incorrect string '%s'\n", wine_dbgstr_w(buffer)); + + ret = SQLGetPrivateProfileStringW(wineodbc, testing , defaultX, NULL, 0, abcdini); + ok(ret == 0, "SQLGetPrivateProfileStringW returned %d\n", ret); + + ret = SQLGetPrivateProfileStringW(wineodbc, testing , defaultX, buffer, 7, abcdini); + ok(ret == 6, "SQLGetPrivateProfileStringW returned %d\n", ret); + + lstrcpyW(buffer, wine); + ret = SQLGetPrivateProfileStringW(wineodbc, NULL , empty, buffer, 10, abcdini); + ok(ret == lstrlenW(testing)+1, "SQLGetPrivateProfileStringW returned %d\n", ret); + ok(!lstrcmpW(buffer, testing), "incorrect string '%s'\n", wine_dbgstr_w(buffer)); + + ret = SQLWritePrivateProfileString("wineodbc", "value" , "0", "abcd.ini"); + ok(ret, "SQLWritePrivateProfileString failed\n"); + + lstrcpyW(buffer, wine); + ret = SQLGetPrivateProfileStringW(wineodbc, NULL , empty, buffer, 256, abcdini); + ok(ret == (lstrlenW(testing) + lstrlenW(value)+2), "SQLGetPrivateProfileStringW returned %d\n", ret); + if(ret == (lstrlenW(testing) + lstrlenW(value)+2)) + { + ok(!memcmp(buffer, testingvalue, sizeof(testingvalue)), + "incorrect string '%s'\n", wine_dbgstr_wn(buffer, ret)); + } + + lstrcpyW(buffer, value); + ret = SQLGetPrivateProfileStringW(wineodbc, NULL , empty, buffer, 10, abcdini); + ok(ret == lstrlenW(testing)+1, "SQLGetPrivateProfileStringW returned %d\n", ret); + if(ret >= lstrlenW(testing)+1) + { + ok(!lstrcmpW(buffer, testing), "incorrect string '%s'\n", wine_dbgstr_w(buffer)); + } + + lstrcpyW(buffer, value); + ret = SQLGetPrivateProfileStringW(wineodbc, NULL , empty, buffer, 2, abcdini); + ok(ret == 0, "SQLGetPrivateProfileStringW returned %d\n", ret); + + reg_ret = RegOpenKeyExW(HKEY_CURRENT_USER, abcd_key, 0, KEY_READ, &hkey); + ok(reg_ret == ERROR_SUCCESS, "RegOpenKeyExW failed\n"); + if(reg_ret == ERROR_SUCCESS) + { + reg_ret = RegDeleteKeyW(HKEY_CURRENT_USER, abcd_key); + ok(reg_ret == ERROR_SUCCESS, "RegDeleteKeyW failed\n"); + + RegCloseKey(hkey); + } + + /* Cleanup key */ + reg_ret = RegDeleteKeyW(HKEY_CURRENT_USER, abcdini_key); + ok(reg_ret == ERROR_SUCCESS, "RegDeleteKeyW failed\n"); + } +} + START_TEST(misc) { test_SQLConfigMode(); test_SQLInstallerError(); test_SQLInstallDriverManager(); test_SQLWritePrivateProfileString(); + test_SQLGetPrivateProfileString(); + test_SQLGetPrivateProfileStringW(); } diff -Nru wine1.7-1.7.50/dlls/ole32/compobj.c wine1.7-1.7.55/dlls/ole32/compobj.c --- wine1.7-1.7.50/dlls/ole32/compobj.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ole32/compobj.c 2015-11-13 14:32:40.000000000 +0000 @@ -1025,7 +1025,7 @@ * SEE ALSO * CoRegisterClassObject */ -HRESULT WINAPI CoRevokeClassObject( +HRESULT WINAPI DECLSPEC_HOTPATCH CoRevokeClassObject( DWORD dwRegister) { HRESULT hr = E_INVALIDARG; @@ -1873,7 +1873,7 @@ * SEE ALSO * CoUninitialize */ -HRESULT WINAPI CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit) +HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit) { struct oletls *info = COM_CurrentInfo(); HRESULT hr = S_OK; @@ -2019,6 +2019,7 @@ */ HRESULT WINAPI CoDisconnectObject( LPUNKNOWN lpUnk, DWORD reserved ) { + struct stub_manager *manager; HRESULT hr; IMarshal *marshal; APARTMENT *apt; @@ -2039,7 +2040,13 @@ if (!apt) return CO_E_NOTINITIALIZED; - apartment_disconnectobject(apt, lpUnk); + manager = get_stub_manager_from_object(apt, lpUnk, FALSE); + if (manager) { + stub_manager_disconnect(manager); + /* Release stub manager twice, to remove the apartment reference. */ + stub_manager_int_release(manager); + stub_manager_int_release(manager); + } /* Note: native is pretty broken here because it just silently * fails, without returning an appropriate error code if the object was @@ -3180,10 +3187,8 @@ REFIID iid, LPVOID *ppv) { + MULTI_QI multi_qi = { iid }; HRESULT hres; - LPCLASSFACTORY lpclf = 0; - APARTMENT *apt; - CLSID clsid; TRACE("(rclsid=%s, pUnkOuter=%p, dwClsContext=%08x, riid=%s, ppv=%p)\n", debugstr_guid(rclsid), pUnkOuter, dwClsContext, debugstr_guid(iid), ppv); @@ -3191,65 +3196,8 @@ if (ppv==0) return E_POINTER; - hres = CoGetTreatAsClass(rclsid, &clsid); - if(FAILED(hres)) - clsid = *rclsid; - - *ppv = 0; - - if (!(apt = COM_CurrentApt())) - { - if (!(apt = apartment_find_multi_threaded())) - { - ERR("apartment not initialised\n"); - return CO_E_NOTINITIALIZED; - } - apartment_release(apt); - } - - /* - * The Standard Global Interface Table (GIT) object is a process-wide singleton. - */ - if (IsEqualIID(&clsid, &CLSID_StdGlobalInterfaceTable)) - { - IGlobalInterfaceTable *git = get_std_git(); - hres = IGlobalInterfaceTable_QueryInterface(git, iid, ppv); - if (hres != S_OK) return hres; - - TRACE("Retrieved GIT (%p)\n", *ppv); - return S_OK; - } - - if (IsEqualCLSID(&clsid, &CLSID_ManualResetEvent)) - return ManualResetEvent_Construct(pUnkOuter, iid, ppv); - - /* - * Get a class factory to construct the object we want. - */ - hres = CoGetClassObject(&clsid, - dwClsContext, - NULL, - &IID_IClassFactory, - (LPVOID)&lpclf); - - if (FAILED(hres)) - return hres; - - /* - * Create the object and don't forget to release the factory - */ - hres = IClassFactory_CreateInstance(lpclf, pUnkOuter, iid, ppv); - IClassFactory_Release(lpclf); - if (FAILED(hres)) - { - if (hres == CLASS_E_NOAGGREGATION && pUnkOuter) - FIXME("Class %s does not support aggregation\n", debugstr_guid(&clsid)); - else - FIXME("no instance created for interface %s of class %s, hres is 0x%08x\n", - debugstr_guid(iid), - debugstr_guid(&clsid),hres); - } - + hres = CoCreateInstanceEx(rclsid, pUnkOuter, dwClsContext, NULL, 1, &multi_qi); + *ppv = multi_qi.pItf; return hres; } @@ -3264,18 +3212,26 @@ } } -static HRESULT return_multi_qi(IUnknown *unk, DWORD count, MULTI_QI *mqi) +static HRESULT return_multi_qi(IUnknown *unk, DWORD count, MULTI_QI *mqi, BOOL include_unk) { - ULONG index, fetched = 0; + ULONG index = 0, fetched = 0; - for (index = 0; index < count; index++) + if (include_unk) + { + mqi[0].hr = S_OK; + mqi[0].pItf = unk; + index = fetched = 1; + } + + for (; index < count; index++) { mqi[index].hr = IUnknown_QueryInterface(unk, mqi[index].pIID, (void**)&mqi[index].pItf); if (mqi[index].hr == S_OK) fetched++; } - IUnknown_Release(unk); + if (!include_unk) + IUnknown_Release(unk); if (fetched == 0) return E_NOINTERFACE; @@ -3294,39 +3250,83 @@ ULONG cmq, MULTI_QI* pResults) { - IUnknown* pUnk = NULL; - HRESULT hr; + IUnknown *unk = NULL; + IClassFactory *cf; + APARTMENT *apt; + CLSID clsid; + HRESULT hres; - /* - * Sanity check - */ - if ( (cmq==0) || (pResults==NULL)) - return E_INVALIDARG; + TRACE("(%s %p %x %p %u %p)\n", debugstr_guid(rclsid), pUnkOuter, dwClsContext, pServerInfo, cmq, pResults); - if (pServerInfo!=NULL) - FIXME("() non-NULL pServerInfo not supported!\n"); + if (!cmq || !pResults) + return E_INVALIDARG; - init_multi_qi(cmq, pResults); + if (pServerInfo) + FIXME("() non-NULL pServerInfo not supported!\n"); - /* - * Get the object and get its IUnknown pointer. - */ - hr = CoCreateInstance(rclsid, - pUnkOuter, - dwClsContext, - &IID_IUnknown, - (VOID**)&pUnk); + init_multi_qi(cmq, pResults); - if (hr != S_OK) - return hr; + hres = CoGetTreatAsClass(rclsid, &clsid); + if(FAILED(hres)) + clsid = *rclsid; + + if (!(apt = COM_CurrentApt())) + { + if (!(apt = apartment_find_multi_threaded())) + { + ERR("apartment not initialised\n"); + return CO_E_NOTINITIALIZED; + } + apartment_release(apt); + } + + /* + * The Standard Global Interface Table (GIT) object is a process-wide singleton. + */ + if (IsEqualIID(&clsid, &CLSID_StdGlobalInterfaceTable)) + { + IGlobalInterfaceTable *git = get_std_git(); + TRACE("Retrieving GIT\n"); + return return_multi_qi((IUnknown*)git, cmq, pResults, FALSE); + } + + if (IsEqualCLSID(&clsid, &CLSID_ManualResetEvent)) { + hres = ManualResetEvent_Construct(pUnkOuter, pResults[0].pIID, (void**)&unk); + if (FAILED(hres)) + return hres; + return return_multi_qi(unk, cmq, pResults, TRUE); + } + + /* + * Get a class factory to construct the object we want. + */ + hres = CoGetClassObject(&clsid, dwClsContext, NULL, &IID_IClassFactory, (void**)&cf); + if (FAILED(hres)) + return hres; - return return_multi_qi(pUnk, cmq, pResults); + /* + * Create the object and don't forget to release the factory + */ + hres = IClassFactory_CreateInstance(cf, pUnkOuter, pResults[0].pIID, (void**)&unk); + IClassFactory_Release(cf); + if (FAILED(hres)) + { + if (hres == CLASS_E_NOAGGREGATION && pUnkOuter) + FIXME("Class %s does not support aggregation\n", debugstr_guid(&clsid)); + else + FIXME("no instance created for interface %s of class %s, hres is 0x%08x\n", + debugstr_guid(pResults[0].pIID), + debugstr_guid(&clsid),hres); + return hres; + } + + return return_multi_qi(unk, cmq, pResults, TRUE); } /*********************************************************************** * CoGetInstanceFromFile [OLE32.@] */ -HRESULT WINAPI CoGetInstanceFromFile( +HRESULT WINAPI DECLSPEC_HOTPATCH CoGetInstanceFromFile( COSERVERINFO *server_info, CLSID *rclsid, IUnknown *outer, @@ -3383,7 +3383,7 @@ IPersistFile_Release(pf); } - return return_multi_qi(unk, count, results); + return return_multi_qi(unk, count, results, FALSE); } /*********************************************************************** @@ -3446,7 +3446,7 @@ IPersistStorage_Release(ps); } - return return_multi_qi(unk, count, results); + return return_multi_qi(unk, count, results, FALSE); } /*********************************************************************** @@ -3605,32 +3605,8 @@ apt = COM_CurrentApt(); if (!apt) return CO_E_NOTINITIALIZED; - stubmgr = get_stub_manager_from_object(apt, pUnk); - - if (stubmgr) - { - if (fLock) - stub_manager_ext_addref(stubmgr, 1, FALSE); - else - stub_manager_ext_release(stubmgr, 1, FALSE, fLastUnlockReleases); - - stub_manager_int_release(stubmgr); - - return S_OK; - } - else if (fLock) - { - stubmgr = new_stub_manager(apt, pUnk); - - if (stubmgr) - { - stub_manager_ext_addref(stubmgr, 1, FALSE); - stub_manager_int_release(stubmgr); - } - - return S_OK; - } - else + stubmgr = get_stub_manager_from_object(apt, pUnk, fLock); + if (!stubmgr) { WARN("stub object not found %p\n", pUnk); /* Note: native is pretty broken here because it just silently @@ -3638,6 +3614,14 @@ * think that the object was disconnected, when it actually wasn't */ return S_OK; } + + if (fLock) + stub_manager_ext_addref(stubmgr, 1, FALSE); + else + stub_manager_ext_release(stubmgr, 1, FALSE, fLastUnlockReleases); + + stub_manager_int_release(stubmgr); + return S_OK; } /*********************************************************************** diff -Nru wine1.7-1.7.50/dlls/ole32/compobj_private.h wine1.7-1.7.55/dlls/ole32/compobj_private.h --- wine1.7-1.7.50/dlls/ole32/compobj_private.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ole32/compobj_private.h 2015-11-13 14:32:40.000000000 +0000 @@ -107,6 +107,7 @@ */ ULONG norm_refs; /* refcount of normal marshals (CS lock) */ + BOOL disconnected; /* CoDisconnectObject has been called (CS lock) */ }; /* imported interface proxy */ @@ -185,18 +186,19 @@ /* Stub Manager */ ULONG stub_manager_int_release(struct stub_manager *This) DECLSPEC_HIDDEN; -struct stub_manager *new_stub_manager(APARTMENT *apt, IUnknown *object) DECLSPEC_HIDDEN; ULONG stub_manager_ext_addref(struct stub_manager *m, ULONG refs, BOOL tableweak) DECLSPEC_HIDDEN; ULONG stub_manager_ext_release(struct stub_manager *m, ULONG refs, BOOL tableweak, BOOL last_unlock_releases) DECLSPEC_HIDDEN; -struct ifstub *stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *sb, IUnknown *iptr, REFIID iid, +struct ifstub *stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *sb, REFIID iid, DWORD dest_context, void *dest_context_data, MSHLFLAGS flags) DECLSPEC_HIDDEN; struct ifstub *stub_manager_find_ifstub(struct stub_manager *m, REFIID iid, MSHLFLAGS flags) DECLSPEC_HIDDEN; struct stub_manager *get_stub_manager(APARTMENT *apt, OID oid) DECLSPEC_HIDDEN; -struct stub_manager *get_stub_manager_from_object(APARTMENT *apt, void *object) DECLSPEC_HIDDEN; +struct stub_manager *get_stub_manager_from_object(APARTMENT *apt, IUnknown *object, BOOL alloc) DECLSPEC_HIDDEN; BOOL stub_manager_notify_unmarshal(struct stub_manager *m, const IPID *ipid) DECLSPEC_HIDDEN; BOOL stub_manager_is_table_marshaled(struct stub_manager *m, const IPID *ipid) DECLSPEC_HIDDEN; void stub_manager_release_marshal_data(struct stub_manager *m, ULONG refs, const IPID *ipid, BOOL tableweak) DECLSPEC_HIDDEN; -HRESULT ipid_get_dispatch_params(const IPID *ipid, APARTMENT **stub_apt, IRpcStubBuffer **stub, IRpcChannelBuffer **chan, IID *iid, IUnknown **iface) DECLSPEC_HIDDEN; +void stub_manager_disconnect(struct stub_manager *m) DECLSPEC_HIDDEN; +HRESULT ipid_get_dispatch_params(const IPID *ipid, APARTMENT **stub_apt, struct stub_manager **manager, IRpcStubBuffer **stub, + IRpcChannelBuffer **chan, IID *iid, IUnknown **iface) DECLSPEC_HIDDEN; HRESULT start_apartment_remote_unknown(void) DECLSPEC_HIDDEN; HRESULT marshal_object(APARTMENT *apt, STDOBJREF *stdobjref, REFIID riid, IUnknown *obj, DWORD dest_context, void *dest_context_data, MSHLFLAGS mshlflags) DECLSPEC_HIDDEN; @@ -213,7 +215,7 @@ HRESULT RPC_CreateServerChannel(DWORD dest_context, void *dest_context_data, IRpcChannelBuffer **chan) DECLSPEC_HIDDEN; void RPC_ExecuteCall(struct dispatch_params *params) DECLSPEC_HIDDEN; HRESULT RPC_RegisterInterface(REFIID riid) DECLSPEC_HIDDEN; -void RPC_UnregisterInterface(REFIID riid) DECLSPEC_HIDDEN; +void RPC_UnregisterInterface(REFIID riid, BOOL wait) DECLSPEC_HIDDEN; HRESULT RPC_StartLocalServer(REFCLSID clsid, IStream *stream, BOOL multi_use, void **registration) DECLSPEC_HIDDEN; void RPC_StopLocalServer(void *registration) DECLSPEC_HIDDEN; HRESULT RPC_GetLocalClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv) DECLSPEC_HIDDEN; @@ -236,7 +238,6 @@ APARTMENT *apartment_findfromtid(DWORD tid) DECLSPEC_HIDDEN; DWORD apartment_release(struct apartment *apt) DECLSPEC_HIDDEN; HRESULT apartment_disconnectproxies(struct apartment *apt) DECLSPEC_HIDDEN; -void apartment_disconnectobject(struct apartment *apt, void *object) DECLSPEC_HIDDEN; static inline HRESULT apartment_getoxid(const struct apartment *apt, OXID *oxid) { *oxid = apt->oxid; @@ -317,6 +318,8 @@ extern BOOL actctx_get_miscstatus(const CLSID*, DWORD, DWORD*) DECLSPEC_HIDDEN; +extern const char *debugstr_formatetc(const FORMATETC *formatetc) DECLSPEC_HIDDEN; + static inline void *heap_alloc(size_t len) { return HeapAlloc(GetProcessHeap(), 0, len); diff -Nru wine1.7-1.7.50/dlls/ole32/datacache.c wine1.7-1.7.55/dlls/ole32/datacache.c --- wine1.7-1.7.50/dlls/ole32/datacache.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ole32/datacache.c 2015-11-13 14:32:40.000000000 +0000 @@ -216,7 +216,7 @@ return CONTAINING_RECORD(iface, DataCache, IAdviseSink_iface); } -static const char * debugstr_formatetc(const FORMATETC *formatetc) +const char *debugstr_formatetc(const FORMATETC *formatetc) { return wine_dbg_sprintf("{ cfFormat = 0x%x, ptd = %p, dwAspect = %d, lindex = %d, tymed = %d }", formatetc->cfFormat, formatetc->ptd, formatetc->dwAspect, @@ -282,10 +282,10 @@ /* checks that the clipformat and tymed are valid and returns an error if they * aren't and CACHE_S_NOTSUPPORTED if they are valid, but can't be rendered by * DataCache_Draw */ -static HRESULT check_valid_clipformat_and_tymed(CLIPFORMAT cfFormat, DWORD tymed) +static HRESULT check_valid_clipformat_and_tymed(CLIPFORMAT cfFormat, DWORD tymed, BOOL load) { if (!cfFormat || !tymed || - (cfFormat == CF_METAFILEPICT && tymed == TYMED_MFPICT) || + (cfFormat == CF_METAFILEPICT && (tymed == TYMED_MFPICT || load)) || (cfFormat == CF_BITMAP && tymed == TYMED_GDI) || (cfFormat == CF_DIB && tymed == TYMED_HGLOBAL) || (cfFormat == CF_ENHMETAFILE && tymed == TYMED_ENHMF)) @@ -299,11 +299,11 @@ } } -static HRESULT DataCache_CreateEntry(DataCache *This, const FORMATETC *formatetc, DataCacheEntry **cache_entry) +static HRESULT DataCache_CreateEntry(DataCache *This, const FORMATETC *formatetc, DataCacheEntry **cache_entry, BOOL load) { HRESULT hr; - hr = check_valid_clipformat_and_tymed(formatetc->cfFormat, formatetc->tymed); + hr = check_valid_clipformat_and_tymed(formatetc->cfFormat, formatetc->tymed, load); if (FAILED(hr)) return hr; if (hr == CACHE_S_FORMATETC_NOTSUPPORTED) @@ -408,7 +408,7 @@ if (length == -1) { DWORD cf; - hr = IStream_Read(stream, &cf, sizeof(cf), 0); + hr = IStream_Read(stream, &cf, sizeof(cf), &read); if (hr != S_OK || read != sizeof(cf)) return DV_E_CLIPFORMAT; *clipformat = cf; @@ -1259,7 +1259,7 @@ cache_entry = DataCache_GetEntryForFormatEtc( This, fmt ); if (!cache_entry) - hr = DataCache_CreateEntry( This, fmt, &cache_entry ); + hr = DataCache_CreateEntry( This, fmt, &cache_entry, TRUE ); if (SUCCEEDED( hr )) { DataCacheEntry_DiscardData( cache_entry ); @@ -1333,7 +1333,10 @@ if (IsEqualCLSID( &stat.clsid, &CLSID_Picture_Dib )) fmt = &static_dib_fmt; else + { + FIXME("unsupported format %s\n", debugstr_guid( &stat.clsid )); return E_FAIL; + } return add_cache_entry( This, fmt, stm, contents_stream ); } @@ -1365,7 +1368,8 @@ hr = parse_contents_stream( This, pStg, stm ); IStream_Release( stm ); } - else + + if (FAILED(hr)) hr = parse_pres_streams( This, pStg ); if (SUCCEEDED( hr )) @@ -2003,7 +2007,7 @@ return CACHE_S_SAMECACHE; } - hr = DataCache_CreateEntry(This, pformatetc, &cache_entry); + hr = DataCache_CreateEntry(This, pformatetc, &cache_entry, FALSE); if (SUCCEEDED(hr)) { diff -Nru wine1.7-1.7.50/dlls/ole32/defaulthandler.c wine1.7-1.7.55/dlls/ole32/defaulthandler.c --- wine1.7-1.7.50/dlls/ole32/defaulthandler.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ole32/defaulthandler.c 2015-11-13 14:32:40.000000000 +0000 @@ -75,7 +75,8 @@ enum object_state { object_state_not_running, - object_state_running + object_state_running, + object_state_deferred_close }; /**************************************************************************** @@ -131,6 +132,7 @@ /* IDataObject delegate */ IDataObject *pDataDelegate; enum object_state object_state; + ULONG in_call; /* connection cookie for the advise on the delegate OLE object */ DWORD dwAdvConn; @@ -184,6 +186,20 @@ return IRunnableObject_IsRunning(&This->IRunnableObject_iface); } +static void DefaultHandler_Stop(DefaultHandler *This); + +static inline void start_object_call(DefaultHandler *This) +{ + This->in_call++; +} + +static inline void end_object_call(DefaultHandler *This) +{ + This->in_call--; + if (This->in_call == 0 && This->object_state == object_state_deferred_close) + DefaultHandler_Stop( This ); +} + /********************************************************* * Method implementation for the non delegating IUnknown * part of the DefaultHandler class. @@ -350,7 +366,11 @@ TRACE("(%p, %p)\n", iface, pClientSite); if (object_is_running(This)) + { + start_object_call( This ); hr = IOleObject_SetClientSite(This->pOleDelegate, pClientSite); + end_object_call( This ); + } /* * Make sure we release the previous client site if there @@ -413,7 +433,11 @@ debugstr_w(szContainerObj)); if (object_is_running(This)) + { + start_object_call( This ); IOleObject_SetHostNames(This->pOleDelegate, szContainerApp, szContainerObj); + end_object_call( This ); + } /* Be sure to cleanup before re-assigning the strings. */ HeapFree( GetProcessHeap(), 0, This->containerApp ); @@ -459,17 +483,26 @@ /* undoes the work done by DefaultHandler_Run */ static void DefaultHandler_Stop(DefaultHandler *This) { - if (!object_is_running(This)) + IOleCacheControl *cache_ctrl; + HRESULT hr; + + if (This->object_state == object_state_not_running) return; - IOleObject_Unadvise(This->pOleDelegate, This->dwAdvConn); + hr = IUnknown_QueryInterface( This->dataCache, &IID_IOleCacheControl, (void **)&cache_ctrl ); + if (SUCCEEDED(hr)) + { + hr = IOleCacheControl_OnStop( cache_ctrl ); + IOleCacheControl_Release( cache_ctrl ); + } - /* FIXME: call IOleCache_OnStop */ + IOleObject_Unadvise(This->pOleDelegate, This->dwAdvConn); if (This->dataAdviseHolder) DataAdviseHolder_OnDisconnect(This->dataAdviseHolder); This->object_state = object_state_not_running; + release_delegates( This ); } /************************************************************************ @@ -492,10 +525,11 @@ if (!object_is_running(This)) return S_OK; + start_object_call( This ); hr = IOleObject_Close(This->pOleDelegate, dwSaveOption); + end_object_call( This ); DefaultHandler_Stop(This); - release_delegates(This); return hr; } @@ -513,16 +547,18 @@ IMoniker* pmk) { DefaultHandler *This = impl_from_IOleObject(iface); + HRESULT hr = S_OK; - TRACE("(%p, %d, %p)\n", - iface, - dwWhichMoniker, - pmk); + TRACE("(%p, %d, %p)\n", iface, dwWhichMoniker, pmk); if (object_is_running(This)) - return IOleObject_SetMoniker(This->pOleDelegate, dwWhichMoniker, pmk); + { + start_object_call( This ); + hr = IOleObject_SetMoniker(This->pOleDelegate, dwWhichMoniker, pmk); + end_object_call( This ); + } - return S_OK; + return hr; } /************************************************************************ @@ -539,13 +575,19 @@ IMoniker** ppmk) { DefaultHandler *This = impl_from_IOleObject(iface); + HRESULT hr; TRACE("(%p, %d, %d, %p)\n", iface, dwAssign, dwWhichMoniker, ppmk); if (object_is_running(This)) - return IOleObject_GetMoniker(This->pOleDelegate, dwAssign, dwWhichMoniker, - ppmk); + { + start_object_call( This ); + hr = IOleObject_GetMoniker(This->pOleDelegate, dwAssign, dwWhichMoniker, + ppmk); + end_object_call( This ); + return hr; + } /* FIXME: dwWhichMoniker == OLEWHICHMK_CONTAINER only? */ if (This->clientSite) @@ -574,14 +616,20 @@ DWORD dwReserved) { DefaultHandler *This = impl_from_IOleObject(iface); + HRESULT hr = OLE_E_NOTRUNNING; TRACE("(%p, %p, %d, %d)\n", iface, pDataObject, fCreation, dwReserved); if (object_is_running(This)) - return IOleObject_InitFromData(This->pOleDelegate, pDataObject, fCreation, + { + start_object_call( This ); + hr = IOleObject_InitFromData(This->pOleDelegate, pDataObject, fCreation, dwReserved); - return OLE_E_NOTRUNNING; + end_object_call( This ); + } + + return hr; } /************************************************************************ @@ -597,15 +645,20 @@ IDataObject** ppDataObject) { DefaultHandler *This = impl_from_IOleObject(iface); + HRESULT hr = OLE_E_NOTRUNNING; TRACE("(%p, %d, %p)\n", iface, dwReserved, ppDataObject); if (object_is_running(This)) - return IOleObject_GetClipboardData(This->pOleDelegate, dwReserved, + { + start_object_call( This ); + hr = IOleObject_GetClipboardData(This->pOleDelegate, dwReserved, ppDataObject); + end_object_call( This ); + } - return OLE_E_NOTRUNNING; + return hr; } static HRESULT WINAPI DefaultHandler_DoVerb( @@ -626,8 +679,12 @@ hr = IRunnableObject_Run(pRunnableObj, NULL); if (FAILED(hr)) return hr; - return IOleObject_DoVerb(This->pOleDelegate, iVerb, lpmsg, pActiveSite, + start_object_call( This ); + hr = IOleObject_DoVerb(This->pOleDelegate, iVerb, lpmsg, pActiveSite, lindex, hwndParent, lprcPosRect); + end_object_call( This ); + + return hr; } /************************************************************************ @@ -648,7 +705,11 @@ TRACE("(%p, %p)\n", iface, ppEnumOleVerb); if (object_is_running(This)) + { + start_object_call( This ); hr = IOleObject_EnumVerbs(This->pOleDelegate, ppEnumOleVerb); + end_object_call( This ); + } if (hr == OLE_S_USEREG) return OleRegEnumVerbs(&This->clsid, ppEnumOleVerb); @@ -660,6 +721,8 @@ IOleObject* iface) { DefaultHandler *This = impl_from_IOleObject(iface); + HRESULT hr; + TRACE("(%p)\n", iface); if (!object_is_running(This)) @@ -667,7 +730,12 @@ FIXME("Should run object\n"); return E_NOTIMPL; } - return IOleObject_Update(This->pOleDelegate); + + start_object_call( This ); + hr = IOleObject_Update(This->pOleDelegate); + end_object_call( This ); + + return hr; } /************************************************************************ @@ -681,12 +749,17 @@ IOleObject* iface) { DefaultHandler *This = impl_from_IOleObject(iface); + HRESULT hr = OLE_E_NOTRUNNING; TRACE("(%p)\n", iface); if (object_is_running(This)) - return IOleObject_IsUpToDate(This->pOleDelegate); + { + start_object_call( This ); + hr = IOleObject_IsUpToDate(This->pOleDelegate); + end_object_call( This ); + } - return OLE_E_NOTRUNNING; + return hr; } /************************************************************************ @@ -701,11 +774,17 @@ CLSID* pClsid) { DefaultHandler *This = impl_from_IOleObject(iface); + HRESULT hr; TRACE("(%p, %p)\n", iface, pClsid); if (object_is_running(This)) - return IOleObject_GetUserClassID(This->pOleDelegate, pClsid); + { + start_object_call( This ); + hr = IOleObject_GetUserClassID(This->pOleDelegate, pClsid); + end_object_call( This ); + return hr; + } if (!pClsid) return E_POINTER; @@ -729,10 +808,16 @@ LPOLESTR* pszUserType) { DefaultHandler *This = impl_from_IOleObject(iface); + HRESULT hr; TRACE("(%p, %d, %p)\n", iface, dwFormOfType, pszUserType); if (object_is_running(This)) - return IOleObject_GetUserType(This->pOleDelegate, dwFormOfType, pszUserType); + { + start_object_call( This ); + hr = IOleObject_GetUserType(This->pOleDelegate, dwFormOfType, pszUserType); + end_object_call( This ); + return hr; + } return OleRegGetUserType(&This->clsid, dwFormOfType, pszUserType); } @@ -750,14 +835,19 @@ SIZEL* psizel) { DefaultHandler *This = impl_from_IOleObject(iface); + HRESULT hr = OLE_E_NOTRUNNING; TRACE("(%p, %x, (%d x %d))\n", iface, dwDrawAspect, psizel->cx, psizel->cy); if (object_is_running(This)) - return IOleObject_SetExtent(This->pOleDelegate, dwDrawAspect, psizel); + { + start_object_call( This ); + hr = IOleObject_SetExtent(This->pOleDelegate, dwDrawAspect, psizel); + end_object_call( This ); + } - return OLE_E_NOTRUNNING; + return hr; } /************************************************************************ @@ -782,7 +872,12 @@ TRACE("(%p, %x, %p)\n", iface, dwDrawAspect, psizel); if (object_is_running(This)) - return IOleObject_GetExtent(This->pOleDelegate, dwDrawAspect, psizel); + { + start_object_call( This ); + hres = IOleObject_GetExtent(This->pOleDelegate, dwDrawAspect, psizel); + end_object_call( This ); + return hres; + } hres = IUnknown_QueryInterface(This->dataCache, &IID_IViewObject2, (void**)&cacheView); if (FAILED(hres)) @@ -912,7 +1007,12 @@ TRACE("(%p, %x, %p)\n", iface, dwAspect, pdwStatus); if (object_is_running(This)) - return IOleObject_GetMiscStatus(This->pOleDelegate, dwAspect, pdwStatus); + { + start_object_call( This ); + hres = IOleObject_GetMiscStatus(This->pOleDelegate, dwAspect, pdwStatus); + end_object_call( This ); + return hres; + } hres = OleRegGetMiscStatus(&This->clsid, dwAspect, pdwStatus); @@ -934,13 +1034,18 @@ struct tagLOGPALETTE* pLogpal) { DefaultHandler *This = impl_from_IOleObject(iface); + HRESULT hr = OLE_E_NOTRUNNING; TRACE("(%p, %p))\n", iface, pLogpal); if (object_is_running(This)) - return IOleObject_SetColorScheme(This->pOleDelegate, pLogpal); + { + start_object_call( This ); + hr = IOleObject_SetColorScheme(This->pOleDelegate, pLogpal); + end_object_call( This ); + } - return OLE_E_NOTRUNNING; + return hr; } /********************************************************* @@ -1021,8 +1126,19 @@ IDataObject_Release(cacheDataObject); - if (FAILED(hres) && This->pDataDelegate) + if (hres == S_OK) return hres; + + if (object_is_running( This )) + { + start_object_call(This); hres = IDataObject_GetData(This->pDataDelegate, pformatetcIn, pmedium); + end_object_call(This); + if (hres == S_OK) return hres; + } + + /* Query running state again, as the object may have closed during _GetData call */ + if (!object_is_running( This )) + hres = OLE_E_NOTRUNNING; return hres; } @@ -1067,8 +1183,19 @@ IDataObject_Release(cacheDataObject); - if (FAILED(hres) && This->pDataDelegate) + if (hres == S_OK) return hres; + + if (object_is_running( This )) + { + start_object_call( This ); hres = IDataObject_QueryGetData(This->pDataDelegate, pformatetc); + end_object_call( This ); + if (hres == S_OK) return hres; + } + + /* Query running state again, as the object may have closed during _QueryGetData call */ + if (!object_is_running( This )) + hres = OLE_E_NOTRUNNING; return hres; } @@ -1086,13 +1213,18 @@ LPFORMATETC pformatetcOut) { DefaultHandler *This = impl_from_IDataObject(iface); + HRESULT hr; TRACE("(%p, %p, %p)\n", iface, pformatetcIn, pformatetcOut); - if (!This->pDataDelegate) + if (!object_is_running( This )) return OLE_E_NOTRUNNING; - return IDataObject_GetCanonicalFormatEtc(This->pDataDelegate, pformatetcIn, pformatetcOut); + start_object_call( This ); + hr = IDataObject_GetCanonicalFormatEtc(This->pDataDelegate, pformatetcIn, pformatetcOut); + end_object_call( This ); + + return hr; } /************************************************************************ @@ -1177,8 +1309,12 @@ if (!This->dataAdviseHolder) { hres = CreateDataAdviseHolder(&This->dataAdviseHolder); - if (SUCCEEDED(hres) && This->pDataDelegate) + if (SUCCEEDED(hres) && object_is_running( This )) + { + start_object_call( This ); DataAdviseHolder_OnConnect(This->dataAdviseHolder, This->pDataDelegate); + end_object_call( This ); + } } if (SUCCEEDED(hres)) @@ -1313,6 +1449,7 @@ { DefaultHandler *This = impl_from_IRunnableObject(iface); HRESULT hr; + IOleCacheControl *cache_ctrl; FIXME("(%p): semi-stub\n", pbc); @@ -1327,49 +1464,59 @@ if (FAILED(hr)) return hr; - This->object_state = object_state_running; - hr = IOleObject_Advise(This->pOleDelegate, &This->IAdviseSink_iface, &This->dwAdvConn); + if (FAILED(hr)) goto fail; - if (SUCCEEDED(hr) && This->clientSite) - hr = IOleObject_SetClientSite(This->pOleDelegate, This->clientSite); - - if (SUCCEEDED(hr)) + if (This->clientSite) { - IOleObject_QueryInterface(This->pOleDelegate, &IID_IPersistStorage, - (void **)&This->pPSDelegate); - if (This->pPSDelegate) - { - if(This->storage_state == storage_state_initialised) - hr = IPersistStorage_InitNew(This->pPSDelegate, This->storage); - else if(This->storage_state == storage_state_loaded) - hr = IPersistStorage_Load(This->pPSDelegate, This->storage); - } + hr = IOleObject_SetClientSite(This->pOleDelegate, This->clientSite); + if (FAILED(hr)) goto fail; } - if (SUCCEEDED(hr) && This->containerApp) + hr = IOleObject_QueryInterface(This->pOleDelegate, &IID_IPersistStorage, + (void **)&This->pPSDelegate); + if (FAILED(hr)) goto fail; + + if (This->storage_state == storage_state_initialised) + hr = IPersistStorage_InitNew(This->pPSDelegate, This->storage); + else if (This->storage_state == storage_state_loaded) + hr = IPersistStorage_Load(This->pPSDelegate, This->storage); + if (FAILED(hr)) goto fail; + + if (This->containerApp) + { hr = IOleObject_SetHostNames(This->pOleDelegate, This->containerApp, This->containerObj); + if (FAILED(hr)) goto fail; + } /* FIXME: do more stuff here: * - IOleObject_GetMiscStatus * - IOleObject_GetMoniker - * - IOleCache_OnRun */ - if (SUCCEEDED(hr)) - hr = IOleObject_QueryInterface(This->pOleDelegate, &IID_IDataObject, - (void **)&This->pDataDelegate); + hr = IOleObject_QueryInterface(This->pOleDelegate, &IID_IDataObject, + (void **)&This->pDataDelegate); + if (FAILED(hr)) goto fail; - if (SUCCEEDED(hr) && This->dataAdviseHolder) - hr = DataAdviseHolder_OnConnect(This->dataAdviseHolder, This->pDataDelegate); + This->object_state = object_state_running; - if (FAILED(hr)) + if (This->dataAdviseHolder) { - DefaultHandler_Stop(This); - release_delegates(This); + hr = DataAdviseHolder_OnConnect(This->dataAdviseHolder, This->pDataDelegate); + if (FAILED(hr)) goto fail; } + hr = IUnknown_QueryInterface( This->dataCache, &IID_IOleCacheControl, (void **)&cache_ctrl ); + if (FAILED(hr)) goto fail; + hr = IOleCacheControl_OnRun( cache_ctrl, This->pDataDelegate ); + IOleCacheControl_Release( cache_ctrl ); + if (FAILED(hr)) goto fail; + + return hr; + +fail: + DefaultHandler_Stop(This); return hr; } @@ -1499,10 +1646,15 @@ if (This->oleAdviseHolder) IOleAdviseHolder_SendOnClose(This->oleAdviseHolder); - DefaultHandler_Stop(This); + if(!This->in_call) + DefaultHandler_Stop(This); + else + { + TRACE("OnClose during call. Deferring shutdown\n"); + This->object_state = object_state_deferred_close; + } } - /************************************************************************ * DefaultHandler_IPersistStorage_QueryInterface * @@ -1555,7 +1707,11 @@ TRACE("(%p)->(%p)\n", iface, clsid); if(object_is_running(This)) + { + start_object_call( This ); hr = IPersistStorage_GetClassID(This->pPSDelegate, clsid); + end_object_call( This ); + } else hr = IPersistStorage_GetClassID(This->dataCache_PersistStg, clsid); @@ -1578,7 +1734,11 @@ if(hr != S_FALSE) return hr; if(object_is_running(This)) + { + start_object_call( This ); hr = IPersistStorage_IsDirty(This->pPSDelegate); + end_object_call( This ); + } return hr; } @@ -1662,7 +1822,11 @@ hr = IPersistStorage_InitNew(This->dataCache_PersistStg, pStg); if(SUCCEEDED(hr) && object_is_running(This)) + { + start_object_call( This ); hr = IPersistStorage_InitNew(This->pPSDelegate, pStg); + end_object_call( This ); + } if(SUCCEEDED(hr)) { @@ -1694,7 +1858,11 @@ hr = IPersistStorage_Load(This->dataCache_PersistStg, pStg); if(SUCCEEDED(hr) && object_is_running(This)) + { + start_object_call( This ); hr = IPersistStorage_Load(This->pPSDelegate, pStg); + end_object_call( This ); + } if(SUCCEEDED(hr)) { @@ -1722,7 +1890,11 @@ hr = IPersistStorage_Save(This->dataCache_PersistStg, pStgSave, fSameAsLoad); if(SUCCEEDED(hr) && object_is_running(This)) + { + start_object_call( This ); hr = IPersistStorage_Save(This->pPSDelegate, pStgSave, fSameAsLoad); + end_object_call( This ); + } return hr; } @@ -1744,7 +1916,11 @@ hr = IPersistStorage_SaveCompleted(This->dataCache_PersistStg, pStgNew); if(SUCCEEDED(hr) && object_is_running(This)) + { + start_object_call( This ); hr = IPersistStorage_SaveCompleted(This->pPSDelegate, pStgNew); + end_object_call( This ); + } if(pStgNew) { @@ -1773,7 +1949,11 @@ hr = IPersistStorage_HandsOffStorage(This->dataCache_PersistStg); if(SUCCEEDED(hr) && object_is_running(This)) + { + start_object_call( This ); hr = IPersistStorage_HandsOffStorage(This->pPSDelegate); + end_object_call( This ); + } if(This->storage) IStorage_Release(This->storage); This->storage = NULL; @@ -1954,6 +2134,7 @@ This->pPSDelegate = NULL; This->pDataDelegate = NULL; This->object_state = object_state_not_running; + This->in_call = 0; This->dwAdvConn = 0; This->storage = NULL; @@ -1998,7 +2179,6 @@ /* release delegates */ DefaultHandler_Stop(This); - release_delegates(This); HeapFree( GetProcessHeap(), 0, This->containerApp ); This->containerApp = NULL; diff -Nru wine1.7-1.7.50/dlls/ole32/filemoniker.c wine1.7-1.7.55/dlls/ole32/filemoniker.c --- wine1.7-1.7.50/dlls/ole32/filemoniker.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ole32/filemoniker.c 2015-11-13 14:32:40.000000000 +0000 @@ -500,12 +500,12 @@ /* if the requested class was loaded before ! we don't need to reload it */ res = IRunningObjectTable_GetObject(prot,iface,&pObj); - if (res==S_FALSE){ + if (res != S_OK){ /* first activation of this class */ res=GetClassFile(This->filePathName,&clsID); if (SUCCEEDED(res)){ - res=CoCreateInstance(&clsID,NULL,CLSCTX_ALL,&IID_IPersistFile,(void**)&ppf); + res=CoCreateInstance(&clsID,NULL,CLSCTX_SERVER,&IID_IPersistFile,(void**)&ppf); if (SUCCEEDED(res)){ res=IPersistFile_Load(ppf,This->filePathName,STGM_READ); diff -Nru wine1.7-1.7.50/dlls/ole32/marshal.c wine1.7-1.7.55/dlls/ole32/marshal.c --- wine1.7-1.7.50/dlls/ole32/marshal.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ole32/marshal.c 2015-11-13 14:32:40.000000000 +0000 @@ -122,9 +122,7 @@ struct stub_manager *manager; struct ifstub *ifstub; BOOL tablemarshal; - IRpcStubBuffer *stub = NULL; HRESULT hr; - IUnknown *iobject = NULL; /* object of type riid */ hr = apartment_getoxid(apt, &stdobjref->oxid); if (hr != S_OK) @@ -134,78 +132,57 @@ if (hr != S_OK) return hr; - hr = IUnknown_QueryInterface(object, riid, (void **)&iobject); - if (hr != S_OK) - { - ERR("object doesn't expose interface %s, failing with error 0x%08x\n", - debugstr_guid(riid), hr); - return E_NOINTERFACE; - } - - /* IUnknown doesn't require a stub buffer, because it never goes out on - * the wire */ - if (!IsEqualIID(riid, &IID_IUnknown)) - { - IPSFactoryBuffer *psfb; - - hr = get_facbuf_for_iid(riid, &psfb); - if (hr != S_OK) - { - ERR("couldn't get IPSFactory buffer for interface %s\n", debugstr_guid(riid)); - IUnknown_Release(iobject); - return hr; - } - - hr = IPSFactoryBuffer_CreateStub(psfb, riid, iobject, &stub); - IPSFactoryBuffer_Release(psfb); - if (hr != S_OK) - { - ERR("Failed to create an IRpcStubBuffer from IPSFactory for %s with error 0x%08x\n", - debugstr_guid(riid), hr); - IUnknown_Release(iobject); - return hr; - } - } + if (!(manager = get_stub_manager_from_object(apt, object, TRUE))) + return E_OUTOFMEMORY; stdobjref->flags = SORF_NULL; if (mshlflags & MSHLFLAGS_TABLEWEAK) stdobjref->flags |= SORFP_TABLEWEAK; if (mshlflags & MSHLFLAGS_NOPING) stdobjref->flags |= SORF_NOPING; - - if ((manager = get_stub_manager_from_object(apt, object))) - TRACE("registering new ifstub on pre-existing manager\n"); - else - { - TRACE("constructing new stub manager\n"); - - manager = new_stub_manager(apt, object); - if (!manager) - { - if (stub) IRpcStubBuffer_Release(stub); - IUnknown_Release(iobject); - return E_OUTOFMEMORY; - } - } stdobjref->oid = manager->oid; tablemarshal = ((mshlflags & MSHLFLAGS_TABLESTRONG) || (mshlflags & MSHLFLAGS_TABLEWEAK)); /* make sure ifstub that we are creating is unique */ ifstub = stub_manager_find_ifstub(manager, riid, mshlflags); - if (!ifstub) - ifstub = stub_manager_new_ifstub(manager, stub, iobject, riid, dest_context, dest_context_data, mshlflags); + if (!ifstub) { + IRpcStubBuffer *stub = NULL; - if (stub) IRpcStubBuffer_Release(stub); - IUnknown_Release(iobject); + /* IUnknown doesn't require a stub buffer, because it never goes out on + * the wire */ + if (!IsEqualIID(riid, &IID_IUnknown)) + { + IPSFactoryBuffer *psfb; + + hr = get_facbuf_for_iid(riid, &psfb); + if (hr == S_OK) { + hr = IPSFactoryBuffer_CreateStub(psfb, riid, manager->object, &stub); + IPSFactoryBuffer_Release(psfb); + if (hr != S_OK) + ERR("Failed to create an IRpcStubBuffer from IPSFactory for %s with error 0x%08x\n", + debugstr_guid(riid), hr); + }else { + ERR("couldn't get IPSFactory buffer for interface %s\n", debugstr_guid(riid)); + hr = E_NOINTERFACE; + } - if (!ifstub) - { - stub_manager_int_release(manager); - /* destroy the stub manager if it has no ifstubs by releasing - * zero external references */ - stub_manager_ext_release(manager, 0, FALSE, TRUE); - return E_OUTOFMEMORY; + } + + if (hr == S_OK) { + ifstub = stub_manager_new_ifstub(manager, stub, riid, dest_context, dest_context_data, mshlflags); + if (!ifstub) + hr = E_OUTOFMEMORY; + } + if (stub) IRpcStubBuffer_Release(stub); + + if (hr != S_OK) { + stub_manager_int_release(manager); + /* destroy the stub manager if it has no ifstubs by releasing + * zero external references */ + stub_manager_ext_release(manager, 0, FALSE, TRUE); + return hr; + } } if (!tablemarshal) @@ -1733,7 +1710,7 @@ OBJREF objref; LPMARSHAL pMarshal; - TRACE("(%p, %s, %p, %x, %p)", pStream, debugstr_guid(riid), pUnk, + TRACE("(%p, %s, %p, %x, %p, ", pStream, debugstr_guid(riid), pUnk, dwDestContext, pvDestContext); dump_MSHLFLAGS(mshlFlags); TRACE(")\n"); diff -Nru wine1.7-1.7.50/dlls/ole32/ole2.c wine1.7-1.7.55/dlls/ole32/ole2.c --- wine1.7-1.7.50/dlls/ole32/ole2.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ole32/ole2.c 2015-11-13 14:32:40.000000000 +0000 @@ -171,7 +171,7 @@ /*********************************************************************** * OleInitialize (OLE32.@) */ -HRESULT WINAPI OleInitialize(LPVOID reserved) +HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved) { HRESULT hr; @@ -1235,7 +1235,7 @@ * Success: S_OK. * Failure: Any HRESULT code. */ -HRESULT WINAPI OleRun(LPUNKNOWN pUnknown) +HRESULT WINAPI DECLSPEC_HOTPATCH OleRun(LPUNKNOWN pUnknown) { IRunnableObject *runable; HRESULT hres; @@ -3041,7 +3041,7 @@ hr = PROPVARIANT_ValidateType(pvarSrc->vt); if (FAILED(hr)) - return hr; + return DISP_E_BADVARTYPE; /* this will deal with most cases */ *pvarDest = *pvarSrc; diff -Nru wine1.7-1.7.50/dlls/ole32/ole2impl.c wine1.7-1.7.55/dlls/ole32/ole2impl.c --- wine1.7-1.7.50/dlls/ole32/ole2impl.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ole32/ole2impl.c 2015-11-13 14:32:40.000000000 +0000 @@ -97,7 +97,7 @@ * * FIXME: CF_FILENAME. */ -static HRESULT get_storage(IDataObject *data, IStorage *stg, UINT *src_cf) +static HRESULT get_storage(IDataObject *data, IStorage *stg, UINT *src_cf, BOOL other_fmts) { static const UINT fmt_id[] = { CF_METAFILEPICT, CF_BITMAP, CF_DIB }; UINT i; @@ -107,16 +107,17 @@ IPersistStorage *persist; CLSID clsid; - *src_cf = 0; + if (src_cf) *src_cf = 0; /* CF_EMBEDEDOBJECT */ init_fmtetc(&fmt, embedded_object_clipboard_format, TYMED_ISTORAGE); med.tymed = TYMED_ISTORAGE; med.u.pstg = stg; + med.pUnkForRelease = NULL; hr = IDataObject_GetDataHere(data, &fmt, &med); if(SUCCEEDED(hr)) { - *src_cf = embedded_object_clipboard_format; + if (src_cf) *src_cf = embedded_object_clipboard_format; return hr; } @@ -124,21 +125,25 @@ init_fmtetc(&fmt, embed_source_clipboard_format, TYMED_ISTORAGE); med.tymed = TYMED_ISTORAGE; med.u.pstg = stg; + med.pUnkForRelease = NULL; hr = IDataObject_GetDataHere(data, &fmt, &med); if(SUCCEEDED(hr)) { - *src_cf = embed_source_clipboard_format; + if (src_cf) *src_cf = embed_source_clipboard_format; return hr; } - for (i = 0; i < sizeof(fmt_id)/sizeof(fmt_id[0]); i++) + if (other_fmts) { - init_fmtetc(&fmt, fmt_id[i], TYMED_ISTORAGE); - hr = IDataObject_QueryGetData(data, &fmt); - if(SUCCEEDED(hr)) + for (i = 0; i < sizeof(fmt_id)/sizeof(fmt_id[0]); i++) { - *src_cf = fmt_id[i]; - return hr; + init_fmtetc(&fmt, fmt_id[i], TYMED_ISTORAGE); + hr = IDataObject_QueryGetData(data, &fmt); + if (SUCCEEDED(hr)) + { + if (src_cf) *src_cf = fmt_id[i]; + return hr; + } } } @@ -181,7 +186,7 @@ data, debugstr_guid(iid), flags, renderopt, num_cache_fmts, adv_flags, cache_fmts, sink, conns, client_site, stg, obj); - hr = get_storage(data, stg, &src_cf); + hr = get_storage(data, stg, &src_cf, TRUE); if(FAILED(hr)) return hr; hr = OleLoad(stg, iid, client_site, obj); @@ -233,6 +238,84 @@ } /****************************************************************************** + * OleCreateFromFileEx [OLE32.@] + */ +HRESULT WINAPI OleCreateFromFileEx(REFCLSID clsid, const OLECHAR *filename, REFIID iid, DWORD flags, + DWORD renderopt, ULONG num_fmts, DWORD *adv_flags, FORMATETC *fmts, IAdviseSink *sink, + DWORD *conns, IOleClientSite *client_site, IStorage *stg, void **obj) +{ + HRESULT hr; + IMoniker *mon; + IDataObject *data; + IUnknown *unk = NULL; + IOleCache *cache = NULL; + ULONG i; + + TRACE("cls %s, %s, iid %s, flags %d, render opts %d, num fmts %d, adv flags %p, fmts %p\n", debugstr_guid(clsid), + debugstr_w(filename), debugstr_guid(iid), flags, renderopt, num_fmts, adv_flags, fmts); + TRACE("sink %p, conns %p, client site %p, storage %p, obj %p\n", sink, conns, client_site, stg, obj); + for (i = 0; i < num_fmts; i++) + TRACE("\t%d: fmt %s adv flags %d\n", i, debugstr_formatetc(fmts + i), adv_flags[i]); + + hr = CreateFileMoniker( filename, &mon ); + if (FAILED(hr)) return hr; + + hr = BindMoniker( mon, 0, &IID_IDataObject, (void**)&data ); + IMoniker_Release( mon ); + if (FAILED(hr)) return hr; + + hr = get_storage( data, stg, NULL, FALSE ); + if (FAILED(hr)) goto end; + + hr = OleLoad( stg, &IID_IUnknown, client_site, (void**)&unk ); + if (FAILED(hr)) goto end; + + if (renderopt == OLERENDER_FORMAT) + { + hr = IUnknown_QueryInterface( unk, &IID_IOleCache, (void**)&cache ); + if (FAILED(hr)) goto end; + + for (i = 0; i < num_fmts; i++) + { + STGMEDIUM med; + DWORD dummy_conn; + + memset( &med, 0, sizeof(med) ); + hr = IDataObject_GetData( data, fmts + i, &med ); + if (FAILED(hr)) goto end; + hr = IOleCache_Cache( cache, fmts + i, adv_flags[i], &dummy_conn ); + if (SUCCEEDED(hr)) + hr = IOleCache_SetData( cache, fmts + i, &med, TRUE ); + if (FAILED(hr)) + { + ReleaseStgMedium( &med ); + goto end; + } + } + } + + hr = IUnknown_QueryInterface( unk, iid, obj ); + +end: + if (cache) IOleCache_Release( cache ); + if (unk) IUnknown_Release( unk ); + IDataObject_Release( data ); + return hr; +} + +/****************************************************************************** + * OleCreateFromFile [OLE32.@] + */ +HRESULT WINAPI OleCreateFromFile(REFCLSID clsid, const OLECHAR *filename, REFIID iid, DWORD renderopt, + FORMATETC *fmt, IOleClientSite *client_site, IStorage *storage, void **obj) +{ + DWORD advf = ADVF_PRIMEFIRST; + + return OleCreateFromFileEx(clsid, filename, iid, 0, renderopt, fmt ? 1 : 0, fmt ? &advf : NULL, fmt, + NULL, NULL, client_site, storage, obj); +} + +/****************************************************************************** * OleDuplicateData [OLE32.@] * * Duplicates clipboard data. diff -Nru wine1.7-1.7.50/dlls/ole32/ole2stubs.c wine1.7-1.7.55/dlls/ole32/ole2stubs.c --- wine1.7-1.7.50/dlls/ole32/ole2stubs.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ole32/ole2stubs.c 2015-11-13 14:32:40.000000000 +0000 @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" + #include #include "windef.h" @@ -52,17 +54,6 @@ } /****************************************************************************** - * OleCreateFromFile [OLE32.@] - */ -HRESULT WINAPI OleCreateFromFile(REFCLSID rclsid, LPCOLESTR lpszFileName, REFIID riid, - DWORD renderopt, LPFORMATETC lpFormatEtc, LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, LPVOID* ppvObj) -{ - FIXME("(not shown), stub!\n"); - return E_NOTIMPL; -} - - -/****************************************************************************** * OleGetIconOfClass [OLE32.@] */ HGLOBAL WINAPI OleGetIconOfClass(REFCLSID rclsid, LPOLESTR lpszLabel, BOOL fUseTypeAsLabel) @@ -74,7 +65,7 @@ /*********************************************************************** * OleRegEnumFormatEtc [OLE32.@] */ -HRESULT WINAPI OleRegEnumFormatEtc ( +HRESULT WINAPI DECLSPEC_HOTPATCH OleRegEnumFormatEtc ( REFCLSID clsid, DWORD dwDirection, LPENUMFORMATETC* ppenumFormatetc) diff -Nru wine1.7-1.7.50/dlls/ole32/ole32.spec wine1.7-1.7.55/dlls/ole32/ole32.spec --- wine1.7-1.7.50/dlls/ole32/ole32.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ole32/ole32.spec 2015-11-13 14:32:40.000000000 +0000 @@ -188,8 +188,8 @@ @ stub OleCreateEx @ stdcall OleCreateFromData(ptr ptr long ptr ptr ptr ptr) @ stdcall OleCreateFromDataEx(ptr ptr long long long ptr ptr ptr ptr ptr ptr ptr) -@ stdcall OleCreateFromFile(ptr ptr ptr long ptr ptr ptr ptr) -@ stub OleCreateFromFileEx +@ stdcall OleCreateFromFile(ptr wstr ptr long ptr ptr ptr ptr) +@ stdcall OleCreateFromFileEx(ptr wstr ptr long long long ptr ptr ptr ptr ptr ptr ptr) @ stdcall OleCreateLink(ptr ptr long ptr ptr ptr ptr) @ stub OleCreateLinkEx @ stdcall OleCreateLinkFromData(ptr ptr long ptr ptr ptr ptr) diff -Nru wine1.7-1.7.50/dlls/ole32/rpc.c wine1.7-1.7.55/dlls/ole32/rpc.c --- wine1.7-1.7.50/dlls/ole32/rpc.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ole32/rpc.c 2015-11-13 14:32:40.000000000 +0000 @@ -682,7 +682,7 @@ } RpcBindingInqObject(message_state->binding_handle, &ipid); - hr = ipid_get_dispatch_params(&ipid, &apt, &message_state->params.stub, + hr = ipid_get_dispatch_params(&ipid, &apt, NULL, &message_state->params.stub, &message_state->params.chan, &message_state->params.iid, &message_state->params.iface); @@ -1441,6 +1441,7 @@ static void __RPC_STUB dispatch_rpc(RPC_MESSAGE *msg) { struct dispatch_params *params; + struct stub_manager *stub_manager; APARTMENT *apt; IPID ipid; HRESULT hr; @@ -1456,7 +1457,7 @@ return; } - hr = ipid_get_dispatch_params(&ipid, &apt, ¶ms->stub, ¶ms->chan, + hr = ipid_get_dispatch_params(&ipid, &apt, &stub_manager, ¶ms->stub, ¶ms->chan, ¶ms->iid, ¶ms->iface); if (hr != S_OK) { @@ -1514,6 +1515,7 @@ IRpcStubBuffer_Release(params->stub); HeapFree(GetProcessHeap(), 0, params); + stub_manager_int_release(stub_manager); apartment_release(apt); /* if IRpcStubBuffer_Invoke fails, we should raise an exception to tell @@ -1579,7 +1581,7 @@ } /* stub unregistration */ -void RPC_UnregisterInterface(REFIID riid) +void RPC_UnregisterInterface(REFIID riid, BOOL wait) { struct registered_if *rif; EnterCriticalSection(&csRegIf); @@ -1589,7 +1591,7 @@ { if (!--rif->refs) { - RpcServerUnregisterIf((RPC_IF_HANDLE)&rif->If, NULL, TRUE); + RpcServerUnregisterIf((RPC_IF_HANDLE)&rif->If, NULL, wait); list_remove(&rif->entry); HeapFree(GetProcessHeap(), 0, rif); } diff -Nru wine1.7-1.7.50/dlls/ole32/storage32.c wine1.7-1.7.55/dlls/ole32/storage32.c --- wine1.7-1.7.50/dlls/ole32/storage32.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ole32/storage32.c 2015-11-13 14:32:40.000000000 +0000 @@ -908,6 +908,8 @@ { IEnumSTATSTGImpl* const This = impl_from_IEnumSTATSTG(iface); + TRACE("%p,%s,%p\n", iface, debugstr_guid(riid), ppvObject); + if (ppvObject==0) return E_INVALIDARG; @@ -918,9 +920,11 @@ { *ppvObject = &This->IEnumSTATSTG_iface; IEnumSTATSTG_AddRef(&This->IEnumSTATSTG_iface); + TRACE("<-- %p\n", *ppvObject); return S_OK; } + TRACE("<-- E_NOINTERFACE\n"); return E_NOINTERFACE; } @@ -958,6 +962,8 @@ HRESULT hr; WCHAR result_name[DIRENTRY_NAME_MAX_LEN]; + TRACE("%p,%p\n", This, ref); + hr = StorageBaseImpl_ReadDirEntry(This->parentStorage, This->parentStorage->storageDirEntry, &entry); searchNode = entry.dirRootEntry; @@ -990,6 +996,7 @@ memcpy(This->name, result_name, sizeof(result_name)); } + TRACE("<-- %08x\n", hr); return hr; } @@ -1007,11 +1014,16 @@ DirRef currentSearchNode; HRESULT hr=S_OK; + TRACE("%p,%u,%p,%p\n", iface, celt, rgelt, pceltFetched); + if ( (rgelt==0) || ( (celt!=1) && (pceltFetched==0) ) ) return E_INVALIDARG; if (This->parentStorage->reverted) + { + TRACE("<-- STG_E_REVERTED\n"); return STG_E_REVERTED; + } /* * To avoid the special case, get another pointer to a ULONG value if @@ -1031,14 +1043,18 @@ hr = IEnumSTATSTGImpl_GetNextRef(This, ¤tSearchNode); if (FAILED(hr) || currentSearchNode == DIRENTRY_NULL) + { + memset(currentReturnStruct, 0, sizeof(*currentReturnStruct)); break; + } /* * Read the entry from the storage. */ - StorageBaseImpl_ReadDirEntry(This->parentStorage, + hr = StorageBaseImpl_ReadDirEntry(This->parentStorage, currentSearchNode, ¤tEntry); + if (FAILED(hr)) break; /* * Copy the information to the return buffer. @@ -1058,6 +1074,7 @@ if (SUCCEEDED(hr) && *pceltFetched != celt) hr = S_FALSE; + TRACE("<-- %08x (asked %u, got %u)\n", hr, celt, *pceltFetched); return hr; } @@ -1072,8 +1089,13 @@ DirRef currentSearchNode; HRESULT hr=S_OK; + TRACE("%p,%u\n", iface, celt); + if (This->parentStorage->reverted) + { + TRACE("<-- STG_E_REVERTED\n"); return STG_E_REVERTED; + } while ( (objectFetched < celt) ) { @@ -1088,6 +1110,7 @@ if (SUCCEEDED(hr) && objectFetched != celt) return S_FALSE; + TRACE("<-- %08x\n", hr); return hr; } @@ -1096,8 +1119,13 @@ { IEnumSTATSTGImpl* const This = impl_from_IEnumSTATSTG(iface); + TRACE("%p\n", iface); + if (This->parentStorage->reverted) + { + TRACE("<-- STG_E_REVERTED\n"); return STG_E_REVERTED; + } This->name[0] = 0; @@ -1113,8 +1141,13 @@ IEnumSTATSTGImpl* const This = impl_from_IEnumSTATSTG(iface); IEnumSTATSTGImpl* newClone; + TRACE("%p,%p\n", iface, ppenum); + if (This->parentStorage->reverted) + { + TRACE("<-- STG_E_REVERTED\n"); return STG_E_REVERTED; + } if (ppenum==0) return E_INVALIDARG; @@ -1204,6 +1237,8 @@ { StorageBaseImpl *This = impl_from_IStorage(iface); + TRACE("%p,%s,%p\n", iface, debugstr_guid(riid), ppvObject); + if (!ppvObject) return E_INVALIDARG; @@ -1224,10 +1259,13 @@ *ppvObject = &This->IDirectWriterLock_iface; } else + { + TRACE("<-- E_NOINTERFACE\n"); return E_NOINTERFACE; + } IStorage_AddRef(iface); - + TRACE("<-- %p\n", *ppvObject); return S_OK; } @@ -1410,6 +1448,7 @@ hr = StorageBaseImpl_CopyChildEntryTo( This, data.rightChild, skip_storage, skip_stream, snbExclude, pstgDest ); + TRACE("<-- %08x\n", hr); return hr; } @@ -1417,6 +1456,8 @@ { StgStreamImpl *strm; + TRACE("%p,%d\n", stg, streamEntry); + LIST_FOR_EACH_ENTRY(strm, &stg->strmHead, StgStreamImpl, StrmListEntry) { if (strm->dirEntry == streamEntry) @@ -1432,6 +1473,8 @@ { StorageInternalImpl *childstg; + TRACE("%p,%d\n", stg, storageEntry); + LIST_FOR_EACH_ENTRY(childstg, &stg->storageHead, StorageInternalImpl, ParentListEntry) { if (childstg->base.storageDirEntry == storageEntry) @@ -2236,6 +2279,7 @@ hr = StorageBaseImpl_CopyChildEntryTo( This, data.dirRootEntry, skip_storage, skip_stream, snbExclude, pstgDest ); + TRACE("<-- %08x\n", hr); return hr; } @@ -2392,6 +2436,8 @@ HRESULT destroyHr = S_OK; StorageInternalImpl *stg, *stg2; + TRACE("%p,%d\n", parentStorage, indexToDelete); + /* Invalidate any open storage objects. */ LIST_FOR_EACH_ENTRY_SAFE(stg, stg2, &parentStorage->storageHead, StorageInternalImpl, ParentListEntry) { @@ -2415,6 +2461,7 @@ if (hr != S_OK) { + TRACE("<-- %08x\n", hr); return hr; } @@ -2425,6 +2472,7 @@ if (FAILED(hr)) { IStorage_Release(childStorage); + TRACE("<-- %08x\n", hr); return hr; } @@ -2452,6 +2500,7 @@ IStorage_Release(childStorage); IEnumSTATSTG_Release(elements); + TRACE("%08x\n", hr); return destroyHr; } @@ -2491,6 +2540,7 @@ if (hr!=S_OK) { + TRACE("<-- %08x\n", hr); return(hr); } @@ -2501,6 +2551,7 @@ if(hr != S_OK) { + TRACE("<-- %08x\n", hr); return hr; } @@ -2508,7 +2559,7 @@ * Release the stream object. */ IStream_Release(pis); - + TRACE("<-- %08x\n", hr); return S_OK; } @@ -2554,6 +2605,7 @@ if ( entryToDeleteRef == DIRENTRY_NULL ) { + TRACE("<-- STG_E_FILENOTFOUND\n"); return STG_E_FILENOTFOUND; } @@ -2573,7 +2625,10 @@ } if (hr!=S_OK) + { + TRACE("<-- %08x\n", hr); return hr; + } /* * Remove the entry from its parent storage @@ -2592,6 +2647,7 @@ if (SUCCEEDED(hr)) hr = StorageBaseImpl_Flush(This); + TRACE("<-- %08x\n", hr); return hr; } @@ -6030,6 +6086,7 @@ StorageBaseImpl_UnlockTransaction(This->transactedParent, TRUE); } + TRACE("<-- %08x\n", hr); return hr; } @@ -6136,7 +6193,11 @@ TRACE("%x %s l=%x r=%x d=%x\n", index, debugstr_w(data->name), data->leftChild, data->rightChild, data->dirRootEntry); hr = TransactedSnapshotImpl_EnsureReadEntry(This, index); - if (FAILED(hr)) return hr; + if (FAILED(hr)) + { + TRACE("<-- %08x\n", hr); + return hr; + } memcpy(&This->entries[index].data, data, sizeof(DirEntry)); @@ -6158,7 +6219,7 @@ This->entries[index].transactedParentEntry = This->entries[index].newTransactedParentEntry = DIRENTRY_NULL; } } - + TRACE("<-- S_OK\n"); return S_OK; } @@ -6169,7 +6230,11 @@ HRESULT hr; hr = TransactedSnapshotImpl_EnsureReadEntry(This, index); - if (FAILED(hr)) return hr; + if (FAILED(hr)) + { + TRACE("<-- %08x\n", hr); + return hr; + } memcpy(data, &This->entries[index].data, sizeof(DirEntry)); @@ -6231,10 +6296,18 @@ HRESULT hr; hr = TransactedSnapshotImpl_EnsureReadEntry(This, index); - if (FAILED(hr)) return hr; + if (FAILED(hr)) + { + TRACE("<-- %08x\n", hr); + return hr; + } hr = TransactedSnapshotImpl_MakeStreamDirty(This, index); - if (FAILED(hr)) return hr; + if (FAILED(hr)) + { + TRACE("<-- %08x\n", hr); + return hr; + } hr = StorageBaseImpl_StreamWriteAt(This->scratch, This->entries[index].stream_entry, offset, size, buffer, bytesWritten); @@ -6244,6 +6317,7 @@ This->entries[index].data.size.QuadPart, offset.QuadPart + size); + TRACE("<-- %08x\n", hr); return hr; } @@ -6254,7 +6328,11 @@ HRESULT hr; hr = TransactedSnapshotImpl_EnsureReadEntry(This, index); - if (FAILED(hr)) return hr; + if (FAILED(hr)) + { + TRACE("<-- %08x\n", hr); + return hr; + } if (This->entries[index].data.size.QuadPart == newsize.QuadPart) return S_OK; @@ -6295,6 +6373,7 @@ if (SUCCEEDED(hr)) This->entries[index].data.size = newsize; + TRACE("<-- %08x\n", hr); return hr; } @@ -6306,10 +6385,18 @@ TransactedDirEntry *dst_entry, *src_entry; hr = TransactedSnapshotImpl_EnsureReadEntry(This, src); - if (FAILED(hr)) return hr; + if (FAILED(hr)) + { + TRACE("<-- %08x\n", hr); + return hr; + } hr = TransactedSnapshotImpl_EnsureReadEntry(This, dst); - if (FAILED(hr)) return hr; + if (FAILED(hr)) + { + TRACE("<-- %08x\n", hr); + return hr; + } dst_entry = &This->entries[dst]; src_entry = &This->entries[src]; @@ -6664,7 +6751,7 @@ This->lastTransactionSig = transactionSig+1; } } - + TRACE("<-- %08x\n", hr); return hr; } diff -Nru wine1.7-1.7.50/dlls/ole32/stubmanager.c wine1.7-1.7.55/dlls/ole32/stubmanager.c --- wine1.7-1.7.50/dlls/ole32/stubmanager.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ole32/stubmanager.c 2015-11-13 14:32:40.000000000 +0000 @@ -36,6 +36,8 @@ #include "rpc.h" #include "wine/debug.h" +#include "wine/exception.h" + #include "compobj_private.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); @@ -65,21 +67,28 @@ } /* registers a new interface stub COM object with the stub manager and returns registration record */ -struct ifstub *stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *sb, IUnknown *iptr, REFIID iid, DWORD dest_context, +struct ifstub *stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *sb, REFIID iid, DWORD dest_context, void *dest_context_data, MSHLFLAGS flags) { struct ifstub *stub; HRESULT hr; - TRACE("oid=%s, stubbuffer=%p, iptr=%p, iid=%s\n", - wine_dbgstr_longlong(m->oid), sb, iptr, debugstr_guid(iid)); + TRACE("oid=%s, stubbuffer=%p, iid=%s\n", wine_dbgstr_longlong(m->oid), sb, debugstr_guid(iid)); stub = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct ifstub)); if (!stub) return NULL; + hr = IUnknown_QueryInterface(m->object, iid, (void **)&stub->iface); + if (hr != S_OK) + { + HeapFree(GetProcessHeap(), 0, stub); + return NULL; + } + hr = RPC_CreateServerChannel(dest_context, dest_context_data, &stub->chan); if (hr != S_OK) { + IUnknown_Release(stub->iface); HeapFree(GetProcessHeap(), 0, stub); return NULL; } @@ -87,8 +96,6 @@ stub->stubbuffer = sb; if (sb) IRpcStubBuffer_AddRef(sb); - IUnknown_AddRef(iptr); - stub->iface = iptr; stub->flags = flags; stub->iid = *iid; @@ -116,7 +123,8 @@ list_remove(&ifstub->entry); - RPC_UnregisterInterface(&ifstub->iid); + if (!m->disconnected) + RPC_UnregisterInterface(&ifstub->iid, TRUE); if (ifstub->stubbuffer) IRpcStubBuffer_Release(ifstub->stubbuffer); IUnknown_Release(ifstub->iface); @@ -168,7 +176,7 @@ /* creates a new stub manager and adds it into the apartment. caller must * release stub manager when it is no longer required. the apartment and * external refs together take one implicit ref */ -struct stub_manager *new_stub_manager(APARTMENT *apt, IUnknown *object) +static struct stub_manager *new_stub_manager(APARTMENT *apt, IUnknown *object) { struct stub_manager *sm; HRESULT hres; @@ -216,6 +224,7 @@ * the marshalled ifptr. */ sm->extrefs = 0; + sm->disconnected = FALSE; hres = IUnknown_QueryInterface(object, &IID_IExternalConnection, (void**)&sm->extern_conn); if(FAILED(hres)) @@ -231,6 +240,21 @@ return sm; } +void stub_manager_disconnect(struct stub_manager *m) +{ + struct ifstub *ifstub; + + EnterCriticalSection(&m->lock); + if (!m->disconnected) + { + LIST_FOR_EACH_ENTRY(ifstub, &m->ifstubs, struct ifstub, entry) + RPC_UnregisterInterface(&ifstub->iid, FALSE); + + m->disconnected = TRUE; + } + LeaveCriticalSection(&m->lock); +} + /* caller must remove stub manager from apartment prior to calling this function */ static void stub_manager_delete(struct stub_manager *m) { @@ -249,7 +273,18 @@ IExternalConnection_Release(m->extern_conn); CoTaskMemFree(m->oxid_info.psa); - IUnknown_Release(m->object); + + /* Some broken apps crash in object destructors. We have a test showing + * that on winxp+ those crashes are caught and ignored. */ + __TRY + { + IUnknown_Release(m->object); + } + __EXCEPT_PAGE_FAULT + { + ERR("Got page fault when releasing stub!\n"); + } + __ENDTRY DEBUG_CLEAR_CRITSEC_NAME(&m->lock); DeleteCriticalSection(&m->lock); @@ -298,10 +333,18 @@ /* gets the stub manager associated with an object - caller must have * a reference to the apartment while a reference to the stub manager is held. * it must also call release on the stub manager when it is no longer needed */ -struct stub_manager *get_stub_manager_from_object(APARTMENT *apt, void *object) +struct stub_manager *get_stub_manager_from_object(APARTMENT *apt, IUnknown *obj, BOOL alloc) { struct stub_manager *result = NULL; struct list *cursor; + IUnknown *object; + HRESULT hres; + + hres = IUnknown_QueryInterface(obj, &IID_IUnknown, (void**)&object); + if (FAILED(hres)) { + ERR("QueryInterface(IID_IUnknown failed): %08x\n", hres); + return NULL; + } EnterCriticalSection(&apt->cs); LIST_FOR_EACH( cursor, &apt->stubmgrs ) @@ -317,37 +360,17 @@ } LeaveCriticalSection(&apt->cs); - if (result) + if (result) { TRACE("found %p for object %p\n", result, object); - else + }else if (alloc) { + TRACE("not found, creating new stub manager...\n"); + result = new_stub_manager(apt, object); + }else { TRACE("not found for object %p\n", object); - - return result; -} - -/* removes the apartment reference to an object, destroying it when no other - * threads have a reference to it */ -void apartment_disconnectobject(struct apartment *apt, void *object) -{ - BOOL found = FALSE; - struct stub_manager *stubmgr; - - EnterCriticalSection(&apt->cs); - LIST_FOR_EACH_ENTRY( stubmgr, &apt->stubmgrs, struct stub_manager, entry ) - { - if (stubmgr->object == object) - { - found = TRUE; - stub_manager_int_release(stubmgr); - break; - } } - LeaveCriticalSection(&apt->cs); - if (found) - TRACE("disconnect object %p\n", object); - else - WARN("couldn't find object %p\n", object); + IUnknown_Release(object); + return result; } /* gets the stub manager associated with an object id - caller must have @@ -500,6 +523,7 @@ * release the references to all objects (except iface) if the function * returned success, otherwise no references are returned. */ HRESULT ipid_get_dispatch_params(const IPID *ipid, APARTMENT **stub_apt, + struct stub_manager **manager, IRpcStubBuffer **stub, IRpcChannelBuffer **chan, IID *iid, IUnknown **iface) { @@ -522,7 +546,10 @@ *iid = ifstub->iid; *iface = ifstub->iface; - stub_manager_int_release(stubmgr); + if (manager) + *manager = stubmgr; + else + stub_manager_int_release(stubmgr); return S_OK; } else @@ -640,7 +667,8 @@ return S_OK; } - FIXME("No interface for iid %s\n", debugstr_guid(riid)); + if (!IsEqualIID(riid, &IID_IExternalConnection)) + FIXME("No interface for iid %s\n", debugstr_guid(riid)); *ppv = NULL; return E_NOINTERFACE; diff -Nru wine1.7-1.7.50/dlls/ole32/tests/compobj.c wine1.7-1.7.55/dlls/ole32/tests/compobj.c --- wine1.7-1.7.50/dlls/ole32/tests/compobj.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ole32/tests/compobj.c 2015-11-13 14:32:40.000000000 +0000 @@ -37,6 +37,32 @@ #include "wine/test.h" +#define DEFINE_EXPECT(func) \ + static BOOL expect_ ## func = FALSE, called_ ## func = FALSE + +#define SET_EXPECT(func) \ + expect_ ## func = TRUE + +#define CHECK_EXPECT2(func) \ + do { \ + ok(expect_ ##func, "unexpected call " #func "\n"); \ + called_ ## func = TRUE; \ + }while(0) + +#define CHECK_EXPECT(func) \ + do { \ + CHECK_EXPECT2(func); \ + expect_ ## func = FALSE; \ + }while(0) + +#define CHECK_CALLED(func) \ + do { \ + ok(called_ ## func, "expected " #func "\n"); \ + expect_ ## func = called_ ## func = FALSE; \ + }while(0) + +DEFINE_EXPECT(CreateStub); + /* functions that are not present on all versions of Windows */ static HRESULT (WINAPI * pCoInitializeEx)(LPVOID lpReserved, DWORD dwCoInit); static HRESULT (WINAPI * pCoGetObjectContext)(REFIID riid, LPVOID *ppv); @@ -126,6 +152,7 @@ return 1; /* non-heap-based object */ } +static IID create_instance_iid; static HRESULT WINAPI Test_IClassFactory_CreateInstance( LPCLASSFACTORY iface, IUnknown *pUnkOuter, @@ -133,6 +160,7 @@ LPVOID *ppvObj) { *ppvObj = NULL; + create_instance_iid = *riid; if (pUnkOuter) return CLASS_E_NOAGGREGATION; return E_NOINTERFACE; } @@ -763,6 +791,30 @@ CoUninitialize(); } +static void test_CoCreateInstanceEx(void) +{ + MULTI_QI qi_res = { &IID_IMoniker }; + DWORD cookie; + HRESULT hr; + + CoInitialize(NULL); + + hr = CoRegisterClassObject(&CLSID_WineOOPTest, (IUnknown *)&Test_ClassFactory, + CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, &cookie); + ok_ole_success(hr, "CoRegisterClassObject"); + + create_instance_iid = IID_NULL; + hr = CoCreateInstanceEx(&CLSID_WineOOPTest, NULL, CLSCTX_INPROC_SERVER, NULL, 1, &qi_res); + ok(hr == E_NOINTERFACE, "CoCreateInstanceEx failed: %08x\n", hr); + ok(IsEqualGUID(&create_instance_iid, qi_res.pIID), "Unexpected CreateInstance iid %s\n", + wine_dbgstr_guid(&create_instance_iid)); + + hr = CoRevokeClassObject(cookie); + ok_ole_success(hr, "CoRevokeClassObject"); + + CoUninitialize(); +} + static ATOM register_dummy_class(void) { WNDCLASSA wc = @@ -903,6 +955,59 @@ CoUninitialize(); } +static IUnknown Test_Unknown; + +static HRESULT WINAPI EnumOLEVERB_QueryInterface(IEnumOLEVERB *iface, REFIID riid, void **ppv) +{ + return IUnknown_QueryInterface(&Test_Unknown, riid, ppv); +} + +static ULONG WINAPI EnumOLEVERB_AddRef(IEnumOLEVERB *iface) +{ + return 2; +} + +static ULONG WINAPI EnumOLEVERB_Release(IEnumOLEVERB *iface) +{ + return 1; +} + +static HRESULT WINAPI EnumOLEVERB_Next(IEnumOLEVERB *iface, ULONG celt, OLEVERB *rgelt, ULONG *fetched) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI EnumOLEVERB_Skip(IEnumOLEVERB *iface, ULONG celt) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI EnumOLEVERB_Reset(IEnumOLEVERB *iface) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI EnumOLEVERB_Clone(IEnumOLEVERB *iface, IEnumOLEVERB **ppenum) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static const IEnumOLEVERBVtbl EnumOLEVERBVtbl = { + EnumOLEVERB_QueryInterface, + EnumOLEVERB_AddRef, + EnumOLEVERB_Release, + EnumOLEVERB_Next, + EnumOLEVERB_Skip, + EnumOLEVERB_Reset, + EnumOLEVERB_Clone +}; + +static IEnumOLEVERB EnumOLEVERB = { &EnumOLEVERBVtbl }; + static HRESULT WINAPI Test_IUnknown_QueryInterface( IUnknown *iface, REFIID riid, @@ -910,16 +1015,17 @@ { if (ppvObj == NULL) return E_POINTER; - if (IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IWineTest)) - { + if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IWineTest)) { *ppvObj = iface; - IUnknown_AddRef(iface); - return S_OK; + }else if(IsEqualIID(riid, &IID_IEnumOLEVERB)) { + *ppvObj = &EnumOLEVERB; + }else { + *ppvObj = NULL; + return E_NOINTERFACE; } - *ppvObj = NULL; - return E_NOINTERFACE; + IUnknown_AddRef((IUnknown*)*ppvObj); + return S_OK; } static ULONG WINAPI Test_IUnknown_AddRef(IUnknown *iface) @@ -941,6 +1047,8 @@ static IUnknown Test_Unknown = { &TestUnknown_Vtbl }; +static IPSFactoryBuffer *ps_factory_buffer; + static HRESULT WINAPI PSFactoryBuffer_QueryInterface( IPSFactoryBuffer * This, /* [in] */ REFIID riid, @@ -984,7 +1092,13 @@ /* [unique][in] */ IUnknown *pUnkServer, /* [out] */ IRpcStubBuffer **ppStub) { - return E_NOTIMPL; + CHECK_EXPECT(CreateStub); + + ok(pUnkServer == (IUnknown*)&Test_Unknown, "unexpected pUnkServer %p\n", pUnkServer); + if(!ps_factory_buffer) + return E_NOTIMPL; + + return IPSFactoryBuffer_CreateStub(ps_factory_buffer, &IID_IEnumOLEVERB, pUnkServer, ppStub); } static IPSFactoryBufferVtbl PSFactoryBufferVtbl = @@ -1028,9 +1142,31 @@ hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); ok_ole_success(hr, "CreateStreamOnHGlobal"); + SET_EXPECT(CreateStub); hr = CoMarshalInterface(stream, &IID_IWineTest, &Test_Unknown, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); ok(hr == E_NOTIMPL, "CoMarshalInterface should have returned E_NOTIMPL instead of 0x%08x\n", hr); + CHECK_CALLED(CreateStub); + + hr = CoGetPSClsid(&IID_IEnumOLEVERB, &clsid); + ok_ole_success(hr, "CoGetPSClsid"); + + hr = CoGetClassObject(&clsid, CLSCTX_INPROC_SERVER, NULL, &IID_IPSFactoryBuffer, (void **)&ps_factory_buffer); + ok_ole_success(hr, "CoGetClassObject"); + + hr = CoRegisterPSClsid(&IID_IEnumOLEVERB, &CLSID_WineTestPSFactoryBuffer); + ok_ole_success(hr, "CoRegisterPSClsid"); + + SET_EXPECT(CreateStub); + hr = CoMarshalInterface(stream, &IID_IEnumOLEVERB, (IUnknown*)&EnumOLEVERB, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); + ok(hr == S_OK, "CoMarshalInterface should have returned E_NOTIMPL instead of 0x%08x\n", hr); + CHECK_CALLED(CreateStub); + + hr = CoMarshalInterface(stream, &IID_IEnumOLEVERB, &Test_Unknown, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); + ok(hr == S_OK, "CoMarshalInterface should have returned E_NOTIMPL instead of 0x%08x\n", hr); + IStream_Release(stream); + IPSFactoryBuffer_Release(ps_factory_buffer); + ps_factory_buffer = NULL; hr = CoRevokeClassObject(dwRegistrationKey); ok_ole_success(hr, "CoRevokeClassObject"); @@ -2526,6 +2662,7 @@ test_CoCreateInstance(); test_ole_menu(); test_CoGetClassObject(); + test_CoCreateInstanceEx(); test_CoRegisterMessageFilter(); test_CoRegisterPSClsid(); test_CoGetPSClsid(); diff -Nru wine1.7-1.7.50/dlls/ole32/tests/marshal.c wine1.7-1.7.55/dlls/ole32/tests/marshal.c --- wine1.7-1.7.50/dlls/ole32/tests/marshal.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ole32/tests/marshal.c 2015-11-13 14:32:40.000000000 +0000 @@ -195,6 +195,24 @@ static IUnknown Test_Unknown = { &TestUnknown_Vtbl }; +static ULONG WINAPI TestCrash_IUnknown_Release(LPUNKNOWN iface) +{ + UnlockModule(); + if(!cLocks) { + trace("crashing...\n"); + *(int**)0xc = 0; + } + return 1; /* non-heap-based object */ +} + +static const IUnknownVtbl TestCrashUnknown_Vtbl = +{ + Test_IUnknown_QueryInterface, + Test_IUnknown_AddRef, + TestCrash_IUnknown_Release, +}; + +static IUnknown TestCrash_Unknown = { &TestCrashUnknown_Vtbl }; static HRESULT WINAPI Test_IClassFactory_QueryInterface( LPCLASSFACTORY iface, @@ -1082,6 +1100,63 @@ end_host_object(host_tid, host_thread); } +static BOOL crash_thread_success; + +static DWORD CALLBACK crash_couninitialize_proc(void *p) +{ + IStream *stream; + HRESULT hr; + + cLocks = 0; + + CoInitialize(NULL); + + hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); + ok_ole_success(hr, CreateStreamOnHGlobal); + + hr = CoMarshalInterface(stream, &IID_IUnknown, &TestCrash_Unknown, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); + ok_ole_success(hr, CoMarshalInterface); + + IStream_Seek(stream, ullZero, STREAM_SEEK_SET, NULL); + + hr = CoReleaseMarshalData(stream); + ok_ole_success(hr, CoReleaseMarshalData); + + ok_no_locks(); + + hr = CoMarshalInterface(stream, &IID_IUnknown, &TestCrash_Unknown, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); + ok_ole_success(hr, CoMarshalInterface); + + ok_more_than_one_lock(); + + trace("CoUninitialize >>>\n"); + CoUninitialize(); + trace("CoUninitialize <<<\n"); + + ok_no_locks(); + + IStream_Release(stream); + crash_thread_success = TRUE; + return 0; +} + +static void test_crash_couninitialize(void) +{ + HANDLE thread; + DWORD tid; + + if(!GetProcAddress(GetModuleHandleA("kernel32.dll"), "CreateActCtxW")) { + win_skip("Skipping crash tests on win2k.\n"); + return; + } + + crash_thread_success = FALSE; + thread = CreateThread(NULL, 0, crash_couninitialize_proc, NULL, 0, &tid); + ok(!WaitForSingleObject(thread, 10000), "wait timed out\n"); + CloseHandle(thread); + ok(crash_thread_success, "Crash thread failed\n"); +} + /* tests success case of a same-thread table-weak marshal, unmarshal, unmarshal */ static void test_tableweak_marshal_and_unmarshal_twice(void) { @@ -2852,6 +2927,63 @@ static HWND hwnd_app; +struct local_server +{ + IPersist IPersist_iface; /* a nice short interface */ +}; + +static HRESULT WINAPI local_server_QueryInterface(IPersist *iface, REFIID iid, void **obj) +{ + *obj = NULL; + + if (IsEqualGUID(iid, &IID_IUnknown) || + IsEqualGUID(iid, &IID_IPersist)) + *obj = iface; + + if (*obj) + { + IPersist_AddRef(iface); + return S_OK; + } + return E_NOINTERFACE; +} + +static ULONG WINAPI local_server_AddRef(IPersist *iface) +{ + return 2; +} + +static ULONG WINAPI local_server_Release(IPersist *iface) +{ + return 1; +} + +static HRESULT WINAPI local_server_GetClassID(IPersist *iface, CLSID *clsid) +{ + HRESULT hr; + + *clsid = IID_IUnknown; + + /* Test calling CoDisconnectObject within a COM call */ + hr = CoDisconnectObject((IUnknown *)iface, 0); + ok(hr == S_OK, "got %08x\n", hr); + + return S_OK; +} + +static const IPersistVtbl local_server_persist_vtbl = +{ + local_server_QueryInterface, + local_server_AddRef, + local_server_Release, + local_server_GetClassID +}; + +struct local_server local_server_class = +{ + {&local_server_persist_vtbl} +}; + static HRESULT WINAPI TestOOP_IClassFactory_QueryInterface( LPCLASSFACTORY iface, REFIID riid, @@ -2886,12 +3018,12 @@ REFIID riid, LPVOID *ppvObj) { - if (IsEqualIID(riid, &IID_IClassFactory) || IsEqualIID(riid, &IID_IUnknown)) - { - *ppvObj = iface; - return S_OK; - } - return CLASS_E_CLASSNOTAVAILABLE; + IPersist *persist = &local_server_class.IPersist_iface; + HRESULT hr; + IPersist_AddRef( persist ); + hr = IPersist_QueryInterface( persist, riid, ppvObj ); + IPersist_Release( persist ); + return hr; } static HRESULT WINAPI TestOOP_IClassFactory_LockServer( @@ -2921,24 +3053,25 @@ DWORD cookie; HRESULT hr; HANDLE ready_event; - HANDLE quit_event; DWORD wait; + HANDLE handles[2]; heventShutdown = CreateEventA(NULL, TRUE, FALSE, NULL); + ready_event = CreateEventA(NULL, FALSE, FALSE, "Wine COM Test Ready Event"); + handles[0] = CreateEventA(NULL, FALSE, FALSE, "Wine COM Test Quit Event"); + handles[1] = CreateEventA(NULL, FALSE, FALSE, "Wine COM Test Repeat Event"); +again: hr = CoRegisterClassObject(&CLSID_WineOOPTest, (IUnknown *)&TestOOP_ClassFactory, CLSCTX_LOCAL_SERVER, REGCLS_SINGLEUSE, &cookie); ok_ole_success(hr, CoRegisterClassObject); - ready_event = CreateEventA(NULL, FALSE, FALSE, "Wine COM Test Ready Event"); SetEvent(ready_event); - quit_event = CreateEventA(NULL, FALSE, FALSE, "Wine COM Test Quit Event"); - do { - wait = MsgWaitForMultipleObjects(1, &quit_event, FALSE, 30000, QS_ALLINPUT); - if (wait == WAIT_OBJECT_0+1) + wait = MsgWaitForMultipleObjects(2, handles, FALSE, 30000, QS_ALLINPUT); + if (wait == WAIT_OBJECT_0+2) { MSG msg; @@ -2949,12 +3082,20 @@ DispatchMessageA(&msg); } } + else if (wait == WAIT_OBJECT_0+1) + { + hr = CoRevokeClassObject(cookie); + ok_ole_success(hr, CoRevokeClassObject); + goto again; + } } - while (wait == WAIT_OBJECT_0+1); + while (wait == WAIT_OBJECT_0+2); ok( wait == WAIT_OBJECT_0, "quit event wait timed out\n" ); hr = CoRevokeClassObject(cookie); ok_ole_success(hr, CoRevokeClassObject); + CloseHandle(handles[0]); + CloseHandle(handles[1]); } static HANDLE create_target_process(const char *arg) @@ -2969,7 +3110,7 @@ pi.hThread = NULL; pi.hProcess = NULL; winetest_get_mainargs( &argv ); - sprintf(cmdline, "%s %s %s", argv[0], argv[1], arg); + sprintf(cmdline, "\"%s\" %s %s", argv[0], argv[1], arg); ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); ok(ret, "CreateProcess failed with error: %u\n", GetLastError()); if (pi.hThread) CloseHandle(pi.hThread); @@ -2982,10 +3123,13 @@ DWORD cookie; HRESULT hr; IClassFactory * cf; + IPersist *persist; DWORD ret; HANDLE process; HANDLE quit_event; HANDLE ready_event; + HANDLE repeat_event; + CLSID clsid; heventShutdown = CreateEventA(NULL, TRUE, FALSE, NULL); @@ -3052,16 +3196,30 @@ ready_event = CreateEventA(NULL, FALSE, FALSE, "Wine COM Test Ready Event"); ok( !WaitForSingleObject(ready_event, 10000), "wait timed out\n" ); - CloseHandle(ready_event); - hr = CoCreateInstance(&CLSID_WineOOPTest, NULL, CLSCTX_LOCAL_SERVER, &IID_IClassFactory, (void **)&cf); + hr = CoCreateInstance(&CLSID_WineOOPTest, NULL, CLSCTX_LOCAL_SERVER, &IID_IPersist, (void **)&persist); ok_ole_success(hr, CoCreateInstance); - IClassFactory_Release(cf); + IPersist_Release(persist); - hr = CoCreateInstance(&CLSID_WineOOPTest, NULL, CLSCTX_LOCAL_SERVER, &IID_IClassFactory, (void **)&cf); + hr = CoCreateInstance(&CLSID_WineOOPTest, NULL, CLSCTX_LOCAL_SERVER, &IID_IPersist, (void **)&persist); ok(hr == REGDB_E_CLASSNOTREG, "Second CoCreateInstance on REGCLS_SINGLEUSE object should have failed\n"); + /* Re-register the class and try calling CoDisconnectObject from within a call to that object */ + repeat_event = CreateEventA(NULL, FALSE, FALSE, "Wine COM Test Repeat Event"); + SetEvent(repeat_event); + CloseHandle(repeat_event); + + ok( !WaitForSingleObject(ready_event, 10000), "wait timed out\n" ); + CloseHandle(ready_event); + + hr = CoCreateInstance(&CLSID_WineOOPTest, NULL, CLSCTX_LOCAL_SERVER, &IID_IPersist, (void **)&persist); + ok_ole_success(hr, CoCreateInstance); + + /* GetClassID will call CoDisconnectObject */ + IPersist_GetClassID(persist, &clsid); + IPersist_Release(persist); + quit_event = CreateEventA(NULL, FALSE, FALSE, "Wine COM Test Quit Event"); SetEvent(quit_event); @@ -3549,6 +3707,7 @@ test_globalinterfacetable(); test_manualresetevent(); + test_crash_couninitialize(); /* must be last test as channel hooks can't be unregistered */ test_channel_hook(); diff -Nru wine1.7-1.7.50/dlls/ole32/tests/ole2.c wine1.7-1.7.55/dlls/ole32/tests/ole2.c --- wine1.7-1.7.50/dlls/ole32/tests/ole2.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ole32/tests/ole2.c 2015-11-13 14:32:40.000000000 +0000 @@ -26,6 +26,7 @@ #include "windef.h" #include "winbase.h" +#include "wingdi.h" #include "objbase.h" #include "shlguid.h" @@ -115,6 +116,32 @@ static UINT cf_test_1, cf_test_2, cf_test_3; +/**************************************************************************** + * PresentationDataHeader + * + * This structure represents the header of the \002OlePresXXX stream in + * the OLE object storage. + */ +typedef struct PresentationDataHeader +{ + /* clipformat: + * - standard clipformat: + * DWORD length = 0xffffffff; + * DWORD cfFormat; + * - or custom clipformat: + * DWORD length; + * CHAR format_name[length]; (null-terminated) + */ + DWORD unknown3; /* 4, possibly TYMED_ISTREAM */ + DVASPECT dvAspect; + DWORD lindex; + DWORD tymed; + DWORD unknown7; /* 0 */ + DWORD dwObjectExtentX; + DWORD dwObjectExtentY; + DWORD dwSize; +} PresentationDataHeader; + #define CHECK_EXPECTED_METHOD(method_name) \ do { \ trace("%s\n", method_name); \ @@ -1042,6 +1069,7 @@ { HRESULT hr; IOleObject *pObject; + DWORD fmt; static const struct expected_method methods_oleload[] = { @@ -1099,6 +1127,105 @@ IOleObject_Release(pObject); CHECK_NO_EXTRA_METHODS(); } + + for (fmt = CF_TEXT; fmt < CF_MAX; fmt++) + { + static const WCHAR olrepres[] = { 2,'O','l','e','P','r','e','s','0','0','0',0 }; + IStorage *stg; + IStream *stream; + IUnknown *obj; + DWORD data, i, tymed, data_size; + PresentationDataHeader header; + HDC hdc; + HGDIOBJ hobj; + RECT rc; + char buf[256]; + + for (i = 0; i < 7; i++) + { + hr = StgCreateDocfile(NULL, STGM_READWRITE | STGM_CREATE | STGM_SHARE_EXCLUSIVE | STGM_DELETEONRELEASE, 0, &stg); + ok(hr == S_OK, "StgCreateDocfile error %#x\n", hr); + + hr = IStorage_SetClass(stg, &CLSID_WineTest); + ok(hr == S_OK, "SetClass error %#x\n", hr); + + hr = IStorage_CreateStream(stg, olrepres, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, 0, &stream); + ok(hr == S_OK, "CreateStream error %#x\n", hr); + + data = ~0; + hr = IStream_Write(stream, &data, sizeof(data), NULL); + ok(hr == S_OK, "Write error %#x\n", hr); + + data = fmt; + hr = IStream_Write(stream, &data, sizeof(data), NULL); + ok(hr == S_OK, "Write error %#x\n", hr); + + switch (fmt) + { + case CF_BITMAP: + /* FIXME: figure out stream format */ + hobj = CreateBitmap(1, 1, 1, 1, NULL); + data_size = GetBitmapBits(hobj, sizeof(buf), buf); + DeleteObject(hobj); + break; + + case CF_METAFILEPICT: + case CF_ENHMETAFILE: + hdc = CreateMetaFileA(NULL); + hobj = CloseMetaFile(hdc); + data_size = GetMetaFileBitsEx(hobj, sizeof(buf), buf); + DeleteMetaFile(hobj); + break; + + default: + data_size = sizeof(buf); + memset(buf, 'A', sizeof(buf)); + break; + } + + tymed = 1 << i; + + header.unknown3 = 4; + header.dvAspect = DVASPECT_CONTENT; + header.lindex = -1; + header.tymed = tymed; + header.unknown7 = 0; + header.dwObjectExtentX = 1; + header.dwObjectExtentY = 1; + header.dwSize = data_size; + hr = IStream_Write(stream, &header, sizeof(header), NULL); + ok(hr == S_OK, "Write error %#x\n", hr); + + hr = IStream_Write(stream, buf, data_size, NULL); + ok(hr == S_OK, "Write error %#x\n", hr); + + IStream_Release(stream); + + hr = OleLoad(stg, &IID_IUnknown, NULL, (void **)&obj); + /* FIXME: figure out stream format */ + if (fmt == CF_BITMAP && hr != S_OK) + { + IStorage_Release(stg); + continue; + } + ok(hr == S_OK, "OleLoad error %#x: cfFormat = %u, tymed = %u\n", hr, fmt, tymed); + + hdc = CreateCompatibleDC(0); + SetRect(&rc, 0, 0, 100, 100); + hr = OleDraw(obj, DVASPECT_CONTENT, hdc, &rc); + DeleteDC(hdc); + if (fmt == CF_METAFILEPICT) + ok(hr == S_OK, "OleDraw error %#x: cfFormat = %u, tymed = %u\n", hr, fmt, tymed); + else if (fmt == CF_ENHMETAFILE) +todo_wine + ok(hr == S_OK, "OleDraw error %#x: cfFormat = %u, tymed = %u\n", hr, fmt, tymed); + else + ok(hr == OLE_E_BLANK || hr == OLE_E_NOTRUNNING || hr == E_FAIL, "OleDraw should fail: %#x, cfFormat = %u, tymed = %u\n", hr, fmt, header.tymed); + + IUnknown_Release(obj); + IStorage_Release(stg); + } + } } static BOOL STDMETHODCALLTYPE draw_continue(ULONG_PTR param) @@ -1933,7 +2060,6 @@ fmtetc.lindex = -1; fmtetc.tymed = TYMED_ENHMF; hr = IDataObject_QueryGetData(pDataObject, &fmtetc); - todo_wine ok(hr == OLE_E_NOTRUNNING, "IDataObject_QueryGetData should have returned OLE_E_NOTRUNNING instead of 0x%08x\n", hr); fmtetc.cfFormat = CF_TEXT; @@ -1942,7 +2068,6 @@ fmtetc.lindex = -1; fmtetc.tymed = TYMED_NULL; hr = IDataObject_QueryGetData(pDataObject, &fmtetc); - todo_wine ok(hr == OLE_E_NOTRUNNING, "IDataObject_QueryGetData should have returned OLE_E_NOTRUNNING instead of 0x%08x\n", hr); hr = IOleObject_QueryInterface(pObject, &IID_IRunnableObject, (void **)&pRunnableObject); diff -Nru wine1.7-1.7.50/dlls/ole32/tests/propvariant.c wine1.7-1.7.55/dlls/ole32/tests/propvariant.c --- wine1.7-1.7.50/dlls/ole32/tests/propvariant.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ole32/tests/propvariant.c 2015-11-13 14:32:40.000000000 +0000 @@ -130,7 +130,7 @@ }; -static void expect(HRESULT hr, VARTYPE vt, BOOL copy) +static void expect(HRESULT hr, VARTYPE vt, BOOL copy, int line) { int idx = vt & VT_TYPEMASK; BYTE flags; @@ -158,7 +158,12 @@ } if(flags == PROP_INV) - ok(hr == copy ? DISP_E_BADVARTYPE : STG_E_INVALIDPARAMETER, "%s (%s): got %08x\n", wine_vtypes[idx], modifier, hr); + { + if (copy && (vt & VT_VECTOR)) + ok(hr == DISP_E_BADVARTYPE || hr == STG_E_INVALIDPARAMETER, "%s (%s): got %08x (line %d)\n", wine_vtypes[idx], modifier, hr, line); + else + ok(hr == (copy ? DISP_E_BADVARTYPE : STG_E_INVALIDPARAMETER), "%s (%s): got %08x (line %d)\n", wine_vtypes[idx], modifier, hr, line); + } else if(flags == PROP_V0) ok(hr == S_OK, "%s (%s): got %08x\n", wine_vtypes[idx], modifier, hr); else if(flags & PROP_TODO) @@ -210,7 +215,7 @@ vt = propvar.vt = i; memset(©, 0x77, sizeof(copy)); hr = PropVariantCopy(©, &propvar); - expect(hr, vt, TRUE); + expect(hr, vt, TRUE, __LINE__); if (hr == S_OK) { ok(copy.vt == propvar.vt, "expected %d, got %d\n", propvar.vt, copy.vt); @@ -224,7 +229,7 @@ ok(!ret || broken(ret) /* win2000 */, "%d: copy should stay unchanged\n", i); } hr = PropVariantClear(&propvar); - expect(hr, vt, FALSE); + expect(hr, vt, FALSE, __LINE__); ok(propvar.vt == 0, "expected 0, got %d\n", propvar.vt); ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n", i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart); @@ -234,7 +239,7 @@ vt = propvar.vt = i | VT_ARRAY; memset(©, 0x77, sizeof(copy)); hr = PropVariantCopy(©, &propvar); - expect(hr, vt, TRUE); + expect(hr, vt, TRUE, __LINE__); if (hr == S_OK) { ok(copy.vt == propvar.vt, "expected %d, got %d\n", propvar.vt, copy.vt); @@ -247,7 +252,7 @@ ok(!ret || broken(ret) /* win2000 */, "%d: copy should stay unchanged\n", i); } hr = PropVariantClear(&propvar); - expect(hr, vt, FALSE); + expect(hr, vt, FALSE, __LINE__); ok(propvar.vt == 0, "expected 0, got %d\n", propvar.vt); ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n", i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart); @@ -258,7 +263,7 @@ vt = propvar.vt = i | VT_VECTOR; memset(©, 0x77, sizeof(copy)); hr = PropVariantCopy(©, &propvar); - expect(hr, vt, TRUE); + expect(hr, vt, TRUE, __LINE__); if (hr == S_OK) { ok(copy.vt == propvar.vt, "expected %d, got %d\n", propvar.vt, copy.vt); @@ -271,7 +276,7 @@ ok(!ret || broken(ret) /* win2000 */, "%d: copy should stay unchanged\n", i); } hr = PropVariantClear(&propvar); - expect(hr, vt, FALSE); + expect(hr, vt, FALSE, __LINE__); ok(propvar.vt == 0, "expected 0, got %d\n", propvar.vt); ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n", i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart); @@ -281,7 +286,7 @@ vt = propvar.vt = i | VT_BYREF; memset(©, 0x77, sizeof(copy)); hr = PropVariantCopy(©, &propvar); - expect(hr, vt, TRUE); + expect(hr, vt, TRUE, __LINE__); if (hr == S_OK) { ok(copy.vt == propvar.vt, "expected %d, got %d\n", propvar.vt, copy.vt); @@ -295,7 +300,7 @@ ok(!ret || broken(ret) /* win2000 */, "%d: copy should stay unchanged\n", i); } hr = PropVariantClear(&propvar); - expect(hr, vt, FALSE); + expect(hr, vt, FALSE, __LINE__); ok(propvar.vt == 0, "expected 0, got %d\n", propvar.vt); ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n", i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart); diff -Nru wine1.7-1.7.50/dlls/ole32/tests/storage32.c wine1.7-1.7.55/dlls/ole32/tests/storage32.c --- wine1.7-1.7.50/dlls/ole32/tests/storage32.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ole32/tests/storage32.c 2015-11-13 14:32:40.000000000 +0000 @@ -513,6 +513,7 @@ ULARGE_INTEGER p; unsigned char buffer[0x100]; IUnknown *unk; + BOOL ret; DeleteFileA(filenameA); @@ -691,8 +692,8 @@ IStorage_Release(stg); } - r = DeleteFileA(filenameA); - ok(r, "file should exist\n"); + ret = DeleteFileA(filenameA); + ok(ret, "file should exist\n"); } static BOOL touch_file(LPCSTR filename) @@ -739,6 +740,7 @@ IStorage *stg = NULL, *stg2 = NULL; HRESULT r; DWORD stgm; + BOOL ret; /* try opening a zero length file - it should stay zero length */ DeleteFileA(filenameA); @@ -898,8 +900,8 @@ r = StgOpenStorage( filename, NULL, STGM_NOSNAPSHOT | STGM_PRIORITY, NULL, 0, &stg); ok(r == STG_E_INVALIDFLAG, "should fail\n"); - r = DeleteFileA(filenameA); - ok(r, "file didn't exist\n"); + ret = DeleteFileA(filenameA); + ok(ret, "file didn't exist\n"); } static void test_storage_suminfo(void) @@ -1222,6 +1224,7 @@ static const WCHAR stmname[] = { 'C','O','N','T','E','N','T','S',0 }; static const WCHAR stmname2[] = { 'A','B','C','D','E','F','G','H','I',0 }; static const WCHAR stmname3[] = { 'A','B','C','D','E','F','G','H','I','J',0 }; + static const STATSTG stat_null; STATSTG stat; IEnumSTATSTG *ee = NULL; ULONG count; @@ -1267,10 +1270,12 @@ r = IStorage_DestroyElement(stg, stmname); ok(r==S_OK, "IStorage->DestroyElement failed\n"); + memset(&stat, 0xad, sizeof(stat)); count = 0xf00; r = IEnumSTATSTG_Next(ee, 1, &stat, &count); ok(r==S_FALSE, "IEnumSTATSTG->Next failed\n"); ok(count == 0, "count wrong\n"); + ok(memcmp(&stat, &stat_null, sizeof(stat)) == 0, "stat is not zeroed\n"); /* reset and try again */ r = IEnumSTATSTG_Reset(ee); @@ -1397,6 +1402,7 @@ static const WCHAR stmname2[] = { 'F','O','O',0 }; static const WCHAR stgname[] = { 'P','E','R','M','S','T','G',0 }; static const WCHAR stgname2[] = { 'T','E','M','P','S','T','G',0 }; + BOOL ret; DeleteFileA(filenameA); @@ -1517,8 +1523,8 @@ IStorage_Release(stg); - r = DeleteFileA(filenameA); - ok( r == TRUE, "deleted file\n"); + ret = DeleteFileA(filenameA); + ok(ret, "deleted file\n"); } static void test_substorage_share(void) @@ -1529,6 +1535,7 @@ static const WCHAR stgname[] = { 'P','E','R','M','S','T','G',0 }; static const WCHAR stmname[] = { 'C','O','N','T','E','N','T','S',0 }; static const WCHAR othername[] = { 'N','E','W','N','A','M','E',0 }; + BOOL ret; DeleteFileA(filenameA); @@ -1608,8 +1615,8 @@ IStorage_Release(stg); - r = DeleteFileA(filenameA); - ok( r == TRUE, "deleted file\n"); + ret = DeleteFileA(filenameA); + ok(ret, "deleted file\n"); } static void test_revert(void) @@ -1622,6 +1629,7 @@ static const WCHAR stgname[] = { 'P','E','R','M','S','T','G',0 }; static const WCHAR stgname2[] = { 'T','E','M','P','S','T','G',0 }; STATSTG statstg; + BOOL ret; DeleteFileA(filenameA); @@ -1739,8 +1747,8 @@ IStorage_Release(stg); - r = DeleteFileA(filenameA); - ok( r == TRUE, "deleted file\n"); + ret = DeleteFileA(filenameA); + ok(ret, "deleted file\n"); /* Revert only invalidates objects in transacted mode */ r = StgCreateDocfile( filename, STGM_CREATE | STGM_SHARE_EXCLUSIVE | @@ -1759,8 +1767,8 @@ IStream_Release(stm); IStorage_Release(stg); - r = DeleteFileA(filenameA); - ok( r == TRUE, "deleted file\n"); + ret = DeleteFileA(filenameA); + ok(ret, "deleted file\n"); } static void test_parent_free(void) @@ -1772,6 +1780,7 @@ static const WCHAR stgname[] = { 'P','E','R','M','S','T','G',0 }; ULONG ref; STATSTG statstg; + BOOL ret; DeleteFileA(filenameA); @@ -1821,8 +1830,8 @@ IStorage_Release(stg); - r = DeleteFileA(filenameA); - ok( r == TRUE, "deleted file\n"); + ret = DeleteFileA(filenameA); + ok(ret, "deleted file\n"); } static void test_nonroot_transacted(void) @@ -1833,6 +1842,7 @@ static const WCHAR stgname[] = { 'P','E','R','M','S','T','G',0 }; static const WCHAR stmname[] = { 'C','O','N','T','E','N','T','S',0 }; static const WCHAR stmname2[] = { 'F','O','O',0 }; + BOOL ret; DeleteFileA(filenameA); @@ -1941,8 +1951,8 @@ IStorage_Release(stg); - r = DeleteFileA(filenameA); - ok( r == TRUE, "deleted file\n"); + ret = DeleteFileA(filenameA); + ok(ret, "deleted file\n"); } static void test_ReadClassStm(void) @@ -2411,6 +2421,7 @@ static const WCHAR fileW[] = {'f','m','t','t','e','s','t',0}; static WCHAR userTypeW[] = {'S','t','g','U','s','r','T','y','p','e',0}; static const WCHAR strmNameW[] = {1,'C','o','m','p','O','b','j',0}; + static const STATSTG statstg_null; hr = StgCreateDocfile( fileW, STGM_CREATE | STGM_SHARE_EXCLUSIVE | STGM_READWRITE, 0, &stg); ok(hr == S_OK, "should succeed, res=%x\n", hr); @@ -2429,6 +2440,7 @@ BOOL found = FALSE; STATSTG statstg; DWORD got; + memset(&statstg, 0xad, sizeof(statstg)); while ((hr = IEnumSTATSTG_Next(stat, 1, &statstg, &got)) == S_OK && got == 1) { if (strcmp_ww(statstg.pwcsName, strmNameW) == 0) @@ -2437,6 +2449,7 @@ ok(0, "found unexpected stream or storage\n"); CoTaskMemFree(statstg.pwcsName); } + ok(memcmp(&statstg, &statstg_null, sizeof(statstg)) == 0, "statstg is not zeroed\n"); ok(found == TRUE, "expected storage to contain stream \\0001CompObj\n"); IEnumSTATSTG_Release(stat); } @@ -2453,6 +2466,7 @@ BOOL found = FALSE; STATSTG statstg; DWORD got; + memset(&statstg, 0xad, sizeof(statstg)); while ((hr = IEnumSTATSTG_Next(stat, 1, &statstg, &got)) == S_OK && got == 1) { if (strcmp_ww(statstg.pwcsName, strmNameW) == 0) @@ -2461,6 +2475,7 @@ ok(0, "found unexpected stream or storage\n"); CoTaskMemFree(statstg.pwcsName); } + ok(memcmp(&statstg, &statstg_null, sizeof(statstg)) == 0, "statstg is not zeroed\n"); ok(found == TRUE, "expected storage to contain stream \\0001CompObj\n"); IEnumSTATSTG_Release(stat); } @@ -2925,6 +2940,7 @@ static const WCHAR stgname2[] = { 'S','T','G',0 }; static const WCHAR stmname[] = { 'C','O','N','T','E','N','T','S',0 }; static const WCHAR stmname2[] = { 'E','N','T','S',0 }; + BOOL ret; DeleteFileA(filenameA); @@ -2981,8 +2997,8 @@ IStorage_Release(stg); - r = DeleteFileA(filenameA); - ok( r == TRUE, "deleted file\n"); + ret = DeleteFileA(filenameA); + ok(ret, "deleted file\n"); } static void test_toplevel_stat(void) @@ -3068,6 +3084,7 @@ HRESULT r; ULONG ref; static const WCHAR stgname[] = { 'P','E','R','M','S','T','G',0 }; + BOOL ret; DeleteFileA(filenameA); @@ -3103,8 +3120,8 @@ IStorage_Release(stg); - r = DeleteFileA(filenameA); - ok( r == TRUE, "deleted file\n"); + ret = DeleteFileA(filenameA); + ok(ret, "deleted file\n"); } static void test_copyto_locking(void) @@ -3115,6 +3132,7 @@ static const WCHAR stgname[] = { 'S','T','G','1',0 }; static const WCHAR stgname2[] = { 'S','T','G','2',0 }; static const WCHAR stmname[] = { 'C','O','N','T','E','N','T','S',0 }; + BOOL ret; DeleteFileA(filenameA); @@ -3154,8 +3172,8 @@ IStorage_Release(stg2); IStorage_Release(stg); - r = DeleteFileA(filenameA); - ok( r == TRUE, "deleted file\n"); + ret = DeleteFileA(filenameA); + ok(ret, "deleted file\n"); } static void test_copyto_recursive(void) @@ -3164,6 +3182,7 @@ HRESULT r; static const WCHAR stgname[] = { 'S','T','G','1',0 }; static const WCHAR stgname2[] = { 'S','T','G','2',0 }; + BOOL ret; DeleteFileA(filenameA); @@ -3205,8 +3224,8 @@ IStorage_Release(stg2); IStorage_Release(stg); - r = DeleteFileA(filenameA); - ok( r == TRUE, "deleted file\n"); + ret = DeleteFileA(filenameA); + ok(ret, "deleted file\n"); } static void test_hglobal_storage_creation(void) diff -Nru wine1.7-1.7.50/dlls/ole32/tests/usrmarshal.c wine1.7-1.7.55/dlls/ole32/tests/usrmarshal.c --- wine1.7-1.7.50/dlls/ole32/tests/usrmarshal.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ole32/tests/usrmarshal.c 2015-11-13 14:32:40.000000000 +0000 @@ -85,6 +85,91 @@ umcb->CBType = buffer ? USER_MARSHAL_CB_UNMARSHALL : USER_MARSHAL_CB_BUFFER_SIZE; } +#define RELEASEMARSHALDATA WM_USER + +struct host_object_data +{ + IStream *stream; + IID iid; + IUnknown *object; + MSHLFLAGS marshal_flags; + HANDLE marshal_event; + IMessageFilter *filter; +}; + +static DWORD CALLBACK host_object_proc(LPVOID p) +{ + struct host_object_data *data = p; + HRESULT hr; + MSG msg; + + CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + + if (data->filter) + { + IMessageFilter * prev_filter = NULL; + hr = CoRegisterMessageFilter(data->filter, &prev_filter); + if (prev_filter) IMessageFilter_Release(prev_filter); + ok(hr == S_OK, "got %08x\n", hr); + } + + hr = CoMarshalInterface(data->stream, &data->iid, data->object, MSHCTX_INPROC, NULL, data->marshal_flags); + ok(hr == S_OK, "got %08x\n", hr); + + /* force the message queue to be created before signaling parent thread */ + PeekMessageA(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE); + + SetEvent(data->marshal_event); + + while (GetMessageA(&msg, NULL, 0, 0)) + { + if (msg.hwnd == NULL && msg.message == RELEASEMARSHALDATA) + { + CoReleaseMarshalData(data->stream); + SetEvent((HANDLE)msg.lParam); + } + else + DispatchMessageA(&msg); + } + + HeapFree(GetProcessHeap(), 0, data); + + CoUninitialize(); + + return hr; +} + +static DWORD start_host_object2(IStream *stream, REFIID riid, IUnknown *object, MSHLFLAGS marshal_flags, IMessageFilter *filter, HANDLE *thread) +{ + DWORD tid = 0; + HANDLE marshal_event = CreateEventA(NULL, FALSE, FALSE, NULL); + struct host_object_data *data = HeapAlloc(GetProcessHeap(), 0, sizeof(*data)); + + data->stream = stream; + data->iid = *riid; + data->object = object; + data->marshal_flags = marshal_flags; + data->marshal_event = marshal_event; + data->filter = filter; + + *thread = CreateThread(NULL, 0, host_object_proc, data, 0, &tid); + + /* wait for marshaling to complete before returning */ + ok( !WaitForSingleObject(marshal_event, 10000), "wait timed out\n" ); + CloseHandle(marshal_event); + + return tid; +} + +static void end_host_object(DWORD tid, HANDLE thread) +{ + BOOL ret = PostThreadMessageA(tid, WM_QUIT, 0, 0); + ok(ret, "PostThreadMessage failed with error %d\n", GetLastError()); + /* be careful of races - don't return until hosting thread has terminated */ + ok( !WaitForSingleObject(thread, 10000), "wait timed out\n" ); + CloseHandle(thread); +} + static const char cf_marshaled[] = { 0x9, 0x0, 0x0, 0x0, @@ -527,6 +612,17 @@ Test_IUnknown_Release, }; +struct test_stream +{ + IStream IStream_iface; + LONG refs; +}; + +static inline struct test_stream *impl_from_IStream(IStream *iface) +{ + return CONTAINING_RECORD(iface, struct test_stream, IStream_iface); +} + static HRESULT WINAPI Test_IStream_QueryInterface(IStream *iface, REFIID riid, LPVOID *ppvObj) { @@ -546,12 +642,14 @@ static ULONG WINAPI Test_IStream_AddRef(IStream *iface) { - return 2; /* non-heap-based object */ + struct test_stream *This = impl_from_IStream(iface); + return InterlockedIncrement(&This->refs); } static ULONG WINAPI Test_IStream_Release(IStream *iface) { - return 1; /* non-heap-based object */ + struct test_stream *This = impl_from_IStream(iface); + return InterlockedDecrement(&This->refs); } static const IStreamVtbl TestStream_Vtbl = @@ -563,13 +661,15 @@ }; static TestUnknown Test_Unknown = { {&TestUnknown_Vtbl}, 1 }; -static IStream Test_Stream = { &TestStream_Vtbl }; +static TestUnknown Test_Unknown2 = { {&TestUnknown_Vtbl}, 1 }; +static struct test_stream Test_Stream = { {&TestStream_Vtbl}, 1 }; +static struct test_stream Test_Stream2 = { {&TestStream_Vtbl}, 1 }; ULONG __RPC_USER WdtpInterfacePointer_UserSize(ULONG *, ULONG, ULONG, IUnknown *, REFIID); unsigned char * __RPC_USER WdtpInterfacePointer_UserMarshal(ULONG *, ULONG, unsigned char *, IUnknown *, REFIID); unsigned char * __RPC_USER WdtpInterfacePointer_UserUnmarshal(ULONG *, unsigned char *, IUnknown **, REFIID); -static void marshal_WdtpInterfacePointer(DWORD umcb_ctx, DWORD ctx) +static void marshal_WdtpInterfacePointer(DWORD umcb_ctx, DWORD ctx, BOOL client, BOOL in, BOOL out) { USER_MARSHAL_CB umcb; MIDL_STUB_MESSAGE stub_msg; @@ -638,11 +738,17 @@ CoReleaseMarshalData(stm); IStream_Release(stm); - unk2 = NULL; + Test_Unknown2.refs = 1; + unk2 = &Test_Unknown2.IUnknown_iface; init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, umcb_ctx); + umcb.pStubMsg->IsClient = client; + umcb.pStubMsg->fIsIn = in; + umcb.pStubMsg->fIsOut = out; + WdtpInterfacePointer_UserUnmarshal(&umcb.Flags, buffer, &unk2, &IID_IUnknown); ok(unk2 != NULL, "IUnknown object didn't unmarshal properly\n"); ok(Test_Unknown.refs == 2, "got %d\n", Test_Unknown.refs); + ok(Test_Unknown2.refs == 0, "got %d\n", Test_Unknown2.refs); HeapFree(GetProcessHeap(), 0, buffer); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_INPROC); IUnknown_Release(unk2); @@ -657,17 +763,26 @@ */ /* All three are marshalled as inproc */ - marshal_WdtpInterfacePointer(MSHCTX_INPROC, MSHCTX_INPROC); - marshal_WdtpInterfacePointer(MSHCTX_DIFFERENTMACHINE, MSHCTX_INPROC); - marshal_WdtpInterfacePointer(MSHCTX_INPROC, MAKELONG(MSHCTX_INPROC, 0xffff)); + marshal_WdtpInterfacePointer(MSHCTX_INPROC, MSHCTX_INPROC, 0,0,0); + marshal_WdtpInterfacePointer(MSHCTX_DIFFERENTMACHINE, MSHCTX_INPROC,0,0,0); + marshal_WdtpInterfacePointer(MSHCTX_INPROC, MAKELONG(MSHCTX_INPROC, 0xffff),0,0,0); /* All three are marshalled as remote */ - marshal_WdtpInterfacePointer(MSHCTX_INPROC, MSHCTX_DIFFERENTMACHINE); - marshal_WdtpInterfacePointer(MSHCTX_DIFFERENTMACHINE, MSHCTX_DIFFERENTMACHINE); - marshal_WdtpInterfacePointer(MSHCTX_INPROC, MAKELONG(MSHCTX_DIFFERENTMACHINE, 0xffff)); + marshal_WdtpInterfacePointer(MSHCTX_INPROC, MSHCTX_DIFFERENTMACHINE,0,0,0); + marshal_WdtpInterfacePointer(MSHCTX_DIFFERENTMACHINE, MSHCTX_DIFFERENTMACHINE,0,0,0); + marshal_WdtpInterfacePointer(MSHCTX_INPROC, MAKELONG(MSHCTX_DIFFERENTMACHINE, 0xffff),0,0,0); + + /* Test different combinations of client, in and out */ + marshal_WdtpInterfacePointer(MSHCTX_INPROC, MSHCTX_DIFFERENTMACHINE,0,0,1); + marshal_WdtpInterfacePointer(MSHCTX_INPROC, MSHCTX_DIFFERENTMACHINE,0,1,0); + marshal_WdtpInterfacePointer(MSHCTX_INPROC, MSHCTX_DIFFERENTMACHINE,0,1,1); + marshal_WdtpInterfacePointer(MSHCTX_INPROC, MSHCTX_DIFFERENTMACHINE,1,0,0); + marshal_WdtpInterfacePointer(MSHCTX_INPROC, MSHCTX_DIFFERENTMACHINE,1,0,1); + marshal_WdtpInterfacePointer(MSHCTX_INPROC, MSHCTX_DIFFERENTMACHINE,1,1,0); + marshal_WdtpInterfacePointer(MSHCTX_INPROC, MSHCTX_DIFFERENTMACHINE,1,1,1); } -static void test_marshal_STGMEDIUM(void) +static void marshal_STGMEDIUM(BOOL client, BOOL in, BOOL out) { USER_MARSHAL_CB umcb; MIDL_STUB_MESSAGE stub_msg; @@ -676,13 +791,17 @@ ULONG size, expect_size; STGMEDIUM med, med2; IUnknown *unk = &Test_Unknown.IUnknown_iface; - IStream *stm = &Test_Stream; + IStream *stm = &Test_Stream.IStream_iface; /* TYMED_NULL with pUnkForRelease */ + Test_Unknown.refs = 1; + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); expect_size = WdtpInterfacePointer_UserSize(&umcb.Flags, umcb.Flags, 2 * sizeof(DWORD), unk, &IID_IUnknown); expect_buffer = HeapAlloc(GetProcessHeap(), 0, expect_size); + *(DWORD*)expect_buffer = TYMED_NULL; + *((DWORD*)expect_buffer + 1) = 0xdeadbeef; init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, expect_buffer, expect_size, MSHCTX_DIFFERENTMACHINE); expect_buffer_end = WdtpInterfacePointer_UserMarshal(&umcb.Flags, umcb.Flags, expect_buffer + 2 * sizeof(DWORD), unk, &IID_IUnknown); @@ -703,26 +822,42 @@ ok(!memcmp(buffer+8, expect_buffer + 8, expect_buffer_end - expect_buffer - 8), "buffer mismatch\n"); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE); + umcb.pStubMsg->IsClient = client; + umcb.pStubMsg->fIsIn = in; + umcb.pStubMsg->fIsOut = out; - /* native crashes if this is uninitialised, presumably because it - tries to release it */ + Test_Unknown2.refs = 1; med2.tymed = TYMED_NULL; U(med2).pstm = NULL; - med2.pUnkForRelease = NULL; + med2.pUnkForRelease = &Test_Unknown2.IUnknown_iface; STGMEDIUM_UserUnmarshal(&umcb.Flags, buffer, &med2); ok(med2.tymed == TYMED_NULL, "got tymed %x\n", med2.tymed); ok(med2.pUnkForRelease != NULL, "Incorrectly unmarshalled\n"); + ok(Test_Unknown2.refs == 0, "got %d\n", Test_Unknown2.refs); HeapFree(GetProcessHeap(), 0, buffer); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); STGMEDIUM_UserFree(&umcb.Flags, &med2); + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, expect_buffer, expect_size, MSHCTX_DIFFERENTMACHINE); + med2.tymed = TYMED_NULL; + U(med2).pstm = NULL; + med2.pUnkForRelease = NULL; + STGMEDIUM_UserUnmarshal(&umcb.Flags, expect_buffer, &med2); + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); + STGMEDIUM_UserFree(&umcb.Flags, &med2); + + ok(Test_Unknown.refs == 1, "got %d\n", Test_Unknown.refs); + HeapFree(GetProcessHeap(), 0, expect_buffer); /* TYMED_ISTREAM with pUnkForRelease */ + Test_Unknown.refs = 1; + Test_Stream.refs = 1; + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); expect_size = WdtpInterfacePointer_UserSize(&umcb.Flags, umcb.Flags, 3 * sizeof(DWORD), (IUnknown*)stm, &IID_IStream); expect_size = WdtpInterfacePointer_UserSize(&umcb.Flags, umcb.Flags, expect_size, unk, &IID_IUnknown); @@ -730,6 +865,9 @@ expect_buffer = HeapAlloc(GetProcessHeap(), 0, expect_size); /* There may be a hole between the two interfaces so init the buffer to something */ memset(expect_buffer, 0xcc, expect_size); + *(DWORD*)expect_buffer = TYMED_ISTREAM; + *((DWORD*)expect_buffer + 1) = 0xdeadbeef; + *((DWORD*)expect_buffer + 2) = 0xcafe; init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, expect_buffer, expect_size, MSHCTX_DIFFERENTMACHINE); expect_buffer_end = WdtpInterfacePointer_UserMarshal(&umcb.Flags, umcb.Flags, expect_buffer + 3 * sizeof(DWORD), (IUnknown*)stm, &IID_IStream); expect_buffer_end = WdtpInterfacePointer_UserMarshal(&umcb.Flags, umcb.Flags, expect_buffer_end, unk, &IID_IUnknown); @@ -753,24 +891,98 @@ ok(!memcmp(buffer + 12, expect_buffer + 12, (buffer_end - buffer) - 12), "buffer mismatch\n"); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE); + umcb.pStubMsg->IsClient = client; + umcb.pStubMsg->fIsIn = in; + umcb.pStubMsg->fIsOut = out; + + Test_Stream2.refs = 1; + Test_Unknown2.refs = 1; + med2.tymed = TYMED_ISTREAM; + U(med2).pstm = &Test_Stream2.IStream_iface; + med2.pUnkForRelease = &Test_Unknown2.IUnknown_iface; - /* native crashes if this is uninitialised, presumably because it - tries to release it */ + STGMEDIUM_UserUnmarshal(&umcb.Flags, buffer, &med2); + + ok(med2.tymed == TYMED_ISTREAM, "got tymed %x\n", med2.tymed); + ok(U(med2).pstm != NULL, "Incorrectly unmarshalled\n"); + ok(med2.pUnkForRelease != NULL, "Incorrectly unmarshalled\n"); + ok(Test_Stream2.refs == 0, "got %d\n", Test_Stream2.refs); + ok(Test_Unknown2.refs == 0, "got %d\n", Test_Unknown2.refs); + + HeapFree(GetProcessHeap(), 0, buffer); + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); + STGMEDIUM_UserFree(&umcb.Flags, &med2); + + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, expect_buffer, expect_size, MSHCTX_DIFFERENTMACHINE); med2.tymed = TYMED_NULL; U(med2).pstm = NULL; med2.pUnkForRelease = NULL; + STGMEDIUM_UserUnmarshal(&umcb.Flags, expect_buffer, &med2); + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); + STGMEDIUM_UserFree(&umcb.Flags, &med2); + + ok(Test_Unknown.refs == 1, "got %d\n", Test_Unknown.refs); + ok(Test_Stream.refs == 1, "got %d\n", Test_Stream.refs); + + HeapFree(GetProcessHeap(), 0, expect_buffer); + + /* TYMED_ISTREAM = NULL with pUnkForRelease = NULL */ + + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); + expect_size = 3 * sizeof(DWORD); + + med.tymed = TYMED_ISTREAM; + U(med).pstm = NULL; + med.pUnkForRelease = NULL; + + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); + size = STGMEDIUM_UserSize(&umcb.Flags, 0, &med); + ok(size == expect_size, "size %d should be %d bytes\n", size, expect_size); + + buffer = HeapAlloc(GetProcessHeap(), 0, size); + memset(buffer, 0xcc, size); + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE); + buffer_end = STGMEDIUM_UserMarshal(&umcb.Flags, buffer, &med); + ok(buffer_end - buffer == expect_size, "buffer size mismatch\n"); + ok(*(DWORD*)buffer == TYMED_ISTREAM, "got %08x\n", *(DWORD*)buffer); + ok(*((DWORD*)buffer+1) == 0, "got %08x\n", *((DWORD*)buffer+1)); + ok(*((DWORD*)buffer+2) == 0, "got %08x\n", *((DWORD*)buffer+2)); + + init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE); + umcb.pStubMsg->IsClient = client; + umcb.pStubMsg->fIsIn = in; + umcb.pStubMsg->fIsOut = out; + + Test_Stream2.refs = 1; + Test_Unknown2.refs = 1; + med2.tymed = TYMED_ISTREAM; + U(med2).pstm = &Test_Stream2.IStream_iface; + med2.pUnkForRelease = &Test_Unknown2.IUnknown_iface; STGMEDIUM_UserUnmarshal(&umcb.Flags, buffer, &med2); ok(med2.tymed == TYMED_ISTREAM, "got tymed %x\n", med2.tymed); - ok(U(med2).pstm != NULL, "Incorrectly unmarshalled\n"); - ok(med2.pUnkForRelease != NULL, "Incorrectly unmarshalled\n"); + ok(U(med2).pstm == NULL, "Incorrectly unmarshalled\n"); + ok(med2.pUnkForRelease == &Test_Unknown2.IUnknown_iface, "Incorrectly unmarshalled\n"); + ok(Test_Stream2.refs == 0, "got %d\n", Test_Stream2.refs); + ok(Test_Unknown2.refs == 1, "got %d\n", Test_Unknown2.refs); HeapFree(GetProcessHeap(), 0, buffer); init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE); STGMEDIUM_UserFree(&umcb.Flags, &med2); +} - HeapFree(GetProcessHeap(), 0, expect_buffer); +static void test_marshal_STGMEDIUM(void) +{ + marshal_STGMEDIUM(0, 0, 0); + marshal_STGMEDIUM(0, 0, 1); + marshal_STGMEDIUM(0, 1, 0); + marshal_STGMEDIUM(0, 1, 1); + /* For Windows versions post 2003, client side, non-[in,out] STGMEDIUMs get zero-initialised. + However since inline stubs don't set fIsIn or fIsOut this behaviour would break + ref counting in GetDataHere_Proxy for example, as we'd end up not releasing the original + interface. For simplicity we don't test or implement this. */ + marshal_STGMEDIUM(1, 1, 1); } static void test_marshal_SNB(void) @@ -978,9 +1190,156 @@ DeleteObject(hBrush); } +struct obj +{ + IDataObject IDataObject_iface; +}; + +static HRESULT WINAPI obj_QueryInterface(IDataObject *iface, REFIID iid, void **obj) +{ + *obj = NULL; + + if (IsEqualGUID(iid, &IID_IUnknown) || + IsEqualGUID(iid, &IID_IDataObject)) + *obj = iface; + + if (*obj) + { + IDataObject_AddRef(iface); + return S_OK; + } + + return E_NOINTERFACE; +} + +static ULONG WINAPI obj_AddRef(IDataObject *iface) +{ + return 2; +} + +static ULONG WINAPI obj_Release(IDataObject *iface) +{ + return 1; +} + +static HRESULT WINAPI obj_DO_GetDataHere(IDataObject *iface, FORMATETC *fmt, + STGMEDIUM *med) +{ + ok( med->pUnkForRelease == NULL, "got %p\n", med->pUnkForRelease ); + + if (fmt->cfFormat == 2) + { + IStream_Release(U(med)->pstm); + U(med)->pstm = &Test_Stream2.IStream_iface; + } + + return S_OK; +} + +static const IDataObjectVtbl obj_data_object_vtbl = +{ + obj_QueryInterface, + obj_AddRef, + obj_Release, + NULL, /* GetData */ + obj_DO_GetDataHere, + NULL, /* QueryGetData */ + NULL, /* GetCanonicalFormatEtc */ + NULL, /* SetData */ + NULL, /* EnumFormatEtc */ + NULL, /* DAdvise */ + NULL, /* DUnadvise */ + NULL /* EnumDAdvise */ +}; + +static struct obj obj = +{ + {&obj_data_object_vtbl} +}; + +static void test_GetDataHere_Proxy(void) +{ + HRESULT hr; + IStream *stm; + HANDLE thread; + DWORD tid; + static const LARGE_INTEGER zero; + IDataObject *data; + FORMATETC fmt; + STGMEDIUM med; + + hr = CreateStreamOnHGlobal( NULL, TRUE, &stm ); + ok( hr == S_OK, "got %08x\n", hr ); + tid = start_host_object2( stm, &IID_IDataObject, (IUnknown *)&obj.IDataObject_iface, MSHLFLAGS_NORMAL, NULL, &thread ); + + IStream_Seek( stm, zero, STREAM_SEEK_SET, NULL ); + hr = CoUnmarshalInterface( stm, &IID_IDataObject, (void **)&data ); + ok( hr == S_OK, "got %08x\n", hr ); + IStream_Release( stm ); + + Test_Stream.refs = 1; + Test_Stream2.refs = 1; + Test_Unknown.refs = 1; + + fmt.cfFormat = 1; + fmt.ptd = NULL; + fmt.dwAspect = DVASPECT_CONTENT; + fmt.lindex = -1; + U(med).pstm = NULL; + med.pUnkForRelease = &Test_Unknown.IUnknown_iface; + + fmt.tymed = med.tymed = TYMED_NULL; + hr = IDataObject_GetDataHere( data, &fmt, &med ); + ok( hr == DV_E_TYMED, "got %08x\n", hr ); + + for (fmt.tymed = TYMED_HGLOBAL; fmt.tymed <= TYMED_ENHMF; fmt.tymed <<= 1) + { + med.tymed = fmt.tymed; + hr = IDataObject_GetDataHere( data, &fmt, &med ); + ok( hr == (fmt.tymed <= TYMED_ISTORAGE ? S_OK : DV_E_TYMED), "got %08x for tymed %d\n", hr, fmt.tymed ); + ok( Test_Unknown.refs == 1, "got %d\n", Test_Unknown.refs ); + } + + fmt.tymed = TYMED_ISTREAM; + med.tymed = TYMED_ISTORAGE; + hr = IDataObject_GetDataHere( data, &fmt, &med ); + ok( hr == DV_E_TYMED, "got %08x\n", hr ); + + fmt.tymed = med.tymed = TYMED_ISTREAM; + U(med).pstm = &Test_Stream.IStream_iface; + med.pUnkForRelease = &Test_Unknown.IUnknown_iface; + + hr = IDataObject_GetDataHere( data, &fmt, &med ); + ok( hr == S_OK, "got %08x\n", hr ); + + ok( U(med).pstm == &Test_Stream.IStream_iface, "stm changed\n" ); + ok( med.pUnkForRelease == &Test_Unknown.IUnknown_iface, "punk changed\n" ); + + ok( Test_Stream.refs == 1, "got %d\n", Test_Stream.refs ); + ok( Test_Unknown.refs == 1, "got %d\n", Test_Unknown.refs ); + + fmt.cfFormat = 2; + fmt.tymed = med.tymed = TYMED_ISTREAM; + U(med).pstm = &Test_Stream.IStream_iface; + med.pUnkForRelease = &Test_Unknown.IUnknown_iface; + + hr = IDataObject_GetDataHere( data, &fmt, &med ); + ok( hr == S_OK, "got %08x\n", hr ); + + ok( U(med).pstm == &Test_Stream.IStream_iface, "stm changed\n" ); + ok( med.pUnkForRelease == &Test_Unknown.IUnknown_iface, "punk changed\n" ); + + ok( Test_Stream.refs == 1, "got %d\n", Test_Stream.refs ); + ok( Test_Unknown.refs == 1, "got %d\n", Test_Unknown.refs ); + ok( Test_Stream2.refs == 0, "got %d\n", Test_Stream2.refs ); + + IDataObject_Release( data ); + end_host_object( tid, thread ); +} + START_TEST(usrmarshal) { - CoInitialize(NULL); + CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); test_marshal_CLIPFORMAT(); test_marshal_HWND(); @@ -995,5 +1354,7 @@ test_marshal_HICON(); test_marshal_HBRUSH(); + test_GetDataHere_Proxy(); + CoUninitialize(); } diff -Nru wine1.7-1.7.50/dlls/ole32/usrmarshal.c wine1.7-1.7.55/dlls/ole32/usrmarshal.c --- wine1.7-1.7.50/dlls/ole32/usrmarshal.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ole32/usrmarshal.c 2015-11-13 14:32:40.000000000 +0000 @@ -1490,6 +1490,7 @@ IStream *stm; DWORD size; void *ptr; + IUnknown *orig; TRACE("(%s, %p, %p, %s)\n", debugstr_user_flags(pFlags), pBuffer, ppunk, debugstr_guid(riid)); @@ -1517,11 +1518,14 @@ memcpy(ptr, pBuffer, size); GlobalUnlock(h); + orig = *ppunk; hr = CoUnmarshalInterface(stm, riid, (void**)ppunk); IStream_Release(stm); if(hr != S_OK) RaiseException(hr, 0, 0, NULL); + if(orig) IUnknown_Release(orig); + return pBuffer + size; } @@ -1846,7 +1850,10 @@ pBuffer = WdtpInterfacePointer_UserUnmarshal(pFlags, pBuffer, (IUnknown**)&pStgMedium->u.pstm, &IID_IStream); } else + { + if (pStgMedium->u.pstm) IStream_Release( pStgMedium->u.pstm ); pStgMedium->u.pstm = NULL; + } break; case TYMED_ISTORAGE: TRACE("TYMED_ISTORAGE\n"); @@ -1855,7 +1862,10 @@ pBuffer = WdtpInterfacePointer_UserUnmarshal(pFlags, pBuffer, (IUnknown**)&pStgMedium->u.pstg, &IID_IStorage); } else + { + if (pStgMedium->u.pstg) IStorage_Release( pStgMedium->u.pstg ); pStgMedium->u.pstg = NULL; + } break; case TYMED_GDI: TRACE("TYMED_GDI\n"); @@ -1884,9 +1894,10 @@ RaiseException(DV_E_TYMED, 0, 0, NULL); } - pStgMedium->pUnkForRelease = NULL; if (releaseunk) pBuffer = WdtpInterfacePointer_UserUnmarshal(pFlags, pBuffer, &pStgMedium->pUnkForRelease, &IID_IUnknown); + /* Unlike the IStream / IStorage ifaces, the existing pUnkForRelease + is left intact if a NULL ptr is unmarshalled - see the tests. */ return pBuffer; } @@ -2772,13 +2783,39 @@ return IDataObject_GetData(This, pformatetcIn, pRemoteMedium); } -HRESULT CALLBACK IDataObject_GetDataHere_Proxy( - IDataObject* This, - FORMATETC *pformatetc, - STGMEDIUM *pmedium) +HRESULT CALLBACK IDataObject_GetDataHere_Proxy(IDataObject *iface, FORMATETC *fmt, STGMEDIUM *med) { - TRACE("(%p)->(%p, %p)\n", This, pformatetc, pmedium); - return IDataObject_RemoteGetDataHere_Proxy(This, pformatetc, pmedium); + IUnknown *release; + IStorage *stg = NULL; + HRESULT hr; + + TRACE("(%p)->(%p, %p)\n", iface, fmt, med); + + if ((med->tymed & (TYMED_HGLOBAL | TYMED_FILE | TYMED_ISTREAM | TYMED_ISTORAGE)) == 0) + return DV_E_TYMED; + if (med->tymed != fmt->tymed) + return DV_E_TYMED; + + release = med->pUnkForRelease; + med->pUnkForRelease = NULL; + + if (med->tymed == TYMED_ISTREAM || med->tymed == TYMED_ISTORAGE) + { + stg = med->u.pstg; /* This may actually be a stream, but that's ok */ + if (stg) IStorage_AddRef( stg ); + } + + hr = IDataObject_RemoteGetDataHere_Proxy(iface, fmt, med); + + med->pUnkForRelease = release; + if (stg) + { + if (med->u.pstg) + IStorage_Release( med->u.pstg ); + med->u.pstg = stg; + } + + return hr; } HRESULT __RPC_STUB IDataObject_GetDataHere_Stub( diff -Nru wine1.7-1.7.50/dlls/oleacc/tests/main.c wine1.7-1.7.55/dlls/oleacc/tests/main.c --- wine1.7-1.7.50/dlls/oleacc/tests/main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/oleacc/tests/main.c 2015-11-13 14:32:40.000000000 +0000 @@ -445,7 +445,7 @@ ret = GetStateTextW(1< #include #include @@ -499,7 +501,7 @@ * Success: S_OK. * Failure: HRESULT code. */ -HRESULT WINAPI RegisterActiveObject( +HRESULT WINAPI DECLSPEC_HOTPATCH RegisterActiveObject( LPUNKNOWN punk,REFCLSID rcid,DWORD dwFlags,LPDWORD pdwRegister ) { WCHAR guidbuf[80]; @@ -538,7 +540,7 @@ * Success: S_OK. * Failure: HRESULT code. */ -HRESULT WINAPI RevokeActiveObject(DWORD xregister,LPVOID reserved) +HRESULT WINAPI DECLSPEC_HOTPATCH RevokeActiveObject(DWORD xregister,LPVOID reserved) { LPRUNNINGOBJECTTABLE runobtable; HRESULT ret; @@ -565,7 +567,7 @@ * Success: S_OK. * Failure: HRESULT code. */ -HRESULT WINAPI GetActiveObject(REFCLSID rcid,LPVOID preserved,LPUNKNOWN *ppunk) +HRESULT WINAPI DECLSPEC_HOTPATCH GetActiveObject(REFCLSID rcid,LPVOID preserved,LPUNKNOWN *ppunk) { WCHAR guidbuf[80]; HRESULT ret; diff -Nru wine1.7-1.7.50/dlls/oleaut32/olepicture.c wine1.7-1.7.55/dlls/oleaut32/olepicture.c --- wine1.7-1.7.50/dlls/oleaut32/olepicture.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/oleaut32/olepicture.c 2015-11-13 14:32:40.000000000 +0000 @@ -1210,6 +1210,8 @@ HDC hdcRef; int i; + TRACE("(this %p, xbuf %p, xread %u)\n", This, xbuf, xread); + /* FIXME("icon.idReserved=%d\n",cifd->idReserved); FIXME("icon.idType=%d\n",cifd->idType); @@ -1226,6 +1228,13 @@ FIXME("[%d] dwDIBOffset %d\n",i,cifd->idEntries[i].dwDIBOffset); } */ + + /* Need at least one icon to do something. */ + if (!cifd->idCount) + { + ERR("Invalid icon count of zero.\n"); + return E_FAIL; + } i=0; /* If we have more than one icon, try to find the best. * this currently means '32 pixel wide'. @@ -1237,6 +1246,12 @@ } if (i==cifd->idCount) i=0; } + if (xread < cifd->idEntries[i].dwDIBOffset + cifd->idEntries[i].dwDIBSize) + { + ERR("Icon data address %u is over %u bytes available.\n", + cifd->idEntries[i].dwDIBOffset + cifd->idEntries[i].dwDIBSize, xread); + return E_FAIL; + } if (cifd->idType == 2) { LPBYTE buf = HeapAlloc(GetProcessHeap(), 0, cifd->idEntries[i].dwDIBSize + 4); diff -Nru wine1.7-1.7.50/dlls/oleaut32/tests/safearray.c wine1.7-1.7.55/dlls/oleaut32/tests/safearray.c --- wine1.7-1.7.50/dlls/oleaut32/tests/safearray.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/oleaut32/tests/safearray.c 2015-11-13 14:32:40.000000000 +0000 @@ -212,7 +212,7 @@ static BOOL WINAPI RecordInfo_IsMatchingType(IRecordInfo *iface, IRecordInfo *info2) { ok(0, "unexpected call\n"); - return E_NOTIMPL; + return FALSE; } static PVOID WINAPI RecordInfo_RecordCreate(IRecordInfo *iface) diff -Nru wine1.7-1.7.50/dlls/oleaut32/tests/test_tlb.idl wine1.7-1.7.55/dlls/oleaut32/tests/test_tlb.idl --- wine1.7-1.7.50/dlls/oleaut32/tests/test_tlb.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/oleaut32/tests/test_tlb.idl 2015-11-13 14:32:40.000000000 +0000 @@ -2,6 +2,7 @@ * ITypeLib test IDL - we dump it and compare results in typelib.c * * Copyright 2007 Google (Mikolaj Zalewski) + * Copyright 2006,2015 Dmitry Timoshkov * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,6 +29,43 @@ { importlib("stdole2.tlb"); + typedef [uuid(b14b6bb5-904e-4ff9-b247-bd361f7a0001)] + struct g { int g1; } g; + + [uuid(b14b6bb5-904e-4ff9-b247-bd361f7a0002)] + interface test_iface : IUnknown + { + HRESULT test([in] g *ptr); + } + + interface child_iface; + interface parent_iface; + + [uuid(b14b6bb5-904e-4ff9-b247-bd361f7aa001)] + interface parent_iface : IUnknown + { + HRESULT test1([out,retval] child_iface **iface); + } + [uuid(b14b6bb5-904e-4ff9-b247-bd361f7aa002)] + interface child_iface: parent_iface + { + HRESULT test2(void); + } + + [uuid(016fe2ec-b2c8-45f8-b23b-39e53a753901),restricted] + struct _n { int n1; }; + [uuid(016fe2ec-b2c8-45f8-b23b-39e53a753902),hidden] + typedef struct _n n; + [uuid(016fe2ec-b2c8-45f8-b23b-39e53a753903),version(1.2),helpcontext(3)] + typedef struct _n nn; + + [uuid(016fe2ec-b2c8-45f8-b23b-39e53a753904),restricted] + struct _m { int m1; }; + [uuid(016fe2ec-b2c8-45f8-b23b-39e53a753905),hidden,version(1.2)] + typedef struct _m m; + [uuid(016fe2ec-b2c8-45f8-b23b-39e53a753906),helpcontext(3)] + typedef struct _m mm; + [dual,uuid(b14b6bb5-904e-4ff9-b247-bd361f7aaedd)] interface IDualIface : IDispatch { @@ -58,4 +96,40 @@ IDispatch *disp; BSTR bstr; }; + + typedef [uuid(016fe2ec-b2c8-45f8-b23b-39e53a75396a),restricted] + int t_INT; + + typedef [public] enum _a { a1, a2 } a; + typedef [public] enum aa { aa1, aa2 } aa; + typedef enum _b { b1, b2 } b; + typedef enum bb { bb1, bb2 } bb; + typedef [uuid(016fe2ec-b2c8-45f8-b23b-39e53a75396b)] enum _c { c1, c2 } c; + typedef [uuid(016fe2ec-b2c8-45f8-b23b-39e53a75396c)] enum cc { cc1, cc2 } cc; + + typedef [uuid(016fe2ec-b2c8-45f8-b23b-39e53a75396d),restricted,hidden] + enum _d { d1, d2 } d; + typedef [uuid(016fe2ec-b2c8-45f8-b23b-39e53a75396e),restricted,hidden] + enum dd { dd1, dd2 } dd; + + typedef [uuid(016fe2ec-b2c8-45f8-b23b-39e53a753970),restricted,hidden] + struct _e { int e1; } e; + typedef [uuid(016fe2ec-b2c8-45f8-b23b-39e53a753971),restricted,hidden] + struct ee { int ee1; } ee; + + typedef [uuid(016fe2ec-b2c8-45f8-b23b-39e53a753972),restricted,hidden] + union _f { int f1; BSTR *f2; } f; + typedef [uuid(016fe2ec-b2c8-45f8-b23b-39e53a753973),restricted,hidden] + union ff { int ff1; BSTR *ff2; } ff; + + [uuid(ec5dfcd6-eeb0-4cd6-b51e-8030e1dac00a)] + interface ITestIface : IDispatch + { + HRESULT test1(a value); + HRESULT test2(b value); + HRESULT test3(c value); + HRESULT test4(d value); + HRESULT test5(e value); + HRESULT test6(f value); + } } diff -Nru wine1.7-1.7.50/dlls/oleaut32/tests/tmarshal.c wine1.7-1.7.55/dlls/oleaut32/tests/tmarshal.c --- wine1.7-1.7.50/dlls/oleaut32/tests/tmarshal.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/oleaut32/tests/tmarshal.c 2015-11-13 14:32:40.000000000 +0000 @@ -825,7 +825,7 @@ return S_OK; } -static HRESULT WINAPI Widget__restrict(IWidget* iface, INT *i) +static HRESULT WINAPI Widget_pos_restrict(IWidget* iface, INT *i) { trace("restrict\n"); *i = DISPID_TM_RESTRICTED; @@ -839,6 +839,76 @@ return S_OK; } +static HRESULT WINAPI Widget_VarArg_Run( + IWidget *iface, BSTR name, SAFEARRAY *params, VARIANT *result) +{ + static const WCHAR catW[] = { 'C','a','t',0 }; + static const WCHAR supermanW[] = { 'S','u','p','e','r','m','a','n',0 }; + LONG bound; + VARIANT *var; + BSTR bstr; + HRESULT hr; + + trace("VarArg_Run(%p,%p,%p)\n", name, params, result); + + ok(!lstrcmpW(name, catW), "got %s\n", wine_dbgstr_w(name)); + + hr = SafeArrayGetLBound(params, 1, &bound); + ok(hr == S_OK, "SafeArrayGetLBound error %#x\n", hr); + ok(bound == 0, "expected 0, got %d\n", bound); + + hr = SafeArrayGetUBound(params, 1, &bound); + ok(hr == S_OK, "SafeArrayGetUBound error %#x\n", hr); + ok(bound == 0, "expected 0, got %d\n", bound); + + hr = SafeArrayAccessData(params, (void **)&var); + ok(hr == S_OK, "SafeArrayAccessData failed with %x\n", hr); + + ok(V_VT(&var[0]) == VT_BSTR, "expected VT_BSTR, got %d\n", V_VT(&var[0])); + bstr = V_BSTR(&var[0]); + ok(!lstrcmpW(bstr, supermanW), "got %s\n", wine_dbgstr_w(bstr)); + + hr = SafeArrayUnaccessData(params); + ok(hr == S_OK, "SafeArrayUnaccessData error %#x\n", hr); + + return S_OK; +} + +static HRESULT WINAPI Widget_VarArg_Ref_Run( + IWidget *iface, BSTR name, SAFEARRAY **params, VARIANT *result) +{ + static const WCHAR catW[] = { 'C','a','t',0 }; + static const WCHAR supermanW[] = { 'S','u','p','e','r','m','a','n',0 }; + LONG bound; + VARIANT *var; + BSTR bstr; + HRESULT hr; + + trace("VarArg_Ref_Run(%p,%p,%p)\n", name, params, result); + + ok(!lstrcmpW(name, catW), "got %s\n", wine_dbgstr_w(name)); + + hr = SafeArrayGetLBound(*params, 1, &bound); + ok(hr == S_OK, "SafeArrayGetLBound error %#x\n", hr); + ok(bound == 0, "expected 0, got %d\n", bound); + + hr = SafeArrayGetUBound(*params, 1, &bound); + ok(hr == S_OK, "SafeArrayGetUBound error %#x\n", hr); + ok(bound == 0, "expected 0, got %d\n", bound); + + hr = SafeArrayAccessData(*params, (void **)&var); + ok(hr == S_OK, "SafeArrayAccessData error %#x\n", hr); + + ok(V_VT(&var[0]) == VT_BSTR, "expected VT_BSTR, got %d\n", V_VT(&var[0])); + bstr = V_BSTR(&var[0]); + ok(!lstrcmpW(bstr, supermanW), "got %s\n", wine_dbgstr_w(bstr)); + + hr = SafeArrayUnaccessData(*params); + ok(hr == S_OK, "SafeArrayUnaccessData error %#x\n", hr); + + return S_OK; +} + static const struct IWidgetVtbl Widget_VTable = { Widget_QueryInterface, @@ -875,8 +945,10 @@ Widget_ByRefUInt, Widget_put_prop_opt_arg, Widget_put_prop_req_arg, - Widget__restrict, - Widget_neg_restrict + Widget_pos_restrict, + Widget_neg_restrict, + Widget_VarArg_Run, + Widget_VarArg_Ref_Run }; static HRESULT WINAPI StaticWidget_QueryInterface(IStaticWidget *iface, REFIID riid, void **ppvObject) @@ -1462,6 +1534,30 @@ ok_ole_success(hr, IDispatch_Invoke); VariantClear(&varresult); + /* call Array with BSTR argument - type mismatch */ + VariantInit(&vararg[0]); + V_VT(&vararg[0]) = VT_BSTR; + V_BSTR(&vararg[0]) = SysAllocString(szSuperman); + dispparams.cNamedArgs = 0; + dispparams.cArgs = 1; + dispparams.rgdispidNamedArgs = NULL; + dispparams.rgvarg = vararg; + hr = IDispatch_Invoke(pDispatch, DISPID_TM_ARRAY, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, NULL, NULL, NULL); + ok(hr == DISP_E_TYPEMISMATCH || hr == DISP_E_BADVARTYPE, "expected DISP_E_TYPEMISMATCH, got %#x\n", hr); + SysFreeString(V_BSTR(&vararg[0])); + + /* call ArrayPtr with BSTR argument - type mismatch */ + VariantInit(&vararg[0]); + V_VT(&vararg[0]) = VT_BSTR; + V_BSTR(&vararg[0]) = SysAllocString(szSuperman); + dispparams.cNamedArgs = 0; + dispparams.cArgs = 1; + dispparams.rgdispidNamedArgs = NULL; + dispparams.rgvarg = vararg; + hr = IDispatch_Invoke(pDispatch, DISPID_TM_VARARRAYPTR, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, NULL, NULL, NULL); + ok(hr == DISP_E_TYPEMISMATCH || hr == DISP_E_BADVARTYPE, "expected DISP_E_TYPEMISMATCH, got %#x\n", hr); + SysFreeString(V_BSTR(&vararg[0])); + /* call VariantCArray - test marshaling of variant arrays */ V_VT(&vararg[0]) = VT_I4; V_I4(&vararg[0]) = 1; @@ -1492,7 +1588,7 @@ dispparams.rgdispidNamedArgs = NULL; dispparams.rgvarg = vararg; hr = IDispatch_Invoke(pDispatch, DISPID_TM_VARARG, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, NULL, NULL, NULL); - ok_ole_success(hr, ITypeInfo_Invoke); + ok_ole_success(hr, IDispatch_Invoke); /* call VarArg, even one (non-optional, non-safearray) named argument is not allowed */ dispidNamed = 0; @@ -1502,6 +1598,38 @@ ok(hr == DISP_E_NONAMEDARGS, "IDispatch_Invoke should have returned DISP_E_NONAMEDARGS instead of 0x%08x\n", hr); dispidNamed = DISPID_PROPERTYPUT; + /* call VarArg_Run */ + VariantInit(&vararg[1]); + V_VT(&vararg[1]) = VT_BSTR; + V_BSTR(&vararg[1]) = SysAllocString(szCat); + VariantInit(&vararg[0]); + V_VT(&vararg[0]) = VT_BSTR; + V_BSTR(&vararg[0]) = SysAllocString(szSuperman); + dispparams.cNamedArgs = 0; + dispparams.cArgs = 2; + dispparams.rgdispidNamedArgs = NULL; + dispparams.rgvarg = vararg; + hr = IDispatch_Invoke(pDispatch, DISPID_TM_VARARG_RUN, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, NULL, NULL, NULL); + ok_ole_success(hr, IDispatch_Invoke); + SysFreeString(V_BSTR(&vararg[1])); + SysFreeString(V_BSTR(&vararg[0])); + + /* call VarArg_Ref_Run */ + VariantInit(&vararg[1]); + V_VT(&vararg[1]) = VT_BSTR; + V_BSTR(&vararg[1]) = SysAllocString(szCat); + VariantInit(&vararg[0]); + V_VT(&vararg[0]) = VT_BSTR; + V_BSTR(&vararg[0]) = SysAllocString(szSuperman); + dispparams.cNamedArgs = 0; + dispparams.cArgs = 2; + dispparams.rgdispidNamedArgs = NULL; + dispparams.rgvarg = vararg; + hr = IDispatch_Invoke(pDispatch, DISPID_TM_VARARG_REF_RUN, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, NULL, NULL, NULL); + ok_ole_success(hr, IDispatch_Invoke); + SysFreeString(V_BSTR(&vararg[1])); + SysFreeString(V_BSTR(&vararg[0])); + /* call Error */ dispparams.cNamedArgs = 0; dispparams.cArgs = 0; @@ -1909,6 +2037,9 @@ ok(hres == S_OK, "CoReleaseMarshalData failed: %08x\n", hres); ok(external_connections == 0, "external_connections = %d\n", external_connections); + IStream_Release(stream); + IStream_Release(stream2); + /* Weak table marshaling does not increment external connections */ hres = CreateStreamOnHGlobal(NULL, TRUE, &stream); ok(hres == S_OK, "CreateStreamOnHGlobal failed: %08x\n", hres); @@ -1927,6 +2058,8 @@ hres = CoReleaseMarshalData(stream); ok(hres == S_OK, "CoReleaseMarshalData failed: %08x\n", hres); ok(external_connections == 0, "external_connections = %d\n", external_connections); + + IStream_Release(stream); } START_TEST(tmarshal) diff -Nru wine1.7-1.7.50/dlls/oleaut32/tests/tmarshal_dispids.h wine1.7-1.7.55/dlls/oleaut32/tests/tmarshal_dispids.h --- wine1.7-1.7.50/dlls/oleaut32/tests/tmarshal_dispids.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/oleaut32/tests/tmarshal_dispids.h 2015-11-13 14:32:40.000000000 +0000 @@ -44,6 +44,8 @@ #define DISPID_TM_RESTRICTED 25 #define DISPID_TM_NEG_RESTRICTED -26 #define DISPID_TM_TESTSECONDIFACE 27 +#define DISPID_TM_VARARG_RUN 28 +#define DISPID_TM_VARARG_REF_RUN 29 #define DISPID_NOA_BSTRRET 1 #define DISPID_NOA_ERROR 2 diff -Nru wine1.7-1.7.50/dlls/oleaut32/tests/tmarshal.idl wine1.7-1.7.55/dlls/oleaut32/tests/tmarshal.idl --- wine1.7-1.7.50/dlls/oleaut32/tests/tmarshal.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/oleaut32/tests/tmarshal.idl 2015-11-13 14:32:40.000000000 +0000 @@ -175,10 +175,16 @@ HRESULT prop_req_arg([in] INT req, [in] INT i); [id(DISPID_TM_RESTRICTED), restricted] - HRESULT _restrict([out, retval] INT *i); + HRESULT pos_restrict([out, retval] INT *i); [id(DISPID_TM_NEG_RESTRICTED), restricted] HRESULT neg_restrict([out, retval] INT *i); + + [id(DISPID_TM_VARARG_RUN), vararg] + HRESULT VarArg_Run([in] BSTR name, [in] SAFEARRAY(VARIANT) params, [out, retval] VARIANT *result); + + [id(DISPID_TM_VARARG_REF_RUN), vararg] + HRESULT VarArg_Ref_Run([in] BSTR name, [in] SAFEARRAY(VARIANT) *params, [out, retval] VARIANT *result); } [ diff -Nru wine1.7-1.7.50/dlls/oleaut32/tests/typelib.c wine1.7-1.7.55/dlls/oleaut32/tests/typelib.c --- wine1.7-1.7.50/dlls/oleaut32/tests/typelib.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/oleaut32/tests/typelib.c 2015-11-13 14:32:40.000000000 +0000 @@ -2,7 +2,7 @@ * ITypeLib and ITypeInfo test * * Copyright 2004 Jacek Caban - * Copyright 2006 Dmitry Timoshkov + * Copyright 2006,2015 Dmitry Timoshkov * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,12 +19,16 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define NONAMELESSSTRUCT +#define NONAMELESSUNION + #define COBJMACROS #define CONST_VTABLE #include #include #include +#include #include "windef.h" #include "winbase.h" @@ -41,7 +45,7 @@ #define expect_int(expr, value) expect_eq(expr, (int)(value), int, "%d") #define expect_hex(expr, value) expect_eq(expr, (int)(value), int, "0x%x") #define expect_null(expr) expect_eq(expr, NULL, const void *, "%p") -#define expect_guid(expected, guid) { ok(IsEqualGUID(expected, guid), "got wrong guid\n"); } +#define expect_guid(expected, guid) { ok(IsEqualGUID(expected, guid), "got wrong guid %s\n", wine_dbgstr_guid(guid)); } #define expect_wstr_acpval(expr, value) \ { \ @@ -71,8 +75,8 @@ #define ARCH "none" #endif -static HRESULT WINAPI (*pRegisterTypeLibForUser)(ITypeLib*,OLECHAR*,OLECHAR*); -static HRESULT WINAPI (*pUnRegisterTypeLibForUser)(REFGUID,WORD,WORD,LCID,SYSKIND); +static HRESULT (WINAPI *pRegisterTypeLibForUser)(ITypeLib*,OLECHAR*,OLECHAR*); +static HRESULT (WINAPI *pUnRegisterTypeLibForUser)(REFGUID,WORD,WORD,LCID,SYSKIND); static BOOL (WINAPI *pActivateActCtx)(HANDLE,ULONG_PTR*); static HANDLE (WINAPI *pCreateActCtxW)(PCACTCTXW); @@ -3662,11 +3666,9 @@ static char *dump_string(LPWSTR wstr) { - int size = lstrlenW(wstr)+3; + int size = lstrlenW(wstr)+1; char *out = CoTaskMemAlloc(size); - WideCharToMultiByte(20127, 0, wstr, -1, out+1, size, NULL, NULL); - out[0] = '\"'; - strcat(out, "\""); + WideCharToMultiByte(20127, 0, wstr, -1, out, size, NULL, NULL); return out; } @@ -3707,9 +3709,95 @@ {0, NULL} }; +static const struct map_entry callconv_map[] = { + MAP_ENTRY(CC_FASTCALL), + MAP_ENTRY(CC_CDECL), + MAP_ENTRY(CC_PASCAL), + MAP_ENTRY(CC_MACPASCAL), + MAP_ENTRY(CC_STDCALL), + MAP_ENTRY(CC_FPFASTCALL), + MAP_ENTRY(CC_SYSCALL), + MAP_ENTRY(CC_MPWCDECL), + MAP_ENTRY(CC_MPWPASCAL), + {0, NULL} +}; + +static const struct map_entry vt_map[] = { + MAP_ENTRY(VT_EMPTY), + MAP_ENTRY(VT_NULL), + MAP_ENTRY(VT_I2), + MAP_ENTRY(VT_I4), + MAP_ENTRY(VT_R4), + MAP_ENTRY(VT_R8), + MAP_ENTRY(VT_CY), + MAP_ENTRY(VT_DATE), + MAP_ENTRY(VT_BSTR), + MAP_ENTRY(VT_DISPATCH), + MAP_ENTRY(VT_ERROR), + MAP_ENTRY(VT_BOOL), + MAP_ENTRY(VT_VARIANT), + MAP_ENTRY(VT_UNKNOWN), + MAP_ENTRY(VT_DECIMAL), + MAP_ENTRY(15), + MAP_ENTRY(VT_I1), + MAP_ENTRY(VT_UI1), + MAP_ENTRY(VT_UI2), + MAP_ENTRY(VT_UI4), + MAP_ENTRY(VT_I8), + MAP_ENTRY(VT_UI8), + MAP_ENTRY(VT_INT), + MAP_ENTRY(VT_UINT), + MAP_ENTRY(VT_VOID), + MAP_ENTRY(VT_HRESULT), + MAP_ENTRY(VT_PTR), + MAP_ENTRY(VT_SAFEARRAY), + MAP_ENTRY(VT_CARRAY), + MAP_ENTRY(VT_USERDEFINED), + MAP_ENTRY(VT_LPSTR), + MAP_ENTRY(VT_LPWSTR), + MAP_ENTRY(VT_RECORD), + MAP_ENTRY(VT_INT_PTR), + MAP_ENTRY(VT_UINT_PTR), + MAP_ENTRY(39), + MAP_ENTRY(40), + MAP_ENTRY(41), + MAP_ENTRY(42), + MAP_ENTRY(43), + MAP_ENTRY(44), + MAP_ENTRY(45), + MAP_ENTRY(46), + MAP_ENTRY(47), + MAP_ENTRY(48), + MAP_ENTRY(49), + MAP_ENTRY(50), + MAP_ENTRY(51), + MAP_ENTRY(52), + MAP_ENTRY(53), + MAP_ENTRY(54), + MAP_ENTRY(55), + MAP_ENTRY(56), + MAP_ENTRY(57), + MAP_ENTRY(58), + MAP_ENTRY(59), + MAP_ENTRY(60), + MAP_ENTRY(61), + MAP_ENTRY(62), + MAP_ENTRY(63), + MAP_ENTRY(VT_FILETIME), + MAP_ENTRY(VT_BLOB), + MAP_ENTRY(VT_STREAM), + MAP_ENTRY(VT_STORAGE), + MAP_ENTRY(VT_STREAMED_OBJECT), + MAP_ENTRY(VT_STORED_OBJECT), + MAP_ENTRY(VT_BLOB_OBJECT), + MAP_ENTRY(VT_CF), + MAP_ENTRY(VT_CLSID), + {0, NULL} +}; + #undef MAP_ENTRY -static const char *map_value(DWORD val, const struct map_entry *map) +static const char *map_value(int val, const struct map_entry *map) { static int map_id; static char bufs[16][256]; @@ -3723,10 +3811,152 @@ } buf = bufs[(map_id++)%16]; - sprintf(buf, "0x%x", val); + sprintf(buf, "%d", val); return buf; } +static const char *dump_type_flags(DWORD flags) +{ + static char buf[256]; + + if (!flags) return "0"; + + buf[0] = 0; + +#define ADD_FLAG(x) if (flags & x) { if (buf[0]) strcat(buf, "|"); strcat(buf, #x); flags &= ~x; } + ADD_FLAG(TYPEFLAG_FPROXY) + ADD_FLAG(TYPEFLAG_FREVERSEBIND) + ADD_FLAG(TYPEFLAG_FDISPATCHABLE) + ADD_FLAG(TYPEFLAG_FREPLACEABLE) + ADD_FLAG(TYPEFLAG_FAGGREGATABLE) + ADD_FLAG(TYPEFLAG_FRESTRICTED) + ADD_FLAG(TYPEFLAG_FOLEAUTOMATION) + ADD_FLAG(TYPEFLAG_FNONEXTENSIBLE) + ADD_FLAG(TYPEFLAG_FDUAL) + ADD_FLAG(TYPEFLAG_FCONTROL) + ADD_FLAG(TYPEFLAG_FHIDDEN) + ADD_FLAG(TYPEFLAG_FPREDECLID) + ADD_FLAG(TYPEFLAG_FLICENSED) + ADD_FLAG(TYPEFLAG_FCANCREATE) + ADD_FLAG(TYPEFLAG_FAPPOBJECT) +#undef ADD_FLAG + + assert(!flags); + assert(strlen(buf) < sizeof(buf)); + + return buf; +} + +static char *print_size(BSTR name, TYPEATTR *attr) +{ + static char buf[256]; + + switch (attr->typekind) + { + case TKIND_DISPATCH: + case TKIND_INTERFACE: + sprintf(buf, "sizeof(%s*)", dump_string(name)); + break; + + case TKIND_RECORD: + sprintf(buf, "sizeof(struct %s)", dump_string(name)); + break; + + case TKIND_UNION: + sprintf(buf, "sizeof(union %s)", dump_string(name)); + break; + + case TKIND_ENUM: + case TKIND_ALIAS: + sprintf(buf, "4"); + break; + + default: + assert(0); + return NULL; + } + + return buf; +} + +static const char *dump_param_flags(DWORD flags) +{ + static char buf[256]; + + if (!flags) return "PARAMFLAG_NONE"; + + buf[0] = 0; + +#define ADD_FLAG(x) if (flags & x) { if (buf[0]) strcat(buf, "|"); strcat(buf, #x); flags &= ~x; } + ADD_FLAG(PARAMFLAG_FIN) + ADD_FLAG(PARAMFLAG_FOUT) + ADD_FLAG(PARAMFLAG_FLCID) + ADD_FLAG(PARAMFLAG_FRETVAL) + ADD_FLAG(PARAMFLAG_FOPT) + ADD_FLAG(PARAMFLAG_FHASDEFAULT) + ADD_FLAG(PARAMFLAG_FHASCUSTDATA) +#undef ADD_FLAG + + assert(!flags); + assert(strlen(buf) < sizeof(buf)); + + return buf; +} + +static const char *dump_func_flags(DWORD flags) +{ + static char buf[256]; + + if (!flags) return "0"; + + buf[0] = 0; + +#define ADD_FLAG(x) if (flags & x) { if (buf[0]) strcat(buf, "|"); strcat(buf, #x); flags &= ~x; } + ADD_FLAG(FUNCFLAG_FRESTRICTED) + ADD_FLAG(FUNCFLAG_FSOURCE) + ADD_FLAG(FUNCFLAG_FBINDABLE) + ADD_FLAG(FUNCFLAG_FREQUESTEDIT) + ADD_FLAG(FUNCFLAG_FDISPLAYBIND) + ADD_FLAG(FUNCFLAG_FDEFAULTBIND) + ADD_FLAG(FUNCFLAG_FHIDDEN) + ADD_FLAG(FUNCFLAG_FUSESGETLASTERROR) + ADD_FLAG(FUNCFLAG_FDEFAULTCOLLELEM) + ADD_FLAG(FUNCFLAG_FUIDEFAULT) + ADD_FLAG(FUNCFLAG_FNONBROWSABLE) + ADD_FLAG(FUNCFLAG_FREPLACEABLE) + ADD_FLAG(FUNCFLAG_FIMMEDIATEBIND) +#undef ADD_FLAG + + assert(!flags); + assert(strlen(buf) < sizeof(buf)); + + return buf; +} + +static int get_href_type(ITypeInfo *info, TYPEDESC *tdesc) +{ + int href_type = -1; + + if (tdesc->vt == VT_USERDEFINED) + { + HRESULT hr; + ITypeInfo *param; + TYPEATTR *attr; + + hr = ITypeInfo_GetRefTypeInfo(info, U(*tdesc).hreftype, ¶m); + ok(hr == S_OK, "GetRefTypeInfo error %#x\n", hr); + hr = ITypeInfo_GetTypeAttr(param, &attr); + ok(hr == S_OK, "GetTypeAttr error %#x\n", hr); + + href_type = attr->typekind; + + ITypeInfo_ReleaseTypeAttr(param, attr); + ITypeInfo_Release(param); + } + + return href_type; +} + static void test_dump_typelib(const char *name) { WCHAR wszString[260]; @@ -3737,27 +3967,36 @@ MultiByteToWideChar(CP_ACP, 0, name, -1, wszString, 260); OLE_CHECK(LoadTypeLib(wszString, &lib)); + + printf("/*** Autogenerated data. Do not edit, change the generator above instead. ***/\n"); + count = ITypeLib_GetTypeInfoCount(lib); - printf("/* interfaces count: %d */\n", count); for (i = 0; i < count; i++) { TYPEATTR *attr; BSTR name; + DWORD help_ctx; int f = 0; - OLE_CHECK(ITypeLib_GetDocumentation(lib, i, &name, NULL, NULL, NULL)); + OLE_CHECK(ITypeLib_GetDocumentation(lib, i, &name, NULL, &help_ctx, NULL)); printf("{\n" - " %s,\n", dump_string(name)); - SysFreeString(name); + " \"%s\",\n", dump_string(name)); OLE_CHECK(ITypeLib_GetTypeInfo(lib, i, &info)); - ITypeInfo_GetTypeAttr(info, &attr); - printf(" /*kind*/ %s, /*flags*/ 0x%x, /*align*/ %d, /*size*/ %d,\n" - " /*#vtbl*/ %d, /*#func*/ %d,\n" - " {\n", - map_value(attr->typekind, tkind_map), attr->wTypeFlags, attr->cbAlignment, attr->cbSizeInstance, attr->cbSizeVft, - attr->cFuncs); - ITypeInfo_ReleaseTypeAttr(info, attr); + OLE_CHECK(ITypeInfo_GetTypeAttr(info, &attr)); + + printf(" \"%s\",\n", wine_dbgstr_guid(&attr->guid)); + + printf(" /*kind*/ %s, /*flags*/ %s, /*align*/ %d, /*size*/ %s,\n" + " /*helpctx*/ 0x%04x, /*version*/ 0x%08x, /*#vtbl*/ %d, /*#func*/ %d", + map_value(attr->typekind, tkind_map), dump_type_flags(attr->wTypeFlags), + attr->cbAlignment, print_size(name, attr), + help_ctx, MAKELONG(attr->wMinorVerNum, attr->wMajorVerNum), + attr->cbSizeVft/sizeof(void*), attr->cFuncs); + + if (attr->cFuncs) printf(",\n {\n"); + else printf("\n"); + while (1) { FUNCDESC *desc; @@ -3768,25 +4007,27 @@ if (FAILED(ITypeInfo_GetFuncDesc(info, f, &desc))) break; printf(" {\n" - " 0x%x, /*func*/ %s, /*inv*/ %s, /*call*/ 0x%x,\n", + " /*id*/ 0x%x, /*func*/ %s, /*inv*/ %s, /*call*/ %s,\n", desc->memid, map_value(desc->funckind, funckind_map), map_value(desc->invkind, invkind_map), - desc->callconv); - printf(" /*#param*/ %d, /*#opt*/ %d, /*vtbl*/ %d, /*#scodes*/ %d, /*flags*/ 0x%x,\n", - desc->cParams, desc->cParamsOpt, desc->oVft, desc->cScodes, desc->wFuncFlags); - printf(" {%d, %x}, /* ret */\n", desc->elemdescFunc.tdesc.vt, desc->elemdescFunc.paramdesc.wParamFlags); + map_value(desc->callconv, callconv_map)); + printf(" /*#param*/ %d, /*#opt*/ %d, /*vtbl*/ %d, /*#scodes*/ %d, /*flags*/ %s,\n", + desc->cParams, desc->cParamsOpt, desc->oVft/sizeof(void*), desc->cScodes, dump_func_flags(desc->wFuncFlags)); + printf(" {%s, %s, %s}, /* ret */\n", map_value(desc->elemdescFunc.tdesc.vt, vt_map), + map_value(get_href_type(info, &desc->elemdescFunc.tdesc), tkind_map), dump_param_flags(U(desc->elemdescFunc).paramdesc.wParamFlags)); printf(" { /* params */\n"); for (p = 0; p < desc->cParams; p++) { ELEMDESC e = desc->lprgelemdescParam[p]; - printf(" {%d, %x},\n", e.tdesc.vt, e.paramdesc.wParamFlags); + printf(" {%s, %s, %s},\n", map_value(e.tdesc.vt, vt_map), + map_value(get_href_type(info, &e.tdesc), tkind_map), dump_param_flags(U(e).paramdesc.wParamFlags)); } - printf(" {-1, -1}\n"); + printf(" {-1, 0, 0}\n"); printf(" },\n"); printf(" { /* names */\n"); OLE_CHECK(ITypeInfo_GetNames(info, desc->memid, tab, 256, &cNames)); for (p = 0; p < cNames; p++) { - printf(" %s,\n", dump_string(tab[p])); + printf(" \"%s\",\n", dump_string(tab[p])); SysFreeString(tab[p]); } printf(" NULL,\n"); @@ -3795,9 +4036,11 @@ ITypeInfo_ReleaseFuncDesc(info, desc); f++; } - printf(" }\n"); + if (attr->cFuncs) printf(" }\n"); printf("},\n"); + ITypeInfo_ReleaseTypeAttr(info, attr); ITypeInfo_Release(info); + SysFreeString(name); } ITypeLib_Release(lib); } @@ -3807,6 +4050,7 @@ typedef struct _element_info { VARTYPE vt; + TYPEKIND type; USHORT wParamFlags; } element_info; @@ -3834,26 +4078,135 @@ WORD wTypeFlags; USHORT cbAlignment; USHORT cbSizeInstance; + USHORT help_ctx; + DWORD version; USHORT cbSizeVft; USHORT cFuncs; function_info funcs[20]; } type_info; static const type_info info[] = { +/*** Autogenerated data. Do not edit, change the generator above instead. ***/ +{ + "g", + "{b14b6bb5-904e-4ff9-b247-bd361f7a0001}", + /*kind*/ TKIND_RECORD, /*flags*/ 0, /*align*/ 4, /*size*/ sizeof(struct g), + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0 +}, +{ + "test_iface", + "{b14b6bb5-904e-4ff9-b247-bd361f7a0002}", + /*kind*/ TKIND_INTERFACE, /*flags*/ 0, /*align*/ 4, /*size*/ sizeof(test_iface*), + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 4, /*#func*/ 1, + { + { + /*id*/ 0x60010000, /*func*/ FUNC_PUREVIRTUAL, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, + /*#param*/ 1, /*#opt*/ 0, /*vtbl*/ 3, /*#scodes*/ 0, /*flags*/ 0, + {VT_HRESULT, -1, PARAMFLAG_NONE}, /* ret */ + { /* params */ + {VT_PTR, -1, PARAMFLAG_FIN}, + {-1, 0, 0} + }, + { /* names */ + "Test", + "ptr", + NULL, + }, + }, + } +}, +{ + "parent_iface", + "{b14b6bb5-904e-4ff9-b247-bd361f7aa001}", + /*kind*/ TKIND_INTERFACE, /*flags*/ 0, /*align*/ 4, /*size*/ sizeof(parent_iface*), + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 4, /*#func*/ 1, + { + { + /*id*/ 0x60010000, /*func*/ FUNC_PUREVIRTUAL, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, + /*#param*/ 1, /*#opt*/ 0, /*vtbl*/ 3, /*#scodes*/ 0, /*flags*/ 0, + {VT_HRESULT, -1, PARAMFLAG_NONE}, /* ret */ + { /* params */ + {VT_PTR, -1, PARAMFLAG_FOUT|PARAMFLAG_FRETVAL}, + {-1, 0, 0} + }, + { /* names */ + "test1", + "iface", + NULL, + }, + }, + } +}, +{ + "child_iface", + "{b14b6bb5-904e-4ff9-b247-bd361f7aa002}", + /*kind*/ TKIND_INTERFACE, /*flags*/ 0, /*align*/ 4, /*size*/ sizeof(child_iface*), + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 5, /*#func*/ 1, + { + { + /*id*/ 0x60020000, /*func*/ FUNC_PUREVIRTUAL, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, + /*#param*/ 0, /*#opt*/ 0, /*vtbl*/ 4, /*#scodes*/ 0, /*flags*/ 0, + {VT_HRESULT, -1, PARAMFLAG_NONE}, /* ret */ + { /* params */ + {-1, 0, 0} + }, + { /* names */ + "test2", + NULL, + }, + }, + } +}, +{ + "_n", + "{016fe2ec-b2c8-45f8-b23b-39e53a753903}", + /*kind*/ TKIND_RECORD, /*flags*/ 0, /*align*/ 4, /*size*/ sizeof(struct _n), + /*helpctx*/ 0x0003, /*version*/ 0x00010002, /*#vtbl*/ 0, /*#func*/ 0 +}, +{ + "n", + "{016fe2ec-b2c8-45f8-b23b-39e53a753902}", + /*kind*/ TKIND_ALIAS, /*flags*/ TYPEFLAG_FHIDDEN, /*align*/ 4, /*size*/ 4, + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0 +}, +{ + "nn", + "{00000000-0000-0000-0000-000000000000}", + /*kind*/ TKIND_ALIAS, /*flags*/ 0, /*align*/ 4, /*size*/ 4, + /*helpctx*/ 0x0003, /*version*/ 0x00010002, /*#vtbl*/ 0, /*#func*/ 0 +}, +{ + "_m", + "{016fe2ec-b2c8-45f8-b23b-39e53a753906}", + /*kind*/ TKIND_RECORD, /*flags*/ 0, /*align*/ 4, /*size*/ sizeof(struct _m), + /*helpctx*/ 0x0003, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0 +}, +{ + "m", + "{016fe2ec-b2c8-45f8-b23b-39e53a753905}", + /*kind*/ TKIND_ALIAS, /*flags*/ TYPEFLAG_FHIDDEN, /*align*/ 4, /*size*/ 4, + /*helpctx*/ 0x0000, /*version*/ 0x00010002, /*#vtbl*/ 0, /*#func*/ 0 +}, +{ + "mm", + "{00000000-0000-0000-0000-000000000000}", + /*kind*/ TKIND_ALIAS, /*flags*/ 0, /*align*/ 4, /*size*/ 4, + /*helpctx*/ 0x0003, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0 +}, { "IDualIface", "{b14b6bb5-904e-4ff9-b247-bd361f7aaedd}", - /*kind*/ TKIND_DISPATCH, /*flags*/ TYPEFLAG_FDISPATCHABLE|TYPEFLAG_FDUAL, /*align*/ 4, /*size*/ sizeof(void*), - /*#vtbl*/ 7, /*#func*/ 8, + /*kind*/ TKIND_DISPATCH, /*flags*/ TYPEFLAG_FDISPATCHABLE|TYPEFLAG_FDUAL, /*align*/ 4, /*size*/ sizeof(IDualIface*), + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 7, /*#func*/ 8, { { - 0x60000000, /*func*/ FUNC_DISPATCH, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, - /*#param*/ 2, /*#opt*/ 0, /*vtbl*/ 0, /*#scodes*/ 0, /*flags*/ 0x1, - {24, 0}, /* ret */ + /*id*/ 0x60000000, /*func*/ FUNC_DISPATCH, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, + /*#param*/ 2, /*#opt*/ 0, /*vtbl*/ 0, /*#scodes*/ 0, /*flags*/ FUNCFLAG_FRESTRICTED, + {VT_VOID, -1, PARAMFLAG_NONE}, /* ret */ { /* params */ - {26, 1}, - {26, 2}, - {-1, -1} + {VT_PTR, -1, PARAMFLAG_FIN}, + {VT_PTR, -1, PARAMFLAG_FOUT}, + {-1, 0, 0} }, { /* names */ "QueryInterface", @@ -3863,11 +4216,11 @@ }, }, { - 0x60000001, /*func*/ FUNC_DISPATCH, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, - /*#param*/ 0, /*#opt*/ 0, /*vtbl*/ 1, /*#scodes*/ 0, /*flags*/ 0x1, - {19, 0}, /* ret */ + /*id*/ 0x60000001, /*func*/ FUNC_DISPATCH, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, + /*#param*/ 0, /*#opt*/ 0, /*vtbl*/ 1, /*#scodes*/ 0, /*flags*/ FUNCFLAG_FRESTRICTED, + {VT_UI4, -1, PARAMFLAG_NONE}, /* ret */ { /* params */ - {-1, -1} + {-1, 0, 0} }, { /* names */ "AddRef", @@ -3875,11 +4228,11 @@ }, }, { - 0x60000002, /*func*/ FUNC_DISPATCH, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, - /*#param*/ 0, /*#opt*/ 0, /*vtbl*/ 2, /*#scodes*/ 0, /*flags*/ 0x1, - {19, 0}, /* ret */ + /*id*/ 0x60000002, /*func*/ FUNC_DISPATCH, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, + /*#param*/ 0, /*#opt*/ 0, /*vtbl*/ 2, /*#scodes*/ 0, /*flags*/ FUNCFLAG_FRESTRICTED, + {VT_UI4, -1, PARAMFLAG_NONE}, /* ret */ { /* params */ - {-1, -1} + {-1, 0, 0} }, { /* names */ "Release", @@ -3887,12 +4240,12 @@ }, }, { - 0x60010000, /*func*/ FUNC_DISPATCH, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, - /*#param*/ 1, /*#opt*/ 0, /*vtbl*/ 3, /*#scodes*/ 0, /*flags*/ 0x1, - {24, 0}, /* ret */ + /*id*/ 0x60010000, /*func*/ FUNC_DISPATCH, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, + /*#param*/ 1, /*#opt*/ 0, /*vtbl*/ 3, /*#scodes*/ 0, /*flags*/ FUNCFLAG_FRESTRICTED, + {VT_VOID, -1, PARAMFLAG_NONE}, /* ret */ { /* params */ - {26, 2}, - {-1, -1} + {VT_PTR, -1, PARAMFLAG_FOUT}, + {-1, 0, 0} }, { /* names */ "GetTypeInfoCount", @@ -3901,14 +4254,14 @@ }, }, { - 0x60010001, /*func*/ FUNC_DISPATCH, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, - /*#param*/ 3, /*#opt*/ 0, /*vtbl*/ 4, /*#scodes*/ 0, /*flags*/ 0x1, - {24, 0}, /* ret */ + /*id*/ 0x60010001, /*func*/ FUNC_DISPATCH, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, + /*#param*/ 3, /*#opt*/ 0, /*vtbl*/ 4, /*#scodes*/ 0, /*flags*/ FUNCFLAG_FRESTRICTED, + {VT_VOID, -1, PARAMFLAG_NONE}, /* ret */ { /* params */ - {23, 1}, - {19, 1}, - {26, 2}, - {-1, -1} + {VT_UINT, -1, PARAMFLAG_FIN}, + {VT_UI4, -1, PARAMFLAG_FIN}, + {VT_PTR, -1, PARAMFLAG_FOUT}, + {-1, 0, 0} }, { /* names */ "GetTypeInfo", @@ -3919,16 +4272,16 @@ }, }, { - 0x60010002, /*func*/ FUNC_DISPATCH, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, - /*#param*/ 5, /*#opt*/ 0, /*vtbl*/ 5, /*#scodes*/ 0, /*flags*/ 0x1, - {24, 0}, /* ret */ + /*id*/ 0x60010002, /*func*/ FUNC_DISPATCH, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, + /*#param*/ 5, /*#opt*/ 0, /*vtbl*/ 5, /*#scodes*/ 0, /*flags*/ FUNCFLAG_FRESTRICTED, + {VT_VOID, -1, PARAMFLAG_NONE}, /* ret */ { /* params */ - {26, 1}, - {26, 1}, - {23, 1}, - {19, 1}, - {26, 2}, - {-1, -1} + {VT_PTR, -1, PARAMFLAG_FIN}, + {VT_PTR, -1, PARAMFLAG_FIN}, + {VT_UINT, -1, PARAMFLAG_FIN}, + {VT_UI4, -1, PARAMFLAG_FIN}, + {VT_PTR, -1, PARAMFLAG_FOUT}, + {-1, 0, 0} }, { /* names */ "GetIDsOfNames", @@ -3941,19 +4294,19 @@ }, }, { - 0x60010003, /*func*/ FUNC_DISPATCH, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, - /*#param*/ 8, /*#opt*/ 0, /*vtbl*/ 6, /*#scodes*/ 0, /*flags*/ 0x1, - {24, 0}, /* ret */ + /*id*/ 0x60010003, /*func*/ FUNC_DISPATCH, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, + /*#param*/ 8, /*#opt*/ 0, /*vtbl*/ 6, /*#scodes*/ 0, /*flags*/ FUNCFLAG_FRESTRICTED, + {VT_VOID, -1, PARAMFLAG_NONE}, /* ret */ { /* params */ - {3, 1}, - {26, 1}, - {19, 1}, - {18, 1}, - {26, 1}, - {26, 2}, - {26, 2}, - {26, 2}, - {-1, -1} + {VT_I4, -1, PARAMFLAG_FIN}, + {VT_PTR, -1, PARAMFLAG_FIN}, + {VT_UI4, -1, PARAMFLAG_FIN}, + {VT_UI2, -1, PARAMFLAG_FIN}, + {VT_PTR, -1, PARAMFLAG_FIN}, + {VT_PTR, -1, PARAMFLAG_FOUT}, + {VT_PTR, -1, PARAMFLAG_FOUT}, + {VT_PTR, -1, PARAMFLAG_FOUT}, + {-1, 0, 0} }, { /* names */ "Invoke", @@ -3969,11 +4322,11 @@ }, }, { - 0x60020000, /*func*/ FUNC_DISPATCH, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, - /*#param*/ 0, /*#opt*/ 0, /*vtbl*/ 7, /*#scodes*/ 0, /*flags*/ 0x0, - {24, 0}, /* ret */ + /*id*/ 0x60020000, /*func*/ FUNC_DISPATCH, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, + /*#param*/ 0, /*#opt*/ 0, /*vtbl*/ 7, /*#scodes*/ 0, /*flags*/ 0, + {VT_VOID, -1, PARAMFLAG_NONE}, /* ret */ { /* params */ - {-1, -1} + {-1, 0, 0} }, { /* names */ "Test", @@ -3985,15 +4338,15 @@ { "ISimpleIface", "{ec5dfcd6-eeb0-4cd6-b51e-8030e1dac009}", - /*kind*/ TKIND_INTERFACE, /*flags*/ TYPEFLAG_FDISPATCHABLE, /*align*/ 4, /*size*/ sizeof(void*), - /*#vtbl*/ 8, /*#func*/ 1, + /*kind*/ TKIND_INTERFACE, /*flags*/ TYPEFLAG_FDISPATCHABLE, /*align*/ 4, /*size*/ sizeof(ISimpleIface*), + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 8, /*#func*/ 1, { { - 0x60020000, /*func*/ FUNC_PUREVIRTUAL, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, - /*#param*/ 0, /*#opt*/ 0, /*vtbl*/ 7, /*#scodes*/ 0, /*flags*/ 0x0, - {25, 0}, /* ret */ + /*id*/ 0x60020000, /*func*/ FUNC_PUREVIRTUAL, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, + /*#param*/ 0, /*#opt*/ 0, /*vtbl*/ 7, /*#scodes*/ 0, /*flags*/ 0, + {VT_HRESULT, -1, PARAMFLAG_NONE}, /* ret */ { /* params */ - {-1, -1} + {-1, 0, 0} }, { /* names */ "Test", @@ -4005,12 +4358,214 @@ { "test_struct", "{4029f190-ca4a-4611-aeb9-673983cb96dd}", - /* kind */ TKIND_RECORD, /*flags*/ 0, /*align*/ 4, /*size*/ sizeof(struct test_struct) + /*kind*/ TKIND_RECORD, /*flags*/ 0, /*align*/ 4, /*size*/ sizeof(struct test_struct), + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0 }, { "test_struct2", "{4029f190-ca4a-4611-aeb9-673983cb96de}", - /* kind */ TKIND_RECORD, /*flags*/ 0, /*align*/ 4, /*size*/ sizeof(struct test_struct) + /*kind*/ TKIND_RECORD, /*flags*/ 0, /*align*/ 4, /*size*/ sizeof(struct test_struct2), + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0 +}, +{ + "t_INT", + "{016fe2ec-b2c8-45f8-b23b-39e53a75396a}", + /*kind*/ TKIND_ALIAS, /*flags*/ TYPEFLAG_FRESTRICTED, /*align*/ 4, /*size*/ 4, + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0 +}, +{ + "a", + "{00000000-0000-0000-0000-000000000000}", + /*kind*/ TKIND_ALIAS, /*flags*/ 0, /*align*/ 4, /*size*/ 4, + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0 +}, +{ + "_a", + "{00000000-0000-0000-0000-000000000000}", + /*kind*/ TKIND_ENUM, /*flags*/ 0, /*align*/ 4, /*size*/ 4, + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0 +}, +{ + "aa", + "{00000000-0000-0000-0000-000000000000}", + /*kind*/ TKIND_ENUM, /*flags*/ 0, /*align*/ 4, /*size*/ 4, + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0 +}, +{ + "_b", + "{00000000-0000-0000-0000-000000000000}", + /*kind*/ TKIND_ENUM, /*flags*/ 0, /*align*/ 4, /*size*/ 4, + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0 +}, +{ + "bb", + "{00000000-0000-0000-0000-000000000000}", + /*kind*/ TKIND_ENUM, /*flags*/ 0, /*align*/ 4, /*size*/ 4, + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0 +}, +{ + "c", + "{016fe2ec-b2c8-45f8-b23b-39e53a75396b}", + /*kind*/ TKIND_ALIAS, /*flags*/ 0, /*align*/ 4, /*size*/ 4, + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0 +}, +{ + "_c", + "{00000000-0000-0000-0000-000000000000}", + /*kind*/ TKIND_ENUM, /*flags*/ 0, /*align*/ 4, /*size*/ 4, + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0 +}, +{ + "cc", + "{016fe2ec-b2c8-45f8-b23b-39e53a75396c}", + /*kind*/ TKIND_ENUM, /*flags*/ 0, /*align*/ 4, /*size*/ 4, + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0 +}, +{ + "d", + "{016fe2ec-b2c8-45f8-b23b-39e53a75396d}", + /*kind*/ TKIND_ALIAS, /*flags*/ TYPEFLAG_FRESTRICTED|TYPEFLAG_FHIDDEN, /*align*/ 4, /*size*/ 4, + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0 +}, +{ + "_d", + "{00000000-0000-0000-0000-000000000000}", + /*kind*/ TKIND_ENUM, /*flags*/ TYPEFLAG_FRESTRICTED|TYPEFLAG_FHIDDEN, /*align*/ 4, /*size*/ 4, + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0 +}, +{ + "dd", + "{016fe2ec-b2c8-45f8-b23b-39e53a75396e}", + /*kind*/ TKIND_ENUM, /*flags*/ TYPEFLAG_FRESTRICTED|TYPEFLAG_FHIDDEN, /*align*/ 4, /*size*/ 4, + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0 +}, +{ + "e", + "{016fe2ec-b2c8-45f8-b23b-39e53a753970}", + /*kind*/ TKIND_ALIAS, /*flags*/ TYPEFLAG_FRESTRICTED|TYPEFLAG_FHIDDEN, /*align*/ 4, /*size*/ 4, + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0 +}, +{ + "_e", + "{00000000-0000-0000-0000-000000000000}", + /*kind*/ TKIND_RECORD, /*flags*/ TYPEFLAG_FRESTRICTED|TYPEFLAG_FHIDDEN, /*align*/ 4, /*size*/ sizeof(struct _e), + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0 +}, +{ + "ee", + "{016fe2ec-b2c8-45f8-b23b-39e53a753971}", + /*kind*/ TKIND_RECORD, /*flags*/ TYPEFLAG_FRESTRICTED|TYPEFLAG_FHIDDEN, /*align*/ 4, /*size*/ sizeof(struct ee), + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0 +}, +{ + "f", + "{016fe2ec-b2c8-45f8-b23b-39e53a753972}", + /*kind*/ TKIND_ALIAS, /*flags*/ TYPEFLAG_FRESTRICTED|TYPEFLAG_FHIDDEN, /*align*/ 4, /*size*/ 4, + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0 +}, +{ + "_f", + "{00000000-0000-0000-0000-000000000000}", + /*kind*/ TKIND_UNION, /*flags*/ TYPEFLAG_FRESTRICTED|TYPEFLAG_FHIDDEN, /*align*/ 4, /*size*/ sizeof(union _f), + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0 +}, +{ + "ff", + "{016fe2ec-b2c8-45f8-b23b-39e53a753973}", + /*kind*/ TKIND_UNION, /*flags*/ TYPEFLAG_FRESTRICTED|TYPEFLAG_FHIDDEN, /*align*/ 4, /*size*/ sizeof(union ff), + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 0, /*#func*/ 0 +}, +{ + "ITestIface", + "{ec5dfcd6-eeb0-4cd6-b51e-8030e1dac00a}", + /*kind*/ TKIND_INTERFACE, /*flags*/ TYPEFLAG_FDISPATCHABLE, /*align*/ 4, /*size*/ sizeof(ITestIface*), + /*helpctx*/ 0x0000, /*version*/ 0x00000000, /*#vtbl*/ 13, /*#func*/ 6, + { + { + /*id*/ 0x60020000, /*func*/ FUNC_PUREVIRTUAL, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, + /*#param*/ 1, /*#opt*/ 0, /*vtbl*/ 7, /*#scodes*/ 0, /*flags*/ 0, + {VT_HRESULT, -1, PARAMFLAG_NONE}, /* ret */ + { /* params */ + {VT_USERDEFINED, TKIND_ALIAS, PARAMFLAG_NONE}, + {-1, 0, 0} + }, + { /* names */ + "test1", + "value", + NULL, + }, + }, + { + /*id*/ 0x60020001, /*func*/ FUNC_PUREVIRTUAL, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, + /*#param*/ 1, /*#opt*/ 0, /*vtbl*/ 8, /*#scodes*/ 0, /*flags*/ 0, + {VT_HRESULT, -1, PARAMFLAG_NONE}, /* ret */ + { /* params */ + {VT_USERDEFINED, TKIND_ENUM, PARAMFLAG_NONE}, + {-1, 0, 0} + }, + { /* names */ + "test2", + "value", + NULL, + }, + }, + { + /*id*/ 0x60020002, /*func*/ FUNC_PUREVIRTUAL, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, + /*#param*/ 1, /*#opt*/ 0, /*vtbl*/ 9, /*#scodes*/ 0, /*flags*/ 0, + {VT_HRESULT, -1, PARAMFLAG_NONE}, /* ret */ + { /* params */ + {VT_USERDEFINED, TKIND_ALIAS, PARAMFLAG_NONE}, + {-1, 0, 0} + }, + { /* names */ + "test3", + "value", + NULL, + }, + }, + { + /*id*/ 0x60020003, /*func*/ FUNC_PUREVIRTUAL, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, + /*#param*/ 1, /*#opt*/ 0, /*vtbl*/ 10, /*#scodes*/ 0, /*flags*/ 0, + {VT_HRESULT, -1, PARAMFLAG_NONE}, /* ret */ + { /* params */ + {VT_USERDEFINED, TKIND_ALIAS, PARAMFLAG_NONE}, + {-1, 0, 0} + }, + { /* names */ + "test4", + "value", + NULL, + }, + }, + { + /*id*/ 0x60020004, /*func*/ FUNC_PUREVIRTUAL, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, + /*#param*/ 1, /*#opt*/ 0, /*vtbl*/ 11, /*#scodes*/ 0, /*flags*/ 0, + {VT_HRESULT, -1, PARAMFLAG_NONE}, /* ret */ + { /* params */ + {VT_USERDEFINED, TKIND_ALIAS, PARAMFLAG_NONE}, + {-1, 0, 0} + }, + { /* names */ + "test5", + "value", + NULL, + }, + }, + { + /*id*/ 0x60020005, /*func*/ FUNC_PUREVIRTUAL, /*inv*/ INVOKE_FUNC, /*call*/ CC_STDCALL, + /*#param*/ 1, /*#opt*/ 0, /*vtbl*/ 12, /*#scodes*/ 0, /*flags*/ 0, + {VT_HRESULT, -1, PARAMFLAG_NONE}, /* ret */ + { /* params */ + {VT_USERDEFINED, TKIND_ALIAS, PARAMFLAG_NONE}, + {-1, 0, 0} + }, + { /* names */ + "test6", + "value", + NULL, + }, + }, + } } }; @@ -4035,18 +4590,34 @@ ITypeInfo *typeinfo; TYPEATTR *typeattr; BSTR bstrIfName; + DWORD help_ctx; trace("Interface %s\n", ti->name); ole_check(ITypeLib_GetTypeInfo(typelib, iface, &typeinfo)); - ole_check(ITypeLib_GetDocumentation(typelib, iface, &bstrIfName, NULL, NULL, NULL)); + ole_check(ITypeLib_GetDocumentation(typelib, iface, &bstrIfName, NULL, &help_ctx, NULL)); expect_wstr_acpval(bstrIfName, ti->name); SysFreeString(bstrIfName); ole_check(ITypeInfo_GetTypeAttr(typeinfo, &typeattr)); expect_int(typeattr->typekind, ti->type); expect_hex(typeattr->wTypeFlags, ti->wTypeFlags); + /* FIXME: remove once widl is fixed */ + if (typeattr->typekind == TKIND_ALIAS && typeattr->cbAlignment != ti->cbAlignment) + { +todo_wine /* widl generates broken typelib and typeattr just reflects that */ + ok(typeattr->cbAlignment == ti->cbAlignment || broken(typeattr->cbAlignment == 1), + "expected %d, got %d\n", ti->cbAlignment, typeattr->cbAlignment); +todo_wine /* widl generates broken typelib and typeattr just reflects that */ + ok(typeattr->cbSizeInstance == ti->cbSizeInstance || broken(typeattr->cbSizeInstance == 0), + "expected %d, got %d\n", ti->cbSizeInstance, typeattr->cbSizeInstance); + } + else + { expect_int(typeattr->cbAlignment, ti->cbAlignment); expect_int(typeattr->cbSizeInstance, ti->cbSizeInstance); + } + expect_int(help_ctx, ti->help_ctx); + expect_int(MAKELONG(typeattr->wMinorVerNum, typeattr->wMajorVerNum), ti->version); expect_int(typeattr->cbSizeVft, ti->cbSizeVft * sizeof(void*)); expect_int(typeattr->cFuncs, ti->cFuncs); @@ -4065,8 +4636,8 @@ /* check that it's possible to search using this uuid */ typeinfo2 = NULL; hr = ITypeLib_GetTypeInfoOfGuid(typelib, &guid, &typeinfo2); - ok(hr == S_OK, "got 0x%08x\n", hr); - ITypeInfo_Release(typeinfo2); + ok(hr == S_OK || (IsEqualGUID(&guid, &IID_NULL) && hr == TYPE_E_ELEMENTNOTFOUND), "got 0x%08x\n", hr); + if (hr == S_OK) ITypeInfo_Release(typeinfo2); } for (func = 0; func < typeattr->cFuncs; func++) @@ -4102,6 +4673,20 @@ for (i = 0 ; i < desc->cParams; i++) { check_type(&desc->lprgelemdescParam[i], &fn_info->params[i]); + + if (desc->lprgelemdescParam[i].tdesc.vt == VT_USERDEFINED) + { + ITypeInfo *param; + TYPEATTR *var_attr; + + ole_check(ITypeInfo_GetRefTypeInfo(typeinfo, U(desc->lprgelemdescParam[i].tdesc).hreftype, ¶m)); + ole_check(ITypeInfo_GetTypeAttr(param, &var_attr)); + + ok(var_attr->typekind == fn_info->params[i].type, "expected %#x, got %#x\n", fn_info->params[i].type, var_attr->typekind); + + ITypeInfo_ReleaseTypeAttr(param, var_attr); + ITypeInfo_Release(param); + } } expect_int(fn_info->params[desc->cParams].vt, (VARTYPE)-1); diff -Nru wine1.7-1.7.50/dlls/oleaut32/tests/vartest.c wine1.7-1.7.55/dlls/oleaut32/tests/vartest.c --- wine1.7-1.7.50/dlls/oleaut32/tests/vartest.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/oleaut32/tests/vartest.c 2015-11-13 14:32:40.000000000 +0000 @@ -230,7 +230,7 @@ static BOOL WINAPI RecordInfo_IsMatchingType(IRecordInfo *iface, IRecordInfo *info2) { ok(0, "unexpected call\n"); - return E_NOTIMPL; + return FALSE; } static PVOID WINAPI RecordInfo_RecordCreate(IRecordInfo *iface) diff -Nru wine1.7-1.7.50/dlls/oleaut32/tmarshal.c wine1.7-1.7.55/dlls/oleaut32/tmarshal.c --- wine1.7-1.7.50/dlls/oleaut32/tmarshal.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/oleaut32/tmarshal.c 2015-11-13 14:32:40.000000000 +0000 @@ -2282,6 +2282,7 @@ ITypeInfo *tinfo; TMStubImpl *stub; TYPEATTR *typeattr; + IUnknown *obj; TRACE("(%s,%p,%p)\n",debugstr_guid(riid),pUnkServer,ppStub); @@ -2291,16 +2292,26 @@ return hres; } + /* FIXME: This is not exactly right. We should probably call QI later. */ + hres = IUnknown_QueryInterface(pUnkServer, riid, (void**)&obj); + if (FAILED(hres)) { + WARN("Could not get %s iface: %08x\n", debugstr_guid(riid), hres); + obj = pUnkServer; + IUnknown_AddRef(obj); + } + stub = CoTaskMemAlloc(sizeof(TMStubImpl)); - if (!stub) + if (!stub) { + IUnknown_Release(obj); return E_OUTOFMEMORY; + } stub->IRpcStubBuffer_iface.lpVtbl = &tmstubvtbl; stub->ref = 1; stub->tinfo = tinfo; stub->dispatch_stub = NULL; stub->dispatch_derivative = FALSE; stub->iid = *riid; - hres = IRpcStubBuffer_Connect(&stub->IRpcStubBuffer_iface,pUnkServer); + hres = IRpcStubBuffer_Connect(&stub->IRpcStubBuffer_iface, obj); *ppStub = &stub->IRpcStubBuffer_iface; TRACE("IRpcStubBuffer: %p\n", stub); if (hres) @@ -2315,6 +2326,7 @@ ITypeInfo_ReleaseTypeAttr(tinfo, typeattr); } + IUnknown_Release(obj); return hres; } @@ -2326,17 +2338,12 @@ PSFacBuf_CreateStub }; -/* This is the whole PSFactoryBuffer object, just the vtableptr */ -static const IPSFactoryBufferVtbl *lppsfac = &psfacbufvtbl; +static IPSFactoryBuffer psfac = { &psfacbufvtbl }; /*********************************************************************** * TMARSHAL_DllGetClassObject */ -HRESULT TMARSHAL_DllGetClassObject(REFCLSID rclsid, REFIID iid,LPVOID *ppv) +HRESULT TMARSHAL_DllGetClassObject(REFCLSID rclsid, REFIID iid, void **ppv) { - if (IsEqualIID(iid,&IID_IPSFactoryBuffer)) { - *ppv = &lppsfac; - return S_OK; - } - return E_NOINTERFACE; + return IPSFactoryBuffer_QueryInterface(&psfac, iid, ppv); } diff -Nru wine1.7-1.7.50/dlls/oleaut32/typelib.c wine1.7-1.7.55/dlls/oleaut32/typelib.c --- wine1.7-1.7.50/dlls/oleaut32/typelib.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/oleaut32/typelib.c 2015-11-13 14:32:40.000000000 +0000 @@ -7078,7 +7078,7 @@ } V_VT(&rgvarg[i]) = rgvt[i]; } - else if (rgvt[i] == (VT_VARIANT | VT_ARRAY) && func_desc->cParamsOpt < 0 && i == func_desc->cParams-1) + else if ((rgvt[i] == (VT_VARIANT | VT_ARRAY) || rgvt[i] == (VT_VARIANT | VT_ARRAY | VT_BYREF)) && func_desc->cParamsOpt < 0) { SAFEARRAY *a; SAFEARRAYBOUND bound; @@ -7107,7 +7107,10 @@ SafeArrayDestroy(a); break; } - V_ARRAY(&rgvarg[i]) = a; + if (rgvt[i] & VT_BYREF) + V_BYREF(&rgvarg[i]) = &a; + else + V_ARRAY(&rgvarg[i]) = a; V_VT(&rgvarg[i]) = rgvt[i]; } else if ((rgvt[i] & VT_BYREF) && !V_ISBYREF(src_arg)) @@ -7882,19 +7885,19 @@ ITypeLib * *ppTLib, UINT *pIndex) { ITypeInfoImpl *This = impl_from_ITypeInfo2(iface); - + /* If a pointer is null, we simply ignore it, the ATL in particular passes pIndex as 0 */ if (pIndex) { *pIndex=This->index; TRACE("returning pIndex=%d\n", *pIndex); } - + if (ppTLib) { - *ppTLib=(LPTYPELIB )(This->pTypeLib); + *ppTLib = (ITypeLib *)&This->pTypeLib->ITypeLib2_iface; ITypeLib_AddRef(*ppTLib); TRACE("returning ppTLib=%p\n", *ppTLib); } - + return S_OK; } diff -Nru wine1.7-1.7.50/dlls/oleaut32/usrmarshal.c wine1.7-1.7.55/dlls/oleaut32/usrmarshal.c --- wine1.7-1.7.50/dlls/oleaut32/usrmarshal.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/oleaut32/usrmarshal.c 2015-11-13 14:32:40.000000000 +0000 @@ -349,11 +349,12 @@ ptr = *(DWORD*)Buffer; Buffer += sizeof(DWORD); + /* Clear any existing interface which WdtpInterfacePointer_UserUnmarshal() + would try to release. This has been done already with a VariantClear(). */ + *ppunk = NULL; + if(!ptr) - { - *ppunk = NULL; return Buffer; - } return WdtpInterfacePointer_UserUnmarshal(pFlags, Buffer, ppunk, riid); } diff -Nru wine1.7-1.7.50/dlls/oleaut32/variant.c wine1.7-1.7.55/dlls/oleaut32/variant.c --- wine1.7-1.7.50/dlls/oleaut32/variant.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/oleaut32/variant.c 2015-11-13 14:32:40.000000000 +0000 @@ -3606,7 +3606,7 @@ } /* Determine return type */ - if (!(rightvt == VT_EMPTY)) + if (rightvt != VT_EMPTY) { if (leftvt == VT_NULL || rightvt == VT_NULL) { @@ -3639,7 +3639,7 @@ else if (leftvt == VT_R4 || rightvt == VT_R4) resvt = VT_R4; } - else if (leftvt == VT_NULL && rightvt == VT_EMPTY) + else if (leftvt == VT_NULL) { V_VT(result) = VT_NULL; hres = S_OK; diff -Nru wine1.7-1.7.50/dlls/oledb32/convert.c wine1.7-1.7.55/dlls/oledb32/convert.c --- wine1.7-1.7.50/dlls/oledb32/convert.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/oledb32/convert.c 2015-11-13 14:32:40.000000000 +0000 @@ -183,6 +183,15 @@ return S_OK; } + if(src_type == DBTYPE_VARIANT && V_VT((VARIANT*)src) == VT_NULL) + { + if(dst_type == DBTYPE_VARIANT) + *dst_len = sizeof(VARIANT); + + *dst_status = DBSTATUS_S_ISNULL; + return S_OK; + } + if(IDataConvert_CanConvert(iface, src_type, dst_type) != S_OK) { return DB_E_UNSUPPORTEDCONVERSION; @@ -631,18 +640,9 @@ } break; case DBTYPE_VARIANT: - if(V_VT((VARIANT*)src) == VT_NULL) - { - *dst_status = DBSTATUS_S_ISNULL; - *dst_len = get_length(DBTYPE_BSTR); - return S_OK; - } - else - { - VariantInit(&tmp); - if ((hr = VariantChangeType(&tmp, (VARIANT*)src, 0, VT_BSTR)) == S_OK) - *d = V_BSTR(&tmp); - } + VariantInit(&tmp); + if ((hr = VariantChangeType(&tmp, (VARIANT*)src, 0, VT_BSTR)) == S_OK) + *d = V_BSTR(&tmp); break; default: FIXME("Unimplemented conversion %04x -> BSTR\n", src_type); return E_NOTIMPL; } @@ -1000,44 +1000,35 @@ return S_OK; case DBTYPE_VARIANT: { - if(V_VT((VARIANT*)src) == VT_NULL) + switch(V_VT((VARIANT*)src)) { - *dst_status = DBSTATUS_S_ISNULL; - *dst_len = 0; - return S_OK; - } - else + case VT_UI1 | VT_ARRAY: { - switch(V_VT((VARIANT*)src)) - { - case VT_UI1 | VT_ARRAY: - { - LONG l; - BYTE *data = NULL; + LONG l; + BYTE *data = NULL; - hr = SafeArrayGetUBound(V_ARRAY((VARIANT*)src), 1, &l); - if(FAILED(hr)) - return hr; - - hr = SafeArrayAccessData(V_ARRAY((VARIANT*)src), (VOID**)&data); - if(FAILED(hr)) - { - ERR("SafeArrayAccessData Failed = 0x%08x\n", hr); - return hr; - } - - *dst_len = l+1; - *dst_status = DBSTATUS_S_OK; - memcpy(d, data, *dst_len); + hr = SafeArrayGetUBound(V_ARRAY((VARIANT*)src), 1, &l); + if(FAILED(hr)) + return hr; - SafeArrayUnaccessData(V_ARRAY((VARIANT*)src)); - return S_OK; - } - break; - default: - FIXME("Unimplemented variant type %d -> BYTES\n", V_VT((VARIANT*)src)); - return E_NOTIMPL; + hr = SafeArrayAccessData(V_ARRAY((VARIANT*)src), (VOID**)&data); + if(FAILED(hr)) + { + ERR("SafeArrayAccessData Failed = 0x%08x\n", hr); + return hr; } + + *dst_len = l+1; + *dst_status = DBSTATUS_S_OK; + memcpy(d, data, *dst_len); + + SafeArrayUnaccessData(V_ARRAY((VARIANT*)src)); + return S_OK; + } + break; + default: + FIXME("Unimplemented variant type %d -> BYTES\n", V_VT((VARIANT*)src)); + return E_NOTIMPL; } } break; diff -Nru wine1.7-1.7.50/dlls/oledb32/datainit.c wine1.7-1.7.55/dlls/oledb32/datainit.c --- wine1.7-1.7.50/dlls/oledb32/datainit.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/oledb32/datainit.c 2015-11-13 14:32:40.000000000 +0000 @@ -413,7 +413,7 @@ if (scol) scol++; start = scol; - if (!strcmpW(name, providerW)) + if (!strcmpiW(name, providerW)) { SysFreeString(name); SysFreeString(value); @@ -548,6 +548,29 @@ *datasource = NULL; } +static inline WCHAR *strdupW(const WCHAR *src) +{ + WCHAR *dest; + if (!src) return NULL; + dest = heap_alloc((strlenW(src)+1)*sizeof(WCHAR)); + if (dest) + strcpyW(dest, src); + return dest; +} + +static WCHAR *strstriW(const WCHAR *str, const WCHAR *sub) +{ + LPWSTR strlower, sublower, r; + strlower = CharLowerW(strdupW(str)); + sublower = CharLowerW(strdupW(sub)); + r = strstrW(strlower, sublower); + if (r) + r = (LPWSTR)str + (r - strlower); + heap_free(strlower); + heap_free(sublower); + return r; +} + static HRESULT WINAPI datainit_GetDataSource(IDataInitialize *iface, IUnknown *outer, DWORD clsctx, LPWSTR initstring, REFIID riid, IUnknown **datasource) { @@ -565,7 +588,7 @@ /* first get provider name */ provclsid = IID_NULL; - if (initstring && (prov = strstrW(initstring, providerW))) + if (initstring && (prov = strstriW(initstring, providerW))) { WCHAR *start, *progid; int len; diff -Nru wine1.7-1.7.50/dlls/oledb32/tests/convert.c wine1.7-1.7.55/dlls/oledb32/tests/convert.c --- wine1.7-1.7.50/dlls/oledb32/tests/convert.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/oledb32/tests/convert.c 2015-11-13 14:32:40.000000000 +0000 @@ -455,6 +455,13 @@ ok(dst_len == sizeof(dst), "got %ld\n", dst_len); ok(dst == 0x4321, "got %08x\n", dst); + V_VT((VARIANT*)src) = VT_NULL; + dst_len = 0x1234; + hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_I2, 0, &dst_len, src, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status); + ok(dst_len == 0x1234, "got %ld\n", dst_len); + dst_len = dst = 0x1234; memset(src, 0, sizeof(DECIMAL)); ((DECIMAL*)src)->u1.Lo64 = 0x4321; @@ -764,6 +771,13 @@ ok(dst_len == sizeof(i4), "got %ld\n", dst_len); ok(i4 == 0x1234, "got %08x\n", i4); + V_VT((VARIANT*)src) = VT_NULL; + dst_len = 0x1234; + hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_I4, 0, &dst_len, src, &i4, sizeof(i4), 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status); + ok(dst_len == 0x1234, "got %ld\n", dst_len); + i4 = 0x12345678; memset(src, 0, sizeof(DECIMAL)); ((DECIMAL*)src)->u1.Lo64 = 0x1234; @@ -924,6 +938,13 @@ ok(dst_len == sizeof(dst), "got %ld\n", dst_len); ok(dst.QuadPart == 10, "got %d\n", (int)dst.QuadPart); SysFreeString(b); + + V_VT((VARIANT*)src) = VT_NULL; + dst_len = 0x1234; + hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_I8, 0, &dst_len, src, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status); + ok(dst_len == 0x1234, "got %ld\n", dst_len); } static void test_converttobstr(void) @@ -989,10 +1010,11 @@ V_VT(&v) = VT_NULL; dst = (void*)0x1234; + dst_len = 33; hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_BSTR, 0, &dst_len, &v, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0); ok(hr == S_OK, "got %08x\n", hr); ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status); - ok(dst_len == sizeof(BSTR), "got %ld\n", dst_len); + ok(dst_len == 33, "got %ld\n", dst_len); ok(dst == (void*)0x1234, "got %p\n", dst); } @@ -1013,6 +1035,8 @@ BSTR b; VARIANT v; + VariantInit(&v); + memset(dst, 0xcc, sizeof(dst)); dst_len = 0x1234; hr = IDataConvert_DataConvert(convert, DBTYPE_EMPTY, DBTYPE_WSTR, 0, &dst_len, src, dst, sizeof(dst), 0, &dst_status, 0, 0, 0); @@ -1476,11 +1500,12 @@ ok(!lstrcmpW(b, dst), "got %s\n", wine_dbgstr_w(dst)); VariantClear(&v); + dst_len = 44; V_VT(&v) = VT_NULL; hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_WSTR, 0, &dst_len, &v, dst, sizeof(dst), 0, &dst_status, 0, 0, 0); ok(hr == S_OK, "got %08x\n", hr); ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status); - ok(dst_len == 0, "got %ld\n", dst_len); + ok(dst_len == 44, "got %ld\n", dst_len); } static void test_converttostr(void) @@ -1497,6 +1522,7 @@ static const char hexunpacked_a[] = "57696E6500"; static const char hexpacked_a[] = "Wine"; BSTR b; + VARIANT v; memset(dst, 0xcc, sizeof(dst)); dst_len = 0x1234; @@ -1974,6 +2000,13 @@ ok(dst_len == 0, "got %ld\n", dst_len); ok(dst[0] == 0, "not null terminated\n"); ok(dst[1] == (char)0xcc, "clobbered buffer\n"); + + dst_len = 44; + V_VT(&v) = VT_NULL; + hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_STR, 0, &dst_len, &v, dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status); + ok(dst_len == 44, "got %ld\n", dst_len); } static void test_converttobyrefwstr(void) @@ -1986,6 +2019,9 @@ static const WCHAR ten[] = {'1','0',0}; static const WCHAR fourthreetwoone[] = {'4','3','2','1',0}; BSTR b; + VARIANT v; + + VariantInit(&v); hr = IDataConvert_DataConvert(convert, DBTYPE_EMPTY, DBTYPE_BYREF | DBTYPE_WSTR, 0, &dst_len, src, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0); ok(hr == S_OK, "got %08x\n", hr); @@ -2058,6 +2094,13 @@ ok(dst_len == 4, "got %ld\n", dst_len); ok(!lstrcmpW(ten, dst), "got %s\n", wine_dbgstr_w(dst)); CoTaskMemFree(dst); + + dst_len = 44; + V_VT(&v) = VT_NULL; + hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_BYREF | DBTYPE_WSTR, 0, &dst_len, &v, dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status); + ok(dst_len == 44, "got %ld\n", dst_len); } static void test_converttoguid(void) @@ -2067,6 +2110,9 @@ BYTE src[20]; DBSTATUS dst_status; DBLENGTH dst_len; + VARIANT v; + + VariantInit(&v); dst = IID_IDCInfo; dst_len = 0x1234; @@ -2092,6 +2138,13 @@ ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); ok(dst_len == sizeof(GUID), "got %ld\n", dst_len); ok(IsEqualGUID(&dst, &IID_IDataConvert), "didn't get IID_IDataConvert\n"); + + dst_len = 44; + V_VT(&v) = VT_NULL; + hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_GUID, 0, &dst_len, &v, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status); + ok(dst_len == 44, "got %ld\n", dst_len); } static void test_converttofiletime(void) @@ -2101,6 +2154,9 @@ BYTE src[20]; DBSTATUS dst_status; DBLENGTH dst_len; + VARIANT v; + + VariantInit(&v); memset(&dst, 0xcc, sizeof(dst)); ((FILETIME *)src)->dwLowDateTime = 0x12345678; @@ -2117,6 +2173,13 @@ ok(dst.dwLowDateTime == 0x12345678, "got %08x\n", dst.dwLowDateTime); ok(dst.dwHighDateTime == 0x9abcdef0, "got %08x\n", dst.dwHighDateTime); } + + dst_len = 44; + V_VT(&v) = VT_NULL; + hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_FILETIME, 0, &dst_len, &v, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status); + ok(dst_len == 44, "got %ld\n", dst_len); } static void test_converttoui1(void) @@ -2126,6 +2189,9 @@ BYTE src[20]; DBSTATUS dst_status; DBLENGTH dst_len; + VARIANT v; + + VariantInit(&v); dst = 0x12; dst_len = 0x1234; @@ -2160,6 +2226,13 @@ ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); ok(dst_len == sizeof(dst), "got %ld\n", dst_len); ok(dst == 0xfe, "got %08x\n", dst); + + dst_len = 44; + V_VT(&v) = VT_NULL; + hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_UI1, 0, &dst_len, &v, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status); + ok(dst_len == 44, "got %ld\n", dst_len); } static void test_converttoui4(void) @@ -2223,6 +2296,13 @@ ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); ok(dst_len == sizeof(dst), "got %ld\n", dst_len); ok(dst == 0x4321, "got %08x\n", dst); + + dst_len = 44; + V_VT((VARIANT*)src) = VT_NULL; + hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_UI4, 0, &dst_len, src, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status); + ok(dst_len == 44, "got %ld\n", dst_len); } static void test_converttor4(void) @@ -2232,6 +2312,9 @@ BYTE src[20]; DBSTATUS dst_status; DBLENGTH dst_len; + VARIANT v; + + VariantInit(&v); dst = 1.0; dst_len = 0x1234; @@ -2266,6 +2349,13 @@ ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); ok(dst_len == sizeof(dst), "got %ld\n", dst_len); ok(dst == 10.0, "got %f\n", dst); + + dst_len = 44; + V_VT(&v) = VT_NULL; + hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_R4, 0, &dst_len, &v, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status); + ok(dst_len == 44, "got %ld\n", dst_len); } static void test_converttor8(void) @@ -2319,6 +2409,13 @@ ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); ok(dst_len == sizeof(dst), "got %ld\n", dst_len); ok(dst == 0x4321, "got %f\n", dst); + + dst_len = 44; + V_VT(&var) = VT_NULL; + hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_R4, 0, &dst_len, &var, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status); + ok(dst_len == 44, "got %ld\n", dst_len); } static void test_converttocy(void) @@ -2328,6 +2425,9 @@ BYTE src[20]; DBSTATUS dst_status; DBLENGTH dst_len; + VARIANT v; + + VariantInit(&v); dst.int64 = 0xcc; dst_len = 0x1234; @@ -2362,6 +2462,13 @@ ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); ok(dst_len == sizeof(CY), "got %ld\n", dst_len); ok(dst.int64 == 1234, "got %d\n", dst.s.Lo); + + dst_len = 44; + V_VT(&v) = VT_NULL; + hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_CY, 0, &dst_len, &v, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status); + ok(dst_len == 44, "got %ld\n", dst_len); } static void test_converttoui8(void) @@ -2371,6 +2478,9 @@ BYTE src[20]; DBSTATUS dst_status; DBLENGTH dst_len; + VARIANT v; + + VariantInit(&v); dst.QuadPart = 0xcc; dst_len = 0x1234; @@ -2416,6 +2526,13 @@ ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status); ok(dst_len == sizeof(dst), "got %ld\n", dst_len); ok(dst.QuadPart == 1234, "got %d\n", (int)dst.QuadPart); + + dst_len = 44; + V_VT(&v) = VT_NULL; + hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_UI8, 0, &dst_len, &v, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status); + ok(dst_len == 44, "got %ld\n", dst_len); } static void test_getconversionsize(void) @@ -2567,11 +2684,11 @@ ok(!memcmp(byte_src, dst, 2 ), "bytes differ\n"); V_VT(&v) = VT_NULL; - dst_len = 0; + dst_len = 77; hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_BYTES, sizeof(v), &dst_len, &v, &dst, 2, 0, &dst_status, 0, 0, 0); ok(hr == S_OK, "got %08x\n", hr); ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status); - ok(dst_len == 0, "got %ld\n", dst_len); + ok(dst_len == 77, "got %ld\n", dst_len); dst_len = 0; rgsabound[0].lLbound = 0; @@ -2586,6 +2703,13 @@ ok(!memcmp(byte_dst, dst, dst_len), "bytes differ\n"); VariantClear(&v); + dst_len = 44; + V_VT(&v) = VT_NULL; + hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_BYTES, 0, &dst_len, &v, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status); + ok(dst_len == 44, "got %ld\n", dst_len); + } static void test_converttobytesbyref(void) @@ -2595,6 +2719,9 @@ BYTE byte_src[] = {0, 1, 2, 4, 5}; BYTE *dst; DBSTATUS dst_status; + VARIANT v; + + VariantInit(&v); dst_len = 0; hr = IDataConvert_DataConvert(convert, DBTYPE_BYTES, DBTYPE_BYTES | DBTYPE_BYREF, sizeof(byte_src), &dst_len, byte_src, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0); @@ -2603,6 +2730,13 @@ ok(dst_len == sizeof(byte_src), "got %ld\n", dst_len); ok(!memcmp(byte_src, dst, dst_len ), "bytes differ\n"); CoTaskMemFree(dst); + + dst_len = 44; + V_VT(&v) = VT_NULL; + hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_BYTES | DBTYPE_BYREF, 0, &dst_len, &v, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status); + ok(dst_len == 44, "got %ld\n", dst_len); } static void test_converttodbdate(void) @@ -2641,6 +2775,13 @@ ok(dst_len == sizeof(DBDATE), "got %ld\n", dst_len); ok(!memcmp(&ts, &dst, sizeof(DBDATE) ), "bytes differ\n"); SysFreeString(bstr); + + V_VT(&var) = VT_NULL; + dst_len = 88; + hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_DBDATE, sizeof(var), &dst_len, &var, &dst, 2, 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status); + ok(dst_len == 88, "got %ld\n", dst_len); } @@ -2662,6 +2803,9 @@ LARGE_INTEGER i8; VARIANT_BOOL boolean = VARIANT_TRUE; FLOAT fvalue = 543.21f; + VARIANT var; + + VariantInit(&var); V_VT(&dst) = VT_EMPTY; dst_len = 0; @@ -2837,11 +2981,19 @@ /* src_status = DBSTATUS_S_ISNULL */ i4 = 123; + dst_len = 99; hr = IDataConvert_DataConvert(convert, DBTYPE_I4, DBTYPE_VARIANT, sizeof(i4), &dst_len, &i4, &dst, sizeof(dst), DBSTATUS_S_ISNULL, &dst_status, 0, 0, 0); ok(hr == S_OK, "got %08x\n", hr); ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status); ok(dst_len == 0, "got %ld\n", dst_len); + dst_len = 44; + V_VT(&var) = VT_NULL; + hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_VARIANT, 0, &dst_len, &var, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status); + ok(dst_len == sizeof(VARIANT), "got %ld\n", dst_len); + } static void test_converttotimestamp(void) @@ -2873,6 +3025,13 @@ ok(dst_len == sizeof(dst), "got %ld\n", dst_len); ok(!memcmp(&ts, &dst, sizeof(ts)), "Wrong timestamp\n"); SysFreeString(bstr); + + V_VT(&var) = VT_NULL; + dst_len = 77; + hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_DBTIMESTAMP, sizeof(var), &dst_len, &var, &dst, 2, 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status); + ok(dst_len == 77, "got %ld\n", dst_len); } static void test_converttoiunknown(void) @@ -2882,12 +3041,22 @@ DBLENGTH dst_len; IUnknown *dst = NULL; static WCHAR strW[] = {'t','e','s','t',0}; + VARIANT var; + + VariantInit(&var); dst_len = 0x1234; hr = IDataConvert_DataConvert(convert, DBTYPE_WSTR, DBTYPE_IUNKNOWN, sizeof(strW), &dst_len, strW, dst, sizeof(dst), DBSTATUS_S_ISNULL, &dst_status, 0, 0, 0); ok(hr == S_OK, "got %08x\n", hr); ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status); ok(dst_len == 0, "got %ld\n", dst_len); + + dst_len = 44; + V_VT(&var) = VT_NULL; + hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_IUNKNOWN, 0, &dst_len, &var, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0); + ok(hr == S_OK, "got %08x\n", hr); + ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status); + ok(dst_len == 44, "got %ld\n", dst_len); } START_TEST(convert) diff -Nru wine1.7-1.7.50/dlls/oledb32/tests/database.c wine1.7-1.7.55/dlls/oledb32/tests/database.c --- wine1.7-1.7.50/dlls/oledb32/tests/database.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/oledb32/tests/database.c 2015-11-13 14:32:40.000000000 +0000 @@ -382,6 +382,8 @@ { static const WCHAR initstring_msdasql[] = {'P','r','o','v','i','d','e','r','=','M','S','D','A','S','Q','L','.','1',';', 'D','a','t','a',' ','S','o','u','r','c','e','=','d','u','m','m','y', 0}; + static const WCHAR initstring_msdasql2[] = {'p','R','o','V','i','D','e','R','=','M','S','D','A','S','Q','L','.','1',';', + 'D','a','t','a',' ','S','o','u','r','c','e','=','d','u','m','m','y', 0}; static const WCHAR initstring_sqloledb[] = {'P','r','o','v','i','d','e','r','=','S','Q','L','O','L','E','D','B','.','1',';', 'D','a','t','a',' ','S','o','u','r','c','e','=','d','u','m','m','y', 0}; IDataInitialize *datainit = NULL; @@ -414,6 +416,13 @@ } IDBInitialize_Release(dbinit); + + /* mixed casing string */ + dbinit = NULL; + hr = IDataInitialize_GetDataSource(datainit, NULL, CLSCTX_INPROC_SERVER, (WCHAR*)initstring_msdasql2, + &IID_IDBInitialize, (IUnknown**)&dbinit); + ok(hr == S_OK, "got 0x%08x\n", hr); + IDBInitialize_Release(dbinit); } else ok(dbinit == NULL, "got %p\n", dbinit); diff -Nru wine1.7-1.7.50/dlls/oledlg/oledlg_main.c wine1.7-1.7.55/dlls/oledlg/oledlg_main.c --- wine1.7-1.7.50/dlls/oledlg/oledlg_main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/oledlg/oledlg_main.c 2015-11-13 14:32:40.000000000 +0000 @@ -158,14 +158,15 @@ BOOL WINAPI OleUIAddVerbMenuW(IOleObject *object, LPCWSTR shorttype, HMENU hMenu, UINT uPos, UINT idmin, UINT idmax, BOOL addConvert, UINT idConvert, HMENU *ret_submenu) { - static const WCHAR spaceW[] = {' ',0}; IEnumOLEVERB *enumverbs = NULL; - WCHAR *rootname, *objecttype; LPOLESTR usertype = NULL; OLEVERB firstverb, verb; + WCHAR *objecttype; WCHAR resstrW[32]; /* should be enough */ + DWORD_PTR args[2]; BOOL singleverb; HMENU submenu; + WCHAR *str; TRACE("(%p, %s, %p, %d, %d, %d, %d, %d, %p)\n", object, debugstr_w(shorttype), hMenu, uPos, idmin, idmax, addConvert, idConvert, ret_submenu); @@ -182,7 +183,7 @@ LoadStringW(OLEDLG_hInstance, IDS_VERBMENU_OBJECT, resstrW, sizeof(resstrW)/sizeof(WCHAR)); /* no object, or object without enumeration support */ - if (!object || (object && !enumverbs)) { + if (!object || !enumverbs) { InsertMenuW(hMenu, uPos, MF_BYPOSITION|MF_STRING|MF_GRAYED, idmin, resstrW); return FALSE; } @@ -193,12 +194,6 @@ else objecttype = (WCHAR*)shorttype; - rootname = CoTaskMemAlloc((strlenW(objecttype) + strlenW(resstrW) + 2)*sizeof(WCHAR)); - strcpyW(rootname, objecttype); - strcatW(rootname, spaceW); - strcatW(rootname, resstrW); - CoTaskMemFree(usertype); - /* iterate through verbs */ /* find first suitable verb */ @@ -206,18 +201,20 @@ singleverb = get_next_insertable_verb(enumverbs, idmin, idmax, &verb) != S_OK; if (singleverb && !addConvert) { - WCHAR *str = CoTaskMemAlloc((strlenW(rootname) + strlenW(firstverb.lpszVerbName) + 2)*sizeof(WCHAR)); + LoadStringW(OLEDLG_hInstance, IDS_VERBMENU_SINGLEVERB_OBJECT, resstrW, sizeof(resstrW)/sizeof(WCHAR)); + + args[0] = (DWORD_PTR)firstverb.lpszVerbName; + args[1] = (DWORD_PTR)objecttype; - strcpyW(str, firstverb.lpszVerbName); - strcatW(str, spaceW); - strcatW(str, rootname); + FormatMessageW(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_ARGUMENT_ARRAY, + resstrW, 0, 0, (WCHAR*)&str, 0, (__ms_va_list*)args); RemoveMenu(hMenu, uPos, MF_BYPOSITION); InsertMenuW(hMenu, uPos, MF_BYPOSITION|MF_STRING, idmin, str); CoTaskMemFree(firstverb.lpszVerbName); - CoTaskMemFree(rootname); - CoTaskMemFree(str); + HeapFree(GetProcessHeap(), 0, str); IEnumOLEVERB_Release(enumverbs); + CoTaskMemFree(usertype); return TRUE; } @@ -246,9 +243,16 @@ *ret_submenu = submenu; /* now submenu is ready, add root entry to original menu, attach submenu */ - InsertMenuW(hMenu, uPos, MF_BYPOSITION|MF_POPUP|MF_STRING, (UINT_PTR)submenu, rootname); + LoadStringW(OLEDLG_hInstance, IDS_VERBMENU_OBJECT_WITH_NAME, resstrW, sizeof(resstrW)/sizeof(WCHAR)); + + args[0] = (DWORD_PTR)objecttype; + FormatMessageW(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_ARGUMENT_ARRAY, + resstrW, 0, 0, (WCHAR*)&str, 0, (__ms_va_list*)args); + + InsertMenuW(hMenu, uPos, MF_BYPOSITION|MF_POPUP|MF_STRING, (UINT_PTR)submenu, str); + HeapFree(GetProcessHeap(), 0, str); IEnumOLEVERB_Release(enumverbs); - CoTaskMemFree(rootname); + CoTaskMemFree(usertype); return TRUE; } diff -Nru wine1.7-1.7.50/dlls/oledlg/oledlg.rc wine1.7-1.7.55/dlls/oledlg/oledlg.rc --- wine1.7-1.7.50/dlls/oledlg/oledlg.rc 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/oledlg/oledlg.rc 2015-11-13 14:32:40.000000000 +0000 @@ -30,7 +30,9 @@ IDS_NOTOLEMOD "File does not appear to be a valid OLE module. Unable to register OLE control." IDS_NOTOLEMODCAPTION "Add Control" IDS_VERBMENU_OBJECT "&Object" + IDS_VERBMENU_OBJECT_WITH_NAME "%1 &Object" IDS_VERBMENU_CONVERT "&Convert..." + IDS_VERBMENU_SINGLEVERB_OBJECT "%1 %2 &Object" } STRINGTABLE diff -Nru wine1.7-1.7.50/dlls/oledlg/resource.h wine1.7-1.7.55/dlls/oledlg/resource.h --- wine1.7-1.7.50/dlls/oledlg/resource.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/oledlg/resource.h 2015-11-13 14:32:40.000000000 +0000 @@ -43,6 +43,8 @@ /* String ids for verb menu */ #define IDS_VERBMENU_CONVERT 0x130 +#define IDS_VERBMENU_SINGLEVERB_OBJECT 0x132 +#define IDS_VERBMENU_OBJECT_WITH_NAME 0x134 #define IDS_VERBMENU_OBJECT 0x135 /* String ids for Paste Special */ diff -Nru wine1.7-1.7.50/dlls/oledlg/tests/main.c wine1.7-1.7.55/dlls/oledlg/tests/main.c --- wine1.7-1.7.50/dlls/oledlg/tests/main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/oledlg/tests/main.c 2015-11-13 14:32:40.000000000 +0000 @@ -26,6 +26,18 @@ #include "initguid.h" #include "oledlg.h" +static const WCHAR *strstrW( const WCHAR *str, const WCHAR *sub ) +{ + while (*str) + { + const WCHAR *p1 = str, *p2 = sub; + while (*p1 && *p2 && *p1 == *p2) { p1++; p2++; } + if (!*p2) return str; + str++; + } + return NULL; +} + static HRESULT WINAPI enumverbs_QueryInterface(IEnumOLEVERB *iface, REFIID riid, void **ppv) { if (IsEqualIID(riid, &IID_IEnumOLEVERB) || IsEqualIID(riid, &IID_IUnknown)) { @@ -396,8 +408,9 @@ info.cch = sizeof(buffW)/sizeof(WCHAR); ret = GetMenuItemInfoW(hMenu, 4, TRUE, &info); ok(ret, "got %d\n", ret); - /* item string has a form of ' ', where Object is localized */ - ok(!memcmp(buffW, verbW, sizeof(verbW) - sizeof(WCHAR)), "str %s\n", wine_dbgstr_w(buffW)); + /* Item string contains verb, usertype and localized string for 'Object' word, + exact format depends on localization. */ + ok(strstrW(buffW, verbW) != NULL, "str %s\n", wine_dbgstr_w(buffW)); ok(info.fState == 0, "got state 0x%08x\n", info.fState); ok(info.hSubMenu == NULL, "got submenu %p\n", info.hSubMenu); diff -Nru wine1.7-1.7.50/dlls/openal32/openal.c wine1.7-1.7.55/dlls/openal32/openal.c --- wine1.7-1.7.50/dlls/openal32/openal.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/openal32/openal.c 2015-11-13 14:32:40.000000000 +0000 @@ -99,6 +99,8 @@ { switch(reason) { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls(hinst); #define LOADFUNC(x) x = alcGetProcAddress(NULL, #x) diff -Nru wine1.7-1.7.50/dlls/opencl/opencl.c wine1.7-1.7.55/dlls/opencl/opencl.c --- wine1.7-1.7.50/dlls/opencl/opencl.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/opencl/opencl.c 2015-11-13 14:32:40.000000000 +0000 @@ -32,6 +32,7 @@ #if defined(HAVE_CL_CL_H) #define CL_USE_DEPRECATED_OPENCL_1_1_APIS +#define CL_USE_DEPRECATED_OPENCL_1_2_APIS #define CL_USE_DEPRECATED_OPENCL_2_0_APIS #include #elif defined(HAVE_OPENCL_OPENCL_H) diff -Nru wine1.7-1.7.50/dlls/opengl32/wgl.c wine1.7-1.7.55/dlls/opengl32/wgl.c --- wine1.7-1.7.50/dlls/opengl32/wgl.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/opengl32/wgl.c 2015-11-13 14:32:40.000000000 +0000 @@ -92,6 +92,8 @@ }; static CRITICAL_SECTION wgl_section = { &critsect_debug, -1, 0, 0, 0, 0 }; +static const MAT2 identity = { {0,1},{0,0},{0,0},{0,1} }; + static inline struct opengl_funcs *get_dc_funcs( HDC hdc ) { struct opengl_funcs *funcs = __wine_get_wgl_driver( hdc, WINE_WGL_DRIVER_VERSION ); @@ -827,7 +829,7 @@ /* Compare the major/minor version numbers of the native OpenGL library and what is required by the function. * The gl_version string is guaranteed to have at least a major/minor and sometimes it has a release number as well. */ - if( (gl_version[0] >= version[0]) || ((gl_version[0] == version[0]) && (gl_version[2] >= version[2])) ) { + if( (gl_version[0] > version[0]) || ((gl_version[0] == version[0]) && (gl_version[2] >= version[2])) ) { return TRUE; } WARN("The function requires OpenGL version '%c.%c' while your drivers only provide '%c.%c'\n", version[0], version[2], gl_version[0], gl_version[2]); @@ -1057,7 +1059,7 @@ */ HPBUFFERARB WINAPI wglCreatePbufferARB( HDC hdc, int format, int width, int height, const int *attribs ) { - HPBUFFERARB ret = 0; + HPBUFFERARB ret; struct wgl_pbuffer *pbuffer; struct opengl_funcs *funcs = get_dc_funcs( hdc ); @@ -1212,7 +1214,6 @@ funcs->gl.p_glPixelStorei(GL_UNPACK_ALIGNMENT, 4); for (glyph = first; glyph < first + count; glyph++) { - static const MAT2 identity = { {0,1},{0,0},{0,0},{0,1} }; unsigned int needed_size, height, width, width_int; if (unicode) @@ -1479,7 +1480,6 @@ { const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; UINT glyph; - const MAT2 identity = {{0,1},{0,0},{0,0},{0,1}}; GLUtesselator *tess = NULL; LOGFONTW lf; HFONT old_font, unscaled_font; @@ -1749,7 +1749,7 @@ static GLubyte *filter_extensions_list(const char *extensions, const char *disabled) { - char *p, *str = NULL; + char *p, *str; const char *end; p = str = HeapAlloc(GetProcessHeap(), 0, strlen(extensions) + 2); @@ -1785,7 +1785,7 @@ { const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; const char *ext, *end, *gl_ext; - GLuint *disabled_exts = NULL, *new_disabled_exts; + GLuint *disabled_exts, *new_disabled_exts; unsigned int i = 0, j, disabled_size; GLint extensions_count; diff -Nru wine1.7-1.7.50/dlls/prntvpt/main.c wine1.7-1.7.55/dlls/prntvpt/main.c --- wine1.7-1.7.50/dlls/prntvpt/main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/prntvpt/main.c 2015-11-13 14:32:40.000000000 +0000 @@ -23,6 +23,7 @@ #include "windef.h" #include "winbase.h" +#include "prntvpt.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(prntvpt); @@ -48,3 +49,9 @@ FIXME("stub:%s %p\n", debugstr_w(printer), version); return E_NOTIMPL; } + +HRESULT WINAPI PTOpenProvider(PCWSTR printer, DWORD version, HPTPROVIDER *provider) +{ + FIXME("%s, %d, %p: stub\n", debugstr_w(printer), version, provider); + return E_NOTIMPL; +} diff -Nru wine1.7-1.7.50/dlls/prntvpt/prntvpt.spec wine1.7-1.7.55/dlls/prntvpt/prntvpt.spec --- wine1.7-1.7.50/dlls/prntvpt/prntvpt.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/prntvpt/prntvpt.spec 2015-11-13 14:32:40.000000000 +0000 @@ -1,27 +1,27 @@ -1 stdcall PTQuerySchemaVersionSupport(wstr ptr) -2 stub PTOpenProvider -3 stub PTOpenProviderEx -4 stub PTCloseProvider -5 stub BindPTProviderThunk -6 stub PTGetPrintCapabilities -7 stub PTMergeAndValidatePrintTicket -8 stub PTConvertPrintTicketToDevMode -9 stub PTConvertDevModeToPrintTicket -10 stub PTReleaseMemory -11 stub ConvertDevModeToPrintTicketThunk2 -12 stub ConvertDevModeToPrintTicketThunk -13 stub ConvertPrintTicketToDevModeThunk2 -14 stub ConvertPrintTicketToDevModeThunk -15 stub DllCanUnloadNow -16 stub DllGetClassObject -17 stdcall -private DllMain(long long ptr) -18 stub DllRegisterServer -19 stub DllUnregisterServer -20 stub GetDeviceDefaultPrintTicketThunk -21 stub GetDeviceNamespacesThunk -22 stub GetPrintCapabilitiesThunk2 -23 stub GetPrintCapabilitiesThunk -24 stub GetSchemaVersionThunk -25 stub MergeAndValidatePrintTicketThunk2 -26 stub MergeAndValidatePrintTicketThunk -27 stub UnbindPTProviderThunk +@ stdcall PTQuerySchemaVersionSupport(wstr ptr) +@ stdcall PTOpenProvider(wstr long ptr) +@ stub PTOpenProviderEx +@ stub PTCloseProvider +@ stub BindPTProviderThunk +@ stub PTGetPrintCapabilities +@ stub PTMergeAndValidatePrintTicket +@ stub PTConvertPrintTicketToDevMode +@ stub PTConvertDevModeToPrintTicket +@ stub PTReleaseMemory +@ stub ConvertDevModeToPrintTicketThunk2 +@ stub ConvertDevModeToPrintTicketThunk +@ stub ConvertPrintTicketToDevModeThunk2 +@ stub ConvertPrintTicketToDevModeThunk +@ stub DllCanUnloadNow +@ stub DllGetClassObject +@ stdcall -private DllMain(long long ptr) +@ stub DllRegisterServer +@ stub DllUnregisterServer +@ stub GetDeviceDefaultPrintTicketThunk +@ stub GetDeviceNamespacesThunk +@ stub GetPrintCapabilitiesThunk2 +@ stub GetPrintCapabilitiesThunk +@ stub GetSchemaVersionThunk +@ stub MergeAndValidatePrintTicketThunk2 +@ stub MergeAndValidatePrintTicketThunk +@ stub UnbindPTProviderThunk diff -Nru wine1.7-1.7.50/dlls/propsys/tests/propsys.c wine1.7-1.7.55/dlls/propsys/tests/propsys.c --- wine1.7-1.7.50/dlls/propsys/tests/propsys.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/propsys/tests/propsys.c 2015-11-13 14:32:40.000000000 +0000 @@ -765,11 +765,11 @@ PropVariantClear(&propvar); propvar.vt = VT_I8; - propvar.u.hVal.QuadPart = (LONGLONG)1 << 63; + propvar.u.hVal.QuadPart = (ULONGLONG)1 << 63; hr = PropVariantToInt64(&propvar, &llval); ok(hr == S_OK, "hr=%x\n", hr); - ok(llval == (LONGLONG)1 << 63, "got wrong value %s\n", debugstr_longlong(llval)); + ok(llval == (ULONGLONG)1 << 63, "got wrong value %s\n", debugstr_longlong(llval)); hr = PropVariantToUInt64(&propvar, &ullval); ok(hr == HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW), "hr=%x\n", hr); diff -Nru wine1.7-1.7.50/dlls/psapi/tests/psapi_main.c wine1.7-1.7.55/dlls/psapi/tests/psapi_main.c --- wine1.7-1.7.50/dlls/psapi/tests/psapi_main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/psapi/tests/psapi_main.c 2015-11-13 14:32:40.000000000 +0000 @@ -147,23 +147,6 @@ ok(hMod == GetModuleHandleA(NULL), "hMod=%p GetModuleHandleA(NULL)=%p\n", hMod, GetModuleHandleA(NULL)); ok(cbNeeded % sizeof(hMod) == 0, "not a multiple of sizeof(HMODULE) cbNeeded=%d\n", cbNeeded); - /* Windows sometimes has a bunch of extra dlls, presumably brought in by - * aclayers.dll. - */ - if (cbNeeded < 4 * sizeof(HMODULE) || cbNeeded > 30 * sizeof(HMODULE)) - { - HMODULE hmods[100]; - int i; - ok(0, "cbNeeded=%d\n", cbNeeded); - - pEnumProcessModules(hpQV, hmods, sizeof(hmods), &cbNeeded); - for (i = 0 ; i < cbNeeded/sizeof(*hmods); i++) - { - char path[1024]; - GetModuleFileNameA(hmods[i], path, sizeof(path)); - trace("i=%d hmod=%p path=[%s]\n", i, hmods[i], path); - } - } } static void test_GetModuleInformation(void) @@ -194,6 +177,11 @@ ok(info.lpBaseOfDll == hMod, "lpBaseOfDll=%p hMod=%p\n", info.lpBaseOfDll, hMod); } +static BOOL check_with_margin(SIZE_T perf, SIZE_T sysperf, int margin) +{ + return (perf >= max(sysperf, margin) - margin && perf <= sysperf + margin); +} + static void test_GetPerformanceInfo(void) { PERFORMANCE_INFORMATION info; @@ -227,36 +215,30 @@ ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08x\n", status); ok(size >= sizeof(SYSTEM_PERFORMANCE_INFORMATION), "incorrect length %d\n", size); - ok(info.CommitTotal == sys_performance_info->TotalCommittedPages, - "expected info.CommitTotal=%u but got %u\n", - sys_performance_info->TotalCommittedPages, (ULONG)info.CommitTotal); - - ok(info.CommitLimit == sys_performance_info->TotalCommitLimit, - "expected info.CommitLimit=%u but got %u\n", - sys_performance_info->TotalCommitLimit, (ULONG)info.CommitLimit); - - ok(info.CommitPeak == sys_performance_info->PeakCommitment, - "expected info.CommitPeak=%u but got %u\n", - sys_performance_info->PeakCommitment, (ULONG)info.CommitPeak); - - ok(info.PhysicalAvailable >= max(sys_performance_info->AvailablePages, 25) - 25 && - info.PhysicalAvailable <= sys_performance_info->AvailablePages + 25, - "expected approximately info.PhysicalAvailable=%u but got %u\n", - sys_performance_info->AvailablePages, (ULONG)info.PhysicalAvailable); + + ok(check_with_margin(info.CommitTotal, sys_performance_info->TotalCommittedPages, 288), + "expected approximately %ld but got %d\n", info.CommitTotal, sys_performance_info->TotalCommittedPages); + + ok(check_with_margin(info.CommitLimit, sys_performance_info->TotalCommitLimit, 32), + "expected approximately %ld but got %d\n", info.CommitLimit, sys_performance_info->TotalCommitLimit); + + ok(check_with_margin(info.CommitPeak, sys_performance_info->PeakCommitment, 32), + "expected approximately %ld but got %d\n", info.CommitPeak, sys_performance_info->PeakCommitment); + + ok(check_with_margin(info.PhysicalAvailable, sys_performance_info->AvailablePages, 128), + "expected approximately %ld but got %d\n", info.PhysicalAvailable, sys_performance_info->AvailablePages); /* TODO: info.SystemCache not checked yet - to which field(s) does this value correspond to? */ - ok(info.KernelTotal == sys_performance_info->PagedPoolUsage + sys_performance_info->NonPagedPoolUsage, - "expected info.KernelTotal=%u but got %u\n", - sys_performance_info->PagedPoolUsage + sys_performance_info->NonPagedPoolUsage, (ULONG)info.KernelTotal); - - ok(info.KernelPaged == sys_performance_info->PagedPoolUsage, - "expected info.KernelPaged=%u but got %u\n", - sys_performance_info->PagedPoolUsage, (ULONG)info.KernelPaged); - - ok(info.KernelNonpaged == sys_performance_info->NonPagedPoolUsage, - "expected info.KernelNonpaged=%u but got %u\n", - sys_performance_info->NonPagedPoolUsage, (ULONG)info.KernelNonpaged); + ok(check_with_margin(info.KernelTotal, sys_performance_info->PagedPoolUsage + sys_performance_info->NonPagedPoolUsage, 64), + "expected approximately %ld but got %d\n", info.KernelTotal, + sys_performance_info->PagedPoolUsage + sys_performance_info->NonPagedPoolUsage); + + ok(check_with_margin(info.KernelPaged, sys_performance_info->PagedPoolUsage, 64), + "expected approximately %ld but got %d\n", info.KernelPaged, sys_performance_info->PagedPoolUsage); + + ok(check_with_margin(info.KernelNonpaged, sys_performance_info->NonPagedPoolUsage, 8), + "expected approximately %ld but got %d\n", info.KernelNonpaged, sys_performance_info->NonPagedPoolUsage); /* compare with values from SYSTEM_BASIC_INFORMATION */ size = 0; @@ -297,14 +279,14 @@ } HeapFree(GetProcessHeap(), 0, sys_process_info); - ok(info.HandleCount == handle_count, - "expected info.HandleCount=%u but got %u\n", handle_count, info.HandleCount); + ok(check_with_margin(info.HandleCount, handle_count, 24), + "expected approximately %d but got %d\n", info.HandleCount, handle_count); - ok(info.ProcessCount == process_count, - "expected info.ProcessCount=%u but got %u\n", process_count, info.ProcessCount); + ok(check_with_margin(info.ProcessCount, process_count, 4), + "expected approximately %d but got %d\n", info.ProcessCount, process_count); - ok(info.ThreadCount == thread_count, - "expected info.ThreadCount=%u but got %u\n", thread_count, info.ThreadCount); + ok(check_with_margin(info.ThreadCount, thread_count, 4), + "expected approximately %d but got %d\n", info.ThreadCount, thread_count); } } @@ -642,30 +624,36 @@ SetLastError(0xdeadbeef); memset( szModExPath, 0xcc, sizeof(szModExPath) ); ret = pGetModuleFileNameExA(hpQV, NULL, szModExPath, 4 ); - ok( ret == 4, "wrong length %u\n", ret ); + ok( ret == 4 || ret == strlen(szModExPath), "wrong length %u\n", ret ); ok( broken(szModExPath[3]) /*w2kpro*/ || strlen(szModExPath) == 3, "szModExPath=\"%s\" ret=%d\n", szModExPath, ret ); ok(GetLastError() == 0xdeadbeef, "got error %d\n", GetLastError()); - SetLastError(0xdeadbeef); - ret = pGetModuleFileNameExA(hpQV, NULL, szModExPath, 0 ); - ok( ret == 0, "wrong length %u\n", ret ); - ok(GetLastError() == ERROR_INVALID_PARAMETER, "got error %d\n", GetLastError()); + if (0) /* crashes on Windows 10 */ + { + SetLastError(0xdeadbeef); + ret = pGetModuleFileNameExA(hpQV, NULL, szModExPath, 0 ); + ok( ret == 0, "wrong length %u\n", ret ); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got error %d\n", GetLastError()); + } SetLastError(0xdeadbeef); memset( buffer, 0xcc, sizeof(buffer) ); ret = pGetModuleFileNameExW(hpQV, NULL, buffer, 4 ); - ok( ret == 4, "wrong length %u\n", ret ); + ok( ret == 4 || ret == lstrlenW(buffer), "wrong length %u\n", ret ); ok( broken(buffer[3]) /*w2kpro*/ || lstrlenW(buffer) == 3, "buffer=%s ret=%d\n", wine_dbgstr_w(buffer), ret ); ok(GetLastError() == 0xdeadbeef, "got error %d\n", GetLastError()); - SetLastError(0xdeadbeef); - buffer[0] = 0xcc; - ret = pGetModuleFileNameExW(hpQV, NULL, buffer, 0 ); - ok( ret == 0, "wrong length %u\n", ret ); - ok(GetLastError() == 0xdeadbeef, "got error %d\n", GetLastError()); - ok( buffer[0] == 0xcc, "buffer modified %s\n", wine_dbgstr_w(buffer) ); + if (0) /* crashes on Windows 10 */ + { + SetLastError(0xdeadbeef); + buffer[0] = 0xcc; + ret = pGetModuleFileNameExW(hpQV, NULL, buffer, 0 ); + ok( ret == 0, "wrong length %u\n", ret ); + ok(GetLastError() == 0xdeadbeef, "got error %d\n", GetLastError()); + ok( buffer[0] == 0xcc, "buffer modified %s\n", wine_dbgstr_w(buffer) ); + } } static void test_GetModuleBaseName(void) diff -Nru wine1.7-1.7.50/dlls/quartz/avisplit.c wine1.7-1.7.55/dlls/quartz/avisplit.c --- wine1.7-1.7.50/dlls/quartz/avisplit.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/quartz/avisplit.c 2015-11-13 14:32:40.000000000 +0000 @@ -203,7 +203,7 @@ ++stream->index_next; } - rtSampleStop = rtSampleStart + MEDIATIME_FROM_BYTES(entry->dwSize & ~(1 << 31)); + rtSampleStop = rtSampleStart + MEDIATIME_FROM_BYTES(entry->dwSize & ~(1u << 31)); TRACE("offset(%u) size(%u)\n", (DWORD)BYTES_FROM_MEDIATIME(rtSampleStart), (DWORD)BYTES_FROM_MEDIATIME(rtSampleStop - rtSampleStart)); } @@ -596,7 +596,7 @@ BOOL keyframe = !(pIndex->aIndex[x].dwSize >> 31); DWORDLONG offset = pIndex->qwBaseOffset + pIndex->aIndex[x].dwOffset; TRACE("dwOffset: %x%08x\n", (DWORD)(offset >> 32), (DWORD)offset); - TRACE("dwSize: %u\n", (pIndex->aIndex[x].dwSize & ~(1<<31))); + TRACE("dwSize: %u\n", (pIndex->aIndex[x].dwSize & ~(1u << 31))); TRACE("Frame is a keyframe: %s\n", keyframe ? "yes" : "no"); } @@ -994,7 +994,7 @@ for (z = 0; z < stream->stdindex[y]->nEntriesInUse; ++z) { - UINT len = stream->stdindex[y]->aIndex[z].dwSize & ~(1 << 31); + UINT len = stream->stdindex[y]->aIndex[z].dwSize & ~(1u << 31); frames += len / stream->streamheader.dwSampleSize + !!(len % stream->streamheader.dwSampleSize); } } @@ -1109,24 +1109,18 @@ return E_FAIL; } - pos += sizeof(RIFFCHUNK) + list.cb; - hr = IAsyncReader_SyncRead(This->pReader, pos, sizeof(list), (BYTE *)&list); - - while (list.fcc == ckidAVIPADDING || (list.fcc == FOURCC_LIST && list.fccListType != listtypeAVIMOVIE)) + /* Skip any chunks until we find the LIST chunk */ + do { pos += sizeof(RIFFCHUNK) + list.cb; - hr = IAsyncReader_SyncRead(This->pReader, pos, sizeof(list), (BYTE *)&list); } + while (hr == S_OK && (list.fcc != FOURCC_LIST || + (list.fcc == FOURCC_LIST && list.fccListType != listtypeAVIMOVIE))); - if (list.fcc != FOURCC_LIST) - { - ERR("Expected LIST, but got %.04s\n", (LPSTR)&list.fcc); - return E_FAIL; - } - if (list.fccListType != listtypeAVIMOVIE) + if (hr != S_OK) { - ERR("Expected AVI movie list, but got %.04s\n", (LPSTR)&list.fccListType); + ERR("Failed to find LIST chunk from AVI file\n"); return E_FAIL; } @@ -1134,21 +1128,18 @@ /* FIXME: AVIX files are extended beyond the FOURCC chunk "AVI ", and thus won't be played here, * once I get one of the files I'll try to fix it */ - if (hr == S_OK) - { - This->rtStart = pAviSplit->CurrentChunkOffset = MEDIATIME_FROM_BYTES(pos + sizeof(RIFFLIST)); - pos += list.cb + sizeof(RIFFCHUNK); - - pAviSplit->EndOfFile = This->rtStop = MEDIATIME_FROM_BYTES(pos); - if (pos > total) - { - ERR("File smaller (%x%08x) then EndOfFile (%x%08x)\n", (DWORD)(total >> 32), (DWORD)total, (DWORD)(pAviSplit->EndOfFile >> 32), (DWORD)pAviSplit->EndOfFile); - return E_FAIL; - } + This->rtStart = pAviSplit->CurrentChunkOffset = MEDIATIME_FROM_BYTES(pos + sizeof(RIFFLIST)); + pos += list.cb + sizeof(RIFFCHUNK); - hr = IAsyncReader_SyncRead(This->pReader, BYTES_FROM_MEDIATIME(pAviSplit->CurrentChunkOffset), sizeof(pAviSplit->CurrentChunk), (BYTE *)&pAviSplit->CurrentChunk); + pAviSplit->EndOfFile = This->rtStop = MEDIATIME_FROM_BYTES(pos); + if (pos > total) + { + ERR("File smaller (%x%08x) then EndOfFile (%x%08x)\n", (DWORD)(total >> 32), (DWORD)total, (DWORD)(pAviSplit->EndOfFile >> 32), (DWORD)pAviSplit->EndOfFile); + return E_FAIL; } + hr = IAsyncReader_SyncRead(This->pReader, BYTES_FROM_MEDIATIME(pAviSplit->CurrentChunkOffset), sizeof(pAviSplit->CurrentChunk), (BYTE *)&pAviSplit->CurrentChunk); + props->cbAlign = 1; props->cbPrefix = 0; /* Comrades, prevent shortage of buffers, or you will feel the consequences! DA! */ @@ -1342,7 +1333,7 @@ { if (stream->streamheader.dwSampleSize) { - ULONG len = stream->stdindex[y]->aIndex[z].dwSize & ~(1 << 31); + ULONG len = stream->stdindex[y]->aIndex[z].dwSize & ~(1u << 31); ULONG size = stream->streamheader.dwSampleSize; pin->dwSamplesProcessed += len / size; @@ -1460,7 +1451,7 @@ if (FAILED(hr)) return hr; - *ppv = This; + *ppv = &This->Parser.filter.IBaseFilter_iface; return hr; } diff -Nru wine1.7-1.7.50/dlls/quartz/fil_data.idl wine1.7-1.7.55/dlls/quartz/fil_data.idl --- wine1.7-1.7.50/dlls/quartz/fil_data.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/quartz/fil_data.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep header + import "objidl.idl"; import "strmif.idl"; import "unknwn.idl"; diff -Nru wine1.7-1.7.50/dlls/quartz/filesource.c wine1.7-1.7.55/dlls/quartz/filesource.c --- wine1.7-1.7.50/dlls/quartz/filesource.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/quartz/filesource.c 2015-11-13 14:32:40.000000000 +0000 @@ -810,20 +810,18 @@ *ppv = NULL; - if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = This; - else if (IsEqualIID(riid, &IID_IPin)) - *ppv = This; + if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IPin)) + *ppv = &This->pin.pin.IPin_iface; else if (IsEqualIID(riid, &IID_IAsyncReader)) *ppv = &This->IAsyncReader_iface; if (*ppv) { - IUnknown_AddRef((IUnknown *)(*ppv)); + IUnknown_AddRef((IUnknown *)*ppv); return S_OK; } - if (!IsEqualIID(riid, &IID_IPin) && !IsEqualIID(riid, &IID_IMediaSeeking)) + if (!IsEqualIID(riid, &IID_IMediaSeeking)) FIXME("No interface for %s!\n", qzdebugstr_guid(riid)); return E_NOINTERFACE; diff -Nru wine1.7-1.7.50/dlls/quartz/filtergraph.c wine1.7-1.7.55/dlls/quartz/filtergraph.c --- wine1.7-1.7.50/dlls/quartz/filtergraph.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/quartz/filtergraph.c 2015-11-13 14:32:40.000000000 +0000 @@ -611,7 +611,7 @@ if (info_out.dir != PINDIR_OUTPUT) { IBaseFilter_Release(info_out.pFilter); - return E_UNEXPECTED; + return VFW_E_CANNOT_CONNECT; } hr = IPin_QueryPinInfo(in, &info_in); @@ -621,7 +621,7 @@ goto out; if (info_in.dir != PINDIR_INPUT) { - hr = E_UNEXPECTED; + hr = VFW_E_CANNOT_CONNECT; goto out; } @@ -913,6 +913,9 @@ TRACE("(%p/%p)->(%p, %p)\n", This, iface, ppinOut, ppinIn); + if(!ppinOut || !ppinIn) + return E_POINTER; + if (TRACE_ON(quartz)) { hr = IPin_QueryPinInfo(ppinIn, &PinInfo); diff -Nru wine1.7-1.7.50/dlls/quartz/mpegsplit.c wine1.7-1.7.55/dlls/quartz/mpegsplit.c --- wine1.7-1.7.50/dlls/quartz/mpegsplit.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/quartz/mpegsplit.c 2015-11-13 14:32:40.000000000 +0000 @@ -55,6 +55,7 @@ typedef struct MPEGSplitterImpl { ParserImpl Parser; + IAMStreamSelect IAMStreamSelect_iface; LONGLONG EndOfFile; LONGLONG position; DWORD begin_offset; @@ -64,11 +65,21 @@ BOOL seek; } MPEGSplitterImpl; +static inline MPEGSplitterImpl *impl_from_IBaseFilter( IBaseFilter *iface ) +{ + return CONTAINING_RECORD(iface, MPEGSplitterImpl, Parser.filter.IBaseFilter_iface); +} + static inline MPEGSplitterImpl *impl_from_IMediaSeeking( IMediaSeeking *iface ) { return CONTAINING_RECORD(iface, MPEGSplitterImpl, Parser.sourceSeeking.IMediaSeeking_iface); } +static inline MPEGSplitterImpl *impl_from_IAMStreamSelect( IAMStreamSelect *iface ) +{ + return CONTAINING_RECORD(iface, MPEGSplitterImpl, IAMStreamSelect_iface); +} + static int MPEGSplitter_head_check(const BYTE *header) { /* If this is a possible start code, check for a system or video header */ @@ -114,9 +125,7 @@ int bitrate_index, freq_index, lsf = 1, mpeg1, layer, padding, bitrate, length; LONGLONG duration; - if (!(header[0] == 0xff && ((header[1]>>5)&0x7) == 0x7 && - ((header[1]>>1)&0x3) != 0 && ((header[2]>>4)&0xf) != 0xf && - ((header[2]>>2)&0x3) != 0x3)) + if (MPEGSplitter_head_check(header) != MPEG_AUDIO_HEADER) { FIXME("Not a valid header: %02x:%02x:%02x:%02x\n", header[0], header[1], header[2], header[3]); return E_INVALIDARG; @@ -206,9 +215,9 @@ if (SUCCEEDED(hr)) { IMediaSample_SetTime(sample, &rtSampleStart, &rtSampleStop); - IMediaSample_SetPreroll(sample, 0); - IMediaSample_SetDiscontinuity(sample, 0); - IMediaSample_SetSyncPoint(sample, 1); + IMediaSample_SetPreroll(sample, FALSE); + IMediaSample_SetDiscontinuity(sample, FALSE); + IMediaSample_SetSyncPoint(sample, TRUE); hr = IAsyncReader_Request(pin->pReader, sample, 0); if (SUCCEEDED(hr)) { @@ -478,7 +487,7 @@ HRESULT hr; LONGLONG pos = 0; /* in bytes */ BYTE header[10]; - int streamtype = 0; + int streamtype; LONGLONG total, avail; AM_MEDIA_TYPE amt; PIN_INFO piOutput; @@ -516,12 +525,37 @@ hr = IAsyncReader_SyncRead(pPin->pReader, pos, 4, header); if (SUCCEEDED(hr)) pos += 4; - TRACE("%x:%x:%x:%x\n", header[0], header[1], header[2], header[3]); } while (0); - while(SUCCEEDED(hr) && !(streamtype=MPEGSplitter_head_check(header))) + while(SUCCEEDED(hr)) { - TRACE("%x:%x:%x:%x\n", header[0], header[1], header[2], header[3]); + TRACE("Testing header %x:%x:%x:%x\n", header[0], header[1], header[2], header[3]); + + streamtype = MPEGSplitter_head_check(header); + if (streamtype == MPEG_AUDIO_HEADER) + { + LONGLONG length; + if (parse_header(header, &length, NULL) == S_OK) + { + BYTE next_header[4]; + /* Ensure we have a valid header by seeking for the next frame, some bad + * encoded ID3v2 may have an incorrect length and we end up finding bytes + * like FF FE 00 28 which are nothing more than a Unicode BOM followed by + * ')' character from inside a ID3v2 tag. Unfortunately that sequence + * matches like a valid mpeg audio header. + */ + hr = IAsyncReader_SyncRead(pPin->pReader, pos + length - 4, 4, next_header); + if (FAILED(hr)) + break; + if (parse_header(next_header, &length, NULL) == S_OK) + break; + TRACE("%x:%x:%x:%x is a fake audio header, looking for next...\n", + header[0], header[1], header[2], header[3]); + } + } + else if (streamtype) /* Video or System stream */ + break; + /* No valid header yet; shift by a byte and check again */ memmove(header, header+1, 3); hr = IAsyncReader_SyncRead(pPin->pReader, pos++, 1, header + 3); @@ -712,7 +746,7 @@ IMediaSample_SetPreroll(sample, FALSE); IMediaSample_SetDiscontinuity(sample, TRUE); IMediaSample_SetSyncPoint(sample, 1); - This->seek = 0; + This->seek = FALSE; hr = IAsyncReader_Request(pin->pReader, sample, 0); if (SUCCEEDED(hr)) @@ -729,9 +763,36 @@ return hr; } +static HRESULT WINAPI MPEGSplitter_QueryInterface(IBaseFilter *iface, REFIID riid, void **ppv) +{ + MPEGSplitterImpl *This = impl_from_IBaseFilter(iface); + TRACE("(%s, %p)\n", qzdebugstr_guid(riid), ppv); + + *ppv = NULL; + + if ( IsEqualIID(riid, &IID_IUnknown) + || IsEqualIID(riid, &IID_IPersist) + || IsEqualIID(riid, &IID_IMediaFilter) + || IsEqualIID(riid, &IID_IBaseFilter) ) + *ppv = iface; + else if ( IsEqualIID(riid, &IID_IAMStreamSelect) ) + *ppv = &This->IAMStreamSelect_iface; + + if (*ppv) + { + IBaseFilter_AddRef(iface); + return S_OK; + } + + if (!IsEqualIID(riid, &IID_IPin) && !IsEqualIID(riid, &IID_IVideoWindow)) + FIXME("No interface for %s!\n", qzdebugstr_guid(riid)); + + return E_NOINTERFACE; +} + static const IBaseFilterVtbl MPEGSplitter_Vtbl = { - Parser_QueryInterface, + MPEGSplitter_QueryInterface, Parser_AddRef, Parser_Release, Parser_GetClassID, @@ -748,6 +809,64 @@ Parser_QueryVendorInfo }; +static HRESULT WINAPI AMStreamSelect_QueryInterface(IAMStreamSelect *iface, REFIID riid, void **ppv) +{ + MPEGSplitterImpl *This = impl_from_IAMStreamSelect(iface); + + return IBaseFilter_QueryInterface(&This->Parser.filter.IBaseFilter_iface, riid, ppv); +} + +static ULONG WINAPI AMStreamSelect_AddRef(IAMStreamSelect *iface) +{ + MPEGSplitterImpl *This = impl_from_IAMStreamSelect(iface); + + return IBaseFilter_AddRef(&This->Parser.filter.IBaseFilter_iface); +} + +static ULONG WINAPI AMStreamSelect_Release(IAMStreamSelect *iface) +{ + MPEGSplitterImpl *This = impl_from_IAMStreamSelect(iface); + + return IBaseFilter_Release(&This->Parser.filter.IBaseFilter_iface); +} + +static HRESULT WINAPI AMStreamSelect_Count(IAMStreamSelect *iface, DWORD *streams) +{ + MPEGSplitterImpl *This = impl_from_IAMStreamSelect(iface); + + FIXME("(%p/%p)->(%p) stub!\n", This, iface, streams); + + return E_NOTIMPL; +} + +static HRESULT WINAPI AMStreamSelect_Info(IAMStreamSelect *iface, LONG index, AM_MEDIA_TYPE **media_type, DWORD *flags, LCID *lcid, DWORD *group, WCHAR **name, IUnknown **object, IUnknown **unknown) +{ + MPEGSplitterImpl *This = impl_from_IAMStreamSelect(iface); + + FIXME("(%p/%p)->(%d,%p,%p,%p,%p,%p,%p,%p) stub!\n", This, iface, index, media_type, flags, lcid, group, name, object, unknown); + + return E_NOTIMPL; +} + +static HRESULT WINAPI AMStreamSelect_Enable(IAMStreamSelect *iface, LONG index, DWORD flags) +{ + MPEGSplitterImpl *This = impl_from_IAMStreamSelect(iface); + + FIXME("(%p/%p)->(%d,%x) stub!\n", This, iface, index, flags); + + return E_NOTIMPL; +} + +static const IAMStreamSelectVtbl AMStreamSelectVtbl = +{ + AMStreamSelect_QueryInterface, + AMStreamSelect_AddRef, + AMStreamSelect_Release, + AMStreamSelect_Count, + AMStreamSelect_Info, + AMStreamSelect_Enable +}; + HRESULT MPEGSplitter_create(IUnknown * pUnkOuter, LPVOID * ppv) { MPEGSplitterImpl *This; @@ -771,10 +890,11 @@ CoTaskMemFree(This); return hr; } - This->seek = 1; + This->IAMStreamSelect_iface.lpVtbl = &AMStreamSelectVtbl; + This->seek = TRUE; /* Note: This memory is managed by the parser filter once created */ - *ppv = This; + *ppv = &This->Parser.filter.IBaseFilter_iface; return hr; } diff -Nru wine1.7-1.7.50/dlls/quartz/parser.c wine1.7-1.7.55/dlls/quartz/parser.c --- wine1.7-1.7.50/dlls/quartz/parser.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/quartz/parser.c 2015-11-13 14:32:40.000000000 +0000 @@ -147,11 +147,11 @@ || IsEqualIID(riid, &IID_IPersist) || IsEqualIID(riid, &IID_IMediaFilter) || IsEqualIID(riid, &IID_IBaseFilter) ) - *ppv = This; + *ppv = &This->filter.IBaseFilter_iface; if (*ppv) { - IUnknown_AddRef((IUnknown *)(*ppv)); + IUnknown_AddRef((IUnknown *)*ppv); return S_OK; } @@ -521,21 +521,21 @@ { ParserImpl *This = impl_from_IMediaSeeking(iface); - return IUnknown_QueryInterface((IUnknown *)This, riid, ppv); + return IBaseFilter_QueryInterface(&This->filter.IBaseFilter_iface, riid, ppv); } static ULONG WINAPI Parser_Seeking_AddRef(IMediaSeeking * iface) { ParserImpl *This = impl_from_IMediaSeeking(iface); - return IUnknown_AddRef((IUnknown *)This); + return IBaseFilter_AddRef(&This->filter.IBaseFilter_iface); } static ULONG WINAPI Parser_Seeking_Release(IMediaSeeking * iface) { ParserImpl *This = impl_from_IMediaSeeking(iface); - return IUnknown_Release((IUnknown *)This); + return IBaseFilter_Release(&This->filter.IBaseFilter_iface); } static const IMediaSeekingVtbl Parser_Seeking_Vtbl = diff -Nru wine1.7-1.7.50/dlls/quartz/pin.c wine1.7-1.7.55/dlls/quartz/pin.c --- wine1.7-1.7.50/dlls/quartz/pin.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/quartz/pin.c 2015-11-13 14:32:40.000000000 +0000 @@ -212,7 +212,7 @@ pPinImpl->dRate = 1.0; pPinImpl->state = Req_Die; pPinImpl->fnCustomRequest = pCustomRequest; - pPinImpl->stop_playback = 1; + pPinImpl->stop_playback = TRUE; InitializeCriticalSection(&pPinImpl->thread_lock); pPinImpl->thread_lock.DebugInfo->Spare[0] = (DWORD_PTR)( __FILE__ ": PullPin.thread_lock"); @@ -415,6 +415,7 @@ { DWORD_PTR dwUser; + pSample = NULL; IAsyncReader_WaitForNext(This->pReader, 0, &pSample, &dwUser); if (!pSample) @@ -637,7 +638,7 @@ /* Wake up! */ assert(WaitForSingleObject(This->thread_sleepy, 0) == WAIT_TIMEOUT); This->state = Req_Run; - This->stop_playback = 0; + This->stop_playback = FALSE; ResetEvent(This->hEventStateChanged); SetEvent(This->thread_sleepy); } @@ -663,7 +664,7 @@ assert(WaitForSingleObject(This->thread_sleepy, 0) == WAIT_TIMEOUT); This->state = Req_Pause; - This->stop_playback = 1; + This->stop_playback = TRUE; ResetEvent(This->hEventStateChanged); SetEvent(This->thread_sleepy); @@ -699,7 +700,7 @@ assert(This->state == Req_Pause || This->state == Req_Sleepy); - This->stop_playback = 1; + This->stop_playback = TRUE; This->state = Req_Die; assert(WaitForSingleObject(This->thread_sleepy, 0) == WAIT_TIMEOUT); ResetEvent(This->hEventStateChanged); diff -Nru wine1.7-1.7.50/dlls/quartz/systemclock.c wine1.7-1.7.55/dlls/quartz/systemclock.c --- wine1.7-1.7.50/dlls/quartz/systemclock.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/quartz/systemclock.c 2015-11-13 14:32:40.000000000 +0000 @@ -215,7 +215,7 @@ if (IsEqualIID (riid, &IID_IUnknown) || IsEqualIID (riid, &IID_IReferenceClock)) { SystemClockImpl_AddRef(iface); - *ppobj = This; + *ppobj = &This->IReferenceClock_iface; return S_OK; } diff -Nru wine1.7-1.7.50/dlls/quartz/tests/fil_data.idl wine1.7-1.7.55/dlls/quartz/tests/fil_data.idl --- wine1.7-1.7.50/dlls/quartz/tests/fil_data.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/quartz/tests/fil_data.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep header + import "objidl.idl"; import "strmif.idl"; import "unknwn.idl"; diff -Nru wine1.7-1.7.50/dlls/quartz/tests/filtergraph.c wine1.7-1.7.55/dlls/quartz/tests/filtergraph.c --- wine1.7-1.7.50/dlls/quartz/tests/filtergraph.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/quartz/tests/filtergraph.c 2015-11-13 14:32:40.000000000 +0000 @@ -180,6 +180,9 @@ ok(hr == S_OK, "CoCreateInstance failed with %x\n", hr); ok(pF != NULL, "pF is NULL\n"); + hr = IGraphBuilder_AddFilter(pgraph, NULL, testFilterW); + ok(hr == E_POINTER, "IGraphBuilder_AddFilter returned %x\n", hr); + /* add the two filters to the graph */ hr = IGraphBuilder_AddFilter(pgraph, pF, testFilterW); ok(hr == S_OK, "failed to add pF to the graph: %x\n", hr); @@ -204,6 +207,15 @@ hr = IGraphBuilder_FindFilterByName(pgraph, testFilterW, NULL); ok(hr == E_POINTER, "IGraphBuilder_FindFilterByName returned %x\n", hr); + hr = IGraphBuilder_Connect(pgraph, NULL, pIn); + ok(hr == E_POINTER, "IGraphBuilder_Connect returned %x\n", hr); + + hr = IGraphBuilder_Connect(pgraph, pIn, NULL); + ok(hr == E_POINTER, "IGraphBuilder_Connect returned %x\n", hr); + + hr = IGraphBuilder_Connect(pgraph, pIn, pIn); + ok(hr == VFW_E_CANNOT_CONNECT, "IGraphBuilder_Connect returned %x\n", hr); + if (pIn) IPin_Release(pIn); if (pEnum) IEnumPins_Release(pEnum); if (pF) IBaseFilter_Release(pF); diff -Nru wine1.7-1.7.50/dlls/quartz/tests/Makefile.in wine1.7-1.7.55/dlls/quartz/tests/Makefile.in --- wine1.7-1.7.50/dlls/quartz/tests/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/quartz/tests/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -8,6 +8,7 @@ filtermapper.c \ memallocator.c \ misc.c \ + mpegsplit.c \ referenceclock.c \ videorenderer.c diff -Nru wine1.7-1.7.50/dlls/quartz/tests/mpegsplit.c wine1.7-1.7.55/dlls/quartz/tests/mpegsplit.c --- wine1.7-1.7.50/dlls/quartz/tests/mpegsplit.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/quartz/tests/mpegsplit.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,58 @@ +/* + * Unit tests for the MPEG-1 stream splitter functions + * + * Copyright 2015 Anton Baskanov + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include "wine/test.h" +#include "dshow.h" + +static IUnknown *create_mpeg_splitter(void) +{ + IUnknown *mpeg_splitter = NULL; + HRESULT result = CoCreateInstance(&CLSID_MPEG1Splitter, NULL, CLSCTX_INPROC_SERVER, + &IID_IUnknown, (void **)&mpeg_splitter); + ok(S_OK == result, "got 0x%08x\n", result); + return mpeg_splitter; +} + +static void test_query_interface(void) +{ + IUnknown *mpeg_splitter = create_mpeg_splitter(); + + IAMStreamSelect *stream_select = NULL; + HRESULT result = IUnknown_QueryInterface( + mpeg_splitter, &IID_IAMStreamSelect, (void **)&stream_select); + ok(S_OK == result, "got 0x%08x\n", result); + if (S_OK == result) + { + IAMStreamSelect_Release(stream_select); + } + + IUnknown_Release(mpeg_splitter); +} + +START_TEST(mpegsplit) +{ + CoInitialize(NULL); + + test_query_interface(); + + CoUninitialize(); +} diff -Nru wine1.7-1.7.50/dlls/quartz/vmr9.c wine1.7-1.7.55/dlls/quartz/vmr9.c --- wine1.7-1.7.50/dlls/quartz/vmr9.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/quartz/vmr9.c 2015-11-13 14:32:40.000000000 +0000 @@ -3085,6 +3085,7 @@ D3DDISPLAYMODE mode; hr = IDirect3D9_EnumAdapterModes(This->d3d9_ptr, i++, D3DFMT_X8R8G8B8, 0, &mode); + if (hr == D3DERR_INVALIDCALL) break; /* out of adapters */ } while (FAILED(hr)); if (FAILED(hr)) ERR("HR: %08x\n", hr); @@ -3111,6 +3112,6 @@ This->SurfaceAllocatorNotify = NULL; This->reset = FALSE; - *ppv = This; + *ppv = &This->IVMRImagePresenter9_iface; return S_OK; } diff -Nru wine1.7-1.7.50/dlls/quartz/waveparser.c wine1.7-1.7.55/dlls/quartz/waveparser.c --- wine1.7-1.7.50/dlls/quartz/waveparser.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/quartz/waveparser.c 2015-11-13 14:32:40.000000000 +0000 @@ -122,9 +122,9 @@ pin->rtCurrent = pin->rtNext; pin->rtNext = rtSampleStop; - IMediaSample_SetPreroll(newsample, 0); - IMediaSample_SetDiscontinuity(newsample, 0); - IMediaSample_SetSyncPoint(newsample, 1); + IMediaSample_SetPreroll(newsample, FALSE); + IMediaSample_SetDiscontinuity(newsample, FALSE); + IMediaSample_SetSyncPoint(newsample, TRUE); hr = IAsyncReader_Request(pin->pReader, newsample, 0); } @@ -440,7 +440,7 @@ if (FAILED(hr)) return hr; - *ppv = This; + *ppv = &This->Parser.filter.IBaseFilter_iface; return hr; } diff -Nru wine1.7-1.7.50/dlls/riched20/caret.c wine1.7-1.7.55/dlls/riched20/caret.c --- wine1.7-1.7.50/dlls/riched20/caret.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/riched20/caret.c 2015-11-13 14:32:40.000000000 +0000 @@ -446,7 +446,7 @@ continue; } } - if (delete_all) ME_SetDefaultParaFormat( start_para->member.para.pFmt ); + if (delete_all) ME_SetDefaultParaFormat( editor, start_para->member.para.pFmt ); return TRUE; } diff -Nru wine1.7-1.7.50/dlls/riched20/editor.c wine1.7-1.7.55/dlls/riched20/editor.c --- wine1.7-1.7.50/dlls/riched20/editor.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/riched20/editor.c 2015-11-13 14:32:40.000000000 +0000 @@ -96,7 +96,7 @@ + EM_SETCHARFORMAT (partly done, no ANSI) - EM_SETEDITSTYLE + EM_SETEVENTMASK (few notifications supported) - - EM_SETFONTSIZE + + EM_SETFONTSIZE - EM_SETIMECOLOR 1.0asian - EM_SETIMEOPTIONS 1.0asian - EM_SETIMESTATUS @@ -172,14 +172,14 @@ - ES_AUTOHSCROLL - ES_AUTOVSCROLL - - ES_CENTER + + ES_CENTER + ES_DISABLENOSCROLL (scrollbar is always visible) - ES_EX_NOCALLOLEINIT - - ES_LEFT + + ES_LEFT - ES_MULTILINE (currently single line controls aren't supported) - ES_NOIME - ES_READONLY (I'm not sure if beeping is the proper behaviour) - - ES_RIGHT + + ES_RIGHT - ES_SAVESEL - ES_SELFIME - ES_SUNKEN @@ -533,7 +533,7 @@ ME_Style *style2; RTFFlushOutputBuffer(info); /* FIXME too slow ? how come ? */ - style2 = ME_ApplyStyle(info->style, &fmt); + style2 = ME_ApplyStyle(info->editor, info->style, &fmt); ME_ReleaseStyle(info->style); info->style = style2; info->styleChanged = TRUE; @@ -1236,136 +1236,191 @@ return ret; } -static void ME_RTFReadPictGroup(RTF_Info *info) +static void ME_RTFReadShpPictGroup( RTF_Info *info ) { - SIZEL sz; - BYTE* buffer = NULL; - unsigned bufsz, bufidx; - BOOL flip; - BYTE val; - METAFILEPICT mfp; - HENHMETAFILE hemf; - HBITMAP hbmp; - enum gfxkind {gfx_unknown = 0, gfx_enhmetafile, gfx_metafile, gfx_dib} gfx = gfx_unknown; + int level = 1; - RTFGetToken (info); - if (info->rtfClass == rtfEOF) - return; - mfp.mm = MM_TEXT; - /* fetch picture type */ - if (RTFCheckMM (info, rtfPictAttr, rtfWinMetafile)) - { - mfp.mm = info->rtfParam; - gfx = gfx_metafile; - } - else if (RTFCheckMM (info, rtfPictAttr, rtfDevIndBitmap)) - { - if (info->rtfParam != 0) FIXME("dibitmap should be 0 (%d)\n", info->rtfParam); - gfx = gfx_dib; - } - else if (RTFCheckMM (info, rtfPictAttr, rtfEmfBlip)) - { - gfx = gfx_enhmetafile; - } - else - { - FIXME("%d %d\n", info->rtfMajor, info->rtfMinor); - goto skip_group; - } - sz.cx = sz.cy = 0; - /* fetch picture attributes */ - for (;;) - { - RTFGetToken (info); - if (info->rtfClass == rtfEOF) - return; - if (info->rtfClass == rtfText) - break; - if (!RTFCheckCM (info, rtfControl, rtfPictAttr)) + for (;;) { - ERR("Expected picture attribute (%d %d)\n", - info->rtfClass, info->rtfMajor); - goto skip_group; - } - else if (RTFCheckMM (info, rtfPictAttr, rtfPicWid)) - { - if (gfx == gfx_metafile) mfp.xExt = info->rtfParam; + RTFGetToken (info); + + if (info->rtfClass == rtfEOF) return; + if (RTFCheckCM( info, rtfGroup, rtfEndGroup )) + { + if (--level == 0) break; + } + else if (RTFCheckCM( info, rtfGroup, rtfBeginGroup )) + { + level++; + } + else + { + RTFRouteToken( info ); + if (RTFCheckCM( info, rtfGroup, rtfEndGroup )) + level--; + } } - else if (RTFCheckMM (info, rtfPictAttr, rtfPicHt)) + + RTFRouteToken( info ); /* feed "}" back to router */ + return; +} + +static DWORD read_hex_data( RTF_Info *info, BYTE **out ) +{ + DWORD read = 0, size = 1024; + BYTE *buf, val; + BOOL flip; + + *out = NULL; + + if (info->rtfClass != rtfText) { - if (gfx == gfx_metafile) mfp.yExt = info->rtfParam; + ERR("Called with incorrect token\n"); + return 0; } - else if (RTFCheckMM (info, rtfPictAttr, rtfPicGoalWid)) - sz.cx = info->rtfParam; - else if (RTFCheckMM (info, rtfPictAttr, rtfPicGoalHt)) - sz.cy = info->rtfParam; - else - FIXME("Non supported attribute: %d %d %d\n", info->rtfClass, info->rtfMajor, info->rtfMinor); - } - /* fetch picture data */ - bufsz = 1024; - bufidx = 0; - buffer = HeapAlloc(GetProcessHeap(), 0, bufsz); - val = info->rtfMajor; - for (flip = TRUE;; flip = !flip) - { - RTFGetToken (info); - if (info->rtfClass == rtfEOF) + + buf = HeapAlloc( GetProcessHeap(), 0, size ); + if (!buf) return 0; + + val = info->rtfMajor; + for (flip = TRUE;; flip = !flip) { - HeapFree(GetProcessHeap(), 0, buffer); - return; /* Warn ?? */ + RTFGetToken( info ); + if (info->rtfClass == rtfEOF) + { + HeapFree( GetProcessHeap(), 0, buf ); + return 0; + } + if (info->rtfClass != rtfText) break; + if (flip) + { + if (read >= size) + { + size *= 2; + buf = HeapReAlloc( GetProcessHeap(), 0, buf, size ); + if (!buf) return 0; + } + buf[read++] = RTFCharToHex(val) * 16 + RTFCharToHex(info->rtfMajor); + } + else + val = info->rtfMajor; } - if (RTFCheckCM(info, rtfGroup, rtfEndGroup)) - break; - if (info->rtfClass != rtfText) goto skip_group; - if (flip) + if (flip) FIXME("wrong hex string\n"); + + *out = buf; + return read; +} + +static void ME_RTFReadPictGroup(RTF_Info *info) +{ + SIZEL sz; + BYTE *buffer = NULL; + DWORD size = 0; + METAFILEPICT mfp; + HENHMETAFILE hemf; + HBITMAP hbmp; + enum gfxkind {gfx_unknown = 0, gfx_enhmetafile, gfx_metafile, gfx_dib} gfx = gfx_unknown; + int level = 1; + + mfp.mm = MM_TEXT; + sz.cx = sz.cy = 0; + + for (;;) { - if (bufidx >= bufsz && - !(buffer = HeapReAlloc(GetProcessHeap(), 0, buffer, bufsz += 1024))) - goto skip_group; - buffer[bufidx++] = RTFCharToHex(val) * 16 + RTFCharToHex(info->rtfMajor); + RTFGetToken( info ); + + if (info->rtfClass == rtfText) + { + if (level == 1) + { + if (!buffer) + size = read_hex_data( info, &buffer ); + } + else + { + RTFSkipGroup( info ); + } + } /* We potentially have a new token so fall through. */ + + if (info->rtfClass == rtfEOF) return; + + if (RTFCheckCM( info, rtfGroup, rtfEndGroup )) + { + if (--level == 0) break; + continue; + } + if (RTFCheckCM( info, rtfGroup, rtfBeginGroup )) + { + level++; + continue; + } + if (!RTFCheckCM( info, rtfControl, rtfPictAttr )) + { + RTFRouteToken( info ); + if (RTFCheckCM( info, rtfGroup, rtfEndGroup )) + level--; + continue; + } + + if (RTFCheckMM( info, rtfPictAttr, rtfWinMetafile )) + { + mfp.mm = info->rtfParam; + gfx = gfx_metafile; + } + else if (RTFCheckMM( info, rtfPictAttr, rtfDevIndBitmap )) + { + if (info->rtfParam != 0) FIXME("dibitmap should be 0 (%d)\n", info->rtfParam); + gfx = gfx_dib; + } + else if (RTFCheckMM( info, rtfPictAttr, rtfEmfBlip )) + gfx = gfx_enhmetafile; + else if (RTFCheckMM( info, rtfPictAttr, rtfPicWid )) + mfp.xExt = info->rtfParam; + else if (RTFCheckMM( info, rtfPictAttr, rtfPicHt )) + mfp.yExt = info->rtfParam; + else if (RTFCheckMM( info, rtfPictAttr, rtfPicGoalWid )) + sz.cx = info->rtfParam; + else if (RTFCheckMM( info, rtfPictAttr, rtfPicGoalHt )) + sz.cy = info->rtfParam; + else + FIXME("Non supported attribute: %d %d %d\n", info->rtfClass, info->rtfMajor, info->rtfMinor); } - else - val = info->rtfMajor; - } - if (flip) FIXME("wrong hex string\n"); - switch (gfx) - { - case gfx_enhmetafile: - if ((hemf = SetEnhMetaFileBits(bufidx, buffer))) - ME_RTFInsertOleObject(info, hemf, NULL, &sz); - break; - case gfx_metafile: - if ((hemf = SetWinMetaFileBits(bufidx, buffer, NULL, &mfp))) - ME_RTFInsertOleObject(info, hemf, NULL, &sz); - break; - case gfx_dib: + if (buffer) { - BITMAPINFO* bi = (BITMAPINFO*)buffer; - HDC hdc = GetDC(0); - unsigned nc = bi->bmiHeader.biClrUsed; - - /* not quite right, especially for bitfields type of compression */ - if (!nc && bi->bmiHeader.biBitCount <= 8) - nc = 1 << bi->bmiHeader.biBitCount; - if ((hbmp = CreateDIBitmap(hdc, &bi->bmiHeader, - CBM_INIT, (char*)(bi + 1) + nc * sizeof(RGBQUAD), - bi, DIB_RGB_COLORS))) - ME_RTFInsertOleObject(info, NULL, hbmp, &sz); - ReleaseDC(0, hdc); + switch (gfx) + { + case gfx_enhmetafile: + if ((hemf = SetEnhMetaFileBits( size, buffer ))) + ME_RTFInsertOleObject( info, hemf, NULL, &sz ); + break; + case gfx_metafile: + if ((hemf = SetWinMetaFileBits( size, buffer, NULL, &mfp ))) + ME_RTFInsertOleObject( info, hemf, NULL, &sz ); + break; + case gfx_dib: + { + BITMAPINFO *bi = (BITMAPINFO*)buffer; + HDC hdc = GetDC(0); + unsigned nc = bi->bmiHeader.biClrUsed; + + /* not quite right, especially for bitfields type of compression */ + if (!nc && bi->bmiHeader.biBitCount <= 8) + nc = 1 << bi->bmiHeader.biBitCount; + if ((hbmp = CreateDIBitmap( hdc, &bi->bmiHeader, + CBM_INIT, (char*)(bi + 1) + nc * sizeof(RGBQUAD), + bi, DIB_RGB_COLORS)) ) + ME_RTFInsertOleObject( info, NULL, hbmp, &sz ); + ReleaseDC( 0, hdc ); + break; + } + default: + break; + } } - break; - default: - break; - } - HeapFree(GetProcessHeap(), 0, buffer); - RTFRouteToken (info); /* feed "}" back to router */ - return; -skip_group: - HeapFree(GetProcessHeap(), 0, buffer); - RTFSkipGroup(info); - RTFRouteToken(info); /* feed "}" back to router */ + HeapFree( GetProcessHeap(), 0, buffer ); + RTFRouteToken( info ); /* feed "}" back to router */ + return; } /* for now, lookup the \result part and use it, whatever the object */ @@ -1509,7 +1564,7 @@ ME_GetTextLength(editor), FALSE); from = to = 0; ME_ClearTempStyle(editor); - ME_SetDefaultParaFormat(editor->pCursors[0].pPara->member.para.pFmt); + ME_SetDefaultParaFormat(editor, editor->pCursors[0].pPara->member.para.pFmt); } @@ -1554,6 +1609,7 @@ WriterInit(&parser); RTFInit(&parser); RTFSetReadHook(&parser, ME_RTFReadHook); + RTFSetDestinationCallback(&parser, rtfShpPict, ME_RTFReadShpPictGroup); RTFSetDestinationCallback(&parser, rtfPict, ME_RTFReadPictGroup); RTFSetDestinationCallback(&parser, rtfObject, ME_RTFReadObjectGroup); if (!parser.editor->bEmulateVersion10) /* v4.1 */ @@ -2309,7 +2365,7 @@ ME_InsertTextFromCursor(editor, 0, &endl, 1, editor->pCursors[0].pRun->member.run.style); para = editor->pBuffer->pFirst->member.para.next_para; - ME_SetDefaultParaFormat(para->member.para.pFmt); + ME_SetDefaultParaFormat(editor, para->member.para.pFmt); para->member.para.nFlags = MEPF_REWRAP; editor->pCursors[0].pPara = para; editor->pCursors[0].pRun = ME_FindItemFwd(para, diRun); @@ -2735,7 +2791,7 @@ return TRUE; } -ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10) +ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10, DWORD csStyle) { ME_TextEditor *ed = ALLOC_OBJ(ME_TextEditor); int i; @@ -2749,6 +2805,11 @@ ed->reOle = NULL; ed->bEmulateVersion10 = bEmulateVersion10; ed->styleFlags = 0; + ed->alignStyle = PFA_LEFT; + if (csStyle & ES_RIGHT) + ed->alignStyle = PFA_RIGHT; + if (csStyle & ES_CENTER) + ed->alignStyle = PFA_CENTER; ITextHost_TxGetPropertyBits(texthost, (TXTBIT_RICHTEXT|TXTBIT_MULTILINE| TXTBIT_READONLY|TXTBIT_USEPASSWORD| @@ -2860,6 +2921,7 @@ ed->wheel_remain = 0; + list_init( &ed->style_list ); OleInitialize(NULL); return ed; @@ -2869,6 +2931,7 @@ { ME_DisplayItem *pFirst = editor->pBuffer->pFirst; ME_DisplayItem *p = pFirst, *pNext = NULL; + ME_Style *s, *cursor2; int i; ME_ClearTempStyle(editor); @@ -2878,6 +2941,10 @@ ME_DestroyDisplayItem(p); p = pNext; } + + LIST_FOR_EACH_ENTRY_SAFE( s, cursor2, &editor->style_list, ME_Style, entry ) + ME_DestroyStyle( s ); + ME_ReleaseStyle(editor->pBuffer->pDefaultStyle); for (i=0; i 0); + + if (editor->mode & TM_PLAINTEXT) + return FALSE; + + cf.cbSize = sizeof(cf); + cf.dwMask = CFM_SIZE; + ME_GetSelectionCharFormat(editor, &cf); + tmp_size = (cf.yHeight / 20) + wParam; + + if (tmp_size <= 1) + size = 1; + else if (tmp_size > 12 && tmp_size < 28 && tmp_size % 2) + size = tmp_size + (is_increase ? 1 : -1); + else if (tmp_size > 28 && tmp_size < 36) + size = is_increase ? 36 : 28; + else if (tmp_size > 36 && tmp_size < 48) + size = is_increase ? 48 : 36; + else if (tmp_size > 48 && tmp_size < 72) + size = is_increase ? 72 : 48; + else if (tmp_size > 72 && tmp_size < 80) + size = is_increase ? 80 : 72; + else if (tmp_size > 80 && tmp_size < 1638) + size = 10 * (is_increase ? (tmp_size / 10 + 1) : (tmp_size / 10)); + else if (tmp_size >= 1638) + size = 1638; + else + size = tmp_size; + + cf.yHeight = size * 20; /* convert twips to points */ + ME_SetSelectionCharFormat(editor, &cf); + ME_CommitUndo(editor); + ME_WrapMarkedParagraphs(editor); + ME_UpdateScrollBar(editor); + ME_Repaint(editor); + + return TRUE; + } case EM_SETOPTIONS: { /* these flags are equivalent to ES_* counterparts, except for @@ -3726,7 +3834,10 @@ if (!wParam) wParam = (WPARAM)GetStockObject(SYSTEM_FONT); - GetObjectW((HGDIOBJ)wParam, sizeof(LOGFONTW), &lf); + + if (!GetObjectW((HGDIOBJ)wParam, sizeof(LOGFONTW), &lf)) + return 0; + hDC = ITextHost_TxGetDC(editor->texthost); ME_CharFormatFromLogFont(hDC, &lf, &fmt); ITextHost_TxReleaseDC(editor->texthost, hDC); diff -Nru wine1.7-1.7.50/dlls/riched20/editor.h wine1.7-1.7.55/dlls/riched20/editor.h --- wine1.7-1.7.50/dlls/riched20/editor.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/riched20/editor.h 2015-11-13 14:32:40.000000000 +0000 @@ -69,9 +69,10 @@ /* style.c */ ME_Style *ME_MakeStyle(CHARFORMAT2W *style) DECLSPEC_HIDDEN; void ME_AddRefStyle(ME_Style *item) DECLSPEC_HIDDEN; +void ME_DestroyStyle(ME_Style *item) DECLSPEC_HIDDEN; void ME_ReleaseStyle(ME_Style *item) DECLSPEC_HIDDEN; ME_Style *ME_GetInsertStyle(ME_TextEditor *editor, int nCursor) DECLSPEC_HIDDEN; -ME_Style *ME_ApplyStyle(ME_Style *sSrc, CHARFORMAT2W *style) DECLSPEC_HIDDEN; +ME_Style *ME_ApplyStyle(ME_TextEditor *ed, ME_Style *sSrc, CHARFORMAT2W *style) DECLSPEC_HIDDEN; HFONT ME_SelectStyleFont(ME_Context *c, ME_Style *s) DECLSPEC_HIDDEN; void ME_UnselectStyleFont(ME_Context *c, ME_Style *s, HFONT hOldFont) DECLSPEC_HIDDEN; void ME_InitCharFormat2W(CHARFORMAT2W *pFmt) DECLSPEC_HIDDEN; @@ -213,7 +214,7 @@ BOOL ME_SetSelectionParaFormat(ME_TextEditor *editor, const PARAFORMAT2 *pFmt) DECLSPEC_HIDDEN; void ME_GetSelectionParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt) DECLSPEC_HIDDEN; void ME_MarkAllForWrapping(ME_TextEditor *editor) DECLSPEC_HIDDEN; -void ME_SetDefaultParaFormat(PARAFORMAT2 *pFmt) DECLSPEC_HIDDEN; +void ME_SetDefaultParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt) DECLSPEC_HIDDEN; /* paint.c */ void ME_PaintContent(ME_TextEditor *editor, HDC hDC, const RECT *rcUpdate) DECLSPEC_HIDDEN; @@ -249,7 +250,7 @@ void ME_GetITextDocumentInterface(IRichEditOle *iface, LPVOID *ppvObj) DECLSPEC_HIDDEN; /* editor.c */ -ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10) DECLSPEC_HIDDEN; +ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10, DWORD csStyle) DECLSPEC_HIDDEN; void ME_DestroyEditor(ME_TextEditor *editor) DECLSPEC_HIDDEN; LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode, HRESULT* phresult) DECLSPEC_HIDDEN; diff -Nru wine1.7-1.7.50/dlls/riched20/editstr.h wine1.7-1.7.55/dlls/riched20/editstr.h --- wine1.7-1.7.50/dlls/riched20/editstr.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/riched20/editstr.h 2015-11-13 14:32:40.000000000 +0000 @@ -60,14 +60,25 @@ int nLen, nBuffer; } ME_String; +typedef struct tagME_FontCacheItem +{ + LOGFONTW lfSpecs; + HFONT hFont; + int nRefs; + int nAge; +} ME_FontCacheItem; + +#define HFONT_CACHE_SIZE 10 + typedef struct tagME_Style { CHARFORMAT2W fmt; - HFONT hFont; /* cached font for the style */ + ME_FontCacheItem *font_cache; /* cached font for the style */ TEXTMETRICW tm; /* cached font metrics for the style */ int nRefs; /* reference count */ SCRIPT_CACHE script_cache; + struct list entry; } ME_Style; typedef enum { @@ -372,16 +383,6 @@ UINT nNestingLevel; } ME_OutStream; -typedef struct tagME_FontCacheItem -{ - LOGFONTW lfSpecs; - HFONT hFont; - int nRefs; - int nAge; -} ME_FontCacheItem; - -#define HFONT_CACHE_SIZE 10 - typedef struct tagME_TextEditor { HWND hWnd, hwndParent; @@ -391,6 +392,7 @@ ME_TextBuffer *pBuffer; ME_Cursor *pCursors; DWORD styleFlags; + DWORD alignStyle; DWORD exStyleFlags; int nCursors; SIZE sizeWindow; @@ -443,6 +445,7 @@ BOOL bMouseCaptured; int wheel_remain; + struct list style_list; } ME_TextEditor; typedef struct tagME_Context diff -Nru wine1.7-1.7.50/dlls/riched20/list.c wine1.7-1.7.55/dlls/riched20/list.c --- wine1.7-1.7.50/dlls/riched20/list.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/riched20/list.c 2015-11-13 14:32:40.000000000 +0000 @@ -179,13 +179,6 @@ ZeroMemory(item, sizeof(ME_DisplayItem)); item->type = type; item->prev = item->next = NULL; - if (type == diParagraph) - { - item->member.para.pFmt = ALLOC_OBJ(PARAFORMAT2); - ME_SetDefaultParaFormat(item->member.para.pFmt); - item->member.para.nFlags = MEPF_REWRAP; - } - return item; } diff -Nru wine1.7-1.7.50/dlls/riched20/para.c wine1.7-1.7.55/dlls/riched20/para.c --- wine1.7-1.7.50/dlls/riched20/para.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/riched20/para.c 2015-11-13 14:32:40.000000000 +0000 @@ -23,6 +23,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(richedit); +static ME_DisplayItem *make_para(ME_TextEditor *editor) +{ + ME_DisplayItem *item = ME_MakeDI(diParagraph); + + item->member.para.pFmt = ALLOC_OBJ(PARAFORMAT2); + ME_SetDefaultParaFormat(editor, item->member.para.pFmt); + item->member.para.nFlags = MEPF_REWRAP; + return item; +} + void ME_MakeFirstParagraph(ME_TextEditor *editor) { ME_Context c; @@ -30,7 +40,7 @@ LOGFONTW lf; HFONT hf; ME_TextBuffer *text = editor->pBuffer; - ME_DisplayItem *para = ME_MakeDI(diParagraph); + ME_DisplayItem *para = make_para(editor); ME_DisplayItem *run; ME_Style *style; int eol_len; @@ -196,7 +206,7 @@ { ME_DisplayItem *next_para = NULL; ME_DisplayItem *run_para = NULL; - ME_DisplayItem *new_para = ME_MakeDI(diParagraph); + ME_DisplayItem *new_para = make_para(editor); ME_DisplayItem *end_run; int ofs, i; ME_DisplayItem *pp; @@ -619,12 +629,12 @@ } } -void ME_SetDefaultParaFormat(PARAFORMAT2 *pFmt) +void ME_SetDefaultParaFormat(ME_TextEditor *editor, PARAFORMAT2 *pFmt) { ZeroMemory(pFmt, sizeof(PARAFORMAT2)); pFmt->cbSize = sizeof(PARAFORMAT2); pFmt->dwMask = PFM_ALL2; - pFmt->wAlignment = PFA_LEFT; + pFmt->wAlignment = editor->alignStyle; pFmt->sStyle = -1; pFmt->bOutlineLevel = TRUE; } diff -Nru wine1.7-1.7.50/dlls/riched20/reader.c wine1.7-1.7.55/dlls/riched20/reader.c --- wine1.7-1.7.50/dlls/riched20/reader.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/riched20/reader.c 2015-11-13 14:32:40.000000000 +0000 @@ -1808,6 +1808,8 @@ { rtfDestination, rtfNeXTGraphic, "NeXTGraphic", 0 }, { rtfDestination, rtfNestTableProps, "nesttableprops", 0 }, { rtfDestination, rtfNoNestTables, "nonesttables", 0 }, + { rtfDestination, rtfShpPict, "shppict", 0 }, + { rtfDestination, rtfNonShpPict, "nonshppict", 0 }, /* * Font families diff -Nru wine1.7-1.7.50/dlls/riched20/rtf.h wine1.7-1.7.55/dlls/riched20/rtf.h --- wine1.7-1.7.50/dlls/riched20/rtf.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/riched20/rtf.h 2015-11-13 14:32:40.000000000 +0000 @@ -184,7 +184,9 @@ # define rtfGenerator 74 # define rtfNestTableProps 75 # define rtfNoNestTables 76 -# define rtfMaxDestination 77 /* highest dest + 1 */ +# define rtfShpPict 77 +# define rtfNonShpPict 78 +# define rtfMaxDestination 79 /* highest dest + 1 */ # define rtfFontFamily 4 # define rtfFFNil 0 diff -Nru wine1.7-1.7.50/dlls/riched20/run.c wine1.7-1.7.55/dlls/riched20/run.c --- wine1.7-1.7.50/dlls/riched20/run.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/riched20/run.c 2015-11-13 14:32:40.000000000 +0000 @@ -695,7 +695,7 @@ ME_Style *s; if (!editor->pBuffer->pCharStyle) editor->pBuffer->pCharStyle = ME_GetInsertStyle(editor, 0); - s = ME_ApplyStyle(editor->pBuffer->pCharStyle, pFmt); + s = ME_ApplyStyle(editor, editor->pBuffer->pCharStyle, pFmt); ME_ReleaseStyle(editor->pBuffer->pCharStyle); editor->pBuffer->pCharStyle = s; } else { @@ -753,7 +753,7 @@ for (run = start_run; run != end_run; run = ME_FindItemFwd( run, diRun )) { - ME_Style *new_style = ME_ApplyStyle(run->member.run.style, pFmt); + ME_Style *new_style = ME_ApplyStyle(editor, run->member.run.style, pFmt); add_undo_set_char_fmt( editor, run->member.run.para->nCharOfs + run->member.run.nCharOfs, run->member.run.len, &run->member.run.style->fmt ); @@ -763,25 +763,6 @@ } } -/****************************************************************************** - * ME_SetDefaultCharFormat - * - * Applies a style change to the default character style. - */ -void ME_SetDefaultCharFormat(ME_TextEditor *editor, CHARFORMAT2W *mod) -{ - ME_Style *style; - - assert(mod->cbSize == sizeof(CHARFORMAT2W)); - style = ME_ApplyStyle(editor->pBuffer->pDefaultStyle, mod); - editor->pBuffer->pDefaultStyle->fmt = style->fmt; - editor->pBuffer->pDefaultStyle->tm = style->tm; - ScriptFreeCache( &editor->pBuffer->pDefaultStyle->script_cache ); - ME_ReleaseStyle(style); - ME_MarkAllForWrapping(editor); - /* pcf = editor->pBuffer->pDefaultStyle->fmt; */ -} - static void ME_GetRunCharFormat(ME_TextEditor *editor, ME_DisplayItem *run, CHARFORMAT2W *pFmt) { ME_CopyCharFormat(pFmt, &run->member.run.style->fmt); diff -Nru wine1.7-1.7.50/dlls/riched20/style.c wine1.7-1.7.55/dlls/riched20/style.c --- wine1.7-1.7.50/dlls/riched20/style.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/riched20/style.c 2015-11-13 14:32:40.000000000 +0000 @@ -146,25 +146,26 @@ assert(style->cbSize == sizeof(CHARFORMAT2W)); s->fmt = *style; s->nRefs = 1; - s->hFont = NULL; + s->font_cache = NULL; memset(&s->tm, 0, sizeof(s->tm)); s->tm.tmAscent = -1; s->script_cache = NULL; + list_init(&s->entry); all_refs++; TRACE_(richedit_style)("ME_MakeStyle %p, total refs=%d\n", s, all_refs); return s; } #define COPY_STYLE_ITEM(mask, member) \ - if (style->dwMask & mask) { \ - s->fmt.dwMask |= mask;\ - s->fmt.member = style->member;\ + if (mod->dwMask & mask) { \ + fmt.dwMask |= mask;\ + fmt.member = mod->member;\ } #define COPY_STYLE_ITEM_MEMCPY(mask, member) \ - if (style->dwMask & mask) { \ - s->fmt.dwMask |= mask;\ - CopyMemory(s->fmt.member, style->member, sizeof(style->member));\ + if (mod->dwMask & mask) { \ + fmt.dwMask |= mask;\ + CopyMemory(fmt.member, mod->member, sizeof(mod->member));\ } void ME_InitCharFormat2W(CHARFORMAT2W *pFmt) @@ -173,10 +174,12 @@ pFmt->cbSize = sizeof(CHARFORMAT2W); } -ME_Style *ME_ApplyStyle(ME_Style *sSrc, CHARFORMAT2W *style) +ME_Style *ME_ApplyStyle(ME_TextEditor *editor, ME_Style *sSrc, CHARFORMAT2W *mod) { - ME_Style *s = ME_MakeStyle(&sSrc->fmt); - assert(style->cbSize == sizeof(CHARFORMAT2W)); + CHARFORMAT2W fmt = sSrc->fmt; + ME_Style *s; + + assert(mod->cbSize == sizeof(CHARFORMAT2W)); COPY_STYLE_ITEM(CFM_ANIMATION, bAnimation); COPY_STYLE_ITEM(CFM_BACKCOLOR, crBackColor); COPY_STYLE_ITEM(CFM_CHARSET, bCharSet); @@ -186,9 +189,9 @@ COPY_STYLE_ITEM(CFM_LCID, lcid); COPY_STYLE_ITEM(CFM_OFFSET, yOffset); COPY_STYLE_ITEM(CFM_REVAUTHOR, bRevAuthor); - if (style->dwMask & CFM_SIZE) { - s->fmt.dwMask |= CFM_SIZE; - s->fmt.yHeight = min(style->yHeight, yHeightCharPtsMost * 20); + if (mod->dwMask & CFM_SIZE) { + fmt.dwMask |= CFM_SIZE; + fmt.yHeight = min(mod->yHeight, yHeightCharPtsMost * 20); } COPY_STYLE_ITEM(CFM_SPACING, sSpacing); COPY_STYLE_ITEM(CFM_STYLE, sStyle); @@ -197,31 +200,46 @@ /* FIXME: this is not documented this way, but that's the more logical */ COPY_STYLE_ITEM(CFM_FACE, bPitchAndFamily); - s->fmt.dwEffects &= ~(style->dwMask); - s->fmt.dwEffects |= style->dwEffects & style->dwMask; - s->fmt.dwMask |= style->dwMask; - if (style->dwMask & CFM_COLOR) + fmt.dwEffects &= ~(mod->dwMask); + fmt.dwEffects |= mod->dwEffects & mod->dwMask; + fmt.dwMask |= mod->dwMask; + if (mod->dwMask & CFM_COLOR) { - if (style->dwEffects & CFE_AUTOCOLOR) - s->fmt.dwEffects |= CFE_AUTOCOLOR; + if (mod->dwEffects & CFE_AUTOCOLOR) + fmt.dwEffects |= CFE_AUTOCOLOR; else - s->fmt.dwEffects &= ~CFE_AUTOCOLOR; + fmt.dwEffects &= ~CFE_AUTOCOLOR; } - if (style->dwMask & CFM_UNDERLINE) + if (mod->dwMask & CFM_UNDERLINE) { - s->fmt.dwMask |= CFM_UNDERLINETYPE; - s->fmt.bUnderlineType = (style->dwEffects & CFM_UNDERLINE) ? + fmt.dwMask |= CFM_UNDERLINETYPE; + fmt.bUnderlineType = (mod->dwEffects & CFM_UNDERLINE) ? CFU_CF1UNDERLINE : CFU_UNDERLINENONE; } - if (style->dwMask & CFM_BOLD && !(style->dwMask & CFM_WEIGHT)) + if (mod->dwMask & CFM_BOLD && !(mod->dwMask & CFM_WEIGHT)) { - s->fmt.wWeight = (style->dwEffects & CFE_BOLD) ? FW_BOLD : FW_NORMAL; - } else if (style->dwMask & CFM_WEIGHT && !(style->dwMask & CFM_BOLD)) { - if (style->wWeight > FW_NORMAL) - s->fmt.dwEffects |= CFE_BOLD; + fmt.wWeight = (mod->dwEffects & CFE_BOLD) ? FW_BOLD : FW_NORMAL; + } else if (mod->dwMask & CFM_WEIGHT && !(mod->dwMask & CFM_BOLD)) { + if (mod->wWeight > FW_NORMAL) + fmt.dwEffects |= CFE_BOLD; else - s->fmt.dwEffects &= ~CFE_BOLD; + fmt.dwEffects &= ~CFE_BOLD; + } + + LIST_FOR_EACH_ENTRY(s, &editor->style_list, ME_Style, entry) + { + if (!memcmp( &s->fmt, &fmt, sizeof(fmt) )) + { + TRACE_(richedit_style)("found existing style %p\n", s); + ME_AddRefStyle( s ); + return s; + } } + + s = ME_MakeStyle( &fmt ); + if (s) + list_add_head( &editor->style_list, &s->entry ); + TRACE_(richedit_style)("created new style %p\n", s); return s; } @@ -383,8 +401,6 @@ { item = &c->editor->pFontCache[i]; TRACE_(richedit_style)("font reused %d\n", i); - - s->hFont = item->hFont; item->nRefs++; } else @@ -397,44 +413,41 @@ DeleteObject(item->hFont); item->hFont = NULL; } - s->hFont = CreateFontIndirectW(&lf); - assert(s->hFont); + item->hFont = CreateFontIndirectW(&lf); TRACE_(richedit_style)("font created %d\n", nEmpty); - item->hFont = s->hFont; item->nRefs = 1; item->lfSpecs = lf; } - hOldFont = SelectObject(c->hDC, s->hFont); + s->font_cache = item; + hOldFont = SelectObject(c->hDC, item->hFont); /* should be cached too, maybe ? */ GetTextMetricsW(c->hDC, &s->tm); return hOldFont; } -void ME_UnselectStyleFont(ME_Context *c, ME_Style *s, HFONT hOldFont) +static void release_font_cache(ME_FontCacheItem *item) { - int i; - - assert(s); - SelectObject(c->hDC, hOldFont); - for (i=0; ieditor->pFontCache[i]; - if (pItem->hFont == s->hFont && pItem->nRefs > 0) + if (item->nRefs > 0) { - pItem->nRefs--; - pItem->nAge = 0; - s->hFont = NULL; - return; + item->nRefs--; + item->nAge = 0; } - } - assert(0 == "UnselectStyleFont without SelectStyleFont"); } -static void ME_DestroyStyle(ME_Style *s) { - if (s->hFont) +void ME_UnselectStyleFont(ME_Context *c, ME_Style *s, HFONT hOldFont) +{ + SelectObject(c->hDC, hOldFont); + release_font_cache(s->font_cache); + s->font_cache = NULL; +} + +void ME_DestroyStyle(ME_Style *s) +{ + list_remove( &s->entry ); + if (s->font_cache) { - DeleteObject(s->hFont); - s->hFont = NULL; + release_font_cache( s->font_cache ); + s->font_cache = NULL; } ScriptFreeCache( &s->script_cache ); FREE_OBJ(s); @@ -514,3 +527,31 @@ ME_ReleaseStyle(editor->pBuffer->pCharStyle); editor->pBuffer->pCharStyle = NULL; } + +/****************************************************************************** + * ME_SetDefaultCharFormat + * + * Applies a style change to the default character style. + * + * The default style is special in that it is mutable - runs + * in the document that have this style should change if the + * default style changes. That means we need to fix up this + * style manually. + */ +void ME_SetDefaultCharFormat(ME_TextEditor *editor, CHARFORMAT2W *mod) +{ + ME_Style *style, *def = editor->pBuffer->pDefaultStyle; + + assert(mod->cbSize == sizeof(CHARFORMAT2W)); + style = ME_ApplyStyle(editor, def, mod); + def->fmt = style->fmt; + def->tm = style->tm; + if (def->font_cache) + { + release_font_cache( def->font_cache ); + def->font_cache = NULL; + } + ScriptFreeCache( &def->script_cache ); + ME_ReleaseStyle( style ); + ME_MarkAllForWrapping( editor ); +} diff -Nru wine1.7-1.7.50/dlls/riched20/tests/editor.c wine1.7-1.7.55/dlls/riched20/tests/editor.c --- wine1.7-1.7.50/dlls/riched20/tests/editor.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/riched20/tests/editor.c 2015-11-13 14:32:40.000000000 +0000 @@ -3307,6 +3307,8 @@ DestroyWindow(hwndRichEdit); } +LONG streamout_written = 0; + static DWORD CALLBACK test_WM_SETTEXT_esCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, @@ -3318,6 +3320,7 @@ memcpy(*str, pbBuff, *pcb); *str += *pcb; } + streamout_written = *pcb; return 0; } @@ -3442,6 +3445,7 @@ EDITSTREAM es; char buf[1024] = {0}; char * p; + LRESULT result; const char * TestItem1 = "TestSomeText"; const char * TestItem2 = "TestSomeText\r"; @@ -3453,24 +3457,28 @@ es.dwError = 0; es.pfnCallback = test_WM_SETTEXT_esCallback; memset(buf, 0, sizeof(buf)); - SendMessageA(hwndRichEdit, EM_STREAMOUT, SF_TEXT, (LPARAM)&es); + result = SendMessageA(hwndRichEdit, EM_STREAMOUT, SF_TEXT, (LPARAM)&es); r = strlen(buf); ok(r == 12, "streamed text length is %d, expecting 12\n", r); ok(strcmp(buf, TestItem1) == 0, "streamed text different, got %s\n", buf); + ok(result == streamout_written, "got %ld expected %d\n", result, streamout_written); /* RTF mode writes the final end of para \r if it's part of the selection */ p = buf; - SendMessageA(hwndRichEdit, EM_STREAMOUT, SF_RTF, (LPARAM)&es); + result = SendMessageA(hwndRichEdit, EM_STREAMOUT, SF_RTF, (LPARAM)&es); ok (count_pars(buf) == 1, "got %s\n", buf); + ok(result == streamout_written, "got %ld expected %d\n", result, streamout_written); p = buf; SendMessageA(hwndRichEdit, EM_SETSEL, 0, 12); - SendMessageA(hwndRichEdit, EM_STREAMOUT, SF_RTF|SFF_SELECTION, (LPARAM)&es); + result = SendMessageA(hwndRichEdit, EM_STREAMOUT, SF_RTF|SFF_SELECTION, (LPARAM)&es); ok (count_pars(buf) == 0, "got %s\n", buf); + ok(result == streamout_written, "got %ld expected %d\n", result, streamout_written); p = buf; SendMessageA(hwndRichEdit, EM_SETSEL, 0, -1); - SendMessageA(hwndRichEdit, EM_STREAMOUT, SF_RTF|SFF_SELECTION, (LPARAM)&es); + result = SendMessageA(hwndRichEdit, EM_STREAMOUT, SF_RTF|SFF_SELECTION, (LPARAM)&es); ok (count_pars(buf) == 1, "got %s\n", buf); + ok(result == streamout_written, "got %ld expected %d\n", result, streamout_written); SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)TestItem2); p = buf; @@ -3478,7 +3486,8 @@ es.dwError = 0; es.pfnCallback = test_WM_SETTEXT_esCallback; memset(buf, 0, sizeof(buf)); - SendMessageA(hwndRichEdit, EM_STREAMOUT, SF_TEXT, (LPARAM)&es); + result = SendMessageA(hwndRichEdit, EM_STREAMOUT, SF_TEXT, (LPARAM)&es); + ok(result == streamout_written, "got %ld expected %d\n", result, streamout_written); r = strlen(buf); /* Here again, \r gets converted to \r\n, like WM_GETTEXT */ ok(r == 14, "streamed text length is %d, expecting 14\n", r); @@ -3487,16 +3496,19 @@ /* And again RTF mode writes the final end of para \r if it's part of the selection */ p = buf; - SendMessageA(hwndRichEdit, EM_STREAMOUT, SF_RTF, (LPARAM)&es); + result = SendMessageA(hwndRichEdit, EM_STREAMOUT, SF_RTF, (LPARAM)&es); ok (count_pars(buf) == 2, "got %s\n", buf); + ok(result == streamout_written, "got %ld expected %d\n", result, streamout_written); p = buf; SendMessageA(hwndRichEdit, EM_SETSEL, 0, 13); - SendMessageA(hwndRichEdit, EM_STREAMOUT, SF_RTF|SFF_SELECTION, (LPARAM)&es); + result = SendMessageA(hwndRichEdit, EM_STREAMOUT, SF_RTF|SFF_SELECTION, (LPARAM)&es); ok (count_pars(buf) == 1, "got %s\n", buf); + ok(result == streamout_written, "got %ld expected %d\n", result, streamout_written); p = buf; SendMessageA(hwndRichEdit, EM_SETSEL, 0, -1); - SendMessageA(hwndRichEdit, EM_STREAMOUT, SF_RTF|SFF_SELECTION, (LPARAM)&es); + result = SendMessageA(hwndRichEdit, EM_STREAMOUT, SF_RTF|SFF_SELECTION, (LPARAM)&es); ok (count_pars(buf) == 2, "got %s\n", buf); + ok(result == streamout_written, "got %ld expected %d\n", result, streamout_written); SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)TestItem3); p = buf; @@ -3504,7 +3516,8 @@ es.dwError = 0; es.pfnCallback = test_WM_SETTEXT_esCallback; memset(buf, 0, sizeof(buf)); - SendMessageA(hwndRichEdit, EM_STREAMOUT, SF_TEXT, (LPARAM)&es); + result = SendMessageA(hwndRichEdit, EM_STREAMOUT, SF_TEXT, (LPARAM)&es); + ok(result == streamout_written, "got %ld expected %d\n", result, streamout_written); r = strlen(buf); ok(r == 14, "streamed text length is %d, expecting 14\n", r); ok(strcmp(buf, TestItem3) == 0, @@ -3516,11 +3529,12 @@ es.dwError = 0; es.pfnCallback = test_esCallback_written_1; memset(buf, 0, sizeof(buf)); - SendMessageA(hwndRichEdit, EM_STREAMOUT, SF_TEXT, (LPARAM)&es); + result = SendMessageA(hwndRichEdit, EM_STREAMOUT, SF_TEXT, (LPARAM)&es); r = strlen(buf); ok(r == 14, "streamed text length is %d, expecting 14\n", r); ok(strcmp(buf, TestItem3) == 0, "streamed text different, got %s\n", buf); + ok(result == 0, "got %ld expected 0\n", result); DestroyWindow(hwndRichEdit); @@ -7857,6 +7871,170 @@ DestroyWindow(richedit); } +static inline LONG twips2points(LONG value) +{ + return value / 20; +} + +#define TEST_EM_SETFONTSIZE(hwnd,size,expected_size,expected_res,expected_undo) \ + _test_font_size(__LINE__,hwnd,size,expected_size,expected_res,expected_undo) +static void _test_font_size(unsigned line, HWND hwnd, LONG size, LONG expected_size, + LRESULT expected_res, BOOL expected_undo) +{ + CHARFORMAT2A cf; + LRESULT res; + BOOL isundo; + + cf.cbSize = sizeof(cf); + cf.dwMask = CFM_SIZE; + + res = SendMessageA(hwnd, EM_SETFONTSIZE, size, 0); + SendMessageA(hwnd, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf); + isundo = SendMessageA(hwnd, EM_CANUNDO, 0, 0); + ok_(__FILE__,line)(res == expected_res, "EM_SETFONTSIZE unexpected return value: %lx.\n", res); + ok_(__FILE__,line)(twips2points(cf.yHeight) == expected_size, "got wrong font size: %d, expected: %d\n", + twips2points(cf.yHeight), expected_size); + ok_(__FILE__,line)(isundo == expected_undo, "get wrong undo mark: %d, expected: %d.\n", + isundo, expected_undo); +} + +static void test_EM_SETFONTSIZE(void) +{ + HWND richedit = new_richedit(NULL); + CHAR text[] = "wine"; + CHARFORMAT2A tmp_cf; + LONG default_size; + + tmp_cf.cbSize = sizeof(tmp_cf); + tmp_cf.dwMask = CFM_SIZE; + tmp_cf.yHeight = 9 * 20.0; + SendMessageA(richedit, EM_SETCHARFORMAT, SCF_DEFAULT, (LPARAM)&tmp_cf); + + SendMessageA(richedit, WM_SETTEXT, 0, (LPARAM)text); + + SendMessageA(richedit, EM_SETMODIFY, FALSE, 0); + /* without selection */ + TEST_EM_SETFONTSIZE(richedit, 1, 10, TRUE, FALSE); /* 9 + 1 -> 10 */ + SendMessageA(richedit, EM_GETCHARFORMAT, SCF_DEFAULT, (LPARAM)&tmp_cf); + default_size = twips2points(tmp_cf.yHeight); + ok(default_size == 9, "Default font size should not be changed.\n"); + ok(SendMessageA(richedit, EM_SETMODIFY, 0, 0) == FALSE, "Modify flag should not be changed.\n"); + + SendMessageA(richedit, EM_SETSEL, 0, 2); + + TEST_EM_SETFONTSIZE(richedit, 0, 9, TRUE, TRUE); /* 9 + 0 -> 9 */ + + SendMessageA(richedit, EM_SETMODIFY, FALSE, 0); + TEST_EM_SETFONTSIZE(richedit, 3, 12, TRUE, TRUE); /* 9 + 3 -> 12 */ + ok(SendMessageA(richedit, EM_SETMODIFY, 0, 0) == FALSE, "Modify flag should not be changed.\n"); + + TEST_EM_SETFONTSIZE(richedit, 1, 14, TRUE, TRUE); /* 12 + 1 + 1 -> 14 */ + TEST_EM_SETFONTSIZE(richedit, -1, 12, TRUE, TRUE); /* 14 - 1 - 1 -> 12 */ + TEST_EM_SETFONTSIZE(richedit, 4, 16, TRUE, TRUE); /* 12 + 4 -> 16 */ + TEST_EM_SETFONTSIZE(richedit, 3, 20, TRUE, TRUE); /* 16 + 3 + 1 -> 20 */ + TEST_EM_SETFONTSIZE(richedit, 0, 20, TRUE, TRUE); /* 20 + 0 -> 20 */ + TEST_EM_SETFONTSIZE(richedit, 8, 28, TRUE, TRUE); /* 20 + 8 -> 28 */ + TEST_EM_SETFONTSIZE(richedit, 0, 28, TRUE, TRUE); /* 28 + 0 -> 28 */ + TEST_EM_SETFONTSIZE(richedit, 1, 36, TRUE, TRUE); /* 28 + 1 -> 36 */ + TEST_EM_SETFONTSIZE(richedit, 0, 36, TRUE, TRUE); /* 36 + 0 -> 36 */ + TEST_EM_SETFONTSIZE(richedit, 1, 48, TRUE, TRUE); /* 36 + 1 -> 48 */ + TEST_EM_SETFONTSIZE(richedit, 0, 48, TRUE, TRUE); /* 48 + 0 -> 48 */ + TEST_EM_SETFONTSIZE(richedit, 1, 72, TRUE, TRUE); /* 48 + 1 -> 72 */ + TEST_EM_SETFONTSIZE(richedit, 0, 72, TRUE, TRUE); /* 72 + 0 -> 72 */ + TEST_EM_SETFONTSIZE(richedit, 1, 80, TRUE, TRUE); /* 72 + 1 -> 80 */ + TEST_EM_SETFONTSIZE(richedit, 0, 80, TRUE, TRUE); /* 80 + 0 -> 80 */ + TEST_EM_SETFONTSIZE(richedit, 1, 90, TRUE, TRUE); /* 80 + 1 -> 90 */ + TEST_EM_SETFONTSIZE(richedit, 0, 90, TRUE, TRUE); /* 90 + 0 -> 90 */ + TEST_EM_SETFONTSIZE(richedit, 1, 100, TRUE, TRUE); /* 90 + 1 -> 100 */ + TEST_EM_SETFONTSIZE(richedit, 25, 130, TRUE, TRUE); /* 100 + 25 -> 130 */ + TEST_EM_SETFONTSIZE(richedit, -1, 120, TRUE, TRUE); /* 130 - 1 -> 120 */ + TEST_EM_SETFONTSIZE(richedit, -35, 80, TRUE, TRUE); /* 120 - 35 -> 80 */ + TEST_EM_SETFONTSIZE(richedit, -7, 72, TRUE, TRUE); /* 80 - 7 -> 72 */ + TEST_EM_SETFONTSIZE(richedit, -42, 28, TRUE, TRUE); /* 72 - 42 -> 28 */ + TEST_EM_SETFONTSIZE(richedit, -16, 12, TRUE, TRUE); /* 28 - 16 -> 12 */ + TEST_EM_SETFONTSIZE(richedit, -3, 9, TRUE, TRUE); /* 12 - 3 -> 9 */ + TEST_EM_SETFONTSIZE(richedit, -8, 1, TRUE, TRUE); /* 9 - 8 -> 1 */ + TEST_EM_SETFONTSIZE(richedit, -111, 1, TRUE, TRUE); /* 1 - 111 -> 1 */ + TEST_EM_SETFONTSIZE(richedit, 10086, 1638, TRUE, TRUE); /* 1 + 10086 -> 1638 */ + + /* return FALSE when richedit is TM_PLAINTEXT mode */ + SendMessageA(richedit, WM_SETTEXT, 0, (LPARAM)""); + SendMessageA(richedit, EM_SETTEXTMODE, (WPARAM)TM_PLAINTEXT, 0); + TEST_EM_SETFONTSIZE(richedit, 0, 9, FALSE, FALSE); + + DestroyWindow(richedit); +} + +static void test_alignment_style(void) +{ + HWND richedit = NULL; + PARAFORMAT2 pf; + DWORD align_style[] = {ES_LEFT, ES_CENTER, ES_RIGHT, ES_RIGHT | ES_CENTER, + ES_LEFT | ES_CENTER, ES_LEFT | ES_RIGHT, + ES_LEFT | ES_RIGHT | ES_CENTER}; + DWORD align_mask[] = {PFA_LEFT, PFA_CENTER, PFA_RIGHT, PFA_CENTER, PFA_CENTER, + PFA_RIGHT, PFA_CENTER}; + const char * streamtext = + "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang12298{\\fonttbl{\\f0\\fswiss\\fprq2\\fcharset0 System;}}\r\n" + "\\viewkind4\\uc1\\pard\\f0\\fs17 TestSomeText\\par\r\n" + "}\r\n"; + EDITSTREAM es; + int i; + + for (i = 0; i < sizeof(align_style) / sizeof(align_style[0]); i++) + { + DWORD dwStyle, new_align; + + richedit = new_windowW(RICHEDIT_CLASS20W, align_style[i], NULL); + memset(&pf, 0, sizeof(pf)); + pf.cbSize = sizeof(PARAFORMAT2); + pf.dwMask = -1; + + SendMessageW(richedit, EM_GETPARAFORMAT, 0, (LPARAM)&pf); + ok(pf.wAlignment == align_mask[i], "(i = %d) got %d expected %d\n", + i, pf.wAlignment, align_mask[i]); + dwStyle = GetWindowLongW(richedit, GWL_STYLE); + ok((i ? (dwStyle & align_style[i]) : (!(dwStyle & 0x0000000f))) , + "(i = %d) didn't set right align style: 0x%x\n", i, dwStyle); + + + /* Based on test_reset_default_para_fmt() */ + new_align = (align_mask[i] == PFA_LEFT) ? PFA_RIGHT : PFA_LEFT; + simulate_typing_characters(richedit, "123"); + + SendMessageW(richedit, EM_SETSEL, 0, -1); + pf.dwMask = PFM_ALIGNMENT; + pf.wAlignment = new_align; + SendMessageW(richedit, EM_SETPARAFORMAT, 0, (LPARAM)&pf); + + SendMessageW(richedit, EM_GETPARAFORMAT, 0, (LPARAM)&pf); + ok(pf.wAlignment == new_align, "got %d expect %d\n", pf.wAlignment, new_align); + + SendMessageW(richedit, EM_SETSEL, 0, -1); + SendMessageW(richedit, WM_CUT, 0, 0); + + SendMessageW(richedit, EM_GETPARAFORMAT, 0, (LPARAM)&pf); + ok(pf.wAlignment == align_mask[i], "got %d exppect %d\n", pf.wAlignment, align_mask[i]); + + DestroyWindow(richedit); + } + + /* test with EM_STREAMIN */ + richedit = new_windowW(RICHEDIT_CLASS20W, ES_CENTER, NULL); + simulate_typing_characters(richedit, "abc"); + es.dwCookie = (DWORD_PTR)&streamtext; + es.dwError = 0; + es.pfnCallback = test_EM_STREAMIN_esCallback; + SendMessageW(richedit, EM_STREAMIN, SF_RTF, (LPARAM)&es); + SendMessageW(richedit, EM_SETSEL, 0, -1); + memset(&pf, 0, sizeof(pf)); + pf.cbSize = sizeof(PARAFORMAT2); + pf.dwMask = -1; + SendMessageW(richedit, EM_GETPARAFORMAT, SCF_SELECTION, (LPARAM)&pf); + ok(pf.wAlignment == ES_CENTER, "got %d expected ES_CENTER\n", pf.wAlignment); + DestroyWindow(richedit); +} + START_TEST( editor ) { BOOL ret; @@ -7922,6 +8100,8 @@ test_WM_CREATE(); test_reset_default_para_fmt(); test_EM_SETREADONLY(); + test_EM_SETFONTSIZE(); + test_alignment_style(); /* Set the environment variable WINETEST_RICHED20 to keep windows * responsive and open for 30 seconds. This is useful for debugging. diff -Nru wine1.7-1.7.50/dlls/riched20/txthost.c wine1.7-1.7.55/dlls/riched20/txthost.c --- wine1.7-1.7.50/dlls/riched20/txthost.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/riched20/txthost.c 2015-11-13 14:32:40.000000000 +0000 @@ -55,7 +55,7 @@ texthost->hWnd = hwnd; texthost->bEmulateVersion10 = bEmulateVersion10; - editor = ME_MakeEditor(&texthost->ITextHost_iface, bEmulateVersion10); + editor = ME_MakeEditor(&texthost->ITextHost_iface, bEmulateVersion10, cs->style); editor->exStyleFlags = GetWindowLongW(hwnd, GWL_EXSTYLE); editor->styleFlags |= GetWindowLongW(hwnd, GWL_STYLE) & ES_WANTRETURN; editor->hWnd = hwnd; /* FIXME: Remove editor's dependence on hWnd */ diff -Nru wine1.7-1.7.50/dlls/riched20/txtsrv.c wine1.7-1.7.55/dlls/riched20/txtsrv.c --- wine1.7-1.7.50/dlls/riched20/txtsrv.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/riched20/txtsrv.c 2015-11-13 14:32:40.000000000 +0000 @@ -414,7 +414,7 @@ ITextImpl->pMyHost = pITextHost; ITextImpl->IUnknown_inner.lpVtbl = &textservices_inner_vtbl; ITextImpl->ITextServices_iface.lpVtbl = &textservices_vtbl; - ITextImpl->editor = ME_MakeEditor(pITextHost, FALSE); + ITextImpl->editor = ME_MakeEditor(pITextHost, FALSE, ES_LEFT); ITextImpl->editor->exStyleFlags = 0; ITextImpl->editor->rcFormat.left = 0; ITextImpl->editor->rcFormat.top = 0; diff -Nru wine1.7-1.7.50/dlls/riched20/undo.c wine1.7-1.7.55/dlls/riched20/undo.c --- wine1.7-1.7.50/dlls/riched20/undo.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/riched20/undo.c 2015-11-13 14:32:40.000000000 +0000 @@ -341,6 +341,7 @@ add_undo_set_para_fmt( editor, ¶->member.para ); *para->member.para.pFmt = undo->u.set_para_fmt.fmt; para->member.para.border = undo->u.set_para_fmt.border; + para->member.para.nFlags |= MEPF_REWRAP; break; } case undo_set_char_fmt: diff -Nru wine1.7-1.7.50/dlls/riched20/writer.c wine1.7-1.7.55/dlls/riched20/writer.c --- wine1.7-1.7.50/dlls/riched20/writer.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/riched20/writer.c 2015-11-13 14:32:40.000000000 +0000 @@ -62,6 +62,8 @@ return FALSE; /* Don't resend partial chunks if nWritten < pStream->pos */ } + if (nWritten == pStream->pos) + pStream->written += nWritten; pStream->pos = 0; return TRUE; } diff -Nru wine1.7-1.7.50/dlls/rpcrt4/ndr_stubless.c wine1.7-1.7.55/dlls/rpcrt4/ndr_stubless.c --- wine1.7-1.7.50/dlls/rpcrt4/ndr_stubless.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/rpcrt4/ndr_stubless.c 2015-11-13 14:32:40.000000000 +0000 @@ -1161,12 +1161,14 @@ if (params[i].attr.IsOut || params[i].attr.IsReturn) call_marshaller(pStubMsg, pArg, ¶ms[i]); break; - case STUBLESS_FREE: + case STUBLESS_MUSTFREE: if (params[i].attr.MustFree) { call_freer(pStubMsg, pArg, ¶ms[i]); } - else if (params[i].attr.ServerAllocSize) + break; + case STUBLESS_FREE: + if (params[i].attr.ServerAllocSize) { HeapFree(GetProcessHeap(), 0, *(void **)pArg); } @@ -1455,6 +1457,7 @@ case STUBLESS_INITOUT: case STUBLESS_CALCSIZE: case STUBLESS_MARSHAL: + case STUBLESS_MUSTFREE: case STUBLESS_FREE: retval_ptr = stub_do_args(&stubMsg, pFormat, phase, number_of_params); break; diff -Nru wine1.7-1.7.50/dlls/rpcrt4/ndr_stubless.h wine1.7-1.7.55/dlls/rpcrt4/ndr_stubless.h --- wine1.7-1.7.50/dlls/rpcrt4/ndr_stubless.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/rpcrt4/ndr_stubless.h 2015-11-13 14:32:40.000000000 +0000 @@ -234,6 +234,7 @@ STUBLESS_CALCSIZE, STUBLESS_GETBUFFER, STUBLESS_MARSHAL, + STUBLESS_MUSTFREE, STUBLESS_FREE }; diff -Nru wine1.7-1.7.50/dlls/rpcrt4/rpc_binding.h wine1.7-1.7.55/dlls/rpcrt4/rpc_binding.h --- wine1.7-1.7.50/dlls/rpcrt4/rpc_binding.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/rpcrt4/rpc_binding.h 2015-11-13 14:32:40.000000000 +0000 @@ -104,6 +104,7 @@ int (*write)(RpcConnection *conn, const void *buffer, unsigned int len); int (*close)(RpcConnection *conn); void (*cancel_call)(RpcConnection *conn); + RPC_STATUS (*is_server_listening)(const char *endpoint); int (*wait_for_incoming_data)(RpcConnection *conn); size_t (*get_top_of_tower)(unsigned char *tower_data, const char *networkaddr, const char *endpoint); RPC_STATUS (*parse_top_of_tower)(const unsigned char *tower_data, size_t tower_size, char **networkaddr, char **endpoint); @@ -162,6 +163,7 @@ RPC_STATUS RPCRT4_ReleaseConnection(RpcConnection* Connection) DECLSPEC_HIDDEN; RPC_STATUS RPCRT4_OpenClientConnection(RpcConnection* Connection) DECLSPEC_HIDDEN; RPC_STATUS RPCRT4_CloseConnection(RpcConnection* Connection) DECLSPEC_HIDDEN; +RPC_STATUS RPCRT4_IsServerListening(const char *protseq, const char *endpoint) DECLSPEC_HIDDEN; RPC_STATUS RPCRT4_ResolveBinding(RpcBinding* Binding, LPCSTR Endpoint) DECLSPEC_HIDDEN; RPC_STATUS RPCRT4_SetBindingObject(RpcBinding* Binding, const UUID* ObjectUuid) DECLSPEC_HIDDEN; diff -Nru wine1.7-1.7.50/dlls/rpcrt4/rpc_server.c wine1.7-1.7.55/dlls/rpcrt4/rpc_server.c --- wine1.7-1.7.50/dlls/rpcrt4/rpc_server.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/rpcrt4/rpc_server.c 2015-11-13 14:32:40.000000000 +0000 @@ -1676,9 +1676,15 @@ TRACE("(%p)\n", Binding); - EnterCriticalSection(&listen_cs); - if (manual_listen_count > 0) status = RPC_S_OK; - LeaveCriticalSection(&listen_cs); + if (Binding) { + RpcBinding *rpc_binding = (RpcBinding*)Binding; + status = RPCRT4_IsServerListening(rpc_binding->Protseq, rpc_binding->Endpoint); + }else { + EnterCriticalSection(&listen_cs); + if (manual_listen_count > 0) status = RPC_S_OK; + LeaveCriticalSection(&listen_cs); + } + return status; } diff -Nru wine1.7-1.7.50/dlls/rpcrt4/rpc_transport.c wine1.7-1.7.55/dlls/rpcrt4/rpc_transport.c --- wine1.7-1.7.50/dlls/rpcrt4/rpc_transport.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/rpcrt4/rpc_transport.c 2015-11-13 14:32:40.000000000 +0000 @@ -247,10 +247,21 @@ return RPC_S_OK; } +static char *ncalrpc_pipe_name(const char *endpoint) +{ + static const char prefix[] = "\\\\.\\pipe\\lrpc\\"; + char *pipe_name; + + /* protseq=ncalrpc: supposed to use NT LPC ports, + * but we'll implement it with named pipes for now */ + pipe_name = I_RpcAllocate(sizeof(prefix) + strlen(endpoint)); + strcat(strcpy(pipe_name, prefix), endpoint); + return pipe_name; +} + static RPC_STATUS rpcrt4_ncalrpc_open(RpcConnection* Connection) { RpcConnection_np *npc = (RpcConnection_np *) Connection; - static const char prefix[] = "\\\\.\\pipe\\lrpc\\"; RPC_STATUS r; LPSTR pname; @@ -258,10 +269,7 @@ if (npc->pipe) return RPC_S_OK; - /* protseq=ncalrpc: supposed to use NT LPC ports, - * but we'll implement it with named pipes for now */ - pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1); - strcat(strcpy(pname, prefix), Connection->Endpoint); + pname = ncalrpc_pipe_name(Connection->Endpoint); r = rpcrt4_conn_open_pipe(Connection, pname, TRUE); I_RpcFree(pname); @@ -270,7 +278,6 @@ static RPC_STATUS rpcrt4_protseq_ncalrpc_open_endpoint(RpcServerProtseq* protseq, const char *endpoint) { - static const char prefix[] = "\\\\.\\pipe\\lrpc\\"; RPC_STATUS r; LPSTR pname; RpcConnection *Connection; @@ -291,10 +298,7 @@ if (r != RPC_S_OK) return r; - /* protseq=ncalrpc: supposed to use NT LPC ports, - * but we'll implement it with named pipes for now */ - pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1); - strcat(strcpy(pname, prefix), Connection->Endpoint); + pname = ncalrpc_pipe_name(Connection->Endpoint); r = rpcrt4_conn_create_pipe(Connection, pname); I_RpcFree(pname); @@ -306,10 +310,20 @@ return r; } +static char *ncacn_pipe_name(const char *endpoint) +{ + static const char prefix[] = "\\\\."; + char *pipe_name; + + /* protseq=ncacn_np: named pipes */ + pipe_name = I_RpcAllocate(sizeof(prefix) + strlen(endpoint)); + strcat(strcpy(pipe_name, prefix), endpoint); + return pipe_name; +} + static RPC_STATUS rpcrt4_ncacn_np_open(RpcConnection* Connection) { RpcConnection_np *npc = (RpcConnection_np *) Connection; - static const char prefix[] = "\\\\."; RPC_STATUS r; LPSTR pname; @@ -317,9 +331,7 @@ if (npc->pipe) return RPC_S_OK; - /* protseq=ncacn_np: named pipes */ - pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1); - strcat(strcpy(pname, prefix), Connection->Endpoint); + pname = ncacn_pipe_name(Connection->Endpoint); r = rpcrt4_conn_open_pipe(Connection, pname, FALSE); I_RpcFree(pname); @@ -328,7 +340,6 @@ static RPC_STATUS rpcrt4_protseq_ncacn_np_open_endpoint(RpcServerProtseq *protseq, const char *endpoint) { - static const char prefix[] = "\\\\."; RPC_STATUS r; LPSTR pname; RpcConnection *Connection; @@ -349,9 +360,7 @@ if (r != RPC_S_OK) return r; - /* protseq=ncacn_np: named pipes */ - pname = I_RpcAllocate(strlen(prefix) + strlen(Connection->Endpoint) + 1); - strcat(strcpy(pname, prefix), Connection->Endpoint); + pname = ncacn_pipe_name(Connection->Endpoint); r = rpcrt4_conn_create_pipe(Connection, pname); I_RpcFree(pname); @@ -379,30 +388,53 @@ { RPC_STATUS status; LPSTR pname; - static const char prefix[] = "\\\\."; rpcrt4_conn_np_handoff((RpcConnection_np *)old_conn, (RpcConnection_np *)new_conn); - pname = I_RpcAllocate(strlen(prefix) + strlen(old_conn->Endpoint) + 1); - strcat(strcpy(pname, prefix), old_conn->Endpoint); + pname = ncacn_pipe_name(old_conn->Endpoint); status = rpcrt4_conn_create_pipe(old_conn, pname); I_RpcFree(pname); return status; } +static RPC_STATUS is_pipe_listening(const char *pipe_name) +{ + return WaitNamedPipeA(pipe_name, 1) ? RPC_S_OK : RPC_S_NOT_LISTENING; +} + +static RPC_STATUS rpcrt4_ncacn_np_is_server_listening(const char *endpoint) +{ + char *pipe_name; + RPC_STATUS status; + + pipe_name = ncacn_pipe_name(endpoint); + status = is_pipe_listening(pipe_name); + I_RpcFree(pipe_name); + return status; +} + +static RPC_STATUS rpcrt4_ncalrpc_np_is_server_listening(const char *endpoint) +{ + char *pipe_name; + RPC_STATUS status; + + pipe_name = ncalrpc_pipe_name(endpoint); + status = is_pipe_listening(pipe_name); + I_RpcFree(pipe_name); + return status; +} + static RPC_STATUS rpcrt4_ncalrpc_handoff(RpcConnection *old_conn, RpcConnection *new_conn) { RPC_STATUS status; LPSTR pname; - static const char prefix[] = "\\\\.\\pipe\\lrpc\\"; TRACE("%s\n", old_conn->Endpoint); rpcrt4_conn_np_handoff((RpcConnection_np *)old_conn, (RpcConnection_np *)new_conn); - pname = I_RpcAllocate(strlen(prefix) + strlen(old_conn->Endpoint) + 1); - strcat(strcpy(pname, prefix), old_conn->Endpoint); + pname = ncalrpc_pipe_name(old_conn->Endpoint); status = rpcrt4_conn_create_pipe(old_conn, pname); I_RpcFree(pname); @@ -1527,6 +1559,12 @@ rpcrt4_sock_wait_cancel(tcpc); } +static RPC_STATUS rpcrt4_conn_tcp_is_server_listening(const char *endpoint) +{ + FIXME("\n"); + return RPC_S_ACCESS_DENIED; +} + static int rpcrt4_conn_tcp_wait_for_incoming_data(RpcConnection *Connection) { RpcConnection_tcp *tcpc = (RpcConnection_tcp *) Connection; @@ -3296,6 +3334,12 @@ SetEvent(httpc->cancel_event); } +static RPC_STATUS rpcrt4_ncacn_http_is_server_listening(const char *endpoint) +{ + FIXME("\n"); + return RPC_S_ACCESS_DENIED; +} + static int rpcrt4_ncacn_http_wait_for_incoming_data(RpcConnection *Connection) { RpcConnection_http *httpc = (RpcConnection_http *) Connection; @@ -3337,6 +3381,7 @@ rpcrt4_conn_np_write, rpcrt4_conn_np_close, rpcrt4_conn_np_cancel_call, + rpcrt4_ncacn_np_is_server_listening, rpcrt4_conn_np_wait_for_incoming_data, rpcrt4_ncacn_np_get_top_of_tower, rpcrt4_ncacn_np_parse_top_of_tower, @@ -3357,6 +3402,7 @@ rpcrt4_conn_np_write, rpcrt4_conn_np_close, rpcrt4_conn_np_cancel_call, + rpcrt4_ncalrpc_np_is_server_listening, rpcrt4_conn_np_wait_for_incoming_data, rpcrt4_ncalrpc_get_top_of_tower, rpcrt4_ncalrpc_parse_top_of_tower, @@ -3377,6 +3423,7 @@ rpcrt4_conn_tcp_write, rpcrt4_conn_tcp_close, rpcrt4_conn_tcp_cancel_call, + rpcrt4_conn_tcp_is_server_listening, rpcrt4_conn_tcp_wait_for_incoming_data, rpcrt4_ncacn_ip_tcp_get_top_of_tower, rpcrt4_ncacn_ip_tcp_parse_top_of_tower, @@ -3397,6 +3444,7 @@ rpcrt4_ncacn_http_write, rpcrt4_ncacn_http_close, rpcrt4_ncacn_http_cancel_call, + rpcrt4_ncacn_http_is_server_listening, rpcrt4_ncacn_http_wait_for_incoming_data, rpcrt4_ncacn_http_get_top_of_tower, rpcrt4_ncacn_http_parse_top_of_tower, @@ -3570,6 +3618,20 @@ return RPC_S_OK; } +RPC_STATUS RPCRT4_IsServerListening(const char *protseq, const char *endpoint) +{ + const struct connection_ops *ops; + + ops = rpcrt4_get_conn_protseq_ops(protseq); + if (!ops) + { + FIXME("not supported for protseq %s\n", protseq); + return RPC_S_INVALID_BINDING; + } + + return ops->is_server_listening(endpoint); +} + RPC_STATUS RpcTransport_GetTopOfTower(unsigned char *tower_data, size_t *tower_size, const char *protseq, diff -Nru wine1.7-1.7.50/dlls/rpcrt4/tests/ndr_marshall.c wine1.7-1.7.55/dlls/rpcrt4/tests/ndr_marshall.c --- wine1.7-1.7.50/dlls/rpcrt4/tests/ndr_marshall.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/rpcrt4/tests/ndr_marshall.c 2015-11-13 14:32:40.000000000 +0000 @@ -965,7 +965,7 @@ s1.c = 0xa5; s1.l1 = 0xdeadbeef; s1.l2 = 0xcafebabe; - s1.ll = ((LONGLONG) 0xbadefeed << 32) | 0x2468ace0; + s1.ll = ((ULONGLONG) 0xbadefeed << 32) | 0x2468ace0; wiredatalen = 24; memcpy(wiredata, &s1, wiredatalen); diff -Nru wine1.7-1.7.50/dlls/rpcrt4/tests/server.c wine1.7-1.7.55/dlls/rpcrt4/tests/server.c --- wine1.7-1.7.50/dlls/rpcrt4/tests/server.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/rpcrt4/tests/server.c 2015-11-13 14:32:40.000000000 +0000 @@ -1532,6 +1532,26 @@ ok(status == RPC_S_OK, "RpcBindingSetAuthInfoExA failed %d\n", status); } +#define test_is_server_listening(a,b) _test_is_server_listening(__LINE__,a,b) +static void _test_is_server_listening(unsigned line, RPC_BINDING_HANDLE binding, RPC_STATUS expected_status) +{ + RPC_STATUS status; + status = RpcMgmtIsServerListening(binding); + ok_(__FILE__,line)(status == expected_status, "RpcMgmtIsServerListening returned %u, expected %u\n", + status, expected_status); +} + +#define test_is_server_listening2(a,b,c) _test_is_server_listening2(__LINE__,a,b,c) +static void _test_is_server_listening2(unsigned line, RPC_BINDING_HANDLE binding, RPC_STATUS expected_status, + RPC_STATUS expected_status2) +{ + RPC_STATUS status; + status = RpcMgmtIsServerListening(binding); + ok_(__FILE__,line)(status == expected_status || status == expected_status2, + "RpcMgmtIsServerListening returned %u, expected %u or %u\n", + status, expected_status, expected_status2); +} + static void client(const char *test) { @@ -1553,6 +1573,7 @@ run_tests(); authinfo_test(RPC_PROTSEQ_TCP, 0); + test_is_server_listening2(IServer_IfHandle, RPC_S_OK, RPC_S_ACCESS_DENIED); ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n"); ok(RPC_S_OK == RpcBindingFree(&IServer_IfHandle), "RpcBindingFree\n"); @@ -1564,6 +1585,7 @@ set_auth_info(IServer_IfHandle); authinfo_test(RPC_PROTSEQ_TCP, 1); + test_is_server_listening(IServer_IfHandle, RPC_S_ACCESS_DENIED); ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n"); ok(RPC_S_OK == RpcBindingFree(&IServer_IfHandle), "RpcBindingFree\n"); @@ -1575,6 +1597,7 @@ run_tests(); /* can cause RPC_X_BAD_STUB_DATA exception */ authinfo_test(RPC_PROTSEQ_LRPC, 0); + test_is_server_listening(IServer_IfHandle, RPC_S_OK); ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n"); ok(RPC_S_OK == RpcBindingFree(&IServer_IfHandle), "RpcBindingFree\n"); @@ -1586,6 +1609,7 @@ set_auth_info(IServer_IfHandle); authinfo_test(RPC_PROTSEQ_LRPC, 1); + test_is_server_listening(IServer_IfHandle, RPC_S_OK); ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n"); ok(RPC_S_OK == RpcBindingFree(&IServer_IfHandle), "RpcBindingFree\n"); @@ -1595,9 +1619,12 @@ ok(RPC_S_OK == RpcStringBindingComposeA(NULL, np, address_np, pipe, NULL, &binding), "RpcStringBindingCompose\n"); ok(RPC_S_OK == RpcBindingFromStringBindingA(binding, &IServer_IfHandle), "RpcBindingFromStringBinding\n"); + test_is_server_listening(IServer_IfHandle, RPC_S_OK); run_tests(); authinfo_test(RPC_PROTSEQ_NMP, 0); + test_is_server_listening(IServer_IfHandle, RPC_S_OK); stop(); + test_is_server_listening(IServer_IfHandle, RPC_S_NOT_LISTENING); ok(RPC_S_OK == RpcStringFreeA(&binding), "RpcStringFree\n"); ok(RPC_S_OK == RpcBindingFree(&IServer_IfHandle), "RpcBindingFree\n"); @@ -1638,8 +1665,10 @@ else status = RpcServerRegisterIf(s_IServer_v0_0_s_ifspec, NULL, NULL); ok(status == RPC_S_OK, "RpcServerRegisterIf failed with status %d\n", status); + test_is_server_listening(NULL, RPC_S_NOT_LISTENING); status = RpcServerListen(1, 20, TRUE); ok(status == RPC_S_OK, "RpcServerListen failed with status %d\n", status); + test_is_server_listening(NULL, RPC_S_OK); stop_event = CreateEventW(NULL, FALSE, FALSE, NULL); ok(stop_event != NULL, "CreateEvent failed with error %d\n", GetLastError()); diff -Nru wine1.7-1.7.50/dlls/rsaenh/tests/rsaenh.c wine1.7-1.7.55/dlls/rsaenh/tests/rsaenh.c --- wine1.7-1.7.50/dlls/rsaenh/tests/rsaenh.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/rsaenh/tests/rsaenh.c 2015-11-13 14:32:40.000000000 +0000 @@ -1166,8 +1166,8 @@ /* Does AES provider support salt? */ result = CryptGetKeyParam(hKey, KP_SALT, NULL, &dwLen, 0); - ok((!result && GetLastError() == NTE_BAD_KEY) || result /* Win7 */, - "expected NTE_BAD_KEY, got %08x\n", GetLastError()); + todo_wine ok(result || broken(GetLastError() == NTE_BAD_KEY), /* Vista or older */ + "Expected OK, got last error %d\n", GetLastError()); if (result) ok(!dwLen, "unexpected salt length %d\n", dwLen); @@ -1971,8 +1971,7 @@ * actual buffer. The private exponent can be omitted, its length is * inferred from the passed-in length parameter. */ - dwLen = sizeof(BLOBHEADER) + sizeof(RSAPUBKEY) + - rsaPubKey->bitlen / 8 + 5 * rsaPubKey->bitlen / 16; + dwLen = sizeof(BLOBHEADER) + sizeof(RSAPUBKEY) + rsaPubKey->bitlen / 2; for (; dwLen < sizeof(abPlainPrivateKey); dwLen++) { result = CryptImportKey(hProv, abPlainPrivateKey, dwLen, 0, 0, &hKeyExchangeKey); diff -Nru wine1.7-1.7.50/dlls/schedsvc/schedsvc.c wine1.7-1.7.55/dlls/schedsvc/schedsvc.c --- wine1.7-1.7.50/dlls/schedsvc/schedsvc.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/schedsvc/schedsvc.c 2015-11-13 14:32:40.000000000 +0000 @@ -87,8 +87,7 @@ WCHAR *slash; DWORD last_error = GetLastError(); - if (last_error == ERROR_ALREADY_EXISTS || last_error != ERROR_PATH_NOT_FOUND || - !(slash = strrchrW(new_path, '\\'))) + if (last_error != ERROR_PATH_NOT_FOUND || !(slash = strrchrW(new_path, '\\'))) { hr = HRESULT_FROM_WIN32(last_error); break; diff -Nru wine1.7-1.7.50/dlls/scrrun/tests/scrrun.idl wine1.7-1.7.55/dlls/scrrun/tests/scrrun.idl --- wine1.7-1.7.50/dlls/scrrun/tests/scrrun.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/scrrun/tests/scrrun.idl 2015-11-13 14:32:40.000000000 +0000 @@ -15,6 +15,9 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ + +#pragma makedep header + import "unknwn.idl"; import "objidl.idl"; import "oaidl.idl"; diff -Nru wine1.7-1.7.50/dlls/secur32/tests/negotiate.c wine1.7-1.7.55/dlls/secur32/tests/negotiate.c --- wine1.7-1.7.50/dlls/secur32/tests/negotiate.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/secur32/tests/negotiate.c 2015-11-13 14:32:40.000000000 +0000 @@ -262,6 +262,9 @@ SecPkgInfoA *pi; BOOL first = TRUE; + memset(&client, 0, sizeof(client)); + memset(&server, 0, sizeof(server)); + id.User = (unsigned char *)"user"; id.UserLength = strlen( "user" ); id.Domain = (unsigned char *)"domain"; @@ -342,17 +345,29 @@ cleanup_buffers( &client ); cleanup_buffers( &server ); - status_c = pDeleteSecurityContext( &client.ctxt ); - ok( status_c == SEC_E_OK, "DeleteSecurityContext returned %08x\n", status_c ); + if (client.ctxt.dwLower || client.ctxt.dwUpper) + { + status_c = pDeleteSecurityContext( &client.ctxt ); + ok( status_c == SEC_E_OK, "DeleteSecurityContext returned %08x\n", status_c ); + } - status_s = pDeleteSecurityContext( &server.ctxt ); - ok( status_s == SEC_E_OK, "DeleteSecurityContext returned %08x\n", status_s ); + if (server.ctxt.dwLower || server.ctxt.dwUpper) + { + status_s = pDeleteSecurityContext( &server.ctxt ); + ok( status_s == SEC_E_OK, "DeleteSecurityContext returned %08x\n", status_s ); + } - status_c = pFreeCredentialsHandle( &client.cred ); - ok( status_c == SEC_E_OK, "FreeCredentialsHandle returned %08x\n", status_c ); + if (client.cred.dwLower || client.cred.dwUpper) + { + status_c = pFreeCredentialsHandle( &client.cred ); + ok( status_c == SEC_E_OK, "FreeCredentialsHandle returned %08x\n", status_c ); + } - status_s = pFreeCredentialsHandle(&server.cred); - ok( status_s == SEC_E_OK, "FreeCredentialsHandle returned %08x\n", status_s ); + if (server.cred.dwLower || server.cred.dwUpper) + { + status_s = pFreeCredentialsHandle(&server.cred); + ok( status_s == SEC_E_OK, "FreeCredentialsHandle returned %08x\n", status_s ); + } } START_TEST(negotiate) diff -Nru wine1.7-1.7.50/dlls/setupapi/tests/install.c wine1.7-1.7.55/dlls/setupapi/tests/install.c --- wine1.7-1.7.50/dlls/setupapi/tests/install.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/setupapi/tests/install.c 2015-11-13 14:32:40.000000000 +0000 @@ -720,6 +720,64 @@ RemoveDirectoryA(dirA); } +static const char dirid_inf[] = "[Version]\n" + "Signature=\"$Chicago$\"\n" + "[DefaultInstall]\n" + "AddReg=Add.Settings\n" + "[Add.Settings]\n" + "HKCU,Software\\Wine\\setupapitest,dirid,,%%%i%%\n"; + +static void check_dirid(int dirid, LPCSTR expected) +{ + char buffer[sizeof(dirid_inf)+11]; + char path[MAX_PATH], actual[MAX_PATH]; + LONG ret; + DWORD size, type; + HKEY key; + + sprintf(buffer, dirid_inf, dirid); + + create_inf_file(inffile, buffer); + + sprintf(path, "%s\\%s", CURR_DIR, inffile); + run_cmdline("DefaultInstall", 128, path); + + size = sizeof(actual); + actual[0] = '\0'; + ret = RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\setupapitest", &key); + if (ret == ERROR_SUCCESS) + { + ret = RegQueryValueExA(key, "dirid", NULL, &type, (BYTE*)&actual, &size); + RegCloseKey(key); + if (type != REG_SZ) + ret = ERROR_FILE_NOT_FOUND; + } + + ok(ret == ERROR_SUCCESS, "Failed getting value for dirid %i, err=%d\n", dirid, ret); + ok(!strcmp(actual, expected), "Expected path for dirid %i was \"%s\", got \"%s\"\n", dirid, expected, actual); + + ok_registry(TRUE); + ret = DeleteFileA(inffile); + ok(ret, "Expected source inf to exist, last error was %d\n", GetLastError()); +} + +/* Test dirid values */ +static void test_dirid(void) +{ + char expected[MAX_PATH]; + + check_dirid(DIRID_NULL, ""); + + GetWindowsDirectoryA(expected, MAX_PATH); + check_dirid(DIRID_WINDOWS, expected); + + GetSystemDirectoryA(expected, MAX_PATH); + check_dirid(DIRID_SYSTEM, expected); + + strcat(expected, "\\unknown"); + check_dirid(40, expected); +} + START_TEST(install) { HMODULE hsetupapi = GetModuleHandleA("setupapi.dll"); @@ -770,6 +828,7 @@ test_registry(); test_install_svc_from(); test_driver_install(); + test_dirid(); UnhookWindowsHookEx(hhook); diff -Nru wine1.7-1.7.50/dlls/sfc/sfc.spec wine1.7-1.7.55/dlls/sfc/sfc.spec --- wine1.7-1.7.50/dlls/sfc/sfc.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/sfc/sfc.spec 2015-11-13 14:32:40.000000000 +0000 @@ -7,7 +7,7 @@ 7 stub @ 8 stub @ 9 stub @ -@ stub SfcGetNextProtectedFile +@ stdcall SfcGetNextProtectedFile(long ptr) sfc_os.SfcGetNextProtectedFile @ stdcall SfcIsFileProtected(ptr wstr) sfc_os.SfcIsFileProtected @ stdcall SfcIsKeyProtected(long wstr long) sfc_os.SfcIsKeyProtected @ stub SfcWLEventLogoff diff -Nru wine1.7-1.7.50/dlls/sfc_os/sfc_os.c wine1.7-1.7.55/dlls/sfc_os/sfc_os.c --- wine1.7-1.7.50/dlls/sfc_os/sfc_os.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/sfc_os/sfc_os.c 2015-11-13 14:32:40.000000000 +0000 @@ -49,6 +49,15 @@ } /****************************************************************** + * SfcGetNextProtectedFile [sfc_os.@] + */ +BOOL WINAPI SfcGetNextProtectedFile(HANDLE handle, PROTECTED_FILE_DATA *data) +{ + FIXME("%p %p\n", handle, data); + return FALSE; +} + +/****************************************************************** * SfcIsFileProtected [sfc_os.@] * * Check, if the given File is protected by the System diff -Nru wine1.7-1.7.50/dlls/sfc_os/sfc_os.spec wine1.7-1.7.55/dlls/sfc_os/sfc_os.spec --- wine1.7-1.7.50/dlls/sfc_os/sfc_os.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/sfc_os/sfc_os.spec 2015-11-13 14:32:40.000000000 +0000 @@ -1,3 +1,3 @@ -@ stub SfcGetNextProtectedFile +@ stdcall SfcGetNextProtectedFile(long ptr) @ stdcall SfcIsFileProtected(ptr wstr) @ stdcall SfcIsKeyProtected(long wstr long) diff -Nru wine1.7-1.7.50/dlls/shdocvw/shdocvw_main.c wine1.7-1.7.55/dlls/shdocvw/shdocvw_main.c --- wine1.7-1.7.50/dlls/shdocvw/shdocvw_main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/shdocvw/shdocvw_main.c 2015-11-13 14:32:40.000000000 +0000 @@ -258,9 +258,9 @@ * * Called by Emerge Desktop (alternative Windows Shell). */ -DWORD WINAPI RunInstallUninstallStubs2(void) +DWORD WINAPI RunInstallUninstallStubs2(int arg) { - FIXME("(), stub!\n"); + FIXME("(%d), stub!\n", arg); return 0x0deadbee; } diff -Nru wine1.7-1.7.50/dlls/shdocvw/shdocvw.spec wine1.7-1.7.55/dlls/shdocvw/shdocvw.spec --- wine1.7-1.7.50/dlls/shdocvw/shdocvw.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/shdocvw/shdocvw.spec 2015-11-13 14:32:40.000000000 +0000 @@ -20,7 +20,7 @@ 123 stdcall -noname StopWatchAFORWARD(long str long long long) 124 stdcall -noname StopWatchWFORWARD(long wstr long long long) 125 stdcall -noname RunInstallUninstallStubs() -130 stdcall -noname RunInstallUninstallStubs2() +130 stdcall -noname RunInstallUninstallStubs2(long) 131 stub -noname SHCreateSplashScreen 135 stub -noname IsFileUrl 136 stub -noname IsFileUrlW diff -Nru wine1.7-1.7.50/dlls/shell32/brsfolder.c wine1.7-1.7.55/dlls/shell32/brsfolder.c --- wine1.7-1.7.50/dlls/shell32/brsfolder.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/shell32/brsfolder.c 2015-11-13 14:32:40.000000000 +0000 @@ -757,9 +757,10 @@ if(FAILED(hr)) return hr; - hr = SHGetPathFromIDListW(info->pidlRet, name); - if(FAILED(hr)) + if(!SHGetPathFromIDListW(info->pidlRet, name)) { + hr = E_FAIL; goto cleanup; + } len = strlenW(name); if(lenmkid.cb == 0x00) ); + return ( !pidl || pidl->mkid.cb == 0x00 ); } static diff -Nru wine1.7-1.7.50/dlls/shell32/shell32.manifest wine1.7-1.7.55/dlls/shell32/shell32.manifest --- wine1.7-1.7.50/dlls/shell32/shell32.manifest 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/shell32/shell32.manifest 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,4 @@ + + + + diff -Nru wine1.7-1.7.50/dlls/shell32/shell32.rc wine1.7-1.7.55/dlls/shell32/shell32.rc --- wine1.7-1.7.50/dlls/shell32/shell32.rc 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/shell32/shell32.rc 2015-11-13 14:32:40.000000000 +0000 @@ -457,6 +457,9 @@ /* @makedep: AUTHORS */ AUTHORS RCDATA AUTHORS +/* @makedep: shell32.manifest */ +124 RT_MANIFEST shell32.manifest + /* please keep in sync with version.h values */ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL diff -Nru wine1.7-1.7.50/dlls/shell32/shell32.spec wine1.7-1.7.55/dlls/shell32/shell32.spec --- wine1.7-1.7.50/dlls/shell32/shell32.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/shell32/shell32.spec 2015-11-13 14:32:40.000000000 +0000 @@ -245,10 +245,10 @@ 650 stdcall -noname PathIsSameRoot(ptr ptr) PathIsSameRootAW - 651 stdcall -noname ReadCabinetState(long long) # OldReadCabinetState - 652 stdcall -noname WriteCabinetState(long) + 651 stdcall -noname @(ptr long) ReadCabinetState # OldReadCabinetState + 652 stdcall -noname WriteCabinetState(ptr) 653 stdcall -noname PathProcessCommand(long long long long) PathProcessCommandAW - 654 stdcall @(long long) shell32_654 # ReadCabinetState@8 + 654 stdcall ReadCabinetState(ptr long) 660 stdcall -noname FileIconInit(long) 680 stdcall IsUserAnAdmin() diff -Nru wine1.7-1.7.50/dlls/shell32/shelldispatch.c wine1.7-1.7.55/dlls/shell32/shelldispatch.c --- wine1.7-1.7.50/dlls/shell32/shelldispatch.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/shell32/shelldispatch.c 2015-11-13 14:32:40.000000000 +0000 @@ -1569,11 +1569,45 @@ return E_NOTIMPL; } -static HRESULT WINAPI ShellDispatch_ShellExecute(IShellDispatch6 *iface, BSTR file, VARIANT args, VARIANT dir, - VARIANT op, VARIANT show) +static HRESULT WINAPI ShellDispatch_ShellExecute(IShellDispatch6 *iface, + BSTR file, VARIANT v_args, VARIANT v_dir, VARIANT v_op, VARIANT v_show) { - FIXME("(%s): stub\n", debugstr_w(file)); - return E_NOTIMPL; + VARIANT args_str, dir_str, op_str, show_int; + WCHAR *args = NULL, *dir = NULL, *op = NULL; + INT show = 0; + HINSTANCE ret; + + TRACE("(%s, %s, %s, %s, %s)\n", debugstr_w(file), debugstr_variant(&v_args), + debugstr_variant(&v_dir), debugstr_variant(&v_op), debugstr_variant(&v_show)); + + VariantInit(&args_str); + VariantChangeType(&args_str, &v_args, 0, VT_BSTR); + if (V_VT(&args_str) == VT_BSTR) + args = V_BSTR(&args_str); + + VariantInit(&dir_str); + VariantChangeType(&dir_str, &v_dir, 0, VT_BSTR); + if (V_VT(&dir_str) == VT_BSTR) + dir = V_BSTR(&dir_str); + + VariantInit(&op_str); + VariantChangeType(&op_str, &v_op, 0, VT_BSTR); + if (V_VT(&op_str) == VT_BSTR) + op = V_BSTR(&op_str); + + VariantInit(&show_int); + VariantChangeType(&show_int, &v_show, 0, VT_I4); + if (V_VT(&show_int) == VT_I4) + show = V_I4(&show_int); + + ret = ShellExecuteW(NULL, op, file, args, dir, show); + + VariantClear(&args_str); + VariantClear(&dir_str); + VariantClear(&op_str); + VariantClear(&show_int); + + return (ULONG_PTR)ret > 32 ? S_OK : S_FALSE; } static HRESULT WINAPI ShellDispatch_FindPrinter(IShellDispatch6 *iface, BSTR name, BSTR location, BSTR model) diff -Nru wine1.7-1.7.50/dlls/shell32/shellitem.c wine1.7-1.7.55/dlls/shell32/shellitem.c --- wine1.7-1.7.50/dlls/shell32/shellitem.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/shell32/shellitem.c 2015-11-13 14:32:40.000000000 +0000 @@ -1197,6 +1197,7 @@ if(SUCCEEDED(ret)) { ret = create_shellitemarray(array, cidl, ppsiItemArray); + HeapFree(GetProcessHeap(), 0, array); if(SUCCEEDED(ret)) return ret; } @@ -1310,6 +1311,7 @@ if(SUCCEEDED(ret)) { ret = create_shellitemarray(array, cidl, psia); + HeapFree(GetProcessHeap(), 0, array); if(SUCCEEDED(ret)) return ret; } diff -Nru wine1.7-1.7.50/dlls/shell32/shellole.c wine1.7-1.7.55/dlls/shell32/shellole.c --- wine1.7-1.7.50/dlls/shell32/shellole.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/shell32/shellole.c 2015-11-13 14:32:40.000000000 +0000 @@ -59,7 +59,7 @@ /* this table contains all CLSIDs of shell32 objects */ static const struct { - REFIID riid; + REFIID clsid; LPFNCREATEINSTANCE lpfnCI; } InterfaceTable[] = { @@ -204,8 +204,8 @@ */ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv) { - HRESULT hres = E_OUTOFMEMORY; IClassFactory * pcf = NULL; + HRESULT hres; int i; TRACE("CLSID:%s,IID:%s\n",shdebugstr_guid(rclsid),shdebugstr_guid(iid)); @@ -214,10 +214,11 @@ *ppv = NULL; /* search our internal interface table */ - for(i=0;InterfaceTable[i].riid;i++) { - if(IsEqualIID(InterfaceTable[i].riid, rclsid)) { + for(i=0;InterfaceTable[i].clsid;i++) { + if(IsEqualIID(InterfaceTable[i].clsid, rclsid)) { TRACE("index[%u]\n", i); pcf = IDefClF_fnConstructor(InterfaceTable[i].lpfnCI, NULL, NULL); + break; } } diff -Nru wine1.7-1.7.50/dlls/shell32/shellord.c wine1.7-1.7.55/dlls/shell32/shellord.c --- wine1.7-1.7.50/dlls/shell32/shellord.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/shell32/shellord.c 2015-11-13 14:32:40.000000000 +0000 @@ -876,7 +876,11 @@ switch (uFlags) { case SHARD_PIDL: - SHGetPathFromIDListA(pv, doc_name); + if (!SHGetPathFromIDListA(pv, doc_name)) + { + WARN("can't get path from PIDL\n"); + return; + } break; case SHARD_PATHA: @@ -1551,21 +1555,6 @@ } /************************************************************************ - * @ [SHELL32.654] - * - * NOTES - * first parameter seems to be a pointer (same as passed to WriteCabinetState) - * second one could be a size (0x0c). The size is the same as the structure saved to - * HCU\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState - * I'm (js) guessing: this one is just ReadCabinetState ;-) - */ -HRESULT WINAPI shell32_654 (CABINETSTATE *cs, int length) -{ - TRACE("%p %d\n",cs,length); - return ReadCabinetState(cs,length); -} - -/************************************************************************ * RLBuildListOfPaths [SHELL32.146] * * NOTES diff -Nru wine1.7-1.7.50/dlls/shell32/shellpath.c wine1.7-1.7.55/dlls/shell32/shellpath.c --- wine1.7-1.7.50/dlls/shell32/shellpath.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/shell32/shellpath.c 2015-11-13 14:32:40.000000000 +0000 @@ -5568,8 +5568,7 @@ if(SUCCEEDED(hr)) { - if(SUCCEEDED(hr)) - hr = HRESULT_FROM_WIN32(RegSetValueExW(hKey, szCategory, 0, REG_DWORD, (LPBYTE)&pKFD->category, sizeof(pKFD->category))); + hr = HRESULT_FROM_WIN32(RegSetValueExW(hKey, szCategory, 0, REG_DWORD, (LPBYTE)&pKFD->category, sizeof(pKFD->category))); if(SUCCEEDED(hr) && pKFD->dwAttributes != 0) hr = HRESULT_FROM_WIN32(RegSetValueExW(hKey, szAttributes, 0, REG_DWORD, (LPBYTE)&pKFD->dwAttributes, sizeof(pKFD->dwAttributes))); @@ -5590,10 +5589,7 @@ } if(SUCCEEDED(hr) && pKFD->category != KF_CATEGORY_VIRTUAL && pKFD->pszRelativePath) - { - if(SUCCEEDED(hr)) - hr = HRESULT_FROM_WIN32(RegSetValueExW(hKey, szRelativePath, 0, REG_SZ, (LPBYTE)pKFD->pszRelativePath, (lstrlenW(pKFD->pszRelativePath)+1)*sizeof(WCHAR) )); - } + hr = HRESULT_FROM_WIN32(RegSetValueExW(hKey, szRelativePath, 0, REG_SZ, (LPBYTE)pKFD->pszRelativePath, (lstrlenW(pKFD->pszRelativePath)+1)*sizeof(WCHAR) )); RegCloseKey(hKey); diff -Nru wine1.7-1.7.50/dlls/shell32/shlfileop.c wine1.7-1.7.55/dlls/shell32/shlfileop.c --- wine1.7-1.7.50/dlls/shell32/shlfileop.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/shell32/shlfileop.c 2015-11-13 14:32:40.000000000 +0000 @@ -1180,7 +1180,7 @@ } /* the FO_COPY operation */ -static DWORD copy_files(FILE_OPERATION *op, const FILE_LIST *flFrom, FILE_LIST *flTo) +static int copy_files(FILE_OPERATION *op, const FILE_LIST *flFrom, FILE_LIST *flTo) { DWORD i; const FILE_ENTRY *entryToCopy; @@ -1328,10 +1328,11 @@ } /* the FO_DELETE operation */ -static DWORD delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom) +static int delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom) { const FILE_ENTRY *fileEntry; - DWORD i, ret; + DWORD i; + int ret; BOOL bTrash; if (!flFrom->dwNumFiles) @@ -1399,7 +1400,7 @@ } /* the FO_MOVE operation */ -static DWORD move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const FILE_LIST *flTo) +static int move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const FILE_LIST *flTo) { DWORD i; INT mismatched = 0; @@ -1470,7 +1471,7 @@ } /* the FO_RENAME files */ -static DWORD rename_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const FILE_LIST *flTo) +static int rename_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, const FILE_LIST *flTo) { const FILE_ENTRY *feFrom; const FILE_ENTRY *feTo; diff -Nru wine1.7-1.7.50/dlls/shell32/tests/shelldispatch.c wine1.7-1.7.55/dlls/shell32/tests/shelldispatch.c --- wine1.7-1.7.50/dlls/shell32/tests/shelldispatch.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/shell32/tests/shelldispatch.c 2015-11-13 14:32:40.000000000 +0000 @@ -829,6 +829,46 @@ IShellDispatch_Release(sd); } +static void test_ShellExecute(void) +{ + HRESULT hr; + IShellDispatch2 *sd; + BSTR name; + VARIANT args, dir, op, show; + + static const WCHAR regW[] = {'r','e','g',0}; + + hr = CoCreateInstance(&CLSID_Shell, NULL, CLSCTX_INPROC_SERVER, + &IID_IShellDispatch2, (void**)&sd); + if (hr != S_OK) + { + win_skip("IShellDispatch2 not supported\n"); + return; + } + + VariantInit(&args); + VariantInit(&dir); + VariantInit(&op); + VariantInit(&show); + + V_VT(&show) = VT_I4; + V_I4(&show) = 0; + + name = SysAllocString(regW); + + hr = IShellDispatch2_ShellExecute(sd, name, args, dir, op, show); + ok(hr == S_OK, "ShellExecute failed: %08x\n", hr); + + /* test invalid value for show */ + V_VT(&show) = VT_BSTR; + V_BSTR(&show) = name; + + hr = IShellDispatch2_ShellExecute(sd, name, args, dir, op, show); + ok(hr == S_OK, "ShellExecute failed: %08x\n", hr); + + SysFreeString(name); +} + START_TEST(shelldispatch) { HRESULT r; @@ -845,6 +885,7 @@ test_ShellWindows(); test_ParseName(); test_Verbs(); + test_ShellExecute(); CoUninitialize(); } diff -Nru wine1.7-1.7.50/dlls/shell32/tests/shelllink.c wine1.7-1.7.55/dlls/shell32/tests/shelllink.c --- wine1.7-1.7.50/dlls/shell32/tests/shelllink.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/shell32/tests/shelllink.c 2015-11-13 14:32:40.000000000 +0000 @@ -993,7 +993,6 @@ { BYTE buffer[sizeof(SHSTOCKICONINFO) + 16]; SHSTOCKICONINFO *sii = (SHSTOCKICONINFO *) buffer; - BOOL atleast_win7; HRESULT hr; INT i; @@ -1007,11 +1006,11 @@ /* negative values are handled */ memset(buffer, '#', sizeof(buffer)); sii->cbSize = sizeof(SHSTOCKICONINFO); - hr = pSHGetStockIconInfo(-1, SHGSI_ICONLOCATION, sii); + hr = pSHGetStockIconInfo(SIID_INVALID, SHGSI_ICONLOCATION, sii); ok(hr == E_INVALIDARG, "-1: got 0x%x (expected E_INVALIDARG)\n", hr); /* max. id for vista is 140 (no definition exists for this value) */ - for (i = 0; i <= 140; i++) + for (i = SIID_DOCNOASSOC; i <= SIID_CLUSTEREDDRIVE; i++) { memset(buffer, '#', sizeof(buffer)); sii->cbSize = sizeof(SHSTOCKICONINFO); @@ -1026,38 +1025,17 @@ sii->iIcon, wine_dbgstr_w(sii->szPath)); } - /* there are more icons since win7 */ - memset(buffer, '#', sizeof(buffer)); - sii->cbSize = sizeof(SHSTOCKICONINFO); - hr = pSHGetStockIconInfo(i, SHGSI_ICONLOCATION, sii); - atleast_win7 = (!hr); - - for (; i < (SIID_MAX_ICONS + 25) ; i++) + /* test invalid icons indices that are invalid for all platforms */ + for (i = SIID_MAX_ICONS; i < (SIID_MAX_ICONS + 25) ; i++) { memset(buffer, '#', sizeof(buffer)); sii->cbSize = sizeof(SHSTOCKICONINFO); hr = pSHGetStockIconInfo(i, SHGSI_ICONLOCATION, sii); - - if (atleast_win7 && (i == (SIID_MAX_ICONS - 1)) && broken(hr == E_INVALIDARG)) - { - /* Off by one windows bug: there are SIID_MAX_ICONS icons from 0 - * up to SIID_MAX_ICONS-1 on Windows 8, but the last one is missing - * on Windows 7. - */ - trace("%3d: got E_INVALIDARG (windows bug: off by one)\n", i); - } - else if (atleast_win7 && (i < (SIID_MAX_ICONS))) - { - ok(hr == S_OK, - "%3d: got 0x%x, iSysImageIndex: 0x%x, iIcon: 0x%x (expected S_OK)\n", - i, hr, sii->iSysImageIndex, sii->iIcon); - - if ((hr == S_OK) && (winetest_debug > 1)) - trace("%3d: got iSysImageIndex %3d, iIcon %3d and %s\n", i, sii->iSysImageIndex, - sii->iIcon, wine_dbgstr_w(sii->szPath)); - } - else - ok(hr == E_INVALIDARG, "%3d: got 0x%x (expected E_INVALIDARG)\n", i, hr); + ok(hr == E_INVALIDARG, "%3d: got 0x%x (expected E_INVALIDARG)\n", i, hr); + todo_wine { + ok(sii->iSysImageIndex == -1, "%d: got iSysImageIndex %d\n", i, sii->iSysImageIndex); + ok(sii->iIcon == -1, "%d: got iIcon %d\n", i, sii->iIcon); + } } /* test more returned SHSTOCKICONINFO elements without extra flags */ diff -Nru wine1.7-1.7.50/dlls/shell32/tests/string.c wine1.7-1.7.55/dlls/shell32/tests/string.c --- wine1.7-1.7.50/dlls/shell32/tests/string.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/shell32/tests/string.c 2015-11-13 14:32:40.000000000 +0000 @@ -32,7 +32,7 @@ #include "wine/test.h" static HMODULE hShell32; -static HRESULT (WINAPI *pStrRetToStrNAW)(LPVOID,DWORD,LPSTRRET,const ITEMIDLIST *); +static BOOL (WINAPI *pStrRetToStrNAW)(LPVOID,DWORD,LPSTRRET,const ITEMIDLIST *); static WCHAR *CoDupStrW(const char* src) { diff -Nru wine1.7-1.7.50/dlls/shlwapi/ordinal.c wine1.7-1.7.55/dlls/shlwapi/ordinal.c --- wine1.7-1.7.50/dlls/shlwapi/ordinal.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/shlwapi/ordinal.c 2015-11-13 14:32:40.000000000 +0000 @@ -5187,9 +5187,9 @@ * pValue: address to receive the property value as a 32-bit signed integer * * RETURNS - * 0 for Success + * HRESULT codes */ -BOOL WINAPI SHPropertyBag_ReadLONG(IPropertyBag *ppb, LPCWSTR pszPropName, LPLONG pValue) +HRESULT WINAPI SHPropertyBag_ReadLONG(IPropertyBag *ppb, LPCWSTR pszPropName, LPLONG pValue) { VARIANT var; HRESULT hr; diff -Nru wine1.7-1.7.50/dlls/shlwapi/path.c wine1.7-1.7.55/dlls/shlwapi/path.c --- wine1.7-1.7.50/dlls/shlwapi/path.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/shlwapi/path.c 2015-11-13 14:32:40.000000000 +0000 @@ -661,7 +661,7 @@ if (lpszPath) { LPSTR lpszFileName = PathFindFileNameA(lpszPath); - if(lpszFileName) + if(lpszFileName != lpszPath) RtlMoveMemory(lpszPath, lpszFileName, strlen(lpszFileName)+1); } } @@ -677,7 +677,7 @@ TRACE("(%s)\n", debugstr_w(lpszPath)); lpszFileName = PathFindFileNameW(lpszPath); - if(lpszFileName) + if(lpszFileName != lpszPath) RtlMoveMemory(lpszPath, lpszFileName, (strlenW(lpszFileName)+1)*sizeof(WCHAR)); } diff -Nru wine1.7-1.7.50/dlls/shlwapi/reg.c wine1.7-1.7.55/dlls/shlwapi/reg.c --- wine1.7-1.7.50/dlls/shlwapi/reg.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/shlwapi/reg.c 2015-11-13 14:32:40.000000000 +0000 @@ -193,6 +193,9 @@ LPSHUSKEY hKey = hUSKey; LONG ret = ERROR_SUCCESS; + if (!hKey) + return ERROR_INVALID_PARAMETER; + if (hKey->HKCUkey) ret = RegCloseKey(hKey->HKCUkey); if (hKey->HKCUstart && hKey->HKCUstart != HKEY_CURRENT_USER) diff -Nru wine1.7-1.7.50/dlls/shlwapi/tests/ordinal.c wine1.7-1.7.55/dlls/shlwapi/tests/ordinal.c --- wine1.7-1.7.50/dlls/shlwapi/tests/ordinal.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/shlwapi/tests/ordinal.c 2015-11-13 14:32:40.000000000 +0000 @@ -1633,21 +1633,19 @@ out = 0xfeedface; rc = pSHPropertyBag_ReadLONG(NULL, szName1, &out); - ok(rc == E_INVALIDARG || broken(rc == 0), "incorrect return %x\n",rc); + ok(rc == E_INVALIDARG || broken(rc == S_OK), "incorrect return %x\n",rc); ok(out == 0xfeedface, "value should not have changed\n"); rc = pSHPropertyBag_ReadLONG(&pb->IPropertyBag_iface, NULL, &out); - ok(rc == E_INVALIDARG || broken(rc == 0) || broken(rc == 1), "incorrect return %x\n",rc); + ok(rc == E_INVALIDARG || broken(rc == S_OK) || broken(rc == S_FALSE), "incorrect return %x\n",rc); ok(out == 0xfeedface, "value should not have changed\n"); rc = pSHPropertyBag_ReadLONG(&pb->IPropertyBag_iface, szName1, NULL); - ok(rc == E_INVALIDARG || broken(rc == 0) || broken(rc == 1), "incorrect return %x\n",rc); + ok(rc == E_INVALIDARG || broken(rc == S_OK) || broken(rc == S_FALSE), "incorrect return %x\n",rc); rc = pSHPropertyBag_ReadLONG(&pb->IPropertyBag_iface, szName1, &out); - ok(rc == DISP_E_BADVARTYPE || broken(rc == 0) || broken(rc == 1), "incorrect return %x\n",rc); + ok(rc == DISP_E_BADVARTYPE || broken(rc == S_OK) || broken(rc == S_FALSE), "incorrect return %x\n",rc); ok(out == 0xfeedface || broken(out == 0xfeedfa00), "value should not have changed %x\n",out); IUnknown_Release((IUnknown*)pb); } - - static void test_SHSetWindowBits(void) { HWND hwnd; diff -Nru wine1.7-1.7.50/dlls/shlwapi/tests/path.c wine1.7-1.7.55/dlls/shlwapi/tests/path.c --- wine1.7-1.7.50/dlls/shlwapi/tests/path.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/shlwapi/tests/path.c 2015-11-13 14:32:40.000000000 +0000 @@ -27,8 +27,8 @@ #include "shlwapi.h" #include "wininet.h" -static HRESULT (WINAPI *pPathIsValidCharA)(char,DWORD); -static HRESULT (WINAPI *pPathIsValidCharW)(WCHAR,DWORD); +static BOOL (WINAPI *pPathIsValidCharA)(char,DWORD); +static BOOL (WINAPI *pPathIsValidCharW)(WCHAR,DWORD); static LPWSTR (WINAPI *pPathCombineW)(LPWSTR, LPCWSTR, LPCWSTR); static HRESULT (WINAPI *pPathCreateFromUrlA)(LPCSTR, LPSTR, LPDWORD, DWORD); static HRESULT (WINAPI *pPathCreateFromUrlW)(LPCWSTR, LPWSTR, LPDWORD, DWORD); @@ -1639,6 +1639,19 @@ } } +static void test_PathStripPathA(void) +{ + const char const_path[] = "test"; + char path[] = "short//path\\file.txt"; + + PathStripPathA(path); + ok(!strcmp(path, "file.txt"), "path = %s\n", path); + + /* following test should not crash */ + /* LavView 2013 depends on that behaviour */ + PathStripPathA((char*)const_path); +} + START_TEST(path) { HMODULE hShlwapi = GetModuleHandleA("shlwapi.dll"); @@ -1684,4 +1697,5 @@ test_PathUnExpandEnvStrings(); test_PathIsRelativeA(); test_PathIsRelativeW(); + test_PathStripPathA(); } diff -Nru wine1.7-1.7.50/dlls/shlwapi/tests/shreg.c wine1.7-1.7.55/dlls/shlwapi/tests/shreg.c --- wine1.7-1.7.50/dlls/shlwapi/tests/shreg.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/shlwapi/tests/shreg.c 2015-11-13 14:32:40.000000000 +0000 @@ -38,6 +38,8 @@ static DWORD (WINAPI *pSHRegGetPathA)(HKEY,LPCSTR,LPCSTR,LPSTR,DWORD); static LSTATUS (WINAPI *pSHRegGetValueA)(HKEY,LPCSTR,LPCSTR,SRRF,LPDWORD,LPVOID,LPDWORD); static LSTATUS (WINAPI *pSHRegCreateUSKeyW)(LPCWSTR,REGSAM,HUSKEY,PHUSKEY,DWORD); +static LSTATUS (WINAPI *pSHRegOpenUSKeyW)(LPCWSTR,REGSAM,HUSKEY,PHUSKEY,BOOL); +static LSTATUS (WINAPI *pSHRegCloseUSKey)(HUSKEY); static const char sTestpath1[] = "%LONGSYSTEMVAR%\\subdir1"; static const char sTestpath2[] = "%FOO%\\subdir1"; @@ -458,6 +460,35 @@ ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret); } +static void test_SHRegCloseUSKey(void) +{ + static const WCHAR localW[] = {'S','o','f','t','w','a','r','e',0}; + LONG ret; + HUSKEY key; + + if (!pSHRegOpenUSKeyW || !pSHRegCloseUSKey) + { + win_skip("SHRegOpenUSKeyW or SHRegCloseUSKey not available\n"); + return; + } + + ret = pSHRegCloseUSKey(NULL); + ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret); + + ret = pSHRegOpenUSKeyW(localW, KEY_ALL_ACCESS, NULL, &key, FALSE); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + + ret = pSHRegCloseUSKey(key); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + + /* Test with limited rights, specially without KEY_SET_VALUE */ + ret = pSHRegOpenUSKeyW(localW, KEY_QUERY_VALUE, NULL, &key, FALSE); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + + ret = pSHRegCloseUSKey(key); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); +} + START_TEST(shreg) { HKEY hkey = create_test_entries(); @@ -476,6 +507,8 @@ pSHRegGetPathA = (void*)GetProcAddress(hshlwapi,"SHRegGetPathA"); pSHRegGetValueA = (void*)GetProcAddress(hshlwapi,"SHRegGetValueA"); pSHRegCreateUSKeyW = (void*)GetProcAddress(hshlwapi, "SHRegCreateUSKeyW"); + pSHRegOpenUSKeyW = (void*)GetProcAddress(hshlwapi, "SHRegOpenUSKeyW"); + pSHRegCloseUSKey = (void*)GetProcAddress(hshlwapi, "SHRegCloseUSKey"); test_SHGetValue(); test_SHRegGetValue(); @@ -484,6 +517,7 @@ test_SHCopyKey(); test_SHDeleteKey(); test_SHRegCreateUSKeyW(); + test_SHRegCloseUSKey(); delete_key( hkey, "Software\\Wine", "Test" ); } diff -Nru wine1.7-1.7.50/dlls/strmbase/audio.c wine1.7-1.7.55/dlls/strmbase/audio.c --- wine1.7-1.7.50/dlls/strmbase/audio.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/strmbase/audio.c 2015-11-13 14:32:40.000000000 +0000 @@ -70,8 +70,8 @@ HRESULT WINAPI BasicAudioImpl_Invoke(IBasicAudio *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, UINT *puArgErr) { BasicAudio *This = impl_from_IBasicAudio(iface); - HRESULT hr = S_OK; ITypeInfo *pTypeInfo; + HRESULT hr; hr = BaseDispatchImpl_GetTypeInfo(&This->baseDispatch, riid, 1, lcid, &pTypeInfo); if (SUCCEEDED(hr)) diff -Nru wine1.7-1.7.50/dlls/strmbase/dispatch.c wine1.7-1.7.55/dlls/strmbase/dispatch.c --- wine1.7-1.7.50/dlls/strmbase/dispatch.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/strmbase/dispatch.c 2015-11-13 14:32:40.000000000 +0000 @@ -29,16 +29,14 @@ HRESULT WINAPI BaseDispatch_Init(BaseDispatch *This, REFIID riid) { - HRESULT hr = E_FAIL; ITypeLib *pTypeLib; + HRESULT hr; This->pTypeInfo = NULL; hr = LoadRegTypeLib(&LIBID_QuartzTypeLib, 1, 0, LOCALE_SYSTEM_DEFAULT, &pTypeLib); if (SUCCEEDED(hr)) { hr = ITypeLib_GetTypeInfoOfGuid(pTypeLib, riid, &This->pTypeInfo); - - if (pTypeLib) ITypeLib_Release(pTypeLib); } return hr; diff -Nru wine1.7-1.7.50/dlls/strmbase/filter.c wine1.7-1.7.55/dlls/strmbase/filter.c --- wine1.7-1.7.50/dlls/strmbase/filter.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/strmbase/filter.c 2015-11-13 14:32:40.000000000 +0000 @@ -158,7 +158,6 @@ HRESULT WINAPI BaseFilterImpl_JoinFilterGraph(IBaseFilter * iface, IFilterGraph *pGraph, LPCWSTR pName ) { - HRESULT hr = S_OK; BaseFilter *This = impl_from_IBaseFilter(iface); TRACE("(%p)->(%p, %s)\n", This, pGraph, debugstr_w(pName)); @@ -173,7 +172,7 @@ } LeaveCriticalSection(&This->csFilter); - return hr; + return S_OK; } HRESULT WINAPI BaseFilterImpl_QueryVendorInfo(IBaseFilter * iface, LPWSTR *pVendorInfo) diff -Nru wine1.7-1.7.50/dlls/strmbase/outputqueue.c wine1.7-1.7.55/dlls/strmbase/outputqueue.c --- wine1.7-1.7.50/dlls/strmbase/outputqueue.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/strmbase/outputqueue.c 2015-11-13 14:32:40.000000000 +0000 @@ -68,7 +68,6 @@ OutputQueue **ppOutputQueue ) { - HRESULT hr = S_OK; BOOL threaded = FALSE; DWORD tid; @@ -101,7 +100,7 @@ EnterCriticalSection(&This->csQueue); if (bAuto && pInputPin->pMemInputPin) - threaded = IMemInputPin_ReceiveCanBlock(pInputPin->pMemInputPin); + threaded = IMemInputPin_ReceiveCanBlock(pInputPin->pMemInputPin) == S_OK; else threaded = bQueue; @@ -116,7 +115,7 @@ } LeaveCriticalSection(&This->csQueue); - return hr; + return S_OK; } HRESULT WINAPI OutputQueue_Destroy(OutputQueue *pOutputQueue) diff -Nru wine1.7-1.7.50/dlls/strmbase/pin.c wine1.7-1.7.55/dlls/strmbase/pin.c --- wine1.7-1.7.50/dlls/strmbase/pin.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/strmbase/pin.c 2015-11-13 14:32:40.000000000 +0000 @@ -575,9 +575,9 @@ /* replaces OutputPin_SendSample */ HRESULT WINAPI BaseOutputPinImpl_Deliver(BaseOutputPin *This, IMediaSample * pSample) { - HRESULT hr = S_OK; IMemInputPin * pMemConnected = NULL; PIN_INFO pinInfo; + HRESULT hr; EnterCriticalSection(This->pin.pCritSec); { @@ -615,7 +615,7 @@ /* replaces OutputPin_CommitAllocator */ HRESULT WINAPI BaseOutputPinImpl_Active(BaseOutputPin *This) { - HRESULT hr = S_OK; + HRESULT hr; TRACE("(%p)->()\n", This); @@ -635,7 +635,7 @@ /* replaces OutputPin_DecommitAllocator */ HRESULT WINAPI BaseOutputPinImpl_Inactive(BaseOutputPin *This) { - HRESULT hr = S_OK; + HRESULT hr; TRACE("(%p)->()\n", This); @@ -875,12 +875,9 @@ TRACE("(%p)->() Release from %d\n", iface, refCount + 1); if (!refCount) - { BaseInputPin_Destroy(This); - return 0; - } - else - return refCount; + + return refCount; } HRESULT WINAPI BaseInputPinImpl_Connect(IPin * iface, IPin * pConnector, const AM_MEDIA_TYPE * pmt) diff -Nru wine1.7-1.7.50/dlls/strmbase/qualitycontrol.c wine1.7-1.7.55/dlls/strmbase/qualitycontrol.c --- wine1.7-1.7.50/dlls/strmbase/qualitycontrol.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/strmbase/qualitycontrol.c 2015-11-13 14:32:40.000000000 +0000 @@ -49,9 +49,9 @@ return S_OK; } -HRESULT QualityControlImpl_Destroy(QualityControlImpl *This) +void QualityControlImpl_Destroy(QualityControlImpl *This) { - return HeapFree(GetProcessHeap(),0,This); + HeapFree(GetProcessHeap(),0,This); } HRESULT WINAPI QualityControlImpl_QueryInterface(IQualityControl *iface, REFIID riid, void **ppv) { diff -Nru wine1.7-1.7.50/dlls/strmbase/renderer.c wine1.7-1.7.55/dlls/strmbase/renderer.c --- wine1.7-1.7.50/dlls/strmbase/renderer.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/strmbase/renderer.c 2015-11-13 14:32:40.000000000 +0000 @@ -60,7 +60,7 @@ { BaseInputPin *This = impl_BaseInputPin_from_IPin(iface); BaseRenderer *renderer = impl_from_IBaseFilter(This->pin.pinInfo.pFilter); - HRESULT hr = S_OK; + HRESULT hr; TRACE("(%p/%p)->(%p, %p)\n", This, renderer, pReceivePin, pmt); @@ -99,7 +99,7 @@ static HRESULT WINAPI BaseRenderer_InputPin_EndOfStream(IPin * iface) { - HRESULT hr = S_OK; + HRESULT hr; BaseInputPin* This = impl_BaseInputPin_from_IPin(iface); BaseRenderer *pFilter = impl_from_IBaseFilter(This->pin.pinInfo.pFilter); @@ -126,7 +126,7 @@ { BaseInputPin* This = impl_BaseInputPin_from_IPin(iface); BaseRenderer *pFilter = impl_from_IBaseFilter(This->pin.pinInfo.pFilter); - HRESULT hr = S_OK; + HRESULT hr; TRACE("(%p/%p)->()\n", This, iface); @@ -151,7 +151,7 @@ { BaseInputPin* This = impl_BaseInputPin_from_IPin(iface); BaseRenderer *pFilter = impl_from_IBaseFilter(This->pin.pinInfo.pFilter); - HRESULT hr = S_OK; + HRESULT hr; TRACE("(%p/%p)->()\n", This, pFilter); diff -Nru wine1.7-1.7.50/dlls/strmbase/strmbase_private.h wine1.7-1.7.55/dlls/strmbase/strmbase_private.h --- wine1.7-1.7.50/dlls/strmbase/strmbase_private.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/strmbase/strmbase_private.h 2015-11-13 14:32:40.000000000 +0000 @@ -35,7 +35,7 @@ } QualityControlImpl; HRESULT QualityControlImpl_Create(IPin *input, IBaseFilter *self, QualityControlImpl **ppv); -HRESULT QualityControlImpl_Destroy(QualityControlImpl *This); +void QualityControlImpl_Destroy(QualityControlImpl *This); HRESULT WINAPI QualityControlImpl_QueryInterface(IQualityControl *iface, REFIID riid, void **ppv); ULONG WINAPI QualityControlImpl_AddRef(IQualityControl *iface); ULONG WINAPI QualityControlImpl_Release(IQualityControl *iface); diff -Nru wine1.7-1.7.50/dlls/strmbase/transform.c wine1.7-1.7.55/dlls/strmbase/transform.c --- wine1.7-1.7.50/dlls/strmbase/transform.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/strmbase/transform.c 2015-11-13 14:32:40.000000000 +0000 @@ -93,7 +93,7 @@ static HRESULT WINAPI TransformFilter_Input_Receive(BaseInputPin *This, IMediaSample *pInSample) { - HRESULT hr = S_FALSE; + HRESULT hr; TransformFilter * pTransform; TRACE("%p\n", This); pTransform = impl_from_IBaseFilter(This->pin.pinInfo.pFilter); diff -Nru wine1.7-1.7.50/dlls/strmbase/video.c wine1.7-1.7.55/dlls/strmbase/video.c --- wine1.7-1.7.50/dlls/strmbase/video.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/strmbase/video.c 2015-11-13 14:32:40.000000000 +0000 @@ -77,8 +77,8 @@ HRESULT WINAPI BaseControlVideoImpl_Invoke(IBasicVideo *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, UINT *puArgErr) { BaseControlVideo *This = impl_from_IBasicVideo(iface); - HRESULT hr = S_OK; ITypeInfo *pTypeInfo; + HRESULT hr; hr = BaseDispatchImpl_GetTypeInfo(&This->baseDispatch, riid, 1, lcid, &pTypeInfo); if (SUCCEEDED(hr)) diff -Nru wine1.7-1.7.50/dlls/strmbase/window.c wine1.7-1.7.55/dlls/strmbase/window.c --- wine1.7-1.7.50/dlls/strmbase/window.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/strmbase/window.c 2015-11-13 14:32:40.000000000 +0000 @@ -250,8 +250,8 @@ HRESULT WINAPI BaseControlWindowImpl_Invoke(IVideoWindow *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExepInfo, UINT *puArgErr) { BaseControlWindow* This = impl_from_IVideoWindow(iface); - HRESULT hr = S_OK; ITypeInfo *pTypeInfo; + HRESULT hr; hr = BaseDispatchImpl_GetTypeInfo(&This->baseDispatch, riid, 1, lcid, &pTypeInfo); if (SUCCEEDED(hr)) diff -Nru wine1.7-1.7.50/dlls/taskschd/task.c wine1.7-1.7.55/dlls/taskschd/task.c --- wine1.7-1.7.50/dlls/taskschd/task.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/taskschd/task.c 2015-11-13 14:32:40.000000000 +0000 @@ -2611,8 +2611,8 @@ hr = RpcStringBindingComposeW(NULL, ncalrpc, NULL, NULL, NULL, &binding_str); if (hr != RPC_S_OK) return hr; hr = RpcBindingFromStringBindingW(binding_str, &rpc_handle); - if (hr != RPC_S_OK) return hr; RpcStringFreeW(&binding_str); + if (hr != RPC_S_OK) return hr; /* Make sure that the connection works */ hr = SchRpcHighestVersion(&task_svc->version); diff -Nru wine1.7-1.7.50/dlls/taskschd/tests/scheduler.c wine1.7-1.7.55/dlls/taskschd/tests/scheduler.c --- wine1.7-1.7.50/dlls/taskschd/tests/scheduler.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/taskschd/tests/scheduler.c 2015-11-13 14:32:40.000000000 +0000 @@ -782,6 +782,7 @@ { hr = ITaskFolder_DeleteTask(root, Wine_Task1, 0); ok(hr == S_OK, "DeleteTask error %#x\n", hr); + IRegisteredTask_Release(task1); } } @@ -809,8 +810,10 @@ for (i = 0; i < sizeof(open_existing_task)/sizeof(open_existing_task[0]); i++) { - hr = ITaskFolder_RegisterTask(root, Wine_Task1, xmlW, open_existing_task[i].flags, v_null, v_null, TASK_LOGON_NONE, v_null, &task1); + hr = ITaskFolder_RegisterTask(root, Wine_Task1, xmlW, open_existing_task[i].flags, v_null, v_null, TASK_LOGON_NONE, v_null, &task2); ok(hr == open_existing_task[i].hr, "%d: expected %#x, got %#x\n", i, open_existing_task[i].hr, hr); + if (hr == S_OK) + IRegisteredTask_Release(task2); } hr = IRegisteredTask_get_Name(task1, NULL); @@ -944,6 +947,7 @@ ok(hr == S_OK, "get_Name error %#x\n", hr); hr = IIDFromString(bstr, &iid); ok(hr == S_OK, "IIDFromString error %#x\n", hr); + SysFreeString(bstr); IRegisteredTask_Release(task1); @@ -1006,7 +1010,10 @@ if (!def->restart_interval[0]) ok(bstr == NULL, "expected NULL, got %s\n", wine_dbgstr_w(bstr)); else + { ok(!lstrcmpW(bstr, def->restart_interval), "expected %s, got %s\n", wine_dbgstr_w(def->restart_interval), wine_dbgstr_w(bstr)); + SysFreeString(bstr); + } hr = ITaskSettings_get_RestartCount(set, &vint); ok(hr == S_OK, "expected S_OK, got %#x\n", hr); @@ -1052,7 +1059,10 @@ if (!test->delete_expired_task_after[0]) ok(bstr == NULL, "expected NULL, got %s\n", wine_dbgstr_w(bstr)); else + { ok(!lstrcmpW(bstr, test->delete_expired_task_after), "expected %s, got %s\n", wine_dbgstr_w(test->delete_expired_task_after), wine_dbgstr_w(bstr)); + SysFreeString(bstr); + } hr = ITaskSettings_get_Priority(set, &vint); ok(hr == S_OK, "expected S_OK, got %#x\n", hr); @@ -1094,7 +1104,11 @@ todo_wine ok(hr == S_OK, "expected S_OK, got %#x\n", hr); /* FIXME: Remove once implemented */ - if (hr != S_OK) return; + if (hr != S_OK) + { + ITaskSettings_Release(set); + return; + } hr = ITaskSettings_put_RestartCount(set, test->restart_count); ok(hr == S_OK, "expected S_OK, got %#x\n", hr); diff -Nru wine1.7-1.7.50/dlls/ucrtbase/Makefile.in wine1.7-1.7.55/dlls/ucrtbase/Makefile.in --- wine1.7-1.7.50/dlls/ucrtbase/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/ucrtbase/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,33 @@ +EXTRADEFS = -D_MT -D_MSVCR_VER=140 +MODULE = ucrtbase.dll +DELAYIMPORTS = advapi32 user32 +PARENTSRC = ../msvcrt + +C_SRCS = \ + console.c \ + cpp.c \ + ctype.c \ + data.c \ + dir.c \ + environ.c \ + errno.c \ + except.c \ + except_arm.c \ + except_i386.c \ + except_x86_64.c \ + exit.c \ + file.c \ + heap.c \ + locale.c \ + lock.c \ + main.c \ + math.c \ + mbcs.c \ + misc.c \ + process.c \ + scanf.c \ + string.c \ + thread.c \ + time.c \ + undname.c \ + wcs.c diff -Nru wine1.7-1.7.50/dlls/ucrtbase/tests/Makefile.in wine1.7-1.7.55/dlls/ucrtbase/tests/Makefile.in --- wine1.7-1.7.50/dlls/ucrtbase/tests/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/ucrtbase/tests/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,6 @@ +TESTDLL = ucrtbase.dll +APPMODE = -mno-cygwin + +C_SRCS = \ + printf.c \ + string.c diff -Nru wine1.7-1.7.50/dlls/ucrtbase/tests/printf.c wine1.7-1.7.55/dlls/ucrtbase/tests/printf.c --- wine1.7-1.7.50/dlls/ucrtbase/tests/printf.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/ucrtbase/tests/printf.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,464 @@ +/* + * Conformance tests for *printf functions. + * + * Copyright 2002 Uwe Bonnes + * Copyright 2004 Aneurin Price + * Copyright 2005 Mike McCormack + * Copyright 2015 Martin Storsjo + * + * 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 "windef.h" +#include "winbase.h" +#include "winnls.h" + +#include "wine/test.h" + +#define UCRTBASE_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION (0x0001) +#define UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR (0x0002) +#define UCRTBASE_PRINTF_LEGACY_WIDE_SPECIFIERS (0x0004) +#define UCRTBASE_PRINTF_LEGACY_MSVCRT_COMPATIBILITY (0x0008) +#define UCRTBASE_PRINTF_LEGACY_THREE_DIGIT_EXPONENTS (0x0010) + +static inline float __port_infinity(void) +{ + static const unsigned __inf_bytes = 0x7f800000; + return *(const float *)&__inf_bytes; +} +#define INFINITY __port_infinity() + +static inline float __port_nan(void) +{ + static const unsigned __nan_bytes = 0x7fc00000; + return *(const float *)&__nan_bytes; +} +#define NAN __port_nan() + +static inline float __port_ind(void) +{ + static const unsigned __ind_bytes = 0xffc00000; + return *(const float *)&__ind_bytes; +} +#define IND __port_ind() + +static int (__cdecl *p_vfprintf)(unsigned __int64 options, FILE *file, const char *format, + void *locale, __ms_va_list valist); +static int (__cdecl *p_vsprintf)(unsigned __int64 options, char *str, size_t len, const char *format, + void *locale, __ms_va_list valist); +static int (__cdecl *p_vsnprintf_s)(unsigned __int64 options, char *str, size_t sizeOfBuffer, size_t count, const char *format, + void *locale, __ms_va_list valist); +static int (__cdecl *p_vsprintf_s)(unsigned __int64 options, char *str, size_t count, const char *format, + void *locale, __ms_va_list valist); +static int (__cdecl *p_vswprintf)(unsigned __int64 options, wchar_t *str, size_t len, const wchar_t *format, + void *locale, __ms_va_list valist); + +static FILE *(__cdecl *p_fopen)(const char *name, const char *mode); +static int (__cdecl *p_fclose)(FILE *file); +static long (__cdecl *p_ftell)(FILE *file); +static char *(__cdecl *p_fgets)(char *str, int size, FILE *file); + +static BOOL init( void ) +{ + HMODULE hmod = LoadLibraryA("ucrtbase.dll"); + + if (!hmod) + { + win_skip("ucrtbase.dll not installed\n"); + return FALSE; + } + + p_vfprintf = (void *)GetProcAddress(hmod, "__stdio_common_vfprintf"); + p_vsprintf = (void *)GetProcAddress(hmod, "__stdio_common_vsprintf"); + p_vsnprintf_s = (void *)GetProcAddress(hmod, "__stdio_common_vsnprintf_s"); + p_vsprintf_s = (void *)GetProcAddress(hmod, "__stdio_common_vsprintf_s"); + p_vswprintf = (void *)GetProcAddress(hmod, "__stdio_common_vswprintf"); + + p_fopen = (void *)GetProcAddress(hmod, "fopen"); + p_fclose = (void *)GetProcAddress(hmod, "fclose"); + p_ftell = (void *)GetProcAddress(hmod, "ftell"); + p_fgets = (void *)GetProcAddress(hmod, "fgets"); + return TRUE; +} + +static int __cdecl vsprintf_wrapper(unsigned __int64 options, char *str, + size_t len, const char *format, ...) +{ + int ret; + __ms_va_list valist; + __ms_va_start(valist, format); + ret = p_vsprintf(options, str, len, format, NULL, valist); + __ms_va_end(valist); + return ret; +} + +static void test_snprintf (void) +{ + const char *tests[] = {"short", "justfit", "justfits", "muchlonger"}; + char buffer[8]; + const int bufsiz = sizeof buffer; + unsigned int i; + + /* Legacy _snprintf style termination */ + for (i = 0; i < sizeof tests / sizeof tests[0]; i++) { + const char *fmt = tests[i]; + const int expect = strlen(fmt) > bufsiz ? -1 : strlen(fmt); + const int n = vsprintf_wrapper (UCRTBASE_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION, buffer, bufsiz, fmt); + const int valid = n < 0 ? bufsiz : (n == bufsiz ? n : n+1); + + ok (n == expect, "\"%s\": expected %d, returned %d\n", + fmt, expect, n); + ok (!memcmp (fmt, buffer, valid), + "\"%s\": rendered \"%.*s\"\n", fmt, valid, buffer); + } + + /* C99 snprintf style termination */ + for (i = 0; i < sizeof tests / sizeof tests[0]; i++) { + const char *fmt = tests[i]; + const int expect = strlen(fmt); + const int n = vsprintf_wrapper (UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR, buffer, bufsiz, fmt); + const int valid = n >= bufsiz ? bufsiz - 1 : n < 0 ? 0 : n; + + ok (n == expect, "\"%s\": expected %d, returned %d\n", + fmt, expect, n); + ok (!memcmp (fmt, buffer, valid), + "\"%s\": rendered \"%.*s\"\n", fmt, valid, buffer); + ok (buffer[valid] == '\0', + "\"%s\": Missing null termination (ret %d) - is %d\n", fmt, n, buffer[valid]); + } + + /* swprintf style termination */ + for (i = 0; i < sizeof tests / sizeof tests[0]; i++) { + const char *fmt = tests[i]; + const int expect = strlen(fmt) >= bufsiz ? -2 : strlen(fmt); + const int n = vsprintf_wrapper (0, buffer, bufsiz, fmt); + const int valid = n < 0 ? bufsiz - 1 : n; + + ok (n == expect, "\"%s\": expected %d, returned %d\n", + fmt, expect, n); + ok (!memcmp (fmt, buffer, valid), + "\"%s\": rendered \"%.*s\"\n", fmt, valid, buffer); + ok (buffer[valid] == '\0', + "\"%s\": Missing null termination (ret %d) - is %d\n", fmt, n, buffer[valid]); + } + + ok (vsprintf_wrapper (UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR, NULL, 0, "abcd") == 4, + "Failure to snprintf to NULL\n"); +} + +static int __cdecl vswprintf_wrapper(unsigned __int64 options, wchar_t *str, + size_t len, const wchar_t *format, ...) +{ + int ret; + __ms_va_list valist; + __ms_va_start(valist, format); + ret = p_vswprintf(options, str, len, format, NULL, valist); + __ms_va_end(valist); + return ret; +} + +static void test_swprintf (void) +{ + const wchar_t str_short[] = {'s','h','o','r','t',0}; + const wchar_t str_justfit[] = {'j','u','s','t','f','i','t',0}; + const wchar_t str_justfits[] = {'j','u','s','t','f','i','t','s',0}; + const wchar_t str_muchlonger[] = {'m','u','c','h','l','o','n','g','e','r',0}; + const wchar_t *tests[] = {str_short, str_justfit, str_justfits, str_muchlonger}; + + wchar_t buffer[8]; + char narrow[8], narrow_fmt[16]; + const int bufsiz = sizeof buffer / sizeof buffer[0]; + unsigned int i; + + /* Legacy _snprintf style termination */ + for (i = 0; i < sizeof tests / sizeof tests[0]; i++) { + const wchar_t *fmt = tests[i]; + const int expect = wcslen(fmt) > bufsiz ? -1 : wcslen(fmt); + const int n = vswprintf_wrapper (UCRTBASE_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION, buffer, bufsiz, fmt); + const int valid = n < 0 ? bufsiz : (n == bufsiz ? n : n+1); + + WideCharToMultiByte (CP_ACP, 0, buffer, -1, narrow, sizeof(narrow), NULL, NULL); + WideCharToMultiByte (CP_ACP, 0, fmt, -1, narrow_fmt, sizeof(narrow_fmt), NULL, NULL); + ok (n == expect, "\"%s\": expected %d, returned %d\n", + narrow_fmt, expect, n); + ok (!memcmp (fmt, buffer, valid * sizeof(wchar_t)), + "\"%s\": rendered \"%.*s\"\n", narrow_fmt, valid, narrow); + } + + /* C99 snprintf style termination */ + for (i = 0; i < sizeof tests / sizeof tests[0]; i++) { + const wchar_t *fmt = tests[i]; + const int expect = wcslen(fmt); + const int n = vswprintf_wrapper (UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR, buffer, bufsiz, fmt); + const int valid = n >= bufsiz ? bufsiz - 1 : n < 0 ? 0 : n; + + WideCharToMultiByte (CP_ACP, 0, buffer, -1, narrow, sizeof(narrow), NULL, NULL); + WideCharToMultiByte (CP_ACP, 0, fmt, -1, narrow_fmt, sizeof(narrow_fmt), NULL, NULL); + ok (n == expect, "\"%s\": expected %d, returned %d\n", + narrow_fmt, expect, n); + ok (!memcmp (fmt, buffer, valid * sizeof(wchar_t)), + "\"%s\": rendered \"%.*s\"\n", narrow_fmt, valid, narrow); + ok (buffer[valid] == '\0', + "\"%s\": Missing null termination (ret %d) - is %d\n", narrow_fmt, n, buffer[valid]); + } + + /* swprintf style termination */ + for (i = 0; i < sizeof tests / sizeof tests[0]; i++) { + const wchar_t *fmt = tests[i]; + const int expect = wcslen(fmt) >= bufsiz ? -2 : wcslen(fmt); + const int n = vswprintf_wrapper (0, buffer, bufsiz, fmt); + const int valid = n < 0 ? bufsiz - 1 : n; + + WideCharToMultiByte (CP_ACP, 0, buffer, -1, narrow, sizeof(narrow), NULL, NULL); + WideCharToMultiByte (CP_ACP, 0, fmt, -1, narrow_fmt, sizeof(narrow_fmt), NULL, NULL); + ok (n == expect, "\"%s\": expected %d, returned %d\n", + narrow_fmt, expect, n); + ok (!memcmp (fmt, buffer, valid * sizeof(wchar_t)), + "\"%s\": rendered \"%.*s\"\n", narrow_fmt, valid, narrow); + ok (buffer[valid] == '\0', + "\"%s\": Missing null termination (ret %d) - is %d\n", narrow_fmt, n, buffer[valid]); + } +} + +static int __cdecl vfprintf_wrapper(FILE *file, + const char *format, ...) +{ + int ret; + __ms_va_list valist; + __ms_va_start(valist, format); + ret = p_vfprintf(0, file, format, NULL, valist); + __ms_va_end(valist); + return ret; +} + +static void test_fprintf(void) +{ + static const char file_name[] = "fprintf.tst"; + + FILE *fp = p_fopen(file_name, "wb"); + char buf[1024]; + int ret; + + ret = vfprintf_wrapper(fp, "simple test\n"); + ok(ret == 12, "ret = %d\n", ret); + ret = p_ftell(fp); + ok(ret == 12, "ftell returned %d\n", ret); + + ret = vfprintf_wrapper(fp, "contains%cnull\n", '\0'); + ok(ret == 14, "ret = %d\n", ret); + ret = p_ftell(fp); + ok(ret == 26, "ftell returned %d\n", ret); + + p_fclose(fp); + + fp = p_fopen(file_name, "rb"); + p_fgets(buf, sizeof(buf), fp); + ret = p_ftell(fp); + ok(ret == 12, "ftell returned %d\n", ret); + ok(!strcmp(buf, "simple test\n"), "buf = %s\n", buf); + + p_fgets(buf, sizeof(buf), fp); + ret = p_ftell(fp); + ok(ret == 26, "ret = %d\n", ret); + ok(!memcmp(buf, "contains\0null\n", 14), "buf = %s\n", buf); + + p_fclose(fp); + + fp = p_fopen(file_name, "wt"); + + ret = vfprintf_wrapper(fp, "simple test\n"); + ok(ret == 12, "ret = %d\n", ret); + ret = p_ftell(fp); + ok(ret == 13, "ftell returned %d\n", ret); + + ret = vfprintf_wrapper(fp, "contains%cnull\n", '\0'); + ok(ret == 14, "ret = %d\n", ret); + ret = p_ftell(fp); + ok(ret == 28, "ftell returned %d\n", ret); + + p_fclose(fp); + + fp = p_fopen(file_name, "rb"); + p_fgets(buf, sizeof(buf), fp); + ret = p_ftell(fp); + ok(ret == 13, "ftell returned %d\n", ret); + ok(!strcmp(buf, "simple test\r\n"), "buf = %s\n", buf); + + p_fgets(buf, sizeof(buf), fp); + ret = p_ftell(fp); + ok(ret == 28, "ret = %d\n", ret); + ok(!memcmp(buf, "contains\0null\r\n", 15), "buf = %s\n", buf); + + p_fclose(fp); + unlink(file_name); +} + +static int __cdecl _vsnprintf_s_wrapper(char *str, size_t sizeOfBuffer, + size_t count, const char *format, ...) +{ + int ret; + __ms_va_list valist; + __ms_va_start(valist, format); + ret = p_vsnprintf_s(0, str, sizeOfBuffer, count, format, NULL, valist); + __ms_va_end(valist); + return ret; +} + +static void test_vsnprintf_s(void) +{ + const char format[] = "AB%uC"; + const char out7[] = "AB123C"; + const char out6[] = "AB123"; + const char out2[] = "A"; + const char out1[] = ""; + char buffer[14] = { 0 }; + int exp, got; + + /* Enough room. */ + exp = strlen(out7); + + got = _vsnprintf_s_wrapper(buffer, 14, _TRUNCATE, format, 123); + ok( exp == got, "length wrong, expect=%d, got=%d\n", exp, got); + ok( !strcmp(out7, buffer), "buffer wrong, got=%s\n", buffer); + + got = _vsnprintf_s_wrapper(buffer, 12, _TRUNCATE, format, 123); + ok( exp == got, "length wrong, expect=%d, got=%d\n", exp, got); + ok( !strcmp(out7, buffer), "buffer wrong, got=%s\n", buffer); + + got = _vsnprintf_s_wrapper(buffer, 7, _TRUNCATE, format, 123); + ok( exp == got, "length wrong, expect=%d, got=%d\n", exp, got); + ok( !strcmp(out7, buffer), "buffer wrong, got=%s\n", buffer); + + /* Not enough room. */ + exp = -1; + + got = _vsnprintf_s_wrapper(buffer, 6, _TRUNCATE, format, 123); + ok( exp == got, "length wrong, expect=%d, got=%d\n", exp, got); + ok( !strcmp(out6, buffer), "buffer wrong, got=%s\n", buffer); + + got = _vsnprintf_s_wrapper(buffer, 2, _TRUNCATE, format, 123); + ok( exp == got, "length wrong, expect=%d, got=%d\n", exp, got); + ok( !strcmp(out2, buffer), "buffer wrong, got=%s\n", buffer); + + got = _vsnprintf_s_wrapper(buffer, 1, _TRUNCATE, format, 123); + ok( exp == got, "length wrong, expect=%d, got=%d\n", exp, got); + ok( !strcmp(out1, buffer), "buffer wrong, got=%s\n", buffer); +} + +static void test_printf_legacy_wide(void) +{ + const wchar_t wide[] = {'A','B','C','D',0}; + const char narrow[] = "abcd"; + const char out[] = "abcd ABCD"; + /* The legacy wide flag doesn't affect narrow printfs, so the same + * format should behave the same both with and without the flag. */ + const char narrow_fmt[] = "%s %ls"; + /* The standard behaviour is to use the same format as for the narrow + * case, while the legacy case has got a different meaning for %s. */ + const wchar_t std_wide_fmt[] = {'%','s',' ','%','l','s',0}; + const wchar_t legacy_wide_fmt[] = {'%','h','s',' ','%','s',0}; + char buffer[20]; + wchar_t wbuffer[20]; + + vsprintf_wrapper(0, buffer, sizeof(buffer), narrow_fmt, narrow, wide); + ok(!strcmp(buffer, out), "buffer wrong, got=%s\n", buffer); + vsprintf_wrapper(UCRTBASE_PRINTF_LEGACY_WIDE_SPECIFIERS, buffer, sizeof(buffer), narrow_fmt, narrow, wide); + ok(!strcmp(buffer, out), "buffer wrong, got=%s\n", buffer); + + vswprintf_wrapper(0, wbuffer, sizeof(wbuffer), std_wide_fmt, narrow, wide); + WideCharToMultiByte(CP_ACP, 0, wbuffer, -1, buffer, sizeof(buffer), NULL, NULL); + ok(!strcmp(buffer, out), "buffer wrong, got=%s\n", buffer); + vswprintf_wrapper(UCRTBASE_PRINTF_LEGACY_WIDE_SPECIFIERS, wbuffer, sizeof(wbuffer), legacy_wide_fmt, narrow, wide); + WideCharToMultiByte(CP_ACP, 0, wbuffer, -1, buffer, sizeof(buffer), NULL, NULL); + ok(!strcmp(buffer, out), "buffer wrong, got=%s\n", buffer); +} + +static void test_printf_legacy_msvcrt(void) +{ + char buf[50]; + + /* In standard mode, %F is a float format conversion, while it is a + * length modifier in legacy msvcrt mode. In legacy mode, N is also + * a length modifier. */ + vsprintf_wrapper(0, buf, sizeof(buf), "%F", 1.23); + ok(!strcmp(buf, "1.230000"), "buf = %s\n", buf); + vsprintf_wrapper(UCRTBASE_PRINTF_LEGACY_MSVCRT_COMPATIBILITY, buf, sizeof(buf), "%Fd %Nd", 123, 456); + ok(!strcmp(buf, "123 456"), "buf = %s\n", buf); + + vsprintf_wrapper(0, buf, sizeof(buf), "%f %F %f %e %E %g %G", INFINITY, INFINITY, -INFINITY, INFINITY, INFINITY, INFINITY, INFINITY); + ok(!strcmp(buf, "inf INF -inf inf INF inf INF"), "buf = %s\n", buf); + vsprintf_wrapper(UCRTBASE_PRINTF_LEGACY_MSVCRT_COMPATIBILITY, buf, sizeof(buf), "%f", INFINITY); + ok(!strcmp(buf, "1.#INF00"), "buf = %s\n", buf); + vsprintf_wrapper(0, buf, sizeof(buf), "%f %F", NAN, NAN); + ok(!strcmp(buf, "nan NAN"), "buf = %s\n", buf); + vsprintf_wrapper(UCRTBASE_PRINTF_LEGACY_MSVCRT_COMPATIBILITY, buf, sizeof(buf), "%f", NAN); + ok(!strcmp(buf, "1.#QNAN0"), "buf = %s\n", buf); + vsprintf_wrapper(0, buf, sizeof(buf), "%f %F", IND, IND); + ok(!strcmp(buf, "-nan(ind) -NAN(IND)"), "buf = %s\n", buf); + vsprintf_wrapper(UCRTBASE_PRINTF_LEGACY_MSVCRT_COMPATIBILITY, buf, sizeof(buf), "%f", IND); + ok(!strcmp(buf, "-1.#IND00"), "buf = %s\n", buf); +} + +static void test_printf_legacy_three_digit_exp(void) +{ + char buf[20]; + + vsprintf_wrapper(0, buf, sizeof(buf), "%E", 1.23); + ok(!strcmp(buf, "1.230000E+00"), "buf = %s\n", buf); + vsprintf_wrapper(UCRTBASE_PRINTF_LEGACY_THREE_DIGIT_EXPONENTS, buf, sizeof(buf), "%E", 1.23); + ok(!strcmp(buf, "1.230000E+000"), "buf = %s\n", buf); + vsprintf_wrapper(0, buf, sizeof(buf), "%E", 1.23e+123); + ok(!strcmp(buf, "1.230000E+123"), "buf = %s\n", buf); +} + +static void test_printf_c99(void) +{ + char buf[20]; + + /* The msvcrt compatibility flag doesn't affect whether 'z' is interpreted + * as size_t size for integers. */ + if (sizeof(void*) == 8) { + vsprintf_wrapper(0, buf, sizeof(buf), "%zx %d", + (size_t) 0x12345678123456, 1); + ok(!strcmp(buf, "12345678123456 1"), "buf = %s\n", buf); + vsprintf_wrapper(UCRTBASE_PRINTF_LEGACY_MSVCRT_COMPATIBILITY, + buf, sizeof(buf), "%zx %d", (size_t) 0x12345678123456, 1); + ok(!strcmp(buf, "12345678123456 1"), "buf = %s\n", buf); + } else { + vsprintf_wrapper(0, buf, sizeof(buf), "%zx %d", + (size_t) 0x123456, 1); + ok(!strcmp(buf, "123456 1"), "buf = %s\n", buf); + vsprintf_wrapper(UCRTBASE_PRINTF_LEGACY_MSVCRT_COMPATIBILITY, + buf, sizeof(buf), "%zx %d", (size_t) 0x123456, 1); + ok(!strcmp(buf, "123456 1"), "buf = %s\n", buf); + } +} + +START_TEST(printf) +{ + if (!init()) return; + + test_snprintf(); + test_swprintf(); + test_fprintf(); + test_vsnprintf_s(); + test_printf_legacy_wide(); + test_printf_legacy_msvcrt(); + test_printf_legacy_three_digit_exp(); + test_printf_c99(); +} diff -Nru wine1.7-1.7.50/dlls/ucrtbase/tests/string.c wine1.7-1.7.55/dlls/ucrtbase/tests/string.c --- wine1.7-1.7.50/dlls/ucrtbase/tests/string.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/ucrtbase/tests/string.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,121 @@ +/* + * Copyright 2015 Martin Storsjo + * + * 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 +#include + +#include +#include +#include "wine/test.h" + +#include + +#ifndef INFINITY +static inline float __port_infinity(void) +{ + static const unsigned __inf_bytes = 0x7f800000; + return *(const float *)&__inf_bytes; +} +#define INFINITY __port_infinity() +#endif + +#ifndef NAN +static inline float __port_nan(void) +{ + static const unsigned __nan_bytes = 0x7fc00000; + return *(const float *)&__nan_bytes; +} +#define NAN __port_nan() +#endif + +static double (CDECL *p_strtod)(const char*, char** end); + +static BOOL init(void) +{ + HMODULE module; + + module = LoadLibraryA("ucrtbase.dll"); + if (!module) + { + win_skip("ucrtbase.dll not installed\n"); + return FALSE; + } + + p_strtod = (void*)GetProcAddress(module, "strtod"); + return TRUE; +} + +static BOOL local_isnan(double d) +{ + return d != d; +} + +#define test_strtod_str(string, value, length) _test_strtod_str(__LINE__, string, value, length) +static void _test_strtod_str(int line, const char* string, double value, int length) +{ + char *end; + double d; + d = p_strtod(string, &end); + if (local_isnan(value)) + ok_(__FILE__, line)(local_isnan(d), "d = %lf (\"%s\")\n", d, string); + else + ok_(__FILE__, line)(d == value, "d = %lf (\"%s\")\n", d, string); + ok_(__FILE__, line)(end == string + length, "incorrect end (%d, \"%s\")\n", (int)(end - string), string); +} + +static void test_strtod(void) +{ + test_strtod_str("infinity", INFINITY, 8); + test_strtod_str("INFINITY", INFINITY, 8); + test_strtod_str("InFiNiTy", INFINITY, 8); + test_strtod_str("INF", INFINITY, 3); + test_strtod_str("-inf", -INFINITY, 4); + test_strtod_str("inf42", INFINITY, 3); + test_strtod_str("inffoo", INFINITY, 3); + test_strtod_str("infini", INFINITY, 3); + + test_strtod_str("NAN", NAN, 3); + test_strtod_str("nan", NAN, 3); + test_strtod_str("NaN", NAN, 3); + + test_strtod_str("0x42", 66, 4); + test_strtod_str("0X42", 66, 4); + test_strtod_str("-0x42", -66, 5); + test_strtod_str("0x1p1", 2, 5); + test_strtod_str("0x1P1", 2, 5); + test_strtod_str("0x1p+1", 2, 6); + test_strtod_str("0x2p-1", 1, 6); + test_strtod_str("0xA", 10, 3); + test_strtod_str("0xa", 10, 3); + test_strtod_str("0xABCDEF", 11259375, 8); + test_strtod_str("0Xabcdef", 11259375, 8); + + test_strtod_str("0x1.1", 1.0625, 5); + test_strtod_str("0x1.1p1", 2.125, 7); + test_strtod_str("0x1.A", 1.625, 5); + test_strtod_str("0x1p1a", 2, 5); +} + +START_TEST(string) +{ + if (!init()) return; + test_strtod(); +} diff -Nru wine1.7-1.7.50/dlls/ucrtbase/ucrtbase.spec wine1.7-1.7.55/dlls/ucrtbase/ucrtbase.spec --- wine1.7-1.7.50/dlls/ucrtbase/ucrtbase.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/ucrtbase/ucrtbase.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,2598 @@ +@ cdecl -arch=i386 _CIacos() +@ cdecl -arch=i386 _CIasin() +@ cdecl -arch=i386 _CIatan() +@ cdecl -arch=i386 _CIatan2() +@ cdecl -arch=i386 _CIcos() +@ cdecl -arch=i386 _CIcosh() +@ cdecl -arch=i386 _CIexp() +@ cdecl -arch=i386 _CIfmod() +@ cdecl -arch=i386 _CIlog() +@ cdecl -arch=i386 _CIlog10() +@ cdecl -arch=i386 _CIpow() +@ cdecl -arch=i386 _CIsin() +@ cdecl -arch=i386 _CIsinh() +@ cdecl -arch=i386 _CIsqrt() +@ cdecl -arch=i386 _CItan() +@ cdecl -arch=i386 _CItanh() +@ stub _Cbuild +@ stub _Cmulcc +@ stub _Cmulcr +@ stub _CreateFrameInfo +@ stdcall _CxxThrowException(long long) +@ cdecl -arch=i386 -norelay _EH_prolog() +@ stub _Exit +@ stub _FCbuild +@ stub _FCmulcc +@ stub _FCmulcr +@ stub _FindAndUnlinkFrame +@ stub _GetImageBase +@ stub _GetThrowImageBase +@ cdecl _Getdays() +@ cdecl _Getmonths() +@ cdecl _Gettnames() +@ stub _IsExceptionObjectToBeDestroyed +@ stub _LCbuild +@ stub _LCmulcc +@ stub _LCmulcr +@ stub _SetImageBase +@ stub _SetThrowImageBase +@ stub _NLG_Dispatch2 +@ stub _NLG_Return +@ stub _NLG_Return2 +@ stub _SetWinRTOutOfMemoryExceptionCallback +@ cdecl _Strftime(str long str ptr ptr) +@ cdecl _W_Getdays() +@ cdecl _W_Getmonths() +@ stub _W_Gettnames +@ stub _Wcsftime +@ cdecl __AdjustPointer(ptr ptr) +@ stub __BuildCatchObject +@ stub __BuildCatchObjectHelper +@ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler +@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) +@ cdecl -arch=i386,x86_64,arm __CxxExceptionFilter(ptr ptr long ptr) +@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) +@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler2(ptr ptr ptr ptr) __CxxFrameHandler +@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler3(ptr ptr ptr ptr) __CxxFrameHandler +@ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) +@ cdecl -arch=i386,x86_64,arm __CxxQueryExceptionSize() +@ stub __CxxRegisterExceptionObject +@ stub __CxxUnregisterExceptionObject +@ stub __DestructExceptionObject +@ stub __FrameUnwindFilter +@ stub __GetPlatformExceptionInfo +@ stub __NLG_Dispatch2 +@ stub __NLG_Return2 +@ cdecl __RTCastToVoid(ptr) MSVCRT___RTCastToVoid +@ cdecl __RTDynamicCast(ptr long ptr ptr long) MSVCRT___RTDynamicCast +@ cdecl __RTtypeid(ptr) MSVCRT___RTtypeid +@ stub __TypeMatch +@ cdecl ___lc_codepage_func() +@ cdecl ___lc_collate_cp_func() +@ cdecl ___lc_locale_name_func() +@ cdecl ___mb_cur_max_func() MSVCRT____mb_cur_max_func +@ cdecl ___mb_cur_max_l_func(ptr) +@ cdecl __acrt_iob_func(long) MSVCRT___acrt_iob_func +@ stub __conio_common_vcprintf +@ stub __conio_common_vcprintf_p +@ stub __conio_common_vcprintf_s +@ stub __conio_common_vcscanf +@ stub __conio_common_vcwprintf +@ stub __conio_common_vcwprintf_p +@ stub __conio_common_vcwprintf_s +@ stub __conio_common_vcwscanf +@ cdecl -arch=i386 __control87_2(long long ptr ptr) +@ stub __current_exception +@ stub __current_exception_context +@ cdecl __daylight() MSVCRT___p__daylight +@ stub __dcrt_get_wide_environment_from_os +@ stub __dcrt_initial_narrow_environment +@ cdecl __doserrno() MSVCRT___doserrno +@ cdecl __dstbias() MSVCRT___p__dstbias +@ stub __fpe_flt_rounds +@ cdecl __fpecode() +@ stub __initialize_lconv_for_unsigned_char +@ stub __intrinsic_abnormal_termination +@ stub __intrinsic_setjmp +@ stub __intrinsic_setjmpex +@ cdecl __isascii(long) MSVCRT___isascii +@ cdecl __iscsym(long) MSVCRT___iscsym +@ cdecl __iscsymf(long) MSVCRT___iscsymf +@ stub __iswcsym +@ stub __iswcsymf +@ cdecl -arch=i386 __libm_sse2_acos() +@ cdecl -arch=i386 __libm_sse2_acosf() +@ cdecl -arch=i386 __libm_sse2_asin() +@ cdecl -arch=i386 __libm_sse2_asinf() +@ cdecl -arch=i386 __libm_sse2_atan() +@ cdecl -arch=i386 __libm_sse2_atan2() +@ cdecl -arch=i386 __libm_sse2_atanf() +@ cdecl -arch=i386 __libm_sse2_cos() +@ cdecl -arch=i386 __libm_sse2_cosf() +@ cdecl -arch=i386 __libm_sse2_exp() +@ cdecl -arch=i386 __libm_sse2_expf() +@ cdecl -arch=i386 __libm_sse2_log() +@ cdecl -arch=i386 __libm_sse2_log10() +@ cdecl -arch=i386 __libm_sse2_log10f() +@ cdecl -arch=i386 __libm_sse2_logf() +@ cdecl -arch=i386 __libm_sse2_pow() +@ cdecl -arch=i386 __libm_sse2_powf() +@ cdecl -arch=i386 __libm_sse2_sin() +@ cdecl -arch=i386 __libm_sse2_sinf() +@ cdecl -arch=i386 __libm_sse2_tan() +@ cdecl -arch=i386 __libm_sse2_tanf() +@ cdecl __p___argc() MSVCRT___p___argc +@ cdecl __p___argv() MSVCRT___p___argv +@ cdecl __p___wargv() MSVCRT___p___wargv +@ cdecl __p__acmdln() +@ cdecl __p__commode() +@ cdecl __p__environ() MSVCRT___p__environ +@ cdecl __p__fmode() +@ stub __p__mbcasemap() +@ cdecl __p__mbctype() +@ cdecl __p__pgmptr() MSVCRT___p__pgmptr +@ cdecl __p__wcmdln() +@ cdecl __p__wenviron() MSVCRT___p__wenviron +@ cdecl __p__wpgmptr() MSVCRT___p__wpgmptr +@ cdecl __pctype_func() MSVCRT___pctype_func +@ stub __processing_throw +@ stub __pwctype_func +@ cdecl __pxcptinfoptrs() MSVCRT___pxcptinfoptrs +@ stub __report_gsfailure +@ cdecl __setusermatherr(ptr) MSVCRT___setusermatherr +@ stub __std_exception_copy +@ stub __std_exception_destroy +@ cdecl __std_type_info_compare(ptr ptr) MSVCRT_type_info_compare +@ stub __std_type_info_destroy_list +@ stub __std_type_info_hash +@ stub __std_type_info_name +@ cdecl __stdio_common_vfprintf(int64 ptr ptr ptr ptr) MSVCRT__stdio_common_vfprintf +@ stub __stdio_common_vfprintf_p +@ stub __stdio_common_vfprintf_s +@ stub __stdio_common_vfscanf +@ stub __stdio_common_vfwprintf +@ stub __stdio_common_vfwprintf_p +@ stub __stdio_common_vfwprintf_s +@ stub __stdio_common_vfwscanf +@ cdecl __stdio_common_vsnprintf_s(int64 ptr long long ptr ptr ptr) MSVCRT__stdio_common_vsnprintf_s +@ stub __stdio_common_vsnwprintf_s +@ cdecl __stdio_common_vsprintf(int64 ptr long ptr ptr ptr) MSVCRT__stdio_common_vsprintf +@ stub __stdio_common_vsprintf_p +@ cdecl __stdio_common_vsprintf_s(int64 ptr long ptr ptr ptr) MSVCRT__stdio_common_vsprintf_s +@ cdecl __stdio_common_vsscanf(int64 ptr long ptr ptr ptr) MSVCRT__stdio_common_vsscanf +@ cdecl __stdio_common_vswprintf(int64 ptr long ptr ptr ptr) MSVCRT__stdio_common_vswprintf +@ stub __stdio_common_vswprintf_p +@ stub __stdio_common_vswprintf_s +@ stub __stdio_common_vswscanf +@ stub __strncnt +@ cdecl __sys_errlist() +@ cdecl __sys_nerr() +@ cdecl __threadhandle() kernel32.GetCurrentThread +@ cdecl __threadid() kernel32.GetCurrentThreadId +@ cdecl __timezone() MSVCRT___p__timezone +@ cdecl __toascii(long) MSVCRT___toascii +@ cdecl __tzname() __p__tzname +@ cdecl __unDName(ptr str long ptr ptr long) +@ cdecl __unDNameEx(ptr str long ptr ptr ptr long) +@ cdecl __uncaught_exception() MSVCRT___uncaught_exception +@ cdecl __wcserror(wstr) MSVCRT___wcserror +@ cdecl __wcserror_s(ptr long wstr) MSVCRT___wcserror_s +@ stub __wcsncnt +@ cdecl -ret64 _abs64(int64) +@ cdecl _access(str long) MSVCRT__access +@ cdecl _access_s(str long) MSVCRT__access_s +@ cdecl _aligned_free(ptr) +@ cdecl _aligned_malloc(long long) +@ cdecl _aligned_msize(ptr long long) +@ cdecl _aligned_offset_malloc(long long long) +@ cdecl _aligned_offset_realloc(ptr long long long) +@ stub _aligned_offset_recalloc +@ cdecl _aligned_realloc(ptr long long) +@ stub _aligned_recalloc +@ cdecl _assert(str str long) MSVCRT__assert +@ cdecl _atodbl(ptr str) MSVCRT__atodbl +@ cdecl _atodbl_l(ptr str ptr) MSVCRT__atodbl_l +@ cdecl _atof_l(str ptr) MSVCRT__atof_l +@ cdecl _atoflt(ptr str) MSVCRT__atoflt +@ cdecl _atoflt_l(ptr str ptr) MSVCRT__atoflt_l +@ cdecl -ret64 _atoi64(str) ntdll._atoi64 +@ stub _atoi64_l +@ cdecl _atoi_l(str ptr) MSVCRT__atoi_l +@ stub _atol_l +@ cdecl _atoldbl(ptr str) MSVCRT__atoldbl +@ stub _atoldbl_l +@ stub _atoll_l +@ cdecl _beep(long long) MSVCRT__beep +@ cdecl _beginthread(ptr long ptr) +@ cdecl _beginthreadex(ptr long ptr ptr long ptr) +@ cdecl _byteswap_uint64(int64) +@ cdecl _byteswap_ulong(long) MSVCRT__byteswap_ulong +@ cdecl _byteswap_ushort(long) +@ cdecl _c_exit() MSVCRT__c_exit +@ cdecl _cabs(long) MSVCRT__cabs +@ cdecl _callnewh(long) +@ stub _calloc_base +@ cdecl _cexit() MSVCRT__cexit +@ cdecl _cgets(ptr) +@ stub _cgets_s +@ stub _cgetws +@ stub _cgetws_s +@ cdecl _chdir(str) MSVCRT__chdir +@ cdecl _chdrive(long) MSVCRT__chdrive +@ cdecl _chgsign(double) MSVCRT__chgsign +@ cdecl _chgsignf(float) MSVCRT__chgsignf +@ cdecl -arch=i386 -norelay _chkesp() +@ cdecl _chmod(str long) MSVCRT__chmod +@ cdecl _chsize(long long) MSVCRT__chsize +@ cdecl _chsize_s(long int64) MSVCRT__chsize_s +@ cdecl _clearfp() +@ cdecl _close(long) MSVCRT__close +@ cdecl _commit(long) MSVCRT__commit +@ cdecl _configthreadlocale(long) +@ cdecl _configure_narrow_argv(long) +@ stub _configure_wide_argv +@ cdecl _control87(long long) +@ cdecl _controlfp(long long) +@ cdecl _controlfp_s(ptr long long) +@ cdecl _copysign(double double) MSVCRT__copysign +@ cdecl _copysignf(float float) MSVCRT__copysignf +@ cdecl _cputs(str) +@ cdecl _cputws(wstr) +@ cdecl _creat(str long) MSVCRT__creat +@ cdecl _create_locale(long str) MSVCRT__create_locale +@ stub _crt_at_quick_exit +@ cdecl _crt_atexit(ptr) MSVCRT__crt_atexit +@ stub _crt_debugger_hook +@ cdecl _ctime32(ptr) MSVCRT__ctime32 +@ cdecl _ctime32_s(str long ptr) MSVCRT__ctime32_s +@ cdecl _ctime64(ptr) MSVCRT__ctime64 +@ cdecl _ctime64_s(str long ptr) MSVCRT__ctime64_s +@ cdecl _cwait(ptr long long) +@ stub _d_int +@ cdecl _dclass(double) MSVCR120__dclass +@ stub _dexp +@ cdecl _difftime32(long long) MSVCRT__difftime32 +@ cdecl _difftime64(long long) MSVCRT__difftime64 +@ stub _dlog +@ stub _dnorm +@ stub _dpcomp +@ stub _dpoly +@ stub _dscale +@ cdecl _dsign(double) MSVCR120__dsign +@ stub _dsin +@ cdecl _dtest(ptr) MSVCR120__dtest +@ stub _dunscale +@ cdecl _dup(long) MSVCRT__dup +@ cdecl _dup2(long long) MSVCRT__dup2 +@ cdecl _dupenv_s(ptr ptr str) +@ cdecl _ecvt(double long ptr ptr) MSVCRT__ecvt +@ cdecl _ecvt_s(str long double long ptr ptr) MSVCRT__ecvt_s +@ cdecl _endthread() +@ cdecl _endthreadex(long) +@ cdecl _eof(long) MSVCRT__eof +@ cdecl _errno() MSVCRT__errno +@ stub _except1 +@ cdecl -arch=i386 _except_handler2(ptr ptr ptr ptr) +@ cdecl -arch=i386 _except_handler3(ptr ptr ptr ptr) +@ cdecl -arch=i386 _except_handler4_common(ptr ptr ptr ptr ptr ptr) +@ varargs _execl(str str) +@ varargs _execle(str str) +@ varargs _execlp(str str) +@ varargs _execlpe(str str) +@ stub _execute_onexit_table +@ cdecl _execv(str ptr) +@ cdecl _execve(str ptr ptr) MSVCRT__execve +@ cdecl _execvp(str ptr) +@ cdecl _execvpe(str ptr ptr) +@ cdecl _exit(long) MSVCRT__exit +@ cdecl _expand(ptr long) +@ cdecl _fclose_nolock(ptr) MSVCRT__fclose_nolock +@ cdecl _fcloseall() MSVCRT__fcloseall +@ cdecl _fcvt(double long ptr ptr) MSVCRT__fcvt +@ cdecl _fcvt_s(ptr long double long ptr ptr) MSVCRT__fcvt_s +@ stub _fd_int +@ cdecl _fdclass(float) MSVCR120__fdclass +@ stub _fdexp +@ stub _fdlog +@ stub _fdnorm +@ cdecl _fdopen(long str) MSVCRT__fdopen +@ stub _fdpcomp +@ stub _fdpoly +@ stub _fdscale +@ cdecl _fdsign(float) MSVCR120__fdsign +@ stub _fdsin +@ cdecl _fdtest(ptr) MSVCR120__fdtest +@ stub _fdunscale +@ cdecl _fflush_nolock(ptr) MSVCRT__fflush_nolock +@ cdecl _fgetc_nolock(ptr) MSVCRT__fgetc_nolock +@ cdecl _fgetchar() MSVCRT__fgetchar +@ cdecl _fgetwc_nolock(ptr) MSVCRT__fgetwc_nolock +@ cdecl _fgetwchar() MSVCRT__fgetwchar +@ cdecl _filelength(long) MSVCRT__filelength +@ cdecl -ret64 _filelengthi64(long) MSVCRT__filelengthi64 +@ cdecl _fileno(ptr) MSVCRT__fileno +@ cdecl _findclose(long) MSVCRT__findclose +@ cdecl _findfirst32(str ptr) MSVCRT__findfirst32 +@ stub _findfirst32i64 +@ cdecl _findfirst64(str ptr) MSVCRT__findfirst64 +@ cdecl _findfirst64i32(str ptr) MSVCRT__findfirst64i32 +@ cdecl _findnext32(long ptr) MSVCRT__findnext32 +@ stub _findnext32i64 +@ cdecl _findnext64(long ptr) MSVCRT__findnext64 +@ cdecl _findnext64i32(long ptr) MSVCRT__findnext64i32 +@ cdecl _finite(double) MSVCRT__finite +@ cdecl -arch=arm,x86_64 _finitef(float) MSVCRT__finitef +@ cdecl _flushall() MSVCRT__flushall +@ cdecl _fpclass(double) MSVCRT__fpclass +@ stub _fpclassf +@ stub _fpieee_flt(long ptr ptr) +@ cdecl _fpreset() +@ cdecl _fputc_nolock(long ptr) MSVCRT__fputc_nolock +@ cdecl _fputchar(long) MSVCRT__fputchar +@ cdecl _fputwc_nolock(long ptr) MSVCRT__fputwc_nolock +@ cdecl _fputwchar(long) MSVCRT__fputwchar +@ cdecl _fread_nolock(ptr long long ptr) MSVCRT__fread_nolock +@ cdecl _fread_nolock_s(ptr long long long ptr) MSVCRT__fread_nolock_s +@ stub _free_base +@ cdecl _free_locale(ptr) MSVCRT__free_locale +@ cdecl _fseek_nolock(ptr long long) MSVCRT__fseek_nolock +@ cdecl _fseeki64(ptr int64 long) MSVCRT__fseeki64 +@ cdecl _fseeki64_nolock(ptr int64 long) MSVCRT__fseeki64_nolock +@ cdecl _fsopen(str str long) MSVCRT__fsopen +@ cdecl _fstat32(long ptr) MSVCRT__fstat32 +@ stub _fstat32i64 +@ cdecl _fstat64(long ptr) MSVCRT__fstat64 +@ cdecl _fstat64i32(long ptr) MSVCRT__fstat64i32 +@ cdecl _ftell_nolock(ptr) MSVCRT__ftell_nolock +@ cdecl -ret64 _ftelli64(ptr) MSVCRT__ftelli64 +@ cdecl -ret64 _ftelli64_nolock(ptr) MSVCRT__ftelli64_nolock +@ cdecl _ftime32(ptr) MSVCRT__ftime32 +@ cdecl _ftime32_s(ptr) MSVCRT__ftime32_s +@ cdecl _ftime64(ptr) MSVCRT__ftime64 +@ cdecl _ftime64_s(ptr) MSVCRT__ftime64_s +@ cdecl -arch=i386 -ret64 _ftol() MSVCRT__ftol +@ cdecl _fullpath(ptr str long) MSVCRT__fullpath +@ cdecl _futime32(long ptr) +@ cdecl _futime64(long ptr) +@ cdecl _fwrite_nolock(ptr long long ptr) MSVCRT__fwrite_nolock +@ cdecl _gcvt(double long str) MSVCRT__gcvt +@ cdecl _gcvt_s(ptr long double long) MSVCRT__gcvt_s +@ stub _get_FMA3_enable +@ cdecl _get_current_locale() MSVCRT__get_current_locale +@ cdecl _get_daylight(ptr) +@ cdecl _get_doserrno(ptr) +@ stub _get_dstbias +@ cdecl _get_errno(ptr) +@ cdecl _get_fmode(ptr) MSVCRT__get_fmode +@ cdecl _get_heap_handle() +@ cdecl _get_initial_narrow_environment() +@ stub _get_initial_wide_environment +@ cdecl _get_invalid_parameter_handler() +@ stub _get_narrow_winmain_command_line +@ cdecl _get_osfhandle(long) MSVCRT__get_osfhandle +@ cdecl _get_pgmptr(ptr) +@ cdecl _get_printf_count_output() MSVCRT__get_printf_count_output +@ stub _get_purecall_handler +@ cdecl _get_stream_buffer_pointers(ptr ptr ptr ptr) MSVCRT__get_stream_buffer_pointers +@ cdecl _get_terminate() MSVCRT__get_terminate +@ stub _get_thread_local_invalid_parameter_handler +@ cdecl _get_timezone(ptr) +@ cdecl _get_tzname(ptr str long long) MSVCRT__get_tzname +@ cdecl _get_unexpected() MSVCRT__get_unexpected +@ stub _get_wide_winmain_command_line +@ cdecl _get_wpgmptr(ptr) +@ cdecl _getc_nolock(ptr) MSVCRT__fgetc_nolock +@ cdecl _getch() +@ cdecl _getch_nolock() +@ cdecl _getche() +@ cdecl _getche_nolock() +@ cdecl _getcwd(str long) MSVCRT__getcwd +@ cdecl _getdcwd(long str long) MSVCRT__getdcwd +@ cdecl _getdiskfree(long ptr) MSVCRT__getdiskfree +@ cdecl _getdllprocaddr(long str long) +@ cdecl _getdrive() MSVCRT__getdrive +@ cdecl _getdrives() kernel32.GetLogicalDrives +@ cdecl _getmaxstdio() MSVCRT__getmaxstdio +@ cdecl _getmbcp() +@ cdecl _getpid() _getpid +@ stub _getsystime(ptr) +@ cdecl _getw(ptr) MSVCRT__getw +@ cdecl _getwc_nolock(ptr) MSVCRT__fgetwc_nolock +@ cdecl _getwch() +@ cdecl _getwch_nolock() +@ cdecl _getwche() +@ cdecl _getwche_nolock() +@ cdecl _getws(ptr) MSVCRT__getws +@ stub _getws_s +@ cdecl -arch=i386 _global_unwind2(ptr) +@ cdecl _gmtime32(ptr) MSVCRT__gmtime32 +@ cdecl _gmtime32_s(ptr ptr) MSVCRT__gmtime32_s +@ cdecl _gmtime64(ptr) MSVCRT__gmtime64 +@ cdecl _gmtime64_s(ptr ptr) MSVCRT__gmtime64_s +@ cdecl _heapchk() +@ cdecl _heapmin() +@ cdecl _heapwalk(ptr) +@ cdecl _hypot(double double) +@ cdecl _hypotf(float float) MSVCRT__hypotf +@ cdecl _i64toa(int64 ptr long) ntdll._i64toa +@ cdecl _i64toa_s(int64 ptr long long) MSVCRT__i64toa_s +@ cdecl _i64tow(int64 ptr long) ntdll._i64tow +@ cdecl _i64tow_s(int64 ptr long long) MSVCRT__i64tow_s +@ cdecl _initialize_narrow_environment() +@ stub _initialize_onexit_table +@ stub _initialize_wide_environment +@ cdecl _initterm(ptr ptr) +@ cdecl _initterm_e(ptr ptr) +@ cdecl _invalid_parameter_noinfo() +@ stub _invalid_parameter_noinfo_noreturn +@ stub _invoke_watson +@ stub _is_exception_typeof +@ cdecl _isalnum_l(long ptr) MSVCRT__isalnum_l +@ cdecl _isalpha_l(long ptr) MSVCRT__isalpha_l +@ cdecl _isatty(long) MSVCRT__isatty +@ stub _isblank_l +@ cdecl _iscntrl_l(long ptr) MSVCRT__iscntrl_l +@ cdecl _isctype(long long) MSVCRT__isctype +@ cdecl _isctype_l(long long ptr) MSVCRT__isctype_l +@ cdecl _isdigit_l(long ptr) MSVCRT__isdigit_l +@ cdecl _isgraph_l(long ptr) MSVCRT__isgraph_l +@ cdecl _isleadbyte_l(long ptr) MSVCRT__isleadbyte_l +@ cdecl _islower_l(long ptr) MSVCRT__islower_l +@ stub _ismbbalnum(long) +@ stub _ismbbalnum_l +@ stub _ismbbalpha(long) +@ stub _ismbbalpha_l +@ stub _ismbbblank +@ stub _ismbbblank_l +@ stub _ismbbgraph(long) +@ stub _ismbbgraph_l +@ stub _ismbbkalnum(long) +@ stub _ismbbkalnum_l +@ cdecl _ismbbkana(long) +@ stub _ismbbkana_l +@ stub _ismbbkprint(long) +@ stub _ismbbkprint_l +@ stub _ismbbkpunct(long) +@ stub _ismbbkpunct_l +@ cdecl _ismbblead(long) +@ cdecl _ismbblead_l(long ptr) +@ stub _ismbbprint(long) +@ stub _ismbbprint_l +@ stub _ismbbpunct(long) +@ stub _ismbbpunct_l +@ cdecl _ismbbtrail(long) +@ stub _ismbbtrail_l +@ cdecl _ismbcalnum(long) +@ stub _ismbcalnum_l +@ cdecl _ismbcalpha(long) +@ stub _ismbcalpha_l +@ stub _ismbcblank +@ stub _ismbcblank_l +@ cdecl _ismbcdigit(long) +@ stub _ismbcdigit_l +@ cdecl _ismbcgraph(long) +@ stub _ismbcgraph_l +@ cdecl _ismbchira(long) +@ stub _ismbchira_l +@ cdecl _ismbckata(long) +@ stub _ismbckata_l +@ stub _ismbcl0(long) +@ stub _ismbcl0_l +@ stub _ismbcl1(long) +@ stub _ismbcl1_l +@ stub _ismbcl2(long) +@ stub _ismbcl2_l +@ cdecl _ismbclegal(long) +@ stub _ismbclegal_l +@ stub _ismbclower(long) +@ stub _ismbclower_l +@ cdecl _ismbcprint(long) +@ stub _ismbcprint_l +@ cdecl _ismbcpunct(long) +@ stub _ismbcpunct_l +@ cdecl _ismbcspace(long) +@ stub _ismbcspace_l +@ cdecl _ismbcsymbol(long) +@ stub _ismbcsymbol_l +@ cdecl _ismbcupper(long) +@ stub _ismbcupper_l +@ cdecl _ismbslead(ptr ptr) +@ stub _ismbslead_l +@ cdecl _ismbstrail(ptr ptr) +@ stub _ismbstrail_l +@ cdecl _isnan(double) MSVCRT__isnan +@ cdecl -arch=arm,x86_64 _isnanf(float) MSVCRT__isnanf +@ cdecl _isprint_l(long ptr) MSVCRT__isprint_l +@ stub _ispunct_l +@ cdecl _isspace_l(long ptr) MSVCRT__isspace_l +@ cdecl _isupper_l(long ptr) MSVCRT__isupper_l +@ stub _iswalnum_l +@ cdecl _iswalpha_l(long ptr) MSVCRT__iswalpha_l +@ stub _iswblank_l +@ stub _iswcntrl_l +@ stub _iswcsym_l +@ stub _iswcsymf_l +@ stub _iswctype_l +@ cdecl _iswdigit_l(long ptr) MSVCRT__iswdigit_l +@ stub _iswgraph_l +@ stub _iswlower_l +@ stub _iswprint_l +@ cdecl _iswpunct_l(long ptr) MSVCRT__iswpunct_l +@ cdecl _iswspace_l(long ptr) MSVCRT__iswspace_l +@ stub _iswupper_l +@ stub _iswxdigit_l +@ cdecl _isxdigit_l(long ptr) MSVCRT__isxdigit_l +@ cdecl _itoa(long ptr long) MSVCRT__itoa +@ cdecl _itoa_s(long ptr long long) MSVCRT__itoa_s +@ cdecl _itow(long ptr long) ntdll._itow +@ cdecl _itow_s(long ptr long long) MSVCRT__itow_s +@ cdecl _j0(double) MSVCRT__j0 +@ cdecl _j1(double) MSVCRT__j1 +@ cdecl _jn(long double) MSVCRT__jn +@ cdecl _kbhit() +@ stub _ld_int +@ cdecl _ldclass(double) MSVCR120__ldclass +@ stub _ldexp +@ stub _ldlog +@ stub _ldpcomp +@ stub _ldpoly +@ stub _ldscale +@ cdecl _ldsign(double) MSVCR120__dsign +@ stub _ldsin +@ cdecl _ldtest(ptr) MSVCR120__ldtest +@ stub _ldunscale +@ cdecl _lfind(ptr ptr ptr long ptr) +@ stub _lfind_s +@ cdecl -arch=i386 _libm_sse2_acos_precise() __libm_sse2_acos +@ cdecl -arch=i386 _libm_sse2_asin_precise() __libm_sse2_asin +@ cdecl -arch=i386 _libm_sse2_atan_precise() __libm_sse2_atan +@ cdecl -arch=i386 _libm_sse2_cos_precise() __libm_sse2_cos +@ cdecl -arch=i386 _libm_sse2_exp_precise() __libm_sse2_exp +@ cdecl -arch=i386 _libm_sse2_log10_precise() __libm_sse2_log10 +@ cdecl -arch=i386 _libm_sse2_log_precise() __libm_sse2_log +@ cdecl -arch=i386 _libm_sse2_pow_precise() __libm_sse2_pow +@ cdecl -arch=i386 _libm_sse2_sin_precise() __libm_sse2_sin +@ cdecl -arch=i386 _libm_sse2_sqrt_precise() __libm_sse2_sqrt_precise +@ cdecl -arch=i386 _libm_sse2_tan_precise() __libm_sse2_tan +@ cdecl _loaddll(str) +@ cdecl -arch=x86_64 _local_unwind(ptr ptr) +@ cdecl -arch=i386 _local_unwind2(ptr long) +@ cdecl -arch=i386 _local_unwind4(ptr ptr long) +@ cdecl _localtime32(ptr) MSVCRT__localtime32 +@ cdecl _localtime32_s(ptr ptr) +@ cdecl _localtime64(ptr) MSVCRT__localtime64 +@ cdecl _localtime64_s(ptr ptr) +@ cdecl _lock_file(ptr) MSVCRT__lock_file +@ stub _lock_locales +@ cdecl _locking(long long long) MSVCRT__locking +@ cdecl _logb(double) MSVCRT__logb +@ cdecl -arch=arm,x86_64 _logbf(float) MSVCRT__logbf +@ cdecl -arch=i386 _longjmpex(ptr long) MSVCRT_longjmp +@ cdecl _lrotl(long long) MSVCRT__lrotl +@ cdecl _lrotr(long long) MSVCRT__lrotr +@ cdecl _lsearch(ptr ptr ptr long ptr) +@ stub _lsearch_s +@ cdecl _lseek(long long long) MSVCRT__lseek +@ cdecl -ret64 _lseeki64(long int64 long) MSVCRT__lseeki64 +@ cdecl _ltoa(long ptr long) ntdll._ltoa +@ cdecl _ltoa_s(long ptr long long) MSVCRT__ltoa_s +@ cdecl _ltow(long ptr long) ntdll._ltow +@ cdecl _ltow_s(long ptr long long) MSVCRT__ltow_s +@ cdecl _makepath(ptr str str str str) MSVCRT__makepath +@ cdecl _makepath_s(ptr long str str str str) MSVCRT__makepath_s +@ stub _malloc_base +@ cdecl _mbbtombc(long) +@ stub _mbbtombc_l +@ cdecl _mbbtype(long long) +@ stub _mbbtype_l +@ stub _mbcasemap +@ cdecl _mbccpy(ptr str) +@ stub _mbccpy_l +@ stub _mbccpy_s +@ stub _mbccpy_s_l +@ cdecl _mbcjistojms(long) +@ stub _mbcjistojms_l +@ cdecl _mbcjmstojis(long) +@ stub _mbcjmstojis_l +@ cdecl _mbclen(ptr) +@ stub _mbclen_l +@ cdecl _mbctohira(long) +@ stub _mbctohira_l +@ cdecl _mbctokata(long) +@ stub _mbctokata_l +@ cdecl _mbctolower(long) +@ stub _mbctolower_l +@ cdecl _mbctombb(long) +@ stub _mbctombb_l +@ cdecl _mbctoupper(long) +@ stub _mbctoupper_l +@ stub _mblen_l +@ cdecl _mbsbtype(str long) +@ stub _mbsbtype_l +@ cdecl _mbscat_s(ptr long str) +@ cdecl _mbscat_s_l(ptr long str ptr) +@ cdecl _mbschr(str long) +@ stub _mbschr_l +@ cdecl _mbscmp(str str) +@ stub _mbscmp_l +@ cdecl _mbscoll(str str) +@ cdecl _mbscoll_l(str str ptr) +@ cdecl _mbscpy_s(ptr long str) +@ cdecl _mbscpy_s_l(ptr long str ptr) +@ cdecl _mbscspn(str str) +@ stub _mbscspn_l +@ cdecl _mbsdec(ptr ptr) +@ stub _mbsdec_l +@ stub _mbsdup +@ cdecl _mbsicmp(str str) +@ stub _mbsicmp_l +@ cdecl _mbsicoll(str str) +@ cdecl _mbsicoll_l(str str ptr) +@ cdecl _mbsinc(str) +@ stub _mbsinc_l +@ cdecl _mbslen(str) +@ stub _mbslen_l +@ cdecl _mbslwr(str) +@ stub _mbslwr_l +@ cdecl _mbslwr_s(str long) +@ stub _mbslwr_s_l +@ cdecl _mbsnbcat(str str long) +@ stub _mbsnbcat_l +@ cdecl _mbsnbcat_s(str long ptr long) +@ stub _mbsnbcat_s_l +@ cdecl _mbsnbcmp(str str long) +@ stub _mbsnbcmp_l +@ cdecl _mbsnbcnt(ptr long) +@ stub _mbsnbcnt_l +@ cdecl _mbsnbcoll(str str long) +@ cdecl _mbsnbcoll_l(str str long ptr) +@ cdecl _mbsnbcpy(ptr str long) +@ stub _mbsnbcpy_l +@ cdecl _mbsnbcpy_s(ptr long str long) +@ cdecl _mbsnbcpy_s_l(ptr long str long ptr) +@ cdecl _mbsnbicmp(str str long) +@ stub _mbsnbicmp_l +@ cdecl _mbsnbicoll(str str long) +@ cdecl _mbsnbicoll_l(str str long ptr) +@ cdecl _mbsnbset(ptr long long) +@ stub _mbsnbset_l +@ stub _mbsnbset_s +@ stub _mbsnbset_s_l +@ cdecl _mbsncat(str str long) +@ stub _mbsncat_l +@ stub _mbsncat_s +@ stub _mbsncat_s_l +@ cdecl _mbsnccnt(str long) +@ stub _mbsnccnt_l +@ cdecl _mbsncmp(str str long) +@ stub _mbsncmp_l +@ stub _mbsncoll(str str long) +@ stub _mbsncoll_l +@ cdecl _mbsncpy(ptr str long) +@ stub _mbsncpy_l +@ stub _mbsncpy_s +@ stub _mbsncpy_s_l +@ cdecl _mbsnextc(str) +@ stub _mbsnextc_l +@ cdecl _mbsnicmp(str str long) +@ stub _mbsnicmp_l +@ stub _mbsnicoll(str str long) +@ stub _mbsnicoll_l +@ cdecl _mbsninc(str long) +@ stub _mbsninc_l +@ stub _mbsnlen +@ stub _mbsnlen_l +@ cdecl _mbsnset(ptr long long) +@ stub _mbsnset_l +@ stub _mbsnset_s +@ stub _mbsnset_s_l +@ cdecl _mbspbrk(str str) +@ stub _mbspbrk_l +@ cdecl _mbsrchr(str long) +@ stub _mbsrchr_l +@ cdecl _mbsrev(str) +@ stub _mbsrev_l +@ cdecl _mbsset(ptr long) +@ stub _mbsset_l +@ stub _mbsset_s +@ stub _mbsset_s_l +@ cdecl _mbsspn(str str) +@ stub _mbsspn_l +@ cdecl _mbsspnp(str str) +@ stub _mbsspnp_l +@ cdecl _mbsstr(str str) +@ stub _mbsstr_l +@ cdecl _mbstok(str str) +@ cdecl _mbstok_l(str str ptr) +@ cdecl _mbstok_s(str str ptr) +@ cdecl _mbstok_s_l(str str ptr ptr) +@ cdecl _mbstowcs_l(ptr str long ptr) MSVCRT__mbstowcs_l +@ cdecl _mbstowcs_s_l(ptr ptr long str long ptr) MSVCRT__mbstowcs_s_l +@ cdecl _mbstrlen(str) +@ cdecl _mbstrlen_l(str ptr) +@ stub _mbstrnlen +@ stub _mbstrnlen_l +@ cdecl _mbsupr(str) +@ stub _mbsupr_l +@ cdecl _mbsupr_s(str long) +@ stub _mbsupr_s_l +@ cdecl _mbtowc_l(ptr str long ptr) MSVCRT_mbtowc_l +@ cdecl _memccpy(ptr ptr long long) ntdll._memccpy +@ cdecl _memicmp(str str long) ntdll._memicmp +@ stub _memicmp_l +@ cdecl _mkdir(str) MSVCRT__mkdir +@ cdecl _mkgmtime32(ptr) MSVCRT__mkgmtime32 +@ cdecl _mkgmtime64(ptr) MSVCRT__mkgmtime64 +@ cdecl _mktemp(str) MSVCRT__mktemp +@ cdecl _mktemp_s(str long) MSVCRT__mktemp_s +@ cdecl _mktime32(ptr) MSVCRT__mktime32 +@ cdecl _mktime64(ptr) MSVCRT__mktime64 +@ cdecl _msize(ptr) +@ cdecl _nextafter(double double) MSVCRT__nextafter +@ cdecl -arch=arm,x86_64 _nextafterf(float float) MSVCRT__nextafterf +@ stub _o__CIacos +@ stub _o__CIasin +@ stub _o__CIatan +@ stub _o__CIatan2 +@ stub _o__CIcos +@ stub _o__CIcosh +@ stub _o__CIexp +@ stub _o__CIfmod +@ stub _o__CIlog +@ stub _o__CIlog10 +@ stub _o__CIpow +@ stub _o__CIsin +@ stub _o__CIsinh +@ stub _o__CIsqrt +@ stub _o__CItan +@ stub _o__CItanh +@ stub _o__Getdays +@ stub _o__Getmonths +@ stub _o__Gettnames +@ stub _o__Strftime +@ stub _o__W_Getdays +@ stub _o__W_Getmonths +@ stub _o__W_Gettnames +@ stub _o__Wcsftime +@ stub _o____lc_codepage_func +@ stub _o____lc_collate_cp_func +@ stub _o____lc_locale_name_func +@ stub _o____mb_cur_max_func +@ stub _o___acrt_iob_func +@ stub _o___conio_common_vcprintf +@ stub _o___conio_common_vcprintf_p +@ stub _o___conio_common_vcprintf_s +@ stub _o___conio_common_vcscanf +@ stub _o___conio_common_vcwprintf +@ stub _o___conio_common_vcwprintf_p +@ stub _o___conio_common_vcwprintf_s +@ stub _o___conio_common_vcwscanf +@ stub _o___daylight +@ stub _o___dstbias +@ stub _o___fpe_flt_rounds +@ stub _o___libm_sse2_acos +@ stub _o___libm_sse2_acosf +@ stub _o___libm_sse2_asin +@ stub _o___libm_sse2_asinf +@ stub _o___libm_sse2_atan +@ stub _o___libm_sse2_atan2 +@ stub _o___libm_sse2_atanf +@ stub _o___libm_sse2_cos +@ stub _o___libm_sse2_cosf +@ stub _o___libm_sse2_exp +@ stub _o___libm_sse2_expf +@ stub _o___libm_sse2_log +@ stub _o___libm_sse2_log10 +@ stub _o___libm_sse2_log10f +@ stub _o___libm_sse2_logf +@ stub _o___libm_sse2_pow +@ stub _o___libm_sse2_powf +@ stub _o___libm_sse2_sin +@ stub _o___libm_sse2_sinf +@ stub _o___libm_sse2_tan +@ stub _o___libm_sse2_tanf +@ stub _o___p___argc +@ stub _o___p___argv +@ stub _o___p___wargv +@ stub _o___p__acmdln +@ stub _o___p__commode +@ stub _o___p__environ +@ stub _o___p__fmode +@ stub _o___p__mbcasemap +@ stub _o___p__mbctype +@ stub _o___p__pgmptr +@ stub _o___p__wcmdln +@ stub _o___p__wenviron +@ stub _o___p__wpgmptr +@ stub _o___pctype_func +@ stub _o___pwctype_func +@ stub _o___std_exception_copy +@ stub _o___std_exception_destroy +@ stub _o___std_type_info_destroy_list +@ stub _o___std_type_info_name +@ stub _o___stdio_common_vfprintf +@ stub _o___stdio_common_vfprintf_p +@ stub _o___stdio_common_vfprintf_s +@ stub _o___stdio_common_vfscanf +@ stub _o___stdio_common_vfwprintf +@ stub _o___stdio_common_vfwprintf_p +@ stub _o___stdio_common_vfwprintf_s +@ stub _o___stdio_common_vfwscanf +@ stub _o___stdio_common_vsnprintf_s +@ stub _o___stdio_common_vsnwprintf_s +@ stub _o___stdio_common_vsprintf +@ stub _o___stdio_common_vsprintf_p +@ stub _o___stdio_common_vsprintf_s +@ stub _o___stdio_common_vsscanf +@ stub _o___stdio_common_vswprintf +@ stub _o___stdio_common_vswprintf_p +@ stub _o___stdio_common_vswprintf_s +@ stub _o___stdio_common_vswscanf +@ stub _o___timezone +@ stub _o___tzname +@ stub _o___wcserror +@ stub _o__access +@ stub _o__access_s +@ stub _o__aligned_free +@ stub _o__aligned_malloc +@ stub _o__aligned_msize +@ stub _o__aligned_offset_malloc +@ stub _o__aligned_offset_realloc +@ stub _o__aligned_offset_recalloc +@ stub _o__aligned_realloc +@ stub _o__aligned_recalloc +@ stub _o__atodbl +@ stub _o__atodbl_l +@ stub _o__atof_l +@ stub _o__atoflt +@ stub _o__atoflt_l +@ stub _o__atoi64 +@ stub _o__atoi64_l +@ stub _o__atoi_l +@ stub _o__atol_l +@ stub _o__atoldbl +@ stub _o__atoldbl_l +@ stub _o__atoll_l +@ stub _o__beep +@ stub _o__beginthread +@ stub _o__beginthreadex +@ stub _o__cabs +@ stub _o__callnewh +@ stub _o__calloc_base +@ stub _o__cexit +@ stub _o__cgets +@ stub _o__cgets_s +@ stub _o__cgetws +@ stub _o__cgetws_s +@ stub _o__chdir +@ stub _o__chdrive +@ stub _o__chmod +@ stub _o__chsize +@ stub _o__chsize_s +@ stub _o__close +@ stub _o__commit +@ stub _o__configthreadlocale +@ stub _o__configure_narrow_argv +@ stub _o__configure_wide_argv +@ stub _o__controlfp_s +@ stub _o__cputs +@ stub _o__cputws +@ stub _o__creat +@ stub _o__create_locale +@ stub _o__crt_atexit +@ stub _o__ctime32_s +@ stub _o__ctime64_s +@ stub _o__cwait +@ stub _o__d_int +@ stub _o__dclass +@ stub _o__difftime32 +@ stub _o__difftime64 +@ stub _o__dlog +@ stub _o__dnorm +@ stub _o__dpcomp +@ stub _o__dpoly +@ stub _o__dscale +@ stub _o__dsign +@ stub _o__dsin +@ stub _o__dtest +@ stub _o__dunscale +@ stub _o__dup +@ stub _o__dup2 +@ stub _o__dupenv_s +@ stub _o__ecvt +@ stub _o__ecvt_s +@ stub _o__endthread +@ stub _o__endthreadex +@ stub _o__eof +@ stub _o__errno +@ stub _o__except1 +@ stub _o__execute_onexit_table +@ stub _o__execv +@ stub _o__execve +@ stub _o__execvp +@ stub _o__execvpe +@ stub _o__exit +@ stub _o__expand +@ stub _o__fclose_nolock +@ stub _o__fcloseall +@ stub _o__fcvt +@ stub _o__fcvt_s +@ stub _o__fd_int +@ stub _o__fdclass +@ stub _o__fdexp +@ stub _o__fdlog +@ stub _o__fdopen +@ stub _o__fdpcomp +@ stub _o__fdpoly +@ stub _o__fdscale +@ stub _o__fdsign +@ stub _o__fdsin +@ stub _o__fflush_nolock +@ stub _o__fgetc_nolock +@ stub _o__fgetchar +@ stub _o__fgetwc_nolock +@ stub _o__fgetwchar +@ stub _o__filelength +@ stub _o__filelengthi64 +@ stub _o__fileno +@ stub _o__findclose +@ stub _o__findfirst32 +@ stub _o__findfirst32i64 +@ stub _o__findfirst64 +@ stub _o__findfirst64i32 +@ stub _o__findnext32 +@ stub _o__findnext32i64 +@ stub _o__findnext64 +@ stub _o__findnext64i32 +@ stub _o__flushall +@ stub _o__fpclass +@ stub _o__fpclassf +@ stub _o__fputc_nolock +@ stub _o__fputchar +@ stub _o__fputwc_nolock +@ stub _o__fputwchar +@ stub _o__fread_nolock +@ stub _o__fread_nolock_s +@ stub _o__free_base +@ stub _o__free_locale +@ stub _o__fseek_nolock +@ stub _o__fseeki64 +@ stub _o__fseeki64_nolock +@ stub _o__fsopen +@ stub _o__fstat32 +@ stub _o__fstat32i64 +@ stub _o__fstat64 +@ stub _o__fstat64i32 +@ stub _o__ftell_nolock +@ stub _o__ftelli64 +@ stub _o__ftelli64_nolock +@ stub _o__ftime32 +@ stub _o__ftime32_s +@ stub _o__ftime64 +@ stub _o__ftime64_s +@ stub _o__fullpath +@ stub _o__futime32 +@ stub _o__futime64 +@ stub _o__fwrite_nolock +@ stub _o__gcvt +@ stub _o__gcvt_s +@ stub _o__get_daylight +@ stub _o__get_doserrno +@ stub _o__get_dstbias +@ stub _o__get_errno +@ stub _o__get_fmode +@ stub _o__get_heap_handle +@ stub _o__get_initial_narrow_environment +@ stub _o__get_initial_wide_environment +@ stub _o__get_invalid_parameter_handler +@ stub _o__get_narrow_winmain_command_line +@ stub _o__get_osfhandle +@ stub _o__get_pgmptr +@ stub _o__get_stream_buffer_pointers +@ stub _o__get_terminate +@ stub _o__get_thread_local_invalid_parameter_handler +@ stub _o__get_timezone +@ stub _o__get_tzname +@ stub _o__get_wide_winmain_command_line +@ stub _o__get_wpgmptr +@ stub _o__getc_nolock +@ stub _o__getch +@ stub _o__getch_nolock +@ stub _o__getche +@ stub _o__getche_nolock +@ stub _o__getcwd +@ stub _o__getdcwd +@ stub _o__getdiskfree +@ stub _o__getdllprocaddr +@ stub _o__getdrive +@ stub _o__getdrives +@ stub _o__getmbcp +@ stub _o__getsystime +@ stub _o__getw +@ stub _o__getwc_nolock +@ stub _o__getwch +@ stub _o__getwch_nolock +@ stub _o__getwche +@ stub _o__getwche_nolock +@ stub _o__getws +@ stub _o__getws_s +@ stub _o__gmtime32 +@ stub _o__gmtime32_s +@ stub _o__gmtime64 +@ stub _o__gmtime64_s +@ stub _o__heapchk +@ stub _o__heapmin +@ stub _o__hypot +@ stub _o__hypotf +@ stub _o__i64toa +@ stub _o__i64toa_s +@ stub _o__i64tow +@ stub _o__i64tow_s +@ stub _o__initialize_narrow_environment +@ stub _o__initialize_onexit_table +@ stub _o__initialize_wide_environment +@ stub _o__invalid_parameter_noinfo +@ stub _o__invalid_parameter_noinfo_noreturn +@ stub _o__isatty +@ stub _o__isctype +@ stub _o__isctype_l +@ stub _o__isleadbyte_l +@ stub _o__ismbbalnum +@ stub _o__ismbbalnum_l +@ stub _o__ismbbalpha +@ stub _o__ismbbalpha_l +@ stub _o__ismbbblank +@ stub _o__ismbbblank_l +@ stub _o__ismbbgraph +@ stub _o__ismbbgraph_l +@ stub _o__ismbbkalnum +@ stub _o__ismbbkalnum_l +@ stub _o__ismbbkana +@ stub _o__ismbbkana_l +@ stub _o__ismbbkprint +@ stub _o__ismbbkprint_l +@ stub _o__ismbbkpunct +@ stub _o__ismbbkpunct_l +@ stub _o__ismbblead +@ stub _o__ismbblead_l +@ stub _o__ismbbprint +@ stub _o__ismbbprint_l +@ stub _o__ismbbpunct +@ stub _o__ismbbpunct_l +@ stub _o__ismbbtrail +@ stub _o__ismbbtrail_l +@ stub _o__ismbcalnum +@ stub _o__ismbcalnum_l +@ stub _o__ismbcalpha +@ stub _o__ismbcalpha_l +@ stub _o__ismbcblank +@ stub _o__ismbcblank_l +@ stub _o__ismbcdigit +@ stub _o__ismbcdigit_l +@ stub _o__ismbcgraph +@ stub _o__ismbcgraph_l +@ stub _o__ismbchira +@ stub _o__ismbchira_l +@ stub _o__ismbckata +@ stub _o__ismbckata_l +@ stub _o__ismbcl0 +@ stub _o__ismbcl0_l +@ stub _o__ismbcl1 +@ stub _o__ismbcl1_l +@ stub _o__ismbcl2 +@ stub _o__ismbcl2_l +@ stub _o__ismbclegal +@ stub _o__ismbclegal_l +@ stub _o__ismbclower +@ stub _o__ismbclower_l +@ stub _o__ismbcprint +@ stub _o__ismbcprint_l +@ stub _o__ismbcpunct +@ stub _o__ismbcpunct_l +@ stub _o__ismbcspace +@ stub _o__ismbcspace_l +@ stub _o__ismbcsymbol +@ stub _o__ismbcsymbol_l +@ stub _o__ismbcupper +@ stub _o__ismbcupper_l +@ stub _o__ismbslead +@ stub _o__ismbslead_l +@ stub _o__ismbstrail +@ stub _o__ismbstrail_l +@ stub _o__iswctype_l +@ stub _o__itoa +@ stub _o__itoa_s +@ stub _o__itow +@ stub _o__itow_s +@ stub _o__j0 +@ stub _o__j1 +@ stub _o__jn +@ stub _o__kbhit +@ stub _o__ld_int +@ stub _o__ldclass +@ stub _o__ldexp +@ stub _o__ldlog +@ stub _o__ldpcomp +@ stub _o__ldpoly +@ stub _o__ldscale +@ stub _o__ldsign +@ stub _o__ldsin +@ stub _o__ldtest +@ stub _o__ldunscale +@ stub _o__lfind +@ stub _o__lfind_s +@ stub _o__libm_sse2_acos_precise +@ stub _o__libm_sse2_asin_precise +@ stub _o__libm_sse2_atan_precise +@ stub _o__libm_sse2_cos_precise +@ stub _o__libm_sse2_exp_precise +@ stub _o__libm_sse2_log10_precise +@ stub _o__libm_sse2_log_precise +@ stub _o__libm_sse2_pow_precise +@ stub _o__libm_sse2_sin_precise +@ stub _o__libm_sse2_sqrt_precise +@ stub _o__libm_sse2_tan_precise +@ stub _o__loaddll +@ stub _o__localtime32 +@ stub _o__localtime32_s +@ stub _o__localtime64 +@ stub _o__localtime64_s +@ stub _o__lock_file +@ stub _o__locking +@ stub _o__logb +@ stub _o__logbf +@ stub _o__lsearch +@ stub _o__lsearch_s +@ stub _o__lseek +@ stub _o__lseeki64 +@ stub _o__ltoa +@ stub _o__ltoa_s +@ stub _o__ltow +@ stub _o__ltow_s +@ stub _o__makepath +@ stub _o__makepath_s +@ stub _o__malloc_base +@ stub _o__mbbtombc +@ stub _o__mbbtombc_l +@ stub _o__mbbtype +@ stub _o__mbbtype_l +@ stub _o__mbccpy +@ stub _o__mbccpy_l +@ stub _o__mbccpy_s +@ stub _o__mbccpy_s_l +@ stub _o__mbcjistojms +@ stub _o__mbcjistojms_l +@ stub _o__mbcjmstojis +@ stub _o__mbcjmstojis_l +@ stub _o__mbclen +@ stub _o__mbclen_l +@ stub _o__mbctohira +@ stub _o__mbctohira_l +@ stub _o__mbctokata +@ stub _o__mbctokata_l +@ stub _o__mbctolower +@ stub _o__mbctolower_l +@ stub _o__mbctombb +@ stub _o__mbctombb_l +@ stub _o__mbctoupper +@ stub _o__mbctoupper_l +@ stub _o__mblen_l +@ stub _o__mbsbtype +@ stub _o__mbsbtype_l +@ stub _o__mbscat_s +@ stub _o__mbscat_s_l +@ stub _o__mbschr +@ stub _o__mbschr_l +@ stub _o__mbscmp +@ stub _o__mbscmp_l +@ stub _o__mbscoll +@ stub _o__mbscoll_l +@ stub _o__mbscpy_s +@ stub _o__mbscpy_s_l +@ stub _o__mbscspn +@ stub _o__mbscspn_l +@ stub _o__mbsdec +@ stub _o__mbsdec_l +@ stub _o__mbsicmp +@ stub _o__mbsicmp_l +@ stub _o__mbsicoll +@ stub _o__mbsicoll_l +@ stub _o__mbsinc +@ stub _o__mbsinc_l +@ stub _o__mbslen +@ stub _o__mbslen_l +@ stub _o__mbslwr +@ stub _o__mbslwr_l +@ stub _o__mbslwr_s +@ stub _o__mbslwr_s_l +@ stub _o__mbsnbcat +@ stub _o__mbsnbcat_l +@ stub _o__mbsnbcat_s +@ stub _o__mbsnbcat_s_l +@ stub _o__mbsnbcmp +@ stub _o__mbsnbcmp_l +@ stub _o__mbsnbcnt +@ stub _o__mbsnbcnt_l +@ stub _o__mbsnbcoll +@ stub _o__mbsnbcoll_l +@ stub _o__mbsnbcpy +@ stub _o__mbsnbcpy_l +@ stub _o__mbsnbcpy_s +@ stub _o__mbsnbcpy_s_l +@ stub _o__mbsnbicmp +@ stub _o__mbsnbicmp_l +@ stub _o__mbsnbicoll +@ stub _o__mbsnbicoll_l +@ stub _o__mbsnbset +@ stub _o__mbsnbset_l +@ stub _o__mbsnbset_s +@ stub _o__mbsnbset_s_l +@ stub _o__mbsncat +@ stub _o__mbsncat_l +@ stub _o__mbsncat_s +@ stub _o__mbsncat_s_l +@ stub _o__mbsnccnt +@ stub _o__mbsnccnt_l +@ stub _o__mbsncmp +@ stub _o__mbsncmp_l +@ stub _o__mbsncoll +@ stub _o__mbsncoll_l +@ stub _o__mbsncpy +@ stub _o__mbsncpy_l +@ stub _o__mbsncpy_s +@ stub _o__mbsncpy_s_l +@ stub _o__mbsnextc +@ stub _o__mbsnextc_l +@ stub _o__mbsnicmp +@ stub _o__mbsnicmp_l +@ stub _o__mbsnicoll +@ stub _o__mbsnicoll_l +@ stub _o__mbsninc +@ stub _o__mbsninc_l +@ stub _o__mbsnlen +@ stub _o__mbsnlen_l +@ stub _o__mbsnset +@ stub _o__mbsnset_l +@ stub _o__mbsnset_s +@ stub _o__mbsnset_s_l +@ stub _o__mbspbrk +@ stub _o__mbspbrk_l +@ stub _o__mbsrchr +@ stub _o__mbsrchr_l +@ stub _o__mbsrev +@ stub _o__mbsrev_l +@ stub _o__mbsset +@ stub _o__mbsset_l +@ stub _o__mbsset_s +@ stub _o__mbsset_s_l +@ stub _o__mbsspn +@ stub _o__mbsspn_l +@ stub _o__mbsspnp +@ stub _o__mbsspnp_l +@ stub _o__mbsstr +@ stub _o__mbsstr_l +@ stub _o__mbstok +@ stub _o__mbstok_l +@ stub _o__mbstok_s +@ stub _o__mbstok_s_l +@ stub _o__mbstowcs_l +@ stub _o__mbstowcs_s_l +@ stub _o__mbstrlen +@ stub _o__mbstrlen_l +@ stub _o__mbstrnlen +@ stub _o__mbstrnlen_l +@ stub _o__mbsupr +@ stub _o__mbsupr_l +@ stub _o__mbsupr_s +@ stub _o__mbsupr_s_l +@ stub _o__mbtowc_l +@ stub _o__memicmp +@ stub _o__memicmp_l +@ stub _o__mkdir +@ stub _o__mkgmtime32 +@ stub _o__mkgmtime64 +@ stub _o__mktemp +@ stub _o__mktemp_s +@ stub _o__mktime32 +@ stub _o__mktime64 +@ stub _o__msize +@ stub _o__nextafter +@ stub _o__nextafterf +@ stub _o__open_osfhandle +@ stub _o__pclose +@ stub _o__pipe +@ stub _o__popen +@ stub _o__purecall +@ stub _o__putc_nolock +@ stub _o__putch +@ stub _o__putch_nolock +@ stub _o__putenv +@ stub _o__putenv_s +@ stub _o__putw +@ stub _o__putwc_nolock +@ stub _o__putwch +@ stub _o__putwch_nolock +@ stub _o__putws +@ stub _o__read +@ stub _o__realloc_base +@ stub _o__recalloc +@ stub _o__register_onexit_function +@ stub _o__resetstkoflw +@ stub _o__rmdir +@ stub _o__rmtmp +@ stub _o__scalb +@ stub _o__scalbf +@ stub _o__searchenv +@ stub _o__searchenv_s +@ stub _o__seh_filter_dll +@ stub _o__seh_filter_exe +@ stub _o__set_abort_behavior +@ stub _o__set_app_type +@ stub _o__set_doserrno +@ stub _o__set_errno +@ stub _o__set_fmode +@ stub _o__set_invalid_parameter_handler +@ stub _o__set_new_handler +@ stub _o__set_new_mode +@ stub _o__set_thread_local_invalid_parameter_handler +@ stub _o__seterrormode +@ stub _o__setmbcp +@ stub _o__setmode +@ stub _o__setsystime +@ stub _o__sleep +@ stub _o__sopen +@ stub _o__sopen_dispatch +@ stub _o__sopen_s +@ stub _o__spawnv +@ stub _o__spawnve +@ stub _o__spawnvp +@ stub _o__spawnvpe +@ stub _o__splitpath +@ stub _o__splitpath_s +@ stub _o__stat32 +@ stub _o__stat32i64 +@ stub _o__stat64 +@ stub _o__stat64i32 +@ stub _o__strcoll_l +@ stub _o__strdate +@ stub _o__strdate_s +@ stub _o__strdup +@ stub _o__strerror +@ stub _o__strerror_s +@ stub _o__strftime_l +@ stub _o__stricmp +@ stub _o__stricmp_l +@ stub _o__stricoll +@ stub _o__stricoll_l +@ stub _o__strlwr +@ stub _o__strlwr_l +@ stub _o__strlwr_s +@ stub _o__strlwr_s_l +@ stub _o__strncoll +@ stub _o__strncoll_l +@ stub _o__strnicmp +@ stub _o__strnicmp_l +@ stub _o__strnicoll +@ stub _o__strnicoll_l +@ stub _o__strnset_s +@ stub _o__strset_s +@ stub _o__strtime +@ stub _o__strtime_s +@ stub _o__strtod_l +@ stub _o__strtof_l +@ stub _o__strtoi64 +@ stub _o__strtoi64_l +@ stub _o__strtol_l +@ stub _o__strtold_l +@ stub _o__strtoll_l +@ stub _o__strtoui64 +@ stub _o__strtoui64_l +@ stub _o__strtoul_l +@ stub _o__strtoull_l +@ stub _o__strupr +@ stub _o__strupr_l +@ stub _o__strupr_s +@ stub _o__strupr_s_l +@ stub _o__strxfrm_l +@ stub _o__swab +@ stub _o__tell +@ stub _o__telli64 +@ stub _o__timespec32_get +@ stub _o__timespec64_get +@ stub _o__tolower +@ stub _o__tolower_l +@ stub _o__toupper +@ stub _o__toupper_l +@ stub _o__towlower_l +@ stub _o__towupper_l +@ stub _o__tzset +@ stub _o__ui64toa +@ stub _o__ui64toa_s +@ stub _o__ui64tow +@ stub _o__ui64tow_s +@ stub _o__ultoa +@ stub _o__ultoa_s +@ stub _o__ultow +@ stub _o__ultow_s +@ stub _o__umask +@ stub _o__umask_s +@ stub _o__ungetc_nolock +@ stub _o__ungetch +@ stub _o__ungetch_nolock +@ stub _o__ungetwc_nolock +@ stub _o__ungetwch +@ stub _o__ungetwch_nolock +@ stub _o__unlink +@ stub _o__unloaddll +@ stub _o__unlock_file +@ stub _o__utime32 +@ stub _o__utime64 +@ stub _o__waccess +@ stub _o__waccess_s +@ stub _o__wasctime +@ stub _o__wasctime_s +@ stub _o__wchdir +@ stub _o__wchmod +@ stub _o__wcreat +@ stub _o__wcreate_locale +@ stub _o__wcscoll_l +@ stub _o__wcsdup +@ stub _o__wcserror +@ stub _o__wcserror_s +@ stub _o__wcsftime_l +@ stub _o__wcsicmp +@ stub _o__wcsicmp_l +@ stub _o__wcsicoll +@ stub _o__wcsicoll_l +@ stub _o__wcslwr +@ stub _o__wcslwr_l +@ stub _o__wcslwr_s +@ stub _o__wcslwr_s_l +@ stub _o__wcsncoll +@ stub _o__wcsncoll_l +@ stub _o__wcsnicmp +@ stub _o__wcsnicmp_l +@ stub _o__wcsnicoll +@ stub _o__wcsnicoll_l +@ stub _o__wcsnset +@ stub _o__wcsnset_s +@ stub _o__wcsset +@ stub _o__wcsset_s +@ stub _o__wcstod_l +@ stub _o__wcstof_l +@ stub _o__wcstoi64 +@ stub _o__wcstoi64_l +@ stub _o__wcstol_l +@ stub _o__wcstold_l +@ stub _o__wcstoll_l +@ stub _o__wcstombs_l +@ stub _o__wcstombs_s_l +@ stub _o__wcstoui64 +@ stub _o__wcstoui64_l +@ stub _o__wcstoul_l +@ stub _o__wcstoull_l +@ stub _o__wcsupr +@ stub _o__wcsupr_l +@ stub _o__wcsupr_s +@ stub _o__wcsupr_s_l +@ stub _o__wcsxfrm_l +@ stub _o__wctime32 +@ stub _o__wctime32_s +@ stub _o__wctime64 +@ stub _o__wctime64_s +@ stub _o__wctomb_l +@ stub _o__wctomb_s_l +@ stub _o__wdupenv_s +@ stub _o__wexecv +@ stub _o__wexecve +@ stub _o__wexecvp +@ stub _o__wexecvpe +@ stub _o__wfdopen +@ stub _o__wfindfirst32 +@ stub _o__wfindfirst32i64 +@ stub _o__wfindfirst64 +@ stub _o__wfindfirst64i32 +@ stub _o__wfindnext32 +@ stub _o__wfindnext32i64 +@ stub _o__wfindnext64 +@ stub _o__wfindnext64i32 +@ stub _o__wfopen +@ stub _o__wfopen_s +@ stub _o__wfreopen +@ stub _o__wfreopen_s +@ stub _o__wfsopen +@ stub _o__wfullpath +@ stub _o__wgetcwd +@ stub _o__wgetdcwd +@ stub _o__wgetenv +@ stub _o__wgetenv_s +@ stub _o__wmakepath +@ stub _o__wmakepath_s +@ stub _o__wmkdir +@ stub _o__wmktemp +@ stub _o__wmktemp_s +@ stub _o__wperror +@ stub _o__wpopen +@ stub _o__wputenv +@ stub _o__wputenv_s +@ stub _o__wremove +@ stub _o__wrename +@ stub _o__write +@ stub _o__wrmdir +@ stub _o__wsearchenv +@ stub _o__wsearchenv_s +@ stub _o__wsetlocale +@ stub _o__wsopen_dispatch +@ stub _o__wsopen_s +@ stub _o__wspawnv +@ stub _o__wspawnve +@ stub _o__wspawnvp +@ stub _o__wspawnvpe +@ stub _o__wsplitpath +@ stub _o__wsplitpath_s +@ stub _o__wstat32 +@ stub _o__wstat32i64 +@ stub _o__wstat64 +@ stub _o__wstat64i32 +@ stub _o__wstrdate +@ stub _o__wstrdate_s +@ stub _o__wstrtime +@ stub _o__wstrtime_s +@ stub _o__wsystem +@ stub _o__wtmpnam_s +@ stub _o__wtof +@ stub _o__wtof_l +@ stub _o__wtoi +@ stub _o__wtoi64 +@ stub _o__wtoi64_l +@ stub _o__wtoi_l +@ stub _o__wtol +@ stub _o__wtol_l +@ stub _o__wtoll +@ stub _o__wtoll_l +@ stub _o__wunlink +@ stub _o__wutime32 +@ stub _o__wutime64 +@ stub _o__y0 +@ stub _o__y1 +@ stub _o__yn +@ stub _o_abort +@ stub _o_acos +@ stub _o_acosf +@ stub _o_acosh +@ stub _o_acoshf +@ stub _o_acoshl +@ stub _o_asctime +@ stub _o_asctime_s +@ stub _o_asin +@ stub _o_asinf +@ stub _o_asinh +@ stub _o_asinhf +@ stub _o_asinhl +@ stub _o_atan +@ stub _o_atan2 +@ stub _o_atan2f +@ stub _o_atanf +@ stub _o_atanh +@ stub _o_atanhf +@ stub _o_atanhl +@ stub _o_atof +@ stub _o_atoi +@ stub _o_atol +@ stub _o_atoll +@ stub _o_bsearch +@ stub _o_bsearch_s +@ stub _o_btowc +@ stub _o_calloc +@ stub _o_cbrt +@ stub _o_cbrtf +@ stub _o_ceil +@ stub _o_ceilf +@ stub _o_clearerr +@ stub _o_clearerr_s +@ stub _o_cos +@ stub _o_cosf +@ stub _o_cosh +@ stub _o_coshf +@ stub _o_erf +@ stub _o_erfc +@ stub _o_erfcf +@ stub _o_erfcl +@ stub _o_erff +@ stub _o_erfl +@ stub _o_exit +@ stub _o_exp +@ stub _o_exp2 +@ stub _o_exp2f +@ stub _o_exp2l +@ stub _o_expf +@ stub _o_fabs +@ stub _o_fclose +@ stub _o_feof +@ stub _o_ferror +@ stub _o_fflush +@ stub _o_fgetc +@ stub _o_fgetpos +@ stub _o_fgets +@ stub _o_fgetwc +@ stub _o_fgetws +@ stub _o_floor +@ stub _o_floorf +@ stub _o_fma +@ stub _o_fmaf +@ stub _o_fmal +@ stub _o_fmod +@ stub _o_fmodf +@ stub _o_fopen +@ stub _o_fopen_s +@ stub _o_fputc +@ stub _o_fputs +@ stub _o_fputwc +@ stub _o_fputws +@ stub _o_fread +@ stub _o_fread_s +@ stub _o_free +@ stub _o_freopen +@ stub _o_freopen_s +@ stub _o_frexp +@ stub _o_fseek +@ stub _o_fsetpos +@ stub _o_ftell +@ stub _o_fwrite +@ stub _o_getc +@ stub _o_getchar +@ stub _o_getenv +@ stub _o_getenv_s +@ stub _o_gets +@ stub _o_gets_s +@ stub _o_getwc +@ stub _o_getwchar +@ stub _o_hypot +@ stub _o_is_wctype +@ stub _o_isalnum +@ stub _o_isalpha +@ stub _o_isblank +@ stub _o_iscntrl +@ stub _o_isdigit +@ stub _o_isgraph +@ stub _o_isleadbyte +@ stub _o_islower +@ stub _o_isprint +@ stub _o_ispunct +@ stub _o_isspace +@ stub _o_isupper +@ stub _o_iswalnum +@ stub _o_iswalpha +@ stub _o_iswascii +@ stub _o_iswblank +@ stub _o_iswcntrl +@ stub _o_iswctype +@ stub _o_iswdigit +@ stub _o_iswgraph +@ stub _o_iswlower +@ stub _o_iswprint +@ stub _o_iswpunct +@ stub _o_iswspace +@ stub _o_iswupper +@ stub _o_iswxdigit +@ stub _o_isxdigit +@ stub _o_ldexp +@ stub _o_lgamma +@ stub _o_lgammaf +@ stub _o_lgammal +@ stub _o_llrint +@ stub _o_llrintf +@ stub _o_llrintl +@ stub _o_llround +@ stub _o_llroundf +@ stub _o_llroundl +@ stub _o_localeconv +@ stub _o_log +@ stub _o_log10 +@ stub _o_log10f +@ stub _o_log1p +@ stub _o_log1pf +@ stub _o_log1pl +@ stub _o_log2 +@ stub _o_log2f +@ stub _o_log2l +@ stub _o_logb +@ stub _o_logbf +@ stub _o_logbl +@ stub _o_logf +@ stub _o_lrint +@ stub _o_lrintf +@ stub _o_lrintl +@ stub _o_lround +@ stub _o_lroundf +@ stub _o_lroundl +@ stub _o_malloc +@ stub _o_mblen +@ stub _o_mbrlen +@ stub _o_mbrtoc16 +@ stub _o_mbrtoc32 +@ stub _o_mbrtowc +@ stub _o_mbsrtowcs +@ stub _o_mbsrtowcs_s +@ stub _o_mbstowcs +@ stub _o_mbstowcs_s +@ stub _o_mbtowc +@ stub _o_memcpy_s +@ stub _o_memset +@ stub _o_modf +@ stub _o_modff +@ stub _o_nan +@ stub _o_nanf +@ stub _o_nanl +@ stub _o_nearbyint +@ stub _o_nearbyintf +@ stub _o_nearbyintl +@ stub _o_nextafter +@ stub _o_nextafterf +@ stub _o_nextafterl +@ stub _o_nexttoward +@ stub _o_nexttowardf +@ stub _o_nexttowardl +@ stub _o_pow +@ stub _o_powf +@ stub _o_putc +@ stub _o_putchar +@ stub _o_puts +@ stub _o_putwc +@ stub _o_putwchar +@ stub _o_qsort +@ stub _o_qsort_s +@ stub _o_raise +@ stub _o_rand +@ stub _o_rand_s +@ stub _o_realloc +@ stub _o_remainder +@ stub _o_remainderf +@ stub _o_remainderl +@ stub _o_remove +@ stub _o_remquo +@ stub _o_remquof +@ stub _o_remquol +@ stub _o_rename +@ stub _o_rewind +@ stub _o_rint +@ stub _o_rintf +@ stub _o_rintl +@ stub _o_round +@ stub _o_roundf +@ stub _o_roundl +@ stub _o_scalbln +@ stub _o_scalblnf +@ stub _o_scalblnl +@ stub _o_scalbn +@ stub _o_scalbnf +@ stub _o_scalbnl +@ stub _o_set_terminate +@ stub _o_setbuf +@ stub _o_setlocale +@ stub _o_setvbuf +@ stub _o_sin +@ stub _o_sinf +@ stub _o_sinh +@ stub _o_sinhf +@ stub _o_sqrt +@ stub _o_sqrtf +@ stub _o_srand +@ stub _o_strcat_s +@ stub _o_strcoll +@ stub _o_strcpy_s +@ stub _o_strerror +@ stub _o_strerror_s +@ stub _o_strftime +@ stub _o_strncat_s +@ stub _o_strncpy_s +@ stub _o_strtod +@ stub _o_strtof +@ stub _o_strtok +@ stub _o_strtok_s +@ stub _o_strtol +@ stub _o_strtold +@ stub _o_strtoll +@ stub _o_strtoul +@ stub _o_strtoull +@ stub _o_system +@ stub _o_tan +@ stub _o_tanf +@ stub _o_tanh +@ stub _o_tanhf +@ stub _o_terminate +@ stub _o_tgamma +@ stub _o_tgammaf +@ stub _o_tgammal +@ stub _o_tmpfile_s +@ stub _o_tmpnam_s +@ stub _o_tolower +@ stub _o_toupper +@ stub _o_towlower +@ stub _o_towupper +@ stub _o_ungetc +@ stub _o_ungetwc +@ stub _o_wcrtomb +@ stub _o_wcrtomb_s +@ stub _o_wcscat_s +@ stub _o_wcscoll +@ stub _o_wcscpy +@ stub _o_wcscpy_s +@ stub _o_wcsftime +@ stub _o_wcsncat_s +@ stub _o_wcsncpy_s +@ stub _o_wcsrtombs +@ stub _o_wcsrtombs_s +@ stub _o_wcstod +@ stub _o_wcstof +@ stub _o_wcstok +@ stub _o_wcstok_s +@ stub _o_wcstol +@ stub _o_wcstold +@ stub _o_wcstoll +@ stub _o_wcstombs +@ stub _o_wcstombs_s +@ stub _o_wcstoul +@ stub _o_wcstoull +@ stub _o_wctob +@ stub _o_wctomb +@ stub _o_wctomb_s +@ stub _o_wmemcpy_s +@ stub _o_wmemmove_s +@ varargs _open(str long) MSVCRT__open +@ cdecl _open_osfhandle(long long) MSVCRT__open_osfhandle +@ cdecl _pclose(ptr) MSVCRT__pclose +@ cdecl _pipe(ptr long long) MSVCRT__pipe +@ cdecl _popen(str str) MSVCRT__popen +@ cdecl _purecall() +@ cdecl _putc_nolock(long ptr) MSVCRT__fputc_nolock +@ cdecl _putch(long) +@ cdecl _putch_nolock(long) +@ cdecl _putenv(str) +@ cdecl _putenv_s(str str) +@ cdecl _putw(long ptr) MSVCRT__putw +@ cdecl _putwc_nolock(long ptr) MSVCRT__fputwc_nolock +@ cdecl _putwch(long) +@ cdecl _putwch_nolock(long) +@ cdecl _putws(wstr) MSVCRT__putws +@ stub _query_app_type +@ stub _query_new_handler +@ stub _query_new_mode +@ cdecl _read(long ptr long) MSVCRT__read +@ stub _realloc_base +@ cdecl _recalloc(ptr long long) +@ stub _register_onexit_function +@ stub _register_thread_local_exe_atexit_callback +@ cdecl _resetstkoflw() MSVCRT__resetstkoflw +@ cdecl _rmdir(str) MSVCRT__rmdir +@ cdecl _rmtmp() MSVCRT__rmtmp +@ cdecl _rotl(long long) +@ cdecl -ret64 _rotl64(int64 long) +@ cdecl _rotr(long long) +@ cdecl -ret64 _rotr64(int64 long) +@ cdecl _scalb(double long) MSVCRT__scalb +@ cdecl -arch=arm,x86_64 _scalbf(float long) MSVCRT__scalbf +@ cdecl _searchenv(str str ptr) MSVCRT__searchenv +@ cdecl _searchenv_s(str str ptr long) MSVCRT__searchenv_s +@ cdecl -arch=i386,x86_64,arm _seh_filter_dll(long ptr) __CppXcptFilter +@ cdecl _seh_filter_exe(long ptr) _XcptFilter +@ stub _set_FMA3_enable +@ stdcall -arch=i386 _seh_longjmp_unwind4(ptr) +@ stdcall -arch=i386 _seh_longjmp_unwind(ptr) +@ cdecl -arch=i386 _set_SSE2_enable(long) MSVCRT__set_SSE2_enable +@ cdecl _set_abort_behavior(long long) MSVCRT__set_abort_behavior +@ cdecl _set_app_type(long) MSVCRT___set_app_type +@ cdecl _set_controlfp(long long) +@ cdecl _set_doserrno(long) +@ cdecl _set_errno(long) +@ cdecl _set_error_mode(long) +@ cdecl _set_fmode(long) MSVCRT__set_fmode +@ cdecl _set_invalid_parameter_handler(ptr) +@ cdecl _set_new_handler(ptr) MSVCRT_set_new_handler +@ cdecl _set_new_mode(long) MSVCRT__set_new_mode +@ cdecl _set_printf_count_output(long) MSVCRT__set_printf_count_output +@ cdecl _set_purecall_handler(ptr) +@ stub _set_se_translator +@ stub _set_thread_local_invalid_parameter_handler +@ cdecl _seterrormode(long) +@ cdecl -arch=i386 -norelay _setjmp3(ptr long) MSVCRT__setjmp3 +@ cdecl _setmaxstdio(long) MSVCRT__setmaxstdio +@ cdecl _setmbcp(long) +@ cdecl _setmode(long long) MSVCRT__setmode +@ stub _setsystime(ptr long) +@ cdecl _sleep(long) MSVCRT__sleep +@ varargs _sopen(str long long) MSVCRT__sopen +@ stub _sopen_dispatch +@ cdecl _sopen_s(ptr str long long long) MSVCRT__sopen_s +@ varargs _spawnl(long str str) +@ varargs _spawnle(long str str) +@ varargs _spawnlp(long str str) +@ varargs _spawnlpe(long str str) +@ cdecl _spawnv(long str ptr) +@ cdecl _spawnve(long str ptr ptr) MSVCRT__spawnve +@ cdecl _spawnvp(long str ptr) +@ cdecl _spawnvpe(long str ptr ptr) MSVCRT__spawnvpe +@ cdecl _splitpath(str ptr ptr ptr ptr) MSVCRT__splitpath +@ cdecl _splitpath_s(str ptr long ptr long ptr long ptr long) MSVCRT__splitpath_s +@ cdecl _stat32(str ptr) MSVCRT__stat32 +@ cdecl _stat32i64(str ptr) MSVCRT__stat32i64 +@ cdecl _stat64(str ptr) MSVCRT_stat64 +@ cdecl _stat64i32(str ptr) MSVCRT__stat64i32 +@ cdecl _statusfp() +@ cdecl -arch=i386 _statusfp2(ptr ptr) +@ cdecl _strcoll_l(str str ptr) MSVCRT_strcoll_l +@ cdecl _strdate(ptr) MSVCRT__strdate +@ cdecl _strdate_s(ptr long) +@ cdecl _strdup(str) MSVCRT__strdup +@ cdecl _strerror(long) MSVCRT__strerror +@ stub _strerror_s +@ stub _strftime_l +@ cdecl _stricmp(str str) MSVCRT__stricmp +@ cdecl _stricmp_l(str str ptr) MSVCRT__stricmp_l +@ cdecl _stricoll(str str) MSVCRT__stricoll +@ cdecl _stricoll_l(str str ptr) MSVCRT__stricoll_l +@ cdecl _strlwr(str) MSVCRT__strlwr +@ cdecl _strlwr_l(str ptr) +@ cdecl _strlwr_s(ptr long) MSVCRT__strlwr_s +@ cdecl _strlwr_s_l(ptr long ptr) MSVCRT__strlwr_s_l +@ cdecl _strncoll(str str long) MSVCRT__strncoll +@ cdecl _strncoll_l(str str long ptr) MSVCRT__strncoll_l +@ cdecl _strnicmp(str str long) MSVCRT__strnicmp +@ cdecl _strnicmp_l(str str long ptr) MSVCRT__strnicmp_l +@ cdecl _strnicoll(str str long) MSVCRT__strnicoll +@ cdecl _strnicoll_l(str str long ptr) MSVCRT__strnicoll_l +@ cdecl _strnset(str long long) MSVCRT__strnset +@ cdecl _strnset_s(str long long long) MSVCRT__strnset_s +@ cdecl _strrev(str) MSVCRT__strrev +@ cdecl _strset(str long) +@ stub _strset_s +@ cdecl _strtime(ptr) MSVCRT__strtime +@ cdecl _strtime_s(ptr long) +@ cdecl _strtod_l(str ptr ptr) MSVCRT_strtod_l +@ stub _strtof_l +@ cdecl -ret64 _strtoi64(str ptr long) MSVCRT_strtoi64 +@ cdecl -ret64 _strtoi64_l(str ptr long ptr) MSVCRT_strtoi64_l +@ stub _strtoimax_l +@ stub _strtol_l +@ stub _strtold_l +@ cdecl -ret64 _strtoll_l(str ptr long ptr) MSVCRT_strtoi64_l +@ cdecl -ret64 _strtoui64(str ptr long) MSVCRT_strtoui64 +@ cdecl -ret64 _strtoui64_l(str ptr long ptr) MSVCRT_strtoui64_l +@ cdecl _strtoul_l(str ptr long ptr) MSVCRT_strtoul_l +@ cdecl -ret64 _strtoull_l(str ptr long ptr) MSVCRT_strtoui64_l +@ stub _strtoumax_l +@ cdecl _strupr(str) MSVCRT__strupr +@ cdecl _strupr_l(str ptr) MSVCRT__strupr_l +@ cdecl _strupr_s(str long) MSVCRT__strupr_s +@ cdecl _strupr_s_l(str long ptr) MSVCRT__strupr_s_l +@ cdecl _strxfrm_l(ptr str long ptr) MSVCRT__strxfrm_l +@ cdecl _swab(str str long) MSVCRT__swab +@ cdecl _tell(long) MSVCRT__tell +@ cdecl -ret64 _telli64(long) +@ cdecl _tempnam(str str) MSVCRT__tempnam +@ cdecl _time32(ptr) MSVCRT__time32 +@ cdecl _time64(ptr) MSVCRT__time64 +@ stub _timespec32_get +@ stub _timespec64_get +@ cdecl _tolower(long) MSVCRT__tolower +@ cdecl _tolower_l(long ptr) MSVCRT__tolower_l +@ cdecl _toupper(long) MSVCRT__toupper +@ cdecl _toupper_l(long ptr) MSVCRT__toupper_l +@ cdecl _towlower_l(long ptr) MSVCRT__towlower_l +@ cdecl _towupper_l(long ptr) MSVCRT__towupper_l +@ cdecl _tzset() MSVCRT__tzset +@ cdecl _ui64toa(int64 ptr long) ntdll._ui64toa +@ cdecl _ui64toa_s(int64 ptr long long) MSVCRT__ui64toa_s +@ cdecl _ui64tow(int64 ptr long) ntdll._ui64tow +@ cdecl _ui64tow_s(int64 ptr long long) MSVCRT__ui64tow_s +@ cdecl _ultoa(long ptr long) ntdll._ultoa +@ cdecl _ultoa_s(long ptr long long) MSVCRT__ultoa_s +@ cdecl _ultow(long ptr long) ntdll._ultow +@ cdecl _ultow_s(long ptr long long) MSVCRT__ultow_s +@ cdecl _umask(long) MSVCRT__umask +@ stub _umask_s +@ cdecl _ungetc_nolock(long ptr) MSVCRT__ungetc_nolock +@ cdecl _ungetch(long) +@ cdecl _ungetch_nolock(long) +@ cdecl _ungetwc_nolock(long ptr) MSVCRT__ungetwc_nolock +@ cdecl _ungetwch(long) +@ cdecl _ungetwch_nolock(long) +@ cdecl _unlink(str) MSVCRT__unlink +@ cdecl _unloaddll(long) +@ cdecl _unlock_file(ptr) MSVCRT__unlock_file +@ stub _unlock_locales +@ cdecl _utime32(str ptr) +@ cdecl _utime64(str ptr) +@ cdecl _waccess(wstr long) MSVCRT__waccess +@ cdecl _waccess_s(wstr long) MSVCRT__waccess_s +@ cdecl _wasctime(ptr) MSVCRT__wasctime +@ cdecl _wasctime_s(ptr long ptr) MSVCRT__wasctime_s +@ cdecl _wassert(wstr wstr long) MSVCRT__wassert +@ cdecl _wchdir(wstr) MSVCRT__wchdir +@ cdecl _wchmod(wstr long) MSVCRT__wchmod +@ cdecl _wcreat(wstr long) MSVCRT__wcreat +@ stub _wcreate_locale +@ cdecl _wcscoll_l(wstr wstr ptr) MSVCRT__wcscoll_l +@ cdecl _wcsdup(wstr) MSVCRT__wcsdup +@ cdecl _wcserror(long) MSVCRT__wcserror +@ cdecl _wcserror_s(ptr long long) MSVCRT__wcserror_s +@ stub _wcsftime_l +@ cdecl _wcsicmp(wstr wstr) MSVCRT__wcsicmp +@ cdecl _wcsicmp_l(wstr wstr ptr) MSVCRT__wcsicmp_l +@ cdecl _wcsicoll(wstr wstr) MSVCRT__wcsicoll +@ cdecl _wcsicoll_l(wstr wstr ptr) MSVCRT__wcsicoll_l +@ cdecl _wcslwr(wstr) MSVCRT__wcslwr +@ cdecl _wcslwr_l(wstr ptr) MSVCRT__wcslwr_l +@ cdecl _wcslwr_s(wstr long) MSVCRT__wcslwr_s +@ cdecl _wcslwr_s_l(wstr long ptr) MSVCRT__wcslwr_s_l +@ cdecl _wcsncoll(wstr wstr long) MSVCRT__wcsncoll +@ cdecl _wcsncoll_l(wstr wstr long ptr) MSVCRT__wcsncoll_l +@ cdecl _wcsnicmp(wstr wstr long) MSVCRT__wcsnicmp +@ cdecl _wcsnicmp_l(wstr wstr long ptr) MSVCRT__wcsnicmp_l +@ cdecl _wcsnicoll(wstr wstr long) MSVCRT__wcsnicoll +@ cdecl _wcsnicoll_l(wstr wstr long ptr) MSVCRT__wcsnicoll_l +@ cdecl _wcsnset(wstr long long) MSVCRT__wcsnset +@ stub _wcsnset_s +@ cdecl _wcsrev(wstr) MSVCRT__wcsrev +@ cdecl _wcsset(wstr long) MSVCRT__wcsset +@ cdecl _wcsset_s(wstr long long) MSVCRT__wcsset_s +@ cdecl _wcstod_l(wstr ptr) MSVCRT__wcstod_l +@ stub _wcstof_l +@ cdecl -ret64 _wcstoi64(wstr ptr long) MSVCRT__wcstoi64 +@ cdecl -ret64 _wcstoi64_l(wstr ptr long ptr) MSVCRT__wcstoi64_l +@ stub _wcstoimax_l +@ cdecl _wcstol_l(wstr ptr long ptr) MSVCRT__wcstol_l +@ stub _wcstold_l +@ stub _wcstoll_l +@ cdecl _wcstombs_l(ptr ptr long ptr) MSVCRT__wcstombs_l +@ cdecl _wcstombs_s_l(ptr ptr long wstr long ptr) MSVCRT__wcstombs_s_l +@ cdecl -ret64 _wcstoui64(wstr ptr long) MSVCRT__wcstoui64 +@ cdecl -ret64 _wcstoui64_l(wstr ptr long ptr) MSVCRT__wcstoui64_l +@ cdecl _wcstoul_l(wstr ptr long ptr) MSVCRT__wcstoul_l +@ stub _wcstoull_l +@ stub _wcstoumax_l +@ cdecl _wcsupr(wstr) ntdll._wcsupr +@ cdecl _wcsupr_l(wstr ptr) MSVCRT__wcsupr_l +@ cdecl _wcsupr_s(wstr long) MSVCRT__wcsupr_s +@ cdecl _wcsupr_s_l(wstr long ptr) MSVCRT__wcsupr_s_l +@ cdecl _wcsxfrm_l(ptr wstr long ptr) MSVCRT__wcsxfrm_l +@ cdecl _wctime32(ptr) MSVCRT__wctime32 +@ stub _wctime32_s +@ cdecl _wctime64(ptr) MSVCRT__wctime64 +@ stub _wctime64_s +@ cdecl _wctomb_l(ptr long ptr) MSVCRT__wctomb_l +@ cdecl _wctomb_s_l(ptr ptr long long ptr) MSVCRT__wctomb_s_l +@ stub _wctype +@ cdecl _wdupenv_s(ptr ptr wstr) +@ varargs _wexecl(wstr wstr) +@ varargs _wexecle(wstr wstr) +@ varargs _wexeclp(wstr wstr) +@ varargs _wexeclpe(wstr wstr) +@ cdecl _wexecv(wstr ptr) +@ cdecl _wexecve(wstr ptr ptr) +@ cdecl _wexecvp(wstr ptr) +@ cdecl _wexecvpe(wstr ptr ptr) +@ cdecl _wfdopen(long wstr) MSVCRT__wfdopen +@ cdecl _wfindfirst32(wstr ptr) MSVCRT__wfindfirst32 +@ stub _wfindfirst32i64 +@ cdecl _wfindfirst64(wstr ptr) MSVCRT__wfindfirst64 +@ cdecl _wfindfirst64i32(wstr ptr) MSVCRT__wfindfirst64i32 +@ stub _wfindnext32 +@ stub _wfindnext32i64 +@ cdecl _wfindnext64(long ptr) MSVCRT__wfindnext64 +@ cdecl _wfindnext64i32(long ptr) MSVCRT__wfindnext64i32 +@ cdecl _wfopen(wstr wstr) MSVCRT__wfopen +@ cdecl _wfopen_s(ptr wstr wstr) MSVCRT__wfopen_s +@ cdecl _wfreopen(wstr wstr ptr) MSVCRT__wfreopen +@ cdecl _wfreopen_s(ptr wstr wstr ptr) MSVCRT__wfreopen_s +@ cdecl _wfsopen(wstr wstr long) MSVCRT__wfsopen +@ cdecl _wfullpath(ptr wstr long) MSVCRT__wfullpath +@ cdecl _wgetcwd(wstr long) MSVCRT__wgetcwd +@ cdecl _wgetdcwd(long wstr long) MSVCRT__wgetdcwd +@ cdecl _wgetenv(wstr) MSVCRT__wgetenv +@ cdecl _wgetenv_s(ptr ptr long wstr) +@ cdecl _wmakepath(ptr wstr wstr wstr wstr) MSVCRT__wmakepath +@ cdecl _wmakepath_s(ptr long wstr wstr wstr wstr) MSVCRT__wmakepath_s +@ cdecl _wmkdir(wstr) MSVCRT__wmkdir +@ cdecl _wmktemp(wstr) MSVCRT__wmktemp +@ cdecl _wmktemp_s(wstr long) MSVCRT__wmktemp_s +@ varargs _wopen(wstr long) MSVCRT__wopen +@ stub _wperror(wstr) +@ cdecl _wpopen(wstr wstr) MSVCRT__wpopen +@ cdecl _wputenv(wstr) +@ cdecl _wputenv_s(wstr wstr) +@ cdecl _wremove(wstr) MSVCRT__wremove +@ cdecl _wrename(wstr wstr) MSVCRT__wrename +@ cdecl _write(long ptr long) MSVCRT__write +@ cdecl _wrmdir(wstr) MSVCRT__wrmdir +@ cdecl _wsearchenv(wstr wstr ptr) MSVCRT__wsearchenv +@ cdecl _wsearchenv_s(wstr wstr ptr long) MSVCRT__wsearchenv_s +@ cdecl _wsetlocale(long wstr) MSVCRT__wsetlocale +@ varargs _wsopen(wstr long long) MSVCRT__wsopen +@ stub _wsopen_dispatch +@ cdecl _wsopen_s(ptr wstr long long long) MSVCRT__wsopen_s +@ varargs _wspawnl(long wstr wstr) +@ varargs _wspawnle(long wstr wstr) +@ varargs _wspawnlp(long wstr wstr) +@ varargs _wspawnlpe(long wstr wstr) +@ cdecl _wspawnv(long wstr ptr) +@ cdecl _wspawnve(long wstr ptr ptr) MSVCRT__wspawnve +@ cdecl _wspawnvp(long wstr ptr) +@ cdecl _wspawnvpe(long wstr ptr ptr) MSVCRT__wspawnvpe +@ cdecl _wsplitpath(wstr ptr ptr ptr ptr) MSVCRT__wsplitpath +@ cdecl _wsplitpath_s(wstr ptr long ptr long ptr long ptr long) MSVCRT__wsplitpath_s +@ cdecl _wstat32(wstr ptr) MSVCRT__wstat32 +@ cdecl _wstat32i64(wstr ptr) MSVCRT__wstat32i64 +@ cdecl _wstat64(wstr ptr) MSVCRT__wstat64 +@ cdecl _wstat64i32(wstr ptr) MSVCRT__wstat64i32 +@ cdecl _wstrdate(ptr) MSVCRT__wstrdate +@ cdecl _wstrdate_s(ptr long) +@ cdecl _wstrtime(ptr) MSVCRT__wstrtime +@ cdecl _wstrtime_s(ptr long) +@ cdecl _wsystem(wstr) +@ cdecl _wtempnam(wstr wstr) MSVCRT__wtempnam +@ cdecl _wtmpnam(ptr) MSVCRT_wtmpnam +@ stub _wtmpnam_s +@ cdecl _wtof(wstr) MSVCRT__wtof +@ cdecl _wtof_l(wstr ptr) MSVCRT__wtof_l +@ cdecl _wtoi(wstr) MSVCRT__wtoi +@ cdecl -ret64 _wtoi64(wstr) MSVCRT__wtoi64 +@ cdecl -ret64 _wtoi64_l(wstr ptr) MSVCRT__wtoi64_l +@ cdecl _wtoi_l(wstr ptr) MSVCRT__wtoi_l +@ cdecl _wtol(wstr) MSVCRT__wtol +@ cdecl _wtol_l(wstr ptr) MSVCRT__wtol_l +@ stub _wtoll +@ stub _wtoll_l +@ cdecl _wunlink(wstr) MSVCRT__wunlink +@ cdecl _wutime32(wstr ptr) +@ cdecl _wutime64(wstr ptr) +@ cdecl _y0(double) MSVCRT__y0 +@ cdecl _y1(double) MSVCRT__y1 +@ cdecl _yn(long double) MSVCRT__yn +@ cdecl abort() MSVCRT_abort +@ cdecl abs(long) MSVCRT_abs +@ cdecl acos(double) MSVCRT_acos +@ cdecl -arch=arm,x86_64 acosf(float) MSVCRT_acosf +@ stub acosh +@ stub acoshf +@ stub acoshl +@ cdecl asctime(ptr) MSVCRT_asctime +@ 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 atan(double) MSVCRT_atan +@ cdecl atan2(double double) MSVCRT_atan2 +@ cdecl -arch=arm,x86_64 atan2f(float float) MSVCRT_atan2f +@ cdecl -arch=arm,x86_64 atanf(float) MSVCRT_atanf +@ stub atanh +@ stub atanhf +@ stub atanhl +@ cdecl atof(str) MSVCRT_atof +@ cdecl atoi(str) MSVCRT_atoi +@ cdecl atol(str) ntdll.atol +@ stub atoll +@ cdecl bsearch(ptr ptr long long ptr) MSVCRT_bsearch +@ cdecl bsearch_s(ptr ptr long long ptr ptr) MSVCRT_bsearch_s +@ cdecl btowc(long) MSVCRT_btowc +@ stub c16rtomb +@ stub c32rtomb +@ stub cabs +@ stub cabsf +@ stub cabsl +@ stub cacos +@ stub cacosf +@ stub cacosh +@ stub cacoshf +@ stub cacoshl +@ stub cacosl +@ cdecl calloc(long long) MSVCRT_calloc +@ stub carg +@ stub cargf +@ stub cargl +@ stub casin +@ stub casinf +@ stub casinh +@ stub casinhf +@ stub casinhl +@ stub casinl +@ stub catan +@ stub catanf +@ stub catanh +@ stub catanhf +@ stub catanhl +@ stub catanl +@ cdecl cbrt(double) MSVCR120_cbrt +@ cdecl cbrtf(float) MSVCR120_cbrtf +@ cdecl cbrtl(double) MSVCR120_cbrtl +@ stub ccos +@ stub ccosf +@ stub ccosh +@ stub ccoshf +@ stub ccoshl +@ stub ccosl +@ cdecl ceil(double) MSVCRT_ceil +@ cdecl -arch=arm,x86_64 ceilf(float) MSVCRT_ceilf +@ stub cexp +@ stub cexpf +@ stub cexpl +@ stub cimag +@ stub cimagf +@ stub cimagl +@ cdecl clearerr(ptr) MSVCRT_clearerr +@ stub clearerr_s +@ cdecl clock() MSVCRT_clock +@ stub clog +@ stub clog10 +@ stub clog10f +@ stub clog10l +@ stub clogf +@ stub clogl +@ stub conj +@ stub conjf +@ stub conjl +@ cdecl copysign(double double) MSVCRT__copysign +@ cdecl copysignf(float float) MSVCRT__copysignf +@ cdecl copysignl(double double) MSVCRT__copysign +@ cdecl cos(double) MSVCRT_cos +@ cdecl -arch=arm,x86_64 cosf(float) MSVCRT_cosf +@ cdecl cosh(double) MSVCRT_cosh +@ cdecl -arch=arm,x86_64 coshf(float) MSVCRT_coshf +@ stub cpow +@ stub cpowf +@ stub cpowl +@ stub cproj +@ stub cprojf +@ stub cprojl +@ stub creal +@ stub crealf +@ stub creall +@ stub csin +@ stub csinf +@ stub csinh +@ stub csinhf +@ stub csinhl +@ stub csinl +@ stub csqrt +@ stub csqrtf +@ stub csqrtl +@ stub ctan +@ stub ctanf +@ stub ctanh +@ stub ctanhf +@ stub ctanhl +@ stub ctanl +@ cdecl -ret64 div(long long) MSVCRT_div +@ cdecl erf(double) MSVCR120_erf +@ stub erfc +@ stub erfcf +@ stub erfcl +@ cdecl erff(double) MSVCR120_erff +@ cdecl erfl(double) MSVCR120_erfl +@ cdecl exit(long) MSVCRT_exit +@ cdecl exp(double) MSVCRT_exp +@ cdecl exp2(double) MSVCR120_exp2 +@ cdecl exp2f(float) MSVCR120_exp2f +@ cdecl exp2l(double) MSVCR120_exp2l +@ cdecl -arch=arm,x86_64 expf(float) MSVCRT_expf +@ stub expm1 +@ stub expm1f +@ stub expm1l +@ cdecl fabs(double) MSVCRT_fabs +@ cdecl fclose(ptr) MSVCRT_fclose +@ stub fdim +@ stub fdimf +@ stub fdiml +@ stub feclearexcept +@ stub fegetenv +@ stub fegetexceptflag +@ stub fegetround +@ stub feholdexcept +@ cdecl feof(ptr) MSVCRT_feof +@ cdecl ferror(ptr) MSVCRT_ferror +@ stub fesetenv +@ stub fesetexceptflag +@ stub fesetround +@ stub fetestexcept +@ cdecl fflush(ptr) MSVCRT_fflush +@ cdecl fgetc(ptr) MSVCRT_fgetc +@ cdecl fgetpos(ptr ptr) MSVCRT_fgetpos +@ cdecl fgets(ptr long ptr) MSVCRT_fgets +@ cdecl fgetwc(ptr) MSVCRT_fgetwc +@ cdecl fgetws(ptr long ptr) MSVCRT_fgetws +@ cdecl floor(double) MSVCRT_floor +@ cdecl -arch=arm,x86_64 floorf(float) MSVCRT_floorf +@ stub fma +@ stub fmaf +@ stub fmal +@ cdecl fmax(double double) MSVCR120_fmax +@ cdecl fmaxf(float float) MSVCR120_fmaxf +@ cdecl fmaxl(double double) MSVCR120_fmax +@ stub fmin +@ stub fminf +@ stub fminl +@ cdecl fmod(double double) MSVCRT_fmod +@ cdecl -arch=arm,x86_64 fmodf(float float) MSVCRT_fmodf +@ cdecl fopen(str str) MSVCRT_fopen +@ cdecl fopen_s(ptr str str) MSVCRT_fopen_s +@ cdecl fputc(long ptr) MSVCRT_fputc +@ cdecl fputs(str ptr) MSVCRT_fputs +@ cdecl fputwc(long ptr) MSVCRT_fputwc +@ cdecl fputws(wstr ptr) MSVCRT_fputws +@ cdecl fread(ptr long long ptr) MSVCRT_fread +@ cdecl fread_s(ptr long long long ptr) MSVCRT_fread_s +@ cdecl free(ptr) MSVCRT_free +@ cdecl freopen(str str ptr) MSVCRT_freopen +@ cdecl freopen_s(ptr str str ptr) MSVCRT_freopen_s +@ cdecl frexp(double ptr) MSVCRT_frexp +@ cdecl fseek(ptr long long) MSVCRT_fseek +@ cdecl fsetpos(ptr ptr) MSVCRT_fsetpos +@ cdecl ftell(ptr) MSVCRT_ftell +@ cdecl fwrite(ptr long long ptr) MSVCRT_fwrite +@ cdecl getc(ptr) MSVCRT_getc +@ cdecl getchar() MSVCRT_getchar +@ cdecl getenv(str) MSVCRT_getenv +@ cdecl getenv_s(ptr ptr long str) +@ cdecl gets(str) MSVCRT_gets +@ stub gets_s +@ cdecl getwc(ptr) MSVCRT_getwc +@ cdecl getwchar() MSVCRT_getwchar +@ stub hypot +@ stub ilogb +@ stub ilogbf +@ stub ilogbl +@ stub imaxabs +@ stub imaxdiv +@ cdecl is_wctype(long long) ntdll.iswctype +@ cdecl isalnum(long) MSVCRT_isalnum +@ cdecl isalpha(long) MSVCRT_isalpha +@ stub isblank +@ cdecl iscntrl(long) MSVCRT_iscntrl +@ cdecl isdigit(long) MSVCRT_isdigit +@ cdecl isgraph(long) MSVCRT_isgraph +@ cdecl isleadbyte(long) MSVCRT_isleadbyte +@ cdecl islower(long) MSVCRT_islower +@ cdecl isprint(long) MSVCRT_isprint +@ cdecl ispunct(long) MSVCRT_ispunct +@ cdecl isspace(long) MSVCRT_isspace +@ cdecl isupper(long) MSVCRT_isupper +@ cdecl iswalnum(long) MSVCRT_iswalnum +@ cdecl iswalpha(long) ntdll.iswalpha +@ cdecl iswascii(long) MSVCRT_iswascii +@ stub iswblank +@ cdecl iswcntrl(long) MSVCRT_iswcntrl +@ cdecl iswctype(long long) ntdll.iswctype +@ cdecl iswdigit(long) MSVCRT_iswdigit +@ cdecl iswgraph(long) MSVCRT_iswgraph +@ cdecl iswlower(long) MSVCRT_iswlower +@ cdecl iswprint(long) MSVCRT_iswprint +@ cdecl iswpunct(long) MSVCRT_iswpunct +@ cdecl iswspace(long) MSVCRT_iswspace +@ cdecl iswupper(long) MSVCRT_iswupper +@ cdecl iswxdigit(long) MSVCRT_iswxdigit +@ cdecl isxdigit(long) MSVCRT_isxdigit +@ cdecl labs(long) MSVCRT_labs +@ cdecl ldexp(double long) MSVCRT_ldexp +@ cdecl ldiv(long long) MSVCRT_ldiv +@ stub lgamma +@ stub lgammaf +@ stub lgammal +@ cdecl -ret64 llabs(int64) MSVCRT_llabs +@ stub lldiv +@ cdecl -ret64 llrint(double) MSVCR120_llrint +@ cdecl -ret64 llrintf(float) MSVCR120_llrintf +@ cdecl -ret64 llrintl(double) MSVCR120_llrintl +@ cdecl -ret64 llround(double) MSVCR120_llround +@ cdecl -ret64 llroundf(float) MSVCR120_llroundf +@ cdecl -ret64 llroundl(double) MSVCR120_llroundl +@ cdecl localeconv() MSVCRT_localeconv +@ cdecl log(double) MSVCRT_log +@ cdecl log10(double) MSVCRT_log10 +@ cdecl -arch=arm,x86_64 log10f(float) MSVCRT_log10f +@ stub log1p +@ stub log1pf +@ stub log1pl +@ cdecl log2(double) MSVCR120_log2 +@ cdecl log2f(float) MSVCR120_log2f +@ cdecl log2l(double) MSVCR120_log2l +@ stub logb +@ stub logbf +@ stub logbl +@ cdecl -arch=arm,x86_64 logf(float) MSVCRT_logf +@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) MSVCRT_longjmp +@ cdecl lrint(double) MSVCR120_lrint +@ cdecl lrintf(float) MSVCR120_lrintf +@ cdecl lrintl(double) MSVCR120_lrintl +@ cdecl lround(double) MSVCR120_lround +@ cdecl lroundf(float) MSVCR120_lroundf +@ cdecl lroundl(double) MSVCR120_lroundl +@ cdecl malloc(long) MSVCRT_malloc +@ cdecl mblen(ptr long) MSVCRT_mblen +@ cdecl mbrlen(ptr long ptr) MSVCRT_mbrlen +@ stub mbrtoc16 +@ stub mbrtoc32 +@ cdecl mbrtowc(ptr str long ptr) MSVCRT_mbrtowc +@ cdecl mbsrtowcs(ptr ptr long ptr) MSVCRT_mbsrtowcs +@ stub mbsrtowcs_s +@ cdecl mbstowcs(ptr str long) MSVCRT_mbstowcs +@ cdecl mbstowcs_s(ptr ptr long str long) MSVCRT__mbstowcs_s +@ cdecl mbtowc(ptr str long) MSVCRT_mbtowc +@ cdecl memchr(ptr long long) MSVCRT_memchr +@ cdecl memcmp(ptr ptr long) MSVCRT_memcmp +@ cdecl memcpy(ptr ptr long) MSVCRT_memcpy +@ cdecl memcpy_s(ptr long ptr long) MSVCRT_memcpy_s +@ cdecl memmove(ptr ptr long) MSVCRT_memmove +@ cdecl memmove_s(ptr long ptr long) MSVCRT_memmove_s +@ cdecl memset(ptr long long) MSVCRT_memset +@ cdecl modf(double ptr) MSVCRT_modf +@ cdecl -arch=arm,x86_64 modff(float ptr) MSVCRT_modff +@ stub nan +@ stub nanf +@ stub nanl +@ stub nearbyint +@ stub nearbyintf +@ stub nearbyintl +@ stub nextafter +@ stub nextafterf +@ stub nextafterl +@ stub nexttoward +@ stub nexttowardf +@ stub nexttowardl +@ stub norm +@ stub normf +@ stub norml +@ cdecl perror(str) MSVCRT_perror +@ cdecl pow(double double) MSVCRT_pow +@ cdecl -arch=arm,x86_64 powf(float float) MSVCRT_powf +@ cdecl putc(long ptr) MSVCRT_putc +@ cdecl putchar(long) MSVCRT_putchar +@ cdecl puts(str) MSVCRT_puts +@ cdecl putwc(long ptr) MSVCRT_fputwc +@ cdecl putwchar(long) MSVCRT__fputwchar +@ cdecl qsort(ptr long long ptr) MSVCRT_qsort +@ cdecl qsort_s(ptr long long ptr ptr) MSVCRT_qsort_s +@ stub quick_exit +@ cdecl raise(long) MSVCRT_raise +@ cdecl rand() MSVCRT_rand +@ cdecl rand_s(ptr) MSVCRT_rand_s +@ cdecl realloc(ptr long) MSVCRT_realloc +@ stub remainder +@ stub remainderf +@ stub remainderl +@ cdecl remove(str) MSVCRT_remove +@ stub remquo +@ stub remquof +@ stub remquol +@ cdecl rename(str str) MSVCRT_rename +@ cdecl rewind(ptr) MSVCRT_rewind +@ cdecl rint(double) MSVCR120_rint +@ cdecl rintf(float) MSVCR120_rintf +@ cdecl rintl(double) MSVCR120_rintl +@ cdecl round(double) MSVCR120_round +@ cdecl roundf(float) MSVCR120_roundf +@ cdecl roundl(double) MSVCR120_roundl +@ stub scalbln +@ stub scalblnf +@ stub scalblnl +@ stub scalbn +@ stub scalbnf +@ stub scalbnl +@ stub set_terminate +@ stub set_unexpected +@ cdecl setbuf(ptr ptr) MSVCRT_setbuf +@ cdecl -arch=arm,x86_64 -norelay -private setjmp(ptr) MSVCRT__setjmp +@ cdecl setlocale(long str) MSVCRT_setlocale +@ cdecl setvbuf(ptr str long long) MSVCRT_setvbuf +@ cdecl signal(long long) MSVCRT_signal +@ cdecl sin(double) MSVCRT_sin +@ cdecl -arch=arm,x86_64 sinf(float) MSVCRT_sinf +@ cdecl sinh(double) MSVCRT_sinh +@ cdecl -arch=arm,x86_64 sinhf(float) MSVCRT_sinhf +@ cdecl sqrt(double) MSVCRT_sqrt +@ cdecl -arch=arm,x86_64 sqrtf(float) MSVCRT_sqrtf +@ cdecl srand(long) MSVCRT_srand +@ cdecl strcat(str str) ntdll.strcat +@ cdecl strcat_s(str long str) MSVCRT_strcat_s +@ cdecl strchr(str long) MSVCRT_strchr +@ cdecl strcmp(str str) MSVCRT_strcmp +@ cdecl strcoll(str str) MSVCRT_strcoll +@ cdecl strcpy(ptr str) ntdll.strcpy +@ cdecl strcpy_s(ptr long str) MSVCRT_strcpy_s +@ cdecl strcspn(str str) ntdll.strcspn +@ cdecl strerror(long) MSVCRT_strerror +@ cdecl strerror_s(ptr long long) MSVCRT_strerror_s +@ cdecl strftime(str long str ptr) MSVCRT_strftime +@ cdecl strlen(str) MSVCRT_strlen +@ cdecl strncat(str str long) MSVCRT_strncat +@ cdecl strncat_s(str long str long) MSVCRT_strncat_s +@ cdecl strncmp(str str long) MSVCRT_strncmp +@ cdecl strncpy(ptr str long) MSVCRT_strncpy +@ cdecl strncpy_s(ptr long str long) MSVCRT_strncpy_s +@ cdecl strnlen(str long) MSVCRT_strnlen +@ cdecl strpbrk(str str) ntdll.strpbrk +@ cdecl strrchr(str long) MSVCRT_strrchr +@ cdecl strspn(str str) ntdll.strspn +@ cdecl strstr(str str) MSVCRT_strstr +@ cdecl strtod(str ptr) MSVCRT_strtod +@ stub strtof +@ stub strtoimax +@ cdecl strtok(str str) MSVCRT_strtok +@ cdecl strtok_s(ptr str ptr) MSVCRT_strtok_s +@ cdecl strtol(str ptr long) MSVCRT_strtol +@ stub strtold +@ cdecl -ret64 strtoll(str ptr long) MSVCRT_strtoi64 +@ cdecl strtoul(str ptr long) MSVCRT_strtoul +@ cdecl -ret64 strtoull(str ptr long) MSVCRT_strtoui64 +@ stub strtoumax +@ cdecl strxfrm(ptr str long) MSVCRT_strxfrm +@ cdecl system(str) MSVCRT_system +@ cdecl tan(double) MSVCRT_tan +@ cdecl -arch=arm,x86_64 tanf(float) MSVCRT_tanf +@ cdecl tanh(double) MSVCRT_tanh +@ cdecl -arch=arm,x86_64 tanhf(float) MSVCRT_tanhf +@ cdecl terminate() MSVCRT_terminate +@ stub tgamma +@ stub tgammaf +@ stub tgammal +@ cdecl tmpfile() MSVCRT_tmpfile +@ cdecl tmpfile_s(ptr) MSVCRT_tmpfile_s +@ cdecl tmpnam(ptr) MSVCRT_tmpnam +@ stub tmpnam_s +@ cdecl tolower(long) MSVCRT_tolower +@ cdecl toupper(long) MSVCRT_toupper +@ stub towctrans +@ cdecl towlower(long) MSVCRT_towlower +@ cdecl towupper(long) MSVCRT_towupper +@ cdecl trunc(double) MSVCR120_trunc +@ cdecl truncf(float) MSVCR120_truncf +@ cdecl truncl(double) MSVCR120_truncl +@ stub unexpected +@ cdecl ungetc(long ptr) MSVCRT_ungetc +@ cdecl ungetwc(long ptr) MSVCRT_ungetwc +@ cdecl wcrtomb(ptr long ptr) MSVCRT_wcrtomb +@ stub wcrtomb_s +@ cdecl wcscat(wstr wstr) ntdll.wcscat +@ cdecl wcscat_s(wstr long wstr) MSVCRT_wcscat_s +@ cdecl wcschr(wstr long) MSVCRT_wcschr +@ cdecl wcscmp(wstr wstr) ntdll.wcscmp +@ cdecl wcscoll(wstr wstr) MSVCRT_wcscoll +@ cdecl wcscpy(ptr wstr) ntdll.wcscpy +@ cdecl wcscpy_s(ptr long wstr) MSVCRT_wcscpy_s +@ cdecl wcscspn(wstr wstr) ntdll.wcscspn +@ cdecl wcsftime(ptr long wstr ptr) MSVCRT_wcsftime +@ cdecl wcslen(wstr) MSVCRT_wcslen +@ cdecl wcsncat(wstr wstr long) ntdll.wcsncat +@ cdecl wcsncat_s(wstr long wstr long) MSVCRT_wcsncat_s +@ cdecl wcsncmp(wstr wstr long) MSVCRT_wcsncmp +@ cdecl wcsncpy(ptr wstr long) MSVCRT_wcsncpy +@ cdecl wcsncpy_s(ptr long wstr long) MSVCRT_wcsncpy_s +@ cdecl wcsnlen(wstr long) MSVCRT_wcsnlen +@ cdecl wcspbrk(wstr wstr) MSVCRT_wcspbrk +@ cdecl wcsrchr(wstr long) ntdll.wcsrchr +@ cdecl wcsrtombs(ptr ptr long ptr) MSVCRT_wcsrtombs +@ cdecl wcsrtombs_s(ptr ptr long ptr long ptr) MSVCRT_wcsrtombs_s +@ cdecl wcsspn(wstr wstr) ntdll.wcsspn +@ cdecl wcsstr(wstr wstr) MSVCRT_wcsstr +@ cdecl wcstod(wstr ptr) MSVCRT_wcstod +@ stub wcstof +@ stub wcstoimax +@ cdecl wcstok(wstr wstr) MSVCRT_wcstok +@ cdecl wcstok_s(ptr wstr ptr) MSVCRT_wcstok_s +@ cdecl wcstol(wstr ptr long) ntdll.wcstol +@ stub wcstold +@ stub wcstoll +@ cdecl wcstombs(ptr ptr long) MSVCRT_wcstombs +@ cdecl wcstombs_s(ptr ptr long wstr long) MSVCRT_wcstombs_s +@ cdecl wcstoul(wstr ptr long) MSVCRT_wcstoul +@ stub wcstoull +@ stub wcstoumax +@ cdecl wcsxfrm(ptr wstr long) MSVCRT_wcsxfrm +@ cdecl wctob(long) MSVCRT_wctob +@ cdecl wctomb(ptr long) MSVCRT_wctomb +@ cdecl wctomb_s(ptr ptr long long) MSVCRT_wctomb_s +@ stub wctrans +@ stub wctype +@ cdecl wmemcpy_s(ptr long ptr long) +@ cdecl wmemmove_s(ptr long ptr long) diff -Nru wine1.7-1.7.50/dlls/urlmon/internet.c wine1.7-1.7.55/dlls/urlmon/internet.c --- wine1.7-1.7.50/dlls/urlmon/internet.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/urlmon/internet.c 2015-11-13 14:32:40.000000000 +0000 @@ -536,10 +536,8 @@ if(feature >= FEATURE_ENTRY_COUNT) return E_FAIL; - if(flags & ~supported_flags) { + if(flags & ~supported_flags) FIXME("Unsupported flags: %08x\n", flags & ~supported_flags); - return E_NOTIMPL; - } if(flags & SET_FEATURE_ON_PROCESS) set_feature_on_process(feature, enable); diff -Nru wine1.7-1.7.50/dlls/urlmon/session.c wine1.7-1.7.55/dlls/urlmon/session.c --- wine1.7-1.7.50/dlls/urlmon/session.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/urlmon/session.c 2015-11-13 14:32:40.000000000 +0000 @@ -545,7 +545,7 @@ ' ','(','c','o','m','p','a','t','i','b','l','e',';', ' ','M','S','I','E',' ','8','.','0',';', ' ','W','i','n','d','o','w','s',' ','%','s','%','d','.','%','d',';', - ' ','%','s',';',' ','T','r','i','d','e','n','t','/','5','.','0',0}; + ' ','%','s','T','r','i','d','e','n','t','/','5','.','0',0}; static const WCHAR post_platform_keyW[] = {'S','O','F','T','W','A','R','E', '\\','M','i','c','r','o','s','o','f','t', @@ -555,9 +555,8 @@ '\\','5','.','0','\\','U','s','e','r',' ','A','g','e','n','t', '\\','P','o','s','t',' ','P','l','a','t','f','o','r','m',0}; static const WCHAR ntW[] = {'N','T',' ',0}; - static const WCHAR win32W[] = {'W','i','n','3','2',0}; - static const WCHAR win64W[] = {'W','i','n','6','4',0}; - static const WCHAR wow64W[] = {'W','O','W','6','4',0}; + static const WCHAR win64W[] = {'W','i','n','6','4',';',' ','x','6','4',';',' ',0}; + static const WCHAR wow64W[] = {'W','O','W','6','4',';',' ',0}; static const WCHAR emptyW[] = {0}; if(user_agent) @@ -571,7 +570,7 @@ else if(IsWow64Process(GetCurrentProcess(), &is_wow) && is_wow) os_type = wow64W; else - os_type = win32W; + os_type = emptyW; sprintfW(buf, formatW, is_nt, info.dwMajorVersion, info.dwMinorVersion, os_type); len = strlenW(buf); diff -Nru wine1.7-1.7.50/dlls/urlmon/tests/protocol.c wine1.7-1.7.55/dlls/urlmon/tests/protocol.c --- wine1.7-1.7.50/dlls/urlmon/tests/protocol.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/urlmon/tests/protocol.c 2015-11-13 14:32:40.000000000 +0000 @@ -887,6 +887,9 @@ case BINDSTATUS_RESERVED_7: trace("BINDSTATUS_RESERVED_7\n"); break; + case BINDSTATUS_RESERVED_8: + trace("BINDSTATUS_RESERVED_8\n"); + break; default: ok(0, "Unexpected status %d (%d)\n", ulStatusCode, ulStatusCode-BINDSTATUS_LAST); }; @@ -1399,6 +1402,9 @@ CHECK_EXPECT(GetBindString_ROOTDOC_URL); ok(cEl == 1, "cEl=%d, expected 1\n", cEl); return E_NOTIMPL; + case BINDSTRING_ENTERPRISE_ID: + ok(cEl == 1, "cEl=%d, expected 1\n", cEl); + return E_NOTIMPL; default: ok(0, "unexpected ulStringType %d\n", ulStringType); } diff -Nru wine1.7-1.7.50/dlls/urlmon/tests/url.c wine1.7-1.7.55/dlls/urlmon/tests/url.c --- wine1.7-1.7.50/dlls/urlmon/tests/url.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/urlmon/tests/url.c 2015-11-13 14:32:40.000000000 +0000 @@ -2863,7 +2863,7 @@ url_a = (flags & BINDTEST_INVALID_CN) ? "https://209.46.25.134/favicon.ico" : "https://test.winehq.org/tests/hello.html"; break; case FTP_TEST: - url_a = "ftp://ftp.winehq.org/pub/other/winelogo.xcf.tar.bz2"; + url_a = "ftp://ftp.winehq.org/welcome.msg"; break; default: url_a = "winetest:test"; diff -Nru wine1.7-1.7.50/dlls/user32/button.c wine1.7-1.7.55/dlls/user32/button.c --- wine1.7-1.7.50/dlls/user32/button.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/button.c 2015-11-13 14:32:40.000000000 +0000 @@ -201,7 +201,7 @@ /* retrieve the button text; returned buffer must be freed by caller */ static inline WCHAR *get_button_text( HWND hwnd ) { - INT len = 512; + static const INT len = 512; WCHAR *buffer = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) ); if (buffer) InternalGetWindowText( hwnd, buffer, len + 1 ); return buffer; @@ -282,16 +282,18 @@ case WM_PRINTCLIENT: case WM_PAINT: + { + PAINTSTRUCT ps; + HDC hdc = wParam ? (HDC)wParam : BeginPaint( hWnd, &ps ); if (btnPaintFunc[btn_type]) { - PAINTSTRUCT ps; - HDC hdc = wParam ? (HDC)wParam : BeginPaint( hWnd, &ps ); int nOldMode = SetBkMode( hdc, OPAQUE ); (btnPaintFunc[btn_type])( hWnd, hdc, ODA_DRAWENTIRE ); SetBkMode(hdc, nOldMode); /* reset painting mode */ - if( !wParam ) EndPaint( hWnd, &ps ); } + if ( !wParam ) EndPaint( hWnd, &ps ); break; + } case WM_KEYDOWN: if (wParam == VK_SPACE) @@ -351,9 +353,13 @@ (state & BST_INDETERMINATE) ? 0 : ((state & 3) + 1), 0 ); break; } + ReleaseCapture(); BUTTON_NOTIFY_PARENT(hWnd, BN_CLICKED); } - ReleaseCapture(); + else + { + ReleaseCapture(); + } break; case WM_CAPTURECHANGED: @@ -443,7 +449,6 @@ break; case BM_SETSTYLE: - if ((wParam & BS_TYPEMASK) >= MAX_BTN_TYPE) break; btn_type = wParam & BS_TYPEMASK; style = (style & ~BS_TYPEMASK) | btn_type; WIN_SetStyle( hWnd, style, BS_TYPEMASK & ~style ); diff -Nru wine1.7-1.7.50/dlls/user32/combo.c wine1.7-1.7.55/dlls/user32/combo.c --- wine1.7-1.7.50/dlls/user32/combo.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/combo.c 2015-11-13 14:32:40.000000000 +0000 @@ -974,7 +974,7 @@ HMONITOR monitor; MONITORINFO mon_info; RECT rect,r; - int nItems = 0; + int nItems; int nDroppedHeight; TRACE("[%p]: drop down\n", lphc->self); diff -Nru wine1.7-1.7.50/dlls/user32/cursoricon.c wine1.7-1.7.55/dlls/user32/cursoricon.c --- wine1.7-1.7.50/dlls/user32/cursoricon.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/cursoricon.c 2015-11-13 14:32:40.000000000 +0000 @@ -158,11 +158,6 @@ return obj; } -static void release_icon_ptr( HICON handle, struct cursoricon_object *ptr ) -{ - release_user_handle_ptr( ptr ); -} - static struct cursoricon_frame *get_icon_frame( struct cursoricon_object *obj, int istep ) { struct static_cursoricon_object *req_frame; @@ -183,16 +178,14 @@ return &req_frame->frame; } -static void release_icon_frame( struct cursoricon_object *obj, int istep, struct cursoricon_frame *frame ) +static void release_icon_frame( struct cursoricon_object *obj, struct cursoricon_frame *frame ) { if (obj->is_ani) { - struct animated_cursoricon_object *ani_icon_data; struct cursoricon_object *frameobj; - ani_icon_data = (struct animated_cursoricon_object *) obj; frameobj = (struct cursoricon_object *) (((char *)frame) - FIELD_OFFSET(struct static_cursoricon_object, frame)); - release_icon_ptr( ani_icon_data->frames[istep], frameobj ); + release_user_handle_ptr( frameobj ); } } @@ -227,7 +220,7 @@ if (frame->alpha) DeleteObject( frame->alpha ); if (frame->color) DeleteObject( frame->color ); DeleteObject( frame->mask ); - release_icon_frame( obj, 0, frame ); + release_icon_frame( obj, frame ); } else { @@ -483,8 +476,8 @@ frame = get_icon_frame( info, 0 ); size->cx = frame->width; size->cy = frame->height; - release_icon_frame( info, 0, frame); - release_icon_ptr( handle, info ); + release_icon_frame( info, frame); + release_user_handle_ptr( info ); return TRUE; } @@ -732,8 +725,7 @@ * * Create the alpha bitmap for a 32-bpp icon that has an alpha channel. */ -static HBITMAP create_alpha_bitmap( HBITMAP color, HBITMAP mask, - const BITMAPINFO *src_info, const void *color_bits ) +static HBITMAP create_alpha_bitmap( HBITMAP color, const BITMAPINFO *src_info, const void *color_bits ) { HBITMAP alpha = 0; BITMAPINFO *info = NULL; @@ -911,7 +903,7 @@ color_bits, bmi_copy, DIB_RGB_COLORS, SRCCOPY ); if (bmi_has_alpha( bmi_copy, color_bits )) - alpha = create_alpha_bitmap( color, mask, 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; @@ -947,7 +939,7 @@ HeapFree( GetProcessHeap(), 0, bmi_copy ); if (ret) - hObj = alloc_icon_handle( FALSE, 1 ); + hObj = alloc_icon_handle( FALSE, 0 ); if (hObj) { struct cursoricon_object *info = get_icon_ptr( hObj ); @@ -963,7 +955,7 @@ frame->color = color; frame->mask = mask; frame->alpha = alpha; - release_icon_frame( info, 0, frame ); + release_icon_frame( info, frame ); if (!IS_INTRESOURCE(resname)) { info->resname = HeapAlloc( GetProcessHeap(), 0, (strlenW(resname) + 1) * sizeof(WCHAR) ); @@ -976,7 +968,7 @@ info->rsrc = rsrc; list_add_head( &icon_cache, &info->entry ); } - release_icon_ptr( hObj, info ); + release_user_handle_ptr( info ); } else { @@ -1102,9 +1094,9 @@ struct cursoricon_object *info; DWORD *frame_rates = NULL; DWORD *frame_seq = NULL; - ani_header header = {0}; + ani_header header; BOOL use_seq = FALSE; - HCURSOR cursor = 0; + HCURSOR cursor; UINT i; BOOL error = FALSE; HICON *frames; @@ -1229,7 +1221,7 @@ { FIXME_(cursor)("Completely failed to create animated cursor!\n"); ani_icon_data->num_frames = 0; - release_icon_ptr( cursor, info ); + release_user_handle_ptr( info ); free_icon_handle( cursor ); HeapFree( GetProcessHeap(), 0, frames ); return 0; @@ -1271,11 +1263,11 @@ frame->delay = frame_rates[i]; else frame->delay = ~0; - release_icon_frame( info, i, frame ); + release_icon_frame( info, frame ); } HeapFree( GetProcessHeap(), 0, frames ); - release_icon_ptr( cursor, info ); + release_user_handle_ptr( info ); return cursor; } @@ -1583,7 +1575,7 @@ SetLastError( ERROR_INVALID_CURSOR_HANDLE ); return 0; } - if ((hNew = alloc_icon_handle( FALSE, 1 ))) + if ((hNew = alloc_icon_handle( FALSE, 0 ))) { struct cursoricon_frame *frameOld, *frameNew; @@ -1592,14 +1584,14 @@ ptrNew->hotspot = ptrOld->hotspot; if (!(frameOld = get_icon_frame( ptrOld, 0 ))) { - release_icon_ptr( hIcon, ptrOld ); + release_user_handle_ptr( ptrOld ); SetLastError( ERROR_INVALID_CURSOR_HANDLE ); return 0; } if (!(frameNew = get_icon_frame( ptrNew, 0 ))) { - release_icon_frame( ptrOld, 0, frameOld ); - release_icon_ptr( hIcon, ptrOld ); + release_icon_frame( ptrOld, frameOld ); + release_user_handle_ptr( ptrOld ); SetLastError( ERROR_INVALID_CURSOR_HANDLE ); return 0; } @@ -1609,11 +1601,11 @@ frameNew->mask = copy_bitmap( frameOld->mask ); frameNew->color = copy_bitmap( frameOld->color ); frameNew->alpha = copy_bitmap( frameOld->alpha ); - release_icon_frame( ptrOld, 0, frameOld ); - release_icon_frame( ptrNew, 0, frameNew ); - release_icon_ptr( hNew, ptrNew ); + release_icon_frame( ptrOld, frameOld ); + release_icon_frame( ptrNew, frameNew ); + release_user_handle_ptr( ptrNew ); } - release_icon_ptr( hIcon, ptrOld ); + release_user_handle_ptr( ptrOld ); return hNew; } @@ -1631,7 +1623,7 @@ if (obj) { BOOL shared = (obj->rsrc != NULL); - release_icon_ptr( hIcon, obj ); + release_user_handle_ptr( obj ); ret = (GetCursor() != hIcon); if (!shared) free_icon_handle( hIcon ); } @@ -1688,7 +1680,7 @@ USER_Driver->pSetCursor( show_count >= 0 ? hCursor : 0 ); if (!(obj = get_icon_ptr( hOldCursor ))) return 0; - release_icon_ptr( hOldCursor, obj ); + release_user_handle_ptr( obj ); return hOldCursor; } @@ -1982,11 +1974,11 @@ *rate_jiffies = ptr->delay; else *rate_jiffies = frame->delay; - release_icon_frame( ptr, istep, frame ); + release_icon_frame( ptr, frame ); } } - release_icon_ptr( hCursor, ptr ); + release_user_handle_ptr( ptr ); return ret; } @@ -2057,7 +2049,7 @@ frame = get_icon_frame( ptr, 0 ); if (!frame) { - release_icon_ptr( icon, ptr ); + release_user_handle_ptr( ptr ); SetLastError( ERROR_INVALID_CURSOR_HANDLE ); return FALSE; } @@ -2084,8 +2076,8 @@ ret = FALSE; } module = ptr->module; - release_icon_frame( ptr, 0, frame ); - release_icon_ptr( icon, ptr ); + release_icon_frame( ptr, frame ); + release_user_handle_ptr( ptr ); if (ret && module) GetModuleFileNameW( module, info->szModName, MAX_PATH ); return ret; } @@ -2189,7 +2181,7 @@ DeleteDC( hdc ); - hObj = alloc_icon_handle( FALSE, 1 ); + hObj = alloc_icon_handle( FALSE, 0 ); if (hObj) { struct cursoricon_object *info = get_icon_ptr( hObj ); @@ -2202,8 +2194,8 @@ frame->height = height; frame->color = color; frame->mask = mask; - frame->alpha = create_alpha_bitmap( iconinfo->hbmColor, mask, NULL, NULL ); - release_icon_frame( info, 0, frame ); + frame->alpha = create_alpha_bitmap( iconinfo->hbmColor, NULL, NULL ); + release_icon_frame( info, frame ); if (info->is_icon) { info->hotspot.x = width / 2; @@ -2215,7 +2207,7 @@ info->hotspot.y = iconinfo->yHotspot; } - release_icon_ptr( hObj, info ); + release_user_handle_ptr( info ); } return hObj; } @@ -2260,19 +2252,19 @@ if (istep >= get_icon_steps( ptr )) { TRACE_(icon)("Stepped past end of animated frames=%d\n", istep); - release_icon_ptr( hIcon, ptr ); + release_user_handle_ptr( ptr ); return FALSE; } if (!(frame = get_icon_frame( ptr, istep ))) { FIXME_(icon)("Error retrieving icon frame %d\n", istep); - release_icon_ptr( hIcon, ptr ); + release_user_handle_ptr( ptr ); return FALSE; } if (!(hMemDC = CreateCompatibleDC( hdc ))) { - release_icon_frame( ptr, istep, frame ); - release_icon_ptr( hIcon, ptr ); + release_icon_frame( ptr, frame ); + release_user_handle_ptr( ptr ); return FALSE; } @@ -2385,8 +2377,8 @@ if (hB_off) DeleteObject(hB_off); failed: DeleteDC( hMemDC ); - release_icon_frame( ptr, istep, frame ); - release_icon_ptr( hIcon, ptr ); + release_icon_frame( ptr, frame ); + release_user_handle_ptr( ptr ); return result; } @@ -2908,7 +2900,7 @@ !icon->is_icon, flags ); else res = CopyIcon( hnd ); /* FIXME: change size if necessary */ - release_icon_ptr( hnd, icon ); + release_user_handle_ptr( icon ); if (res && (flags & LR_COPYDELETEORG)) DeleteObject( hnd ); return res; diff -Nru wine1.7-1.7.50/dlls/user32/dde_client.c wine1.7-1.7.55/dlls/user32/dde_client.c --- wine1.7-1.7.50/dlls/user32/dde_client.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/dde_client.c 2015-11-13 14:32:40.000000000 +0000 @@ -97,7 +97,7 @@ { HWND hwndClient; WDML_INSTANCE* pInstance; - WDML_CONV* pConv = NULL; + WDML_CONV* pConv; ATOM aSrv = 0, aTpc = 0; TRACE("(0x%x,%p,%p,%p)\n", idInst, hszService, hszTopic, pCC); @@ -1135,7 +1135,7 @@ { WDML_CONV* pConv; WDML_XACT* pXAct; - HDDEDATA hDdeData = 0; + HDDEDATA hDdeData; TRACE("(%p,%d,%p,%p,%x,%x,%d,%p)\n", pData, cbData, hConv, hszItem, wFmt, wType, dwTimeout, pdwResult); @@ -1373,7 +1373,7 @@ */ BOOL WINAPI DdeDisconnect(HCONV hConv) { - WDML_CONV* pConv = NULL; + WDML_CONV* pConv; WDML_XACT* pXAct; BOOL ret = FALSE; diff -Nru wine1.7-1.7.50/dlls/user32/dde_misc.c wine1.7-1.7.55/dlls/user32/dde_misc.c --- wine1.7-1.7.50/dlls/user32/dde_misc.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/dde_misc.c 2015-11-13 14:32:40.000000000 +0000 @@ -1881,7 +1881,7 @@ WDML_LINK* WDML_FindLink(WDML_INSTANCE* pInstance, HCONV hConv, WDML_SIDE side, HSZ hszItem, BOOL use_fmt, UINT uFmt) { - WDML_LINK* pCurrent = NULL; + WDML_LINK* pCurrent; for (pCurrent = pInstance->links[side]; pCurrent != NULL; pCurrent = pCurrent->next) { @@ -2061,7 +2061,7 @@ WDML_CONV* WDML_FindConv(WDML_INSTANCE* pInstance, WDML_SIDE side, HSZ hszService, HSZ hszTopic) { - WDML_CONV* pCurrent = NULL; + WDML_CONV* pCurrent; for (pCurrent = pInstance->convs[side]; pCurrent != NULL; pCurrent = pCurrent->next) { diff -Nru wine1.7-1.7.50/dlls/user32/dde_server.c wine1.7-1.7.55/dlls/user32/dde_server.c --- wine1.7-1.7.50/dlls/user32/dde_server.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/dde_server.c 2015-11-13 14:32:40.000000000 +0000 @@ -60,12 +60,12 @@ */ BOOL WINAPI DdePostAdvise(DWORD idInst, HSZ hszTopic, HSZ hszItem) { - WDML_INSTANCE* pInstance = NULL; - WDML_LINK* pLink = NULL; - HDDEDATA hDdeData = 0; - HGLOBAL hItemData = 0; - WDML_CONV* pConv = NULL; - ATOM atom = 0; + WDML_INSTANCE* pInstance; + WDML_LINK* pLink; + HDDEDATA hDdeData; + HGLOBAL hItemData; + WDML_CONV* pConv; + ATOM atom; UINT count; TRACE("(%d,%p,%p)\n", idInst, hszTopic, hszItem); @@ -378,7 +378,7 @@ { HWND hwndClient; HSZ hszApp, hszTop; - HDDEDATA hDdeData = 0; + HDDEDATA hDdeData; WDML_INSTANCE* pInstance; UINT_PTR uiLo, uiHi; diff -Nru wine1.7-1.7.50/dlls/user32/dialog.c wine1.7-1.7.55/dlls/user32/dialog.c --- wine1.7-1.7.50/dlls/user32/dialog.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/dialog.c 2015-11-13 14:32:40.000000000 +0000 @@ -489,7 +489,7 @@ POINT pos; SIZE size; DLG_TEMPLATE template; - DIALOGINFO * dlgInfo = NULL; + DIALOGINFO * dlgInfo; DWORD units = GetDialogBaseUnits(); BOOL ownerEnabled = TRUE; HMENU hMenu = 0; @@ -917,7 +917,7 @@ */ BOOL WINAPI EndDialog( HWND hwnd, INT_PTR retval ) { - BOOL wasEnabled = TRUE; + BOOL wasEnabled; DIALOGINFO * dlgInfo; HWND owner; diff -Nru wine1.7-1.7.50/dlls/user32/driver.c wine1.7-1.7.55/dlls/user32/driver.c --- wine1.7-1.7.50/dlls/user32/driver.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/driver.c 2015-11-13 14:32:40.000000000 +0000 @@ -134,6 +134,7 @@ GET_USER_FUNC(CreateDesktopWindow); GET_USER_FUNC(CreateWindow); GET_USER_FUNC(DestroyWindow); + GET_USER_FUNC(FlashWindowEx); GET_USER_FUNC(GetDC); GET_USER_FUNC(MsgWaitForMultipleObjectsEx); GET_USER_FUNC(ReleaseDC); @@ -410,6 +411,10 @@ { } +static void CDECL nulldrv_FlashWindowEx( FLASHWINFO *info ) +{ +} + static void CDECL nulldrv_GetDC( HDC hdc, HWND hwnd, HWND top_win, const RECT *win_rect, const RECT *top_rect, DWORD flags ) { @@ -546,6 +551,7 @@ nulldrv_CreateDesktopWindow, nulldrv_CreateWindow, nulldrv_DestroyWindow, + nulldrv_FlashWindowEx, nulldrv_GetDC, nulldrv_MsgWaitForMultipleObjectsEx, nulldrv_ReleaseDC, @@ -733,6 +739,11 @@ return load_driver()->pCreateWindow( hwnd ); } +static void CDECL loaderdrv_FlashWindowEx( FLASHWINFO *info ) +{ + load_driver()->pFlashWindowEx( info ); +} + static void CDECL loaderdrv_GetDC( HDC hdc, HWND hwnd, HWND top_win, const RECT *win_rect, const RECT *top_rect, DWORD flags ) { @@ -795,6 +806,7 @@ loaderdrv_CreateDesktopWindow, loaderdrv_CreateWindow, nulldrv_DestroyWindow, + loaderdrv_FlashWindowEx, loaderdrv_GetDC, nulldrv_MsgWaitForMultipleObjectsEx, nulldrv_ReleaseDC, diff -Nru wine1.7-1.7.50/dlls/user32/edit.c wine1.7-1.7.55/dlls/user32/edit.c --- wine1.7-1.7.50/dlls/user32/edit.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/edit.c 2015-11-13 14:32:40.000000000 +0000 @@ -498,7 +498,7 @@ LINEDEF *current_line; LINEDEF *previous_line; LINEDEF *start_line; - INT line_index = 0, nstart_line = 0, nstart_index = 0; + INT line_index = 0, nstart_line, nstart_index; INT line_count = es->line_count; INT orig_net_length; RECT rc; @@ -631,7 +631,7 @@ prev = current_line->net_length - 1; w = current_line->net_length; d = (float)current_line->width/(float)fw; - if (d > 1.2) d -= 0.2; + if (d > 1.2f) d -= 0.2f; next = prev/d; if (next >= prev) next = prev-1; do { @@ -1079,7 +1079,7 @@ INT x = 0; INT y = 0; INT w; - INT lw = 0; + INT lw; LINEDEF *line_def; index = min(index, len); @@ -2577,7 +2577,7 @@ LPWSTR p; HRGN hrgn = 0; LPWSTR buf = NULL; - UINT bufl = 0; + UINT bufl; TRACE("%s, can_undo %d, send_update %d\n", debugstr_w(lpsz_replace), can_undo, send_update); @@ -2726,8 +2726,7 @@ EDIT_EM_EmptyUndoBuffer(es); } - if (bufl) - HeapFree(GetProcessHeap(), 0, buf); + HeapFree(GetProcessHeap(), 0, buf); s += strl; @@ -2883,7 +2882,7 @@ */ static int calc_min_set_margin_size(HDC dc, INT left, INT right) { - WCHAR magic_string[] = {'\'','*','*','\'', 0}; + static const WCHAR magic_string[] = {'\'','*','*','\'', 0}; SIZE sz; GetTextExtentPointW(dc, magic_string, sizeof(magic_string)/sizeof(WCHAR) - 1, &sz); @@ -3923,12 +3922,11 @@ * WM_SIZE * */ -static void EDIT_WM_Size(EDITSTATE *es, UINT action, INT width, INT height) +static void EDIT_WM_Size(EDITSTATE *es, UINT action) { if ((action == SIZE_MAXIMIZED) || (action == SIZE_RESTORED)) { RECT rc; - TRACE("width = %d, height = %d\n", width, height); - SetRect(&rc, 0, 0, width, height); + GetClientRect(es->hwndSelf, &rc); EDIT_SetRectNP(es, &rc); EDIT_UpdateText(es, NULL, TRUE); } @@ -4301,7 +4299,7 @@ static void EDIT_GetCompositionStr(HIMC hIMC, LPARAM CompFlag, EDITSTATE *es) { LONG buflen; - LPWSTR lpCompStr = NULL; + LPWSTR lpCompStr; LPSTR lpCompStrAttr = NULL; DWORD dwBufLenAttr; @@ -4344,8 +4342,6 @@ dwBufLenAttr); lpCompStrAttr[dwBufLenAttr] = 0; } - else - lpCompStrAttr = NULL; } /* check for change in composition start */ @@ -5096,7 +5092,7 @@ break; case WM_SIZE: - EDIT_WM_Size(es, (UINT)wParam, LOWORD(lParam), HIWORD(lParam)); + EDIT_WM_Size(es, (UINT)wParam); break; case WM_STYLECHANGED: diff -Nru wine1.7-1.7.50/dlls/user32/hook.c wine1.7-1.7.55/dlls/user32/hook.c --- wine1.7-1.7.50/dlls/user32/hook.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/hook.c 2015-11-13 14:32:40.000000000 +0000 @@ -475,7 +475,7 @@ { struct user_thread_info *thread_info = get_user_thread_info(); struct hook_info info; - DWORD_PTR ret = 0; + DWORD_PTR ret; USER_CheckNotLock(); diff -Nru wine1.7-1.7.50/dlls/user32/icontitle.c wine1.7-1.7.55/dlls/user32/icontitle.c --- wine1.7-1.7.50/dlls/user32/icontitle.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/icontitle.c 2015-11-13 14:32:40.000000000 +0000 @@ -135,7 +135,7 @@ { RECT rect; HFONT hPrevFont; - HBRUSH hBrush = 0; + HBRUSH hBrush; COLORREF textColor = 0; if( bActive ) diff -Nru wine1.7-1.7.50/dlls/user32/listbox.c wine1.7-1.7.55/dlls/user32/listbox.c --- wine1.7-1.7.50/dlls/user32/listbox.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/listbox.c 2015-11-13 14:32:40.000000000 +0000 @@ -265,7 +265,7 @@ if (descr->style & WS_VSCROLL) SetScrollInfo( descr->self, SB_VERT, &info, TRUE ); - if (descr->style & WS_HSCROLL) + if ((descr->style & WS_HSCROLL) && descr->horz_extent) { info.nPos = descr->horz_pos; info.nPage = descr->width; @@ -274,6 +274,20 @@ info.fMask |= SIF_DISABLENOSCROLL; SetScrollInfo( descr->self, SB_HORZ, &info, TRUE ); } + else + { + if (descr->style & LBS_DISABLENOSCROLL) + { + info.nMin = 0; + info.nMax = 0; + info.fMask = SIF_RANGE | SIF_DISABLENOSCROLL; + SetScrollInfo( descr->self, SB_HORZ, &info, TRUE ); + } + else + { + ShowScrollBar( descr->self, SB_HORZ, FALSE ); + } + } } } @@ -821,7 +835,7 @@ */ static INT LISTBOX_FindStringPos( LB_DESCR *descr, LPCWSTR str, BOOL exact ) { - INT index, min, max, res = -1; + INT index, min, max, res; if (!(descr->style & LBS_SORT)) return -1; /* Add it at the end */ min = 0; @@ -864,7 +878,7 @@ */ static INT LISTBOX_FindFileStrPos( LB_DESCR *descr, LPCWSTR str ) { - INT min, max, res = -1; + INT min, max, res; if (!HAS_STRINGS(descr)) return LISTBOX_FindStringPos( descr, str, FALSE ); @@ -1248,6 +1262,8 @@ info.nMin = 0; info.nMax = descr->horz_extent ? descr->horz_extent - 1 : 0; info.fMask = SIF_RANGE; + if (descr->style & LBS_DISABLENOSCROLL) + info.fMask |= SIF_DISABLENOSCROLL; SetScrollInfo( descr->self, SB_HORZ, &info, TRUE ); } if (descr->horz_pos > extent - descr->width) diff -Nru wine1.7-1.7.50/dlls/user32/mdi.c wine1.7-1.7.55/dlls/user32/mdi.c --- wine1.7-1.7.50/dlls/user32/mdi.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/mdi.c 2015-11-13 14:32:40.000000000 +0000 @@ -838,7 +838,7 @@ static BOOL MDI_AugmentFrameMenu( HWND frame, HWND hChild ) { HMENU menu = GetMenu( frame ); - HMENU hSysPopup = 0; + HMENU hSysPopup; HBITMAP hSysMenuBitmap = 0; HICON hIcon; diff -Nru wine1.7-1.7.50/dlls/user32/menu.c wine1.7-1.7.55/dlls/user32/menu.c --- wine1.7-1.7.50/dlls/user32/menu.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/menu.c 2015-11-13 14:32:40.000000000 +0000 @@ -1458,6 +1458,7 @@ ** the menu owner has finished drawing. */ DRAWITEMSTRUCT dis; + COLORREF old_bk, old_text; dis.CtlType = ODT_MENU; dis.CtlID = 0; @@ -1475,8 +1476,12 @@ "hwndItem=%p, hdc=%p, rcItem=%s\n", hwndOwner, dis.itemID, dis.itemState, dis.itemAction, dis.hwndItem, dis.hDC, wine_dbgstr_rect( &dis.rcItem)); + old_bk = GetBkColor( hdc ); + old_text = GetTextColor( hdc ); SendMessageW( hwndOwner, WM_DRAWITEM, 0, (LPARAM)&dis ); /* Draw the popup-menu arrow */ + SetBkColor( hdc, old_bk ); + SetTextColor( hdc, old_text ); if (lpitem->fType & MF_POPUP) draw_popup_arrow( hdc, rect, arrow_bitmap_width, arrow_bitmap_height); @@ -1737,7 +1742,7 @@ */ static void MENU_DrawPopupMenu( HWND hwnd, HDC hdc, HMENU hmenu ) { - HBRUSH hPrevBrush = 0, brush = GetSysColorBrush( COLOR_MENU ); + HBRUSH hPrevBrush, brush = GetSysColorBrush( COLOR_MENU ); RECT rect; POPUPMENU *menu = MENU_GetMenu( hmenu ); diff -Nru wine1.7-1.7.50/dlls/user32/message.c wine1.7-1.7.55/dlls/user32/message.c --- wine1.7-1.7.50/dlls/user32/message.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/message.c 2015-11-13 14:32:40.000000000 +0000 @@ -1872,6 +1872,7 @@ return EnableWindow( hwnd, wparam ); case WM_WINE_SETACTIVEWINDOW: if (is_desktop_window( hwnd )) return 0; + if (!wparam && GetForegroundWindow() == hwnd) return 0; return (LRESULT)SetActiveWindow( (HWND)wparam ); case WM_WINE_KEYBOARD_LL_HOOK: case WM_WINE_MOUSE_LL_HOOK: @@ -1995,7 +1996,7 @@ void* ptr = NULL; int size = 0; UINT_PTR uiLo, uiHi; - LPARAM lp = 0; + LPARAM lp; HGLOBAL hunlock = 0; int i; DWORD res; diff -Nru wine1.7-1.7.50/dlls/user32/misc.c wine1.7-1.7.55/dlls/user32/misc.c --- wine1.7-1.7.50/dlls/user32/misc.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/misc.c 2015-11-13 14:32:40.000000000 +0000 @@ -757,6 +757,20 @@ return FALSE; } +/********************************************************************** + * GetDisplayConfigBufferSizes [USER32.@] + */ +LONG WINAPI GetDisplayConfigBufferSizes(UINT32 flags, UINT32 *num_path_info, UINT32 *num_mode_info) +{ + FIXME("(0x%x %p %p): stub\n", flags, num_path_info, num_mode_info); + + if (!num_path_info || !num_mode_info) + return ERROR_INVALID_PARAMETER; + + *num_path_info = 0; + *num_mode_info = 0; + return ERROR_NOT_SUPPORTED; +} static const WCHAR imeW[] = {'I','M','E',0}; const struct builtin_class_descr IME_builtin_class = diff -Nru wine1.7-1.7.50/dlls/user32/msgbox.c wine1.7-1.7.55/dlls/user32/msgbox.c --- wine1.7-1.7.50/dlls/user32/msgbox.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/msgbox.c 2015-11-13 14:32:40.000000000 +0000 @@ -71,7 +71,7 @@ int bspace, bw, bh, theight, tleft, wwidth, wheight, wleft, wtop, bpos; int borheight, borwidth, iheight, ileft, iwidth, twidth, tiheight; NONCLIENTMETRICSW nclm; - HMONITOR monitor = 0; + HMONITOR monitor; MONITORINFO mon_info; LPCWSTR lpszText; WCHAR *buffer = NULL; @@ -115,12 +115,14 @@ TRACE_(msgbox)("%s\n", debugstr_w(lpszText)); SetWindowTextW(GetDlgItem(hwnd, MSGBOX_IDTEXT), lpszText); - /* Remove not selected buttons */ + /* Remove not selected buttons and assign the WS_GROUP style to the first button */ + hItem = 0; switch(lpmb->dwStyle & MB_TYPEMASK) { case MB_OK: DestroyWindow(GetDlgItem(hwnd, IDCANCEL)); /* fall through */ case MB_OKCANCEL: + hItem = GetDlgItem(hwnd, IDOK); DestroyWindow(GetDlgItem(hwnd, IDABORT)); DestroyWindow(GetDlgItem(hwnd, IDRETRY)); DestroyWindow(GetDlgItem(hwnd, IDIGNORE)); @@ -130,6 +132,7 @@ DestroyWindow(GetDlgItem(hwnd, IDCONTINUE)); break; case MB_ABORTRETRYIGNORE: + hItem = GetDlgItem(hwnd, IDABORT); DestroyWindow(GetDlgItem(hwnd, IDOK)); DestroyWindow(GetDlgItem(hwnd, IDCANCEL)); DestroyWindow(GetDlgItem(hwnd, IDYES)); @@ -141,6 +144,7 @@ DestroyWindow(GetDlgItem(hwnd, IDCANCEL)); /* fall through */ case MB_YESNOCANCEL: + hItem = GetDlgItem(hwnd, IDYES); DestroyWindow(GetDlgItem(hwnd, IDOK)); DestroyWindow(GetDlgItem(hwnd, IDABORT)); DestroyWindow(GetDlgItem(hwnd, IDRETRY)); @@ -149,6 +153,7 @@ DestroyWindow(GetDlgItem(hwnd, IDTRYAGAIN)); break; case MB_RETRYCANCEL: + hItem = GetDlgItem(hwnd, IDRETRY); DestroyWindow(GetDlgItem(hwnd, IDOK)); DestroyWindow(GetDlgItem(hwnd, IDABORT)); DestroyWindow(GetDlgItem(hwnd, IDIGNORE)); @@ -158,6 +163,7 @@ DestroyWindow(GetDlgItem(hwnd, IDTRYAGAIN)); break; case MB_CANCELTRYCONTINUE: + hItem = GetDlgItem(hwnd, IDCANCEL); DestroyWindow(GetDlgItem(hwnd, IDOK)); DestroyWindow(GetDlgItem(hwnd, IDABORT)); DestroyWindow(GetDlgItem(hwnd, IDIGNORE)); @@ -165,6 +171,9 @@ DestroyWindow(GetDlgItem(hwnd, IDNO)); DestroyWindow(GetDlgItem(hwnd, IDRETRY)); } + + if (hItem) SetWindowLongW(hItem, GWL_STYLE, GetWindowLongW(hItem, GWL_STYLE) | WS_GROUP); + /* Set the icon */ switch(lpmb->dwStyle & MB_ICONMASK) { case MB_ICONEXCLAMATION: diff -Nru wine1.7-1.7.50/dlls/user32/painting.c wine1.7-1.7.55/dlls/user32/painting.c --- wine1.7-1.7.50/dlls/user32/painting.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/painting.c 2015-11-13 14:32:40.000000000 +0000 @@ -1220,7 +1220,7 @@ else /* need to build a list of the region rectangles */ { DWORD size; - RGNDATA *data = NULL; + RGNDATA *data; if (!(size = GetRegionData( hrgn, 0, NULL ))) return FALSE; if (!(data = HeapAlloc( GetProcessHeap(), 0, size ))) return FALSE; diff -Nru wine1.7-1.7.50/dlls/user32/spy.c wine1.7-1.7.55/dlls/user32/spy.c --- wine1.7-1.7.50/dlls/user32/spy.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/spy.c 2015-11-13 14:32:40.000000000 +0000 @@ -1559,8 +1559,9 @@ USM(TB_MAPACCELERATORW ,0), USM(TB_GETSTRINGW ,0), USM(TB_GETSTRINGA ,0), - USM(TB_UNKWN45D ,8), + USM(TB_SETBOUNDINGSIZE ,8), USM(TB_SETHOTITEM2 ,0), + USM(TB_HASACCELERATOR ,0), USM(TB_SETLISTGAP ,0), USM(TB_GETIMAGELISTCOUNT ,0), USM(TB_GETIDEALSIZE ,8), @@ -2520,10 +2521,10 @@ TRACE("NMHDR hwndFrom=%p idFrom=0x%08lx code=0x%08x\n", pnmh->hwndFrom, pnmh->idFrom, pnmh->code); } + break; default: if (sp_e->data_len > 0) SPY_DumpMem ("MSG lParam", (UINT *)sp_e->lParam, sp_e->data_len); - break; } } diff -Nru wine1.7-1.7.50/dlls/user32/sysparams.c wine1.7-1.7.55/dlls/user32/sysparams.c --- wine1.7-1.7.50/dlls/user32/sysparams.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/sysparams.c 2015-11-13 14:32:40.000000000 +0000 @@ -536,7 +536,7 @@ /* load a value to a registry entry */ static DWORD load_entry( struct sysparam_entry *entry, void *data, DWORD size ) { - DWORD type, count = 0; + DWORD type, count; HKEY base_key, volatile_key; if (!get_base_keys( entry->regval[0], &base_key, &volatile_key )) return FALSE; diff -Nru wine1.7-1.7.50/dlls/user32/tests/edit.c wine1.7-1.7.55/dlls/user32/tests/edit.c --- wine1.7-1.7.50/dlls/user32/tests/edit.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/tests/edit.c 2015-11-13 14:32:40.000000000 +0000 @@ -1476,10 +1476,23 @@ SendMessageA(hwEdit, EM_GETRECT, 0, (LPARAM)&old_rect); SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(10, 10)); SendMessageA(hwEdit, EM_GETRECT, 0, (LPARAM)&new_rect); - ok(new_rect.left == old_rect.left, "The left border of the rectangle has changed\n"); - ok(new_rect.right == old_rect.right, "The right border of the rectangle has changed\n"); - ok(new_rect.top == old_rect.top, "The top border of the rectangle has changed\n"); - ok(new_rect.bottom == old_rect.bottom, "The bottom border of the rectangle has changed\n"); + ok(EqualRect(&old_rect, &new_rect), "The border of the rectangle has changed\n"); + + /* The lParam argument of the WM_SIZE message should be ignored. */ + + SendMessageA(hwEdit, EM_GETRECT, 0, (LPARAM)&old_rect); + SendMessageA(hwEdit, WM_SIZE, SIZE_RESTORED, 0); + SendMessageA(hwEdit, EM_GETRECT, 0, (LPARAM)&new_rect); + ok(EqualRect(&old_rect, &new_rect), "The border of the rectangle has changed\n"); + SendMessageA(hwEdit, WM_SIZE, SIZE_MINIMIZED, 0); + SendMessageA(hwEdit, EM_GETRECT, 0, (LPARAM)&new_rect); + ok(EqualRect(&old_rect, &new_rect), "The border of the rectangle has changed\n"); + SendMessageA(hwEdit, WM_SIZE, SIZE_MAXIMIZED, 0); + SendMessageA(hwEdit, EM_GETRECT, 0, (LPARAM)&new_rect); + ok(EqualRect(&old_rect, &new_rect), "The border of the rectangle has changed\n"); + SendMessageA(hwEdit, WM_SIZE, SIZE_RESTORED, MAKELONG(10, 10)); + SendMessageA(hwEdit, EM_GETRECT, 0, (LPARAM)&new_rect); + ok(EqualRect(&old_rect, &new_rect), "The border of the rectangle has changed\n"); DestroyWindow (hwEdit); diff -Nru wine1.7-1.7.50/dlls/user32/tests/listbox.c wine1.7-1.7.55/dlls/user32/tests/listbox.c --- wine1.7-1.7.50/dlls/user32/tests/listbox.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/tests/listbox.c 2015-11-13 14:32:40.000000000 +0000 @@ -1665,7 +1665,10 @@ ok(br == TRUE, "GetScrollInfo failed\n"); ok(sinfo.nMin == 0, "got wrong min: %u\n", sinfo.nMin); ok(sinfo.nMax == 100, "got wrong max: %u\n", sinfo.nMax); + ok((GetWindowLongA(listbox, GWL_STYLE) & WS_HSCROLL) == 0, + "List box should not have a horizontal scroll bar\n"); + /* horizontal extent < width */ SendMessageA(listbox, LB_SETHORIZONTALEXTENT, 64, 0); res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0); @@ -1677,6 +1680,23 @@ ok(br == TRUE, "GetScrollInfo failed\n"); ok(sinfo.nMin == 0, "got wrong min: %u\n", sinfo.nMin); ok(sinfo.nMax == 100, "got wrong max: %u\n", sinfo.nMax); + ok((GetWindowLongA(listbox, GWL_STYLE) & WS_HSCROLL) == 0, + "List box should not have a horizontal scroll bar\n"); + + /* horizontal extent > width */ + SendMessageA(listbox, LB_SETHORIZONTALEXTENT, 184, 0); + + res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0); + ok(res == 184, "Got wrong horizontal extent: %u\n", res); + + sinfo.cbSize = sizeof(sinfo); + sinfo.fMask = SIF_RANGE; + br = GetScrollInfo(listbox, SB_HORZ, &sinfo); + ok(br == TRUE, "GetScrollInfo failed\n"); + ok(sinfo.nMin == 0, "got wrong min: %u\n", sinfo.nMin); + ok(sinfo.nMax == 100, "got wrong max: %u\n", sinfo.nMax); + ok((GetWindowLongA(listbox, GWL_STYLE) & WS_HSCROLL) == 0, + "List box should not have a horizontal scroll bar\n"); DestroyWindow(listbox); @@ -1692,7 +1712,71 @@ ok(br == TRUE, "GetScrollInfo failed\n"); ok(sinfo.nMin == 0, "got wrong min: %u\n", sinfo.nMin); ok(sinfo.nMax == 100, "got wrong max: %u\n", sinfo.nMax); + ok((GetWindowLongA(listbox, GWL_STYLE) & WS_HSCROLL) == 0, + "List box should not have a horizontal scroll bar\n"); + + /* horizontal extent < width */ + SendMessageA(listbox, LB_SETHORIZONTALEXTENT, 64, 0); + + res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0); + ok(res == 64, "Got wrong horizontal extent: %u\n", res); + + sinfo.cbSize = sizeof(sinfo); + sinfo.fMask = SIF_RANGE; + br = GetScrollInfo(listbox, SB_HORZ, &sinfo); + ok(br == TRUE, "GetScrollInfo failed\n"); + ok(sinfo.nMin == 0, "got wrong min: %u\n", sinfo.nMin); + ok(sinfo.nMax == 63, "got wrong max: %u\n", sinfo.nMax); + ok((GetWindowLongA(listbox, GWL_STYLE) & WS_HSCROLL) == 0, + "List box should not have a horizontal scroll bar\n"); + + /* horizontal extent > width */ + SendMessageA(listbox, LB_SETHORIZONTALEXTENT, 184, 0); + + res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0); + ok(res == 184, "Got wrong horizontal extent: %u\n", res); + + sinfo.cbSize = sizeof(sinfo); + sinfo.fMask = SIF_RANGE; + br = GetScrollInfo(listbox, SB_HORZ, &sinfo); + ok(br == TRUE, "GetScrollInfo failed\n"); + ok(sinfo.nMin == 0, "got wrong min: %u\n", sinfo.nMin); + ok(sinfo.nMax == 183, "got wrong max: %u\n", sinfo.nMax); + ok((GetWindowLongA(listbox, GWL_STYLE) & WS_HSCROLL) != 0, + "List box should have a horizontal scroll bar\n"); + + SendMessageA(listbox, LB_SETHORIZONTALEXTENT, 0, 0); + res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0); + ok(res == 0, "Got wrong horizontal extent: %u\n", res); + + sinfo.cbSize = sizeof(sinfo); + sinfo.fMask = SIF_RANGE; + br = GetScrollInfo(listbox, SB_HORZ, &sinfo); + ok(br == TRUE, "GetScrollInfo failed\n"); + ok(sinfo.nMin == 0, "got wrong min: %u\n", sinfo.nMin); + ok(sinfo.nMax == 0, "got wrong max: %u\n", sinfo.nMax); + ok((GetWindowLongA(listbox, GWL_STYLE) & WS_HSCROLL) == 0, + "List box should not have a horizontal scroll bar\n"); + + DestroyWindow(listbox); + + + listbox = create_listbox(WS_CHILD | WS_VISIBLE | WS_HSCROLL | LBS_DISABLENOSCROLL, parent); + + res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0); + ok(res == 0, "Got wrong initial horizontal extent: %u\n", res); + + sinfo.cbSize = sizeof(sinfo); + sinfo.fMask = SIF_RANGE; + br = GetScrollInfo(listbox, SB_HORZ, &sinfo); + ok(br == TRUE, "GetScrollInfo failed\n"); + ok(sinfo.nMin == 0, "got wrong min: %u\n", sinfo.nMin); + ok(sinfo.nMax == 0, "got wrong max: %u\n", sinfo.nMax); + ok((GetWindowLongA(listbox, GWL_STYLE) & WS_HSCROLL) != 0, + "List box should have a horizontal scroll bar\n"); + + /* horizontal extent < width */ SendMessageA(listbox, LB_SETHORIZONTALEXTENT, 64, 0); res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0); @@ -1704,6 +1788,23 @@ ok(br == TRUE, "GetScrollInfo failed\n"); ok(sinfo.nMin == 0, "got wrong min: %u\n", sinfo.nMin); ok(sinfo.nMax == 63, "got wrong max: %u\n", sinfo.nMax); + ok((GetWindowLongA(listbox, GWL_STYLE) & WS_HSCROLL) != 0, + "List box should have a horizontal scroll bar\n"); + + /* horizontal extent > width */ + SendMessageA(listbox, LB_SETHORIZONTALEXTENT, 184, 0); + + res = SendMessageA(listbox, LB_GETHORIZONTALEXTENT, 0, 0); + ok(res == 184, "Got wrong horizontal extent: %u\n", res); + + sinfo.cbSize = sizeof(sinfo); + sinfo.fMask = SIF_RANGE; + br = GetScrollInfo(listbox, SB_HORZ, &sinfo); + ok(br == TRUE, "GetScrollInfo failed\n"); + ok(sinfo.nMin == 0, "got wrong min: %u\n", sinfo.nMin); + ok(sinfo.nMax == 183, "got wrong max: %u\n", sinfo.nMax); + ok((GetWindowLongA(listbox, GWL_STYLE) & WS_HSCROLL) != 0, + "List box should have a horizontal scroll bar\n"); SendMessageA(listbox, LB_SETHORIZONTALEXTENT, 0, 0); @@ -1716,6 +1817,8 @@ ok(br == TRUE, "GetScrollInfo failed\n"); ok(sinfo.nMin == 0, "got wrong min: %u\n", sinfo.nMin); ok(sinfo.nMax == 0, "got wrong max: %u\n", sinfo.nMax); + ok((GetWindowLongA(listbox, GWL_STYLE) & WS_HSCROLL) != 0, + "List box should have a horizontal scroll bar\n"); DestroyWindow(listbox); diff -Nru wine1.7-1.7.50/dlls/user32/tests/menu.c wine1.7-1.7.55/dlls/user32/tests/menu.c --- wine1.7-1.7.50/dlls/user32/tests/menu.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/tests/menu.c 2015-11-13 14:32:40.000000000 +0000 @@ -2508,9 +2508,10 @@ mii.fMask = MIIM_FTYPE | MIIM_STATE | MIIM_ID | MIIM_SUBMENU; ret = GetMenuItemInfoA(hmenu, i, TRUE, &mii); ok(ret, "GetMenuItemInfo(%u) failed\n", i); -if (0) - trace("item #%u: fType %04x, fState %04x, wID %u, hSubMenu %p\n", - i, mii.fType, mii.fState, mii.wID, mii.hSubMenu); + + if (winetest_debug > 1) + trace("item #%u: fType %04x, fState %04x, wID %u, hSubMenu %p\n", + i, mii.fType, mii.fState, mii.wID, mii.hSubMenu); if (mii.hSubMenu) { @@ -2672,9 +2673,9 @@ mii.fMask = MIIM_FTYPE | MIIM_STATE | MIIM_ID | MIIM_STRING; ret = GetMenuItemInfoA(hmenu, i, TRUE, &mii); ok(ret, "GetMenuItemInfo(%u) failed\n", i); -if (0) - trace("item #%u: fType %04x, fState %04x, wID %u, dwTypeData %s\n", - i, mii.fType, mii.fState, mii.wID, (LPCSTR)mii.dwTypeData); + if (winetest_debug > 1) + trace("item #%u: fType %04x, fState %04x, wID %u, dwTypeData %s\n", + i, mii.fType, mii.fState, mii.wID, (LPCSTR)mii.dwTypeData); ok(mii.fType == menu_data[i].type, "%u: expected fType %04x, got %04x\n", i, menu_data[i].type, mii.fType); @@ -2778,9 +2779,10 @@ mii.fMask = MIIM_FTYPE | MIIM_ID | MIIM_STRING | MIIM_BITMAP; ret = GetMenuItemInfoA(hmenu, i, TRUE, &mii); ok(ret, "GetMenuItemInfo(%u) failed\n", i); -if (0) - trace("item #%u: fType %04x, fState %04x, wID %04x, hbmp %p\n", - i, mii.fType, mii.fState, mii.wID, mii.hbmpItem); + + if (winetest_debug > 1) + trace("item #%u: fType %04x, fState %04x, wID %04x, hbmp %p\n", + i, mii.fType, mii.fState, mii.wID, mii.hbmpItem); ok(mii.fType == item[i].type, "%u: expected fType %04x, got %04x\n", i, item[i].type, mii.fType); diff -Nru wine1.7-1.7.50/dlls/user32/tests/monitor.c wine1.7-1.7.55/dlls/user32/tests/monitor.c --- wine1.7-1.7.50/dlls/user32/tests/monitor.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/tests/monitor.c 2015-11-13 14:32:40.000000000 +0000 @@ -34,6 +34,7 @@ static HMONITOR (WINAPI *pMonitorFromPoint)(POINT,DWORD); static HMONITOR (WINAPI *pMonitorFromRect)(LPCRECT,DWORD); static HMONITOR (WINAPI *pMonitorFromWindow)(HWND,DWORD); +static LONG (WINAPI *pGetDisplayConfigBufferSizes)(UINT32,UINT32*,UINT32*); static void init_function_pointers(void) { @@ -48,6 +49,7 @@ GET_PROC(ChangeDisplaySettingsExW) GET_PROC(EnumDisplayDevicesA) GET_PROC(EnumDisplayMonitors) + GET_PROC(GetDisplayConfigBufferSizes) GET_PROC(GetMonitorInfoA) GET_PROC(GetMonitorInfoW) GET_PROC(MonitorFromPoint) @@ -543,6 +545,58 @@ DestroyWindow(hwnd); } +static void test_display_config(void) +{ + UINT32 paths, modes; + LONG ret; + + if (!pGetDisplayConfigBufferSizes) + { + win_skip("GetDisplayConfigBufferSizes is not supported\n"); + return; + } + + ret = pGetDisplayConfigBufferSizes(QDC_ALL_PATHS, NULL, NULL); + ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret); + + paths = 100; + ret = pGetDisplayConfigBufferSizes(QDC_ALL_PATHS, &paths, NULL); + ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret); + ok(paths == 100, "got %u\n", paths); + + modes = 100; + ret = pGetDisplayConfigBufferSizes(QDC_ALL_PATHS, NULL, &modes); + ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret); + ok(modes == 100, "got %u\n", modes); + + paths = modes = 0; + ret = pGetDisplayConfigBufferSizes(QDC_ALL_PATHS, &paths, &modes); + if (!ret) + ok(paths > 0 && modes > 0, "got %u, %u\n", paths, modes); + else + ok(ret == ERROR_NOT_SUPPORTED, "got %d\n", ret); + + /* Invalid flags, non-zero invalid flags validation is version (or driver?) dependent, + it's unreliable to use in tests. */ + ret = pGetDisplayConfigBufferSizes(0, NULL, NULL); + ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret); + + paths = 100; + ret = pGetDisplayConfigBufferSizes(0, &paths, NULL); + ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret); + ok(paths == 100, "got %u\n", paths); + + modes = 100; + ret = pGetDisplayConfigBufferSizes(0, NULL, &modes); + ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret); + ok(modes == 100, "got %u\n", modes); + + paths = modes = 100; + ret = pGetDisplayConfigBufferSizes(0, &paths, &modes); + ok(ret == ERROR_INVALID_PARAMETER || ret == ERROR_NOT_SUPPORTED, "got %d\n", ret); + ok(modes == 0 && paths == 0, "got %u, %u\n", modes, paths); +} + START_TEST(monitor) { init_function_pointers(); @@ -550,4 +604,5 @@ test_ChangeDisplaySettingsEx(); test_monitors(); test_work_area(); + test_display_config(); } diff -Nru wine1.7-1.7.50/dlls/user32/tests/win.c wine1.7-1.7.55/dlls/user32/tests/win.c --- wine1.7-1.7.50/dlls/user32/tests/win.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/tests/win.c 2015-11-13 14:32:40.000000000 +0000 @@ -57,6 +57,7 @@ static BOOL (WINAPI *pGetGUIThreadInfo)(DWORD, GUITHREADINFO*); static BOOL (WINAPI *pGetProcessDefaultLayout)( DWORD *layout ); static BOOL (WINAPI *pSetProcessDefaultLayout)( DWORD layout ); +static BOOL (WINAPI *pFlashWindow)( HWND hwnd, BOOL bInvert ); static BOOL (WINAPI *pFlashWindowEx)( PFLASHWINFO pfwi ); static DWORD (WINAPI *pSetLayout)(HDC hdc, DWORD layout); static DWORD (WINAPI *pGetLayout)(HDC hdc); @@ -68,6 +69,7 @@ static HWND hwndMessage; static HWND hwndMain, hwndMain2; static HHOOK hhook; +static BOOL app_activated, app_deactivated; static const char* szAWRClass = "Winsize"; static HMENU hmenu; @@ -816,6 +818,10 @@ case WM_SETTEXT: num_settext_msgs++; break; + case WM_ACTIVATEAPP: + if (wparam) app_activated = TRUE; + else app_deactivated = TRUE; + break; } return DefWindowProcA(hwnd, msg, wparam, lparam); @@ -1289,7 +1295,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id) { MDICREATESTRUCTA mdi_cs; - HWND mdi_child; + HWND mdi_child, hwnd, exp_hwnd; INT_PTR id; static const WCHAR classW[] = {'M','D','I','_','c','h','i','l','d','_','C','l','a','s','s','_','1',0}; static const WCHAR titleW[] = {'M','D','I',' ','c','h','i','l','d',0}; @@ -1308,6 +1314,9 @@ ok(mdi_child != 0, "MDI child creation failed\n"); id = GetWindowLongPtrA(mdi_child, GWLP_ID); ok(id == first_id, "wrong child id %ld\n", id); + hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0); + exp_hwnd = (GetWindowLongW(mdi_child, GWL_STYLE) & WS_VISIBLE) ? mdi_child : 0; + ok(hwnd == exp_hwnd, "WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd, hwnd); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); @@ -1316,6 +1325,9 @@ ok(mdi_child != 0, "MDI child creation failed\n"); id = GetWindowLongPtrA(mdi_child, GWLP_ID); ok(id == first_id, "wrong child id %ld\n", id); + hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0); +todo_wine + ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); @@ -1330,6 +1342,9 @@ ok(mdi_child != 0, "MDI child creation failed\n"); id = GetWindowLongPtrA(mdi_child, GWLP_ID); ok(id == first_id, "wrong child id %ld\n", id); + hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0); +todo_wine + ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); } @@ -1352,6 +1367,9 @@ { id = GetWindowLongPtrA(mdi_child, GWLP_ID); ok(id == first_id, "wrong child id %ld\n", id); + hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0); + exp_hwnd = (GetWindowLongW(mdi_child, GWL_STYLE) & WS_VISIBLE) ? mdi_child : 0; + ok(hwnd == exp_hwnd, "WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd, hwnd); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); } @@ -1365,6 +1383,9 @@ ok(mdi_child != 0, "MDI child creation failed\n"); id = GetWindowLongPtrA(mdi_child, GWLP_ID); ok(id == first_id, "wrong child id %ld\n", id); + hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0); + exp_hwnd = (GetWindowLongW(mdi_child, GWL_STYLE) & WS_VISIBLE) ? mdi_child : 0; + ok(hwnd == exp_hwnd, "WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd, hwnd); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); @@ -1377,6 +1398,9 @@ ok(mdi_child != 0, "MDI child creation failed\n"); id = GetWindowLongPtrA(mdi_child, GWLP_ID); ok(id == first_id, "wrong child id %ld\n", id); + hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0); +todo_wine + ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); @@ -1395,6 +1419,9 @@ ok(mdi_child != 0, "MDI child creation failed\n"); id = GetWindowLongPtrA(mdi_child, GWLP_ID); ok(id == first_id, "wrong child id %ld\n", id); + hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0); +todo_wine + ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); } @@ -1418,6 +1445,9 @@ { id = GetWindowLongPtrA(mdi_child, GWLP_ID); ok(id == first_id, "wrong child id %ld\n", id); + hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0); + exp_hwnd = (GetWindowLongW(mdi_child, GWL_STYLE) & WS_VISIBLE) ? mdi_child : 0; + ok(hwnd == exp_hwnd, "WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd, hwnd); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); } @@ -1431,6 +1461,9 @@ ok(mdi_child != 0, "MDI child creation failed\n"); id = GetWindowLongPtrA(mdi_child, GWLP_ID); ok(id == first_id, "wrong child id %ld\n", id); + hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0); + exp_hwnd = (GetWindowLongW(mdi_child, GWL_STYLE) & WS_VISIBLE) ? mdi_child : 0; + ok(hwnd == exp_hwnd, "WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd, hwnd); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); @@ -1443,6 +1476,9 @@ ok(mdi_child != 0, "MDI child creation failed\n"); id = GetWindowLongPtrA(mdi_child, GWLP_ID); ok(id == first_id, "wrong child id %ld\n", id); + hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0); +todo_wine + ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); @@ -1461,6 +1497,9 @@ ok(mdi_child != 0, "MDI child creation failed\n"); id = GetWindowLongPtrA(mdi_child, GWLP_ID); ok(id == first_id, "wrong child id %ld\n", id); + hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0); +todo_wine + ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); } @@ -1484,6 +1523,9 @@ { id = GetWindowLongPtrA(mdi_child, GWLP_ID); ok(id == first_id, "wrong child id %ld\n", id); + hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0); + exp_hwnd = (GetWindowLongW(mdi_child, GWL_STYLE) & WS_VISIBLE) ? mdi_child : 0; + ok(hwnd == exp_hwnd, "WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd, hwnd); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); } @@ -1509,6 +1551,8 @@ ok(mdi_child != 0, "MDI child creation failed\n"); id = GetWindowLongPtrA(mdi_child, GWLP_ID); ok(id == 0, "wrong child id %ld\n", id); + hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0); + ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd); DestroyWindow(mdi_child); mdi_child = CreateWindowExA(0, "MDI_child_Class_2", "MDI child", @@ -1520,6 +1564,8 @@ ok(mdi_child != 0, "MDI child creation failed\n"); id = GetWindowLongPtrA(mdi_child, GWLP_ID); ok(id == 0, "wrong child id %ld\n", id); + hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0); + ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd); DestroyWindow(mdi_child); /* maximized child */ @@ -1532,6 +1578,8 @@ ok(mdi_child != 0, "MDI child creation failed\n"); id = GetWindowLongPtrA(mdi_child, GWLP_ID); ok(id == 0, "wrong child id %ld\n", id); + hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0); + ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd); DestroyWindow(mdi_child); trace("Creating maximized child with a caption\n"); @@ -1544,6 +1592,8 @@ ok(mdi_child != 0, "MDI child creation failed\n"); id = GetWindowLongPtrA(mdi_child, GWLP_ID); ok(id == 0, "wrong child id %ld\n", id); + hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0); + ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd); DestroyWindow(mdi_child); trace("Creating maximized child with a caption and a thick frame\n"); @@ -1556,6 +1606,8 @@ ok(mdi_child != 0, "MDI child creation failed\n"); id = GetWindowLongPtrA(mdi_child, GWLP_ID); ok(id == 0, "wrong child id %ld\n", id); + hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0); + ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd); DestroyWindow(mdi_child); } @@ -1868,51 +1920,7 @@ switch (msg) { case WM_CREATE: - { - CLIENTCREATESTRUCT client_cs; - RECT rc; - - GetClientRect(hwnd, &rc); - - client_cs.hWindowMenu = 0; - client_cs.idFirstChild = 1; - - /* MDIClient without MDIS_ALLCHILDSTYLES */ - mdi_client = CreateWindowExA(0, "mdiclient", - NULL, - WS_CHILD /*| WS_VISIBLE*/, - /* tests depend on a not zero MDIClient size */ - 0, 0, rc.right, rc.bottom, - hwnd, 0, GetModuleHandleA(NULL), - &client_cs); - assert(mdi_client); - test_MDI_create(hwnd, mdi_client, client_cs.idFirstChild); - DestroyWindow(mdi_client); - - /* MDIClient with MDIS_ALLCHILDSTYLES */ - mdi_client = CreateWindowExA(0, "mdiclient", - NULL, - WS_CHILD | MDIS_ALLCHILDSTYLES /*| WS_VISIBLE*/, - /* tests depend on a not zero MDIClient size */ - 0, 0, rc.right, rc.bottom, - hwnd, 0, GetModuleHandleA(NULL), - &client_cs); - assert(mdi_client); - test_MDI_create(hwnd, mdi_client, client_cs.idFirstChild); - DestroyWindow(mdi_client); - - /* Test child window stack management */ - mdi_client = CreateWindowExA(0, "mdiclient", - NULL, - WS_CHILD, - 0, 0, rc.right, rc.bottom, - hwnd, 0, GetModuleHandleA(NULL), - &client_cs); - assert(mdi_client); - test_MDI_child_stack(mdi_client); - DestroyWindow(mdi_client); - break; - } + return 1; case WM_WINDOWPOSCHANGED: { @@ -1992,7 +2000,9 @@ static void test_mdi(void) { - HWND mdi_hwndMain; + HWND mdi_hwndMain, mdi_client; + CLIENTCREATESTRUCT client_cs; + RECT rc; /*MSG msg;*/ if (!mdi_RegisterWindowClasses()) assert(0); @@ -2004,6 +2014,46 @@ GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL); assert(mdi_hwndMain); + + GetClientRect(mdi_hwndMain, &rc); + + client_cs.hWindowMenu = 0; + client_cs.idFirstChild = 1; + + /* MDIClient without MDIS_ALLCHILDSTYLES */ + mdi_client = CreateWindowExA(0, "mdiclient", + NULL, + WS_CHILD /*| WS_VISIBLE*/, + /* tests depend on a not zero MDIClient size */ + 0, 0, rc.right, rc.bottom, + mdi_hwndMain, 0, GetModuleHandleA(NULL), + &client_cs); + assert(mdi_client); + test_MDI_create(mdi_hwndMain, mdi_client, client_cs.idFirstChild); + DestroyWindow(mdi_client); + + /* MDIClient with MDIS_ALLCHILDSTYLES */ + mdi_client = CreateWindowExA(0, "mdiclient", + NULL, + WS_CHILD | MDIS_ALLCHILDSTYLES /*| WS_VISIBLE*/, + /* tests depend on a not zero MDIClient size */ + 0, 0, rc.right, rc.bottom, + mdi_hwndMain, 0, GetModuleHandleA(NULL), + &client_cs); + assert(mdi_client); + test_MDI_create(mdi_hwndMain, mdi_client, client_cs.idFirstChild); + DestroyWindow(mdi_client); + + /* Test child window stack management */ + mdi_client = CreateWindowExA(0, "mdiclient", + NULL, + WS_CHILD, + 0, 0, rc.right, rc.bottom, + mdi_hwndMain, 0, GetModuleHandleA(NULL), + &client_cs); + assert(mdi_client); + test_MDI_child_stack(mdi_client); + DestroyWindow(mdi_client); /* while(GetMessage(&msg, 0, 0, 0)) { @@ -6436,10 +6486,12 @@ ret = pUpdateLayeredWindowIndirect( hwnd, &info ); ok( ret, "UpdateLayeredWindowIndirect should succeed on layered window\n" ); sz.cx--; + SetLastError(0); ret = pUpdateLayeredWindowIndirect( hwnd, &info ); ok( !ret, "UpdateLayeredWindowIndirect should fail\n" ); - ok( GetLastError() == ERROR_INCORRECT_SIZE || broken(GetLastError() == ERROR_MR_MID_NOT_FOUND), - "wrong error %u\n", GetLastError() ); + /* particular error code differs from version to version, could be ERROR_INCORRECT_SIZE, + ERROR_MR_MID_NOT_FOUND or ERROR_GEN_FAILURE (Win8/Win10) */ + ok( GetLastError() != 0, "wrong error %u\n", GetLastError() ); info.dwFlags = ULW_OPAQUE; ret = pUpdateLayeredWindowIndirect( hwnd, &info ); ok( ret, "UpdateLayeredWindowIndirect should succeed on layered window\n" ); @@ -7066,6 +7118,33 @@ DestroyWindow( parent ); } +static void test_FlashWindow(void) +{ + HWND hwnd; + BOOL ret; + if (!pFlashWindow) + { + win_skip( "FlashWindow not supported\n" ); + return; + } + + hwnd = CreateWindowExA( 0, "MainWindowClass", "FlashWindow", WS_POPUP, + 0, 0, 0, 0, 0, 0, 0, NULL ); + ok( hwnd != 0, "CreateWindowExA error %d\n", GetLastError() ); + + SetLastError( 0xdeadbeef ); + ret = pFlashWindow( NULL, TRUE ); + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "FlashWindow returned with %d\n", GetLastError() ); + + DestroyWindow( hwnd ); + + SetLastError( 0xdeadbeef ); + ret = pFlashWindow( hwnd, TRUE ); + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "FlashWindow returned with %d\n", GetLastError() ); +} + static void test_FlashWindowEx(void) { HWND hwnd; @@ -7089,13 +7168,13 @@ finfo.hwnd = NULL; SetLastError(0xdeadbeef); ret = pFlashWindowEx(&finfo); - todo_wine ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, - "FlashWindowEx returned with %d\n", GetLastError()); + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "FlashWindowEx returned with %d\n", GetLastError()); finfo.hwnd = hwnd; SetLastError(0xdeadbeef); ret = pFlashWindowEx(NULL); - todo_wine ok(!ret && GetLastError() == ERROR_NOACCESS, + ok(!ret && GetLastError() == ERROR_NOACCESS, "FlashWindowEx returned with %d\n", GetLastError()); SetLastError(0xdeadbeef); @@ -7105,13 +7184,13 @@ finfo.cbSize = sizeof(FLASHWINFO) - 1; SetLastError(0xdeadbeef); ret = pFlashWindowEx(&finfo); - todo_wine ok(!ret && GetLastError()==ERROR_INVALID_PARAMETER, + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "FlashWindowEx succeeded\n"); finfo.cbSize = sizeof(FLASHWINFO) + 1; SetLastError(0xdeadbeef); ret = pFlashWindowEx(&finfo); - todo_wine ok(!ret && GetLastError()==ERROR_INVALID_PARAMETER, + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "FlashWindowEx succeeded\n"); finfo.cbSize = sizeof(FLASHWINFO); @@ -7119,7 +7198,7 @@ SetLastError(0xdeadbeef); ret = pFlashWindowEx(&finfo); - todo_wine ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "FlashWindowEx returned with %d\n", GetLastError()); ok(finfo.cbSize == sizeof(FLASHWINFO), "FlashWindowEx modified cdSize to %x\n", finfo.cbSize); @@ -7135,7 +7214,7 @@ SetLastError(0xdeadbeef); ret = pFlashWindowEx(NULL); - todo_wine ok(!ret && GetLastError() == ERROR_NOACCESS, + ok(!ret && GetLastError() == ERROR_NOACCESS, "FlashWindowEx returned with %d\n", GetLastError()); SetLastError(0xdeadbeef); @@ -7150,7 +7229,6 @@ finfo.dwFlags = FLASHW_STOP; SetLastError(0xdeadbeef); ret = pFlashWindowEx(&finfo); -todo_wine ok(prev != ret, "previous window state should be different\n"); DestroyWindow( hwnd ); @@ -8156,6 +8234,224 @@ DestroyWindow(button); } +#define SET_FOREGROUND_STEAL_1 0x01 +#define SET_FOREGROUND_SET_1 0x02 +#define SET_FOREGROUND_STEAL_2 0x04 +#define SET_FOREGROUND_SET_2 0x08 +#define SET_FOREGROUND_INJECT 0x10 + +struct set_foreground_thread_params +{ + UINT msg_quit, msg_command; + HWND window1, window2, thread_window; + HANDLE command_executed; +}; + +static DWORD WINAPI set_foreground_thread(void *params) +{ + struct set_foreground_thread_params *p = params; + MSG msg; + + p->thread_window = CreateWindowExA(0, "static", "thread window", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 10, 10, 0, 0, 0, NULL); + SetEvent(p->command_executed); + + while(GetMessageA(&msg, 0, 0, 0)) + { + if (msg.message == p->msg_quit) + break; + + if (msg.message == p->msg_command) + { + if (msg.wParam & SET_FOREGROUND_STEAL_1) + { + SetForegroundWindow(p->thread_window); + check_wnd_state(p->thread_window, p->thread_window, p->thread_window, 0); + } + if (msg.wParam & SET_FOREGROUND_INJECT) + { + SendNotifyMessageA(p->window1, WM_ACTIVATEAPP, 0, 0); + } + if (msg.wParam & SET_FOREGROUND_SET_1) + { + SetForegroundWindow(p->window1); + check_wnd_state(0, p->window1, 0, 0); + } + if (msg.wParam & SET_FOREGROUND_STEAL_2) + { + SetForegroundWindow(p->thread_window); + check_wnd_state(p->thread_window, p->thread_window, p->thread_window, 0); + } + if (msg.wParam & SET_FOREGROUND_SET_2) + { + SetForegroundWindow(p->window2); + check_wnd_state(0, p->window2, 0, 0); + } + + SetEvent(p->command_executed); + continue; + } + + TranslateMessage(&msg); + DispatchMessageA(&msg); + } + + DestroyWindow(p->thread_window); + return 0; +} + +static void test_activateapp(HWND window1) +{ + HWND window2, test_window; + HANDLE thread; + struct set_foreground_thread_params thread_params; + DWORD tid; + MSG msg; + + window2 = CreateWindowExA(0, "static", "window 2", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 300, 0, 10, 10, 0, 0, 0, NULL); + thread_params.msg_quit = WM_USER; + thread_params.msg_command = WM_USER + 1; + thread_params.window1 = window1; + thread_params.window2 = window2; + thread_params.command_executed = CreateEventW(NULL, FALSE, FALSE, NULL); + + thread = CreateThread(NULL, 0, set_foreground_thread, &thread_params, 0, &tid); + WaitForSingleObject(thread_params.command_executed, INFINITE); + + SetForegroundWindow(window1); + check_wnd_state(window1, window1, window1, 0); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + + /* Steal foreground: WM_ACTIVATEAPP(0) is delivered. */ + app_activated = app_deactivated = FALSE; + PostThreadMessageA(tid, thread_params.msg_command, SET_FOREGROUND_STEAL_1, 0); + WaitForSingleObject(thread_params.command_executed, INFINITE); + test_window = GetForegroundWindow(); + ok(test_window == thread_params.thread_window, "Expected foreground window %p, got %p\n", + thread_params.thread_window, test_window); + /* Active and Focus window are sometimes 0 on KDE. Ignore them. + * check_wnd_state(window1, thread_params.thread_window, window1, 0); */ + ok(!app_activated, "Received WM_ACTIVATEAPP(1), did not expect it.\n"); + ok(!app_deactivated, "Received WM_ACTIVATEAPP(0), did not expect it.\n"); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + check_wnd_state(0, thread_params.thread_window, 0, 0); + test_window = GetForegroundWindow(); + ok(test_window == thread_params.thread_window, "Expected foreground window %p, got %p\n", + thread_params.thread_window, test_window); + ok(!app_activated, "Received WM_ACTIVATEAPP(1), did not expect it.\n"); + /* This message is reliable on Windows and inside a virtual desktop. + * It is unreliable on KDE (50/50) and never arrives on FVWM. + * ok(app_deactivated, "Expected WM_ACTIVATEAPP(0), did not receive it.\n"); */ + + /* Set foreground: WM_ACTIVATEAPP (1) is delivered. */ + app_activated = app_deactivated = FALSE; + PostThreadMessageA(tid, thread_params.msg_command, SET_FOREGROUND_SET_1, 0); + WaitForSingleObject(thread_params.command_executed, INFINITE); + check_wnd_state(0, 0, 0, 0); + test_window = GetForegroundWindow(); + ok(!test_window, "Expected foreground window 0, got %p\n", test_window); + ok(!app_activated, "Received WM_ACTIVATEAPP(!= 0), did not expect it.\n"); + ok(!app_deactivated, "Received WM_ACTIVATEAPP(0), did not expect it.\n"); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + check_wnd_state(window1, window1, window1, 0); + test_window = GetForegroundWindow(); + ok(test_window == window1, "Expected foreground window %p, got %p\n", + window1, test_window); + ok(app_activated, "Expected WM_ACTIVATEAPP(1), did not receive it.\n"); + ok(!app_deactivated, "Received WM_ACTIVATEAPP(0), did not expect it.\n"); + + /* Steal foreground then set it back: No messages are delivered. */ + app_activated = app_deactivated = FALSE; + PostThreadMessageA(tid, thread_params.msg_command, SET_FOREGROUND_STEAL_1 | SET_FOREGROUND_SET_1, 0); + WaitForSingleObject(thread_params.command_executed, INFINITE); + test_window = GetForegroundWindow(); + ok(test_window == window1, "Expected foreground window %p, got %p\n", + window1, test_window); + check_wnd_state(window1, window1, window1, 0); + ok(!app_activated, "Received WM_ACTIVATEAPP(1), did not expect it.\n"); + ok(!app_deactivated, "Received WM_ACTIVATEAPP(0), did not expect it.\n"); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + test_window = GetForegroundWindow(); + ok(test_window == window1, "Expected foreground window %p, got %p\n", + window1, test_window); + check_wnd_state(window1, window1, window1, 0); + ok(!app_activated, "Received WM_ACTIVATEAPP(1), did not expect it.\n"); + ok(!app_deactivated, "Received WM_ACTIVATEAPP(0), did not expect it.\n"); + + /* This is not implemented with a plain WM_ACTIVATEAPP filter. */ + app_activated = app_deactivated = FALSE; + PostThreadMessageA(tid, thread_params.msg_command, SET_FOREGROUND_STEAL_1 + | SET_FOREGROUND_INJECT | SET_FOREGROUND_SET_1, 0); + WaitForSingleObject(thread_params.command_executed, INFINITE); + test_window = GetForegroundWindow(); + ok(test_window == window1, "Expected foreground window %p, got %p\n", + window1, test_window); + check_wnd_state(window1, window1, window1, 0); + ok(!app_activated, "Received WM_ACTIVATEAPP(1), did not expect it.\n"); + ok(!app_deactivated, "Received WM_ACTIVATEAPP(0), did not expect it.\n"); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + test_window = GetForegroundWindow(); + ok(test_window == window1, "Expected foreground window %p, got %p\n", + window1, test_window); + check_wnd_state(window1, window1, window1, 0); + ok(!app_activated, "Received WM_ACTIVATEAPP(1), did not expect it.\n"); + ok(app_deactivated, "Expected WM_ACTIVATEAPP(0), did not receive it.\n"); + + SetForegroundWindow(thread_params.thread_window); + + /* Set foreground then remove: Both messages are delivered. */ + app_activated = app_deactivated = FALSE; + PostThreadMessageA(tid, thread_params.msg_command, SET_FOREGROUND_SET_1 | SET_FOREGROUND_STEAL_2, 0); + WaitForSingleObject(thread_params.command_executed, INFINITE); + test_window = GetForegroundWindow(); + ok(test_window == thread_params.thread_window, "Expected foreground window %p, got %p\n", + thread_params.thread_window, test_window); + check_wnd_state(0, thread_params.thread_window, 0, 0); + ok(!app_activated, "Received WM_ACTIVATEAPP(1), did not expect it.\n"); + ok(!app_deactivated, "Received WM_ACTIVATEAPP(0), did not expect it.\n"); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + test_window = GetForegroundWindow(); + ok(test_window == thread_params.thread_window, "Expected foreground window %p, got %p\n", + thread_params.thread_window, test_window); + /* Active and focus are window1 on wine because the internal WM_WINE_SETACTIVEWINDOW(0) + * message is never generated. GetCapture() returns 0 though, so we'd get a test success + * in todo_wine in the line below. + * todo_wine check_wnd_state(0, thread_params.thread_window, 0, 0); */ + ok(app_activated, "Expected WM_ACTIVATEAPP(1), did not receive it.\n"); + todo_wine ok(app_deactivated, "Expected WM_ACTIVATEAPP(0), did not receive it.\n"); + + SetForegroundWindow(window1); + test_window = GetForegroundWindow(); + ok(test_window == window1, "Expected foreground window %p, got %p\n", + window1, test_window); + check_wnd_state(window1, window1, window1, 0); + + /* Switch to a different window from the same thread? No messages. */ + app_activated = app_deactivated = FALSE; + PostThreadMessageA(tid, thread_params.msg_command, SET_FOREGROUND_STEAL_1 | SET_FOREGROUND_SET_2, 0); + WaitForSingleObject(thread_params.command_executed, INFINITE); + test_window = GetForegroundWindow(); + ok(test_window == window1, "Expected foreground window %p, got %p\n", + window1, test_window); + check_wnd_state(window1, window1, window1, 0); + ok(!app_activated, "Received WM_ACTIVATEAPP(1), did not expect it.\n"); + ok(!app_deactivated, "Received WM_ACTIVATEAPP(0), did not expect it.\n"); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + test_window = GetForegroundWindow(); + ok(test_window == window2, "Expected foreground window %p, got %p\n", + window2, test_window); + check_wnd_state(window2, window2, window2, 0); + ok(!app_activated, "Received WM_ACTIVATEAPP(1), did not expect it.\n"); + ok(!app_deactivated, "Received WM_ACTIVATEAPP(0), did not expect it.\n"); + + PostThreadMessageA(tid, thread_params.msg_quit, 0, 0); + WaitForSingleObject(thread, INFINITE); + + CloseHandle(thread_params.command_executed); + DestroyWindow(window2); +} + START_TEST(win) { char **argv; @@ -8175,6 +8471,7 @@ pGetGUIThreadInfo = (void *)GetProcAddress( user32, "GetGUIThreadInfo" ); pGetProcessDefaultLayout = (void *)GetProcAddress( user32, "GetProcessDefaultLayout" ); pSetProcessDefaultLayout = (void *)GetProcAddress( user32, "SetProcessDefaultLayout" ); + pFlashWindow = (void *)GetProcAddress( user32, "FlashWindow" ); pFlashWindowEx = (void *)GetProcAddress( user32, "FlashWindowEx" ); pGetLayout = (void *)GetProcAddress( gdi32, "GetLayout" ); pSetLayout = (void *)GetProcAddress( gdi32, "SetLayout" ); @@ -8238,6 +8535,7 @@ test_capture_3(hwndMain, hwndMain2); test_capture_4(); test_rtl_layout(); + test_FlashWindow(); test_FlashWindowEx(); test_CreateWindow(); @@ -8288,6 +8586,7 @@ test_window_without_child_style(); test_smresult(); test_GetMessagePos(); + test_activateapp(hwndMain); /* add the tests above this line */ if (hhook) UnhookWindowsHookEx(hhook); diff -Nru wine1.7-1.7.50/dlls/user32/text.c wine1.7-1.7.55/dlls/user32/text.c --- wine1.7-1.7.50/dlls/user32/text.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/text.c 2015-11-13 14:32:40.000000000 +0000 @@ -1214,7 +1214,7 @@ HFONT hfsave; HDC memdc; int slen = len; - BOOL retval = TRUE; + BOOL retval; COLORREF fg, bg; if(!hdc) return FALSE; diff -Nru wine1.7-1.7.50/dlls/user32/user32.rc wine1.7-1.7.55/dlls/user32/user32.rc --- wine1.7-1.7.50/dlls/user32/user32.rc 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/user32.rc 2015-11-13 14:32:40.000000000 +0000 @@ -75,17 +75,17 @@ STYLE DS_MODALFRAME | DS_NOIDLEMSG | DS_SETFONT | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU BEGIN ICON "", MSGBOX_IDICON, 8, 20, 16, 16, WS_CHILD | WS_VISIBLE - LTEXT "", MSGBOX_IDTEXT, 32, 4, 176, 48, WS_CHILD | WS_VISIBLE | WS_GROUP | SS_NOPREFIX - PUSHBUTTON "OK", IDOK, 16, 56, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP - PUSHBUTTON "Cancel", IDCANCEL, 74, 56, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "&Yes", IDYES, 16, 56, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "&No", IDNO, 74, 56, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP PUSHBUTTON "&Abort", IDABORT, 132, 56, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP PUSHBUTTON "&Retry", IDRETRY, 190, 56, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP - PUSHBUTTON "&Ignore", IDIGNORE, 248, 56, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP - PUSHBUTTON "&Yes", IDYES, 306, 56, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP - PUSHBUTTON "&No", IDNO, 364, 56, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "OK", IDOK, 248, 56, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "Cancel", IDCANCEL, 306, 56, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + PUSHBUTTON "&Ignore", IDIGNORE, 364, 56, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP PUSHBUTTON "&Try Again", IDTRYAGAIN, 422, 56, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP PUSHBUTTON "&Continue", IDCONTINUE, 480, 56, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP PUSHBUTTON "Help", IDHELP, 538, 56, 50, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP + LTEXT "", MSGBOX_IDTEXT, 32, 4, 176, 48, WS_CHILD | WS_VISIBLE | WS_GROUP | SS_NOPREFIX END MDI_MOREWINDOWS DIALOG 20, 20, 232, 122 diff -Nru wine1.7-1.7.50/dlls/user32/user32.spec wine1.7-1.7.55/dlls/user32/user32.spec --- wine1.7-1.7.50/dlls/user32/user32.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/user32.spec 2015-11-13 14:32:40.000000000 +0000 @@ -281,6 +281,7 @@ @ stdcall GetDCEx(long long long) @ stdcall GetDesktopWindow() @ stdcall GetDialogBaseUnits() +@ stdcall GetDisplayConfigBufferSizes(long ptr ptr) @ stdcall GetDlgCtrlID(long) @ stdcall GetDlgItem(long long) @ stdcall GetDlgItemInt(long long ptr long) diff -Nru wine1.7-1.7.50/dlls/user32/user_main.c wine1.7-1.7.55/dlls/user32/user_main.c --- wine1.7-1.7.50/dlls/user32/user_main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/user_main.c 2015-11-13 14:32:40.000000000 +0000 @@ -81,7 +81,7 @@ */ void USER_CheckNotLock(void) { - if (user_section.OwningThread == ULongToHandle(GetCurrentThreadId()) && user_section.RecursionCount) + if (RtlIsCriticalSectionLockedByThread(&user_section)) { ERR( "BUG: holding USER lock\n" ); DebugBreak(); diff -Nru wine1.7-1.7.50/dlls/user32/user_private.h wine1.7-1.7.55/dlls/user32/user_private.h --- wine1.7-1.7.50/dlls/user32/user_private.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/user_private.h 2015-11-13 14:32:40.000000000 +0000 @@ -96,6 +96,7 @@ BOOL (CDECL *pCreateDesktopWindow)(HWND); BOOL (CDECL *pCreateWindow)(HWND); void (CDECL *pDestroyWindow)(HWND); + void (CDECL *pFlashWindowEx)(FLASHWINFO*); void (CDECL *pGetDC)(HDC,HWND,HWND,const RECT *,const RECT *,DWORD); DWORD (CDECL *pMsgWaitForMultipleObjectsEx)(DWORD,const HANDLE*,DWORD,DWORD,DWORD); void (CDECL *pReleaseDC)(HWND,HDC); diff -Nru wine1.7-1.7.50/dlls/user32/win.c wine1.7-1.7.55/dlls/user32/win.c --- wine1.7-1.7.50/dlls/user32/win.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user32/win.c 2015-11-13 14:32:40.000000000 +0000 @@ -354,7 +354,7 @@ { WND *win; HWND current, *list; - int i, pos = 0, size = 16, count = 0; + int i, pos = 0, size = 16, count; if (!(list = HeapAlloc( GetProcessHeap(), 0, size * sizeof(HWND) ))) return NULL; @@ -1911,7 +1911,7 @@ */ HWND WINAPI FindWindowExW( HWND parent, HWND child, LPCWSTR className, LPCWSTR title ) { - HWND *list = NULL; + HWND *list; HWND retvalue = 0; int i = 0, len = 0; WCHAR *buffer = NULL; @@ -3413,17 +3413,45 @@ */ BOOL WINAPI FlashWindow( HWND hWnd, BOOL bInvert ) { + FLASHWINFO finfo; + + finfo.cbSize = sizeof(FLASHWINFO); + finfo.dwFlags = bInvert ? FLASHW_ALL : FLASHW_STOP; + finfo.uCount = 1; + finfo.dwTimeout = 0; + finfo.hwnd = hWnd; + return FlashWindowEx( &finfo ); +} + +/******************************************************************* + * FlashWindowEx (USER32.@) + */ +BOOL WINAPI FlashWindowEx( PFLASHWINFO pfinfo ) +{ WND *wndPtr; - TRACE("%p\n", hWnd); + TRACE( "%p\n", pfinfo->hwnd ); + + if (!pfinfo) + { + SetLastError( ERROR_NOACCESS ); + return FALSE; + } + + if (!pfinfo->hwnd || pfinfo->cbSize != sizeof(FLASHWINFO) || !IsWindow( pfinfo->hwnd )) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return FALSE; + } + FIXME( "%p - semi-stub\n", pfinfo ); - if (IsIconic( hWnd )) + if (IsIconic( pfinfo->hwnd )) { - RedrawWindow( hWnd, 0, 0, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_FRAME ); + RedrawWindow( pfinfo->hwnd, 0, 0, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_FRAME ); - wndPtr = WIN_GetPtr(hWnd); + wndPtr = WIN_GetPtr( pfinfo->hwnd ); if (!wndPtr || wndPtr == WND_OTHER_PROCESS || wndPtr == WND_DESKTOP) return FALSE; - if (bInvert && !(wndPtr->flags & WIN_NCACTIVATED)) + if (pfinfo->dwFlags && !(wndPtr->flags & WIN_NCACTIVATED)) { wndPtr->flags |= WIN_NCACTIVATED; } @@ -3432,35 +3460,29 @@ wndPtr->flags &= ~WIN_NCACTIVATED; } WIN_ReleasePtr( wndPtr ); + USER_Driver->pFlashWindowEx( pfinfo ); return TRUE; } else { WPARAM wparam; + HWND hwnd = pfinfo->hwnd; - wndPtr = WIN_GetPtr(hWnd); + wndPtr = WIN_GetPtr( hwnd ); if (!wndPtr || wndPtr == WND_OTHER_PROCESS || wndPtr == WND_DESKTOP) return FALSE; - hWnd = wndPtr->obj.handle; /* make it a full handle */ + hwnd = wndPtr->obj.handle; /* make it a full handle */ - if (bInvert) wparam = !(wndPtr->flags & WIN_NCACTIVATED); - else wparam = (hWnd == GetForegroundWindow()); + if (pfinfo->dwFlags) wparam = !(wndPtr->flags & WIN_NCACTIVATED); + else wparam = (hwnd == GetForegroundWindow()); WIN_ReleasePtr( wndPtr ); - SendMessageW( hWnd, WM_NCACTIVATE, wparam, 0 ); + SendMessageW( hwnd, WM_NCACTIVATE, wparam, 0 ); + USER_Driver->pFlashWindowEx( pfinfo ); return wparam; } } /******************************************************************* - * FlashWindowEx (USER32.@) - */ -BOOL WINAPI FlashWindowEx( PFLASHWINFO pfwi ) -{ - FIXME("%p\n", pfwi); - return TRUE; -} - -/******************************************************************* * GetWindowContextHelpId (USER32.@) */ DWORD WINAPI GetWindowContextHelpId( HWND hwnd ) diff -Nru wine1.7-1.7.50/dlls/user.exe16/user.c wine1.7-1.7.55/dlls/user.exe16/user.c --- wine1.7-1.7.50/dlls/user.exe16/user.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/user.exe16/user.c 2015-11-13 14:32:40.000000000 +0000 @@ -3244,7 +3244,7 @@ argliststart=args+insertnr-1; /* CMF - This makes a BIG assumption about va_list */ - while ((ret = vsnprintf(b, sz, fmtstr, (va_list) argliststart) < 0) || (ret >= sz)) { + while ((ret = vsnprintf(b, sz, fmtstr, (va_list) argliststart)) < 0 || ret >= sz) { sz = (ret == -1 ? sz + 100 : ret + 1); b = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, b, sz); } diff -Nru wine1.7-1.7.50/dlls/usp10/bracket.c wine1.7-1.7.55/dlls/usp10/bracket.c --- wine1.7-1.7.50/dlls/usp10/bracket.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/usp10/bracket.c 2015-11-13 14:32:40.000000000 +0000 @@ -1,5 +1,5 @@ /* Unicode Bidirectional Bracket table */ -/* generated from http://www.unicode.org/Public/7.0.0/ucd/BidiBrackets.txt */ +/* generated from http://www.unicode.org/Public/8.0.0/ucd/BidiBrackets.txt */ /* DO NOT EDIT!! */ const unsigned short bidi_bracket_table[768] = diff -Nru wine1.7-1.7.50/dlls/usp10/indicsyllable.c wine1.7-1.7.55/dlls/usp10/indicsyllable.c --- wine1.7-1.7.50/dlls/usp10/indicsyllable.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/usp10/indicsyllable.c 2015-11-13 14:32:40.000000000 +0000 @@ -1,9 +1,9 @@ /* Unicode Indic Syllabic Category */ -/* generated from http://www.unicode.org/Public/7.0.0/ucd/IndicSyllabicCategory.txt */ -/* and from http://www.unicode.org/Public/7.0.0/ucd/IndicMatraCategory.txt */ +/* generated from http://www.unicode.org/Public/8.0.0/ucd/IndicSyllabicCategory.txt */ +/* and from http://www.unicode.org/Public/8.0.0/ucd/IndicPositionalCategory.txt */ /* DO NOT EDIT!! */ -const unsigned short indic_syllabic_table[2864] = +const unsigned short indic_syllabic_table[3088] = { /* level 1 offsets */ 0x0100, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, @@ -40,50 +40,50 @@ 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, /* level 2 offsets */ 0x0250, 0x0260, 0x0270, 0x0280, 0x0260, 0x0260, 0x0260, 0x0260, - 0x0260, 0x0260, 0x0290, 0x0260, 0x0260, 0x02a0, 0x0260, 0x0260, + 0x0260, 0x0260, 0x0290, 0x02a0, 0x0260, 0x02b0, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, - 0x02b0, 0x02c0, 0x02d0, 0x02e0, 0x02f0, 0x0300, 0x0310, 0x0320, - 0x0330, 0x0340, 0x0350, 0x0360, 0x0370, 0x0380, 0x0310, 0x0390, - 0x03a0, 0x0340, 0x0350, 0x03b0, 0x03c0, 0x03d0, 0x03e0, 0x03f0, - 0x0400, 0x0410, 0x0350, 0x0420, 0x0430, 0x0260, 0x0310, 0x0260, - 0x0330, 0x0340, 0x0350, 0x0440, 0x0450, 0x0460, 0x0310, 0x0470, - 0x0480, 0x0490, 0x04a0, 0x04b0, 0x04c0, 0x04d0, 0x03e0, 0x0260, - 0x04e0, 0x04f0, 0x0350, 0x0500, 0x0510, 0x0520, 0x0310, 0x0260, - 0x0530, 0x04f0, 0x0350, 0x0540, 0x0550, 0x0560, 0x0310, 0x0260, - 0x0530, 0x04f0, 0x02d0, 0x0570, 0x0580, 0x04d0, 0x0310, 0x0590, - 0x05a0, 0x05b0, 0x02d0, 0x05c0, 0x05d0, 0x05e0, 0x03e0, 0x05f0, - 0x0600, 0x02d0, 0x0610, 0x0620, 0x0630, 0x0280, 0x0260, 0x0260, - 0x0640, 0x0650, 0x0660, 0x0670, 0x0680, 0x0690, 0x0260, 0x0260, - 0x0260, 0x0260, 0x06a0, 0x06b0, 0x06c0, 0x02d0, 0x06d0, 0x06e0, - 0x06f0, 0x0700, 0x0710, 0x0720, 0x0260, 0x0260, 0x0260, 0x0260, - 0x02d0, 0x02d0, 0x0730, 0x0740, 0x0750, 0x0760, 0x0770, 0x0780, - 0x0790, 0x07a0, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, - 0x07b0, 0x07c0, 0x07d0, 0x07c0, 0x07d0, 0x07e0, 0x07b0, 0x07f0, - 0x02d0, 0x02d0, 0x0800, 0x0810, 0x0820, 0x0830, 0x0280, 0x0260, - 0x0840, 0x0610, 0x0850, 0x0860, 0x03e0, 0x02d0, 0x0870, 0x0880, - 0x0260, 0x0260, 0x0260, 0x0890, 0x08a0, 0x0260, 0x0260, 0x0260, - 0x0260, 0x08b0, 0x0260, 0x0260, 0x0260, 0x08c0, 0x08d0, 0x08e0, + 0x02c0, 0x02d0, 0x02e0, 0x02f0, 0x0300, 0x0310, 0x0320, 0x0330, + 0x0340, 0x0350, 0x0360, 0x0370, 0x0380, 0x0390, 0x0320, 0x03a0, + 0x03b0, 0x0350, 0x0360, 0x03c0, 0x03d0, 0x03e0, 0x03f0, 0x0400, + 0x0410, 0x0420, 0x0360, 0x0430, 0x0440, 0x0260, 0x0320, 0x0450, + 0x0340, 0x0350, 0x0360, 0x0460, 0x0470, 0x0480, 0x0320, 0x0490, + 0x04a0, 0x04b0, 0x04c0, 0x04d0, 0x04e0, 0x04f0, 0x03f0, 0x0260, + 0x0500, 0x0510, 0x0360, 0x0520, 0x0530, 0x0540, 0x0320, 0x0260, + 0x0550, 0x0510, 0x0360, 0x0560, 0x0570, 0x0580, 0x0320, 0x0590, + 0x0550, 0x0510, 0x02e0, 0x05a0, 0x05b0, 0x05c0, 0x0320, 0x05d0, + 0x05e0, 0x05f0, 0x02e0, 0x0600, 0x0610, 0x0620, 0x03f0, 0x0630, + 0x0640, 0x02e0, 0x0650, 0x0660, 0x0670, 0x0280, 0x0260, 0x0260, + 0x0680, 0x0690, 0x06a0, 0x06b0, 0x06c0, 0x06d0, 0x0260, 0x0260, + 0x0260, 0x06e0, 0x06f0, 0x0700, 0x0710, 0x02e0, 0x0720, 0x0730, + 0x0740, 0x0750, 0x0760, 0x0770, 0x0780, 0x0260, 0x0260, 0x0260, + 0x02e0, 0x02e0, 0x0790, 0x07a0, 0x07b0, 0x07c0, 0x07d0, 0x07e0, + 0x07f0, 0x0800, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, + 0x0810, 0x0820, 0x0830, 0x0820, 0x0830, 0x0840, 0x0810, 0x0850, + 0x02e0, 0x02e0, 0x0860, 0x0870, 0x0880, 0x0890, 0x0280, 0x0260, + 0x08a0, 0x0650, 0x08b0, 0x08c0, 0x03f0, 0x02e0, 0x08d0, 0x08e0, + 0x0260, 0x0260, 0x0260, 0x08f0, 0x0900, 0x0260, 0x0260, 0x0260, + 0x0260, 0x0910, 0x0260, 0x0260, 0x0260, 0x0920, 0x0930, 0x0940, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, - 0x08f0, 0x0260, 0x0260, 0x0900, 0x0910, 0x0260, 0x0260, 0x0260, - 0x0920, 0x0260, 0x0930, 0x0940, 0x0260, 0x0260, 0x0950, 0x0960, - 0x0260, 0x0260, 0x0970, 0x0980, 0x0260, 0x0260, 0x0260, 0x0260, - 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0990, 0x09a0, - 0x09b0, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, + 0x0950, 0x0260, 0x0260, 0x0960, 0x0970, 0x0260, 0x0980, 0x0990, + 0x09a0, 0x0260, 0x09b0, 0x09c0, 0x0260, 0x0260, 0x09d0, 0x09e0, + 0x0260, 0x0260, 0x09f0, 0x0a00, 0x0260, 0x0260, 0x0260, 0x0260, + 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0a10, 0x0a20, 0x0a30, + 0x0a40, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0a50, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, - 0x0260, 0x0260, 0x0260, 0x0260, 0x09c0, 0x0260, 0x0260, 0x0260, - 0x09d0, 0x0260, 0x09e0, 0x0260, 0x0260, 0x0260, 0x09f0, 0x0a00, - 0x0a10, 0x0260, 0x0260, 0x0a20, 0x0a30, 0x0260, 0x0260, 0x0260, - 0x0260, 0x0260, 0x0260, 0x0260, 0x0a40, 0x0a50, 0x0260, 0x0260, - 0x0a60, 0x0260, 0x0260, 0x0a70, 0x0a80, 0x0260, 0x0260, 0x0260, - 0x0260, 0x0260, 0x0a90, 0x0aa0, 0x0ab0, 0x0260, 0x0260, 0x0ac0, - 0x0260, 0x0260, 0x0260, 0x0ad0, 0x0ae0, 0x0260, 0x0af0, 0x0b00, + 0x0260, 0x0260, 0x0260, 0x0260, 0x0a60, 0x0260, 0x0260, 0x0260, + 0x0a70, 0x0260, 0x0a80, 0x0260, 0x0260, 0x0260, 0x0a90, 0x0aa0, + 0x0ab0, 0x0260, 0x0260, 0x0ac0, 0x0ad0, 0x0260, 0x0ae0, 0x0af0, + 0x0260, 0x0260, 0x0b00, 0x0260, 0x0b10, 0x0b20, 0x0260, 0x0260, + 0x0b30, 0x0260, 0x0260, 0x0b40, 0x0b50, 0x0260, 0x0b60, 0x0260, + 0x0260, 0x0260, 0x0b70, 0x0b80, 0x0b90, 0x0260, 0x0260, 0x0ba0, + 0x0260, 0x0260, 0x0260, 0x0bb0, 0x0bc0, 0x0260, 0x0bd0, 0x0be0, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, - 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0b10, 0x0b20, 0x0260, + 0x0260, 0x0260, 0x0260, 0x0260, 0x0260, 0x0bf0, 0x0c00, 0x0260, /* values */ - 0x5f00, 0x9900, 0x9200, 0x9200, 0x8300, 0x8300, 0x8300, 0x8300, - 0x7b00, 0x6b00, 0x5a00, 0x5100, 0x4200, 0x2d00, 0x1700, 0x0a00, + 0x5f00, 0x9c00, 0x9500, 0x9500, 0x8600, 0x8600, 0x8600, 0x8600, + 0x7e00, 0x6e00, 0x5d00, 0x5100, 0x4200, 0x2d00, 0x1700, 0x0a00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -92,67 +92,71 @@ 0x001d, 0x001d, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0021, 0x0021, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0001, 0x0001, 0x0001, 0x0002, 0x0006, 0x0006, 0x0006, 0x0006, + 0x0501, 0x0501, 0x0501, 0x0102, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, - 0x000a, 0x000a, 0x0507, 0x0107, 0x0004, 0x0003, 0x0107, 0x0207, + 0x000a, 0x000a, 0x0507, 0x0107, 0x0604, 0x0003, 0x0107, 0x0207, 0x0107, 0x0607, 0x0607, 0x0607, 0x0607, 0x0507, 0x0507, 0x0507, 0x0507, 0x0107, 0x0107, 0x0107, 0x0107, 0x0605, 0x0207, 0x0107, - 0x0000, 0x0013, 0x0013, 0x0000, 0x0000, 0x0507, 0x0607, 0x0607, + 0x0000, 0x0519, 0x0619, 0x0500, 0x0500, 0x0507, 0x0607, 0x0607, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x0006, 0x0006, 0x0607, 0x0607, 0x0000, 0x0000, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0000, 0x0000, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, - 0x0000, 0x0001, 0x0001, 0x0002, 0x0000, 0x0006, 0x0006, 0x0006, + 0x0000, 0x0501, 0x0101, 0x0102, 0x0000, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0000, 0x0000, 0x0006, 0x0006, 0x0000, 0x0000, 0x0006, 0x0006, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x0000, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x0000, 0x000a, 0x0000, 0x0000, 0x0000, 0x000a, 0x000a, - 0x000a, 0x000a, 0x0000, 0x0000, 0x0004, 0x0003, 0x0107, 0x0207, + 0x000a, 0x000a, 0x0000, 0x0000, 0x0604, 0x0003, 0x0107, 0x0207, 0x0107, 0x0607, 0x0607, 0x0607, 0x0607, 0x0000, 0x0000, 0x0207, 0x0207, 0x0000, 0x0000, 0x0407, 0x0407, 0x0605, 0x000b, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0107, 0x0000, 0x0000, 0x0000, 0x0000, 0x000a, 0x000a, 0x0000, 0x000a, 0x000a, 0x000a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0001, 0x0001, 0x0002, 0x0000, 0x0006, 0x0006, 0x0006, + 0x0000, 0x0501, 0x0501, 0x0102, 0x0000, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0006, 0x000a, 0x0000, 0x000a, 0x000a, 0x0000, 0x000a, 0x000a, 0x0000, - 0x000a, 0x000a, 0x0000, 0x0000, 0x0004, 0x0000, 0x0107, 0x0207, + 0x000a, 0x000a, 0x0000, 0x0000, 0x0604, 0x0000, 0x0107, 0x0207, 0x0107, 0x0607, 0x0607, 0x0000, 0x0000, 0x0000, 0x0000, 0x0507, 0x0507, 0x0000, 0x0000, 0x0507, 0x0507, 0x0605, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000a, 0x000a, 0x000a, 0x000a, 0x0000, 0x000a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, - 0x0001, 0x0518, 0x0009, 0x0009, 0x0000, 0x000e, 0x0000, 0x0000, + 0x0501, 0x0518, 0x0009, 0x0009, 0x0000, 0x060e, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0001, 0x0001, 0x0002, 0x0000, 0x0006, 0x0006, 0x0006, + 0x0000, 0x0501, 0x0501, 0x0102, 0x0000, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0000, 0x0006, 0x0006, 0x0006, 0x0000, 0x0006, 0x0006, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x0000, 0x000a, 0x000a, 0x0000, 0x000a, 0x000a, 0x000a, - 0x000a, 0x000a, 0x0000, 0x0000, 0x0004, 0x0003, 0x0107, 0x0207, + 0x000a, 0x000a, 0x0000, 0x0000, 0x0604, 0x0003, 0x0107, 0x0207, 0x0107, 0x0607, 0x0607, 0x0607, 0x0607, 0x0507, 0x0000, 0x0507, 0x0507, 0x0007, 0x0000, 0x0107, 0x0107, 0x0605, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x000a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000a, 0x0000, 0x000a, 0x000a, 0x0000, 0x000a, 0x000a, 0x000a, - 0x000a, 0x000a, 0x0000, 0x0000, 0x0004, 0x0003, 0x0107, 0x0507, + 0x000a, 0x000a, 0x0000, 0x0000, 0x0604, 0x0003, 0x0107, 0x0507, 0x0107, 0x0607, 0x0607, 0x0607, 0x0607, 0x0000, 0x0000, 0x0207, 0x0007, 0x0000, 0x0000, 0x0007, 0x0007, 0x0605, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0507, 0x0007, 0x0000, 0x0000, 0x0000, 0x0000, 0x000a, 0x000a, 0x0000, 0x000a, 0x0000, 0x000a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0001, 0x0011, 0x0000, 0x0006, 0x0006, 0x0006, + 0x0000, 0x0000, 0x0501, 0x0011, 0x0000, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0000, 0x0000, 0x0000, 0x0006, 0x0006, 0x0006, 0x0000, 0x0006, 0x0006, 0x0006, 0x000a, 0x0000, 0x0000, 0x0000, 0x000a, 0x000a, 0x0000, 0x000a, 0x0000, 0x000a, 0x000a, @@ -160,11 +164,11 @@ 0x000a, 0x000a, 0x000a, 0x0000, 0x0000, 0x0000, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0107, 0x0107, - 0x0507, 0x0607, 0x0607, 0x0000, 0x0000, 0x0000, 0x0207, 0x0207, + 0x0507, 0x0107, 0x0107, 0x0000, 0x0000, 0x0000, 0x0207, 0x0207, 0x0207, 0x0000, 0x0407, 0x0407, 0x0407, 0x0505, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0107, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0001, 0x0001, 0x0001, 0x0002, 0x0000, 0x0006, 0x0006, 0x0006, + 0x0501, 0x0101, 0x0101, 0x0102, 0x0000, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0000, 0x0006, 0x0006, 0x0006, 0x0000, 0x0006, 0x0006, 0x0006, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, @@ -173,22 +177,26 @@ 0x0507, 0x0107, 0x0107, 0x0107, 0x0107, 0x0000, 0x0507, 0x0507, 0x0007, 0x0000, 0x0507, 0x0507, 0x0507, 0x0505, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0507, 0x0607, 0x0000, - 0x000a, 0x000a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0001, 0x0001, 0x0002, 0x0000, 0x0006, 0x0006, 0x0006, + 0x000a, 0x000a, 0x000a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0501, 0x0101, 0x0102, 0x0000, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0000, 0x0006, 0x0006, 0x000a, 0x000a, 0x000a, 0x000a, 0x0000, 0x000a, 0x000a, 0x000a, - 0x000a, 0x000a, 0x0000, 0x0000, 0x0004, 0x0003, 0x0107, 0x0507, + 0x000a, 0x000a, 0x0000, 0x0000, 0x0604, 0x0003, 0x0107, 0x0507, 0x0007, 0x0107, 0x0107, 0x0107, 0x0107, 0x0000, 0x0507, 0x0807, 0x0807, 0x0000, 0x0807, 0x0807, 0x0507, 0x0505, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0107, 0x0107, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000a, 0x0000, + 0x0000, 0x001f, 0x001f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x0000, 0x0000, 0x0003, 0x0107, 0x0107, 0x0107, 0x0107, 0x0107, 0x0607, 0x0607, 0x0000, 0x0207, 0x0207, 0x0207, 0x0000, 0x0407, 0x0407, 0x0407, 0x0505, 0x0015, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0107, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000b, 0x000b, 0x000b, 0x000b, 0x000b, 0x000b, - 0x0000, 0x0000, 0x0001, 0x0002, 0x0000, 0x0006, 0x0006, 0x0006, + 0x0000, 0x0000, 0x0101, 0x0102, 0x0000, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0000, 0x0000, 0x0000, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, @@ -207,7 +215,7 @@ 0x0107, 0x0507, 0x0107, 0x0107, 0x0507, 0x0507, 0x0507, 0x0507, 0x0607, 0x0607, 0x0616, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0307, 0x0307, 0x0307, 0x0307, 0x0307, 0x0107, 0x0000, 0x0507, - 0x0013, 0x0013, 0x0013, 0x0013, 0x0000, 0x0001, 0x0516, 0x0000, + 0x0513, 0x0513, 0x0513, 0x0513, 0x0522, 0x0501, 0x0516, 0x0000, 0x0000, 0x000a, 0x000a, 0x0000, 0x000a, 0x0000, 0x0000, 0x000a, 0x000a, 0x0000, 0x000a, 0x0000, 0x0000, 0x000a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000a, 0x000a, 0x000a, 0x000a, @@ -215,45 +223,49 @@ 0x0000, 0x000a, 0x000a, 0x000a, 0x0000, 0x000a, 0x0000, 0x000a, 0x0000, 0x0000, 0x000a, 0x000a, 0x0000, 0x000a, 0x000a, 0x0000, 0x0107, 0x0507, 0x0107, 0x0107, 0x0507, 0x0507, 0x0507, 0x0507, - 0x0607, 0x0607, 0x0000, 0x0507, 0x000e, 0x000e, 0x0000, 0x0000, + 0x0607, 0x0607, 0x0000, 0x0507, 0x060e, 0x000e, 0x0000, 0x0000, 0x0307, 0x0307, 0x0307, 0x0307, 0x0307, 0x0000, 0x0000, 0x0000, - 0x0013, 0x0013, 0x0013, 0x0013, 0x0000, 0x0001, 0x0000, 0x0000, + 0x0513, 0x0513, 0x0513, 0x0513, 0x0500, 0x0501, 0x0000, 0x0000, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0000, 0x0000, 0x000a, 0x000a, 0x000a, 0x000a, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0600, 0x0600, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, - 0x001d, 0x001d, 0x001d, 0x001d, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x001d, 0x001d, 0x001d, 0x001d, 0x0000, 0x0621, 0x0000, 0x0621, + 0x0000, 0x0504, 0x0000, 0x0000, 0x0000, 0x0000, 0x0100, 0x0200, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x0000, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0607, 0x0507, 0x0007, 0x0607, 0x0607, 0x0707, 0x0707, - 0x0707, 0x0707, 0x0507, 0x0507, 0x0507, 0x0507, 0x0001, 0x0002, - 0x0507, 0x0007, 0x0001, 0x0001, 0x0616, 0x0003, 0x0000, 0x0000, - 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x000d, 0x000d, 0x000d, - 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, - 0x0000, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, - 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, - 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, - 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, - 0x000d, 0x000d, 0x000d, 0x000d, 0x000d, 0x0000, 0x0000, 0x0000, + 0x0707, 0x0707, 0x0507, 0x0507, 0x0507, 0x0507, 0x0501, 0x0102, + 0x0507, 0x0007, 0x0501, 0x0501, 0x0616, 0x0003, 0x0500, 0x0500, + 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x060d, 0x060d, 0x060d, + 0x060d, 0x060d, 0x060d, 0x060d, 0x060d, 0x060d, 0x060d, 0x060d, + 0x0000, 0x060d, 0x060d, 0x060d, 0x060d, 0x060d, 0x060d, 0x060d, + 0x060d, 0x060d, 0x060d, 0x060d, 0x060d, 0x060d, 0x060d, 0x060d, + 0x060d, 0x060d, 0x060d, 0x060d, 0x060d, 0x060d, 0x060d, 0x060d, + 0x060d, 0x060d, 0x060d, 0x060d, 0x060d, 0x060d, 0x060d, 0x060d, + 0x060d, 0x060d, 0x060d, 0x060d, 0x060d, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0621, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000a, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0107, 0x0107, 0x0507, 0x0507, 0x0607, - 0x0607, 0x0207, 0x0507, 0x0507, 0x0507, 0x0507, 0x0001, 0x0013, - 0x0002, 0x0017, 0x0516, 0x000e, 0x000e, 0x000e, 0x000e, 0x000a, + 0x0607, 0x0207, 0x0507, 0x0507, 0x0507, 0x0507, 0x0501, 0x0613, + 0x0102, 0x0017, 0x0516, 0x010e, 0x000e, 0x060e, 0x060e, 0x000a, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0000, 0x0000, 0x0000, 0x0000, 0x0009, 0x0000, 0x000a, 0x000a, 0x0006, 0x0006, 0x0006, 0x0006, 0x0107, 0x0107, - 0x0607, 0x0607, 0x000a, 0x000a, 0x000a, 0x000a, 0x000e, 0x000e, - 0x000e, 0x000a, 0x0107, 0x0013, 0x0013, 0x000a, 0x000a, 0x0107, - 0x0107, 0x0013, 0x0013, 0x0013, 0x0013, 0x0013, 0x000a, 0x000a, + 0x0607, 0x0607, 0x000a, 0x000a, 0x000a, 0x000a, 0x060e, 0x060e, + 0x060e, 0x000a, 0x0107, 0x0113, 0x0113, 0x000a, 0x000a, 0x0107, + 0x0107, 0x0113, 0x0113, 0x0113, 0x0113, 0x0113, 0x000a, 0x000a, 0x000a, 0x0507, 0x0507, 0x0507, 0x0507, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, - 0x000a, 0x000a, 0x000e, 0x0107, 0x0207, 0x0507, 0x0507, 0x0013, - 0x0013, 0x0013, 0x0013, 0x0013, 0x0013, 0x0013, 0x000a, 0x0013, + 0x000a, 0x000a, 0x060e, 0x0107, 0x0207, 0x0507, 0x0507, 0x0113, + 0x0113, 0x0113, 0x0113, 0x0113, 0x0113, 0x0613, 0x000a, 0x0113, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, - 0x001d, 0x001d, 0x0013, 0x0013, 0x0107, 0x0507, 0x0000, 0x0000, + 0x001d, 0x001d, 0x0113, 0x0113, 0x0107, 0x0507, 0x0000, 0x0000, 0x0006, 0x0006, 0x0006, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x0000, 0x000a, 0x000a, 0x000a, 0x000a, 0x0507, 0x0607, 0x0616, 0x0000, 0x0000, 0x0000, @@ -268,102 +280,118 @@ 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0000, 0x0000, 0x0107, 0x0507, 0x0507, 0x0507, 0x0507, 0x0607, 0x0607, 0x0607, 0x0007, 0x0007, - 0x0007, 0x0207, 0x0207, 0x0207, 0x0407, 0x0407, 0x0001, 0x0002, - 0x0107, 0x0514, 0x0514, 0x0514, 0x050c, 0x0500, 0x0500, 0x0500, - 0x0500, 0x0516, 0x0017, 0x0500, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0003, 0x0000, 0x0000, 0x0000, + 0x0007, 0x0207, 0x0207, 0x0207, 0x0407, 0x0407, 0x0501, 0x0102, + 0x0107, 0x0514, 0x0514, 0x0521, 0x050c, 0x0522, 0x0521, 0x0521, + 0x0521, 0x0516, 0x0017, 0x0521, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0003, 0x0500, 0x0000, 0x0000, 0x0009, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x0507, 0x0507, 0x0607, 0x0107, 0x0107, 0x0807, 0x0807, 0x0507, - 0x0507, 0x000d, 0x000d, 0x000d, 0x0000, 0x0000, 0x0000, 0x0000, - 0x000f, 0x000f, 0x0001, 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, - 0x000f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0507, 0x010d, 0x010d, 0x010d, 0x0000, 0x0000, 0x0000, 0x0000, + 0x010f, 0x010f, 0x0601, 0x010f, 0x010f, 0x010f, 0x010f, 0x010f, + 0x010f, 0x060f, 0x0507, 0x0621, 0x0000, 0x0000, 0x0000, 0x0000, 0x000a, 0x000a, 0x000a, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, 0x0012, 0x0012, 0x0012, 0x0012, 0x0012, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0200, 0x0200, 0x0200, - 0x0100, 0x0100, 0x0200, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0300, 0x0300, 0x0300, + 0x0100, 0x0100, 0x0000, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0100, 0x0100, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0500, 0x0600, 0x0200, 0x0100, 0x0507, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x020e, 0x000e, 0x000f, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x020e, 0x060e, 0x010f, + 0x0500, 0x0500, 0x0500, 0x0600, 0x0600, 0x0600, 0x0600, 0x0000, 0x0017, 0x0107, 0x0507, 0x0100, 0x0100, 0x0500, 0x0500, 0x0500, 0x0500, 0x0600, 0x0600, 0x0500, 0x0600, 0x0100, 0x0200, 0x0200, - 0x0200, 0x0200, 0x0200, 0x0500, 0x0500, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x000c, 0x0002, 0x0000, 0x0000, 0x0000, + 0x0200, 0x0200, 0x0200, 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, + 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, 0x0000, 0x0000, 0x0621, + 0x0500, 0x0500, 0x0500, 0x050c, 0x0102, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0004, 0x0107, 0x0500, 0x0500, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0504, 0x0107, 0x0500, 0x0500, 0x0600, 0x0600, 0x0600, 0x0007, 0x0007, 0x0000, 0x0200, 0x0200, 0x0400, 0x0400, 0x0507, 0x0007, 0x0105, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0001, 0x000c, 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x000d, 0x0000, 0x0000, 0x0500, 0x0600, 0x0200, 0x0100, - 0x0500, 0x0500, 0x0116, 0x0017, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0500, 0x0600, 0x0500, 0x0500, 0x0500, + 0x0500, 0x0500, 0x0500, 0x0500, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0003, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004, 0x0107, - 0x0500, 0x0500, 0x0100, 0x0100, 0x0100, 0x0507, 0x0107, 0x0507, - 0x0000, 0x0000, 0x0100, 0x0100, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0501, 0x050c, 0x0102, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0100, 0x0200, - 0x0200, 0x0000, 0x0100, 0x0100, 0x0607, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0200, 0x0200, 0x0000, 0x0004, + 0x0000, 0x010d, 0x0600, 0x0600, 0x0500, 0x0600, 0x0200, 0x0100, + 0x0500, 0x0500, 0x0116, 0x0017, 0x0600, 0x0600, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0013, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0003, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0504, 0x0107, + 0x0500, 0x0500, 0x0100, 0x0100, 0x0100, 0x0507, 0x0107, 0x0507, + 0x0500, 0x0500, 0x0100, 0x0100, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0013, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0100, 0x0100, 0x0100, 0x0200, + 0x0200, 0x0000, 0x0100, 0x0100, 0x0607, 0x0500, 0x0500, 0x0500, + 0x0500, 0x0500, 0x0500, 0x0500, 0x0200, 0x0200, 0x0521, 0x0604, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0500, 0x0500, 0x0500, 0x0000, 0x0d00, 0x0600, 0x0600, 0x0600, + 0x0600, 0x0600, 0x0500, 0x0500, 0x0600, 0x0600, 0x0600, 0x0600, + 0x0500, 0x0119, 0x0d00, 0x0d00, 0x0d00, 0x0d00, 0x0d00, 0x0d00, + 0x0d00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0600, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0519, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x001a, 0x001b, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0021, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0516, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0501, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0100, 0x0100, 0x0600, 0x0500, 0x0107, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000d, 0x000a, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0001, 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0101, 0x0102, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x000f, 0x0100, 0x0100, 0x0100, + 0x0000, 0x0000, 0x0000, 0x0000, 0x010f, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0605, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, + 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, 0x0500, + 0x0500, 0x0500, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0600, 0x0600, 0x0600, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0600, - 0x0600, 0x0600, 0x0500, 0x0600, 0x0600, 0x0600, 0x0600, 0x0000, - 0x0000, 0x0000, 0x000f, 0x0116, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0600, 0x0600, 0x0500, 0x0600, 0x0600, 0x0600, 0x0600, 0x0500, + 0x0500, 0x0500, 0x010f, 0x0116, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x000c, 0x0002, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0500, 0x0500, 0x050c, 0x0102, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0004, 0x0100, 0x0100, 0x0500, 0x0500, - 0x0600, 0x0600, 0x0200, 0x0200, 0x0507, 0x000d, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0504, 0x0100, 0x0100, 0x0500, 0x0500, + 0x0600, 0x0600, 0x0200, 0x0200, 0x0507, 0x010d, 0x0100, 0x0100, 0x0005, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0507, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0500, 0x0500, 0x0500, 0x0500, 0x0600, 0x0500, 0x0200, - 0x0200, 0x0500, 0x0600, 0x0000, 0x0200, 0x0000, 0x0000, 0x0000, + 0x0200, 0x0500, 0x0600, 0x0100, 0x0200, 0x0600, 0x0600, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x000f, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x000f, 0x000f, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x050f, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x050f, 0x010f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x000a, 0x0013, 0x0013, 0x0013, 0x0000, 0x0000, + 0x0000, 0x0000, 0x000a, 0x0113, 0x0513, 0x0113, 0x0000, 0x0000, 0x0507, 0x0107, 0x0500, 0x0500, 0x0600, 0x0300, 0x0300, 0x0500, - 0x0500, 0x0000, 0x0100, 0x0300, 0x0300, 0x0100, 0x0507, 0x0013, - 0x0012, 0x0013, 0x0012, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0500, 0x0000, 0x0100, 0x0300, 0x0300, 0x0100, 0x0507, 0x0513, + 0x0012, 0x0513, 0x0012, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0207, 0x0600, 0x0500, 0x0200, 0x0100, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0002, 0x0017, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0102, 0x0017, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x000a, 0x0006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0100, 0x0100, 0x0507, 0x0100, 0x0100, - 0x0607, 0x0100, 0x0100, 0x0000, 0x0013, 0x0616, 0x0000, 0x0000 + 0x0607, 0x0100, 0x0100, 0x0000, 0x0113, 0x0616, 0x0000, 0x0000 }; diff -Nru wine1.7-1.7.50/dlls/usp10/linebreak.c wine1.7-1.7.55/dlls/usp10/linebreak.c --- wine1.7-1.7.50/dlls/usp10/linebreak.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/usp10/linebreak.c 2015-11-13 14:32:40.000000000 +0000 @@ -1,8 +1,8 @@ /* Unicode Line Break Properties */ -/* generated from http://www.unicode.org/Public/7.0.0/ucd/LineBreak.txt */ +/* generated from http://www.unicode.org/Public/8.0.0/ucd/LineBreak.txt */ /* DO NOT EDIT!! */ -const unsigned short wine_linebreak_table[7232] = +const unsigned short wine_linebreak_table[7216] = { /* level 1 offsets */ 0x0100, 0x0110, 0x0120, 0x0130, 0x0140, 0x0150, 0x0160, 0x0170, @@ -96,19 +96,19 @@ 0x0860, 0x0860, 0x0860, 0x0860, 0x0a30, 0x10a0, 0x10b0, 0x10c0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x0580, 0x0580, 0x0580, 0x10d0, - 0x05b0, 0x10e0, 0x05b0, 0x05b0, 0x10e0, 0x10f0, 0x05b0, 0x1100, - 0x05b0, 0x05b0, 0x05b0, 0x1110, 0x1110, 0x1120, 0x05b0, 0x1130, - 0x1140, 0x1150, 0x1160, 0x1170, 0x1180, 0x1190, 0x11a0, 0x11b0, - 0x11c0, 0x0ce0, 0x11d0, 0x11e0, 0x11f0, 0x0580, 0x0580, 0x1200, - 0x1210, 0x1220, 0x1230, 0x05b0, 0x05b0, 0x1240, 0x1250, 0x1260, - 0x1270, 0x1260, 0x05b0, 0x05b0, 0x05b0, 0x1280, 0x05b0, 0x05b0, - 0x1290, 0x12a0, 0x12b0, 0x12c0, 0x12d0, 0x12e0, 0x12f0, 0x05b0, - 0x1300, 0x1310, 0x1320, 0x1330, 0x05b0, 0x05b0, 0x05b0, 0x05b0, + 0x05b0, 0x0e40, 0x05b0, 0x05b0, 0x0e40, 0x10e0, 0x05b0, 0x10f0, + 0x05b0, 0x05b0, 0x05b0, 0x1100, 0x1100, 0x1110, 0x05b0, 0x1120, + 0x1130, 0x1140, 0x1150, 0x1160, 0x1170, 0x1180, 0x1190, 0x11a0, + 0x11b0, 0x0ce0, 0x11c0, 0x11d0, 0x11e0, 0x0580, 0x0580, 0x11f0, + 0x1200, 0x1210, 0x1220, 0x05b0, 0x05b0, 0x1230, 0x1240, 0x1250, + 0x1260, 0x1250, 0x05b0, 0x05b0, 0x05b0, 0x1270, 0x05b0, 0x05b0, + 0x1280, 0x1290, 0x12a0, 0x12b0, 0x12c0, 0x12d0, 0x12e0, 0x05b0, + 0x12f0, 0x1300, 0x1310, 0x1320, 0x05b0, 0x05b0, 0x1330, 0x05b0, 0x1340, 0x1350, 0x1360, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1370, 0x05b0, 0x05b0, 0x1380, 0x0860, 0x1390, 0x0860, 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x13b0, - 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x1250, 0x13a0, 0x13a0, 0x13c0, + 0x13a0, 0x13a0, 0x13a0, 0x13a0, 0x1240, 0x13a0, 0x13a0, 0x13c0, 0x13a0, 0x13d0, 0x13e0, 0x13f0, 0x1400, 0x1410, 0x1420, 0x05b0, 0x1430, 0x1440, 0x05b0, 0x1450, 0x1460, 0x05b0, 0x1470, 0x1480, 0x05b0, 0x1490, 0x05b0, 0x14a0, 0x14b0, 0x14c0, 0x14d0, 0x14e0, @@ -117,41 +117,41 @@ 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1560, 0x1570, 0x05b0, 0x05b0, 0x05b0, 0x1340, 0x05b0, 0x1580, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1590, 0x05b0, 0x15a0, - 0x05b0, 0x15b0, 0x05b0, 0x15c0, 0x08f0, 0x15d0, 0x0860, 0x0860, + 0x05b0, 0x15b0, 0x05b0, 0x15c0, 0x08f0, 0x15d0, 0x15e0, 0x0860, 0x05b0, 0x05b0, 0x0840, 0x05b0, 0x05b0, 0x0840, 0x05b0, 0x05b0, - 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x15e0, 0x15f0, - 0x05b0, 0x05b0, 0x0d70, 0x05b0, 0x05b0, 0x05b0, 0x1600, 0x1610, - 0x05b0, 0x1380, 0x1620, 0x1620, 0x1620, 0x1620, 0x0580, 0x0580, - 0x1630, 0x1640, 0x1650, 0x1660, 0x1670, 0x0860, 0x0860, 0x0860, - 0x1680, 0x1690, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x16a0, - 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, - 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x16b0, 0x0860, 0x16c0, - 0x16d0, 0x16e0, 0x16f0, 0x1700, 0x1710, 0x1680, 0x1720, 0x1680, - 0x1730, 0x1740, 0x1750, 0x1680, 0x1720, 0x1680, 0x1730, 0x1760, - 0x1770, 0x1680, 0x1780, 0x1790, 0x1680, 0x1680, 0x1680, 0x1680, - 0x17a0, 0x1680, 0x1680, 0x17b0, 0x1680, 0x1680, 0x16a0, 0x17c0, - 0x1680, 0x17a0, 0x1680, 0x1680, 0x17d0, 0x1680, 0x1680, 0x1680, - 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x17a0, - 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, - 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, - 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, - 0x1680, 0x1680, 0x1680, 0x1680, 0x05b0, 0x05b0, 0x05b0, 0x05b0, - 0x1680, 0x17e0, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, - 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, - 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, 0x1680, - 0x17f0, 0x1680, 0x1680, 0x1680, 0x1800, 0x05b0, 0x05b0, 0x1090, - 0x1810, 0x05b0, 0x1820, 0x0860, 0x05b0, 0x05b0, 0x15e0, 0x1830, - 0x05b0, 0x1840, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1850, + 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x15f0, 0x1600, + 0x05b0, 0x05b0, 0x0d70, 0x05b0, 0x05b0, 0x05b0, 0x1610, 0x1620, + 0x05b0, 0x1380, 0x1630, 0x1630, 0x1630, 0x1630, 0x0580, 0x0580, + 0x1640, 0x1650, 0x1660, 0x1670, 0x1680, 0x0860, 0x0860, 0x0860, + 0x1690, 0x16a0, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x16b0, + 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, + 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x16c0, 0x0860, 0x16d0, + 0x16e0, 0x16f0, 0x1700, 0x1710, 0x1720, 0x1690, 0x1730, 0x1690, + 0x1740, 0x1750, 0x1760, 0x1690, 0x1730, 0x1690, 0x1740, 0x1770, + 0x1780, 0x1690, 0x1790, 0x17a0, 0x1690, 0x1690, 0x1690, 0x1690, + 0x17b0, 0x1690, 0x1690, 0x17c0, 0x1690, 0x1690, 0x16b0, 0x17d0, + 0x1690, 0x17b0, 0x1690, 0x1690, 0x17e0, 0x1690, 0x1690, 0x1690, + 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x17b0, + 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, + 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, + 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, + 0x1690, 0x1690, 0x1690, 0x1690, 0x05b0, 0x05b0, 0x05b0, 0x05b0, + 0x1690, 0x17f0, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, + 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, + 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, 0x1690, + 0x1800, 0x1690, 0x1690, 0x1690, 0x1810, 0x05b0, 0x05b0, 0x1090, + 0x1820, 0x05b0, 0x1830, 0x0860, 0x05b0, 0x05b0, 0x15f0, 0x1840, + 0x05b0, 0x1850, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1860, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, - 0x0840, 0x05b0, 0x1100, 0x15d0, 0x0860, 0x0860, 0x0860, 0x1860, - 0x1870, 0x05b0, 0x1880, 0x1890, 0x05b0, 0x05b0, 0x05b0, 0x18a0, - 0x18b0, 0x05b0, 0x05b0, 0x0ff0, 0x18c0, 0x0ef0, 0x0580, 0x18d0, - 0x07b0, 0x05b0, 0x18e0, 0x05b0, 0x18f0, 0x1900, 0x0d80, 0x1910, - 0x0890, 0x05b0, 0x05b0, 0x1920, 0x1930, 0x1940, 0x0c00, 0x1950, - 0x05b0, 0x05b0, 0x1960, 0x1970, 0x1980, 0x1990, 0x0c00, 0x0c00, - 0x0c00, 0x0c00, 0x0c00, 0x0c00, 0x19a0, 0x19b0, 0x0760, 0x19c0, - 0x19d0, 0x19e0, 0x1620, 0x05b0, 0x05b0, 0x05b0, 0x19f0, 0x0860, - 0x0860, 0x0860, 0x0860, 0x0860, 0x05b0, 0x05b0, 0x1a00, 0x0ef0, + 0x05b0, 0x05b0, 0x10f0, 0x0a30, 0x0860, 0x0860, 0x0860, 0x1870, + 0x1880, 0x05b0, 0x1890, 0x18a0, 0x05b0, 0x05b0, 0x05b0, 0x18b0, + 0x18c0, 0x05b0, 0x05b0, 0x0ff0, 0x18d0, 0x0ef0, 0x0580, 0x18e0, + 0x07b0, 0x05b0, 0x18f0, 0x05b0, 0x1900, 0x1910, 0x0d80, 0x1920, + 0x0890, 0x05b0, 0x05b0, 0x1930, 0x1940, 0x1950, 0x0c00, 0x1960, + 0x05b0, 0x05b0, 0x1970, 0x1980, 0x1990, 0x19a0, 0x0c00, 0x0c00, + 0x0c00, 0x0c00, 0x0c00, 0x0c00, 0x19b0, 0x19c0, 0x0760, 0x19d0, + 0x19e0, 0x19f0, 0x1630, 0x05b0, 0x05b0, 0x05b0, 0x0f20, 0x05b0, + 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1a00, 0x0ef0, 0x1a10, 0x1a20, 0x1a30, 0x1a40, 0x1a30, 0x1a50, 0x1a30, 0x1a10, 0x1a20, 0x1a30, 0x1a40, 0x1a30, 0x1a50, 0x1a30, 0x1a10, 0x1a20, 0x1a30, 0x1a40, 0x1a30, 0x1a50, 0x1a30, 0x1a10, 0x1a20, 0x1a30, @@ -176,10 +176,10 @@ 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x15d0, 0x1ae0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1af0, 0x0860, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1b00, 0x05b0, 0x05b0, 0x0a30, 0x0860, 0x0860, 0x1b10, - 0x0580, 0x1b20, 0x1b30, 0x1b40, 0x1b50, 0x1b60, 0x1b70, 0x1110, - 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1b80, - 0x1b90, 0x1ba0, 0x1680, 0x1bb0, 0x1680, 0x1bc0, 0x1bd0, 0x1be0, - 0x05b0, 0x1bf0, 0x05b0, 0x0840, 0x1c00, 0x1c10, 0x1c20, 0x1c30, + 0x0580, 0x1b20, 0x0580, 0x1b30, 0x1b40, 0x1b50, 0x1b60, 0x1100, + 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1b70, + 0x1b80, 0x1b90, 0x1690, 0x1ba0, 0x1690, 0x1bb0, 0x1bc0, 0x1bd0, + 0x05b0, 0x1be0, 0x05b0, 0x0840, 0x1bf0, 0x1c00, 0x1c10, 0x1c20, /* values */ 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0022, 0x0003, 0x0001, 0x0001, 0x0002, 0x0004, 0x0004, @@ -277,9 +277,9 @@ 0x001d, 0x0004, 0x0004, 0x0004, 0x0011, 0x0011, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, - 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, + 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, - 0x0011, 0x0011, 0x0011, 0x0011, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0011, 0x0011, 0x0011, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, @@ -326,7 +326,7 @@ 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x001d, 0x001a, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, - 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, + 0x0011, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0004, 0x0004, 0x0004, 0x0011, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x001d, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0011, 0x0011, 0x0004, @@ -358,7 +358,7 @@ 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0011, 0x0004, 0x0004, 0x0004, 0x0011, 0x0004, 0x0004, 0x0004, 0x0004, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0004, 0x0004, 0x0011, - 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, + 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0004, 0x0004, 0x0004, 0x0011, 0x001d, 0x001d, 0x001d, @@ -374,7 +374,7 @@ 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0011, 0x0004, 0x0004, 0x0004, 0x0011, 0x0004, 0x0004, 0x0004, 0x0004, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0004, - 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, + 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, 0x001b, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x0004, 0x0004, 0x0011, 0x001d, 0x001d, 0x001d, @@ -463,8 +463,8 @@ 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, - 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, - 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, + 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, + 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x0022, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, @@ -547,8 +547,6 @@ 0x0004, 0x0004, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0004, 0x0004, 0x0004, 0x0004, - 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, - 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x001d, 0x0011, 0x001d, 0x0011, 0x001d, 0x0011, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, @@ -580,7 +578,7 @@ 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001b, 0x001a, - 0x001a, 0x001a, 0x001a, 0x001b, 0x001a, 0x001a, 0x001a, 0x001a, + 0x001a, 0x001a, 0x001a, 0x001b, 0x001a, 0x001a, 0x001b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x0004, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, @@ -598,7 +596,7 @@ 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x0024, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, - 0x001d, 0x0024, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, + 0x001d, 0x0024, 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x001d, 0x001d, 0x0024, 0x001d, 0x0024, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0024, 0x001d, 0x0024, 0x0024, 0x001d, 0x001d, 0x001d, 0x0024, @@ -624,6 +622,8 @@ 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0024, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, + 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001f, + 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0012, 0x0013, 0x0012, 0x0013, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0024, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001e, 0x001e, 0x001d, 0x001d, 0x001d, 0x001d, @@ -707,6 +707,8 @@ 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, + 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, + 0x0011, 0x0011, 0x0011, 0x0011, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0004, 0x0004, 0x0004, 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, @@ -784,7 +786,7 @@ 0x0004, 0x0004, 0x0004, 0x001d, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, - 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0004, + 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0004, 0x0004, 0x0004, 0x0004, 0x001d, 0x0022, 0x0022, 0x0022, 0x0022, 0x0022, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x001d, @@ -802,7 +804,7 @@ 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0022, 0x0022, 0x0004, 0x0004, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, - 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, + 0x001d, 0x001d, 0x001d, 0x001d, 0x0021, 0x001d, 0x0011, 0x0011, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0022, 0x0022, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0004, @@ -837,8 +839,6 @@ 0x0011, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, - 0x0011, 0x0011, 0x0011, 0x0011, 0x001d, 0x001d, 0x0011, 0x0011, - 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x001d, 0x001d, 0x001d, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0022, 0x0004, 0x0004, 0x0011, 0x0011, 0x000f, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0010, @@ -877,8 +877,6 @@ 0x001d, 0x001d, 0x001d, 0x001d, 0x001b, 0x001d, 0x0011, 0x0011, 0x0019, 0x0013, 0x0013, 0x0019, 0x0019, 0x0017, 0x0017, 0x0012, 0x0013, 0x001f, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, - 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, - 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0011, 0x0011, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x0012, 0x0013, 0x0012, 0x0013, 0x0012, 0x0013, 0x0012, 0x0013, 0x0012, 0x0013, 0x0012, 0x0013, 0x0012, 0x0013, 0x0012, 0x0013, 0x001e, 0x001e, 0x0012, diff -Nru wine1.7-1.7.50/dlls/usp10/mirror.c wine1.7-1.7.55/dlls/usp10/mirror.c --- wine1.7-1.7.50/dlls/usp10/mirror.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/usp10/mirror.c 2015-11-13 14:32:40.000000000 +0000 @@ -1,5 +1,5 @@ /* Unicode BiDi mirroring */ -/* generated from http://www.unicode.org/Public/7.0.0/ucd/BidiMirroring.txt */ +/* generated from http://www.unicode.org/Public/8.0.0/ucd/BidiMirroring.txt */ /* DO NOT EDIT!! */ #include "wine/unicode.h" diff -Nru wine1.7-1.7.50/dlls/usp10/shaping.c wine1.7-1.7.55/dlls/usp10/shaping.c --- wine1.7-1.7.50/dlls/usp10/shaping.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/usp10/shaping.c 2015-11-13 14:32:40.000000000 +0000 @@ -1,8 +1,8 @@ /* Unicode Arabic shaping */ -/* generated from http://www.unicode.org/Public/7.0.0/ucd/ArabicShaping.txt */ +/* generated from http://www.unicode.org/Public/8.0.0/ucd/ArabicShaping.txt */ /* DO NOT EDIT!! */ -const unsigned short wine_shaping_table[2864] = +const unsigned short wine_shaping_table[2848] = { /* level 1 offsets */ 0x0100, 0x0110, 0x0110, 0x0120, 0x0130, 0x0140, 0x0150, 0x0160, @@ -95,7 +95,7 @@ 0x0340, 0x0340, 0x0a00, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0a10, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0490, 0x0a20, - 0x0340, 0x0490, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0940, + 0x0340, 0x06d0, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0940, 0x0a30, 0x0340, 0x06f0, 0x0340, 0x0530, 0x0530, 0x0530, 0x0a40, 0x0340, 0x0340, 0x0340, 0x0340, 0x0a50, 0x0340, 0x0360, 0x0940, 0x0340, 0x0340, 0x0a60, 0x0340, 0x0a70, 0x0940, 0x0340, 0x0340, @@ -106,10 +106,10 @@ 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0af0, 0x0340, 0x0340, 0x0b00, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0360, 0x0340, 0x0b10, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, + 0x0360, 0x0340, 0x0360, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0490, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0b20, + 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0b10, /* values */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -183,15 +183,15 @@ 0x0001, 0x0001, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0001, 0x0001, 0x0001, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, - 0x0002, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0002, 0x0004, - 0x0004, 0x0002, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0002, + 0x0002, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0002, 0x0002, + 0x0004, 0x0002, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0002, 0x0004, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0404, 0x0404, 0x0604, 0x0b04, 0x0f04, 0x1004, 0x1204, 0x1304, 0x0104, 0x0104, 0x0802, 0x0302, 0x3402, 0x0000, 0x0702, 0x0a04, - 0x0d04, 0x3502, 0x0802, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0d04, 0x3502, 0x0802, 0x0c04, 0x1104, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -361,8 +361,6 @@ 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, - 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, - 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000 }; diff -Nru wine1.7-1.7.50/dlls/usp10/tests/usp10.c wine1.7-1.7.55/dlls/usp10/tests/usp10.c --- wine1.7-1.7.50/dlls/usp10/tests/usp10.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/usp10/tests/usp10.c 2015-11-13 14:32:40.000000000 +0000 @@ -928,6 +928,7 @@ int nb, outnItems; HFONT hfont, hfont_orig; int test_valid; + shapeTest_glyph glyph_test[4]; static const WCHAR test1[] = {'w', 'i', 'n', 'e',0}; static const shapeTest_char t1_c[] = {{0,{0,0}},{1,{0,0}},{2,{0,0}},{3,{0,0}}}; @@ -1186,7 +1187,16 @@ ScriptFreeCache(&sc); test_shape_ok(hdc, test1, 4, &Control, &State, 0, 4, t1_c, t1_g); - test_shape_ok(hdc, test2, 4, &Control, &State, 1, 4, t2_c, t2_g); + + /* newer Tahoma has zerowidth space glyphs for 0x202b and 0x202c */ + memcpy(glyph_test, t2_g, sizeof(glyph_test)); + GetGlyphIndicesW(hdc, test2, 4, glyphs, 0); + if (glyphs[0] != 0) + glyph_test[0].Glyph = 1; + if (glyphs[3] != 0) + glyph_test[3].Glyph = 1; + + test_shape_ok(hdc, test2, 4, &Control, &State, 1, 4, t2_c, glyph_test); test_valid = find_font_for_range(hdc, "Microsoft Sans Serif", 11, test_hebrew[0], &hfont, &hfont_orig); if (hfont != NULL) @@ -1331,7 +1341,7 @@ static const WCHAR test2[] = {0x202B, 'i', 'n', 0x202C,0}; HRESULT hr; SCRIPT_CACHE sc = NULL; - WORD glyphs[4], glyphs2[4], logclust[4]; + WORD glyphs[4], glyphs2[4], logclust[4], glyphs3[4]; SCRIPT_VISATTR attrs[4]; SCRIPT_ITEM items[2]; int nb, i, j; @@ -1392,13 +1402,17 @@ sc = NULL; memset(glyphs2,-1,sizeof(glyphs2)); + memset(glyphs3,-1,sizeof(glyphs3)); memset(logclust,-1,sizeof(logclust)); memset(attrs,-1,sizeof(attrs)); + + GetGlyphIndicesW(hdc, test2, 4, glyphs3, 0); + hr = ScriptShape(hdc, &sc, test2, 4, 4, &items[0].a, glyphs2, logclust, attrs, &nb); ok(hr == S_OK, "ScriptShape should return S_OK not %08x\n", hr); ok(nb == 4, "Wrong number of items\n"); - ok(glyphs2[0] == 0 || broken(glyphs2[0] == 0x80), "Incorrect glyph for 0x202B\n"); - ok(glyphs2[3] == 0 || broken(glyphs2[3] == 0x80), "Incorrect glyph for 0x202C\n"); + ok(glyphs2[0] == glyphs3[0], "Incorrect glyph for 0x202B\n"); + ok(glyphs2[3] == glyphs3[3], "Incorrect glyph for 0x202C\n"); ok(logclust[0] == 0, "clusters out of order\n"); ok(logclust[1] == 1, "clusters out of order\n"); ok(logclust[2] == 2, "clusters out of order\n"); @@ -1812,13 +1826,19 @@ ScriptFreeCache( &psc); ok (!psc, "psc is not null after ScriptFreeCache\n"); + /* ScriptGetCMap returns whatever font defines, no special treatment for control chars */ cInChars = cChars = 4; + GetGlyphIndicesW(hdc, TestItem2, cInChars, pwOutGlyphs2, 0); + hr = ScriptGetCMap(hdc, &psc, TestItem2, cInChars, dwFlags, pwOutGlyphs3); - ok (hr == S_FALSE, "ScriptGetCMap should return S_FALSE not (%08x)\n", hr); - ok (psc != NULL, "psc should not be null and have SCRIPT_CACHE buffer address\n"); - ok(pwOutGlyphs3[0] == 0 || broken(pwOutGlyphs3[0] == 0x80), "Glyph 0 should be default glyph\n"); - ok(pwOutGlyphs3[3] == 0 || broken(pwOutGlyphs3[0] == 0x80), "Glyph 0 should be default glyph\n"); + if (pwOutGlyphs3[0] == 0 || pwOutGlyphs3[3] == 0) + ok(hr == S_FALSE, "ScriptGetCMap should return S_FALSE not (%08x)\n", hr); + else + ok(hr == S_OK, "ScriptGetCMap should return S_OK not (%08x)\n", hr); + ok(psc != NULL, "psc should not be null and have SCRIPT_CACHE buffer address\n"); + ok(pwOutGlyphs3[0] == pwOutGlyphs2[0], "expected glyph %d, got %d\n", pwOutGlyphs2[0], pwOutGlyphs3[0]); + ok(pwOutGlyphs3[3] == pwOutGlyphs2[3], "expected glyph %d, got %d\n", pwOutGlyphs2[3], pwOutGlyphs3[3]); cInChars = cChars = 9; hr = ScriptGetCMap(hdc, &psc, TestItem3b, cInChars, dwFlags, pwOutGlyphs2); @@ -1901,7 +1921,7 @@ /* U+0020: numeric space U+200B: zero width space U+F71B: unknown, found by black box testing */ - BOOL is_terminal, is_arial, is_times_new_roman, is_arabic = (system_lang_id == LANG_ARABIC); + BOOL is_arial, is_times_new_roman, is_arabic = (system_lang_id == LANG_ARABIC); /* Some sanity checks for ScriptGetFontProperties */ @@ -1973,6 +1993,11 @@ for (i = 0; i < efnd.total; i++) { + if (strlen((char *)efnd.elf[i].elfFullName) >= LF_FACESIZE) + { + trace("Font name to long to test: %s\n",(char *)efnd.elf[i].elfFullName); + continue; + } lstrcpyA(lf.lfFaceName, (char *)efnd.elf[i].elfFullName); font = CreateFontIndirectA(&lf); oldfont = SelectObject(hdc, font); @@ -1994,10 +2019,12 @@ ret = GetTextMetricsA(hdc, &tmA); ok(ret != 0, "GetTextMetricsA failed!\n"); - is_terminal = !(lstrcmpA(lf.lfFaceName, "Terminal") && lstrcmpA(lf.lfFaceName, "@Terminal")); - ok(sfp.wgBlank == tmA.tmBreakChar || broken(is_terminal) || broken(is_arabic), "bitmap font %s wgBlank %04x tmBreakChar %04x\n", lf.lfFaceName, sfp.wgBlank, tmA.tmBreakChar); + ret = pGetGlyphIndicesW(hdc, invalids, 1, gi, GGI_MARK_NONEXISTING_GLYPHS); + ok(ret != GDI_ERROR, "GetGlyphIndicesW failed!\n"); - ok(sfp.wgDefault == tmA.tmDefaultChar || broken(is_arabic), "bitmap font %s wgDefault %04x, tmDefaultChar %04x\n", lf.lfFaceName, sfp.wgDefault, tmA.tmDefaultChar); + ok(sfp.wgBlank == tmA.tmBreakChar || sfp.wgBlank == gi[0], "bitmap font %s wgBlank %04x tmBreakChar %04x Space %04x\n", lf.lfFaceName, sfp.wgBlank, tmA.tmBreakChar, gi[0]); + + ok(sfp.wgDefault == 0 || sfp.wgDefault == tmA.tmDefaultChar || broken(sfp.wgDefault == (0x100 | tmA.tmDefaultChar)), "bitmap font %s wgDefault %04x, tmDefaultChar %04x\n", lf.lfFaceName, sfp.wgDefault, tmA.tmDefaultChar); ok(sfp.wgInvalid == sfp.wgBlank || broken(is_arabic), "bitmap font %s wgInvalid %02x wgBlank %02x\n", lf.lfFaceName, sfp.wgInvalid, sfp.wgBlank); @@ -2014,6 +2041,11 @@ for (i = 0; i < efnd.total; i++) { + if (strlen((char *)efnd.elf[i].elfFullName) >= LF_FACESIZE) + { + trace("Font name to long to test: %s\n",(char *)efnd.elf[i].elfFullName); + continue; + } lstrcpyA(lf.lfFaceName, (char *)efnd.elf[i].elfFullName); font = CreateFontIndirectA(&lf); oldfont = SelectObject(hdc, font); @@ -2235,15 +2267,17 @@ ok (hr == S_OK, "ScriptShape should return S_OK not (%08x)\n", hr); ok (psc != NULL, "psc should not be null and have SCRIPT_CACHE buffer address\n"); ok (pcGlyphs == cChars, "Chars in (%d) should equal Glyphs out (%d)\n", cChars, pcGlyphs); - if (hr ==0) { + if (hr == S_OK) { + BOOL ret; + /* Note hdc is needed as glyph info is not yet in psc */ hr = ScriptPlace(hdc2, &psc, pwOutGlyphs1, pcGlyphs, psva, &pItem[0].a, piAdvance, pGoffset, pABC); ok (hr == S_OK, "Should return S_OK not (%08x)\n", hr); /* key part!!! cached dc is being deleted */ - hr = DeleteDC(hdc2); - ok(hr == 1, "DeleteDC should return 1 not %08x\n", hr); + ret = DeleteDC(hdc2); + ok(ret, "DeleteDC should return 1 not %d\n", ret); /* At this point the cached hdc (hdc2) has been destroyed, * however, we are passing in a *real* hdc (the original hdc). @@ -2527,6 +2561,12 @@ &InClass, &ssa); ok(hr == E_PENDING, "ScriptStringAnalyse Stub should return E_PENDING not %08x\n", hr); + /* Test that 0 length string returns E_INVALIDARG */ + hr = ScriptStringAnalyse( hdc, teststr, 0, Glyphs, Charset, Flags, + ReqWidth, NULL, NULL, Dx, NULL, + &InClass, &ssa); + ok(hr == E_INVALIDARG, "ScriptStringAnalyse should return E_INVALIDARG not %08x\n", hr); + /* test with hdc, this should be a valid test */ hr = ScriptStringAnalyse( hdc, teststr, len, Glyphs, Charset, Flags, ReqWidth, NULL, NULL, Dx, NULL, diff -Nru wine1.7-1.7.50/dlls/usp10/usp10.c wine1.7-1.7.55/dlls/usp10/usp10.c --- wine1.7-1.7.50/dlls/usp10/usp10.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/usp10/usp10.c 2015-11-13 14:32:40.000000000 +0000 @@ -1477,7 +1477,8 @@ } } - while ((!levels || (levels && levels[cnt+1] == levels[0])) && (pwcInChars[cnt] == Numeric_space) && cnt < cInChars) + while ((!levels || (levels && cnt+1 < cInChars && levels[cnt+1] == levels[0])) + && (cnt < cInChars && pwcInChars[cnt] == Numeric_space)) cnt++; if (cnt == cInChars) /* All Spaces */ diff -Nru wine1.7-1.7.50/dlls/vbscript/tests/run.c wine1.7-1.7.55/dlls/vbscript/tests/run.c --- wine1.7-1.7.50/dlls/vbscript/tests/run.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/vbscript/tests/run.c 2015-11-13 14:32:40.000000000 +0000 @@ -100,6 +100,7 @@ DEFINE_EXPECT(GetWindow); DEFINE_EXPECT(GetUIBehavior); DEFINE_EXPECT(EnableModeless); +DEFINE_EXPECT(OnScriptError); #define DISPID_GLOBAL_REPORTSUCCESS 1000 #define DISPID_GLOBAL_TRACE 1001 @@ -138,6 +139,7 @@ static int test_counter; static SCRIPTUICHANDLING uic_handling = SCRIPTUICHANDLING_NOUIERROR; static IDispatchEx testObj; +static HRESULT onerror_hres = E_NOTIMPL; static BSTR a2bstr(const char *str) { @@ -1623,7 +1625,12 @@ static HRESULT WINAPI ActiveScriptSite_OnScriptError(IActiveScriptSite *iface, IActiveScriptError *pscripterror) { - return E_NOTIMPL; + HRESULT hr = onerror_hres; + CHECK_EXPECT(OnScriptError); + + onerror_hres = E_NOTIMPL; + + return hr; } static HRESULT WINAPI ActiveScriptSite_OnEnterScript(IActiveScriptSite *iface) @@ -1927,18 +1934,22 @@ SET_EXPECT(GetUIBehavior); SET_EXPECT(GetWindow); SET_EXPECT(EnableModeless); + SET_EXPECT(OnScriptError); hres = parse_script_ar("MsgBox \"testing...\""); ok(FAILED(hres), "script not failed\n"); CHECK_CALLED(GetUIBehavior); CHECK_CALLED(GetWindow); CHECK_CALLED(EnableModeless); + todo_wine CHECK_CALLED(OnScriptError); uic_handling = SCRIPTUICHANDLING_NOUIERROR; SET_EXPECT(GetUIBehavior); + SET_EXPECT(OnScriptError); hres = parse_script_ar("MsgBox \"testing...\""); ok(FAILED(hres), "script not failed\n"); CHECK_CALLED(GetUIBehavior); + todo_wine CHECK_CALLED(OnScriptError); } static HRESULT test_global_vars_ref(BOOL use_close) @@ -2184,8 +2195,10 @@ parse_htmlscript_a("\n"); parse_htmlscript_a("\n\n"); + SET_EXPECT(OnScriptError); hres = parse_script_ar("", 3 )) + { + read_skip( reader, 3 ); + break; + } + if (!(ch = read_utf8_char( reader, &skip ))) return WS_E_INVALID_FORMAT; + read_skip( reader, skip ); + len += skip; + } + + if (!(node = alloc_node( WS_XML_NODE_TYPE_COMMENT ))) return E_OUTOFMEMORY; + comment = (WS_XML_COMMENT_NODE *)node; + if (!(comment->value.bytes = heap_alloc( len ))) + { + heap_free( node ); + return E_OUTOFMEMORY; + } + memcpy( comment->value.bytes, start, len ); + comment->value.length = len; + + read_insert_node( reader, reader->current, node ); + reader->state = READER_STATE_COMMENT; + return S_OK; +} + +static HRESULT read_node( struct reader *reader ) +{ + HRESULT hr; + + for (;;) + { + if (read_end_of_data( reader )) + { + struct list *eof = list_tail( &reader->root->children ); + reader->current = LIST_ENTRY( eof, struct node, entry ); + reader->state = READER_STATE_EOF; + return S_OK; + } + if (!read_cmp( reader, "state != READER_STATE_EOF && (hr = read_node( reader )) == S_OK) { /* nothing */ }; + if (hr != S_OK) return hr; + } + switch (move) + { + case WS_MOVE_TO_FIRST_NODE: + if ((ptr = list_head( &reader->current->parent->children ))) + { + reader->current = LIST_ENTRY( ptr, struct node, entry ); + success = TRUE; + } + break; + + case WS_MOVE_TO_NEXT_NODE: + if ((ptr = list_next( &reader->current->parent->children, &reader->current->entry ))) + { + reader->current = LIST_ENTRY( ptr, struct node, entry ); + success = TRUE; + } + break; + + case WS_MOVE_TO_PREVIOUS_NODE: + if ((ptr = list_prev( &reader->current->parent->children, &reader->current->entry ))) + { + reader->current = LIST_ENTRY( ptr, struct node, entry ); + success = TRUE; + } + break; + + case WS_MOVE_TO_CHILD_NODE: + if ((ptr = list_head( &reader->current->children ))) + { + reader->current = LIST_ENTRY( ptr, struct node, entry ); + success = TRUE; + } + break; + + case WS_MOVE_TO_BOF: + reader->current = reader->root; + success = TRUE; + break; + + case WS_MOVE_TO_EOF: + if ((ptr = list_tail( &reader->root->children ))) + { + reader->current = LIST_ENTRY( ptr, struct node, entry ); + success = TRUE; + } + break; + + default: + FIXME( "unhandled move %u\n", move ); + return E_NOTIMPL; + } + + if (found) + { + *found = success; + return S_OK; + } + return success ? S_OK : WS_E_INVALID_FORMAT; +} + +/************************************************************************** + * WsMoveReader [webservices.@] + */ +HRESULT WINAPI WsMoveReader( WS_XML_READER *handle, WS_MOVE_TO move, BOOL *found, WS_ERROR *error ) +{ + struct reader *reader = (struct reader *)handle; + + TRACE( "%p %u %p %p\n", handle, move, found, error ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!reader) return E_INVALIDARG; + if (!reader->input_type) return WS_E_INVALID_OPERATION; + + return read_move_to( reader, move, found ); +} + +static WCHAR *xmltext_to_widechar( WS_HEAP *heap, const WS_XML_TEXT *text ) +{ + WCHAR *ret; + + switch (text->textType) + { + case WS_XML_TEXT_TYPE_UTF8: + { + const WS_XML_UTF8_TEXT *utf8 = (const WS_XML_UTF8_TEXT *)text; + int len = MultiByteToWideChar( CP_UTF8, 0, (char *)utf8->value.bytes, utf8->value.length, NULL, 0 ); + if (!(ret = ws_alloc( heap, (len + 1) * sizeof(WCHAR) ))) return NULL; + MultiByteToWideChar( CP_UTF8, 0, (char *)utf8->value.bytes, utf8->value.length, ret, len ); + ret[len] = 0; + break; + } + default: + FIXME( "unhandled type %u\n", text->textType ); + return NULL; + } + + return ret; +} + +#define MAX_INT8 0x7f +#define MIN_INT8 (-MAX_INT8 - 1) +#define MAX_INT16 0x7fff +#define MIN_INT16 (-MAX_INT16 - 1) +#define MAX_INT32 0x7fffffff +#define MIN_INT32 (-MAX_INT32 - 1) +#define MAX_INT64 (((INT64)0x7fffffff << 32) | 0xffffffff) +#define MIN_INT64 (-MAX_INT64 - 1) +#define MAX_UINT8 0xff +#define MAX_UINT16 0xffff +#define MAX_UINT32 0xffffffff +#define MAX_UINT64 (((UINT64)0xffffffff << 32) | 0xffffffff) + +static HRESULT str_to_int64( const char *str, ULONG len, INT64 min, INT64 max, INT64 *ret ) +{ + BOOL negative = FALSE; + const char *ptr = str; + + *ret = 0; + while (len && read_isspace( *ptr )) { ptr++; len--; } + while (len && read_isspace( ptr[len - 1] )) { len--; } + if (!len) return WS_E_INVALID_FORMAT; + + if (*ptr == '-') + { + negative = TRUE; + ptr++; + len--; + } + if (!len) return WS_E_INVALID_FORMAT; + + while (len--) + { + int val; + + if (!isdigit( *ptr )) return WS_E_INVALID_FORMAT; + val = *ptr - '0'; + if (negative) val = -val; + + if ((!negative && (*ret > max / 10 || *ret * 10 > max - val)) || + (negative && (*ret < min / 10 || *ret * 10 < min - val))) + { + return WS_E_NUMERIC_OVERFLOW; + } + *ret = *ret * 10 + val; + ptr++; + } + + return S_OK; +} + +static HRESULT str_to_uint64( const char *str, ULONG len, UINT64 max, UINT64 *ret ) +{ + const char *ptr = str; + + *ret = 0; + while (len && read_isspace( *ptr )) { ptr++; len--; } + while (len && read_isspace( ptr[len - 1] )) { len--; } + if (!len) return WS_E_INVALID_FORMAT; + + while (len--) + { + unsigned int val; + + if (!isdigit( *ptr )) return WS_E_INVALID_FORMAT; + val = *ptr - '0'; + + if ((*ret > max / 10 || *ret * 10 > max - val)) return WS_E_NUMERIC_OVERFLOW; + *ret = *ret * 10 + val; + ptr++; + } + + return S_OK; +} + +/************************************************************************** + * WsReadType [webservices.@] + */ +HRESULT WINAPI WsReadType( WS_XML_READER *handle, WS_TYPE_MAPPING mapping, WS_TYPE type, + const void *desc, WS_READ_OPTION option, WS_HEAP *heap, void *value, + ULONG value_size, WS_ERROR *error ) +{ + struct reader *reader = (struct reader *)handle; + WS_XML_TEXT_NODE *text; + + TRACE( "%p %u %u %p %u %p %p %u %p\n", handle, mapping, type, desc, option, heap, value, + value_size, error ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!reader || !value) return E_INVALIDARG; + + if (reader->current->hdr.node.nodeType != WS_XML_NODE_TYPE_TEXT) + { + FIXME( "only text nodes are supported\n" ); + return E_NOTIMPL; + } + text = (WS_XML_TEXT_NODE *)&reader->current->hdr.node; + if (text->text->textType != WS_XML_TEXT_TYPE_UTF8) + { + FIXME( "text type %u not supported\n", text->text->textType ); + return E_NOTIMPL; + } + + switch (mapping) + { + case WS_ELEMENT_CONTENT_TYPE_MAPPING: + break; + default: + FIXME( "mapping %u not supported\n", mapping ); + return E_NOTIMPL; + } + + switch (type) + { + case WS_BOOL_TYPE: + { + WS_XML_UTF8_TEXT *utf8 = (WS_XML_UTF8_TEXT *)text->text; + ULONG len = utf8->value.length; + BOOL *ret = value; + + if (value_size != sizeof(BOOL)) return E_INVALIDARG; + + if (len == 4 && !memcmp( utf8->value.bytes, "true", 4 )) *ret = TRUE; + else if (len == 1 && !memcmp( utf8->value.bytes, "1", 1 )) *ret = TRUE; + else if (len == 5 && !memcmp( utf8->value.bytes, "false", 5 )) *ret = FALSE; + else if (len == 1 && !memcmp( utf8->value.bytes, "0", 1 )) *ret = FALSE; + else return WS_E_INVALID_FORMAT; + break; + } + case WS_INT8_TYPE: + { + WS_XML_UTF8_TEXT *utf8 = (WS_XML_UTF8_TEXT *)text->text; + INT8 *ret = value; + HRESULT hr; + INT64 val; + + if (value_size != sizeof(INT8)) return E_INVALIDARG; + hr = str_to_int64( (const char *)utf8->value.bytes, utf8->value.length, MIN_INT8, MAX_INT8, &val ); + if (hr != S_OK) return hr; + *ret = val; + break; + } + case WS_INT16_TYPE: + { + WS_XML_UTF8_TEXT *utf8 = (WS_XML_UTF8_TEXT *)text->text; + INT16 *ret = value; + HRESULT hr; + INT64 val; + + if (value_size != sizeof(INT16)) return E_INVALIDARG; + hr = str_to_int64( (const char *)utf8->value.bytes, utf8->value.length, MIN_INT16, MAX_INT16, &val ); + if (hr != S_OK) return hr; + *ret = val; + break; + } + case WS_INT32_TYPE: + { + WS_XML_UTF8_TEXT *utf8 = (WS_XML_UTF8_TEXT *)text->text; + INT32 *ret = value; + HRESULT hr; + INT64 val; + + if (value_size != sizeof(INT32)) return E_INVALIDARG; + hr = str_to_int64( (const char *)utf8->value.bytes, utf8->value.length, MIN_INT32, MAX_INT32, &val ); + if (hr != S_OK) return hr; + *ret = val; + break; + } + case WS_INT64_TYPE: + { + WS_XML_UTF8_TEXT *utf8 = (WS_XML_UTF8_TEXT *)text->text; + INT64 val, *ret = value; + HRESULT hr; + + if (value_size != sizeof(INT64)) return E_INVALIDARG; + hr = str_to_int64( (const char *)utf8->value.bytes, utf8->value.length, MIN_INT64, MAX_INT64, &val ); + if (hr != S_OK) return hr; + *ret = val; + break; + } + case WS_UINT8_TYPE: + { + WS_XML_UTF8_TEXT *utf8 = (WS_XML_UTF8_TEXT *)text->text; + UINT8 *ret = value; + HRESULT hr; + UINT64 val; + + if (value_size != sizeof(UINT8)) return E_INVALIDARG; + hr = str_to_uint64( (const char *)utf8->value.bytes, utf8->value.length, MAX_UINT8, &val ); + if (hr != S_OK) return hr; + *ret = val; + break; + } + case WS_UINT16_TYPE: + { + WS_XML_UTF8_TEXT *utf8 = (WS_XML_UTF8_TEXT *)text->text; + UINT16 *ret = value; + HRESULT hr; + UINT64 val; + + if (value_size != sizeof(UINT16)) return E_INVALIDARG; + hr = str_to_uint64( (const char *)utf8->value.bytes, utf8->value.length, MAX_UINT16, &val ); + if (hr != S_OK) return hr; + *ret = val; + break; + } + case WS_UINT32_TYPE: + { + WS_XML_UTF8_TEXT *utf8 = (WS_XML_UTF8_TEXT *)text->text; + UINT32 *ret = value; + HRESULT hr; + UINT64 val; + + if (value_size != sizeof(UINT32)) return E_INVALIDARG; + hr = str_to_uint64( (const char *)utf8->value.bytes, utf8->value.length, MAX_UINT32, &val ); + if (hr != S_OK) return hr; + *ret = val; + break; + } + case WS_UINT64_TYPE: + { + WS_XML_UTF8_TEXT *utf8 = (WS_XML_UTF8_TEXT *)text->text; + UINT64 val, *ret = value; + HRESULT hr; + + if (value_size != sizeof(UINT64)) return E_INVALIDARG; + hr = str_to_uint64( (const char *)utf8->value.bytes, utf8->value.length, MAX_UINT64, &val ); + if (hr != S_OK) return hr; + *ret = val; + break; + } + case WS_WSZ_TYPE: + { + WCHAR *str, **ret = value; + + if (value_size != sizeof(WCHAR *)) return E_INVALIDARG; + if (!(str = xmltext_to_widechar( heap, text->text ))) return E_OUTOFMEMORY; + *ret = str; + break; + } + default: + FIXME( "type %u not supported\n", type ); + return E_NOTIMPL; + } + + return S_OK; +} + +/************************************************************************** + * WsSetErrorProperty [webservices.@] + */ +HRESULT WINAPI WsSetErrorProperty( WS_ERROR *handle, WS_ERROR_PROPERTY_ID id, const void *value, + ULONG size ) +{ + struct error *error = (struct error *)handle; + + TRACE( "%p %u %p %u\n", handle, id, value, size ); + + if (id == WS_ERROR_PROPERTY_LANGID) return WS_E_INVALID_OPERATION; + return set_error_prop( error, id, value, size ); +} + +static inline BOOL is_utf8( const unsigned char *data, ULONG size, ULONG *offset ) +{ + static const char bom[] = {0xef,0xbb,0xbf}; + const unsigned char *p = data; + + return (size >= sizeof(bom) && !memcmp( p, bom, sizeof(bom) ) && (*offset = sizeof(bom))) || + (size > 2 && !(*offset = 0)); +} + +static inline BOOL is_utf16le( const unsigned char *data, ULONG size, ULONG *offset ) +{ + static const char bom[] = {0xff,0xfe}; + const unsigned char *p = data; + + return (size >= sizeof(bom) && !memcmp( p, bom, sizeof(bom) ) && (*offset = sizeof(bom))) || + (size >= 4 && p[0] == '<' && !p[1] && !(*offset = 0)); +} + +static WS_CHARSET detect_charset( const unsigned char *data, ULONG size, ULONG *offset ) +{ + WS_CHARSET ret = 0; + + /* FIXME: parse xml declaration */ + + if (is_utf16le( data, size, offset )) ret = WS_CHARSET_UTF16LE; + else if (is_utf8( data, size, offset )) ret = WS_CHARSET_UTF8; + else + { + FIXME( "charset not recognized\n" ); + return 0; + } + + TRACE( "detected charset %u\n", ret ); + return ret; +} + +static void set_input_buffer( struct reader *reader, const char *data, ULONG size ) +{ + reader->input_type = WS_XML_READER_INPUT_TYPE_BUFFER; + reader->input_data = data; + reader->input_size = size; + + reader->read_size = reader->input_size; + reader->read_pos = 0; + reader->read_bufptr = reader->input_data; +} + +/************************************************************************** + * WsSetInput [webservices.@] + */ +HRESULT WINAPI WsSetInput( WS_XML_READER *handle, const WS_XML_READER_ENCODING *encoding, + const WS_XML_READER_INPUT *input, const WS_XML_READER_PROPERTY *properties, + ULONG count, WS_ERROR *error ) +{ + struct reader *reader = (struct reader *)handle; + struct node *node; + HRESULT hr; + ULONG i, offset = 0; + + TRACE( "%p %p %p %p %u %p\n", handle, encoding, input, properties, count, error ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!reader) return E_INVALIDARG; + + for (i = 0; i < count; i++) + { + hr = set_reader_prop( reader, properties[i].id, properties[i].value, properties[i].valueSize ); + if (hr != S_OK) return hr; + } + + if ((hr = read_init_state( reader )) != S_OK) return hr; + + switch (encoding->encodingType) + { + case WS_XML_READER_ENCODING_TYPE_TEXT: + { + WS_XML_READER_TEXT_ENCODING *text = (WS_XML_READER_TEXT_ENCODING *)encoding; + WS_XML_READER_BUFFER_INPUT *buf = (WS_XML_READER_BUFFER_INPUT *)input; + WS_CHARSET charset = text->charSet; + + if (input->inputType != WS_XML_READER_INPUT_TYPE_BUFFER) + { + FIXME( "charset detection on input type %u not supported\n", input->inputType ); + return E_NOTIMPL; + } + + if (charset == WS_CHARSET_AUTO) + charset = detect_charset( buf->encodedData, buf->encodedDataSize, &offset ); + + hr = set_reader_prop( reader, WS_XML_READER_PROPERTY_CHARSET, &charset, sizeof(charset) ); + if (hr != S_OK) return hr; + break; + } + default: + FIXME( "encoding type %u not supported\n", encoding->encodingType ); + return E_NOTIMPL; + } + switch (input->inputType) + { + case WS_XML_READER_INPUT_TYPE_BUFFER: + { + WS_XML_READER_BUFFER_INPUT *buf = (WS_XML_READER_BUFFER_INPUT *)input; + set_input_buffer( reader, (const char *)buf->encodedData + offset, buf->encodedDataSize - offset ); + break; + } + default: + FIXME( "input type %u not supported\n", input->inputType ); + return E_NOTIMPL; + } + + if (!(node = alloc_node( WS_XML_NODE_TYPE_BOF ))) return E_OUTOFMEMORY; + read_insert_bof( reader, node ); + return S_OK; +} + +/************************************************************************** + * WsSetInputToBuffer [webservices.@] + */ +HRESULT WINAPI WsSetInputToBuffer( WS_XML_READER *handle, WS_XML_BUFFER *buffer, + const WS_XML_READER_PROPERTY *properties, ULONG count, + WS_ERROR *error ) +{ + struct reader *reader = (struct reader *)handle; + struct xmlbuf *xmlbuf = (struct xmlbuf *)buffer; + WS_CHARSET charset; + struct node *node; + HRESULT hr; + ULONG i, offset = 0; + + TRACE( "%p %p %p %u %p\n", handle, buffer, properties, count, error ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!reader || !xmlbuf) return E_INVALIDARG; + + for (i = 0; i < count; i++) + { + hr = set_reader_prop( reader, properties[i].id, properties[i].value, properties[i].valueSize ); + if (hr != S_OK) return hr; + } + + if ((hr = read_init_state( reader )) != S_OK) return hr; + + charset = detect_charset( xmlbuf->ptr, xmlbuf->size, &offset ); + hr = set_reader_prop( reader, WS_XML_READER_PROPERTY_CHARSET, &charset, sizeof(charset) ); + if (hr != S_OK) return hr; + + set_input_buffer( reader, (const char *)xmlbuf->ptr + offset, xmlbuf->size - offset ); + if (!(node = alloc_node( WS_XML_NODE_TYPE_BOF ))) return E_OUTOFMEMORY; + read_insert_bof( reader, node ); + return S_OK; +} + +/************************************************************************** + * WsXmlStringEquals [webservices.@] + */ +HRESULT WINAPI WsXmlStringEquals( const WS_XML_STRING *str1, const WS_XML_STRING *str2, WS_ERROR *error ) +{ + TRACE( "%s %s %p\n", debugstr_xmlstr(str1), debugstr_xmlstr(str2), error ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!str1 || !str2) return E_INVALIDARG; + + if (str1->length != str2->length) return S_FALSE; + if (!memcmp( str1->bytes, str2->bytes, str1->length )) return S_OK; + return S_FALSE; +} diff -Nru wine1.7-1.7.50/dlls/webservices/tests/Makefile.in wine1.7-1.7.55/dlls/webservices/tests/Makefile.in --- wine1.7-1.7.50/dlls/webservices/tests/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/webservices/tests/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,6 @@ +TESTDLL = webservices.dll +IMPORTS = webservices + +C_SRCS = \ + reader.c \ + writer.c diff -Nru wine1.7-1.7.50/dlls/webservices/tests/reader.c wine1.7-1.7.55/dlls/webservices/tests/reader.c --- wine1.7-1.7.50/dlls/webservices/tests/reader.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/webservices/tests/reader.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,1660 @@ +/* + * Copyright 2015 Hans Leidekker for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * 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 "windows.h" +#include "webservices.h" +#include "wine/test.h" + +static const char data1[] = + ""; + +static const char data2[] = + {0xef,0xbb,0xbf,'<','t','e','x','t','>','t','e','s','t','<','/','t','e','x','t','>',0}; + +static const char data3[] = + "" + "test"; + +static const char data4[] = + "\r\n" + "\r\n" + " \r\n" + " \r\n" + " \r\n" + " \r\n" + " \r\n" + " \r\n" + " https://login.[Live.WebHost]/oauth20_authorize.srf\r\n" + " \r\n" + "\r\n" + "\r\n"; + +static const char data5[] = + ""; + +static const char data6[] = + "" + "test"; + +static const char data7[] = + ""; + +static const char data8[] = + "test"; + +static const char data9[] = + "test"; + +static const char data10[] = + ""; + +static void test_WsCreateError(void) +{ + HRESULT hr; + WS_ERROR *error; + WS_ERROR_PROPERTY prop; + ULONG size, code, count; + LANGID langid; + + hr = WsCreateError( NULL, 0, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + error = NULL; + hr = WsCreateError( NULL, 0, &error ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( error != NULL, "error not set\n" ); + + count = 0xdeadbeef; + size = sizeof(count); + hr = WsGetErrorProperty( error, WS_ERROR_PROPERTY_STRING_COUNT, &count, size ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( !count, "got %u\n", count ); + + hr = WsSetErrorProperty( error, WS_ERROR_PROPERTY_STRING_COUNT, &count, size ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + code = 0xdeadbeef; + size = sizeof(code); + hr = WsGetErrorProperty( error, WS_ERROR_PROPERTY_ORIGINAL_ERROR_CODE, &code, size ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( !code, "got %u\n", code ); + + code = 0xdeadbeef; + hr = WsSetErrorProperty( error, WS_ERROR_PROPERTY_ORIGINAL_ERROR_CODE, &code, size ); + ok( hr == S_OK, "got %08x\n", hr ); + hr = WsGetErrorProperty( error, WS_ERROR_PROPERTY_ORIGINAL_ERROR_CODE, &code, size ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( code == 0xdeadbeef, "got %u\n", code ); + + langid = 0xdead; + size = sizeof(langid); + hr = WsGetErrorProperty( error, WS_ERROR_PROPERTY_LANGID, &langid, size ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( langid == GetUserDefaultUILanguage(), "got %u\n", langid ); + + langid = MAKELANGID( LANG_DUTCH, SUBLANG_DEFAULT ); + hr = WsSetErrorProperty( error, WS_ERROR_PROPERTY_LANGID, &langid, size ); + ok( hr == WS_E_INVALID_OPERATION, "got %08x\n", hr ); + + count = 0xdeadbeef; + size = sizeof(count); + hr = WsGetErrorProperty( error, WS_ERROR_PROPERTY_LANGID + 1, &count, size ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( count == 0xdeadbeef, "got %u\n", count ); + WsFreeError( error ); + + count = 1; + prop.id = WS_ERROR_PROPERTY_STRING_COUNT; + prop.value = &count; + prop.valueSize = sizeof(count); + hr = WsCreateError( &prop, 1, &error ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + code = 0xdeadbeef; + prop.id = WS_ERROR_PROPERTY_ORIGINAL_ERROR_CODE; + prop.value = &code; + prop.valueSize = sizeof(code); + hr = WsCreateError( &prop, 1, &error ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + langid = MAKELANGID( LANG_DUTCH, SUBLANG_DEFAULT ); + 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 ); + + langid = 0xdead; + size = sizeof(langid); + hr = WsGetErrorProperty( error, WS_ERROR_PROPERTY_LANGID, &langid, size ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( langid == MAKELANGID( LANG_DUTCH, SUBLANG_DEFAULT ), "got %u\n", langid ); + WsFreeError( error ); + + count = 0xdeadbeef; + prop.id = WS_ERROR_PROPERTY_LANGID + 1; + prop.value = &count; + prop.valueSize = sizeof(count); + hr = WsCreateError( &prop, 1, &error ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); +} + +static void test_WsCreateHeap(void) +{ + HRESULT hr; + WS_HEAP *heap; + WS_HEAP_PROPERTY prop; + SIZE_T max, trim, requested, actual; + ULONG size; + + hr = WsCreateHeap( 0, 0, NULL, 0, NULL, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + heap = NULL; + hr = WsCreateHeap( 0, 0, NULL, 0, &heap, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( heap != NULL, "heap not set\n" ); + WsFreeHeap( heap ); + + hr = WsCreateHeap( 1 << 16, 1 << 6, NULL, 0, NULL, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + heap = NULL; + hr = WsCreateHeap( 1 << 16, 0, NULL, 0, &heap, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( heap != NULL, "heap not set\n" ); + WsFreeHeap( heap ); + + hr = WsCreateHeap( 1 << 16, 1 << 6, NULL, 0, &heap, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + max = 0xdeadbeef; + size = sizeof(max); + hr = WsGetHeapProperty( heap, WS_HEAP_PROPERTY_MAX_SIZE, &max, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( max == 1 << 16, "got %u\n", (ULONG)max ); + + trim = 0xdeadbeef; + size = sizeof(trim); + hr = WsGetHeapProperty( heap, WS_HEAP_PROPERTY_TRIM_SIZE, &trim, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( trim == 1 << 6, "got %u\n", (ULONG)trim ); + + requested = 0xdeadbeef; + size = sizeof(requested); + hr = WsGetHeapProperty( heap, WS_HEAP_PROPERTY_REQUESTED_SIZE, &requested, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( !requested, "got %u\n", (ULONG)requested ); + + actual = 0xdeadbeef; + size = sizeof(actual); + hr = WsGetHeapProperty( heap, WS_HEAP_PROPERTY_ACTUAL_SIZE, &actual, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( !actual, "got %u\n", (ULONG)actual ); + + actual = 0xdeadbeef; + size = sizeof(actual); + hr = WsGetHeapProperty( heap, WS_HEAP_PROPERTY_ACTUAL_SIZE + 1, &actual, size, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( actual == 0xdeadbeef, "got %u\n", (ULONG)actual ); + WsFreeHeap( heap ); + + max = 1 << 16; + prop.id = WS_HEAP_PROPERTY_MAX_SIZE; + prop.value = &max; + prop.valueSize = sizeof(max); + hr = WsCreateHeap( 1 << 16, 1 << 6, &prop, 1, &heap, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = WsCreateHeap( 1 << 16, 1 << 6, NULL, 1, &heap, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); +} + +static HRESULT set_input( WS_XML_READER *reader, const char *data, ULONG size ) +{ + WS_XML_READER_TEXT_ENCODING encoding; + WS_XML_READER_BUFFER_INPUT input; + + encoding.encoding.encodingType = WS_XML_READER_ENCODING_TYPE_TEXT; + encoding.charSet = WS_CHARSET_AUTO; + + input.input.inputType = WS_XML_READER_INPUT_TYPE_BUFFER; + input.encodedData = (void *)data; + input.encodedDataSize = size; + + return WsSetInput( reader, &encoding.encoding, &input.input, NULL, 0, NULL ); +} + +static void test_WsCreateReader(void) +{ + HRESULT hr; + WS_XML_READER *reader; + WS_XML_READER_PROPERTY prop; + ULONG size, max_depth, max_attrs, trim_size, buffer_size, max_ns; + BOOL allow_fragment, read_decl, in_attr; + ULONGLONG row, column; + WS_CHARSET charset; + + hr = WsCreateReader( NULL, 0, NULL, NULL ) ; + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + reader = NULL; + hr = WsCreateReader( NULL, 0, &reader, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + ok( reader != NULL, "reader not set\n" ); + + /* can't retrieve properties before input is set */ + max_depth = 0xdeadbeef; + size = sizeof(max_depth); + hr = WsGetReaderProperty( reader, WS_XML_READER_PROPERTY_MAX_DEPTH, &max_depth, size, NULL ); + ok( hr == WS_E_INVALID_OPERATION, "got %08x\n", hr ); + ok( max_depth == 0xdeadbeef, "max_depth set\n" ); + + hr = set_input( reader, data1, sizeof(data1) - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + /* check some defaults */ + max_depth = 0xdeadbeef; + size = sizeof(max_depth); + hr = WsGetReaderProperty( reader, WS_XML_READER_PROPERTY_MAX_DEPTH, &max_depth, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( max_depth == 32, "got %u\n", max_depth ); + + allow_fragment = TRUE; + size = sizeof(allow_fragment); + hr = WsGetReaderProperty( reader, WS_XML_READER_PROPERTY_ALLOW_FRAGMENT, &allow_fragment, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( !allow_fragment, "got %d\n", allow_fragment ); + + max_attrs = 0xdeadbeef; + size = sizeof(max_attrs); + hr = WsGetReaderProperty( reader, WS_XML_READER_PROPERTY_MAX_ATTRIBUTES, &max_attrs, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( max_attrs == 128, "got %u\n", max_attrs ); + + read_decl = FALSE; + size = sizeof(read_decl); + hr = WsGetReaderProperty( reader, WS_XML_READER_PROPERTY_READ_DECLARATION, &read_decl, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( read_decl, "got %u\n", read_decl ); + + charset = 0xdeadbeef; + size = sizeof(charset); + hr = WsGetReaderProperty( reader, WS_XML_READER_PROPERTY_CHARSET, &charset, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( charset == WS_CHARSET_UTF8, "got %u\n", charset ); + + size = sizeof(trim_size); + hr = WsGetReaderProperty( reader, WS_XML_READER_PROPERTY_UTF8_TRIM_SIZE, &trim_size, size, NULL ); + todo_wine ok( hr == E_INVALIDARG, "got %08x\n", hr ); + WsFreeReader( reader ); + + hr = WsCreateReader( NULL, 0, &reader, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + hr = set_input( reader, data1, sizeof(data1) - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + size = sizeof(buffer_size); + hr = WsGetReaderProperty( reader, WS_XML_READER_PROPERTY_STREAM_BUFFER_SIZE, &buffer_size, size, NULL ); + todo_wine ok( hr == E_INVALIDARG, "got %08x\n", hr ); + WsFreeReader( reader ); + + hr = WsCreateReader( NULL, 0, &reader, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + hr = set_input( reader, data1, sizeof(data1) - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + max_ns = 0xdeadbeef; + size = sizeof(max_ns); + hr = WsGetReaderProperty( reader, WS_XML_READER_PROPERTY_MAX_NAMESPACES, &max_ns, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( max_ns == 32, "got %u\n", max_ns ); + WsFreeReader( reader ); + + /* change a property */ + max_depth = 16; + prop.id = WS_XML_READER_PROPERTY_MAX_DEPTH; + prop.value = &max_depth; + prop.valueSize = sizeof(max_depth); + hr = WsCreateReader( &prop, 1, &reader, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + hr = set_input( reader, data1, sizeof(data1) - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + max_depth = 0xdeadbeef; + size = sizeof(max_depth); + hr = WsGetReaderProperty( reader, WS_XML_READER_PROPERTY_MAX_DEPTH, &max_depth, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( max_depth == 16, "got %u\n", max_depth ); + WsFreeReader( reader ); + + /* show that some properties are read-only */ + row = 1; + prop.id = WS_XML_READER_PROPERTY_ROW; + prop.value = &row; + prop.valueSize = sizeof(row); + hr = WsCreateReader( &prop, 1, &reader, NULL ) ; + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + column = 1; + prop.id = WS_XML_READER_PROPERTY_COLUMN; + prop.value = &column; + prop.valueSize = sizeof(column); + hr = WsCreateReader( &prop, 1, &reader, NULL ) ; + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + in_attr = TRUE; + prop.id = WS_XML_READER_PROPERTY_IN_ATTRIBUTE; + prop.value = &in_attr; + prop.valueSize = sizeof(in_attr); + hr = WsCreateReader( &prop, 1, &reader, NULL ) ; + ok( hr == E_INVALIDARG, "got %08x\n", hr ); +} + +static void test_WsSetInput(void) +{ + static char test1[] = {0xef,0xbb,0xbf,'<','a','/','>'}; + static char test2[] = {'<','a','/','>'}; + static char test3[] = {'<','!','-','-'}; + static char test4[] = {'<','?','x','m','l',' ','v','e','r','s','i','o','n','=','"','1','.','0','"', + ' ','e','n','c','o','d','i','n','g','=','"','u','t','f','-','8','"','?','>'}; + static char test5[] = {'<','?','x','m','l',' ','e','n','c','o','d','i','n','g','=', + '"','u','t','f','-','8','"','?','>'}; + static char test6[] = {'<','?','x','m','l'}; + static char test7[] = {'<','?','y','m','l'}; + static char test8[] = {'<','?'}; + static char test9[] = {'<','!'}; + static char test10[] = {0xff,0xfe,'<',0,'a',0,'/',0,'>',0}; + static char test11[] = {'<',0,'a',0,'/',0,'>',0}; + static char test12[] = {'<',0,'!',0,'-',0,'-',0}; + static char test13[] = {'<',0,'?',0}; + static char test14[] = {'a','b'}; + static char test15[] = {'a','b','c'}; + static char test16[] = {'a',0}; + static char test17[] = {'a',0,'b',0}; + static char test18[] = {'<',0,'a',0,'b',0}; + static char test19[] = {'<',0,'a',0}; + static char test20[] = {0,'a','b'}; + static char test21[] = {0,0}; + static char test22[] = {0,0,0}; + static char test23[] = {'<',0,'?',0,'x',0,'m',0,'l',0}; + HRESULT hr; + WS_XML_READER *reader; + WS_XML_READER_PROPERTY prop; + WS_XML_READER_TEXT_ENCODING enc; + WS_XML_READER_BUFFER_INPUT input; + WS_CHARSET charset; + const WS_XML_NODE *node; + ULONG i, size, max_depth; + static const struct + { + void *data; + ULONG size; + HRESULT hr; + WS_CHARSET charset; + int todo; + } + tests[] = + { + { test1, sizeof(test1), S_OK, WS_CHARSET_UTF8 }, + { test2, sizeof(test2), S_OK, WS_CHARSET_UTF8 }, + { test3, sizeof(test3), S_OK, WS_CHARSET_UTF8 }, + { test4, sizeof(test4), S_OK, WS_CHARSET_UTF8 }, + { test5, sizeof(test5), WS_E_INVALID_FORMAT, 0, 1 }, + { test6, sizeof(test6), WS_E_INVALID_FORMAT, 0, 1 }, + { test7, sizeof(test7), WS_E_INVALID_FORMAT, 0, 1 }, + { test8, sizeof(test8), WS_E_INVALID_FORMAT, 0 }, + { test9, sizeof(test9), WS_E_INVALID_FORMAT, 0 }, + { test10, sizeof(test10), S_OK, WS_CHARSET_UTF16LE }, + { test11, sizeof(test11), S_OK, WS_CHARSET_UTF16LE }, + { test12, sizeof(test12), S_OK, WS_CHARSET_UTF16LE }, + { test13, sizeof(test13), WS_E_INVALID_FORMAT, 0, 1 }, + { test14, sizeof(test14), WS_E_INVALID_FORMAT, 0 }, + { test15, sizeof(test15), S_OK, WS_CHARSET_UTF8 }, + { test16, sizeof(test16), WS_E_INVALID_FORMAT, 0 }, + { test17, sizeof(test17), S_OK, WS_CHARSET_UTF8 }, + { test18, sizeof(test18), S_OK, WS_CHARSET_UTF16LE }, + { test19, sizeof(test19), S_OK, WS_CHARSET_UTF16LE }, + { test20, sizeof(test20), S_OK, WS_CHARSET_UTF8 }, + { test21, sizeof(test21), WS_E_INVALID_FORMAT, 0 }, + { test22, sizeof(test22), S_OK, WS_CHARSET_UTF8 }, + { test23, sizeof(test23), WS_E_INVALID_FORMAT, 0, 1 }, + }; + + hr = WsCreateReader( NULL, 0, &reader, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsSetInput( NULL, NULL, NULL, NULL, 0, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + node = NULL; + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( node != NULL, "node not set\n" ); + if (node) ok( node->nodeType == WS_XML_NODE_TYPE_EOF, "got %u\n", node->nodeType ); + + enc.encoding.encodingType = WS_XML_READER_ENCODING_TYPE_TEXT; + enc.charSet = WS_CHARSET_UTF8; + + input.input.inputType = WS_XML_READER_INPUT_TYPE_BUFFER; + input.encodedData = (void *)data1; + input.encodedDataSize = sizeof(data1) - 1; + + hr = WsSetInput( reader, &enc.encoding, &input.input, NULL, 0, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + node = NULL; + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( node != NULL, "node not set\n" ); + if (node) ok( node->nodeType == WS_XML_NODE_TYPE_BOF, "got %u\n", node->nodeType ); + + /* multiple calls are allowed */ + hr = WsSetInput( reader, &enc.encoding, &input.input, NULL, 0, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + /* charset is detected by WsSetInput */ + enc.encoding.encodingType = WS_XML_READER_ENCODING_TYPE_TEXT; + enc.charSet = WS_CHARSET_AUTO; + + for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) + { + input.encodedData = tests[i].data; + input.encodedDataSize = tests[i].size; + hr = WsSetInput( reader, &enc.encoding, &input.input, NULL, 0, NULL ); + ok( hr == S_OK, "%u: got %08x\n", i, hr ); + + charset = 0xdeadbeef; + size = sizeof(charset); + hr = WsGetReaderProperty( reader, WS_XML_READER_PROPERTY_CHARSET, &charset, size, NULL ); + if (tests[i].todo) + { + todo_wine ok( hr == tests[i].hr, "%u: got %08x expected %08x\n", i, hr, tests[i].hr ); + if (hr == S_OK) + todo_wine ok( charset == tests[i].charset, "%u: got %u expected %u\n", i, charset, tests[i].charset ); + } + else + { + ok( hr == tests[i].hr, "%u: got %08x expected %08x\n", i, hr, tests[i].hr ); + if (hr == S_OK) + ok( charset == tests[i].charset, "%u: got %u expected %u\n", i, charset, tests[i].charset ); + } + } + + enc.encoding.encodingType = WS_XML_READER_ENCODING_TYPE_TEXT; + enc.charSet = WS_CHARSET_UTF8; + + /* reader properties can be set with WsSetInput */ + max_depth = 16; + prop.id = WS_XML_READER_PROPERTY_MAX_DEPTH; + prop.value = &max_depth; + prop.valueSize = sizeof(max_depth); + hr = WsSetInput( reader, &enc.encoding, &input.input, &prop, 1, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + max_depth = 0xdeadbeef; + size = sizeof(max_depth); + hr = WsGetReaderProperty( reader, WS_XML_READER_PROPERTY_MAX_DEPTH, &max_depth, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( max_depth == 16, "got %u\n", max_depth ); + WsFreeReader( reader ); +} + +static void test_WsSetInputToBuffer(void) +{ + HRESULT hr; + WS_HEAP *heap; + WS_XML_BUFFER *buffer; + WS_XML_READER *reader; + WS_XML_READER_PROPERTY prop; + const WS_XML_NODE *node; + ULONG size, max_depth; + + hr = WsCreateReader( NULL, 0, &reader, NULL ) ; + 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 = WsCreateXmlBuffer( heap, NULL, 0, &buffer, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsSetInputToBuffer( NULL, NULL, NULL, 0, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = WsSetInputToBuffer( reader, NULL, NULL, 0, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + node = NULL; + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( node != NULL, "node not set\n" ); + if (node) ok( node->nodeType == WS_XML_NODE_TYPE_EOF, "got %u\n", node->nodeType ); + + hr = WsSetInputToBuffer( reader, buffer, NULL, 0, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + node = NULL; + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( node != NULL, "node not set\n" ); + if (node) ok( node->nodeType == WS_XML_NODE_TYPE_BOF, "got %u\n", node->nodeType ); + + /* multiple calls are allowed */ + hr = WsSetInputToBuffer( reader, buffer, NULL, 0, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + /* reader properties can be set with WsSetInputToBuffer */ + max_depth = 16; + prop.id = WS_XML_READER_PROPERTY_MAX_DEPTH; + prop.value = &max_depth; + prop.valueSize = sizeof(max_depth); + hr = WsSetInputToBuffer( reader, buffer, &prop, 1, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + max_depth = 0xdeadbeef; + size = sizeof(max_depth); + hr = WsGetReaderProperty( reader, WS_XML_READER_PROPERTY_MAX_DEPTH, &max_depth, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( max_depth == 16, "got %u\n", max_depth ); + + WsFreeReader( reader ); + WsFreeHeap( heap ); +} + +static void test_WsFillReader(void) +{ + HRESULT hr; + WS_XML_READER *reader; + const WS_XML_NODE *node; + + /* what happens of we don't call WsFillReader? */ + hr = WsCreateReader( NULL, 0, &reader, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + node = NULL; + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) ok( node->nodeType == WS_XML_NODE_TYPE_EOF, "got %u\n", node->nodeType ); + + hr = set_input( reader, data1, sizeof(data1) - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + node = NULL; + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) ok( node->nodeType == WS_XML_NODE_TYPE_BOF, "got %u\n", node->nodeType ); + + hr = WsReadNode( reader, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + node = NULL; + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) ok( node->nodeType == WS_XML_NODE_TYPE_EOF, "got %u\n", node->nodeType ); + WsFreeReader( reader ); + + hr = WsCreateReader( NULL, 0, &reader, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + hr = set_input( reader, data1, sizeof(data1) - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsFillReader( reader, sizeof(data1) - 1, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = set_input( reader, data1, sizeof(data1) - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + node = NULL; + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( node != NULL, "node not set\n" ); + if (node) ok( node->nodeType == WS_XML_NODE_TYPE_BOF, "got %u\n", node->nodeType ); + + hr = WsFillReader( NULL, sizeof(data1) - 1, NULL, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = WsFillReader( reader, sizeof(data1) - 1, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + node = NULL; + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( node != NULL, "node not set\n" ); + if (node) ok( node->nodeType == WS_XML_NODE_TYPE_BOF, "got %u\n", node->nodeType ); + + hr = WsFillReader( reader, sizeof(data1) - 1, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + /* min_size larger than input size */ + hr = WsFillReader( reader, sizeof(data1), NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + WsFreeReader( reader ); +} + +static void test_WsReadToStartElement(void) +{ + HRESULT hr; + WS_XML_READER *reader; + const WS_XML_NODE *node, *node2; + int found; + + hr = WsCreateReader( NULL, 0, &reader, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + hr = set_input( reader, data1, sizeof(data1) - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsFillReader( reader, sizeof(data1) - 1, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) ok( node->nodeType == WS_XML_NODE_TYPE_BOF, "got %u\n", node->nodeType ); + + hr = WsFillReader( reader, sizeof(data1) - 1, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsReadToStartElement( NULL, NULL, NULL, NULL, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + found = -1; + hr = WsReadToStartElement( reader, NULL, NULL, &found, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( found == FALSE, "got %d\n", found ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) ok( node->nodeType == WS_XML_NODE_TYPE_EOF, "got %u\n", node->nodeType ); + + hr = set_input( reader, data2, sizeof(data2) - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsFillReader( reader, sizeof(data2) - 1, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) ok( node->nodeType == WS_XML_NODE_TYPE_BOF, "got %u\n", node->nodeType ); + + found = -1; + hr = WsReadToStartElement( reader, NULL, NULL, &found, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( found == TRUE, "got %d\n", found ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) + { + WS_XML_ELEMENT_NODE *elem = (WS_XML_ELEMENT_NODE *)node; + + ok( elem->node.nodeType == WS_XML_NODE_TYPE_ELEMENT, "got %u\n", elem->node.nodeType ); + ok( elem->prefix != NULL, "prefix not set\n" ); + if (elem->prefix) + { + ok( !elem->prefix->length, "got %u\n", elem->prefix->length ); + } + ok( elem->localName != NULL, "localName not set\n" ); + if (elem->localName) + { + ok( elem->localName->length == 4, "got %u\n", elem->localName->length ); + ok( !memcmp( elem->localName->bytes, "text", 4 ), "wrong data\n" ); + } + ok( elem->ns != NULL, "ns not set\n" ); + if (elem->ns) + { + ok( !elem->ns->length, "got %u\n", elem->ns->length ); + } + ok( !elem->attributeCount, "got %u\n", elem->attributeCount ); + ok( elem->attributes == NULL, "attributes set\n" ); + ok( !elem->isEmpty, "isEmpty not zero\n" ); + } + + found = -1; + hr = WsReadToStartElement( reader, NULL, NULL, &found, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( found == TRUE, "got %d\n", found ); + + node2 = NULL; + hr = WsGetReaderNode( reader, &node2, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( node2 == node, "different node\n" ); + + hr = set_input( reader, data3, sizeof(data3) - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsFillReader( reader, sizeof(data3) - 1, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + found = -1; + hr = WsReadToStartElement( reader, NULL, NULL, &found, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( found == TRUE, "got %d\n", found ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) + { + WS_XML_ELEMENT_NODE *elem = (WS_XML_ELEMENT_NODE *)node; + + ok( elem->node.nodeType == WS_XML_NODE_TYPE_ELEMENT, "got %u\n", elem->node.nodeType ); + ok( elem->localName != NULL, "localName not set\n" ); + if (elem->localName) + { + ok( elem->localName->length == 4, "got %u\n", elem->localName->length ); + ok( !memcmp( elem->localName->bytes, "text", 4 ), "wrong data\n" ); + } + } + + hr = set_input( reader, data4, sizeof(data4) - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsFillReader( reader, sizeof(data4) - 1, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + found = -1; + hr = WsReadToStartElement( reader, NULL, NULL, &found, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( found == TRUE, "got %d\n", found ); + WsFreeReader( reader ); +} + +static void test_WsReadStartElement(void) +{ + HRESULT hr; + WS_XML_READER *reader; + const WS_XML_NODE *node, *node2; + int found; + + hr = WsCreateReader( NULL, 0, &reader, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + hr = set_input( reader, data2, sizeof(data2) - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsFillReader( reader, sizeof(data2) - 1, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + found = -1; + hr = WsReadToStartElement( reader, NULL, NULL, &found, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( found == TRUE, "got %d\n", found ); + + hr = WsReadStartElement( NULL, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) ok( node->nodeType == WS_XML_NODE_TYPE_ELEMENT, "got %u\n", node->nodeType ); + + hr = WsReadStartElement( reader, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) + { + WS_XML_TEXT_NODE *text = (WS_XML_TEXT_NODE *)node; + ok( text->node.nodeType == WS_XML_NODE_TYPE_TEXT, "got %u\n", text->node.nodeType ); + ok( text->text != NULL, "text not set\n" ); + if (text->text) + { + WS_XML_UTF8_TEXT *utf8 = (WS_XML_UTF8_TEXT *)text->text; + ok( text->text->textType == WS_XML_TEXT_TYPE_UTF8, "got %u\n", text->text->textType ); + ok( utf8->value.length == 4, "got %u\n", utf8->value.length ); + ok( !memcmp( utf8->value.bytes, "test", 4 ), "wrong data\n" ); + } + } + + hr = WsReadStartElement( reader, NULL ); + ok( hr == WS_E_INVALID_FORMAT, "got %08x\n", hr ); + + node2 = NULL; + hr = WsGetReaderNode( reader, &node2, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( node2 == node, "different node\n" ); + + hr = set_input( reader, data8, sizeof(data8) - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsFillReader( reader, sizeof(data8) - 1, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + found = -1; + hr = WsReadToStartElement( reader, NULL, NULL, &found, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( found == TRUE, "got %d\n", found ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) ok( node->nodeType == WS_XML_NODE_TYPE_ELEMENT, "got %u\n", node->nodeType ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) + { + WS_XML_ELEMENT_NODE *elem = (WS_XML_ELEMENT_NODE *)node; + ok( node->nodeType == WS_XML_NODE_TYPE_ELEMENT, "got %u\n", node->nodeType ); + ok( !memcmp( elem->localName->bytes, "node1", 5), "wrong name\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 ); + if (node) + { + WS_XML_ELEMENT_NODE *elem = (WS_XML_ELEMENT_NODE *)node; + ok( node->nodeType == WS_XML_NODE_TYPE_ELEMENT, "got %u\n", node->nodeType ); + ok( !memcmp( elem->localName->bytes, "node2", 5), "wrong name\n" ); + } + WsFreeReader( reader ); +} + +static void test_WsReadEndElement(void) +{ + HRESULT hr; + WS_XML_READER *reader; + const WS_XML_NODE *node; + + hr = WsCreateReader( NULL, 0, &reader, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + hr = set_input( reader, data2, sizeof(data2) - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsFillReader( reader, sizeof(data2) - 1, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsReadEndElement( reader, NULL ); + ok( hr == WS_E_INVALID_FORMAT, "got %08x\n", hr ); + + hr = set_input( reader, data2, sizeof(data2) - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsFillReader( reader, sizeof(data2) - 1, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsReadNode( reader, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) ok( node->nodeType == WS_XML_NODE_TYPE_ELEMENT, "got %u\n", node->nodeType ); + + hr = WsReadNode( reader, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) ok( node->nodeType == WS_XML_NODE_TYPE_TEXT, "got %u\n", node->nodeType ); + + hr = WsReadNode( reader, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) ok( node->nodeType == WS_XML_NODE_TYPE_END_ELEMENT, "got %u\n", node->nodeType ); + + hr = WsReadNode( reader, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) ok( node->nodeType == WS_XML_NODE_TYPE_EOF, "got %u\n", node->nodeType ); + + hr = set_input( reader, data5, sizeof(data5) - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsFillReader( reader, sizeof(data5) - 1, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsReadEndElement( reader, NULL ); + ok( hr == WS_E_INVALID_FORMAT, "got %08x\n", hr ); + + hr = set_input( reader, data10, sizeof(data10) - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsFillReader( reader, sizeof(data10) - 1, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsReadNode( reader, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) ok( node->nodeType == WS_XML_NODE_TYPE_ELEMENT, "got %u\n", node->nodeType ); + + hr = WsReadEndElement( reader, NULL ); + ok( hr == WS_E_INVALID_FORMAT, "got %08x\n", hr ); + WsFreeReader( reader ); +} + +static void test_WsReadNode(void) +{ + static const char str1[] = ""; + static const char str2[] = "< a>"; + static const char str3[] = ""; + static const char str4[] = "<>"; + static const char str5[] = "<>"; + static const char str6[] = ""; + static const char str7[] = " "; + static const char str8[] = ""; + static const char str9[] = ""; + static const char str10[] = ""; + static const char str11[] = ""; + static const char str12[] = "test"; + static const char str13[] = "test"; + static const char str14[] = ""; + static const char str15[] = ""; + static const char str17[] = ""; + HRESULT hr; + WS_XML_READER *reader; + const WS_XML_NODE *node; + unsigned int i; + int found; + static const struct + { + const char *text; + HRESULT hr; + WS_XML_NODE_TYPE type; + int todo; + } + tests[] = + { + { str1, S_OK, WS_XML_NODE_TYPE_ELEMENT }, + { str2, WS_E_INVALID_FORMAT, 0 }, + { str3, S_OK, WS_XML_NODE_TYPE_ELEMENT }, + { str4, WS_E_INVALID_FORMAT, 0 }, + { str5, WS_E_INVALID_FORMAT, 0 }, + { str6, WS_E_INVALID_FORMAT, 0 }, + { str7, S_OK, WS_XML_NODE_TYPE_TEXT }, + { str8, WS_E_INVALID_FORMAT, 0 }, + { str9, WS_E_INVALID_FORMAT, 0 }, + { str10, WS_E_INVALID_FORMAT, 0, 1 }, + { str11, S_OK, WS_XML_NODE_TYPE_EOF }, + { str12, S_OK, WS_XML_NODE_TYPE_ELEMENT }, + { str13, S_OK, WS_XML_NODE_TYPE_ELEMENT }, + { str14, WS_E_INVALID_FORMAT, 0, 1 }, + { str15, WS_E_INVALID_FORMAT, 0 }, + { str16, S_OK, WS_XML_NODE_TYPE_COMMENT }, + { str17, S_OK, WS_XML_NODE_TYPE_COMMENT }, + }; + + hr = WsCreateReader( NULL, 0, &reader, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) + { + hr = set_input( reader, tests[i].text, strlen(tests[i].text) ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsFillReader( reader, strlen(tests[i].text), NULL, NULL ); + ok( hr == S_OK, "%u: got %08x\n", i, hr ); + + hr = WsReadNode( reader, NULL ); + if (tests[i].todo) + todo_wine ok( hr == tests[i].hr, "%u: got %08x\n", i, hr ); + else + ok( hr == tests[i].hr, "%u: got %08x\n", i, hr ); + if (hr == S_OK) + { + node = NULL; + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "%u: got %08x\n", i, hr ); + ok( node != NULL, "%u: node not set\n", i ); + if (node) + { + if (tests[i].todo) + todo_wine + ok( node->nodeType == tests[i].type, "%u: got %u\n", i, node->nodeType ); + else + ok( node->nodeType == tests[i].type, "%u: got %u\n", i, node->nodeType ); + } + } + } + + hr = set_input( reader, data6, sizeof(data6) - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsFillReader( reader, sizeof(data6) - 1, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + found = -1; + hr = WsReadToStartElement( reader, NULL, NULL, &found, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( found == TRUE, "got %d\n", found ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) + { + WS_XML_ELEMENT_NODE *elem = (WS_XML_ELEMENT_NODE *)node; + WS_XML_ATTRIBUTE *attr; + WS_XML_UTF8_TEXT *text; + + ok( elem->node.nodeType == WS_XML_NODE_TYPE_ELEMENT, "got %u\n", elem->node.nodeType ); + ok( elem->prefix != NULL, "prefix not set\n" ); + ok( !elem->prefix->length, "got %u\n", elem->prefix->length ); + ok( elem->prefix->bytes == NULL, "bytes set\n" ); + ok( elem->localName != NULL, "localName not set\n" ); + ok( elem->localName->length == 4, "got %u\n", elem->localName->length ); + ok( !memcmp( elem->localName->bytes, "text", 4 ), "wrong data\n" ); + ok( elem->ns != NULL, "ns not set\n" ); + ok( !elem->ns->length, "got %u\n", elem->ns->length ); + ok( elem->ns->bytes != NULL, "bytes not set\n" ); + ok( elem->attributeCount == 2, "got %u\n", elem->attributeCount ); + ok( elem->attributes != NULL, "attributes not set\n" ); + ok( !elem->isEmpty, "isEmpty not zero\n" ); + + attr = elem->attributes[0]; + ok( !attr->singleQuote, "got %u\n", attr->singleQuote ); + ok( !attr->isXmlNs, "got %u\n", attr->isXmlNs ); + ok( attr->prefix != NULL, "prefix not set\n" ); + ok( !attr->prefix->length, "got %u\n", attr->prefix->length ); + ok( attr->prefix->bytes == NULL, "bytes set\n" ); + ok( attr->localName != NULL, "localName not set\n" ); + ok( attr->localName->length == 4, "got %u\n", attr->localName->length ); + ok( !memcmp( attr->localName->bytes, "attr", 4 ), "wrong data\n" ); + ok( attr->ns != NULL, "ns not set\n" ); + ok( !attr->ns->length, "got %u\n", attr->ns->length ); + ok( attr->ns->bytes == NULL, "bytes set\n" ); + ok( attr->value != NULL, "value not set\n" ); + + text = (WS_XML_UTF8_TEXT *)attr->value; + ok( attr->value->textType == WS_XML_TEXT_TYPE_UTF8, "got %u\n", attr->value->textType ); + ok( text->value.length == 5, "got %u\n", text->value.length ); + ok( !memcmp( text->value.bytes, "value", 5 ), "wrong data\n" ); + + attr = elem->attributes[1]; + ok( attr->singleQuote == 1, "got %u\n", attr->singleQuote ); + ok( !attr->isXmlNs, "got %u\n", attr->isXmlNs ); + ok( attr->prefix != NULL, "prefix not set\n" ); + ok( !attr->prefix->length, "got %u\n", attr->prefix->length ); + ok( attr->prefix->bytes == NULL, "bytes set\n" ); + ok( attr->localName != NULL, "localName not set\n" ); + ok( attr->localName->length == 5, "got %u\n", attr->localName->length ); + ok( !memcmp( attr->localName->bytes, "attr2", 5 ), "wrong data\n" ); + ok( attr->ns != NULL, "ns not set\n" ); + ok( !attr->ns->length, "got %u\n", attr->ns->length ); + ok( attr->ns->bytes == NULL, "bytes set\n" ); + ok( attr->value != NULL, "value not set\n" ); + + text = (WS_XML_UTF8_TEXT *)attr->value; + ok( attr->value->textType == WS_XML_TEXT_TYPE_UTF8, "got %u\n", attr->value->textType ); + ok( text->value.length == 6, "got %u\n", text->value.length ); + ok( !memcmp( text->value.bytes, "value2", 6 ), "wrong data\n" ); + } + + hr = set_input( reader, data7, sizeof(data7) - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsFillReader( reader, sizeof(data7) - 1, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsReadNode( reader, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + if (node) + { + WS_XML_COMMENT_NODE *comment = (WS_XML_COMMENT_NODE *)node; + + ok( comment->node.nodeType == WS_XML_NODE_TYPE_COMMENT, "got %u\n", comment->node.nodeType ); + ok( comment->value.length == 9, "got %u\n", comment->value.length ); + ok( !memcmp( comment->value.bytes, " comment ", 9 ), "wrong data\n" ); + } + + WsFreeReader( reader ); +} + +static void prepare_type_test( WS_XML_READER *reader, const char *data, ULONG size ) +{ + HRESULT hr; + + hr = set_input( reader, data, size ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsFillReader( reader, size, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsReadToStartElement( reader, NULL, NULL, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsReadStartElement( reader, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); +} + +static void test_WsReadType(void) +{ + static const WCHAR testW[] = {'t','e','s','t',0}; + HRESULT hr; + WS_XML_READER *reader; + WS_HEAP *heap; + WCHAR *val_str; + BOOL val_bool; + INT8 val_int8; + INT16 val_int16; + INT32 val_int32; + INT64 val_int64; + UINT8 val_uint8; + UINT16 val_uint16; + UINT32 val_uint32; + UINT64 val_uint64; + + 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_type_test( reader, data2, sizeof(data2) - 1 ); + hr = WsReadType( NULL, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_WSZ_TYPE, NULL, + WS_READ_REQUIRED_POINTER, heap, &val_str, sizeof(val_str), NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_WSZ_TYPE, NULL, + WS_READ_REQUIRED_POINTER, heap, &val_str, 0, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_WSZ_TYPE, NULL, + WS_READ_REQUIRED_POINTER, heap, NULL, sizeof(val_str), NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_WSZ_TYPE, NULL, + WS_READ_REQUIRED_POINTER, heap, &val_str, sizeof(val_str) + 1, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + val_str = NULL; + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_WSZ_TYPE, NULL, + WS_READ_REQUIRED_POINTER, heap, &val_str, sizeof(val_str), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( val_str != NULL, "pointer not set\n" ); + if (val_str) ok( !lstrcmpW( val_str, testW ), "wrong data\n" ); + + val_bool = -1; + prepare_type_test( reader, "true", sizeof("true") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_BOOL_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_bool, sizeof(BOOL), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( val_bool == TRUE, "got %d\n", val_bool ); + + val_bool = -1; + prepare_type_test( reader, "false", sizeof("false") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_BOOL_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_bool, sizeof(BOOL), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( val_bool == FALSE, "got %d\n", val_bool ); + + val_bool = -1; + prepare_type_test( reader, "FALSE", sizeof("FALSE") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_BOOL_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_bool, sizeof(val_bool), NULL ); + ok( hr == WS_E_INVALID_FORMAT, "got %08x\n", hr ); + ok( val_bool == -1, "got %d\n", val_bool ); + + val_bool = -1; + prepare_type_test( reader, "1", sizeof("1") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_BOOL_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_bool, sizeof(val_bool), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( val_bool == TRUE, "got %d\n", val_bool ); + + val_bool = -1; + prepare_type_test( reader, "2", sizeof("2") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_BOOL_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_bool, sizeof(val_bool), NULL ); + ok( hr == WS_E_INVALID_FORMAT, "got %08x\n", hr ); + ok( val_bool == -1, "got %d\n", val_bool ); + + val_bool = -1; + prepare_type_test( reader, "0", sizeof("0") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_BOOL_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_bool, sizeof(val_bool), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( val_bool == FALSE, "got %d\n", val_bool ); + + val_int8 = 0; + prepare_type_test( reader, "-128", sizeof("-128") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_INT8_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_int8, sizeof(val_int8), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( val_int8 == -128, "got %d\n", val_int8 ); + + val_int8 = 0; + prepare_type_test( reader, " ", sizeof(" ") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_INT8_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_int8, sizeof(val_int8), NULL ); + ok( hr == WS_E_INVALID_FORMAT, "got %08x\n", hr ); + ok( !val_int8, "got %d\n", val_int8 ); + + val_int8 = 0; + prepare_type_test( reader, "-", sizeof("-") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_INT8_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_int8, sizeof(val_int8), NULL ); + ok( hr == WS_E_INVALID_FORMAT, "got %08x\n", hr ); + ok( !val_int8, "got %d\n", val_int8 ); + + val_int8 = -1; + prepare_type_test( reader, "-0", sizeof("-0") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_INT8_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_int8, sizeof(val_int8), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( !val_int8, "got %d\n", val_int8 ); + + val_int8 = 0; + prepare_type_test( reader, "-129", sizeof("-129") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_INT8_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_int8, sizeof(val_int8), NULL ); + ok( hr == WS_E_NUMERIC_OVERFLOW, "got %08x\n", hr ); + ok( !val_int8, "got %d\n", val_int8 ); + + val_int16 = 0; + prepare_type_test( reader, "-32768", sizeof("-32768") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_INT16_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_int16, sizeof(val_int16), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( val_int16 == -32768, "got %d\n", val_int16 ); + + val_int16 = 0; + prepare_type_test( reader, "-32769", sizeof("-32769") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_INT16_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_int16, sizeof(val_int16), NULL ); + ok( hr == WS_E_NUMERIC_OVERFLOW, "got %08x\n", hr ); + ok( !val_int16, "got %d\n", val_int16 ); + + val_int32 = 0; + prepare_type_test( reader, "-2147483648", sizeof("-2147483648") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_INT32_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_int32, sizeof(val_int32), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( val_int32 == -2147483647 - 1, "got %d\n", val_int32 ); + + val_int32 = 0; + prepare_type_test( reader, "-2147483649", sizeof("-2147483649") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_INT32_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_int32, sizeof(val_int32), NULL ); + todo_wine ok( hr == WS_E_INVALID_FORMAT, "got %08x\n", hr ); + ok( !val_int32, "got %d\n", val_int32 ); + + val_int64 = 0; + prepare_type_test( reader, "-9223372036854775808", sizeof("-9223372036854775808") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_INT64_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_int64, sizeof(val_int64), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( val_int64 == -9223372036854775807 - 1, "wrong value\n" ); + + val_int64 = 0; + prepare_type_test( reader, "-9223372036854775809", sizeof("-9223372036854775809") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_INT64_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_int64, sizeof(val_int64), NULL ); + todo_wine ok( hr == WS_E_INVALID_FORMAT, "got %08x\n", hr ); + ok( !val_int64, "wrong value\n" ); + + val_uint8 = 0; + prepare_type_test( reader, " 255 ", sizeof(" 255 ") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_UINT8_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_uint8, sizeof(val_uint8), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( val_uint8 == 255, "got %u\n", val_uint8 ); + + val_uint8 = 0; + prepare_type_test( reader, "+255", sizeof("+255") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_UINT8_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_uint8, sizeof(val_uint8), NULL ); + ok( hr == WS_E_INVALID_FORMAT, "got %08x\n", hr ); + ok( !val_uint8, "got %u\n", val_uint8 ); + + val_uint8 = 0; + prepare_type_test( reader, "-255", sizeof("-255") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_UINT8_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_uint8, sizeof(val_uint8), NULL ); + todo_wine ok( hr == WS_E_NUMERIC_OVERFLOW, "got %08x\n", hr ); + ok( !val_uint8, "got %u\n", val_uint8 ); + + val_uint8 = 0; + prepare_type_test( reader, "0xff", sizeof("0xff") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_UINT8_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_uint8, sizeof(val_uint8), NULL ); + ok( hr == WS_E_INVALID_FORMAT, "got %08x\n", hr ); + ok( !val_uint8, "got %u\n", val_uint8 ); + + val_uint8 = 0; + prepare_type_test( reader, "256", sizeof("256") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_UINT8_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_uint8, sizeof(val_uint8), NULL ); + ok( hr == WS_E_NUMERIC_OVERFLOW, "got %08x\n", hr ); + ok( !val_uint8, "got %u\n", val_uint8 ); + + val_uint16 = 0; + prepare_type_test( reader, "65535", sizeof("65535") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_UINT16_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_uint16, sizeof(val_uint16), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( val_uint16 == 65535, "got %u\n", val_uint16 ); + + val_uint16 = 0; + prepare_type_test( reader, "65536", sizeof("65536") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_UINT16_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_uint16, sizeof(val_uint16), NULL ); + ok( hr == WS_E_NUMERIC_OVERFLOW, "got %08x\n", hr ); + ok( !val_uint16, "got %u\n", val_uint16 ); + + val_uint32 = 0; + prepare_type_test( reader, "4294967295", sizeof("4294967295") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_UINT32_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_uint32, sizeof(val_uint32), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( val_uint32 == ~0, "got %u\n", val_uint32 ); + + val_uint32 = 0; + prepare_type_test( reader, "4294967296", sizeof("4294967296") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_UINT32_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_uint32, sizeof(val_uint32), NULL ); + ok( hr == WS_E_NUMERIC_OVERFLOW, "got %08x\n", hr ); + ok( !val_uint32, "got %u\n", val_uint32 ); + + val_uint64 = 0; + prepare_type_test( reader, "18446744073709551615", sizeof("18446744073709551615") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_UINT64_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_uint64, sizeof(val_uint64), NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( val_uint64 == ~0, "wrong value\n" ); + + val_uint64 = 0; + prepare_type_test( reader, "18446744073709551616", sizeof("18446744073709551616") - 1 ); + hr = WsReadType( reader, WS_ELEMENT_CONTENT_TYPE_MAPPING, WS_UINT64_TYPE, NULL, + WS_READ_REQUIRED_VALUE, heap, &val_uint64, sizeof(val_uint64), NULL ); + todo_wine ok( hr == WS_E_INVALID_FORMAT, "got %08x\n", hr ); + ok( !val_uint64, "wrong value\n" ); + + WsFreeReader( reader ); + WsFreeHeap( heap ); +} + +static void test_WsGetXmlAttribute(void) +{ + static const WCHAR valueW[] = {'v','a','l','u','e',0}; + HRESULT hr; + WS_XML_READER *reader; + WS_XML_STRING xmlstr; + WS_HEAP *heap; + WCHAR *str; + ULONG count; + int found; + + 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 ); + + hr = set_input( reader, data9, sizeof(data9) - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsFillReader( reader, sizeof(data9) - 1, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + found = -1; + hr = WsReadToStartElement( reader, NULL, NULL, &found, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( found == TRUE, "got %d\n", found ); + + xmlstr.bytes = (BYTE *)"attr"; + xmlstr.length = sizeof("attr") - 1; + xmlstr.dictionary = NULL; + xmlstr.id = 0; + str = NULL; + count = 0; + hr = WsGetXmlAttribute( reader, &xmlstr, heap, &str, &count, NULL ); + todo_wine ok( hr == S_OK, "got %08x\n", hr ); + todo_wine ok( str != NULL, "str not set\n" ); + todo_wine ok( count == 5, "got %u\n", count ); + /* string is not null-terminated */ + if (str) ok( !memcmp( str, valueW, count * sizeof(WCHAR) ), "wrong data\n" ); + + xmlstr.bytes = (BYTE *)"none"; + xmlstr.length = sizeof("none") - 1; + xmlstr.dictionary = NULL; + xmlstr.id = 0; + str = (WCHAR *)0xdeadbeef; + count = 0xdeadbeef; + hr = WsGetXmlAttribute( reader, &xmlstr, heap, &str, &count, NULL ); + todo_wine ok( hr == S_FALSE, "got %08x\n", hr ); + todo_wine ok( str == NULL, "str not set\n" ); + todo_wine ok( !count, "got %u\n", count ); + + WsFreeReader( reader ); + WsFreeHeap( heap ); +} + +static void test_WsXmlStringEquals(void) +{ + BYTE bom[] = {0xef,0xbb,0xbf}; + WS_XML_STRING str1 = {0, NULL}, str2 = {0, NULL}; + HRESULT hr; + + hr = WsXmlStringEquals( NULL, NULL, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = WsXmlStringEquals( &str1, NULL, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = WsXmlStringEquals( NULL, &str2, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = WsXmlStringEquals( &str1, &str2, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + str1.length = 1; + str1.bytes = (BYTE *)"a"; + hr = WsXmlStringEquals( &str1, &str1, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + str2.length = 1; + str2.bytes = (BYTE *)"b"; + hr = WsXmlStringEquals( &str1, &str2, NULL ); + ok( hr == S_FALSE, "got %08x\n", hr ); + + str2.length = 1; + str2.bytes = bom; + hr = WsXmlStringEquals( &str1, &str2, NULL ); + ok( hr == S_FALSE, "got %08x\n", hr ); + + str1.length = 3; + hr = WsXmlStringEquals( &str1, &str2, NULL ); + ok( hr == S_FALSE, "got %08x\n", hr ); + + str2.length = 3; + hr = WsXmlStringEquals( &str1, &str2, NULL ); + ok( hr == S_FALSE, "got %08x\n", hr ); + + str1.length = 3; + str1.bytes = bom; + hr = WsXmlStringEquals( &str1, &str2, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); +} + +static void test_WsAlloc(void) +{ + HRESULT hr; + WS_HEAP *heap; + void *ptr; + + hr = WsCreateHeap( 256, 0, NULL, 0, &heap, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + ptr = NULL; + hr = WsAlloc( NULL, 16, &ptr, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + ok( ptr == NULL, "ptr set\n" ); + + ptr = NULL; + hr = WsAlloc( heap, 512, &ptr, NULL ); + todo_wine ok( hr == WS_E_QUOTA_EXCEEDED, "got %08x\n", hr ); + todo_wine ok( ptr == NULL, "ptr not set\n" ); + + ptr = NULL; + hr = WsAlloc( heap, 16, &ptr, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( ptr != NULL, "ptr not set\n" ); + WsFreeHeap( heap ); +} + +static void test_WsMoveReader(void) +{ + HRESULT hr; + WS_HEAP *heap; + WS_XML_READER *reader; + WS_XML_WRITER *writer; + WS_XML_BUFFER *buffer; + WS_XML_STRING localname = {1, (BYTE *)"a"}, localname2 = {1, (BYTE *)"b"}, ns = {0, NULL}; + const WS_XML_NODE *node; + WS_XML_ELEMENT_NODE *elem; + + hr = WsCreateReader( NULL, 0, &reader, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsMoveReader( NULL, WS_MOVE_TO_EOF, NULL, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + /* reader must be set to an XML buffer */ + hr = WsMoveReader( reader, WS_MOVE_TO_EOF, NULL, NULL ); + ok( hr == WS_E_INVALID_OPERATION, "got %08x\n", hr ); + + hr = set_input( reader, data8, sizeof(data8) - 1 ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsMoveReader( reader, WS_MOVE_TO_EOF, NULL, NULL ); + todo_wine ok( hr == WS_E_INVALID_OPERATION, "got %08x\n", hr ); + WsFreeReader( reader ); + + hr = WsCreateHeap( 1 << 16, 0, NULL, 0, &heap, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsCreateXmlBuffer( heap, NULL, 0, &buffer, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsCreateWriter( NULL, 0, &writer, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsSetOutputToBuffer( writer, buffer, NULL, 0, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + /* */ + hr = WsWriteStartElement( writer, NULL, &localname, &ns, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteStartElement( writer, NULL, &localname2, &ns, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteEndElement( writer, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteEndElement( writer, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsCreateReader( NULL, 0, &reader, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsMoveReader( reader, WS_MOVE_TO_EOF, NULL, NULL ); + ok( hr == WS_E_INVALID_OPERATION, "got %08x\n", hr ); + + hr = WsSetInputToBuffer( reader, buffer, NULL, 0, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + /* first element is child node of BOF node */ + hr = WsMoveReader( reader, WS_MOVE_TO_BOF, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsMoveReader( reader, WS_MOVE_TO_CHILD_NODE, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + elem = (WS_XML_ELEMENT_NODE *)node; + ok( elem->node.nodeType == WS_XML_NODE_TYPE_ELEMENT, "got %u\n", elem->node.nodeType ); + ok( elem->localName->length == 1, "got %u\n", elem->localName->length ); + ok( !memcmp( elem->localName->bytes, "a", 1 ), "wrong data\n" ); + + hr = WsMoveReader( reader, WS_MOVE_TO_CHILD_NODE, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsGetReaderNode( reader, &node, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + elem = (WS_XML_ELEMENT_NODE *)node; + ok( elem->node.nodeType == WS_XML_NODE_TYPE_ELEMENT, "got %u\n", elem->node.nodeType ); + ok( elem->localName->length == 1, "got %u\n", elem->localName->length ); + ok( !memcmp( elem->localName->bytes, "b", 1 ), "wrong data\n" ); + + hr = WsMoveReader( reader, WS_MOVE_TO_NEXT_NODE, NULL, 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_END_ELEMENT, "got %u\n", elem->node.nodeType ); + + /* EOF node is last child of BOF node */ + hr = WsMoveReader( reader, WS_MOVE_TO_BOF, NULL, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsMoveReader( reader, WS_MOVE_TO_CHILD_NODE, NULL, 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_ELEMENT, "got %u\n", elem->node.nodeType ); + + hr = WsMoveReader( reader, WS_MOVE_TO_NEXT_NODE, NULL, 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", elem->node.nodeType ); + + WsFreeReader( reader ); + WsFreeWriter( writer ); + WsFreeHeap( heap ); +} + +START_TEST(reader) +{ + test_WsCreateError(); + test_WsCreateHeap(); + test_WsCreateReader(); + test_WsSetInput(); + test_WsSetInputToBuffer(); + test_WsFillReader(); + test_WsReadToStartElement(); + test_WsReadStartElement(); + test_WsReadEndElement(); + test_WsReadNode(); + test_WsReadType(); + test_WsGetXmlAttribute(); + test_WsXmlStringEquals(); + test_WsAlloc(); + test_WsMoveReader(); +} diff -Nru wine1.7-1.7.50/dlls/webservices/tests/writer.c wine1.7-1.7.55/dlls/webservices/tests/writer.c --- wine1.7-1.7.50/dlls/webservices/tests/writer.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/webservices/tests/writer.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,460 @@ +/* + * Copyright 2015 Hans Leidekker for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * 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 "windows.h" +#include "webservices.h" +#include "wine/test.h" + +static HRESULT set_output( WS_XML_WRITER *writer ) +{ + WS_XML_WRITER_TEXT_ENCODING encoding; + WS_XML_WRITER_BUFFER_OUTPUT output; + + encoding.encoding.encodingType = WS_XML_WRITER_ENCODING_TYPE_TEXT; + encoding.charSet = WS_CHARSET_UTF8; + + output.output.outputType = WS_XML_WRITER_OUTPUT_TYPE_BUFFER; + + return WsSetOutput( writer, &encoding.encoding, &output.output, NULL, 0, NULL ); +} + +static void test_WsCreateWriter(void) +{ + HRESULT hr; + WS_XML_WRITER *writer; + WS_XML_WRITER_PROPERTY prop; + ULONG size, max_depth, max_attrs, indent, trim_size, max_size, max_ns; + BOOL allow_fragment, write_decl, in_attr; + WS_CHARSET charset; + WS_BUFFERS buffers; + WS_BYTES bytes; + + hr = WsCreateWriter( NULL, 0, NULL, NULL ) ; + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + writer = NULL; + hr = WsCreateWriter( NULL, 0, &writer, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + ok( writer != NULL, "writer not set\n" ); + + /* can't retrieve properties before output is set */ + max_depth = 0xdeadbeef; + size = sizeof(max_depth); + hr = WsGetWriterProperty( writer, WS_XML_WRITER_PROPERTY_MAX_DEPTH, &max_depth, size, NULL ); + ok( hr == WS_E_INVALID_OPERATION, "got %08x\n", hr ); + ok( max_depth == 0xdeadbeef, "max_depth set\n" ); + + hr = set_output( writer ); + ok( hr == S_OK, "got %08x\n", hr ); + + /* check some defaults */ + max_depth = 0xdeadbeef; + size = sizeof(max_depth); + hr = WsGetWriterProperty( writer, WS_XML_WRITER_PROPERTY_MAX_DEPTH, &max_depth, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( max_depth == 32, "got %u\n", max_depth ); + + allow_fragment = TRUE; + size = sizeof(allow_fragment); + hr = WsGetWriterProperty( writer, WS_XML_WRITER_PROPERTY_ALLOW_FRAGMENT, &allow_fragment, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( !allow_fragment, "got %d\n", allow_fragment ); + + max_attrs = 0xdeadbeef; + size = sizeof(max_attrs); + hr = WsGetWriterProperty( writer, WS_XML_WRITER_PROPERTY_MAX_ATTRIBUTES, &max_attrs, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( max_attrs == 128, "got %u\n", max_attrs ); + + write_decl = TRUE; + size = sizeof(write_decl); + hr = WsGetWriterProperty( writer, WS_XML_WRITER_PROPERTY_WRITE_DECLARATION, &write_decl, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( !write_decl, "got %d\n", write_decl ); + + indent = 0xdeadbeef; + size = sizeof(indent); + hr = WsGetWriterProperty( writer, WS_XML_WRITER_PROPERTY_INDENT, &indent, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( !indent, "got %u\n", indent ); + + trim_size = 0xdeadbeef; + size = sizeof(trim_size); + hr = WsGetWriterProperty( writer, WS_XML_WRITER_PROPERTY_BUFFER_TRIM_SIZE, &trim_size, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( trim_size == 4096, "got %u\n", trim_size ); + + charset = 0xdeadbeef; + size = sizeof(charset); + hr = WsGetWriterProperty( writer, WS_XML_WRITER_PROPERTY_CHARSET, &charset, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( charset == WS_CHARSET_UTF8, "got %u\n", charset ); + + buffers.bufferCount = 0xdeadbeef; + buffers.buffers = (WS_BYTES *)0xdeadbeef; + size = sizeof(buffers); + hr = WsGetWriterProperty( writer, WS_XML_WRITER_PROPERTY_BUFFERS, &buffers, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( !buffers.bufferCount, "got %u\n", buffers.bufferCount ); + ok( !buffers.buffers, "got %p\n", buffers.buffers ); + + max_size = 0xdeadbeef; + size = sizeof(max_size); + hr = WsGetWriterProperty( writer, WS_XML_WRITER_PROPERTY_BUFFER_MAX_SIZE, &max_size, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( max_size == 65536, "got %u\n", max_size ); + + bytes.length = 0xdeadbeef; + bytes.bytes = (BYTE *)0xdeadbeef; + size = sizeof(buffers); + hr = WsGetWriterProperty( writer, WS_XML_WRITER_PROPERTY_BYTES, &bytes, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( !bytes.length, "got %u\n", bytes.length ); + ok( bytes.bytes != NULL, "got %p\n", bytes.bytes ); + + max_size = 0xdeadbeef; + size = sizeof(max_size); + hr = WsGetWriterProperty( writer, WS_XML_WRITER_PROPERTY_MAX_MIME_PARTS_BUFFER_SIZE, &max_size, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( max_size == 65536, "got %u\n", max_size ); + + bytes.length = 0xdeadbeef; + bytes.bytes = (BYTE *)0xdeadbeef; + size = sizeof(bytes); + hr = WsGetWriterProperty( writer, WS_XML_WRITER_PROPERTY_INITIAL_BUFFER, &bytes, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( !bytes.length, "got %u\n", bytes.length ); + ok( !bytes.bytes, "got %p\n", bytes.bytes ); + + max_ns = 0xdeadbeef; + size = sizeof(max_ns); + hr = WsGetWriterProperty( writer, WS_XML_WRITER_PROPERTY_MAX_NAMESPACES, &max_ns, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( max_ns == 32, "got %u\n", max_ns ); + WsFreeWriter( writer ); + + /* change a property */ + max_depth = 16; + prop.id = WS_XML_WRITER_PROPERTY_MAX_DEPTH; + prop.value = &max_depth; + prop.valueSize = sizeof(max_depth); + hr = WsCreateWriter( &prop, 1, &writer, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + hr = set_output( writer ); + ok( hr == S_OK, "got %08x\n", hr ); + + max_depth = 0xdeadbeef; + size = sizeof(max_depth); + hr = WsGetWriterProperty( writer, WS_XML_WRITER_PROPERTY_MAX_DEPTH, &max_depth, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( max_depth == 16, "got %u\n", max_depth ); + WsFreeWriter( writer ); + + /* show that some properties are read-only */ + in_attr = TRUE; + prop.id = WS_XML_WRITER_PROPERTY_IN_ATTRIBUTE; + prop.value = &in_attr; + prop.valueSize = sizeof(in_attr); + hr = WsCreateWriter( &prop, 1, &writer, NULL ) ; + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + size = 1; + prop.id = WS_XML_WRITER_PROPERTY_BYTES_WRITTEN; + prop.value = &size; + prop.valueSize = sizeof(size); + hr = WsCreateWriter( &prop, 1, &writer, NULL ) ; + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + size = 1; + prop.id = WS_XML_WRITER_PROPERTY_BYTES_TO_CLOSE; + prop.value = &size; + prop.valueSize = sizeof(size); + hr = WsCreateWriter( &prop, 1, &writer, NULL ) ; + ok( hr == E_INVALIDARG, "got %08x\n", hr ); +} + +static void test_WsCreateXmlBuffer(void) +{ + HRESULT hr; + WS_HEAP *heap; + WS_XML_WRITER *writer; + WS_XML_BUFFER *buffer; + WS_BYTES bytes; + ULONG size; + + hr = WsCreateXmlBuffer( NULL, NULL, 0, NULL, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = WsCreateXmlBuffer( NULL, NULL, 0, &buffer, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = WsCreateHeap( 1 << 16, 0, NULL, 0, &heap, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsCreateXmlBuffer( heap, NULL, 0, NULL, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + buffer = NULL; + hr = WsCreateXmlBuffer( heap, NULL, 0, &buffer, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( buffer != NULL, "buffer not set\n" ); + + hr = WsCreateWriter( NULL, 0, &writer, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + size = sizeof(bytes); + hr = WsGetWriterProperty( writer, WS_XML_WRITER_PROPERTY_BYTES, &bytes, size, NULL ); + ok( hr == WS_E_INVALID_OPERATION, "got %08x\n", hr ); + + hr = WsSetOutputToBuffer( writer, buffer, NULL, 0, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + size = sizeof(bytes); + hr = WsGetWriterProperty( writer, WS_XML_WRITER_PROPERTY_BYTES, &bytes, size, NULL ); + todo_wine ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + WsFreeWriter( writer ); + WsFreeHeap( heap ); +} + +static void test_WsSetOutput(void) +{ + HRESULT hr; + WS_XML_WRITER *writer; + WS_XML_WRITER_PROPERTY prop; + WS_XML_WRITER_TEXT_ENCODING encoding; + WS_XML_WRITER_BUFFER_OUTPUT output; + ULONG size, max_depth; + + hr = WsCreateWriter( NULL, 0, &writer, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsSetOutput( NULL, NULL, NULL, NULL, 0, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + encoding.encoding.encodingType = WS_XML_WRITER_ENCODING_TYPE_TEXT; + encoding.charSet = WS_CHARSET_UTF8; + + output.output.outputType = WS_XML_WRITER_OUTPUT_TYPE_BUFFER; + + hr = WsSetOutput( writer, &encoding.encoding, &output.output, NULL, 0, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + /* multiple calls are allowed */ + hr = WsSetOutput( writer, &encoding.encoding, &output.output, NULL, 0, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + /* writer properties can be set with WsSetOutput */ + max_depth = 16; + prop.id = WS_XML_WRITER_PROPERTY_MAX_DEPTH; + prop.value = &max_depth; + prop.valueSize = sizeof(max_depth); + hr = WsSetOutput( writer, &encoding.encoding, &output.output, &prop, 1, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + max_depth = 0xdeadbeef; + size = sizeof(max_depth); + hr = WsGetWriterProperty( writer, WS_XML_WRITER_PROPERTY_MAX_DEPTH, &max_depth, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( max_depth == 16, "got %u\n", max_depth ); + WsFreeWriter( writer ); +} + +static void test_WsSetOutputToBuffer(void) +{ + HRESULT hr; + WS_HEAP *heap; + WS_XML_BUFFER *buffer; + WS_XML_WRITER *writer; + WS_XML_WRITER_PROPERTY prop; + ULONG size, max_depth; + + hr = WsSetOutputToBuffer( NULL, NULL, NULL, 0, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = WsCreateWriter( NULL, 0, &writer, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsSetOutputToBuffer( writer, NULL, NULL, 0, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + hr = WsCreateHeap( 1 << 16, 0, NULL, 0, &heap, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsCreateXmlBuffer( heap, NULL, 0, &buffer, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsSetOutputToBuffer( writer, buffer, NULL, 0, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + /* multiple calls are allowed */ + hr = WsSetOutputToBuffer( writer, buffer, NULL, 0, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + /* writer properties can be set with WsSetOutputToBuffer */ + max_depth = 16; + prop.id = WS_XML_WRITER_PROPERTY_MAX_DEPTH; + prop.value = &max_depth; + prop.valueSize = sizeof(max_depth); + hr = WsSetOutputToBuffer( writer, buffer, &prop, 1, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + max_depth = 0xdeadbeef; + size = sizeof(max_depth); + hr = WsGetWriterProperty( writer, WS_XML_WRITER_PROPERTY_MAX_DEPTH, &max_depth, size, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( max_depth == 16, "got %u\n", max_depth ); + + WsFreeWriter( writer ); + WsFreeHeap( heap ); +} + +static void check_output( WS_XML_WRITER *writer, const char *expected, unsigned int line ) +{ + WS_BYTES bytes; + ULONG size = sizeof(bytes); + int len = strlen( expected ); + HRESULT hr; + + memset( &bytes, 0, sizeof(bytes) ); + hr = WsGetWriterProperty( writer, WS_XML_WRITER_PROPERTY_BYTES, &bytes, size, NULL ); + ok( hr == S_OK, "%u: got %08x\n", line, hr ); + ok( bytes.length == len, "%u: got %u expected %u\n", line, bytes.length, len ); + if (bytes.length != len) return; + ok( !memcmp( bytes.bytes, expected, len ), "%u: got %s expected %s\n", line, bytes.bytes, expected ); +} + +static void test_WsWriteStartElement(void) +{ + HRESULT hr; + WS_XML_WRITER *writer; + WS_XML_STRING prefix = {1, (BYTE *)"p"}, ns = {2, (BYTE *)"ns"}; + WS_XML_STRING localname = {1, (BYTE *)"a"}, localname2 = {1, (BYTE *)"b"}; + + hr = WsCreateWriter( NULL, 0, &writer, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + hr = set_output( writer ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteStartElement( NULL, &prefix, &localname, &ns, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + /* first call to WsWriteStartElement doesn't output anything */ + hr = WsWriteStartElement( writer, &prefix, &localname, &ns, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, "", __LINE__ ); + + /* two ways to close an element */ + hr = WsWriteEndStartElement( writer, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, "", __LINE__ ); + + hr = WsWriteEndElement( writer, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, "", __LINE__ ); + + hr = set_output( writer ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteStartElement( writer, &prefix, &localname, &ns, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteEndElement( writer, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, "", __LINE__ ); + + /* nested elements */ + hr = set_output( writer ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteStartElement( writer, NULL, &localname, &ns, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, "", __LINE__ ); + + hr = WsWriteStartElement( writer, NULL, &localname2, &ns, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, "", __LINE__ ); + + hr = WsWriteEndElement( writer, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, "", __LINE__ ); + + hr = WsWriteEndElement( writer, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, "", __LINE__ ); + + WsFreeWriter( writer ); +} + +static void test_WsWriteStartAttribute(void) +{ + HRESULT hr; + WS_XML_WRITER *writer; + WS_XML_STRING prefix = {1, (BYTE *)"p"}, localname = {3, (BYTE *)"str"}, ns = {2, (BYTE *)"ns"}; + WS_XML_UTF8_TEXT text; + + hr = WsCreateWriter( NULL, 0, &writer, NULL ) ; + ok( hr == S_OK, "got %08x\n", hr ); + + hr = set_output( writer ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteStartElement( writer, &prefix, &localname, &ns, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + + hr = WsWriteStartAttribute( NULL, &prefix, &localname, &ns, FALSE, NULL ); + ok( hr == E_INVALIDARG, "got %08x\n", hr ); + + /* WsWriteStartAttribute doesn't output anything */ + localname.length = 3; + localname.bytes = (BYTE *)"len"; + hr = WsWriteStartAttribute( writer, &prefix, &localname, &ns, FALSE, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, "", __LINE__ ); + + text.text.textType = WS_XML_TEXT_TYPE_UTF8; + text.value.length = 1; + text.value.bytes = (BYTE *)"0"; + hr = WsWriteText( writer, &text.text, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, "", __LINE__ ); + + /* WsWriteEndAttribute doesn't output anything */ + hr = WsWriteEndAttribute( writer, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, "", __LINE__ ); + + hr = WsWriteEndElement( writer, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + check_output( writer, "", __LINE__ ); + + WsFreeWriter( writer ); +} + +START_TEST(writer) +{ + test_WsCreateWriter(); + test_WsCreateXmlBuffer(); + test_WsSetOutput(); + test_WsSetOutputToBuffer(); + test_WsWriteStartElement(); + test_WsWriteStartAttribute(); +} diff -Nru wine1.7-1.7.50/dlls/webservices/webservices_private.h wine1.7-1.7.55/dlls/webservices/webservices_private.h --- wine1.7-1.7.50/dlls/webservices/webservices_private.h 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/webservices/webservices_private.h 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,66 @@ +/* + * Copyright 2015 Hans Leidekker for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * 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 + */ + +struct xmlbuf +{ + WS_HEAP *heap; + void *ptr; + SIZE_T size_allocated; + SIZE_T size; +}; + +void *ws_alloc( WS_HEAP *, SIZE_T ) DECLSPEC_HIDDEN; +void *ws_realloc( WS_HEAP *, void *, SIZE_T ) DECLSPEC_HIDDEN; +void ws_free( WS_HEAP *, void * ) DECLSPEC_HIDDEN; +const char *debugstr_xmlstr( const WS_XML_STRING * ) DECLSPEC_HIDDEN; +WS_XML_STRING *alloc_xml_string( const char *, ULONG ) DECLSPEC_HIDDEN; +WS_XML_UTF8_TEXT *alloc_utf8_text( const char *, ULONG ) DECLSPEC_HIDDEN; +HRESULT append_attribute( WS_XML_ELEMENT_NODE *, WS_XML_ATTRIBUTE * ) DECLSPEC_HIDDEN; +void free_attribute( WS_XML_ATTRIBUTE * ) DECLSPEC_HIDDEN; + +struct node +{ + WS_XML_ELEMENT_NODE hdr; + struct list entry; + struct node *parent; + struct list children; +}; + +struct node *alloc_node( WS_XML_NODE_TYPE ) DECLSPEC_HIDDEN; +void free_node( struct node * ) DECLSPEC_HIDDEN; +void destroy_nodes( struct node * ) DECLSPEC_HIDDEN; + +static inline void *heap_alloc( SIZE_T size ) +{ + return HeapAlloc( GetProcessHeap(), 0, size ); +} + +static inline void *heap_alloc_zero( SIZE_T size ) +{ + return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, size ); +} + +static inline void *heap_realloc( void *mem, SIZE_T size ) +{ + return HeapReAlloc( GetProcessHeap(), 0, mem, size ); +} + +static inline BOOL heap_free( void *mem ) +{ + return HeapFree( GetProcessHeap(), 0, mem ); +} diff -Nru wine1.7-1.7.50/dlls/webservices/webservices.spec wine1.7-1.7.55/dlls/webservices/webservices.spec --- wine1.7-1.7.50/dlls/webservices/webservices.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/webservices/webservices.spec 2015-11-13 14:32:40.000000000 +0000 @@ -9,7 +9,7 @@ @ stub WsAddErrorString @ stub WsAddMappedHeader @ stub WsAddressMessage -@ stub WsAlloc +@ stdcall WsAlloc(ptr long ptr ptr) @ stub WsAsyncExecute @ stub WsCall @ stub WsCheckMustUnderstandHeaders @@ -24,18 +24,18 @@ @ stub WsCreateChannelForListener @ stdcall WsCreateError(ptr long ptr) @ stub WsCreateFaultFromError -@ stub WsCreateHeap +@ stdcall WsCreateHeap(long long ptr long ptr ptr) @ stub WsCreateListener @ stub WsCreateMessage @ stub WsCreateMessageForChannel @ stub WsCreateMetadata -@ stub WsCreateReader +@ stdcall WsCreateReader(ptr long ptr ptr) @ stub WsCreateServiceEndpointFromTemplate @ stub WsCreateServiceHost @ stub WsCreateServiceProxy @ stub WsCreateServiceProxyFromTemplate -@ stub WsCreateWriter -@ stub WsCreateXmlBuffer +@ stdcall WsCreateWriter(ptr long ptr ptr) +@ stdcall WsCreateXmlBuffer(ptr ptr long ptr ptr) @ stub WsCreateXmlSecurityToken @ stub WsDateTimeToFileTime @ stub WsDecodeUrl @@ -44,31 +44,31 @@ @ stub WsEndWriterCanonicalization @ stub WsFileTimeToDateTime @ stub WsFillBody -@ stub WsFillReader +@ stdcall WsFillReader(ptr long ptr ptr) @ stub WsFindAttribute @ stub WsFlushBody @ stub WsFlushWriter @ stub WsFreeChannel -@ stub WsFreeError -@ stub WsFreeHeap +@ stdcall WsFreeError(ptr) +@ stdcall WsFreeHeap(ptr) @ stub WsFreeListener @ stub WsFreeMessage @ stub WsFreeMetadata -@ stub WsFreeReader +@ stdcall WsFreeReader(ptr) @ stub WsFreeSecurityToken @ stub WsFreeServiceHost @ stub WsFreeServiceProxy -@ stub WsFreeWriter +@ stdcall WsFreeWriter(ptr) @ stub WsGetChannelProperty @ stub WsGetCustomHeader @ stub WsGetDictionary -@ stub WsGetErrorProperty -@ stub WsGetErrorString +@ stdcall WsGetErrorProperty(ptr long ptr long) +@ stdcall WsGetErrorString(ptr long ptr) @ stub WsGetFaultErrorDetail @ stub WsGetFaultErrorProperty @ stub WsGetHeader @ stub WsGetHeaderAttributes -@ stub WsGetHeapProperty +@ stdcall WsGetHeapProperty(ptr long ptr long ptr) @ stub WsGetListenerProperty @ stub WsGetMappedHeader @ stub WsGetMessageProperty @@ -80,20 +80,20 @@ @ stub WsGetPolicyAlternativeCount @ stub WsGetPolicyProperty @ stub WsGetPrefixFromNamespace -@ stub WsGetReaderNode +@ stdcall WsGetReaderNode(ptr ptr ptr) @ stub WsGetReaderPosition -@ stub WsGetReaderProperty +@ stdcall WsGetReaderProperty(ptr long ptr long ptr) @ stub WsGetSecurityContextProperty @ stub WsGetSecurityTokenProperty @ stub WsGetServiceHostProperty @ stub WsGetServiceProxyProperty @ stub WsGetWriterPosition -@ stub WsGetWriterProperty -@ stub WsGetXmlAttribute +@ stdcall WsGetWriterProperty(ptr long ptr long ptr) +@ stdcall WsGetXmlAttribute(ptr ptr ptr ptr ptr ptr) @ stub WsInitializeMessage @ stub WsMarkHeaderAsUnderstood @ stub WsMatchPolicyAlternative -@ stub WsMoveReader +@ stdcall WsMoveReader(ptr long ptr ptr) @ stub WsMoveWriter @ stub WsOpenChannel @ stub WsOpenListener @@ -109,19 +109,19 @@ @ stub WsReadCharsUtf8 @ stub WsReadElement @ stub WsReadEndAttribute -@ stub WsReadEndElement +@ stdcall WsReadEndElement(ptr ptr) @ stub WsReadEndpointAddressExtension @ stub WsReadEnvelopeEnd @ stub WsReadEnvelopeStart @ stub WsReadMessageEnd @ stub WsReadMessageStart @ stub WsReadMetadata -@ stub WsReadNode +@ stdcall WsReadNode(ptr ptr) @ stub WsReadQualifiedName @ stub WsReadStartAttribute -@ stub WsReadStartElement -@ stub WsReadToStartElement -@ stub WsReadType +@ stdcall WsReadStartElement(ptr ptr) +@ stdcall WsReadToStartElement(ptr ptr ptr ptr ptr) +@ stdcall WsReadType(ptr long long ptr long ptr ptr long ptr) @ stub WsReadValue @ stub WsReadXmlBuffer @ stub WsReadXmlBufferFromBytes @@ -146,16 +146,16 @@ @ stub WsSendMessage @ stub WsSendReplyMessage @ stub WsSetChannelProperty -@ stub WsSetErrorProperty +@ stdcall WsSetErrorProperty(ptr long ptr long) @ stub WsSetFaultErrorDetail @ stub WsSetFaultErrorProperty @ stub WsSetHeader -@ stub WsSetInput -@ stub WsSetInputToBuffer +@ stdcall WsSetInput(ptr ptr ptr ptr long ptr) +@ stdcall WsSetInputToBuffer(ptr ptr ptr long ptr) @ stub WsSetListenerProperty @ stub WsSetMessageProperty -@ stub WsSetOutput -@ stub WsSetOutputToBuffer +@ stdcall WsSetOutput(ptr ptr ptr ptr long ptr) +@ stdcall WsSetOutputToBuffer(ptr ptr ptr long ptr) @ stub WsSetReaderPosition @ stub WsSetWriterPosition @ stub WsShutdownSessionChannel @@ -171,23 +171,23 @@ @ stub WsWriteChars @ stub WsWriteCharsUtf8 @ stub WsWriteElement -@ stub WsWriteEndAttribute +@ stdcall WsWriteEndAttribute(ptr ptr) @ stub WsWriteEndCData -@ stub WsWriteEndElement -@ stub WsWriteEndStartElement +@ stdcall WsWriteEndElement(ptr ptr) +@ stdcall WsWriteEndStartElement(ptr ptr) @ stub WsWriteEnvelopeEnd @ stub WsWriteEnvelopeStart @ stub WsWriteMessageEnd @ stub WsWriteMessageStart @ stub WsWriteNode @ stub WsWriteQualifiedName -@ stub WsWriteStartAttribute +@ stdcall WsWriteStartAttribute(ptr ptr ptr ptr long ptr) @ stub WsWriteStartCData -@ stub WsWriteStartElement -@ stub WsWriteText +@ stdcall WsWriteStartElement(ptr ptr ptr ptr ptr) +@ stdcall WsWriteText(ptr ptr ptr) @ stub WsWriteType @ stub WsWriteValue @ stub WsWriteXmlBuffer @ stub WsWriteXmlBufferToBytes @ stub WsWriteXmlnsAttribute -@ stub WsXmlStringEquals +@ stdcall WsXmlStringEquals(ptr ptr ptr) diff -Nru wine1.7-1.7.50/dlls/webservices/writer.c wine1.7-1.7.55/dlls/webservices/writer.c --- wine1.7-1.7.50/dlls/webservices/writer.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/webservices/writer.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,772 @@ +/* + * Copyright 2015 Hans Leidekker for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * 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 "webservices.h" + +#include "wine/debug.h" +#include "wine/list.h" +#include "webservices_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(webservices); + +static const struct +{ + ULONG size; + BOOL readonly; +} +writer_props[] = +{ + { sizeof(ULONG), FALSE }, /* WS_XML_WRITER_PROPERTY_MAX_DEPTH */ + { sizeof(BOOL), FALSE }, /* WS_XML_WRITER_PROPERTY_ALLOW_FRAGMENT */ + { sizeof(ULONG), FALSE }, /* WS_XML_READER_PROPERTY_MAX_ATTRIBUTES */ + { sizeof(BOOL), FALSE }, /* WS_XML_WRITER_PROPERTY_WRITE_DECLARATION */ + { sizeof(ULONG), FALSE }, /* WS_XML_WRITER_PROPERTY_INDENT */ + { sizeof(ULONG), FALSE }, /* WS_XML_WRITER_PROPERTY_BUFFER_TRIM_SIZE */ + { sizeof(WS_CHARSET), FALSE }, /* WS_XML_WRITER_PROPERTY_CHARSET */ + { sizeof(WS_BUFFERS), FALSE }, /* WS_XML_WRITER_PROPERTY_BUFFERS */ + { sizeof(ULONG), FALSE }, /* WS_XML_WRITER_PROPERTY_BUFFER_MAX_SIZE */ + { sizeof(WS_BYTES), FALSE }, /* WS_XML_WRITER_PROPERTY_BYTES */ + { sizeof(BOOL), TRUE }, /* WS_XML_WRITER_PROPERTY_IN_ATTRIBUTE */ + { sizeof(ULONG), FALSE }, /* WS_XML_WRITER_PROPERTY_MAX_MIME_PARTS_BUFFER_SIZE */ + { sizeof(WS_BYTES), FALSE }, /* WS_XML_WRITER_PROPERTY_INITIAL_BUFFER */ + { sizeof(BOOL), FALSE }, /* WS_XML_WRITER_PROPERTY_ALLOW_INVALID_CHARACTER_REFERENCES */ + { sizeof(ULONG), FALSE }, /* WS_XML_WRITER_PROPERTY_MAX_NAMESPACES */ + { sizeof(ULONG), TRUE }, /* WS_XML_WRITER_PROPERTY_BYTES_WRITTEN */ + { sizeof(ULONG), TRUE }, /* WS_XML_WRITER_PROPERTY_BYTES_TO_CLOSE */ + { sizeof(BOOL), FALSE }, /* WS_XML_WRITER_PROPERTY_COMPRESS_EMPTY_ELEMENTS */ + { sizeof(BOOL), FALSE } /* WS_XML_WRITER_PROPERTY_EMIT_UNCOMPRESSED_EMPTY_ELEMENTS */ +}; + +enum writer_state +{ + WRITER_STATE_INITIAL, + WRITER_STATE_STARTELEMENT, + WRITER_STATE_STARTENDELEMENT, + WRITER_STATE_STARTATTRIBUTE, + WRITER_STATE_ENDSTARTELEMENT, + WRITER_STATE_ENDELEMENT +}; + +struct writer +{ + ULONG write_pos; + char *write_bufptr; + enum writer_state state; + struct node *root; + struct node *current; + WS_XML_STRING *current_ns; + WS_XML_WRITER_OUTPUT_TYPE output_type; + struct xmlbuf *output_buf; + WS_HEAP *output_heap; + ULONG prop_count; + WS_XML_WRITER_PROPERTY prop[sizeof(writer_props)/sizeof(writer_props[0])]; +}; + +static struct writer *alloc_writer(void) +{ + static const ULONG count = sizeof(writer_props)/sizeof(writer_props[0]); + struct writer *ret; + ULONG i, size = sizeof(*ret) + count * sizeof(WS_XML_WRITER_PROPERTY); + char *ptr; + + for (i = 0; i < count; i++) size += writer_props[i].size; + if (!(ret = heap_alloc_zero( size ))) return NULL; + + ptr = (char *)&ret->prop[count]; + for (i = 0; i < count; i++) + { + ret->prop[i].value = ptr; + ret->prop[i].valueSize = writer_props[i].size; + ptr += ret->prop[i].valueSize; + } + ret->prop_count = count; + return ret; +} + +static HRESULT set_writer_prop( struct writer *writer, WS_XML_WRITER_PROPERTY_ID id, const void *value, + ULONG size ) +{ + if (id >= writer->prop_count || size != writer_props[id].size || writer_props[id].readonly) + return E_INVALIDARG; + + memcpy( writer->prop[id].value, value, size ); + return S_OK; +} + +static HRESULT get_writer_prop( struct writer *writer, WS_XML_WRITER_PROPERTY_ID id, void *buf, ULONG size ) +{ + if (id >= writer->prop_count || size != writer_props[id].size) + return E_INVALIDARG; + + memcpy( buf, writer->prop[id].value, writer->prop[id].valueSize ); + return S_OK; +} + +static void free_writer( struct writer *writer ) +{ + destroy_nodes( writer->root ); + heap_free( writer->current_ns ); + WsFreeHeap( writer->output_heap ); + heap_free( writer ); +} + +static void write_insert_eof( struct writer *writer, struct node *eof ) +{ + if (!writer->root) writer->root = eof; + else + { + eof->parent = writer->root; + list_add_tail( &writer->root->children, &eof->entry ); + } + writer->current = eof; +} + +static void write_insert_bof( struct writer *writer, struct node *bof ) +{ + writer->root->parent = bof; + list_add_tail( &bof->children, &writer->root->entry ); + writer->current = writer->root = bof; +} + +static void write_insert_node( struct writer *writer, struct node *node ) +{ + node->parent = writer->current; + if (writer->current == writer->root) + { + struct list *eof = list_tail( &writer->root->children ); + list_add_before( eof, &node->entry ); + } + else list_add_tail( &writer->current->children, &node->entry ); + writer->current = node; +} + +static HRESULT write_init_state( struct writer *writer ) +{ + struct node *node; + + heap_free( writer->current_ns ); + writer->current_ns = NULL; + destroy_nodes( writer->root ); + writer->root = NULL; + + if (!(node = alloc_node( WS_XML_NODE_TYPE_EOF ))) return E_OUTOFMEMORY; + write_insert_eof( writer, node ); + writer->state = WRITER_STATE_INITIAL; + return S_OK; +} + +/************************************************************************** + * WsCreateWriter [webservices.@] + */ +HRESULT WINAPI WsCreateWriter( const WS_XML_WRITER_PROPERTY *properties, ULONG count, + WS_XML_WRITER **handle, WS_ERROR *error ) +{ + struct writer *writer; + ULONG i, max_depth = 32, max_attrs = 128, trim_size = 4096, max_size = 65536, max_ns = 32; + WS_CHARSET charset = WS_CHARSET_UTF8; + HRESULT hr; + + TRACE( "%p %u %p %p\n", properties, count, handle, error ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!handle) return E_INVALIDARG; + if (!(writer = alloc_writer())) return E_OUTOFMEMORY; + + set_writer_prop( writer, WS_XML_WRITER_PROPERTY_MAX_DEPTH, &max_depth, sizeof(max_depth) ); + set_writer_prop( writer, WS_XML_WRITER_PROPERTY_MAX_ATTRIBUTES, &max_attrs, sizeof(max_attrs) ); + set_writer_prop( writer, WS_XML_WRITER_PROPERTY_BUFFER_TRIM_SIZE, &trim_size, sizeof(trim_size) ); + set_writer_prop( writer, WS_XML_WRITER_PROPERTY_CHARSET, &charset, sizeof(charset) ); + set_writer_prop( writer, WS_XML_WRITER_PROPERTY_BUFFER_MAX_SIZE, &max_size, sizeof(max_size) ); + set_writer_prop( writer, WS_XML_WRITER_PROPERTY_MAX_MIME_PARTS_BUFFER_SIZE, &max_size, sizeof(max_size) ); + set_writer_prop( writer, WS_XML_WRITER_PROPERTY_MAX_NAMESPACES, &max_ns, sizeof(max_ns) ); + + for (i = 0; i < count; i++) + { + hr = set_writer_prop( writer, properties[i].id, properties[i].value, properties[i].valueSize ); + if (hr != S_OK) + { + free_writer( writer ); + return hr; + } + } + + hr = get_writer_prop( writer, WS_XML_WRITER_PROPERTY_BUFFER_MAX_SIZE, &max_size, sizeof(max_size) ); + if (hr != S_OK) + { + free_writer( writer ); + return hr; + } + + hr = WsCreateHeap( max_size, 0, NULL, 0, &writer->output_heap, NULL ); + if (hr != S_OK) + { + free_writer( writer ); + return hr; + } + + hr = write_init_state( writer ); + if (hr != S_OK) + { + free_writer( writer ); + return hr; + } + + *handle = (WS_XML_WRITER *)writer; + return S_OK; +} + +/************************************************************************** + * WsFreeWriter [webservices.@] + */ +void WINAPI WsFreeWriter( WS_XML_WRITER *handle ) +{ + struct writer *writer = (struct writer *)handle; + + TRACE( "%p\n", handle ); + free_writer( writer ); +} + +#define XML_BUFFER_INITIAL_ALLOCATED_SIZE 256 +static struct xmlbuf *alloc_xmlbuf( WS_HEAP *heap ) +{ + struct xmlbuf *ret; + + if (!(ret = ws_alloc( heap, sizeof(*ret) ))) return NULL; + if (!(ret->ptr = ws_alloc( heap, XML_BUFFER_INITIAL_ALLOCATED_SIZE ))) + { + ws_free( heap, ret ); + return NULL; + } + ret->heap = heap; + ret->size_allocated = XML_BUFFER_INITIAL_ALLOCATED_SIZE; + ret->size = 0; + return ret; +} + +static void free_xmlbuf( struct xmlbuf *xmlbuf ) +{ + if (!xmlbuf) return; + ws_free( xmlbuf->heap, xmlbuf->ptr ); + ws_free( xmlbuf->heap, xmlbuf ); +} + +/************************************************************************** + * WsCreateXmlBuffer [webservices.@] + */ +HRESULT WINAPI WsCreateXmlBuffer( WS_HEAP *heap, const WS_XML_BUFFER_PROPERTY *properties, + ULONG count, WS_XML_BUFFER **handle, WS_ERROR *error ) +{ + struct xmlbuf *xmlbuf; + + if (!heap || !handle) return E_INVALIDARG; + if (count) FIXME( "properties not implemented\n" ); + + if (!(xmlbuf = alloc_xmlbuf( heap ))) return E_OUTOFMEMORY; + + *handle = (WS_XML_BUFFER *)xmlbuf; + return S_OK; +} + +/************************************************************************** + * WsGetWriterProperty [webservices.@] + */ +HRESULT WINAPI WsGetWriterProperty( WS_XML_WRITER *handle, WS_XML_WRITER_PROPERTY_ID id, + void *buf, ULONG size, WS_ERROR *error ) +{ + struct writer *writer = (struct writer *)handle; + + TRACE( "%p %u %p %u %p\n", handle, id, buf, size, error ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!writer->output_type) return WS_E_INVALID_OPERATION; + + switch (id) + { + case WS_XML_WRITER_PROPERTY_BYTES: + { + WS_BYTES *bytes = buf; + if (size != sizeof(*bytes)) return E_INVALIDARG; + bytes->bytes = writer->output_buf->ptr; + bytes->length = writer->output_buf->size; + return S_OK; + } + default: + return get_writer_prop( writer, id, buf, size ); + } +} + +static void set_output_buffer( struct writer *writer, struct xmlbuf *xmlbuf ) +{ + /* free current buffer if it's ours */ + if (writer->output_buf && writer->output_buf->heap == writer->output_heap) + { + free_xmlbuf( writer->output_buf ); + } + writer->output_buf = xmlbuf; + writer->output_type = WS_XML_WRITER_OUTPUT_TYPE_BUFFER; + writer->write_bufptr = xmlbuf->ptr; + writer->write_pos = 0; +} + +/************************************************************************** + * WsSetOutput [webservices.@] + */ +HRESULT WINAPI WsSetOutput( WS_XML_WRITER *handle, const WS_XML_WRITER_ENCODING *encoding, + const WS_XML_WRITER_OUTPUT *output, const WS_XML_WRITER_PROPERTY *properties, + ULONG count, WS_ERROR *error ) +{ + struct writer *writer = (struct writer *)handle; + struct node *node; + HRESULT hr; + ULONG i; + + TRACE( "%p %p %p %p %u %p\n", handle, encoding, output, properties, count, error ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!writer) return E_INVALIDARG; + + for (i = 0; i < count; i++) + { + hr = set_writer_prop( writer, properties[i].id, properties[i].value, properties[i].valueSize ); + if (hr != S_OK) return hr; + } + + if ((hr = write_init_state( writer )) != S_OK) return hr; + + switch (encoding->encodingType) + { + case WS_XML_WRITER_ENCODING_TYPE_TEXT: + { + WS_XML_WRITER_TEXT_ENCODING *text = (WS_XML_WRITER_TEXT_ENCODING *)encoding; + if (text->charSet != WS_CHARSET_UTF8) + { + FIXME( "charset %u not supported\n", text->charSet ); + return E_NOTIMPL; + } + break; + } + default: + FIXME( "encoding type %u not supported\n", encoding->encodingType ); + return E_NOTIMPL; + } + switch (output->outputType) + { + case WS_XML_WRITER_OUTPUT_TYPE_BUFFER: + { + struct xmlbuf *xmlbuf; + + if (!(xmlbuf = alloc_xmlbuf( writer->output_heap ))) return E_OUTOFMEMORY; + set_output_buffer( writer, xmlbuf ); + break; + } + default: + FIXME( "output type %u not supported\n", output->outputType ); + return E_NOTIMPL; + } + + if (!(node = alloc_node( WS_XML_NODE_TYPE_BOF ))) return E_OUTOFMEMORY; + write_insert_bof( writer, node ); + return S_OK; +} + +/************************************************************************** + * WsSetOutputToBuffer [webservices.@] + */ +HRESULT WINAPI WsSetOutputToBuffer( WS_XML_WRITER *handle, WS_XML_BUFFER *buffer, + const WS_XML_WRITER_PROPERTY *properties, ULONG count, + WS_ERROR *error ) +{ + struct writer *writer = (struct writer *)handle; + struct xmlbuf *xmlbuf = (struct xmlbuf *)buffer; + struct node *node; + HRESULT hr; + ULONG i; + + TRACE( "%p %p %p %u %p\n", handle, buffer, properties, count, error ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!writer || !xmlbuf) return E_INVALIDARG; + + for (i = 0; i < count; i++) + { + hr = set_writer_prop( writer, properties[i].id, properties[i].value, properties[i].valueSize ); + if (hr != S_OK) return hr; + } + + if ((hr = write_init_state( writer )) != S_OK) return hr; + set_output_buffer( writer, xmlbuf ); + + if (!(node = alloc_node( WS_XML_NODE_TYPE_BOF ))) return E_OUTOFMEMORY; + write_insert_bof( writer, node ); + return S_OK; +} + +static HRESULT write_grow_buffer( struct writer *writer, ULONG size ) +{ + struct xmlbuf *buf = writer->output_buf; + SIZE_T new_size; + void *tmp; + + if (buf->size_allocated >= writer->write_pos + size) + { + buf->size = writer->write_pos + size; + return S_OK; + } + new_size = max( buf->size_allocated * 2, writer->write_pos + size ); + if (!(tmp = ws_realloc( buf->heap, buf->ptr, new_size ))) return E_OUTOFMEMORY; + writer->write_bufptr = buf->ptr = tmp; + buf->size_allocated = new_size; + buf->size = writer->write_pos + size; + return S_OK; +} + +static inline void write_char( struct writer *writer, char ch ) +{ + writer->write_bufptr[writer->write_pos++] = ch; +} + +static inline void write_bytes( struct writer *writer, const BYTE *bytes, ULONG len ) +{ + memcpy( writer->write_bufptr + writer->write_pos, bytes, len ); + writer->write_pos += len; +} + +static HRESULT write_attribute( struct writer *writer, WS_XML_ATTRIBUTE *attr ) +{ + WS_XML_UTF8_TEXT *text = (WS_XML_UTF8_TEXT *)attr->value; + ULONG size; + HRESULT hr; + + /* ' prefix:attr="value"' */ + + size = attr->localName->length + 4 /* ' =""' */; + if (attr->prefix) size += attr->prefix->length + 1 /* ':' */; + if (text) size += text->value.length; + if ((hr = write_grow_buffer( writer, size )) != S_OK) return hr; + + write_char( writer, ' ' ); + if (attr->prefix) + { + write_bytes( writer, attr->prefix->bytes, attr->prefix->length ); + write_char( writer, ':' ); + } + write_bytes( writer, attr->localName->bytes, attr->localName->length ); + write_char( writer, '=' ); + if (attr->singleQuote) write_char( writer, '\'' ); + else write_char( writer, '"' ); + if (text) write_bytes( writer, text->value.bytes, text->value.length ); + if (attr->singleQuote) write_char( writer, '\'' ); + else write_char( writer, '"' ); + + /* FIXME: ignoring namespace */ + return S_OK; +} + +static inline BOOL is_current_namespace( struct writer *writer, const WS_XML_STRING *ns ) +{ + return (WsXmlStringEquals( writer->current_ns, ns, NULL ) == S_OK); +} + +static HRESULT set_current_namespace( struct writer *writer, const WS_XML_STRING *ns ) +{ + WS_XML_STRING *str; + if (!(str = alloc_xml_string( (const char *)ns->bytes, ns->length ))) return E_OUTOFMEMORY; + heap_free( writer->current_ns ); + writer->current_ns = str; + return S_OK; +} + +static HRESULT write_startelement( struct writer *writer ) +{ + WS_XML_ELEMENT_NODE *elem = (WS_XML_ELEMENT_NODE *)writer->current; + ULONG size, i; + HRESULT hr; + + /* 'localName->length + 1 /* '<' */; + if (elem->prefix) size += elem->prefix->length + 1 /* ':' */; + if (elem->ns->length && !is_current_namespace( writer, elem->ns )) + { + size += strlen(" xmlns") + elem->ns->length + 3 /* '=""' */; + if (elem->prefix) size += elem->prefix->length + 1 /* ':' */; + } + if ((hr = write_grow_buffer( writer, size )) != S_OK) return hr; + + write_char( writer, '<' ); + if (elem->prefix) + { + write_bytes( writer, elem->prefix->bytes, elem->prefix->length ); + write_char( writer, ':' ); + } + write_bytes( writer, elem->localName->bytes, elem->localName->length ); + for (i = 0; i < elem->attributeCount; i++) + { + if ((hr = write_attribute( writer, elem->attributes[i] )) != S_OK) return hr; + } + if (elem->ns->length && !is_current_namespace( writer, elem->ns )) + { + if ((hr = set_current_namespace( writer, elem->ns )) != S_OK) return hr; + + write_bytes( writer, (const BYTE *)" xmlns", 6 ); + if (elem->prefix) + { + write_char( writer, ':' ); + write_bytes( writer, elem->prefix->bytes, elem->prefix->length ); + } + write_char( writer, '=' ); + write_char( writer, '"' ); + write_bytes( writer, elem->ns->bytes, elem->ns->length ); + write_char( writer, '"' ); + } + return S_OK; +} + +static HRESULT write_endelement( struct writer *writer ) +{ + WS_XML_ELEMENT_NODE *elem = (WS_XML_ELEMENT_NODE *)writer->current; + ULONG size; + HRESULT hr; + + /* '' */ + + size = elem->localName->length + 3 /* '' */; + if (elem->prefix) size += elem->prefix->length + 1 /* ':' */; + if ((hr = write_grow_buffer( writer, size )) != S_OK) return hr; + + write_char( writer, '<' ); + write_char( writer, '/' ); + if (elem->prefix) + { + write_bytes( writer, elem->prefix->bytes, elem->prefix->length ); + write_char( writer, ':' ); + } + write_bytes( writer, elem->localName->bytes, elem->localName->length ); + write_char( writer, '>' ); + return S_OK; +} + +/************************************************************************** + * WsWriteEndAttribute [webservices.@] + */ +HRESULT WINAPI WsWriteEndAttribute( WS_XML_WRITER *handle, WS_ERROR *error ) +{ + struct writer *writer = (struct writer *)handle; + + TRACE( "%p %p\n", handle, error ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!writer) return E_INVALIDARG; + if (writer->state != WRITER_STATE_STARTATTRIBUTE) return WS_E_INVALID_OPERATION; + + writer->state = WRITER_STATE_STARTELEMENT; + return S_OK; +} + +/************************************************************************** + * WsWriteEndElement [webservices.@] + */ +HRESULT WINAPI WsWriteEndElement( WS_XML_WRITER *handle, WS_ERROR *error ) +{ + struct writer *writer = (struct writer *)handle; + HRESULT hr; + + TRACE( "%p %p\n", handle, error ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!writer) return E_INVALIDARG; + + if (writer->state == WRITER_STATE_STARTELEMENT) + { + /* '/>' */ + if ((hr = write_startelement( writer )) != S_OK) return hr; + if ((hr = write_grow_buffer( writer, 2 )) != S_OK) return hr; + write_char( writer, '/' ); + write_char( writer, '>' ); + + writer->current = writer->current->parent; + writer->state = WRITER_STATE_STARTENDELEMENT; + return S_OK; + } + else + { + struct node *node = alloc_node( WS_XML_NODE_TYPE_END_ELEMENT ); + if (!node) return E_OUTOFMEMORY; + + /* '' */ + if ((hr = write_endelement( writer )) != S_OK) + { + free_node( node ); + return hr; + } + + write_insert_node( writer, node ); + writer->current = node->parent; + writer->state = WRITER_STATE_ENDELEMENT; + return S_OK; + } + return WS_E_INVALID_OPERATION; +} + +/************************************************************************** + * WsWriteEndStartElement [webservices.@] + */ +HRESULT WINAPI WsWriteEndStartElement( WS_XML_WRITER *handle, WS_ERROR *error ) +{ + struct writer *writer = (struct writer *)handle; + HRESULT hr; + + TRACE( "%p %p\n", handle, error ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!writer) return E_INVALIDARG; + if (writer->state != WRITER_STATE_STARTELEMENT) return WS_E_INVALID_OPERATION; + + if ((hr = write_startelement( writer )) != S_OK) return hr; + if ((hr = write_grow_buffer( writer, 1 )) != S_OK) return hr; + write_char( writer, '>' ); + + writer->state = WRITER_STATE_ENDSTARTELEMENT; + return S_OK; +} + +/************************************************************************** + * WsWriteStartAttribute [webservices.@] + */ +HRESULT WINAPI WsWriteStartAttribute( WS_XML_WRITER *handle, const WS_XML_STRING *prefix, + const WS_XML_STRING *localname, const WS_XML_STRING *ns, + BOOL single, WS_ERROR *error ) +{ + struct writer *writer = (struct writer *)handle; + WS_XML_ELEMENT_NODE *elem; + WS_XML_ATTRIBUTE *attr; + HRESULT hr = E_OUTOFMEMORY; + + TRACE( "%p %s %s %s %d %p\n", handle, debugstr_xmlstr(prefix), debugstr_xmlstr(localname), + debugstr_xmlstr(ns), single, error ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!writer || !localname || !ns) return E_INVALIDARG; + + if (writer->state != WRITER_STATE_STARTELEMENT) return WS_E_INVALID_OPERATION; + elem = (WS_XML_ELEMENT_NODE *)writer->current; + + if (!(attr = heap_alloc_zero( sizeof(*attr) ))) return E_OUTOFMEMORY; + attr->singleQuote = !!single; + + if (prefix && !(attr->prefix = alloc_xml_string( (const char *)prefix->bytes, prefix->length ))) + goto error; + + if (!(attr->localName = alloc_xml_string( (const char *)localname->bytes, localname->length ))) + goto error; + + if (!(attr->ns = alloc_xml_string( (const char *)ns->bytes, ns->length ))) + goto error; + + if ((hr = append_attribute( elem, attr )) != S_OK) goto error; + + writer->state = WRITER_STATE_STARTATTRIBUTE; + return S_OK; + +error: + free_attribute( attr ); + return hr; +} + +/************************************************************************** + * WsWriteStartElement [webservices.@] + */ +HRESULT WINAPI WsWriteStartElement( WS_XML_WRITER *handle, const WS_XML_STRING *prefix, + const WS_XML_STRING *localname, const WS_XML_STRING *ns, + WS_ERROR *error ) +{ + struct writer *writer = (struct writer *)handle; + struct node *node; + WS_XML_ELEMENT_NODE *elem; + HRESULT hr = E_OUTOFMEMORY; + + TRACE( "%p %s %s %s %p\n", handle, debugstr_xmlstr(prefix), debugstr_xmlstr(localname), + debugstr_xmlstr(ns), error ); + if (error) FIXME( "ignoring error parameter\n" ); + + if (!writer || !localname || !ns) return E_INVALIDARG; + + /* flush current start element */ + if (writer->state == WRITER_STATE_STARTELEMENT) + { + if ((hr = write_startelement( writer )) != S_OK) return hr; + if ((hr = write_grow_buffer( writer, 1 )) != S_OK) return hr; + write_char( writer, '>' ); + } + + if (!(node = alloc_node( WS_XML_NODE_TYPE_ELEMENT ))) return E_OUTOFMEMORY; + elem = (WS_XML_ELEMENT_NODE *)node; + + if (prefix && !(elem->prefix = alloc_xml_string( (const char *)prefix->bytes, prefix->length ))) + goto error; + + if (!(elem->localName = alloc_xml_string( (const char *)localname->bytes, localname->length ))) + goto error; + + if (!(elem->ns = alloc_xml_string( (const char *)ns->bytes, ns->length ))) + goto error; + + write_insert_node( writer, node ); + writer->state = WRITER_STATE_STARTELEMENT; + return S_OK; + +error: + free_node( node ); + return hr; +} + +/************************************************************************** + * WsWriteText [webservices.@] + */ +HRESULT WINAPI WsWriteText( WS_XML_WRITER *handle, const WS_XML_TEXT *text, WS_ERROR *error ) +{ + struct writer *writer = (struct writer *)handle; + WS_XML_ELEMENT_NODE *elem; + WS_XML_UTF8_TEXT *src, *dst; + + TRACE( "%p %p %p\n", handle, text, error ); + + if (!writer || !text) return E_INVALIDARG; + + if (writer->state != WRITER_STATE_STARTATTRIBUTE) + { + FIXME( "can't handle writer state %u\n", writer->state ); + return E_NOTIMPL; + } + if (text->textType != WS_XML_TEXT_TYPE_UTF8) + { + FIXME( "text type %u not supported\n", text->textType ); + return E_NOTIMPL; + } + src = (WS_XML_UTF8_TEXT *)text; + if (!(dst = alloc_utf8_text( (const char *)src->value.bytes, src->value.length ))) + return E_OUTOFMEMORY; + + elem = (WS_XML_ELEMENT_NODE *)writer->current; + elem->attributes[elem->attributeCount - 1]->value = (WS_XML_TEXT *)dst; + return S_OK; +} diff -Nru wine1.7-1.7.50/dlls/wiaservc/tests/Makefile.in wine1.7-1.7.55/dlls/wiaservc/tests/Makefile.in --- wine1.7-1.7.50/dlls/wiaservc/tests/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/wiaservc/tests/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,5 @@ +TESTDLL = wiaservc.dll +IMPORTS = ole32 + +C_SRCS = \ + wia.c diff -Nru wine1.7-1.7.50/dlls/wiaservc/tests/wia.c wine1.7-1.7.55/dlls/wiaservc/tests/wia.c --- wine1.7-1.7.50/dlls/wiaservc/tests/wia.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/wiaservc/tests/wia.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,74 @@ +/* + * Unit test suite for WIA system + * + * Copyright 2015 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 + +#define COBJMACROS + +#include "objbase.h" +#include "initguid.h" +#include "wia_lh.h" + +#include "wine/test.h" + +static IWiaDevMgr *devmanager; + +static void test_EnumDeviceInfo(void) +{ + IEnumWIA_DEV_INFO *devenum; + HRESULT hr; + ULONG count; + + hr = IWiaDevMgr_EnumDeviceInfo(devmanager, WIA_DEVINFO_ENUM_LOCAL, NULL); + ok(FAILED(hr), "got 0x%08x\n", hr); + + hr = IWiaDevMgr_EnumDeviceInfo(devmanager, WIA_DEVINFO_ENUM_LOCAL, &devenum); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IEnumWIA_DEV_INFO_GetCount(devenum, NULL); + ok(FAILED(hr), "got 0x%08x\n", hr); + + count = 1000; + hr = IEnumWIA_DEV_INFO_GetCount(devenum, &count); +todo_wine + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(count != 1000, "got %u\n", count); + + IEnumWIA_DEV_INFO_Release(devenum); +} + +START_TEST(wia) +{ + HRESULT hr; + + CoInitialize(NULL); + + hr = CoCreateInstance(&CLSID_WiaDevMgr, NULL, CLSCTX_LOCAL_SERVER, &IID_IWiaDevMgr, (void**)&devmanager); + if (FAILED(hr)) { + win_skip("Failed to create WiaDevMgr instance, 0x%08x\n", hr); + CoUninitialize(); + return; + } + + test_EnumDeviceInfo(); + + IWiaDevMgr_Release(devmanager); + CoUninitialize(); +} diff -Nru wine1.7-1.7.50/dlls/wiaservc/wiadevmgr.c wine1.7-1.7.55/dlls/wiaservc/wiadevmgr.c --- wine1.7-1.7.50/dlls/wiaservc/wiadevmgr.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wiaservc/wiadevmgr.c 2015-11-13 14:32:40.000000000 +0000 @@ -29,11 +29,119 @@ WINE_DEFAULT_DEBUG_CHANNEL(wia); +typedef struct +{ + IEnumWIA_DEV_INFO IEnumWIA_DEV_INFO_iface; + LONG ref; +} enumwiadevinfo; + static inline wiadevmgr *impl_from_IWiaDevMgr(IWiaDevMgr *iface) { return CONTAINING_RECORD(iface, wiadevmgr, IWiaDevMgr_iface); } +static inline enumwiadevinfo *impl_from_IEnumWIA_DEV_INFO(IEnumWIA_DEV_INFO *iface) +{ + return CONTAINING_RECORD(iface, enumwiadevinfo, IEnumWIA_DEV_INFO_iface); +} + +static HRESULT WINAPI enumwiadevinfo_QueryInterface(IEnumWIA_DEV_INFO *iface, REFIID riid, void **obj) +{ + enumwiadevinfo *This = impl_from_IEnumWIA_DEV_INFO(iface); + + TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), obj); + + if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IEnumWIA_DEV_INFO)) + *obj = iface; + else + { + FIXME("interface %s not implemented\n", debugstr_guid(riid)); + *obj = NULL; + return E_NOINTERFACE; + } + IUnknown_AddRef((IUnknown*)*obj); + return S_OK; +} + +static ULONG WINAPI enumwiadevinfo_AddRef(IEnumWIA_DEV_INFO *iface) +{ + enumwiadevinfo *This = impl_from_IEnumWIA_DEV_INFO(iface); + ULONG ref = InterlockedIncrement(&This->ref); + TRACE("(%p)->(%u)\n", This, ref); + return ref; +} + +static ULONG WINAPI enumwiadevinfo_Release(IEnumWIA_DEV_INFO *iface) +{ + enumwiadevinfo *This = impl_from_IEnumWIA_DEV_INFO(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p)->(%u)\n", This, ref); + + if (ref == 0) + HeapFree(GetProcessHeap(), 0, This); + return ref; +} + +static HRESULT WINAPI enumwiadevinfo_Next(IEnumWIA_DEV_INFO *iface, ULONG count, IWiaPropertyStorage **elem, ULONG *fetched) +{ + enumwiadevinfo *This = impl_from_IEnumWIA_DEV_INFO(iface); + + FIXME("(%p, %d, %p, %p): stub\n", This, count, elem, fetched); + + *fetched = 0; + return E_NOTIMPL; +} + +static HRESULT WINAPI enumwiadevinfo_Skip(IEnumWIA_DEV_INFO *iface, ULONG count) +{ + enumwiadevinfo *This = impl_from_IEnumWIA_DEV_INFO(iface); + + FIXME("(%p, %u): stub\n", This, count); + + return E_NOTIMPL; +} + +static HRESULT WINAPI enumwiadevinfo_Reset(IEnumWIA_DEV_INFO *iface) +{ + enumwiadevinfo *This = impl_from_IEnumWIA_DEV_INFO(iface); + + FIXME("(%p): stub\n", This); + + return E_NOTIMPL; +} + +static HRESULT WINAPI enumwiadevinfo_Clone(IEnumWIA_DEV_INFO *iface, IEnumWIA_DEV_INFO **ret) +{ + enumwiadevinfo *This = impl_from_IEnumWIA_DEV_INFO(iface); + + FIXME("(%p, %p): stub\n", This, ret); + + return E_NOTIMPL; +} + +static HRESULT WINAPI enumwiadevinfo_GetCount(IEnumWIA_DEV_INFO *iface, ULONG *count) +{ + enumwiadevinfo *This = impl_from_IEnumWIA_DEV_INFO(iface); + + FIXME("(%p, %p): stub\n", This, count); + + *count = 0; + return E_NOTIMPL; +} + +static const IEnumWIA_DEV_INFOVtbl EnumWIA_DEV_INFOVtbl = +{ + enumwiadevinfo_QueryInterface, + enumwiadevinfo_AddRef, + enumwiadevinfo_Release, + enumwiadevinfo_Next, + enumwiadevinfo_Skip, + enumwiadevinfo_Reset, + enumwiadevinfo_Clone, + enumwiadevinfo_GetCount +}; + static HRESULT WINAPI wiadevmgr_QueryInterface(IWiaDevMgr *iface, REFIID riid, void **ppvObject) { wiadevmgr *This = impl_from_IWiaDevMgr(iface); @@ -69,11 +177,24 @@ return ref; } -static HRESULT WINAPI wiadevmgr_EnumDeviceInfo(IWiaDevMgr *iface, LONG lFlag, IEnumWIA_DEV_INFO **ppIEnum) +static HRESULT WINAPI wiadevmgr_EnumDeviceInfo(IWiaDevMgr *iface, LONG flag, IEnumWIA_DEV_INFO **ret) { wiadevmgr *This = impl_from_IWiaDevMgr(iface); - FIXME("(%p, %d, %p): stub\n", This, lFlag, ppIEnum); - return E_NOTIMPL; + enumwiadevinfo *enuminfo; + + TRACE("(%p)->(%x, %p)\n", This, flag, ret); + + *ret = NULL; + + enuminfo = HeapAlloc(GetProcessHeap(), 0, sizeof(*enuminfo)); + if (!enuminfo) + return E_OUTOFMEMORY; + + enuminfo->IEnumWIA_DEV_INFO_iface.lpVtbl = &EnumWIA_DEV_INFOVtbl; + enuminfo->ref = 1; + + *ret = &enuminfo->IEnumWIA_DEV_INFO_iface; + return S_OK; } static HRESULT WINAPI wiadevmgr_CreateDevice(IWiaDevMgr *iface, BSTR bstrDeviceID, IWiaItem **ppWiaItemRoot) diff -Nru wine1.7-1.7.50/dlls/wimgapi/main.c wine1.7-1.7.55/dlls/wimgapi/main.c --- wine1.7-1.7.50/dlls/wimgapi/main.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/wimgapi/main.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,52 @@ +/* + * + * wimgapi implementation + * + * Copyright 2015 Stefan Leichter + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" + +#include + +#include "windef.h" +#include "winbase.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wimgapi); + +BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) +{ + TRACE("(0x%p, %d, %p)\n", instance, reason, reserved); + + switch (reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(instance); + break; + } + + return TRUE; +} + +DWORD WINAPI WIMRegisterMessageCallback(HANDLE wim, FARPROC callback, PVOID data) +{ + FIXME("(%p %p %p) stub\n", wim, callback, data); + return 0; +} diff -Nru wine1.7-1.7.50/dlls/wimgapi/Makefile.in wine1.7-1.7.55/dlls/wimgapi/Makefile.in --- wine1.7-1.7.50/dlls/wimgapi/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/wimgapi/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,4 @@ +MODULE = wimgapi.dll + +C_SRCS = \ + main.c diff -Nru wine1.7-1.7.50/dlls/wimgapi/wimgapi.spec wine1.7-1.7.55/dlls/wimgapi/wimgapi.spec --- wine1.7-1.7.50/dlls/wimgapi/wimgapi.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/wimgapi/wimgapi.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,42 @@ +@ stub -private DllCanUnloadNow +@ stdcall -private DllMain(long long ptr) +@ stub WIMApplyImage +@ stub WIMCaptureImage +@ stub WIMCloseHandle +@ stub WIMCommitImageHandle +@ stub WIMCopyFile +@ stub WIMCreateFile +@ stub WIMCreateImageFile +@ stub WIMDeleteImage +@ stub WIMDeleteImageMounts +@ stub WIMEnumImageFiles +@ stub WIMExportImage +@ stub WIMExtractImagePath +@ stub WIMFindFirstImageFile +@ stub WIMFindNextImageFile +@ stub WIMGetAttributes +@ stub WIMGetImageCount +@ stub WIMGetImageInformation +@ stub WIMGetMessageCallbackCount +@ stub WIMGetMountedImageHandle +@ stub WIMGetMountedImageInfo +@ stub WIMGetMountedImageInfoFromFile +@ stub WIMGetMountedImages +@ stub WIMInitFileIOCallbacks +@ stub WIMLoadImage +@ stub WIMMountImage +@ stub WIMMountImageHandle +@ stub WIMReadImageFile +@ stub WIMRegisterLogFile +@ stdcall WIMRegisterMessageCallback(long ptr ptr) +@ stub WIMRemountImage +@ stub WIMSetBootImage +@ stub WIMSetFileIOCallbackTemporaryPath +@ stub WIMSetImageInformation +@ stub WIMSetReferenceFile +@ stub WIMSetTemporaryFile +@ stub WIMSplitFile +@ stub WIMUmountImage +@ stub WIMUmountImageHandle +@ stub WIMUnregisterLogFile +@ stub WIMUnregisterMessageCallback diff -Nru wine1.7-1.7.50/dlls/windowscodecs/tests/pngformat.c wine1.7-1.7.55/dlls/windowscodecs/tests/pngformat.c --- wine1.7-1.7.50/dlls/windowscodecs/tests/pngformat.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/windowscodecs/tests/pngformat.c 2015-11-13 14:32:40.000000000 +0000 @@ -295,6 +295,7 @@ hr = IWICImagingFactory_CreateDecoderFromStream(factory, stream, NULL, 0, &decoder); ok(hr == S_OK, "CreateDecoderFromStream error %#x\n", hr); + if (FAILED(hr)) return NULL; hr = IWICBitmapDecoder_GetContainerFormat(decoder, &format); ok(hr == S_OK, "GetContainerFormat error %#x\n", hr); @@ -342,6 +343,7 @@ decoder = create_decoder(png_no_color_profile, sizeof(png_no_color_profile)); ok(decoder != 0, "Failed to load PNG image data\n"); + if (!decoder) return; /* global color context */ hr = IWICBitmapDecoder_GetColorContexts(decoder, 0, NULL, NULL); @@ -369,6 +371,7 @@ decoder = create_decoder(png_color_profile, sizeof(png_color_profile)); ok(decoder != 0, "Failed to load PNG image data\n"); + if (!decoder) return; /* global color context */ count = 0xdeadbeef; @@ -546,6 +549,7 @@ decoder = create_decoder(png_PLTE_tRNS, sizeof(png_PLTE_tRNS)); ok(decoder != 0, "Failed to load PNG image data\n"); + if (!decoder) return; hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame); ok(hr == S_OK, "GetFrame error %#x\n", hr); diff -Nru wine1.7-1.7.50/dlls/windowscodecs/tests/tiffformat.c wine1.7-1.7.55/dlls/windowscodecs/tests/tiffformat.c --- wine1.7-1.7.50/dlls/windowscodecs/tests/tiffformat.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/windowscodecs/tests/tiffformat.c 2015-11-13 14:32:40.000000000 +0000 @@ -170,6 +170,7 @@ hr = IWICImagingFactory_CreateDecoderFromStream(factory, stream, NULL, 0, &decoder); ok(hr == S_OK, "CreateDecoderFromStream error %#x\n", hr); + if (FAILED(hr)) return NULL; hr = IWICBitmapDecoder_GetContainerFormat(decoder, &guid); ok(hr == S_OK, "GetContainerFormat error %#x\n", hr); @@ -190,6 +191,7 @@ decoder = create_decoder(&tiff_1bpp_data, sizeof(tiff_1bpp_data)); ok(decoder != 0, "Failed to load TIFF image data\n"); + if (!decoder) return; hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame); ok(hr == S_OK, "GetFrame error %#x\n", hr); @@ -231,6 +233,7 @@ hr = IWICImagingFactory_CreateDecoder(factory, &GUID_ContainerFormatTiff, NULL, &decoder); ok(hr == S_OK, "CreateDecoder error %#x\n", hr); + if (FAILED(hr)) return; frame_count = 0xdeadbeef; hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count); @@ -322,6 +325,7 @@ decoder = create_decoder(&tiff_8bpp_alpha, sizeof(tiff_8bpp_alpha)); ok(decoder != 0, "Failed to load TIFF image data\n"); + if (!decoder) return; hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count); ok(hr == S_OK, "GetFrameCount error %#x\n", hr); diff -Nru wine1.7-1.7.50/dlls/winecoreaudio.drv/midi.c wine1.7-1.7.55/dlls/winecoreaudio.drv/midi.c --- wine1.7-1.7.50/dlls/winecoreaudio.drv/midi.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winecoreaudio.drv/midi.c 2015-11-13 14:32:40.000000000 +0000 @@ -437,9 +437,8 @@ return MMSYSERR_ERROR; } } - else - { - FIXME("MOD_MIDIPORT\n"); + else if (destinations[wDevID].caps.wTechnology == MOD_MIDIPORT) { + MIDIOut_Send(MIDIOutPort, destinations[wDevID].dest, lpData, lpMidiHdr->dwBufferLength); } lpMidiHdr->dwFlags &= ~MHDR_INQUEUE; @@ -822,6 +821,7 @@ DWORD sendData = 0; int pos = 0; DWORD currentTime; + BOOL sysexStart; switch (msgid) { @@ -836,26 +836,55 @@ if (src->state < 1) { TRACE("input not started, thrown away\n"); - goto done; - } - /* FIXME skipping SysEx */ - if (msg->data[0] == 0xF0) - { - FIXME("Starting System Exclusive\n"); - src->state |= 2; + return NULL; } - if (src->state & 2) - { - for (i = 0; i < msg->length; ++i) - { - if (msg->data[i] == 0xF7) - { - FIXME("Ending System Exclusive\n"); - src->state &= ~2; + + sysexStart = (msg->data[0] == 0xF0); + + if (sysexStart || src->state & 2) { + int pos = 0; + int len = msg->length; + + if (sysexStart) { + TRACE("Receiving sysex message\n"); + src->state |= 2; + } + + EnterCriticalSection(&midiInLock); + currentTime = GetTickCount() - src->startTime; + + while (len) { + LPMIDIHDR lpMidiHdr = src->lpQueueHdr; + + if (lpMidiHdr != NULL) { + int copylen = min(len, lpMidiHdr->dwBufferLength - lpMidiHdr->dwBytesRecorded); + memcpy(lpMidiHdr->lpData + lpMidiHdr->dwBytesRecorded, msg->data + pos, copylen); + lpMidiHdr->dwBytesRecorded += copylen; + len -= copylen; + pos += copylen; + + TRACE("Copied %d bytes of sysex message\n", copylen); + + if ((lpMidiHdr->dwBytesRecorded == lpMidiHdr->dwBufferLength) || + (*(BYTE*)(lpMidiHdr->lpData + lpMidiHdr->dwBytesRecorded - 1) == 0xF7)) { + TRACE("Sysex message complete (or buffer limit reached), dispatching %d bytes\n", lpMidiHdr->dwBytesRecorded); + src->lpQueueHdr = lpMidiHdr->lpNext; + lpMidiHdr->dwFlags &= ~MHDR_INQUEUE; + lpMidiHdr->dwFlags |= MHDR_DONE; + MIDI_NotifyClient(msg->devID, MIM_LONGDATA, (DWORD_PTR)lpMidiHdr, currentTime); + src->state &= ~2; + } + } + else { + FIXME("Sysex data received but no buffer to store it!\n"); + break; } } - goto done; + + LeaveCriticalSection(&midiInLock); + return NULL; } + EnterCriticalSection(&midiInLock); currentTime = GetTickCount() - src->startTime; @@ -889,7 +918,6 @@ CFRunLoopStop(CFRunLoopGetCurrent()); break; } -done: return NULL; } diff -Nru wine1.7-1.7.50/dlls/wined3d/arb_program_shader.c wine1.7-1.7.55/dlls/wined3d/arb_program_shader.c --- wine1.7-1.7.50/dlls/wined3d/arb_program_shader.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/arb_program_shader.c 2015-11-13 14:32:40.000000000 +0000 @@ -805,7 +805,8 @@ { DWORD idx = i >> 5; DWORD shift = i & 0x1f; - if(reg_maps->constf[idx] & (1 << shift)) highest_constf = i; + if (reg_maps->constf[idx] & (1u << shift)) + highest_constf = i; } if(use_nv_clip(gl_info) && ctx->target_version >= NV2) @@ -890,11 +891,14 @@ /* Need to PARAM the environment parameters (constants) so we can use relative addressing */ shader_addline(buffer, "PARAM C[%d] = { program.env[0..%d] };\n", max_constantsF, max_constantsF - 1); - } else { - for(i = 0; i < max_constantsF; i++) { + } + else + { + for (i = 0; i < max_constantsF; ++i) + { DWORD idx, mask; idx = i >> 5; - mask = 1 << (i & 0x1f); + mask = 1u << (i & 0x1fu); if (!shader_constant_is_local(shader, i) && (reg_maps->constf[idx] & mask)) { shader_addline(buffer, "PARAM C%d = program.env[%d];\n",i, i); @@ -1087,7 +1091,7 @@ } else { - if (ctx->cur_vs_args->super.swizzle_map & (1 << reg->idx[0].offset)) + if (ctx->cur_vs_args->super.swizzle_map & (1u << reg->idx[0].offset)) *is_color = TRUE; sprintf(register_name, "vertex.attrib[%u]", reg->idx[0].offset); } @@ -1426,14 +1430,14 @@ device = shader->device; gl_info = &device->adapter->gl_info; - if (pshader && priv->cur_ps_args->super.np2_fixup & (1 << sampler_idx) + if (pshader && priv->cur_ps_args->super.np2_fixup & (1u << sampler_idx) && gl_info->supported[ARB_TEXTURE_RECTANGLE]) tex_type = "RECT"; else tex_type = "2D"; if (shader_is_pshader_version(ins->ctx->reg_maps->shader_version.type)) { - if (priv->cur_np2fixup_info->super.active & (1 << sampler_idx)) + if (priv->cur_np2fixup_info->super.active & (1u << sampler_idx)) { if (flags) FIXME("Only ordinary sampling from NP2 textures is supported.\n"); else np2_fixup = TRUE; @@ -3220,7 +3224,7 @@ for (i = 0; i < gl_info->limits.clipplanes; ++i) { - if (args->clip.boolclip.clipplane_mask & (1 << i)) + if (args->clip.boolclip.clipplane_mask & (1u << i)) { shader_addline(buffer, "DP4 TA.%c, TMP_OUT, state.clip[%u].plane;\n", component[cur_clip++], i); @@ -3810,7 +3814,8 @@ i, compiled->bumpenvmatconst[bump_const].const_num); compiled->numbumpenvmatconsts = bump_const + 1; - if (!(reg_maps->luminanceparams & (1 << i))) continue; + if (!(reg_maps->luminanceparams & (1u << i))) + continue; compiled->luminanceconst[bump_const].const_num = next_local++; shader_addline(buffer, "PARAM luminance%d = program.local[%d];\n", @@ -3820,7 +3825,7 @@ for(i = 0; i < MAX_CONST_I; i++) { compiled->int_consts[i] = WINED3D_CONST_NUM_UNUSED; - if (reg_maps->integer_constants & (1 << i) && priv_ctx.target_version >= NV2) + if (reg_maps->integer_constants & (1u << i) && priv_ctx.target_version >= NV2) { const DWORD *control_values = find_loop_control_values(shader, i); @@ -3876,13 +3881,18 @@ fixup->offset = next_local; fixup->super.active = 0; - for (i = 0; i < MAX_FRAGMENT_SAMPLERS; ++i) { - if (!(map & (1 << i))) continue; + for (i = 0; i < MAX_FRAGMENT_SAMPLERS; ++i) + { + if (!(map & (1u << i))) + continue; - if (fixup->offset + (cur_fixup_sampler >> 1) < max_lconsts) { - fixup->super.active |= (1 << i); + if (fixup->offset + (cur_fixup_sampler >> 1) < max_lconsts) + { + fixup->super.active |= (1u << i); fixup->super.idx[i] = cur_fixup_sampler++; - } else { + } + else + { FIXME("No free constant found to load NP2 fixup data into shader. " "Sampling from this texture will probably look wrong.\n"); break; @@ -4263,7 +4273,7 @@ for(i = 0; i < MAX_CONST_I; i++) { compiled->int_consts[i] = WINED3D_CONST_NUM_UNUSED; - if(reg_maps->integer_constants & (1 << i) && priv_ctx.target_version >= NV2) + if (reg_maps->integer_constants & (1u << i) && priv_ctx.target_version >= NV2) { const DWORD *control_values = find_loop_control_values(shader, i); @@ -4307,7 +4317,7 @@ const char *one = arb_get_helper_value(WINED3D_SHADER_TYPE_VERTEX, ARB_ONE); for(i = 0; i < MAX_REG_TEXCRD; i++) { - if (reg_maps->texcoord_mask[i] && reg_maps->texcoord_mask[i] != WINED3DSP_WRITEMASK_ALL) + if (reg_maps->u.texcoord_mask[i] && reg_maps->u.texcoord_mask[i] != WINED3DSP_WRITEMASK_ALL) shader_addline(buffer, "MOV result.texcoord[%u].w, %s\n", i, one); } } @@ -4528,7 +4538,7 @@ int i; WORD int_skip; - find_ps_compile_args(state, shader, context->stream_info.position_transformed, &args->super, gl_info); + find_ps_compile_args(state, shader, context->stream_info.position_transformed, &args->super, context); /* This forces all local boolean constants to 1 to make them stateblock independent */ args->bools = shader->reg_maps.local_bool_consts; @@ -4536,7 +4546,7 @@ for(i = 0; i < MAX_CONST_B; i++) { if (state->ps_consts_b[i]) - args->bools |= ( 1 << i); + args->bools |= ( 1u << i); } /* Only enable the clip plane emulation KIL if at least one clipplane is enabled. The KIL instruction @@ -4558,9 +4568,9 @@ return; } - for(i = 0; i < MAX_CONST_I; i++) + for (i = 0; i < MAX_CONST_I; ++i) { - if(int_skip & (1 << i)) + if (int_skip & (1u << i)) { args->loop_ctrl[i][0] = 0; args->loop_ctrl[i][1] = 0; @@ -4586,7 +4596,7 @@ int i; WORD int_skip; - find_vs_compile_args(state, shader, context->stream_info.swizzle_map, &args->super); + find_vs_compile_args(state, shader, context->stream_info.swizzle_map, &args->super, d3d_info); args->clip.boolclip_compare = 0; if (use_ps(state)) @@ -4618,7 +4628,7 @@ for(i = 0; i < MAX_CONST_B; i++) { if (state->vs_consts_b[i]) - args->clip.boolclip.bools |= ( 1 << i); + args->clip.boolclip.bools |= (1u << i); } args->vertex.samplers[0] = context->tex_unit_map[MAX_FRAGMENT_SAMPLERS + 0]; @@ -4637,7 +4647,7 @@ for(i = 0; i < MAX_CONST_I; i++) { - if(int_skip & (1 << i)) + if (int_skip & (1u << i)) { args->loop_ctrl[i][0] = 0; args->loop_ctrl[i][1] = 0; @@ -4820,9 +4830,9 @@ priv->last_vs_color_unclamp = FALSE; } - context->shader_update_mask = (1 << WINED3D_SHADER_TYPE_PIXEL) - | (1 << WINED3D_SHADER_TYPE_VERTEX) - | (1 << WINED3D_SHADER_TYPE_GEOMETRY); + context->shader_update_mask = (1u << WINED3D_SHADER_TYPE_PIXEL) + | (1u << WINED3D_SHADER_TYPE_VERTEX) + | (1u << WINED3D_SHADER_TYPE_GEOMETRY); } /* Context activation is done by the caller. */ @@ -5151,6 +5161,7 @@ caps->ps_1x_max_value = 0.0f; } + caps->varying_count = 0; caps->wined3d_caps = WINED3D_SHADER_CAP_SRGB_WRITE; if (use_nv_clip(gl_info)) caps->wined3d_caps |= WINED3D_SHADER_CAP_VS_CLIPPING; @@ -5326,7 +5337,7 @@ BOOL vshader = shader_is_vshader_version(reg_maps->shader_version.type); const struct wined3d_shader_lconst *constant; WORD bools = 0; - WORD flag = (1 << idx); + WORD flag = (1u << idx); struct shader_arb_ctx_priv *priv = ins->ctx->backend_data; if (reg_maps->local_bool_consts & flag) @@ -5358,7 +5369,7 @@ /* Integer constants can either be a local constant, or they can be stored in the shader * type specific compile args. */ - if (reg_maps->local_int_consts & (1 << idx)) + if (reg_maps->local_int_consts & (1u << idx)) { const struct wined3d_shader_lconst *constant; @@ -5756,8 +5767,9 @@ /* ARB_fragment_program fixed function pipeline replacement definitions */ #define ARB_FFP_CONST_TFACTOR 0 -#define ARB_FFP_CONST_COLOR_KEY ((ARB_FFP_CONST_TFACTOR) + 1) -#define ARB_FFP_CONST_SPECULAR_ENABLE ((ARB_FFP_CONST_COLOR_KEY) + 1) +#define ARB_FFP_CONST_COLOR_KEY_LOW ((ARB_FFP_CONST_TFACTOR) + 1) +#define ARB_FFP_CONST_COLOR_KEY_HIGH ((ARB_FFP_CONST_COLOR_KEY_LOW) + 1) +#define ARB_FFP_CONST_SPECULAR_ENABLE ((ARB_FFP_CONST_COLOR_KEY_HIGH) + 1) #define ARB_FFP_CONST_CONSTANT(i) ((ARB_FFP_CONST_SPECULAR_ENABLE) + 1 + i) #define ARB_FFP_CONST_BUMPMAT(i) ((ARB_FFP_CONST_CONSTANT(7)) + 1 + i) #define ARB_FFP_CONST_LUMINANCE(i) ((ARB_FFP_CONST_BUMPMAT(7)) + 1 + i) @@ -6030,7 +6042,7 @@ { struct wined3d_device *device = context->swapchain->device; const struct wined3d_gl_info *gl_info = context->gl_info; - struct wined3d_color float_key; + struct wined3d_color float_key[2]; const struct wined3d_texture *texture = state->textures[0]; if (!texture) @@ -6046,14 +6058,17 @@ return; priv = device->shader_priv; - priv->pshader_const_dirty[ARB_FFP_CONST_COLOR_KEY] = 1; - priv->highest_dirty_ps_const = max(priv->highest_dirty_ps_const, ARB_FFP_CONST_COLOR_KEY + 1); + priv->pshader_const_dirty[ARB_FFP_CONST_COLOR_KEY_LOW] = 1; + priv->pshader_const_dirty[ARB_FFP_CONST_COLOR_KEY_HIGH] = 1; + priv->highest_dirty_ps_const = max(priv->highest_dirty_ps_const, ARB_FFP_CONST_COLOR_KEY_HIGH + 1); } - wined3d_format_convert_color_to_float(texture->resource.format, NULL, - texture->async.src_blt_color_key.color_space_high_value, &float_key); - GL_EXTCALL(glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_COLOR_KEY, &float_key.r)); - checkGLcall("glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_COLOR_KEY, &float_key.r)"); + wined3d_format_get_float_color_key(texture->resource.format, &texture->async.src_blt_color_key, float_key); + + GL_EXTCALL(glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_COLOR_KEY_LOW, &float_key[0].r)); + checkGLcall("glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_COLOR_KEY_LOW, &float_key[0].r)"); + GL_EXTCALL(glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_COLOR_KEY_HIGH, &float_key[1].r)); + checkGLcall("glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_COLOR_KEY_HIGH, &float_key[1].r)"); } static const char *get_argreg(struct wined3d_string_buffer *buffer, DWORD argnum, unsigned int stage, DWORD arg) @@ -6308,7 +6323,8 @@ if (settings->color_key_enabled) { - shader_addline(&buffer, "PARAM color_key = program.env[%u];\n", ARB_FFP_CONST_COLOR_KEY); + shader_addline(&buffer, "PARAM color_key_low = program.env[%u];\n", ARB_FFP_CONST_COLOR_KEY_LOW); + shader_addline(&buffer, "PARAM color_key_high = program.env[%u];\n", ARB_FFP_CONST_COLOR_KEY_HIGH); tex_read[0] = TRUE; } @@ -6492,10 +6508,12 @@ if (settings->color_key_enabled) { - shader_addline(&buffer, "SUB TMP, tex0, color_key;\n"); - shader_addline(&buffer, "DP4 TMP.b, TMP, TMP;\n"); - shader_addline(&buffer, "SGE TMP, -TMP.b, 0.0;\n"); - shader_addline(&buffer, "KIL -TMP;\n"); + shader_addline(&buffer, "SLT TMP, tex0, color_key_low;\n"); /* below low key */ + shader_addline(&buffer, "SGE ret, tex0, color_key_high;\n"); /* above high key */ + shader_addline(&buffer, "ADD TMP, TMP, ret;\n"); /* or */ + shader_addline(&buffer, "DP4 TMP.b, TMP, TMP;\n"); /* on any channel */ + shader_addline(&buffer, "SGE TMP, -TMP.b, 0.0;\n"); /* logical not */ + shader_addline(&buffer, "KIL -TMP;\n"); /* discard if true */ } /* Generate the main shader */ @@ -6604,7 +6622,7 @@ } else if (use_pshader) { - context->shader_update_mask |= 1 << WINED3D_SHADER_TYPE_PIXEL; + context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL; } return; } @@ -6658,7 +6676,7 @@ context->last_was_pshader = TRUE; } - context->shader_update_mask |= 1 << WINED3D_SHADER_TYPE_PIXEL; + context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL; } /* We can't link the fog states to the fragment state directly since the @@ -6861,6 +6879,7 @@ {STATE_TEXTURESTAGE(6,WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), {STATE_TEXTURESTAGE(6, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), textransform }, WINED3D_GL_EXT_NONE }, {STATE_TEXTURESTAGE(7,WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), {STATE_TEXTURESTAGE(7, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), textransform }, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_SPECULARENABLE), { STATE_RENDER(WINED3D_RS_SPECULARENABLE), state_arb_specularenable}, WINED3D_GL_EXT_NONE }, + {STATE_RENDER(WINED3D_RS_SHADEMODE), { STATE_RENDER(WINED3D_RS_SHADEMODE), state_shademode }, WINED3D_GL_EXT_NONE }, {0 /* Terminate */, { 0, 0 }, WINED3D_GL_EXT_NONE }, }; @@ -6901,7 +6920,8 @@ }; #define ARBFP_BLIT_PARAM_SIZE 0 -#define ARBFP_BLIT_PARAM_COLOR_KEY 1 +#define ARBFP_BLIT_PARAM_COLOR_KEY_LOW 1 +#define ARBFP_BLIT_PARAM_COLOR_KEY_HIGH 2 struct arbfp_blit_priv { @@ -7586,13 +7606,16 @@ if (type->use_color_key) { shader_addline(&buffer, "TEMP color;\n"); - shader_addline(&buffer, "TEMP compare;\n"); - shader_addline(&buffer, "PARAM color_key = program.local[%u];\n", ARBFP_BLIT_PARAM_COLOR_KEY); + shader_addline(&buffer, "TEMP less, greater;\n"); + shader_addline(&buffer, "PARAM color_key_low = program.local[%u];\n", ARBFP_BLIT_PARAM_COLOR_KEY_LOW); + shader_addline(&buffer, "PARAM color_key_high = program.local[%u];\n", ARBFP_BLIT_PARAM_COLOR_KEY_HIGH); shader_addline(&buffer, "TEX color, fragment.texcoord[0], texture[0], %s;\n", tex_target); - shader_addline(&buffer, "SUB compare, color, color_key;\n"); - shader_addline(&buffer, "DP4 compare.r, compare, compare;\n"); - shader_addline(&buffer, "SGE compare, -compare.r, 0.0;\n"); - shader_addline(&buffer, "KIL -compare;\n"); + shader_addline(&buffer, "SLT less, color, color_key_low;\n"); /* below low key */ + shader_addline(&buffer, "SGE greater, color, color_key_high;\n"); /* above high key */ + shader_addline(&buffer, "ADD less, less, greater;\n"); /* or */ + shader_addline(&buffer, "DP4 less.b, less, less;\n"); /* on any channel */ + shader_addline(&buffer, "SGE less, -less.b, 0.0;\n"); /* logical not */ + shader_addline(&buffer, "KIL -less;\n"); /* discard if true */ shader_addline(&buffer, "MOV result.color, color;\n"); } else @@ -7622,7 +7645,7 @@ struct wine_rb_entry *entry; struct arbfp_blit_type type; struct arbfp_blit_desc *desc; - struct wined3d_color float_color_key; + struct wined3d_color float_color_key[2]; if (is_complex_fixup(surface->resource.format->color_fixup)) fixup = get_complex_fixup(surface->resource.format->color_fixup); @@ -7723,10 +7746,11 @@ checkGLcall("glProgramLocalParameter4fvARB"); if (type.use_color_key) { - wined3d_format_convert_color_to_float(surface->resource.format, NULL, - color_key->color_space_high_value, &float_color_key); + wined3d_format_get_float_color_key(surface->resource.format, color_key, float_color_key); + GL_EXTCALL(glProgramLocalParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, + ARBFP_BLIT_PARAM_COLOR_KEY_LOW, &float_color_key[0].r)); GL_EXTCALL(glProgramLocalParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, - ARBFP_BLIT_PARAM_COLOR_KEY, &float_color_key.r)); + ARBFP_BLIT_PARAM_COLOR_KEY_HIGH, &float_color_key[1].r)); checkGLcall("glProgramLocalParameter4fvARB"); } @@ -7836,7 +7860,7 @@ * flip in the blitter, we don't actually need that flip anyway. So we * use the surface's texture as scratch texture, and flip the source * rectangle instead. */ - surface_load_fb_texture(src_surface, FALSE); + 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; diff -Nru wine1.7-1.7.50/dlls/wined3d/ati_fragment_shader.c wine1.7-1.7.55/dlls/wined3d/ati_fragment_shader.c --- wine1.7-1.7.50/dlls/wined3d/ati_fragment_shader.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/ati_fragment_shader.c 2015-11-13 14:32:40.000000000 +0000 @@ -1114,6 +1114,7 @@ {STATE_RENDER(WINED3D_RS_FOGEND), { STATE_RENDER(WINED3D_RS_FOGSTART), NULL }, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_SRGBWRITEENABLE), { STATE_RENDER(WINED3D_RS_SRGBWRITEENABLE), atifs_srgbwriteenable }, WINED3D_GL_EXT_NONE }, {STATE_COLOR_KEY, { STATE_COLOR_KEY, state_nop }, WINED3D_GL_EXT_NONE }, + {STATE_RENDER(WINED3D_RS_SHADEMODE), { STATE_RENDER(WINED3D_RS_SHADEMODE), state_shademode }, WINED3D_GL_EXT_NONE }, {STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_OP), { STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL), NULL }, WINED3D_GL_EXT_NONE }, {STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_ARG1), { STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL), NULL }, WINED3D_GL_EXT_NONE }, {STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_ARG2), { STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL), NULL }, WINED3D_GL_EXT_NONE }, diff -Nru wine1.7-1.7.50/dlls/wined3d/buffer.c wine1.7-1.7.55/dlls/wined3d/buffer.c --- wine1.7-1.7.50/dlls/wined3d/buffer.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/buffer.c 2015-11-13 14:32:40.000000000 +0000 @@ -275,7 +275,7 @@ /* Ignore attributes that do not have our vbo. After that check we can be sure that the attribute is * there, on nonexistent attribs the vbo is 0. */ - if (!(si->use_map & (1 << attrib_idx)) + if (!(si->use_map & (1u << attrib_idx)) || state->streams[attrib->stream_idx].buffer != This) return FALSE; @@ -432,9 +432,9 @@ * 0x000000ff: Red mask */ *dst_color = 0; - *dst_color |= (src_color & 0xff00ff00); /* Alpha Green */ - *dst_color |= (src_color & 0x00ff0000) >> 16; /* Red */ - *dst_color |= (src_color & 0x000000ff) << 16; /* Blue */ + *dst_color |= (src_color & 0xff00ff00u); /* Alpha Green */ + *dst_color |= (src_color & 0x00ff0000u) >> 16; /* Red */ + *dst_color |= (src_color & 0x000000ffu) << 16; /* Blue */ } static inline void fixup_transformed_pos(float *p) @@ -1123,11 +1123,51 @@ return wined3d_buffer_decref(buffer_from_resource(resource)); } +static HRESULT buffer_resource_sub_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, + struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) +{ + struct wined3d_buffer *buffer = buffer_from_resource(resource); + UINT offset, size; + + if (sub_resource_idx) + { + WARN("Invalid sub_resource_idx %u.\n", sub_resource_idx); + return E_INVALIDARG; + } + + if (box) + { + offset = box->left; + size = box->right - box->left; + } + else + { + offset = size = 0; + } + + map_desc->row_pitch = map_desc->slice_pitch = buffer->desc.byte_width; + return wined3d_buffer_map(buffer, offset, size, (BYTE **)&map_desc->data, flags); +} + +static HRESULT buffer_resource_sub_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx) +{ + if (sub_resource_idx) + { + WARN("Invalid sub_resource_idx %u.\n", sub_resource_idx); + return E_INVALIDARG; + } + + wined3d_buffer_unmap(buffer_from_resource(resource)); + return WINED3D_OK; +} + static const struct wined3d_resource_ops buffer_resource_ops = { buffer_resource_incref, buffer_resource_decref, buffer_unload, + buffer_resource_sub_resource_map, + buffer_resource_sub_resource_unmap, }; static HRESULT buffer_init(struct wined3d_buffer *buffer, struct wined3d_device *device, @@ -1236,7 +1276,8 @@ struct wined3d_buffer *object; HRESULT hr; - TRACE("device %p, desc %p, data %p, parent %p, buffer %p\n", device, desc, data, parent, buffer); + TRACE("device %p, desc %p, data %p, parent %p, parent_ops %p, buffer %p\n", + device, desc, data, parent, parent_ops, buffer); object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); if (!object) diff -Nru wine1.7-1.7.50/dlls/wined3d/context.c wine1.7-1.7.55/dlls/wined3d/context.c --- wine1.7-1.7.50/dlls/wined3d/context.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/context.c 2015-11-13 14:32:40.000000000 +0000 @@ -141,8 +141,6 @@ { case WINED3D_LOCATION_TEXTURE_RGB: case WINED3D_LOCATION_TEXTURE_SRGB: - wined3d_texture_prepare_texture(depth_stencil->container, context, FALSE); - if (format_flags & WINED3DFMT_FLAG_DEPTH) { gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_DEPTH_ATTACHMENT, @@ -161,13 +159,11 @@ break; case WINED3D_LOCATION_RB_MULTISAMPLE: - surface_prepare_rb(depth_stencil, gl_info, TRUE); context_attach_depth_stencil_rb(gl_info, fbo_target, format_flags, depth_stencil->rb_multisample); break; case WINED3D_LOCATION_RB_RESOLVED: - surface_prepare_rb(depth_stencil, gl_info, FALSE); context_attach_depth_stencil_rb(gl_info, fbo_target, format_flags, depth_stencil->rb_resolved); break; @@ -217,7 +213,6 @@ case WINED3D_LOCATION_TEXTURE_RGB: case WINED3D_LOCATION_TEXTURE_SRGB: srgb = location == WINED3D_LOCATION_TEXTURE_SRGB; - wined3d_texture_prepare_texture(surface->container, context, srgb); gl_info->fbo_ops.glFramebufferTexture2D(fbo_target, GL_COLOR_ATTACHMENT0 + idx, surface->texture_target, surface_get_texture_name(surface, gl_info, srgb), surface->texture_level); @@ -225,14 +220,12 @@ break; case WINED3D_LOCATION_RB_MULTISAMPLE: - surface_prepare_rb(surface, gl_info, TRUE); gl_info->fbo_ops.glFramebufferRenderbuffer(fbo_target, GL_COLOR_ATTACHMENT0 + idx, GL_RENDERBUFFER, surface->rb_multisample); checkGLcall("glFramebufferRenderbuffer()"); break; case WINED3D_LOCATION_RB_RESOLVED: - surface_prepare_rb(surface, gl_info, FALSE); gl_info->fbo_ops.glFramebufferRenderbuffer(fbo_target, GL_COLOR_ATTACHMENT0 + idx, GL_RENDERBUFFER, surface->rb_resolved); checkGLcall("glFramebufferRenderbuffer()"); @@ -305,12 +298,12 @@ static inline DWORD context_generate_rt_mask(GLenum buffer) { /* Should take care of all the GL_FRONT/GL_BACK/GL_AUXi/GL_NONE... cases */ - return buffer ? (1 << 31) | buffer : 0; + return buffer ? (1u << 31) | buffer : 0; } static inline DWORD context_generate_rt_mask_from_surface(const struct wined3d_surface *target) { - return (1 << 31) | surface_get_gl_buffer(target); + return (1u << 31) | surface_get_gl_buffer(target); } static struct fbo_entry *context_create_fbo_entry(const struct wined3d_context *context, @@ -827,7 +820,7 @@ if (dc == context->hdc && context->hdc_is_private && context->hdc_has_format) return TRUE; - current = GetPixelFormat(dc); + current = gl_info->gl_ops.wgl.p_wglGetPixelFormat(dc); if (current == format) goto success; if (!current) @@ -1194,6 +1187,20 @@ } } +/* This is used when a context for render target A is active, but a separate context is + * needed to access the WGL framebuffer for render target B. Re-acquire a context for rt + * A to avoid breaking caller code. */ +void context_restore(struct wined3d_context *context, struct wined3d_surface *restore) +{ + if (context->current_rt != restore) + { + context_release(context); + context = context_acquire(restore->resource.device, restore); + } + + context_release(context); +} + static void context_enter(struct wined3d_context *context) { TRACE("Entering context %p, level %u.\n", context, context->level + 1); @@ -1212,7 +1219,7 @@ context->needs_set = 1; } else if (!context->needs_set && !(context->hdc_is_private && context->hdc_has_format) - && context->pixel_format != GetPixelFormat(context->hdc)) + && context->pixel_format != context->gl_info->gl_ops.wgl.p_wglGetPixelFormat(context->hdc)) context->needs_set = 1; } } @@ -1228,7 +1235,7 @@ context->dirtyArray[context->numDirtyEntries++] = rep; idx = rep / (sizeof(*context->isStateDirty) * CHAR_BIT); shift = rep & ((sizeof(*context->isStateDirty) * CHAR_BIT) - 1); - context->isStateDirty[idx] |= (1 << shift); + context->isStateDirty[idx] |= (1u << shift); } /* This function takes care of wined3d pixel format selection. */ @@ -1237,8 +1244,6 @@ BOOL auxBuffers, BOOL findCompatible) { int iPixelFormat=0; - BYTE redBits, greenBits, blueBits, alphaBits, colorBits; - BYTE depthBits=0, stencilBits=0; unsigned int current_value; unsigned int cfg_count = device->adapter->cfg_count; unsigned int i; @@ -1247,15 +1252,6 @@ device, hdc, debug_d3dformat(color_format->id), debug_d3dformat(ds_format->id), auxBuffers, findCompatible); - if (!getColorBits(color_format, &redBits, &greenBits, &blueBits, &alphaBits, &colorBits)) - { - ERR("Unable to get color bits for format %s (%#x)!\n", - debug_d3dformat(color_format->id), color_format->id); - return 0; - } - - getDepthStencilBits(ds_format, &depthBits, &stencilBits); - current_value = 0; for (i = 0; i < cfg_count; ++i) { @@ -1269,17 +1265,17 @@ /* In window mode we need a window drawable format and double buffering. */ if (!(cfg->windowDrawable && cfg->doubleBuffer)) continue; - if (cfg->redSize < redBits) + if (cfg->redSize < color_format->red_size) continue; - if (cfg->greenSize < greenBits) + if (cfg->greenSize < color_format->green_size) continue; - if (cfg->blueSize < blueBits) + if (cfg->blueSize < color_format->blue_size) continue; - if (cfg->alphaSize < alphaBits) + if (cfg->alphaSize < color_format->alpha_size) continue; - if (cfg->depthSize < depthBits) + if (cfg->depthSize < ds_format->depth_size) continue; - if (stencilBits && cfg->stencilSize != stencilBits) + if (ds_format->stencil_size && cfg->stencilSize != ds_format->stencil_size) continue; /* Check multisampling support. */ if (cfg->numSamples) @@ -1288,18 +1284,18 @@ value = 1; /* We try to locate a format which matches our requirements exactly. In case of * depth it is no problem to emulate 16-bit using e.g. 24-bit, so accept that. */ - if (cfg->depthSize == depthBits) + if (cfg->depthSize == ds_format->depth_size) value += 1; - if (cfg->stencilSize == stencilBits) + if (cfg->stencilSize == ds_format->stencil_size) value += 2; - if (cfg->alphaSize == alphaBits) + if (cfg->alphaSize == color_format->alpha_size) value += 4; /* We like to have aux buffers in backbuffer mode */ if (auxBuffers && cfg->auxBuffers) value += 8; - if (cfg->redSize == redBits - && cfg->greenSize == greenBits - && cfg->blueSize == blueBits) + if (cfg->redSize == color_format->red_size + && cfg->greenSize == color_format->green_size + && cfg->blueSize == color_format->blue_size) value += 16; if (value > current_value) @@ -1323,10 +1319,11 @@ pfd.nVersion = 1; pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER | PFD_DRAW_TO_WINDOW;/*PFD_GENERIC_ACCELERATED*/ pfd.iPixelType = PFD_TYPE_RGBA; - pfd.cAlphaBits = alphaBits; - pfd.cColorBits = colorBits; - pfd.cDepthBits = depthBits; - pfd.cStencilBits = stencilBits; + pfd.cAlphaBits = color_format->alpha_size; + pfd.cColorBits = color_format->red_size + color_format->green_size + + color_format->blue_size + color_format->alpha_size; + pfd.cDepthBits = ds_format->depth_size; + pfd.cStencilBits = ds_format->stencil_size; pfd.iLayerType = PFD_MAIN_PLANE; iPixelFormat = ChoosePixelFormat(hdc, &pfd); @@ -1512,7 +1509,7 @@ /* Initialize the texture unit mapping to a 1:1 mapping */ for (s = 0; s < MAX_COMBINED_SAMPLERS; ++s) { - if (s < gl_info->limits.fragment_samplers) + if (s < gl_info->limits.combined_samplers) { ret->tex_unit_map[s] = s; ret->rev_tex_unit_map[s] = s; @@ -1560,6 +1557,20 @@ if (color_format->id == WINED3DFMT_P8_UINT) color_format = wined3d_get_format(gl_info, WINED3DFMT_B8G8R8A8_UNORM); + /* When "always_offscreen" is enabled, we only use the drawable for + * presentation blits, and don't do any rendering to it. That means we + * don't need depth or stencil buffers, and can mostly ignore the render + * target format. This wouldn't necessarily be quite correct for 10bpc + * display modes, but we don't currently support those. + * Using the same format regardless of the color/depth/stencil targets + * makes it much less likely that different wined3d instances will set + * conflicting pixel formats. */ + if (wined3d_settings.always_offscreen) + { + color_format = wined3d_get_format(gl_info, WINED3DFMT_B8G8R8A8_UNORM); + ds_format = wined3d_get_format(gl_info, WINED3DFMT_UNKNOWN); + } + /* Try to find a pixel format which matches our requirements. */ pixel_format = context_choose_pixel_format(device, hdc, color_format, ds_format, auxBuffers, FALSE); @@ -1577,10 +1588,10 @@ goto out; } - context_enter(ret); - ret->gl_info = gl_info; + context_enter(ret); + if (!context_set_pixel_format(ret, hdc, hdc_is_private, pixel_format)) { ERR("Failed to set pixel format %d on device context %p.\n", pixel_format, hdc); @@ -1662,27 +1673,27 @@ if (context_debug_output_enabled(gl_info)) { - GL_EXTCALL(glDebugMessageCallbackARB(wined3d_debug_callback, ret)); + GL_EXTCALL(glDebugMessageCallback(wined3d_debug_callback, ret)); if (TRACE_ON(d3d_synchronous)) - gl_info->gl_ops.gl.p_glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB); - GL_EXTCALL(glDebugMessageControlARB(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, NULL, GL_FALSE)); + gl_info->gl_ops.gl.p_glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS); + GL_EXTCALL(glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, NULL, GL_FALSE)); if (ERR_ON(d3d)) { - GL_EXTCALL(glDebugMessageControlARB(GL_DONT_CARE, GL_DEBUG_TYPE_ERROR_ARB, + GL_EXTCALL(glDebugMessageControl(GL_DONT_CARE, GL_DEBUG_TYPE_ERROR, GL_DONT_CARE, 0, NULL, GL_TRUE)); } if (FIXME_ON(d3d)) { - GL_EXTCALL(glDebugMessageControlARB(GL_DONT_CARE, GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB, + GL_EXTCALL(glDebugMessageControl(GL_DONT_CARE, GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR, GL_DONT_CARE, 0, NULL, GL_TRUE)); - GL_EXTCALL(glDebugMessageControlARB(GL_DONT_CARE, GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB, + GL_EXTCALL(glDebugMessageControl(GL_DONT_CARE, GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR, GL_DONT_CARE, 0, NULL, GL_TRUE)); - GL_EXTCALL(glDebugMessageControlARB(GL_DONT_CARE, GL_DEBUG_TYPE_PORTABILITY_ARB, + GL_EXTCALL(glDebugMessageControl(GL_DONT_CARE, GL_DEBUG_TYPE_PORTABILITY, GL_DONT_CARE, 0, NULL, GL_TRUE)); } if (WARN_ON(d3d_perf)) { - GL_EXTCALL(glDebugMessageControlARB(GL_DONT_CARE, GL_DEBUG_TYPE_PERFORMANCE_ARB, + GL_EXTCALL(glDebugMessageControl(GL_DONT_CARE, GL_DEBUG_TYPE_PERFORMANCE, GL_DONT_CARE, 0, NULL, GL_TRUE)); } } @@ -1805,9 +1816,9 @@ GL_EXTCALL(glProvokingVertexEXT(GL_FIRST_VERTEX_CONVENTION_EXT)); } device->shader_backend->shader_init_context_state(ret); - ret->shader_update_mask = (1 << WINED3D_SHADER_TYPE_PIXEL) - | (1 << WINED3D_SHADER_TYPE_VERTEX) - | (1 << WINED3D_SHADER_TYPE_GEOMETRY); + ret->shader_update_mask = (1u << WINED3D_SHADER_TYPE_PIXEL) + | (1u << WINED3D_SHADER_TYPE_VERTEX) + | (1u << WINED3D_SHADER_TYPE_GEOMETRY); /* 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 @@ -2099,12 +2110,12 @@ static inline BOOL is_rt_mask_onscreen(DWORD rt_mask) { - return rt_mask & (1 << 31); + return rt_mask & (1u << 31); } static inline GLenum draw_buffer_from_rt_mask(DWORD rt_mask) { - return rt_mask & ~(1 << 31); + return rt_mask & ~(1u << 31); } /* Context activation is done by the caller. */ @@ -2245,25 +2256,21 @@ static BOOL match_depth_stencil_format(const struct wined3d_format *existing, const struct wined3d_format *required) { - BYTE existing_depth, existing_stencil, required_depth, required_stencil; - if (existing == required) return TRUE; if ((existing->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_FLOAT) != (required->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_FLOAT)) return FALSE; - - getDepthStencilBits(existing, &existing_depth, &existing_stencil); - getDepthStencilBits(required, &required_depth, &required_stencil); - - if(existing_depth < required_depth) return FALSE; - /* If stencil bits are used the exact amount is required - otherwise wrapping - * won't work correctly */ - if(required_stencil && required_stencil != existing_stencil) return FALSE; + if (existing->depth_size < required->depth_size) + return FALSE; + /* If stencil bits are used the exact amount is required - otherwise + * wrapping won't work correctly. */ + if (required->stencil_size && required->stencil_size != existing->stencil_size) + return FALSE; return TRUE; } -/* The caller provides a context */ +/* Context activation is done by the caller. */ static void context_validate_onscreen_formats(struct wined3d_context *context, const struct wined3d_rendertarget_view *depth_stencil) { @@ -2279,7 +2286,7 @@ WARN("Depth stencil format is not supported by WGL, rendering the backbuffer in an FBO\n"); /* The currently active context is the necessary context to access the swapchain's onscreen buffers */ - surface_load_location(context->current_rt, WINED3D_LOCATION_TEXTURE_RGB); + surface_load_location(context->current_rt, context, WINED3D_LOCATION_TEXTURE_RGB); swapchain->render_to_fbo = TRUE; swapchain_update_draw_bindings(swapchain); context_set_render_offscreen(context, TRUE); @@ -2387,7 +2394,7 @@ { context->blit_targets[i] = wined3d_rendertarget_view_get_surface(rts[i]); if (rts[i] && rts[i]->format->id != WINED3DFMT_NULL) - rt_mask |= (1 << i); + rt_mask |= (1u << i); } while (i < context->gl_info->limits.buffers) { @@ -2423,7 +2430,7 @@ for (i = 0; i < rt_count; ++i) { if (rts[i] && rts[i]->format->id != WINED3DFMT_NULL) - rt_mask |= (1 << i); + rt_mask |= (1u << i); } } else @@ -2482,9 +2489,9 @@ i = 0; while (rt_mask_bits) { - rt_mask_bits &= ~(1 << i); + rt_mask_bits &= ~(1u << i); if (!rts[i] || rts[i]->format->id == WINED3DFMT_NULL) - rt_mask &= ~(1 << i); + rt_mask &= ~(1u << i); i++; } @@ -2535,6 +2542,7 @@ DWORD i = context->rev_tex_unit_map[unit]; DWORD j = context->tex_unit_map[stage]; + TRACE("Mapping stage %u to unit %u.\n", stage, unit); context->tex_unit_map[stage] = unit; if (i != WINED3D_UNMAPPED_STAGE && i != stage) context->tex_unit_map[i] = WINED3D_UNMAPPED_STAGE; @@ -2581,11 +2589,11 @@ || ((alpha_arg2 == WINED3DTA_TEXTURE) && alpha_op != WINED3D_TOP_SELECT_ARG1) || ((alpha_arg3 == WINED3DTA_TEXTURE) && (alpha_op == WINED3D_TOP_MULTIPLY_ADD || alpha_op == WINED3D_TOP_LERP))) - context->fixed_function_usage_map |= (1 << i); + context->fixed_function_usage_map |= (1u << i); if ((color_op == WINED3D_TOP_BUMPENVMAP || color_op == WINED3D_TOP_BUMPENVMAP_LUMINANCE) && i < MAX_TEXTURES - 1) - context->fixed_function_usage_map |= (1 << (i + 1)); + context->fixed_function_usage_map |= (1u << (i + 1)); } if (i < context->lowest_disabled_stage) @@ -2609,11 +2617,16 @@ static void context_map_fixed_function_samplers(struct wined3d_context *context, const struct wined3d_state *state) { + const struct wined3d_d3d_info *d3d_info = context->d3d_info; + const struct wined3d_gl_info *gl_info = context->gl_info; unsigned int i, tex; WORD ffu_map; - const struct wined3d_d3d_info *d3d_info = context->d3d_info; context_update_fixed_function_usage_map(context, state); + + if (gl_info->limits.combined_samplers >= MAX_COMBINED_SAMPLERS) + return; + ffu_map = context->fixed_function_usage_map; if (d3d_info->limits.ffp_textures == d3d_info->limits.ffp_blend_stages @@ -2654,10 +2667,14 @@ static void context_map_psamplers(struct wined3d_context *context, const struct wined3d_state *state) { + const struct wined3d_d3d_info *d3d_info = context->d3d_info; + const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_shader_resource_info *resource_info = state->shader[WINED3D_SHADER_TYPE_PIXEL]->reg_maps.resource_info; unsigned int i; - const struct wined3d_d3d_info *d3d_info = context->d3d_info; + + if (gl_info->limits.combined_samplers >= MAX_COMBINED_SAMPLERS) + return; for (i = 0; i < MAX_FRAGMENT_SAMPLERS; ++i) { @@ -2672,8 +2689,7 @@ } static BOOL context_unit_free_for_vs(const struct wined3d_context *context, - const struct wined3d_shader_resource_info *ps_resource_info, - const struct wined3d_shader_resource_info *vs_resource_info, DWORD unit) + const struct wined3d_shader_resource_info *ps_resource_info, DWORD unit) { DWORD current_mapping = context->rev_tex_unit_map[unit]; @@ -2688,15 +2704,14 @@ if (!ps_resource_info) { /* No pixel shader, check fixed function */ - return current_mapping >= MAX_TEXTURES || !(context->fixed_function_usage_map & (1 << current_mapping)); + return current_mapping >= MAX_TEXTURES || !(context->fixed_function_usage_map & (1u << current_mapping)); } /* Pixel shader, check the shader's sampler map */ return !ps_resource_info[current_mapping].type; } - /* Used by a vertex sampler */ - return !vs_resource_info[current_mapping - MAX_FRAGMENT_SAMPLERS].type; + return TRUE; } static void context_map_vsamplers(struct wined3d_context *context, BOOL ps, const struct wined3d_state *state) @@ -2708,6 +2723,9 @@ int start = min(MAX_COMBINED_SAMPLERS, gl_info->limits.combined_samplers) - 1; int i; + if (gl_info->limits.combined_samplers >= MAX_COMBINED_SAMPLERS) + return; + /* Note that we only care if a resource is used or not, not the * resource's specific type. Otherwise we'd need to call * shader_update_samplers() here for 1.x pixelshaders. */ @@ -2719,18 +2737,15 @@ DWORD vsampler_idx = i + MAX_FRAGMENT_SAMPLERS; if (vs_resource_info[i].type) { - if (context->tex_unit_map[vsampler_idx] != WINED3D_UNMAPPED_STAGE) - { - /* Already mapped somewhere */ - continue; - } - while (start >= 0) { - if (context_unit_free_for_vs(context, ps_resource_info, vs_resource_info, start)) + if (context_unit_free_for_vs(context, ps_resource_info, start)) { - context_map_stage(context, vsampler_idx, start); - context_invalidate_state(context, STATE_SAMPLER(vsampler_idx)); + if (context->tex_unit_map[vsampler_idx] != start) + { + context_map_stage(context, vsampler_idx, start); + context_invalidate_state(context, STATE_SAMPLER(vsampler_idx)); + } --start; break; @@ -2738,6 +2753,8 @@ --start; } + if (context->tex_unit_map[vsampler_idx] == WINED3D_UNMAPPED_STAGE) + WARN("Couldn't find a free texture unit for vertex sampler %u.\n", i); } } } @@ -2746,13 +2763,12 @@ { BOOL vs = use_vs(state); BOOL ps = use_ps(state); - /* - * Rules are: - * -> Pixel shaders need a 1:1 map. In theory the shader input could be mapped too, but - * that would be really messy and require shader recompilation - * -> When the mapping of a stage is changed, sampler and ALL texture stage states have - * to be reset. Because of that try to work with a 1:1 mapping as much as possible - */ + + /* Try to go for a 1:1 mapping of the samplers when possible. Pixel shaders + * need a 1:1 map at the moment. + * When the mapping of a stage is changed, sampler and ALL texture stage + * states have to be reset. */ + if (ps) context_map_psamplers(context, state); else @@ -2903,9 +2919,9 @@ if (!context->gl_info->supported[ARB_VERTEX_ARRAY_BGRA] && element->format->id == WINED3DFMT_B8G8R8A8_UNORM) { - stream_info->swizzle_map |= 1 << idx; + stream_info->swizzle_map |= 1u << idx; } - stream_info->use_map |= 1 << idx; + stream_info->use_map |= 1u << idx; } } } @@ -2983,9 +2999,9 @@ } else { - WORD slow_mask = -!d3d_info->ffp_generic_attributes & (1 << WINED3D_FFP_PSIZE); + WORD slow_mask = -!d3d_info->ffp_generic_attributes & (1u << WINED3D_FFP_PSIZE); slow_mask |= -!gl_info->supported[ARB_VERTEX_ARRAY_BGRA] - & ((1 << WINED3D_FFP_DIFFUSE) | (1 << WINED3D_FFP_SPECULAR)); + & ((1u << WINED3D_FFP_DIFFUSE) | (1u << WINED3D_FFP_SPECULAR)); if (((stream_info->position_transformed && !d3d_info->xyzrhw) || (stream_info->use_map & slow_mask)) && !stream_info->all_vbo) @@ -3201,7 +3217,7 @@ DWORD rep = context->dirtyArray[i]; DWORD idx = rep / (sizeof(*context->isStateDirty) * CHAR_BIT); BYTE shift = rep & ((sizeof(*context->isStateDirty) * CHAR_BIT) - 1); - context->isStateDirty[idx] &= ~(1 << shift); + context->isStateDirty[idx] &= ~(1u << shift); state_table[rep].apply(context, state, rep); } diff -Nru wine1.7-1.7.50/dlls/wined3d/cs.c wine1.7-1.7.55/dlls/wined3d/cs.c --- wine1.7-1.7.50/dlls/wined3d/cs.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/cs.c 2015-11-13 14:32:40.000000000 +0000 @@ -430,7 +430,7 @@ surface_modify_ds_location(prev_surface, WINED3D_LOCATION_DISCARDED, prev->width, prev->height); if (prev_surface == device->onscreen_depth_stencil) { - wined3d_surface_decref(device->onscreen_depth_stencil); + wined3d_texture_decref(device->onscreen_depth_stencil->container); device->onscreen_depth_stencil = NULL; } } @@ -903,7 +903,7 @@ if (op->set) { - switch (op->flags & ~WINED3D_CKEY_COLORSPACE) + switch (op->flags) { case WINED3D_CKEY_DST_BLT: texture->async.dst_blt_color_key = op->color_key; @@ -935,7 +935,7 @@ } else { - switch (op->flags & ~WINED3D_CKEY_COLORSPACE) + switch (op->flags) { case WINED3D_CKEY_DST_BLT: texture->async.color_key_flags &= ~WINED3D_CKEY_DST_BLT; diff -Nru wine1.7-1.7.50/dlls/wined3d/device.c wine1.7-1.7.55/dlls/wined3d/device.c --- wine1.7-1.7.50/dlls/wined3d/device.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/device.c 2015-11-13 14:32:40.000000000 +0000 @@ -208,10 +208,10 @@ surface_modify_ds_location(device->onscreen_depth_stencil, WINED3D_LOCATION_TEXTURE_RGB, device->onscreen_depth_stencil->ds_current_size.cx, device->onscreen_depth_stencil->ds_current_size.cy); - wined3d_surface_decref(device->onscreen_depth_stencil); + wined3d_texture_decref(device->onscreen_depth_stencil->container); } device->onscreen_depth_stencil = depth_stencil; - wined3d_surface_incref(device->onscreen_depth_stencil); + wined3d_texture_incref(device->onscreen_depth_stencil->container); } static BOOL is_full_clear(const struct wined3d_surface *target, const RECT *draw_rect, const RECT *clear_rect) @@ -300,6 +300,15 @@ unsigned int i; RECT ds_rect; + context = context_acquire(device, target); + if (!context->valid) + { + context_release(context); + WARN("Invalid context, skipping clear.\n"); + return; + } + gl_info = context->gl_info; + /* When we're clearing parts of the drawable, make sure that the target surface is well up to date in the * drawable. After the clear we'll mark the drawable up to date, so we have to make sure that this is true * for the cleared parts, and the untouched parts. @@ -308,25 +317,18 @@ * anyway. If we're not clearing the color buffer we don't have to copy either since we're not going to set * the drawable up to date. We have to check all settings that limit the clear area though. Do not bother * checking all this if the dest surface is in the drawable anyway. */ - if (flags & WINED3DCLEAR_TARGET && !is_full_clear(target, draw_rect, clear_rect)) + for (i = 0; i < rt_count; ++i) { - for (i = 0; i < rt_count; ++i) + struct wined3d_surface *rt = wined3d_rendertarget_view_get_surface(fb->render_targets[i]); + if (rt && rt->resource.format->id != WINED3DFMT_NULL) { - struct wined3d_surface *rt = wined3d_rendertarget_view_get_surface(fb->render_targets[i]); - if (rt) - surface_load_location(rt, rt->container->resource.draw_binding); + if (flags & WINED3DCLEAR_TARGET && !is_full_clear(target, draw_rect, clear_rect)) + surface_load_location(rt, context, rt->container->resource.draw_binding); + else + wined3d_surface_prepare(rt, context, rt->container->resource.draw_binding); } } - context = context_acquire(device, target); - if (!context->valid) - { - context_release(context); - WARN("Invalid context, skipping clear.\n"); - return; - } - gl_info = context->gl_info; - if (target) { render_offscreen = context->render_offscreen; @@ -339,6 +341,9 @@ drawable_height = depth_stencil->pow2Height; } + if (depth_stencil && render_offscreen) + wined3d_surface_prepare(depth_stencil, context, depth_stencil->container->resource.draw_binding); + if (flags & WINED3DCLEAR_ZBUFFER) { DWORD location = render_offscreen ? fb->depth_stencil->resource->draw_binding : WINED3D_LOCATION_DRAWABLE; @@ -1097,7 +1102,7 @@ { surface = device->onscreen_depth_stencil; device->onscreen_depth_stencil = NULL; - wined3d_surface_decref(surface); + wined3d_texture_decref(surface->container); } if (device->fb.depth_stencil) @@ -1229,7 +1234,8 @@ return NULL; } - *offset = device->state.stream_output[idx].offset; + if (offset) + *offset = device->state.stream_output[idx].offset; return device->state.stream_output[idx].buffer; } @@ -1257,7 +1263,7 @@ prev_buffer = stream->buffer; if (device->recording) - device->recording->changed.streamSource |= 1 << stream_idx; + device->recording->changed.streamSource |= 1u << stream_idx; if (prev_buffer == buffer && stream->stride == stride @@ -1338,7 +1344,7 @@ stream->frequency = divider & 0x7fffff; if (device->recording) - device->recording->changed.streamFreq |= 1 << stream_idx; + device->recording->changed.streamFreq |= 1u << stream_idx; else if (stream->frequency != old_freq || stream->flags != old_flags) wined3d_cs_emit_set_stream_source_freq(device->cs, stream_idx, stream->frequency, stream->flags); @@ -1374,7 +1380,7 @@ if (device->recording) { TRACE("Recording... not performing anything.\n"); - device->recording->changed.transform[d3dts >> 5] |= 1 << (d3dts & 0x1f); + device->recording->changed.transform[d3dts >> 5] |= 1u << (d3dts & 0x1f); device->update_state->transforms[d3dts] = *matrix; return; } @@ -1763,7 +1769,7 @@ } if (device->recording) - device->recording->changed.clipplane |= 1 << plane_idx; + device->recording->changed.clipplane |= 1u << plane_idx; if (!memcmp(&device->update_state->clip_planes[plane_idx], plane, sizeof(*plane))) { @@ -1957,7 +1963,7 @@ if (device->recording) { TRACE("Recording... not performing anything.\n"); - device->recording->changed.renderState[state >> 5] |= 1 << (state & 0x1f); + device->recording->changed.renderState[state >> 5] |= 1u << (state & 0x1f); return; } @@ -2005,7 +2011,7 @@ if (device->recording) { TRACE("Recording... not performing anything.\n"); - device->recording->changed.samplerState[sampler_idx] |= 1 << state; + device->recording->changed.samplerState[sampler_idx] |= 1u << state; return; } @@ -2287,7 +2293,7 @@ if (device->recording) { for (i = start_register; i < count + start_register; ++i) - device->recording->changed.vertexShaderConstantsB |= (1 << i); + device->recording->changed.vertexShaderConstantsB |= (1u << i); } else { @@ -2334,7 +2340,7 @@ if (device->recording) { for (i = start_register; i < count + start_register; ++i) - device->recording->changed.vertexShaderConstantsI |= (1 << i); + device->recording->changed.vertexShaderConstantsI |= (1u << i); } else { @@ -2521,7 +2527,7 @@ if (device->recording) { for (i = start_register; i < count + start_register; ++i) - device->recording->changed.pixelShaderConstantsB |= (1 << i); + device->recording->changed.pixelShaderConstantsB |= (1u << i); } else { @@ -2568,7 +2574,7 @@ if (device->recording) { for (i = start_register; i < count + start_register; ++i) - device->recording->changed.pixelShaderConstantsI |= (1 << i); + device->recording->changed.pixelShaderConstantsI |= (1u << i); } else { @@ -2746,12 +2752,12 @@ DWORD numTextures; HRESULT hr; - if (stream_info->use_map & (1 << WINED3D_FFP_NORMAL)) + if (stream_info->use_map & (1u << WINED3D_FFP_NORMAL)) { WARN(" lighting state not saved yet... Some strange stuff may happen !\n"); } - if (!(stream_info->use_map & (1 << WINED3D_FFP_POSITION))) + if (!(stream_info->use_map & (1u << WINED3D_FFP_POSITION))) { ERR("Source has no position mask\n"); return WINED3DERR_INVALIDCALL; @@ -2935,7 +2941,7 @@ { const struct wined3d_stream_info_element *element = &stream_info->elements[WINED3D_FFP_DIFFUSE]; const DWORD *color_d = (const DWORD *)(element->data.addr + i * element->stride); - if (!(stream_info->use_map & (1 << WINED3D_FFP_DIFFUSE))) + if (!(stream_info->use_map & (1u << WINED3D_FFP_DIFFUSE))) { static BOOL warned = FALSE; @@ -2958,7 +2964,7 @@ /* What's the color value in the feedback buffer? */ const struct wined3d_stream_info_element *element = &stream_info->elements[WINED3D_FFP_SPECULAR]; const DWORD *color_s = (const DWORD *)(element->data.addr + i * element->stride); - if (!(stream_info->use_map & (1 << WINED3D_FFP_SPECULAR))) + if (!(stream_info->use_map & (1u << WINED3D_FFP_SPECULAR))) { static BOOL warned = FALSE; @@ -2980,7 +2986,7 @@ { const struct wined3d_stream_info_element *element = &stream_info->elements[WINED3D_FFP_TEXCOORD0 + tex_index]; const float *tex_coord = (const float *)(element->data.addr + i * element->stride); - if (!(stream_info->use_map & (1 << (WINED3D_FFP_TEXCOORD0 + tex_index)))) + if (!(stream_info->use_map & (1u << (WINED3D_FFP_TEXCOORD0 + tex_index)))) { ERR("No source texture, but destination requests one\n"); dest_ptr += GET_TEXCOORD_SIZE_FROM_FVF(DestFVF, tex_index) * sizeof(float); @@ -3090,7 +3096,7 @@ if (device->recording) { TRACE("Recording... not performing anything.\n"); - device->recording->changed.textureState[stage] |= 1 << state; + device->recording->changed.textureState[stage] |= 1u << state; return; } @@ -3143,7 +3149,7 @@ } if (device->recording) - device->recording->changed.textures |= 1 << stage; + device->recording->changed.textures |= 1u << stage; prev = device->update_state->textures[stage]; TRACE("Previous texture %p.\n", prev); @@ -3183,22 +3189,6 @@ return device->state.textures[stage]; } -HRESULT CDECL wined3d_device_get_back_buffer(const struct wined3d_device *device, UINT swapchain_idx, - UINT backbuffer_idx, enum wined3d_backbuffer_type backbuffer_type, struct wined3d_surface **backbuffer) -{ - struct wined3d_swapchain *swapchain; - - TRACE("device %p, swapchain_idx %u, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n", - device, swapchain_idx, backbuffer_idx, backbuffer_type, backbuffer); - - if (!(swapchain = wined3d_device_get_swapchain(device, swapchain_idx))) - return WINED3DERR_INVALIDCALL; - - if (!(*backbuffer = wined3d_swapchain_get_back_buffer(swapchain, backbuffer_idx, backbuffer_type))) - return WINED3DERR_INVALIDCALL; - return WINED3D_OK; -} - HRESULT CDECL wined3d_device_get_device_caps(const struct wined3d_device *device, WINED3DCAPS *caps) { TRACE("device %p, caps %p.\n", device, caps); @@ -3306,24 +3296,6 @@ return WINED3D_OK; } -HRESULT CDECL wined3d_device_present(const struct wined3d_device *device, const RECT *src_rect, - const RECT *dst_rect, HWND dst_window_override, const RGNDATA *dirty_region, DWORD flags) -{ - UINT i; - - TRACE("device %p, src_rect %s, dst_rect %s, dst_window_override %p, dirty_region %p, flags %#x.\n", - device, wine_dbgstr_rect(src_rect), wine_dbgstr_rect(dst_rect), - dst_window_override, dirty_region, flags); - - for (i = 0; i < device->swapchain_count; ++i) - { - wined3d_swapchain_present(device->swapchains[i], src_rect, - dst_rect, dst_window_override, dirty_region, flags); - } - - return WINED3D_OK; -} - HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) { @@ -3666,19 +3638,6 @@ return WINED3D_OK; } -HRESULT CDECL wined3d_device_get_front_buffer_data(const struct wined3d_device *device, - UINT swapchain_idx, struct wined3d_surface *dst_surface) -{ - struct wined3d_swapchain *swapchain; - - TRACE("device %p, swapchain_idx %u, dst_surface %p.\n", device, swapchain_idx, dst_surface); - - if (!(swapchain = wined3d_device_get_swapchain(device, swapchain_idx))) - return WINED3DERR_INVALIDCALL; - - return wined3d_swapchain_get_front_buffer_data(swapchain, dst_surface); -} - HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device, DWORD *num_passes) { const struct wined3d_state *state = &device->state; @@ -3909,7 +3868,7 @@ } } -void CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *device, +HRESULT CDECL wined3d_device_copy_sub_resource_region(struct wined3d_device *device, struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, unsigned int dst_x, 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) @@ -3928,7 +3887,7 @@ if (src_resource == dst_resource && src_sub_resource_idx == dst_sub_resource_idx) { WARN("Source and destination are the same sub-resource.\n"); - return; + return WINED3DERR_INVALIDCALL; } if (src_resource->type != dst_resource->type) @@ -3936,7 +3895,7 @@ WARN("Resource types (%s / %s) don't match.\n", debug_d3dresourcetype(dst_resource->type), debug_d3dresourcetype(src_resource->type)); - return; + return WINED3DERR_INVALIDCALL; } if (src_resource->format->id != dst_resource->format->id) @@ -3944,20 +3903,20 @@ WARN("Resource formats (%s / %s) don't match.\n", debug_d3dformat(dst_resource->format->id), debug_d3dformat(src_resource->format->id)); - return; + return WINED3DERR_INVALIDCALL; } if (dst_resource->type != WINED3D_RTYPE_TEXTURE) { FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(dst_resource->type)); - return; + return WINED3DERR_INVALIDCALL; } dst_texture = wined3d_texture_from_resource(dst_resource); if (!(tmp = wined3d_texture_get_sub_resource(dst_texture, dst_sub_resource_idx))) { WARN("Invalid dst_sub_resource_idx %u.\n", dst_sub_resource_idx); - return; + return WINED3DERR_INVALIDCALL; } dst_surface = surface_from_resource(tmp); @@ -3965,7 +3924,7 @@ 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; + return WINED3DERR_INVALIDCALL; } src_surface = surface_from_resource(tmp); @@ -3981,6 +3940,8 @@ if (FAILED(hr = wined3d_surface_blt(dst_surface, &dst_rect, src_surface, &src_rect, 0, NULL, WINED3D_TEXF_POINT))) ERR("Failed to blit, hr %#x.\n", hr); + + return hr; } void CDECL wined3d_device_update_sub_resource(struct wined3d_device *device, struct wined3d_resource *resource, @@ -4049,7 +4010,7 @@ && src_rect.bottom == sub_resource->height) wined3d_texture_prepare_texture(texture, context, FALSE); else - surface_load_location(surface, WINED3D_LOCATION_TEXTURE_RGB); + surface_load_location(surface, context, WINED3D_LOCATION_TEXTURE_RGB); wined3d_texture_bind_and_dirtify(texture, context, FALSE); wined3d_surface_upload_data(surface, gl_info, resource->format, @@ -4237,10 +4198,22 @@ } HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device, - UINT x_hotspot, UINT y_hotspot, struct wined3d_surface *cursor_image) + UINT x_hotspot, UINT y_hotspot, struct wined3d_texture *texture, unsigned int sub_resource_idx) { - TRACE("device %p, x_hotspot %u, y_hotspot %u, cursor_image %p.\n", - device, x_hotspot, y_hotspot, cursor_image); + struct wined3d_display_mode mode; + struct wined3d_map_desc map_desc; + struct wined3d_resource *sub_resource; + struct wined3d_surface *cursor_image; + HRESULT hr; + + TRACE("device %p, x_hotspot %u, y_hotspot %u, texture %p, sub_resource_idx %u.\n", + device, x_hotspot, y_hotspot, texture, sub_resource_idx); + + if (!(sub_resource = wined3d_texture_get_sub_resource(texture, sub_resource_idx)) + || sub_resource->type != WINED3D_RTYPE_SURFACE) + return WINED3DERR_INVALIDCALL; + + cursor_image = surface_from_resource(sub_resource); if (device->cursor_texture) { @@ -4248,86 +4221,84 @@ device->cursor_texture = NULL; } - if (cursor_image) + if (cursor_image->resource.format->id != WINED3DFMT_B8G8R8A8_UNORM) { - struct wined3d_display_mode mode; - struct wined3d_map_desc map_desc; - HRESULT hr; + WARN("Surface %p has an invalid format %s.\n", + cursor_image, debug_d3dformat(cursor_image->resource.format->id)); + return WINED3DERR_INVALIDCALL; + } - /* MSDN: Cursor must be A8R8G8B8 */ - if (cursor_image->resource.format->id != WINED3DFMT_B8G8R8A8_UNORM) - { - WARN("surface %p has an invalid format.\n", cursor_image); - return WINED3DERR_INVALIDCALL; - } + if (FAILED(hr = wined3d_get_adapter_display_mode(device->wined3d, device->adapter->ordinal, &mode, NULL))) + { + ERR("Failed to get display mode, hr %#x.\n", hr); + return WINED3DERR_INVALIDCALL; + } - if (FAILED(hr = wined3d_get_adapter_display_mode(device->wined3d, device->adapter->ordinal, &mode, NULL))) - { - ERR("Failed to get display mode, hr %#x.\n", hr); - return WINED3DERR_INVALIDCALL; - } + if (cursor_image->resource.width > mode.width || cursor_image->resource.height > mode.height) + { + WARN("Surface %p dimensions are %ux%u, but screen dimensions are %ux%u.\n", + cursor_image, cursor_image->resource.width, cursor_image->resource.height, + mode.width, mode.height); + return WINED3DERR_INVALIDCALL; + } - /* MSDN: Cursor must be smaller than the display mode */ - if (cursor_image->resource.width > mode.width || cursor_image->resource.height > mode.height) - { - WARN("Surface %p dimensions are %ux%u, but screen dimensions are %ux%u.\n", - cursor_image, cursor_image->resource.width, cursor_image->resource.height, - mode.width, mode.height); - return WINED3DERR_INVALIDCALL; - } + /* TODO: MSDN: Cursor sizes must be a power of 2 */ - /* TODO: MSDN: Cursor sizes must be a power of 2 */ + /* Do not store the surface's pointer because the application may + * release it after setting the cursor image. Windows doesn't + * addref the set surface, so we can't do this either without + * creating circular refcount dependencies. */ + if (!(device->cursor_texture = wined3d_device_create_cursor_texture(device, cursor_image))) + { + ERR("Failed to create cursor texture.\n"); + return WINED3DERR_INVALIDCALL; + } - /* Do not store the surface's pointer because the application may - * release it after setting the cursor image. Windows doesn't - * addref the set surface, so we can't do this either without - * creating circular refcount dependencies. */ - if (!(device->cursor_texture = wined3d_device_create_cursor_texture(device, cursor_image))) - { - ERR("Failed to create cursor texture.\n"); - return WINED3DERR_INVALIDCALL; - } + if (cursor_image->resource.width == 32 && cursor_image->resource.height == 32) + { + UINT mask_size = cursor_image->resource.width * cursor_image->resource.height / 8; + ICONINFO cursor_info; + DWORD *mask_bits; + HCURSOR cursor; + + /* 32-bit user32 cursors ignore the alpha channel if it's all + * zeroes, and use the mask instead. Fill the mask with all ones + * to ensure we still get a fully transparent cursor. */ + if (!(mask_bits = HeapAlloc(GetProcessHeap(), 0, mask_size))) + return E_OUTOFMEMORY; + memset(mask_bits, 0xff, mask_size); - device->cursorWidth = cursor_image->resource.width; - device->cursorHeight = cursor_image->resource.height; + wined3d_surface_map(cursor_image, &map_desc, NULL, WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY); + cursor_info.fIcon = FALSE; + cursor_info.xHotspot = x_hotspot; + cursor_info.yHotspot = y_hotspot; + cursor_info.hbmMask = CreateBitmap(cursor_image->resource.width, + 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); + wined3d_surface_unmap(cursor_image); + + /* Create our cursor and clean up. */ + cursor = CreateIconIndirect(&cursor_info); + if (cursor_info.hbmMask) + DeleteObject(cursor_info.hbmMask); + if (cursor_info.hbmColor) + DeleteObject(cursor_info.hbmColor); + if (device->hardwareCursor) + DestroyCursor(device->hardwareCursor); + device->hardwareCursor = cursor; + if (device->bCursorVisible) + SetCursor(cursor); - if (cursor_image->resource.width == 32 && cursor_image->resource.height == 32) - { - UINT mask_size = cursor_image->resource.width * cursor_image->resource.height / 8; - ICONINFO cursorInfo; - DWORD *maskBits; - HCURSOR cursor; - - /* 32-bit user32 cursors ignore the alpha channel if it's all - * zeroes, and use the mask instead. Fill the mask with all ones - * to ensure we still get a fully transparent cursor. */ - maskBits = HeapAlloc(GetProcessHeap(), 0, mask_size); - memset(maskBits, 0xff, mask_size); - wined3d_surface_map(cursor_image, &map_desc, NULL, - WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY); - TRACE("width: %u height: %u.\n", cursor_image->resource.width, cursor_image->resource.height); - - cursorInfo.fIcon = FALSE; - cursorInfo.xHotspot = x_hotspot; - cursorInfo.yHotspot = y_hotspot; - cursorInfo.hbmMask = CreateBitmap(cursor_image->resource.width, cursor_image->resource.height, - 1, 1, maskBits); - cursorInfo.hbmColor = CreateBitmap(cursor_image->resource.width, cursor_image->resource.height, - 1, 32, map_desc.data); - wined3d_surface_unmap(cursor_image); - /* Create our cursor and clean up. */ - cursor = CreateIconIndirect(&cursorInfo); - if (cursorInfo.hbmMask) DeleteObject(cursorInfo.hbmMask); - if (cursorInfo.hbmColor) DeleteObject(cursorInfo.hbmColor); - if (device->hardwareCursor) DestroyCursor(device->hardwareCursor); - device->hardwareCursor = cursor; - if (device->bCursorVisible) SetCursor( cursor ); - HeapFree(GetProcessHeap(), 0, maskBits); - } + HeapFree(GetProcessHeap(), 0, mask_bits); } + TRACE("New cursor dimensions are %ux%u.\n", cursor_image->resource.width, cursor_image->resource.height); + device->cursorWidth = cursor_image->resource.width; + device->cursorHeight = cursor_image->resource.height; device->xHotSpot = x_hotspot; device->yHotSpot = y_hotspot; + return WINED3D_OK; } @@ -4519,7 +4490,8 @@ HRESULT hr = WINED3D_OK; unsigned int i; - TRACE("device %p, swapchain_desc %p, mode %p, callback %p.\n", device, swapchain_desc, mode, callback); + TRACE("device %p, swapchain_desc %p, mode %p, callback %p, reset_state %#x.\n", + device, swapchain_desc, mode, callback, reset_state); if (!(swapchain = wined3d_device_get_swapchain(device, 0))) { @@ -4554,7 +4526,7 @@ if (device->onscreen_depth_stencil) { - wined3d_surface_decref(device->onscreen_depth_stencil); + wined3d_texture_decref(device->onscreen_depth_stencil->container); device->onscreen_depth_stencil = NULL; } @@ -4701,32 +4673,37 @@ } if (swapchain->desc.enable_auto_depth_stencil) { - struct wined3d_resource_desc surface_desc; - struct wined3d_surface *surface; + struct wined3d_resource_desc texture_desc; + struct wined3d_texture *texture; + struct wined3d_rendertarget_view_desc view_desc; TRACE("Creating the depth stencil buffer\n"); - surface_desc.resource_type = WINED3D_RTYPE_SURFACE; - surface_desc.format = swapchain->desc.auto_depth_stencil_format; - surface_desc.multisample_type = swapchain->desc.multisample_type; - surface_desc.multisample_quality = swapchain->desc.multisample_quality; - surface_desc.usage = WINED3DUSAGE_DEPTHSTENCIL; - surface_desc.pool = WINED3D_POOL_DEFAULT; - surface_desc.width = swapchain->desc.backbuffer_width; - surface_desc.height = swapchain->desc.backbuffer_height; - surface_desc.depth = 1; - surface_desc.size = 0; + texture_desc.resource_type = WINED3D_RTYPE_TEXTURE; + texture_desc.format = swapchain->desc.auto_depth_stencil_format; + texture_desc.multisample_type = swapchain->desc.multisample_type; + texture_desc.multisample_quality = swapchain->desc.multisample_quality; + texture_desc.usage = WINED3DUSAGE_DEPTHSTENCIL; + texture_desc.pool = WINED3D_POOL_DEFAULT; + texture_desc.width = swapchain->desc.backbuffer_width; + texture_desc.height = swapchain->desc.backbuffer_height; + texture_desc.depth = 1; + texture_desc.size = 0; - if (FAILED(hr = device->device_parent->ops->create_swapchain_surface(device->device_parent, - device->device_parent, &surface_desc, &surface))) + if (FAILED(hr = device->device_parent->ops->create_swapchain_texture(device->device_parent, + device->device_parent, &texture_desc, &texture))) { ERR("Failed to create the auto depth/stencil surface, hr %#x.\n", hr); return WINED3DERR_INVALIDCALL; } - hr = wined3d_rendertarget_view_create_from_surface(surface, + view_desc.format_id = texture->resource.format->id; + view_desc.u.texture.level_idx = 0; + view_desc.u.texture.layer_idx = 0; + view_desc.u.texture.layer_count = 1; + hr = wined3d_rendertarget_view_create(&view_desc, &texture->resource, NULL, &wined3d_null_parent_ops, &device->auto_depth_stencil_view); - wined3d_surface_decref(surface); + wined3d_texture_decref(texture); if (FAILED(hr)) { ERR("Failed to create rendertarget view, hr %#x.\n", hr); @@ -5095,7 +5072,7 @@ context->dirtyArray[context->numDirtyEntries++] = rep; idx = rep / (sizeof(*context->isStateDirty) * CHAR_BIT); shift = rep & ((sizeof(*context->isStateDirty) * CHAR_BIT) - 1); - context->isStateDirty[idx] |= (1 << shift); + context->isStateDirty[idx] |= (1u << shift); } } diff -Nru wine1.7-1.7.50/dlls/wined3d/directx.c wine1.7-1.7.55/dlls/wined3d/directx.c --- wine1.7-1.7.50/dlls/wined3d/directx.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/directx.c 2015-11-13 14:32:40.000000000 +0000 @@ -1291,6 +1291,7 @@ {HW_VENDOR_AMD, CARD_AMD_RADEON_HD2600, "ATI Mobility Radeon HD 2600", DRIVER_AMD_R600, 256 }, {HW_VENDOR_AMD, CARD_AMD_RADEON_HD2900, "ATI Radeon HD 2900 XT", DRIVER_AMD_R600, 512 }, {HW_VENDOR_AMD, CARD_AMD_RADEON_HD3200, "ATI Radeon HD 3200 Graphics", DRIVER_AMD_R600, 128 }, + {HW_VENDOR_AMD, CARD_AMD_RADEON_HD3850, "ATI Radeon HD 3850 AGP", DRIVER_AMD_R600, 512 }, {HW_VENDOR_AMD, CARD_AMD_RADEON_HD4200M, "ATI Mobility Radeon HD 4200", DRIVER_AMD_R600, 256 }, {HW_VENDOR_AMD, CARD_AMD_RADEON_HD4350, "ATI Radeon HD 4350", DRIVER_AMD_R600, 256 }, {HW_VENDOR_AMD, CARD_AMD_RADEON_HD4600, "ATI Radeon HD 4600 Series", DRIVER_AMD_R600, 512 }, @@ -2019,7 +2020,7 @@ /* R600 */ {"R680", CARD_AMD_RADEON_HD2900}, {"R600", CARD_AMD_RADEON_HD2900}, - {"RV670", CARD_AMD_RADEON_HD2900}, + {"RV670", CARD_AMD_RADEON_HD3850}, {"RV635", CARD_AMD_RADEON_HD2600}, {"RV630", CARD_AMD_RADEON_HD2600}, {"RV620", CARD_AMD_RADEON_HD2350}, @@ -2923,6 +2924,9 @@ USE_GL_FUNC(glCompressedTexSubImage3D) /* OpenGL 1.3 */ USE_GL_FUNC(glCreateProgram) /* OpenGL 2.0 */ USE_GL_FUNC(glCreateShader) /* OpenGL 2.0 */ + USE_GL_FUNC(glDebugMessageCallback) /* OpenGL 4.3 */ + USE_GL_FUNC(glDebugMessageControl) /* OpenGL 4.3 */ + USE_GL_FUNC(glDebugMessageInsert) /* OpenGL 4.3 */ USE_GL_FUNC(glDeleteBuffers) /* OpenGL 1.5 */ USE_GL_FUNC(glDeleteProgram) /* OpenGL 2.0 */ USE_GL_FUNC(glDeleteQueries) /* OpenGL 1.5 */ @@ -2943,6 +2947,7 @@ USE_GL_FUNC(glGetAttribLocation) /* OpenGL 2.0 */ USE_GL_FUNC(glGetBufferSubData) /* OpenGL 1.5 */ USE_GL_FUNC(glGetCompressedTexImage) /* OpenGL 1.3 */ + USE_GL_FUNC(glGetDebugMessageLog) /* OpenGL 4.3 */ USE_GL_FUNC(glGetProgramInfoLog) /* OpenGL 2.0 */ USE_GL_FUNC(glGetProgramiv) /* OpenGL 2.0 */ USE_GL_FUNC(glGetQueryiv) /* OpenGL 1.5 */ @@ -3040,12 +3045,16 @@ MAP_GL_FUNCTION(glCompressedTexSubImage3D, glCompressedTexSubImage3DARB); MAP_GL_FUNCTION(glCreateProgram, glCreateProgramObjectARB); MAP_GL_FUNCTION(glCreateShader, glCreateShaderObjectARB); + MAP_GL_FUNCTION(glDebugMessageCallback, glDebugMessageCallbackARB); + MAP_GL_FUNCTION(glDebugMessageControl, glDebugMessageControlARB); + MAP_GL_FUNCTION(glDebugMessageInsert, glDebugMessageInsertARB); MAP_GL_FUNCTION(glDeleteBuffers, glDeleteBuffersARB); MAP_GL_FUNCTION(glDeleteProgram, glDeleteObjectARB); MAP_GL_FUNCTION(glDeleteQueries, glDeleteQueriesARB); MAP_GL_FUNCTION(glDeleteShader, glDeleteObjectARB); MAP_GL_FUNCTION(glDetachShader, glDetachObjectARB); MAP_GL_FUNCTION(glDisableVertexAttribArray, glDisableVertexAttribArrayARB); + MAP_GL_FUNCTION(glDrawArraysInstanced, glDrawArraysInstancedARB); MAP_GL_FUNCTION(glDrawBuffers, glDrawBuffersARB); MAP_GL_FUNCTION(glDrawElementsInstanced, glDrawElementsInstancedARB); MAP_GL_FUNCTION(glEnableVertexAttribArray, glEnableVertexAttribArrayARB); @@ -3057,6 +3066,7 @@ MAP_GL_FUNCTION(glGetAttribLocation, glGetAttribLocationARB); MAP_GL_FUNCTION(glGetBufferSubData, glGetBufferSubDataARB); MAP_GL_FUNCTION(glGetCompressedTexImage, glGetCompressedTexImageARB); + MAP_GL_FUNCTION(glGetDebugMessageLog, glGetDebugMessageLogARB); MAP_GL_FUNCTION(glGetProgramInfoLog, glGetInfoLogARB); MAP_GL_FUNCTION(glGetProgramiv, glGetObjectParameterivARB); MAP_GL_FUNCTION(glGetQueryiv, glGetQueryivARB); @@ -3544,6 +3554,8 @@ if (gl_version >= MAKEDWORD_VERSION(2, 0)) gl_info->supported[WINED3D_GL_VERSION_2_0] = TRUE; + if (gl_version >= MAKEDWORD_VERSION(3, 2)) + gl_info->supported[WINED3D_GL_VERSION_3_2] = TRUE; if (gl_info->supported[APPLE_FENCE]) { @@ -3707,11 +3719,13 @@ adapter->d3d_info.limits.ps_version = shader_caps.ps_version; adapter->d3d_info.limits.vs_uniform_count = shader_caps.vs_uniform_count; adapter->d3d_info.limits.ps_uniform_count = shader_caps.ps_uniform_count; + adapter->d3d_info.limits.varying_count = shader_caps.varying_count; adapter->vertex_pipe->vp_get_caps(gl_info, &vertex_caps); adapter->d3d_info.xyzrhw = vertex_caps.xyzrhw; adapter->d3d_info.ffp_generic_attributes = vertex_caps.ffp_generic_attributes; adapter->d3d_info.limits.ffp_vertex_blend_matrices = vertex_caps.max_vertex_blend_matrices; + adapter->d3d_info.emulated_flatshading = vertex_caps.emulated_flatshading; adapter->fragment_pipe->get_caps(gl_info, &fragment_caps); adapter->d3d_info.limits.ffp_blend_stages = fragment_caps.MaxTextureBlendStages; @@ -3799,7 +3813,7 @@ adapter->d3d_info.valid_rt_mask = 0; for (i = 0; i < gl_info->limits.buffers; ++i) - adapter->d3d_info.valid_rt_mask |= (1 << i); + adapter->d3d_info.valid_rt_mask |= (1u << i); if (!gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) { @@ -4258,50 +4272,28 @@ static BOOL wined3d_check_pixel_format_color(const struct wined3d_gl_info *gl_info, const struct wined3d_pixel_format *cfg, const struct wined3d_format *format) { - BYTE redSize, greenSize, blueSize, alphaSize, colorBits; - /* Float formats need FBOs. If FBOs are used this function isn't called */ if (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_FLOAT) return FALSE; - if(cfg->iPixelType == WGL_TYPE_RGBA_ARB) { /* Integer RGBA formats */ - if (!getColorBits(format, &redSize, &greenSize, &blueSize, &alphaSize, &colorBits)) - { - ERR("Unable to check compatibility for format %s.\n", debug_d3dformat(format->id)); - return FALSE; - } - - if(cfg->redSize < redSize) - return FALSE; - - if(cfg->greenSize < greenSize) - return FALSE; - - if(cfg->blueSize < blueSize) - return FALSE; - - if(cfg->alphaSize < alphaSize) - return FALSE; + /* Probably a RGBA_float or color index mode. */ + if (cfg->iPixelType != WGL_TYPE_RGBA_ARB) + return FALSE; - return TRUE; - } + if (cfg->redSize < format->red_size + || cfg->greenSize < format->green_size + || cfg->blueSize < format->blue_size + || cfg->alphaSize < format->alpha_size) + return FALSE; - /* Probably a RGBA_float or color index mode */ - return FALSE; + return TRUE; } static BOOL wined3d_check_pixel_format_depth(const struct wined3d_gl_info *gl_info, const struct wined3d_pixel_format *cfg, const struct wined3d_format *format) { - BYTE depthSize, stencilSize; BOOL lockable = FALSE; - if (!getDepthStencilBits(format, &depthSize, &stencilSize)) - { - ERR("Unable to check compatibility for format %s.\n", debug_d3dformat(format->id)); - return FALSE; - } - /* Float formats need FBOs. If FBOs are used this function isn't called */ if (format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_FLOAT) return FALSE; @@ -4309,15 +4301,19 @@ if ((format->id == WINED3DFMT_D16_LOCKABLE) || (format->id == WINED3DFMT_D32_FLOAT)) lockable = TRUE; - /* On some modern cards like the Geforce8/9 GLX doesn't offer some dephthstencil formats which D3D9 reports. - * We can safely report 'compatible' formats (e.g. D24 can be used for D16) as long as we aren't dealing with - * a lockable format. This also helps D3D <= 7 as they expect D16 which isn't offered without this on Geforce8 cards. */ - if(!(cfg->depthSize == depthSize || (!lockable && cfg->depthSize > depthSize))) + /* On some modern cards like the Geforce8/9, GLX doesn't offer some + * dephth/stencil formats which D3D9 reports. We can safely report + * "compatible" formats (e.g. D24 can be used for D16) as long as we + * aren't dealing with a lockable format. This also helps D3D <= 7 as they + * expect D16 which isn't offered without this on Geforce8 cards. */ + if (!(cfg->depthSize == format->depth_size || (!lockable && cfg->depthSize > format->depth_size))) return FALSE; - /* Some cards like Intel i915 ones only offer D24S8 but lots of games also need a format without stencil, so - * allow more stencil bits than requested. */ - if(cfg->stencilSize < stencilSize) + /* Some cards like Intel i915 ones only offer D24S8 but lots of games also + * need a format without stencil. We can allow a mismatch if the format + * doesn't have any stencil bits. If it does have stencil bits the size + * must match, or stencil wrapping would break. */ + if (format->stencil_size && cfg->stencilSize != format->stencil_size) return FALSE; return TRUE; @@ -4405,7 +4401,6 @@ if (quality_levels) { if (multisample_type == WINED3D_MULTISAMPLE_NON_MASKABLE) - /* FIXME: This is probably wrong. */ *quality_levels = gl_info->limits.samples; else *quality_levels = 1; @@ -4467,17 +4462,15 @@ return FALSE; if (wined3d_settings.offscreen_rendering_mode == ORM_BACKBUFFER) { - BYTE AdapterRed, AdapterGreen, AdapterBlue, AdapterAlpha, AdapterTotalSize; - BYTE CheckRed, CheckGreen, CheckBlue, CheckAlpha, CheckTotalSize; const struct wined3d_pixel_format *cfgs = adapter->cfgs; unsigned int i; - getColorBits(adapter_format, &AdapterRed, &AdapterGreen, &AdapterBlue, &AdapterAlpha, &AdapterTotalSize); - getColorBits(check_format, &CheckRed, &CheckGreen, &CheckBlue, &CheckAlpha, &CheckTotalSize); - - /* In backbuffer mode the front and backbuffer share the same WGL pixelformat. - * The format must match in RGB, alpha is allowed to be different. (Only the backbuffer can have alpha) */ - if (!((AdapterRed == CheckRed) && (AdapterGreen == CheckGreen) && (AdapterBlue == CheckBlue))) + /* In backbuffer mode the front and backbuffer share the same WGL + * pixelformat. The format must match in RGB, alpha is allowed to be + * different. (Only the backbuffer can have alpha.) */ + if (adapter_format->red_size != check_format->red_size + || adapter_format->green_size != check_format->green_size + || adapter_format->blue_size != check_format->blue_size) { TRACE("[FAILED]\n"); return FALSE; @@ -5452,8 +5445,8 @@ struct wined3d_device *object; HRESULT hr; - TRACE("wined3d %p, adapter_idx %u, device_type %#x, focus_window %p, flags %#x, device_parent %p, device %p.\n", - wined3d, adapter_idx, device_type, focus_window, flags, device_parent, device); + TRACE("wined3d %p, adapter_idx %u, device_type %#x, focus_window %p, flags %#x, surface_alignment %u, device_parent %p, device %p.\n", + wined3d, adapter_idx, device_type, focus_window, flags, surface_alignment, device_parent, device); /* Validate the adapter number. If no adapters are available(no GL), ignore the adapter * number and create a device without a 3D adapter for 2D only operation. */ diff -Nru wine1.7-1.7.50/dlls/wined3d/drawprim.c wine1.7-1.7.55/dlls/wined3d/drawprim.c --- wine1.7-1.7.50/dlls/wined3d/drawprim.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/drawprim.c 2015-11-13 14:32:40.000000000 +0000 @@ -139,13 +139,13 @@ /* Start drawing in GL */ gl_info->gl_ops.gl.p_glBegin(glPrimType); - if (si->use_map & (1 << WINED3D_FFP_POSITION)) + if (si->use_map & (1u << WINED3D_FFP_POSITION)) { element = &si->elements[WINED3D_FFP_POSITION]; position = element->data.addr; } - if (si->use_map & (1 << WINED3D_FFP_NORMAL)) + if (si->use_map & (1u << WINED3D_FFP_NORMAL)) { element = &si->elements[WINED3D_FFP_NORMAL]; normal = element->data.addr; @@ -156,7 +156,7 @@ } num_untracked_materials = context->num_untracked_materials; - if (si->use_map & (1 << WINED3D_FFP_DIFFUSE)) + if (si->use_map & (1u << WINED3D_FFP_DIFFUSE)) { element = &si->elements[WINED3D_FFP_DIFFUSE]; diffuse = element->data.addr; @@ -169,7 +169,7 @@ gl_info->gl_ops.gl.p_glColor4f(1.0f, 1.0f, 1.0f, 1.0f); } - if (si->use_map & (1 << WINED3D_FFP_SPECULAR)) + if (si->use_map & (1u << WINED3D_FFP_SPECULAR)) { element = &si->elements[WINED3D_FFP_SPECULAR]; specular = element->data.addr; @@ -229,11 +229,11 @@ continue; } - if (si->use_map & (1 << (WINED3D_FFP_TEXCOORD0 + coordIdx))) + if (si->use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coordIdx))) { element = &si->elements[WINED3D_FFP_TEXCOORD0 + coordIdx]; texCoords[coordIdx] = element->data.addr; - tex_mask |= (1 << textureNo); + tex_mask |= (1u << textureNo); } else { @@ -368,9 +368,9 @@ if (gl_info->supported[ARB_VERTEX_ARRAY_BGRA]) { const DWORD *src = ptr; - DWORD c = *src & 0xff00ff00; - c |= (*src & 0xff0000) >> 16; - c |= (*src & 0xff) << 16; + DWORD c = *src & 0xff00ff00u; + c |= (*src & 0xff0000u) >> 16; + c |= (*src & 0xffu) << 16; GL_EXTCALL(glVertexAttrib4Nubv(index, (GLubyte *)&c)); break; } @@ -497,7 +497,7 @@ for (i = MAX_ATTRIBS - 1; i >= 0; i--) { - if (!(si->use_map & (1 << i))) continue; + if (!(si->use_map & (1u << i))) continue; ptr = si->elements[i].data.addr + si->elements[i].stride * SkipnStrides; @@ -534,7 +534,7 @@ for (i = 0; i < sizeof(si->elements) / sizeof(*si->elements); ++i) { - if (!(si->use_map & (1 << i))) continue; + if (!(si->use_map & (1u << i))) continue; if (state->streams[si->elements[i].stream_idx].flags & WINED3DSTREAMSOURCE_INSTANCEDATA) { @@ -582,7 +582,7 @@ { struct wined3d_stream_info_element *e; - if (!(s->use_map & (1 << i))) continue; + if (!(s->use_map & (1u << i))) continue; e = &s->elements[i]; if (e->data.buffer_object) @@ -611,20 +611,6 @@ if (!index_count) return; - if (state->render_states[WINED3D_RS_COLORWRITEENABLE]) - { - /* Invalidate the back buffer memory so LockRect will read it the next time */ - for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) - { - struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(device->fb.render_targets[i]); - if (target) - { - surface_load_location(target, target->container->resource.draw_binding); - surface_invalidate_location(target, ~target->container->resource.draw_binding); - } - } - } - context = context_acquire(device, wined3d_rendertarget_view_get_surface(device->fb.render_targets[0])); if (!context->valid) { @@ -634,6 +620,23 @@ } gl_info = context->gl_info; + for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) + { + struct wined3d_surface *target = wined3d_rendertarget_view_get_surface(device->fb.render_targets[i]); + if (target && target->resource.format->id != WINED3DFMT_NULL) + { + if (state->render_states[WINED3D_RS_COLORWRITEENABLE]) + { + surface_load_location(target, context, target->container->resource.draw_binding); + surface_invalidate_location(target, ~target->container->resource.draw_binding); + } + else + { + wined3d_surface_prepare(target, context, target->container->resource.draw_binding); + } + } + } + if (device->fb.depth_stencil) { /* Note that this depends on the context_acquire() call above to set @@ -643,9 +646,10 @@ * that we never copy the stencil data.*/ DWORD location = context->render_offscreen ? device->fb.depth_stencil->resource->draw_binding : WINED3D_LOCATION_DRAWABLE; + struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(device->fb.depth_stencil); + if (state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_ZENABLE]) { - struct wined3d_surface *ds = wined3d_rendertarget_view_get_surface(device->fb.depth_stencil); RECT current_rect, draw_rect, r; if (!context->render_offscreen && ds != device->onscreen_depth_stencil) @@ -661,7 +665,11 @@ IntersectRect(&r, &draw_rect, ¤t_rect); if (!EqualRect(&r, &draw_rect)) surface_load_ds_location(ds, context, location); + else + wined3d_surface_prepare(ds, context, location); } + else + wined3d_surface_prepare(ds, context, location); } if (!context_apply_draw_state(context, device)) diff -Nru wine1.7-1.7.50/dlls/wined3d/glsl_shader.c wine1.7-1.7.55/dlls/wined3d/glsl_shader.c --- wine1.7-1.7.50/dlls/wined3d/glsl_shader.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/glsl_shader.c 2015-11-13 14:32:40.000000000 +0000 @@ -66,6 +66,7 @@ struct wined3d_string_buffer *name; DWORD coord_mask; enum wined3d_data_type data_type; + BOOL output_single_component; }; enum heap_node_op @@ -1266,12 +1267,11 @@ static void shader_glsl_load_color_key_constant(const struct glsl_ps_program *ps, const struct wined3d_gl_info *gl_info, const struct wined3d_state *state) { - struct wined3d_color float_key; + struct wined3d_color float_key[2]; const struct wined3d_texture *texture = state->textures[0]; - wined3d_format_convert_color_to_float(texture->resource.format, NULL, - texture->async.src_blt_color_key.color_space_high_value, &float_key); - GL_EXTCALL(glUniform4fv(ps->color_key_location, 1, &float_key.r)); + wined3d_format_get_float_color_key(texture->resource.format, &texture->async.src_blt_color_key, float_key); + GL_EXTCALL(glUniform4fv(ps->color_key_location, 2, &float_key[0].r)); } /* Context activation is done by the caller (state handler). */ @@ -1542,6 +1542,80 @@ return ret; } +static BOOL needs_legacy_glsl_syntax(const struct wined3d_gl_info *gl_info) +{ + return gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]; +} + +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, ...) +{ + va_list args; + int ret; + + shader_addline(buffer, "%s%s ", flat ? "flat " : "", + needs_legacy_glsl_syntax(gl_info) ? "varying" : "in"); + for (;;) + { + va_start(args, format); + ret = shader_vaddline(buffer, format, args); + va_end(args); + if (!ret) + return; + if (!string_buffer_resize(buffer, ret)) + return; + } +} + +static void PRINTF_ATTR(4, 5) declare_out_varying(const struct wined3d_gl_info *gl_info, + struct wined3d_string_buffer *buffer, BOOL flat, const char *format, ...) +{ + va_list args; + int ret; + + shader_addline(buffer, "%s%s ", flat ? "flat " : "", + needs_legacy_glsl_syntax(gl_info) ? "varying" : "out"); + for (;;) + { + va_start(args, format); + ret = shader_vaddline(buffer, format, args); + va_end(args); + if (!ret) + return; + if (!string_buffer_resize(buffer, ret)) + return; + } +} + +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; + const struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps; + const BOOL *input_reg_used = shader->u.ps.input_reg_used; + unsigned int i; + + if (reg_maps->shader_version.major < 3) + return input_reg_used[idx]; + + for (i = 0; i < input_signature->element_count; ++i) + { + const struct wined3d_shader_signature_element *input = &input_signature->elements[i]; + + if (!(reg_maps->input_registers & (1u << input->register_idx))) + continue; + + if (shader_match_semantic(input->semantic_name, WINED3D_DECL_USAGE_COLOR) + && input->semantic_idx == idx) + { + if (input_reg_used[input->register_idx]) + return TRUE; + else + return FALSE; + } + } + return FALSE; +} + /** 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, @@ -1608,10 +1682,8 @@ * Writing gl_ClipVertex requires one uniform for each * clipplane as well. */ max_constantsF = gl_info->limits.glsl_vs_float_constants - 3; - if(ctx_priv->cur_vs_args->clip_enabled) - { + if (vs_args->clip_enabled) max_constantsF -= gl_info->limits.clipplanes; - } max_constantsF -= count_bits(reg_maps->integer_constants); /* Strictly speaking a bool only uses one scalar, but the nvidia(Linux) compiler doesn't pack them properly, * so each scalar requires a full vec4. We could work around this by packing the booleans ourselves, but @@ -1672,7 +1744,7 @@ continue; } - shadow_sampler = version->type == WINED3D_SHADER_TYPE_PIXEL && (ps_args->shadow & (1 << entry->sampler_idx)); + shadow_sampler = version->type == WINED3D_SHADER_TYPE_PIXEL && (ps_args->shadow & (1u << entry->sampler_idx)); switch (reg_maps->resource_info[entry->resource_idx].type) { case WINED3D_SHADER_RESOURCE_TEXTURE_1D: @@ -1684,7 +1756,7 @@ case WINED3D_SHADER_RESOURCE_TEXTURE_2D: tex_rect = version->type == WINED3D_SHADER_TYPE_PIXEL - && (ps_args->np2_fixup & (1 << entry->resource_idx)) + && (ps_args->np2_fixup & (1u << entry->resource_idx)) && gl_info->supported[ARB_TEXTURE_RECTANGLE]; if (shadow_sampler) { @@ -1739,7 +1811,7 @@ for (i = 0; i < shader->limits->sampler; ++i) { - if (!reg_maps->resource_info[i].type || !(ps_args->np2_fixup & (1 << i))) + if (!reg_maps->resource_info[i].type || !(ps_args->np2_fixup & (1u << i))) continue; if (reg_maps->resource_info[i].type != WINED3D_SHADER_RESOURCE_TEXTURE_2D) @@ -1762,12 +1834,6 @@ if (map & 1) shader_addline(buffer, "ivec4 A%u;\n", i); } - /* Declare texture coordinate temporaries and initialize them */ - for (i = 0, map = reg_maps->texcoord; map; map >>= 1, ++i) - { - if (map & 1) shader_addline(buffer, "vec4 T%u = gl_TexCoord[%u];\n", i, i); - } - if (version->type == WINED3D_SHADER_TYPE_VERTEX) { for (i = 0; i < shader->input_signature.element_count; ++i) @@ -1789,6 +1855,14 @@ shader_addline(buffer, "} ffp_point;\n"); } + if (!gl_info->supported[WINED3D_GL_LEGACY_CONTEXT] && version->major < 3) + { + declare_out_varying(gl_info, buffer, vs_args->flatshading, "vec4 ffp_varying_diffuse;\n"); + declare_out_varying(gl_info, buffer, vs_args->flatshading, "vec4 ffp_varying_specular;\n"); + declare_out_varying(gl_info, buffer, FALSE, "vec4 ffp_varying_texcoord[%u];\n", MAX_TEXTURES); + declare_out_varying(gl_info, buffer, FALSE, "float ffp_varying_fogcoord;\n"); + } + shader_addline(buffer, "uniform vec4 posFixup;\n"); shader_addline(buffer, "void order_ps_input(in vec4[%u]);\n", shader->limits->packed_output); } @@ -1806,6 +1880,26 @@ shader_addline(buffer, " float end;\n"); shader_addline(buffer, " float scale;\n"); shader_addline(buffer, "} ffp_fog;\n"); + + if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) + { + if (glsl_is_color_reg_read(shader, 0)) + shader_addline(buffer, "vec4 ffp_varying_diffuse;\n"); + if (glsl_is_color_reg_read(shader, 1)) + shader_addline(buffer, "vec4 ffp_varying_specular;\n"); + shader_addline(buffer, "vec4 ffp_texcoord[%u];\n", MAX_TEXTURES); + shader_addline(buffer, "float ffp_varying_fogcoord;\n"); + } + else + { + if (glsl_is_color_reg_read(shader, 0)) + declare_in_varying(gl_info, buffer, ps_args->flatshading, "vec4 ffp_varying_diffuse;\n"); + if (glsl_is_color_reg_read(shader, 1)) + declare_in_varying(gl_info, buffer, ps_args->flatshading, "vec4 ffp_varying_specular;\n"); + declare_in_varying(gl_info, buffer, FALSE, "vec4 ffp_varying_texcoord[%u];\n", MAX_TEXTURES); + shader_addline(buffer, "vec4 ffp_texcoord[%u];\n", MAX_TEXTURES); + declare_in_varying(gl_info, buffer, FALSE, "float ffp_varying_fogcoord;\n"); + } } if (version->major >= 3) @@ -1813,7 +1907,7 @@ UINT in_count = min(vec4_varyings(version->major, gl_info), shader->limits->packed_input); if (use_vs(state)) - shader_addline(buffer, "varying vec4 %s_link[%u];\n", prefix, in_count); + declare_in_varying(gl_info, buffer, FALSE, "vec4 %s_link[%u];\n", prefix, in_count); shader_addline(buffer, "vec4 %s_in[%u];\n", prefix, in_count); } @@ -1824,7 +1918,7 @@ shader_addline(buffer, "uniform mat2 bumpenv_mat%u;\n", i); - if (reg_maps->luminanceparams & (1 << i)) + if (reg_maps->luminanceparams & (1u << i)) { shader_addline(buffer, "uniform float bumpenv_lum_scale%u;\n", i); shader_addline(buffer, "uniform float bumpenv_lum_offset%u;\n", i); @@ -2052,7 +2146,7 @@ if (version->type == WINED3D_SHADER_TYPE_VERTEX) { struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data; - if (priv->cur_vs_args->swizzle_map & (1 << reg->idx[0].offset)) + if (priv->cur_vs_args->swizzle_map & (1u << reg->idx[0].offset)) *is_color = TRUE; sprintf(register_name, "%s_in%u", prefix, reg->idx[0].offset); break; @@ -2089,7 +2183,8 @@ * OS X doesn't see the NOP operation there. */ if (idx) { - if (shader->u.ps.declared_in_count > in_count) + if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT] + && shader->u.ps.declared_in_count > in_count) { sprintf(register_name, "((%s + %u) > %u ? (%s + %u) > %u ? gl_SecondaryColor : gl_Color : %s_in[%s + %u])", @@ -2103,7 +2198,8 @@ } else { - if (shader->u.ps.declared_in_count > in_count) + if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT] + && shader->u.ps.declared_in_count > in_count) { sprintf(register_name, "((%s) > %u ? (%s) > %u ? gl_SecondaryColor : gl_Color : %s_in[%s])", rel_param0.param_str, in_count - 1, rel_param0.param_str, in_count, @@ -2125,9 +2221,9 @@ else { if (!reg->idx[0].offset) - strcpy(register_name, "gl_Color"); + strcpy(register_name, "ffp_varying_diffuse"); else - strcpy(register_name, "gl_SecondaryColor"); + strcpy(register_name, "ffp_varying_specular"); break; } break; @@ -2540,7 +2636,7 @@ 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 & (1 << resource_idx)); + && (priv->cur_ps_args->shadow & (1u << resource_idx)); BOOL projected = flags & WINED3D_GLSL_SAMPLE_PROJECTED; BOOL texrect = flags & WINED3D_GLSL_SAMPLE_NPOT && gl_info->supported[ARB_TEXTURE_RECTANGLE]; BOOL lod = flags & WINED3D_GLSL_SAMPLE_LOD; @@ -2560,21 +2656,24 @@ if (resource_type == WINED3D_SHADER_RESOURCE_TEXTURE_CUBE) projected = FALSE; - if (shadow) - base = "shadow"; + if (needs_legacy_glsl_syntax(gl_info)) + { + if (shadow) + base = "shadow"; - type_part = resource_types[resource_type].type_part; - if (resource_type == WINED3D_SHADER_RESOURCE_TEXTURE_2D && texrect) - type_part = "2DRect"; - if (!type_part[0]) - FIXME("Unhandled resource type %#x.\n", resource_type); + type_part = resource_types[resource_type].type_part; + if (resource_type == WINED3D_SHADER_RESOURCE_TEXTURE_2D && texrect) + type_part = "2DRect"; + if (!type_part[0]) + FIXME("Unhandled resource type %#x.\n", resource_type); - if (!lod && grad && !gl_info->supported[EXT_GPU_SHADER4]) - { - if (gl_info->supported[ARB_SHADER_TEXTURE_LOD]) - suffix = "ARB"; - else - FIXME("Unsupported grad function.\n"); + if (!lod && grad && !gl_info->supported[EXT_GPU_SHADER4]) + { + if (gl_info->supported[ARB_SHADER_TEXTURE_LOD]) + suffix = "ARB"; + else + FIXME("Unsupported grad function.\n"); + } } sample_function->name = string_buffer_get(priv->string_buffers); @@ -2584,7 +2683,8 @@ coord_size = resource_types[resource_type].coord_size; if (shadow) ++coord_size; - sample_function->coord_mask = (1 << coord_size) - 1; + sample_function->coord_mask = (1u << coord_size) - 1; + sample_function->output_single_component = shadow && !needs_legacy_glsl_syntax(gl_info); } static void shader_glsl_release_sample_function(const struct wined3d_shader_context *ctx, @@ -2721,7 +2821,7 @@ const struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data; fixup = priv->cur_ps_args->color_fixup[sampler]; - if (priv->cur_ps_args->np2_fixup & (1 << sampler)) + if (priv->cur_ps_args->np2_fixup & (1u << sampler)) np2_fixup = TRUE; } else @@ -2731,6 +2831,9 @@ shader_glsl_append_dst_ext(ins->ctx->buffer, ins, &ins->dst[0], sample_function->data_type); + if (sample_function->output_single_component) + shader_addline(ins->ctx->buffer, "vec4("); + shader_addline(ins->ctx->buffer, "%s(%s_sampler%u, ", sample_function->name->buffer, shader_glsl_get_prefix(version->type), sampler); @@ -2777,6 +2880,9 @@ else shader_addline(ins->ctx->buffer, ")"); + if (sample_function->output_single_component) + shader_addline(ins->ctx->buffer, ")"); + shader_addline(ins->ctx->buffer, "%s);\n", dst_swizzle); if (!is_identity_fixup(fixup)) @@ -4007,7 +4113,7 @@ } } - if (priv->cur_ps_args->np2_fixup & (1 << resource_idx)) + 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); @@ -4062,7 +4168,7 @@ } sampler_idx = ins->src[1].reg.idx[0].offset; - if (priv->cur_ps_args->np2_fixup & (1 << sampler_idx)) + 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); @@ -4087,7 +4193,7 @@ 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 & (1 << sampler_idx)) + && 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); @@ -4151,7 +4257,7 @@ char dst_mask[6]; shader_glsl_get_write_mask(&ins->dst[0], dst_mask); - shader_addline(buffer, "clamp(gl_TexCoord[%u], 0.0, 1.0)%s);\n", + shader_addline(buffer, "clamp(ffp_texcoord[%u], 0.0, 1.0)%s);\n", ins->dst[0].reg.idx[0].offset, dst_mask); } else @@ -4162,33 +4268,22 @@ shader_glsl_get_swizzle(&ins->src[0], FALSE, write_mask, dst_swizzle); - if (src_mod == WINED3DSPSM_DZ) + if (src_mod == WINED3DSPSM_DZ || src_mod == WINED3DSPSM_DW) { unsigned int mask_size = shader_glsl_get_write_mask_size(write_mask); struct glsl_src_param div_param; + DWORD src_writemask = src_mod == WINED3DSPSM_DZ ? WINED3DSP_WRITEMASK_2 : WINED3DSP_WRITEMASK_3; - shader_glsl_add_src_param(ins, &ins->src[0], WINED3DSP_WRITEMASK_2, &div_param); + shader_glsl_add_src_param(ins, &ins->src[0], src_writemask, &div_param); - if (mask_size > 1) { - shader_addline(buffer, "gl_TexCoord[%u]%s / vec%d(%s));\n", reg, dst_swizzle, mask_size, div_param.param_str); - } else { - shader_addline(buffer, "gl_TexCoord[%u]%s / %s);\n", reg, dst_swizzle, div_param.param_str); - } + if (mask_size > 1) + shader_addline(buffer, "ffp_texcoord[%u]%s / vec%d(%s));\n", reg, dst_swizzle, mask_size, div_param.param_str); + else + shader_addline(buffer, "ffp_texcoord[%u]%s / %s);\n", reg, dst_swizzle, div_param.param_str); } - else if (src_mod == WINED3DSPSM_DW) + else { - unsigned int mask_size = shader_glsl_get_write_mask_size(write_mask); - struct glsl_src_param div_param; - - shader_glsl_add_src_param(ins, &ins->src[0], WINED3DSP_WRITEMASK_3, &div_param); - - if (mask_size > 1) { - shader_addline(buffer, "gl_TexCoord[%u]%s / vec%d(%s));\n", reg, dst_swizzle, mask_size, div_param.param_str); - } else { - shader_addline(buffer, "gl_TexCoord[%u]%s / %s);\n", reg, dst_swizzle, div_param.param_str); - } - } else { - shader_addline(buffer, "gl_TexCoord[%u]%s);\n", reg, dst_swizzle); + shader_addline(buffer, "ffp_texcoord[%u]%s);\n", reg, dst_swizzle); } } } @@ -4218,17 +4313,17 @@ { case 1: shader_glsl_gen_sample_code(ins, sampler_idx, &sample_function, WINED3DSP_NOSWIZZLE, NULL, NULL, NULL, - "dot(gl_TexCoord[%u].xyz, %s)", sampler_idx, src0_param.param_str); + "dot(ffp_texcoord[%u].xyz, %s)", sampler_idx, src0_param.param_str); break; case 2: shader_glsl_gen_sample_code(ins, sampler_idx, &sample_function, WINED3DSP_NOSWIZZLE, NULL, NULL, NULL, - "vec2(dot(gl_TexCoord[%u].xyz, %s), 0.0)", sampler_idx, src0_param.param_str); + "vec2(dot(ffp_texcoord[%u].xyz, %s), 0.0)", sampler_idx, src0_param.param_str); break; case 3: shader_glsl_gen_sample_code(ins, sampler_idx, &sample_function, WINED3DSP_NOSWIZZLE, NULL, NULL, NULL, - "vec3(dot(gl_TexCoord[%u].xyz, %s), 0.0, 0.0)", sampler_idx, src0_param.param_str); + "vec3(dot(ffp_texcoord[%u].xyz, %s), 0.0, 0.0)", sampler_idx, src0_param.param_str); break; default: @@ -4433,7 +4528,7 @@ shader_addline(buffer, "tmp0.z = dot(vec3(T%u), vec3(%s));\n", reg, src0_param.param_str); /* Construct the eye-ray vector from w coordinates */ - shader_addline(buffer, "tmp1.xyz = normalize(vec3(gl_TexCoord[%u].w, gl_TexCoord[%u].w, gl_TexCoord[%u].w));\n", + shader_addline(buffer, "tmp1.xyz = normalize(vec3(ffp_texcoord[%u].w, ffp_texcoord[%u].w, ffp_texcoord[%u].w));\n", tex_mx->texcoord_w[0], tex_mx->texcoord_w[1], reg); shader_addline(buffer, "tmp0.xyz = -reflect(tmp1.xyz, normalize(tmp0.xyz));\n"); @@ -4641,7 +4736,7 @@ static void shader_glsl_input_pack(const struct wined3d_shader *shader, struct wined3d_string_buffer *buffer, const struct wined3d_shader_signature *input_signature, const struct wined3d_shader_reg_maps *reg_maps, - const struct ps_compile_args *args) + const struct ps_compile_args *args, const struct wined3d_gl_info *gl_info) { unsigned int i; @@ -4653,7 +4748,7 @@ char reg_mask[6]; /* Unused */ - if (!(reg_maps->input_registers & (1 << input->register_idx))) + if (!(reg_maps->input_registers & (1u << input->register_idx))) continue; semantic_name = input->semantic_name; @@ -4674,9 +4769,14 @@ } else if (shader_match_semantic(semantic_name, WINED3D_DECL_USAGE_TEXCOORD)) { - if (semantic_idx < 8 && args->vp_mode == pretransformed) - shader_addline(buffer, "ps_in[%u]%s = gl_TexCoord[%u]%s;\n", - shader->u.ps.input_reg_map[input->register_idx], reg_mask, semantic_idx, reg_mask); + if (args->pointsprite) + shader_addline(buffer, "ps_in[%u] = vec4(gl_PointCoord.xy, 0.0, 0.0);\n", + shader->u.ps.input_reg_map[input->register_idx]); + else if (args->vp_mode == pretransformed && args->texcoords_initialized & (1u << semantic_idx)) + shader_addline(buffer, "ps_in[%u]%s = %s[%u]%s;\n", + shader->u.ps.input_reg_map[input->register_idx], reg_mask, + gl_info->supported[WINED3D_GL_LEGACY_CONTEXT] + ? "gl_TexCoord" : "ffp_varying_texcoord", semantic_idx, reg_mask); else shader_addline(buffer, "ps_in[%u]%s = vec4(0.0, 0.0, 0.0, 0.0)%s;\n", shader->u.ps.input_reg_map[input->register_idx], reg_mask, reg_mask); @@ -4684,10 +4784,10 @@ else if (shader_match_semantic(semantic_name, WINED3D_DECL_USAGE_COLOR)) { if (!semantic_idx) - shader_addline(buffer, "ps_in[%u]%s = vec4(gl_Color)%s;\n", + shader_addline(buffer, "ps_in[%u]%s = vec4(ffp_varying_diffuse)%s;\n", shader->u.ps.input_reg_map[input->register_idx], reg_mask, reg_mask); else if (semantic_idx == 1) - shader_addline(buffer, "ps_in[%u]%s = vec4(gl_SecondaryColor)%s;\n", + shader_addline(buffer, "ps_in[%u]%s = vec4(ffp_varying_specular)%s;\n", shader->u.ps.input_reg_map[input->register_idx], reg_mask, reg_mask); else shader_addline(buffer, "ps_in[%u]%s = vec4(0.0, 0.0, 0.0, 0.0)%s;\n", @@ -4764,27 +4864,29 @@ const struct wined3d_shader_reg_maps *reg_maps_out) { struct wined3d_string_buffer *buffer = &priv->shader_buffer; + BOOL legacy_context = gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]; unsigned int i, j; DWORD *set; DWORD in_idx; unsigned int in_count = vec4_varyings(3, gl_info); + unsigned int max_varyings = legacy_context ? in_count + 2 : in_count; char reg_mask[6]; struct wined3d_string_buffer *destination = string_buffer_get(&priv->string_buffers); - set = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*set) * (in_count + 2)); + set = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*set) * max_varyings); for (i = 0; i < input_signature->element_count; ++i) { const struct wined3d_shader_signature_element *input = &input_signature->elements[i]; - if (!(reg_maps_in->input_registers & (1 << input->register_idx))) + if (!(reg_maps_in->input_registers & (1u << input->register_idx))) continue; in_idx = map[input->register_idx]; /* Declared, but not read register */ if (in_idx == ~0u) continue; - if (in_idx >= (in_count + 2)) + if (in_idx >= max_varyings) { FIXME("More input varyings declared than supported, expect issues.\n"); continue; @@ -4805,16 +4907,15 @@ const struct wined3d_shader_signature_element *output = &output_signature->elements[j]; DWORD mask; - if (!(reg_maps_out->output_registers & (1 << output->register_idx)) + if (!(reg_maps_out->output_registers & (1u << output->register_idx)) || input->semantic_idx != output->semantic_idx || strcmp(input->semantic_name, output->semantic_name) || !(mask = input->mask & output->mask)) continue; if (set[in_idx] == ~0u) - set[in_idx] = mask; - else - set[in_idx] |= mask; + set[in_idx] = 0; + set[in_idx] |= mask & reg_maps_out->u.output_registers_mask[output->register_idx]; shader_glsl_write_mask_to_str(mask, reg_mask); shader_addline(buffer, "%s%s = vs_out[%u]%s;\n", @@ -4822,7 +4923,7 @@ } } - for (i = 0; i < in_count + 2; ++i) + for (i = 0; i < max_varyings; ++i) { unsigned int size; @@ -4856,7 +4957,7 @@ /* Context activation is done by the caller. */ static GLuint generate_param_reorder_function(struct shader_glsl_priv *priv, const struct wined3d_shader *vs, const struct wined3d_shader *ps, - BOOL per_vertex_point_size, const struct wined3d_gl_info *gl_info) + BOOL per_vertex_point_size, BOOL flatshading, const struct wined3d_gl_info *gl_info) { struct wined3d_string_buffer *buffer = &priv->shader_buffer; GLuint ret = 0; @@ -4865,6 +4966,7 @@ const char *semantic_name; UINT semantic_idx; char reg_mask[6]; + BOOL legacy_context = gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]; string_buffer_clear(buffer); @@ -4880,6 +4982,17 @@ if (ps_major < 3) { + DWORD colors_written_mask[2] = {0}; + DWORD texcoords_written_mask[MAX_TEXTURES] = {0}; + + if (!legacy_context) + { + declare_out_varying(gl_info, buffer, flatshading, "vec4 ffp_varying_diffuse;\n"); + declare_out_varying(gl_info, buffer, flatshading, "vec4 ffp_varying_specular;\n"); + declare_out_varying(gl_info, buffer, FALSE, "vec4 ffp_varying_texcoord[%u];\n", MAX_TEXTURES); + declare_out_varying(gl_info, buffer, FALSE, "float ffp_varying_fogcoord;\n"); + } + shader_addline(buffer, "void order_ps_input(in vec4 vs_out[%u])\n{\n", vs->limits->packed_output); for (i = 0; i < vs->output_signature.element_count; ++i) @@ -4887,7 +5000,7 @@ const struct wined3d_shader_signature_element *output = &vs->output_signature.elements[i]; DWORD write_mask; - if (!(vs->reg_maps.output_registers & (1 << output->register_idx))) + if (!(vs->reg_maps.output_registers & (1u << output->register_idx))) continue; semantic_name = output->semantic_name; @@ -4895,14 +5008,16 @@ write_mask = output->mask; shader_glsl_write_mask_to_str(write_mask, reg_mask); - if (shader_match_semantic(semantic_name, WINED3D_DECL_USAGE_COLOR)) + if (shader_match_semantic(semantic_name, WINED3D_DECL_USAGE_COLOR) && semantic_idx < 2) { - if (!semantic_idx) - shader_addline(buffer, "gl_FrontColor%s = vs_out[%u]%s;\n", - reg_mask, output->register_idx, reg_mask); - else if (semantic_idx == 1) - shader_addline(buffer, "gl_FrontSecondaryColor%s = vs_out[%u]%s;\n", - reg_mask, output->register_idx, reg_mask); + if (legacy_context) + shader_addline(buffer, "gl_Front%sColor%s = vs_out[%u]%s;\n", + semantic_idx ? "Secondary" : "", reg_mask, output->register_idx, reg_mask); + else + shader_addline(buffer, "ffp_varying_%s%s = clamp(vs_out[%u]%s, 0.0, 1.0);\n", + semantic_idx ? "specular" : "diffuse", reg_mask, output->register_idx, reg_mask); + + colors_written_mask[semantic_idx] = write_mask; } else if (shader_match_semantic(semantic_name, WINED3D_DECL_USAGE_POSITION) && !semantic_idx) { @@ -4911,15 +5026,12 @@ } else if (shader_match_semantic(semantic_name, WINED3D_DECL_USAGE_TEXCOORD)) { - if (semantic_idx < 8) + if (semantic_idx < MAX_TEXTURES) { - if (!(gl_info->quirks & WINED3D_QUIRK_SET_TEXCOORD_W) || ps_major > 0) - write_mask |= WINED3DSP_WRITEMASK_3; - - shader_addline(buffer, "gl_TexCoord[%u]%s = vs_out[%u]%s;\n", + shader_addline(buffer, "%s[%u]%s = vs_out[%u]%s;\n", + legacy_context ? "gl_TexCoord" : "ffp_varying_texcoord", semantic_idx, reg_mask, output->register_idx, reg_mask); - if (!(write_mask & WINED3DSP_WRITEMASK_3)) - shader_addline(buffer, "gl_TexCoord[%u].w = 1.0;\n", semantic_idx); + texcoords_written_mask[semantic_idx] = write_mask; } } else if (shader_match_semantic(semantic_name, WINED3D_DECL_USAGE_PSIZE) && per_vertex_point_size) @@ -4929,17 +5041,49 @@ } else if (shader_match_semantic(semantic_name, WINED3D_DECL_USAGE_FOG)) { - shader_addline(buffer, "gl_FogFragCoord = clamp(vs_out[%u].%c, 0.0, 1.0);\n", + shader_addline(buffer, "%s = clamp(vs_out[%u].%c, 0.0, 1.0);\n", + legacy_context ? "gl_FogFragCoord" : "ffp_varying_fogcoord", output->register_idx, reg_mask[1]); } } - shader_addline(buffer, "}\n"); + + for (i = 0; i < 2; ++i) + { + if (colors_written_mask[i] != WINED3DSP_WRITEMASK_ALL) + { + shader_glsl_write_mask_to_str(~colors_written_mask[i] & WINED3DSP_WRITEMASK_ALL, reg_mask); + if (!i) + shader_addline(buffer, "%s%s = vec4(1.0)%s;\n", + legacy_context ? "gl_FrontColor" : "ffp_varying_diffuse", + reg_mask, reg_mask); + else + shader_addline(buffer, "%s%s = vec4(0.0)%s;\n", + legacy_context ? "gl_FrontSecondaryColor" : "ffp_varying_specular", + reg_mask, reg_mask); + } + } + for (i = 0; i < MAX_TEXTURES; ++i) + { + if (ps && !(ps->reg_maps.texcoord & (1u << i))) + continue; + + if (texcoords_written_mask[i] != WINED3DSP_WRITEMASK_ALL) + { + if (gl_info->limits.glsl_varyings < wined3d_max_compat_varyings(gl_info) + && !texcoords_written_mask[i]) + continue; + + shader_glsl_write_mask_to_str(~texcoords_written_mask[i] & WINED3DSP_WRITEMASK_ALL, reg_mask); + shader_addline(buffer, "%s[%u]%s = vec4(0.0)%s;\n", + legacy_context ? "gl_TexCoord" : "ffp_varying_texcoord", i, reg_mask, reg_mask); + } + } } else { UINT in_count = min(vec4_varyings(ps_major, gl_info), ps->limits->packed_input); - /* This one is tricky: a 3.0 pixel shader reads from a 3.0 vertex shader */ - shader_addline(buffer, "varying vec4 ps_link[%u];\n", in_count); + + declare_out_varying(gl_info, buffer, FALSE, "vec4 ps_link[%u];\n", in_count); shader_addline(buffer, "void order_ps_input(in vec4 vs_out[%u])\n{\n", vs->limits->packed_output); /* First, sort out position and point size. Those are not passed to the pixel shader */ @@ -4947,7 +5091,7 @@ { const struct wined3d_shader_signature_element *output = &vs->output_signature.elements[i]; - if (!(vs->reg_maps.output_registers & (1 << output->register_idx))) + if (!(vs->reg_maps.output_registers & (1u << output->register_idx))) continue; semantic_name = output->semantic_name; @@ -4969,10 +5113,10 @@ /* Then, fix the pixel shader input */ handle_ps3_input(priv, gl_info, ps->u.ps.input_reg_map, &ps->input_signature, &ps->reg_maps, &vs->output_signature, &vs->reg_maps); - - shader_addline(buffer, "}\n"); } + shader_addline(buffer, "}\n"); + ret = GL_EXTCALL(glCreateShader(GL_VERTEX_SHADER)); checkGLcall("glCreateShader(GL_VERTEX_SHADER)"); shader_glsl_compile(gl_info, ret, buffer->buffer); @@ -4998,16 +5142,16 @@ return; case WINED3D_FFP_PS_FOG_LINEAR: - shader_addline(buffer, "float fog = (ffp_fog.end - gl_FogFragCoord) * ffp_fog.scale;\n"); + shader_addline(buffer, "float fog = (ffp_fog.end - ffp_varying_fogcoord) * ffp_fog.scale;\n"); break; case WINED3D_FFP_PS_FOG_EXP: - shader_addline(buffer, "float fog = exp(-ffp_fog.density * gl_FogFragCoord);\n"); + shader_addline(buffer, "float fog = exp(-ffp_fog.density * ffp_varying_fogcoord);\n"); break; case WINED3D_FFP_PS_FOG_EXP2: shader_addline(buffer, "float fog = exp(-ffp_fog.density * ffp_fog.density" - " * gl_FogFragCoord * gl_FogFragCoord);\n"); + " * ffp_varying_fogcoord * ffp_varying_fogcoord);\n"); break; default: @@ -5029,6 +5173,7 @@ const struct wined3d_gl_info *gl_info = context->gl_info; const DWORD *function = shader->function; struct shader_glsl_ctx_priv priv_ctx; + BOOL legacy_context = gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]; /* Create the hw GLSL shader object and assign it as the shader->prgId */ GLuint shader_id = GL_EXTCALL(glCreateShader(GL_FRAGMENT_SHADER)); @@ -5056,9 +5201,41 @@ /* Base Declarations */ shader_generate_glsl_declarations(context, buffer, shader, reg_maps, &priv_ctx); + if (reg_maps->shader_version.major < 3 || args->vp_mode != vertexshader) + { + unsigned int i; + WORD map = reg_maps->texcoord; + + if (legacy_context) + { + if (glsl_is_color_reg_read(shader, 0)) + shader_addline(buffer, "ffp_varying_diffuse = gl_Color;\n"); + if (glsl_is_color_reg_read(shader, 1)) + shader_addline(buffer, "ffp_varying_specular = gl_SecondaryColor;\n"); + } + + for (i = 0; map; map >>= 1, ++i) + { + if (map & 1) + { + if (args->pointsprite) + shader_addline(buffer, "ffp_texcoord[%u] = vec4(gl_PointCoord.xy, 0.0, 0.0);\n", i); + else if (args->texcoords_initialized & (1u << i)) + shader_addline(buffer, "ffp_texcoord[%u] = %s[%u];\n", i, + legacy_context ? "gl_TexCoord" : "ffp_varying_texcoord", i); + else + shader_addline(buffer, "ffp_texcoord[%u] = vec4(0.0);\n", i); + shader_addline(buffer, "vec4 T%u = ffp_texcoord[%u];\n", i, i); + } + } + + if (legacy_context) + shader_addline(buffer, "ffp_varying_fogcoord = gl_FogFragCoord;\n"); + } + /* Pack 3.0 inputs */ if (reg_maps->shader_version.major >= 3) - shader_glsl_input_pack(shader, buffer, &shader->input_signature, reg_maps, args); + shader_glsl_input_pack(shader, buffer, &shader->input_signature, reg_maps, args, gl_info); /* Base Shader Body */ shader_generate_main(shader, buffer, reg_maps, function, &priv_ctx); @@ -5095,6 +5272,7 @@ const struct wined3d_gl_info *gl_info = context->gl_info; const DWORD *function = shader->function; struct shader_glsl_ctx_priv priv_ctx; + BOOL legacy_context = gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]; /* Create the hw GLSL shader program and assign it as the shader->prgId */ GLuint shader_id = GL_EXTCALL(glCreateShader(GL_VERTEX_SHADER)); @@ -5128,10 +5306,15 @@ * the fog frag coord is thrown away. If the fog frag coord is used, but not written by * the shader, it is set to 0.0(fully fogged, since start = 1.0, end = 0.0) */ - if (args->fog_src == VS_FOG_Z) - shader_addline(buffer, "gl_FogFragCoord = gl_Position.z;\n"); - else if (!reg_maps->fog) - shader_addline(buffer, "gl_FogFragCoord = 0.0;\n"); + if (reg_maps->shader_version.major < 3) + { + if (args->fog_src == VS_FOG_Z) + shader_addline(buffer, "%s = gl_Position.z;\n", + legacy_context ? "gl_FogFragCoord" : "ffp_varying_fogcoord"); + else if (!reg_maps->fog) + shader_addline(buffer, "%s = 0.0;\n", + legacy_context ? "gl_FogFragCoord" : "ffp_varying_fogcoord"); + } /* We always store the clipplanes without y inversion */ if (args->clip_enabled) @@ -5287,6 +5470,8 @@ return FALSE; if (stored->per_vertex_point_size != new->per_vertex_point_size) return FALSE; + if (stored->flatshading != new->flatshading) + return FALSE; return stored->fog_src == new->fog_src; } @@ -5421,8 +5606,8 @@ if (!settings->lighting) { - shader_addline(buffer, "gl_FrontColor = ffp_attrib_diffuse;\n"); - shader_addline(buffer, "gl_FrontSecondaryColor = ffp_attrib_specular;\n"); + shader_addline(buffer, "ffp_varying_diffuse = ffp_attrib_diffuse;\n"); + shader_addline(buffer, "ffp_varying_specular = ffp_attrib_specular;\n"); return; } @@ -5564,16 +5749,15 @@ } } - shader_addline(buffer, "gl_FrontColor.xyz = %s.xyz * ambient + %s.xyz * diffuse + %s.xyz;\n", + shader_addline(buffer, "ffp_varying_diffuse.xyz = %s.xyz * ambient + %s.xyz * diffuse + %s.xyz;\n", ambient, diffuse, emissive); - shader_addline(buffer, "gl_FrontColor.w = %s.w;\n", diffuse); - shader_addline(buffer, "gl_FrontSecondaryColor = %s * specular;\n", specular); + shader_addline(buffer, "ffp_varying_diffuse.w = %s.w;\n", diffuse); + shader_addline(buffer, "ffp_varying_specular = %s * specular;\n", specular); } /* Context activation is done by the caller. */ -static GLuint shader_glsl_generate_ffp_vertex_shader(struct wined3d_string_buffer *buffer, - const struct wined3d_ffp_vs_settings *settings, const struct wined3d_gl_info *gl_info, - BOOL legacy_lighting) +static GLuint shader_glsl_generate_ffp_vertex_shader(struct shader_glsl_priv *priv, + const struct wined3d_ffp_vs_settings *settings, const struct wined3d_gl_info *gl_info) { static const struct attrib_info { @@ -5591,8 +5775,12 @@ {"vec4", "ffp_attrib_diffuse"}, /* WINED3D_FFP_DIFFUSE */ {"vec4", "ffp_attrib_specular"}, /* WINED3D_FFP_SPECULAR */ }; + struct wined3d_string_buffer *buffer = &priv->shader_buffer; + BOOL legacy_lighting = priv->legacy_lighting; GLuint shader_obj; unsigned int i; + BOOL legacy_context = gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]; + BOOL output_legacy_fogcoord = legacy_context; string_buffer_clear(buffer); @@ -5647,6 +5835,21 @@ shader_addline(buffer, "} ffp_point;\n"); } + if (legacy_context) + { + shader_addline(buffer, "vec4 ffp_varying_diffuse;\n"); + shader_addline(buffer, "vec4 ffp_varying_specular;\n"); + shader_addline(buffer, "vec4 ffp_varying_texcoord[%u];\n", MAX_TEXTURES); + shader_addline(buffer, "float ffp_varying_fogcoord;\n"); + } + else + { + declare_out_varying(gl_info, buffer, settings->flatshading, "vec4 ffp_varying_diffuse;\n"); + declare_out_varying(gl_info, buffer, settings->flatshading, "vec4 ffp_varying_specular;\n"); + declare_out_varying(gl_info, buffer, FALSE, "vec4 ffp_varying_texcoord[%u];\n", MAX_TEXTURES); + declare_out_varying(gl_info, buffer, FALSE, "float ffp_varying_fogcoord;\n"); + } + shader_addline(buffer, "\nvoid main()\n{\n"); shader_addline(buffer, "float m;\n"); shader_addline(buffer, "vec3 r;\n"); @@ -5707,34 +5910,45 @@ } shader_glsl_ffp_vertex_lighting(buffer, settings, legacy_lighting); + if (legacy_context) + { + shader_addline(buffer, "gl_FrontColor = ffp_varying_diffuse;\n"); + shader_addline(buffer, "gl_FrontSecondaryColor = ffp_varying_specular;\n"); + } for (i = 0; i < MAX_TEXTURES; ++i) { + BOOL output_legacy_texcoord = gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]; + switch (settings->texgen[i] & 0xffff0000) { case WINED3DTSS_TCI_PASSTHRU: - if (settings->texcoords & (1 << i)) - shader_addline(buffer, "gl_TexCoord[%u] = ffp_texture_matrix[%u] * ffp_attrib_texcoord%u;\n", + if (settings->texcoords & (1u << i)) + shader_addline(buffer, "ffp_varying_texcoord[%u] = ffp_texture_matrix[%u] * ffp_attrib_texcoord%u;\n", i, i, i); + else if (gl_info->limits.glsl_varyings >= wined3d_max_compat_varyings(gl_info)) + shader_addline(buffer, "ffp_varying_texcoord[%u] = vec4(0.0);\n", i); + else + output_legacy_texcoord = FALSE; break; case WINED3DTSS_TCI_CAMERASPACENORMAL: - shader_addline(buffer, "gl_TexCoord[%u] = ffp_texture_matrix[%u] * vec4(normal, 1.0);\n", i, i); + shader_addline(buffer, "ffp_varying_texcoord[%u] = ffp_texture_matrix[%u] * vec4(normal, 1.0);\n", i, i); break; case WINED3DTSS_TCI_CAMERASPACEPOSITION: - shader_addline(buffer, "gl_TexCoord[%u] = ffp_texture_matrix[%u] * ec_pos;\n", i, i); + shader_addline(buffer, "ffp_varying_texcoord[%u] = ffp_texture_matrix[%u] * ec_pos;\n", i, i); break; case WINED3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR: - shader_addline(buffer, "gl_TexCoord[%u] = ffp_texture_matrix[%u]" + shader_addline(buffer, "ffp_varying_texcoord[%u] = ffp_texture_matrix[%u]" " * vec4(reflect(normalize(ec_pos.xyz), normal), 1.0);\n", i, i); break; case WINED3DTSS_TCI_SPHEREMAP: shader_addline(buffer, "r = reflect(normalize(ec_pos.xyz), normal);\n"); shader_addline(buffer, "m = 2.0 * length(vec3(r.x, r.y, r.z + 1.0));\n"); - shader_addline(buffer, "gl_TexCoord[%u] = ffp_texture_matrix[%u]" + shader_addline(buffer, "ffp_varying_texcoord[%u] = ffp_texture_matrix[%u]" " * vec4(r.x / m + 0.5, r.y / m + 0.5, 0.0, 1.0);\n", i, i); break; @@ -5742,35 +5956,40 @@ ERR("Unhandled texgen %#x.\n", settings->texgen[i]); break; } + if (output_legacy_texcoord) + shader_addline(buffer, "gl_TexCoord[%u] = ffp_varying_texcoord[%u];\n", i, i); } switch (settings->fog_mode) { case WINED3D_FFP_VS_FOG_OFF: + output_legacy_fogcoord = FALSE; break; case WINED3D_FFP_VS_FOG_FOGCOORD: - shader_addline(buffer, "gl_FogFragCoord = ffp_attrib_specular.w * 255.0;\n"); + shader_addline(buffer, "ffp_varying_fogcoord = ffp_attrib_specular.w * 255.0;\n"); break; case WINED3D_FFP_VS_FOG_RANGE: - shader_addline(buffer, "gl_FogFragCoord = length(ec_pos.xyz);\n"); + shader_addline(buffer, "ffp_varying_fogcoord = length(ec_pos.xyz);\n"); break; case WINED3D_FFP_VS_FOG_DEPTH: if (settings->ortho_fog) /* Need to undo the [0.0 - 1.0] -> [-1.0 - 1.0] transformation from D3D to GL coordinates. */ - shader_addline(buffer, "gl_FogFragCoord = gl_Position.z * 0.5 + 0.5;\n"); + shader_addline(buffer, "ffp_varying_fogcoord = gl_Position.z * 0.5 + 0.5;\n"); else if (settings->transformed) - shader_addline(buffer, "gl_FogFragCoord = ec_pos.z;\n"); + shader_addline(buffer, "ffp_varying_fogcoord = ec_pos.z;\n"); else - shader_addline(buffer, "gl_FogFragCoord = abs(ec_pos.z);\n"); + shader_addline(buffer, "ffp_varying_fogcoord = abs(ec_pos.z);\n"); break; default: ERR("Unhandled fog mode %#x.\n", settings->fog_mode); break; } + if (output_legacy_fogcoord) + shader_addline(buffer, "gl_FogFragCoord = ffp_varying_fogcoord;\n"); if (settings->point_size) { @@ -5800,12 +6019,12 @@ switch (arg & WINED3DTA_SELECTMASK) { case WINED3DTA_DIFFUSE: - ret = "gl_Color"; + ret = "ffp_varying_diffuse"; break; case WINED3DTA_CURRENT: if (!stage) - ret = "gl_Color"; + ret = "ffp_varying_diffuse"; else ret = "ret"; break; @@ -5832,7 +6051,7 @@ break; case WINED3DTA_SPECULAR: - ret = "gl_SecondaryColor"; + ret = "ffp_varying_specular"; break; case WINED3DTA_TEMP: @@ -5910,7 +6129,7 @@ { case WINED3D_TOP_DISABLE: if (!stage) - shader_addline(buffer, "%s%s = gl_Color%s;\n", dstreg, dstmask, dstmask); + shader_addline(buffer, "%s%s = ffp_varying_diffuse%s;\n", dstreg, dstmask, dstmask); break; case WINED3D_TOP_SELECT_ARG1: @@ -6049,6 +6268,7 @@ DWORD arg0, arg1, arg2; unsigned int stage; struct wined3d_string_buffer *tex_reg_name = string_buffer_get(&priv->string_buffers); + BOOL legacy_context = gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]; string_buffer_clear(buffer); @@ -6064,7 +6284,7 @@ if (arg0 == WINED3DTA_TEXTURE || arg1 == WINED3DTA_TEXTURE || arg2 == WINED3DTA_TEXTURE || (stage == 0 && settings->color_key_enabled)) - tex_map |= 1 << stage; + tex_map |= 1u << stage; if (arg0 == WINED3DTA_TFACTOR || arg1 == WINED3DTA_TFACTOR || arg2 == WINED3DTA_TFACTOR) tfactor_used = TRUE; if (arg0 == WINED3DTA_TEMP || arg1 == WINED3DTA_TEMP || arg2 == WINED3DTA_TEMP) @@ -6072,19 +6292,19 @@ if (settings->op[stage].dst == tempreg) tempreg_used = TRUE; if (arg0 == WINED3DTA_CONSTANT || arg1 == WINED3DTA_CONSTANT || arg2 == WINED3DTA_CONSTANT) - tss_const_map |= 1 << stage; + tss_const_map |= 1u << stage; switch (settings->op[stage].cop) { case WINED3D_TOP_BUMPENVMAP_LUMINANCE: - lum_map |= 1 << stage; + lum_map |= 1u << stage; /* fall through */ case WINED3D_TOP_BUMPENVMAP: - bump_map |= 1 << stage; + bump_map |= 1u << stage; /* fall through */ case WINED3D_TOP_BLEND_TEXTURE_ALPHA: case WINED3D_TOP_BLEND_TEXTURE_ALPHA_PM: - tex_map |= 1 << stage; + tex_map |= 1u << stage; break; case WINED3D_TOP_BLEND_FACTOR_ALPHA: @@ -6103,13 +6323,13 @@ arg2 = settings->op[stage].aarg2 & WINED3DTA_SELECTMASK; if (arg0 == WINED3DTA_TEXTURE || arg1 == WINED3DTA_TEXTURE || arg2 == WINED3DTA_TEXTURE) - tex_map |= 1 << stage; + tex_map |= 1u << stage; if (arg0 == WINED3DTA_TFACTOR || arg1 == WINED3DTA_TFACTOR || arg2 == WINED3DTA_TFACTOR) tfactor_used = TRUE; if (arg0 == WINED3DTA_TEMP || arg1 == WINED3DTA_TEMP || arg2 == WINED3DTA_TEMP) tempreg_used = TRUE; if (arg0 == WINED3DTA_CONSTANT || arg1 == WINED3DTA_CONSTANT || arg2 == WINED3DTA_CONSTANT) - tss_const_map |= 1 << stage; + tss_const_map |= 1u << stage; } lowest_disabled_stage = stage; @@ -6126,10 +6346,10 @@ for (stage = 0; stage < MAX_TEXTURES; ++stage) { - if (tss_const_map & (1 << stage)) + if (tss_const_map & (1u << stage)) shader_addline(buffer, "uniform vec4 tss_const%u;\n", stage); - if (!(tex_map & (1 << stage))) + if (!(tex_map & (1u << stage))) continue; switch (settings->op[stage].tex_type) @@ -6156,11 +6376,11 @@ shader_addline(buffer, "vec4 tex%u;\n", stage); - if (!(bump_map & (1 << stage))) + if (!(bump_map & (1u << stage))) continue; shader_addline(buffer, "uniform mat2 bumpenv_mat%u;\n", stage); - if (!(lum_map & (1 << stage))) + if (!(lum_map & (1u << stage))) continue; shader_addline(buffer, "uniform float bumpenv_lum_scale%u;\n", stage); shader_addline(buffer, "uniform float bumpenv_lum_offset%u;\n", stage); @@ -6168,7 +6388,7 @@ if (tfactor_used) shader_addline(buffer, "uniform vec4 tex_factor;\n"); if (settings->color_key_enabled) - shader_addline(buffer, "uniform vec4 color_key;\n"); + shader_addline(buffer, "uniform vec4 color_key[2];\n"); shader_addline(buffer, "uniform vec4 specular_enable;\n"); if (settings->sRGB_write) @@ -6188,10 +6408,50 @@ shader_addline(buffer, " float scale;\n"); shader_addline(buffer, "} ffp_fog;\n"); + if (legacy_context) + { + shader_addline(buffer, "vec4 ffp_varying_diffuse;\n"); + shader_addline(buffer, "vec4 ffp_varying_specular;\n"); + shader_addline(buffer, "vec4 ffp_varying_texcoord[%u];\n", MAX_TEXTURES); + shader_addline(buffer, "vec4 ffp_texcoord[%u];\n", MAX_TEXTURES); + shader_addline(buffer, "float ffp_varying_fogcoord;\n"); + } + else + { + declare_in_varying(gl_info, buffer, settings->flatshading, "vec4 ffp_varying_diffuse;\n"); + declare_in_varying(gl_info, buffer, settings->flatshading, "vec4 ffp_varying_specular;\n"); + declare_in_varying(gl_info, buffer, FALSE, "vec4 ffp_varying_texcoord[%u];\n", MAX_TEXTURES); + shader_addline(buffer, "vec4 ffp_texcoord[%u];\n", MAX_TEXTURES); + declare_in_varying(gl_info, buffer, FALSE, "float ffp_varying_fogcoord;\n"); + } + shader_addline(buffer, "void main()\n{\n"); + if (legacy_context) + { + shader_addline(buffer, "ffp_varying_diffuse = gl_Color;\n"); + shader_addline(buffer, "ffp_varying_specular = gl_SecondaryColor;\n"); + } + + for (stage = 0; stage < MAX_TEXTURES; ++stage) + { + if (tex_map & (1u << stage)) + { + if (settings->pointsprite) + shader_addline(buffer, "ffp_texcoord[%u] = vec4(gl_PointCoord.xy, 0.0, 0.0);\n", stage); + else if (settings->texcoords_initialized & (1u << stage)) + shader_addline(buffer, "ffp_texcoord[%u] = %s[%u];\n", + stage, legacy_context ? "gl_TexCoord" : "ffp_varying_texcoord", stage); + else + shader_addline(buffer, "ffp_texcoord[%u] = vec4(0.0);\n", stage); + } + } + + if (legacy_context && settings->fog != WINED3D_FFP_PS_FOG_OFF) + shader_addline(buffer, "ffp_varying_fogcoord = gl_FogFragCoord;\n"); + if (lowest_disabled_stage < 7 && settings->emul_clipplanes) - shader_addline(buffer, "if (any(lessThan(gl_TexCoord[7], vec4(0.0)))) discard;\n"); + shader_addline(buffer, "if (any(lessThan(ffp_texcoord[7], vec4(0.0)))) discard;\n"); /* Generate texture sampling instructions) */ for (stage = 0; stage < MAX_TEXTURES && settings->op[stage].cop != WINED3D_TOP_DISABLE; ++stage) @@ -6199,7 +6459,7 @@ const char *texture_function, *coord_mask; BOOL proj; - if (!(tex_map & (1 << stage))) + if (!(tex_map & (1u << stage))) continue; if (settings->op[stage].projected == proj_none) @@ -6217,6 +6477,9 @@ proj = TRUE; } + if (settings->op[stage].tex_type == WINED3D_GL_RES_TYPE_TEX_CUBE) + proj = FALSE; + switch (settings->op[stage].tex_type) { case WINED3D_GL_RES_TYPE_TEX_1D: @@ -6277,6 +6540,8 @@ coord_mask = "xyzw"; break; } + if (!needs_legacy_glsl_syntax(gl_info)) + texture_function = proj ? "textureProj" : "texture"; if (stage > 0 && (settings->op[stage - 1].cop == WINED3D_TOP_BUMPENVMAP @@ -6292,20 +6557,20 @@ { if (settings->op[stage].projected == proj_count4) { - shader_addline(buffer, "ret.xy = (ret.xy * gl_TexCoord[%u].w) + gl_TexCoord[%u].xy;\n", + shader_addline(buffer, "ret.xy = (ret.xy * ffp_texcoord[%u].w) + ffp_texcoord[%u].xy;\n", stage, stage); - shader_addline(buffer, "ret.zw = gl_TexCoord[%u].ww;\n", stage); + shader_addline(buffer, "ret.zw = ffp_texcoord[%u].ww;\n", stage); } else { - shader_addline(buffer, "ret.xy = (ret.xy * gl_TexCoord[%u].z) + gl_TexCoord[%u].xy;\n", + shader_addline(buffer, "ret.xy = (ret.xy * ffp_texcoord[%u].z) + ffp_texcoord[%u].xy;\n", stage, stage); - shader_addline(buffer, "ret.zw = gl_TexCoord[%u].zz;\n", stage); + shader_addline(buffer, "ret.zw = ffp_texcoord[%u].zz;\n", stage); } } else { - shader_addline(buffer, "ret = gl_TexCoord[%u] + ret.xyxy;\n", stage); + shader_addline(buffer, "ret = ffp_texcoord[%u] + ret.xyxy;\n", stage); } shader_addline(buffer, "tex%u = %s(ps_sampler%u, ret.%s);\n", @@ -6317,12 +6582,12 @@ } else if (settings->op[stage].projected == proj_count3) { - shader_addline(buffer, "tex%u = %s(ps_sampler%u, gl_TexCoord[%u].xyz);\n", + shader_addline(buffer, "tex%u = %s(ps_sampler%u, ffp_texcoord[%u].xyz);\n", stage, texture_function, stage, stage); } else { - shader_addline(buffer, "tex%u = %s(ps_sampler%u, gl_TexCoord[%u].%s);\n", + shader_addline(buffer, "tex%u = %s(ps_sampler%u, ffp_texcoord[%u].%s);\n", stage, texture_function, stage, stage, coord_mask); } @@ -6332,7 +6597,10 @@ } if (settings->color_key_enabled) - shader_addline(buffer, "if (all(equal(tex0, color_key))) discard;\n"); + { + shader_addline(buffer, "if (all(greaterThanEqual(tex0, color_key[0])) && all(lessThan(tex0, color_key[1])))\n"); + shader_addline(buffer, " discard;\n"); + } /* Generate the main shader */ for (stage = 0; stage < MAX_TEXTURES; ++stage) @@ -6342,7 +6610,7 @@ if (settings->op[stage].cop == WINED3D_TOP_DISABLE) { if (!stage) - final_combiner_src = "gl_Color"; + final_combiner_src = "ffp_varying_diffuse"; break; } @@ -6370,7 +6638,7 @@ settings->op[stage].cop, settings->op[stage].carg0, settings->op[stage].carg1, settings->op[stage].carg2); if (!stage) - shader_addline(buffer, "ret.w = gl_Color.w;\n"); + shader_addline(buffer, "ret.w = ffp_varying_diffuse.w;\n"); } else if (op_equal) { @@ -6389,7 +6657,7 @@ } } - shader_addline(buffer, "gl_FragData[0] = gl_SecondaryColor * specular_enable + %s;\n", final_combiner_src); + shader_addline(buffer, "gl_FragData[0] = ffp_varying_specular * specular_enable + %s;\n", final_combiner_src); if (settings->sRGB_write) shader_glsl_generate_srgb_write_correction(buffer); @@ -6418,7 +6686,7 @@ return NULL; shader->desc.settings = *settings; - shader->id = shader_glsl_generate_ffp_vertex_shader(&priv->shader_buffer, settings, gl_info, priv->legacy_lighting); + shader->id = shader_glsl_generate_ffp_vertex_shader(priv, settings, gl_info); list_init(&shader->linked_programs); if (wine_rb_put(&priv->ffp_vertex_shaders, &shader->desc.settings, &shader->desc.entry) == -1) ERR("Failed to insert ffp vertex shader.\n"); @@ -6614,6 +6882,7 @@ struct shader_glsl_priv *priv, struct glsl_context_data *ctx_data) { const struct wined3d_gl_info *gl_info = context->gl_info; + const struct wined3d_d3d_info *d3d_info = context->d3d_info; const struct ps_np2fixup_info *np2fixup_info = NULL; struct glsl_shader_prog_link *entry = NULL; struct wined3d_shader *vshader = NULL; @@ -6629,7 +6898,7 @@ WORD attribs_map; struct wined3d_string_buffer *tmp_name; - if (!(context->shader_update_mask & (1 << WINED3D_SHADER_TYPE_VERTEX)) && ctx_data->glsl_program) + if (!(context->shader_update_mask & (1u << WINED3D_SHADER_TYPE_VERTEX)) && ctx_data->glsl_program) { vs_id = ctx_data->glsl_program->vs.id; vs_list = &ctx_data->glsl_program->vs.shader_entry; @@ -6639,7 +6908,7 @@ vshader = state->shader[WINED3D_SHADER_TYPE_VERTEX]; gshader = state->shader[WINED3D_SHADER_TYPE_GEOMETRY]; - if (!(context->shader_update_mask & (1 << WINED3D_SHADER_TYPE_GEOMETRY)) + if (!(context->shader_update_mask & (1u << WINED3D_SHADER_TYPE_GEOMETRY)) && ctx_data->glsl_program->gs.id) gs_id = ctx_data->glsl_program->gs.id; else if (gshader) @@ -6649,9 +6918,10 @@ else if (use_vs(state)) { struct vs_compile_args vs_compile_args; + vshader = state->shader[WINED3D_SHADER_TYPE_VERTEX]; - find_vs_compile_args(state, vshader, context->stream_info.swizzle_map, &vs_compile_args); + find_vs_compile_args(state, vshader, context->stream_info.swizzle_map, &vs_compile_args, d3d_info); vs_id = find_glsl_vshader(context, &priv->shader_buffer, &priv->string_buffers, vshader, &vs_compile_args); vs_list = &vshader->linked_programs; @@ -6663,13 +6933,13 @@ struct glsl_ffp_vertex_shader *ffp_shader; struct wined3d_ffp_vs_settings settings; - wined3d_ffp_get_vs_settings(state, &context->stream_info, &settings); + wined3d_ffp_get_vs_settings(context, state, &settings); ffp_shader = shader_glsl_find_ffp_vertex_shader(priv, gl_info, &settings); vs_id = ffp_shader->id; vs_list = &ffp_shader->linked_programs; } - if (!(context->shader_update_mask & (1 << WINED3D_SHADER_TYPE_PIXEL)) && ctx_data->glsl_program) + if (!(context->shader_update_mask & (1u << WINED3D_SHADER_TYPE_PIXEL)) && ctx_data->glsl_program) { ps_id = ctx_data->glsl_program->ps.id; ps_list = &ctx_data->glsl_program->ps.shader_entry; @@ -6681,7 +6951,7 @@ { struct ps_compile_args ps_compile_args; pshader = state->shader[WINED3D_SHADER_TYPE_PIXEL]; - find_ps_compile_args(state, pshader, context->stream_info.position_transformed, &ps_compile_args, gl_info); + find_ps_compile_args(state, pshader, context->stream_info.position_transformed, &ps_compile_args, context); ps_id = find_glsl_pshader(context, &priv->shader_buffer, &priv->string_buffers, pshader, &ps_compile_args, &np2fixup_info); ps_list = &pshader->linked_programs; @@ -6735,7 +7005,9 @@ { attribs_map = vshader->reg_maps.input_registers; reorder_shader_id = generate_param_reorder_function(priv, vshader, pshader, - state->gl_primitive_type == GL_POINTS && vshader->reg_maps.point_size, gl_info); + state->gl_primitive_type == GL_POINTS && vshader->reg_maps.point_size, + d3d_info->emulated_flatshading + && state->render_states[WINED3D_RS_SHADEMODE] == WINED3D_SHADE_FLAT, gl_info); TRACE("Attaching GLSL shader object %u to program %u.\n", reorder_shader_id, program_id); GL_EXTCALL(glAttachShader(program_id, reorder_shader_id)); checkGLcall("glAttachShader"); @@ -6746,7 +7018,7 @@ } else { - attribs_map = (1 << WINED3D_FFP_ATTRIBS_COUNT) - 1; + attribs_map = (1u << WINED3D_FFP_ATTRIBS_COUNT) - 1; } /* Bind vertex attributes to a corresponding index number to match @@ -6827,13 +7099,8 @@ GL_EXTCALL(glUseProgram(program_id)); checkGLcall("glUseProgram"); - /* Load the vertex and pixel samplers now. The function that finds the mappings makes sure - * that it stays the same for each vertexshader-pixelshader pair(=linked glsl program). If - * a pshader with fixed function pipeline is used there are no vertex samplers, and if a - * vertex shader with fixed function pixel processing is used we make sure that the card - * supports enough samplers to allow the max number of vertex samplers with all possible - * fixed function fragment processing setups. So once the program is linked these samplers - * won't change. */ + /* Texture unit mapping is set up to be the same each time the shader + * program is used so we can hardcode the sampler uniform values. */ shader_glsl_load_samplers(gl_info, priv, context->tex_unit_map, program_id); entry->constant_update_mask = 0; @@ -7112,9 +7379,9 @@ struct glsl_context_data *ctx_data = context->shader_backend_data; ctx_data->glsl_program = NULL; - context->shader_update_mask = (1 << WINED3D_SHADER_TYPE_PIXEL) - | (1 << WINED3D_SHADER_TYPE_VERTEX) - | (1 << WINED3D_SHADER_TYPE_GEOMETRY); + context->shader_update_mask = (1u << WINED3D_SHADER_TYPE_PIXEL) + | (1u << WINED3D_SHADER_TYPE_VERTEX) + | (1u << WINED3D_SHADER_TYPE_GEOMETRY); } /* Context activation is done by the caller. */ @@ -7493,10 +7760,8 @@ { UINT shader_model; - if (gl_info->supported[EXT_GPU_SHADER4] && gl_info->supported[ARB_SHADER_BIT_ENCODING] - && gl_info->supported[ARB_GEOMETRY_SHADER4] && gl_info->glsl_version >= MAKEDWORD_VERSION(1, 50) - && gl_info->supported[ARB_DRAW_ELEMENTS_BASE_VERTEX] && gl_info->supported[ARB_DRAW_INSTANCED] - && gl_info->supported[ARB_TEXTURE_RG] && gl_info->supported[ARB_SAMPLER_OBJECTS]) + 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]) shader_model = 4; /* ARB_shader_texture_lod or EXT_gpu_shader4 is required for the SM3 * texldd and texldl instructions. */ @@ -7512,6 +7777,7 @@ caps->vs_uniform_count = gl_info->limits.glsl_vs_float_constants; caps->ps_uniform_count = gl_info->limits.glsl_ps_float_constants; + caps->varying_count = gl_info->limits.glsl_varyings; /* FIXME: The following line is card dependent. -8.0 to 8.0 is the * Direct3D minimum requirement. @@ -7726,6 +7992,7 @@ static void glsl_vertex_pipe_vp_get_caps(const struct wined3d_gl_info *gl_info, struct wined3d_vertex_caps *caps) { caps->xyzrhw = TRUE; + caps->emulated_flatshading = !gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]; caps->ffp_generic_attributes = TRUE; caps->max_active_lights = MAX_ACTIVE_LIGHTS; caps->max_vertex_blend_matrices = MAX_VERTEX_BLENDS; @@ -7798,10 +8065,13 @@ wine_rb_destroy(&priv->ffp_vertex_shaders, shader_glsl_free_ffp_vertex_shader, &ctx); } +static void glsl_vertex_pipe_nop(struct wined3d_context *context, + const struct wined3d_state *state, DWORD state_id) {} + static void glsl_vertex_pipe_shader(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - context->shader_update_mask |= 1 << WINED3D_SHADER_TYPE_VERTEX; + context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_VERTEX; } static void glsl_vertex_pipe_vdecl(struct wined3d_context *context, @@ -7818,7 +8088,7 @@ * the draw uses the fixed function vertex pipeline regardless of any * vertex shader set by the application. */ if (transformed != wasrhw) - context->shader_update_mask |= 1 << WINED3D_SHADER_TYPE_VERTEX; + context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_VERTEX; if (!use_vs(state)) { @@ -7830,16 +8100,16 @@ context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_TEXMATRIX; - /* Because of settings->texcoords, we have to always regenerate the - * vertex shader on a vdecl change. - * TODO: Just always output all the texcoords when there are enough - * varyings available to drop the dependency. */ - context->shader_update_mask |= 1 << WINED3D_SHADER_TYPE_VERTEX; + /* Because of settings->texcoords, we have to regenerate the vertex + * shader on a vdecl change if there aren't enough varyings to just + * always output all the texture coordinates. */ + if (gl_info->limits.glsl_varyings < wined3d_max_compat_varyings(gl_info)) + context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_VERTEX; if (use_ps(state) && state->shader[WINED3D_SHADER_TYPE_PIXEL]->reg_maps.shader_version.major == 1 && state->shader[WINED3D_SHADER_TYPE_PIXEL]->reg_maps.shader_version.minor <= 3) - context->shader_update_mask |= 1 << WINED3D_SHADER_TYPE_PIXEL; + context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL; } else { @@ -7857,7 +8127,7 @@ static void glsl_vertex_pipe_vs(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - context->shader_update_mask |= 1 << WINED3D_SHADER_TYPE_VERTEX; + context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_VERTEX; /* Different vertex shaders potentially require a different vertex attributes setup. */ if (!isStateDirty(context, STATE_VDECL)) context_apply_state(context, state, STATE_VDECL); @@ -7897,7 +8167,7 @@ /* Table fog behavior depends on the projection matrix. */ if (state->render_states[WINED3D_RS_FOGENABLE] && state->render_states[WINED3D_RS_FOGTABLEMODE] != WINED3D_FOG_NONE) - context->shader_update_mask |= 1 << WINED3D_SHADER_TYPE_VERTEX; + context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_VERTEX; context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_PROJ; } @@ -7932,12 +8202,12 @@ return; if ((np2 = !(texture->flags & WINED3D_TEXTURE_POW2_MAT_IDENT)) - || context->lastWasPow2Texture & (1 << sampler)) + || context->lastWasPow2Texture & (1u << sampler)) { if (np2) - context->lastWasPow2Texture |= 1 << sampler; + context->lastWasPow2Texture |= 1u << sampler; else - context->lastWasPow2Texture &= ~(1 << sampler); + context->lastWasPow2Texture &= ~(1u << sampler); context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_TEXMATRIX; } @@ -7968,6 +8238,12 @@ context->constant_update_mask |= WINED3D_SHADER_CONST_VS_POINTSIZE; } +static void glsl_vertex_pipe_shademode(struct wined3d_context *context, + const struct wined3d_state *state, DWORD state_id) +{ + context->shader_update_mask |= 1 << WINED3D_SHADER_TYPE_VERTEX; +} + static const struct StateEntryTemplate glsl_vertex_pipe_vp_states[] = { {STATE_VDECL, {STATE_VDECL, glsl_vertex_pipe_vdecl }, WINED3D_GL_EXT_NONE }, @@ -8107,6 +8383,8 @@ {STATE_SAMPLER(7), {0, NULL }, WINED3D_GL_NORMALIZED_TEXRECT}, {STATE_SAMPLER(7), {STATE_SAMPLER(7), glsl_vertex_pipe_texmatrix_np2}, WINED3D_GL_EXT_NONE }, {STATE_POINT_ENABLE, {STATE_POINT_ENABLE, glsl_vertex_pipe_shader}, WINED3D_GL_EXT_NONE }, + {STATE_RENDER(WINED3D_RS_SHADEMODE), {STATE_RENDER(WINED3D_RS_SHADEMODE), glsl_vertex_pipe_nop }, WINED3D_GL_LEGACY_CONTEXT }, + {STATE_RENDER(WINED3D_RS_SHADEMODE), {STATE_RENDER(WINED3D_RS_SHADEMODE), glsl_vertex_pipe_shademode}, WINED3D_GL_EXT_NONE }, {0 /* Terminate */, {0, NULL }, WINED3D_GL_EXT_NONE }, }; @@ -8224,7 +8502,7 @@ { context->last_was_pshader = use_ps(state); - context->shader_update_mask |= 1 << WINED3D_SHADER_TYPE_PIXEL; + context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL; } static void glsl_fragment_pipe_fogparams(struct wined3d_context *context, @@ -8241,7 +8519,7 @@ DWORD fogstart = state->render_states[WINED3D_RS_FOGSTART]; DWORD fogend = state->render_states[WINED3D_RS_FOGEND]; - context->shader_update_mask |= 1 << WINED3D_SHADER_TYPE_PIXEL; + context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL; if (!state->render_states[WINED3D_RS_FOGENABLE]) return; @@ -8270,14 +8548,26 @@ static void glsl_fragment_pipe_vdecl(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { + /* Because of settings->texcoords_initialized and args->texcoords_initialized. */ + if (context->gl_info->limits.glsl_varyings < wined3d_max_compat_varyings(context->gl_info)) + context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL; + if (!isStateDirty(context, STATE_RENDER(WINED3D_RS_FOGENABLE))) glsl_fragment_pipe_fog(context, state, state_id); } +static void glsl_fragment_pipe_vs(struct wined3d_context *context, + const struct wined3d_state *state, DWORD state_id) +{ + /* Because of settings->texcoords_initialized and args->texcoords_initialized. */ + if (context->gl_info->limits.glsl_varyings < wined3d_max_compat_varyings(context->gl_info)) + context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL; +} + static void glsl_fragment_pipe_tex_transform(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - context->shader_update_mask |= 1 << WINED3D_SHADER_TYPE_PIXEL; + context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL; } static void glsl_fragment_pipe_invalidate_constants(struct wined3d_context *context, @@ -8323,9 +8613,16 @@ context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_COLOR_KEY; } +static void glsl_fragment_pipe_shademode(struct wined3d_context *context, + const struct wined3d_state *state, DWORD state_id) +{ + context->shader_update_mask |= 1 << WINED3D_SHADER_TYPE_PIXEL; +} + static const struct StateEntryTemplate glsl_fragment_pipe_state_template[] = { {STATE_VDECL, {STATE_VDECL, glsl_fragment_pipe_vdecl }, WINED3D_GL_EXT_NONE }, + {STATE_SHADER(WINED3D_SHADER_TYPE_VERTEX), {STATE_SHADER(WINED3D_SHADER_TYPE_VERTEX), glsl_fragment_pipe_vs }, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_TEXTUREFACTOR), {STATE_RENDER(WINED3D_RS_TEXTUREFACTOR), glsl_fragment_pipe_invalidate_constants}, WINED3D_GL_EXT_NONE }, {STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_OP), {STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL), NULL }, WINED3D_GL_EXT_NONE }, {STATE_TEXTURESTAGE(0, WINED3D_TSS_COLOR_ARG1), {STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL), NULL }, WINED3D_GL_EXT_NONE }, @@ -8433,6 +8730,8 @@ {STATE_TEXTURESTAGE(7, WINED3D_TSS_CONSTANT), {STATE_TEXTURESTAGE(7, WINED3D_TSS_CONSTANT), glsl_fragment_pipe_invalidate_constants}, WINED3D_GL_EXT_NONE }, {STATE_RENDER(WINED3D_RS_SPECULARENABLE), {STATE_RENDER(WINED3D_RS_SPECULARENABLE), glsl_fragment_pipe_invalidate_constants}, WINED3D_GL_EXT_NONE }, {STATE_POINT_ENABLE, {STATE_POINT_ENABLE, glsl_fragment_pipe_shader }, WINED3D_GL_EXT_NONE }, + {STATE_RENDER(WINED3D_RS_SHADEMODE), {STATE_RENDER(WINED3D_RS_SHADEMODE), state_shademode }, WINED3D_GL_LEGACY_CONTEXT}, + {STATE_RENDER(WINED3D_RS_SHADEMODE), {STATE_RENDER(WINED3D_RS_SHADEMODE), glsl_fragment_pipe_shademode }, WINED3D_GL_EXT_NONE }, {0 /* Terminate */, {0, 0 }, WINED3D_GL_EXT_NONE }, }; diff -Nru wine1.7-1.7.50/dlls/wined3d/nvidia_texture_shader.c wine1.7-1.7.55/dlls/wined3d/nvidia_texture_shader.c --- wine1.7-1.7.50/dlls/wined3d/nvidia_texture_shader.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/nvidia_texture_shader.c 2015-11-13 14:32:40.000000000 +0000 @@ -41,9 +41,11 @@ || state->texture_states[stage - 1][WINED3D_TSS_COLOR_OP] == WINED3D_TOP_BUMPENVMAP)) { bumpmap = TRUE; - context->texShaderBumpMap |= (1 << stage); - } else { - context->texShaderBumpMap &= ~(1 << stage); + context->texShaderBumpMap |= (1u << stage); + } + else + { + context->texShaderBumpMap &= ~(1u << stage); } if (state->textures[stage]) @@ -477,7 +479,7 @@ static void nvrc_colorop(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { DWORD stage = (state_id - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1); - BOOL tex_used = context->fixed_function_usage_map & (1 << stage); + BOOL tex_used = context->fixed_function_usage_map & (1u << stage); DWORD mapped_stage = context->tex_unit_map[stage]; const struct wined3d_gl_info *gl_info = context->gl_info; @@ -570,7 +572,7 @@ { BOOL usesBump = (state->texture_states[stage][WINED3D_TSS_COLOR_OP] == WINED3D_TOP_BUMPENVMAP_LUMINANCE || state->texture_states[stage][WINED3D_TSS_COLOR_OP] == WINED3D_TOP_BUMPENVMAP); - BOOL usedBump = !!(context->texShaderBumpMap & 1 << (stage + 1)); + BOOL usedBump = !!(context->texShaderBumpMap & 1u << (stage + 1)); if (usesBump != usedBump) { context_active_texture(context, gl_info, mapped_stage + 1); @@ -897,6 +899,7 @@ { STATE_RENDER(WINED3D_RS_FOGVERTEXMODE), { STATE_RENDER(WINED3D_RS_FOGENABLE), NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_FOGSTART), { STATE_RENDER(WINED3D_RS_FOGSTART), state_fogstartend }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_FOGEND), { STATE_RENDER(WINED3D_RS_FOGSTART), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_SHADEMODE), { STATE_RENDER(WINED3D_RS_SHADEMODE), state_shademode }, WINED3D_GL_EXT_NONE }, { STATE_SAMPLER(0), { STATE_SAMPLER(0), nvts_texdim }, NV_TEXTURE_SHADER2 }, { STATE_SAMPLER(0), { STATE_SAMPLER(0), sampler_texdim }, WINED3D_GL_EXT_NONE }, { STATE_SAMPLER(1), { STATE_SAMPLER(1), nvts_texdim }, NV_TEXTURE_SHADER2 }, diff -Nru wine1.7-1.7.50/dlls/wined3d/palette.c wine1.7-1.7.55/dlls/wined3d/palette.c --- wine1.7-1.7.50/dlls/wined3d/palette.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/palette.c 2015-11-13 14:32:40.000000000 +0000 @@ -157,8 +157,8 @@ struct wined3d_palette *object; HRESULT hr; - TRACE("device %p, flags %#x, entries %p, palette %p.\n", - device, flags, entries, palette); + TRACE("device %p, flags %#x, entry_count %u, entries %p, palette %p.\n", + device, flags, entry_count, entries, palette); object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); if (!object) diff -Nru wine1.7-1.7.50/dlls/wined3d/query.c wine1.7-1.7.55/dlls/wined3d/query.c --- wine1.7-1.7.50/dlls/wined3d/query.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/query.c 2015-11-13 14:32:40.000000000 +0000 @@ -114,7 +114,7 @@ const struct wined3d_gl_info *gl_info; enum wined3d_event_query_result ret; - TRACE("(%p)\n", query); + TRACE("query %p, device %p.\n", query, device); if (!query->context) { @@ -812,7 +812,7 @@ struct wined3d_query *object; HRESULT hr; - TRACE("device %p, type %#x, query %p.\n", device, type, query); + TRACE("device %p, type %#x, parent %p, query %p.\n", device, type, parent, query); object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); if (!object) diff -Nru wine1.7-1.7.50/dlls/wined3d/resource.c wine1.7-1.7.55/dlls/wined3d/resource.c --- wine1.7-1.7.50/dlls/wined3d/resource.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/resource.c 2015-11-13 14:32:40.000000000 +0000 @@ -295,6 +295,22 @@ desc->size = resource->size; } +HRESULT CDECL wined3d_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, + struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) +{ + TRACE("resource %p, sub_resource_idx %u, map_desc %p, box %p, flags %#x.\n", + resource, sub_resource_idx, map_desc, box, flags); + + return resource->resource_ops->resource_sub_resource_map(resource, sub_resource_idx, map_desc, box, flags); +} + +HRESULT CDECL wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx) +{ + TRACE("resource %p, sub_resource_idx %u.\n", resource, sub_resource_idx); + + return resource->resource_ops->resource_sub_resource_unmap(resource, sub_resource_idx); +} + BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource) { void **p; diff -Nru wine1.7-1.7.50/dlls/wined3d/shader.c wine1.7-1.7.55/dlls/wined3d/shader.c --- wine1.7-1.7.50/dlls/wined3d/shader.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/shader.c 2015-11-13 14:32:40.000000000 +0000 @@ -499,7 +499,7 @@ DWORD idx, shift; idx = bit >> 5; shift = bit & 0x1f; - bitmap[idx] |= (1 << shift); + bitmap[idx] |= (1u << shift); } static BOOL shader_record_register_usage(struct wined3d_shader *shader, struct wined3d_shader_reg_maps *reg_maps, @@ -509,13 +509,13 @@ { case WINED3DSPR_TEXTURE: /* WINED3DSPR_ADDR */ if (shader_type == WINED3D_SHADER_TYPE_PIXEL) - reg_maps->texcoord |= 1 << reg->idx[0].offset; + reg_maps->texcoord |= 1u << reg->idx[0].offset; else - reg_maps->address |= 1 << reg->idx[0].offset; + reg_maps->address |= 1u << reg->idx[0].offset; break; case WINED3DSPR_TEMP: - reg_maps->temporary |= 1 << reg->idx[0].offset; + reg_maps->temporary |= 1u << reg->idx[0].offset; break; case WINED3DSPR_INPUT: @@ -538,7 +538,7 @@ } } else - reg_maps->input_registers |= 1 << reg->idx[0].offset; + reg_maps->input_registers |= 1u << reg->idx[0].offset; break; case WINED3DSPR_RASTOUT: @@ -589,7 +589,7 @@ } else { - reg_maps->integer_constants |= (1 << reg->idx[0].offset); + reg_maps->integer_constants |= (1u << reg->idx[0].offset); } break; @@ -601,12 +601,12 @@ } else { - reg_maps->boolean_constants |= (1 << reg->idx[0].offset); + reg_maps->boolean_constants |= (1u << reg->idx[0].offset); } break; case WINED3DSPR_COLOROUT: - reg_maps->rt_mask |= (1 << reg->idx[0].offset); + reg_maps->rt_mask |= (1u << reg->idx[0].offset); break; default: @@ -745,7 +745,7 @@ if (shader_version.type == WINED3D_SHADER_TYPE_PIXEL && shader_version.major == 3 && semantic->usage == WINED3D_DECL_USAGE_POSITION && !semantic->usage_idx) return WINED3DERR_INVALIDCALL; - reg_maps->input_registers |= 1 << reg_idx; + reg_maps->input_registers |= 1u << reg_idx; shader_signature_from_semantic(&input_signature_elements[reg_idx], semantic); break; @@ -756,7 +756,7 @@ ERR("Invalid output register index %u.\n", reg_idx); break; } - reg_maps->output_registers |= 1 << reg_idx; + reg_maps->output_registers |= 1u << reg_idx; shader_signature_from_semantic(&output_signature_elements[reg_idx], semantic); if (semantic->usage == WINED3D_DECL_USAGE_FOG) reg_maps->fog = 1; @@ -853,7 +853,7 @@ memcpy(lconst->value, ins.src[0].reg.immconst_data, 4 * sizeof(DWORD)); list_add_head(&shader->constantsI, &lconst->entry); - reg_maps->local_int_consts |= (1 << lconst->idx); + reg_maps->local_int_consts |= (1u << lconst->idx); } else if (ins.handler_idx == WINED3DSIH_DEFB) { @@ -864,12 +864,12 @@ memcpy(lconst->value, ins.src[0].reg.immconst_data, sizeof(DWORD)); list_add_head(&shader->constantsB, &lconst->entry); - reg_maps->local_bool_consts |= (1 << lconst->idx); + reg_maps->local_bool_consts |= (1u << lconst->idx); } /* For subroutine prototypes. */ else if (ins.handler_idx == WINED3DSIH_LABEL) { - reg_maps->labels |= 1 << ins.src[0].reg.idx[0].offset; + reg_maps->labels |= 1u << ins.src[0].reg.idx[0].offset; } /* Set texture, address, temporary registers. */ else @@ -889,32 +889,31 @@ shader_version.type, constf_size)) return WINED3DERR_INVALIDCALL; - /* WINED3DSPR_TEXCRDOUT is the same as WINED3DSPR_OUTPUT. _OUTPUT can be > MAX_REG_TEXCRD and - * is used in >= 3.0 shaders. Filter 3.0 shaders to prevent overflows, and also filter pixel - * shaders because TECRDOUT isn't used in them, but future register types might cause issues */ - if (shader_version.type == WINED3D_SHADER_TYPE_VERTEX && shader_version.major < 3) + if (shader_version.type == WINED3D_SHADER_TYPE_VERTEX) { UINT idx = ins.dst[i].reg.idx[0].offset; switch (ins.dst[i].reg.type) { case WINED3DSPR_RASTOUT: + if (shader_version.major >= 3) + break; switch (idx) { case 0: /* oPos */ - reg_maps->output_registers |= 1 << 10; + reg_maps->output_registers |= 1u << 10; shader_signature_from_usage(&output_signature_elements[10], WINED3D_DECL_USAGE_POSITION, 0, 10, WINED3DSP_WRITEMASK_ALL); break; case 1: /* oFog */ - reg_maps->output_registers |= 1 << 11; + reg_maps->output_registers |= 1u << 11; shader_signature_from_usage(&output_signature_elements[11], WINED3D_DECL_USAGE_FOG, 0, 11, WINED3DSP_WRITEMASK_0); break; case 2: /* oPts */ - reg_maps->output_registers |= 1 << 11; + reg_maps->output_registers |= 1u << 11; shader_signature_from_usage(&output_signature_elements[11], WINED3D_DECL_USAGE_PSIZE, 0, 11, WINED3DSP_WRITEMASK_1); break; @@ -922,16 +921,18 @@ break; case WINED3DSPR_ATTROUT: + if (shader_version.major >= 3) + break; if (idx < 2) { idx += 8; - if (reg_maps->output_registers & (1 << idx)) + if (reg_maps->output_registers & (1u << idx)) { output_signature_elements[idx].mask |= ins.dst[i].write_mask; } else { - reg_maps->output_registers |= 1 << idx; + reg_maps->output_registers |= 1u << idx; shader_signature_from_usage(&output_signature_elements[idx], WINED3D_DECL_USAGE_COLOR, idx - 8, idx, ins.dst[i].write_mask); } @@ -939,15 +940,19 @@ break; case WINED3DSPR_TEXCRDOUT: - - reg_maps->texcoord_mask[idx] |= ins.dst[i].write_mask; - if (reg_maps->output_registers & (1 << idx)) + if (shader_version.major >= 3) + { + reg_maps->u.output_registers_mask[idx] |= ins.dst[i].write_mask; + break; + } + reg_maps->u.texcoord_mask[idx] |= ins.dst[i].write_mask; + if (reg_maps->output_registers & (1u << idx)) { output_signature_elements[idx].mask |= ins.dst[i].write_mask; } else { - reg_maps->output_registers |= 1 << idx; + reg_maps->output_registers |= 1u << idx; shader_signature_from_usage(&output_signature_elements[idx], WINED3D_DECL_USAGE_TEXCOORD, idx, idx, ins.dst[i].write_mask); } @@ -1012,16 +1017,16 @@ if (ins.handler_idx == WINED3DSIH_TEXBEM || ins.handler_idx == WINED3DSIH_TEXBEML) { - reg_maps->bumpmat |= 1 << reg_idx; + reg_maps->bumpmat |= 1u << reg_idx; if (ins.handler_idx == WINED3DSIH_TEXBEML) { - reg_maps->luminanceparams |= 1 << reg_idx; + reg_maps->luminanceparams |= 1u << reg_idx; } } } else if (ins.handler_idx == WINED3DSIH_BEM) { - reg_maps->bumpmat |= 1 << ins.dst[i].reg.idx[0].offset; + reg_maps->bumpmat |= 1u << ins.dst[i].reg.idx[0].offset; } } @@ -1093,7 +1098,7 @@ /* PS before 2.0 don't have explicit color outputs. Instead the value of * R0 is written to the render target. */ if (shader_version.major < 2 && shader_version.type == WINED3D_SHADER_TYPE_PIXEL) - reg_maps->rt_mask |= (1 << 0); + reg_maps->rt_mask |= (1u << 0); shader->functionLength = ((const char *)ptr - (const char *)byte_code); @@ -1101,7 +1106,7 @@ { for (i = 0; i < input_signature->element_count; ++i) { - reg_maps->input_registers |= 1 << input_signature->elements[i].register_idx; + reg_maps->input_registers |= 1u << input_signature->elements[i].register_idx; if (shader_version.type == WINED3D_SHADER_TYPE_PIXEL && input_signature->elements[i].sysval_semantic == WINED3D_SV_POSITION) reg_maps->vpos = 1; @@ -1120,7 +1125,7 @@ e = input_signature->elements; for (i = 0; i < ARRAY_SIZE(input_signature_elements); ++i) { - if (!(reg_maps->input_registers & (1 << i))) + if (!(reg_maps->input_registers & (1u << i))) continue; input_signature_elements[i].register_idx = i; *e++ = input_signature_elements[i]; @@ -1131,7 +1136,7 @@ { for (i = 0; i < output_signature->element_count; ++i) { - reg_maps->output_registers |= 1 << output_signature->elements[i].register_idx; + reg_maps->output_registers |= 1u << output_signature->elements[i].register_idx; } } else if (reg_maps->output_registers) @@ -1146,7 +1151,7 @@ e = output_signature->elements; for (i = 0; i < ARRAY_SIZE(output_signature_elements); ++i) { - if (!(reg_maps->output_registers & (1 << i))) + if (!(reg_maps->output_registers & (1u << i))) continue; *e++ = output_signature_elements[i]; } @@ -1157,7 +1162,7 @@ unsigned int shader_find_free_input_register(const struct wined3d_shader_reg_maps *reg_maps, unsigned int max) { - DWORD map = 1 << max; + DWORD map = 1u << max; map |= map - 1; map &= reg_maps->shader_version.major < 3 ? ~reg_maps->texcoord : ~reg_maps->input_registers; @@ -1178,7 +1183,7 @@ break; case WINED3D_SHADER_RESOURCE_TEXTURE_3D: - TRACE("_volume"); + TRACE("_3d"); break; case WINED3D_SHADER_RESOURCE_TEXTURE_CUBE: @@ -1924,9 +1929,9 @@ priv->vertex_pipe->vp_enable(gl_info, FALSE); priv->fragment_pipe->enable_extension(gl_info, FALSE); - context->shader_update_mask = (1 << WINED3D_SHADER_TYPE_PIXEL) - | (1 << WINED3D_SHADER_TYPE_VERTEX) - | (1 << WINED3D_SHADER_TYPE_GEOMETRY); + context->shader_update_mask = (1u << WINED3D_SHADER_TYPE_PIXEL) + | (1u << WINED3D_SHADER_TYPE_VERTEX) + | (1u << WINED3D_SHADER_TYPE_GEOMETRY); } static HRESULT shader_none_alloc(struct wined3d_device *device, const struct wined3d_vertex_pipe_ops *vertex_pipe, @@ -1989,6 +1994,7 @@ caps->vs_uniform_count = 0; caps->ps_uniform_count = 0; caps->ps_1x_max_value = 0.0f; + caps->varying_count = 0; caps->wined3d_caps = 0; } @@ -2037,8 +2043,8 @@ unsigned int backend_version; const struct wined3d_d3d_info *d3d_info = &shader->device->adapter->d3d_info; - TRACE("shader %p, byte_code %p, output_signature %p, float_const_count %u.\n", - shader, byte_code, output_signature, float_const_count); + TRACE("shader %p, byte_code %p, output_signature %p, float_const_count %u, type %#x, max_version %u.\n", + shader, byte_code, output_signature, float_const_count, type, max_version); list_init(&shader->constantsF); list_init(&shader->constantsB); @@ -2203,7 +2209,7 @@ } void find_vs_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader, - WORD swizzle_map, struct vs_compile_args *args) + WORD swizzle_map, struct vs_compile_args *args, const struct wined3d_d3d_info *d3d_info) { args->fog_src = state->render_states[WINED3D_RS_FOGTABLEMODE] == WINED3D_FOG_NONE ? VS_FOG_COORD : VS_FOG_Z; @@ -2212,6 +2218,10 @@ args->point_size = state->gl_primitive_type == GL_POINTS; args->per_vertex_point_size = shader->reg_maps.point_size; args->swizzle_map = swizzle_map; + if (d3d_info->emulated_flatshading) + args->flatshading = state->render_states[WINED3D_RS_SHADEMODE] == WINED3D_SHADE_FLAT; + else + args->flatshading = FALSE; } static BOOL match_usage(BYTE usage1, BYTE usage_idx1, BYTE usage2, BYTE usage_idx2) @@ -2367,7 +2377,7 @@ { const struct wined3d_shader_signature_element *input = &shader->input_signature.elements[i]; - if (!(reg_maps->input_registers & (1 << input->register_idx)) || !input->semantic_name) + if (!(reg_maps->input_registers & (1u << input->register_idx)) || !input->semantic_name) continue; shader->u.vs.attributes[input->register_idx].usage = @@ -2396,8 +2406,10 @@ } void find_ps_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader, - BOOL position_transformed, struct ps_compile_args *args, const struct wined3d_gl_info *gl_info) + BOOL position_transformed, struct ps_compile_args *args, const struct wined3d_context *context) { + const struct wined3d_gl_info *gl_info = context->gl_info; + const struct wined3d_d3d_info *d3d_info = context->d3d_info; const struct wined3d_texture *texture; UINT i; @@ -2520,11 +2532,11 @@ args->color_fixup[i] = texture->resource.format->color_fixup; if (texture->resource.format_flags & WINED3DFMT_FLAG_SHADOW) - args->shadow |= 1 << i; + args->shadow |= 1u << i; /* Flag samplers that need NP2 texcoord fixup. */ if (!(texture->flags & WINED3D_TEXTURE_POW2_MAT_IDENT)) - args->np2_fixup |= (1 << i); + args->np2_fixup |= (1u << i); } if (shader->reg_maps.shader_version.major >= 3) { @@ -2570,8 +2582,40 @@ } } + if (context->d3d_info->limits.varying_count < wined3d_max_compat_varyings(context->gl_info)) + { + const struct wined3d_shader *vs = state->shader[WINED3D_SHADER_TYPE_VERTEX]; + + args->texcoords_initialized = 0; + for (i = 0; i < MAX_TEXTURES; ++i) + { + if (vs) + { + if (state->shader[WINED3D_SHADER_TYPE_VERTEX]->reg_maps.output_registers & (1u << i)) + args->texcoords_initialized |= 1u << i; + } + else + { + const struct wined3d_stream_info *si = &context->stream_info; + unsigned int coord_idx = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX]; + + if ((state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX] >> WINED3D_FFP_TCI_SHIFT) + & WINED3D_FFP_TCI_MASK + || (coord_idx < MAX_TEXTURES && (si->use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coord_idx))))) + args->texcoords_initialized |= 1u << i; + } + } + } + else + { + args->texcoords_initialized = (1u << MAX_TEXTURES) - 1; + } + args->pointsprite = state->render_states[WINED3D_RS_POINTSPRITEENABLE] && state->gl_primitive_type == GL_POINTS; + + if (d3d_info->emulated_flatshading) + args->flatshading = state->render_states[WINED3D_RS_SHADEMODE] == WINED3D_SHADE_FLAT; } static HRESULT pixelshader_init(struct wined3d_shader *shader, struct wined3d_device *device, diff -Nru wine1.7-1.7.50/dlls/wined3d/shader_sm1.c wine1.7-1.7.55/dlls/wined3d/shader_sm1.c --- wine1.7-1.7.50/dlls/wined3d/shader_sm1.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/shader_sm1.c 2015-11-13 14:32:40.000000000 +0000 @@ -31,62 +31,62 @@ /* DCL usage masks */ #define WINED3DSP_DCL_USAGE_SHIFT 0 -#define WINED3DSP_DCL_USAGE_MASK (0xf << WINED3DSP_DCL_USAGE_SHIFT) +#define WINED3DSP_DCL_USAGE_MASK (0xfu << WINED3DSP_DCL_USAGE_SHIFT) #define WINED3DSP_DCL_USAGEINDEX_SHIFT 16 -#define WINED3DSP_DCL_USAGEINDEX_MASK (0xf << WINED3DSP_DCL_USAGEINDEX_SHIFT) +#define WINED3DSP_DCL_USAGEINDEX_MASK (0xfu << WINED3DSP_DCL_USAGEINDEX_SHIFT) /* DCL sampler type */ #define WINED3D_SM1_RESOURCE_TYPE_SHIFT 27 -#define WINED3D_SM1_RESOURCE_TYPE_MASK (0xf << WINED3D_SM1_RESOURCE_TYPE_SHIFT) +#define WINED3D_SM1_RESOURCE_TYPE_MASK (0xfu << WINED3D_SM1_RESOURCE_TYPE_SHIFT) /* Opcode-related masks */ #define WINED3DSI_OPCODE_MASK 0x0000ffff #define WINED3D_OPCODESPECIFICCONTROL_SHIFT 16 -#define WINED3D_OPCODESPECIFICCONTROL_MASK (0xff << WINED3D_OPCODESPECIFICCONTROL_SHIFT) +#define WINED3D_OPCODESPECIFICCONTROL_MASK (0xffu << WINED3D_OPCODESPECIFICCONTROL_SHIFT) #define WINED3DSI_INSTLENGTH_SHIFT 24 -#define WINED3DSI_INSTLENGTH_MASK (0xf << WINED3DSI_INSTLENGTH_SHIFT) +#define WINED3DSI_INSTLENGTH_MASK (0xfu << WINED3DSI_INSTLENGTH_SHIFT) -#define WINED3DSI_COISSUE (1 << 30) +#define WINED3DSI_COISSUE (0x1u << 30) #define WINED3DSI_COMMENTSIZE_SHIFT 16 -#define WINED3DSI_COMMENTSIZE_MASK (0x7fff << WINED3DSI_COMMENTSIZE_SHIFT) +#define WINED3DSI_COMMENTSIZE_MASK (0x7fffu << WINED3DSI_COMMENTSIZE_SHIFT) -#define WINED3DSHADER_INSTRUCTION_PREDICATED (1 << 28) +#define WINED3DSHADER_INSTRUCTION_PREDICATED (0x1u << 28) /* Register number mask */ #define WINED3DSP_REGNUM_MASK 0x000007ff /* Register type masks */ #define WINED3DSP_REGTYPE_SHIFT 28 -#define WINED3DSP_REGTYPE_MASK (0x7 << WINED3DSP_REGTYPE_SHIFT) +#define WINED3DSP_REGTYPE_MASK (0x7u << WINED3DSP_REGTYPE_SHIFT) #define WINED3DSP_REGTYPE_SHIFT2 8 -#define WINED3DSP_REGTYPE_MASK2 (0x18 << WINED3DSP_REGTYPE_SHIFT2) +#define WINED3DSP_REGTYPE_MASK2 (0x18u << WINED3DSP_REGTYPE_SHIFT2) /* Relative addressing mask */ #define WINED3DSHADER_ADDRESSMODE_SHIFT 13 -#define WINED3DSHADER_ADDRESSMODE_MASK (1 << WINED3DSHADER_ADDRESSMODE_SHIFT) +#define WINED3DSHADER_ADDRESSMODE_MASK (0x1u << WINED3DSHADER_ADDRESSMODE_SHIFT) /* Destination modifier mask */ #define WINED3DSP_DSTMOD_SHIFT 20 -#define WINED3DSP_DSTMOD_MASK (0xf << WINED3DSP_DSTMOD_SHIFT) +#define WINED3DSP_DSTMOD_MASK (0xfu << WINED3DSP_DSTMOD_SHIFT) /* Destination shift mask */ #define WINED3DSP_DSTSHIFT_SHIFT 24 -#define WINED3DSP_DSTSHIFT_MASK (0xf << WINED3DSP_DSTSHIFT_SHIFT) +#define WINED3DSP_DSTSHIFT_MASK (0xfu << WINED3DSP_DSTSHIFT_SHIFT) /* Write mask */ #define WINED3D_SM1_WRITEMASK_SHIFT 16 -#define WINED3D_SM1_WRITEMASK_MASK (0xf << WINED3D_SM1_WRITEMASK_SHIFT) +#define WINED3D_SM1_WRITEMASK_MASK (0xfu << WINED3D_SM1_WRITEMASK_SHIFT) /* Swizzle mask */ #define WINED3DSP_SWIZZLE_SHIFT 16 -#define WINED3DSP_SWIZZLE_MASK (0xff << WINED3DSP_SWIZZLE_SHIFT) +#define WINED3DSP_SWIZZLE_MASK (0xffu << WINED3DSP_SWIZZLE_SHIFT) /* Source modifier mask */ #define WINED3DSP_SRCMOD_SHIFT 24 -#define WINED3DSP_SRCMOD_MASK (0xf << WINED3DSP_SRCMOD_SHIFT) +#define WINED3DSP_SRCMOD_MASK (0xfu << WINED3DSP_SRCMOD_SHIFT) #define WINED3DSP_END 0x0000ffff @@ -95,8 +95,8 @@ enum WINED3DSHADER_ADDRESSMODE_TYPE { - WINED3DSHADER_ADDRMODE_ABSOLUTE = 0 << WINED3DSHADER_ADDRESSMODE_SHIFT, - WINED3DSHADER_ADDRMODE_RELATIVE = 1 << WINED3DSHADER_ADDRESSMODE_SHIFT, + WINED3DSHADER_ADDRMODE_ABSOLUTE = 0u << WINED3DSHADER_ADDRESSMODE_SHIFT, + WINED3DSHADER_ADDRMODE_RELATIVE = 1u << WINED3DSHADER_ADDRESSMODE_SHIFT, }; enum wined3d_sm1_resource_type @@ -412,7 +412,7 @@ { if (priv->shader_version.major < 2) { - *addr_token = (1 << 31) + *addr_token = (1u << 31) | ((WINED3DSPR_ADDR << WINED3DSP_REGTYPE_SHIFT2) & WINED3DSP_REGTYPE_MASK2) | ((WINED3DSPR_ADDR << WINED3DSP_REGTYPE_SHIFT) & WINED3DSP_REGTYPE_MASK) | (WINED3DSP_NOSWIZZLE << WINED3DSP_SWIZZLE_SHIFT); diff -Nru wine1.7-1.7.50/dlls/wined3d/shader_sm4.c wine1.7-1.7.55/dlls/wined3d/shader_sm4.c --- wine1.7-1.7.50/dlls/wined3d/shader_sm4.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/shader_sm4.c 2015-11-13 14:32:40.000000000 +0000 @@ -24,47 +24,47 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader); WINE_DECLARE_DEBUG_CHANNEL(d3d_bytecode); -#define WINED3D_SM4_INSTRUCTION_MODIFIER (1 << 31) +#define WINED3D_SM4_INSTRUCTION_MODIFIER (0x1u << 31) #define WINED3D_SM4_INSTRUCTION_LENGTH_SHIFT 24 -#define WINED3D_SM4_INSTRUCTION_LENGTH_MASK (0x1f << WINED3D_SM4_INSTRUCTION_LENGTH_SHIFT) +#define WINED3D_SM4_INSTRUCTION_LENGTH_MASK (0x1fu << WINED3D_SM4_INSTRUCTION_LENGTH_SHIFT) #define WINED3D_SM4_RESOURCE_TYPE_SHIFT 11 -#define WINED3D_SM4_RESOURCE_TYPE_MASK (0xf << WINED3D_SM4_RESOURCE_TYPE_SHIFT) +#define WINED3D_SM4_RESOURCE_TYPE_MASK (0xfu << WINED3D_SM4_RESOURCE_TYPE_SHIFT) #define WINED3D_SM4_PRIMITIVE_TYPE_SHIFT 11 -#define WINED3D_SM4_PRIMITIVE_TYPE_MASK (0x7 << WINED3D_SM4_PRIMITIVE_TYPE_SHIFT) +#define WINED3D_SM4_PRIMITIVE_TYPE_MASK (0x7u << WINED3D_SM4_PRIMITIVE_TYPE_SHIFT) #define WINED3D_SM4_INDEX_TYPE_SHIFT 11 -#define WINED3D_SM4_INDEX_TYPE_MASK (0x1 << WINED3D_SM4_INDEX_TYPE_SHIFT) +#define WINED3D_SM4_INDEX_TYPE_MASK (0x1u << WINED3D_SM4_INDEX_TYPE_SHIFT) #define WINED3D_SM4_OPCODE_MASK 0xff -#define WINED3D_SM4_REGISTER_MODIFIER (1 << 31) +#define WINED3D_SM4_REGISTER_MODIFIER (0x1u << 31) #define WINED3D_SM4_ADDRESSING_SHIFT1 25 -#define WINED3D_SM4_ADDRESSING_MASK1 (0x3 << WINED3D_SM4_ADDRESSING_SHIFT1) +#define WINED3D_SM4_ADDRESSING_MASK1 (0x3u << WINED3D_SM4_ADDRESSING_SHIFT1) #define WINED3D_SM4_ADDRESSING_SHIFT0 22 -#define WINED3D_SM4_ADDRESSING_MASK0 (0x3 << WINED3D_SM4_ADDRESSING_SHIFT0) +#define WINED3D_SM4_ADDRESSING_MASK0 (0x3u << WINED3D_SM4_ADDRESSING_SHIFT0) #define WINED3D_SM4_REGISTER_ORDER_SHIFT 20 -#define WINED3D_SM4_REGISTER_ORDER_MASK (0x3 << WINED3D_SM4_REGISTER_ORDER_SHIFT) +#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 (0xf << WINED3D_SM4_REGISTER_TYPE_SHIFT) +#define WINED3D_SM4_REGISTER_TYPE_MASK (0xfu << WINED3D_SM4_REGISTER_TYPE_SHIFT) #define WINED3D_SM4_SWIZZLE_TYPE_SHIFT 2 -#define WINED3D_SM4_SWIZZLE_TYPE_MASK (0x3 << WINED3D_SM4_SWIZZLE_TYPE_SHIFT) +#define WINED3D_SM4_SWIZZLE_TYPE_MASK (0x3u << WINED3D_SM4_SWIZZLE_TYPE_SHIFT) #define WINED3D_SM4_IMMCONST_TYPE_SHIFT 0 -#define WINED3D_SM4_IMMCONST_TYPE_MASK (0x3 << WINED3D_SM4_IMMCONST_TYPE_SHIFT) +#define WINED3D_SM4_IMMCONST_TYPE_MASK (0x3u << WINED3D_SM4_IMMCONST_TYPE_SHIFT) #define WINED3D_SM4_WRITEMASK_SHIFT 4 -#define WINED3D_SM4_WRITEMASK_MASK (0xf << WINED3D_SM4_WRITEMASK_SHIFT) +#define WINED3D_SM4_WRITEMASK_MASK (0xfu << WINED3D_SM4_WRITEMASK_SHIFT) #define WINED3D_SM4_SWIZZLE_SHIFT 4 -#define WINED3D_SM4_SWIZZLE_MASK (0xff << WINED3D_SM4_SWIZZLE_SHIFT) +#define WINED3D_SM4_SWIZZLE_MASK (0xffu << WINED3D_SM4_SWIZZLE_SHIFT) #define WINED3D_SM4_VERSION_MAJOR(version) (((version) >> 4) & 0xf) #define WINED3D_SM4_VERSION_MINOR(version) (((version) >> 0) & 0xf) diff -Nru wine1.7-1.7.50/dlls/wined3d/stateblock.c wine1.7-1.7.55/dlls/wined3d/stateblock.c --- wine1.7-1.7.50/dlls/wined3d/stateblock.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/stateblock.c 2015-11-13 14:32:40.000000000 +0000 @@ -225,7 +225,7 @@ static inline void stateblock_set_bits(DWORD *map, UINT map_size) { - DWORD mask = (1 << (map_size & 0x1f)) - 1; + DWORD mask = (1u << (map_size & 0x1f)) - 1; memset(map, 0xff, (map_size >> 5) * sizeof(*map)); if (mask) map[map_size >> 5] = mask; } @@ -275,14 +275,14 @@ for (i = 0; i < sizeof(pixel_states_render) / sizeof(*pixel_states_render); ++i) { DWORD rs = pixel_states_render[i]; - states->renderState[rs >> 5] |= 1 << (rs & 0x1f); + states->renderState[rs >> 5] |= 1u << (rs & 0x1f); } for (i = 0; i < sizeof(pixel_states_texture) / sizeof(*pixel_states_texture); ++i) - texture_mask |= 1 << pixel_states_texture[i]; + texture_mask |= 1u << pixel_states_texture[i]; for (i = 0; i < MAX_TEXTURES; ++i) states->textureState[i] = texture_mask; for (i = 0; i < sizeof(pixel_states_sampler) / sizeof(*pixel_states_sampler); ++i) - sampler_mask |= 1 << pixel_states_sampler[i]; + sampler_mask |= 1u << pixel_states_sampler[i]; for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i) states->samplerState[i] = sampler_mask; states->pixelShaderConstantsB = 0xffff; states->pixelShaderConstantsI = 0xffff; @@ -302,14 +302,14 @@ for (i = 0; i < sizeof(vertex_states_render) / sizeof(*vertex_states_render); ++i) { DWORD rs = vertex_states_render[i]; - states->renderState[rs >> 5] |= 1 << (rs & 0x1f); + states->renderState[rs >> 5] |= 1u << (rs & 0x1f); } for (i = 0; i < sizeof(vertex_states_texture) / sizeof(*vertex_states_texture); ++i) - texture_mask |= 1 << vertex_states_texture[i]; + texture_mask |= 1u << vertex_states_texture[i]; for (i = 0; i < MAX_TEXTURES; ++i) states->textureState[i] = texture_mask; for (i = 0; i < sizeof(vertex_states_sampler) / sizeof(*vertex_states_sampler); ++i) - sampler_mask |= 1 << vertex_states_sampler[i]; + sampler_mask |= 1u << vertex_states_sampler[i]; for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i) states->samplerState[i] = sampler_mask; states->vertexShaderConstantsB = 0xffff; states->vertexShaderConstantsI = 0xffff; @@ -357,7 +357,7 @@ for (i = 0; i < MAX_CONST_I; ++i) { - if (stateblock->changed.vertexShaderConstantsI & (1 << i)) + if (stateblock->changed.vertexShaderConstantsI & (1u << i)) { stateblock->contained_vs_consts_i[stateblock->num_contained_vs_consts_i] = i; ++stateblock->num_contained_vs_consts_i; @@ -366,7 +366,7 @@ for (i = 0; i < MAX_CONST_B; ++i) { - if (stateblock->changed.vertexShaderConstantsB & (1 << i)) + if (stateblock->changed.vertexShaderConstantsB & (1u << i)) { stateblock->contained_vs_consts_b[stateblock->num_contained_vs_consts_b] = i; ++stateblock->num_contained_vs_consts_b; @@ -384,7 +384,7 @@ for (i = 0; i < MAX_CONST_I; ++i) { - if (stateblock->changed.pixelShaderConstantsI & (1 << i)) + if (stateblock->changed.pixelShaderConstantsI & (1u << i)) { stateblock->contained_ps_consts_i[stateblock->num_contained_ps_consts_i] = i; ++stateblock->num_contained_ps_consts_i; @@ -393,7 +393,7 @@ for (i = 0; i < MAX_CONST_B; ++i) { - if (stateblock->changed.pixelShaderConstantsB & (1 << i)) + if (stateblock->changed.pixelShaderConstantsB & (1u << i)) { stateblock->contained_ps_consts_b[stateblock->num_contained_ps_consts_b] = i; ++stateblock->num_contained_ps_consts_b; diff -Nru wine1.7-1.7.50/dlls/wined3d/state.c wine1.7-1.7.55/dlls/wined3d/state.c --- wine1.7-1.7.50/dlls/wined3d/state.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/state.c 2015-11-13 14:32:40.000000000 +0000 @@ -165,7 +165,7 @@ } } -static void state_shademode(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) +void state_shademode(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { const struct wined3d_gl_info *gl_info = context->gl_info; @@ -176,12 +176,12 @@ checkGLcall("glShadeModel(GL_FLAT)"); break; case WINED3D_SHADE_GOURAUD: + /* WINED3D_SHADE_PHONG in practice is the same as WINED3D_SHADE_GOURAUD + * in D3D. */ + case WINED3D_SHADE_PHONG: gl_info->gl_ops.gl.p_glShadeModel(GL_SMOOTH); checkGLcall("glShadeModel(GL_SMOOTH)"); break; - case WINED3D_SHADE_PHONG: - FIXME("WINED3D_SHADE_PHONG isn't supported.\n"); - break; default: FIXME("Unrecognized shade mode %#x.\n", state->render_states[WINED3D_RS_SHADEMODE]); @@ -587,7 +587,7 @@ * The enabled / disabled planes are hardcoded into the shader. Update the * shader to update the enabled clipplanes. In case of fixed function, we * need to update the clipping field from ffp_vertex_settings. */ - context->shader_update_mask |= 1 << WINED3D_SHADER_TYPE_VERTEX; + context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_VERTEX; /* TODO: Keep track of previously enabled clipplanes to avoid unnecessary resetting * of already set values @@ -1213,7 +1213,7 @@ } context->num_untracked_materials = 0; - if ((context->stream_info.use_map & (1 << WINED3D_FFP_DIFFUSE)) + if ((context->stream_info.use_map & (1u << WINED3D_FFP_DIFFUSE)) && state->render_states[WINED3D_RS_COLORVERTEX]) { TRACE("diff %d, amb %d, emis %d, spec %d\n", @@ -1366,7 +1366,7 @@ * by zero and is not properly defined in opengl, so avoid it */ if (state->render_states[WINED3D_RS_NORMALIZENORMALS] - && (context->stream_info.use_map & (1 << WINED3D_FFP_NORMAL))) + && (context->stream_info.use_map & (1u << WINED3D_FFP_NORMAL))) { gl_info->gl_ops.gl.p_glEnable(GL_NORMALIZE); checkGLcall("glEnable(GL_NORMALIZE);"); @@ -2999,7 +2999,7 @@ static void tex_colorop(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { DWORD stage = (state_id - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1); - BOOL tex_used = context->fixed_function_usage_map & (1 << stage); + BOOL tex_used = context->fixed_function_usage_map & (1u << stage); DWORD mapped_stage = context->tex_unit_map[stage]; const struct wined3d_gl_info *gl_info = context->gl_info; @@ -3060,7 +3060,7 @@ void tex_alphaop(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { DWORD stage = (state_id - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1); - BOOL tex_used = context->fixed_function_usage_map & (1 << stage); + BOOL tex_used = context->fixed_function_usage_map & (1u << stage); DWORD mapped_stage = context->tex_unit_map[stage]; const struct wined3d_gl_info *gl_info = context->gl_info; DWORD op, arg1, arg2, arg0; @@ -3213,7 +3213,7 @@ continue; } - if (coordIdx < MAX_TEXTURES && (si->use_map & (1 << (WINED3D_FFP_TEXCOORD0 + coordIdx)))) + if (coordIdx < MAX_TEXTURES && (si->use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coordIdx)))) { const struct wined3d_stream_info_element *e = &si->elements[WINED3D_FFP_TEXCOORD0 + coordIdx]; @@ -3446,12 +3446,12 @@ { const BOOL texIsPow2 = !(texture->flags & WINED3D_TEXTURE_POW2_MAT_IDENT); - if (texIsPow2 || (context->lastWasPow2Texture & (1 << sampler))) + if (texIsPow2 || (context->lastWasPow2Texture & (1u << sampler))) { if (texIsPow2) - context->lastWasPow2Texture |= 1 << sampler; + context->lastWasPow2Texture |= 1u << sampler; else - context->lastWasPow2Texture &= ~(1 << sampler); + context->lastWasPow2Texture &= ~(1u << sampler); transform_texture(context, state, STATE_TEXTURESTAGE(context->tex_unit_map[sampler], WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS)); @@ -3667,12 +3667,12 @@ context->last_was_pshader = FALSE; } - context->shader_update_mask |= 1 << WINED3D_SHADER_TYPE_PIXEL; + context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL; } static void state_geometry_shader(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - context->shader_update_mask |= 1 << WINED3D_SHADER_TYPE_GEOMETRY; + context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_GEOMETRY; } static void shader_bumpenv(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) @@ -3927,7 +3927,7 @@ if (gl_info->supported[ARB_INSTANCED_ARRAYS]) GL_EXTCALL(glVertexAttribDivisor(i, 0)); - context->numbered_array_mask &= ~(1 << i); + context->numbered_array_mask &= ~(1u << i); } /* This should match any arrays loaded in loadNumberedArrays @@ -3956,9 +3956,9 @@ { const struct wined3d_stream_state *stream; - if (!(stream_info->use_map & (1 << i))) + if (!(stream_info->use_map & (1u << i))) { - if (context->numbered_array_mask & (1 << i)) + if (context->numbered_array_mask & (1u << i)) unload_numbered_array(context, i); if (!use_vs(state) && i == WINED3D_FFP_DIFFUSE) GL_EXTCALL(glVertexAttrib4f(i, 1.0f, 1.0f, 1.0f, 1.0f)); @@ -3980,7 +3980,7 @@ { /* Unload instanced arrays, they will be loaded using * immediate mode instead. */ - if (context->numbered_array_mask & (1 << i)) + if (context->numbered_array_mask & (1u << i)) unload_numbered_array(context, i); continue; } @@ -4005,10 +4005,10 @@ stream_info->elements[i].stride, stream_info->elements[i].data.addr + state->load_base_vertex_index * stream_info->elements[i].stride)); - if (!(context->numbered_array_mask & (1 << i))) + if (!(context->numbered_array_mask & (1u << i))) { GL_EXTCALL(glEnableVertexAttribArray(i)); - context->numbered_array_mask |= (1 << i); + context->numbered_array_mask |= (1u << i); } } else @@ -4023,7 +4023,7 @@ ptr += (ULONG_PTR)buffer_get_sysmem(stream->buffer, context); } - if (context->numbered_array_mask & (1 << i)) unload_numbered_array(context, i); + if (context->numbered_array_mask & (1u << i)) unload_numbered_array(context, i); switch (stream_info->elements[i].format->id) { @@ -4047,9 +4047,9 @@ if (gl_info->supported[ARB_VERTEX_ARRAY_BGRA]) { const DWORD *src = (const DWORD *)ptr; - DWORD c = *src & 0xff00ff00; - c |= (*src & 0xff0000) >> 16; - c |= (*src & 0xff) << 16; + DWORD c = *src & 0xff00ff00u; + c |= (*src & 0xff0000u) >> 16; + c |= (*src & 0xffu) << 16; GL_EXTCALL(glVertexAttrib4Nubv(i, (GLubyte *)&c)); break; } @@ -4145,8 +4145,8 @@ context->instance_count = 0; /* Blend Data ---------------------------------------------- */ - if ((si->use_map & (1 << WINED3D_FFP_BLENDWEIGHT)) - || si->use_map & (1 << WINED3D_FFP_BLENDINDICES)) + if ((si->use_map & (1u << WINED3D_FFP_BLENDWEIGHT)) + || si->use_map & (1u << WINED3D_FFP_BLENDINDICES)) { e = &si->elements[WINED3D_FFP_BLENDWEIGHT]; @@ -4177,7 +4177,7 @@ checkGLcall("glWeightPointerARB"); - if (si->use_map & (1 << WINED3D_FFP_BLENDINDICES)) + if (si->use_map & (1u << WINED3D_FFP_BLENDINDICES)) { static BOOL warned; if (!warned) @@ -4204,7 +4204,7 @@ } /* Point Size ----------------------------------------------*/ - if (si->use_map & (1 << WINED3D_FFP_PSIZE)) + if (si->use_map & (1u << WINED3D_FFP_PSIZE)) { /* no such functionality in the fixed function GL pipeline */ TRACE("Cannot change ptSize here in openGl\n"); @@ -4212,7 +4212,7 @@ } /* Vertex Pointers -----------------------------------------*/ - if (si->use_map & (1 << WINED3D_FFP_POSITION)) + if (si->use_map & (1u << WINED3D_FFP_POSITION)) { e = &si->elements[WINED3D_FFP_POSITION]; @@ -4234,7 +4234,7 @@ } /* Normals -------------------------------------------------*/ - if (si->use_map & (1 << WINED3D_FFP_NORMAL)) + if (si->use_map & (1u << WINED3D_FFP_NORMAL)) { e = &si->elements[WINED3D_FFP_NORMAL]; @@ -4261,7 +4261,7 @@ } /* Diffuse Colour --------------------------------------------*/ - if (si->use_map & (1 << WINED3D_FFP_DIFFUSE)) + if (si->use_map & (1u << WINED3D_FFP_DIFFUSE)) { e = &si->elements[WINED3D_FFP_DIFFUSE]; @@ -4289,7 +4289,7 @@ } /* Specular Colour ------------------------------------------*/ - if (si->use_map & (1 << WINED3D_FFP_SPECULAR)) + if (si->use_map & (1u << WINED3D_FFP_SPECULAR)) { TRACE("setting specular colour\n"); @@ -4520,7 +4520,7 @@ } context->last_was_vshader = useVertexShaderFunction; - context->shader_update_mask |= 1 << WINED3D_SHADER_TYPE_VERTEX; + context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_VERTEX; if (updateFog) context_apply_state(context, state, STATE_RENDER(WINED3D_RS_FOGVERTEXMODE)); @@ -4537,7 +4537,7 @@ if (use_ps(state) && state->shader[WINED3D_SHADER_TYPE_PIXEL]->reg_maps.shader_version.major == 1 && state->shader[WINED3D_SHADER_TYPE_PIXEL]->reg_maps.shader_version.minor <= 3) - context->shader_update_mask |= 1 << WINED3D_SHADER_TYPE_PIXEL; + context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL; } } @@ -4941,7 +4941,6 @@ { 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_SHADEMODE), { STATE_RENDER(WINED3D_RS_SHADEMODE), state_shademode }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_LINEPATTERN), { STATE_RENDER(WINED3D_RS_LINEPATTERN), state_linepattern }, 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 }, @@ -5549,6 +5548,7 @@ { STATE_RENDER(WINED3D_RS_FOGVERTEXMODE), { STATE_RENDER(WINED3D_RS_FOGENABLE), NULL }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_FOGSTART), { STATE_RENDER(WINED3D_RS_FOGSTART), state_fogstartend }, WINED3D_GL_EXT_NONE }, { STATE_RENDER(WINED3D_RS_FOGEND), { STATE_RENDER(WINED3D_RS_FOGSTART), NULL }, WINED3D_GL_EXT_NONE }, + { STATE_RENDER(WINED3D_RS_SHADEMODE), { STATE_RENDER(WINED3D_RS_SHADEMODE), state_shademode }, WINED3D_GL_EXT_NONE }, { STATE_SAMPLER(0), { STATE_SAMPLER(0), sampler_texdim }, WINED3D_GL_EXT_NONE }, { STATE_SAMPLER(1), { STATE_SAMPLER(1), sampler_texdim }, WINED3D_GL_EXT_NONE }, { STATE_SAMPLER(2), { STATE_SAMPLER(2), sampler_texdim }, WINED3D_GL_EXT_NONE }, diff -Nru wine1.7-1.7.50/dlls/wined3d/surface.c wine1.7-1.7.55/dlls/wined3d/surface.c --- wine1.7-1.7.50/dlls/wined3d/surface.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/surface.c 2015-11-13 14:32:40.000000000 +0000 @@ -351,9 +351,9 @@ /* Works correctly only for <= 4 bpp formats. */ static void get_color_masks(const struct wined3d_format *format, DWORD *masks) { - masks[0] = ((1 << format->red_size) - 1) << format->red_offset; - masks[1] = ((1 << format->green_size) - 1) << format->green_offset; - masks[2] = ((1 << format->blue_size) - 1) << format->blue_offset; + masks[0] = ((1u << format->red_size) - 1) << format->red_offset; + masks[1] = ((1u << format->green_size) - 1) << format->green_offset; + masks[2] = ((1u << format->blue_size) - 1) << format->blue_offset; } static HRESULT surface_create_dib_section(struct wined3d_surface *surface) @@ -388,7 +388,7 @@ default: /* Allocate extra space for a palette. */ b_info = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * (1 << (format->byte_count * 8))); + sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * (1u << (format->byte_count * 8))); break; } @@ -751,7 +751,11 @@ } if (surface->container->swapchain && surface->container->swapchain->front_buffer == surface->container) - surface_load_location(surface, surface->container->resource.draw_binding); + { + context = context_acquire(device, surface); + surface_load_location(surface, context, surface->container->resource.draw_binding); + context_release(context); + } else if (surface->container->resource.format_flags & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)) FIXME("Depth / stencil buffer locking is not implemented.\n"); } @@ -804,12 +808,6 @@ if (src_mask & WINED3DFMT_FLAG_STENCIL) gl_mask |= GL_STENCIL_BUFFER_BIT; - /* Make sure the locations are up-to-date. Loading the destination - * surface isn't required if the entire surface is overwritten. */ - surface_load_location(src_surface, src_location); - if (!surface_is_full_rect(dst_surface, dst_rect)) - surface_load_location(dst_surface, dst_location); - context = context_acquire(device, NULL); if (!context->valid) { @@ -818,6 +816,14 @@ return; } + /* Make sure the locations are up-to-date. Loading the destination + * surface isn't required if the entire surface is overwritten. */ + surface_load_location(src_surface, context, src_location); + if (!surface_is_full_rect(dst_surface, dst_rect)) + surface_load_location(dst_surface, context, dst_location); + else + wined3d_surface_prepare(dst_surface, context, dst_location); + gl_info = context->gl_info; context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, NULL, src_surface, src_location); @@ -858,13 +864,15 @@ } /* Blit between surface locations. Onscreen on different swapchains is not supported. - * Depth / stencil is not supported. */ -static void surface_blt_fbo(const struct wined3d_device *device, enum wined3d_texture_filter_type filter, + * Depth / stencil is not supported. Context activation is done by the caller. */ +static void surface_blt_fbo(const struct wined3d_device *device, + struct wined3d_context *old_ctx, enum wined3d_texture_filter_type filter, struct wined3d_surface *src_surface, DWORD src_location, const RECT *src_rect_in, struct wined3d_surface *dst_surface, DWORD dst_location, const RECT *dst_rect_in) { const struct wined3d_gl_info *gl_info; - struct wined3d_context *context; + struct wined3d_context *context = old_ctx; + struct wined3d_surface *required_rt, *restore_rt = NULL; RECT src_rect, dst_rect; GLenum gl_filter; GLenum buffer; @@ -903,13 +911,22 @@ * surface isn't required if the entire surface is overwritten. (And is * in fact harmful if we're being called by surface_load_location() with * the purpose of loading the destination surface.) */ - surface_load_location(src_surface, src_location); + surface_load_location(src_surface, old_ctx, src_location); if (!surface_is_full_rect(dst_surface, &dst_rect)) - surface_load_location(dst_surface, dst_location); + surface_load_location(dst_surface, old_ctx, dst_location); + else + wined3d_surface_prepare(dst_surface, old_ctx, dst_location); + - if (src_location == WINED3D_LOCATION_DRAWABLE) context = context_acquire(device, src_surface); - else if (dst_location == WINED3D_LOCATION_DRAWABLE) context = context_acquire(device, dst_surface); - else context = context_acquire(device, NULL); + if (src_location == WINED3D_LOCATION_DRAWABLE) required_rt = src_surface; + 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; + context = context_acquire(device, required_rt); + } if (!context->valid) { @@ -972,7 +989,8 @@ && dst_surface->container->swapchain->front_buffer == dst_surface->container)) gl_info->gl_ops.gl.p_glFlush(); - context_release(context); + if (restore_rt) + context_restore(context, restore_rt); } static BOOL fbo_blit_supported(const struct wined3d_gl_info *gl_info, enum wined3d_blit_op blit_op, @@ -995,6 +1013,10 @@ if (!((dst_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_FBO_ATTACHABLE) || (dst_usage & WINED3DUSAGE_RENDERTARGET))) return FALSE; + if (!(src_format->id == dst_format->id + || (is_identity_fixup(src_format->color_fixup) + && is_identity_fixup(dst_format->color_fixup)))) + return FALSE; break; case WINED3D_BLIT_OP_DEPTH_BLIT: @@ -1002,17 +1024,18 @@ return FALSE; if (!(dst_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL))) return FALSE; + /* Accept pure swizzle fixups for depth formats. In general we + * ignore the stencil component (if present) at the moment and the + * swizzle is not relevant with just the depth component. */ + if (is_complex_fixup(src_format->color_fixup) || is_complex_fixup(dst_format->color_fixup) + || is_scaling_fixup(src_format->color_fixup) || is_scaling_fixup(dst_format->color_fixup)) + return FALSE; break; default: return FALSE; } - if (!(src_format->id == dst_format->id - || (is_identity_fixup(src_format->color_fixup) - && is_identity_fixup(dst_format->color_fixup)))) - return FALSE; - return TRUE; } @@ -1082,19 +1105,6 @@ return WINED3D_OK; } -HRESULT CDECL wined3d_surface_get_render_target_data(struct wined3d_surface *surface, - struct wined3d_surface *render_target) -{ - TRACE("surface %p, render_target %p.\n", surface, render_target); - - /* TODO: Check surface sizes, pools, etc. */ - - if (render_target->resource.multisample_type) - return WINED3DERR_INVALIDCALL; - - return wined3d_surface_blt(surface, NULL, render_target, NULL, 0, NULL, WINED3D_TEXF_POINT); -} - /* Context activation is done by the caller. */ static void surface_remove_pbo(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info) { @@ -1125,6 +1135,9 @@ TRACE("surface %p.\n", surface); + context = context_acquire(device, NULL); + gl_info = context->gl_info; + if (resource->pool == WINED3D_POOL_DEFAULT) { /* Default pool resources are supposed to be destroyed before Reset is called. @@ -1150,13 +1163,10 @@ else { surface_prepare_map_memory(surface); - surface_load_location(surface, surface->resource.map_binding); + surface_load_location(surface, context, surface->resource.map_binding); surface_invalidate_location(surface, ~surface->resource.map_binding); } - context = context_acquire(device, NULL); - gl_info = context->gl_info; - /* Destroy PBOs, but load them into real sysmem before */ if (surface->pbo) surface_remove_pbo(surface, gl_info); @@ -1190,11 +1200,26 @@ resource_unload(resource); } +static HRESULT surface_resource_sub_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, + struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) +{ + ERR("Not supported on sub-resources.\n"); + return WINED3DERR_INVALIDCALL; +} + +static HRESULT surface_resource_sub_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx) +{ + ERR("Not supported on sub-resources.\n"); + return WINED3DERR_INVALIDCALL; +} + static const struct wined3d_resource_ops surface_resource_ops = { surface_resource_incref, surface_resource_decref, surface_unload, + surface_resource_sub_resource_map, + surface_resource_sub_resource_unmap, }; static const struct wined3d_surface_ops surface_ops = @@ -1526,13 +1551,13 @@ } } -static BOOL surface_check_block_align(struct wined3d_surface *surface, const RECT *rect) +static BOOL surface_check_block_align(struct wined3d_surface *surface, const struct wined3d_box *box) { UINT width_mask, height_mask; - if (!rect->left && !rect->top - && rect->right == surface->resource.width - && rect->bottom == surface->resource.height) + if (!box->left && !box->top + && box->right == surface->resource.width + && box->bottom == surface->resource.height) return TRUE; /* This assumes power of two block sizes, but NPOT block sizes would be @@ -1540,13 +1565,20 @@ width_mask = surface->resource.format->block_width - 1; height_mask = surface->resource.format->block_height - 1; - if (!(rect->left & width_mask) && !(rect->top & height_mask) - && !(rect->right & width_mask) && !(rect->bottom & height_mask)) + if (!(box->left & width_mask) && !(box->top & height_mask) + && !(box->right & width_mask) && !(box->bottom & height_mask)) return TRUE; return FALSE; } +static BOOL surface_check_block_align_rect(struct wined3d_surface *surface, const RECT *rect) +{ + struct wined3d_box box = {rect->left, rect->top, rect->right, rect->bottom, 0, 1}; + + return surface_check_block_align(surface, &box); +} + HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point, struct wined3d_surface *src_surface, const RECT *src_rect) { @@ -1617,14 +1649,14 @@ return WINED3DERR_INVALIDCALL; } - if ((src_fmt_flags & WINED3DFMT_FLAG_BLOCKS) && !surface_check_block_align(src_surface, src_rect)) + if ((src_fmt_flags & WINED3DFMT_FLAG_BLOCKS) && !surface_check_block_align_rect(src_surface, src_rect)) { WARN("Source rectangle not block-aligned.\n"); return WINED3DERR_INVALIDCALL; } SetRect(&dst_rect, dst_point->x, dst_point->y, dst_point->x + update_w, dst_point->y + update_h); - if ((dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS) && !surface_check_block_align(dst_surface, &dst_rect)) + if ((dst_fmt_flags & WINED3DFMT_FLAG_BLOCKS) && !surface_check_block_align_rect(dst_surface, &dst_rect)) { WARN("Destination rectangle not block-aligned.\n"); return WINED3DERR_INVALIDCALL; @@ -1643,7 +1675,7 @@ if (update_w == dst_w && update_h == dst_h) wined3d_texture_prepare_texture(dst_surface->container, context, FALSE); else - surface_load_location(dst_surface, WINED3D_LOCATION_TEXTURE_RGB); + surface_load_location(dst_surface, context, WINED3D_LOCATION_TEXTURE_RGB); wined3d_texture_bind_and_dirtify(dst_surface->container, context, FALSE); surface_get_memory(src_surface, &data, src_surface->locations); @@ -1759,7 +1791,8 @@ return GL_BACK; } -void surface_load(struct wined3d_surface *surface, BOOL srgb) +/* Context activation is done by the caller. */ +void surface_load(struct wined3d_surface *surface, struct wined3d_context *context, BOOL srgb) { DWORD location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; @@ -1775,7 +1808,7 @@ } TRACE("Reloading because surface is dirty.\n"); - surface_load_location(surface, location); + surface_load_location(surface, context, location); surface_evict_sysmem(surface); } @@ -1795,21 +1828,21 @@ if (isinf(*in)) return (*in < 0.0f ? 0xfc00 : 0x7c00); - if (tmp < powf(2, 10)) + if (tmp < (float)(1u << 10)) { do { tmp = tmp * 2.0f; exp--; - } while (tmp < powf(2, 10)); + } while (tmp < (float)(1u << 10)); } - else if (tmp >= powf(2, 11)) + else if (tmp >= (float)(1u << 11)) { do { tmp /= 2.0f; exp++; - } while (tmp >= powf(2, 11)); + } while (tmp >= (float)(1u << 11)); } mantissa = (unsigned int)tmp; @@ -1883,38 +1916,6 @@ return &surface->resource; } -HRESULT CDECL wined3d_surface_get_blt_status(const struct wined3d_surface *surface, DWORD flags) -{ - TRACE("surface %p, flags %#x.\n", surface, flags); - - switch (flags) - { - case WINEDDGBS_CANBLT: - case WINEDDGBS_ISBLTDONE: - return WINED3D_OK; - - default: - return WINED3DERR_INVALIDCALL; - } -} - -HRESULT CDECL wined3d_surface_get_flip_status(const struct wined3d_surface *surface, DWORD flags) -{ - TRACE("surface %p, flags %#x.\n", surface, flags); - - /* XXX: DDERR_INVALIDSURFACETYPE */ - - switch (flags) - { - case WINEDDGFS_CANFLIP: - case WINEDDGFS_ISFLIPDONE: - return WINED3D_OK; - - default: - return WINED3DERR_INVALIDCALL; - } -} - HRESULT CDECL wined3d_surface_is_lost(const struct wined3d_surface *surface) { TRACE("surface %p.\n", surface); @@ -2206,10 +2207,10 @@ for (x = 0; x < w; ++x) { WORD pixel = src_line[x]; - dst_line[x] = 0xff000000 - | convert_5to8[(pixel & 0xf800) >> 11] << 16 - | convert_6to8[(pixel & 0x07e0) >> 5] << 8 - | convert_5to8[(pixel & 0x001f)]; + dst_line[x] = 0xff000000u + | convert_5to8[(pixel & 0xf800u) >> 11] << 16 + | convert_6to8[(pixel & 0x07e0u) >> 5] << 8 + | convert_5to8[(pixel & 0x001fu)]; } } } @@ -2489,7 +2490,7 @@ } HRESULT CDECL wined3d_surface_map(struct wined3d_surface *surface, - struct wined3d_map_desc *map_desc, const RECT *rect, DWORD flags) + struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) { const struct wined3d_format *format = surface->resource.format; unsigned int fmt_flags = surface->container->resource.format_flags; @@ -2498,8 +2499,8 @@ const struct wined3d_gl_info *gl_info; BYTE *base_memory; - TRACE("surface %p, map_desc %p, rect %s, flags %#x.\n", - surface, map_desc, wine_dbgstr_rect(rect), flags); + TRACE("surface %p, map_desc %p, box %p, flags %#x.\n", + surface, map_desc, box, flags); if (surface->resource.map_count) { @@ -2507,11 +2508,11 @@ return WINED3DERR_INVALIDCALL; } - if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && rect - && !surface_check_block_align(surface, rect)) + if ((fmt_flags & WINED3DFMT_FLAG_BLOCKS) && box + && !surface_check_block_align(surface, box)) { - WARN("Map rect %s is misaligned for %ux%u blocks.\n", - wine_dbgstr_rect(rect), format->block_width, format->block_height); + WARN("Map rect %p is misaligned for %ux%u blocks.\n", + box, format->block_width, format->block_height); if (surface->resource.pool == WINED3D_POOL_DEFAULT) return WINED3DERR_INVALIDCALL; @@ -2546,10 +2547,16 @@ } else { + struct wined3d_context *context = NULL; + if (surface->resource.usage & WINED3DUSAGE_DYNAMIC) WARN_(d3d_perf)("Mapping a dynamic surface without WINED3D_MAP_DISCARD.\n"); - surface_load_location(surface, surface->resource.map_binding); + if (surface->resource.device->d3d_initialized) + context = context_acquire(surface->resource.device, NULL); + surface_load_location(surface, context, surface->resource.map_binding); + if (context) + context_release(context); } if (!(flags & (WINED3D_MAP_NO_DIRTY_UPDATE | WINED3D_MAP_READONLY))) @@ -2590,9 +2597,9 @@ map_desc->row_pitch = surface->resource.width * format->byte_count; else map_desc->row_pitch = wined3d_surface_get_pitch(surface); - map_desc->slice_pitch = 0; + map_desc->slice_pitch = surface->resource.height * map_desc->row_pitch; - if (!rect) + if (!box) { map_desc->data = base_memory; surface->lockedRect.left = 0; @@ -2607,19 +2614,19 @@ /* Compressed textures are block based, so calculate the offset of * the block that contains the top-left pixel of the locked rectangle. */ map_desc->data = base_memory - + ((rect->top / format->block_height) * map_desc->row_pitch) - + ((rect->left / format->block_width) * format->block_byte_count); + + ((box->top / format->block_height) * map_desc->row_pitch) + + ((box->left / format->block_width) * format->block_byte_count); } else { map_desc->data = base_memory - + (map_desc->row_pitch * rect->top) - + (rect->left * format->byte_count); + + (map_desc->row_pitch * box->top) + + (box->left * format->byte_count); } - surface->lockedRect.left = rect->left; - surface->lockedRect.top = rect->top; - surface->lockedRect.right = rect->right; - surface->lockedRect.bottom = rect->bottom; + surface->lockedRect.left = box->left; + surface->lockedRect.top = box->top; + surface->lockedRect.right = box->right; + surface->lockedRect.bottom = box->bottom; } TRACE("Locked rect %s.\n", wine_dbgstr_rect(&surface->lockedRect)); @@ -2631,6 +2638,8 @@ HRESULT CDECL wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc) { HRESULT hr; + struct wined3d_device *device = surface->resource.device; + struct wined3d_context *context = NULL; TRACE("surface %p, dc %p.\n", surface, dc); @@ -2642,26 +2651,36 @@ if (surface->resource.map_count) return WINED3DERR_INVALIDCALL; + if (device->d3d_initialized) + context = context_acquire(surface->resource.device, NULL); + /* Create a DIB section if there isn't a dc yet. */ if (!surface->hDC) { if (surface->flags & SFLAG_CLIENT) { - surface_load_location(surface, WINED3D_LOCATION_SYSMEM); + surface_load_location(surface, context, WINED3D_LOCATION_SYSMEM); surface_release_client_storage(surface); } hr = surface_create_dib_section(surface); if (FAILED(hr)) - return WINED3DERR_INVALIDCALL; + { + if (context) + context_release(context); + return WINED3DERR_INVALIDCALL; + } if (!(surface->resource.map_binding == WINED3D_LOCATION_USER_MEMORY || surface->container->flags & WINED3D_TEXTURE_PIN_SYSMEM || surface->pbo)) surface->resource.map_binding = WINED3D_LOCATION_DIB; } - surface_load_location(surface, WINED3D_LOCATION_DIB); + surface_load_location(surface, context, WINED3D_LOCATION_DIB); surface_invalidate_location(surface, ~WINED3D_LOCATION_DIB); + if (context) + context_release(context); + surface->flags |= SFLAG_DCINUSE; surface->resource.map_count++; @@ -2699,18 +2718,28 @@ * copied back to the DIB in the next getdc call. * * The same consideration applies to user memory surfaces. */ - surface_load_location(surface, surface->resource.map_binding); + struct wined3d_device *device = surface->resource.device; + struct wined3d_context *context = NULL; + + if (device->d3d_initialized) + context = context_acquire(device, NULL); + + surface_load_location(surface, context, surface->resource.map_binding); surface_invalidate_location(surface, WINED3D_LOCATION_DIB); + if (context) + context_release(context); } return WINED3D_OK; } -static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_location) +static void read_from_framebuffer(struct wined3d_surface *surface, + struct wined3d_context *old_ctx, DWORD dst_location) { struct wined3d_device *device = surface->resource.device; const struct wined3d_gl_info *gl_info; - struct wined3d_context *context; + struct wined3d_context *context = old_ctx; + struct wined3d_surface *restore_rt = NULL; BYTE *mem; BYTE *row, *top, *bottom; int i; @@ -2719,7 +2748,12 @@ surface_get_memory(surface, &data, dst_location); - context = context_acquire(device, surface); + if (surface != old_ctx->current_rt) + { + restore_rt = old_ctx->current_rt; + context = context_acquire(device, surface); + } + context_apply_blit_state(context, device); gl_info = context->gl_info; @@ -2806,19 +2840,29 @@ checkGLcall("glBindBuffer"); } - context_release(context); + if (restore_rt) + context_restore(context, restore_rt); } /* Read the framebuffer contents into a texture. Note that this function * doesn't do any kind of flipping. Using this on an onscreen surface will - * result in a flipped D3D texture. */ -void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb) + * result in a flipped D3D texture. + * + * Context activation is done by the caller. This function may temporarily + * 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; const struct wined3d_gl_info *gl_info; - struct wined3d_context *context; + struct wined3d_context *context = old_ctx; + struct wined3d_surface *restore_rt = NULL; + + if (old_ctx->current_rt != surface) + { + restore_rt = old_ctx->current_rt; + context = context_acquire(device, surface); + } - context = context_acquire(device, surface); gl_info = context->gl_info; device_invalidate_state(device, STATE_FRAMEBUFFER); @@ -2837,19 +2881,33 @@ 0, 0, 0, 0, surface->resource.width, surface->resource.height); checkGLcall("glCopyTexSubImage2D"); - context_release(context); + if (restore_rt) + context_restore(context, restore_rt); } void surface_prepare_rb(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, BOOL multisample) { if (multisample) { + DWORD samples; + if (surface->rb_multisample) return; + /* TODO: Nvidia exposes their Coverage Sample Anti-Aliasing (CSAA) feature + * through type == MULTISAMPLE_XX and quality != 0. This could be mapped + * to GL_NV_framebuffer_multisample_coverage. + * + * AMD has a similar feature called Enhanced Quality Anti-Aliasing (EQAA), + * but it does not have an equivalent OpenGL extension. */ + if (surface->resource.multisample_type == WINED3D_MULTISAMPLE_NON_MASKABLE) + samples = surface->resource.multisample_quality; + else + samples = surface->resource.multisample_type; + gl_info->fbo_ops.glGenRenderbuffers(1, &surface->rb_multisample); gl_info->fbo_ops.glBindRenderbuffer(GL_RENDERBUFFER, surface->rb_multisample); - gl_info->fbo_ops.glRenderbufferStorageMultisample(GL_RENDERBUFFER, surface->resource.multisample_type, + gl_info->fbo_ops.glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples, surface->resource.format->glInternal, surface->pow2Width, surface->pow2Height); checkGLcall("glRenderbufferStorageMultisample()"); TRACE("Created multisample rb %u.\n", surface->rb_multisample); @@ -2868,83 +2926,6 @@ } } -void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) -{ - if (front->container->level_count != 1 || front->container->layer_count != 1 - || back->container->level_count != 1 || back->container->layer_count != 1) - ERR("Flip between surfaces %p and %p not supported.\n", front, back); - - /* Flip the surface contents */ - /* Flip the DC */ - { - HDC tmp; - tmp = front->hDC; - front->hDC = back->hDC; - back->hDC = tmp; - } - - /* Flip the DIBsection */ - { - HBITMAP tmp = front->dib.DIBsection; - front->dib.DIBsection = back->dib.DIBsection; - back->dib.DIBsection = tmp; - } - - /* Flip the surface data */ - { - void* tmp; - - tmp = front->dib.bitmap_data; - front->dib.bitmap_data = back->dib.bitmap_data; - back->dib.bitmap_data = tmp; - - tmp = front->resource.heap_memory; - front->resource.heap_memory = back->resource.heap_memory; - back->resource.heap_memory = tmp; - } - - /* Flip the PBO */ - { - GLuint tmp_pbo = front->pbo; - front->pbo = back->pbo; - back->pbo = tmp_pbo; - } - - /* Flip the opengl texture */ - { - GLuint tmp; - - tmp = back->container->texture_rgb.name; - back->container->texture_rgb.name = front->container->texture_rgb.name; - front->container->texture_rgb.name = tmp; - - tmp = back->container->texture_srgb.name; - back->container->texture_srgb.name = front->container->texture_srgb.name; - front->container->texture_srgb.name = tmp; - - tmp = back->rb_multisample; - back->rb_multisample = front->rb_multisample; - front->rb_multisample = tmp; - - tmp = back->rb_resolved; - back->rb_resolved = front->rb_resolved; - front->rb_resolved = tmp; - - resource_unload(&back->resource); - resource_unload(&front->resource); - } - - { - DWORD tmp_flags = back->flags; - back->flags = front->flags; - front->flags = tmp_flags; - - tmp_flags = back->locations; - back->locations = front->locations; - front->locations = tmp_flags; - } -} - /* Does a direct frame buffer -> texture copy. Stretching is done with single * pixel copy calls. */ static void fb_copy_to_texture_direct(struct wined3d_surface *dst_surface, struct wined3d_surface *src_surface, @@ -3356,19 +3337,28 @@ rect->bottom = drawable_height - rect->bottom; } +/* Context activation is done by the caller. */ static void surface_blt_to_drawable(const struct wined3d_device *device, + struct wined3d_context *old_ctx, enum wined3d_texture_filter_type filter, BOOL alpha_test, struct wined3d_surface *src_surface, const RECT *src_rect_in, struct wined3d_surface *dst_surface, const RECT *dst_rect_in) { const struct wined3d_gl_info *gl_info; - struct wined3d_context *context; + struct wined3d_context *context = old_ctx; + struct wined3d_surface *restore_rt = NULL; RECT src_rect, dst_rect; src_rect = *src_rect_in; dst_rect = *dst_rect_in; - context = context_acquire(device, dst_surface); + + if (old_ctx->current_rt != dst_surface) + { + restore_rt = old_ctx->current_rt; + context = context_acquire(device, dst_surface); + } + gl_info = context->gl_info; /* Make sure the surface is up-to-date. This should probably use @@ -3421,7 +3411,8 @@ && dst_surface->container->swapchain->front_buffer == dst_surface->container)) gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ - context_release(context); + if (restore_rt) + context_restore(context, restore_rt); } HRESULT surface_color_fill(struct wined3d_surface *s, const RECT *rect, const struct wined3d_color *color) @@ -3653,7 +3644,7 @@ struct wined3d_device *device = surface->resource.device; GLsizei w, h; - TRACE("surface %p, new location %#x.\n", surface, location); + TRACE("surface %p, context %p, new location %#x.\n", surface, context, location); /* TODO: Make this work for modes other than FBO */ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return; @@ -3687,23 +3678,7 @@ if (surface->locations & WINED3D_LOCATION_DISCARDED) { TRACE("Surface was discarded, no need copy data.\n"); - switch (location) - { - case WINED3D_LOCATION_TEXTURE_RGB: - wined3d_texture_prepare_texture(surface->container, context, FALSE); - break; - case WINED3D_LOCATION_RB_MULTISAMPLE: - surface_prepare_rb(surface, gl_info, TRUE); - break; - case WINED3D_LOCATION_RB_RESOLVED: - surface_prepare_rb(surface, gl_info, FALSE); - break; - case WINED3D_LOCATION_DRAWABLE: - /* Nothing to do */ - break; - default: - FIXME("Unhandled location %#x\n", location); - } + wined3d_surface_prepare(surface, context, location); surface->locations &= ~WINED3D_LOCATION_DISCARDED; surface->locations |= location; surface->ds_current_size.cx = surface->resource.width; @@ -3766,7 +3741,6 @@ gl_info->gl_ops.gl.p_glTexParameteri(bind_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); gl_info->gl_ops.gl.p_glTexParameteri(bind_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); gl_info->gl_ops.gl.p_glTexParameteri(bind_target, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); - gl_info->gl_ops.gl.p_glTexParameteri(bind_target, GL_DEPTH_TEXTURE_MODE_ARB, GL_LUMINANCE); gl_info->gl_ops.gl.p_glBindTexture(bind_target, old_binding); context_apply_fbo_state_blit(context, GL_FRAMEBUFFER, @@ -3886,9 +3860,12 @@ memcpy(dst.addr, src.addr, size); } +/* Context activation is done by the caller. */ static void surface_load_sysmem(struct wined3d_surface *surface, - const struct wined3d_gl_info *gl_info, DWORD dst_location) + struct wined3d_context *context, DWORD dst_location) { + const struct wined3d_gl_info *gl_info = context->gl_info; + if (surface->locations & surface_simple_locations) { surface_copy_simple_location(surface, dst_location); @@ -3896,29 +3873,21 @@ } if (surface->locations & (WINED3D_LOCATION_RB_MULTISAMPLE | WINED3D_LOCATION_RB_RESOLVED)) - surface_load_location(surface, WINED3D_LOCATION_TEXTURE_RGB); + 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)) { - struct wined3d_device *device = surface->resource.device; - struct wined3d_context *context; - - /* TODO: Use already acquired context when possible. */ - context = context_acquire(device, NULL); - wined3d_texture_bind_and_dirtify(surface->container, context, !(surface->locations & WINED3D_LOCATION_TEXTURE_RGB)); surface_download_data(surface, gl_info, dst_location); - context_release(context); - return; } if (surface->locations & WINED3D_LOCATION_DRAWABLE) { - read_from_framebuffer(surface, dst_location); + read_from_framebuffer(surface, context, dst_location); return; } @@ -3926,8 +3895,9 @@ surface, wined3d_debug_location(surface->locations)); } +/* Context activation is done by the caller. */ static HRESULT surface_load_drawable(struct wined3d_surface *surface, - const struct wined3d_gl_info *gl_info) + struct wined3d_context *context) { RECT r; @@ -3939,21 +3909,21 @@ } surface_get_rect(surface, NULL, &r); - surface_load_location(surface, WINED3D_LOCATION_TEXTURE_RGB); - surface_blt_to_drawable(surface->resource.device, + surface_load_location(surface, context, WINED3D_LOCATION_TEXTURE_RGB); + surface_blt_to_drawable(surface->resource.device, context, WINED3D_TEXF_POINT, FALSE, surface, &r, surface, &r); return WINED3D_OK; } static HRESULT surface_load_texture(struct wined3d_surface *surface, - const struct wined3d_gl_info *gl_info, BOOL srgb) + struct wined3d_context *context, BOOL srgb) { + const struct wined3d_gl_info *gl_info = context->gl_info; RECT src_rect = {0, 0, surface->resource.width, surface->resource.height}; struct wined3d_device *device = surface->resource.device; const struct wined3d_color_key_conversion *conversion; struct wined3d_texture *texture = surface->container; - struct wined3d_context *context; UINT width, src_pitch, dst_pitch; struct wined3d_bo_address data; struct wined3d_format format; @@ -3964,7 +3934,7 @@ && wined3d_resource_is_offscreen(&texture->resource) && (surface->locations & WINED3D_LOCATION_DRAWABLE)) { - surface_load_fb_texture(surface, srgb); + surface_load_fb_texture(surface, srgb, context); return WINED3D_OK; } @@ -3976,10 +3946,10 @@ NULL, surface->resource.usage, surface->resource.pool, surface->resource.format)) { if (srgb) - surface_blt_fbo(device, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_RGB, + surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_RGB, &src_rect, surface, WINED3D_LOCATION_TEXTURE_SRGB, &src_rect); else - surface_blt_fbo(device, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_SRGB, + surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_TEXTURE_SRGB, &src_rect, surface, WINED3D_LOCATION_TEXTURE_RGB, &src_rect); return WINED3D_OK; @@ -3996,7 +3966,7 @@ DWORD dst_location = srgb ? WINED3D_LOCATION_TEXTURE_SRGB : WINED3D_LOCATION_TEXTURE_RGB; RECT rect = {0, 0, surface->resource.width, surface->resource.height}; - surface_blt_fbo(device, WINED3D_TEXF_POINT, surface, src_location, + surface_blt_fbo(device, context, WINED3D_TEXF_POINT, surface, src_location, &rect, surface, dst_location, &rect); return WINED3D_OK; @@ -4012,7 +3982,7 @@ /* Performance warning... */ FIXME("Downloading RGB surface %p to reload it as sRGB.\n", surface); surface_prepare_map_memory(surface); - surface_load_location(surface, surface->resource.map_binding); + surface_load_location(surface, context, surface->resource.map_binding); } } else @@ -4023,7 +3993,7 @@ /* Performance warning... */ FIXME("Downloading sRGB surface %p to reload it as RGB.\n", surface); surface_prepare_map_memory(surface); - surface_load_location(surface, surface->resource.map_binding); + surface_load_location(surface, context, surface->resource.map_binding); } } @@ -4032,12 +4002,9 @@ WARN("Trying to load a texture from sysmem, but no simple location is valid.\n"); /* Lets hope we get it from somewhere... */ surface_prepare_system_memory(surface); - surface_load_location(surface, WINED3D_LOCATION_SYSMEM); + surface_load_location(surface, context, WINED3D_LOCATION_SYSMEM); } - /* TODO: Use already acquired context when possible. */ - context = context_acquire(device, NULL); - wined3d_texture_prepare_texture(texture, context, srgb); wined3d_texture_bind_and_dirtify(texture, context, srgb); @@ -4061,7 +4028,7 @@ surface->resource.map_binding = WINED3D_LOCATION_SYSMEM; surface_prepare_map_memory(surface); - surface_load_location(surface, surface->resource.map_binding); + surface_load_location(surface, context, surface->resource.map_binding); surface_remove_pbo(surface, gl_info); } @@ -4111,14 +4078,13 @@ wined3d_surface_upload_data(surface, gl_info, &format, &src_rect, src_pitch, &dst_point, srgb, wined3d_const_bo_address(&data)); - context_release(context); - HeapFree(GetProcessHeap(), 0, mem); return WINED3D_OK; } -static void surface_multisample_resolve(struct wined3d_surface *surface) +/* Context activation is done by the caller. */ +static void surface_multisample_resolve(struct wined3d_surface *surface, struct wined3d_context *context) { RECT rect = {0, 0, surface->resource.width, surface->resource.height}; @@ -4126,14 +4092,13 @@ ERR("Trying to resolve multisampled surface %p, but location WINED3D_LOCATION_RB_MULTISAMPLE not current.\n", surface); - surface_blt_fbo(surface->resource.device, WINED3D_TEXF_POINT, + surface_blt_fbo(surface->resource.device, context, WINED3D_TEXF_POINT, surface, WINED3D_LOCATION_RB_MULTISAMPLE, &rect, surface, WINED3D_LOCATION_RB_RESOLVED, &rect); } -HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) +/* 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) { - struct wined3d_device *device = surface->resource.device; - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; HRESULT hr; TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location)); @@ -4143,9 +4108,7 @@ if (location == WINED3D_LOCATION_TEXTURE_RGB && surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED)) { - struct wined3d_context *context = context_acquire(device, NULL); surface_load_ds_location(surface, context, location); - context_release(context); return WINED3D_OK; } else if (location & surface->locations @@ -4189,21 +4152,22 @@ case WINED3D_LOCATION_USER_MEMORY: case WINED3D_LOCATION_SYSMEM: case WINED3D_LOCATION_BUFFER: - surface_load_sysmem(surface, gl_info, location); + surface_load_sysmem(surface, context, location); break; case WINED3D_LOCATION_DRAWABLE: - if (FAILED(hr = surface_load_drawable(surface, gl_info))) + if (FAILED(hr = surface_load_drawable(surface, context))) return hr; break; case WINED3D_LOCATION_RB_RESOLVED: - surface_multisample_resolve(surface); + surface_multisample_resolve(surface, context); break; case WINED3D_LOCATION_TEXTURE_RGB: case WINED3D_LOCATION_TEXTURE_SRGB: - if (FAILED(hr = surface_load_texture(surface, gl_info, location == WINED3D_LOCATION_TEXTURE_SRGB))) + if (FAILED(hr = surface_load_texture(surface, context, + location == WINED3D_LOCATION_TEXTURE_SRGB))) return hr; break; @@ -4367,6 +4331,8 @@ struct wined3d_surface *dst_surface, const RECT *dst_rect, const struct wined3d_color_key *color_key) { + 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; @@ -4375,8 +4341,10 @@ wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, color_key); - surface_blt_to_drawable(device, filter, + context = context_acquire(device, dst_surface); + surface_blt_to_drawable(device, context, filter, !!color_key, src_surface, src_rect, dst_surface, dst_rect); + context_release(context); /* Restore the color key parameters */ wined3d_texture_set_color_key(src_surface->container, WINED3D_CKEY_SRC_BLT, @@ -4539,6 +4507,7 @@ struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) { + const struct wined3d_box dst_box = {dst_rect->left, dst_rect->top, dst_rect->right, dst_rect->bottom, 0, 1}; int bpp, srcheight, srcwidth, dstheight, dstwidth, width; const struct wined3d_format *src_format, *dst_format; unsigned int src_fmt_flags, dst_fmt_flags; @@ -4589,7 +4558,7 @@ src_fmt_flags = dst_fmt_flags; } - wined3d_surface_map(dst_surface, &dst_map, dst_rect, 0); + wined3d_surface_map(dst_surface, &dst_map, &dst_box, 0); } bpp = dst_surface->resource.format->byte_count; @@ -4628,14 +4597,14 @@ goto release; } - if (!surface_check_block_align(src_surface, src_rect)) + if (!surface_check_block_align_rect(src_surface, src_rect)) { WARN("Source rectangle not block-aligned.\n"); hr = WINED3DERR_INVALIDCALL; goto release; } - if (!surface_check_block_align(dst_surface, dst_rect)) + if (!surface_check_block_align_rect(dst_surface, dst_rect)) { WARN("Destination rectangle not block-aligned.\n"); hr = WINED3DERR_INVALIDCALL; @@ -5076,7 +5045,7 @@ | WINEDDBLT_DEPTHFILL | WINEDDBLT_DONOTWAIT; - TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p, filter %s.\n", + TRACE("dst_surface %p, dst_rect_in %s, src_surface %p, src_rect_in %s, flags %#x, fx %p, filter %s.\n", dst_surface, wine_dbgstr_rect(dst_rect_in), src_surface, wine_dbgstr_rect(src_rect_in), flags, fx, debug_d3dtexturefiltertype(filter)); TRACE("Usage is %s.\n", debug_d3dusage(dst_surface->resource.usage)); @@ -5317,7 +5286,11 @@ if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, &src_rect))) { if (!wined3d_resource_is_offscreen(&dst_surface->container->resource)) - surface_load_location(dst_surface, dst_surface->container->resource.draw_binding); + { + struct wined3d_context *context = context_acquire(device, dst_surface); + surface_load_location(dst_surface, context, dst_surface->container->resource.draw_binding); + context_release(context); + } return WINED3D_OK; } } @@ -5349,11 +5322,15 @@ &src_rect, src_surface->resource.usage, src_surface->resource.pool, src_surface->resource.format, &dst_rect, dst_surface->resource.usage, dst_surface->resource.pool, dst_surface->resource.format)) { + struct wined3d_context *context; TRACE("Using FBO blit.\n"); - surface_blt_fbo(device, filter, + context = context_acquire(device, NULL); + surface_blt_fbo(device, context, filter, src_surface, src_surface->container->resource.draw_binding, &src_rect, dst_surface, dst_surface->container->resource.draw_binding, &dst_rect); + context_release(context); + surface_validate_location(dst_surface, dst_surface->container->resource.draw_binding); surface_invalidate_location(dst_surface, ~dst_surface->container->resource.draw_binding); @@ -5395,12 +5372,6 @@ unsigned int resource_size; HRESULT hr; - if (multisample_quality > 0) - { - FIXME("multisample_quality set to %u, substituting 0.\n", multisample_quality); - multisample_quality = 0; - } - /* 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. @@ -5515,7 +5486,7 @@ } if (FAILED(hr = device_parent->ops->surface_created(device_parent, - wined3d_texture_get_parent(container), object, &parent, &parent_ops))) + container, layer * container->level_count + level, object, &parent, &parent_ops))) { WARN("Failed to create surface parent, hr %#x.\n", hr); wined3d_surface_destroy(object); @@ -5530,3 +5501,26 @@ return hr; } + +/* Context activation is done by the caller. */ +void wined3d_surface_prepare(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) +{ + switch (location) + { + case WINED3D_LOCATION_TEXTURE_RGB: + wined3d_texture_prepare_texture(surface->container, context, FALSE); + break; + + case WINED3D_LOCATION_TEXTURE_SRGB: + wined3d_texture_prepare_texture(surface->container, context, TRUE); + break; + + case WINED3D_LOCATION_RB_MULTISAMPLE: + surface_prepare_rb(surface, context->gl_info, TRUE); + break; + + case WINED3D_LOCATION_RB_RESOLVED: + surface_prepare_rb(surface, context->gl_info, FALSE); + break; + } +} diff -Nru wine1.7-1.7.50/dlls/wined3d/swapchain.c wine1.7-1.7.55/dlls/wined3d/swapchain.c --- wine1.7-1.7.50/dlls/wined3d/swapchain.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/swapchain.c 2015-11-13 14:32:40.000000000 +0000 @@ -156,13 +156,19 @@ } HRESULT CDECL wined3d_swapchain_get_front_buffer_data(const struct wined3d_swapchain *swapchain, - struct wined3d_surface *dst_surface) + struct wined3d_texture *dst_texture, unsigned int sub_resource_idx) { - struct wined3d_surface *src_surface; + struct wined3d_surface *src_surface, *dst_surface; + struct wined3d_resource *sub_resource; RECT src_rect, dst_rect; - TRACE("swapchain %p, dst_surface %p.\n", swapchain, dst_surface); + 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); dst_rect = src_rect; @@ -177,11 +183,11 @@ return wined3d_surface_blt(dst_surface, &dst_rect, src_surface, &src_rect, 0, NULL, WINED3D_TEXF_POINT); } -struct wined3d_surface * CDECL wined3d_swapchain_get_back_buffer(const struct wined3d_swapchain *swapchain, - UINT back_buffer_idx, enum wined3d_backbuffer_type type) +struct wined3d_texture * CDECL wined3d_swapchain_get_back_buffer(const struct wined3d_swapchain *swapchain, + UINT back_buffer_idx) { - TRACE("swapchain %p, back_buffer_idx %u, type %#x.\n", - swapchain, back_buffer_idx, type); + TRACE("swapchain %p, back_buffer_idx %u.\n", + swapchain, back_buffer_idx); /* Return invalid if there is no backbuffer array, otherwise it will * crash when ddraw is used (there swapchain->back_buffers is always @@ -198,7 +204,7 @@ TRACE("Returning back buffer %p.\n", swapchain->back_buffers[back_buffer_idx]); - return surface_from_resource(wined3d_texture_get_sub_resource(swapchain->back_buffers[back_buffer_idx], 0)); + return swapchain->back_buffers[back_buffer_idx]; } HRESULT CDECL wined3d_swapchain_get_raster_status(const struct wined3d_swapchain *swapchain, @@ -309,7 +315,7 @@ if (backbuffer->resource.multisample_type) { location = WINED3D_LOCATION_RB_RESOLVED; - surface_load_location(backbuffer, location); + surface_load_location(backbuffer, context, location); } context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, backbuffer, NULL, location); @@ -511,14 +517,14 @@ */ if (!swapchain->render_to_fbo && render_to_fbo && wined3d_settings.offscreen_rendering_mode == ORM_FBO) { - surface_load_location(back_buffer, WINED3D_LOCATION_TEXTURE_RGB); + surface_load_location(back_buffer, context, WINED3D_LOCATION_TEXTURE_RGB); surface_invalidate_location(back_buffer, WINED3D_LOCATION_DRAWABLE); swapchain->render_to_fbo = TRUE; swapchain_update_draw_bindings(swapchain); } else { - surface_load_location(back_buffer, back_buffer->container->resource.draw_binding); + surface_load_location(back_buffer, context, back_buffer->container->resource.draw_binding); } if (swapchain->render_to_fbo) @@ -555,45 +561,16 @@ } front = surface_from_resource(wined3d_texture_get_sub_resource(swapchain->front_buffer, 0)); - if (!swapchain->render_to_fbo && ((front->locations & WINED3D_LOCATION_SYSMEM) - || (back_buffer->locations & WINED3D_LOCATION_SYSMEM))) - { - /* Both memory copies of the surfaces are ok, flip them around too instead of dirtifying - * Doesn't work with render_to_fbo because we're not flipping - */ - - if (front->resource.size == back_buffer->resource.size) - { - flip_surface(front, back_buffer); - /* Tell the front buffer surface that is has been modified. However, - * the other locations were preserved during that, so keep the flags. - * This serves to update the emulated overlay, if any. */ - surface_validate_location(front, WINED3D_LOCATION_DRAWABLE); - } - else - { - surface_validate_location(front, WINED3D_LOCATION_DRAWABLE); - surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE); - surface_validate_location(back_buffer, WINED3D_LOCATION_DRAWABLE); - surface_invalidate_location(back_buffer, ~WINED3D_LOCATION_DRAWABLE); - } - } - else - { - surface_validate_location(front, WINED3D_LOCATION_DRAWABLE); - surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE); - /* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM - * and INTEXTURE copies can keep their old content if they have any defined content. - * If the swapeffect is COPY, the content remains the same. If it is FLIP however, - * the texture / sysmem copy needs to be reloaded from the drawable - */ - if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP) - { - surface_validate_location(back_buffer, back_buffer->container->resource.draw_binding); - surface_invalidate_location(back_buffer, ~back_buffer->container->resource.draw_binding); - } - } + surface_validate_location(front, WINED3D_LOCATION_DRAWABLE); + surface_invalidate_location(front, ~WINED3D_LOCATION_DRAWABLE); + /* If the swapeffect is DISCARD, the back buffer is undefined. That means the SYSMEM + * and INTEXTURE copies can keep their old content if they have any defined content. + * If the swapeffect is COPY, the content remains the same. + * + * The FLIP swap effect is not implemented yet. We could mark WINED3D_LOCATION_DRAWABLE + * up to date and hope WGL flipped front and back buffers and read this data into + * the FBO. Don't bother about this for now. */ if (fb->depth_stencil) { @@ -606,7 +583,7 @@ fb->depth_stencil->width, fb->depth_stencil->height); if (ds == swapchain->device->onscreen_depth_stencil) { - wined3d_surface_decref(swapchain->device->onscreen_depth_stencil); + wined3d_texture_decref(swapchain->device->onscreen_depth_stencil->container); swapchain->device->onscreen_depth_stencil = NULL; } } @@ -640,7 +617,7 @@ TRACE("Copying surface %p to screen.\n", front); - surface_load_location(front, WINED3D_LOCATION_DIB); + surface_load_location(front, NULL, WINED3D_LOCATION_DIB); src_dc = front->hDC; window = swapchain->win_handle; @@ -772,7 +749,7 @@ struct wined3d_swapchain_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops) { const struct wined3d_adapter *adapter = device->adapter; - struct wined3d_resource_desc surface_desc; + struct wined3d_resource_desc texture_desc; struct wined3d_surface *front_buffer; BOOL displaymode_set = FALSE; RECT client_rect; @@ -780,13 +757,6 @@ HRESULT hr; UINT i; - if (desc->backbuffer_count > WINED3DPRESENT_BACK_BUFFER_MAX) - { - FIXME("The application requested %u back buffers, this is not supported.\n", - desc->backbuffer_count); - return WINED3DERR_INVALIDCALL; - } - if (desc->backbuffer_count > 1) { FIXME("The application requested more than one back buffer, this is not properly supported.\n" @@ -843,26 +813,26 @@ TRACE("Creating front buffer.\n"); - surface_desc.resource_type = WINED3D_RTYPE_SURFACE; - surface_desc.format = swapchain->desc.backbuffer_format; - surface_desc.multisample_type = swapchain->desc.multisample_type; - surface_desc.multisample_quality = swapchain->desc.multisample_quality; - surface_desc.usage = 0; - surface_desc.pool = WINED3D_POOL_DEFAULT; - surface_desc.width = swapchain->desc.backbuffer_width; - surface_desc.height = swapchain->desc.backbuffer_height; - surface_desc.depth = 1; - surface_desc.size = 0; + texture_desc.resource_type = WINED3D_RTYPE_TEXTURE; + texture_desc.format = swapchain->desc.backbuffer_format; + texture_desc.multisample_type = swapchain->desc.multisample_type; + texture_desc.multisample_quality = swapchain->desc.multisample_quality; + texture_desc.usage = 0; + texture_desc.pool = WINED3D_POOL_DEFAULT; + texture_desc.width = swapchain->desc.backbuffer_width; + texture_desc.height = swapchain->desc.backbuffer_height; + texture_desc.depth = 1; + texture_desc.size = 0; - if (FAILED(hr = device->device_parent->ops->create_swapchain_surface(device->device_parent, - parent, &surface_desc, &front_buffer))) + if (FAILED(hr = device->device_parent->ops->create_swapchain_texture(device->device_parent, + parent, &texture_desc, &swapchain->front_buffer))) { WARN("Failed to create front buffer, hr %#x.\n", hr); goto err; } - swapchain->front_buffer = front_buffer->container; 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); @@ -959,20 +929,17 @@ goto err; } - surface_desc.usage |= WINED3DUSAGE_RENDERTARGET; + texture_desc.usage |= WINED3DUSAGE_RENDERTARGET; for (i = 0; i < swapchain->desc.backbuffer_count; ++i) { - struct wined3d_surface *back_buffer; - TRACE("Creating back buffer %u.\n", i); - if (FAILED(hr = device->device_parent->ops->create_swapchain_surface(device->device_parent, - parent, &surface_desc, &back_buffer))) + if (FAILED(hr = device->device_parent->ops->create_swapchain_texture(device->device_parent, + parent, &texture_desc, &swapchain->back_buffers[i]))) { WARN("Failed to create back buffer %u, hr %#x.\n", i, hr); swapchain->desc.backbuffer_count = i; goto err; } - swapchain->back_buffers[i] = back_buffer->container; wined3d_texture_set_swapchain(swapchain->back_buffers[i], swapchain); } } @@ -983,21 +950,26 @@ TRACE("Creating depth/stencil buffer.\n"); if (!device->auto_depth_stencil_view) { - struct wined3d_surface *ds; + struct wined3d_texture *ds; + struct wined3d_rendertarget_view_desc desc; - surface_desc.format = swapchain->desc.auto_depth_stencil_format; - surface_desc.usage = WINED3DUSAGE_DEPTHSTENCIL; + texture_desc.format = swapchain->desc.auto_depth_stencil_format; + texture_desc.usage = WINED3DUSAGE_DEPTHSTENCIL; - if (FAILED(hr = device->device_parent->ops->create_swapchain_surface(device->device_parent, - device->device_parent, &surface_desc, &ds))) + if (FAILED(hr = device->device_parent->ops->create_swapchain_texture(device->device_parent, + device->device_parent, &texture_desc, &ds))) { WARN("Failed to create the auto depth/stencil surface, hr %#x.\n", hr); goto err; } - hr = wined3d_rendertarget_view_create_from_surface(ds, - NULL, &wined3d_null_parent_ops, &device->auto_depth_stencil_view); - wined3d_surface_decref(ds); + desc.format_id = ds->resource.format->id; + desc.u.texture.level_idx = 0; + desc.u.texture.layer_idx = 0; + desc.u.texture.layer_count = 1; + hr = wined3d_rendertarget_view_create(&desc, &ds->resource, NULL, &wined3d_null_parent_ops, + &device->auto_depth_stencil_view); + wined3d_texture_decref(ds); if (FAILED(hr)) { ERR("Failed to create rendertarget view, hr %#x.\n", hr); diff -Nru wine1.7-1.7.50/dlls/wined3d/texture.c wine1.7-1.7.55/dlls/wined3d/texture.c --- wine1.7-1.7.50/dlls/wined3d/texture.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/texture.c 2015-11-13 14:32:40.000000000 +0000 @@ -253,6 +253,12 @@ gl_tex->sampler_desc.min_filter = WINED3D_TEXF_POINT; gl_tex->sampler_desc.mip_filter = WINED3D_TEXF_NONE; } + + if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT] && gl_info->supported[ARB_DEPTH_TEXTURE]) + { + gl_info->gl_ops.gl.p_glTexParameteri(target, GL_DEPTH_TEXTURE_MODE_ARB, GL_INTENSITY); + checkGLcall("glTexParameteri(GL_DEPTH_TEXTURE_MODE_ARB, GL_INTENSITY)"); + } } /* Context activation is done by the caller. */ @@ -362,14 +368,9 @@ if (!sampler_desc->compare != !gl_tex->sampler_desc.compare) { if (sampler_desc->compare) - { - gl_info->gl_ops.gl.p_glTexParameteri(target, GL_DEPTH_TEXTURE_MODE_ARB, GL_LUMINANCE); gl_info->gl_ops.gl.p_glTexParameteri(target, GL_TEXTURE_COMPARE_MODE_ARB, GL_COMPARE_R_TO_TEXTURE_ARB); - } else - { gl_info->gl_ops.gl.p_glTexParameteri(target, GL_TEXTURE_COMPARE_MODE_ARB, GL_NONE); - } gl_tex->sampler_desc.compare = sampler_desc->compare; } @@ -443,7 +444,7 @@ DWORD flag; UINT i; - TRACE("texture %p, srgb %#x.\n", texture, srgb); + TRACE("texture %p, context %p, srgb %#x.\n", texture, context, srgb); if (gl_info->supported[EXT_TEXTURE_SRGB_DECODE]) srgb = FALSE; @@ -570,8 +571,8 @@ DWORD flags, const struct wined3d_color_key *color_key) { struct wined3d_device *device = texture->resource.device; - static const DWORD all_flags = WINED3D_CKEY_COLORSPACE | WINED3D_CKEY_DST_BLT - | WINED3D_CKEY_DST_OVERLAY | WINED3D_CKEY_SRC_BLT | WINED3D_CKEY_SRC_OVERLAY; + static const DWORD all_flags = WINED3D_CKEY_DST_BLT | WINED3D_CKEY_DST_OVERLAY + | WINED3D_CKEY_SRC_BLT | WINED3D_CKEY_SRC_OVERLAY; TRACE("texture %p, flags %#x, color_key %p.\n", texture, flags, color_key); @@ -581,12 +582,6 @@ return WINED3DERR_INVALIDCALL; } - if (flags & WINED3D_CKEY_COLORSPACE) - { - FIXME("Unhandled flags %#x.\n", flags); - return WINED3DERR_INVALIDCALL; - } - wined3d_cs_emit_set_color_key(device->cs, texture, flags, color_key); return WINED3D_OK; @@ -768,16 +763,19 @@ static void texture2d_sub_resource_load(struct wined3d_resource *sub_resource, struct wined3d_context *context, BOOL srgb) { - surface_load(surface_from_resource(sub_resource), srgb); + surface_load(surface_from_resource(sub_resource), context, srgb); } static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub_resource, const struct wined3d_box *dirty_region) { struct wined3d_surface *surface = surface_from_resource(sub_resource); + struct wined3d_context *context; surface_prepare_map_memory(surface); - surface_load_location(surface, surface->resource.map_binding); + context = context_acquire(surface->resource.device, NULL); + surface_load_location(surface, context, surface->resource.map_binding); + context_release(context); surface_invalidate_location(surface, ~surface->resource.map_binding); } @@ -832,7 +830,7 @@ GLenum internal; UINT i; - TRACE("texture %p, format %s.\n", texture, debug_d3dformat(format->id)); + TRACE("texture %p, context %p, format %s.\n", texture, context, debug_d3dformat(format->id)); if (format->convert) { @@ -961,11 +959,34 @@ wined3d_texture_unload_gl_texture(texture); } -static const struct wined3d_resource_ops texture_resource_ops = +static HRESULT texture2d_resource_sub_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, + struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) +{ + struct wined3d_resource *sub_resource; + + if (!(sub_resource = wined3d_texture_get_sub_resource(wined3d_texture_from_resource(resource), sub_resource_idx))) + return E_INVALIDARG; + + return wined3d_surface_map(surface_from_resource(sub_resource), map_desc, box, flags); +} + +static HRESULT texture2d_resource_sub_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx) +{ + struct wined3d_resource *sub_resource; + + if (!(sub_resource = wined3d_texture_get_sub_resource(wined3d_texture_from_resource(resource), sub_resource_idx))) + return E_INVALIDARG; + + return wined3d_surface_unmap(surface_from_resource(sub_resource)); +} + +static const struct wined3d_resource_ops texture2d_resource_ops = { texture_resource_incref, texture_resource_decref, wined3d_texture_unload, + texture2d_resource_sub_resource_map, + texture2d_resource_sub_resource_unmap, }; static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc, @@ -1023,7 +1044,7 @@ } if (FAILED(hr = wined3d_texture_init(texture, &texture2d_ops, 6, levels, desc, - surface_flags, device, parent, parent_ops, &texture_resource_ops))) + surface_flags, device, parent, parent_ops, &texture2d_resource_ops))) { WARN("Failed to initialize texture, returning %#x\n", hr); return hr; @@ -1141,7 +1162,7 @@ } if (FAILED(hr = wined3d_texture_init(texture, &texture2d_ops, 1, levels, desc, - surface_flags, device, parent, parent_ops, &texture_resource_ops))) + surface_flags, device, parent, parent_ops, &texture2d_resource_ops))) { WARN("Failed to initialize texture, returning %#x.\n", hr); return hr; @@ -1307,6 +1328,36 @@ texture3d_prepare_texture, }; +static HRESULT texture3d_resource_sub_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, + struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) +{ + struct wined3d_resource *sub_resource; + + if (!(sub_resource = wined3d_texture_get_sub_resource(wined3d_texture_from_resource(resource), sub_resource_idx))) + return E_INVALIDARG; + + return wined3d_volume_map(volume_from_resource(sub_resource), map_desc, box, flags); +} + +static HRESULT texture3d_resource_sub_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx) +{ + struct wined3d_resource *sub_resource; + + if (!(sub_resource = wined3d_texture_get_sub_resource(wined3d_texture_from_resource(resource), sub_resource_idx))) + return E_INVALIDARG; + + return wined3d_volume_unmap(volume_from_resource(sub_resource)); +} + +static const struct wined3d_resource_ops texture3d_resource_ops = +{ + texture_resource_incref, + texture_resource_decref, + wined3d_texture_unload, + texture3d_resource_sub_resource_map, + texture3d_resource_sub_resource_unmap, +}; + static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc, UINT levels, struct wined3d_device *device, void *parent, const struct wined3d_parent_ops *parent_ops) { @@ -1374,7 +1425,7 @@ } if (FAILED(hr = wined3d_texture_init(texture, &texture3d_ops, 1, levels, desc, - 0, device, parent, parent_ops, &texture_resource_ops))) + 0, device, parent, parent_ops, &texture3d_resource_ops))) { WARN("Failed to initialize texture, returning %#x.\n", hr); return hr; @@ -1411,6 +1462,30 @@ return WINED3D_OK; } +HRESULT CDECL wined3d_texture_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, const RECT *dst_rect_in, + struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, const RECT *src_rect_in, DWORD flags, + const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter) +{ + struct wined3d_resource *dst_resource, *src_resource = NULL; + + TRACE("dst_texture %p, dst_sub_resource_idx %u, src_texture %p, src_sub_resource_idx %u.\n", + dst_texture, dst_sub_resource_idx, src_texture, src_sub_resource_idx); + + if (!(dst_resource = wined3d_texture_get_sub_resource(dst_texture, dst_sub_resource_idx)) + || dst_resource->type != WINED3D_RTYPE_SURFACE) + return WINED3DERR_INVALIDCALL; + + if (src_texture) + { + if (!(src_resource = wined3d_texture_get_sub_resource(src_texture, src_sub_resource_idx)) + || src_resource->type != WINED3D_RTYPE_SURFACE) + return WINED3DERR_INVALIDCALL; + } + + return wined3d_surface_blt(surface_from_resource(dst_resource), dst_rect_in, + src_resource ? surface_from_resource(src_resource) : NULL, src_rect_in, flags, fx, filter); +} + HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct wined3d_resource_desc *desc, UINT level_count, DWORD surface_flags, const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture) @@ -1471,3 +1546,39 @@ return WINED3D_OK; } + +HRESULT CDECL wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC *dc) +{ + struct wined3d_resource *sub_resource; + + TRACE("texture %p, sub_resource_idx %u, dc %p.\n", texture, sub_resource_idx, dc); + + if (!(sub_resource = wined3d_texture_get_sub_resource(texture, sub_resource_idx))) + return WINED3DERR_INVALIDCALL; + + if (sub_resource->type != WINED3D_RTYPE_SURFACE) + { + WARN("Not supported on %s resources.\n", debug_d3dresourcetype(texture->resource.type)); + return WINED3DERR_INVALIDCALL; + } + + return wined3d_surface_getdc(surface_from_resource(sub_resource), dc); +} + +HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC dc) +{ + struct wined3d_resource *sub_resource; + + TRACE("texture %p, sub_resource_idx %u, dc %p.\n", texture, sub_resource_idx, dc); + + if (!(sub_resource = wined3d_texture_get_sub_resource(texture, sub_resource_idx))) + return WINED3DERR_INVALIDCALL; + + if (sub_resource->type != WINED3D_RTYPE_SURFACE) + { + WARN("Not supported on %s resources.\n", debug_d3dresourcetype(texture->resource.type)); + return WINED3DERR_INVALIDCALL; + } + + return wined3d_surface_releasedc(surface_from_resource(sub_resource), dc); +} diff -Nru wine1.7-1.7.50/dlls/wined3d/utils.c wine1.7-1.7.55/dlls/wined3d/utils.c --- wine1.7-1.7.50/dlls/wined3d/utils.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/utils.c 2015-11-13 14:32:40.000000000 +0000 @@ -283,8 +283,8 @@ for (x = 0; x < width; x++ ) { unsigned char color = (*Source++); - /* A */ Dest[1] = (color & 0xf0) << 0; - /* L */ Dest[0] = (color & 0x0f) << 4; + /* A */ Dest[1] = (color & 0xf0u) << 0; + /* L */ Dest[0] = (color & 0x0fu) << 4; Dest += 2; } } @@ -311,9 +311,9 @@ texel_in = (const unsigned short *)(src + z * src_slice_pitch + y * src_row_pitch); for (x = 0; x < width; x++ ) { - l_in = (*texel_in & 0xfc00) >> 10; - g_in = (*texel_in & 0x03e0) >> 5; - r_in = *texel_in & 0x001f; + l_in = (*texel_in & 0xfc00u) >> 10; + g_in = (*texel_in & 0x03e0u) >> 5; + r_in = *texel_in & 0x001fu; *texel_out = ((r_in + 16) << 11) | (l_in << 5) | (g_in + 16); texel_out++; @@ -338,9 +338,9 @@ texel_out = dst + z * dst_slice_pitch + y * dst_row_pitch; for (x = 0; x < width; x++ ) { - l_in = (*texel_in & 0xfc00) >> 10; - g_in = (*texel_in & 0x03e0) >> 5; - r_in = *texel_in & 0x001f; + l_in = (*texel_in & 0xfc00u) >> 10; + g_in = (*texel_in & 0x03e0u) >> 5; + r_in = *texel_in & 0x001fu; r_out = r_in << 3; if (!(r_in & 0x10)) /* r > 0 */ @@ -385,9 +385,9 @@ texel_out = dst + z * dst_slice_pitch + y * dst_row_pitch; for (x = 0; x < width; x++ ) { - l_in = (*texel_in & 0xfc00) >> 10; - g_in = (*texel_in & 0x03e0) >> 5; - r_in = *texel_in & 0x001f; + l_in = (*texel_in & 0xfc00u) >> 10; + g_in = (*texel_in & 0x03e0u) >> 5; + r_in = *texel_in & 0x001fu; ds_out = r_in << 3; if (!(r_in & 0x10)) /* r > 0 */ @@ -657,7 +657,7 @@ for (x = 0; x < width; ++x) { - dest_f[x * 2] = float_24_to_32((source[x] & 0xffffff00) >> 8); + dest_f[x * 2] = float_24_to_32((source[x] & 0xffffff00u) >> 8); dest_s[x * 2 + 1] = source[x] & 0xff; } } @@ -724,9 +724,9 @@ { WORD src_color = src_row[x]; if (!color_in_range(color_key, src_color)) - dst_row[x] = 0x8000 | ((src_color & 0xffc0) >> 1) | (src_color & 0x1f); + dst_row[x] = 0x8000u | ((src_color & 0xffc0u) >> 1) | (src_color & 0x1fu); else - dst_row[x] = ((src_color & 0xffc0) >> 1) | (src_color & 0x1f); + dst_row[x] = ((src_color & 0xffc0u) >> 1) | (src_color & 0x1fu); } } } @@ -1024,7 +1024,7 @@ WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING | WINED3DFMT_FLAG_RENDERTARGET, ARB_ES2_COMPATIBILITY, NULL}, - {WINED3DFMT_B5G5R5X1_UNORM, GL_RGB5, GL_RGB5_A1, 0, + {WINED3DFMT_B5G5R5X1_UNORM, GL_RGB5, GL_RGB5, 0, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING, WINED3D_GL_EXT_NONE, NULL}, @@ -1875,10 +1875,10 @@ checkGLcall("Post-pixelshader blending check"); a = color >> 24; - r = (color & 0x00ff0000) >> 16; + r = (color & 0x00ff0000u) >> 16; - r_range = format->red_size < 8 ? 1 << (8 - format->red_size) : 1; - a_range = format->alpha_size < 8 ? 1 << (8 - format->alpha_size) : 1; + r_range = format->red_size < 8 ? 1u << (8 - format->red_size) : 1; + a_range = format->alpha_size < 8 ? 1u << (8 - format->alpha_size) : 1; if (format->red_size && (r < 0x7f - r_range || r > 0x7f + r_range)) match = FALSE; else if (format->alpha_size > 1 && (a < 0xbf - a_range || a > 0xbf + a_range)) @@ -2533,6 +2533,13 @@ gl_info->formats[idx].height_scale.denominator = 2; gl_info->formats[idx].color_fixup = create_complex_fixup_desc(COMPLEX_FIXUP_NV12); + if (!gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) + { + idx = getFmtIdx(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_FRAGMENT_PROGRAM]) { idx = getFmtIdx(WINED3DFMT_P8_UINT); @@ -2735,7 +2742,7 @@ if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) { FIXME("No FBOs, assuming polyoffset scale of 2^%u.\n", fallback); - return (float)(1 << fallback); + return (float)(1u << fallback); } gl_info->gl_ops.gl.p_glGenTextures(1, &color); @@ -2773,7 +2780,7 @@ gl_info->gl_ops.gl.p_glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); /* The post viewport transform Z of the geometry runs from 0.0 to 0.5. We want to push it another * 0.25 so that the Z buffer content (0.5) cuts the quad off at half the screen. */ - gl_info->gl_ops.gl.p_glPolygonOffset(0.0f, (float)(1 << cur) * 0.25f); + gl_info->gl_ops.gl.p_glPolygonOffset(0.0f, (float)(1u << cur) * 0.25f); draw_test_quad(ctx, geometry, &blue); checkGLcall("Test draw"); @@ -2804,7 +2811,7 @@ gl_info->gl_ops.gl.p_glDisable(GL_DEPTH_TEST); gl_info->gl_ops.gl.p_glDisable(GL_POLYGON_OFFSET_FILL); - return (float)(1 << cur); + return (float)(1u << cur); } const struct wined3d_format *wined3d_get_format(const struct wined3d_gl_info *gl_info, @@ -3883,12 +3890,12 @@ compute_texture_matrix(gl_info, &state->transforms[WINED3D_TS_TEXTURE0 + tex], state->texture_states[tex][WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS], generated, context->last_was_rhw, - context->stream_info.use_map & (1 << (WINED3D_FFP_TEXCOORD0 + coord_idx)) + context->stream_info.use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coord_idx)) ? context->stream_info.elements[WINED3D_FFP_TEXCOORD0 + coord_idx].format->id : WINED3DFMT_UNKNOWN, device->shader_backend->shader_has_ffp_proj_control(device->shader_priv), mat); - if ((context->lastWasPow2Texture & (1 << tex)) && state->textures[tex]) + if ((context->lastWasPow2Texture & (1u << tex)) && state->textures[tex]) { if (generated) FIXME("Non-power-of-two texture being used with generated texture coords.\n"); @@ -4009,77 +4016,6 @@ return count; } -/* Helper function for retrieving color info for ChoosePixelFormat and wglChoosePixelFormatARB. - * The later function requires individual color components. */ -BOOL getColorBits(const struct wined3d_format *format, - BYTE *redSize, BYTE *greenSize, BYTE *blueSize, BYTE *alphaSize, BYTE *totalSize) -{ - TRACE("format %s.\n", debug_d3dformat(format->id)); - - switch (format->id) - { - case WINED3DFMT_B10G10R10A2_UNORM: - case WINED3DFMT_R10G10B10A2_UNORM: - case WINED3DFMT_B8G8R8X8_UNORM: - case WINED3DFMT_B8G8R8_UNORM: - case WINED3DFMT_B8G8R8A8_UNORM: - case WINED3DFMT_R8G8B8A8_UNORM: - case WINED3DFMT_B5G5R5X1_UNORM: - case WINED3DFMT_B5G5R5A1_UNORM: - case WINED3DFMT_B5G6R5_UNORM: - case WINED3DFMT_B4G4R4X4_UNORM: - case WINED3DFMT_B4G4R4A4_UNORM: - case WINED3DFMT_B2G3R3_UNORM: - case WINED3DFMT_P8_UINT_A8_UNORM: - case WINED3DFMT_P8_UINT: - break; - default: - FIXME("Unsupported format %s.\n", debug_d3dformat(format->id)); - return FALSE; - } - - *redSize = format->red_size; - *greenSize = format->green_size; - *blueSize = format->blue_size; - *alphaSize = format->alpha_size; - *totalSize = *redSize + *greenSize + *blueSize + *alphaSize; - - TRACE("Returning red: %d, green: %d, blue: %d, alpha: %d, total: %d for format %s.\n", - *redSize, *greenSize, *blueSize, *alphaSize, *totalSize, debug_d3dformat(format->id)); - return TRUE; -} - -/* Helper function for retrieving depth/stencil info for ChoosePixelFormat and wglChoosePixelFormatARB */ -BOOL getDepthStencilBits(const struct wined3d_format *format, BYTE *depthSize, BYTE *stencilSize) -{ - TRACE("format %s.\n", debug_d3dformat(format->id)); - - switch (format->id) - { - case WINED3DFMT_D16_LOCKABLE: - case WINED3DFMT_D16_UNORM: - case WINED3DFMT_S1_UINT_D15_UNORM: - case WINED3DFMT_X8D24_UNORM: - case WINED3DFMT_S4X4_UINT_D24_UNORM: - case WINED3DFMT_D24_UNORM_S8_UINT: - case WINED3DFMT_S8_UINT_D24_FLOAT: - case WINED3DFMT_D32_UNORM: - case WINED3DFMT_D32_FLOAT: - case WINED3DFMT_INTZ: - break; - default: - FIXME("Unsupported depth/stencil format %s.\n", debug_d3dformat(format->id)); - return FALSE; - } - - *depthSize = format->depth_size; - *stencilSize = format->stencil_size; - - TRACE("Returning depthSize: %d and stencilSize: %d for format %s.\n", - *depthSize, *stencilSize, debug_d3dformat(format->id)); - return TRUE; -} - /* Note: It's the caller's responsibility to ensure values can be expressed * in the requested format. UNORM formats for example can only express values * in the range 0.0f -> 1.0f. */ @@ -4145,7 +4081,7 @@ static float color_to_float(DWORD color, DWORD size, DWORD offset) { - DWORD mask = (1 << size) - 1; + DWORD mask = (1u << size) - 1; if (!size) return 1.0f; @@ -4207,6 +4143,72 @@ } } +void wined3d_format_get_float_color_key(const struct wined3d_format *format, + const struct wined3d_color_key *key, struct wined3d_color *float_colors) +{ + struct wined3d_color slop; + + switch (format->id) + { + case WINED3DFMT_B8G8R8_UNORM: + case WINED3DFMT_B8G8R8A8_UNORM: + case WINED3DFMT_B8G8R8X8_UNORM: + case WINED3DFMT_B5G6R5_UNORM: + case WINED3DFMT_B5G5R5X1_UNORM: + case WINED3DFMT_B5G5R5A1_UNORM: + case WINED3DFMT_B4G4R4A4_UNORM: + case WINED3DFMT_B2G3R3_UNORM: + case WINED3DFMT_R8_UNORM: + case WINED3DFMT_A8_UNORM: + case WINED3DFMT_B2G3R3A8_UNORM: + case WINED3DFMT_B4G4R4X4_UNORM: + case WINED3DFMT_R10G10B10A2_UNORM: + case WINED3DFMT_R10G10B10A2_SNORM: + case WINED3DFMT_R8G8B8A8_UNORM: + case WINED3DFMT_R8G8B8X8_UNORM: + case WINED3DFMT_R16G16_UNORM: + case WINED3DFMT_B10G10R10A2_UNORM: + slop.r = 0.5f / ((1 << format->red_size) - 1); + slop.g = 0.5f / ((1 << format->green_size) - 1); + slop.b = 0.5f / ((1 << format->blue_size) - 1); + slop.a = 0.5f / ((1 << format->alpha_size) - 1); + + float_colors[0].r = color_to_float(key->color_space_low_value, format->red_size, format->red_offset) + - slop.r; + float_colors[0].g = color_to_float(key->color_space_low_value, format->green_size, format->green_offset) + - slop.g; + float_colors[0].b = color_to_float(key->color_space_low_value, format->blue_size, format->blue_offset) + - slop.b; + float_colors[0].a = color_to_float(key->color_space_low_value, format->alpha_size, format->alpha_offset) + - slop.a; + + float_colors[1].r = color_to_float(key->color_space_high_value, format->red_size, format->red_offset) + + slop.r; + float_colors[1].g = color_to_float(key->color_space_high_value, format->green_size, format->green_offset) + + slop.g; + float_colors[1].b = color_to_float(key->color_space_high_value, format->blue_size, format->blue_offset) + + slop.b; + float_colors[1].a = color_to_float(key->color_space_high_value, format->alpha_size, format->alpha_offset) + + slop.a; + break; + + case WINED3DFMT_P8_UINT: + float_colors[0].r = 0.0f; + float_colors[0].g = 0.0f; + float_colors[0].b = 0.0f; + float_colors[0].a = (key->color_space_low_value - 0.5f) / 255.0f; + + float_colors[1].r = 0.0f; + float_colors[1].g = 0.0f; + float_colors[1].b = 0.0f; + float_colors[1].a = (key->color_space_high_value + 0.5f) / 255.0f; + break; + + default: + ERR("Unhandled color key to float conversion for format %s.\n", debug_d3dformat(format->id)); + } +} + /* DirectDraw stuff */ enum wined3d_format_id pixelformat_for_depth(DWORD depth) { @@ -4277,6 +4279,13 @@ return size; } +unsigned int wined3d_max_compat_varyings(const struct wined3d_gl_info *gl_info) +{ + /* On core profile we have to also count diffuse and specular colors and the + * fog coordinate. */ + return gl_info->supported[WINED3D_GL_LEGACY_CONTEXT] ? MAX_TEXTURES * 4 : (MAX_TEXTURES + 2) * 4 + 1; +} + void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d_state *state, struct ffp_frag_settings *settings, BOOL ignore_textype) { @@ -4556,6 +4565,48 @@ settings->color_key_enabled = 1; else settings->color_key_enabled = 0; + + /* texcoords_initialized is set to meaningful values only when GL doesn't + * support enough varyings to always pass around all the possible texture + * coordinates. + * This is used to avoid reading a varying not written by the vertex shader. + * Reading uninitialized varyings on core profile contexts results in an + * error while with builtin varyings on legacy contexts you get undefined + * behavior. */ + if (d3d_info->limits.varying_count + && d3d_info->limits.varying_count < wined3d_max_compat_varyings(gl_info)) + { + settings->texcoords_initialized = 0; + for (i = 0; i < MAX_TEXTURES; ++i) + { + if (use_vs(state)) + { + if (state->shader[WINED3D_SHADER_TYPE_VERTEX]->reg_maps.output_registers & (1u << i)) + settings->texcoords_initialized |= 1u << i; + } + else + { + const struct wined3d_stream_info *si = &context->stream_info; + unsigned int coord_idx = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX]; + if ((state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX] >> WINED3D_FFP_TCI_SHIFT) + & WINED3D_FFP_TCI_MASK + || (coord_idx < MAX_TEXTURES && (si->use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coord_idx))))) + settings->texcoords_initialized |= 1u << i; + } + } + } + else + { + settings->texcoords_initialized = (1u << MAX_TEXTURES) - 1; + } + + settings->pointsprite = state->render_states[WINED3D_RS_POINTSPRITEENABLE] + && state->gl_primitive_type == GL_POINTS; + + if (d3d_info->emulated_flatshading) + settings->flatshading = state->render_states[WINED3D_RS_SHADEMODE] == WINED3D_SHADE_FLAT; + else + settings->flatshading = FALSE; } const struct ffp_frag_desc *find_ffp_frag_shader(const struct wine_rb_tree *fragment_shaders, @@ -4715,9 +4766,12 @@ ffp_frag_program_key_compare, }; -void wined3d_ffp_get_vs_settings(const struct wined3d_state *state, const struct wined3d_stream_info *si, - struct wined3d_ffp_vs_settings *settings) +void wined3d_ffp_get_vs_settings(const struct wined3d_context *context, + const struct wined3d_state *state, struct wined3d_ffp_vs_settings *settings) { + const struct wined3d_stream_info *si = &context->stream_info; + const struct wined3d_gl_info *gl_info = context->gl_info; + const struct wined3d_d3d_info *d3d_info = context->d3d_info; unsigned int coord_idx, i; if (si->position_transformed) @@ -4726,7 +4780,7 @@ settings->transformed = 1; settings->point_size = state->gl_primitive_type == GL_POINTS; - settings->per_vertex_point_size = !!(si->use_map & 1 << WINED3D_FFP_PSIZE); + settings->per_vertex_point_size = !!(si->use_map & 1u << WINED3D_FFP_PSIZE); if (!state->render_states[WINED3D_RS_FOGENABLE]) settings->fog_mode = WINED3D_FFP_VS_FOG_OFF; else if (state->render_states[WINED3D_RS_FOGTABLEMODE] != WINED3D_FOG_NONE) @@ -4737,10 +4791,18 @@ for (i = 0; i < MAX_TEXTURES; ++i) { coord_idx = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX]; - if (coord_idx < MAX_TEXTURES && (si->use_map & (1 << (WINED3D_FFP_TEXCOORD0 + coord_idx)))) - settings->texcoords |= 1 << i; + if (coord_idx < MAX_TEXTURES && (si->use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coord_idx)))) + settings->texcoords |= 1u << i; settings->texgen[i] = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX]; } + if (d3d_info->limits.varying_count >= wined3d_max_compat_varyings(gl_info)) + settings->texcoords = (1u << MAX_TEXTURES) - 1; + + if (d3d_info->emulated_flatshading) + settings->flatshading = state->render_states[WINED3D_RS_SHADEMODE] == WINED3D_SHADE_FLAT; + else + settings->flatshading = FALSE; + return; } @@ -4760,14 +4822,14 @@ settings->transformed = 0; settings->clipping = state->render_states[WINED3D_RS_CLIPPING] && state->render_states[WINED3D_RS_CLIPPLANEENABLE]; - settings->normal = !!(si->use_map & (1 << WINED3D_FFP_NORMAL)); + settings->normal = !!(si->use_map & (1u << WINED3D_FFP_NORMAL)); settings->normalize = settings->normal && state->render_states[WINED3D_RS_NORMALIZENORMALS]; settings->lighting = !!state->render_states[WINED3D_RS_LIGHTING]; settings->localviewer = !!state->render_states[WINED3D_RS_LOCALVIEWER]; settings->point_size = state->gl_primitive_type == GL_POINTS; - settings->per_vertex_point_size = !!(si->use_map & 1 << WINED3D_FFP_PSIZE); + settings->per_vertex_point_size = !!(si->use_map & 1u << WINED3D_FFP_PSIZE); - if (state->render_states[WINED3D_RS_COLORVERTEX] && (si->use_map & (1 << WINED3D_FFP_DIFFUSE))) + if (state->render_states[WINED3D_RS_COLORVERTEX] && (si->use_map & (1u << WINED3D_FFP_DIFFUSE))) { settings->diffuse_source = state->render_states[WINED3D_RS_DIFFUSEMATERIALSOURCE]; settings->emissive_source = state->render_states[WINED3D_RS_EMISSIVEMATERIALSOURCE]; @@ -4786,10 +4848,12 @@ for (i = 0; i < MAX_TEXTURES; ++i) { coord_idx = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX]; - if (coord_idx < MAX_TEXTURES && (si->use_map & (1 << (WINED3D_FFP_TEXCOORD0 + coord_idx)))) - settings->texcoords |= 1 << i; + if (coord_idx < MAX_TEXTURES && (si->use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coord_idx)))) + settings->texcoords |= 1u << i; settings->texgen[i] = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX]; } + if (d3d_info->limits.varying_count >= wined3d_max_compat_varyings(gl_info)) + settings->texcoords = (1u << MAX_TEXTURES) - 1; settings->light_type = 0; for (i = 0; i < MAX_ACTIVE_LIGHTS; ++i) @@ -4819,6 +4883,11 @@ else settings->fog_mode = WINED3D_FFP_VS_FOG_DEPTH; + if (d3d_info->emulated_flatshading) + settings->flatshading = state->render_states[WINED3D_RS_SHADEMODE] == WINED3D_SHADE_FLAT; + else + settings->flatshading = FALSE; + settings->padding = 0; } diff -Nru wine1.7-1.7.50/dlls/wined3d/view.c wine1.7-1.7.55/dlls/wined3d/view.c --- wine1.7-1.7.50/dlls/wined3d/view.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/view.c 2015-11-13 14:32:40.000000000 +0000 @@ -131,8 +131,8 @@ { struct wined3d_rendertarget_view *object; - TRACE("desc %p, resource %p, parent %p, view %p.\n", - desc, resource, parent, view); + TRACE("desc %p, resource %p, parent %p, parent_ops %p, view %p.\n", + desc, resource, parent, parent_ops, view); if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) return E_OUTOFMEMORY; @@ -150,7 +150,7 @@ { struct wined3d_rendertarget_view_desc desc; - TRACE("surface %p, view %p.\n", surface, view); + TRACE("surface %p, parent %p, parent_ops %p, view %p.\n", surface, parent, parent_ops, view); desc.format_id = surface->resource.format->id; desc.u.texture.level_idx = surface->texture_level; @@ -160,6 +160,28 @@ return wined3d_rendertarget_view_create(&desc, &surface->container->resource, parent, parent_ops, view); } +HRESULT CDECL wined3d_rendertarget_view_create_from_sub_resource(struct wined3d_texture *texture, + unsigned int sub_resource_idx, void *parent, const struct wined3d_parent_ops *parent_ops, + struct wined3d_rendertarget_view **view) +{ + struct wined3d_resource *sub_resource; + + TRACE("texture %p, sub_resource_idx %u, parent %p, parent_ops %p, view %p.\n", + texture, sub_resource_idx, parent, parent_ops, view); + + if (!(sub_resource = wined3d_texture_get_sub_resource(texture, sub_resource_idx))) + return WINED3DERR_INVALIDCALL; + + if (sub_resource->type != WINED3D_RTYPE_SURFACE) + { + FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(texture->resource.type)); + return WINED3DERR_INVALIDCALL; + } + + return wined3d_rendertarget_view_create_from_surface(surface_from_resource(sub_resource), + parent, parent_ops, view); +} + ULONG CDECL wined3d_shader_resource_view_incref(struct wined3d_shader_resource_view *view) { ULONG refcount = InterlockedIncrement(&view->refcount); @@ -199,7 +221,7 @@ { struct wined3d_shader_resource_view *object; - TRACE("parent %p, parent_ops %p, view %p.\n", parent, parent_ops, view); + TRACE("resource %p, parent %p, parent_ops %p, view %p.\n", resource, parent, parent_ops, view); if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) return E_OUTOFMEMORY; diff -Nru wine1.7-1.7.50/dlls/wined3d/volume.c wine1.7-1.7.55/dlls/wined3d/volume.c --- wine1.7-1.7.50/dlls/wined3d/volume.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/volume.c 2015-11-13 14:32:40.000000000 +0000 @@ -460,39 +460,6 @@ resource_unload(resource); } -ULONG CDECL wined3d_volume_incref(struct wined3d_volume *volume) -{ - TRACE("Forwarding to container %p.\n", volume->container); - - return wined3d_texture_incref(volume->container); -} - -ULONG CDECL wined3d_volume_decref(struct wined3d_volume *volume) -{ - TRACE("Forwarding to container %p.\n", volume->container); - - return wined3d_texture_decref(volume->container); -} - -void * CDECL wined3d_volume_get_parent(const struct wined3d_volume *volume) -{ - TRACE("volume %p.\n", volume); - - return volume->resource.parent; -} - -void CDECL wined3d_volume_preload(struct wined3d_volume *volume) -{ - FIXME("volume %p stub!\n", volume); -} - -struct wined3d_resource * CDECL wined3d_volume_get_resource(struct wined3d_volume *volume) -{ - TRACE("volume %p.\n", volume); - - return &volume->resource; -} - static BOOL volume_check_block_align(const struct wined3d_volume *volume, const struct wined3d_box *box) { @@ -543,7 +510,7 @@ return TRUE; } -HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume, +HRESULT wined3d_volume_map(struct wined3d_volume *volume, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) { struct wined3d_device *device = volume->resource.device; @@ -688,12 +655,7 @@ return WINED3D_OK; } -struct wined3d_volume * CDECL wined3d_volume_from_resource(struct wined3d_resource *resource) -{ - return volume_from_resource(resource); -} - -HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume) +HRESULT wined3d_volume_unmap(struct wined3d_volume *volume) { TRACE("volume %p.\n", volume); @@ -724,12 +686,31 @@ static ULONG volume_resource_incref(struct wined3d_resource *resource) { - return wined3d_volume_incref(volume_from_resource(resource)); + struct wined3d_volume *volume = volume_from_resource(resource); + TRACE("Forwarding to container %p.\n", volume->container); + + return wined3d_texture_incref(volume->container); } static ULONG volume_resource_decref(struct wined3d_resource *resource) { - return wined3d_volume_decref(volume_from_resource(resource)); + struct wined3d_volume *volume = volume_from_resource(resource); + TRACE("Forwarding to container %p.\n", volume->container); + + return wined3d_texture_decref(volume->container); +} + +static HRESULT volume_resource_sub_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, + struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) +{ + ERR("Not supported on sub-resources.\n"); + return WINED3DERR_INVALIDCALL; +} + +static HRESULT volume_resource_sub_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx) +{ + ERR("Not supported on sub-resources.\n"); + return WINED3DERR_INVALIDCALL; } static const struct wined3d_resource_ops volume_resource_ops = @@ -737,6 +718,8 @@ volume_resource_incref, volume_resource_decref, volume_unload, + volume_resource_sub_resource_map, + volume_resource_sub_resource_unmap, }; static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_texture *container, @@ -808,7 +791,7 @@ } if (FAILED(hr = device_parent->ops->volume_created(device_parent, - wined3d_texture_get_parent(container), object, &parent, &parent_ops))) + container, level, &parent, &parent_ops))) { WARN("Failed to create volume parent, hr %#x.\n", hr); wined3d_volume_destroy(object); diff -Nru wine1.7-1.7.50/dlls/wined3d/wined3d_gl.h wine1.7-1.7.55/dlls/wined3d/wined3d_gl.h --- wine1.7-1.7.50/dlls/wined3d/wined3d_gl.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/wined3d_gl.h 2015-11-13 14:32:40.000000000 +0000 @@ -165,6 +165,7 @@ WINED3D_GL_NORMALIZED_TEXRECT, WINED3D_GL_LEGACY_CONTEXT, WINED3D_GL_VERSION_2_0, + WINED3D_GL_VERSION_3_2, WINED3D_GL_EXT_COUNT, }; diff -Nru wine1.7-1.7.50/dlls/wined3d/wined3d_private.h wine1.7-1.7.55/dlls/wined3d/wined3d_private.h --- wine1.7-1.7.50/dlls/wined3d/wined3d_private.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/wined3d_private.h 2015-11-13 14:32:40.000000000 +0000 @@ -127,10 +127,10 @@ { struct color_fixup_desc fixup = { - 0, complex_fixup & (1 << 0) ? CHANNEL_SOURCE_COMPLEX1 : CHANNEL_SOURCE_COMPLEX0, - 0, complex_fixup & (1 << 1) ? CHANNEL_SOURCE_COMPLEX1 : CHANNEL_SOURCE_COMPLEX0, - 0, complex_fixup & (1 << 2) ? CHANNEL_SOURCE_COMPLEX1 : CHANNEL_SOURCE_COMPLEX0, - 0, complex_fixup & (1 << 3) ? CHANNEL_SOURCE_COMPLEX1 : CHANNEL_SOURCE_COMPLEX0, + 0u, complex_fixup & (1u << 0) ? CHANNEL_SOURCE_COMPLEX1 : CHANNEL_SOURCE_COMPLEX0, + 0u, complex_fixup & (1u << 1) ? CHANNEL_SOURCE_COMPLEX1 : CHANNEL_SOURCE_COMPLEX0, + 0u, complex_fixup & (1u << 2) ? CHANNEL_SOURCE_COMPLEX1 : CHANNEL_SOURCE_COMPLEX0, + 0u, complex_fixup & (1u << 3) ? CHANNEL_SOURCE_COMPLEX1 : CHANNEL_SOURCE_COMPLEX0, }; return fixup; } @@ -145,6 +145,11 @@ return fixup.x_source == CHANNEL_SOURCE_COMPLEX0 || fixup.x_source == CHANNEL_SOURCE_COMPLEX1; } +static inline BOOL is_scaling_fixup(struct color_fixup_desc fixup) +{ + return fixup.x_sign_fixup || fixup.y_sign_fixup || fixup.z_sign_fixup || fixup.w_sign_fixup; +} + static inline BOOL is_same_fixup(struct color_fixup_desc f1, struct color_fixup_desc f2) { return f1.x_sign_fixup == f2.x_sign_fixup && f1.x_source == f2.x_source @@ -156,10 +161,10 @@ static inline enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup) { enum complex_fixup complex_fixup = 0; - if (fixup.x_source == CHANNEL_SOURCE_COMPLEX1) complex_fixup |= (1 << 0); - if (fixup.y_source == CHANNEL_SOURCE_COMPLEX1) complex_fixup |= (1 << 1); - if (fixup.z_source == CHANNEL_SOURCE_COMPLEX1) complex_fixup |= (1 << 2); - if (fixup.w_source == CHANNEL_SOURCE_COMPLEX1) complex_fixup |= (1 << 3); + if (fixup.x_source == CHANNEL_SOURCE_COMPLEX1) complex_fixup |= (1u << 0); + if (fixup.y_source == CHANNEL_SOURCE_COMPLEX1) complex_fixup |= (1u << 1); + if (fixup.z_source == CHANNEL_SOURCE_COMPLEX1) complex_fixup |= (1u << 2); + if (fixup.w_source == CHANNEL_SOURCE_COMPLEX1) complex_fixup |= (1u << 3); return complex_fixup; } @@ -214,9 +219,9 @@ */ static inline float float_16_to_32(const unsigned short *in) { - const unsigned short s = ((*in) & 0x8000); - const unsigned short e = ((*in) & 0x7c00) >> 10; - const unsigned short m = (*in) & 0x3ff; + const unsigned short s = ((*in) & 0x8000u); + const unsigned short e = ((*in) & 0x7c00u) >> 10; + const unsigned short m = (*in) & 0x3ffu; const float sgn = (s ? -1.0f : 1.0f); if(e == 0) { @@ -232,9 +237,9 @@ static inline float float_24_to_32(DWORD in) { - const float sgn = in & 0x800000 ? -1.0f : 1.0f; - const unsigned short e = (in & 0x780000) >> 19; - const unsigned int m = in & 0x7ffff; + const float sgn = in & 0x800000u ? -1.0f : 1.0f; + const unsigned short e = (in & 0x780000u) >> 19; + const unsigned int m = in & 0x7ffffu; if (e == 0) { @@ -364,7 +369,7 @@ WINED3D_IMMCONST_VEC4, }; -#define WINED3DSP_NOSWIZZLE (0 | (1 << 2) | (2 << 4) | (3 << 6)) +#define WINED3DSP_NOSWIZZLE (0u | (1u << 2) | (2u << 4) | (3u << 6)) enum wined3d_shader_src_modifier { @@ -384,11 +389,11 @@ WINED3DSPSM_NOT = 13, }; -#define WINED3DSP_WRITEMASK_0 0x1 /* .x r */ -#define WINED3DSP_WRITEMASK_1 0x2 /* .y g */ -#define WINED3DSP_WRITEMASK_2 0x4 /* .z b */ -#define WINED3DSP_WRITEMASK_3 0x8 /* .w a */ -#define WINED3DSP_WRITEMASK_ALL 0xf /* all */ +#define WINED3DSP_WRITEMASK_0 0x1u /* .x r */ +#define WINED3DSP_WRITEMASK_1 0x2u /* .y g */ +#define WINED3DSP_WRITEMASK_2 0x4u /* .z b */ +#define WINED3DSP_WRITEMASK_3 0x8u /* .w a */ +#define WINED3DSP_WRITEMASK_ALL 0xfu /* all */ enum wined3d_shader_dst_modifier { @@ -413,11 +418,11 @@ WINED3D_SHADER_REL_OP_LE = 6, }; -#define WINED3D_SM1_VS 0xfffe -#define WINED3D_SM1_PS 0xffff -#define WINED3D_SM4_PS 0x0000 -#define WINED3D_SM4_VS 0x0001 -#define WINED3D_SM4_GS 0x0002 +#define WINED3D_SM1_VS 0xfffeu +#define WINED3D_SM1_PS 0xffffu +#define WINED3D_SM4_PS 0x0000u +#define WINED3D_SM4_VS 0x0001u +#define WINED3D_SM4_GS 0x0002u /* Shader version tokens, and shader end tokens */ #define WINED3DPS_VERSION(major, minor) ((WINED3D_SM1_PS << 16) | ((major) << 8) | (minor)) @@ -609,24 +614,28 @@ struct wined3d_shader_reg_maps { struct wined3d_shader_version shader_version; - BYTE texcoord; /* MAX_REG_TEXCRD, 8 */ - BYTE address; /* MAX_REG_ADDR, 1 */ - WORD labels; /* MAX_LABELS, 16 */ - DWORD temporary; /* MAX_REG_TEMP, 32 */ - DWORD *constf; /* pixel, vertex */ - DWORD texcoord_mask[MAX_REG_TEXCRD]; /* vertex < 3.0 */ - DWORD input_registers; /* max(MAX_REG_INPUT, MAX_ATTRIBS), 32 */ - DWORD output_registers; /* MAX_REG_OUTPUT, 32 */ - WORD integer_constants; /* MAX_CONST_I, 16 */ - WORD boolean_constants; /* MAX_CONST_B, 16 */ - WORD local_int_consts; /* MAX_CONST_I, 16 */ - WORD local_bool_consts; /* MAX_CONST_B, 16 */ + BYTE texcoord; /* MAX_REG_TEXCRD, 8 */ + BYTE address; /* MAX_REG_ADDR, 1 */ + WORD labels; /* MAX_LABELS, 16 */ + DWORD temporary; /* MAX_REG_TEMP, 32 */ + DWORD *constf; /* pixel, vertex */ + union + { + DWORD texcoord_mask[MAX_REG_TEXCRD]; /* vertex < 3.0 */ + BYTE output_registers_mask[MAX_REG_OUTPUT]; /* vertex >= 3.0 */ + } u; + DWORD input_registers; /* max(MAX_REG_INPUT, MAX_ATTRIBS), 32 */ + DWORD output_registers; /* MAX_REG_OUTPUT, 32 */ + WORD integer_constants; /* MAX_CONST_I, 16 */ + WORD boolean_constants; /* MAX_CONST_B, 16 */ + WORD local_int_consts; /* MAX_CONST_I, 16 */ + WORD local_bool_consts; /* MAX_CONST_B, 16 */ UINT cb_sizes[WINED3D_MAX_CBS]; struct wined3d_shader_resource_info resource_info[max(MAX_FRAGMENT_SAMPLERS, MAX_VERTEX_SAMPLERS)]; struct wined3d_shader_sampler_map sampler_map; - BYTE bumpmat; /* MAX_TEXTURES, 8 */ - BYTE luminanceparams; /* MAX_TEXTURES, 8 */ + BYTE bumpmat; /* MAX_TEXTURES, 8 */ + BYTE luminanceparams; /* MAX_TEXTURES, 8 */ WORD usesnrm : 1; WORD vpos : 1; @@ -774,6 +783,7 @@ DWORD vs_uniform_count; DWORD ps_uniform_count; float ps_1x_max_value; + DWORD varying_count; DWORD wined3d_caps; }; @@ -810,11 +820,11 @@ * into the shader code */ -#define WINED3D_PSARGS_PROJECTED (1 << 3) +#define WINED3D_PSARGS_PROJECTED (1u << 3) #define WINED3D_PSARGS_TEXTRANSFORM_SHIFT 4 -#define WINED3D_PSARGS_TEXTRANSFORM_MASK 0xf +#define WINED3D_PSARGS_TEXTRANSFORM_MASK 0xfu #define WINED3D_PSARGS_TEXTYPE_SHIFT 2 -#define WINED3D_PSARGS_TEXTYPE_MASK 0x3 +#define WINED3D_PSARGS_TEXTYPE_MASK 0x3u /* Used for Shader Model 1 pixel shaders to track the bound texture * type. 2D and RECT textures are separated through NP2 fixup. */ @@ -832,12 +842,14 @@ WORD tex_transform; /* ps 1.0-1.3, 4 textures */ WORD tex_types; /* ps 1.0 - 1.4, 6 textures */ WORD srgb_correction; - WORD np2_fixup; /* Bitmap for NP2 texcoord fixups (16 samplers max currently). D3D9 has a limit of 16 samplers and the fixup is superfluous in D3D10 (unconditional NP2 support mandatory). */ + WORD np2_fixup; WORD shadow; /* MAX_FRAGMENT_SAMPLERS, 16 */ + WORD texcoords_initialized; /* MAX_TEXTURES, 8 */ BOOL pointsprite; + BOOL flatshading; }; enum fog_src_type { @@ -851,7 +863,8 @@ BYTE clip_enabled : 1; BYTE point_size : 1; BYTE per_vertex_point_size : 1; - BYTE padding : 5; + BYTE flatshading : 1; + BYTE padding : 4; WORD swizzle_map; /* MAX_ATTRIBS, 16 */ }; @@ -1306,6 +1319,7 @@ struct wined3d_vertex_caps { BOOL xyzrhw; + BOOL emulated_flatshading; BOOL ffp_generic_attributes; DWORD max_active_lights; DWORD max_vertex_blend_matrices; @@ -1417,6 +1431,7 @@ struct wined3d_resource *resource, enum wined3d_resource_type type) DECLSPEC_HIDDEN; void context_resource_unloaded(const struct wined3d_device *device, struct wined3d_resource *resource, enum wined3d_resource_type type) DECLSPEC_HIDDEN; +void context_restore(struct wined3d_context *context, struct wined3d_surface *restore) DECLSPEC_HIDDEN; BOOL context_set_current(struct wined3d_context *ctx) DECLSPEC_HIDDEN; void context_set_draw_buffer(struct wined3d_context *context, GLenum buffer) DECLSPEC_HIDDEN; void context_set_tls_idx(DWORD idx) DECLSPEC_HIDDEN; @@ -1486,6 +1501,7 @@ CARD_AMD_RADEON_HD2600 = 0x9581, CARD_AMD_RADEON_HD2900 = 0x9400, CARD_AMD_RADEON_HD3200 = 0x9620, + CARD_AMD_RADEON_HD3850 = 0x9515, CARD_AMD_RADEON_HD4200M = 0x9712, CARD_AMD_RADEON_HD4350 = 0x954f, CARD_AMD_RADEON_HD4600 = 0x9495, @@ -1748,6 +1764,7 @@ UINT vs_version, gs_version, ps_version; DWORD vs_uniform_count; DWORD ps_uniform_count; + UINT varying_count; UINT ffp_textures; UINT ffp_blend_stages; UINT ffp_vertex_blend_matrices; @@ -1771,6 +1788,7 @@ struct wined3d_d3d_limits limits; struct wined3d_ffp_attrib_ops ffp_attrib_ops; BOOL xyzrhw; + BOOL emulated_flatshading; BOOL ffp_generic_attributes; BOOL vs_clipping; BOOL shader_color_key; @@ -1863,8 +1881,11 @@ enum wined3d_ffp_ps_fog_mode fog; unsigned char sRGB_write; unsigned char emul_clipplanes; - unsigned char color_key_enabled; - unsigned char padding; + unsigned char texcoords_initialized; + unsigned char color_key_enabled : 1; + unsigned char pointsprite : 1; + unsigned char flatshading : 1; + unsigned char padding : 5; }; struct ffp_frag_desc @@ -1877,6 +1898,7 @@ extern const struct wine_rb_functions wined3d_ffp_vertex_program_rb_functions DECLSPEC_HIDDEN; extern const struct wined3d_parent_ops wined3d_null_parent_ops DECLSPEC_HIDDEN; +unsigned int wined3d_max_compat_varyings(const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d_state *state, struct ffp_frag_settings *settings, BOOL ignore_textype) DECLSPEC_HIDDEN; const struct ffp_frag_desc *find_ffp_frag_shader(const struct wine_rb_tree *fragment_shaders, @@ -1897,10 +1919,10 @@ }; #define WINED3D_FFP_TCI_SHIFT 16 -#define WINED3D_FFP_TCI_MASK 0xff +#define WINED3D_FFP_TCI_MASK 0xffu #define WINED3D_FFP_LIGHT_TYPE_SHIFT(idx) (3 * (idx)) -#define WINED3D_FFP_LIGHT_TYPE_MASK 0x7 +#define WINED3D_FFP_LIGHT_TYPE_MASK 0x7u struct wined3d_ffp_vs_settings { @@ -1922,7 +1944,8 @@ DWORD fog_mode : 2; DWORD texcoords : 8; /* MAX_TEXTURES */ DWORD ortho_fog : 1; - DWORD padding : 11; + DWORD flatshading : 1; + DWORD padding : 10; DWORD texgen[MAX_TEXTURES]; }; @@ -1933,8 +1956,8 @@ struct wined3d_ffp_vs_settings settings; }; -void wined3d_ffp_get_vs_settings(const struct wined3d_state *state, const struct wined3d_stream_info *si, - struct wined3d_ffp_vs_settings *settings) DECLSPEC_HIDDEN; +void wined3d_ffp_get_vs_settings(const struct wined3d_context *context, + const struct wined3d_state *state, struct wined3d_ffp_vs_settings *settings) DECLSPEC_HIDDEN; struct wined3d { @@ -2128,7 +2151,7 @@ { DWORD idx = state / (sizeof(*context->isStateDirty) * CHAR_BIT); BYTE shift = state & ((sizeof(*context->isStateDirty) * CHAR_BIT) - 1); - return context->isStateDirty[idx] & (1 << shift); + return context->isStateDirty[idx] & (1u << shift); } #define WINED3D_RESOURCE_ACCESS_GPU 0x1 @@ -2139,6 +2162,9 @@ ULONG (*resource_incref)(struct wined3d_resource *resource); ULONG (*resource_decref)(struct wined3d_resource *resource); void (*resource_unload)(struct wined3d_resource *resource); + HRESULT (*resource_sub_resource_map)(struct wined3d_resource *resource, unsigned int sub_resource_idx, + struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags); + HRESULT (*resource_sub_resource_unmap)(struct wined3d_resource *resource, unsigned int sub_resource_idx); }; struct wined3d_resource @@ -2332,7 +2358,10 @@ void wined3d_volume_load(struct wined3d_volume *volume, struct wined3d_context *context, BOOL srgb_mode) DECLSPEC_HIDDEN; void wined3d_volume_invalidate_location(struct wined3d_volume *volume, DWORD location) DECLSPEC_HIDDEN; +HRESULT wined3d_volume_map(struct wined3d_volume *volume, + struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags) DECLSPEC_HIDDEN; void wined3d_volume_validate_location(struct wined3d_volume *volume, DWORD location) DECLSPEC_HIDDEN; +HRESULT wined3d_volume_unmap(struct wined3d_volume *volume) DECLSPEC_HIDDEN; void wined3d_volume_upload_data(struct wined3d_volume *volume, const struct wined3d_context *context, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN; @@ -2428,12 +2457,16 @@ void surface_get_drawable_size(const struct wined3d_surface *surface, const struct wined3d_context *context, unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN; void surface_invalidate_location(struct wined3d_surface *surface, DWORD location) DECLSPEC_HIDDEN; -void surface_load(struct wined3d_surface *surface, BOOL srgb) DECLSPEC_HIDDEN; +void surface_load(struct wined3d_surface *surface, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN; void surface_load_ds_location(struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; -void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb) DECLSPEC_HIDDEN; -HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) DECLSPEC_HIDDEN; +void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb, + struct wined3d_context *context) DECLSPEC_HIDDEN; +HRESULT surface_load_location(struct wined3d_surface *surface, + struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN; void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN; +void wined3d_surface_prepare(struct wined3d_surface *surface, struct wined3d_context *context, + DWORD location) DECLSPEC_HIDDEN; void surface_prepare_rb(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, BOOL multisample) DECLSPEC_HIDDEN; void surface_set_compatible_renderbuffer(struct wined3d_surface *surface, @@ -2456,7 +2489,6 @@ void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context, const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN; -void flip_surface(struct wined3d_surface *front, struct wined3d_surface *back) DECLSPEC_HIDDEN; /* Surface flags: */ #define SFLAG_DIBSECTION 0x00000001 /* Has a DIB section attached for GetDC. */ @@ -2876,11 +2908,9 @@ const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN; void state_pointsprite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN; +void state_shademode(struct wined3d_context *context, + const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN; -BOOL getColorBits(const struct wined3d_format *format, - BYTE *redSize, BYTE *greenSize, BYTE *blueSize, BYTE *alphaSize, BYTE *totalSize) DECLSPEC_HIDDEN; -BOOL getDepthStencilBits(const struct wined3d_format *format, - BYTE *depthSize, BYTE *stencilSize) DECLSPEC_HIDDEN; GLenum gl_primitive_type_from_d3d(enum wined3d_primitive_type primitive_type) DECLSPEC_HIDDEN; /* Math utils */ @@ -2999,10 +3029,11 @@ void pixelshader_update_resource_types(struct wined3d_shader *shader, WORD tex_types) DECLSPEC_HIDDEN; void find_ps_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader, BOOL position_transformed, struct ps_compile_args *args, - const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; + const struct wined3d_context *context) DECLSPEC_HIDDEN; void find_vs_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader, - WORD swizzle_map, struct vs_compile_args *args) DECLSPEC_HIDDEN; + WORD swizzle_map, struct vs_compile_args *args, + const struct wined3d_d3d_info *d3d_info) DECLSPEC_HIDDEN; void string_buffer_clear(struct wined3d_string_buffer *buffer) DECLSPEC_HIDDEN; BOOL string_buffer_init(struct wined3d_string_buffer *buffer) DECLSPEC_HIDDEN; @@ -3227,6 +3258,8 @@ const struct wined3d_color *color) DECLSPEC_HIDDEN; BOOL wined3d_format_convert_color_to_float(const struct wined3d_format *format, const struct wined3d_palette *palette, DWORD color, struct wined3d_color *float_color) DECLSPEC_HIDDEN; +void wined3d_format_get_float_color_key(const struct wined3d_format *format, + const struct wined3d_color_key *key, struct wined3d_color *float_colors) DECLSPEC_HIDDEN; const struct wined3d_color_key_conversion * wined3d_format_get_color_key_conversion( const struct wined3d_texture *texture, BOOL need_alpha_ck) DECLSPEC_HIDDEN; @@ -3253,6 +3286,6 @@ /* The WNDCLASS-Name for the fake window which we use to retrieve the GL capabilities */ #define WINED3D_OPENGL_WINDOW_CLASS_NAME "WineD3D_OpenGL" -#define MAKEDWORD_VERSION(maj, min) (((maj & 0xffff) << 16) | (min & 0xffff)) +#define MAKEDWORD_VERSION(maj, min) (((maj & 0xffffu) << 16) | (min & 0xffffu)) #endif diff -Nru wine1.7-1.7.50/dlls/wined3d/wined3d.spec wine1.7-1.7.55/dlls/wined3d/wined3d.spec --- wine1.7-1.7.50/dlls/wined3d/wined3d.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wined3d/wined3d.spec 2015-11-13 14:32:40.000000000 +0000 @@ -49,7 +49,6 @@ @ cdecl wined3d_device_end_stateblock(ptr ptr) @ cdecl wined3d_device_evict_managed_resources(ptr) @ cdecl wined3d_device_get_available_texture_mem(ptr) -@ cdecl wined3d_device_get_back_buffer(ptr long long long ptr) @ cdecl wined3d_device_get_base_vertex_index(ptr) @ cdecl wined3d_device_get_clip_plane(ptr long ptr) @ cdecl wined3d_device_get_clip_status(ptr ptr) @@ -57,7 +56,6 @@ @ cdecl wined3d_device_get_depth_stencil_view(ptr) @ cdecl wined3d_device_get_device_caps(ptr ptr) @ cdecl wined3d_device_get_display_mode(ptr long ptr ptr) -@ cdecl wined3d_device_get_front_buffer_data(ptr long ptr) @ cdecl wined3d_device_get_gamma_ramp(ptr long ptr) @ cdecl wined3d_device_get_geometry_shader(ptr) @ cdecl wined3d_device_get_gs_cb(ptr long) @@ -105,7 +103,6 @@ @ cdecl wined3d_device_init_3d(ptr ptr) @ cdecl wined3d_device_init_gdi(ptr ptr) @ cdecl wined3d_device_multiply_transform(ptr long ptr) -@ cdecl wined3d_device_present(ptr ptr ptr ptr ptr long) @ cdecl wined3d_device_process_vertices(ptr long long long ptr ptr long long) @ cdecl wined3d_device_release_focus_window(ptr) @ cdecl wined3d_device_reset(ptr ptr ptr ptr long) @@ -114,7 +111,7 @@ @ cdecl wined3d_device_set_clip_plane(ptr long ptr) @ cdecl wined3d_device_set_clip_status(ptr ptr) @ cdecl wined3d_device_set_cursor_position(ptr long long long) -@ cdecl wined3d_device_set_cursor_properties(ptr long long ptr) +@ cdecl wined3d_device_set_cursor_properties(ptr long long ptr long) @ cdecl wined3d_device_set_depth_stencil_view(ptr ptr) @ cdecl wined3d_device_set_dialog_box_mode(ptr long) @ cdecl wined3d_device_set_gamma_ramp(ptr long long ptr) @@ -185,11 +182,14 @@ @ cdecl wined3d_resource_get_desc(ptr ptr) @ cdecl wined3d_resource_get_parent(ptr) @ cdecl wined3d_resource_get_priority(ptr) +@ cdecl wined3d_resource_map(ptr long ptr ptr long) @ cdecl wined3d_resource_set_parent(ptr ptr) @ cdecl wined3d_resource_set_priority(ptr long) +@ cdecl wined3d_resource_unmap(ptr long) @ cdecl wined3d_rendertarget_view_create(ptr ptr ptr ptr ptr) @ cdecl wined3d_rendertarget_view_create_from_surface(ptr ptr ptr ptr) +@ cdecl wined3d_rendertarget_view_create_from_sub_resource(ptr long ptr ptr ptr) @ cdecl wined3d_rendertarget_view_decref(ptr) @ cdecl wined3d_rendertarget_view_get_parent(ptr) @ cdecl wined3d_rendertarget_view_get_resource(ptr) @@ -225,12 +225,9 @@ @ cdecl wined3d_surface_blt(ptr ptr ptr ptr long ptr long) @ cdecl wined3d_surface_decref(ptr) @ cdecl wined3d_surface_from_resource(ptr) -@ cdecl wined3d_surface_get_blt_status(ptr long) -@ cdecl wined3d_surface_get_flip_status(ptr long) @ cdecl wined3d_surface_get_overlay_position(ptr ptr ptr) @ cdecl wined3d_surface_get_parent(ptr) @ cdecl wined3d_surface_get_pitch(ptr) -@ cdecl wined3d_surface_get_render_target_data(ptr ptr) @ cdecl wined3d_surface_get_resource(ptr) @ cdecl wined3d_surface_getdc(ptr ptr) @ cdecl wined3d_surface_incref(ptr) @@ -249,7 +246,7 @@ @ cdecl wined3d_swapchain_get_back_buffer(ptr long long) @ cdecl wined3d_swapchain_get_device(ptr) @ cdecl wined3d_swapchain_get_display_mode(ptr ptr ptr) -@ cdecl wined3d_swapchain_get_front_buffer_data(ptr ptr) +@ cdecl wined3d_swapchain_get_front_buffer_data(ptr ptr long) @ cdecl wined3d_swapchain_get_gamma_ramp(ptr ptr) @ cdecl wined3d_swapchain_get_parent(ptr) @ cdecl wined3d_swapchain_get_desc(ptr ptr) @@ -262,10 +259,12 @@ @ cdecl wined3d_swapchain_set_window(ptr ptr) @ cdecl wined3d_texture_add_dirty_region(ptr long ptr) +@ cdecl wined3d_texture_blt(ptr long ptr ptr long ptr long ptr long) @ cdecl wined3d_texture_create(ptr ptr long long ptr ptr ptr ptr) @ cdecl wined3d_texture_decref(ptr) @ cdecl wined3d_texture_generate_mipmaps(ptr) @ cdecl wined3d_texture_get_autogen_filter_type(ptr) +@ cdecl wined3d_texture_get_dc(ptr long ptr) @ cdecl wined3d_texture_get_level_count(ptr) @ cdecl wined3d_texture_get_lod(ptr) @ cdecl wined3d_texture_get_parent(ptr) @@ -273,6 +272,7 @@ @ cdecl wined3d_texture_get_sub_resource(ptr long) @ cdecl wined3d_texture_incref(ptr) @ cdecl wined3d_texture_preload(ptr) +@ cdecl wined3d_texture_release_dc(ptr long ptr) @ cdecl wined3d_texture_set_autogen_filter_type(ptr long) @ cdecl wined3d_texture_set_color_key(ptr long ptr) @ cdecl wined3d_texture_set_lod(ptr long) @@ -283,12 +283,3 @@ @ cdecl wined3d_vertex_declaration_decref(ptr) @ cdecl wined3d_vertex_declaration_get_parent(ptr) @ cdecl wined3d_vertex_declaration_incref(ptr) - -@ cdecl wined3d_volume_decref(ptr) -@ cdecl wined3d_volume_from_resource(ptr) -@ cdecl wined3d_volume_get_parent(ptr) -@ cdecl wined3d_volume_get_resource(ptr) -@ cdecl wined3d_volume_incref(ptr) -@ cdecl wined3d_volume_map(ptr ptr ptr long) -@ cdecl wined3d_volume_preload(ptr) -@ cdecl wined3d_volume_unmap(ptr) diff -Nru wine1.7-1.7.50/dlls/winemac.drv/cocoa_app.m wine1.7-1.7.55/dlls/winemac.drv/cocoa_app.m --- wine1.7-1.7.50/dlls/winemac.drv/cocoa_app.m 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winemac.drv/cocoa_app.m 2015-11-13 14:32:40.000000000 +0000 @@ -699,9 +699,9 @@ return TRUE; } - - (CGDisplayModeRef)modeMatchingMode:(CGDisplayModeRef)mode forDisplay:(CGDirectDisplayID)displayID + - (NSArray*)modesMatchingMode:(CGDisplayModeRef)mode forDisplay:(CGDirectDisplayID)displayID { - CGDisplayModeRef ret = NULL; + NSMutableArray* ret = [NSMutableArray array]; NSDictionary* options = nil; #if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8 @@ -715,10 +715,7 @@ { CGDisplayModeRef candidateMode = (CGDisplayModeRef)candidateModeObject; if ([self mode:candidateMode matchesMode:mode]) - { - ret = candidateMode; - break; - } + [ret addObject:candidateModeObject]; } return ret; } @@ -743,11 +740,15 @@ } else // ... otherwise, try to restore just the one display { - mode = [self modeMatchingMode:mode forDisplay:displayID]; - if (mode && CGDisplaySetDisplayMode(displayID, mode, NULL) == CGDisplayNoErr) + for (id modeObject in [self modesMatchingMode:mode forDisplay:displayID]) { - [originalDisplayModes removeObjectForKey:displayIDKey]; - ret = TRUE; + mode = (CGDisplayModeRef)modeObject; + if (CGDisplaySetDisplayMode(displayID, mode, NULL) == CGDisplayNoErr) + { + [originalDisplayModes removeObjectForKey:displayIDKey]; + ret = TRUE; + break; + } } } } @@ -755,6 +756,7 @@ { BOOL active = [NSApp isActive]; CGDisplayModeRef currentMode; + NSArray* modes; currentMode = CGDisplayModeRetain((CGDisplayModeRef)[latentDisplayModes objectForKey:displayIDKey]); if (!currentMode) @@ -771,8 +773,8 @@ CGDisplayModeRelease(currentMode); currentMode = NULL; - mode = [self modeMatchingMode:mode forDisplay:displayID]; - if (!mode) + modes = [self modesMatchingMode:mode forDisplay:displayID]; + if (!modes.count) return FALSE; if ([originalDisplayModes count] || displaysCapturedForFullscreen || @@ -789,7 +791,17 @@ originalMode = currentMode = CGDisplayCopyDisplayMode(displayID); if (originalMode) - ret = (CGDisplaySetDisplayMode(displayID, mode, NULL) == CGDisplayNoErr); + { + for (id modeObject in modes) + { + mode = (CGDisplayModeRef)modeObject; + if (CGDisplaySetDisplayMode(displayID, mode, NULL) == CGDisplayNoErr) + { + ret = TRUE; + break; + } + } + } if (ret && !(currentMode && [self mode:mode matchesMode:currentMode])) [originalDisplayModes setObject:(id)originalMode forKey:displayIDKey]; else if (![originalDisplayModes count]) @@ -1307,20 +1319,27 @@ } else { + // Annoyingly, CGWarpMouseCursorPosition() effectively disassociates + // the mouse from the cursor position for 0.25 seconds. This means + // that mouse movement during that interval doesn't move the cursor + // and events carry a constant location (the warped-to position) + // even though they have delta values. For apps which warp the + // cursor frequently (like after every mouse move), this makes + // cursor movement horribly laggy and jerky, as only a fraction of + // mouse move events have any effect. + // + // On some versions of OS X, it's sufficient to forcibly reassociate + // the mouse and cursor position. On others, it's necessary to set + // the local events suppression interval to 0 for the warp. That's + // deprecated, but I'm not aware of any other way. For good + // measure, we do both. + CGSetLocalEventsSuppressionInterval(0); ret = (CGWarpMouseCursorPosition(pos) == kCGErrorSuccess); + CGSetLocalEventsSuppressionInterval(0.25); if (ret) { lastSetCursorPositionTime = [[NSProcessInfo processInfo] systemUptime]; - // Annoyingly, CGWarpMouseCursorPosition() effectively disassociates - // the mouse from the cursor position for 0.25 seconds. This means - // that mouse movement during that interval doesn't move the cursor - // and events carry a constant location (the warped-to position) - // even though they have delta values. This screws us up because - // the accumulated deltas we send to Wine don't match any eventual - // absolute position we send (like with a button press). We can - // work around this by simply forcibly reassociating the mouse and - // cursor position. CGAssociateMouseAndMouseCursorPosition(true); } } diff -Nru wine1.7-1.7.50/dlls/winemac.drv/cocoa_clipboard.m wine1.7-1.7.55/dlls/winemac.drv/cocoa_clipboard.m --- wine1.7-1.7.50/dlls/winemac.drv/cocoa_clipboard.m 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winemac.drv/cocoa_clipboard.m 2015-11-13 14:32:40.000000000 +0000 @@ -66,12 +66,10 @@ [NSNumber numberWithUnsignedInteger:NSBMPFileType], [NSNumber numberWithUnsignedInteger:NSGIFFileType], [NSNumber numberWithUnsignedInteger:NSJPEGFileType], - [NSNumber numberWithUnsignedInteger:NSJPEG2000FileType], nil]; BitmapOutputTypes = [[NSArray alloc] initWithObjects:@"public.tiff", @"public.png", - @"com.microsoft.bmp", @"com.compuserve.gif", @"public.jpeg", - @"public.jpeg-2000", nil]; + @"com.microsoft.bmp", @"com.compuserve.gif", @"public.jpeg", nil]; BitmapOutputTypeMap = [[NSDictionary alloc] initWithObjects:bitmapFileTypes forKeys:BitmapOutputTypes]; diff -Nru wine1.7-1.7.50/dlls/winemac.drv/cocoa_opengl.m wine1.7-1.7.55/dlls/winemac.drv/cocoa_opengl.m --- wine1.7-1.7.50/dlls/winemac.drv/cocoa_opengl.m 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winemac.drv/cocoa_opengl.m 2015-11-13 14:32:40.000000000 +0000 @@ -109,7 +109,7 @@ glDrawBuffer(GL_FRONT_AND_BACK); glDisable(GL_SCISSOR_TEST); glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - glClearColor(0, 0, 0, 1); + glClearColor(0, 0, 0, gl_surface_mode == GL_SURFACE_IN_FRONT_TRANSPARENT ? 0 : 1); glClear(GL_COLOR_BUFFER_BIT); diff -Nru wine1.7-1.7.50/dlls/winemac.drv/cocoa_window.h wine1.7-1.7.55/dlls/winemac.drv/cocoa_window.h --- wine1.7-1.7.50/dlls/winemac.drv/cocoa_window.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winemac.drv/cocoa_window.h 2015-11-13 14:32:40.000000000 +0000 @@ -43,6 +43,9 @@ void* surface; pthread_mutex_t* surface_mutex; + CGDirectDisplayID _lastDisplayID; + NSTimeInterval _lastDisplayTime; + NSBezierPath* shape; NSData* shapeData; BOOL shapeChangedSinceLastDraw; @@ -54,7 +57,6 @@ NSUInteger lastModifierFlags; - NSTimer* liveResizeDisplayTimer; NSRect frameAtResizeStart; BOOL resizingFromLeft, resizingFromTop; @@ -73,6 +75,8 @@ NSPoint dragStartPosition; NSPoint dragWindowStartPosition; + NSTimeInterval lastDockIconSnapshot; + BOOL ignore_windowDeminiaturize; BOOL ignore_windowResize; BOOL fakingClose; diff -Nru wine1.7-1.7.50/dlls/winemac.drv/cocoa_window.m wine1.7-1.7.55/dlls/winemac.drv/cocoa_window.m --- wine1.7-1.7.50/dlls/winemac.drv/cocoa_window.m 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winemac.drv/cocoa_window.m 2015-11-13 14:32:40.000000000 +0000 @@ -19,6 +19,7 @@ */ #import +#import #import "cocoa_window.h" @@ -150,6 +151,141 @@ } +@interface NSWindow (WineAccessPrivateMethods) + - (id) _displayChanged; +@end + + +@interface WineDisplayLink : NSObject +{ + CGDirectDisplayID _displayID; + CVDisplayLinkRef _link; + NSMutableSet* _windows; + + NSTimeInterval _actualRefreshPeriod; + NSTimeInterval _nominalRefreshPeriod; +} + + - (id) initWithDisplayID:(CGDirectDisplayID)displayID; + + - (void) addWindow:(WineWindow*)window; + - (void) removeWindow:(WineWindow*)window; + + - (NSTimeInterval) refreshPeriod; + + - (void) start; + +@end + +@implementation WineDisplayLink + +static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp* inNow, const CVTimeStamp* inOutputTime, CVOptionFlags flagsIn, CVOptionFlags* flagsOut, void* displayLinkContext); + + - (id) initWithDisplayID:(CGDirectDisplayID)displayID + { + self = [super init]; + if (self) + { + CVReturn status = CVDisplayLinkCreateWithCGDisplay(displayID, &_link); + if (status == kCVReturnSuccess && !_link) + status = kCVReturnError; + if (status == kCVReturnSuccess) + status = CVDisplayLinkSetOutputCallback(_link, WineDisplayLinkCallback, self); + if (status != kCVReturnSuccess) + { + [self release]; + return nil; + } + + _displayID = displayID; + _windows = [[NSMutableSet alloc] init]; + } + return self; + } + + - (void) dealloc + { + if (_link) + { + CVDisplayLinkStop(_link); + CVDisplayLinkRelease(_link); + } + [_windows release]; + [super dealloc]; + } + + - (void) addWindow:(WineWindow*)window + { + @synchronized(self) { + BOOL needsStart = !_windows.count; + [_windows addObject:window]; + if (needsStart) + CVDisplayLinkStart(_link); + } + } + + - (void) removeWindow:(WineWindow*)window + { + @synchronized(self) { + BOOL wasRunning = _windows.count > 0; + [_windows removeObject:window]; + if (wasRunning && !_windows.count) + CVDisplayLinkStop(_link); + } + } + + - (void) fire + { + NSSet* windows; + @synchronized(self) { + windows = [_windows copy]; + } + dispatch_async(dispatch_get_main_queue(), ^{ + BOOL anyDisplayed = FALSE; + for (WineWindow* window in windows) + { + if ([window viewsNeedDisplay]) + { + [window displayIfNeeded]; + anyDisplayed = YES; + } + } + if (!anyDisplayed) + CVDisplayLinkStop(_link); + }); + [windows release]; + } + + - (NSTimeInterval) refreshPeriod + { + if (_actualRefreshPeriod || (_actualRefreshPeriod = CVDisplayLinkGetActualOutputVideoRefreshPeriod(_link))) + return _actualRefreshPeriod; + + if (_nominalRefreshPeriod) + return _nominalRefreshPeriod; + + CVTime time = CVDisplayLinkGetNominalOutputVideoRefreshPeriod(_link); + if (time.flags & kCVTimeIsIndefinite) + return 1.0 / 60.0; + _nominalRefreshPeriod = time.timeValue / (double)time.timeScale; + return _nominalRefreshPeriod; + } + + - (void) start + { + CVDisplayLinkStart(_link); + } + +static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp* inNow, const CVTimeStamp* inOutputTime, CVOptionFlags flagsIn, CVOptionFlags* flagsOut, void* displayLinkContext) +{ + WineDisplayLink* link = displayLinkContext; + [link fire]; + return kCVReturnSuccess; +} + +@end + + @interface WineContentView : NSView { NSMutableArray* glContexts; @@ -193,11 +329,10 @@ @property (assign, nonatomic) void* imeData; @property (nonatomic) BOOL commandDone; -@property (retain, nonatomic) NSTimer* liveResizeDisplayTimer; - @property (readonly, copy, nonatomic) NSArray* childWineWindows; - (void) updateColorSpace; + - (void) updateForGLSubviews; - (BOOL) becameEligibleParentOrChild; - (void) becameIneligibleChild; @@ -334,14 +469,14 @@ [self setNeedsDisplay:YES]; } - [(WineWindow*)[self window] updateColorSpace]; + [(WineWindow*)[self window] updateForGLSubviews]; } - (void) removeGLContext:(WineOpenGLContext*)context { [glContexts removeObjectIdenticalTo:context]; [pendingGlContexts removeObjectIdenticalTo:context]; - [(WineWindow*)[self window] updateColorSpace]; + [(WineWindow*)[self window] updateForGLSubviews]; } - (void) updateGLContexts @@ -553,7 +688,6 @@ @synthesize colorKeyed, colorKeyRed, colorKeyGreen, colorKeyBlue; @synthesize usePerPixelAlpha; @synthesize imeData, commandDone; - @synthesize liveResizeDisplayTimer; + (WineWindow*) createWindowWithFeatures:(const struct macdrv_window_features*)wf windowFrame:(NSRect)window_frame @@ -586,11 +720,13 @@ [window setAcceptsMouseMovedEvents:YES]; [window setColorSpace:[NSColorSpace genericRGBColorSpace]]; [window setDelegate:window]; + [window setAutodisplay:NO]; window.hwnd = hwnd; window.queue = queue; window->savedContentMinSize = NSZeroSize; window->savedContentMaxSize = NSMakeSize(FLT_MAX, FLT_MAX); window->resizable = wf->resizable; + window->_lastDisplayTime = [[NSDate distantPast] timeIntervalSinceReferenceDate]; [window registerForDraggedTypes:[NSArray arrayWithObjects:(NSString*)kUTTypeData, (NSString*)kUTTypeContent, @@ -631,14 +767,17 @@ name:NSApplicationDidUnhideNotification object:NSApp]; + [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:window + selector:@selector(checkWineDisplayLink) + name:NSWorkspaceActiveSpaceDidChangeNotification + object:[NSWorkspace sharedWorkspace]]; + return window; } - (void) dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; - [liveResizeDisplayTimer invalidate]; - [liveResizeDisplayTimer release]; [queue release]; [latentChildWindows release]; [latentParentWindow release]; @@ -939,6 +1078,7 @@ if ([self level] > [child level]) [child setLevel:[self level]]; [self addChildWindow:child ordered:NSWindowAbove]; + [child checkWineDisplayLink]; [latentChildWindows removeObjectIdenticalTo:child]; child.latentParentWindow = nil; reordered = TRUE; @@ -1201,6 +1341,7 @@ if ([self level] != [other level]) [self setLevel:[other level]]; [self orderWindow:orderingMode relativeTo:[other windowNumber]]; + [self checkWineDisplayLink]; // The above call to -[NSWindow orderWindow:relativeTo:] won't // reorder windows which are both children of the same parent @@ -1219,6 +1360,7 @@ if (next && [self level] < [next level]) [self setLevel:[next level]]; [self orderFront:nil]; + [self checkWineDisplayLink]; needAdjustWindowLevels = TRUE; } @@ -1259,6 +1401,10 @@ if ([self isMiniaturized]) pendingMinimize = TRUE; + WineWindow* parent = (WineWindow*)self.parentWindow; + if ([parent isKindOfClass:[WineWindow class]]) + [parent grabDockIconSnapshotFromWindow:self force:NO]; + [self becameIneligibleParentOrChild]; if ([self isMiniaturized]) { @@ -1268,6 +1414,7 @@ } else [self orderOut:nil]; + [self checkWineDisplayLink]; savedVisibleState = FALSE; if (wasVisible && wasOnActiveSpace && fullscreen) [controller updateFullscreenWindows]; @@ -1402,7 +1549,8 @@ - (BOOL) needsTransparency { - return self.shape || self.colorKeyed || self.usePerPixelAlpha; + return self.shape || self.colorKeyed || self.usePerPixelAlpha || + (gl_surface_mode == GL_SURFACE_BEHIND && [[self.contentView valueForKeyPath:@"subviews.@max.hasGLContext"] boolValue]); } - (void) checkTransparency @@ -1441,16 +1589,6 @@ [self checkTransparency]; } - - (void) setLiveResizeDisplayTimer:(NSTimer*)newTimer - { - if (newTimer != liveResizeDisplayTimer) - { - [liveResizeDisplayTimer invalidate]; - [liveResizeDisplayTimer release]; - liveResizeDisplayTimer = [newTimer retain]; - } - } - - (void) makeFocused:(BOOL)activate { if (activate) @@ -1562,6 +1700,180 @@ } } + - (NSMutableDictionary*) displayIDToDisplayLinkMap + { + static NSMutableDictionary* displayIDToDisplayLinkMap; + if (!displayIDToDisplayLinkMap) + { + displayIDToDisplayLinkMap = [[NSMutableDictionary alloc] init]; + + [[NSNotificationCenter defaultCenter] addObserverForName:NSApplicationDidChangeScreenParametersNotification + object:NSApp + queue:nil + usingBlock:^(NSNotification *note){ + NSMutableSet* badDisplayIDs = [NSMutableSet setWithArray:displayIDToDisplayLinkMap.allKeys]; + NSSet* validDisplayIDs = [NSSet setWithArray:[[NSScreen screens] valueForKeyPath:@"deviceDescription.NSScreenNumber"]]; + [badDisplayIDs minusSet:validDisplayIDs]; + [displayIDToDisplayLinkMap removeObjectsForKeys:[badDisplayIDs allObjects]]; + }]; + } + return displayIDToDisplayLinkMap; + } + + - (WineDisplayLink*) wineDisplayLink + { + if (!_lastDisplayID) + return nil; + + NSMutableDictionary* displayIDToDisplayLinkMap = [self displayIDToDisplayLinkMap]; + return [displayIDToDisplayLinkMap objectForKey:[NSNumber numberWithUnsignedInt:_lastDisplayID]]; + } + + - (void) checkWineDisplayLink + { + NSScreen* screen = self.screen; + if (![self isVisible] || ![self isOnActiveSpace] || [self isMiniaturized] || [self isEmptyShaped]) + screen = nil; +#if defined(MAC_OS_X_VERSION_10_9) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 + if ([self respondsToSelector:@selector(occlusionState)] && !(self.occlusionState & NSWindowOcclusionStateVisible)) + screen = nil; +#endif + + NSNumber* displayIDNumber = [screen.deviceDescription objectForKey:@"NSScreenNumber"]; + CGDirectDisplayID displayID = [displayIDNumber unsignedIntValue]; + if (displayID == _lastDisplayID) + return; + + NSMutableDictionary* displayIDToDisplayLinkMap = [self displayIDToDisplayLinkMap]; + + if (_lastDisplayID) + { + WineDisplayLink* link = [displayIDToDisplayLinkMap objectForKey:[NSNumber numberWithUnsignedInt:_lastDisplayID]]; + [link removeWindow:self]; + } + if (displayID) + { + WineDisplayLink* link = [displayIDToDisplayLinkMap objectForKey:displayIDNumber]; + if (!link) + { + link = [[[WineDisplayLink alloc] initWithDisplayID:displayID] autorelease]; + [displayIDToDisplayLinkMap setObject:link forKey:displayIDNumber]; + } + [link addWindow:self]; + [self displayIfNeeded]; + } + _lastDisplayID = displayID; + } + + - (BOOL) isEmptyShaped + { + return (self.shapeData.length == sizeof(CGRectZero) && !memcmp(self.shapeData.bytes, &CGRectZero, sizeof(CGRectZero))); + } + + - (BOOL) canProvideSnapshot + { + return (self.windowNumber > 0 && ![self isEmptyShaped]); + } + + - (void) grabDockIconSnapshotFromWindow:(WineWindow*)window force:(BOOL)force + { + if (![self isEmptyShaped]) + return; + + NSTimeInterval now = [[NSProcessInfo processInfo] systemUptime]; + if (!force && now < lastDockIconSnapshot + 1) + return; + + if (window) + { + if (![window canProvideSnapshot]) + return; + } + else + { + CGFloat bestArea; + for (WineWindow* childWindow in self.childWindows) + { + if (![childWindow isKindOfClass:[WineWindow class]] || ![childWindow canProvideSnapshot]) + continue; + + NSSize size = childWindow.frame.size; + CGFloat area = size.width * size.height; + if (!window || area > bestArea) + { + window = childWindow; + bestArea = area; + } + } + + if (!window) + return; + } + + const void* windowID = (const void*)(CGWindowID)window.windowNumber; + CFArrayRef windowIDs = CFArrayCreate(NULL, &windowID, 1, NULL); + CGImageRef windowImage = CGWindowListCreateImageFromArray(CGRectNull, windowIDs, kCGWindowImageBoundsIgnoreFraming); + CFRelease(windowIDs); + if (!windowImage) + return; + + NSImage* appImage = [NSApp applicationIconImage]; + if (!appImage) + appImage = [NSImage imageNamed:NSImageNameApplicationIcon]; + + NSImage* dockIcon = [[[NSImage alloc] initWithSize:NSMakeSize(256, 256)] autorelease]; + [dockIcon lockFocus]; + + CGContextRef cgcontext = [[NSGraphicsContext currentContext] graphicsPort]; + + CGRect rect = CGRectMake(8, 8, 240, 240); + size_t width = CGImageGetWidth(windowImage); + size_t height = CGImageGetHeight(windowImage); + if (width > height) + { + rect.size.height *= height / (double)width; + rect.origin.y += (CGRectGetWidth(rect) - CGRectGetHeight(rect)) / 2; + } + else if (width != height) + { + rect.size.width *= width / (double)height; + rect.origin.x += (CGRectGetHeight(rect) - CGRectGetWidth(rect)) / 2; + } + + CGContextDrawImage(cgcontext, rect, windowImage); + [appImage drawInRect:NSMakeRect(156, 4, 96, 96) + fromRect:NSZeroRect + operation:NSCompositeSourceOver + fraction:1 + respectFlipped:YES + hints:nil]; + + [dockIcon unlockFocus]; + + CGImageRelease(windowImage); + + NSImageView* imageView = (NSImageView*)self.dockTile.contentView; + if (![imageView isKindOfClass:[NSImageView class]]) + { + imageView = [[[NSImageView alloc] initWithFrame:NSMakeRect(0, 0, 256, 256)] autorelease]; + imageView.imageScaling = NSImageScaleProportionallyUpOrDown; + self.dockTile.contentView = imageView; + } + imageView.image = dockIcon; + [self.dockTile display]; + lastDockIconSnapshot = now; + } + + - (void) checkEmptyShaped + { + if (self.dockTile.contentView && ![self isEmptyShaped]) + { + self.dockTile.contentView = nil; + lastDockIconSnapshot = 0; + } + [self checkWineDisplayLink]; + } + /* * ---------- NSWindow method overrides ---------- @@ -1591,6 +1903,38 @@ return frameRect; } + // This private method of NSWindow is called as Cocoa reacts to the display + // configuration changing. Among other things, it adjusts the window's + // frame based on how the screen(s) changed size. That tells Wine that the + // window has been moved. We don't want that. Rather, we want to make + // sure that the WinAPI notion of the window position is maintained/ + // restored, possibly undoing or overriding Cocoa's adjustment. + // + // So, we queue a REASSERT_WINDOW_POSITION event to the back end before + // Cocoa has a chance to adjust the frame, thus preceding any resulting + // WINDOW_FRAME_CHANGED event that may get queued. The back end will + // reassert its notion of the position. That call won't get processed + // until after this method returns, so it will override whatever this + // method does to the window position. It will also discard any pending + // WINDOW_FRAME_CHANGED events. + // + // Unfortunately, the only way I've found to know when Cocoa is _about to_ + // adjust the window's position due to a display change is to hook into + // this private method. This private method has remained stable from 10.6 + // through 10.11. If it does change, the most likely thing is that it + // will be removed and no longer called and this fix will simply stop + // working. The only real danger would be if Apple changed the return type + // to a struct or floating-point type, which would change the calling + // convention. + - (id) _displayChanged + { + macdrv_event* event = macdrv_create_event(REASSERT_WINDOW_POSITION, self); + [queue postEvent:event]; + macdrv_release_event(event); + + return [super _displayChanged]; + } + - (BOOL) isExcludedFromWindowsMenu { return !([self collectionBehavior] & NSWindowCollectionBehaviorParticipatesInCycle); @@ -1727,6 +2071,10 @@ macdrv_event* event = macdrv_create_event(WINDOW_MINIMIZE_REQUESTED, self); [queue postEvent:event]; macdrv_release_event(event); + + WineWindow* parent = (WineWindow*)self.parentWindow; + if ([parent isKindOfClass:[WineWindow class]]) + [parent grabDockIconSnapshotFromWindow:self force:YES]; } - (void) toggleFullScreen:(id)sender @@ -1735,6 +2083,40 @@ [super toggleFullScreen:sender]; } + - (void) setViewsNeedDisplay:(BOOL)value + { + if (value && ![self viewsNeedDisplay]) + { + WineDisplayLink* link = [self wineDisplayLink]; + if (link) + { + NSTimeInterval now = [[NSProcessInfo processInfo] systemUptime]; + if (_lastDisplayTime + [link refreshPeriod] < now) + [self setAutodisplay:YES]; + else + { + [link start]; + _lastDisplayTime = now; + } + } + } + [super setViewsNeedDisplay:value]; + } + + - (void) display + { + _lastDisplayTime = [[NSProcessInfo processInfo] systemUptime]; + [super display]; + [self setAutodisplay:NO]; + } + + - (void) displayIfNeeded + { + _lastDisplayTime = [[NSProcessInfo processInfo] systemUptime]; + [super displayIfNeeded]; + [self setAutodisplay:NO]; + } + - (NSArray*) childWineWindows { NSArray* childWindows = self.childWindows; @@ -1775,6 +2157,13 @@ [self setColorSpace:[NSColorSpace genericRGBColorSpace]]; } + - (void) updateForGLSubviews + { + [self updateColorSpace]; + if (gl_surface_mode == GL_SURFACE_BEHIND) + [self checkTransparency]; + } + /* * ---------- NSResponder method overrides ---------- @@ -1889,6 +2278,16 @@ [controller windowGotFocus:self]; } + - (void) windowDidChangeOcclusionState:(NSNotification*)notification + { + [self checkWineDisplayLink]; + } + + - (void) windowDidChangeScreen:(NSNotification*)notification + { + [self checkWineDisplayLink]; + } + - (void)windowDidDeminiaturize:(NSNotification *)notification { WineApplicationController* controller = [WineApplicationController sharedController]; @@ -1915,6 +2314,7 @@ } [self windowDidResize:notification]; + [self checkWineDisplayLink]; } - (void) windowDidEndLiveResize:(NSNotification *)notification @@ -1925,8 +2325,6 @@ [queue postEvent:event]; macdrv_release_event(event); } - - self.liveResizeDisplayTimer = nil; } - (void) windowDidEnterFullScreen:(NSNotification*)notification @@ -1958,6 +2356,7 @@ { if (fullscreen && [self isOnActiveSpace]) [[WineApplicationController sharedController] updateFullscreenWindows]; + [self checkWineDisplayLink]; } - (void)windowDidMove:(NSNotification *)notification @@ -2077,6 +2476,7 @@ - (void)windowWillMiniaturize:(NSNotification *)notification { [self becameIneligibleParentOrChild]; + [self grabDockIconSnapshotFromWindow:nil force:NO]; } - (NSSize) windowWillResize:(NSWindow*)sender toSize:(NSSize)frameSize @@ -2140,29 +2540,6 @@ frameAtResizeStart = [self frame]; resizingFromLeft = resizingFromTop = FALSE; - - // There's a strange restriction in window redrawing during Cocoa- - // managed window resizing. Only calls to -[NSView setNeedsDisplay...] - // that happen synchronously when Cocoa tells us that our window size - // has changed or asynchronously in a short interval thereafter provoke - // the window to redraw. Calls to those methods that happen asynchronously - // a half second or more after the last change of the window size aren't - // heeded until the next resize-related user event (e.g. mouse movement). - // - // Wine often has a significant delay between when it's been told that - // the window has changed size and when it can flush completed drawing. - // So, our windows would get stuck with incomplete drawing for as long - // as the user holds the mouse button down and doesn't move it. - // - // We address this by "manually" asking our windows to check if they need - // redrawing every so often (during live resize only). - self.liveResizeDisplayTimer = [NSTimer scheduledTimerWithTimeInterval:1.0/30.0 - target:self - selector:@selector(displayIfNeeded) - userInfo:nil - repeats:YES]; - [[NSRunLoop currentRunLoop] addTimer:liveResizeDisplayTimer - forMode:NSRunLoopCommonModes]; } - (NSRect) windowWillUseStandardFrame:(NSWindow*)window defaultFrame:(NSRect)proposedFrame @@ -2538,6 +2915,7 @@ { window.shape = nil; window.shapeData = nil; + [window checkEmptyShaped]; } else { @@ -2552,6 +2930,7 @@ [path appendBezierPathWithRect:NSRectFromCGRect(rects[i])]; window.shape = path; window.shapeData = [NSData dataWithBytes:rects length:length]; + [window checkEmptyShaped]; } } }); @@ -2683,7 +3062,7 @@ name:NSApplicationDidChangeScreenParametersNotification object:NSApp]; [[window contentView] addSubview:view]; - [window updateColorSpace]; + [window updateForGLSubviews]; }); [pool release]; @@ -2712,7 +3091,7 @@ object:NSApp]; [view removeFromSuperview]; [view release]; - [window updateColorSpace]; + [window updateForGLSubviews]; }); [pool release]; @@ -2737,15 +3116,15 @@ BOOL changedWindow = (window && window != [view window]); NSRect newFrame = NSRectFromCGRect(rect); NSRect oldFrame = [view frame]; - BOOL needUpdateWindowColorSpace = FALSE; + BOOL needUpdateWindowForGLSubviews = FALSE; if (changedWindow) { WineWindow* oldWindow = (WineWindow*)[view window]; [view removeFromSuperview]; - [oldWindow updateColorSpace]; + [oldWindow updateForGLSubviews]; [[window contentView] addSubview:view]; - needUpdateWindowColorSpace = TRUE; + needUpdateWindowForGLSubviews = TRUE; } if (!NSEqualRects(oldFrame, newFrame)) @@ -2759,11 +3138,11 @@ else [view setFrame:newFrame]; [view setNeedsDisplay:YES]; - needUpdateWindowColorSpace = TRUE; + needUpdateWindowForGLSubviews = TRUE; } - if (needUpdateWindowColorSpace) - [(WineWindow*)[view window] updateColorSpace]; + if (needUpdateWindowForGLSubviews) + [(WineWindow*)[view window] updateForGLSubviews]; }); [pool release]; diff -Nru wine1.7-1.7.50/dlls/winemac.drv/display.c wine1.7-1.7.55/dlls/winemac.drv/display.c --- wine1.7-1.7.50/dlls/winemac.drv/display.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winemac.drv/display.c 2015-11-13 14:32:40.000000000 +0000 @@ -25,13 +25,30 @@ #include "winuser.h" #include "winreg.h" #include "ddrawi.h" +#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(display); +struct display_mode_descriptor +{ + DWORD width; + DWORD height; + DWORD pixel_width; + DWORD pixel_height; + DWORD io_flags; + double refresh; + CFStringRef pixel_encoding; +}; + + BOOL CDECL macdrv_EnumDisplaySettingsEx(LPCWSTR devname, DWORD mode, LPDEVMODEW devmode, DWORD flags); +static const char initial_mode_key[] = "Initial Display Mode"; +static const WCHAR pixelencodingW[] = {'P','i','x','e','l','E','n','c','o','d','i','n','g',0}; + + static CFArrayRef modes; static BOOL modes_has_8bpp, modes_has_16bpp; static int default_mode_bpp; @@ -44,6 +61,8 @@ }; static CRITICAL_SECTION modes_section = { &critsect_debug, -1, 0, 0, 0, 0 }; +static BOOL inited_original_display_mode; + static inline HMONITOR display_id_to_monitor(CGDirectDisplayID display_id) { @@ -157,6 +176,253 @@ } +static BOOL write_display_settings(HKEY parent_hkey, CGDirectDisplayID displayID) +{ + BOOL ret = FALSE; + char display_key_name[19]; + HKEY display_hkey; + CGDisplayModeRef display_mode; + DWORD val; + CFStringRef pixel_encoding; + size_t len; + WCHAR* buf = NULL; + + snprintf(display_key_name, sizeof(display_key_name), "Display 0x%08x", displayID); + /* @@ Wine registry key: HKLM\Software\Wine\Mac Driver\Initial Display Mode\Display 0xnnnnnnnn */ + if (RegCreateKeyExA(parent_hkey, display_key_name, 0, NULL, + REG_OPTION_VOLATILE, KEY_WRITE, NULL, &display_hkey, NULL)) + return FALSE; + + display_mode = CGDisplayCopyDisplayMode(displayID); + if (!display_mode) + goto fail; + + val = CGDisplayModeGetWidth(display_mode); + if (RegSetValueExA(display_hkey, "Width", 0, REG_DWORD, (const BYTE*)&val, sizeof(val))) + goto fail; + val = CGDisplayModeGetHeight(display_mode); + if (RegSetValueExA(display_hkey, "Height", 0, REG_DWORD, (const BYTE*)&val, sizeof(val))) + goto fail; + val = CGDisplayModeGetRefreshRate(display_mode) * 100; + if (RegSetValueExA(display_hkey, "RefreshRateTimes100", 0, REG_DWORD, (const BYTE*)&val, sizeof(val))) + goto fail; + val = CGDisplayModeGetIOFlags(display_mode); + if (RegSetValueExA(display_hkey, "IOFlags", 0, REG_DWORD, (const BYTE*)&val, sizeof(val))) + goto fail; + +#if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8 + if (CGDisplayModeGetPixelWidth != NULL && CGDisplayModeGetPixelHeight != NULL) + { + val = CGDisplayModeGetPixelWidth(display_mode); + if (RegSetValueExA(display_hkey, "PixelWidth", 0, REG_DWORD, (const BYTE*)&val, sizeof(val))) + goto fail; + val = CGDisplayModeGetPixelHeight(display_mode); + if (RegSetValueExA(display_hkey, "PixelHeight", 0, REG_DWORD, (const BYTE*)&val, sizeof(val))) + goto fail; + } +#endif + + pixel_encoding = CGDisplayModeCopyPixelEncoding(display_mode); + len = CFStringGetLength(pixel_encoding); + buf = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR)); + CFStringGetCharacters(pixel_encoding, CFRangeMake(0, len), (UniChar*)buf); + buf[len] = 0; + CFRelease(pixel_encoding); + if (RegSetValueExW(display_hkey, pixelencodingW, 0, REG_SZ, (const BYTE*)buf, (len + 1) * sizeof(WCHAR))) + goto fail; + + ret = TRUE; + +fail: + HeapFree(GetProcessHeap(), 0, buf); + if (display_mode) CGDisplayModeRelease(display_mode); + RegCloseKey(display_hkey); + if (!ret) + RegDeleteKeyA(parent_hkey, display_key_name); + return ret; +} + + +static void init_original_display_mode(void) +{ + BOOL success = FALSE; + HKEY mac_driver_hkey, parent_hkey; + DWORD disposition; + struct macdrv_display *displays = NULL; + int num_displays, i; + + if (inited_original_display_mode) + return; + + /* @@ Wine registry key: HKLM\Software\Wine\Mac Driver */ + if (RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\Mac Driver", 0, NULL, + 0, KEY_ALL_ACCESS, NULL, &mac_driver_hkey, NULL)) + return; + + /* @@ Wine registry key: HKLM\Software\Wine\Mac Driver\Initial Display Mode */ + if (RegCreateKeyExA(mac_driver_hkey, initial_mode_key, 0, NULL, + REG_OPTION_VOLATILE, KEY_WRITE, NULL, &parent_hkey, &disposition)) + { + parent_hkey = NULL; + goto fail; + } + + /* If we didn't create a new key, then it already existed. Something already stored + the initial display mode since Wine was started. We don't want to overwrite it. */ + if (disposition != REG_CREATED_NEW_KEY) + goto done; + + if (macdrv_get_displays(&displays, &num_displays)) + goto fail; + + for (i = 0; i < num_displays; i++) + { + if (!write_display_settings(parent_hkey, displays[i].displayID)) + goto fail; + } + +done: + success = TRUE; + +fail: + macdrv_free_displays(displays); + RegCloseKey(parent_hkey); + if (!success && parent_hkey) + RegDeleteTreeA(mac_driver_hkey, initial_mode_key); + RegCloseKey(mac_driver_hkey); + if (success) + inited_original_display_mode = TRUE; +} + + +static BOOL read_dword(HKEY hkey, const char* name, DWORD* val) +{ + DWORD type, size = sizeof(*val); + if (RegQueryValueExA(hkey, name, 0, &type, (BYTE*)val, &size) || type != REG_DWORD || size != sizeof(*val)) + return FALSE; + return TRUE; +} + + +static void free_display_mode_descriptor(struct display_mode_descriptor* desc) +{ + if (desc) + { + if (desc->pixel_encoding) + CFRelease(desc->pixel_encoding); + HeapFree(GetProcessHeap(), 0, desc); + } +} + + +static struct display_mode_descriptor* create_original_display_mode_descriptor(CGDirectDisplayID displayID) +{ + static const char display_key_format[] = "Software\\Wine\\Mac Driver\\Initial Display Mode\\Display 0x%08x"; + struct display_mode_descriptor* ret = NULL; + struct display_mode_descriptor* desc; + char display_key[sizeof(display_key_format) + 10]; + HKEY hkey; + DWORD type, size; + DWORD refresh100; + WCHAR* pixel_encoding = NULL, *end; + + init_original_display_mode(); + + snprintf(display_key, sizeof(display_key), display_key_format, displayID); + /* @@ Wine registry key: HKLM\Software\Wine\Mac Driver\Initial Display Mode\Display 0xnnnnnnnn */ + if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, display_key, 0, KEY_READ, &hkey)) + return NULL; + + desc = HeapAlloc(GetProcessHeap(), 0, sizeof(*desc)); + desc->pixel_encoding = NULL; + + if (!read_dword(hkey, "Width", &desc->width) || + !read_dword(hkey, "Height", &desc->height) || + !read_dword(hkey, "RefreshRateTimes100", &refresh100) || + !read_dword(hkey, "IOFlags", &desc->io_flags)) + goto done; + if (refresh100) + desc->refresh = refresh100 / 100.0; + else + desc->refresh = 60; + + if (!read_dword(hkey, "PixelWidth", &desc->pixel_width) || + !read_dword(hkey, "PixelHeight", &desc->pixel_height)) + { + desc->pixel_width = desc->width; + desc->pixel_height = desc->height; + } + + size = 0; + if (RegQueryValueExW(hkey, pixelencodingW, 0, &type, NULL, &size) || type != REG_SZ) + goto done; + pixel_encoding = HeapAlloc(GetProcessHeap(), 0, size * sizeof(WCHAR)); + if (RegQueryValueExW(hkey, pixelencodingW, 0, &type, (BYTE*)pixel_encoding, &size) || type != REG_SZ) + goto done; + if ((end = memchrW(pixel_encoding, 0, size))) + size = end - pixel_encoding; + desc->pixel_encoding = CFStringCreateWithCharacters(NULL, (const UniChar*)pixel_encoding, size); + + ret = desc; + +done: + if (!ret) + free_display_mode_descriptor(desc); + HeapFree(GetProcessHeap(), 0, pixel_encoding); + RegCloseKey(hkey); + return ret; +} + + +static BOOL display_mode_matches_descriptor(CGDisplayModeRef mode, const struct display_mode_descriptor* desc) +{ + DWORD mode_io_flags; + double mode_refresh; + CFStringRef mode_pixel_encoding; + + if (!desc) + return FALSE; + + if (CGDisplayModeGetWidth(mode) != desc->width || + CGDisplayModeGetHeight(mode) != desc->height) + return FALSE; + + mode_io_flags = CGDisplayModeGetIOFlags(mode); + if ((desc->io_flags ^ mode_io_flags) & (kDisplayModeValidFlag | kDisplayModeSafeFlag | kDisplayModeStretchedFlag | + kDisplayModeInterlacedFlag | kDisplayModeTelevisionFlag)) + return FALSE; + + mode_refresh = CGDisplayModeGetRefreshRate(mode); + if (!mode_refresh) + mode_refresh = 60; + if (fabs(desc->refresh - mode_refresh) > 0.1) + return FALSE; + +#if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8 + if (CGDisplayModeGetPixelWidth != NULL && CGDisplayModeGetPixelHeight != NULL) + { + if (CGDisplayModeGetPixelWidth(mode) != desc->pixel_width || + CGDisplayModeGetPixelHeight(mode) != desc->pixel_height) + return FALSE; + } + else +#endif + if (CGDisplayModeGetWidth(mode) != desc->pixel_width || + CGDisplayModeGetHeight(mode) != desc->pixel_height) + return FALSE; + + mode_pixel_encoding = CGDisplayModeCopyPixelEncoding(mode); + if (!CFEqual(mode_pixel_encoding, desc->pixel_encoding)) + { + CFRelease(mode_pixel_encoding); + return FALSE; + } + CFRelease(mode_pixel_encoding); + + return TRUE; +} + + static int display_mode_bits_per_pixel(CGDisplayModeRef display_mode) { CFStringRef pixel_encoding; @@ -291,6 +557,7 @@ CGDisplayModeGetPixelWidth != NULL && CGDisplayModeGetPixelHeight != NULL) { CFDictionaryRef options; + struct display_mode_descriptor* desc; CFMutableDictionaryRef modes_by_size; CFIndex i, count; CGDisplayModeRef* mode_array; @@ -305,70 +572,73 @@ if (!modes) return NULL; + desc = create_original_display_mode_descriptor(display); + modes_by_size = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); count = CFArrayGetCount(modes); for (i = 0; i < count; i++) { BOOL better = TRUE; CGDisplayModeRef new_mode = (CGDisplayModeRef)CFArrayGetValueAtIndex(modes, i); - uint32_t new_flags = CGDisplayModeGetIOFlags(new_mode); - CFStringRef pixel_encoding; - size_t width_points; - size_t height_points; - CFDictionaryRef key; - CGDisplayModeRef old_mode; + BOOL new_is_original = display_mode_matches_descriptor(new_mode, desc); + CFDictionaryRef key = create_mode_dict(new_mode); - if (!(new_flags & kDisplayModeDefaultFlag) && (pixel_encoding = CGDisplayModeCopyPixelEncoding(new_mode))) + /* If a given mode is the user's default, then always list it in preference to any similar + modes that may exist. */ + if (new_is_original) + better = TRUE; + else { - BOOL bpp30 = CFEqual(pixel_encoding, CFSTR(kIO30BitDirectPixels)); - CFRelease(pixel_encoding); - if (bpp30) + CFStringRef pixel_encoding = CGDisplayModeCopyPixelEncoding(new_mode); + CGDisplayModeRef old_mode; + + if (pixel_encoding) { - /* This is an odd pixel encoding. It seems it's only returned - when using kCGDisplayShowDuplicateLowResolutionModes. It's - 32bpp in terms of the actual raster layout, but it's 10 - bits per component. I think that no Windows program is - likely to need it and they will probably be confused by it. - Skip it. */ - continue; + BOOL bpp30 = CFEqual(pixel_encoding, CFSTR(kIO30BitDirectPixels)); + CFRelease(pixel_encoding); + if (bpp30) + { + /* This is an odd pixel encoding. It seems it's only returned + when using kCGDisplayShowDuplicateLowResolutionModes. It's + 32bpp in terms of the actual raster layout, but it's 10 + bits per component. I think that no Windows program is + likely to need it and they will probably be confused by it. + Skip it. */ + CFRelease(key); + continue; + } } - } - width_points = CGDisplayModeGetWidth(new_mode); - height_points = CGDisplayModeGetHeight(new_mode); - key = create_mode_dict(new_mode); - old_mode = (CGDisplayModeRef)CFDictionaryGetValue(modes_by_size, key); - - if (old_mode) - { - uint32_t old_flags = CGDisplayModeGetIOFlags(old_mode); - - /* If a given mode is the user's default, then always list it in preference to any similar - modes that may exist. */ - if ((new_flags & kDisplayModeDefaultFlag) && !(old_flags & kDisplayModeDefaultFlag)) - better = TRUE; - else if (!(new_flags & kDisplayModeDefaultFlag) && (old_flags & kDisplayModeDefaultFlag)) - better = FALSE; - else + old_mode = (CGDisplayModeRef)CFDictionaryGetValue(modes_by_size, key); + if (old_mode) { - /* Otherwise, prefer a mode whose pixel size equals its point size over one which - is scaled. */ - size_t new_width_pixels = CGDisplayModeGetPixelWidth(new_mode); - size_t new_height_pixels = CGDisplayModeGetPixelHeight(new_mode); - size_t old_width_pixels = CGDisplayModeGetPixelWidth(old_mode); - size_t old_height_pixels = CGDisplayModeGetPixelHeight(old_mode); - BOOL new_size_same = (new_width_pixels == width_points && new_height_pixels == height_points); - BOOL old_size_same = (old_width_pixels == width_points && old_height_pixels == height_points); - - if (new_size_same && !old_size_same) - better = TRUE; - else if (!new_size_same && old_size_same) + BOOL old_is_original = display_mode_matches_descriptor(old_mode, desc); + + if (old_is_original) better = FALSE; else { - /* Otherwise, prefer the mode with the smaller pixel size. */ - if (old_width_pixels < new_width_pixels || old_height_pixels < new_height_pixels) + /* Otherwise, prefer a mode whose pixel size equals its point size over one which + is scaled. */ + size_t width_points = CGDisplayModeGetWidth(new_mode); + size_t height_points = CGDisplayModeGetHeight(new_mode); + size_t new_width_pixels = CGDisplayModeGetPixelWidth(new_mode); + size_t new_height_pixels = CGDisplayModeGetPixelHeight(new_mode); + size_t old_width_pixels = CGDisplayModeGetPixelWidth(old_mode); + size_t old_height_pixels = CGDisplayModeGetPixelHeight(old_mode); + BOOL new_size_same = (new_width_pixels == width_points && new_height_pixels == height_points); + BOOL old_size_same = (old_width_pixels == width_points && old_height_pixels == height_points); + + if (new_size_same && !old_size_same) + better = TRUE; + else if (!new_size_same && old_size_same) better = FALSE; + else + { + /* Otherwise, prefer the mode with the smaller pixel size. */ + if (old_width_pixels < new_width_pixels || old_height_pixels < new_height_pixels) + better = FALSE; + } } } } @@ -379,6 +649,7 @@ CFRelease(key); } + free_display_mode_descriptor(desc); CFRelease(modes); count = CFDictionaryGetCount(modes_by_size); @@ -416,6 +687,8 @@ TRACE("%s %p %p 0x%08x %p\n", debugstr_w(devname), devmode, hwnd, flags, lpvoid); + init_original_display_mode(); + if (devmode) { /* this is the minimal dmSize that XP accepts */ @@ -676,6 +949,8 @@ TRACE("%s, %u, %p + %hu, %08x\n", debugstr_w(devname), mode, devmode, devmode->dmSize, flags); + init_original_display_mode(); + memcpy(devmode->dmDeviceName, dev_name, sizeof(dev_name)); devmode->dmSpecVersion = DM_SPECVERSION; devmode->dmDriverVersion = DM_SPECVERSION; diff -Nru wine1.7-1.7.50/dlls/winemac.drv/event.c wine1.7-1.7.55/dlls/winemac.drv/event.c --- wine1.7-1.7.50/dlls/winemac.drv/event.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winemac.drv/event.c 2015-11-13 14:32:40.000000000 +0000 @@ -45,6 +45,7 @@ "MOUSE_MOVED_ABSOLUTE", "MOUSE_SCROLL", "QUERY_EVENT", + "REASSERT_WINDOW_POSITION", "RELEASE_CAPTURE", "STATUS_ITEM_MOUSE_BUTTON", "STATUS_ITEM_MOUSE_MOVE", @@ -115,6 +116,7 @@ if (mask & QS_SENDMESSAGE) { event_mask |= event_mask_for_type(QUERY_EVENT); + event_mask |= event_mask_for_type(REASSERT_WINDOW_POSITION); event_mask |= event_mask_for_type(RELEASE_CAPTURE); event_mask |= event_mask_for_type(WINDOW_BROUGHT_FORWARD); event_mask |= event_mask_for_type(WINDOW_CLOSE_REQUESTED); @@ -237,6 +239,9 @@ case QUERY_EVENT: macdrv_query_event(hwnd, event); break; + case REASSERT_WINDOW_POSITION: + macdrv_reassert_window_position(hwnd); + break; case RELEASE_CAPTURE: macdrv_release_capture(hwnd, event); break; diff -Nru wine1.7-1.7.50/dlls/winemac.drv/gdi.c wine1.7-1.7.55/dlls/winemac.drv/gdi.c --- wine1.7-1.7.50/dlls/winemac.drv/gdi.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winemac.drv/gdi.c 2015-11-13 14:32:40.000000000 +0000 @@ -444,7 +444,6 @@ NULL, /* pFontIsLinked */ NULL, /* pFrameRgn */ NULL, /* pGdiComment */ - NULL, /* pGdiRealizationInfo */ NULL, /* pGetBoundsRect */ NULL, /* pGetCharABCWidths */ NULL, /* pGetCharABCWidthsI */ @@ -452,6 +451,7 @@ macdrv_GetDeviceCaps, /* pGetDeviceCaps */ macdrv_GetDeviceGammaRamp, /* pGetDeviceGammaRamp */ NULL, /* pGetFontData */ + NULL, /* pGetFontRealizationInfo */ NULL, /* pGetFontUnicodeRanges */ NULL, /* pGetGlyphIndices */ NULL, /* pGetGlyphOutline */ diff -Nru wine1.7-1.7.50/dlls/winemac.drv/macdrv_cocoa.h wine1.7-1.7.55/dlls/winemac.drv/macdrv_cocoa.h --- wine1.7-1.7.50/dlls/winemac.drv/macdrv_cocoa.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winemac.drv/macdrv_cocoa.h 2015-11-13 14:32:40.000000000 +0000 @@ -118,6 +118,12 @@ }; enum { + GL_SURFACE_IN_FRONT_OPAQUE, + GL_SURFACE_IN_FRONT_TRANSPARENT, + GL_SURFACE_BEHIND, +}; + +enum { MACDRV_HOTKEY_SUCCESS, MACDRV_HOTKEY_ALREADY_REGISTERED, MACDRV_HOTKEY_FAILURE, @@ -149,6 +155,7 @@ extern int allow_immovable_windows DECLSPEC_HIDDEN; extern int cursor_clipping_locks_windows DECLSPEC_HIDDEN; extern int use_precise_scrolling DECLSPEC_HIDDEN; +extern int gl_surface_mode DECLSPEC_HIDDEN; extern int macdrv_start_cocoa_app(unsigned long long tickcount) DECLSPEC_HIDDEN; extern void macdrv_window_rejected_focus(const struct macdrv_event *event) DECLSPEC_HIDDEN; @@ -188,6 +195,7 @@ MOUSE_MOVED_ABSOLUTE, MOUSE_SCROLL, QUERY_EVENT, + REASSERT_WINDOW_POSITION, RELEASE_CAPTURE, STATUS_ITEM_MOUSE_BUTTON, STATUS_ITEM_MOUSE_MOVE, diff -Nru wine1.7-1.7.50/dlls/winemac.drv/macdrv.h wine1.7-1.7.55/dlls/winemac.drv/macdrv.h --- wine1.7-1.7.50/dlls/winemac.drv/macdrv.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winemac.drv/macdrv.h 2015-11-13 14:32:40.000000000 +0000 @@ -175,6 +175,7 @@ extern void macdrv_window_restore_requested(HWND hwnd, const macdrv_event *event) DECLSPEC_HIDDEN; extern void macdrv_window_drag_begin(HWND hwnd) DECLSPEC_HIDDEN; extern void macdrv_window_drag_end(HWND hwnd) DECLSPEC_HIDDEN; +extern void macdrv_reassert_window_position(HWND hwnd) DECLSPEC_HIDDEN; extern BOOL query_resize_size(HWND hwnd, macdrv_query *query) DECLSPEC_HIDDEN; extern BOOL query_resize_start(HWND hwnd) DECLSPEC_HIDDEN; extern BOOL query_min_max_info(HWND hwnd) DECLSPEC_HIDDEN; diff -Nru wine1.7-1.7.50/dlls/winemac.drv/macdrv_main.c wine1.7-1.7.55/dlls/winemac.drv/macdrv_main.c --- wine1.7-1.7.50/dlls/winemac.drv/macdrv_main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winemac.drv/macdrv_main.c 2015-11-13 14:32:40.000000000 +0000 @@ -57,6 +57,7 @@ int allow_immovable_windows = TRUE; int cursor_clipping_locks_windows = TRUE; int use_precise_scrolling = TRUE; +int gl_surface_mode = GL_SURFACE_IN_FRONT_OPAQUE; HMODULE macdrv_module = 0; @@ -183,6 +184,16 @@ if (!get_config_key(hkey, appkey, "UsePreciseScrolling", buffer, sizeof(buffer))) use_precise_scrolling = IS_OPTION_TRUE(buffer[0]); + if (!get_config_key(hkey, appkey, "OpenGLSurfaceMode", buffer, sizeof(buffer))) + { + if (!strcmp(buffer, "transparent")) + gl_surface_mode = GL_SURFACE_IN_FRONT_TRANSPARENT; + else if (!strcmp(buffer, "behind")) + gl_surface_mode = GL_SURFACE_BEHIND; + else + gl_surface_mode = GL_SURFACE_IN_FRONT_OPAQUE; + } + if (appkey) RegCloseKey(appkey); if (hkey) RegCloseKey(hkey); } diff -Nru wine1.7-1.7.50/dlls/winemac.drv/Makefile.in wine1.7-1.7.55/dlls/winemac.drv/Makefile.in --- wine1.7-1.7.50/dlls/winemac.drv/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winemac.drv/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -1,7 +1,7 @@ MODULE = winemac.drv IMPORTS = uuid user32 gdi32 advapi32 DELAYIMPORTS = ole32 shell32 imm32 -EXTRALIBS = -framework AppKit -framework Carbon -framework Security -framework OpenGL -framework IOKit +EXTRALIBS = -framework AppKit -framework Carbon -framework Security -framework OpenGL -framework IOKit -framework CoreVideo C_SRCS = \ clipboard.c \ diff -Nru wine1.7-1.7.50/dlls/winemac.drv/opengl.c wine1.7-1.7.55/dlls/winemac.drv/opengl.c --- wine1.7-1.7.50/dlls/winemac.drv/opengl.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winemac.drv/opengl.c 2015-11-13 14:32:40.000000000 +0000 @@ -1480,6 +1480,21 @@ return FALSE; } + if (gl_surface_mode == GL_SURFACE_IN_FRONT_TRANSPARENT) + { + GLint opacity = 0; + err = CGLSetParameter(context->cglcontext, kCGLCPSurfaceOpacity, &opacity); + if (err != kCGLNoError) + WARN("CGLSetParameter(kCGLCPSurfaceOpacity) failed with error %d %s; leaving opaque\n", err, CGLErrorString(err)); + } + else if (gl_surface_mode == GL_SURFACE_BEHIND) + { + GLint order = -1; + err = CGLSetParameter(context->cglcontext, kCGLCPSurfaceOrder, &order); + if (err != kCGLNoError) + WARN("CGLSetParameter(kCGLCPSurfaceOrder) failed with error %d %s; leaving in front\n", err, CGLErrorString(err)); + } + context->context = macdrv_create_opengl_context(context->cglcontext); CGLReleaseContext(context->cglcontext); if (!context->context) @@ -1638,7 +1653,7 @@ done: release_win_data(data); - if (ret) __wine_set_pixel_format(hwnd, fmt); + if (ret && gl_surface_mode == GL_SURFACE_BEHIND) __wine_set_pixel_format(hwnd, fmt); return ret; } diff -Nru wine1.7-1.7.50/dlls/winemac.drv/window.c wine1.7-1.7.55/dlls/winemac.drv/window.c --- wine1.7-1.7.50/dlls/winemac.drv/window.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winemac.drv/window.c 2015-11-13 14:32:40.000000000 +0000 @@ -1682,12 +1682,7 @@ macdrv_reset_device_metrics(); return 0; case WM_MACDRV_DISPLAYCHANGE: - if ((data = get_win_data(hwnd))) - { - if (data->cocoa_window && data->on_screen) - sync_window_position(data, SWP_NOZORDER | SWP_NOACTIVATE, NULL, NULL); - release_win_data(data); - } + macdrv_reassert_window_position(hwnd); SendMessageW(hwnd, WM_DISPLAYCHANGE, wp, lp); return 0; case WM_MACDRV_ACTIVATE_ON_FOLLOWING_FOCUS: @@ -2243,6 +2238,23 @@ } } + +/*********************************************************************** + * macdrv_reassert_window_position + * + * Handler for REASSERT_WINDOW_POSITION events. + */ +void macdrv_reassert_window_position(HWND hwnd) +{ + struct macdrv_win_data *data = get_win_data(hwnd); + if (data) + { + if (data->cocoa_window && data->on_screen) + sync_window_position(data, SWP_NOZORDER | SWP_NOACTIVATE, NULL, NULL); + release_win_data(data); + } +} + struct quit_info { HWND *wins; diff -Nru wine1.7-1.7.50/dlls/wineps.drv/download.c wine1.7-1.7.55/dlls/wineps.drv/download.c --- wine1.7-1.7.50/dlls/wineps.drv/download.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wineps.drv/download.c 2015-11-13 14:32:40.000000000 +0000 @@ -30,6 +30,8 @@ #include "winnls.h" #include "psdrv.h" +#include "data/agl.h" + #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(psdrv); @@ -359,11 +361,385 @@ return TRUE; } +static void get_standard_glyph_name(WORD index, char *name) +{ + static const GLYPHNAME nonbreakingspace = { -1, "nonbreakingspace" }; + static const GLYPHNAME nonmarkingreturn = { -1, "nonmarkingreturn" }; + static const GLYPHNAME notdef = { -1, ".notdef" }; + static const GLYPHNAME null = { -1, ".null" }; + /* These PostScript Format 1 glyph names are stored by glyph index, do not reorder them. */ + static const GLYPHNAME *glyph_table[] = { + ¬def, + &null, + &nonmarkingreturn, + GN_space, + GN_exclam, + GN_quotedbl, + GN_numbersign, + GN_dollar, + GN_percent, + GN_ampersand, + GN_quotesingle, + GN_parenleft, + GN_parenright, + GN_asterisk, + GN_plus, + GN_comma, + GN_hyphen, + GN_period, + GN_slash, + GN_zero, + GN_one, + GN_two, + GN_three, + GN_four, + GN_five, + GN_six, + GN_seven, + GN_eight, + GN_nine, + GN_colon, + GN_semicolon, + GN_less, + GN_equal, + GN_greater, + GN_question, + GN_at, + GN_A, + GN_B, + GN_C, + GN_D, + GN_E, + GN_F, + GN_G, + GN_H, + GN_I, + GN_J, + GN_K, + GN_L, + GN_M, + GN_N, + GN_O, + GN_P, + GN_Q, + GN_R, + GN_S, + GN_T, + GN_U, + GN_V, + GN_W, + GN_X, + GN_Y, + GN_Z, + GN_bracketleft, + GN_backslash, + GN_bracketright, + GN_asciicircum, + GN_underscore, + GN_grave, + GN_a, + GN_b, + GN_c, + GN_d, + GN_e, + GN_f, + GN_g, + GN_h, + GN_i, + GN_j, + GN_k, + GN_l, + GN_m, + GN_n, + GN_o, + GN_p, + GN_q, + GN_r, + GN_s, + GN_t, + GN_u, + GN_v, + GN_w, + GN_x, + GN_y, + GN_z, + GN_braceleft, + GN_bar, + GN_braceright, + GN_asciitilde, + GN_Adieresis, + GN_Aring, + GN_Ccedilla, + GN_Eacute, + GN_Ntilde, + GN_Odieresis, + GN_Udieresis, + GN_aacute, + GN_agrave, + GN_acircumflex, + GN_adieresis, + GN_atilde, + GN_aring, + GN_ccedilla, + GN_eacute, + GN_egrave, + GN_ecircumflex, + GN_edieresis, + GN_iacute, + GN_igrave, + GN_icircumflex, + GN_idieresis, + GN_ntilde, + GN_oacute, + GN_ograve, + GN_ocircumflex, + GN_odieresis, + GN_otilde, + GN_uacute, + GN_ugrave, + GN_ucircumflex, + GN_udieresis, + GN_dagger, + GN_degree, + GN_cent, + GN_sterling, + GN_section, + GN_bullet, + GN_paragraph, + GN_germandbls, + GN_registered, + GN_copyright, + GN_trademark, + GN_acute, + GN_dieresis, + GN_notequal, + GN_AE, + GN_Oslash, + GN_infinity, + GN_plusminus, + GN_lessequal, + GN_greaterequal, + GN_yen, + GN_mu, + GN_partialdiff, + GN_summation, + GN_product, + GN_pi, + GN_integral, + GN_ordfeminine, + GN_ordmasculine, + GN_Omega, + GN_ae, + GN_oslash, + GN_questiondown, + GN_exclamdown, + GN_logicalnot, + GN_radical, + GN_florin, + GN_approxequal, + GN_Delta, + GN_guillemotleft, + GN_guillemotright, + GN_ellipsis, + &nonbreakingspace, + GN_Agrave, + GN_Atilde, + GN_Otilde, + GN_OE, + GN_oe, + GN_endash, + GN_emdash, + GN_quotedblleft, + GN_quotedblright, + GN_quoteleft, + GN_quoteright, + GN_divide, + GN_lozenge, + GN_ydieresis, + GN_Ydieresis, + GN_fraction, + GN_currency, + GN_guilsinglleft, + GN_guilsinglright, + GN_fi, + GN_fl, + GN_daggerdbl, + GN_periodcentered, + GN_quotesinglbase, + GN_quotedblbase, + GN_perthousand, + GN_Acircumflex, + GN_Ecircumflex, + GN_Aacute, + GN_Edieresis, + GN_Egrave, + GN_Iacute, + GN_Icircumflex, + GN_Idieresis, + GN_Igrave, + GN_Oacute, + GN_Ocircumflex, + GN_apple, + GN_Ograve, + GN_Uacute, + GN_Ucircumflex, + GN_Ugrave, + GN_dotlessi, + GN_circumflex, + GN_tilde, + GN_macron, + GN_breve, + GN_dotaccent, + GN_ring, + GN_cedilla, + GN_hungarumlaut, + GN_ogonek, + GN_caron, + GN_Lslash, + GN_lslash, + GN_Scaron, + GN_scaron, + GN_Zcaron, + GN_zcaron, + GN_brokenbar, + GN_Eth, + GN_eth, + GN_Yacute, + GN_yacute, + GN_Thorn, + GN_thorn, + GN_minus, + GN_multiply, + GN_onesuperior, + GN_twosuperior, + GN_threesuperior, + GN_onehalf, + GN_onequarter, + GN_threequarters, + GN_franc, + GN_Gbreve, + GN_gbreve, + GN_Idotaccent, + GN_Scedilla, + GN_scedilla, + GN_Cacute, + GN_cacute, + GN_Ccaron, + GN_ccaron, + GN_dcroat + }; + snprintf(name, MAX_G_NAME + 1, "%s", glyph_table[index]->sz); +} + +static int get_post2_name_index(BYTE *post2header, DWORD size, WORD index) +{ + USHORT numberOfGlyphs = GET_BE_WORD(post2header); + DWORD offset = (1 + index) * sizeof(USHORT); + + if(offset + sizeof(USHORT) > size || index >= numberOfGlyphs) + { + FIXME("Index '%d' exceeds PostScript Format 2 table size (%d)\n", index, numberOfGlyphs); + return -1; + } + return GET_BE_WORD(post2header + offset); +} + +static void get_post2_custom_glyph_name(BYTE *post2header, DWORD size, WORD index, char *name) +{ + USHORT numberOfGlyphs = GET_BE_WORD(post2header); + int i, name_offset = (1 + numberOfGlyphs) * sizeof(USHORT); + BYTE name_length = 0; + + for(i = 0; i <= index; i++) + { + name_offset += name_length; + if(name_offset + sizeof(BYTE) > size) + { + FIXME("Pascal name offset '%d' exceeds PostScript Format 2 table size (%d)\n", + name_offset + 1, size); + return; + } + name_length = (post2header + name_offset)[0]; + if(name_offset + name_length > size) + { + FIXME("Pascal name offset '%d' exceeds PostScript Format 2 table size (%d)\n", + name_offset + name_length, size); + return; + } + name_offset += sizeof(BYTE); + } + name_length = min(name_length, MAX_G_NAME); + memcpy(name, post2header + name_offset, name_length); + name[name_length] = 0; +} + void get_glyph_name(HDC hdc, WORD index, char *name) { - /* FIXME */ - sprintf(name, "g%04x", index); - return; + struct + { + DWORD format; + DWORD italicAngle; + SHORT underlinePosition; + SHORT underlineThickness; + DWORD isFixedPitch; + DWORD minMemType42; + DWORD maxMemType42; + DWORD minMemType1; + DWORD maxMemType1; + } *post_header; + BYTE *post = NULL; + DWORD size; + + /* set a fallback name that is just 'g' */ + snprintf(name, MAX_G_NAME + 1, "g%04x", index); + + /* attempt to obtain the glyph name from the 'post' table */ + size = GetFontData(hdc, MS_MAKE_TAG('p','o','s','t'), 0, NULL, 0); + if(size < sizeof(*post_header) || size == GDI_ERROR) + return; + post = HeapAlloc(GetProcessHeap(), 0, size); + if(!post) + return; + size = GetFontData(hdc, MS_MAKE_TAG('p','o','s','t'), 0, post, size); + if(size < sizeof(*post_header) || size == GDI_ERROR) + goto cleanup; + post_header = (typeof(post_header))(post); + /* note: only interested in the format for obtaining glyph names */ + post_header->format = GET_BE_DWORD(&post_header->format); + + /* now that we know the format of the 'post' table we can get the glyph name */ + if(post_header->format == MAKELONG(0, 1)) + { + if(index < 258) + get_standard_glyph_name(index, name); + else + WARN("Font uses PostScript Format 1, but non-standard glyph (%d) requested.\n", index); + } + else if(post_header->format == MAKELONG(0, 2)) + { + BYTE *post2header = post + sizeof(*post_header); + int glyphNameIndex; + + size -= sizeof(*post_header); + if(size < sizeof(USHORT)) + { + FIXME("PostScript Format 2 table is invalid (cannot fit header)\n"); + goto cleanup; + } + glyphNameIndex = get_post2_name_index(post2header, size, index); + if(glyphNameIndex == -1) + goto cleanup; /* invalid index, use fallback name */ + else if(glyphNameIndex < 258) + get_standard_glyph_name(glyphNameIndex, name); + else + get_post2_custom_glyph_name(post2header, size, glyphNameIndex - 258, name); + } + else + FIXME("PostScript Format %d.%d glyph names are currently unsupported.\n", + HIWORD(post_header->format), LOWORD(post_header->format)); + +cleanup: + HeapFree(GetProcessHeap(), 0, post); } /**************************************************************************** diff -Nru wine1.7-1.7.50/dlls/wineps.drv/init.c wine1.7-1.7.55/dlls/wineps.drv/init.c --- wine1.7-1.7.50/dlls/wineps.drv/init.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wineps.drv/init.c 2015-11-13 14:32:40.000000000 +0000 @@ -856,7 +856,6 @@ NULL, /* pFontIsLinked */ NULL, /* pFrameRgn */ NULL, /* pGdiComment */ - NULL, /* pGdiRealizationInfo */ NULL, /* pGetBoundsRect */ NULL, /* pGetCharABCWidths */ NULL, /* pGetCharABCWidthsI */ @@ -864,6 +863,7 @@ PSDRV_GetDeviceCaps, /* pGetDeviceCaps */ NULL, /* pGetDeviceGammaRamp */ NULL, /* pGetFontData */ + NULL, /* pGetFontRealizationInfo */ NULL, /* pGetFontUnicodeRanges */ NULL, /* pGetGlyphIndices */ NULL, /* pGetGlyphOutline */ diff -Nru wine1.7-1.7.50/dlls/wineps.drv/ps.c wine1.7-1.7.55/dlls/wineps.drv/ps.c --- wine1.7-1.7.50/dlls/wineps.drv/ps.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wineps.drv/ps.c 2015-11-13 14:32:40.000000000 +0000 @@ -48,6 +48,8 @@ cups_two_sided_long, /* DMDUP_VERTICAL */ cups_two_sided_short /* DMDUP_HORIZONTAL */ }; +static const char cups_collate_false[] = "%cupsJobTicket: collate=false\n"; +static const char cups_collate_true[] = "%cupsJobTicket: collate=true\n"; static const char psheader[] = /* title llx lly urx ury orientation */ "%%%%Creator: Wine PostScript Driver\n" @@ -331,6 +333,7 @@ static void write_cups_job_ticket( PHYSDEV dev, const struct ticket_info *info ) { + PSDRV_PDEVICE *physDev = get_psdrv_dev( dev ); char buf[256]; int len; @@ -356,6 +359,22 @@ write_spool( dev, str, strlen( str ) ); } } + + if (physDev->Devmode->dmPublic.u1.s1.dmCopies > 1) + { + len = snprintf( buf, sizeof(buf), "%%cupsJobTicket: copies=%d\n", + physDev->Devmode->dmPublic.u1.s1.dmCopies ); + if (len > 0 && len < sizeof(buf)) + write_spool( dev, buf, len ); + + if (physDev->Devmode->dmPublic.dmFields & DM_COLLATE) + { + if (physDev->Devmode->dmPublic.dmCollate == DMCOLLATE_FALSE) + write_spool( dev, cups_collate_false, sizeof(cups_collate_false) - 1 ); + else if (physDev->Devmode->dmPublic.dmCollate == DMCOLLATE_TRUE) + write_spool( dev, cups_collate_true, sizeof(cups_collate_true) - 1 ); + } + } } INT PSDRV_WriteHeader( PHYSDEV dev, LPCWSTR title ) @@ -414,12 +433,6 @@ write_spool( dev, psendprolog, strlen(psendprolog) ); write_spool( dev, psbeginsetup, strlen(psbeginsetup) ); - if(physDev->Devmode->dmPublic.u1.s1.dmCopies > 1) { - char copies_buf[100]; - sprintf(copies_buf, "mark {\n << /NumCopies %d >> setpagedevice\n} stopped cleartomark\n", physDev->Devmode->dmPublic.u1.s1.dmCopies); - write_spool(dev, copies_buf, strlen(copies_buf)); - } - if (slot && slot->InvocationString) PSDRV_WriteFeature( dev, "*InputSlot", slot->Name, slot->InvocationString ); diff -Nru wine1.7-1.7.50/dlls/winepulse.drv/Makefile.in wine1.7-1.7.55/dlls/winepulse.drv/Makefile.in --- wine1.7-1.7.50/dlls/winepulse.drv/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/winepulse.drv/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,7 @@ +MODULE = winepulse.drv +IMPORTS = dxguid uuid winmm user32 advapi32 ole32 +EXTRALIBS = $(PULSE_LIBS) $(PTHREAD_LIBS) +EXTRAINCL = $(PULSE_CFLAGS) + +C_SRCS = \ + mmdevdrv.c diff -Nru wine1.7-1.7.50/dlls/winepulse.drv/mmdevdrv.c wine1.7-1.7.55/dlls/winepulse.drv/mmdevdrv.c --- wine1.7-1.7.50/dlls/winepulse.drv/mmdevdrv.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/winepulse.drv/mmdevdrv.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,3245 @@ +/* + * Copyright 2011-2012 Maarten Lankhorst + * Copyright 2010-2011 Maarten Lankhorst for CodeWeavers + * Copyright 2011 Andrew Eikum for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define NONAMELESSUNION +#define COBJMACROS +#define _GNU_SOURCE + +#include "config.h" +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include "windef.h" +#include "winbase.h" +#include "winnls.h" +#include "winreg.h" +#include "wine/debug.h" +#include "wine/unicode.h" +#include "wine/list.h" + +#include "ole2.h" +#include "dshow.h" +#include "dsound.h" +#include "propsys.h" + +#include "initguid.h" +#include "ks.h" +#include "ksmedia.h" +#include "propkey.h" +#include "mmdeviceapi.h" +#include "audioclient.h" +#include "endpointvolume.h" +#include "audiopolicy.h" + +WINE_DEFAULT_DEBUG_CHANNEL(pulse); + +#define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER) + +/* From */ +enum DriverPriority { + Priority_Unavailable = 0, + Priority_Low, + Priority_Neutral, + Priority_Preferred +}; + +static const REFERENCE_TIME MinimumPeriod = 30000; +static const REFERENCE_TIME DefaultPeriod = 100000; + +static pa_context *pulse_ctx; +static pa_mainloop *pulse_ml; + +static HANDLE pulse_thread; +static pthread_mutex_t pulse_lock; +static pthread_cond_t pulse_cond = PTHREAD_COND_INITIALIZER; +static struct list g_sessions = LIST_INIT(g_sessions); + +static UINT g_phys_speakers_mask = 0; + +/* Mixer format + period times */ +static WAVEFORMATEXTENSIBLE pulse_fmt[2]; +static REFERENCE_TIME pulse_min_period[2], pulse_def_period[2]; + +static GUID pulse_render_guid = +{ 0xfd47d9cc, 0x4218, 0x4135, { 0x9c, 0xe2, 0x0c, 0x19, 0x5c, 0x87, 0x40, 0x5b } }; +static GUID pulse_capture_guid = +{ 0x25da76d0, 0x033c, 0x4235, { 0x90, 0x02, 0x19, 0xf4, 0x88, 0x94, 0xac, 0x6f } }; + +BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved) +{ + if (reason == DLL_PROCESS_ATTACH) { + pthread_mutexattr_t attr; + + DisableThreadLibraryCalls(dll); + + pthread_mutexattr_init(&attr); + pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT); + + if (pthread_mutex_init(&pulse_lock, &attr) != 0) + pthread_mutex_init(&pulse_lock, NULL); + } else if (reason == DLL_PROCESS_DETACH) { + if (pulse_thread) + SetThreadPriority(pulse_thread, 0); + if (pulse_ctx) { + pa_context_disconnect(pulse_ctx); + pa_context_unref(pulse_ctx); + } + if (pulse_ml) + pa_mainloop_quit(pulse_ml, 0); + if (pulse_thread) { + WaitForSingleObject(pulse_thread, INFINITE); + CloseHandle(pulse_thread); + } + } + return TRUE; +} + +typedef struct ACImpl ACImpl; + +typedef struct _AudioSession { + GUID guid; + struct list clients; + + IMMDevice *device; + + float master_vol; + UINT32 channel_count; + float *channel_vols; + BOOL mute; + + struct list entry; +} AudioSession; + +typedef struct _AudioSessionWrapper { + IAudioSessionControl2 IAudioSessionControl2_iface; + IChannelAudioVolume IChannelAudioVolume_iface; + ISimpleAudioVolume ISimpleAudioVolume_iface; + + LONG ref; + + ACImpl *client; + AudioSession *session; +} AudioSessionWrapper; + +typedef struct _ACPacket { + struct list entry; + UINT64 qpcpos; + BYTE *data; + UINT32 discont; +} ACPacket; + +struct ACImpl { + IAudioClient IAudioClient_iface; + IAudioRenderClient IAudioRenderClient_iface; + IAudioCaptureClient IAudioCaptureClient_iface; + IAudioClock IAudioClock_iface; + IAudioClock2 IAudioClock2_iface; + IAudioStreamVolume IAudioStreamVolume_iface; + IUnknown *marshal; + IMMDevice *parent; + struct list entry; + float vol[PA_CHANNELS_MAX]; + + LONG ref; + EDataFlow dataflow; + DWORD flags; + AUDCLNT_SHAREMODE share; + HANDLE event; + + UINT32 bufsize_frames, bufsize_bytes, locked, capture_period, pad, started, peek_ofs; + void *locked_ptr, *tmp_buffer; + + pa_stream *stream; + pa_sample_spec ss; + pa_channel_map map; + + INT64 clock_lastpos, clock_written; + + AudioSession *session; + AudioSessionWrapper *session_wrapper; + struct list packet_free_head; + struct list packet_filled_head; +}; + +static const WCHAR defaultW[] = {'P','u','l','s','e','a','u','d','i','o',0}; + +static const IAudioClientVtbl AudioClient_Vtbl; +static const IAudioRenderClientVtbl AudioRenderClient_Vtbl; +static const IAudioCaptureClientVtbl AudioCaptureClient_Vtbl; +static const IAudioSessionControl2Vtbl AudioSessionControl2_Vtbl; +static const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl; +static const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl; +static const IAudioClockVtbl AudioClock_Vtbl; +static const IAudioClock2Vtbl AudioClock2_Vtbl; +static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl; + +static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client); + +static inline ACImpl *impl_from_IAudioClient(IAudioClient *iface) +{ + return CONTAINING_RECORD(iface, ACImpl, IAudioClient_iface); +} + +static inline ACImpl *impl_from_IAudioRenderClient(IAudioRenderClient *iface) +{ + return CONTAINING_RECORD(iface, ACImpl, IAudioRenderClient_iface); +} + +static inline ACImpl *impl_from_IAudioCaptureClient(IAudioCaptureClient *iface) +{ + return CONTAINING_RECORD(iface, ACImpl, IAudioCaptureClient_iface); +} + +static inline AudioSessionWrapper *impl_from_IAudioSessionControl2(IAudioSessionControl2 *iface) +{ + return CONTAINING_RECORD(iface, AudioSessionWrapper, IAudioSessionControl2_iface); +} + +static inline AudioSessionWrapper *impl_from_ISimpleAudioVolume(ISimpleAudioVolume *iface) +{ + return CONTAINING_RECORD(iface, AudioSessionWrapper, ISimpleAudioVolume_iface); +} + +static inline AudioSessionWrapper *impl_from_IChannelAudioVolume(IChannelAudioVolume *iface) +{ + return CONTAINING_RECORD(iface, AudioSessionWrapper, IChannelAudioVolume_iface); +} + +static inline ACImpl *impl_from_IAudioClock(IAudioClock *iface) +{ + return CONTAINING_RECORD(iface, ACImpl, IAudioClock_iface); +} + +static inline ACImpl *impl_from_IAudioClock2(IAudioClock2 *iface) +{ + return CONTAINING_RECORD(iface, ACImpl, IAudioClock2_iface); +} + +static inline ACImpl *impl_from_IAudioStreamVolume(IAudioStreamVolume *iface) +{ + return CONTAINING_RECORD(iface, ACImpl, IAudioStreamVolume_iface); +} + +/* Following pulseaudio design here, mainloop has the lock taken whenever + * it is handling something for pulse, and the lock is required whenever + * doing any pa_* call that can affect the state in any way + * + * pa_cond_wait is used when waiting on results, because the mainloop needs + * the same lock taken to affect the state + * + * This is basically the same as the pa_threaded_mainloop implementation, + * but that cannot be used because it uses pthread_create directly + * + * pa_threaded_mainloop_(un)lock -> pthread_mutex_(un)lock + * pa_threaded_mainloop_signal -> pthread_cond_signal + * pa_threaded_mainloop_wait -> pthread_cond_wait + */ + +static int pulse_poll_func(struct pollfd *ufds, unsigned long nfds, int timeout, void *userdata) { + int r; + pthread_mutex_unlock(&pulse_lock); + r = poll(ufds, nfds, timeout); + pthread_mutex_lock(&pulse_lock); + return r; +} + +static DWORD CALLBACK pulse_mainloop_thread(void *tmp) { + int ret; + pulse_ml = pa_mainloop_new(); + pa_mainloop_set_poll_func(pulse_ml, pulse_poll_func, NULL); + pthread_mutex_lock(&pulse_lock); + pthread_cond_signal(&pulse_cond); + pa_mainloop_run(pulse_ml, &ret); + pthread_mutex_unlock(&pulse_lock); + pa_mainloop_free(pulse_ml); + return ret; +} + +static void pulse_contextcallback(pa_context *c, void *userdata) +{ + switch (pa_context_get_state(c)) { + default: + FIXME("Unhandled state: %i\n", pa_context_get_state(c)); + case PA_CONTEXT_CONNECTING: + case PA_CONTEXT_UNCONNECTED: + case PA_CONTEXT_AUTHORIZING: + case PA_CONTEXT_SETTING_NAME: + case PA_CONTEXT_TERMINATED: + TRACE("State change to %i\n", pa_context_get_state(c)); + return; + + case PA_CONTEXT_READY: + TRACE("Ready\n"); + break; + + case PA_CONTEXT_FAILED: + ERR("Context failed: %s\n", pa_strerror(pa_context_errno(c))); + break; + } + pthread_cond_signal(&pulse_cond); +} + +static void pulse_stream_state(pa_stream *s, void *user) +{ + pa_stream_state_t state = pa_stream_get_state(s); + TRACE("Stream state changed to %i\n", state); + pthread_cond_signal(&pulse_cond); +} + +static const enum pa_channel_position pulse_pos_from_wfx[] = { + PA_CHANNEL_POSITION_FRONT_LEFT, + PA_CHANNEL_POSITION_FRONT_RIGHT, + PA_CHANNEL_POSITION_FRONT_CENTER, + PA_CHANNEL_POSITION_LFE, + PA_CHANNEL_POSITION_REAR_LEFT, + PA_CHANNEL_POSITION_REAR_RIGHT, + PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER, + PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER, + PA_CHANNEL_POSITION_REAR_CENTER, + PA_CHANNEL_POSITION_SIDE_LEFT, + PA_CHANNEL_POSITION_SIDE_RIGHT, + PA_CHANNEL_POSITION_TOP_CENTER, + PA_CHANNEL_POSITION_TOP_FRONT_LEFT, + PA_CHANNEL_POSITION_TOP_FRONT_CENTER, + PA_CHANNEL_POSITION_TOP_FRONT_RIGHT, + PA_CHANNEL_POSITION_TOP_REAR_LEFT, + PA_CHANNEL_POSITION_TOP_REAR_CENTER, + PA_CHANNEL_POSITION_TOP_REAR_RIGHT +}; + +static DWORD pulse_channel_map_to_channel_mask(const pa_channel_map *map) { + int i; + DWORD mask = 0; + + for (i = 0; i < map->channels; ++i) + switch (map->map[i]) { + default: FIXME("Unhandled channel %s\n", pa_channel_position_to_string(map->map[i])); break; + case PA_CHANNEL_POSITION_FRONT_LEFT: mask |= SPEAKER_FRONT_LEFT; break; + case PA_CHANNEL_POSITION_MONO: + case PA_CHANNEL_POSITION_FRONT_CENTER: mask |= SPEAKER_FRONT_CENTER; break; + case PA_CHANNEL_POSITION_FRONT_RIGHT: mask |= SPEAKER_FRONT_RIGHT; break; + case PA_CHANNEL_POSITION_REAR_LEFT: mask |= SPEAKER_BACK_LEFT; break; + case PA_CHANNEL_POSITION_REAR_CENTER: mask |= SPEAKER_BACK_CENTER; break; + case PA_CHANNEL_POSITION_REAR_RIGHT: mask |= SPEAKER_BACK_RIGHT; break; + case PA_CHANNEL_POSITION_LFE: mask |= SPEAKER_LOW_FREQUENCY; break; + case PA_CHANNEL_POSITION_SIDE_LEFT: mask |= SPEAKER_SIDE_LEFT; break; + case PA_CHANNEL_POSITION_SIDE_RIGHT: mask |= SPEAKER_SIDE_RIGHT; break; + case PA_CHANNEL_POSITION_TOP_CENTER: mask |= SPEAKER_TOP_CENTER; break; + case PA_CHANNEL_POSITION_TOP_FRONT_LEFT: mask |= SPEAKER_TOP_FRONT_LEFT; break; + case PA_CHANNEL_POSITION_TOP_FRONT_CENTER: mask |= SPEAKER_TOP_FRONT_CENTER; break; + case PA_CHANNEL_POSITION_TOP_FRONT_RIGHT: mask |= SPEAKER_TOP_FRONT_RIGHT; break; + case PA_CHANNEL_POSITION_TOP_REAR_LEFT: mask |= SPEAKER_TOP_BACK_LEFT; break; + case PA_CHANNEL_POSITION_TOP_REAR_CENTER: mask |= SPEAKER_TOP_BACK_CENTER; break; + case PA_CHANNEL_POSITION_TOP_REAR_RIGHT: mask |= SPEAKER_TOP_BACK_RIGHT; break; + case PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER: mask |= SPEAKER_FRONT_LEFT_OF_CENTER; break; + case PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER: mask |= SPEAKER_FRONT_RIGHT_OF_CENTER; break; + } + + return mask; +} + +static void pulse_probe_settings(int render, WAVEFORMATEXTENSIBLE *fmt) { + WAVEFORMATEX *wfx = &fmt->Format; + pa_stream *stream; + pa_channel_map map; + pa_sample_spec ss; + pa_buffer_attr attr; + int ret; + unsigned int length = 0; + + pa_channel_map_init_auto(&map, 2, PA_CHANNEL_MAP_ALSA); + ss.rate = 48000; + ss.format = PA_SAMPLE_FLOAT32LE; + ss.channels = map.channels; + + attr.maxlength = -1; + attr.tlength = -1; + attr.minreq = attr.fragsize = pa_frame_size(&ss); + attr.prebuf = 0; + + stream = pa_stream_new(pulse_ctx, "format test stream", &ss, &map); + if (stream) + pa_stream_set_state_callback(stream, pulse_stream_state, NULL); + if (!stream) + ret = -1; + else if (render) + ret = pa_stream_connect_playback(stream, NULL, &attr, + PA_STREAM_START_CORKED|PA_STREAM_FIX_RATE|PA_STREAM_FIX_CHANNELS|PA_STREAM_EARLY_REQUESTS, NULL, NULL); + else + ret = pa_stream_connect_record(stream, NULL, &attr, PA_STREAM_START_CORKED|PA_STREAM_FIX_RATE|PA_STREAM_FIX_CHANNELS|PA_STREAM_EARLY_REQUESTS); + if (ret >= 0) { + while (pa_mainloop_iterate(pulse_ml, 1, &ret) >= 0 && + pa_stream_get_state(stream) == PA_STREAM_CREATING) + {} + if (pa_stream_get_state(stream) == PA_STREAM_READY) { + ss = *pa_stream_get_sample_spec(stream); + map = *pa_stream_get_channel_map(stream); + if (render) + length = pa_stream_get_buffer_attr(stream)->minreq; + else + length = pa_stream_get_buffer_attr(stream)->fragsize; + pa_stream_disconnect(stream); + while (pa_mainloop_iterate(pulse_ml, 1, &ret) >= 0 && + pa_stream_get_state(stream) == PA_STREAM_READY) + {} + } + } + if (stream) + pa_stream_unref(stream); + if (length) + pulse_def_period[!render] = pulse_min_period[!render] = pa_bytes_to_usec(10 * length, &ss); + else + pulse_min_period[!render] = MinimumPeriod; + if (pulse_def_period[!render] <= DefaultPeriod) + pulse_def_period[!render] = DefaultPeriod; + + wfx->wFormatTag = WAVE_FORMAT_EXTENSIBLE; + wfx->cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX); + wfx->nChannels = ss.channels; + wfx->wBitsPerSample = 8 * pa_sample_size_of_format(ss.format); + wfx->nSamplesPerSec = ss.rate; + wfx->nBlockAlign = pa_frame_size(&ss); + wfx->nAvgBytesPerSec = wfx->nSamplesPerSec * wfx->nBlockAlign; + if (ss.format != PA_SAMPLE_S24_32LE) + fmt->Samples.wValidBitsPerSample = wfx->wBitsPerSample; + else + fmt->Samples.wValidBitsPerSample = 24; + if (ss.format == PA_SAMPLE_FLOAT32LE) + fmt->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; + else + fmt->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; + + fmt->dwChannelMask = pulse_channel_map_to_channel_mask(&map); +} + +static HRESULT pulse_connect(void) +{ + int len; + WCHAR path[PATH_MAX], *name; + char *str; + + if (!pulse_thread) + { + if (!(pulse_thread = CreateThread(NULL, 0, pulse_mainloop_thread, NULL, 0, NULL))) + { + ERR("Failed to create mainloop thread.\n"); + return E_FAIL; + } + SetThreadPriority(pulse_thread, THREAD_PRIORITY_TIME_CRITICAL); + pthread_cond_wait(&pulse_cond, &pulse_lock); + } + + if (pulse_ctx && PA_CONTEXT_IS_GOOD(pa_context_get_state(pulse_ctx))) + return S_OK; + if (pulse_ctx) + pa_context_unref(pulse_ctx); + + GetModuleFileNameW(NULL, path, sizeof(path)/sizeof(*path)); + name = strrchrW(path, '\\'); + if (!name) + name = path; + else + name++; + len = WideCharToMultiByte(CP_UNIXCP, 0, name, -1, NULL, 0, NULL, NULL); + str = pa_xmalloc(len); + WideCharToMultiByte(CP_UNIXCP, 0, name, -1, str, len, NULL, NULL); + TRACE("Name: %s\n", str); + pulse_ctx = pa_context_new(pa_mainloop_get_api(pulse_ml), str); + pa_xfree(str); + if (!pulse_ctx) { + ERR("Failed to create context\n"); + return E_FAIL; + } + + pa_context_set_state_callback(pulse_ctx, pulse_contextcallback, NULL); + + TRACE("libpulse protocol version: %u. API Version %u\n", pa_context_get_protocol_version(pulse_ctx), PA_API_VERSION); + if (pa_context_connect(pulse_ctx, NULL, 0, NULL) < 0) + goto fail; + + /* Wait for connection */ + while (pthread_cond_wait(&pulse_cond, &pulse_lock)) { + pa_context_state_t state = pa_context_get_state(pulse_ctx); + + if (state == PA_CONTEXT_FAILED || state == PA_CONTEXT_TERMINATED) + goto fail; + + if (state == PA_CONTEXT_READY) + break; + } + + TRACE("Connected to server %s with protocol version: %i.\n", + pa_context_get_server(pulse_ctx), + pa_context_get_server_protocol_version(pulse_ctx)); + return S_OK; + +fail: + pa_context_unref(pulse_ctx); + pulse_ctx = NULL; + return E_FAIL; +} + +/* For default Pulseaudio render device, OR together all of the + * PKEY_AudioEndpoint_PhysicalSpeakers values of the sinks. */ +static void pulse_phys_speakers_cb(pa_context *c, const pa_sink_info *i, int eol, void *userdata) +{ + if (i) + g_phys_speakers_mask |= pulse_channel_map_to_channel_mask(&i->channel_map); +} + +/* some poorly-behaved applications call audio functions during DllMain, so we + * have to do as much as possible without creating a new thread. this function + * sets up a synchronous connection to verify the server is running and query + * static data. */ +static HRESULT pulse_test_connect(void) +{ + int len, ret; + WCHAR path[PATH_MAX], *name; + char *str; + pa_operation *o; + + pulse_ml = pa_mainloop_new(); + + pa_mainloop_set_poll_func(pulse_ml, pulse_poll_func, NULL); + + GetModuleFileNameW(NULL, path, sizeof(path)/sizeof(*path)); + name = strrchrW(path, '\\'); + if (!name) + name = path; + else + name++; + len = WideCharToMultiByte(CP_UNIXCP, 0, name, -1, NULL, 0, NULL, NULL); + str = pa_xmalloc(len); + WideCharToMultiByte(CP_UNIXCP, 0, name, -1, str, len, NULL, NULL); + TRACE("Name: %s\n", str); + pulse_ctx = pa_context_new(pa_mainloop_get_api(pulse_ml), str); + pa_xfree(str); + if (!pulse_ctx) { + ERR("Failed to create context\n"); + pa_mainloop_free(pulse_ml); + pulse_ml = NULL; + return E_FAIL; + } + + pa_context_set_state_callback(pulse_ctx, pulse_contextcallback, NULL); + + TRACE("libpulse protocol version: %u. API Version %u\n", pa_context_get_protocol_version(pulse_ctx), PA_API_VERSION); + if (pa_context_connect(pulse_ctx, NULL, 0, NULL) < 0) + goto fail; + + /* Wait for connection */ + while (pa_mainloop_iterate(pulse_ml, 1, &ret) >= 0) { + pa_context_state_t state = pa_context_get_state(pulse_ctx); + + if (state == PA_CONTEXT_FAILED || state == PA_CONTEXT_TERMINATED) + goto fail; + + if (state == PA_CONTEXT_READY) + break; + } + + TRACE("Test-connected to server %s with protocol version: %i.\n", + pa_context_get_server(pulse_ctx), + pa_context_get_server_protocol_version(pulse_ctx)); + + pulse_probe_settings(1, &pulse_fmt[0]); + pulse_probe_settings(0, &pulse_fmt[1]); + + g_phys_speakers_mask = 0; + o = pa_context_get_sink_info_list(pulse_ctx, &pulse_phys_speakers_cb, NULL); + if (o) { + while (pa_mainloop_iterate(pulse_ml, 1, &ret) >= 0 && + pa_operation_get_state(o) == PA_OPERATION_RUNNING) + {} + pa_operation_unref(o); + } + + pa_context_unref(pulse_ctx); + pulse_ctx = NULL; + pa_mainloop_free(pulse_ml); + pulse_ml = NULL; + + return S_OK; + +fail: + pa_context_unref(pulse_ctx); + pulse_ctx = NULL; + pa_mainloop_free(pulse_ml); + pulse_ml = NULL; + + return E_FAIL; +} + +static HRESULT pulse_stream_valid(ACImpl *This) { + if (!This->stream) + return AUDCLNT_E_NOT_INITIALIZED; + if (!This->stream || pa_stream_get_state(This->stream) != PA_STREAM_READY) + return AUDCLNT_E_DEVICE_INVALIDATED; + return S_OK; +} + +static void silence_buffer(pa_sample_format_t format, BYTE *buffer, UINT32 bytes) +{ + memset(buffer, format == PA_SAMPLE_U8 ? 0x80 : 0, bytes); +} + +static void dump_attr(const pa_buffer_attr *attr) { + TRACE("maxlength: %u\n", attr->maxlength); + TRACE("minreq: %u\n", attr->minreq); + TRACE("fragsize: %u\n", attr->fragsize); + TRACE("tlength: %u\n", attr->tlength); + TRACE("prebuf: %u\n", attr->prebuf); +} + +static void pulse_op_cb(pa_stream *s, int success, void *user) { + TRACE("Success: %i\n", success); + *(int*)user = success; + pthread_cond_signal(&pulse_cond); +} + +static void pulse_attr_update(pa_stream *s, void *user) { + const pa_buffer_attr *attr = pa_stream_get_buffer_attr(s); + TRACE("New attributes or device moved:\n"); + dump_attr(attr); +} + +static void pulse_wr_callback(pa_stream *s, size_t bytes, void *userdata) +{ + ACImpl *This = userdata; + UINT32 oldpad = This->pad; + + if (bytes < This->bufsize_bytes) + This->pad = This->bufsize_bytes - bytes; + else + This->pad = 0; + + if (oldpad == This->pad) + return; + + assert(oldpad > This->pad); + + This->clock_written += oldpad - This->pad; + TRACE("New pad: %zu (-%zu)\n", This->pad / pa_frame_size(&This->ss), (oldpad - This->pad) / pa_frame_size(&This->ss)); + + if (This->event) + SetEvent(This->event); +} + +static void pulse_underflow_callback(pa_stream *s, void *userdata) +{ + WARN("Underflow\n"); +} + +/* Latency is periodically updated even when nothing is played, + * because of PA_STREAM_AUTO_TIMING_UPDATE so use it as timer + * + * Perfect for passing all tests :) + */ +static void pulse_latency_callback(pa_stream *s, void *userdata) +{ + ACImpl *This = userdata; + if (!This->pad && This->event) + SetEvent(This->event); +} + +static void pulse_started_callback(pa_stream *s, void *userdata) +{ + TRACE("(Re)started playing\n"); +} + +static void pulse_rd_loop(ACImpl *This, size_t bytes) +{ + while (bytes >= This->capture_period) { + ACPacket *p, *next; + LARGE_INTEGER stamp, freq; + BYTE *dst, *src; + size_t src_len, copy, rem = This->capture_period; + if (!(p = (ACPacket*)list_head(&This->packet_free_head))) { + p = (ACPacket*)list_head(&This->packet_filled_head); + if (!p->discont) { + next = (ACPacket*)p->entry.next; + next->discont = 1; + } else + p = (ACPacket*)list_tail(&This->packet_filled_head); + assert(This->pad == This->bufsize_bytes); + } else { + assert(This->pad < This->bufsize_bytes); + This->pad += This->capture_period; + assert(This->pad <= This->bufsize_bytes); + } + QueryPerformanceCounter(&stamp); + QueryPerformanceFrequency(&freq); + p->qpcpos = (stamp.QuadPart * (INT64)10000000) / freq.QuadPart; + p->discont = 0; + list_remove(&p->entry); + list_add_tail(&This->packet_filled_head, &p->entry); + + dst = p->data; + while (rem) { + pa_stream_peek(This->stream, (const void**)&src, &src_len); + assert(src_len); + assert(This->peek_ofs < src_len); + src += This->peek_ofs; + src_len -= This->peek_ofs; + assert(src_len <= bytes); + + copy = rem; + if (copy > src_len) + copy = src_len; + memcpy(dst, src, rem); + src += copy; + src_len -= copy; + dst += copy; + rem -= copy; + + if (!src_len) { + This->peek_ofs = 0; + pa_stream_drop(This->stream); + } else + This->peek_ofs += copy; + } + bytes -= This->capture_period; + } +} + +static void pulse_rd_drop(ACImpl *This, size_t bytes) +{ + while (bytes >= This->capture_period) { + size_t src_len, copy, rem = This->capture_period; + while (rem) { + const void *src; + pa_stream_peek(This->stream, &src, &src_len); + assert(src_len); + assert(This->peek_ofs < src_len); + src_len -= This->peek_ofs; + assert(src_len <= bytes); + + copy = rem; + if (copy > src_len) + copy = src_len; + + src_len -= copy; + rem -= copy; + + if (!src_len) { + This->peek_ofs = 0; + pa_stream_drop(This->stream); + } else + This->peek_ofs += copy; + bytes -= copy; + } + } +} + +static void pulse_rd_callback(pa_stream *s, size_t bytes, void *userdata) +{ + ACImpl *This = userdata; + + TRACE("Readable total: %zu, fragsize: %u\n", bytes, pa_stream_get_buffer_attr(s)->fragsize); + assert(bytes >= This->peek_ofs); + bytes -= This->peek_ofs; + if (bytes < This->capture_period) + return; + + if (This->started) + pulse_rd_loop(This, bytes); + else + pulse_rd_drop(This, bytes); + + if (This->event) + SetEvent(This->event); +} + +static HRESULT pulse_stream_connect(ACImpl *This, UINT32 period_bytes) { + int ret; + char buffer[64]; + static LONG number; + pa_buffer_attr attr; + if (This->stream) { + pa_stream_disconnect(This->stream); + while (pa_stream_get_state(This->stream) == PA_STREAM_READY) + pthread_cond_wait(&pulse_cond, &pulse_lock); + pa_stream_unref(This->stream); + } + ret = InterlockedIncrement(&number); + sprintf(buffer, "audio stream #%i", ret); + This->stream = pa_stream_new(pulse_ctx, buffer, &This->ss, &This->map); + + if (!This->stream) { + WARN("pa_stream_new returned error %i\n", pa_context_errno(pulse_ctx)); + return AUDCLNT_E_ENDPOINT_CREATE_FAILED; + } + + pa_stream_set_state_callback(This->stream, pulse_stream_state, This); + pa_stream_set_buffer_attr_callback(This->stream, pulse_attr_update, This); + pa_stream_set_moved_callback(This->stream, pulse_attr_update, This); + + /* Pulseaudio will fill in correct values */ + attr.minreq = attr.fragsize = period_bytes; + attr.maxlength = attr.tlength = This->bufsize_bytes; + attr.prebuf = pa_frame_size(&This->ss); + dump_attr(&attr); + if (This->dataflow == eRender) + ret = pa_stream_connect_playback(This->stream, NULL, &attr, + PA_STREAM_START_CORKED|PA_STREAM_START_UNMUTED|PA_STREAM_AUTO_TIMING_UPDATE|PA_STREAM_INTERPOLATE_TIMING|PA_STREAM_EARLY_REQUESTS, NULL, NULL); + else + ret = pa_stream_connect_record(This->stream, NULL, &attr, + PA_STREAM_START_CORKED|PA_STREAM_START_UNMUTED|PA_STREAM_AUTO_TIMING_UPDATE|PA_STREAM_INTERPOLATE_TIMING|PA_STREAM_EARLY_REQUESTS); + if (ret < 0) { + WARN("Returns %i\n", ret); + return AUDCLNT_E_ENDPOINT_CREATE_FAILED; + } + while (pa_stream_get_state(This->stream) == PA_STREAM_CREATING) + pthread_cond_wait(&pulse_cond, &pulse_lock); + if (pa_stream_get_state(This->stream) != PA_STREAM_READY) + return AUDCLNT_E_ENDPOINT_CREATE_FAILED; + + if (This->dataflow == eRender) { + pa_stream_set_write_callback(This->stream, pulse_wr_callback, This); + pa_stream_set_underflow_callback(This->stream, pulse_underflow_callback, This); + pa_stream_set_started_callback(This->stream, pulse_started_callback, This); + } else + pa_stream_set_read_callback(This->stream, pulse_rd_callback, This); + return S_OK; +} + +HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, const WCHAR ***ids, GUID **keys, + UINT *num, UINT *def_index) +{ + WCHAR *id; + + TRACE("%d %p %p %p\n", flow, ids, num, def_index); + + *num = 1; + *def_index = 0; + + *ids = HeapAlloc(GetProcessHeap(), 0, sizeof(**ids)); + *keys = NULL; + if (!*ids) + return E_OUTOFMEMORY; + + (*ids)[0] = id = HeapAlloc(GetProcessHeap(), 0, sizeof(defaultW)); + *keys = HeapAlloc(GetProcessHeap(), 0, sizeof(**keys)); + if (!*keys || !id) { + HeapFree(GetProcessHeap(), 0, id); + HeapFree(GetProcessHeap(), 0, *keys); + HeapFree(GetProcessHeap(), 0, *ids); + *ids = NULL; + *keys = NULL; + return E_OUTOFMEMORY; + } + memcpy(id, defaultW, sizeof(defaultW)); + + if (flow == eRender) + (*keys)[0] = pulse_render_guid; + else + (*keys)[0] = pulse_capture_guid; + + return S_OK; +} + +int WINAPI AUDDRV_GetPriority(void) +{ + HRESULT hr; + pthread_mutex_lock(&pulse_lock); + hr = pulse_test_connect(); + pthread_mutex_unlock(&pulse_lock); + return SUCCEEDED(hr) ? Priority_Preferred : Priority_Unavailable; +} + +HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev, IAudioClient **out) +{ + ACImpl *This; + int i; + EDataFlow dataflow; + HRESULT hr; + + TRACE("%s %p %p\n", debugstr_guid(guid), dev, out); + if (IsEqualGUID(guid, &pulse_render_guid)) + dataflow = eRender; + else if (IsEqualGUID(guid, &pulse_capture_guid)) + dataflow = eCapture; + else + return E_UNEXPECTED; + + *out = NULL; + + This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*This)); + if (!This) + return E_OUTOFMEMORY; + + This->IAudioClient_iface.lpVtbl = &AudioClient_Vtbl; + This->IAudioRenderClient_iface.lpVtbl = &AudioRenderClient_Vtbl; + This->IAudioCaptureClient_iface.lpVtbl = &AudioCaptureClient_Vtbl; + This->IAudioClock_iface.lpVtbl = &AudioClock_Vtbl; + This->IAudioClock2_iface.lpVtbl = &AudioClock2_Vtbl; + This->IAudioStreamVolume_iface.lpVtbl = &AudioStreamVolume_Vtbl; + This->dataflow = dataflow; + This->parent = dev; + for (i = 0; i < PA_CHANNELS_MAX; ++i) + This->vol[i] = 1.f; + + hr = CoCreateFreeThreadedMarshaler((IUnknown*)This, &This->marshal); + if (hr) { + HeapFree(GetProcessHeap(), 0, This); + return hr; + } + IMMDevice_AddRef(This->parent); + + *out = &This->IAudioClient_iface; + IAudioClient_AddRef(&This->IAudioClient_iface); + + return S_OK; +} + +static HRESULT WINAPI AudioClient_QueryInterface(IAudioClient *iface, + REFIID riid, void **ppv) +{ + ACImpl *This = impl_from_IAudioClient(iface); + + TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); + + if (!ppv) + return E_POINTER; + + *ppv = NULL; + if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IAudioClient)) + *ppv = iface; + if (*ppv) { + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; + } + + if (IsEqualIID(riid, &IID_IMarshal)) + return IUnknown_QueryInterface(This->marshal, riid, ppv); + + WARN("Unknown interface %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI AudioClient_AddRef(IAudioClient *iface) +{ + ACImpl *This = impl_from_IAudioClient(iface); + ULONG ref; + ref = InterlockedIncrement(&This->ref); + TRACE("(%p) Refcount now %u\n", This, ref); + return ref; +} + +static ULONG WINAPI AudioClient_Release(IAudioClient *iface) +{ + ACImpl *This = impl_from_IAudioClient(iface); + ULONG ref; + ref = InterlockedDecrement(&This->ref); + TRACE("(%p) Refcount now %u\n", This, ref); + if (!ref) { + if (This->stream) { + pthread_mutex_lock(&pulse_lock); + if (PA_STREAM_IS_GOOD(pa_stream_get_state(This->stream))) { + pa_stream_disconnect(This->stream); + while (PA_STREAM_IS_GOOD(pa_stream_get_state(This->stream))) + pthread_cond_wait(&pulse_cond, &pulse_lock); + } + pa_stream_unref(This->stream); + This->stream = NULL; + list_remove(&This->entry); + pthread_mutex_unlock(&pulse_lock); + } + IUnknown_Release(This->marshal); + IMMDevice_Release(This->parent); + HeapFree(GetProcessHeap(), 0, This->tmp_buffer); + HeapFree(GetProcessHeap(), 0, This); + } + return ref; +} + +static void dump_fmt(const WAVEFORMATEX *fmt) +{ + TRACE("wFormatTag: 0x%x (", fmt->wFormatTag); + switch(fmt->wFormatTag) { + case WAVE_FORMAT_PCM: + TRACE("WAVE_FORMAT_PCM"); + break; + case WAVE_FORMAT_IEEE_FLOAT: + TRACE("WAVE_FORMAT_IEEE_FLOAT"); + break; + case WAVE_FORMAT_EXTENSIBLE: + TRACE("WAVE_FORMAT_EXTENSIBLE"); + break; + default: + TRACE("Unknown"); + break; + } + TRACE(")\n"); + + TRACE("nChannels: %u\n", fmt->nChannels); + TRACE("nSamplesPerSec: %u\n", fmt->nSamplesPerSec); + TRACE("nAvgBytesPerSec: %u\n", fmt->nAvgBytesPerSec); + TRACE("nBlockAlign: %u\n", fmt->nBlockAlign); + TRACE("wBitsPerSample: %u\n", fmt->wBitsPerSample); + TRACE("cbSize: %u\n", fmt->cbSize); + + if (fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE) { + WAVEFORMATEXTENSIBLE *fmtex = (void*)fmt; + TRACE("dwChannelMask: %08x\n", fmtex->dwChannelMask); + TRACE("Samples: %04x\n", fmtex->Samples.wReserved); + TRACE("SubFormat: %s\n", wine_dbgstr_guid(&fmtex->SubFormat)); + } +} + +static WAVEFORMATEX *clone_format(const WAVEFORMATEX *fmt) +{ + WAVEFORMATEX *ret; + size_t size; + + if (fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE) + size = sizeof(WAVEFORMATEXTENSIBLE); + else + size = sizeof(WAVEFORMATEX); + + ret = CoTaskMemAlloc(size); + if (!ret) + return NULL; + + memcpy(ret, fmt, size); + + ret->cbSize = size - sizeof(WAVEFORMATEX); + + return ret; +} + +static DWORD get_channel_mask(unsigned int channels) +{ + switch(channels) { + case 0: + return 0; + case 1: + return KSAUDIO_SPEAKER_MONO; + case 2: + return KSAUDIO_SPEAKER_STEREO; + case 3: + return KSAUDIO_SPEAKER_STEREO | SPEAKER_LOW_FREQUENCY; + case 4: + return KSAUDIO_SPEAKER_QUAD; /* not _SURROUND */ + case 5: + return KSAUDIO_SPEAKER_QUAD | SPEAKER_LOW_FREQUENCY; + case 6: + return KSAUDIO_SPEAKER_5POINT1; /* not 5POINT1_SURROUND */ + case 7: + return KSAUDIO_SPEAKER_5POINT1 | SPEAKER_BACK_CENTER; + case 8: + return KSAUDIO_SPEAKER_7POINT1_SURROUND; /* Vista deprecates 7POINT1 */ + } + FIXME("Unknown speaker configuration: %u\n", channels); + return 0; +} + +static void session_init_vols(AudioSession *session, UINT channels) +{ + if (session->channel_count < channels) { + UINT i; + + if (session->channel_vols) + session->channel_vols = HeapReAlloc(GetProcessHeap(), 0, + session->channel_vols, sizeof(float) * channels); + else + session->channel_vols = HeapAlloc(GetProcessHeap(), 0, + sizeof(float) * channels); + if (!session->channel_vols) + return; + + for(i = session->channel_count; i < channels; ++i) + session->channel_vols[i] = 1.f; + + session->channel_count = channels; + } +} + +static AudioSession *create_session(const GUID *guid, IMMDevice *device, + UINT num_channels) +{ + AudioSession *ret; + + ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(AudioSession)); + if (!ret) + return NULL; + + memcpy(&ret->guid, guid, sizeof(GUID)); + + ret->device = device; + + list_init(&ret->clients); + + list_add_head(&g_sessions, &ret->entry); + + session_init_vols(ret, num_channels); + + ret->master_vol = 1.f; + + return ret; +} + +/* if channels == 0, then this will return or create a session with + * matching dataflow and GUID. otherwise, channels must also match */ +static HRESULT get_audio_session(const GUID *sessionguid, + IMMDevice *device, UINT channels, AudioSession **out) +{ + AudioSession *session; + + if (!sessionguid || IsEqualGUID(sessionguid, &GUID_NULL)) { + *out = create_session(&GUID_NULL, device, channels); + if (!*out) + return E_OUTOFMEMORY; + + return S_OK; + } + + *out = NULL; + LIST_FOR_EACH_ENTRY(session, &g_sessions, AudioSession, entry) { + if (session->device == device && + IsEqualGUID(sessionguid, &session->guid)) { + session_init_vols(session, channels); + *out = session; + break; + } + } + + if (!*out) { + *out = create_session(sessionguid, device, channels); + if (!*out) + return E_OUTOFMEMORY; + } + + return S_OK; +} + +static HRESULT pulse_spec_from_waveformat(ACImpl *This, const WAVEFORMATEX *fmt) +{ + pa_channel_map_init(&This->map); + This->ss.rate = fmt->nSamplesPerSec; + This->ss.format = PA_SAMPLE_INVALID; + + switch(fmt->wFormatTag) { + case WAVE_FORMAT_IEEE_FLOAT: + if (!fmt->nChannels || fmt->nChannels > 2 || fmt->wBitsPerSample != 32) + break; + This->ss.format = PA_SAMPLE_FLOAT32LE; + pa_channel_map_init_auto(&This->map, fmt->nChannels, PA_CHANNEL_MAP_ALSA); + break; + case WAVE_FORMAT_PCM: + if (!fmt->nChannels || fmt->nChannels > 2) + break; + if (fmt->wBitsPerSample == 8) + This->ss.format = PA_SAMPLE_U8; + else if (fmt->wBitsPerSample == 16) + This->ss.format = PA_SAMPLE_S16LE; + else + return AUDCLNT_E_UNSUPPORTED_FORMAT; + pa_channel_map_init_auto(&This->map, fmt->nChannels, PA_CHANNEL_MAP_ALSA); + break; + case WAVE_FORMAT_EXTENSIBLE: { + WAVEFORMATEXTENSIBLE *wfe = (WAVEFORMATEXTENSIBLE*)fmt; + DWORD mask = wfe->dwChannelMask; + DWORD i = 0, j; + if (fmt->cbSize != (sizeof(*wfe) - sizeof(*fmt)) && fmt->cbSize != sizeof(*wfe)) + break; + if (IsEqualGUID(&wfe->SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT) && + (!wfe->Samples.wValidBitsPerSample || wfe->Samples.wValidBitsPerSample == 32) && + fmt->wBitsPerSample == 32) + This->ss.format = PA_SAMPLE_FLOAT32LE; + else if (IsEqualGUID(&wfe->SubFormat, &KSDATAFORMAT_SUBTYPE_PCM)) { + DWORD valid = wfe->Samples.wValidBitsPerSample; + if (!valid) + valid = fmt->wBitsPerSample; + if (!valid || valid > fmt->wBitsPerSample) + break; + switch (fmt->wBitsPerSample) { + case 8: + if (valid == 8) + This->ss.format = PA_SAMPLE_U8; + break; + case 16: + if (valid == 16) + This->ss.format = PA_SAMPLE_S16LE; + break; + case 24: + if (valid == 24) + This->ss.format = PA_SAMPLE_S24LE; + break; + case 32: + if (valid == 24) + This->ss.format = PA_SAMPLE_S24_32LE; + else if (valid == 32) + This->ss.format = PA_SAMPLE_S32LE; + break; + default: + return AUDCLNT_E_UNSUPPORTED_FORMAT; + } + } + This->map.channels = fmt->nChannels; + if (!mask || (mask & (SPEAKER_ALL|SPEAKER_RESERVED))) + mask = get_channel_mask(fmt->nChannels); + for (j = 0; j < sizeof(pulse_pos_from_wfx)/sizeof(*pulse_pos_from_wfx) && i < fmt->nChannels; ++j) { + if (mask & (1 << j)) + This->map.map[i++] = pulse_pos_from_wfx[j]; + } + + /* Special case for mono since pulse appears to map it differently */ + if (mask == SPEAKER_FRONT_CENTER) + This->map.map[0] = PA_CHANNEL_POSITION_MONO; + + if (i < fmt->nChannels || (mask & SPEAKER_RESERVED)) { + This->map.channels = 0; + ERR("Invalid channel mask: %i/%i and %x(%x)\n", i, fmt->nChannels, mask, wfe->dwChannelMask); + break; + } + break; + } + case WAVE_FORMAT_ALAW: + case WAVE_FORMAT_MULAW: + if (fmt->wBitsPerSample != 8) { + FIXME("Unsupported bpp %u for LAW\n", fmt->wBitsPerSample); + return AUDCLNT_E_UNSUPPORTED_FORMAT; + } + if (fmt->nChannels != 1 && fmt->nChannels != 2) { + FIXME("Unsupported channels %u for LAW\n", fmt->nChannels); + return AUDCLNT_E_UNSUPPORTED_FORMAT; + } + This->ss.format = fmt->wFormatTag == WAVE_FORMAT_MULAW ? PA_SAMPLE_ULAW : PA_SAMPLE_ALAW; + pa_channel_map_init_auto(&This->map, fmt->nChannels, PA_CHANNEL_MAP_ALSA); + break; + default: + WARN("Unhandled tag %x\n", fmt->wFormatTag); + return AUDCLNT_E_UNSUPPORTED_FORMAT; + } + This->ss.channels = This->map.channels; + if (!pa_channel_map_valid(&This->map) || This->ss.format == PA_SAMPLE_INVALID) { + ERR("Invalid format! Channel spec valid: %i, format: %i\n", pa_channel_map_valid(&This->map), This->ss.format); + return AUDCLNT_E_UNSUPPORTED_FORMAT; + } + return S_OK; +} + +static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface, + AUDCLNT_SHAREMODE mode, DWORD flags, REFERENCE_TIME duration, + REFERENCE_TIME period, const WAVEFORMATEX *fmt, + const GUID *sessionguid) +{ + ACImpl *This = impl_from_IAudioClient(iface); + HRESULT hr = S_OK; + UINT period_bytes; + + TRACE("(%p)->(%x, %x, %s, %s, %p, %s)\n", This, mode, flags, + wine_dbgstr_longlong(duration), wine_dbgstr_longlong(period), fmt, debugstr_guid(sessionguid)); + + if (!fmt) + return E_POINTER; + + if (mode != AUDCLNT_SHAREMODE_SHARED && mode != AUDCLNT_SHAREMODE_EXCLUSIVE) + return AUDCLNT_E_NOT_INITIALIZED; + if (mode == AUDCLNT_SHAREMODE_EXCLUSIVE) + return AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED; + + if (flags & ~(AUDCLNT_STREAMFLAGS_CROSSPROCESS | + AUDCLNT_STREAMFLAGS_LOOPBACK | + AUDCLNT_STREAMFLAGS_EVENTCALLBACK | + AUDCLNT_STREAMFLAGS_NOPERSIST | + AUDCLNT_STREAMFLAGS_RATEADJUST | + AUDCLNT_SESSIONFLAGS_EXPIREWHENUNOWNED | + AUDCLNT_SESSIONFLAGS_DISPLAY_HIDE | + AUDCLNT_SESSIONFLAGS_DISPLAY_HIDEWHENEXPIRED)) { + TRACE("Unknown flags: %08x\n", flags); + return E_INVALIDARG; + } + + pthread_mutex_lock(&pulse_lock); + + hr = pulse_connect(); + if (FAILED(hr)) { + pthread_mutex_unlock(&pulse_lock); + return hr; + } + + if (This->stream) { + pthread_mutex_unlock(&pulse_lock); + return AUDCLNT_E_ALREADY_INITIALIZED; + } + + hr = pulse_spec_from_waveformat(This, fmt); + TRACE("Obtaining format returns %08x\n", hr); + dump_fmt(fmt); + + if (FAILED(hr)) + goto exit; + + if (mode == AUDCLNT_SHAREMODE_SHARED) { + REFERENCE_TIME def = pulse_def_period[This->dataflow == eCapture]; + REFERENCE_TIME min = pulse_min_period[This->dataflow == eCapture]; + + /* Switch to low latency mode if below 2 default periods, + * which is 20 ms by default, this will increase the amount + * of interrupts but allows very low latency. In dsound I + * managed to get a total latency of ~8ms, which is well below + * default + */ + if (duration < 2 * def) + period = min; + else + period = def; + if (duration < 2 * period) + duration = 2 * period; + + /* Uh oh, really low latency requested.. */ + if (duration <= 2 * period) + period /= 2; + } + period_bytes = pa_frame_size(&This->ss) * MulDiv(period, This->ss.rate, 10000000); + + if (duration < 20000000) + This->bufsize_frames = ceil((duration / 10000000.) * fmt->nSamplesPerSec); + else + This->bufsize_frames = 2 * fmt->nSamplesPerSec; + This->bufsize_bytes = This->bufsize_frames * pa_frame_size(&This->ss); + + This->share = mode; + This->flags = flags; + hr = pulse_stream_connect(This, period_bytes); + if (SUCCEEDED(hr)) { + UINT32 unalign; + const pa_buffer_attr *attr = pa_stream_get_buffer_attr(This->stream); + /* Update frames according to new size */ + dump_attr(attr); + if (This->dataflow == eRender) + This->bufsize_bytes = attr->tlength; + else { + This->capture_period = period_bytes = attr->fragsize; + if ((unalign = This->bufsize_bytes % period_bytes)) + This->bufsize_bytes += period_bytes - unalign; + } + This->bufsize_frames = This->bufsize_bytes / pa_frame_size(&This->ss); + } + if (SUCCEEDED(hr)) { + UINT32 i, capture_packets = This->capture_period ? This->bufsize_bytes / This->capture_period : 0; + This->tmp_buffer = HeapAlloc(GetProcessHeap(), 0, This->bufsize_bytes + capture_packets * sizeof(ACPacket)); + if (!This->tmp_buffer) + hr = E_OUTOFMEMORY; + else { + ACPacket *cur_packet = (ACPacket*)((char*)This->tmp_buffer + This->bufsize_bytes); + BYTE *data = This->tmp_buffer; + silence_buffer(This->ss.format, This->tmp_buffer, This->bufsize_bytes); + list_init(&This->packet_free_head); + list_init(&This->packet_filled_head); + for (i = 0; i < capture_packets; ++i, ++cur_packet) { + list_add_tail(&This->packet_free_head, &cur_packet->entry); + cur_packet->data = data; + data += This->capture_period; + } + assert(!This->capture_period || This->bufsize_bytes == This->capture_period * capture_packets); + assert(!capture_packets || data - This->bufsize_bytes == This->tmp_buffer); + } + } + if (SUCCEEDED(hr)) + hr = get_audio_session(sessionguid, This->parent, fmt->nChannels, &This->session); + if (SUCCEEDED(hr)) + list_add_tail(&This->session->clients, &This->entry); + +exit: + if (FAILED(hr)) { + HeapFree(GetProcessHeap(), 0, This->tmp_buffer); + This->tmp_buffer = NULL; + if (This->stream) { + pa_stream_disconnect(This->stream); + pa_stream_unref(This->stream); + This->stream = NULL; + } + } + pthread_mutex_unlock(&pulse_lock); + return hr; +} + +static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient *iface, + UINT32 *out) +{ + ACImpl *This = impl_from_IAudioClient(iface); + HRESULT hr; + + TRACE("(%p)->(%p)\n", This, out); + + if (!out) + return E_POINTER; + + pthread_mutex_lock(&pulse_lock); + hr = pulse_stream_valid(This); + if (SUCCEEDED(hr)) + *out = This->bufsize_frames; + pthread_mutex_unlock(&pulse_lock); + + return hr; +} + +static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient *iface, + REFERENCE_TIME *latency) +{ + ACImpl *This = impl_from_IAudioClient(iface); + const pa_buffer_attr *attr; + REFERENCE_TIME lat; + HRESULT hr; + + TRACE("(%p)->(%p)\n", This, latency); + + if (!latency) + return E_POINTER; + + pthread_mutex_lock(&pulse_lock); + hr = pulse_stream_valid(This); + if (FAILED(hr)) { + pthread_mutex_unlock(&pulse_lock); + return hr; + } + attr = pa_stream_get_buffer_attr(This->stream); + if (This->dataflow == eRender) + lat = attr->minreq / pa_frame_size(&This->ss); + else + lat = attr->fragsize / pa_frame_size(&This->ss); + *latency = 10000000; + *latency *= lat; + *latency /= This->ss.rate; + pthread_mutex_unlock(&pulse_lock); + TRACE("Latency: %u ms\n", (DWORD)(*latency / 10000)); + return S_OK; +} + +static void ACImpl_GetRenderPad(ACImpl *This, UINT32 *out) +{ + *out = This->pad / pa_frame_size(&This->ss); +} + +static void ACImpl_GetCapturePad(ACImpl *This, UINT32 *out) +{ + ACPacket *packet = This->locked_ptr; + if (!packet && !list_empty(&This->packet_filled_head)) { + packet = (ACPacket*)list_head(&This->packet_filled_head); + This->locked_ptr = packet; + list_remove(&packet->entry); + } + if (out) + *out = This->pad / pa_frame_size(&This->ss); +} + +static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient *iface, + UINT32 *out) +{ + ACImpl *This = impl_from_IAudioClient(iface); + HRESULT hr; + + TRACE("(%p)->(%p)\n", This, out); + + if (!out) + return E_POINTER; + + pthread_mutex_lock(&pulse_lock); + hr = pulse_stream_valid(This); + if (FAILED(hr)) { + pthread_mutex_unlock(&pulse_lock); + return hr; + } + + if (This->dataflow == eRender) + ACImpl_GetRenderPad(This, out); + else + ACImpl_GetCapturePad(This, out); + pthread_mutex_unlock(&pulse_lock); + + TRACE("%p Pad: %u ms (%u)\n", This, MulDiv(*out, 1000, This->ss.rate), *out); + return S_OK; +} + +static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface, + AUDCLNT_SHAREMODE mode, const WAVEFORMATEX *fmt, + WAVEFORMATEX **out) +{ + ACImpl *This = impl_from_IAudioClient(iface); + HRESULT hr = S_OK; + WAVEFORMATEX *closest = NULL; + BOOL exclusive; + + TRACE("(%p)->(%x, %p, %p)\n", This, mode, fmt, out); + + if (!fmt) + return E_POINTER; + + if (out) + *out = NULL; + + if (mode == AUDCLNT_SHAREMODE_EXCLUSIVE) { + exclusive = 1; + out = NULL; + } else if (mode == AUDCLNT_SHAREMODE_SHARED) { + exclusive = 0; + if (!out) + return E_POINTER; + } else + return E_INVALIDARG; + + if (fmt->nChannels == 0) + return AUDCLNT_E_UNSUPPORTED_FORMAT; + + closest = clone_format(fmt); + if (!closest) + return E_OUTOFMEMORY; + + dump_fmt(fmt); + + switch (fmt->wFormatTag) { + case WAVE_FORMAT_EXTENSIBLE: { + WAVEFORMATEXTENSIBLE *ext = (WAVEFORMATEXTENSIBLE*)closest; + + if ((fmt->cbSize != sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX) && + fmt->cbSize != sizeof(WAVEFORMATEXTENSIBLE)) || + fmt->nBlockAlign != fmt->wBitsPerSample / 8 * fmt->nChannels || + ext->Samples.wValidBitsPerSample > fmt->wBitsPerSample || + fmt->nAvgBytesPerSec != fmt->nBlockAlign * fmt->nSamplesPerSec) { + hr = E_INVALIDARG; + break; + } + + if (exclusive) { + UINT32 mask = 0, i, channels = 0; + + if (!(ext->dwChannelMask & (SPEAKER_ALL | SPEAKER_RESERVED))) { + for (i = 1; !(i & SPEAKER_RESERVED); i <<= 1) { + if (i & ext->dwChannelMask) { + mask |= i; + channels++; + } + } + + if (channels != fmt->nChannels || (ext->dwChannelMask & ~mask)) { + hr = AUDCLNT_E_UNSUPPORTED_FORMAT; + break; + } + } else { + hr = AUDCLNT_E_UNSUPPORTED_FORMAT; + break; + } + } + + if (IsEqualGUID(&ext->SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT)) { + if (fmt->wBitsPerSample != 32) { + hr = E_INVALIDARG; + break; + } + + if (ext->Samples.wValidBitsPerSample != fmt->wBitsPerSample) { + hr = S_FALSE; + ext->Samples.wValidBitsPerSample = fmt->wBitsPerSample; + } + } else if (IsEqualGUID(&ext->SubFormat, &KSDATAFORMAT_SUBTYPE_PCM)) { + if (!fmt->wBitsPerSample || fmt->wBitsPerSample > 32 || fmt->wBitsPerSample % 8) { + hr = E_INVALIDARG; + break; + } + + if (ext->Samples.wValidBitsPerSample != fmt->wBitsPerSample && + !(fmt->wBitsPerSample == 32 && + ext->Samples.wValidBitsPerSample == 24)) { + hr = S_FALSE; + ext->Samples.wValidBitsPerSample = fmt->wBitsPerSample; + break; + } + } else { + hr = AUDCLNT_E_UNSUPPORTED_FORMAT; + break; + } + + break; + } + + case WAVE_FORMAT_ALAW: + case WAVE_FORMAT_MULAW: + if (fmt->wBitsPerSample != 8) { + hr = E_INVALIDARG; + break; + } + /* Fall-through */ + case WAVE_FORMAT_IEEE_FLOAT: + if (fmt->wFormatTag == WAVE_FORMAT_IEEE_FLOAT && fmt->wBitsPerSample != 32) { + hr = E_INVALIDARG; + break; + } + /* Fall-through */ + case WAVE_FORMAT_PCM: + if (fmt->wFormatTag == WAVE_FORMAT_PCM && + (!fmt->wBitsPerSample || fmt->wBitsPerSample > 32 || fmt->wBitsPerSample % 8)) { + hr = E_INVALIDARG; + break; + } + + if (fmt->nChannels > 2) { + hr = AUDCLNT_E_UNSUPPORTED_FORMAT; + break; + } + /* + * fmt->cbSize, fmt->nBlockAlign and fmt->nAvgBytesPerSec seem to be + * ignored, invalid values are happily accepted. + */ + break; + default: + hr = AUDCLNT_E_UNSUPPORTED_FORMAT; + break; + } + + if (exclusive && hr != S_OK) { + hr = AUDCLNT_E_UNSUPPORTED_FORMAT; + CoTaskMemFree(closest); + } else if (hr != S_FALSE) + CoTaskMemFree(closest); + else + *out = closest; + + /* Winepulse does not currently support exclusive mode, if you know of an + * application that uses it, I will correct this.. + */ + if (hr == S_OK && exclusive) + return This->dataflow == eCapture ? AUDCLNT_E_UNSUPPORTED_FORMAT : AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED; + + TRACE("returning: %08x %p\n", hr, out ? *out : NULL); + return hr; +} + +static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface, + WAVEFORMATEX **pwfx) +{ + ACImpl *This = impl_from_IAudioClient(iface); + WAVEFORMATEXTENSIBLE *fmt = &pulse_fmt[This->dataflow == eCapture]; + + TRACE("(%p)->(%p)\n", This, pwfx); + + if (!pwfx) + return E_POINTER; + + *pwfx = clone_format(&fmt->Format); + if (!*pwfx) + return E_OUTOFMEMORY; + dump_fmt(*pwfx); + return S_OK; +} + +static HRESULT WINAPI AudioClient_GetDevicePeriod(IAudioClient *iface, + REFERENCE_TIME *defperiod, REFERENCE_TIME *minperiod) +{ + ACImpl *This = impl_from_IAudioClient(iface); + + TRACE("(%p)->(%p, %p)\n", This, defperiod, minperiod); + + if (!defperiod && !minperiod) + return E_POINTER; + + if (defperiod) + *defperiod = pulse_def_period[This->dataflow == eCapture]; + if (minperiod) + *minperiod = pulse_min_period[This->dataflow == eCapture]; + + return S_OK; +} + +static HRESULT WINAPI AudioClient_Start(IAudioClient *iface) +{ + ACImpl *This = impl_from_IAudioClient(iface); + HRESULT hr = S_OK; + int success; + pa_operation *o; + + TRACE("(%p)\n", This); + + pthread_mutex_lock(&pulse_lock); + hr = pulse_stream_valid(This); + if (FAILED(hr)) { + pthread_mutex_unlock(&pulse_lock); + return hr; + } + + if ((This->flags & AUDCLNT_STREAMFLAGS_EVENTCALLBACK) && !This->event) { + pthread_mutex_unlock(&pulse_lock); + return AUDCLNT_E_EVENTHANDLE_NOT_SET; + } + + if (This->started) { + pthread_mutex_unlock(&pulse_lock); + return AUDCLNT_E_NOT_STOPPED; + } + + if (pa_stream_is_corked(This->stream)) { + o = pa_stream_cork(This->stream, 0, pulse_op_cb, &success); + if (o) { + while(pa_operation_get_state(o) == PA_OPERATION_RUNNING) + pthread_cond_wait(&pulse_cond, &pulse_lock); + pa_operation_unref(o); + } else + success = 0; + if (!success) + hr = E_FAIL; + } + if (SUCCEEDED(hr)) { + This->started = TRUE; + if (This->dataflow == eRender && This->event) + pa_stream_set_latency_update_callback(This->stream, pulse_latency_callback, This); + } + pthread_mutex_unlock(&pulse_lock); + return hr; +} + +static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface) +{ + ACImpl *This = impl_from_IAudioClient(iface); + HRESULT hr = S_OK; + pa_operation *o; + int success; + + TRACE("(%p)\n", This); + + pthread_mutex_lock(&pulse_lock); + hr = pulse_stream_valid(This); + if (FAILED(hr)) { + pthread_mutex_unlock(&pulse_lock); + return hr; + } + + if (!This->started) { + pthread_mutex_unlock(&pulse_lock); + return S_FALSE; + } + + if (This->dataflow == eRender) { + o = pa_stream_cork(This->stream, 1, pulse_op_cb, &success); + if (o) { + while(pa_operation_get_state(o) == PA_OPERATION_RUNNING) + pthread_cond_wait(&pulse_cond, &pulse_lock); + pa_operation_unref(o); + } else + success = 0; + if (!success) + hr = E_FAIL; + } + if (SUCCEEDED(hr)) { + This->started = FALSE; + } + pthread_mutex_unlock(&pulse_lock); + return hr; +} + +static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface) +{ + ACImpl *This = impl_from_IAudioClient(iface); + HRESULT hr = S_OK; + + TRACE("(%p)\n", This); + + pthread_mutex_lock(&pulse_lock); + hr = pulse_stream_valid(This); + if (FAILED(hr)) { + pthread_mutex_unlock(&pulse_lock); + return hr; + } + + if (This->started) { + pthread_mutex_unlock(&pulse_lock); + return AUDCLNT_E_NOT_STOPPED; + } + + if (This->locked) { + pthread_mutex_unlock(&pulse_lock); + return AUDCLNT_E_BUFFER_OPERATION_PENDING; + } + + if (This->dataflow == eRender) { + /* If there is still data in the render buffer it needs to be removed from the server */ + int success = 0; + if (This->pad) { + pa_operation *o = pa_stream_flush(This->stream, pulse_op_cb, &success); + if (o) { + while(pa_operation_get_state(o) == PA_OPERATION_RUNNING) + pthread_cond_wait(&pulse_cond, &pulse_lock); + pa_operation_unref(o); + } + } + if (success || !This->pad) + This->clock_lastpos = This->clock_written = This->pad = 0; + } else { + ACPacket *p; + This->clock_written += This->pad; + This->pad = 0; + + if ((p = This->locked_ptr)) { + This->locked_ptr = NULL; + list_add_tail(&This->packet_free_head, &p->entry); + } + list_move_tail(&This->packet_free_head, &This->packet_filled_head); + } + pthread_mutex_unlock(&pulse_lock); + + return hr; +} + +static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient *iface, + HANDLE event) +{ + ACImpl *This = impl_from_IAudioClient(iface); + HRESULT hr; + + TRACE("(%p)->(%p)\n", This, event); + + if (!event) + return E_INVALIDARG; + + pthread_mutex_lock(&pulse_lock); + hr = pulse_stream_valid(This); + if (FAILED(hr)) { + pthread_mutex_unlock(&pulse_lock); + return hr; + } + + if (!(This->flags & AUDCLNT_STREAMFLAGS_EVENTCALLBACK)) + hr = AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED; + else if (This->event) + hr = HRESULT_FROM_WIN32(ERROR_INVALID_NAME); + else + This->event = event; + pthread_mutex_unlock(&pulse_lock); + return hr; +} + +static HRESULT WINAPI AudioClient_GetService(IAudioClient *iface, REFIID riid, + void **ppv) +{ + ACImpl *This = impl_from_IAudioClient(iface); + HRESULT hr; + + TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppv); + + if (!ppv) + return E_POINTER; + *ppv = NULL; + + pthread_mutex_lock(&pulse_lock); + hr = pulse_stream_valid(This); + pthread_mutex_unlock(&pulse_lock); + if (FAILED(hr)) + return hr; + + if (IsEqualIID(riid, &IID_IAudioRenderClient)) { + if (This->dataflow != eRender) + return AUDCLNT_E_WRONG_ENDPOINT_TYPE; + *ppv = &This->IAudioRenderClient_iface; + } else if (IsEqualIID(riid, &IID_IAudioCaptureClient)) { + if (This->dataflow != eCapture) + return AUDCLNT_E_WRONG_ENDPOINT_TYPE; + *ppv = &This->IAudioCaptureClient_iface; + } else if (IsEqualIID(riid, &IID_IAudioClock)) { + *ppv = &This->IAudioClock_iface; + } else if (IsEqualIID(riid, &IID_IAudioStreamVolume)) { + *ppv = &This->IAudioStreamVolume_iface; + } else if (IsEqualIID(riid, &IID_IAudioSessionControl) || + IsEqualIID(riid, &IID_IChannelAudioVolume) || + IsEqualIID(riid, &IID_ISimpleAudioVolume)) { + if (!This->session_wrapper) { + This->session_wrapper = AudioSessionWrapper_Create(This); + if (!This->session_wrapper) + return E_OUTOFMEMORY; + } + if (IsEqualIID(riid, &IID_IAudioSessionControl)) + *ppv = &This->session_wrapper->IAudioSessionControl2_iface; + else if (IsEqualIID(riid, &IID_IChannelAudioVolume)) + *ppv = &This->session_wrapper->IChannelAudioVolume_iface; + else if (IsEqualIID(riid, &IID_ISimpleAudioVolume)) + *ppv = &This->session_wrapper->ISimpleAudioVolume_iface; + } + + if (*ppv) { + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; + } + + FIXME("stub %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static const IAudioClientVtbl AudioClient_Vtbl = +{ + AudioClient_QueryInterface, + AudioClient_AddRef, + AudioClient_Release, + AudioClient_Initialize, + AudioClient_GetBufferSize, + AudioClient_GetStreamLatency, + AudioClient_GetCurrentPadding, + AudioClient_IsFormatSupported, + AudioClient_GetMixFormat, + AudioClient_GetDevicePeriod, + AudioClient_Start, + AudioClient_Stop, + AudioClient_Reset, + AudioClient_SetEventHandle, + AudioClient_GetService +}; + +static HRESULT WINAPI AudioRenderClient_QueryInterface( + IAudioRenderClient *iface, REFIID riid, void **ppv) +{ + ACImpl *This = impl_from_IAudioRenderClient(iface); + TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); + + if (!ppv) + return E_POINTER; + *ppv = NULL; + + if (IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_IAudioRenderClient)) + *ppv = iface; + if (*ppv) { + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; + } + + if (IsEqualIID(riid, &IID_IMarshal)) + return IUnknown_QueryInterface(This->marshal, riid, ppv); + + WARN("Unknown interface %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI AudioRenderClient_AddRef(IAudioRenderClient *iface) +{ + ACImpl *This = impl_from_IAudioRenderClient(iface); + return AudioClient_AddRef(&This->IAudioClient_iface); +} + +static ULONG WINAPI AudioRenderClient_Release(IAudioRenderClient *iface) +{ + ACImpl *This = impl_from_IAudioRenderClient(iface); + return AudioClient_Release(&This->IAudioClient_iface); +} + +static HRESULT WINAPI AudioRenderClient_GetBuffer(IAudioRenderClient *iface, + UINT32 frames, BYTE **data) +{ + ACImpl *This = impl_from_IAudioRenderClient(iface); + size_t avail, req, bytes = frames * pa_frame_size(&This->ss); + UINT32 pad; + HRESULT hr = S_OK; + int ret = -1; + + TRACE("(%p)->(%u, %p)\n", This, frames, data); + + if (!data) + return E_POINTER; + *data = NULL; + + pthread_mutex_lock(&pulse_lock); + hr = pulse_stream_valid(This); + if (FAILED(hr) || This->locked) { + pthread_mutex_unlock(&pulse_lock); + return FAILED(hr) ? hr : AUDCLNT_E_OUT_OF_ORDER; + } + if (!frames) { + pthread_mutex_unlock(&pulse_lock); + return S_OK; + } + + ACImpl_GetRenderPad(This, &pad); + avail = This->bufsize_frames - pad; + if (avail < frames || bytes > This->bufsize_bytes) { + pthread_mutex_unlock(&pulse_lock); + WARN("Wanted to write %u, but only %zu available\n", frames, avail); + return AUDCLNT_E_BUFFER_TOO_LARGE; + } + + This->locked = frames; + req = bytes; + ret = pa_stream_begin_write(This->stream, &This->locked_ptr, &req); + if (ret < 0 || req < bytes) { + FIXME("%p Not using pulse locked data: %i %zu/%u %u/%u\n", This, ret, req/pa_frame_size(&This->ss), frames, pad, This->bufsize_frames); + if (ret >= 0) + pa_stream_cancel_write(This->stream); + *data = This->tmp_buffer; + This->locked_ptr = NULL; + } else + *data = This->locked_ptr; + pthread_mutex_unlock(&pulse_lock); + return hr; +} + +static void pulse_free_noop(void *buf) +{ +} + +static HRESULT WINAPI AudioRenderClient_ReleaseBuffer( + IAudioRenderClient *iface, UINT32 written_frames, DWORD flags) +{ + ACImpl *This = impl_from_IAudioRenderClient(iface); + UINT32 written_bytes = written_frames * pa_frame_size(&This->ss); + + TRACE("(%p)->(%u, %x)\n", This, written_frames, flags); + + pthread_mutex_lock(&pulse_lock); + if (!This->locked || !written_frames) { + if (This->locked_ptr) + pa_stream_cancel_write(This->stream); + This->locked = 0; + This->locked_ptr = NULL; + pthread_mutex_unlock(&pulse_lock); + return written_frames ? AUDCLNT_E_OUT_OF_ORDER : S_OK; + } + + if (This->locked < written_frames) { + pthread_mutex_unlock(&pulse_lock); + return AUDCLNT_E_INVALID_SIZE; + } + + This->locked = 0; + if (This->locked_ptr) { + if (flags & AUDCLNT_BUFFERFLAGS_SILENT) + silence_buffer(This->ss.format, This->locked_ptr, written_bytes); + pa_stream_write(This->stream, This->locked_ptr, written_bytes, NULL, 0, PA_SEEK_RELATIVE); + } else { + if (flags & AUDCLNT_BUFFERFLAGS_SILENT) + silence_buffer(This->ss.format, This->tmp_buffer, written_bytes); + pa_stream_write(This->stream, This->tmp_buffer, written_bytes, pulse_free_noop, 0, PA_SEEK_RELATIVE); + } + + This->pad += written_bytes; + This->locked_ptr = NULL; + TRACE("Released %u, pad %zu\n", written_frames, This->pad / pa_frame_size(&This->ss)); + assert(This->pad <= This->bufsize_bytes); + + pthread_mutex_unlock(&pulse_lock); + return S_OK; +} + +static const IAudioRenderClientVtbl AudioRenderClient_Vtbl = { + AudioRenderClient_QueryInterface, + AudioRenderClient_AddRef, + AudioRenderClient_Release, + AudioRenderClient_GetBuffer, + AudioRenderClient_ReleaseBuffer +}; + +static HRESULT WINAPI AudioCaptureClient_QueryInterface( + IAudioCaptureClient *iface, REFIID riid, void **ppv) +{ + ACImpl *This = impl_from_IAudioCaptureClient(iface); + TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); + + if (!ppv) + return E_POINTER; + *ppv = NULL; + + if (IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_IAudioCaptureClient)) + *ppv = iface; + if (*ppv) { + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; + } + + if (IsEqualIID(riid, &IID_IMarshal)) + return IUnknown_QueryInterface(This->marshal, riid, ppv); + + WARN("Unknown interface %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI AudioCaptureClient_AddRef(IAudioCaptureClient *iface) +{ + ACImpl *This = impl_from_IAudioCaptureClient(iface); + return IAudioClient_AddRef(&This->IAudioClient_iface); +} + +static ULONG WINAPI AudioCaptureClient_Release(IAudioCaptureClient *iface) +{ + ACImpl *This = impl_from_IAudioCaptureClient(iface); + return IAudioClient_Release(&This->IAudioClient_iface); +} + +static HRESULT WINAPI AudioCaptureClient_GetBuffer(IAudioCaptureClient *iface, + BYTE **data, UINT32 *frames, DWORD *flags, UINT64 *devpos, + UINT64 *qpcpos) +{ + ACImpl *This = impl_from_IAudioCaptureClient(iface); + HRESULT hr; + ACPacket *packet; + + TRACE("(%p)->(%p, %p, %p, %p, %p)\n", This, data, frames, flags, + devpos, qpcpos); + + if (!data || !frames || !flags) + return E_POINTER; + + pthread_mutex_lock(&pulse_lock); + hr = pulse_stream_valid(This); + if (FAILED(hr) || This->locked) { + pthread_mutex_unlock(&pulse_lock); + return FAILED(hr) ? hr : AUDCLNT_E_OUT_OF_ORDER; + } + + ACImpl_GetCapturePad(This, NULL); + if ((packet = This->locked_ptr)) { + *frames = This->capture_period / pa_frame_size(&This->ss); + *flags = 0; + if (packet->discont) + *flags |= AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY; + if (devpos) { + if (packet->discont) + *devpos = (This->clock_written + This->capture_period) / pa_frame_size(&This->ss); + else + *devpos = This->clock_written / pa_frame_size(&This->ss); + } + if (qpcpos) + *qpcpos = packet->qpcpos; + *data = packet->data; + } + else + *frames = 0; + This->locked = *frames; + pthread_mutex_unlock(&pulse_lock); + return *frames ? S_OK : AUDCLNT_S_BUFFER_EMPTY; +} + +static HRESULT WINAPI AudioCaptureClient_ReleaseBuffer( + IAudioCaptureClient *iface, UINT32 done) +{ + ACImpl *This = impl_from_IAudioCaptureClient(iface); + + TRACE("(%p)->(%u)\n", This, done); + + pthread_mutex_lock(&pulse_lock); + if (!This->locked && done) { + pthread_mutex_unlock(&pulse_lock); + return AUDCLNT_E_OUT_OF_ORDER; + } + if (done && This->locked != done) { + pthread_mutex_unlock(&pulse_lock); + return AUDCLNT_E_INVALID_SIZE; + } + if (done) { + ACPacket *packet = This->locked_ptr; + This->locked_ptr = NULL; + This->pad -= This->capture_period; + if (packet->discont) + This->clock_written += 2 * This->capture_period; + else + This->clock_written += This->capture_period; + list_add_tail(&This->packet_free_head, &packet->entry); + } + This->locked = 0; + pthread_mutex_unlock(&pulse_lock); + return S_OK; +} + +static HRESULT WINAPI AudioCaptureClient_GetNextPacketSize( + IAudioCaptureClient *iface, UINT32 *frames) +{ + ACImpl *This = impl_from_IAudioCaptureClient(iface); + + TRACE("(%p)->(%p)\n", This, frames); + if (!frames) + return E_POINTER; + + pthread_mutex_lock(&pulse_lock); + ACImpl_GetCapturePad(This, NULL); + if (This->locked_ptr) + *frames = This->capture_period / pa_frame_size(&This->ss); + else + *frames = 0; + pthread_mutex_unlock(&pulse_lock); + return S_OK; +} + +static const IAudioCaptureClientVtbl AudioCaptureClient_Vtbl = +{ + AudioCaptureClient_QueryInterface, + AudioCaptureClient_AddRef, + AudioCaptureClient_Release, + AudioCaptureClient_GetBuffer, + AudioCaptureClient_ReleaseBuffer, + AudioCaptureClient_GetNextPacketSize +}; + +static HRESULT WINAPI AudioClock_QueryInterface(IAudioClock *iface, + REFIID riid, void **ppv) +{ + ACImpl *This = impl_from_IAudioClock(iface); + + TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); + + if (!ppv) + return E_POINTER; + *ppv = NULL; + + if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IAudioClock)) + *ppv = iface; + else if (IsEqualIID(riid, &IID_IAudioClock2)) + *ppv = &This->IAudioClock2_iface; + if (*ppv) { + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; + } + + if (IsEqualIID(riid, &IID_IMarshal)) + return IUnknown_QueryInterface(This->marshal, riid, ppv); + + WARN("Unknown interface %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI AudioClock_AddRef(IAudioClock *iface) +{ + ACImpl *This = impl_from_IAudioClock(iface); + return IAudioClient_AddRef(&This->IAudioClient_iface); +} + +static ULONG WINAPI AudioClock_Release(IAudioClock *iface) +{ + ACImpl *This = impl_from_IAudioClock(iface); + return IAudioClient_Release(&This->IAudioClient_iface); +} + +static HRESULT WINAPI AudioClock_GetFrequency(IAudioClock *iface, UINT64 *freq) +{ + ACImpl *This = impl_from_IAudioClock(iface); + HRESULT hr; + + TRACE("(%p)->(%p)\n", This, freq); + + pthread_mutex_lock(&pulse_lock); + hr = pulse_stream_valid(This); + if (SUCCEEDED(hr)) { + if (This->share == AUDCLNT_SHAREMODE_SHARED) + *freq = This->ss.rate * pa_frame_size(&This->ss); + else + *freq = This->ss.rate; + } + pthread_mutex_unlock(&pulse_lock); + return hr; +} + +static HRESULT WINAPI AudioClock_GetPosition(IAudioClock *iface, UINT64 *pos, + UINT64 *qpctime) +{ + ACImpl *This = impl_from_IAudioClock(iface); + HRESULT hr; + + TRACE("(%p)->(%p, %p)\n", This, pos, qpctime); + + if (!pos) + return E_POINTER; + + pthread_mutex_lock(&pulse_lock); + hr = pulse_stream_valid(This); + if (FAILED(hr)) { + pthread_mutex_unlock(&pulse_lock); + return hr; + } + + *pos = This->clock_written; + + if (This->share == AUDCLNT_SHAREMODE_EXCLUSIVE) + *pos /= pa_frame_size(&This->ss); + + /* Make time never go backwards */ + if (*pos < This->clock_lastpos) + *pos = This->clock_lastpos; + else + This->clock_lastpos = *pos; + pthread_mutex_unlock(&pulse_lock); + + TRACE("%p Position: %u\n", This, (unsigned)*pos); + + if (qpctime) { + LARGE_INTEGER stamp, freq; + QueryPerformanceCounter(&stamp); + QueryPerformanceFrequency(&freq); + *qpctime = (stamp.QuadPart * (INT64)10000000) / freq.QuadPart; + } + + return S_OK; +} + +static HRESULT WINAPI AudioClock_GetCharacteristics(IAudioClock *iface, + DWORD *chars) +{ + ACImpl *This = impl_from_IAudioClock(iface); + + TRACE("(%p)->(%p)\n", This, chars); + + if (!chars) + return E_POINTER; + + *chars = AUDIOCLOCK_CHARACTERISTIC_FIXED_FREQ; + + return S_OK; +} + +static const IAudioClockVtbl AudioClock_Vtbl = +{ + AudioClock_QueryInterface, + AudioClock_AddRef, + AudioClock_Release, + AudioClock_GetFrequency, + AudioClock_GetPosition, + AudioClock_GetCharacteristics +}; + +static HRESULT WINAPI AudioClock2_QueryInterface(IAudioClock2 *iface, + REFIID riid, void **ppv) +{ + ACImpl *This = impl_from_IAudioClock2(iface); + return IAudioClock_QueryInterface(&This->IAudioClock_iface, riid, ppv); +} + +static ULONG WINAPI AudioClock2_AddRef(IAudioClock2 *iface) +{ + ACImpl *This = impl_from_IAudioClock2(iface); + return IAudioClient_AddRef(&This->IAudioClient_iface); +} + +static ULONG WINAPI AudioClock2_Release(IAudioClock2 *iface) +{ + ACImpl *This = impl_from_IAudioClock2(iface); + return IAudioClient_Release(&This->IAudioClient_iface); +} + +static HRESULT WINAPI AudioClock2_GetDevicePosition(IAudioClock2 *iface, + UINT64 *pos, UINT64 *qpctime) +{ + ACImpl *This = impl_from_IAudioClock2(iface); + HRESULT hr = AudioClock_GetPosition(&This->IAudioClock_iface, pos, qpctime); + if (SUCCEEDED(hr) && This->share == AUDCLNT_SHAREMODE_SHARED) + *pos /= pa_frame_size(&This->ss); + return hr; +} + +static const IAudioClock2Vtbl AudioClock2_Vtbl = +{ + AudioClock2_QueryInterface, + AudioClock2_AddRef, + AudioClock2_Release, + AudioClock2_GetDevicePosition +}; + +static HRESULT WINAPI AudioStreamVolume_QueryInterface( + IAudioStreamVolume *iface, REFIID riid, void **ppv) +{ + ACImpl *This = impl_from_IAudioStreamVolume(iface); + + TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); + + if (!ppv) + return E_POINTER; + *ppv = NULL; + + if (IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_IAudioStreamVolume)) + *ppv = iface; + if (*ppv) { + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; + } + + if (IsEqualIID(riid, &IID_IMarshal)) + return IUnknown_QueryInterface(This->marshal, riid, ppv); + + WARN("Unknown interface %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI AudioStreamVolume_AddRef(IAudioStreamVolume *iface) +{ + ACImpl *This = impl_from_IAudioStreamVolume(iface); + return IAudioClient_AddRef(&This->IAudioClient_iface); +} + +static ULONG WINAPI AudioStreamVolume_Release(IAudioStreamVolume *iface) +{ + ACImpl *This = impl_from_IAudioStreamVolume(iface); + return IAudioClient_Release(&This->IAudioClient_iface); +} + +static HRESULT WINAPI AudioStreamVolume_GetChannelCount( + IAudioStreamVolume *iface, UINT32 *out) +{ + ACImpl *This = impl_from_IAudioStreamVolume(iface); + + TRACE("(%p)->(%p)\n", This, out); + + if (!out) + return E_POINTER; + + *out = This->ss.channels; + + return S_OK; +} + +struct pulse_info_cb_data { + UINT32 n; + float *levels; +}; + +static HRESULT WINAPI AudioStreamVolume_SetAllVolumes( + IAudioStreamVolume *iface, UINT32 count, const float *levels) +{ + ACImpl *This = impl_from_IAudioStreamVolume(iface); + HRESULT hr; + int i; + + TRACE("(%p)->(%d, %p)\n", This, count, levels); + + if (!levels) + return E_POINTER; + + if (count != This->ss.channels) + return E_INVALIDARG; + + pthread_mutex_lock(&pulse_lock); + hr = pulse_stream_valid(This); + if (FAILED(hr)) + goto out; + + for (i = 0; i < count; ++i) + This->vol[i] = levels[i]; + +out: + pthread_mutex_unlock(&pulse_lock); + return hr; +} + +static HRESULT WINAPI AudioStreamVolume_GetAllVolumes( + IAudioStreamVolume *iface, UINT32 count, float *levels) +{ + ACImpl *This = impl_from_IAudioStreamVolume(iface); + HRESULT hr; + int i; + + TRACE("(%p)->(%d, %p)\n", This, count, levels); + + if (!levels) + return E_POINTER; + + if (count != This->ss.channels) + return E_INVALIDARG; + + pthread_mutex_lock(&pulse_lock); + hr = pulse_stream_valid(This); + if (FAILED(hr)) + goto out; + + for (i = 0; i < count; ++i) + levels[i] = This->vol[i]; + +out: + pthread_mutex_unlock(&pulse_lock); + return hr; +} + +static HRESULT WINAPI AudioStreamVolume_SetChannelVolume( + IAudioStreamVolume *iface, UINT32 index, float level) +{ + ACImpl *This = impl_from_IAudioStreamVolume(iface); + HRESULT hr; + float volumes[PA_CHANNELS_MAX]; + + TRACE("(%p)->(%d, %f)\n", This, index, level); + + if (level < 0.f || level > 1.f) + return E_INVALIDARG; + + if (index >= This->ss.channels) + return E_INVALIDARG; + + hr = AudioStreamVolume_GetAllVolumes(iface, This->ss.channels, volumes); + volumes[index] = level; + if (SUCCEEDED(hr)) + hr = AudioStreamVolume_SetAllVolumes(iface, This->ss.channels, volumes); + return hr; +} + +static HRESULT WINAPI AudioStreamVolume_GetChannelVolume( + IAudioStreamVolume *iface, UINT32 index, float *level) +{ + ACImpl *This = impl_from_IAudioStreamVolume(iface); + float volumes[PA_CHANNELS_MAX]; + HRESULT hr; + + TRACE("(%p)->(%d, %p)\n", This, index, level); + + if (!level) + return E_POINTER; + + if (index >= This->ss.channels) + return E_INVALIDARG; + + hr = AudioStreamVolume_GetAllVolumes(iface, This->ss.channels, volumes); + if (SUCCEEDED(hr)) + *level = volumes[index]; + return hr; +} + +static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl = +{ + AudioStreamVolume_QueryInterface, + AudioStreamVolume_AddRef, + AudioStreamVolume_Release, + AudioStreamVolume_GetChannelCount, + AudioStreamVolume_SetChannelVolume, + AudioStreamVolume_GetChannelVolume, + AudioStreamVolume_SetAllVolumes, + AudioStreamVolume_GetAllVolumes +}; + +static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client) +{ + AudioSessionWrapper *ret; + + ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + sizeof(AudioSessionWrapper)); + if (!ret) + return NULL; + + ret->IAudioSessionControl2_iface.lpVtbl = &AudioSessionControl2_Vtbl; + ret->ISimpleAudioVolume_iface.lpVtbl = &SimpleAudioVolume_Vtbl; + ret->IChannelAudioVolume_iface.lpVtbl = &ChannelAudioVolume_Vtbl; + + ret->ref = !client; + + ret->client = client; + if (client) { + ret->session = client->session; + AudioClient_AddRef(&client->IAudioClient_iface); + } + + return ret; +} + +static HRESULT WINAPI AudioSessionControl_QueryInterface( + IAudioSessionControl2 *iface, REFIID riid, void **ppv) +{ + TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); + + if (!ppv) + return E_POINTER; + *ppv = NULL; + + if (IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_IAudioSessionControl) || + IsEqualIID(riid, &IID_IAudioSessionControl2)) + *ppv = iface; + if (*ppv) { + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; + } + + WARN("Unknown interface %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI AudioSessionControl_AddRef(IAudioSessionControl2 *iface) +{ + AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); + ULONG ref; + ref = InterlockedIncrement(&This->ref); + TRACE("(%p) Refcount now %u\n", This, ref); + return ref; +} + +static ULONG WINAPI AudioSessionControl_Release(IAudioSessionControl2 *iface) +{ + AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); + ULONG ref; + ref = InterlockedDecrement(&This->ref); + TRACE("(%p) Refcount now %u\n", This, ref); + if (!ref) { + if (This->client) { + This->client->session_wrapper = NULL; + AudioClient_Release(&This->client->IAudioClient_iface); + } + HeapFree(GetProcessHeap(), 0, This); + } + return ref; +} + +static HRESULT WINAPI AudioSessionControl_GetState(IAudioSessionControl2 *iface, + AudioSessionState *state) +{ + AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); + ACImpl *client; + + TRACE("(%p)->(%p)\n", This, state); + + if (!state) + return NULL_PTR_ERR; + + pthread_mutex_lock(&pulse_lock); + if (list_empty(&This->session->clients)) { + *state = AudioSessionStateExpired; + goto out; + } + LIST_FOR_EACH_ENTRY(client, &This->session->clients, ACImpl, entry) { + if (client->started) { + *state = AudioSessionStateActive; + goto out; + } + } + *state = AudioSessionStateInactive; + +out: + pthread_mutex_unlock(&pulse_lock); + return S_OK; +} + +static HRESULT WINAPI AudioSessionControl_GetDisplayName( + IAudioSessionControl2 *iface, WCHAR **name) +{ + AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); + + FIXME("(%p)->(%p) - stub\n", This, name); + + return E_NOTIMPL; +} + +static HRESULT WINAPI AudioSessionControl_SetDisplayName( + IAudioSessionControl2 *iface, const WCHAR *name, const GUID *session) +{ + AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); + + FIXME("(%p)->(%p, %s) - stub\n", This, name, debugstr_guid(session)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI AudioSessionControl_GetIconPath( + IAudioSessionControl2 *iface, WCHAR **path) +{ + AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); + + FIXME("(%p)->(%p) - stub\n", This, path); + + return E_NOTIMPL; +} + +static HRESULT WINAPI AudioSessionControl_SetIconPath( + IAudioSessionControl2 *iface, const WCHAR *path, const GUID *session) +{ + AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); + + FIXME("(%p)->(%p, %s) - stub\n", This, path, debugstr_guid(session)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI AudioSessionControl_GetGroupingParam( + IAudioSessionControl2 *iface, GUID *group) +{ + AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); + + FIXME("(%p)->(%p) - stub\n", This, group); + + return E_NOTIMPL; +} + +static HRESULT WINAPI AudioSessionControl_SetGroupingParam( + IAudioSessionControl2 *iface, const GUID *group, const GUID *session) +{ + AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); + + FIXME("(%p)->(%s, %s) - stub\n", This, debugstr_guid(group), + debugstr_guid(session)); + + return E_NOTIMPL; +} + +static HRESULT WINAPI AudioSessionControl_RegisterAudioSessionNotification( + IAudioSessionControl2 *iface, IAudioSessionEvents *events) +{ + AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); + + FIXME("(%p)->(%p) - stub\n", This, events); + + return S_OK; +} + +static HRESULT WINAPI AudioSessionControl_UnregisterAudioSessionNotification( + IAudioSessionControl2 *iface, IAudioSessionEvents *events) +{ + AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); + + FIXME("(%p)->(%p) - stub\n", This, events); + + return S_OK; +} + +static HRESULT WINAPI AudioSessionControl_GetSessionIdentifier( + IAudioSessionControl2 *iface, WCHAR **id) +{ + AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); + + FIXME("(%p)->(%p) - stub\n", This, id); + + return E_NOTIMPL; +} + +static HRESULT WINAPI AudioSessionControl_GetSessionInstanceIdentifier( + IAudioSessionControl2 *iface, WCHAR **id) +{ + AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); + + FIXME("(%p)->(%p) - stub\n", This, id); + + return E_NOTIMPL; +} + +static HRESULT WINAPI AudioSessionControl_GetProcessId( + IAudioSessionControl2 *iface, DWORD *pid) +{ + AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); + + TRACE("(%p)->(%p)\n", This, pid); + + if (!pid) + return E_POINTER; + + *pid = GetCurrentProcessId(); + + return S_OK; +} + +static HRESULT WINAPI AudioSessionControl_IsSystemSoundsSession( + IAudioSessionControl2 *iface) +{ + AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); + + TRACE("(%p)\n", This); + + return S_FALSE; +} + +static HRESULT WINAPI AudioSessionControl_SetDuckingPreference( + IAudioSessionControl2 *iface, BOOL optout) +{ + AudioSessionWrapper *This = impl_from_IAudioSessionControl2(iface); + + TRACE("(%p)->(%d)\n", This, optout); + + return S_OK; +} + +static const IAudioSessionControl2Vtbl AudioSessionControl2_Vtbl = +{ + AudioSessionControl_QueryInterface, + AudioSessionControl_AddRef, + AudioSessionControl_Release, + AudioSessionControl_GetState, + AudioSessionControl_GetDisplayName, + AudioSessionControl_SetDisplayName, + AudioSessionControl_GetIconPath, + AudioSessionControl_SetIconPath, + AudioSessionControl_GetGroupingParam, + AudioSessionControl_SetGroupingParam, + AudioSessionControl_RegisterAudioSessionNotification, + AudioSessionControl_UnregisterAudioSessionNotification, + AudioSessionControl_GetSessionIdentifier, + AudioSessionControl_GetSessionInstanceIdentifier, + AudioSessionControl_GetProcessId, + AudioSessionControl_IsSystemSoundsSession, + AudioSessionControl_SetDuckingPreference +}; + +typedef struct _SessionMgr { + IAudioSessionManager2 IAudioSessionManager2_iface; + + LONG ref; + + IMMDevice *device; +} SessionMgr; + +static HRESULT WINAPI AudioSessionManager_QueryInterface(IAudioSessionManager2 *iface, + REFIID riid, void **ppv) +{ + TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); + + if (!ppv) + return E_POINTER; + *ppv = NULL; + + if (IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_IAudioSessionManager) || + IsEqualIID(riid, &IID_IAudioSessionManager2)) + *ppv = iface; + if (*ppv) { + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; + } + + WARN("Unknown interface %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static inline SessionMgr *impl_from_IAudioSessionManager2(IAudioSessionManager2 *iface) +{ + return CONTAINING_RECORD(iface, SessionMgr, IAudioSessionManager2_iface); +} + +static ULONG WINAPI AudioSessionManager_AddRef(IAudioSessionManager2 *iface) +{ + SessionMgr *This = impl_from_IAudioSessionManager2(iface); + ULONG ref; + ref = InterlockedIncrement(&This->ref); + TRACE("(%p) Refcount now %u\n", This, ref); + return ref; +} + +static ULONG WINAPI AudioSessionManager_Release(IAudioSessionManager2 *iface) +{ + SessionMgr *This = impl_from_IAudioSessionManager2(iface); + ULONG ref; + ref = InterlockedDecrement(&This->ref); + TRACE("(%p) Refcount now %u\n", This, ref); + if (!ref) + HeapFree(GetProcessHeap(), 0, This); + return ref; +} + +static HRESULT WINAPI AudioSessionManager_GetAudioSessionControl( + IAudioSessionManager2 *iface, const GUID *session_guid, DWORD flags, + IAudioSessionControl **out) +{ + SessionMgr *This = impl_from_IAudioSessionManager2(iface); + AudioSession *session; + AudioSessionWrapper *wrapper; + HRESULT hr; + + TRACE("(%p)->(%s, %x, %p)\n", This, debugstr_guid(session_guid), + flags, out); + + hr = get_audio_session(session_guid, This->device, 0, &session); + if (FAILED(hr)) + return hr; + + wrapper = AudioSessionWrapper_Create(NULL); + if (!wrapper) + return E_OUTOFMEMORY; + + wrapper->session = session; + + *out = (IAudioSessionControl*)&wrapper->IAudioSessionControl2_iface; + + return S_OK; +} + +static HRESULT WINAPI AudioSessionManager_GetSimpleAudioVolume( + IAudioSessionManager2 *iface, const GUID *session_guid, DWORD flags, + ISimpleAudioVolume **out) +{ + SessionMgr *This = impl_from_IAudioSessionManager2(iface); + AudioSession *session; + AudioSessionWrapper *wrapper; + HRESULT hr; + + TRACE("(%p)->(%s, %x, %p)\n", This, debugstr_guid(session_guid), + flags, out); + + hr = get_audio_session(session_guid, This->device, 0, &session); + if (FAILED(hr)) + return hr; + + wrapper = AudioSessionWrapper_Create(NULL); + if (!wrapper) + return E_OUTOFMEMORY; + + wrapper->session = session; + + *out = &wrapper->ISimpleAudioVolume_iface; + + return S_OK; +} + +static HRESULT WINAPI AudioSessionManager_GetSessionEnumerator( + IAudioSessionManager2 *iface, IAudioSessionEnumerator **out) +{ + SessionMgr *This = impl_from_IAudioSessionManager2(iface); + FIXME("(%p)->(%p) - stub\n", This, out); + return E_NOTIMPL; +} + +static HRESULT WINAPI AudioSessionManager_RegisterSessionNotification( + IAudioSessionManager2 *iface, IAudioSessionNotification *notification) +{ + SessionMgr *This = impl_from_IAudioSessionManager2(iface); + FIXME("(%p)->(%p) - stub\n", This, notification); + return E_NOTIMPL; +} + +static HRESULT WINAPI AudioSessionManager_UnregisterSessionNotification( + IAudioSessionManager2 *iface, IAudioSessionNotification *notification) +{ + SessionMgr *This = impl_from_IAudioSessionManager2(iface); + FIXME("(%p)->(%p) - stub\n", This, notification); + return E_NOTIMPL; +} + +static HRESULT WINAPI AudioSessionManager_RegisterDuckNotification( + IAudioSessionManager2 *iface, const WCHAR *session_id, + IAudioVolumeDuckNotification *notification) +{ + SessionMgr *This = impl_from_IAudioSessionManager2(iface); + FIXME("(%p)->(%p) - stub\n", This, notification); + return E_NOTIMPL; +} + +static HRESULT WINAPI AudioSessionManager_UnregisterDuckNotification( + IAudioSessionManager2 *iface, + IAudioVolumeDuckNotification *notification) +{ + SessionMgr *This = impl_from_IAudioSessionManager2(iface); + FIXME("(%p)->(%p) - stub\n", This, notification); + return E_NOTIMPL; +} + +static const IAudioSessionManager2Vtbl AudioSessionManager2_Vtbl = +{ + AudioSessionManager_QueryInterface, + AudioSessionManager_AddRef, + AudioSessionManager_Release, + AudioSessionManager_GetAudioSessionControl, + AudioSessionManager_GetSimpleAudioVolume, + AudioSessionManager_GetSessionEnumerator, + AudioSessionManager_RegisterSessionNotification, + AudioSessionManager_UnregisterSessionNotification, + AudioSessionManager_RegisterDuckNotification, + AudioSessionManager_UnregisterDuckNotification +}; + +static HRESULT WINAPI SimpleAudioVolume_QueryInterface( + ISimpleAudioVolume *iface, REFIID riid, void **ppv) +{ + TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); + + if (!ppv) + return E_POINTER; + *ppv = NULL; + + if (IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_ISimpleAudioVolume)) + *ppv = iface; + if (*ppv) { + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; + } + + WARN("Unknown interface %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI SimpleAudioVolume_AddRef(ISimpleAudioVolume *iface) +{ + AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); + return AudioSessionControl_AddRef(&This->IAudioSessionControl2_iface); +} + +static ULONG WINAPI SimpleAudioVolume_Release(ISimpleAudioVolume *iface) +{ + AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); + return AudioSessionControl_Release(&This->IAudioSessionControl2_iface); +} + +static HRESULT WINAPI SimpleAudioVolume_SetMasterVolume( + ISimpleAudioVolume *iface, float level, const GUID *context) +{ + AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); + AudioSession *session = This->session; + + TRACE("(%p)->(%f, %s)\n", session, level, wine_dbgstr_guid(context)); + + if (level < 0.f || level > 1.f) + return E_INVALIDARG; + + if (context) + FIXME("Notifications not supported yet\n"); + + TRACE("Pulseaudio does not support session volume control\n"); + + pthread_mutex_lock(&pulse_lock); + session->master_vol = level; + pthread_mutex_unlock(&pulse_lock); + + return S_OK; +} + +static HRESULT WINAPI SimpleAudioVolume_GetMasterVolume( + ISimpleAudioVolume *iface, float *level) +{ + AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); + AudioSession *session = This->session; + + TRACE("(%p)->(%p)\n", session, level); + + if (!level) + return NULL_PTR_ERR; + + *level = session->master_vol; + + return S_OK; +} + +static HRESULT WINAPI SimpleAudioVolume_SetMute(ISimpleAudioVolume *iface, + BOOL mute, const GUID *context) +{ + AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); + AudioSession *session = This->session; + + TRACE("(%p)->(%u, %p)\n", session, mute, context); + + if (context) + FIXME("Notifications not supported yet\n"); + + session->mute = mute; + + return S_OK; +} + +static HRESULT WINAPI SimpleAudioVolume_GetMute(ISimpleAudioVolume *iface, + BOOL *mute) +{ + AudioSessionWrapper *This = impl_from_ISimpleAudioVolume(iface); + AudioSession *session = This->session; + + TRACE("(%p)->(%p)\n", session, mute); + + if (!mute) + return NULL_PTR_ERR; + + *mute = session->mute; + + return S_OK; +} + +static const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl = +{ + SimpleAudioVolume_QueryInterface, + SimpleAudioVolume_AddRef, + SimpleAudioVolume_Release, + SimpleAudioVolume_SetMasterVolume, + SimpleAudioVolume_GetMasterVolume, + SimpleAudioVolume_SetMute, + SimpleAudioVolume_GetMute +}; + +static HRESULT WINAPI ChannelAudioVolume_QueryInterface( + IChannelAudioVolume *iface, REFIID riid, void **ppv) +{ + TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); + + if (!ppv) + return E_POINTER; + *ppv = NULL; + + if (IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_IChannelAudioVolume)) + *ppv = iface; + if (*ppv) { + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; + } + + WARN("Unknown interface %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI ChannelAudioVolume_AddRef(IChannelAudioVolume *iface) +{ + AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); + return AudioSessionControl_AddRef(&This->IAudioSessionControl2_iface); +} + +static ULONG WINAPI ChannelAudioVolume_Release(IChannelAudioVolume *iface) +{ + AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); + return AudioSessionControl_Release(&This->IAudioSessionControl2_iface); +} + +static HRESULT WINAPI ChannelAudioVolume_GetChannelCount( + IChannelAudioVolume *iface, UINT32 *out) +{ + AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); + AudioSession *session = This->session; + + TRACE("(%p)->(%p)\n", session, out); + + if (!out) + return NULL_PTR_ERR; + + *out = session->channel_count; + + return S_OK; +} + +static HRESULT WINAPI ChannelAudioVolume_SetChannelVolume( + IChannelAudioVolume *iface, UINT32 index, float level, + const GUID *context) +{ + AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); + AudioSession *session = This->session; + + TRACE("(%p)->(%d, %f, %s)\n", session, index, level, + wine_dbgstr_guid(context)); + + if (level < 0.f || level > 1.f) + return E_INVALIDARG; + + if (index >= session->channel_count) + return E_INVALIDARG; + + if (context) + FIXME("Notifications not supported yet\n"); + + TRACE("Pulseaudio does not support session volume control\n"); + + pthread_mutex_lock(&pulse_lock); + session->channel_vols[index] = level; + pthread_mutex_unlock(&pulse_lock); + + return S_OK; +} + +static HRESULT WINAPI ChannelAudioVolume_GetChannelVolume( + IChannelAudioVolume *iface, UINT32 index, float *level) +{ + AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); + AudioSession *session = This->session; + + TRACE("(%p)->(%d, %p)\n", session, index, level); + + if (!level) + return NULL_PTR_ERR; + + if (index >= session->channel_count) + return E_INVALIDARG; + + *level = session->channel_vols[index]; + + return S_OK; +} + +static HRESULT WINAPI ChannelAudioVolume_SetAllVolumes( + IChannelAudioVolume *iface, UINT32 count, const float *levels, + const GUID *context) +{ + AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); + AudioSession *session = This->session; + int i; + + TRACE("(%p)->(%d, %p, %s)\n", session, count, levels, + wine_dbgstr_guid(context)); + + if (!levels) + return NULL_PTR_ERR; + + if (count != session->channel_count) + return E_INVALIDARG; + + if (context) + FIXME("Notifications not supported yet\n"); + + TRACE("Pulseaudio does not support session volume control\n"); + + pthread_mutex_lock(&pulse_lock); + for(i = 0; i < count; ++i) + session->channel_vols[i] = levels[i]; + pthread_mutex_unlock(&pulse_lock); + return S_OK; +} + +static HRESULT WINAPI ChannelAudioVolume_GetAllVolumes( + IChannelAudioVolume *iface, UINT32 count, float *levels) +{ + AudioSessionWrapper *This = impl_from_IChannelAudioVolume(iface); + AudioSession *session = This->session; + int i; + + TRACE("(%p)->(%d, %p)\n", session, count, levels); + + if (!levels) + return NULL_PTR_ERR; + + if (count != session->channel_count) + return E_INVALIDARG; + + for(i = 0; i < count; ++i) + levels[i] = session->channel_vols[i]; + + return S_OK; +} + +static const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl = +{ + ChannelAudioVolume_QueryInterface, + ChannelAudioVolume_AddRef, + ChannelAudioVolume_Release, + ChannelAudioVolume_GetChannelCount, + ChannelAudioVolume_SetChannelVolume, + ChannelAudioVolume_GetChannelVolume, + ChannelAudioVolume_SetAllVolumes, + ChannelAudioVolume_GetAllVolumes +}; + +HRESULT WINAPI AUDDRV_GetAudioSessionManager(IMMDevice *device, + IAudioSessionManager2 **out) +{ + SessionMgr *This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SessionMgr)); + *out = NULL; + if (!This) + return E_OUTOFMEMORY; + This->IAudioSessionManager2_iface.lpVtbl = &AudioSessionManager2_Vtbl; + This->device = device; + This->ref = 1; + *out = &This->IAudioSessionManager2_iface; + return S_OK; +} + +HRESULT WINAPI AUDDRV_GetPropValue(GUID *guid, const PROPERTYKEY *prop, PROPVARIANT *out) +{ + TRACE("%s, (%s,%u), %p\n", wine_dbgstr_guid(guid), wine_dbgstr_guid(&prop->fmtid), prop->pid, out); + + if (IsEqualGUID(guid, &pulse_render_guid) && IsEqualPropertyKey(*prop, PKEY_AudioEndpoint_PhysicalSpeakers)) { + out->vt = VT_UI4; + out->u.ulVal = g_phys_speakers_mask; + + return out->u.ulVal ? S_OK : E_FAIL; + } + + return E_NOTIMPL; +} diff -Nru wine1.7-1.7.50/dlls/winepulse.drv/winepulse.drv.spec wine1.7-1.7.55/dlls/winepulse.drv/winepulse.drv.spec --- wine1.7-1.7.50/dlls/winepulse.drv/winepulse.drv.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/winepulse.drv/winepulse.drv.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,11 @@ +# MMDevAPI driver functions +@ stdcall -private GetPriority() AUDDRV_GetPriority +@ stdcall -private GetEndpointIDs(long ptr ptr ptr ptr) AUDDRV_GetEndpointIDs +@ stdcall -private GetAudioEndpoint(ptr ptr ptr) AUDDRV_GetAudioEndpoint +@ stdcall -private GetAudioSessionManager(ptr ptr) AUDDRV_GetAudioSessionManager +@ stdcall -private GetPropValue(ptr ptr ptr) AUDDRV_GetPropValue + +# WinMM driver functions +@ stdcall -private DriverProc(long long long long long) winealsa.drv.DriverProc +@ stdcall -private midMessage(long long long long long) winealsa.drv.midMessage +@ stdcall -private modMessage(long long long long long) winealsa.drv.modMessage diff -Nru wine1.7-1.7.50/dlls/winex11.drv/clipboard.c wine1.7-1.7.55/dlls/winex11.drv/clipboard.c --- wine1.7-1.7.50/dlls/winex11.drv/clipboard.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winex11.drv/clipboard.c 2015-11-13 14:32:40.000000000 +0000 @@ -367,8 +367,19 @@ i = 0; LIST_FOR_EACH_ENTRY( format, &format_list, WINE_CLIPFORMAT, entry ) if (!format->drvData) { - GetClipboardFormatNameW( format->wFormatID, buffer, 256 ); - len = WideCharToMultiByte(CP_UNIXCP, 0, buffer, -1, NULL, 0, NULL, NULL); + if (GetClipboardFormatNameW(format->wFormatID, buffer, 256) > 0) + { + /* use defined format name */ + len = WideCharToMultiByte(CP_UNIXCP, 0, buffer, -1, NULL, 0, NULL, NULL); + } + else + { + /* create a name in the same way as ntdll/atom.c:integral_atom_name + * which is normally used by GetClipboardFormatNameW + */ + static const WCHAR fmt[] = {'#','%','u',0}; + len = sprintfW(buffer, fmt, format->wFormatID) + 1; + } names[i] = HeapAlloc(GetProcessHeap(), 0, len); WideCharToMultiByte(CP_UNIXCP, 0, buffer, -1, names[i++], len, NULL, NULL); } diff -Nru wine1.7-1.7.50/dlls/winex11.drv/init.c wine1.7-1.7.55/dlls/winex11.drv/init.c --- wine1.7-1.7.50/dlls/winex11.drv/init.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winex11.drv/init.c 2015-11-13 14:32:40.000000000 +0000 @@ -500,7 +500,6 @@ NULL, /* pFontIsLinked */ NULL, /* pFrameRgn */ NULL, /* pGdiComment */ - NULL, /* pGdiRealizationInfo */ NULL, /* pGetBoundsRect */ NULL, /* pGetCharABCWidths */ NULL, /* pGetCharABCWidthsI */ @@ -508,6 +507,7 @@ X11DRV_GetDeviceCaps, /* pGetDeviceCaps */ X11DRV_GetDeviceGammaRamp, /* pGetDeviceGammaRamp */ NULL, /* pGetFontData */ + NULL, /* pGetFontRealizationInfo */ NULL, /* pGetFontUnicodeRanges */ NULL, /* pGetGlyphIndices */ NULL, /* pGetGlyphOutline */ diff -Nru wine1.7-1.7.50/dlls/winex11.drv/keyboard.c wine1.7-1.7.55/dlls/winex11.drv/keyboard.c --- wine1.7-1.7.50/dlls/winex11.drv/keyboard.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winex11.drv/keyboard.c 2015-11-13 14:32:40.000000000 +0000 @@ -1592,7 +1592,7 @@ */ langid = PRIMARYLANGID(LANGIDFROMLCID(layout)); if (langid == LANG_CHINESE || langid == LANG_JAPANESE || langid == LANG_KOREAN) - layout |= 0xe001 << 16; /* IME */ + layout = MAKELONG( layout, 0xe001 ); /* IME */ else layout |= layout << 16; diff -Nru wine1.7-1.7.50/dlls/winex11.drv/opengl.c wine1.7-1.7.55/dlls/winex11.drv/opengl.c --- wine1.7-1.7.50/dlls/winex11.drv/opengl.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winex11.drv/opengl.c 2015-11-13 14:32:40.000000000 +0000 @@ -997,7 +997,7 @@ static int get_render_type_from_fbconfig(Display *display, GLXFBConfig fbconfig) { - int render_type=0, render_type_bit; + int render_type, render_type_bit; pglXGetFBConfigAttrib(display, fbconfig, GLX_RENDER_TYPE, &render_type_bit); switch(render_type_bit) { @@ -1015,6 +1015,7 @@ break; default: ERR("Unknown render_type: %x\n", render_type_bit); + render_type = 0; } return render_type; } @@ -1787,7 +1788,7 @@ */ static struct wgl_context *glxdrv_wglCreateContext( HDC hdc ) { - struct wgl_context *ret = NULL; + struct wgl_context *ret; struct gl_drawable *gl; if (!(gl = get_gl_drawable( WindowFromDC( hdc ), hdc ))) @@ -2037,7 +2038,7 @@ static struct wgl_context *X11DRV_wglCreateContextAttribsARB( HDC hdc, struct wgl_context *hShareContext, const int* attribList ) { - struct wgl_context *ret = NULL; + struct wgl_context *ret; struct gl_drawable *gl; int err = 0; @@ -2134,8 +2135,8 @@ static struct wgl_pbuffer *X11DRV_wglCreatePbufferARB( HDC hdc, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList ) { - struct wgl_pbuffer* object = NULL; - const struct wgl_pixel_format *fmt = NULL; + struct wgl_pbuffer* object; + const struct wgl_pixel_format *fmt; int attribs[256]; int nAttribs = 0; @@ -2507,7 +2508,7 @@ { int attribs[256]; int nAttribs = 0; - GLXFBConfig* cfgs = NULL; + GLXFBConfig* cfgs; int nCfgs = 0; int it; int fmt_id; @@ -2613,7 +2614,7 @@ UINT nAttributes, const int *piAttributes, int *piValues ) { UINT i; - const struct wgl_pixel_format *fmt = NULL; + const struct wgl_pixel_format *fmt; int hTest; int tmp; int curGLXAttr = 0; @@ -3029,7 +3030,7 @@ { struct wgl_context *ctx = NtCurrentTeb()->glContext; struct gl_drawable *gl; - BOOL ret = TRUE; + BOOL ret; TRACE("(%d)\n", interval); diff -Nru wine1.7-1.7.50/dlls/winex11.drv/palette.c wine1.7-1.7.55/dlls/winex11.drv/palette.c --- wine1.7-1.7.50/dlls/winex11.drv/palette.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winex11.drv/palette.c 2015-11-13 14:32:40.000000000 +0000 @@ -587,17 +587,17 @@ * cube - based on Greg Kreider's code. */ - int i = 0, idx = 0; + int i = 1, idx = 0; int red, no_r, inc_r; int green, no_g, inc_g; int blue, no_b, inc_b; if (palette_size <= NB_RESERVED_COLORS) return; - while (i*i*i < (palette_size - NB_RESERVED_COLORS)) i++; + while (i*i*i <= (palette_size - NB_RESERVED_COLORS)) i++; no_r = no_g = no_b = --i; - if ((no_r * (no_g+1) * no_b) < (palette_size - NB_RESERVED_COLORS)) no_g++; - if ((no_r * no_g * (no_b+1)) < (palette_size - NB_RESERVED_COLORS)) no_b++; + if ((no_r * (no_g+1) * no_b) <= (palette_size - NB_RESERVED_COLORS)) no_g++; + if ((no_r * no_g * (no_b+1)) <= (palette_size - NB_RESERVED_COLORS)) no_b++; inc_r = (255 - NB_COLORCUBE_START_INDEX)/no_r; inc_g = (255 - NB_COLORCUBE_START_INDEX)/no_g; inc_b = (255 - NB_COLORCUBE_START_INDEX)/no_b; @@ -1215,6 +1215,11 @@ { UINT i; + if (!palette_size) + { + dev = GET_NEXT_PHYSDEV(dev, pGetSystemPaletteEntries); + return dev->funcs->pGetSystemPaletteEntries(dev, start, count, entries); + } if (!entries) return palette_size; if (start >= palette_size) return 0; if (start + count >= palette_size) count = palette_size - start; diff -Nru wine1.7-1.7.50/dlls/winex11.drv/window.c wine1.7-1.7.55/dlls/winex11.drv/window.c --- wine1.7-1.7.50/dlls/winex11.drv/window.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winex11.drv/window.c 2015-11-13 14:32:40.000000000 +0000 @@ -1024,6 +1024,7 @@ xev.xclient.send_event = True; xev.xclient.format = 32; xev.xclient.data.l[3] = 1; + xev.xclient.data.l[4] = 0; for (i = 0; i < NB_NET_WM_STATES; i++) { @@ -2766,3 +2767,32 @@ release_win_data( data ); return -1; } + +void CDECL X11DRV_FlashWindowEx( PFLASHWINFO pfinfo ) +{ + struct x11drv_win_data *data = get_win_data( pfinfo->hwnd ); + XEvent xev; + + if (!data) + return; + + if (data->mapped) + { + xev.type = ClientMessage; + xev.xclient.window = data->whole_window; + xev.xclient.message_type = x11drv_atom( _NET_WM_STATE ); + xev.xclient.serial = 0; + xev.xclient.display = data->display; + xev.xclient.send_event = True; + xev.xclient.format = 32; + xev.xclient.data.l[0] = pfinfo->dwFlags ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE; + xev.xclient.data.l[1] = x11drv_atom( _NET_WM_STATE_DEMANDS_ATTENTION ); + xev.xclient.data.l[2] = 0; + xev.xclient.data.l[3] = 1; + xev.xclient.data.l[4] = 0; + + XSendEvent( data->display, DefaultRootWindow( data->display ), False, + SubstructureNotifyMask, &xev ); + } + release_win_data( data ); +} diff -Nru wine1.7-1.7.50/dlls/winex11.drv/winex11.drv.spec wine1.7-1.7.55/dlls/winex11.drv/winex11.drv.spec --- wine1.7-1.7.50/dlls/winex11.drv/winex11.drv.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winex11.drv/winex11.drv.spec 2015-11-13 14:32:40.000000000 +0000 @@ -30,6 +30,7 @@ @ cdecl EmptyClipboard() X11DRV_EmptyClipboard @ cdecl EndClipboardUpdate() X11DRV_EndClipboardUpdate @ cdecl EnumClipboardFormats(long) X11DRV_EnumClipboardFormats +@ cdecl FlashWindowEx(ptr) X11DRV_FlashWindowEx @ cdecl GetClipboardData(long) X11DRV_GetClipboardData @ cdecl GetDC(long long long ptr ptr long) X11DRV_GetDC @ cdecl IsClipboardFormatAvailable(long) X11DRV_IsClipboardFormatAvailable diff -Nru wine1.7-1.7.50/dlls/winex11.drv/x11drv.h wine1.7-1.7.55/dlls/winex11.drv/x11drv.h --- wine1.7-1.7.50/dlls/winex11.drv/x11drv.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winex11.drv/x11drv.h 2015-11-13 14:32:40.000000000 +0000 @@ -421,6 +421,7 @@ XATOM__NET_WM_PING, XATOM__NET_WM_STATE, XATOM__NET_WM_STATE_ABOVE, + XATOM__NET_WM_STATE_DEMANDS_ATTENTION, XATOM__NET_WM_STATE_FULLSCREEN, XATOM__NET_WM_STATE_MAXIMIZED_HORZ, XATOM__NET_WM_STATE_MAXIMIZED_VERT, diff -Nru wine1.7-1.7.50/dlls/winex11.drv/x11drv_main.c wine1.7-1.7.55/dlls/winex11.drv/x11drv_main.c --- wine1.7-1.7.50/dlls/winex11.drv/x11drv_main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winex11.drv/x11drv_main.c 2015-11-13 14:32:40.000000000 +0000 @@ -138,6 +138,7 @@ "_NET_WM_PING", "_NET_WM_STATE", "_NET_WM_STATE_ABOVE", + "_NET_WM_STATE_DEMANDS_ATTENTION", "_NET_WM_STATE_FULLSCREEN", "_NET_WM_STATE_MAXIMIZED_HORZ", "_NET_WM_STATE_MAXIMIZED_VERT", diff -Nru wine1.7-1.7.50/dlls/winex11.drv/xrender.c wine1.7-1.7.55/dlls/winex11.drv/xrender.c --- wine1.7-1.7.50/dlls/winex11.drv/xrender.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winex11.drv/xrender.c 2015-11-13 14:32:40.000000000 +0000 @@ -2181,7 +2181,6 @@ NULL, /* pFontIsLinked */ NULL, /* pFrameRgn */ NULL, /* pGdiComment */ - NULL, /* pGdiRealizationInfo */ NULL, /* pGetBoundsRect */ NULL, /* pGetCharABCWidths */ NULL, /* pGetCharABCWidthsI */ @@ -2189,6 +2188,7 @@ NULL, /* pGetDeviceCaps */ NULL, /* pGetDeviceGammaRamp */ NULL, /* pGetFontData */ + NULL, /* pGetFontRealizationInfo */ NULL, /* pGetFontUnicodeRanges */ NULL, /* pGetGlyphIndices */ NULL, /* pGetGlyphOutline */ diff -Nru wine1.7-1.7.50/dlls/winhttp/request.c wine1.7-1.7.55/dlls/winhttp/request.c --- wine1.7-1.7.50/dlls/winhttp/request.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winhttp/request.c 2015-11-13 14:32:40.000000000 +0000 @@ -34,6 +34,7 @@ #include "ole2.h" #include "initguid.h" #include "httprequest.h" +#include "httprequestid.h" #include "winhttp.h" #include "winhttp_private.h" @@ -1051,7 +1052,7 @@ return FALSE; } } - if (!netconn_secure_connect( &request->netconn, connect->servername )) + if (!netconn_secure_connect( &request->netconn, connect->hostname )) { netconn_close( &request->netconn ); heap_free( addressW ); @@ -2723,6 +2724,7 @@ LONG receive_timeout; WINHTTP_PROXY_INFO proxy; BOOL async; + UINT url_codepage; }; static inline struct winhttp_request *impl_from_IWinHttpRequest( IWinHttpRequest *iface ) @@ -2945,6 +2947,48 @@ TRACE("%p, %d, %s, %d, %d, %p, %p, %p, %p\n", request, member, debugstr_guid(riid), lcid, flags, params, result, excep_info, arg_err); + if (!IsEqualIID( riid, &IID_NULL )) return DISP_E_UNKNOWNINTERFACE; + + if (member == DISPID_HTTPREQUEST_OPTION) + { + VARIANT ret_value, option; + UINT err_pos; + + if (!result) result = &ret_value; + if (!arg_err) arg_err = &err_pos; + + VariantInit( &option ); + VariantInit( result ); + + if (!flags) return S_OK; + + if (flags == DISPATCH_PROPERTYPUT) + { + hr = DispGetParam( params, 0, VT_I4, &option, arg_err ); + if (FAILED(hr)) return hr; + + hr = IWinHttpRequest_put_Option( &request->IWinHttpRequest_iface, V_I4( &option ), params->rgvarg[0] ); + if (FAILED(hr)) + WARN("put_Option(%d) failed: %x\n", V_I4( &option ), hr); + return hr; + } + else if (flags & (DISPATCH_PROPERTYGET | DISPATCH_METHOD)) + { + hr = DispGetParam( params, 0, VT_I4, &option, arg_err ); + if (FAILED(hr)) return hr; + + hr = IWinHttpRequest_get_Option( &request->IWinHttpRequest_iface, V_I4( &option ), result ); + if (FAILED(hr)) + WARN("get_Option(%d) failed: %x\n", V_I4( &option ), hr); + return hr; + } + + FIXME("unsupported flags %x\n", flags); + return E_NOTIMPL; + } + + /* fallback to standard implementation */ + hr = get_typeinfo( IWinHttpRequest_tid, &typeinfo ); if (SUCCEEDED(hr)) { @@ -3071,6 +3115,7 @@ request->connect_timeout = 60000; request->send_timeout = 30000; request->receive_timeout = 30000; + request->url_codepage = CP_UTF8; VariantInit( &request->data ); request->state = REQUEST_STATE_INITIALIZED; } @@ -3091,6 +3136,7 @@ request->bytes_read = 0; request->error = ERROR_SUCCESS; request->async = FALSE; + request->url_codepage = CP_UTF8; VariantClear( &request->data ); request->state = REQUEST_STATE_INITIALIZED; } @@ -3996,8 +4042,25 @@ WinHttpRequestOption option, VARIANT *value ) { - FIXME("\n"); - return E_NOTIMPL; + struct winhttp_request *request = impl_from_IWinHttpRequest( iface ); + HRESULT hr = S_OK; + + TRACE("%p, %u, %p\n", request, option, value); + + EnterCriticalSection( &request->cs ); + switch (option) + { + case WinHttpRequestOption_URLCodePage: + V_VT( value ) = VT_I4; + V_I4( value ) = request->url_codepage; + break; + default: + FIXME("unimplemented option %u\n", option); + hr = E_NOTIMPL; + break; + } + LeaveCriticalSection( &request->cs ); + return hr; } static HRESULT WINAPI winhttp_request_put_Option( @@ -4021,6 +4084,28 @@ request->disable_feature |= WINHTTP_DISABLE_REDIRECTS; break; } + case WinHttpRequestOption_URLCodePage: + { + static const WCHAR utf8W[] = {'u','t','f','-','8',0}; + VARIANT cp; + + VariantInit( &cp ); + hr = VariantChangeType( &cp, &value, 0, VT_UI4 ); + if (SUCCEEDED( hr )) + { + request->url_codepage = V_UI4( &cp ); + TRACE("URL codepage: %u\n", request->url_codepage); + } + else if (V_VT( &value ) == VT_BSTR && !strcmpiW( V_BSTR( &value ), utf8W )) + { + TRACE("URL codepage: UTF-8\n"); + request->url_codepage = CP_UTF8; + hr = S_OK; + } + else + FIXME("URL codepage %s is not recognized\n", debugstr_variant( &value )); + break; + } default: FIXME("unimplemented option %u\n", option); hr = E_NOTIMPL; @@ -4174,6 +4259,7 @@ request->state = REQUEST_STATE_UNINITIALIZED; request->proxy.lpszProxy = NULL; request->proxy.lpszProxyBypass = NULL; + request->url_codepage = CP_UTF8; InitializeCriticalSection( &request->cs ); request->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": winhttp_request.cs"); diff -Nru wine1.7-1.7.50/dlls/winhttp/tests/notification.c wine1.7-1.7.55/dlls/winhttp/tests/notification.c --- wine1.7-1.7.50/dlls/winhttp/tests/notification.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winhttp/tests/notification.c 2015-11-13 14:32:40.000000000 +0000 @@ -159,7 +159,7 @@ static void test_connection_cache( void ) { HANDLE ses, con, req, event; - DWORD size, status; + DWORD size, status, err; BOOL ret, unload = TRUE; struct info info, *context = &info; @@ -194,7 +194,8 @@ setup_test( &info, winhttp_send_request, __LINE__ ); ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); - if (!ret && GetLastError() == ERROR_WINHTTP_CANNOT_CONNECT) + err = GetLastError(); + if (!ret && (err == ERROR_WINHTTP_CANNOT_CONNECT || err == ERROR_WINHTTP_TIMEOUT)) { skip("connection failed, skipping\n"); goto done; @@ -222,7 +223,8 @@ setup_test( &info, winhttp_send_request, __LINE__ ); ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); - if (!ret && GetLastError() == ERROR_WINHTTP_CANNOT_CONNECT) + err = GetLastError(); + if (!ret && (err == ERROR_WINHTTP_CANNOT_CONNECT || err == ERROR_WINHTTP_TIMEOUT)) { skip("connection failed, skipping\n"); goto done; @@ -289,7 +291,8 @@ setup_test( &info, winhttp_send_request, __LINE__ ); ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); - if (!ret && GetLastError() == ERROR_WINHTTP_CANNOT_CONNECT) + err = GetLastError(); + if (!ret && (err == ERROR_WINHTTP_CANNOT_CONNECT || err == ERROR_WINHTTP_TIMEOUT)) { skip("connection failed, skipping\n"); goto done; @@ -317,7 +320,8 @@ setup_test( &info, winhttp_send_request, __LINE__ ); ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); - if (!ret && GetLastError() == ERROR_WINHTTP_CANNOT_CONNECT) + err = GetLastError(); + if (!ret && (err == ERROR_WINHTTP_CANNOT_CONNECT || err == ERROR_WINHTTP_TIMEOUT)) { skip("connection failed, skipping\n"); goto done; @@ -387,7 +391,7 @@ static void test_redirect( void ) { HANDLE ses, con, req; - DWORD size, status; + DWORD size, status, err; BOOL ret; struct info info, *context = &info; @@ -414,7 +418,8 @@ setup_test( &info, winhttp_send_request, __LINE__ ); ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); - if (!ret && GetLastError() == ERROR_WINHTTP_CANNOT_CONNECT) + err = GetLastError(); + if (!ret && (err == ERROR_WINHTTP_CANNOT_CONNECT || err == ERROR_WINHTTP_TIMEOUT)) { skip("connection failed, skipping\n"); goto done; @@ -524,7 +529,7 @@ SetLastError( 0xdeadbeef ); ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); err = GetLastError(); - if (!ret && err == ERROR_WINHTTP_CANNOT_CONNECT) + if (!ret && (err == ERROR_WINHTTP_CANNOT_CONNECT || err == ERROR_WINHTTP_TIMEOUT)) { skip("connection failed, skipping\n"); WinHttpCloseHandle( req ); diff -Nru wine1.7-1.7.50/dlls/winhttp/tests/winhttp.c wine1.7-1.7.55/dlls/winhttp/tests/winhttp.c --- wine1.7-1.7.50/dlls/winhttp/tests/winhttp.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winhttp/tests/winhttp.c 2015-11-13 14:32:40.000000000 +0000 @@ -2,6 +2,7 @@ * WinHTTP - tests * * Copyright 2008 Google (Zac Brown) + * Copyright 2015 Dmitry Timoshkov * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,11 +27,14 @@ #include #include #include -#include "initguid.h" +#include #include +#include #include "wine/test.h" +DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); + static const WCHAR test_useragent[] = {'W','i','n','e',' ','R','e','g','r','e','s','s','i','o','n',' ','T','e','s','t',0}; static const WCHAR test_winehq[] = {'t','e','s','t','.','w','i','n','e','h','q','.','o','r','g',0}; @@ -250,7 +254,7 @@ SetLastError(0xdeadbeef); ret = WinHttpSendRequest(request, WINHTTP_NO_ADDITIONAL_HEADERS, 0, NULL, 0, 0, 0); err = GetLastError(); - if (!ret && err == ERROR_WINHTTP_CANNOT_CONNECT) + if (!ret && (err == ERROR_WINHTTP_CANNOT_CONNECT || err == ERROR_WINHTTP_TIMEOUT)) { skip("Connection failed, skipping.\n"); goto done; @@ -276,6 +280,7 @@ { static const WCHAR empty[] = {0}; HINTERNET ses, con, req; + DWORD err; BOOL ret; ses = WinHttpOpen(test_useragent, 0, NULL, NULL, 0); @@ -288,7 +293,8 @@ ok(req != NULL, "failed to open a request %u\n", GetLastError()); ret = WinHttpSendRequest(req, empty, 0, NULL, 0, 0, 0); - if (!ret && GetLastError() == ERROR_WINHTTP_CANNOT_CONNECT) + err = GetLastError(); + if (!ret && (err == ERROR_WINHTTP_CANNOT_CONNECT || err == ERROR_WINHTTP_TIMEOUT)) { skip("connection failed, skipping\n"); goto done; @@ -311,7 +317,7 @@ static CHAR post_data[] = "mode=Test"; static const char test_post[] = "mode => Test\0\n"; HINTERNET session, request, connection; - DWORD header_len, optional_len, total_len, bytes_rw, size; + DWORD header_len, optional_len, total_len, bytes_rw, size, err; DWORD_PTR context; BOOL ret; CHAR buffer[256]; @@ -344,7 +350,8 @@ context++; ret = WinHttpSendRequest(request, content_type, header_len, post_data, optional_len, total_len, context); - if (!ret && GetLastError() == ERROR_WINHTTP_CANNOT_CONNECT) + err = GetLastError(); + if (!ret && (err == ERROR_WINHTTP_CANNOT_CONNECT || err == ERROR_WINHTTP_TIMEOUT)) { skip("connection failed, skipping\n"); goto done; @@ -482,7 +489,8 @@ static const WCHAR test_header_begin[] = {'P','O','S','T',' ','/','p','o','s','t','t','e','s','t','.','p','h','p',' ','H','T','T','P','/','1'}; static const WCHAR full_path_test_header_begin[] = - {'P','O','S','T',' ','h','t','t','p',':','/','/','t','e','s','t','.','w','i','n','e','h','q','.','o','r','g',':','8','0','/','p','o','s','t','.','p','h','p',' ','H','T','T','P','/','1'}; + {'P','O','S','T',' ','h','t','t','p',':','/','/','t','e','s','t','.','w','i','n','e','h','q','.','o','r','g',':','8','0', + '/','p','o','s','t','t','e','s','t','.','p','h','p',' ','H','T','T','P','/','1'}; static const WCHAR test_header_end[] = {'\r','\n','\r','\n',0}; static const WCHAR test_header_name[] = {'W','a','r','n','i','n','g',0}; static const WCHAR test_header_name2[] = {'n','a','m','e',0}; @@ -963,7 +971,7 @@ static void test_secure_connection(void) { HINTERNET ses, con, req; - DWORD size, status, policy, bitness, read_size; + DWORD size, status, policy, bitness, read_size, err; BOOL ret; CERT_CONTEXT *cert; WINHTTP_CERTIFICATE_INFO info; @@ -984,7 +992,8 @@ ok(req != NULL, "failed to open a request %u\n", GetLastError()); ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); - if (!ret && GetLastError() == ERROR_WINHTTP_CANNOT_CONNECT) + err = GetLastError(); + if (!ret && (err == ERROR_WINHTTP_CANNOT_CONNECT || err == ERROR_WINHTTP_TIMEOUT)) { skip("Connection failed, skipping.\n"); goto cleanup; @@ -1006,7 +1015,9 @@ WinHttpSetStatusCallback(req, cert_error, WINHTTP_CALLBACK_STATUS_SECURE_FAILURE, 0); ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); - if (!ret && (GetLastError() == ERROR_WINHTTP_SECURE_FAILURE || GetLastError() == ERROR_WINHTTP_CANNOT_CONNECT)) + err = GetLastError(); + if (!ret && (err == ERROR_WINHTTP_SECURE_FAILURE || err == ERROR_WINHTTP_CANNOT_CONNECT || + err == ERROR_WINHTTP_TIMEOUT)) { skip("secure connection failed, skipping remaining secure tests\n"); goto cleanup; @@ -1084,7 +1095,8 @@ ok(req != NULL, "failed to open a request %u\n", GetLastError()); ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); - if (!ret && GetLastError() == ERROR_WINHTTP_CANNOT_CONNECT) + error = GetLastError(); + if (!ret && (error == ERROR_WINHTTP_CANNOT_CONNECT || error == ERROR_WINHTTP_TIMEOUT)) { skip("connection failed, skipping\n"); goto done; @@ -1111,7 +1123,8 @@ ok(req != NULL, "failed to open a request %u\n", GetLastError()); ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); - if (!ret && (GetLastError() == ERROR_WINHTTP_CANNOT_CONNECT || GetLastError() == ERROR_WINHTTP_TIMEOUT)) + error = GetLastError(); + if (!ret && (error == ERROR_WINHTTP_CANNOT_CONNECT || error == ERROR_WINHTTP_TIMEOUT)) { skip("connection failed, skipping\n"); goto done; @@ -2134,7 +2147,7 @@ DWORD count, status, size, error, supported, first, target; BOOL ret; - ses = WinHttpOpen(test_useragent, 0, NULL, NULL, 0); + ses = WinHttpOpen(test_useragent, WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0); ok(ses != NULL, "failed to open session %u\n", GetLastError()); con = WinHttpConnect(ses, localhostW, port, 0); @@ -2202,7 +2215,7 @@ DWORD status, size, error, supported, first, target; BOOL ret; - ses = WinHttpOpen(test_useragent, 0, NULL, NULL, 0); + ses = WinHttpOpen(test_useragent, WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0); ok(ses != NULL, "failed to open session %u\n", GetLastError()); con = WinHttpConnect(ses, localhostW, port, 0); @@ -2339,7 +2352,7 @@ /* credentials set with WinHttpSetCredentials take precedence over those set through options */ - ses = WinHttpOpen(test_useragent, 0, NULL, NULL, 0); + ses = WinHttpOpen(test_useragent, WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0); ok(ses != NULL, "failed to open session %u\n", GetLastError()); con = WinHttpConnect(ses, localhostW, port, 0); @@ -2373,7 +2386,7 @@ WinHttpCloseHandle(con); WinHttpCloseHandle(ses); - ses = WinHttpOpen(test_useragent, 0, NULL, NULL, 0); + ses = WinHttpOpen(test_useragent, WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0); ok(ses != NULL, "failed to open session %u\n", GetLastError()); con = WinHttpConnect(ses, localhostW, port, 0); @@ -2415,7 +2428,7 @@ DWORD error; BOOL ret; - ses = WinHttpOpen(test_useragent, 0, NULL, NULL, 0); + ses = WinHttpOpen(test_useragent, WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0); ok(ses != NULL, "failed to open session %u\n", GetLastError()); con = WinHttpConnect(ses, localhostW, port, 0); @@ -2452,7 +2465,7 @@ DWORD size, len = sizeof(buf), bytes_read, status; BOOL ret; - ses = WinHttpOpen(test_useragent, 0, NULL, NULL, 0); + ses = WinHttpOpen(test_useragent, WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0); ok(ses != NULL, "failed to open session %u\n", GetLastError()); con = WinHttpConnect(ses, localhostW, port, 0); @@ -2537,7 +2550,7 @@ DWORD size, len, count, status; BOOL ret; - ses = WinHttpOpen(test_useragent, 0, NULL, NULL, 0); + ses = WinHttpOpen(test_useragent, WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0); ok(ses != NULL, "failed to open session %u\n", GetLastError()); con = WinHttpConnect(ses, localhostW, port, 0); @@ -2602,7 +2615,7 @@ GetSystemTime(&st); WinHttpTimeFromSystemTime(&st, &today[sizeof(ifmodifiedW)/sizeof(WCHAR)]); - session = WinHttpOpen(test_useragent, WINHTTP_ACCESS_TYPE_DEFAULT_PROXY, + session = WinHttpOpen(test_useragent, WINHTTP_ACCESS_TYPE_NO_PROXY, WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0); ok(session != NULL, "WinHttpOpen failed: %u\n", GetLastError()); @@ -2656,7 +2669,7 @@ DWORD index, len; BOOL ret; - ses = WinHttpOpen( test_useragent, 0, NULL, NULL, 0 ); + ses = WinHttpOpen( test_useragent, WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0 ); ok( ses != NULL, "failed to open session %u\n", GetLastError() ); con = WinHttpConnect( ses, localhostW, port, 0 ); @@ -2688,7 +2701,7 @@ DWORD total_len = 0; BOOL ret; - ses = WinHttpOpen(test_useragent, 0, NULL, NULL, 0); + ses = WinHttpOpen(test_useragent, WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0); ok(ses != NULL, "failed to open session %u\n", GetLastError()); con = WinHttpConnect(ses, localhostW, port, 0); @@ -2741,7 +2754,7 @@ DWORD status, size; BOOL ret; - ses = WinHttpOpen( test_useragent, 0, NULL, NULL, 0 ); + ses = WinHttpOpen( test_useragent, WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0 ); ok( ses != NULL, "failed to open session %u\n", GetLastError() ); con = WinHttpConnect( ses, localhostW, port, 0 ); @@ -2821,7 +2834,7 @@ WinHttpCloseHandle( con ); WinHttpCloseHandle( ses ); - ses = WinHttpOpen( test_useragent, 0, NULL, NULL, 0 ); + ses = WinHttpOpen( test_useragent, WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0 ); ok( ses != NULL, "failed to open session %u\n", GetLastError() ); con = WinHttpConnect( ses, localhostW, port, 0 ); @@ -2855,7 +2868,7 @@ DWORD size, error; BOOL ret; - ses = WinHttpOpen( test_useragent, 0, NULL, NULL, 0 ); + ses = WinHttpOpen( test_useragent, WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0 ); ok( ses != NULL, "failed to open session %u\n", GetLastError() ); con = WinHttpConnect( ses, localhostW, port, 0 ); @@ -3043,11 +3056,12 @@ static const WCHAR connectionW[] = {'C','o','n','n','e','c','t','i','o','n',0}; static const WCHAR dateW[] = {'D','a','t','e',0}; static const WCHAR test_dataW[] = {'t','e','s','t','d','a','t','a',128,0}; + static const WCHAR utf8W[] = {'u','t','f','-','8',0}; HRESULT hr; IWinHttpRequest *req; BSTR method, url, username, password, response = NULL, status_text = NULL, headers = NULL; BSTR date, today, connection, value = NULL; - VARIANT async, empty, timeout, body, body2, proxy_server, bypass_list, data; + VARIANT async, empty, timeout, body, body2, proxy_server, bypass_list, data, cp; VARIANT_BOOL succeeded; LONG status; WCHAR todayW[WINHTTP_TIME_FORMAT_BUFSIZE]; @@ -3131,6 +3145,39 @@ hr = IWinHttpRequest_Open( req, method, url, async ); ok( hr == S_OK, "got %08x\n", hr ); + V_VT( &cp ) = VT_ERROR; + V_ERROR( &cp ) = 0xdeadbeef; + hr = IWinHttpRequest_get_Option( req, WinHttpRequestOption_URLCodePage, &cp ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( V_VT( &cp ) == VT_I4, "got %08x\n", V_VT( &cp ) ); + ok( V_I4( &cp ) == CP_UTF8, "got %u\n", V_I4( &cp ) ); + + V_VT( &cp ) = VT_UI4; + V_UI4( &cp ) = CP_ACP; + hr = IWinHttpRequest_put_Option( req, WinHttpRequestOption_URLCodePage, cp ); + ok( hr == S_OK, "got %08x\n", hr ); + + V_VT( &cp ) = VT_ERROR; + V_ERROR( &cp ) = 0xdeadbeef; + hr = IWinHttpRequest_get_Option( req, WinHttpRequestOption_URLCodePage, &cp ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( V_VT( &cp ) == VT_I4, "got %08x\n", V_VT( &cp ) ); + ok( V_I4( &cp ) == CP_ACP, "got %u\n", V_I4( &cp ) ); + + value = SysAllocString( utf8W ); + V_VT( &cp ) = VT_BSTR; + V_BSTR( &cp ) = value; + hr = IWinHttpRequest_put_Option( req, WinHttpRequestOption_URLCodePage, cp ); + ok( hr == S_OK, "got %08x\n", hr ); + SysFreeString( value ); + + V_VT( &cp ) = VT_ERROR; + V_ERROR( &cp ) = 0xdeadbeef; + hr = IWinHttpRequest_get_Option( req, WinHttpRequestOption_URLCodePage, &cp ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( V_VT( &cp ) == VT_I4, "got %08x\n", V_VT( &cp ) ); + ok( V_I4( &cp ) == CP_UTF8, "got %u\n", V_I4( &cp ) ); + hr = IWinHttpRequest_Abort( req ); ok( hr == S_OK, "got %08x\n", hr ); @@ -3505,6 +3552,241 @@ CoUninitialize(); } +static void request_get_property(IWinHttpRequest *request, int property, VARIANT *ret) +{ + DISPPARAMS params; + VARIANT arg; + HRESULT hr; + + memset(¶ms, 0, sizeof(params)); + params.cNamedArgs = 0; + params.rgdispidNamedArgs = NULL; + params.cArgs = 1; + params.rgvarg = &arg; + VariantInit(&arg); + V_VT(&arg) = VT_I4; + V_I4(&arg) = property; + VariantInit(ret); + hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, + DISPATCH_PROPERTYGET, ¶ms, ret, NULL, NULL); + ok(hr == S_OK, "error %#x\n", hr); +} + +static void test_IWinHttpRequest_Invoke(void) +{ + static const WCHAR utf8W[] = {'U','T','F','-','8',0}; + static const WCHAR regid[] = {'W','i','n','H','t','t','p','.','W','i','n','H','t','t','p','R','e','q','u','e','s','t','.','5','.','1',0}; + WCHAR openW[] = {'O','p','e','n',0}; + WCHAR optionW[] = {'O','p','t','i','o','n',0}; + OLECHAR *open = openW, *option = optionW; + BSTR utf8; + CLSID clsid; + IWinHttpRequest *request; + IDispatch *dispatch; + DISPID id; + DISPPARAMS params; + VARIANT arg[3], ret; + UINT err; + BOOL bret; + HRESULT hr; + + CoInitialize(NULL); + + hr = CLSIDFromProgID(regid, &clsid); + ok(hr == S_OK, "CLSIDFromProgID error %#x\n", hr); + bret = IsEqualIID(&clsid, &CLSID_WinHttpRequest); + ok(bret || broken(!bret) /* win2003 */, "not expected %s\n", wine_dbgstr_guid(&clsid)); + + hr = CoCreateInstance(&CLSID_WinHttpRequest, 0, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&request); + ok(hr == S_OK, "error %#x\n", hr); + + hr = IWinHttpRequest_QueryInterface(request, &IID_IDispatch, (void **)&dispatch); + ok(hr == S_OK, "error %#x\n", hr); + IDispatch_Release(dispatch); + + hr = IWinHttpRequest_GetIDsOfNames(request, &IID_NULL, &open, 1, 0x0409, &id); + ok(hr == S_OK, "error %#x\n", hr); + ok(id == DISPID_HTTPREQUEST_OPEN, "expected DISPID_HTTPREQUEST_OPEN, got %u\n", id); + + hr = IWinHttpRequest_GetIDsOfNames(request, &IID_NULL, &option, 1, 0x0409, &id); + ok(hr == S_OK, "error %#x\n", hr); + ok(id == DISPID_HTTPREQUEST_OPTION, "expected DISPID_HTTPREQUEST_OPTION, got %u\n", id); + + request_get_property(request, WinHttpRequestOption_URLCodePage, &ret); + ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %d\n", V_VT(&ret)); + ok(V_I4(&ret) == CP_UTF8, "expected CP_UTF8, got %d\n", V_I4(&ret)); + + memset(¶ms, 0, sizeof(params)); + params.cArgs = 2; + params.cNamedArgs = 0; + params.rgvarg = arg; + V_VT(&arg[0]) = VT_I4; + V_I4(&arg[0]) = 1252; + V_VT(&arg[1]) = VT_R8; + V_R8(&arg[1]) = 2.0; /* WinHttpRequestOption_URLCodePage */ + VariantInit(&ret); + hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, + DISPATCH_METHOD, ¶ms, NULL, NULL, &err); + ok(hr == S_OK, "error %#x\n", hr); + + request_get_property(request, WinHttpRequestOption_URLCodePage, &ret); + ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %d\n", V_VT(&ret)); + ok(V_I4(&ret) == CP_UTF8, "expected CP_UTF8, got %d\n", V_I4(&ret)); + + memset(¶ms, 0, sizeof(params)); + params.cArgs = 2; + params.cNamedArgs = 0; + params.rgvarg = arg; + V_VT(&arg[0]) = VT_I4; + V_I4(&arg[0]) = 1252; + V_VT(&arg[1]) = VT_R8; + V_R8(&arg[1]) = 2.0; /* WinHttpRequestOption_URLCodePage */ + VariantInit(&ret); + hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, + DISPATCH_METHOD | DISPATCH_PROPERTYPUT, ¶ms, NULL, NULL, &err); + ok(hr == S_OK, "error %#x\n", hr); + + request_get_property(request, WinHttpRequestOption_URLCodePage, &ret); + ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %d\n", V_VT(&ret)); + ok(V_I4(&ret) == CP_UTF8, "expected CP_UTF8, got %d\n", V_I4(&ret)); + + memset(¶ms, 0, sizeof(params)); + params.cArgs = 2; + params.cNamedArgs = 0; + params.rgvarg = arg; + V_VT(&arg[0]) = VT_I4; + V_I4(&arg[0]) = 1252; + V_VT(&arg[1]) = VT_R8; + V_R8(&arg[1]) = 2.0; /* WinHttpRequestOption_URLCodePage */ + VariantInit(&ret); + hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, + DISPATCH_PROPERTYPUT, ¶ms, NULL, NULL, &err); + ok(hr == S_OK, "error %#x\n", hr); + + request_get_property(request, WinHttpRequestOption_URLCodePage, &ret); + ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %d\n", V_VT(&ret)); + ok(V_I4(&ret) == 1252, "expected 1252, got %d\n", V_I4(&ret)); + + memset(¶ms, 0, sizeof(params)); + params.cArgs = 2; + params.cNamedArgs = 0; + params.rgvarg = arg; + V_VT(&arg[0]) = VT_BSTR; + utf8 = SysAllocString(utf8W); + V_BSTR(&arg[0]) = utf8; + V_VT(&arg[1]) = VT_R8; + V_R8(&arg[1]) = 2.0; /* WinHttpRequestOption_URLCodePage */ + hr = IWinHttpRequest_Invoke(request, id, &IID_NULL, 0, DISPATCH_METHOD, ¶ms, NULL, NULL, &err); + ok(hr == S_OK, "error %#x\n", hr); + + request_get_property(request, WinHttpRequestOption_URLCodePage, &ret); + ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %d\n", V_VT(&ret)); + ok(V_I4(&ret) == 1252, "expected 1252, got %d\n", V_I4(&ret)); + + VariantInit(&ret); + hr = IWinHttpRequest_Invoke(request, id, &IID_NULL, 0, DISPATCH_METHOD, ¶ms, &ret, NULL, &err); + ok(hr == S_OK, "error %#x\n", hr); + + request_get_property(request, WinHttpRequestOption_URLCodePage, &ret); + ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %d\n", V_VT(&ret)); + ok(V_I4(&ret) == 1252, "expected 1252, got %d\n", V_I4(&ret)); + + VariantInit(&ret); + hr = IWinHttpRequest_Invoke(request, id, &IID_NULL, 0, DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, &err); + ok(hr == S_OK, "error %#x\n", hr); + + request_get_property(request, WinHttpRequestOption_URLCodePage, &ret); + ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %d\n", V_VT(&ret)); + ok(V_I4(&ret) == CP_UTF8, "expected CP_UTF8, got %d\n", V_I4(&ret)); + + hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_PROPERTYPUT, ¶ms, NULL, NULL, NULL); + ok(hr == S_OK, "error %#x\n", hr); + + hr = IWinHttpRequest_Invoke(request, 255, &IID_NULL, 0, DISPATCH_PROPERTYPUT, ¶ms, NULL, NULL, NULL); + ok(hr == DISP_E_MEMBERNOTFOUND, "error %#x\n", hr); + + VariantInit(&ret); + hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_IUnknown, 0, DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, &err); + ok(hr == DISP_E_UNKNOWNINTERFACE, "error %#x\n", hr); + + VariantInit(&ret); +if (0) /* crashes */ + hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_PROPERTYPUT, NULL, &ret, NULL, &err); + + params.cArgs = 1; + hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, &err); + ok(hr == DISP_E_TYPEMISMATCH, "error %#x\n", hr); + + VariantInit(&arg[2]); + params.cArgs = 3; + hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_PROPERTYPUT, ¶ms, &ret, NULL, &err); +todo_wine + ok(hr == S_OK, "error %#x\n", hr); + + VariantInit(&arg[0]); + VariantInit(&arg[1]); + VariantInit(&arg[2]); + + params.cArgs = 1; + V_VT(&arg[0]) = VT_I4; + V_I4(&arg[0]) = WinHttpRequestOption_URLCodePage; + hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_PROPERTYGET, ¶ms, NULL, NULL, NULL); + ok(hr == S_OK, "error %#x\n", hr); + + V_VT(&ret) = 0xdead; + V_I4(&ret) = 0xbeef; + hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_METHOD|DISPATCH_PROPERTYGET, ¶ms, &ret, NULL, NULL); + ok(hr == S_OK, "error %#x\n", hr); + ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %d\n", V_VT(&ret)); + ok(V_I4(&ret) == CP_UTF8, "expected CP_UTF8, got %d\n", V_I4(&ret)); + + V_VT(&ret) = 0xdead; + V_I4(&ret) = 0xbeef; + hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_METHOD, ¶ms, &ret, NULL, NULL); + ok(hr == S_OK, "error %#x\n", hr); + ok(V_VT(&ret) == VT_I4, "expected VT_I4, got %d\n", V_VT(&ret)); + ok(V_I4(&ret) == CP_UTF8, "expected CP_UTF8, got %d\n", V_I4(&ret)); + + hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_METHOD|DISPATCH_PROPERTYGET, ¶ms, NULL, NULL, NULL); + ok(hr == S_OK, "error %#x\n", hr); + + V_VT(&ret) = 0xdead; + V_I4(&ret) = 0xbeef; + hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, 0, ¶ms, &ret, NULL, NULL); + ok(hr == S_OK, "error %#x\n", hr); + ok(V_VT(&ret) == VT_EMPTY, "expected VT_EMPTY, got %d\n", V_VT(&ret)); + ok(V_I4(&ret) == 0xbeef || V_I4(&ret) == 0 /* Win8 */, "expected 0xdead, got %d\n", V_I4(&ret)); + + hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, 0, ¶ms, NULL, NULL, NULL); + ok(hr == S_OK, "error %#x\n", hr); + + hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_IUnknown, 0, DISPATCH_PROPERTYGET, ¶ms, NULL, NULL, NULL); + ok(hr == DISP_E_UNKNOWNINTERFACE, "error %#x\n", hr); + + params.cArgs = 2; + hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_PROPERTYGET, ¶ms, NULL, NULL, NULL); +todo_wine + ok(hr == S_OK, "error %#x\n", hr); + + params.cArgs = 0; + hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_OPTION, &IID_NULL, 0, DISPATCH_PROPERTYGET, ¶ms, NULL, NULL, NULL); + ok(hr == DISP_E_PARAMNOTFOUND, "error %#x\n", hr); + + SysFreeString(utf8); + + params.cArgs = 1; + V_VT(&arg[0]) = VT_I4; + V_I4(&arg[0]) = AutoLogonPolicy_Never; + VariantInit(&ret); + hr = IWinHttpRequest_Invoke(request, DISPID_HTTPREQUEST_SETAUTOLOGONPOLICY, &IID_NULL, 0, + DISPATCH_METHOD, ¶ms, &ret, NULL, NULL); + ok(hr == S_OK, "error %#x\n", hr); + + IWinHttpRequest_Release(request); + + CoUninitialize(); +} + static void test_WinHttpDetectAutoProxyConfigUrl(void) { BOOL ret; @@ -3707,7 +3989,7 @@ static const WCHAR verb[] = {'/','t','e','s','t','c','h','u','n','k','e','d',0}; static const WCHAR chunked[] = {'c','h','u','n','k','e','d',0}; WCHAR header[32]; - DWORD len; + DWORD len, err; HINTERNET ses, con = NULL, req = NULL; BOOL ret; @@ -3726,7 +4008,8 @@ if (!req) goto done; ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); - if (!ret && GetLastError() == ERROR_WINHTTP_CANNOT_CONNECT) + err = GetLastError(); + if (!ret && (err == ERROR_WINHTTP_CANNOT_CONNECT || err == ERROR_WINHTTP_TIMEOUT)) { skip("connection failed, skipping\n"); goto done; @@ -3805,6 +4088,7 @@ test_resolve_timeout(); test_credentials(); test_IWinHttpRequest(); + test_IWinHttpRequest_Invoke(); test_WinHttpDetectAutoProxyConfigUrl(); test_WinHttpGetIEProxyConfigForCurrentUser(); test_WinHttpGetProxyForUrl(); diff -Nru wine1.7-1.7.50/dlls/wininet/http.c wine1.7-1.7.55/dlls/wininet/http.c --- wine1.7-1.7.50/dlls/wininet/http.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wininet/http.c 2015-11-13 14:32:40.000000000 +0000 @@ -376,6 +376,7 @@ EnterCriticalSection( &req->headers_section ); if ((header = HTTP_GetHeader( req, hostW ))) ret = heap_strdupW( header->lpszValue ); + else ret = heap_strdupW( req->server->canon_host_port ); LeaveCriticalSection( &req->headers_section ); return ret; } @@ -771,7 +772,6 @@ while((HeaderIndex = HTTP_GetCustomHeaderIndex(request, szSet_Cookie, numCookies++, FALSE)) != -1) { - HTTPHEADERW *host; const WCHAR *data; WCHAR *name; @@ -780,10 +780,6 @@ if (!setCookieHeader->lpszValue) continue; - host = HTTP_GetHeader(request, hostW); - if(!host) - continue; - data = strchrW(setCookieHeader->lpszValue, '='); if(!data) continue; @@ -793,7 +789,7 @@ continue; data++; - set_cookie(host->lpszValue, request->path, name, data, INTERNET_COOKIE_HTTPONLY); + set_cookie(request->server->name, request->path, name, data, INTERNET_COOKIE_HTTPONLY); heap_free(name); } @@ -1891,20 +1887,21 @@ static const WCHAR https[] = { 'h','t','t','p','s',':','/','/',0 }; static const WCHAR slash[] = { '/',0 }; LPHTTPHEADERW host_header; + const WCHAR *host; LPCWSTR scheme; - host_header = HTTP_GetHeader(req, hostW); - if(!host_header) - return FALSE; - EnterCriticalSection( &req->headers_section ); + host_header = HTTP_GetHeader(req, hostW); + if (host_header) host = host_header->lpszValue; + else host = req->server->canon_host_port; + if (req->hdr.dwFlags & INTERNET_FLAG_SECURE) scheme = https; else scheme = http; strcpyW(buf, scheme); - strcatW(buf, host_header->lpszValue); + strcatW(buf, host); if (req->path[0] != '/') strcatW(buf, slash); strcatW(buf, req->path); @@ -2145,16 +2142,12 @@ case INTERNET_OPTION_URL: { static const WCHAR httpW[] = {'h','t','t','p',':','/','/',0}; WCHAR url[INTERNET_MAX_URL_LENGTH]; - HTTPHEADERW *host; TRACE("INTERNET_OPTION_URL\n"); - EnterCriticalSection( &req->headers_section ); - host = HTTP_GetHeader(req, hostW); strcpyW(url, httpW); - strcatW(url, host->lpszValue); + strcatW(url, req->server->canon_host_port); strcatW(url, req->path); - LeaveCriticalSection( &req->headers_section ); TRACE("INTERNET_OPTION_URL: %s\n",debugstr_w(url)); return str_to_buffer(url, buffer, size, unicode); @@ -3422,8 +3415,6 @@ request->verb = heap_strdupW(lpszVerb && *lpszVerb ? lpszVerb : szGET); request->version = heap_strdupW(lpszVersion && *lpszVersion ? lpszVersion : g_szHttp1_1); - HTTP_ProcessHeader(request, hostW, request->server->canon_host_port, HTTP_ADDREQ_FLAG_ADD | HTTP_ADDHDR_FLAG_REQ); - if (hIC->proxy && hIC->proxy[0] && !HTTP_ShouldBypassProxy(hIC, session->hostName)) HTTP_DealWithProxy( hIC, session, request ); @@ -4886,6 +4877,16 @@ return ret; } +static void set_content_length_header( http_request_t *request, DWORD len, DWORD flags ) +{ + static const WCHAR fmtW[] = + {'C','o','n','t','e','n','t','-','L','e','n','g','t','h',':',' ','%','u','\r','\n',0}; + WCHAR buf[sizeof(fmtW)/sizeof(fmtW[0]) + 10]; + + sprintfW( buf, fmtW, len ); + HTTP_HttpAddRequestHeadersW( request, buf, ~0u, flags ); +} + /*********************************************************************** * HTTP_HttpSendRequestW (internal) * @@ -4900,12 +4901,9 @@ DWORD dwHeaderLength, LPVOID lpOptional, DWORD dwOptionalLength, DWORD dwContentLength, BOOL bEndRequest) { - static const WCHAR szContentLength[] = - { 'C','o','n','t','e','n','t','-','L','e','n','g','t','h',':',' ','%','l','i','\r','\n',0 }; BOOL redirected = FALSE, secure_proxy_connect = FALSE, loop_next; LPWSTR requestString = NULL; INT responseLen, cnt; - WCHAR contentLengthStr[sizeof szContentLength/2 /* includes \r\n */ + 20 /* int */ ]; DWORD res; TRACE("--> %p\n", request); @@ -4916,10 +4914,12 @@ if (!request->verb) request->verb = heap_strdupW(szGET); + HTTP_ProcessHeader(request, hostW, request->server->canon_host_port, + HTTP_ADDREQ_FLAG_ADD_IF_NEW | HTTP_ADDHDR_FLAG_REQ); + if (dwContentLength || strcmpW(request->verb, szGET)) { - sprintfW(contentLengthStr, szContentLength, dwContentLength); - HTTP_HttpAddRequestHeadersW(request, contentLengthStr, -1L, HTTP_ADDREQ_FLAG_ADD_IF_NEW); + set_content_length_header(request, dwContentLength, HTTP_ADDREQ_FLAG_ADD_IF_NEW); request->bytesToWrite = dwContentLength; } if (request->session->appInfo->agent) @@ -5008,6 +5008,10 @@ { static const WCHAR connectW[] = {'C','O','N','N','E','C','T',0}; const WCHAR *target = request->server->host_port; + + if (HTTP_GetCustomHeaderIndex(request, szContent_Length, 0, TRUE) >= 0) + set_content_length_header(request, 0, HTTP_ADDREQ_FLAG_REPLACE); + requestString = build_request_header(request, connectW, target, g_szHttp1_1, TRUE); } else if (request->proxy && !(request->hdr.dwFlags & INTERNET_FLAG_SECURE)) @@ -5017,7 +5021,12 @@ heap_free(url); } else + { + if (request->proxy && HTTP_GetCustomHeaderIndex(request, szContent_Length, 0, TRUE) >= 0) + set_content_length_header(request, dwContentLength, HTTP_ADDREQ_FLAG_REPLACE); + requestString = build_request_header(request, request->verb, request->path, request->version, TRUE); + } TRACE("Request header -> %s\n", debugstr_w(requestString) ); @@ -5126,7 +5135,7 @@ dwBufferSize=2048; if (request->status_code == HTTP_STATUS_DENIED) { - WCHAR *host = get_host_header( request ); + WCHAR *host = heap_strdupW( request->server->canon_host_port ); DWORD dwIndex = 0; while (HTTP_HttpQueryInfoW(request,HTTP_QUERY_WWW_AUTHENTICATE,szAuthValue,&dwBufferSize,&dwIndex) == ERROR_SUCCESS) { diff -Nru wine1.7-1.7.50/dlls/wininet/internet.c wine1.7-1.7.55/dlls/wininet/internet.c --- wine1.7-1.7.50/dlls/wininet/internet.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wininet/internet.c 2015-11-13 14:32:40.000000000 +0000 @@ -359,7 +359,7 @@ } else { - if ((ret = RegDeleteValueW( key, szProxyServer ))) + if ((ret = RegDeleteValueW( key, szProxyServer )) && ret != ERROR_FILE_NOT_FOUND) { RegCloseKey( key ); return ret; @@ -1317,9 +1317,8 @@ HINTERNET rc = NULL; DWORD res = ERROR_SUCCESS; - TRACE("(%p, %s, %i, %s, %s, %i, %x, %lx)\n", hInternet, debugstr_w(lpszServerName), - nServerPort, debugstr_w(lpszUserName), debugstr_w(lpszPassword), - dwService, dwFlags, dwContext); + TRACE("(%p, %s, %u, %s, %p, %u, %x, %lx)\n", hInternet, debugstr_w(lpszServerName), + nServerPort, debugstr_w(lpszUserName), lpszPassword, dwService, dwFlags, dwContext); if (!lpszServerName) { diff -Nru wine1.7-1.7.50/dlls/wininet/tests/http.c wine1.7-1.7.55/dlls/wininet/tests/http.c --- wine1.7-1.7.50/dlls/wininet/tests/http.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wininet/tests/http.c 2015-11-13 14:32:40.000000000 +0000 @@ -2106,6 +2106,13 @@ else send(c, notokmsg, sizeof notokmsg-1, 0); } + if (strstr(buffer, "CONNECT ")) + { + if (!strstr(buffer, "Content-Length: 0")) + send(c, notokmsg, sizeof notokmsg-1, 0); + else + send(c, proxymsg, sizeof proxymsg-1, 0); + } if (strstr(buffer, "/test2")) { if (strstr(buffer, "Proxy-Authorization: Basic bWlrZToxMTAx")) @@ -2153,6 +2160,8 @@ { if (strstr(buffer, "Content-Length: 100")) { + if (strstr(buffer, "POST /test7b")) + recvfrom(c, buffer, sizeof buffer, 0, NULL, NULL); send(c, okmsg, sizeof okmsg-1, 0); send(c, page1, sizeof page1-1, 0); } @@ -2410,7 +2419,7 @@ DWORD r, sz; char buffer[0x40]; - hi = InternetOpenA(NULL, 0, NULL, NULL, 0); + hi = InternetOpenA(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); ok(hi != NULL, "open failed\n"); hc = InternetConnectA(hi, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); @@ -2804,6 +2813,25 @@ ok(r, "HttpQueryInfo failed\n"); ok(!strcmp(buffer, "200"), "proxy code wrong\n"); + InternetCloseHandle(hr); + InternetCloseHandle(hc); + InternetCloseHandle(hi); + + sprintf(buffer, "localhost:%d\n", port); + hi = InternetOpenA("winetest", INTERNET_OPEN_TYPE_PROXY, buffer, NULL, 0); + ok(hi != NULL, "InternetOpen failed\n"); + + hc = InternetConnectA(hi, "test.winehq.org", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); + ok(hc != NULL, "InternetConnect failed\n"); + + hr = HttpOpenRequestA(hc, "POST", "/test2", NULL, NULL, NULL, INTERNET_FLAG_SECURE, 0); + ok(hr != NULL, "HttpOpenRequest failed\n"); + + r = HttpSendRequestA(hr, NULL, 0, (char *)"data", sizeof("data")); + ok(r, "HttpSendRequest failed %u\n", GetLastError()); + + test_status_code(hr, 407); + done: InternetCloseHandle(hr); InternetCloseHandle(hc); @@ -2879,7 +2907,7 @@ connect = InternetConnectA(session, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); ok(connect != NULL, "InternetConnect failed\n"); - request = HttpOpenRequestA(connect, "POST", "/test7b", NULL, NULL, types, 0, 0); + request = HttpOpenRequestA(connect, "POST", "/test7b", NULL, NULL, types, INTERNET_FLAG_KEEP_CONNECTION, 0); ok(request != NULL, "HttpOpenRequest failed\n"); ret = HttpAddRequestHeadersA(request, "Content-Length: 100\r\n", ~0u, HTTP_ADDREQ_FLAG_ADD_IF_NEW); @@ -2887,7 +2915,7 @@ data_len = sizeof(data); memset(data, 'a', sizeof(data)); - ret = HttpSendRequestA(request, connection, ~0u, data, data_len); + ret = HttpSendRequestA(request, NULL, 0, data, data_len); ok(ret, "HttpSendRequest failed: %u\n", GetLastError()); status = 0; @@ -2979,8 +3007,8 @@ memset(buffer, 0, sizeof(buffer)); ret = HttpQueryInfoA(req, HTTP_QUERY_HOST | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &size, &count); err = GetLastError(); - todo_wine ok(!ret, "HttpQueryInfo succeeded\n"); - todo_wine ok(err == ERROR_HTTP_HEADER_NOT_FOUND, "Expected error ERROR_HTTP_HEADER_NOT_FOUND, got %d\n", err); + ok(!ret, "HttpQueryInfo succeeded\n"); + ok(err == ERROR_HTTP_HEADER_NOT_FOUND, "Expected error ERROR_HTTP_HEADER_NOT_FOUND, got %d\n", err); size = sizeof(buffer) - 1; memset(buffer, 0, sizeof(buffer)); @@ -3001,12 +3029,12 @@ memset(buffer, 0, sizeof(buffer)); ret = InternetQueryOptionA(req, INTERNET_OPTION_URL, buffer, &size); ok(ret, "InternetQueryOption failed\n"); - todo_wine ok(!strcmp(full_url, buffer), "Expected %s, got %s\n", full_url, buffer); + ok(!strcmp(full_url, buffer), "Expected %s, got %s\n", full_url, buffer); ret = HttpSendRequestA(req, NULL, 0, NULL, 0); ok(ret, "HttpSendRequest failed\n"); - test_status_code_todo(req, 200); + test_status_code(req, 200); InternetCloseHandle(req); req = HttpOpenRequestA(con, NULL, "/test_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); @@ -3300,7 +3328,7 @@ hCompleteEvent = CreateEventW(NULL, FALSE, FALSE, NULL); - session = InternetOpenA("", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, INTERNET_FLAG_ASYNC); + session = InternetOpenA("", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, INTERNET_FLAG_ASYNC); ok(session != NULL,"InternetOpen failed with error %u\n", GetLastError()); pInternetSetStatusCallbackA(session, callback); @@ -3365,7 +3393,7 @@ hCompleteEvent = CreateEventW(NULL, FALSE, FALSE, NULL); conn_close_event = CreateEventW(NULL, FALSE, FALSE, NULL); - session = InternetOpenA("", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, INTERNET_FLAG_ASYNC); + session = InternetOpenA("", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, INTERNET_FLAG_ASYNC); ok(session != NULL,"InternetOpen failed with error %u\n", GetLastError()); pInternetSetStatusCallbackA(session, callback); @@ -4318,7 +4346,7 @@ HINTERNET ses, con, req; BOOL ret; - ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); + ses = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); ok(ses != NULL, "InternetOpen failed\n"); con = InternetConnectA(ses, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); @@ -4356,7 +4384,7 @@ DWORD status, size; BOOL ret; - ses = InternetOpenA( "winetest", 0, NULL, NULL, 0 ); + ses = InternetOpenA( "winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0 ); ok( ses != NULL, "InternetOpenA failed\n" ); con = InternetConnectA( ses, "localhost", port, "user", "pwd", @@ -4379,7 +4407,7 @@ InternetCloseHandle( con ); InternetCloseHandle( ses ); - ses = InternetOpenA( "winetest", 0, NULL, NULL, 0 ); + ses = InternetOpenA( "winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0 ); ok( ses != NULL, "InternetOpenA failed\n" ); con = InternetConnectA( ses, "localhost", port, NULL, NULL, @@ -4548,7 +4576,7 @@ CertFreeCertificateChain(chain); }else { ok_(__FILE__,line)(!res && GetLastError() == error, - "InternetGetSecurityInfoByURLA returned: %x(%u), exected %u\n", res, GetLastError(), error); + "InternetGetSecurityInfoByURLA returned: %x(%u), expected %u\n", res, GetLastError(), error); } } @@ -5618,6 +5646,7 @@ WaitForSingleObject( info.wait, 10000 ); Sleep(100); CloseHandle( info.wait ); + DeleteCriticalSection( ¬ification_cs ); } static HINTERNET closetest_session, closetest_req, closetest_conn; @@ -5692,7 +5721,7 @@ DWORD error; BOOL ret; - session = InternetOpenA("winetest", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); + session = InternetOpenA("winetest", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); ok(session != NULL, "failed to get session handle\n"); connect = InternetConnectA(session, "localhost", 1, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); diff -Nru wine1.7-1.7.50/dlls/wininet/tests/internet.c wine1.7-1.7.55/dlls/wininet/tests/internet.c --- wine1.7-1.7.50/dlls/wininet/tests/internet.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wininet/tests/internet.c 2015-11-13 14:32:40.000000000 +0000 @@ -1349,6 +1349,35 @@ HeapFree(GetProcessHeap(), 0, list.pOptions[0].Value.pszValue); HeapFree(GetProcessHeap(), 0, list.pOptions); + /* test with NULL as proxy server */ + list.dwOptionCount = 1; + list.pOptions = HeapAlloc(GetProcessHeap(), 0, sizeof(INTERNET_PER_CONN_OPTIONA)); + list.pOptions[0].dwOption = INTERNET_PER_CONN_PROXY_SERVER; + list.pOptions[0].Value.pszValue = NULL; + + ret = InternetSetOptionA(NULL, INTERNET_OPTION_PER_CONNECTION_OPTION, &list, size); + ok(ret == TRUE, "InternetSetOption should've succeeded\n"); + + ret = InternetSetOptionA(NULL, INTERNET_OPTION_PER_CONNECTION_OPTION, &list, size); + ok(ret == TRUE, "InternetSetOption should've succeeded\n"); + + HeapFree(GetProcessHeap(), 0, list.pOptions); + + /* get & verify the proxy server */ + list.dwOptionCount = 1; + list.dwOptionError = 0; + list.pOptions = HeapAlloc(GetProcessHeap(), 0, sizeof(INTERNET_PER_CONN_OPTIONA)); + list.pOptions[0].dwOption = INTERNET_PER_CONN_PROXY_SERVER; + + ret = InternetQueryOptionA(NULL, INTERNET_OPTION_PER_CONNECTION_OPTION, &list, &size); + ok(ret == TRUE, "InternetQueryOption should've succeeded\n"); + ok(!list.pOptions[0].Value.pszValue, + "Retrieved proxy server should've been NULL, was: \"%s\"\n", + list.pOptions[0].Value.pszValue); + + HeapFree(GetProcessHeap(), 0, list.pOptions[0].Value.pszValue); + HeapFree(GetProcessHeap(), 0, list.pOptions); + /* restore original settings */ list.dwOptionCount = 2; list.pOptions = orig_settings; diff -Nru wine1.7-1.7.50/dlls/wininet/tests/urlcache.c wine1.7-1.7.55/dlls/wininet/tests/urlcache.c --- wine1.7-1.7.50/dlls/wininet/tests/urlcache.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wininet/tests/urlcache.c 2015-11-13 14:32:40.000000000 +0000 @@ -1086,7 +1086,7 @@ ret = CreateUrlCacheEntryA(url_with_slash, 0, "html", filename, 0); ok(ret, "CreateUrlCacheEntry failed with error %d\n", GetLastError()); - create_and_write_file(filenameA, &zero_byte, sizeof(zero_byte)); + create_and_write_file(filename, &zero_byte, sizeof(zero_byte)); ret = CommitUrlCacheEntryA("Visited: http://testing.cache.com/", NULL, filetime_zero, filetime_zero, NORMAL_CACHE_ENTRY, NULL, 0, "html", NULL); diff -Nru wine1.7-1.7.50/dlls/winmm/mmio.c wine1.7-1.7.55/dlls/winmm/mmio.c --- wine1.7-1.7.50/dlls/winmm/mmio.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winmm/mmio.c 2015-11-13 14:32:40.000000000 +0000 @@ -591,11 +591,7 @@ if (!refmminfo) { refmminfo = &mmioinfo; - - mmioinfo.fccIOProc = 0; - mmioinfo.pIOProc = NULL; - mmioinfo.pchBuffer = NULL; - mmioinfo.cchBuffer = 0; + memset(&mmioinfo, 0, sizeof(mmioinfo)); is_unicode = FALSE; } diff -Nru wine1.7-1.7.50/dlls/winmm/tests/joystick.c wine1.7-1.7.55/dlls/winmm/tests/joystick.c --- wine1.7-1.7.50/dlls/winmm/tests/joystick.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winmm/tests/joystick.c 2015-11-13 14:32:40.000000000 +0000 @@ -156,7 +156,7 @@ par = 0xdead; ret = joyGetThreshold(joyid, &par); ok(ret == JOYERR_NOERROR, "Test [%d]: Expected %d, got %d\n", i, JOYERR_NOERROR, ret); - if (!win98 || (win98 && i < 8)) + if (!win98 || i < 8) { if ((1 << i) & threshold_error) ok(par == period[8], "Test [%d]: Expected %d, got %d\n", i, period[8], par); diff -Nru wine1.7-1.7.50/dlls/winmm/tests/mmio.c wine1.7-1.7.55/dlls/winmm/tests/mmio.c --- wine1.7-1.7.50/dlls/winmm/tests/mmio.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winmm/tests/mmio.c 2015-11-13 14:32:40.000000000 +0000 @@ -599,12 +599,15 @@ static LRESULT CALLBACK mmio_test_IOProc(LPSTR lpMMIOInfo, UINT uMessage, LPARAM lParam1, LPARAM lParam2) { LPMMIOINFO lpInfo = (LPMMIOINFO) lpMMIOInfo; + int i; switch (uMessage) { case MMIOM_OPEN: if (lpInfo->fccIOProc == FOURCC_DOS) lpInfo->fccIOProc = mmioFOURCC('F', 'A', 'I', 'L'); + for (i = 0; i < sizeof(lpInfo->adwInfo) / sizeof(*lpInfo->adwInfo); i++) + ok(lpInfo->adwInfo[i] == 0, "[%d] Expected 0, got %u\n", i, lpInfo->adwInfo[i]); return MMSYSERR_NOERROR; case MMIOM_CLOSE: return MMSYSERR_NOERROR; @@ -636,6 +639,18 @@ mmioGetInfo(hmmio, &mmio, 0); ok(hmmio && mmio.fccIOProc == FOURCC_XYZ, "mmioOpenA error %u, got %4.4s\n", mmio.wErrorRet, (LPCSTR)&mmio.fccIOProc); + ok(mmio.adwInfo[1] == 0, "mmioOpenA sent MMIOM_SEEK, got %d\n", + mmio.adwInfo[1]); + ok(mmio.lDiskOffset == 0, "mmioOpenA updated lDiskOffset, got %d\n", + mmio.lDiskOffset); + mmioClose(hmmio, 0); + + /* Same test with NULL info */ + memset(&mmio, 0, sizeof(mmio)); + hmmio = mmioOpenA(fname, NULL, MMIO_READ); + mmioGetInfo(hmmio, &mmio, 0); + ok(hmmio && mmio.fccIOProc == FOURCC_XYZ, "mmioOpenA error %u, got %4.4s\n", + mmio.wErrorRet, (LPCSTR)&mmio.fccIOProc); ok(mmio.adwInfo[1] == 0, "mmioOpenA sent MMIOM_SEEK, got %d\n", mmio.adwInfo[1]); ok(mmio.lDiskOffset == 0, "mmioOpenA updated lDiskOffset, got %d\n", diff -Nru wine1.7-1.7.50/dlls/winspool.drv/info.c wine1.7-1.7.55/dlls/winspool.drv/info.c --- wine1.7-1.7.50/dlls/winspool.drv/info.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winspool.drv/info.c 2015-11-13 14:32:40.000000000 +0000 @@ -8432,6 +8432,11 @@ { ret = schedule_file(job->filename); } + else if(isalpha(portname[0]) && portname[1] == ':') + { + TRACE("copying to %s\n", debugstr_w(portname)); + ret = CopyFileW(job->filename, portname, FALSE); + } else { FIXME("can't schedule to port %s\n", debugstr_w(portname)); diff -Nru wine1.7-1.7.50/dlls/winspool.drv/tests/info.c wine1.7-1.7.55/dlls/winspool.drv/tests/info.c --- wine1.7-1.7.50/dlls/winspool.drv/tests/info.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/winspool.drv/tests/info.c 2015-11-13 14:32:40.000000000 +0000 @@ -721,8 +721,7 @@ AddMonitorA(NULL, 2, (LPBYTE) &mi2a); SetLastError(MAGIC_DEAD); res = DeleteMonitorA(NULL, invalid_env, winetest); - ok( res || - (!res && GetLastError() == ERROR_INVALID_ENVIRONMENT) /* Vista/W2K8 */, + ok( res || GetLastError() == ERROR_INVALID_ENVIRONMENT /* Vista/W2K8 */, "returned %d with %d\n", res, GetLastError()); /* the monitor-name */ @@ -1012,7 +1011,7 @@ pcbNeeded = MAGIC_DEAD; pcReturned = MAGIC_DEAD; res = EnumMonitorsA(NULL, level, buffer, cbBuf, NULL, &pcReturned); - ok( res || (!res && (GetLastError() == RPC_X_NULL_REF_POINTER)) , + ok( res || GetLastError() == RPC_X_NULL_REF_POINTER, "(%d) returned %d with %d (expected '!=0' or '0' with " "RPC_X_NULL_REF_POINTER)\n", level, res, GetLastError()); @@ -1020,7 +1019,7 @@ pcReturned = MAGIC_DEAD; SetLastError(MAGIC_DEAD); res = EnumMonitorsA(NULL, level, buffer, cbBuf, &pcbNeeded, NULL); - ok( res || (!res && (GetLastError() == RPC_X_NULL_REF_POINTER)) , + ok( res || GetLastError() == RPC_X_NULL_REF_POINTER, "(%d) returned %d with %d (expected '!=0' or '0' with " "RPC_X_NULL_REF_POINTER)\n", level, res, GetLastError()); @@ -1230,7 +1229,7 @@ pcbNeeded = 0xdeadbeef; pcReturned = 0xdeadbeef; res = EnumPrinterDriversA(NULL, NULL, level, buffer, cbBuf, NULL, &pcReturned); - ok( res || (!res && (GetLastError() == RPC_X_NULL_REF_POINTER)) , + ok( res || GetLastError() == RPC_X_NULL_REF_POINTER, "(%u) got %u with %u (expected '!=0' or '0' with " "RPC_X_NULL_REF_POINTER)\n", level, res, GetLastError()); @@ -1238,7 +1237,7 @@ pcReturned = 0xdeadbeef; SetLastError(0xdeadbeef); res = EnumPrinterDriversA(NULL, NULL, level, buffer, cbBuf, &pcbNeeded, NULL); - ok( res || (!res && (GetLastError() == RPC_X_NULL_REF_POINTER)) , + ok( res || GetLastError() == RPC_X_NULL_REF_POINTER, "(%u) got %u with %u (expected '!=0' or '0' with " "RPC_X_NULL_REF_POINTER)\n", level, res, GetLastError()); @@ -1790,7 +1789,7 @@ SetLastError(MAGIC_DEAD); res = OpenPrinterA(NULL, &hprinter, NULL); if (is_spooler_deactivated(res, GetLastError())) return; - ok(res || (!res && GetLastError() == ERROR_INVALID_PARAMETER), + ok(res || GetLastError() == ERROR_INVALID_PARAMETER, "returned %d with %d (expected '!=0' or '0' with ERROR_INVALID_PARAMETER)\n", res, GetLastError()); if(res) { @@ -1824,7 +1823,7 @@ hprinter = (HANDLE) 0xdeadbeef; SetLastError(0xdeadbeef); res = OpenPrinterA(local_server, &hprinter, NULL); - ok(res || (!res && GetLastError() == ERROR_INVALID_PARAMETER), + ok(res || GetLastError() == ERROR_INVALID_PARAMETER, "returned %d with %d (expected '!=0' or '0' with ERROR_INVALID_PARAMETER)\n", res, GetLastError()); if(res) ClosePrinter(hprinter); @@ -1965,21 +1964,21 @@ WriteProfileStringA("windows", "device", org_value); SetLastError(MAGIC_DEAD); res = pSetDefaultPrinterA(""); - ok(res || (!res && (GetLastError() == ERROR_INVALID_PRINTER_NAME)), + ok(res || GetLastError() == ERROR_INVALID_PRINTER_NAME, "returned %d with %d (expected '!=0' or '0' with " "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError()); WriteProfileStringA("windows", "device", org_value); SetLastError(MAGIC_DEAD); res = pSetDefaultPrinterA(NULL); - ok(res || (!res && (GetLastError() == ERROR_INVALID_PRINTER_NAME)), + ok(res || GetLastError() == ERROR_INVALID_PRINTER_NAME, "returned %d with %d (expected '!=0' or '0' with " "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError()); WriteProfileStringA("windows", "device", org_value); SetLastError(MAGIC_DEAD); res = pSetDefaultPrinterA(default_printer); - ok(res || (!res && (GetLastError() == ERROR_INVALID_PRINTER_NAME)), + ok(res || GetLastError() == ERROR_INVALID_PRINTER_NAME, "returned %d with %d (expected '!=0' or '0' with " "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError()); @@ -2000,7 +1999,7 @@ goto restore_old_printer; /* we get ERROR_INVALID_PRINTER_NAME when no printer is installed */ - ok(res || (!res && (GetLastError() == ERROR_INVALID_PRINTER_NAME)), + ok(res || GetLastError() == ERROR_INVALID_PRINTER_NAME, "returned %d with %d (expected '!=0' or '0' with " "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError()); @@ -2008,14 +2007,14 @@ SetLastError(MAGIC_DEAD); res = pSetDefaultPrinterA(NULL); /* we get ERROR_INVALID_PRINTER_NAME when no printer is installed */ - ok(res || (!res && (GetLastError() == ERROR_INVALID_PRINTER_NAME)), + ok(res || GetLastError() == ERROR_INVALID_PRINTER_NAME, "returned %d with %d (expected '!=0' or '0' with " "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError()); WriteProfileStringA("windows", "device", NULL); SetLastError(MAGIC_DEAD); res = pSetDefaultPrinterA(default_printer); - ok(res || (!res && (GetLastError() == ERROR_INVALID_PRINTER_NAME)), + ok(res || GetLastError() == ERROR_INVALID_PRINTER_NAME, "returned %d with %d (expected '!=0' or '0' with " "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError()); diff -Nru wine1.7-1.7.50/dlls/wintrust/tests/softpub.c wine1.7-1.7.55/dlls/wintrust/tests/softpub.c --- wine1.7-1.7.50/dlls/wintrust/tests/softpub.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wintrust/tests/softpub.c 2015-11-13 14:32:40.000000000 +0000 @@ -544,6 +544,7 @@ CRYPT_PROVIDER_DATA data = { 0 }; CRYPT_PROVIDER_SGNR sgnr = { sizeof(sgnr), { 0 } }; HRESULT ret; + BOOL b; if (!CertFreeCertificateChain_p) { @@ -563,8 +564,8 @@ ok(data.padwTrustStepErrors[TRUSTERROR_STEP_FINAL_CERTPROV] == TRUST_E_NOSIGNATURE, "Expected TRUST_E_NOSIGNATURE, got %08x\n", data.padwTrustStepErrors[TRUSTERROR_STEP_FINAL_CERTPROV]); - ret = funcs->pfnAddSgnr2Chain(&data, FALSE, 0, &sgnr); - if (ret) + b = funcs->pfnAddSgnr2Chain(&data, FALSE, 0, &sgnr); + if (b) { PCCERT_CONTEXT cert; @@ -577,8 +578,8 @@ { WINTRUST_DATA wintrust_data = { 0 }; - ret = funcs->pfnAddCert2Chain(&data, 0, FALSE, 0, cert); - ok(ret == S_FALSE, "Expected S_FALSE, got %08x\n", ret); + b = funcs->pfnAddCert2Chain(&data, 0, FALSE, 0, cert); + ok(b == TRUE, "Expected TRUE, got %d\n", b); /* If pWintrustData isn't set, crashes attempting to access * pWintrustData->fdwRevocationChecks diff -Nru wine1.7-1.7.50/dlls/wldap32/init.c wine1.7-1.7.55/dlls/wldap32/init.c --- wine1.7-1.7.50/dlls/wldap32/init.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wldap32/init.c 2015-11-13 14:32:40.000000000 +0000 @@ -319,7 +319,7 @@ * * See ldap_initW. */ -WLDAP32_LDAP * CDECL ldap_initA( PCHAR hostname, ULONG portnumber ) +WLDAP32_LDAP * CDECL ldap_initA( const PCHAR hostname, ULONG portnumber ) { #ifdef HAVE_LDAP WLDAP32_LDAP *ld = NULL; @@ -365,7 +365,7 @@ * to this function. The connection will not be made until the first * LDAP function that needs it is called. */ -WLDAP32_LDAP * CDECL ldap_initW( PWCHAR hostname, ULONG portnumber ) +WLDAP32_LDAP * CDECL ldap_initW( const PWCHAR hostname, ULONG portnumber ) { #ifdef HAVE_LDAP LDAP *ld = NULL; diff -Nru wine1.7-1.7.50/dlls/wmiutils/path.c wine1.7-1.7.55/dlls/wmiutils/path.c --- wine1.7-1.7.50/dlls/wmiutils/path.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wmiutils/path.c 2015-11-13 14:32:40.000000000 +0000 @@ -1211,7 +1211,7 @@ LPWSTR wszNamespace) { FIXME("%p, %s, %s\n", iface, debugstr_w(wszMachine), debugstr_w(wszNamespace)); - return E_NOTIMPL; + return FALSE; } static BOOL WINAPI path_IsRelativeOrChild( @@ -1221,7 +1221,7 @@ LONG lFlags) { FIXME("%p, %s, %s, 0x%x\n", iface, debugstr_w(wszMachine), debugstr_w(wszNamespace), lFlags); - return E_NOTIMPL; + return FALSE; } static BOOL WINAPI path_IsLocal( @@ -1229,7 +1229,7 @@ LPCWSTR wszMachine) { FIXME("%p, %s\n", iface, debugstr_w(wszMachine)); - return E_NOTIMPL; + return FALSE; } static BOOL WINAPI path_IsSameClassName( @@ -1237,7 +1237,7 @@ LPCWSTR wszClass) { FIXME("%p, %s\n", iface, debugstr_w(wszClass)); - return E_NOTIMPL; + return FALSE; } static const struct IWbemPathVtbl path_vtbl = diff -Nru wine1.7-1.7.50/dlls/wpcap/Makefile.in wine1.7-1.7.55/dlls/wpcap/Makefile.in --- wine1.7-1.7.50/dlls/wpcap/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wpcap/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -1,6 +1,6 @@ MODULE = wpcap.dll DELAYIMPORTS = ws2_32 -EXTRALIBS = @LIBPCAP@ +EXTRALIBS = $(PCAP_LIBS) C_SRCS = \ wpcap.c diff -Nru wine1.7-1.7.50/dlls/wpcap/wpcap.c wine1.7-1.7.55/dlls/wpcap/wpcap.c --- wine1.7-1.7.50/dlls/wpcap/wpcap.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wpcap/wpcap.c 2015-11-13 14:32:40.000000000 +0000 @@ -27,6 +27,19 @@ WINE_DEFAULT_DEBUG_CHANNEL(wpcap); WINE_DECLARE_DEBUG_CHANNEL(winediag); +#ifndef PCAP_SRC_FILE_STRING +#define PCAP_SRC_FILE_STRING "file://" +#endif +#ifndef PCAP_SRC_FILE +#define PCAP_SRC_FILE 2 +#endif +#ifndef PCAP_SRC_IF_STRING +#define PCAP_SRC_IF_STRING "rpcap://" +#endif +#ifndef PCAP_SRC_IFLOCAL +#define PCAP_SRC_IFLOCAL 3 +#endif + void CDECL wine_pcap_breakloop(pcap_t *p) { TRACE("(%p)\n", p); @@ -239,6 +252,44 @@ return pcap_open_live(source, snaplen, promisc, to_ms, errbuf); } +int CDECL wine_pcap_parsesrcstr(const char *source, int *type, char *host, char *port, char *name, char *errbuf) +{ + int t = PCAP_SRC_IFLOCAL; + const char *p = source; + + FIXME("(%s %p %p %p %p %p): partial stub\n", debugstr_a(source), type, host, port, name, errbuf); + + if (host) + *host = '\0'; + if (port) + *port = '\0'; + if (name) + *name = '\0'; + + if (!strncmp(p, PCAP_SRC_IF_STRING, strlen(PCAP_SRC_IF_STRING))) + p += strlen(PCAP_SRC_IF_STRING); + else if (!strncmp(p, PCAP_SRC_FILE_STRING, strlen(PCAP_SRC_FILE_STRING))) + { + p += strlen(PCAP_SRC_FILE_STRING); + t = PCAP_SRC_FILE; + } + + if (type) + *type = t; + + if (!*p) + { + if (errbuf) + sprintf(errbuf, "The name has not been specified in the source string."); + return -1; + } + + if (name) + strcpy(name, p); + + return 0; +} + int CDECL wine_pcap_sendpacket(pcap_t *p, const unsigned char *buf, int size) { TRACE("(%p %p %i)\n", p, buf, size); diff -Nru wine1.7-1.7.50/dlls/wpcap/wpcap.spec wine1.7-1.7.55/dlls/wpcap/wpcap.spec --- wine1.7-1.7.50/dlls/wpcap/wpcap.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wpcap/wpcap.spec 2015-11-13 14:32:40.000000000 +0000 @@ -51,7 +51,7 @@ @ stub pcap_open_dead @ cdecl pcap_open_live(str long long long ptr) wine_pcap_open_live @ stub pcap_open_offline -@ stub pcap_parsesrcstr +@ cdecl pcap_parsesrcstr(str ptr ptr ptr ptr ptr) wine_pcap_parsesrcstr @ stub pcap_perror @ stub pcap_read @ stub pcap_remoteact_accept diff -Nru wine1.7-1.7.50/dlls/ws2_32/socket.c wine1.7-1.7.55/dlls/ws2_32/socket.c --- wine1.7-1.7.50/dlls/ws2_32/socket.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ws2_32/socket.c 2015-11-13 14:32:40.000000000 +0000 @@ -177,6 +177,8 @@ #define TCP_KEEPIDLE TCP_KEEPALIVE #endif +#define FILE_USE_FILE_POINTER_POSITION ((LONGLONG)-2) + WINE_DEFAULT_DEBUG_CHANNEL(winsock); WINE_DECLARE_DEBUG_CHANNEL(winediag); @@ -514,6 +516,20 @@ struct ws2_async *read; }; +struct ws2_transmitfile_async +{ + struct ws2_async_io io; + char *buffer; + HANDLE file; + DWORD file_read; + DWORD file_bytes; + DWORD bytes_per_send; + TRANSMIT_FILE_BUFFERS buffers; + DWORD flags; + LARGE_INTEGER offset; + struct ws2_async write; +}; + static struct ws2_async_io *async_io_freelist; static void release_async_io( struct ws2_async_io *io ) @@ -2725,6 +2741,294 @@ } /*********************************************************************** + * WS2_ReadFile (INTERNAL) + * + * Perform an APC-safe ReadFile operation + */ +static NTSTATUS WS2_ReadFile(HANDLE hFile, PIO_STATUS_BLOCK io_status, char* buffer, ULONG length, + PLARGE_INTEGER offset) +{ + int result = -1, unix_handle; + unsigned int options; + NTSTATUS status; + + TRACE( "(%p,%p,0x%08x)\n", hFile, buffer,length ); + + status = wine_server_handle_to_fd( hFile, FILE_READ_DATA, &unix_handle, &options ); + if (status) return status; + + while (result == -1) + { + if (offset->QuadPart != FILE_USE_FILE_POINTER_POSITION) + result = pread( unix_handle, buffer, length, offset->QuadPart ); + else + result = read( unix_handle, buffer, length ); + if (errno != EINTR) + break; + } + + if (!result) + status = (length ? STATUS_END_OF_FILE : STATUS_SUCCESS); + else if (result != -1) + status = STATUS_SUCCESS; + else if (errno != EAGAIN) + status = wsaErrStatus(); + else + status = STATUS_PENDING; + + wine_server_release_fd( hFile, unix_handle ); + TRACE("= 0x%08x (%d)\n", status, result); + if (status == STATUS_SUCCESS || status == STATUS_END_OF_FILE) + { + io_status->u.Status = status; + io_status->Information = result; + } + + return status; +} + +/*********************************************************************** + * WS2_transmitfile_getbuffer (INTERNAL) + * + * Pick the appropriate buffer for a TransmitFile send operation. + */ +static NTSTATUS WS2_transmitfile_getbuffer( int fd, struct ws2_transmitfile_async *wsa ) +{ + /* send any incomplete writes from a previous iteration */ + if (wsa->write.first_iovec < wsa->write.n_iovecs) + return STATUS_PENDING; + + /* process the header (if applicable) */ + if (wsa->buffers.Head) + { + wsa->write.first_iovec = 0; + wsa->write.n_iovecs = 1; + wsa->write.iovec[0].iov_base = wsa->buffers.Head; + wsa->write.iovec[0].iov_len = wsa->buffers.HeadLength; + wsa->buffers.Head = NULL; + return STATUS_PENDING; + } + + /* process the main file */ + if (wsa->file) + { + DWORD bytes_per_send = wsa->bytes_per_send; + IO_STATUS_BLOCK iosb; + NTSTATUS status; + + iosb.Information = 0; + /* when the size of the transfer is limited ensure that we don't go past that limit */ + if (wsa->file_bytes != 0) + bytes_per_send = min(bytes_per_send, wsa->file_bytes - wsa->file_read); + status = WS2_ReadFile( wsa->file, &iosb, wsa->buffer, bytes_per_send, &wsa->offset ); + if (wsa->offset.QuadPart != FILE_USE_FILE_POINTER_POSITION) + wsa->offset.QuadPart += iosb.Information; + if (status == STATUS_END_OF_FILE) + wsa->file = NULL; /* continue on to the footer */ + else if (status != STATUS_SUCCESS) + return status; + else + { + if (iosb.Information) + { + wsa->write.first_iovec = 0; + wsa->write.n_iovecs = 1; + wsa->write.iovec[0].iov_base = wsa->buffer; + wsa->write.iovec[0].iov_len = iosb.Information; + wsa->file_read += iosb.Information; + } + + if (wsa->file_bytes != 0 && wsa->file_read >= wsa->file_bytes) + wsa->file = NULL; + + return STATUS_PENDING; + } + } + + /* send the footer (if applicable) */ + if (wsa->buffers.Tail) + { + wsa->write.first_iovec = 0; + wsa->write.n_iovecs = 1; + wsa->write.iovec[0].iov_base = wsa->buffers.Tail; + wsa->write.iovec[0].iov_len = wsa->buffers.TailLength; + wsa->buffers.Tail = NULL; + return STATUS_PENDING; + } + + return STATUS_SUCCESS; +} + +/*********************************************************************** + * WS2_transmitfile_base (INTERNAL) + * + * Shared implementation for both synchronous and asynchronous TransmitFile. + */ +static NTSTATUS WS2_transmitfile_base( int fd, struct ws2_transmitfile_async *wsa ) +{ + NTSTATUS status; + + status = WS2_transmitfile_getbuffer( fd, wsa ); + if (status == STATUS_PENDING) + { + IO_STATUS_BLOCK *iosb = (IO_STATUS_BLOCK *)wsa->write.user_overlapped; + int n; + + n = WS2_send( fd, &wsa->write, convert_flags(wsa->write.flags) ); + if (n >= 0) + { + if (iosb) iosb->Information += n; + } + else if (errno != EAGAIN) + return wsaErrStatus(); + } + + return status; +} + +/*********************************************************************** + * WS2_async_transmitfile (INTERNAL) + * + * Asynchronous callback for overlapped TransmitFile operations. + */ +static NTSTATUS WS2_async_transmitfile( void *user, IO_STATUS_BLOCK *iosb, + NTSTATUS status, void **apc, void **arg ) +{ + struct ws2_transmitfile_async *wsa = user; + int fd; + + if (status == STATUS_ALERTED) + { + if (!(status = wine_server_handle_to_fd( wsa->write.hSocket, FILE_WRITE_DATA, &fd, NULL ))) + { + status = WS2_transmitfile_base( fd, wsa ); + wine_server_release_fd( wsa->write.hSocket, fd ); + } + if (status == STATUS_PENDING) + return status; + } + + iosb->u.Status = status; + release_async_io( &wsa->io ); + return status; +} + +/*********************************************************************** + * TransmitFile + */ +static BOOL WINAPI WS2_TransmitFile( SOCKET s, HANDLE h, DWORD file_bytes, DWORD bytes_per_send, + LPOVERLAPPED overlapped, LPTRANSMIT_FILE_BUFFERS buffers, + DWORD flags ) +{ + union generic_unix_sockaddr uaddr; + unsigned int uaddrlen = sizeof(uaddr); + struct ws2_transmitfile_async *wsa; + NTSTATUS status; + int fd; + + TRACE("(%lx, %p, %d, %d, %p, %p, %d)\n", s, h, file_bytes, bytes_per_send, overlapped, + buffers, flags ); + + fd = get_sock_fd( s, FILE_WRITE_DATA, NULL ); + if (fd == -1) + { + WSASetLastError( WSAENOTSOCK ); + return FALSE; + } + if (getpeername( fd, &uaddr.addr, &uaddrlen ) != 0) + { + release_sock_fd( s, fd ); + WSASetLastError( WSAENOTCONN ); + return FALSE; + } + if (flags) + FIXME("Flags are not currently supported (0x%x).\n", flags); + + if (h && GetFileType( h ) != FILE_TYPE_DISK) + { + FIXME("Non-disk file handles are not currently supported.\n"); + release_sock_fd( s, fd ); + WSASetLastError( WSAEOPNOTSUPP ); + return FALSE; + } + + /* set reasonable defaults when requested */ + if (!bytes_per_send) + bytes_per_send = (1 << 16); /* Depends on OS version: PAGE_SIZE, 2*PAGE_SIZE, or 2^16 */ + + if (!(wsa = (struct ws2_transmitfile_async *)alloc_async_io( sizeof(*wsa) + bytes_per_send ))) + { + release_sock_fd( s, fd ); + WSASetLastError( WSAEFAULT ); + return FALSE; + } + if (buffers) + wsa->buffers = *buffers; + else + memset(&wsa->buffers, 0x0, sizeof(wsa->buffers)); + wsa->buffer = (char *)(wsa + 1); + wsa->file = h; + wsa->file_read = 0; + wsa->file_bytes = file_bytes; + wsa->bytes_per_send = bytes_per_send; + wsa->flags = flags; + wsa->offset.QuadPart = FILE_USE_FILE_POINTER_POSITION; + wsa->write.hSocket = SOCKET2HANDLE(s); + wsa->write.addr = NULL; + wsa->write.addrlen.val = 0; + wsa->write.flags = 0; + wsa->write.lpFlags = &wsa->flags; + wsa->write.control = NULL; + wsa->write.n_iovecs = 0; + wsa->write.first_iovec = 0; + wsa->write.user_overlapped = overlapped; + if (overlapped) + { + IO_STATUS_BLOCK *iosb = (IO_STATUS_BLOCK *)overlapped; + int status; + + wsa->offset.u.LowPart = overlapped->u.s.Offset; + wsa->offset.u.HighPart = overlapped->u.s.OffsetHigh; + iosb->u.Status = STATUS_PENDING; + iosb->Information = 0; + SERVER_START_REQ( register_async ) + { + req->type = ASYNC_TYPE_WRITE; + req->async.handle = wine_server_obj_handle( SOCKET2HANDLE(s) ); + req->async.event = wine_server_obj_handle( overlapped->hEvent ); + req->async.callback = wine_server_client_ptr( WS2_async_transmitfile ); + req->async.iosb = wine_server_client_ptr( iosb ); + req->async.arg = wine_server_client_ptr( wsa ); + status = wine_server_call( req ); + } + SERVER_END_REQ; + + if(status != STATUS_PENDING) HeapFree( GetProcessHeap(), 0, wsa ); + release_sock_fd( s, fd ); + WSASetLastError( NtStatusToWSAError(status) ); + return FALSE; + } + + do + { + status = WS2_transmitfile_base( fd, wsa ); + if (status == STATUS_PENDING) + { + /* block here */ + do_block(fd, POLLOUT, -1); + _sync_sock_state(s); /* let wineserver notice connection */ + } + } + while (status == STATUS_PENDING); + release_sock_fd( s, fd ); + + if (status != STATUS_SUCCESS) + WSASetLastError( NtStatusToWSAError(status) ); + HeapFree( GetProcessHeap(), 0, wsa ); + return (status == STATUS_SUCCESS); +} + +/*********************************************************************** * GetAcceptExSockaddrs */ static void WINAPI WS2_GetAcceptExSockaddrs(PVOID buffer, DWORD data_size, DWORD local_size, DWORD remote_size, @@ -4430,7 +4734,8 @@ } else if ( IsEqualGUID(&transmitfile_guid, in_buff) ) { - FIXME("SIO_GET_EXTENSION_FUNCTION_POINTER: unimplemented TransmitFile\n"); + *(LPFN_TRANSMITFILE *)out_buff = WS2_TransmitFile; + break; } else if ( IsEqualGUID(&transmitpackets_guid, in_buff) ) { @@ -5996,7 +6301,7 @@ struct addrinfo *unixaires = NULL; int result; struct addrinfo unixhints, *punixhints = NULL; - char *hostname = NULL; + char *hostname; const char *node; *res = NULL; @@ -6006,13 +6311,13 @@ return WSAHOST_NOT_FOUND; } + hostname = get_hostname(); + if (!hostname) return WSA_NOT_ENOUGH_MEMORY; + if (!nodename) node = NULL; else if (!nodename[0]) - { - node = hostname = get_hostname(); - if (!node) return WSA_NOT_ENOUGH_MEMORY; - } + node = hostname; else node = nodename; @@ -6056,6 +6361,14 @@ /* getaddrinfo(3) is thread safe, no need to wrap in CS */ result = getaddrinfo(node, servname, punixhints, &unixaires); + if (result && !strcmp(hostname, node)) + { + /* If it didn't work it means the host name IP is not in /etc/hosts, try again + * by sending a NULL host and avoid sending a NULL servname too because that + * is invalid */ + ERR_(winediag)("Failed to resolve your host name IP\n"); + result = getaddrinfo(NULL, servname ? servname : "0", punixhints, &unixaires); + } TRACE("%s, %s %p -> %p %d\n", debugstr_a(nodename), debugstr_a(servname), hints, res, result); HeapFree(GetProcessHeap(), 0, hostname); @@ -6229,6 +6542,18 @@ } /*********************************************************************** + * GetAddrInfoExW (WS2_32.@) + */ +int WINAPI GetAddrInfoExW(const WCHAR *name, const WCHAR *servname, DWORD namespace, GUID *namespace_id, + const ADDRINFOEXW *hints, ADDRINFOEXW **result, struct timeval *timeout, OVERLAPPED *overlapped, + LPLOOKUPSERVICE_COMPLETION_ROUTINE completion_routine, HANDLE *handle) +{ + FIXME("(%s %s %x %s %p %p %p %p %p %p)\n", debugstr_w(name), debugstr_w(servname), namespace, + debugstr_guid(namespace_id), hints, result, timeout, overlapped, completion_routine, handle); + return WSAHOST_NOT_FOUND; +} + +/*********************************************************************** * GetAddrInfoW (WS2_32.@) */ int WINAPI GetAddrInfoW(LPCWSTR nodename, LPCWSTR servname, const ADDRINFOW *hints, PADDRINFOW *res) @@ -7423,7 +7748,7 @@ #ifdef HAVE_INET_PTON int unixaf, ret; - TRACE("family %d, addr '%s', buffer (%p)\n", family, addr ? addr : "(null)", buffer); + TRACE("family %d, addr %s, buffer (%p)\n", family, debugstr_a(addr), buffer); if (!addr || !buffer) { @@ -7448,6 +7773,36 @@ #endif } +/*********************************************************************** +* InetPtonW (WS2_32.@) +*/ +INT WINAPI InetPtonW(INT family, PCWSTR addr, PVOID buffer) +{ + char *addrA; + int len; + INT ret; + + TRACE("family %d, addr %s, buffer (%p)\n", family, debugstr_w(addr), buffer); + + if (!addr) + { + SetLastError(WSAEFAULT); + return SOCKET_ERROR; + } + + len = WideCharToMultiByte(CP_ACP, 0, addr, -1, NULL, 0, NULL, NULL); + if (!(addrA = HeapAlloc(GetProcessHeap(), 0, len))) + { + SetLastError(WSA_NOT_ENOUGH_MEMORY); + return SOCKET_ERROR; + } + WideCharToMultiByte(CP_ACP, 0, addr, -1, addrA, len, NULL, NULL); + + ret = WS_inet_pton(family, addrA, buffer); + + HeapFree(GetProcessHeap(), 0, addrA); + return ret; +} /*********************************************************************** * WSAStringToAddressA (WS2_32.80) diff -Nru wine1.7-1.7.50/dlls/ws2_32/tests/sock.c wine1.7-1.7.55/dlls/ws2_32/tests/sock.c --- wine1.7-1.7.50/dlls/ws2_32/tests/sock.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ws2_32/tests/sock.c 2015-11-13 14:32:40.000000000 +0000 @@ -67,10 +67,14 @@ static void (WINAPI *pFreeAddrInfoW)(PADDRINFOW); static int (WINAPI *pGetAddrInfoW)(LPCWSTR,LPCWSTR,const ADDRINFOW *,PADDRINFOW *); static PCSTR (WINAPI *pInetNtop)(INT,LPVOID,LPSTR,ULONG); -static int (WINAPI *pInetPton)(INT,LPSTR,LPVOID); +static int (WINAPI *pInetPtonA)(INT,LPCSTR,LPVOID); +static int (WINAPI *pInetPtonW)(INT,LPWSTR,LPVOID); static int (WINAPI *pWSALookupServiceBeginW)(LPWSAQUERYSETW,DWORD,LPHANDLE); static int (WINAPI *pWSALookupServiceEnd)(HANDLE); static int (WINAPI *pWSALookupServiceNextW)(HANDLE,DWORD,LPDWORD,LPWSAQUERYSETW); +static int (WINAPI *pWSAEnumNameSpaceProvidersA)(LPDWORD,LPWSANAMESPACE_INFOA); +static int (WINAPI *pWSAEnumNameSpaceProvidersW)(LPDWORD,LPWSANAMESPACE_INFOW); +static int (WINAPI *pWSAPoll)(WSAPOLLFD *,ULONG,INT); /**************** Structs and typedefs ***************/ @@ -1159,10 +1163,14 @@ pFreeAddrInfoW = (void *)GetProcAddress(hws2_32, "FreeAddrInfoW"); pGetAddrInfoW = (void *)GetProcAddress(hws2_32, "GetAddrInfoW"); pInetNtop = (void *)GetProcAddress(hws2_32, "inet_ntop"); - pInetPton = (void *)GetProcAddress(hws2_32, "inet_pton"); + pInetPtonA = (void *)GetProcAddress(hws2_32, "inet_pton"); + pInetPtonW = (void *)GetProcAddress(hws2_32, "InetPtonW"); pWSALookupServiceBeginW = (void *)GetProcAddress(hws2_32, "WSALookupServiceBeginW"); pWSALookupServiceEnd = (void *)GetProcAddress(hws2_32, "WSALookupServiceEnd"); pWSALookupServiceNextW = (void *)GetProcAddress(hws2_32, "WSALookupServiceNextW"); + pWSAEnumNameSpaceProvidersA = (void *)GetProcAddress(hws2_32, "WSAEnumNameSpaceProvidersA"); + pWSAEnumNameSpaceProvidersW = (void *)GetProcAddress(hws2_32, "WSAEnumNameSpaceProvidersW"); + pWSAPoll = (void *)GetProcAddress(hws2_32, "WSAPoll"); ok ( WSAStartup ( ver, &data ) == 0, "WSAStartup failed\n" ); tls = TlsAlloc(); @@ -3737,7 +3745,8 @@ ok(FD_ISSET(fdRead, &writefds), "fdRead socket is not in the set\n"); len = sizeof(id); id = 0xdeadbeef; - ok(!getsockopt(fdWrite, SOL_SOCKET, SO_ERROR, (char*)&id, &len), "getsockopt failed with %d\n",WSAGetLastError()); + ret = getsockopt(fdWrite, SOL_SOCKET, SO_ERROR, (char*)&id, &len); + ok(!ret, "getsockopt failed with %d\n", WSAGetLastError()); ok(id == 0, "expected 0, got %d\n", id); /* When data is received the receiver gets the read descriptor */ @@ -3821,7 +3830,8 @@ ok(ret == 1, "expected 1, got %d\n", ret); len = sizeof(id); id = 0xdeadbeef; - ok(!getsockopt(fdWrite, SOL_SOCKET, SO_ERROR, (char*)&id, &len), "getsockopt failed with %d\n",WSAGetLastError()); + ret = getsockopt(fdWrite, SOL_SOCKET, SO_ERROR, (char*)&id, &len); + ok(!ret, "getsockopt failed with %d\n", WSAGetLastError()); ok(id == WSAECONNREFUSED, "expected 10061, got %d\n", id); ok(FD_ISSET(fdWrite, &exceptfds), "fdWrite socket is not in the set\n"); ok(select_timeout.tv_usec == 250000, "select timeout should not have changed\n"); @@ -4423,7 +4433,6 @@ return; } - he = NULL; he = gethostbyname(name); ok(he != NULL, "gethostbyname(\"%s\") failed: %d\n", name, h_errno); if(he) @@ -4697,10 +4706,11 @@ int i, ret; DWORD err; char buffer[64],str[64]; + WCHAR printableW[64]; const char *ptr; /* InetNtop and InetPton became available in Vista and Win2008 */ - if (!pInetNtop || !pInetPton) + if (!pInetNtop || !pInetPtonA || !pInetPtonW) { win_skip("InetNtop and/or InetPton not present, not executing tests\n"); return; @@ -4709,7 +4719,7 @@ for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) { WSASetLastError(0xdeadbeef); - ret = pInetPton(tests[i].family, (char *)tests[i].printable, buffer); + ret = pInetPtonA(tests[i].family, tests[i].printable, buffer); ok (ret == tests[i].ret, "Test [%d]: Expected %d, got %d\n", i, tests[i].ret, ret); if (tests[i].ret == -1) { @@ -4730,6 +4740,25 @@ ok (strcmp(ptr, tests[i].collapsed) == 0, "Test [%d]: Expected '%s', got '%s'\n", i, tests[i].collapsed, ptr); } + + for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) + { + if (tests[i].printable) + MultiByteToWideChar(CP_ACP, 0, tests[i].printable, -1, printableW, + sizeof(printableW) / sizeof(printableW[0])); + WSASetLastError(0xdeadbeef); + ret = pInetPtonW(tests[i].family, tests[i].printable ? printableW : NULL, buffer); + ok(ret == tests[i].ret, "Test [%d]: Expected %d, got %d\n", i, tests[i].ret, ret); + if (tests[i].ret == -1) + { + err = WSAGetLastError(); + ok(tests[i].err == err, "Test [%d]: Expected 0x%x, got 0x%x\n", i, tests[i].err, err); + } + if (tests[i].ret != 1) continue; + ok(memcmp(buffer, tests[i].raw_data, + tests[i].family == AF_INET ? sizeof(struct in_addr) : sizeof(struct in6_addr)) == 0, + "Test [%d]: Expected binary data differs\n", i); + } } static void test_ioctlsocket(void) @@ -6303,6 +6332,225 @@ WSACloseEvent(ov.hEvent); } +#define POLL_CLEAR() ix = 0 +#define POLL_SET(s, ev) {fds[ix].fd = s; fds[ix++].events = ev;} +#define POLL_ISSET(s, rev) poll_isset(fds, ix, s, rev) +static BOOL poll_isset(WSAPOLLFD *fds, int max, SOCKET s, int rev) +{ + int k; + for (k = 0; k < max; k++) + if (fds[k].fd == s && (fds[k].revents == rev)) return TRUE; + return FALSE; +} + +static void test_WSAPoll(void) +{ + int ix, ret, err, poll_timeout; + SOCKET fdListen, fdRead, fdWrite; + struct sockaddr_in address; + socklen_t len; + static char tmp_buf[1024]; + WSAPOLLFD fds[16]; + HANDLE thread_handle; + DWORD id; + + if (!pWSAPoll) /* >= Vista */ + { + skip("WSAPoll is unsupported, some tests will be skipped.\n"); + return; + } + + /* Invalid parameters test */ + SetLastError(0xdeadbeef); + ret = pWSAPoll(NULL, 0, 0); + err = GetLastError(); + ok(ret == SOCKET_ERROR, "expected -1, got %d\n", ret); + ok(err == WSAEINVAL, "expected 10022, got %d\n", err); + SetLastError(0xdeadbeef); + ret = pWSAPoll(NULL, 1, 0); + err = GetLastError(); + ok(ret == SOCKET_ERROR, "expected -1, got %d\n", ret); + ok(err == WSAEFAULT, "expected 10014, got %d\n", err); + SetLastError(0xdeadbeef); + ret = pWSAPoll(NULL, 0, 1); + err = GetLastError(); + ok(ret == SOCKET_ERROR, "expected -1, got %d\n", ret); + ok(err == WSAEINVAL, "expected 10022, got %d\n", err); + SetLastError(0xdeadbeef); + ret = pWSAPoll(NULL, 1, 1); + err = GetLastError(); + ok(ret == SOCKET_ERROR, "expected -1, got %d\n", ret); + ok(err == WSAEFAULT, "expected 10014, got %d\n", err); + + /* WSAPoll() tries to mime the unix poll() call. The following tests do: + * - check if a connection attempt ended with success or error; + * - check if a pending connection is waiting for acceptance; + * - check for data to read, availability for write and OOB data + */ + memset(&address, 0, sizeof(address)); + address.sin_addr.s_addr = inet_addr("127.0.0.1"); + address.sin_family = AF_INET; + len = sizeof(address); + fdListen = setup_server_socket(&address, &len); + poll_timeout = 100; + + /* When no events are pending poll returns 0 with no error */ + POLL_CLEAR(); + POLL_SET(fdListen, POLLIN); + ret = pWSAPoll(fds, ix, poll_timeout); + ok(ret == 0, "expected 0, got %d\n", ret); + + /* Test listening socket connection attempt notifications */ + fdWrite = setup_connector_socket(&address, len, TRUE); + POLL_CLEAR(); + POLL_SET(fdListen, POLLIN | POLLOUT); + ret = pWSAPoll(fds, ix, poll_timeout); + ok(ret == 1, "expected 1, got %d\n", ret); + ok(POLL_ISSET(fdListen, POLLRDNORM), "fdListen socket events incorrect\n"); + len = sizeof(address); + fdRead = accept(fdListen, (struct sockaddr*) &address, &len); + ok(fdRead != INVALID_SOCKET, "expected a valid socket\n"); + + /* Test client side connection attempt notifications */ + POLL_CLEAR(); + POLL_SET(fdListen, POLLIN | POLLOUT); + POLL_SET(fdRead, POLLIN | POLLOUT); + POLL_SET(fdWrite, POLLIN | POLLOUT); + ret = pWSAPoll(fds, ix, poll_timeout); + ok(ret == 2, "expected 2, got %d\n", ret); + ok(POLL_ISSET(fdWrite, POLLWRNORM), "fdWrite socket events incorrect\n"); + ok(POLL_ISSET(fdRead, POLLWRNORM), "fdRead socket events incorrect\n"); + len = sizeof(id); + id = 0xdeadbeef; + ok(!getsockopt(fdWrite, SOL_SOCKET, SO_ERROR, (char*)&id, &len), + "getsockopt failed with %d\n",WSAGetLastError()); + ok(id == 0, "expected 0, got %d\n", id); + + /* Test data receiving notifications */ + ret = send(fdWrite, "1234", 4, 0); + ok(ret == 4, "expected 4, got %d\n", ret); + POLL_CLEAR(); + POLL_SET(fdListen, POLLIN | POLLOUT); + POLL_SET(fdRead, POLLIN); + ret = pWSAPoll(fds, ix, poll_timeout); + ok(ret == 1, "expected 1, got %d\n", ret); + ok(POLL_ISSET(fdRead, POLLRDNORM), "fdRead socket events incorrect\n"); + ret = recv(fdRead, tmp_buf, sizeof(tmp_buf), 0); + ok(ret == 4, "expected 4, got %d\n", ret); + ok(!strcmp(tmp_buf, "1234"), "data received differs from sent\n"); + + /* Test OOB data notifications */ + ret = send(fdWrite, "A", 1, MSG_OOB); + ok(ret == 1, "expected 1, got %d\n", ret); + POLL_CLEAR(); + POLL_SET(fdListen, POLLIN | POLLOUT); + POLL_SET(fdRead, POLLIN); + ret = pWSAPoll(fds, ix, poll_timeout); + ok(ret == 1, "expected 1, got %d\n", ret); + ok(POLL_ISSET(fdRead, POLLRDBAND), "fdRead socket events incorrect\n"); + tmp_buf[0] = 0xAF; + ret = recv(fdRead, tmp_buf, sizeof(tmp_buf), MSG_OOB); + ok(ret == 1, "expected 1, got %d\n", ret); + ok(tmp_buf[0] == 'A', "expected 'A', got 0x%02X\n", tmp_buf[0]); + + /* If the socket is OOBINLINED the notification is like normal data */ + ret = 1; + ret = setsockopt(fdRead, SOL_SOCKET, SO_OOBINLINE, (char*) &ret, sizeof(ret)); + ok(ret == 0, "expected 0, got %d\n", ret); + ret = send(fdWrite, "A", 1, MSG_OOB); + ok(ret == 1, "expected 1, got %d\n", ret); + POLL_CLEAR(); + POLL_SET(fdListen, POLLIN | POLLOUT); + POLL_SET(fdRead, POLLIN | POLLOUT); + ret = pWSAPoll(fds, ix, poll_timeout); + ok(ret == 1, "expected 1, got %d\n", ret); + tmp_buf[0] = 0xAF; + SetLastError(0xdeadbeef); + ret = recv(fdRead, tmp_buf, sizeof(tmp_buf), MSG_OOB); + ok(ret == SOCKET_ERROR, "expected -1, got %d\n", ret); + ok(GetLastError() == WSAEINVAL, "expected 10022, got %d\n", GetLastError()); + ret = recv(fdRead, tmp_buf, sizeof(tmp_buf), 0); + ok(ret == 1, "expected 1, got %d\n", ret); + ok(tmp_buf[0] == 'A', "expected 'A', got 0x%02X\n", tmp_buf[0]); + + /* Test connection closed notifications */ + ret = closesocket(fdRead); + ok(ret == 0, "expected 0, got %d\n", ret); + POLL_CLEAR(); + POLL_SET(fdListen, POLLIN | POLLOUT); + POLL_SET(fdWrite, POLLIN); + ret = pWSAPoll(fds, ix, poll_timeout); + ok(ret == 1, "expected 1, got %d\n", ret); + ok(POLL_ISSET(fdWrite, POLLHUP), "fdWrite socket events incorrect\n"); + ret = recv(fdWrite, tmp_buf, sizeof(tmp_buf), 0); + ok(ret == 0, "expected 0, got %d\n", ret); + + /* When a connection is attempted to a non-listening socket due to a bug + * in the MS code it will never be notified. This is a long standing issue + * that will never be fixed for compatibility reasons so we have to deal + * with it manually. */ + ret = closesocket(fdWrite); + ok(ret == 0, "expected 0, got %d\n", ret); + ret = closesocket(fdListen); + ok(ret == 0, "expected 0, got %d\n", ret); + len = sizeof(address); + fdWrite = setup_connector_socket(&address, len, TRUE); + POLL_CLEAR(); + POLL_SET(fdWrite, POLLIN | POLLOUT); + poll_timeout = 2000; + ret = pWSAPoll(fds, ix, poll_timeout); + ok(ret == 0, "expected 0, got %d\n", ret); + len = sizeof(id); + id = 0xdeadbeef; + ok(!getsockopt(fdWrite, SOL_SOCKET, SO_ERROR, (char*)&id, &len), + "getsockopt failed with %d\n", WSAGetLastError()); + ok(id == WSAECONNREFUSED, "expected 10061, got %d\n", id); + closesocket(fdWrite); + + /* Try poll() on a closed socket after connection */ + ok(!tcp_socketpair(&fdRead, &fdWrite), "creating socket pair failed\n"); + closesocket(fdRead); + POLL_CLEAR(); + POLL_SET(fdWrite, POLLIN | POLLOUT); + POLL_SET(fdRead, POLLIN | POLLOUT); + ret = pWSAPoll(fds, ix, poll_timeout); + ok(ret == 1, "expected 1, got %d\n", ret); + ok(POLL_ISSET(fdRead, POLLNVAL), "fdRead socket events incorrect\n"); + POLL_CLEAR(); + POLL_SET(fdWrite, POLLIN | POLLOUT); + ret = pWSAPoll(fds, ix, poll_timeout); + ok(ret == 1, "expected 1, got %d\n", ret); + ok(POLL_ISSET(fdWrite, POLLWRNORM | POLLHUP) || broken(POLL_ISSET(fdWrite, POLLWRNORM)) /* <= 2008 */, + "fdWrite socket events incorrect\n"); + closesocket(fdWrite); + + /* Close the socket currently being polled in a thread */ + ok(!tcp_socketpair(&fdRead, &fdWrite), "creating socket pair failed\n"); + thread_handle = CreateThread(NULL, 0, SelectCloseThread, &fdWrite, 0, &id); + ok(thread_handle != NULL, "CreateThread failed unexpectedly: %d\n", GetLastError()); + POLL_CLEAR(); + POLL_SET(fdWrite, POLLIN | POLLOUT); + ret = pWSAPoll(fds, ix, poll_timeout); + ok(ret == 1, "expected 1, got %d\n", ret); + ok(POLL_ISSET(fdWrite, POLLWRNORM), "fdWrite socket events incorrect\n"); + WaitForSingleObject (thread_handle, 1000); + closesocket(fdRead); + /* test again with less flags - behavior changes */ + ok(!tcp_socketpair(&fdRead, &fdWrite), "creating socket pair failed\n"); + thread_handle = CreateThread(NULL, 0, SelectCloseThread, &fdWrite, 0, &id); + ok(thread_handle != NULL, "CreateThread failed unexpectedly: %d\n", GetLastError()); + POLL_CLEAR(); + POLL_SET(fdWrite, POLLIN); + ret = pWSAPoll(fds, ix, poll_timeout); + ok(ret == 1, "expected 1, got %d\n", ret); + ok(POLL_ISSET(fdWrite, POLLNVAL), "fdWrite socket events incorrect\n"); + WaitForSingleObject (thread_handle, 1000); + closesocket(fdRead); +} +#undef POLL_SET +#undef POLL_ISSET +#undef POLL_CLEAR + static void test_GetAddrInfoW(void) { static const WCHAR port[] = {'8','0',0}; @@ -6313,6 +6561,8 @@ static const WCHAR zero[] = {'0',0}; int i, ret; ADDRINFOW *result, *result2, *p, hint; + WCHAR name[256]; + DWORD size = sizeof(name)/sizeof(WCHAR); if (!pGetAddrInfoW || !pFreeAddrInfoW) { @@ -6320,6 +6570,8 @@ return; } memset(&hint, 0, sizeof(ADDRINFOW)); + name[0] = 0; + GetComputerNameExW( ComputerNamePhysicalDnsHostname, name, &size ); result = (ADDRINFOW *)0xdeadbeef; WSASetLastError(0xdeadbeef); @@ -6395,6 +6647,30 @@ ok(WSAGetLastError() == 0, "expected 0, got %d\n", WSAGetLastError()); pFreeAddrInfoW(result); + /* try to get information from the computer name, result is the same + * as if requesting with an empty host name. */ + ret = pGetAddrInfoW(name, NULL, NULL, &result); + ok(!ret, "GetAddrInfoW failed with %d\n", WSAGetLastError()); + ok(result != NULL, "GetAddrInfoW failed\n"); + + ret = pGetAddrInfoW(empty, NULL, NULL, &result2); + ok(!ret, "GetAddrInfoW failed with %d\n", WSAGetLastError()); + ok(result != NULL, "GetAddrInfoW failed\n"); + compare_addrinfow(result, result2); + pFreeAddrInfoW(result); + pFreeAddrInfoW(result2); + + ret = pGetAddrInfoW(name, empty, NULL, &result); + ok(!ret, "GetAddrInfoW failed with %d\n", WSAGetLastError()); + ok(result != NULL, "GetAddrInfoW failed\n"); + + ret = pGetAddrInfoW(empty, empty, NULL, &result2); + ok(!ret, "GetAddrInfoW failed with %d\n", WSAGetLastError()); + ok(result != NULL, "GetAddrInfoW failed\n"); + compare_addrinfow(result, result2); + pFreeAddrInfoW(result); + pFreeAddrInfoW(result2); + result = (ADDRINFOW *)0xdeadbeef; WSASetLastError(0xdeadbeef); ret = pGetAddrInfoW(NULL, NULL, NULL, &result); @@ -6475,6 +6751,8 @@ { int i, ret; ADDRINFOA *result, *result2, *p, hint; + CHAR name[256]; + DWORD size = sizeof(name); if (!pgetaddrinfo || !pfreeaddrinfo) { @@ -6482,6 +6760,7 @@ return; } memset(&hint, 0, sizeof(ADDRINFOA)); + GetComputerNameExA( ComputerNamePhysicalDnsHostname, name, &size ); result = (ADDRINFOA *)0xdeadbeef; WSASetLastError(0xdeadbeef); @@ -6558,6 +6837,30 @@ ok(WSAGetLastError() == 0, "expected 0, got %d\n", WSAGetLastError()); pfreeaddrinfo(result); + /* try to get information from the computer name, result is the same + * as if requesting with an empty host name. */ + ret = pgetaddrinfo(name, NULL, NULL, &result); + ok(!ret, "getaddrinfo failed with %d\n", WSAGetLastError()); + ok(result != NULL, "GetAddrInfoW failed\n"); + + ret = pgetaddrinfo("", NULL, NULL, &result2); + ok(!ret, "getaddrinfo failed with %d\n", WSAGetLastError()); + ok(result != NULL, "GetAddrInfoW failed\n"); + compare_addrinfo(result, result2); + pfreeaddrinfo(result); + pfreeaddrinfo(result2); + + ret = pgetaddrinfo(name, "", NULL, &result); + ok(!ret, "getaddrinfo failed with %d\n", WSAGetLastError()); + ok(result != NULL, "GetAddrInfoW failed\n"); + + ret = pgetaddrinfo("", "", NULL, &result2); + ok(!ret, "getaddrinfo failed with %d\n", WSAGetLastError()); + ok(result != NULL, "GetAddrInfoW failed\n"); + compare_addrinfo(result, result2); + pfreeaddrinfo(result); + pfreeaddrinfo(result2); + result = (ADDRINFOA *)0xdeadbeef; WSASetLastError(0xdeadbeef); ret = pgetaddrinfo("nxdomain.codeweavers.com", NULL, NULL, &result); @@ -7347,6 +7650,255 @@ closesocket(connector2); } +#define compare_file(h,s,o) compare_file2(h,s,o,__FILE__,__LINE__) + +static void compare_file2(HANDLE handle, SOCKET sock, int offset, const char *file, int line) +{ + char buf1[256], buf2[256]; + BOOL success; + int i = 0; + + SetFilePointer(handle, offset, NULL, FILE_BEGIN); + while (1) + { + DWORD n1 = 0, n2 = 0; + + success = ReadFile(handle, buf1, sizeof(buf1), &n1, NULL); + ok_(file,line)(success, "Failed to read from file.\n"); + if (success && n1 == 0) + break; + else if(!success) + return; + n2 = recv(sock, buf2, n1, 0); + ok_(file,line)(n1 == n2, "Block %d size mismatch (%d != %d)\n", i, n1, n2); + ok_(file,line)(memcmp(buf1, buf2, n2) == 0, "Block %d failed\n", i); + i++; + } +} + +static void test_TransmitFile(void) +{ + DWORD num_bytes, err, file_size, total_sent; + GUID transmitFileGuid = WSAID_TRANSMITFILE; + LPFN_TRANSMITFILE pTransmitFile = NULL; + HANDLE file = INVALID_HANDLE_VALUE; + char header_msg[] = "hello world"; + char footer_msg[] = "goodbye!!!"; + char system_ini_path[MAX_PATH]; + struct sockaddr_in bindAddress; + TRANSMIT_FILE_BUFFERS buffers; + SOCKET client, server, dest; + WSAOVERLAPPED ov; + char buf[256]; + int iret, len; + BOOL bret; + + memset( &ov, 0, sizeof(ov) ); + + /* Setup sockets for testing TransmitFile */ + client = socket(AF_INET, SOCK_STREAM, 0); + server = socket(AF_INET, SOCK_STREAM, 0); + if (client == INVALID_SOCKET || server == INVALID_SOCKET) + { + skip("could not create acceptor socket, error %d\n", WSAGetLastError()); + goto cleanup; + } + iret = WSAIoctl(client, SIO_GET_EXTENSION_FUNCTION_POINTER, &transmitFileGuid, sizeof(transmitFileGuid), + &pTransmitFile, sizeof(pTransmitFile), &num_bytes, NULL, NULL); + if (iret) + { + skip("WSAIoctl failed to get TransmitFile with ret %d + errno %d\n", iret, WSAGetLastError()); + goto cleanup; + } + GetSystemWindowsDirectoryA(system_ini_path, MAX_PATH ); + strcat(system_ini_path, "\\system.ini"); + file = CreateFileA(system_ini_path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_ALWAYS, 0x0, NULL); + if (file == INVALID_HANDLE_VALUE) + { + skip("Unable to open a file to transmit.\n"); + goto cleanup; + } + file_size = GetFileSize(file, NULL); + + /* Test TransmitFile with an invalid socket */ + bret = pTransmitFile(INVALID_SOCKET, file, 0, 0, NULL, NULL, 0); + err = WSAGetLastError(); + ok(!bret, "TransmitFile succeeded unexpectedly.\n"); + ok(err == WSAENOTSOCK, "TransmitFile triggered unexpected errno (%d != %d)\n", err, WSAENOTSOCK); + + /* Test a bogus TransmitFile without a connected socket */ + bret = pTransmitFile(client, NULL, 0, 0, NULL, NULL, TF_REUSE_SOCKET); + err = WSAGetLastError(); + ok(!bret, "TransmitFile succeeded unexpectedly.\n"); + ok(err == WSAENOTCONN, "TransmitFile triggered unexpected errno (%d != %d)\n", err, WSAENOTCONN); + + /* Setup a properly connected socket for transfers */ + memset(&bindAddress, 0, sizeof(bindAddress)); + bindAddress.sin_family = AF_INET; + bindAddress.sin_port = htons(9375); + bindAddress.sin_addr.s_addr = inet_addr("127.0.0.1"); + iret = bind(server, (struct sockaddr*)&bindAddress, sizeof(bindAddress)); + if (iret != 0) + { + skip("failed to bind(), error %d\n", WSAGetLastError()); + goto cleanup; + } + iret = listen(server, 1); + if (iret != 0) + { + skip("failed to listen(), error %d\n", WSAGetLastError()); + goto cleanup; + } + iret = connect(client, (struct sockaddr*)&bindAddress, sizeof(bindAddress)); + if (iret != 0) + { + skip("failed to connect(), error %d\n", WSAGetLastError()); + goto cleanup; + } + len = sizeof(bindAddress); + dest = accept(server, (struct sockaddr*)&bindAddress, &len); + if (dest == INVALID_SOCKET) + { + skip("failed to accept(), error %d\n", WSAGetLastError()); + goto cleanup; + } + if (set_blocking(dest, FALSE)) + { + skip("couldn't make socket non-blocking, error %d\n", WSAGetLastError()); + goto cleanup; + } + + /* Test TransmitFile with no possible buffer */ + bret = pTransmitFile(client, NULL, 0, 0, NULL, NULL, 0); + ok(bret, "TransmitFile failed unexpectedly.\n"); + iret = recv(dest, buf, sizeof(buf), 0); + ok(iret == -1, "Returned an unexpected buffer from TransmitFile (%d != -1).\n", iret); + + /* Test TransmitFile with only buffer data */ + buffers.Head = &header_msg[0]; + buffers.HeadLength = sizeof(header_msg)+1; + buffers.Tail = &footer_msg[0]; + buffers.TailLength = sizeof(footer_msg)+1; + bret = pTransmitFile(client, NULL, 0, 0, NULL, &buffers, 0); + ok(bret, "TransmitFile failed unexpectedly.\n"); + iret = recv(dest, buf, sizeof(buf), 0); + ok(iret == sizeof(header_msg)+sizeof(footer_msg)+2, + "Returned an unexpected buffer from TransmitFile: %d\n", iret ); + ok(memcmp(&buf[0], &header_msg[0], sizeof(header_msg)+1) == 0, + "TransmitFile header buffer did not match!\n"); + ok(memcmp(&buf[sizeof(header_msg)+1], &footer_msg[0], sizeof(footer_msg)+1) == 0, + "TransmitFile footer buffer did not match!\n"); + + /* Test TransmitFile with only file data */ + bret = pTransmitFile(client, file, 0, 0, NULL, NULL, 0); + ok(bret, "TransmitFile failed unexpectedly.\n"); + compare_file(file, dest, 0); + + /* Test TransmitFile with both file and buffer data */ + buffers.Head = &header_msg[0]; + buffers.HeadLength = sizeof(header_msg)+1; + buffers.Tail = &footer_msg[0]; + buffers.TailLength = sizeof(footer_msg)+1; + SetFilePointer(file, 0, NULL, FILE_BEGIN); + bret = pTransmitFile(client, file, 0, 0, NULL, &buffers, 0); + ok(bret, "TransmitFile failed unexpectedly.\n"); + iret = recv(dest, buf, sizeof(header_msg)+1, 0); + ok(memcmp(buf, &header_msg[0], sizeof(header_msg)+1) == 0, + "TransmitFile header buffer did not match!\n"); + compare_file(file, dest, 0); + iret = recv(dest, buf, sizeof(footer_msg)+1, 0); + ok(memcmp(buf, &footer_msg[0], sizeof(footer_msg)+1) == 0, + "TransmitFile footer buffer did not match!\n"); + + /* Test overlapped TransmitFile */ + ov.hEvent = CreateEventW(NULL, FALSE, FALSE, NULL); + if (ov.hEvent == INVALID_HANDLE_VALUE) + { + skip("Could not create event object, some tests will be skipped. errno = %d\n", + GetLastError()); + goto cleanup; + } + SetFilePointer(file, 0, NULL, FILE_BEGIN); + bret = pTransmitFile(client, file, 0, 0, &ov, NULL, 0); + err = WSAGetLastError(); + ok(!bret, "TransmitFile succeeded unexpectedly.\n"); + ok(err == ERROR_IO_PENDING, "TransmitFile triggered unexpected errno (%d != %d)\n", + err, ERROR_IO_PENDING); + iret = WaitForSingleObject(ov.hEvent, 2000); + ok(iret == WAIT_OBJECT_0, "Overlapped TransmitFile failed.\n"); + WSAGetOverlappedResult(client, &ov, &total_sent, FALSE, NULL); + ok(total_sent == file_size, + "Overlapped TransmitFile sent an unexpected number of bytes (%d != %d).\n", + total_sent, file_size); + compare_file(file, dest, 0); + + /* Test overlapped TransmitFile w/ start offset */ + ov.hEvent = CreateEventW(NULL, FALSE, FALSE, NULL); + if (ov.hEvent == INVALID_HANDLE_VALUE) + { + skip("Could not create event object, some tests will be skipped. errno = %d\n", GetLastError()); + goto cleanup; + } + SetFilePointer(file, 0, NULL, FILE_BEGIN); + ov.Offset = 10; + bret = pTransmitFile(client, file, 0, 0, &ov, NULL, 0); + err = WSAGetLastError(); + ok(!bret, "TransmitFile succeeded unexpectedly.\n"); + ok(err == ERROR_IO_PENDING, "TransmitFile triggered unexpected errno (%d != %d)\n", err, ERROR_IO_PENDING); + iret = WaitForSingleObject(ov.hEvent, 2000); + ok(iret == WAIT_OBJECT_0, "Overlapped TransmitFile failed.\n"); + WSAGetOverlappedResult(client, &ov, &total_sent, FALSE, NULL); + ok(total_sent == (file_size - ov.Offset), + "Overlapped TransmitFile sent an unexpected number of bytes (%d != %d).\n", + total_sent, file_size - ov.Offset); + compare_file(file, dest, ov.Offset); + + /* Test overlapped TransmitFile w/ file and buffer data */ + ov.hEvent = CreateEventW(NULL, FALSE, FALSE, NULL); + if (ov.hEvent == INVALID_HANDLE_VALUE) + { + skip("Could not create event object, some tests will be skipped. errno = %d\n", GetLastError()); + goto cleanup; + } + buffers.Head = &header_msg[0]; + buffers.HeadLength = sizeof(header_msg)+1; + buffers.Tail = &footer_msg[0]; + buffers.TailLength = sizeof(footer_msg)+1; + SetFilePointer(file, 0, NULL, FILE_BEGIN); + ov.Offset = 0; + bret = pTransmitFile(client, file, 0, 0, &ov, &buffers, 0); + err = WSAGetLastError(); + ok(!bret, "TransmitFile succeeded unexpectedly.\n"); + ok(err == ERROR_IO_PENDING, "TransmitFile triggered unexpected errno (%d != %d)\n", err, ERROR_IO_PENDING); + iret = WaitForSingleObject(ov.hEvent, 2000); + ok(iret == WAIT_OBJECT_0, "Overlapped TransmitFile failed.\n"); + WSAGetOverlappedResult(client, &ov, &total_sent, FALSE, NULL); + ok(total_sent == (file_size + buffers.HeadLength + buffers.TailLength), + "Overlapped TransmitFile sent an unexpected number of bytes (%d != %d).\n", + total_sent, file_size + buffers.HeadLength + buffers.TailLength); + iret = recv(dest, buf, sizeof(header_msg)+1, 0); + ok(memcmp(buf, &header_msg[0], sizeof(header_msg)+1) == 0, + "TransmitFile header buffer did not match!\n"); + compare_file(file, dest, 0); + iret = recv(dest, buf, sizeof(footer_msg)+1, 0); + ok(memcmp(buf, &footer_msg[0], sizeof(footer_msg)+1) == 0, + "TransmitFile footer buffer did not match!\n"); + + /* Test TransmitFile with a UDP datagram socket */ + closesocket(client); + client = socket(AF_INET, SOCK_DGRAM, 0); + bret = pTransmitFile(client, NULL, 0, 0, NULL, NULL, 0); + err = WSAGetLastError(); + ok(!bret, "TransmitFile succeeded unexpectedly.\n"); + ok(err == WSAENOTCONN, "TransmitFile triggered unexpected errno (%d != %d)\n", err, WSAENOTCONN); + +cleanup: + CloseHandle(file); + CloseHandle(ov.hEvent); + closesocket(client); + closesocket(server); +} + static void test_getpeername(void) { SOCKET sock; @@ -8654,6 +9206,160 @@ ok(!ret, "WSALookupServiceEnd failed unexpectedly\n"); } +static void test_WSAEnumNameSpaceProvidersA(void) +{ + LPWSANAMESPACE_INFOA name = NULL; + DWORD ret, error, blen = 0, i; + if (!pWSAEnumNameSpaceProvidersA) + { + win_skip("WSAEnumNameSpaceProvidersA not found\n"); + return; + } + + SetLastError(0xdeadbeef); + ret = pWSAEnumNameSpaceProvidersA(&blen, name); + error = WSAGetLastError(); +todo_wine + ok(ret == SOCKET_ERROR, "Expected failure, got %u\n", ret); +todo_wine + ok(error == WSAEFAULT, "Expected 10014, got %u\n", error); + + /* Invalid parameter tests */ + SetLastError(0xdeadbeef); + ret = pWSAEnumNameSpaceProvidersA(NULL, name); + error = WSAGetLastError(); +todo_wine + ok(ret == SOCKET_ERROR, "Expected failure, got %u\n", ret); +todo_wine + ok(error == WSAEFAULT, "Expected 10014, got %u\n", error); + + SetLastError(0xdeadbeef); + ret = pWSAEnumNameSpaceProvidersA(NULL, NULL); + error = WSAGetLastError(); +todo_wine + ok(ret == SOCKET_ERROR, "Expected failure, got %u\n", ret); +todo_wine + ok(error == WSAEFAULT, "Expected 10014, got %u\n", error); + + SetLastError(0xdeadbeef); + ret = pWSAEnumNameSpaceProvidersA(&blen, NULL); + error = WSAGetLastError(); +todo_wine + ok(ret == SOCKET_ERROR, "Expected failure, got %u\n", ret); +todo_wine + ok(error == WSAEFAULT, "Expected 10014, got %u\n", error); + + name = HeapAlloc(GetProcessHeap(), 0, blen); + if (!name) + { + skip("Failed to alloc memory\n"); + return; + } + + ret = pWSAEnumNameSpaceProvidersA(&blen, name); +todo_wine + ok(ret > 0, "Expected more than zero name space providers\n"); + + for (i = 0;i < ret; i++) + { + trace("Name space Identifier (%p): %s\n", name[i].lpszIdentifier, + name[i].lpszIdentifier); + switch (name[i].dwNameSpace) + { + case NS_DNS: + trace("\tName space ID: NS_DNS (%u)\n", name[i].dwNameSpace); + break; + case NS_NLA: + trace("\tName space ID: NS_NLA (%u)\n", name[i].dwNameSpace); + break; + default: + trace("\tName space ID: Unknown (%u)\n", name[i].dwNameSpace); + break; + } + trace("\tActive: %d\n", name[i].fActive); + trace("\tVersion: %d\n", name[i].dwVersion); + } + + HeapFree(GetProcessHeap(), 0, name); +} + +static void test_WSAEnumNameSpaceProvidersW(void) +{ + LPWSANAMESPACE_INFOW name = NULL; + DWORD ret, error, blen = 0, i; + if (!pWSAEnumNameSpaceProvidersW) + { + win_skip("WSAEnumNameSpaceProvidersW not found\n"); + return; + } + + SetLastError(0xdeadbeef); + ret = pWSAEnumNameSpaceProvidersW(&blen, name); + error = WSAGetLastError(); +todo_wine + ok(ret == SOCKET_ERROR, "Expected failure, got %u\n", ret); +todo_wine + ok(error == WSAEFAULT, "Expected 10014, got %u\n", error); + + /* Invalid parameter tests */ + SetLastError(0xdeadbeef); + ret = pWSAEnumNameSpaceProvidersW(NULL, name); + error = WSAGetLastError(); +todo_wine + ok(ret == SOCKET_ERROR, "Expected failure, got %u\n", ret); +todo_wine + ok(error == WSAEFAULT, "Expected 10014, got %u\n", error); + + SetLastError(0xdeadbeef); + ret = pWSAEnumNameSpaceProvidersW(NULL, NULL); + error = WSAGetLastError(); +todo_wine + ok(ret == SOCKET_ERROR, "Expected failure, got %u\n", ret); +todo_wine + ok(error == WSAEFAULT, "Expected 10014, got %u\n", error); + + SetLastError(0xdeadbeef); + ret = pWSAEnumNameSpaceProvidersW(&blen, NULL); + error = WSAGetLastError(); +todo_wine + ok(ret == SOCKET_ERROR, "Expected failure, got %u\n", ret); +todo_wine + ok(error == WSAEFAULT, "Expected 10014, got %u\n", error); + + name = HeapAlloc(GetProcessHeap(), 0, blen); + if (!name) + { + skip("Failed to alloc memory\n"); + return; + } + + ret = pWSAEnumNameSpaceProvidersW(&blen, name); +todo_wine + ok(ret > 0, "Expected more than zero name space providers\n"); + + for (i = 0;i < ret; i++) + { + trace("Name space Identifier (%p): %s\n", name[i].lpszIdentifier, + wine_dbgstr_w(name[i].lpszIdentifier)); + switch (name[i].dwNameSpace) + { + case NS_DNS: + trace("\tName space ID: NS_DNS (%u)\n", name[i].dwNameSpace); + break; + case NS_NLA: + trace("\tName space ID: NS_NLA (%u)\n", name[i].dwNameSpace); + break; + default: + trace("\tName space ID: Unknown (%u)\n", name[i].dwNameSpace); + break; + } + trace("\tActive: %d\n", name[i].fActive); + trace("\tVersion: %d\n", name[i].dwVersion); + } + + HeapFree(GetProcessHeap(), 0, name); +} + /**************** Main program ***************/ START_TEST( sock ) @@ -8710,11 +9416,13 @@ test_WSASendMsg(); test_WSASendTo(); test_WSARecv(); + test_WSAPoll(); test_events(0); test_events(1); test_ipv6only(); + test_TransmitFile(); test_GetAddrInfoW(); test_getaddrinfo(); test_AcceptEx(); @@ -8724,6 +9432,8 @@ test_sioAddressListChange(); test_WSALookupService(); + test_WSAEnumNameSpaceProvidersA(); + test_WSAEnumNameSpaceProvidersW(); test_WSAAsyncGetServByPort(); test_WSAAsyncGetServByName(); diff -Nru wine1.7-1.7.50/dlls/ws2_32/ws2_32.spec wine1.7-1.7.55/dlls/ws2_32/ws2_32.spec --- wine1.7-1.7.50/dlls/ws2_32/ws2_32.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/ws2_32/ws2_32.spec 2015-11-13 14:32:40.000000000 +0000 @@ -51,8 +51,10 @@ 500 stub WEP @ stdcall FreeAddrInfoW(ptr) +@ stdcall GetAddrInfoExW(wstr wstr long ptr ptr ptr ptr ptr ptr ptr) @ stdcall GetAddrInfoW(wstr wstr ptr ptr) @ stdcall GetNameInfoW(ptr long ptr long ptr long long) +@ stdcall InetPtonW(long wstr ptr) @ stdcall WSApSetPostRoutine(ptr) @ stdcall WPUCompleteOverlappedRequest(long ptr long long ptr) @ stdcall WSAAccept(long ptr ptr ptr long) @@ -121,4 +123,4 @@ @ stdcall getaddrinfo(str str ptr ptr) WS_getaddrinfo @ stdcall getnameinfo(ptr long ptr long ptr long long) WS_getnameinfo @ stdcall inet_ntop(long ptr ptr long) WS_inet_ntop -@ stdcall inet_pton(long ptr ptr) WS_inet_pton +@ stdcall inet_pton(long str ptr) WS_inet_pton diff -Nru wine1.7-1.7.50/dlls/wshom.ocx/tests/wshom.idl wine1.7-1.7.55/dlls/wshom.ocx/tests/wshom.idl --- wine1.7-1.7.50/dlls/wshom.ocx/tests/wshom.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/wshom.ocx/tests/wshom.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep header + import "oaidl.idl"; cpp_quote("#undef ExpandEnvironmentStrings") diff -Nru wine1.7-1.7.50/dlls/x3daudio1_0/main.c wine1.7-1.7.55/dlls/x3daudio1_0/main.c --- wine1.7-1.7.50/dlls/x3daudio1_0/main.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/x3daudio1_0/main.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,36 @@ +/* + * Copyright 2015 Andrew Eikum for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#include "config.h" +#include + +#include "windef.h" +#include "winbase.h" + +BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) +{ + switch (reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(instance); + break; + } + + return TRUE; +} diff -Nru wine1.7-1.7.50/dlls/x3daudio1_0/Makefile.in wine1.7-1.7.55/dlls/x3daudio1_0/Makefile.in --- wine1.7-1.7.50/dlls/x3daudio1_0/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/x3daudio1_0/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,4 @@ +MODULE = x3daudio1_0.dll + +C_SRCS = \ + main.c diff -Nru wine1.7-1.7.50/dlls/x3daudio1_0/x3daudio1_0.spec wine1.7-1.7.55/dlls/x3daudio1_0/x3daudio1_0.spec --- wine1.7-1.7.50/dlls/x3daudio1_0/x3daudio1_0.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/x3daudio1_0/x3daudio1_0.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,2 @@ +@ cdecl X3DAudioCalculate(ptr ptr ptr long ptr) xaudio2_8.X3DAudioCalculate +@ cdecl X3DAudioInitialize(long float ptr) x3daudio1_7.X3DAudioInitialize diff -Nru wine1.7-1.7.50/dlls/x3daudio1_1/x3daudio1_1.spec wine1.7-1.7.55/dlls/x3daudio1_1/x3daudio1_1.spec --- wine1.7-1.7.50/dlls/x3daudio1_1/x3daudio1_1.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/x3daudio1_1/x3daudio1_1.spec 2015-11-13 14:32:40.000000000 +0000 @@ -1,2 +1,2 @@ -@ stub X3DAudioCalculate -@ stub X3DAudioInitialize +@ cdecl X3DAudioCalculate(ptr ptr ptr long ptr) xaudio2_8.X3DAudioCalculate +@ cdecl X3DAudioInitialize(long float ptr) x3daudio1_7.X3DAudioInitialize diff -Nru wine1.7-1.7.50/dlls/x3daudio1_2/x3daudio1_2.spec wine1.7-1.7.55/dlls/x3daudio1_2/x3daudio1_2.spec --- wine1.7-1.7.50/dlls/x3daudio1_2/x3daudio1_2.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/x3daudio1_2/x3daudio1_2.spec 2015-11-13 14:32:40.000000000 +0000 @@ -1,2 +1,2 @@ -@ stub X3DAudioCalculate -@ stub X3DAudioInitialize +@ cdecl X3DAudioCalculate(ptr ptr ptr long ptr) xaudio2_8.X3DAudioCalculate +@ cdecl X3DAudioInitialize(long float ptr) x3daudio1_7.X3DAudioInitialize diff -Nru wine1.7-1.7.50/dlls/x3daudio1_3/x3daudio1_3.spec wine1.7-1.7.55/dlls/x3daudio1_3/x3daudio1_3.spec --- wine1.7-1.7.50/dlls/x3daudio1_3/x3daudio1_3.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/x3daudio1_3/x3daudio1_3.spec 2015-11-13 14:32:40.000000000 +0000 @@ -1,2 +1,2 @@ -@ stub X3DAudioCalculate -@ stub X3DAudioInitialize +@ cdecl X3DAudioCalculate(ptr ptr ptr long ptr) xaudio2_8.X3DAudioCalculate +@ cdecl X3DAudioInitialize(long float ptr) x3daudio1_7.X3DAudioInitialize diff -Nru wine1.7-1.7.50/dlls/x3daudio1_4/x3daudio1_4.spec wine1.7-1.7.55/dlls/x3daudio1_4/x3daudio1_4.spec --- wine1.7-1.7.50/dlls/x3daudio1_4/x3daudio1_4.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/x3daudio1_4/x3daudio1_4.spec 2015-11-13 14:32:40.000000000 +0000 @@ -1,2 +1,2 @@ -@ stub X3DAudioCalculate -@ stub X3DAudioInitialize +@ cdecl X3DAudioCalculate(ptr ptr ptr long ptr) xaudio2_8.X3DAudioCalculate +@ cdecl X3DAudioInitialize(long float ptr) x3daudio1_7.X3DAudioInitialize diff -Nru wine1.7-1.7.50/dlls/x3daudio1_5/x3daudio1_5.spec wine1.7-1.7.55/dlls/x3daudio1_5/x3daudio1_5.spec --- wine1.7-1.7.50/dlls/x3daudio1_5/x3daudio1_5.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/x3daudio1_5/x3daudio1_5.spec 2015-11-13 14:32:40.000000000 +0000 @@ -1,2 +1,2 @@ -@ stub X3DAudioCalculate -@ stub X3DAudioInitialize +@ cdecl X3DAudioCalculate(ptr ptr ptr long ptr) xaudio2_8.X3DAudioCalculate +@ cdecl X3DAudioInitialize(long float ptr) x3daudio1_7.X3DAudioInitialize diff -Nru wine1.7-1.7.50/dlls/x3daudio1_6/main.c wine1.7-1.7.55/dlls/x3daudio1_6/main.c --- wine1.7-1.7.50/dlls/x3daudio1_6/main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/x3daudio1_6/main.c 2015-11-13 14:32:40.000000000 +0000 @@ -23,6 +23,8 @@ #include "windef.h" #include "winbase.h" +#include "x3daudio.h" + BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { switch (fdwReason) diff -Nru wine1.7-1.7.50/dlls/x3daudio1_6/x3daudio1_6.spec wine1.7-1.7.55/dlls/x3daudio1_6/x3daudio1_6.spec --- wine1.7-1.7.50/dlls/x3daudio1_6/x3daudio1_6.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/x3daudio1_6/x3daudio1_6.spec 2015-11-13 14:32:40.000000000 +0000 @@ -1,2 +1,2 @@ -@ stub X3DAudioCalculate -@ stub X3DAudioInitialize +@ cdecl X3DAudioCalculate(ptr ptr ptr long ptr) xaudio2_8.X3DAudioCalculate +@ cdecl X3DAudioInitialize(long float ptr) x3daudio1_7.X3DAudioInitialize diff -Nru wine1.7-1.7.50/dlls/x3daudio1_7/main.c wine1.7-1.7.55/dlls/x3daudio1_7/main.c --- wine1.7-1.7.50/dlls/x3daudio1_7/main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/x3daudio1_7/main.c 2015-11-13 14:32:40.000000000 +0000 @@ -15,15 +15,13 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ + #include "config.h" #include #include "windef.h" #include "winbase.h" - -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(x3daudio); +#include "x3daudio.h" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) { @@ -39,8 +37,9 @@ return TRUE; } -HRESULT CDECL X3DAudioInitialize(UINT32 chanmask, float speedofsound, void *handle) +void CDECL X3DA17_X3DAudioInitialize(UINT32 chanmask, float speedofsound, + X3DAUDIO_HANDLE handle) { - FIXME("0x%x, %f, %p: Stub!\n", chanmask, speedofsound, handle); - return S_OK; + /* forward to xaudio2_8 */ + X3DAudioInitialize(chanmask, speedofsound, handle); } diff -Nru wine1.7-1.7.50/dlls/x3daudio1_7/Makefile.in wine1.7-1.7.55/dlls/x3daudio1_7/Makefile.in --- wine1.7-1.7.50/dlls/x3daudio1_7/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/x3daudio1_7/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -1,4 +1,5 @@ MODULE = x3daudio1_7.dll +IMPORTS = xaudio2_8 C_SRCS = \ main.c diff -Nru wine1.7-1.7.50/dlls/x3daudio1_7/x3daudio1_7.spec wine1.7-1.7.55/dlls/x3daudio1_7/x3daudio1_7.spec --- wine1.7-1.7.50/dlls/x3daudio1_7/x3daudio1_7.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/x3daudio1_7/x3daudio1_7.spec 2015-11-13 14:32:40.000000000 +0000 @@ -1,2 +1,2 @@ -@ stub X3DAudioCalculate -@ cdecl X3DAudioInitialize(long float ptr) +@ cdecl X3DAudioCalculate(ptr ptr ptr long ptr) xaudio2_8.X3DAudioCalculate +@ cdecl X3DAudioInitialize(long float ptr) X3DA17_X3DAudioInitialize diff -Nru wine1.7-1.7.50/dlls/xapofx1_1/main.c wine1.7-1.7.55/dlls/xapofx1_1/main.c --- wine1.7-1.7.50/dlls/xapofx1_1/main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/xapofx1_1/main.c 2015-11-13 14:32:40.000000000 +0000 @@ -19,8 +19,11 @@ #include "config.h" #include +#include "initguid.h" #include "windef.h" #include "winbase.h" +#include "compobj.h" +#include "xapofx.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(xapofx); @@ -43,3 +46,19 @@ } return TRUE; } + +HRESULT CDECL CreateFX(REFCLSID clsid, IUnknown **out) +{ + const GUID *class = clsid; + + TRACE("%s %p\n", debugstr_guid(clsid), out); + + if(IsEqualGUID(clsid, &CLSID_FXReverb27) || + IsEqualGUID(clsid, &CLSID_FXReverb)) + class = &CLSID_WINE_FXReverb11; + else if(IsEqualGUID(clsid, &CLSID_FXEQ27) || + IsEqualGUID(clsid, &CLSID_FXEQ)) + class = &CLSID_WINE_FXEQ11; + + return CoCreateInstance(class, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)out); +} diff -Nru wine1.7-1.7.50/dlls/xapofx1_1/Makefile.in wine1.7-1.7.55/dlls/xapofx1_1/Makefile.in --- wine1.7-1.7.50/dlls/xapofx1_1/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/xapofx1_1/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -1,4 +1,5 @@ MODULE = xapofx1_1.dll +IMPORTS = ole32 C_SRCS = \ main.c diff -Nru wine1.7-1.7.50/dlls/xapofx1_1/xapofx1_1.spec wine1.7-1.7.55/dlls/xapofx1_1/xapofx1_1.spec --- wine1.7-1.7.50/dlls/xapofx1_1/xapofx1_1.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/xapofx1_1/xapofx1_1.spec 2015-11-13 14:32:40.000000000 +0000 @@ -1 +1 @@ -@ stub CreateFX +@ cdecl CreateFX(ptr ptr) diff -Nru wine1.7-1.7.50/dlls/xapofx1_2/main.c wine1.7-1.7.55/dlls/xapofx1_2/main.c --- wine1.7-1.7.50/dlls/xapofx1_2/main.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xapofx1_2/main.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,64 @@ +/* + * Copyright 2015 Andrew Eikum for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" +#include + +#include "initguid.h" +#include "windef.h" +#include "winbase.h" +#include "compobj.h" +#include "xapofx.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(xapofx); + +/***************************************************** + * DllMain + */ +BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) +{ + TRACE("(%p, %d, %p)\n", hinst, reason, reserved); + + switch(reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(hinst); + break; + } + return TRUE; +} + +HRESULT CDECL CreateFX(REFCLSID clsid, IUnknown **out) +{ + const GUID *class = clsid; + + TRACE("%s %p\n", debugstr_guid(clsid), out); + + if(IsEqualGUID(clsid, &CLSID_FXReverb27) || + IsEqualGUID(clsid, &CLSID_FXReverb)) + class = &CLSID_WINE_FXReverb12; + else if(IsEqualGUID(clsid, &CLSID_FXEQ27) || + IsEqualGUID(clsid, &CLSID_FXEQ)) + class = &CLSID_WINE_FXEQ12; + + return CoCreateInstance(class, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)out); +} diff -Nru wine1.7-1.7.50/dlls/xapofx1_2/Makefile.in wine1.7-1.7.55/dlls/xapofx1_2/Makefile.in --- wine1.7-1.7.50/dlls/xapofx1_2/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xapofx1_2/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,5 @@ +MODULE = xapofx1_2.dll +IMPORTS = ole32 + +C_SRCS = \ + main.c diff -Nru wine1.7-1.7.50/dlls/xapofx1_2/xapofx1_2.spec wine1.7-1.7.55/dlls/xapofx1_2/xapofx1_2.spec --- wine1.7-1.7.50/dlls/xapofx1_2/xapofx1_2.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xapofx1_2/xapofx1_2.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1 @@ +@ cdecl CreateFX(ptr ptr) diff -Nru wine1.7-1.7.50/dlls/xapofx1_3/main.c wine1.7-1.7.55/dlls/xapofx1_3/main.c --- wine1.7-1.7.50/dlls/xapofx1_3/main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/xapofx1_3/main.c 2015-11-13 14:32:40.000000000 +0000 @@ -17,11 +17,16 @@ */ #include "config.h" - #include +#include "initguid.h" #include "windef.h" #include "winbase.h" +#include "compobj.h" +#include "xapofx.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(xaudio2); BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) { @@ -36,3 +41,19 @@ return TRUE; } + +HRESULT CDECL CreateFX(REFCLSID clsid, IUnknown **out) +{ + const GUID *class = clsid; + + TRACE("%s %p\n", debugstr_guid(clsid), out); + + if(IsEqualGUID(clsid, &CLSID_FXReverb27) || + IsEqualGUID(clsid, &CLSID_FXReverb)) + class = &CLSID_WINE_FXReverb13; + else if(IsEqualGUID(clsid, &CLSID_FXEQ27) || + IsEqualGUID(clsid, &CLSID_FXEQ)) + class = &CLSID_WINE_FXEQ13; + + return CoCreateInstance(class, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)out); +} diff -Nru wine1.7-1.7.50/dlls/xapofx1_3/Makefile.in wine1.7-1.7.55/dlls/xapofx1_3/Makefile.in --- wine1.7-1.7.50/dlls/xapofx1_3/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/xapofx1_3/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -1,4 +1,5 @@ MODULE = xapofx1_3.dll +IMPORTS = ole32 C_SRCS = \ main.c diff -Nru wine1.7-1.7.50/dlls/xapofx1_3/xapofx1_3.spec wine1.7-1.7.55/dlls/xapofx1_3/xapofx1_3.spec --- wine1.7-1.7.50/dlls/xapofx1_3/xapofx1_3.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/xapofx1_3/xapofx1_3.spec 2015-11-13 14:32:40.000000000 +0000 @@ -1 +1 @@ -@ stub CreateFX +@ cdecl CreateFX(ptr ptr) diff -Nru wine1.7-1.7.50/dlls/xapofx1_4/main.c wine1.7-1.7.55/dlls/xapofx1_4/main.c --- wine1.7-1.7.50/dlls/xapofx1_4/main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/xapofx1_4/main.c 2015-11-13 14:32:40.000000000 +0000 @@ -15,12 +15,18 @@ * 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 "config.h" #include +#include "initguid.h" #include "windef.h" #include "winbase.h" +#include "compobj.h" +#include "xapofx.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(xaudio2); BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) { @@ -35,3 +41,19 @@ return TRUE; } + +HRESULT CDECL CreateFX(REFCLSID clsid, IUnknown **out) +{ + const GUID *class = clsid; + + TRACE("%s %p\n", debugstr_guid(clsid), out); + + if(IsEqualGUID(clsid, &CLSID_FXReverb27) || + IsEqualGUID(clsid, &CLSID_FXReverb)) + class = &CLSID_WINE_FXReverb14; + else if(IsEqualGUID(clsid, &CLSID_FXEQ27) || + IsEqualGUID(clsid, &CLSID_FXEQ)) + class = &CLSID_WINE_FXEQ14; + + return CoCreateInstance(class, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)out); +} diff -Nru wine1.7-1.7.50/dlls/xapofx1_4/Makefile.in wine1.7-1.7.55/dlls/xapofx1_4/Makefile.in --- wine1.7-1.7.50/dlls/xapofx1_4/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/xapofx1_4/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -1,4 +1,5 @@ MODULE = xapofx1_4.dll +IMPORTS = ole32 C_SRCS = \ main.c diff -Nru wine1.7-1.7.50/dlls/xapofx1_4/xapofx1_4.spec wine1.7-1.7.55/dlls/xapofx1_4/xapofx1_4.spec --- wine1.7-1.7.50/dlls/xapofx1_4/xapofx1_4.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/xapofx1_4/xapofx1_4.spec 2015-11-13 14:32:40.000000000 +0000 @@ -1 +1 @@ -@ stub CreateFX +@ cdecl CreateFX(ptr ptr) diff -Nru wine1.7-1.7.50/dlls/xapofx1_5/main.c wine1.7-1.7.55/dlls/xapofx1_5/main.c --- wine1.7-1.7.50/dlls/xapofx1_5/main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/xapofx1_5/main.c 2015-11-13 14:32:40.000000000 +0000 @@ -15,12 +15,18 @@ * 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 "config.h" #include +#include "initguid.h" #include "windef.h" #include "winbase.h" +#include "compobj.h" +#include "xapofx.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(xaudio2); BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) { @@ -35,3 +41,19 @@ return TRUE; } + +HRESULT CDECL CreateFX(REFCLSID clsid, IUnknown **out) +{ + const GUID *class = clsid; + + TRACE("%s %p\n", debugstr_guid(clsid), out); + + if(IsEqualGUID(clsid, &CLSID_FXReverb27) || + IsEqualGUID(clsid, &CLSID_FXReverb)) + class = &CLSID_WINE_FXReverb15; + else if(IsEqualGUID(clsid, &CLSID_FXEQ27) || + IsEqualGUID(clsid, &CLSID_FXEQ)) + class = &CLSID_WINE_FXEQ15; + + return CoCreateInstance(class, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)out); +} diff -Nru wine1.7-1.7.50/dlls/xapofx1_5/Makefile.in wine1.7-1.7.55/dlls/xapofx1_5/Makefile.in --- wine1.7-1.7.50/dlls/xapofx1_5/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/xapofx1_5/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -1,4 +1,5 @@ MODULE = xapofx1_5.dll +IMPORTS = ole32 C_SRCS = \ main.c diff -Nru wine1.7-1.7.50/dlls/xapofx1_5/xapofx1_5.spec wine1.7-1.7.55/dlls/xapofx1_5/xapofx1_5.spec --- wine1.7-1.7.50/dlls/xapofx1_5/xapofx1_5.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/xapofx1_5/xapofx1_5.spec 2015-11-13 14:32:40.000000000 +0000 @@ -1 +1 @@ -@ stub CreateFX +@ cdecl CreateFX(ptr ptr) diff -Nru wine1.7-1.7.50/dlls/xaudio2_0/Makefile.in wine1.7-1.7.55/dlls/xaudio2_0/Makefile.in --- wine1.7-1.7.50/dlls/xaudio2_0/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_0/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,7 @@ +MODULE = xaudio2_0.dll +IMPORTS = ole32 + +C_SRCS = \ + xaudio_dll.c + +IDL_SRCS = xaudio_classes.idl diff -Nru wine1.7-1.7.50/dlls/xaudio2_0/xaudio2_0.spec wine1.7-1.7.55/dlls/xaudio2_0/xaudio2_0.spec --- wine1.7-1.7.50/dlls/xaudio2_0/xaudio2_0.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_0/xaudio2_0.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,4 @@ +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) xaudio2_7.DllGetClassObject +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff -Nru wine1.7-1.7.50/dlls/xaudio2_0/xaudio_classes.idl wine1.7-1.7.55/dlls/xaudio2_0/xaudio_classes.idl --- wine1.7-1.7.50/dlls/xaudio2_0/xaudio_classes.idl 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_0/xaudio_classes.idl 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,42 @@ +/* + * COM Classes for xaudio + * + * Copyright 2015 Andrew Eikum for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma makedep register + +[ + helpstring("XAudio2.0 Class"), + threading(both), + uuid(fac23f48-31f5-45a8-b49b-5225d61401aa) +] +coclass XAudio20 { interface IXAudio20; } + +[ + helpstring("XAudio2.0 AudioReverb Class"), + threading(both), + uuid(6f6ea3a9-2cf5-41cf-91c1-2170b1540063) +] +coclass AudioReverb20 { interface IXAPO; } + +[ + helpstring("XAudio2.0 AudioVolumeMeter Class"), + threading(both), + uuid(c0c56f46-29b1-44e9-9939-a32ce86867e2) +] +coclass AudioVolumeMeter20 { interface IXAPO; } diff -Nru wine1.7-1.7.50/dlls/xaudio2_0/xaudio_dll.c wine1.7-1.7.55/dlls/xaudio2_0/xaudio_dll.c --- wine1.7-1.7.50/dlls/xaudio2_0/xaudio_dll.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_0/xaudio_dll.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2015 Andrew Eikum 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 "winbase.h" +#include "objbase.h" +#include "rpcproxy.h" + +static HINSTANCE instance; + +BOOL WINAPI DllMain(HINSTANCE hinstance, DWORD reason, LPVOID reserved) +{ + switch (reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + instance = hinstance; + DisableThreadLibraryCalls(hinstance); + break; + } + return TRUE; +} + +HRESULT WINAPI DllCanUnloadNow(void) +{ + return S_FALSE; +} + +HRESULT WINAPI DllRegisterServer(void) +{ + return __wine_register_resources(instance); +} + +HRESULT WINAPI DllUnregisterServer(void) +{ + return __wine_unregister_resources(instance); +} diff -Nru wine1.7-1.7.50/dlls/xaudio2_1/Makefile.in wine1.7-1.7.55/dlls/xaudio2_1/Makefile.in --- wine1.7-1.7.50/dlls/xaudio2_1/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_1/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,7 @@ +MODULE = xaudio2_1.dll +IMPORTS = ole32 + +C_SRCS = \ + xaudio_dll.c + +IDL_SRCS = xaudio_classes.idl diff -Nru wine1.7-1.7.50/dlls/xaudio2_1/xaudio2_1.spec wine1.7-1.7.55/dlls/xaudio2_1/xaudio2_1.spec --- wine1.7-1.7.50/dlls/xaudio2_1/xaudio2_1.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_1/xaudio2_1.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,4 @@ +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) xaudio2_7.DllGetClassObject +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff -Nru wine1.7-1.7.50/dlls/xaudio2_1/xaudio_classes.idl wine1.7-1.7.55/dlls/xaudio2_1/xaudio_classes.idl --- wine1.7-1.7.50/dlls/xaudio2_1/xaudio_classes.idl 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_1/xaudio_classes.idl 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,42 @@ +/* + * COM Classes for xaudio + * + * Copyright 2015 Andrew Eikum for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma makedep register + +[ + helpstring("XAudio2.1 Class"), + threading(both), + uuid(e21a7345-eb21-468e-be50-804db97cf708) +] +coclass XAudio21 { interface IXAudio22; } + +[ + helpstring("XAudio2.1 AudioReverb Class"), + threading(both), + uuid(f4769300-b949-4df9-b333-00d33932e9a6) +] +coclass AudioReverb21 { interface IXAPO; } + +[ + helpstring("XAudio2.1 AudioVolumeMeter Class"), + threading(both), + uuid(c1e3f122-a2ea-442c-854f-20d98f8357a1) +] +coclass AudioVolumeMeter21 { interface IXAPO; } diff -Nru wine1.7-1.7.50/dlls/xaudio2_1/xaudio_dll.c wine1.7-1.7.55/dlls/xaudio2_1/xaudio_dll.c --- wine1.7-1.7.50/dlls/xaudio2_1/xaudio_dll.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_1/xaudio_dll.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2015 Andrew Eikum 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 "winbase.h" +#include "objbase.h" +#include "rpcproxy.h" + +static HINSTANCE instance; + +BOOL WINAPI DllMain(HINSTANCE hinstance, DWORD reason, LPVOID reserved) +{ + switch (reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + instance = hinstance; + DisableThreadLibraryCalls(hinstance); + break; + } + return TRUE; +} + +HRESULT WINAPI DllCanUnloadNow(void) +{ + return S_FALSE; +} + +HRESULT WINAPI DllRegisterServer(void) +{ + return __wine_register_resources(instance); +} + +HRESULT WINAPI DllUnregisterServer(void) +{ + return __wine_unregister_resources(instance); +} diff -Nru wine1.7-1.7.50/dlls/xaudio2_2/Makefile.in wine1.7-1.7.55/dlls/xaudio2_2/Makefile.in --- wine1.7-1.7.50/dlls/xaudio2_2/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_2/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,7 @@ +MODULE = xaudio2_2.dll +IMPORTS = ole32 + +C_SRCS = \ + xaudio_dll.c + +IDL_SRCS = xaudio_classes.idl diff -Nru wine1.7-1.7.50/dlls/xaudio2_2/xaudio2_2.spec wine1.7-1.7.55/dlls/xaudio2_2/xaudio2_2.spec --- wine1.7-1.7.50/dlls/xaudio2_2/xaudio2_2.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_2/xaudio2_2.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,4 @@ +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) xaudio2_7.DllGetClassObject +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff -Nru wine1.7-1.7.50/dlls/xaudio2_2/xaudio_classes.idl wine1.7-1.7.55/dlls/xaudio2_2/xaudio_classes.idl --- wine1.7-1.7.50/dlls/xaudio2_2/xaudio_classes.idl 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_2/xaudio_classes.idl 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,42 @@ +/* + * COM Classes for xaudio + * + * Copyright 2015 Andrew Eikum for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma makedep register + +[ + helpstring("XAudio2.2 Class"), + threading(both), + uuid(b802058a-464a-42db-bc10-b650d6f2586a) +] +coclass XAudio22 { interface IXAudio22; } + +[ + helpstring("XAudio2.2 AudioReverb Class"), + threading(both), + uuid(629cf0de-3ecc-41e7-9926-f7e43eebec51) +] +coclass AudioReverb22 { interface IXAPO; } + +[ + helpstring("XAudio2.2 AudioVolumeMeter Class"), + threading(both), + uuid(f5ca7b34-8055-42c0-b836-216129eb7e30) +] +coclass AudioVolumeMeter22 { interface IXAPO; } diff -Nru wine1.7-1.7.50/dlls/xaudio2_2/xaudio_dll.c wine1.7-1.7.55/dlls/xaudio2_2/xaudio_dll.c --- wine1.7-1.7.50/dlls/xaudio2_2/xaudio_dll.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_2/xaudio_dll.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2015 Andrew Eikum 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 "winbase.h" +#include "objbase.h" +#include "rpcproxy.h" + +static HINSTANCE instance; + +BOOL WINAPI DllMain(HINSTANCE hinstance, DWORD reason, LPVOID reserved) +{ + switch (reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + instance = hinstance; + DisableThreadLibraryCalls(hinstance); + break; + } + return TRUE; +} + +HRESULT WINAPI DllCanUnloadNow(void) +{ + return S_FALSE; +} + +HRESULT WINAPI DllRegisterServer(void) +{ + return __wine_register_resources(instance); +} + +HRESULT WINAPI DllUnregisterServer(void) +{ + return __wine_unregister_resources(instance); +} diff -Nru wine1.7-1.7.50/dlls/xaudio2_3/Makefile.in wine1.7-1.7.55/dlls/xaudio2_3/Makefile.in --- wine1.7-1.7.50/dlls/xaudio2_3/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_3/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,7 @@ +MODULE = xaudio2_3.dll +IMPORTS = ole32 + +C_SRCS = \ + xaudio_dll.c + +IDL_SRCS = xaudio_classes.idl diff -Nru wine1.7-1.7.50/dlls/xaudio2_3/xaudio2_3.spec wine1.7-1.7.55/dlls/xaudio2_3/xaudio2_3.spec --- wine1.7-1.7.50/dlls/xaudio2_3/xaudio2_3.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_3/xaudio2_3.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,4 @@ +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) xaudio2_7.DllGetClassObject +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff -Nru wine1.7-1.7.50/dlls/xaudio2_3/xaudio_classes.idl wine1.7-1.7.55/dlls/xaudio2_3/xaudio_classes.idl --- wine1.7-1.7.50/dlls/xaudio2_3/xaudio_classes.idl 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_3/xaudio_classes.idl 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,42 @@ +/* + * COM Classes for xaudio + * + * Copyright 2015 Andrew Eikum for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma makedep register + +[ + helpstring("XAudio2.3 Class"), + threading(both), + uuid(4c5e637a-16c7-4de3-9c46-5ed22181962d) +] +coclass XAudio23 { interface IXAudio27; } + +[ + helpstring("XAudio2.3 AudioReverb Class"), + threading(both), + uuid(9cab402c-1d37-44b4-886d-fa4f36170a4c) +] +coclass AudioReverb23 { interface IXAPO; } + +[ + helpstring("XAudio2.3 AudioVolumeMeter Class"), + threading(both), + uuid(e180344b-ac83-4483-959e-18a5c56a5e19) +] +coclass AudioVolumeMeter23 { interface IXAPO; } diff -Nru wine1.7-1.7.50/dlls/xaudio2_3/xaudio_dll.c wine1.7-1.7.55/dlls/xaudio2_3/xaudio_dll.c --- wine1.7-1.7.50/dlls/xaudio2_3/xaudio_dll.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_3/xaudio_dll.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2015 Andrew Eikum 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 "winbase.h" +#include "objbase.h" +#include "rpcproxy.h" + +static HINSTANCE instance; + +BOOL WINAPI DllMain(HINSTANCE hinstance, DWORD reason, LPVOID reserved) +{ + switch (reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + instance = hinstance; + DisableThreadLibraryCalls(hinstance); + break; + } + return TRUE; +} + +HRESULT WINAPI DllCanUnloadNow(void) +{ + return S_FALSE; +} + +HRESULT WINAPI DllRegisterServer(void) +{ + return __wine_register_resources(instance); +} + +HRESULT WINAPI DllUnregisterServer(void) +{ + return __wine_unregister_resources(instance); +} diff -Nru wine1.7-1.7.50/dlls/xaudio2_4/Makefile.in wine1.7-1.7.55/dlls/xaudio2_4/Makefile.in --- wine1.7-1.7.50/dlls/xaudio2_4/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_4/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,7 @@ +MODULE = xaudio2_4.dll +IMPORTS = ole32 + +C_SRCS = \ + xaudio_dll.c + +IDL_SRCS = xaudio_classes.idl diff -Nru wine1.7-1.7.50/dlls/xaudio2_4/xaudio2_4.spec wine1.7-1.7.55/dlls/xaudio2_4/xaudio2_4.spec --- wine1.7-1.7.50/dlls/xaudio2_4/xaudio2_4.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_4/xaudio2_4.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,4 @@ +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) xaudio2_7.DllGetClassObject +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff -Nru wine1.7-1.7.50/dlls/xaudio2_4/xaudio_classes.idl wine1.7-1.7.55/dlls/xaudio2_4/xaudio_classes.idl --- wine1.7-1.7.50/dlls/xaudio2_4/xaudio_classes.idl 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_4/xaudio_classes.idl 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,42 @@ +/* + * COM Classes for xaudio + * + * Copyright 2015 Andrew Eikum for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma makedep register + +[ + helpstring("XAudio2.4 Class"), + threading(both), + uuid(03219e78-5bc3-44d1-b92e-f63d89cc6526) +] +coclass XAudio24 { interface IXAudio27; } + +[ + helpstring("XAudio2.4 AudioReverb Class"), + threading(both), + uuid(8bb7778b-645b-4475-9a73-1de3170bd3af) +] +coclass AudioReverb24 { interface IXAPO; } + +[ + helpstring("XAudio2.4 AudioVolumeMeter Class"), + threading(both), + uuid(c7338b95-52b8-4542-aa79-42eb016c8c1c) +] +coclass AudioVolumeMeter24 { interface IXAPO; } diff -Nru wine1.7-1.7.50/dlls/xaudio2_4/xaudio_dll.c wine1.7-1.7.55/dlls/xaudio2_4/xaudio_dll.c --- wine1.7-1.7.50/dlls/xaudio2_4/xaudio_dll.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_4/xaudio_dll.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2015 Andrew Eikum 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 "winbase.h" +#include "objbase.h" +#include "rpcproxy.h" + +static HINSTANCE instance; + +BOOL WINAPI DllMain(HINSTANCE hinstance, DWORD reason, LPVOID reserved) +{ + switch (reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + instance = hinstance; + DisableThreadLibraryCalls(hinstance); + break; + } + return TRUE; +} + +HRESULT WINAPI DllCanUnloadNow(void) +{ + return S_FALSE; +} + +HRESULT WINAPI DllRegisterServer(void) +{ + return __wine_register_resources(instance); +} + +HRESULT WINAPI DllUnregisterServer(void) +{ + return __wine_unregister_resources(instance); +} diff -Nru wine1.7-1.7.50/dlls/xaudio2_5/Makefile.in wine1.7-1.7.55/dlls/xaudio2_5/Makefile.in --- wine1.7-1.7.50/dlls/xaudio2_5/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_5/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,7 @@ +MODULE = xaudio2_5.dll +IMPORTS = ole32 + +C_SRCS = \ + xaudio_dll.c + +IDL_SRCS = xaudio_classes.idl diff -Nru wine1.7-1.7.50/dlls/xaudio2_5/xaudio2_5.spec wine1.7-1.7.55/dlls/xaudio2_5/xaudio2_5.spec --- wine1.7-1.7.50/dlls/xaudio2_5/xaudio2_5.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_5/xaudio2_5.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,4 @@ +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) xaudio2_7.DllGetClassObject +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff -Nru wine1.7-1.7.50/dlls/xaudio2_5/xaudio_classes.idl wine1.7-1.7.55/dlls/xaudio2_5/xaudio_classes.idl --- wine1.7-1.7.50/dlls/xaudio2_5/xaudio_classes.idl 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_5/xaudio_classes.idl 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,42 @@ +/* + * COM Classes for xaudio + * + * Copyright 2015 Andrew Eikum for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma makedep register + +[ + helpstring("XAudio2.5 Class"), + threading(both), + uuid(4c9b6dde-6809-46e6-a278-9b6a97588670) +] +coclass XAudio25 { interface IXAudio27; } + +[ + helpstring("XAudio2.5 AudioReverb Class"), + threading(both), + uuid(d06df0d0-8518-441e-822f-5451d5c595b8) +] +coclass AudioReverb25 { interface IXAPO; } + +[ + helpstring("XAudio2.5 AudioVolumeMeter Class"), + threading(both), + uuid(2139e6da-c341-4774-9ac3-b4e026347f64) +] +coclass AudioVolumeMeter25 { interface IXAPO; } diff -Nru wine1.7-1.7.50/dlls/xaudio2_5/xaudio_dll.c wine1.7-1.7.55/dlls/xaudio2_5/xaudio_dll.c --- wine1.7-1.7.50/dlls/xaudio2_5/xaudio_dll.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_5/xaudio_dll.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2015 Andrew Eikum 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 "winbase.h" +#include "objbase.h" +#include "rpcproxy.h" + +static HINSTANCE instance; + +BOOL WINAPI DllMain(HINSTANCE hinstance, DWORD reason, LPVOID reserved) +{ + switch (reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + instance = hinstance; + DisableThreadLibraryCalls(hinstance); + break; + } + return TRUE; +} + +HRESULT WINAPI DllCanUnloadNow(void) +{ + return S_FALSE; +} + +HRESULT WINAPI DllRegisterServer(void) +{ + return __wine_register_resources(instance); +} + +HRESULT WINAPI DllUnregisterServer(void) +{ + return __wine_unregister_resources(instance); +} diff -Nru wine1.7-1.7.50/dlls/xaudio2_6/Makefile.in wine1.7-1.7.55/dlls/xaudio2_6/Makefile.in --- wine1.7-1.7.50/dlls/xaudio2_6/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_6/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,7 @@ +MODULE = xaudio2_6.dll +IMPORTS = ole32 + +C_SRCS = \ + xaudio_dll.c + +IDL_SRCS = xaudio_classes.idl diff -Nru wine1.7-1.7.50/dlls/xaudio2_6/xaudio2_6.spec wine1.7-1.7.55/dlls/xaudio2_6/xaudio2_6.spec --- wine1.7-1.7.50/dlls/xaudio2_6/xaudio2_6.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_6/xaudio2_6.spec 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,4 @@ +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) xaudio2_7.DllGetClassObject +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff -Nru wine1.7-1.7.50/dlls/xaudio2_6/xaudio_classes.idl wine1.7-1.7.55/dlls/xaudio2_6/xaudio_classes.idl --- wine1.7-1.7.50/dlls/xaudio2_6/xaudio_classes.idl 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_6/xaudio_classes.idl 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,42 @@ +/* + * COM Classes for xaudio + * + * Copyright 2015 Andrew Eikum for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma makedep register + +[ + helpstring("XAudio2.6 Class"), + threading(both), + uuid(3eda9b49-2085-498b-9bb2-39a6778493de) +] +coclass XAudio26 { interface IXAudio27; } + +[ + helpstring("XAudio2.6 AudioReverb Class"), + threading(both), + uuid(cecec95a-d894-491a-bee3-5e106fb59f2d) +] +coclass AudioReverb26 { interface IXAPO; } + +[ + helpstring("XAudio2.6 AudioVolumeMeter Class"), + threading(both), + uuid(e48c5a3f-93ef-43bb-a092-2c7ceb946f27) +] +coclass AudioVolumeMeter26 { interface IXAPO; } diff -Nru wine1.7-1.7.50/dlls/xaudio2_6/xaudio_dll.c wine1.7-1.7.55/dlls/xaudio2_6/xaudio_dll.c --- wine1.7-1.7.50/dlls/xaudio2_6/xaudio_dll.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_6/xaudio_dll.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2015 Andrew Eikum 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 "winbase.h" +#include "objbase.h" +#include "rpcproxy.h" + +static HINSTANCE instance; + +BOOL WINAPI DllMain(HINSTANCE hinstance, DWORD reason, LPVOID reserved) +{ + switch (reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + instance = hinstance; + DisableThreadLibraryCalls(hinstance); + break; + } + return TRUE; +} + +HRESULT WINAPI DllCanUnloadNow(void) +{ + return S_FALSE; +} + +HRESULT WINAPI DllRegisterServer(void) +{ + return __wine_register_resources(instance); +} + +HRESULT WINAPI DllUnregisterServer(void) +{ + return __wine_unregister_resources(instance); +} diff -Nru wine1.7-1.7.50/dlls/xaudio2_7/compat.c wine1.7-1.7.55/dlls/xaudio2_7/compat.c --- wine1.7-1.7.50/dlls/xaudio2_7/compat.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_7/compat.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,2296 @@ +/* + * Copyright (c) 2015 Andrew Eikum 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 + * + *************** + * + * Some versions of XAudio2 add or remove functions to the COM vtables, or + * incompatibly change structures. This file provides implementations of the + * older XAudio2 versions onto the new XAudio2 APIs. + * + * Below is a list of significant changes to the main XAudio2 interfaces and + * API. There may be further changes to effects and other parts that Wine + * doesn't currently implement. + * + * 2.0 + * Initial version + * + * 2.1 + * Change CLSID_XAudio2 + * Re-order Error codes + * Change XAUDIO2_LOOP_INFINITE + * Change struct XAUDIO2_PERFORMANCE_DATA + * Change IXAudio2Voice::GetOutputMatrix return value to void + * Add parameter to IXAudio2VoiceCallback::OnVoiceProcessingPassStart + * Change struct XAPO_REGISTRATION_PROPERTIES. CAREFUL when using! Not all + * implementations of IXAPO are Wine implementations. + * + * 2.2 + * Change CLSID_XAudio2 + * No ABI break + * + * 2.3 + * Change CLSID_XAudio2 + * ABI break: + * Change struct XAUDIO2_PERFORMANCE_DATA + * + * 2.4 + * Change CLSID_XAudio2 + * ABI break: + * Add IXAudio2Voice::SetOutputFilterParameters + * Add IXAudio2Voice::GetOutputFilterParameters + * Add IXAudio2SourceVoice::SetSourceSampleRate + * Change struct XAUDIO2_VOICE_SENDS + * + * 2.5 + * Change CLSID_XAudio2 + * No ABI break + * + * 2.6 + * Change CLSID_XAudio2 + * No ABI break + * + * 2.7 + * Change CLSID_XAudio2 + * No ABI break + * + * 2.8 + * Remove CLSID_XAudio2 + * Change IID_IXAudio2 + * Add xaudio2_8.XAudio2Create + * ABI break: + * Remove IXAudio2::GetDeviceCount + * Remove IXAudio2::GetDeviceDetails + * Remove IXAudio2::Initialize + * Change parameter of IXAudio2::CreateMasteringVoice + * Add Flags parameter to IXAudio2SourceVoice::GetState + * Add IXAudio2MasteringVoice::GetChannelMask + */ + +#include "config.h" + +#define NONAMELESSUNION +#define NONAMELESSSTRUCT +#define COBJMACROS + +#include + +#include "xaudio_private.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(xaudio2); + +XA2SourceImpl *impl_from_IXAudio27SourceVoice(IXAudio27SourceVoice *iface) +{ + return CONTAINING_RECORD(iface, XA2SourceImpl, IXAudio27SourceVoice_iface); +} + +static void WINAPI XA27SRC_GetVoiceDetails(IXAudio27SourceVoice *iface, + XAUDIO2_VOICE_DETAILS *pVoiceDetails) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + return IXAudio2SourceVoice_GetVoiceDetails(&This->IXAudio2SourceVoice_iface, pVoiceDetails); +} + +static HRESULT WINAPI XA27SRC_SetOutputVoices(IXAudio27SourceVoice *iface, + const XAUDIO2_VOICE_SENDS *pSendList) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + return IXAudio2SourceVoice_SetOutputVoices(&This->IXAudio2SourceVoice_iface, pSendList); +} + +static HRESULT WINAPI XA27SRC_SetEffectChain(IXAudio27SourceVoice *iface, + const XAUDIO2_EFFECT_CHAIN *pEffectChain) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + return IXAudio2SourceVoice_SetEffectChain(&This->IXAudio2SourceVoice_iface, pEffectChain); +} + +static HRESULT WINAPI XA27SRC_EnableEffect(IXAudio27SourceVoice *iface, + UINT32 EffectIndex, UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + return IXAudio2SourceVoice_EnableEffect(&This->IXAudio2SourceVoice_iface, EffectIndex, OperationSet); +} + +static HRESULT WINAPI XA27SRC_DisableEffect(IXAudio27SourceVoice *iface, + UINT32 EffectIndex, UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + return IXAudio2SourceVoice_DisableEffect(&This->IXAudio2SourceVoice_iface, EffectIndex, OperationSet); +} + +static void WINAPI XA27SRC_GetEffectState(IXAudio27SourceVoice *iface, + UINT32 EffectIndex, BOOL *pEnabled) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + IXAudio2SourceVoice_GetEffectState(&This->IXAudio2SourceVoice_iface, EffectIndex, pEnabled); +} + +static HRESULT WINAPI XA27SRC_SetEffectParameters(IXAudio27SourceVoice *iface, + UINT32 EffectIndex, const void *pParameters, UINT32 ParametersByteSize, + UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + return IXAudio2SourceVoice_SetEffectParameters(&This->IXAudio2SourceVoice_iface, + EffectIndex, pParameters, ParametersByteSize, OperationSet); +} + +static HRESULT WINAPI XA27SRC_GetEffectParameters(IXAudio27SourceVoice *iface, + UINT32 EffectIndex, void *pParameters, UINT32 ParametersByteSize) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + return IXAudio2SourceVoice_GetEffectParameters(&This->IXAudio2SourceVoice_iface, + EffectIndex, pParameters, ParametersByteSize); +} + +static HRESULT WINAPI XA27SRC_SetFilterParameters(IXAudio27SourceVoice *iface, + const XAUDIO2_FILTER_PARAMETERS *pParameters, UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + return IXAudio2SourceVoice_SetFilterParameters(&This->IXAudio2SourceVoice_iface, + pParameters, OperationSet); +} + +static void WINAPI XA27SRC_GetFilterParameters(IXAudio27SourceVoice *iface, + XAUDIO2_FILTER_PARAMETERS *pParameters) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + IXAudio2SourceVoice_GetFilterParameters(&This->IXAudio2SourceVoice_iface, pParameters); +} + +static HRESULT WINAPI XA27SRC_SetOutputFilterParameters(IXAudio27SourceVoice *iface, + IXAudio2Voice *pDestinationVoice, + const XAUDIO2_FILTER_PARAMETERS *pParameters, UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + return IXAudio2SourceVoice_SetOutputFilterParameters(&This->IXAudio2SourceVoice_iface, + pDestinationVoice, pParameters, OperationSet); +} + +static void WINAPI XA27SRC_GetOutputFilterParameters(IXAudio27SourceVoice *iface, + IXAudio2Voice *pDestinationVoice, + XAUDIO2_FILTER_PARAMETERS *pParameters) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + IXAudio2SourceVoice_GetOutputFilterParameters(&This->IXAudio2SourceVoice_iface, + pDestinationVoice, pParameters); +} + +static HRESULT WINAPI XA27SRC_SetVolume(IXAudio27SourceVoice *iface, float Volume, + UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + return IXAudio2SourceVoice_SetVolume(&This->IXAudio2SourceVoice_iface, Volume, + OperationSet); +} + +static void WINAPI XA27SRC_GetVolume(IXAudio27SourceVoice *iface, float *pVolume) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + IXAudio2SourceVoice_GetVolume(&This->IXAudio2SourceVoice_iface, pVolume); +} + +static HRESULT WINAPI XA27SRC_SetChannelVolumes(IXAudio27SourceVoice *iface, + UINT32 Channels, const float *pVolumes, UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + return IXAudio2SourceVoice_SetChannelVolumes(&This->IXAudio2SourceVoice_iface, Channels, + pVolumes, OperationSet); +} + +static void WINAPI XA27SRC_GetChannelVolumes(IXAudio27SourceVoice *iface, + UINT32 Channels, float *pVolumes) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + IXAudio2SourceVoice_GetChannelVolumes(&This->IXAudio2SourceVoice_iface, Channels, + pVolumes); +} + +static HRESULT WINAPI XA27SRC_SetOutputMatrix(IXAudio27SourceVoice *iface, + IXAudio2Voice *pDestinationVoice, UINT32 SourceChannels, + UINT32 DestinationChannels, const float *pLevelMatrix, + UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + return IXAudio2SourceVoice_SetOutputMatrix(&This->IXAudio2SourceVoice_iface, + pDestinationVoice, SourceChannels, DestinationChannels, + pLevelMatrix, OperationSet); +} + +static void WINAPI XA27SRC_GetOutputMatrix(IXAudio27SourceVoice *iface, + IXAudio2Voice *pDestinationVoice, UINT32 SourceChannels, + UINT32 DestinationChannels, float *pLevelMatrix) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + IXAudio2SourceVoice_GetOutputMatrix(&This->IXAudio2SourceVoice_iface, pDestinationVoice, + SourceChannels, DestinationChannels, pLevelMatrix); +} + +static void WINAPI XA27SRC_DestroyVoice(IXAudio27SourceVoice *iface) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + IXAudio2SourceVoice_DestroyVoice(&This->IXAudio2SourceVoice_iface); +} + +static HRESULT WINAPI XA27SRC_Start(IXAudio27SourceVoice *iface, UINT32 Flags, + UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + return IXAudio2SourceVoice_Start(&This->IXAudio2SourceVoice_iface, Flags, OperationSet); +} + +static HRESULT WINAPI XA27SRC_Stop(IXAudio27SourceVoice *iface, UINT32 Flags, + UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + return IXAudio2SourceVoice_Stop(&This->IXAudio2SourceVoice_iface, Flags, OperationSet); +} + +static HRESULT WINAPI XA27SRC_SubmitSourceBuffer(IXAudio27SourceVoice *iface, + const XAUDIO2_BUFFER *pBuffer, const XAUDIO2_BUFFER_WMA *pBufferWMA) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + return IXAudio2SourceVoice_SubmitSourceBuffer(&This->IXAudio2SourceVoice_iface, pBuffer, + pBufferWMA); +} + +static HRESULT WINAPI XA27SRC_FlushSourceBuffers(IXAudio27SourceVoice *iface) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + return IXAudio2SourceVoice_FlushSourceBuffers(&This->IXAudio2SourceVoice_iface); +} + +static HRESULT WINAPI XA27SRC_Discontinuity(IXAudio27SourceVoice *iface) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + return IXAudio2SourceVoice_Discontinuity(&This->IXAudio2SourceVoice_iface); +} + +static HRESULT WINAPI XA27SRC_ExitLoop(IXAudio27SourceVoice *iface, UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + return IXAudio2SourceVoice_ExitLoop(&This->IXAudio2SourceVoice_iface, OperationSet); +} + +static void WINAPI XA27SRC_GetState(IXAudio27SourceVoice *iface, + XAUDIO2_VOICE_STATE *pVoiceState) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + return IXAudio2SourceVoice_GetState(&This->IXAudio2SourceVoice_iface, pVoiceState, 0); +} + +static HRESULT WINAPI XA27SRC_SetFrequencyRatio(IXAudio27SourceVoice *iface, + float Ratio, UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + return IXAudio2SourceVoice_SetFrequencyRatio(&This->IXAudio2SourceVoice_iface, Ratio, OperationSet); +} + +static void WINAPI XA27SRC_GetFrequencyRatio(IXAudio27SourceVoice *iface, float *pRatio) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + return IXAudio2SourceVoice_GetFrequencyRatio(&This->IXAudio2SourceVoice_iface, pRatio); +} + +static HRESULT WINAPI XA27SRC_SetSourceSampleRate( + IXAudio27SourceVoice *iface, + UINT32 NewSourceSampleRate) +{ + XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); + return IXAudio2SourceVoice_SetSourceSampleRate(&This->IXAudio2SourceVoice_iface, NewSourceSampleRate); +} + +const IXAudio27SourceVoiceVtbl XAudio27SourceVoice_Vtbl = { + XA27SRC_GetVoiceDetails, + XA27SRC_SetOutputVoices, + XA27SRC_SetEffectChain, + XA27SRC_EnableEffect, + XA27SRC_DisableEffect, + XA27SRC_GetEffectState, + XA27SRC_SetEffectParameters, + XA27SRC_GetEffectParameters, + XA27SRC_SetFilterParameters, + XA27SRC_GetFilterParameters, + XA27SRC_SetOutputFilterParameters, + XA27SRC_GetOutputFilterParameters, + XA27SRC_SetVolume, + XA27SRC_GetVolume, + XA27SRC_SetChannelVolumes, + XA27SRC_GetChannelVolumes, + XA27SRC_SetOutputMatrix, + XA27SRC_GetOutputMatrix, + XA27SRC_DestroyVoice, + XA27SRC_Start, + XA27SRC_Stop, + XA27SRC_SubmitSourceBuffer, + XA27SRC_FlushSourceBuffers, + XA27SRC_Discontinuity, + XA27SRC_ExitLoop, + XA27SRC_GetState, + XA27SRC_SetFrequencyRatio, + XA27SRC_GetFrequencyRatio, + XA27SRC_SetSourceSampleRate +}; + +static inline IXAudio2Impl *impl_from_IXAudio27(IXAudio27 *iface) +{ + return CONTAINING_RECORD(iface, IXAudio2Impl, IXAudio27_iface); +} + +static HRESULT WINAPI XA27_QueryInterface(IXAudio27 *iface, REFIID riid, + void **ppvObject) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + return IXAudio2_QueryInterface(&This->IXAudio2_iface, riid, ppvObject); +} + +static ULONG WINAPI XA27_AddRef(IXAudio27 *iface) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + return IXAudio2_AddRef(&This->IXAudio2_iface); +} + +static ULONG WINAPI XA27_Release(IXAudio27 *iface) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + return IXAudio2_Release(&This->IXAudio2_iface); +} + +static HRESULT WINAPI XA27_GetDeviceCount(IXAudio27 *iface, UINT32 *pCount) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + + TRACE("%p, %p\n", This, pCount); + + *pCount = This->ndevs; + + return S_OK; +} + +static HRESULT WINAPI XA27_GetDeviceDetails(IXAudio27 *iface, UINT32 index, + XAUDIO2_DEVICE_DETAILS *pDeviceDetails) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + HRESULT hr; + IMMDevice *dev; + IAudioClient *client; + IPropertyStore *ps; + WAVEFORMATEX *wfx; + PROPVARIANT var; + + TRACE("%p, %u, %p\n", This, index, pDeviceDetails); + + if(index >= This->ndevs) + return E_INVALIDARG; + + hr = IMMDeviceEnumerator_GetDevice(This->devenum, This->devids[index], &dev); + if(FAILED(hr)){ + WARN("GetDevice failed: %08x\n", hr); + return hr; + } + + hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, + NULL, (void**)&client); + if(FAILED(hr)){ + WARN("Activate failed: %08x\n", hr); + IMMDevice_Release(dev); + return hr; + } + + hr = IMMDevice_OpenPropertyStore(dev, STGM_READ, &ps); + if(FAILED(hr)){ + WARN("OpenPropertyStore failed: %08x\n", hr); + IAudioClient_Release(client); + IMMDevice_Release(dev); + return hr; + } + + PropVariantInit(&var); + + hr = IPropertyStore_GetValue(ps, (PROPERTYKEY*)&DEVPKEY_Device_FriendlyName, &var); + if(FAILED(hr)){ + WARN("GetValue failed: %08x\n", hr); + goto done; + } + + lstrcpynW(pDeviceDetails->DisplayName, var.u.pwszVal, sizeof(pDeviceDetails->DisplayName)/sizeof(WCHAR)); + + PropVariantClear(&var); + + hr = IAudioClient_GetMixFormat(client, &wfx); + if(FAILED(hr)){ + WARN("GetMixFormat failed: %08x\n", hr); + goto done; + } + + lstrcpyW(pDeviceDetails->DeviceID, This->devids[index]); + + if(index == 0) + pDeviceDetails->Role = GlobalDefaultDevice; + else + pDeviceDetails->Role = NotDefaultDevice; + + if(sizeof(WAVEFORMATEX) + wfx->cbSize > sizeof(pDeviceDetails->OutputFormat)){ + FIXME("AudioClient format is too large to fit into WAVEFORMATEXTENSIBLE!\n"); + CoTaskMemFree(wfx); + hr = E_FAIL; + goto done; + } + memcpy(&pDeviceDetails->OutputFormat, wfx, sizeof(WAVEFORMATEX) + wfx->cbSize); + + CoTaskMemFree(wfx); + +done: + IPropertyStore_Release(ps); + IAudioClient_Release(client); + IMMDevice_Release(dev); + + return hr; +} + +static HRESULT WINAPI XA27_Initialize(IXAudio27 *iface, UINT32 flags, + XAUDIO2_PROCESSOR processor) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + TRACE("(%p)->(0x%x, 0x%x)\n", This, flags, processor); + return S_OK; +} + +static HRESULT WINAPI XA27_RegisterForCallbacks(IXAudio27 *iface, + IXAudio2EngineCallback *pCallback) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + return IXAudio2_RegisterForCallbacks(&This->IXAudio2_iface, pCallback); +} + +static void WINAPI XA27_UnregisterForCallbacks(IXAudio27 *iface, + IXAudio2EngineCallback *pCallback) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + IXAudio2_UnregisterForCallbacks(&This->IXAudio2_iface, pCallback); +} + +static HRESULT WINAPI XA27_CreateSourceVoice(IXAudio27 *iface, + IXAudio2SourceVoice **ppSourceVoice, const WAVEFORMATEX *pSourceFormat, + UINT32 flags, float maxFrequencyRatio, + IXAudio2VoiceCallback *pCallback, const XAUDIO2_VOICE_SENDS *pSendList, + const XAUDIO2_EFFECT_CHAIN *pEffectChain) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + return IXAudio2_CreateSourceVoice(&This->IXAudio2_iface, ppSourceVoice, + pSourceFormat, flags, maxFrequencyRatio, pCallback, pSendList, + pEffectChain); +} + +static HRESULT WINAPI XA27_CreateSubmixVoice(IXAudio27 *iface, + IXAudio2SubmixVoice **ppSubmixVoice, UINT32 inputChannels, + UINT32 inputSampleRate, UINT32 flags, UINT32 processingStage, + const XAUDIO2_VOICE_SENDS *pSendList, + const XAUDIO2_EFFECT_CHAIN *pEffectChain) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + return IXAudio2_CreateSubmixVoice(&This->IXAudio2_iface, ppSubmixVoice, + inputChannels, inputSampleRate, flags, processingStage, pSendList, + pEffectChain); +} + +static HRESULT WINAPI XA27_CreateMasteringVoice(IXAudio27 *iface, + IXAudio2MasteringVoice **ppMasteringVoice, UINT32 inputChannels, + UINT32 inputSampleRate, UINT32 flags, UINT32 deviceIndex, + const XAUDIO2_EFFECT_CHAIN *pEffectChain) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + + TRACE("(%p)->(%p, %u, %u, 0x%x, %u, %p)\n", This, ppMasteringVoice, + inputChannels, inputSampleRate, flags, deviceIndex, + pEffectChain); + + if(deviceIndex >= This->ndevs) + return E_INVALIDARG; + + return IXAudio2_CreateMasteringVoice(&This->IXAudio2_iface, ppMasteringVoice, + inputChannels, inputSampleRate, flags, This->devids[deviceIndex], + pEffectChain, AudioCategory_GameEffects); +} + +static HRESULT WINAPI XA27_StartEngine(IXAudio27 *iface) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + return IXAudio2_StartEngine(&This->IXAudio2_iface); +} + +static void WINAPI XA27_StopEngine(IXAudio27 *iface) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + return IXAudio2_StopEngine(&This->IXAudio2_iface); +} + +static HRESULT WINAPI XA27_CommitChanges(IXAudio27 *iface, UINT32 operationSet) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + return IXAudio2_CommitChanges(&This->IXAudio2_iface, operationSet); +} + +static void WINAPI XA27_GetPerformanceData(IXAudio27 *iface, + XAUDIO2_PERFORMANCE_DATA *pPerfData) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + return IXAudio2_GetPerformanceData(&This->IXAudio2_iface, pPerfData); +} + +static void WINAPI XA27_SetDebugConfiguration(IXAudio27 *iface, + const XAUDIO2_DEBUG_CONFIGURATION *pDebugConfiguration, + void *pReserved) +{ + IXAudio2Impl *This = impl_from_IXAudio27(iface); + return IXAudio2_SetDebugConfiguration(&This->IXAudio2_iface, + pDebugConfiguration, pReserved); +} + +const IXAudio27Vtbl XAudio27_Vtbl = { + XA27_QueryInterface, + XA27_AddRef, + XA27_Release, + XA27_GetDeviceCount, + XA27_GetDeviceDetails, + XA27_Initialize, + XA27_RegisterForCallbacks, + XA27_UnregisterForCallbacks, + XA27_CreateSourceVoice, + XA27_CreateSubmixVoice, + XA27_CreateMasteringVoice, + XA27_StartEngine, + XA27_StopEngine, + XA27_CommitChanges, + XA27_GetPerformanceData, + XA27_SetDebugConfiguration +}; + +XA2SourceImpl *impl_from_IXAudio23SourceVoice(IXAudio23SourceVoice *iface) +{ + return CONTAINING_RECORD(iface, XA2SourceImpl, IXAudio23SourceVoice_iface); +} + +static void WINAPI XA23SRC_GetVoiceDetails(IXAudio23SourceVoice *iface, + XAUDIO2_VOICE_DETAILS *pVoiceDetails) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + return IXAudio2SourceVoice_GetVoiceDetails(&This->IXAudio2SourceVoice_iface, pVoiceDetails); +} + +static HRESULT WINAPI XA23SRC_SetOutputVoices(IXAudio23SourceVoice *iface, + const XAUDIO23_VOICE_SENDS *pSendList) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + XAUDIO2_VOICE_SENDS sends; + HRESULT hr; + DWORD i; + + TRACE("%p, %p\n", This, pSendList); + + sends.SendCount = pSendList->OutputCount; + sends.pSends = HeapAlloc(GetProcessHeap(), 0, sends.SendCount * sizeof(*sends.pSends)); + for(i = 0; i < sends.SendCount; ++i){ + sends.pSends[i].Flags = 0; + sends.pSends[i].pOutputVoice = pSendList->pOutputVoices[i]; + } + + hr = IXAudio2SourceVoice_SetOutputVoices(&This->IXAudio2SourceVoice_iface, &sends); + + HeapFree(GetProcessHeap(), 0, sends.pSends); + + return hr; +} + +static HRESULT WINAPI XA23SRC_SetEffectChain(IXAudio23SourceVoice *iface, + const XAUDIO2_EFFECT_CHAIN *pEffectChain) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + return IXAudio2SourceVoice_SetEffectChain(&This->IXAudio2SourceVoice_iface, pEffectChain); +} + +static HRESULT WINAPI XA23SRC_EnableEffect(IXAudio23SourceVoice *iface, + UINT32 EffectIndex, UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + return IXAudio2SourceVoice_EnableEffect(&This->IXAudio2SourceVoice_iface, + EffectIndex, OperationSet); +} + +static HRESULT WINAPI XA23SRC_DisableEffect(IXAudio23SourceVoice *iface, + UINT32 EffectIndex, UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + return IXAudio2SourceVoice_DisableEffect(&This->IXAudio2SourceVoice_iface, + EffectIndex, OperationSet); +} + +static void WINAPI XA23SRC_GetEffectState(IXAudio23SourceVoice *iface, + UINT32 EffectIndex, BOOL *pEnabled) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + return IXAudio2SourceVoice_GetEffectState(&This->IXAudio2SourceVoice_iface, + EffectIndex, pEnabled); +} + +static HRESULT WINAPI XA23SRC_SetEffectParameters(IXAudio23SourceVoice *iface, + UINT32 EffectIndex, const void *pParameters, UINT32 ParametersByteSize, + UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + return IXAudio2SourceVoice_SetEffectParameters(&This->IXAudio2SourceVoice_iface, + EffectIndex, pParameters, ParametersByteSize, OperationSet); +} + +static HRESULT WINAPI XA23SRC_GetEffectParameters(IXAudio23SourceVoice *iface, + UINT32 EffectIndex, void *pParameters, UINT32 ParametersByteSize) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + return IXAudio2SourceVoice_GetEffectParameters(&This->IXAudio2SourceVoice_iface, + EffectIndex, pParameters, ParametersByteSize); +} + +static HRESULT WINAPI XA23SRC_SetFilterParameters(IXAudio23SourceVoice *iface, + const XAUDIO2_FILTER_PARAMETERS *pParameters, UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + return IXAudio2SourceVoice_SetFilterParameters(&This->IXAudio2SourceVoice_iface, + pParameters, OperationSet); +} + +static void WINAPI XA23SRC_GetFilterParameters(IXAudio23SourceVoice *iface, + XAUDIO2_FILTER_PARAMETERS *pParameters) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + return IXAudio2SourceVoice_GetFilterParameters(&This->IXAudio2SourceVoice_iface, pParameters); +} + +static HRESULT WINAPI XA23SRC_SetVolume(IXAudio23SourceVoice *iface, + float Volume, UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + return IXAudio2SourceVoice_SetVolume(&This->IXAudio2SourceVoice_iface, + Volume, OperationSet); +} + +static void WINAPI XA23SRC_GetVolume(IXAudio23SourceVoice *iface, + float *pVolume) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + return IXAudio2SourceVoice_GetVolume(&This->IXAudio2SourceVoice_iface, pVolume); +} + +static HRESULT WINAPI XA23SRC_SetChannelVolumes(IXAudio23SourceVoice *iface, + UINT32 Channels, const float *pVolumes, UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + return IXAudio2SourceVoice_SetChannelVolumes(&This->IXAudio2SourceVoice_iface, + Channels, pVolumes, OperationSet); +} + +static void WINAPI XA23SRC_GetChannelVolumes(IXAudio23SourceVoice *iface, + UINT32 Channels, float *pVolumes) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + return IXAudio2SourceVoice_GetChannelVolumes(&This->IXAudio2SourceVoice_iface, + Channels, pVolumes); +} + +static HRESULT WINAPI XA23SRC_SetOutputMatrix(IXAudio23SourceVoice *iface, + IXAudio2Voice *pDestinationVoice, UINT32 SourceChannels, + UINT32 DestinationChannels, const float *pLevelMatrix, + UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + return IXAudio2SourceVoice_SetOutputMatrix(&This->IXAudio2SourceVoice_iface, + pDestinationVoice, SourceChannels, DestinationChannels, + pLevelMatrix, OperationSet); +} + +static void WINAPI XA23SRC_GetOutputMatrix(IXAudio23SourceVoice *iface, + IXAudio2Voice *pDestinationVoice, UINT32 SourceChannels, + UINT32 DestinationChannels, float *pLevelMatrix) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + return IXAudio2SourceVoice_GetOutputMatrix(&This->IXAudio2SourceVoice_iface, + pDestinationVoice, SourceChannels, DestinationChannels, + pLevelMatrix); +} + +static void WINAPI XA23SRC_DestroyVoice(IXAudio23SourceVoice *iface) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + return IXAudio2SourceVoice_DestroyVoice(&This->IXAudio2SourceVoice_iface); +} + +static HRESULT WINAPI XA23SRC_Start(IXAudio23SourceVoice *iface, UINT32 Flags, + UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + return IXAudio2SourceVoice_Start(&This->IXAudio2SourceVoice_iface, Flags, OperationSet); +} + +static HRESULT WINAPI XA23SRC_Stop(IXAudio23SourceVoice *iface, UINT32 Flags, + UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + return IXAudio2SourceVoice_Stop(&This->IXAudio2SourceVoice_iface, Flags, OperationSet); +} + +static HRESULT WINAPI XA23SRC_SubmitSourceBuffer(IXAudio23SourceVoice *iface, + const XAUDIO2_BUFFER *pBuffer, const XAUDIO2_BUFFER_WMA *pBufferWMA) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + return IXAudio2SourceVoice_SubmitSourceBuffer(&This->IXAudio2SourceVoice_iface, + pBuffer, pBufferWMA); +} + +static HRESULT WINAPI XA23SRC_FlushSourceBuffers(IXAudio23SourceVoice *iface) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + return IXAudio2SourceVoice_FlushSourceBuffers(&This->IXAudio2SourceVoice_iface); +} + +static HRESULT WINAPI XA23SRC_Discontinuity(IXAudio23SourceVoice *iface) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + return IXAudio2SourceVoice_Discontinuity(&This->IXAudio2SourceVoice_iface); +} + +static HRESULT WINAPI XA23SRC_ExitLoop(IXAudio23SourceVoice *iface, + UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + return IXAudio2SourceVoice_ExitLoop(&This->IXAudio2SourceVoice_iface, OperationSet); +} + +static void WINAPI XA23SRC_GetState(IXAudio23SourceVoice *iface, + XAUDIO2_VOICE_STATE *pVoiceState) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + return IXAudio2SourceVoice_GetState(&This->IXAudio2SourceVoice_iface, pVoiceState, 0); +} + +static HRESULT WINAPI XA23SRC_SetFrequencyRatio(IXAudio23SourceVoice *iface, + float Ratio, UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + return IXAudio2SourceVoice_SetFrequencyRatio(&This->IXAudio2SourceVoice_iface, + Ratio, OperationSet); +} + +static void WINAPI XA23SRC_GetFrequencyRatio(IXAudio23SourceVoice *iface, + float *pRatio) +{ + XA2SourceImpl *This = impl_from_IXAudio23SourceVoice(iface); + return IXAudio2SourceVoice_GetFrequencyRatio(&This->IXAudio2SourceVoice_iface, pRatio); +} + +const IXAudio23SourceVoiceVtbl XAudio23SourceVoice_Vtbl = { + XA23SRC_GetVoiceDetails, + XA23SRC_SetOutputVoices, + XA23SRC_SetEffectChain, + XA23SRC_EnableEffect, + XA23SRC_DisableEffect, + XA23SRC_GetEffectState, + XA23SRC_SetEffectParameters, + XA23SRC_GetEffectParameters, + XA23SRC_SetFilterParameters, + XA23SRC_GetFilterParameters, + XA23SRC_SetVolume, + XA23SRC_GetVolume, + XA23SRC_SetChannelVolumes, + XA23SRC_GetChannelVolumes, + XA23SRC_SetOutputMatrix, + XA23SRC_GetOutputMatrix, + XA23SRC_DestroyVoice, + XA23SRC_Start, + XA23SRC_Stop, + XA23SRC_SubmitSourceBuffer, + XA23SRC_FlushSourceBuffers, + XA23SRC_Discontinuity, + XA23SRC_ExitLoop, + XA23SRC_GetState, + XA23SRC_SetFrequencyRatio, + XA23SRC_GetFrequencyRatio, +}; + +XA2SubmixImpl *impl_from_IXAudio23SubmixVoice(IXAudio23SubmixVoice *iface) +{ + return CONTAINING_RECORD(iface, XA2SubmixImpl, IXAudio23SubmixVoice_iface); +} + +static void WINAPI XA23SUB_GetVoiceDetails(IXAudio23SubmixVoice *iface, + XAUDIO2_VOICE_DETAILS *pVoiceDetails) +{ + XA2SubmixImpl *This = impl_from_IXAudio23SubmixVoice(iface); + return IXAudio2SubmixVoice_GetVoiceDetails(&This->IXAudio2SubmixVoice_iface, pVoiceDetails); +} + +static HRESULT WINAPI XA23SUB_SetOutputVoices(IXAudio23SubmixVoice *iface, + const XAUDIO23_VOICE_SENDS *pSendList) +{ + XA2SubmixImpl *This = impl_from_IXAudio23SubmixVoice(iface); + XAUDIO2_VOICE_SENDS sends; + HRESULT hr; + DWORD i; + + TRACE("%p, %p\n", This, pSendList); + + sends.SendCount = pSendList->OutputCount; + sends.pSends = HeapAlloc(GetProcessHeap(), 0, sends.SendCount * sizeof(*sends.pSends)); + for(i = 0; i < sends.SendCount; ++i){ + sends.pSends[i].Flags = 0; + sends.pSends[i].pOutputVoice = pSendList->pOutputVoices[i]; + } + + hr = IXAudio2SubmixVoice_SetOutputVoices(&This->IXAudio2SubmixVoice_iface, &sends); + + HeapFree(GetProcessHeap(), 0, sends.pSends); + + return hr; +} + +static HRESULT WINAPI XA23SUB_SetEffectChain(IXAudio23SubmixVoice *iface, + const XAUDIO2_EFFECT_CHAIN *pEffectChain) +{ + XA2SubmixImpl *This = impl_from_IXAudio23SubmixVoice(iface); + return IXAudio2SubmixVoice_SetEffectChain(&This->IXAudio2SubmixVoice_iface, pEffectChain); +} + +static HRESULT WINAPI XA23SUB_EnableEffect(IXAudio23SubmixVoice *iface, + UINT32 EffectIndex, UINT32 OperationSet) +{ + XA2SubmixImpl *This = impl_from_IXAudio23SubmixVoice(iface); + return IXAudio2SubmixVoice_EnableEffect(&This->IXAudio2SubmixVoice_iface, + EffectIndex, OperationSet); +} + +static HRESULT WINAPI XA23SUB_DisableEffect(IXAudio23SubmixVoice *iface, + UINT32 EffectIndex, UINT32 OperationSet) +{ + XA2SubmixImpl *This = impl_from_IXAudio23SubmixVoice(iface); + return IXAudio2SubmixVoice_DisableEffect(&This->IXAudio2SubmixVoice_iface, + EffectIndex, OperationSet); +} + +static void WINAPI XA23SUB_GetEffectState(IXAudio23SubmixVoice *iface, + UINT32 EffectIndex, BOOL *pEnabled) +{ + XA2SubmixImpl *This = impl_from_IXAudio23SubmixVoice(iface); + return IXAudio2SubmixVoice_GetEffectState(&This->IXAudio2SubmixVoice_iface, + EffectIndex, pEnabled); +} + +static HRESULT WINAPI XA23SUB_SetEffectParameters(IXAudio23SubmixVoice *iface, + UINT32 EffectIndex, const void *pParameters, UINT32 ParametersByteSize, + UINT32 OperationSet) +{ + XA2SubmixImpl *This = impl_from_IXAudio23SubmixVoice(iface); + return IXAudio2SubmixVoice_SetEffectParameters(&This->IXAudio2SubmixVoice_iface, + EffectIndex, pParameters, ParametersByteSize, OperationSet); +} + +static HRESULT WINAPI XA23SUB_GetEffectParameters(IXAudio23SubmixVoice *iface, + UINT32 EffectIndex, void *pParameters, UINT32 ParametersByteSize) +{ + XA2SubmixImpl *This = impl_from_IXAudio23SubmixVoice(iface); + return IXAudio2SubmixVoice_GetEffectParameters(&This->IXAudio2SubmixVoice_iface, + EffectIndex, pParameters, ParametersByteSize); +} + +static HRESULT WINAPI XA23SUB_SetFilterParameters(IXAudio23SubmixVoice *iface, + const XAUDIO2_FILTER_PARAMETERS *pParameters, UINT32 OperationSet) +{ + XA2SubmixImpl *This = impl_from_IXAudio23SubmixVoice(iface); + return IXAudio2SubmixVoice_SetFilterParameters(&This->IXAudio2SubmixVoice_iface, + pParameters, OperationSet); +} + +static void WINAPI XA23SUB_GetFilterParameters(IXAudio23SubmixVoice *iface, + XAUDIO2_FILTER_PARAMETERS *pParameters) +{ + XA2SubmixImpl *This = impl_from_IXAudio23SubmixVoice(iface); + return IXAudio2SubmixVoice_GetFilterParameters(&This->IXAudio2SubmixVoice_iface, pParameters); +} + +static HRESULT WINAPI XA23SUB_SetVolume(IXAudio23SubmixVoice *iface, + float Volume, UINT32 OperationSet) +{ + XA2SubmixImpl *This = impl_from_IXAudio23SubmixVoice(iface); + return IXAudio2SubmixVoice_SetVolume(&This->IXAudio2SubmixVoice_iface, + Volume, OperationSet); +} + +static void WINAPI XA23SUB_GetVolume(IXAudio23SubmixVoice *iface, + float *pVolume) +{ + XA2SubmixImpl *This = impl_from_IXAudio23SubmixVoice(iface); + return IXAudio2SubmixVoice_GetVolume(&This->IXAudio2SubmixVoice_iface, pVolume); +} + +static HRESULT WINAPI XA23SUB_SetChannelVolumes(IXAudio23SubmixVoice *iface, + UINT32 Channels, const float *pVolumes, UINT32 OperationSet) +{ + XA2SubmixImpl *This = impl_from_IXAudio23SubmixVoice(iface); + return IXAudio2SubmixVoice_SetChannelVolumes(&This->IXAudio2SubmixVoice_iface, + Channels, pVolumes, OperationSet); +} + +static void WINAPI XA23SUB_GetChannelVolumes(IXAudio23SubmixVoice *iface, + UINT32 Channels, float *pVolumes) +{ + XA2SubmixImpl *This = impl_from_IXAudio23SubmixVoice(iface); + return IXAudio2SubmixVoice_GetChannelVolumes(&This->IXAudio2SubmixVoice_iface, + Channels, pVolumes); +} + +static HRESULT WINAPI XA23SUB_SetOutputMatrix(IXAudio23SubmixVoice *iface, + IXAudio2Voice *pDestinationVoice, UINT32 SubmixChannels, + UINT32 DestinationChannels, const float *pLevelMatrix, + UINT32 OperationSet) +{ + XA2SubmixImpl *This = impl_from_IXAudio23SubmixVoice(iface); + return IXAudio2SubmixVoice_SetOutputMatrix(&This->IXAudio2SubmixVoice_iface, + pDestinationVoice, SubmixChannels, DestinationChannels, + pLevelMatrix, OperationSet); +} + +static void WINAPI XA23SUB_GetOutputMatrix(IXAudio23SubmixVoice *iface, + IXAudio2Voice *pDestinationVoice, UINT32 SubmixChannels, + UINT32 DestinationChannels, float *pLevelMatrix) +{ + XA2SubmixImpl *This = impl_from_IXAudio23SubmixVoice(iface); + return IXAudio2SubmixVoice_GetOutputMatrix(&This->IXAudio2SubmixVoice_iface, + pDestinationVoice, SubmixChannels, DestinationChannels, + pLevelMatrix); +} + +static void WINAPI XA23SUB_DestroyVoice(IXAudio23SubmixVoice *iface) +{ + XA2SubmixImpl *This = impl_from_IXAudio23SubmixVoice(iface); + return IXAudio2SubmixVoice_DestroyVoice(&This->IXAudio2SubmixVoice_iface); +} + +const IXAudio23SubmixVoiceVtbl XAudio23SubmixVoice_Vtbl = { + XA23SUB_GetVoiceDetails, + XA23SUB_SetOutputVoices, + XA23SUB_SetEffectChain, + XA23SUB_EnableEffect, + XA23SUB_DisableEffect, + XA23SUB_GetEffectState, + XA23SUB_SetEffectParameters, + XA23SUB_GetEffectParameters, + XA23SUB_SetFilterParameters, + XA23SUB_GetFilterParameters, + XA23SUB_SetVolume, + XA23SUB_GetVolume, + XA23SUB_SetChannelVolumes, + XA23SUB_GetChannelVolumes, + XA23SUB_SetOutputMatrix, + XA23SUB_GetOutputMatrix, + XA23SUB_DestroyVoice +}; + +IXAudio2Impl *impl_from_IXAudio23MasteringVoice(IXAudio23MasteringVoice *iface) +{ + return CONTAINING_RECORD(iface, IXAudio2Impl, IXAudio23MasteringVoice_iface); +} + +static void WINAPI XA23M_GetVoiceDetails(IXAudio23MasteringVoice *iface, + XAUDIO2_VOICE_DETAILS *pVoiceDetails) +{ + IXAudio2Impl *This = impl_from_IXAudio23MasteringVoice(iface); + return IXAudio2MasteringVoice_GetVoiceDetails(&This->IXAudio2MasteringVoice_iface, pVoiceDetails); +} + +static HRESULT WINAPI XA23M_SetOutputVoices(IXAudio23MasteringVoice *iface, + const XAUDIO23_VOICE_SENDS *pSendList) +{ + IXAudio2Impl *This = impl_from_IXAudio23MasteringVoice(iface); + XAUDIO2_VOICE_SENDS sends; + HRESULT hr; + DWORD i; + + TRACE("%p, %p\n", This, pSendList); + + sends.SendCount = pSendList->OutputCount; + sends.pSends = HeapAlloc(GetProcessHeap(), 0, sends.SendCount * sizeof(*sends.pSends)); + for(i = 0; i < sends.SendCount; ++i){ + sends.pSends[i].Flags = 0; + sends.pSends[i].pOutputVoice = pSendList->pOutputVoices[i]; + } + + hr = IXAudio2MasteringVoice_SetOutputVoices(&This->IXAudio2MasteringVoice_iface, &sends); + + HeapFree(GetProcessHeap(), 0, sends.pSends); + + return hr; +} + +static HRESULT WINAPI XA23M_SetEffectChain(IXAudio23MasteringVoice *iface, + const XAUDIO2_EFFECT_CHAIN *pEffectChain) +{ + IXAudio2Impl *This = impl_from_IXAudio23MasteringVoice(iface); + return IXAudio2MasteringVoice_SetEffectChain(&This->IXAudio2MasteringVoice_iface, pEffectChain); +} + +static HRESULT WINAPI XA23M_EnableEffect(IXAudio23MasteringVoice *iface, + UINT32 EffectIndex, UINT32 OperationSet) +{ + IXAudio2Impl *This = impl_from_IXAudio23MasteringVoice(iface); + return IXAudio2MasteringVoice_EnableEffect(&This->IXAudio2MasteringVoice_iface, + EffectIndex, OperationSet); +} + +static HRESULT WINAPI XA23M_DisableEffect(IXAudio23MasteringVoice *iface, + UINT32 EffectIndex, UINT32 OperationSet) +{ + IXAudio2Impl *This = impl_from_IXAudio23MasteringVoice(iface); + return IXAudio2MasteringVoice_DisableEffect(&This->IXAudio2MasteringVoice_iface, + EffectIndex, OperationSet); +} + +static void WINAPI XA23M_GetEffectState(IXAudio23MasteringVoice *iface, + UINT32 EffectIndex, BOOL *pEnabled) +{ + IXAudio2Impl *This = impl_from_IXAudio23MasteringVoice(iface); + return IXAudio2MasteringVoice_GetEffectState(&This->IXAudio2MasteringVoice_iface, + EffectIndex, pEnabled); +} + +static HRESULT WINAPI XA23M_SetEffectParameters(IXAudio23MasteringVoice *iface, + UINT32 EffectIndex, const void *pParameters, UINT32 ParametersByteSize, + UINT32 OperationSet) +{ + IXAudio2Impl *This = impl_from_IXAudio23MasteringVoice(iface); + return IXAudio2MasteringVoice_SetEffectParameters(&This->IXAudio2MasteringVoice_iface, + EffectIndex, pParameters, ParametersByteSize, OperationSet); +} + +static HRESULT WINAPI XA23M_GetEffectParameters(IXAudio23MasteringVoice *iface, + UINT32 EffectIndex, void *pParameters, UINT32 ParametersByteSize) +{ + IXAudio2Impl *This = impl_from_IXAudio23MasteringVoice(iface); + return IXAudio2MasteringVoice_GetEffectParameters(&This->IXAudio2MasteringVoice_iface, + EffectIndex, pParameters, ParametersByteSize); +} + +static HRESULT WINAPI XA23M_SetFilterParameters(IXAudio23MasteringVoice *iface, + const XAUDIO2_FILTER_PARAMETERS *pParameters, UINT32 OperationSet) +{ + IXAudio2Impl *This = impl_from_IXAudio23MasteringVoice(iface); + return IXAudio2MasteringVoice_SetFilterParameters(&This->IXAudio2MasteringVoice_iface, + pParameters, OperationSet); +} + +static void WINAPI XA23M_GetFilterParameters(IXAudio23MasteringVoice *iface, + XAUDIO2_FILTER_PARAMETERS *pParameters) +{ + IXAudio2Impl *This = impl_from_IXAudio23MasteringVoice(iface); + return IXAudio2MasteringVoice_GetFilterParameters(&This->IXAudio2MasteringVoice_iface, pParameters); +} + +static HRESULT WINAPI XA23M_SetVolume(IXAudio23MasteringVoice *iface, + float Volume, UINT32 OperationSet) +{ + IXAudio2Impl *This = impl_from_IXAudio23MasteringVoice(iface); + return IXAudio2MasteringVoice_SetVolume(&This->IXAudio2MasteringVoice_iface, + Volume, OperationSet); +} + +static void WINAPI XA23M_GetVolume(IXAudio23MasteringVoice *iface, + float *pVolume) +{ + IXAudio2Impl *This = impl_from_IXAudio23MasteringVoice(iface); + return IXAudio2MasteringVoice_GetVolume(&This->IXAudio2MasteringVoice_iface, pVolume); +} + +static HRESULT WINAPI XA23M_SetChannelVolumes(IXAudio23MasteringVoice *iface, + UINT32 Channels, const float *pVolumes, UINT32 OperationSet) +{ + IXAudio2Impl *This = impl_from_IXAudio23MasteringVoice(iface); + return IXAudio2MasteringVoice_SetChannelVolumes(&This->IXAudio2MasteringVoice_iface, + Channels, pVolumes, OperationSet); +} + +static void WINAPI XA23M_GetChannelVolumes(IXAudio23MasteringVoice *iface, + UINT32 Channels, float *pVolumes) +{ + IXAudio2Impl *This = impl_from_IXAudio23MasteringVoice(iface); + return IXAudio2MasteringVoice_GetChannelVolumes(&This->IXAudio2MasteringVoice_iface, + Channels, pVolumes); +} + +static HRESULT WINAPI XA23M_SetOutputMatrix(IXAudio23MasteringVoice *iface, + IXAudio2Voice *pDestinationVoice, UINT32 MasteringChannels, + UINT32 DestinationChannels, const float *pLevelMatrix, + UINT32 OperationSet) +{ + IXAudio2Impl *This = impl_from_IXAudio23MasteringVoice(iface); + return IXAudio2MasteringVoice_SetOutputMatrix(&This->IXAudio2MasteringVoice_iface, + pDestinationVoice, MasteringChannels, DestinationChannels, + pLevelMatrix, OperationSet); +} + +static void WINAPI XA23M_GetOutputMatrix(IXAudio23MasteringVoice *iface, + IXAudio2Voice *pDestinationVoice, UINT32 MasteringChannels, + UINT32 DestinationChannels, float *pLevelMatrix) +{ + IXAudio2Impl *This = impl_from_IXAudio23MasteringVoice(iface); + return IXAudio2MasteringVoice_GetOutputMatrix(&This->IXAudio2MasteringVoice_iface, + pDestinationVoice, MasteringChannels, DestinationChannels, + pLevelMatrix); +} + +static void WINAPI XA23M_DestroyVoice(IXAudio23MasteringVoice *iface) +{ + IXAudio2Impl *This = impl_from_IXAudio23MasteringVoice(iface); + return IXAudio2MasteringVoice_DestroyVoice(&This->IXAudio2MasteringVoice_iface); +} + +const IXAudio23MasteringVoiceVtbl XAudio23MasteringVoice_Vtbl = { + XA23M_GetVoiceDetails, + XA23M_SetOutputVoices, + XA23M_SetEffectChain, + XA23M_EnableEffect, + XA23M_DisableEffect, + XA23M_GetEffectState, + XA23M_SetEffectParameters, + XA23M_GetEffectParameters, + XA23M_SetFilterParameters, + XA23M_GetFilterParameters, + XA23M_SetVolume, + XA23M_GetVolume, + XA23M_SetChannelVolumes, + XA23M_GetChannelVolumes, + XA23M_SetOutputMatrix, + XA23M_GetOutputMatrix, + XA23M_DestroyVoice +}; + +static inline IXAudio2Impl *impl_from_IXAudio22(IXAudio22 *iface) +{ + return CONTAINING_RECORD(iface, IXAudio2Impl, IXAudio22_iface); +} + +static HRESULT WINAPI XA22_QueryInterface(IXAudio22 *iface, REFIID riid, + void **ppvObject) +{ + IXAudio2Impl *This = impl_from_IXAudio22(iface); + return IXAudio2_QueryInterface(&This->IXAudio2_iface, riid, ppvObject); +} + +static ULONG WINAPI XA22_AddRef(IXAudio22 *iface) +{ + IXAudio2Impl *This = impl_from_IXAudio22(iface); + return IXAudio2_AddRef(&This->IXAudio2_iface); +} + +static ULONG WINAPI XA22_Release(IXAudio22 *iface) +{ + IXAudio2Impl *This = impl_from_IXAudio22(iface); + return IXAudio2_Release(&This->IXAudio2_iface); +} + +static HRESULT WINAPI XA22_GetDeviceCount(IXAudio22 *iface, UINT32 *pCount) +{ + IXAudio2Impl *This = impl_from_IXAudio22(iface); + + TRACE("%p, %p\n", This, pCount); + + *pCount = This->ndevs; + + return S_OK; +} + +static HRESULT WINAPI XA22_GetDeviceDetails(IXAudio22 *iface, UINT32 index, + XAUDIO2_DEVICE_DETAILS *pDeviceDetails) +{ + IXAudio2Impl *This = impl_from_IXAudio22(iface); + HRESULT hr; + IMMDevice *dev; + IAudioClient *client; + IPropertyStore *ps; + WAVEFORMATEX *wfx; + PROPVARIANT var; + + TRACE("%p, %u, %p\n", This, index, pDeviceDetails); + + if(index >= This->ndevs) + return E_INVALIDARG; + + hr = IMMDeviceEnumerator_GetDevice(This->devenum, This->devids[index], &dev); + if(FAILED(hr)){ + WARN("GetDevice failed: %08x\n", hr); + return hr; + } + + hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, + NULL, (void**)&client); + if(FAILED(hr)){ + WARN("Activate failed: %08x\n", hr); + IMMDevice_Release(dev); + return hr; + } + + hr = IMMDevice_OpenPropertyStore(dev, STGM_READ, &ps); + if(FAILED(hr)){ + WARN("OpenPropertyStore failed: %08x\n", hr); + IAudioClient_Release(client); + IMMDevice_Release(dev); + return hr; + } + + PropVariantInit(&var); + + hr = IPropertyStore_GetValue(ps, (PROPERTYKEY*)&DEVPKEY_Device_FriendlyName, &var); + if(FAILED(hr)){ + WARN("GetValue failed: %08x\n", hr); + goto done; + } + + lstrcpynW(pDeviceDetails->DisplayName, var.u.pwszVal, sizeof(pDeviceDetails->DisplayName)/sizeof(WCHAR)); + + PropVariantClear(&var); + + hr = IAudioClient_GetMixFormat(client, &wfx); + if(FAILED(hr)){ + WARN("GetMixFormat failed: %08x\n", hr); + goto done; + } + + lstrcpyW(pDeviceDetails->DeviceID, This->devids[index]); + + if(index == 0) + pDeviceDetails->Role = GlobalDefaultDevice; + else + pDeviceDetails->Role = NotDefaultDevice; + + if(sizeof(WAVEFORMATEX) + wfx->cbSize > sizeof(pDeviceDetails->OutputFormat)){ + FIXME("AudioClient format is too large to fit into WAVEFORMATEXTENSIBLE!\n"); + CoTaskMemFree(wfx); + hr = E_FAIL; + goto done; + } + memcpy(&pDeviceDetails->OutputFormat, wfx, sizeof(WAVEFORMATEX) + wfx->cbSize); + + CoTaskMemFree(wfx); + +done: + IPropertyStore_Release(ps); + IAudioClient_Release(client); + IMMDevice_Release(dev); + + return hr; +} + +static HRESULT WINAPI XA22_Initialize(IXAudio22 *iface, UINT32 flags, + XAUDIO2_PROCESSOR processor) +{ + IXAudio2Impl *This = impl_from_IXAudio22(iface); + TRACE("(%p)->(0x%x, 0x%x)\n", This, flags, processor); + return S_OK; +} + +static HRESULT WINAPI XA22_RegisterForCallbacks(IXAudio22 *iface, + IXAudio2EngineCallback *pCallback) +{ + IXAudio2Impl *This = impl_from_IXAudio22(iface); + return IXAudio2_RegisterForCallbacks(&This->IXAudio2_iface, pCallback); +} + +static void WINAPI XA22_UnregisterForCallbacks(IXAudio22 *iface, + IXAudio2EngineCallback *pCallback) +{ + IXAudio2Impl *This = impl_from_IXAudio22(iface); + IXAudio2_UnregisterForCallbacks(&This->IXAudio2_iface, pCallback); +} + +static HRESULT WINAPI XA22_CreateSourceVoice(IXAudio22 *iface, + IXAudio2SourceVoice **ppSourceVoice, const WAVEFORMATEX *pSourceFormat, + UINT32 flags, float maxFrequencyRatio, + IXAudio2VoiceCallback *pCallback, const XAUDIO2_VOICE_SENDS *pSendList, + const XAUDIO2_EFFECT_CHAIN *pEffectChain) +{ + IXAudio2Impl *This = impl_from_IXAudio22(iface); + return IXAudio2_CreateSourceVoice(&This->IXAudio2_iface, ppSourceVoice, + pSourceFormat, flags, maxFrequencyRatio, pCallback, pSendList, + pEffectChain); +} + +static HRESULT WINAPI XA22_CreateSubmixVoice(IXAudio22 *iface, + IXAudio2SubmixVoice **ppSubmixVoice, UINT32 inputChannels, + UINT32 inputSampleRate, UINT32 flags, UINT32 processingStage, + const XAUDIO2_VOICE_SENDS *pSendList, + const XAUDIO2_EFFECT_CHAIN *pEffectChain) +{ + IXAudio2Impl *This = impl_from_IXAudio22(iface); + return IXAudio2_CreateSubmixVoice(&This->IXAudio2_iface, ppSubmixVoice, + inputChannels, inputSampleRate, flags, processingStage, pSendList, + pEffectChain); +} + +static HRESULT WINAPI XA22_CreateMasteringVoice(IXAudio22 *iface, + IXAudio2MasteringVoice **ppMasteringVoice, UINT32 inputChannels, + UINT32 inputSampleRate, UINT32 flags, UINT32 deviceIndex, + const XAUDIO2_EFFECT_CHAIN *pEffectChain) +{ + IXAudio2Impl *This = impl_from_IXAudio22(iface); + + TRACE("(%p)->(%p, %u, %u, 0x%x, %u, %p)\n", This, ppMasteringVoice, + inputChannels, inputSampleRate, flags, deviceIndex, + pEffectChain); + + if(deviceIndex >= This->ndevs) + return E_INVALIDARG; + + return IXAudio2_CreateMasteringVoice(&This->IXAudio2_iface, ppMasteringVoice, + inputChannels, inputSampleRate, flags, This->devids[deviceIndex], + pEffectChain, AudioCategory_GameEffects); +} + +static HRESULT WINAPI XA22_StartEngine(IXAudio22 *iface) +{ + IXAudio2Impl *This = impl_from_IXAudio22(iface); + return IXAudio2_StartEngine(&This->IXAudio2_iface); +} + +static void WINAPI XA22_StopEngine(IXAudio22 *iface) +{ + IXAudio2Impl *This = impl_from_IXAudio22(iface); + return IXAudio2_StopEngine(&This->IXAudio2_iface); +} + +static HRESULT WINAPI XA22_CommitChanges(IXAudio22 *iface, UINT32 operationSet) +{ + IXAudio2Impl *This = impl_from_IXAudio22(iface); + return IXAudio2_CommitChanges(&This->IXAudio2_iface, operationSet); +} + +static void WINAPI XA22_GetPerformanceData(IXAudio22 *iface, + XAUDIO22_PERFORMANCE_DATA *pPerfData) +{ + IXAudio2Impl *This = impl_from_IXAudio22(iface); + XAUDIO2_PERFORMANCE_DATA data; + + IXAudio2_GetPerformanceData(&This->IXAudio2_iface, &data); + + pPerfData->AudioCyclesSinceLastQuery = data.AudioCyclesSinceLastQuery; + pPerfData->TotalCyclesSinceLastQuery = data.TotalCyclesSinceLastQuery; + pPerfData->MinimumCyclesPerQuantum = data.MinimumCyclesPerQuantum; + pPerfData->MaximumCyclesPerQuantum = data.MaximumCyclesPerQuantum; + pPerfData->MemoryUsageInBytes = data.MemoryUsageInBytes; + pPerfData->CurrentLatencyInSamples = data.CurrentLatencyInSamples; + pPerfData->GlitchesSinceEngineStarted = data.GlitchesSinceEngineStarted; + pPerfData->ActiveSourceVoiceCount = data.ActiveSourceVoiceCount; + pPerfData->TotalSourceVoiceCount = data.TotalSourceVoiceCount; + + pPerfData->ActiveSubmixVoiceCount = data.ActiveSubmixVoiceCount; + pPerfData->TotalSubmixVoiceCount = data.ActiveSubmixVoiceCount; + + pPerfData->ActiveXmaSourceVoices = data.ActiveXmaSourceVoices; + pPerfData->ActiveXmaStreams = data.ActiveXmaStreams; +} + +static void WINAPI XA22_SetDebugConfiguration(IXAudio22 *iface, + const XAUDIO2_DEBUG_CONFIGURATION *pDebugConfiguration, + void *pReserved) +{ + IXAudio2Impl *This = impl_from_IXAudio22(iface); + return IXAudio2_SetDebugConfiguration(&This->IXAudio2_iface, + pDebugConfiguration, pReserved); +} + +const IXAudio22Vtbl XAudio22_Vtbl = { + XA22_QueryInterface, + XA22_AddRef, + XA22_Release, + XA22_GetDeviceCount, + XA22_GetDeviceDetails, + XA22_Initialize, + XA22_RegisterForCallbacks, + XA22_UnregisterForCallbacks, + XA22_CreateSourceVoice, + XA22_CreateSubmixVoice, + XA22_CreateMasteringVoice, + XA22_StartEngine, + XA22_StopEngine, + XA22_CommitChanges, + XA22_GetPerformanceData, + XA22_SetDebugConfiguration +}; + +XA2SourceImpl *impl_from_IXAudio20SourceVoice(IXAudio20SourceVoice *iface) +{ + return CONTAINING_RECORD(iface, XA2SourceImpl, IXAudio20SourceVoice_iface); +} + +static void WINAPI XA20SRC_GetVoiceDetails(IXAudio20SourceVoice *iface, + XAUDIO2_VOICE_DETAILS *pVoiceDetails) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + return IXAudio2SourceVoice_GetVoiceDetails(&This->IXAudio2SourceVoice_iface, pVoiceDetails); +} + +static HRESULT WINAPI XA20SRC_SetOutputVoices(IXAudio20SourceVoice *iface, + const XAUDIO23_VOICE_SENDS *pSendList) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + XAUDIO2_VOICE_SENDS sends; + HRESULT hr; + DWORD i; + + TRACE("%p, %p\n", This, pSendList); + + sends.SendCount = pSendList->OutputCount; + sends.pSends = HeapAlloc(GetProcessHeap(), 0, sends.SendCount * sizeof(*sends.pSends)); + for(i = 0; i < sends.SendCount; ++i){ + sends.pSends[i].Flags = 0; + sends.pSends[i].pOutputVoice = pSendList->pOutputVoices[i]; + } + + hr = IXAudio2SourceVoice_SetOutputVoices(&This->IXAudio2SourceVoice_iface, &sends); + + HeapFree(GetProcessHeap(), 0, sends.pSends); + + return hr; +} + +static HRESULT WINAPI XA20SRC_SetEffectChain(IXAudio20SourceVoice *iface, + const XAUDIO2_EFFECT_CHAIN *pEffectChain) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + return IXAudio2SourceVoice_SetEffectChain(&This->IXAudio2SourceVoice_iface, pEffectChain); +} + +static HRESULT WINAPI XA20SRC_EnableEffect(IXAudio20SourceVoice *iface, + UINT32 EffectIndex, UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + return IXAudio2SourceVoice_EnableEffect(&This->IXAudio2SourceVoice_iface, + EffectIndex, OperationSet); +} + +static HRESULT WINAPI XA20SRC_DisableEffect(IXAudio20SourceVoice *iface, + UINT32 EffectIndex, UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + return IXAudio2SourceVoice_DisableEffect(&This->IXAudio2SourceVoice_iface, + EffectIndex, OperationSet); +} + +static void WINAPI XA20SRC_GetEffectState(IXAudio20SourceVoice *iface, + UINT32 EffectIndex, BOOL *pEnabled) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + return IXAudio2SourceVoice_GetEffectState(&This->IXAudio2SourceVoice_iface, + EffectIndex, pEnabled); +} + +static HRESULT WINAPI XA20SRC_SetEffectParameters(IXAudio20SourceVoice *iface, + UINT32 EffectIndex, const void *pParameters, UINT32 ParametersByteSize, + UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + return IXAudio2SourceVoice_SetEffectParameters(&This->IXAudio2SourceVoice_iface, + EffectIndex, pParameters, ParametersByteSize, OperationSet); +} + +static HRESULT WINAPI XA20SRC_GetEffectParameters(IXAudio20SourceVoice *iface, + UINT32 EffectIndex, void *pParameters, UINT32 ParametersByteSize) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + return IXAudio2SourceVoice_GetEffectParameters(&This->IXAudio2SourceVoice_iface, + EffectIndex, pParameters, ParametersByteSize); +} + +static HRESULT WINAPI XA20SRC_SetFilterParameters(IXAudio20SourceVoice *iface, + const XAUDIO2_FILTER_PARAMETERS *pParameters, UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + return IXAudio2SourceVoice_SetFilterParameters(&This->IXAudio2SourceVoice_iface, + pParameters, OperationSet); +} + +static void WINAPI XA20SRC_GetFilterParameters(IXAudio20SourceVoice *iface, + XAUDIO2_FILTER_PARAMETERS *pParameters) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + return IXAudio2SourceVoice_GetFilterParameters(&This->IXAudio2SourceVoice_iface, pParameters); +} + +static HRESULT WINAPI XA20SRC_SetVolume(IXAudio20SourceVoice *iface, + float Volume, UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + return IXAudio2SourceVoice_SetVolume(&This->IXAudio2SourceVoice_iface, + Volume, OperationSet); +} + +static void WINAPI XA20SRC_GetVolume(IXAudio20SourceVoice *iface, + float *pVolume) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + return IXAudio2SourceVoice_GetVolume(&This->IXAudio2SourceVoice_iface, pVolume); +} + +static HRESULT WINAPI XA20SRC_SetChannelVolumes(IXAudio20SourceVoice *iface, + UINT32 Channels, const float *pVolumes, UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + return IXAudio2SourceVoice_SetChannelVolumes(&This->IXAudio2SourceVoice_iface, + Channels, pVolumes, OperationSet); +} + +static void WINAPI XA20SRC_GetChannelVolumes(IXAudio20SourceVoice *iface, + UINT32 Channels, float *pVolumes) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + return IXAudio2SourceVoice_GetChannelVolumes(&This->IXAudio2SourceVoice_iface, + Channels, pVolumes); +} + +static HRESULT WINAPI XA20SRC_SetOutputMatrix(IXAudio20SourceVoice *iface, + IXAudio2Voice *pDestinationVoice, UINT32 SourceChannels, + UINT32 DestinationChannels, const float *pLevelMatrix, + UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + return IXAudio2SourceVoice_SetOutputMatrix(&This->IXAudio2SourceVoice_iface, + pDestinationVoice, SourceChannels, DestinationChannels, + pLevelMatrix, OperationSet); +} + +static HRESULT WINAPI XA20SRC_GetOutputMatrix(IXAudio20SourceVoice *iface, + IXAudio2Voice *pDestinationVoice, UINT32 SourceChannels, + UINT32 DestinationChannels, float *pLevelMatrix) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + IXAudio2SourceVoice_GetOutputMatrix(&This->IXAudio2SourceVoice_iface, + pDestinationVoice, SourceChannels, DestinationChannels, + pLevelMatrix); + return S_OK; +} + +static void WINAPI XA20SRC_DestroyVoice(IXAudio20SourceVoice *iface) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + return IXAudio2SourceVoice_DestroyVoice(&This->IXAudio2SourceVoice_iface); +} + +static HRESULT WINAPI XA20SRC_Start(IXAudio20SourceVoice *iface, UINT32 Flags, + UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + return IXAudio2SourceVoice_Start(&This->IXAudio2SourceVoice_iface, Flags, OperationSet); +} + +static HRESULT WINAPI XA20SRC_Stop(IXAudio20SourceVoice *iface, UINT32 Flags, + UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + return IXAudio2SourceVoice_Stop(&This->IXAudio2SourceVoice_iface, Flags, OperationSet); +} + +static HRESULT WINAPI XA20SRC_SubmitSourceBuffer(IXAudio20SourceVoice *iface, + const XAUDIO2_BUFFER *pBuffer, const XAUDIO2_BUFFER_WMA *pBufferWMA) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + return IXAudio2SourceVoice_SubmitSourceBuffer(&This->IXAudio2SourceVoice_iface, + pBuffer, pBufferWMA); +} + +static HRESULT WINAPI XA20SRC_FlushSourceBuffers(IXAudio20SourceVoice *iface) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + return IXAudio2SourceVoice_FlushSourceBuffers(&This->IXAudio2SourceVoice_iface); +} + +static HRESULT WINAPI XA20SRC_Discontinuity(IXAudio20SourceVoice *iface) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + return IXAudio2SourceVoice_Discontinuity(&This->IXAudio2SourceVoice_iface); +} + +static HRESULT WINAPI XA20SRC_ExitLoop(IXAudio20SourceVoice *iface, + UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + return IXAudio2SourceVoice_ExitLoop(&This->IXAudio2SourceVoice_iface, OperationSet); +} + +static void WINAPI XA20SRC_GetState(IXAudio20SourceVoice *iface, + XAUDIO2_VOICE_STATE *pVoiceState) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + return IXAudio2SourceVoice_GetState(&This->IXAudio2SourceVoice_iface, pVoiceState, 0); +} + +static HRESULT WINAPI XA20SRC_SetFrequencyRatio(IXAudio20SourceVoice *iface, + float Ratio, UINT32 OperationSet) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + return IXAudio2SourceVoice_SetFrequencyRatio(&This->IXAudio2SourceVoice_iface, + Ratio, OperationSet); +} + +static void WINAPI XA20SRC_GetFrequencyRatio(IXAudio20SourceVoice *iface, + float *pRatio) +{ + XA2SourceImpl *This = impl_from_IXAudio20SourceVoice(iface); + return IXAudio2SourceVoice_GetFrequencyRatio(&This->IXAudio2SourceVoice_iface, pRatio); +} + +const IXAudio20SourceVoiceVtbl XAudio20SourceVoice_Vtbl = { + XA20SRC_GetVoiceDetails, + XA20SRC_SetOutputVoices, + XA20SRC_SetEffectChain, + XA20SRC_EnableEffect, + XA20SRC_DisableEffect, + XA20SRC_GetEffectState, + XA20SRC_SetEffectParameters, + XA20SRC_GetEffectParameters, + XA20SRC_SetFilterParameters, + XA20SRC_GetFilterParameters, + XA20SRC_SetVolume, + XA20SRC_GetVolume, + XA20SRC_SetChannelVolumes, + XA20SRC_GetChannelVolumes, + XA20SRC_SetOutputMatrix, + XA20SRC_GetOutputMatrix, + XA20SRC_DestroyVoice, + XA20SRC_Start, + XA20SRC_Stop, + XA20SRC_SubmitSourceBuffer, + XA20SRC_FlushSourceBuffers, + XA20SRC_Discontinuity, + XA20SRC_ExitLoop, + XA20SRC_GetState, + XA20SRC_SetFrequencyRatio, + XA20SRC_GetFrequencyRatio, +}; + +XA2SubmixImpl *impl_from_IXAudio20SubmixVoice(IXAudio20SubmixVoice *iface) +{ + return CONTAINING_RECORD(iface, XA2SubmixImpl, IXAudio20SubmixVoice_iface); +} + +static void WINAPI XA20SUB_GetVoiceDetails(IXAudio20SubmixVoice *iface, + XAUDIO2_VOICE_DETAILS *pVoiceDetails) +{ + XA2SubmixImpl *This = impl_from_IXAudio20SubmixVoice(iface); + return IXAudio2SubmixVoice_GetVoiceDetails(&This->IXAudio2SubmixVoice_iface, pVoiceDetails); +} + +static HRESULT WINAPI XA20SUB_SetOutputVoices(IXAudio20SubmixVoice *iface, + const XAUDIO23_VOICE_SENDS *pSendList) +{ + XA2SubmixImpl *This = impl_from_IXAudio20SubmixVoice(iface); + XAUDIO2_VOICE_SENDS sends; + HRESULT hr; + DWORD i; + + TRACE("%p, %p\n", This, pSendList); + + sends.SendCount = pSendList->OutputCount; + sends.pSends = HeapAlloc(GetProcessHeap(), 0, sends.SendCount * sizeof(*sends.pSends)); + for(i = 0; i < sends.SendCount; ++i){ + sends.pSends[i].Flags = 0; + sends.pSends[i].pOutputVoice = pSendList->pOutputVoices[i]; + } + + hr = IXAudio2SubmixVoice_SetOutputVoices(&This->IXAudio2SubmixVoice_iface, &sends); + + HeapFree(GetProcessHeap(), 0, sends.pSends); + + return hr; +} + +static HRESULT WINAPI XA20SUB_SetEffectChain(IXAudio20SubmixVoice *iface, + const XAUDIO2_EFFECT_CHAIN *pEffectChain) +{ + XA2SubmixImpl *This = impl_from_IXAudio20SubmixVoice(iface); + return IXAudio2SubmixVoice_SetEffectChain(&This->IXAudio2SubmixVoice_iface, pEffectChain); +} + +static HRESULT WINAPI XA20SUB_EnableEffect(IXAudio20SubmixVoice *iface, + UINT32 EffectIndex, UINT32 OperationSet) +{ + XA2SubmixImpl *This = impl_from_IXAudio20SubmixVoice(iface); + return IXAudio2SubmixVoice_EnableEffect(&This->IXAudio2SubmixVoice_iface, + EffectIndex, OperationSet); +} + +static HRESULT WINAPI XA20SUB_DisableEffect(IXAudio20SubmixVoice *iface, + UINT32 EffectIndex, UINT32 OperationSet) +{ + XA2SubmixImpl *This = impl_from_IXAudio20SubmixVoice(iface); + return IXAudio2SubmixVoice_DisableEffect(&This->IXAudio2SubmixVoice_iface, + EffectIndex, OperationSet); +} + +static void WINAPI XA20SUB_GetEffectState(IXAudio20SubmixVoice *iface, + UINT32 EffectIndex, BOOL *pEnabled) +{ + XA2SubmixImpl *This = impl_from_IXAudio20SubmixVoice(iface); + return IXAudio2SubmixVoice_GetEffectState(&This->IXAudio2SubmixVoice_iface, + EffectIndex, pEnabled); +} + +static HRESULT WINAPI XA20SUB_SetEffectParameters(IXAudio20SubmixVoice *iface, + UINT32 EffectIndex, const void *pParameters, UINT32 ParametersByteSize, + UINT32 OperationSet) +{ + XA2SubmixImpl *This = impl_from_IXAudio20SubmixVoice(iface); + return IXAudio2SubmixVoice_SetEffectParameters(&This->IXAudio2SubmixVoice_iface, + EffectIndex, pParameters, ParametersByteSize, OperationSet); +} + +static HRESULT WINAPI XA20SUB_GetEffectParameters(IXAudio20SubmixVoice *iface, + UINT32 EffectIndex, void *pParameters, UINT32 ParametersByteSize) +{ + XA2SubmixImpl *This = impl_from_IXAudio20SubmixVoice(iface); + return IXAudio2SubmixVoice_GetEffectParameters(&This->IXAudio2SubmixVoice_iface, + EffectIndex, pParameters, ParametersByteSize); +} + +static HRESULT WINAPI XA20SUB_SetFilterParameters(IXAudio20SubmixVoice *iface, + const XAUDIO2_FILTER_PARAMETERS *pParameters, UINT32 OperationSet) +{ + XA2SubmixImpl *This = impl_from_IXAudio20SubmixVoice(iface); + return IXAudio2SubmixVoice_SetFilterParameters(&This->IXAudio2SubmixVoice_iface, + pParameters, OperationSet); +} + +static void WINAPI XA20SUB_GetFilterParameters(IXAudio20SubmixVoice *iface, + XAUDIO2_FILTER_PARAMETERS *pParameters) +{ + XA2SubmixImpl *This = impl_from_IXAudio20SubmixVoice(iface); + return IXAudio2SubmixVoice_GetFilterParameters(&This->IXAudio2SubmixVoice_iface, pParameters); +} + +static HRESULT WINAPI XA20SUB_SetVolume(IXAudio20SubmixVoice *iface, + float Volume, UINT32 OperationSet) +{ + XA2SubmixImpl *This = impl_from_IXAudio20SubmixVoice(iface); + return IXAudio2SubmixVoice_SetVolume(&This->IXAudio2SubmixVoice_iface, + Volume, OperationSet); +} + +static void WINAPI XA20SUB_GetVolume(IXAudio20SubmixVoice *iface, + float *pVolume) +{ + XA2SubmixImpl *This = impl_from_IXAudio20SubmixVoice(iface); + return IXAudio2SubmixVoice_GetVolume(&This->IXAudio2SubmixVoice_iface, pVolume); +} + +static HRESULT WINAPI XA20SUB_SetChannelVolumes(IXAudio20SubmixVoice *iface, + UINT32 Channels, const float *pVolumes, UINT32 OperationSet) +{ + XA2SubmixImpl *This = impl_from_IXAudio20SubmixVoice(iface); + return IXAudio2SubmixVoice_SetChannelVolumes(&This->IXAudio2SubmixVoice_iface, + Channels, pVolumes, OperationSet); +} + +static void WINAPI XA20SUB_GetChannelVolumes(IXAudio20SubmixVoice *iface, + UINT32 Channels, float *pVolumes) +{ + XA2SubmixImpl *This = impl_from_IXAudio20SubmixVoice(iface); + return IXAudio2SubmixVoice_GetChannelVolumes(&This->IXAudio2SubmixVoice_iface, + Channels, pVolumes); +} + +static HRESULT WINAPI XA20SUB_SetOutputMatrix(IXAudio20SubmixVoice *iface, + IXAudio2Voice *pDestinationVoice, UINT32 SubmixChannels, + UINT32 DestinationChannels, const float *pLevelMatrix, + UINT32 OperationSet) +{ + XA2SubmixImpl *This = impl_from_IXAudio20SubmixVoice(iface); + return IXAudio2SubmixVoice_SetOutputMatrix(&This->IXAudio2SubmixVoice_iface, + pDestinationVoice, SubmixChannels, DestinationChannels, + pLevelMatrix, OperationSet); +} + +static HRESULT WINAPI XA20SUB_GetOutputMatrix(IXAudio20SubmixVoice *iface, + IXAudio2Voice *pDestinationVoice, UINT32 SubmixChannels, + UINT32 DestinationChannels, float *pLevelMatrix) +{ + XA2SubmixImpl *This = impl_from_IXAudio20SubmixVoice(iface); + IXAudio2SubmixVoice_GetOutputMatrix(&This->IXAudio2SubmixVoice_iface, + pDestinationVoice, SubmixChannels, DestinationChannels, + pLevelMatrix); + return S_OK; +} + +static void WINAPI XA20SUB_DestroyVoice(IXAudio20SubmixVoice *iface) +{ + XA2SubmixImpl *This = impl_from_IXAudio20SubmixVoice(iface); + return IXAudio2SubmixVoice_DestroyVoice(&This->IXAudio2SubmixVoice_iface); +} + +const IXAudio20SubmixVoiceVtbl XAudio20SubmixVoice_Vtbl = { + XA20SUB_GetVoiceDetails, + XA20SUB_SetOutputVoices, + XA20SUB_SetEffectChain, + XA20SUB_EnableEffect, + XA20SUB_DisableEffect, + XA20SUB_GetEffectState, + XA20SUB_SetEffectParameters, + XA20SUB_GetEffectParameters, + XA20SUB_SetFilterParameters, + XA20SUB_GetFilterParameters, + XA20SUB_SetVolume, + XA20SUB_GetVolume, + XA20SUB_SetChannelVolumes, + XA20SUB_GetChannelVolumes, + XA20SUB_SetOutputMatrix, + XA20SUB_GetOutputMatrix, + XA20SUB_DestroyVoice +}; + +IXAudio2Impl *impl_from_IXAudio20MasteringVoice(IXAudio20MasteringVoice *iface) +{ + return CONTAINING_RECORD(iface, IXAudio2Impl, IXAudio20MasteringVoice_iface); +} + +static void WINAPI XA20M_GetVoiceDetails(IXAudio20MasteringVoice *iface, + XAUDIO2_VOICE_DETAILS *pVoiceDetails) +{ + IXAudio2Impl *This = impl_from_IXAudio20MasteringVoice(iface); + return IXAudio2MasteringVoice_GetVoiceDetails(&This->IXAudio2MasteringVoice_iface, pVoiceDetails); +} + +static HRESULT WINAPI XA20M_SetOutputVoices(IXAudio20MasteringVoice *iface, + const XAUDIO23_VOICE_SENDS *pSendList) +{ + IXAudio2Impl *This = impl_from_IXAudio20MasteringVoice(iface); + XAUDIO2_VOICE_SENDS sends; + HRESULT hr; + DWORD i; + + TRACE("%p, %p\n", This, pSendList); + + sends.SendCount = pSendList->OutputCount; + sends.pSends = HeapAlloc(GetProcessHeap(), 0, sends.SendCount * sizeof(*sends.pSends)); + for(i = 0; i < sends.SendCount; ++i){ + sends.pSends[i].Flags = 0; + sends.pSends[i].pOutputVoice = pSendList->pOutputVoices[i]; + } + + hr = IXAudio2MasteringVoice_SetOutputVoices(&This->IXAudio2MasteringVoice_iface, &sends); + + HeapFree(GetProcessHeap(), 0, sends.pSends); + + return hr; +} + +static HRESULT WINAPI XA20M_SetEffectChain(IXAudio20MasteringVoice *iface, + const XAUDIO2_EFFECT_CHAIN *pEffectChain) +{ + IXAudio2Impl *This = impl_from_IXAudio20MasteringVoice(iface); + return IXAudio2MasteringVoice_SetEffectChain(&This->IXAudio2MasteringVoice_iface, pEffectChain); +} + +static HRESULT WINAPI XA20M_EnableEffect(IXAudio20MasteringVoice *iface, + UINT32 EffectIndex, UINT32 OperationSet) +{ + IXAudio2Impl *This = impl_from_IXAudio20MasteringVoice(iface); + return IXAudio2MasteringVoice_EnableEffect(&This->IXAudio2MasteringVoice_iface, + EffectIndex, OperationSet); +} + +static HRESULT WINAPI XA20M_DisableEffect(IXAudio20MasteringVoice *iface, + UINT32 EffectIndex, UINT32 OperationSet) +{ + IXAudio2Impl *This = impl_from_IXAudio20MasteringVoice(iface); + return IXAudio2MasteringVoice_DisableEffect(&This->IXAudio2MasteringVoice_iface, + EffectIndex, OperationSet); +} + +static void WINAPI XA20M_GetEffectState(IXAudio20MasteringVoice *iface, + UINT32 EffectIndex, BOOL *pEnabled) +{ + IXAudio2Impl *This = impl_from_IXAudio20MasteringVoice(iface); + return IXAudio2MasteringVoice_GetEffectState(&This->IXAudio2MasteringVoice_iface, + EffectIndex, pEnabled); +} + +static HRESULT WINAPI XA20M_SetEffectParameters(IXAudio20MasteringVoice *iface, + UINT32 EffectIndex, const void *pParameters, UINT32 ParametersByteSize, + UINT32 OperationSet) +{ + IXAudio2Impl *This = impl_from_IXAudio20MasteringVoice(iface); + return IXAudio2MasteringVoice_SetEffectParameters(&This->IXAudio2MasteringVoice_iface, + EffectIndex, pParameters, ParametersByteSize, OperationSet); +} + +static HRESULT WINAPI XA20M_GetEffectParameters(IXAudio20MasteringVoice *iface, + UINT32 EffectIndex, void *pParameters, UINT32 ParametersByteSize) +{ + IXAudio2Impl *This = impl_from_IXAudio20MasteringVoice(iface); + return IXAudio2MasteringVoice_GetEffectParameters(&This->IXAudio2MasteringVoice_iface, + EffectIndex, pParameters, ParametersByteSize); +} + +static HRESULT WINAPI XA20M_SetFilterParameters(IXAudio20MasteringVoice *iface, + const XAUDIO2_FILTER_PARAMETERS *pParameters, UINT32 OperationSet) +{ + IXAudio2Impl *This = impl_from_IXAudio20MasteringVoice(iface); + return IXAudio2MasteringVoice_SetFilterParameters(&This->IXAudio2MasteringVoice_iface, + pParameters, OperationSet); +} + +static void WINAPI XA20M_GetFilterParameters(IXAudio20MasteringVoice *iface, + XAUDIO2_FILTER_PARAMETERS *pParameters) +{ + IXAudio2Impl *This = impl_from_IXAudio20MasteringVoice(iface); + return IXAudio2MasteringVoice_GetFilterParameters(&This->IXAudio2MasteringVoice_iface, pParameters); +} + +static HRESULT WINAPI XA20M_SetVolume(IXAudio20MasteringVoice *iface, + float Volume, UINT32 OperationSet) +{ + IXAudio2Impl *This = impl_from_IXAudio20MasteringVoice(iface); + return IXAudio2MasteringVoice_SetVolume(&This->IXAudio2MasteringVoice_iface, + Volume, OperationSet); +} + +static void WINAPI XA20M_GetVolume(IXAudio20MasteringVoice *iface, + float *pVolume) +{ + IXAudio2Impl *This = impl_from_IXAudio20MasteringVoice(iface); + return IXAudio2MasteringVoice_GetVolume(&This->IXAudio2MasteringVoice_iface, pVolume); +} + +static HRESULT WINAPI XA20M_SetChannelVolumes(IXAudio20MasteringVoice *iface, + UINT32 Channels, const float *pVolumes, UINT32 OperationSet) +{ + IXAudio2Impl *This = impl_from_IXAudio20MasteringVoice(iface); + return IXAudio2MasteringVoice_SetChannelVolumes(&This->IXAudio2MasteringVoice_iface, + Channels, pVolumes, OperationSet); +} + +static void WINAPI XA20M_GetChannelVolumes(IXAudio20MasteringVoice *iface, + UINT32 Channels, float *pVolumes) +{ + IXAudio2Impl *This = impl_from_IXAudio20MasteringVoice(iface); + return IXAudio2MasteringVoice_GetChannelVolumes(&This->IXAudio2MasteringVoice_iface, + Channels, pVolumes); +} + +static HRESULT WINAPI XA20M_SetOutputMatrix(IXAudio20MasteringVoice *iface, + IXAudio2Voice *pDestinationVoice, UINT32 MasteringChannels, + UINT32 DestinationChannels, const float *pLevelMatrix, + UINT32 OperationSet) +{ + IXAudio2Impl *This = impl_from_IXAudio20MasteringVoice(iface); + return IXAudio2MasteringVoice_SetOutputMatrix(&This->IXAudio2MasteringVoice_iface, + pDestinationVoice, MasteringChannels, DestinationChannels, + pLevelMatrix, OperationSet); +} + +static HRESULT WINAPI XA20M_GetOutputMatrix(IXAudio20MasteringVoice *iface, + IXAudio2Voice *pDestinationVoice, UINT32 MasteringChannels, + UINT32 DestinationChannels, float *pLevelMatrix) +{ + IXAudio2Impl *This = impl_from_IXAudio20MasteringVoice(iface); + IXAudio2MasteringVoice_GetOutputMatrix(&This->IXAudio2MasteringVoice_iface, + pDestinationVoice, MasteringChannels, DestinationChannels, + pLevelMatrix); + return S_OK; +} + +static void WINAPI XA20M_DestroyVoice(IXAudio20MasteringVoice *iface) +{ + IXAudio2Impl *This = impl_from_IXAudio20MasteringVoice(iface); + return IXAudio2MasteringVoice_DestroyVoice(&This->IXAudio2MasteringVoice_iface); +} + +const IXAudio20MasteringVoiceVtbl XAudio20MasteringVoice_Vtbl = { + XA20M_GetVoiceDetails, + XA20M_SetOutputVoices, + XA20M_SetEffectChain, + XA20M_EnableEffect, + XA20M_DisableEffect, + XA20M_GetEffectState, + XA20M_SetEffectParameters, + XA20M_GetEffectParameters, + XA20M_SetFilterParameters, + XA20M_GetFilterParameters, + XA20M_SetVolume, + XA20M_GetVolume, + XA20M_SetChannelVolumes, + XA20M_GetChannelVolumes, + XA20M_SetOutputMatrix, + XA20M_GetOutputMatrix, + XA20M_DestroyVoice +}; + +static inline IXAudio2Impl *impl_from_IXAudio20(IXAudio20 *iface) +{ + return CONTAINING_RECORD(iface, IXAudio2Impl, IXAudio20_iface); +} + +static HRESULT WINAPI XA20_QueryInterface(IXAudio20 *iface, REFIID riid, + void **ppvObject) +{ + IXAudio2Impl *This = impl_from_IXAudio20(iface); + return IXAudio2_QueryInterface(&This->IXAudio2_iface, riid, ppvObject); +} + +static ULONG WINAPI XA20_AddRef(IXAudio20 *iface) +{ + IXAudio2Impl *This = impl_from_IXAudio20(iface); + return IXAudio2_AddRef(&This->IXAudio2_iface); +} + +static ULONG WINAPI XA20_Release(IXAudio20 *iface) +{ + IXAudio2Impl *This = impl_from_IXAudio20(iface); + return IXAudio2_Release(&This->IXAudio2_iface); +} + +static HRESULT WINAPI XA20_GetDeviceCount(IXAudio20 *iface, UINT32 *pCount) +{ + IXAudio2Impl *This = impl_from_IXAudio20(iface); + + TRACE("%p, %p\n", This, pCount); + + *pCount = This->ndevs; + + return S_OK; +} + +static HRESULT WINAPI XA20_GetDeviceDetails(IXAudio20 *iface, UINT32 index, + XAUDIO2_DEVICE_DETAILS *pDeviceDetails) +{ + IXAudio2Impl *This = impl_from_IXAudio20(iface); + HRESULT hr; + IMMDevice *dev; + IAudioClient *client; + IPropertyStore *ps; + WAVEFORMATEX *wfx; + PROPVARIANT var; + + TRACE("%p, %u, %p\n", This, index, pDeviceDetails); + + if(index >= This->ndevs) + return E_INVALIDARG; + + hr = IMMDeviceEnumerator_GetDevice(This->devenum, This->devids[index], &dev); + if(FAILED(hr)){ + WARN("GetDevice failed: %08x\n", hr); + return hr; + } + + hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, + NULL, (void**)&client); + if(FAILED(hr)){ + WARN("Activate failed: %08x\n", hr); + IMMDevice_Release(dev); + return hr; + } + + hr = IMMDevice_OpenPropertyStore(dev, STGM_READ, &ps); + if(FAILED(hr)){ + WARN("OpenPropertyStore failed: %08x\n", hr); + IAudioClient_Release(client); + IMMDevice_Release(dev); + return hr; + } + + PropVariantInit(&var); + + hr = IPropertyStore_GetValue(ps, (PROPERTYKEY*)&DEVPKEY_Device_FriendlyName, &var); + if(FAILED(hr)){ + WARN("GetValue failed: %08x\n", hr); + goto done; + } + + lstrcpynW(pDeviceDetails->DisplayName, var.u.pwszVal, sizeof(pDeviceDetails->DisplayName)/sizeof(WCHAR)); + + PropVariantClear(&var); + + hr = IAudioClient_GetMixFormat(client, &wfx); + if(FAILED(hr)){ + WARN("GetMixFormat failed: %08x\n", hr); + goto done; + } + + lstrcpyW(pDeviceDetails->DeviceID, This->devids[index]); + + if(index == 0) + pDeviceDetails->Role = GlobalDefaultDevice; + else + pDeviceDetails->Role = NotDefaultDevice; + + if(sizeof(WAVEFORMATEX) + wfx->cbSize > sizeof(pDeviceDetails->OutputFormat)){ + FIXME("AudioClient format is too large to fit into WAVEFORMATEXTENSIBLE!\n"); + CoTaskMemFree(wfx); + hr = E_FAIL; + goto done; + } + memcpy(&pDeviceDetails->OutputFormat, wfx, sizeof(WAVEFORMATEX) + wfx->cbSize); + + CoTaskMemFree(wfx); + +done: + IPropertyStore_Release(ps); + IAudioClient_Release(client); + IMMDevice_Release(dev); + + return hr; +} + +static HRESULT WINAPI XA20_Initialize(IXAudio20 *iface, UINT32 flags, + XAUDIO2_PROCESSOR processor) +{ + IXAudio2Impl *This = impl_from_IXAudio20(iface); + TRACE("(%p)->(0x%x, 0x%x)\n", This, flags, processor); + return S_OK; +} + +static HRESULT WINAPI XA20_RegisterForCallbacks(IXAudio20 *iface, + IXAudio2EngineCallback *pCallback) +{ + IXAudio2Impl *This = impl_from_IXAudio20(iface); + return IXAudio2_RegisterForCallbacks(&This->IXAudio2_iface, pCallback); +} + +static void WINAPI XA20_UnregisterForCallbacks(IXAudio20 *iface, + IXAudio2EngineCallback *pCallback) +{ + IXAudio2Impl *This = impl_from_IXAudio20(iface); + return IXAudio2_UnregisterForCallbacks(&This->IXAudio2_iface, pCallback); +} + +static HRESULT WINAPI XA20_CreateSourceVoice(IXAudio20 *iface, + IXAudio2SourceVoice **ppSourceVoice, const WAVEFORMATEX *pSourceFormat, + UINT32 flags, float maxFrequencyRatio, + IXAudio2VoiceCallback *pCallback, const XAUDIO2_VOICE_SENDS *pSendList, + const XAUDIO2_EFFECT_CHAIN *pEffectChain) +{ + IXAudio2Impl *This = impl_from_IXAudio20(iface); + return IXAudio2_CreateSourceVoice(&This->IXAudio2_iface, ppSourceVoice, + pSourceFormat, flags, maxFrequencyRatio, pCallback, pSendList, + pEffectChain); +} + +static HRESULT WINAPI XA20_CreateSubmixVoice(IXAudio20 *iface, + IXAudio2SubmixVoice **ppSubmixVoice, UINT32 inputChannels, + UINT32 inputSampleRate, UINT32 flags, UINT32 processingStage, + const XAUDIO2_VOICE_SENDS *pSendList, + const XAUDIO2_EFFECT_CHAIN *pEffectChain) +{ + IXAudio2Impl *This = impl_from_IXAudio20(iface); + return IXAudio2_CreateSubmixVoice(&This->IXAudio2_iface, ppSubmixVoice, + inputChannels, inputSampleRate, flags, processingStage, pSendList, + pEffectChain); +} + +static HRESULT WINAPI XA20_CreateMasteringVoice(IXAudio20 *iface, + IXAudio2MasteringVoice **ppMasteringVoice, UINT32 inputChannels, + UINT32 inputSampleRate, UINT32 flags, UINT32 deviceIndex, + const XAUDIO2_EFFECT_CHAIN *pEffectChain) +{ + IXAudio2Impl *This = impl_from_IXAudio20(iface); + + TRACE("(%p)->(%p, %u, %u, 0x%x, %u, %p)\n", This, ppMasteringVoice, + inputChannels, inputSampleRate, flags, deviceIndex, + pEffectChain); + + if(deviceIndex >= This->ndevs) + return E_INVALIDARG; + + return IXAudio2_CreateMasteringVoice(&This->IXAudio2_iface, ppMasteringVoice, + inputChannels, inputSampleRate, flags, This->devids[deviceIndex], + pEffectChain, AudioCategory_GameEffects); +} + +static HRESULT WINAPI XA20_StartEngine(IXAudio20 *iface) +{ + IXAudio2Impl *This = impl_from_IXAudio20(iface); + return IXAudio2_StartEngine(&This->IXAudio2_iface); +} + +static void WINAPI XA20_StopEngine(IXAudio20 *iface) +{ + IXAudio2Impl *This = impl_from_IXAudio20(iface); + return IXAudio2_StopEngine(&This->IXAudio2_iface); +} + +static HRESULT WINAPI XA20_CommitChanges(IXAudio20 *iface, UINT32 operationSet) +{ + IXAudio2Impl *This = impl_from_IXAudio20(iface); + return IXAudio2_CommitChanges(&This->IXAudio2_iface, operationSet); +} + +static void WINAPI XA20_GetPerformanceData(IXAudio20 *iface, + XAUDIO20_PERFORMANCE_DATA *pPerfData) +{ + IXAudio2Impl *This = impl_from_IXAudio20(iface); + XAUDIO2_PERFORMANCE_DATA data; + + IXAudio2_GetPerformanceData(&This->IXAudio2_iface, &data); + + pPerfData->AudioCyclesSinceLastQuery = data.AudioCyclesSinceLastQuery; + pPerfData->TotalCyclesSinceLastQuery = data.TotalCyclesSinceLastQuery; + pPerfData->MinimumCyclesPerQuantum = data.MinimumCyclesPerQuantum; + pPerfData->MaximumCyclesPerQuantum = data.MaximumCyclesPerQuantum; + pPerfData->MemoryUsageInBytes = data.MemoryUsageInBytes; + pPerfData->CurrentLatencyInSamples = data.CurrentLatencyInSamples; + pPerfData->GlitchesSinceLastQuery = data.GlitchesSinceEngineStarted - This->last_query_glitches; + This->last_query_glitches = data.GlitchesSinceEngineStarted; + pPerfData->ActiveSourceVoiceCount = data.ActiveSourceVoiceCount; + pPerfData->TotalSourceVoiceCount = data.TotalSourceVoiceCount; + + pPerfData->ActiveSubmixVoiceCount = data.ActiveSubmixVoiceCount; + pPerfData->TotalSubmixVoiceCount = data.ActiveSubmixVoiceCount; + + pPerfData->ActiveXmaSourceVoices = data.ActiveXmaSourceVoices; + pPerfData->ActiveXmaStreams = data.ActiveXmaStreams; +} + +static void WINAPI XA20_SetDebugConfiguration(IXAudio20 *iface, + const XAUDIO2_DEBUG_CONFIGURATION *pDebugConfiguration, + void *pReserved) +{ + IXAudio2Impl *This = impl_from_IXAudio20(iface); + return IXAudio2_SetDebugConfiguration(&This->IXAudio2_iface, + pDebugConfiguration, pReserved); +} + +const IXAudio20Vtbl XAudio20_Vtbl = { + XA20_QueryInterface, + XA20_AddRef, + XA20_Release, + XA20_GetDeviceCount, + XA20_GetDeviceDetails, + XA20_Initialize, + XA20_RegisterForCallbacks, + XA20_UnregisterForCallbacks, + XA20_CreateSourceVoice, + XA20_CreateSubmixVoice, + XA20_CreateMasteringVoice, + XA20_StartEngine, + XA20_StopEngine, + XA20_CommitChanges, + XA20_GetPerformanceData, + XA20_SetDebugConfiguration +}; diff -Nru wine1.7-1.7.50/dlls/xaudio2_7/Makefile.in wine1.7-1.7.55/dlls/xaudio2_7/Makefile.in --- wine1.7-1.7.50/dlls/xaudio2_7/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_7/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -1,7 +1,10 @@ MODULE = xaudio2_7.dll IMPORTS = advapi32 kernel32 ole32 user32 uuid +EXTRALIBS = $(OPENAL_LIBS) C_SRCS = \ + compat.c \ + xapofx.c \ xaudio_dll.c IDL_SRCS = xaudio_classes.idl diff -Nru wine1.7-1.7.50/dlls/xaudio2_7/tests/Makefile.in wine1.7-1.7.55/dlls/xaudio2_7/tests/Makefile.in --- wine1.7-1.7.50/dlls/xaudio2_7/tests/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_7/tests/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,5 @@ +TESTDLL = xaudio2_7.dll +IMPORTS = ole32 + +C_SRCS = \ + xaudio2.c diff -Nru wine1.7-1.7.50/dlls/xaudio2_7/tests/xaudio2.c wine1.7-1.7.55/dlls/xaudio2_7/tests/xaudio2.c --- wine1.7-1.7.50/dlls/xaudio2_7/tests/xaudio2.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_7/tests/xaudio2.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,1103 @@ +/* + * Copyright (c) 2015 Andrew Eikum 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 + +#define COBJMACROS +#include "wine/test.h" +#include "initguid.h" +#include "xaudio2.h" +#include "xaudio2fx.h" +#include "xapo.h" +#include "xapofx.h" +#include "mmsystem.h" + +static BOOL xaudio27; + +static HRESULT (WINAPI *pXAudio2Create)(IXAudio2 **, UINT32, XAUDIO2_PROCESSOR) = NULL; +static HRESULT (WINAPI *pCreateAudioVolumeMeter)(IUnknown**) = NULL; + +#define XA2CALL_0(method) if(xaudio27) hr = IXAudio27_##method((IXAudio27*)xa); else hr = IXAudio2_##method(xa); +#define XA2CALL_0V(method) if(xaudio27) IXAudio27_##method((IXAudio27*)xa); else IXAudio2_##method(xa); +#define XA2CALL_V(method, ...) if(xaudio27) IXAudio27_##method((IXAudio27*)xa, __VA_ARGS__); else IXAudio2_##method(xa, __VA_ARGS__); +#define XA2CALL(method, ...) if(xaudio27) hr = IXAudio27_##method((IXAudio27*)xa, __VA_ARGS__); else hr = IXAudio2_##method(xa, __VA_ARGS__); + +static void fill_buf(float *buf, WAVEFORMATEX *fmt, DWORD hz, DWORD len_frames) +{ + if(winetest_interactive){ + DWORD offs, c; + for(offs = 0; offs < len_frames; ++offs) + for(c = 0; c < fmt->nChannels; ++c) + buf[offs * fmt->nChannels + c] = sinf(offs * hz * 2 * M_PI / fmt->nSamplesPerSec); + }else + memset(buf, 0, sizeof(float) * len_frames * fmt->nChannels); +} + +static struct _cb_state { + BOOL start_called, end_called; +} ecb_state, src1_state, src2_state; + +static int pass_state = 0; +static BOOL buffers_called = FALSE; + +static void WINAPI ECB_OnProcessingPassStart(IXAudio2EngineCallback *This) +{ + ok(!xaudio27 || pass_state == 0, "Callbacks called out of order: %u\n", pass_state); + ++pass_state; +} + +static void WINAPI ECB_OnProcessingPassEnd(IXAudio2EngineCallback *This) +{ + ok(!xaudio27 || pass_state == (buffers_called ? 7 : 5), "Callbacks called out of order: %u\n", pass_state); + pass_state = 0; + buffers_called = FALSE; +} + +static void WINAPI ECB_OnCriticalError(IXAudio2EngineCallback *This, HRESULT Error) +{ + ok(0, "Unexpected OnCriticalError\n"); +} + +static const IXAudio2EngineCallbackVtbl ecb_vtbl = { + ECB_OnProcessingPassStart, + ECB_OnProcessingPassEnd, + ECB_OnCriticalError +}; + +static IXAudio2EngineCallback ecb = { &ecb_vtbl }; + +static IXAudio2VoiceCallback vcb1; +static IXAudio2VoiceCallback vcb2; + +static void WINAPI VCB_OnVoiceProcessingPassStart(IXAudio2VoiceCallback *This, + UINT32 BytesRequired) +{ + if(This == &vcb1){ + ok(!xaudio27 || pass_state == (buffers_called ? 4 : 3), "Callbacks called out of order: %u\n", pass_state); + ++pass_state; + }else{ + ok(!xaudio27 || pass_state == 1, "Callbacks called out of order: %u\n", pass_state); + ++pass_state; + } +} + +static void WINAPI VCB_OnVoiceProcessingPassEnd(IXAudio2VoiceCallback *This) +{ + if(This == &vcb1){ + ok(!xaudio27 || pass_state == (buffers_called ? 6 : 4), "Callbacks called out of order: %u\n", pass_state); + ++pass_state; + }else{ + ok(!xaudio27 || pass_state == (buffers_called ? 3 : 2), "Callbacks called out of order: %u\n", pass_state); + ++pass_state; + } +} + +static void WINAPI VCB_OnStreamEnd(IXAudio2VoiceCallback *This) +{ + ok(0, "Unexpected OnStreamEnd\n"); +} + +static void WINAPI VCB_OnBufferStart(IXAudio2VoiceCallback *This, + void *pBufferContext) +{ + if(This == &vcb1){ + ok(!xaudio27 || pass_state == 5, "Callbacks called out of order: %u\n", pass_state); + ++pass_state; + }else{ + ok(!xaudio27 || pass_state == 2, "Callbacks called out of order: %u\n", pass_state); + ++pass_state; + buffers_called = TRUE; + } +} + +static void WINAPI VCB_OnBufferEnd(IXAudio2VoiceCallback *This, + void *pBufferContext) +{ + if(This == &vcb1){ + ok(!xaudio27 || pass_state == 5, "Callbacks called out of order: %u\n", pass_state); + ++pass_state; + }else{ + ok(!xaudio27 || pass_state == 2, "Callbacks called out of order: %u\n", pass_state); + ++pass_state; + buffers_called = TRUE; + } +} + +static void WINAPI VCB_OnLoopEnd(IXAudio2VoiceCallback *This, + void *pBufferContext) +{ + ok(0, "Unexpected OnLoopEnd\n"); +} + +static void WINAPI VCB_OnVoiceError(IXAudio2VoiceCallback *This, + void *pBuffercontext, HRESULT Error) +{ + ok(0, "Unexpected OnVoiceError\n"); +} + +static const IXAudio2VoiceCallbackVtbl vcb_vtbl = { + VCB_OnVoiceProcessingPassStart, + VCB_OnVoiceProcessingPassEnd, + VCB_OnStreamEnd, + VCB_OnBufferStart, + VCB_OnBufferEnd, + VCB_OnLoopEnd, + VCB_OnVoiceError +}; + +static IXAudio2VoiceCallback vcb1 = { &vcb_vtbl }; +static IXAudio2VoiceCallback vcb2 = { &vcb_vtbl }; + +static void test_simple_streaming(IXAudio2 *xa) +{ + HRESULT hr; + IXAudio2MasteringVoice *master; + IXAudio2SourceVoice *src, *src2; + IUnknown *vumeter; + WAVEFORMATEX fmt; + XAUDIO2_BUFFER buf, buf2; + XAUDIO2_VOICE_STATE state; + XAUDIO2_EFFECT_DESCRIPTOR effect; + XAUDIO2_EFFECT_CHAIN chain; + DWORD chmask; + + memset(&ecb_state, 0, sizeof(ecb_state)); + memset(&src1_state, 0, sizeof(src1_state)); + memset(&src2_state, 0, sizeof(src2_state)); + + XA2CALL_0V(StopEngine); + + /* Tests show in native XA2.8, ECB is called from a mixer thread, but VCBs + * may be called from other threads in any order. So we can't rely on any + * sequencing between VCB calls. + * + * XA2.7 does all mixing from a single thread, so call sequence can be + * tested. */ + XA2CALL(RegisterForCallbacks, &ecb); + ok(hr == S_OK, "RegisterForCallbacks failed: %08x\n", hr); + + if(xaudio27) + hr = IXAudio27_CreateMasteringVoice((IXAudio27*)xa, &master, 2, 44100, 0, 0, NULL); + else + hr = IXAudio2_CreateMasteringVoice(xa, &master, 2, 44100, 0, NULL, NULL, AudioCategory_GameEffects); + ok(hr == S_OK, "CreateMasteringVoice failed: %08x\n", hr); + + if(!xaudio27){ + chmask = 0xdeadbeef; + IXAudio2MasteringVoice_GetChannelMask(master, &chmask); + ok(chmask == (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT), "Got unexpected channel mask: 0x%x\n", chmask); + } + + /* create first source voice */ + fmt.wFormatTag = WAVE_FORMAT_IEEE_FLOAT; + fmt.nChannels = 2; + fmt.nSamplesPerSec = 44100; + fmt.wBitsPerSample = 32; + fmt.nBlockAlign = fmt.nChannels * fmt.wBitsPerSample / 8; + fmt.nAvgBytesPerSec = fmt.nSamplesPerSec * fmt.nBlockAlign; + fmt.cbSize = 0; + + XA2CALL(CreateSourceVoice, &src, &fmt, 0, 1.f, &vcb1, NULL, NULL); + ok(hr == S_OK, "CreateSourceVoice failed: %08x\n", hr); + + memset(&buf, 0, sizeof(buf)); + buf.AudioBytes = 22050 * fmt.nBlockAlign; + buf.pAudioData = HeapAlloc(GetProcessHeap(), 0, buf.AudioBytes); + fill_buf((float*)buf.pAudioData, &fmt, 440, 22050); + + hr = IXAudio2SourceVoice_SubmitSourceBuffer(src, &buf, NULL); + ok(hr == S_OK, "SubmitSourceBuffer failed: %08x\n", hr); + + hr = IXAudio2SourceVoice_Start(src, 0, XAUDIO2_COMMIT_NOW); + ok(hr == S_OK, "Start failed: %08x\n", hr); + + /* create second source voice */ + XA2CALL(CreateSourceVoice, &src2, &fmt, 0, 1.f, &vcb2, NULL, NULL); + ok(hr == S_OK, "CreateSourceVoice failed: %08x\n", hr); + + memset(&buf2, 0, sizeof(buf2)); + buf2.AudioBytes = 22050 * fmt.nBlockAlign; + buf2.pAudioData = HeapAlloc(GetProcessHeap(), 0, buf2.AudioBytes); + fill_buf((float*)buf2.pAudioData, &fmt, 220, 22050); + + hr = IXAudio2SourceVoice_SubmitSourceBuffer(src2, &buf2, NULL); + ok(hr == S_OK, "SubmitSourceBuffer failed: %08x\n", hr); + + hr = IXAudio2SourceVoice_Start(src2, 0, XAUDIO2_COMMIT_NOW); + ok(hr == S_OK, "Start failed: %08x\n", hr); + + XA2CALL_0(StartEngine); + ok(hr == S_OK, "StartEngine failed: %08x\n", hr); + + /* hook up volume meter */ + if(xaudio27){ + IXAPO *xapo; + + hr = CoCreateInstance(&CLSID_AudioVolumeMeter, NULL, + CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)&vumeter); + ok(hr == S_OK, "CoCreateInstance(AudioVolumeMeter) failed: %08x\n", hr); + + hr = IUnknown_QueryInterface(vumeter, &IID_IXAPO27, (void**)&xapo); + ok(hr == S_OK, "Couldn't get IXAPO27 interface: %08x\n", hr); + if(SUCCEEDED(hr)) + IXAPO_Release(xapo); + }else{ + IXAPO *xapo; + + hr = pCreateAudioVolumeMeter(&vumeter); + ok(hr == S_OK, "CreateAudioVolumeMeter failed: %08x\n", hr); + + hr = IUnknown_QueryInterface(vumeter, &IID_IXAPO, (void**)&xapo); + ok(hr == S_OK, "Couldn't get IXAPO interface: %08x\n", hr); + if(SUCCEEDED(hr)) + IXAPO_Release(xapo); + } + + effect.InitialState = TRUE; + effect.OutputChannels = 2; + effect.pEffect = vumeter; + + chain.EffectCount = 1; + chain.pEffectDescriptors = &effect; + + hr = IXAudio2MasteringVoice_SetEffectChain(master, &chain); + ok(hr == S_OK, "SetEffectchain failed: %08x\n", hr); + + IUnknown_Release(vumeter); + + while(1){ + if(xaudio27) + IXAudio27SourceVoice_GetState((IXAudio27SourceVoice*)src, &state); + else + IXAudio2SourceVoice_GetState(src, &state, 0); + if(state.SamplesPlayed >= 22050) + break; + Sleep(100); + } + + ok(state.SamplesPlayed == 22050, "Got wrong samples played\n"); + + HeapFree(GetProcessHeap(), 0, (void*)buf.pAudioData); + HeapFree(GetProcessHeap(), 0, (void*)buf2.pAudioData); + + if(xaudio27){ + IXAudio27SourceVoice_DestroyVoice((IXAudio27SourceVoice*)src); + IXAudio27SourceVoice_DestroyVoice((IXAudio27SourceVoice*)src2); + }else{ + IXAudio2SourceVoice_DestroyVoice(src); + IXAudio2SourceVoice_DestroyVoice(src2); + } + IXAudio2MasteringVoice_DestroyVoice(master); + + XA2CALL_V(UnregisterForCallbacks, &ecb); +} + +static void WINAPI vcb_buf_OnVoiceProcessingPassStart(IXAudio2VoiceCallback *This, + UINT32 BytesRequired) +{ +} + +static void WINAPI vcb_buf_OnVoiceProcessingPassEnd(IXAudio2VoiceCallback *This) +{ +} + +static void WINAPI vcb_buf_OnStreamEnd(IXAudio2VoiceCallback *This) +{ + ok(0, "Unexpected OnStreamEnd\n"); +} + +struct vcb_buf_testdata { + int idx; + IXAudio2SourceVoice *src; +}; + +static int obs_calls = 0; +static int obe_calls = 0; + +static void WINAPI vcb_buf_OnBufferStart(IXAudio2VoiceCallback *This, + void *pBufferContext) +{ + struct vcb_buf_testdata *data = pBufferContext; + XAUDIO2_VOICE_STATE state; + + ok(data->idx == obs_calls, "Buffer callback out of order: %u\n", data->idx); + + if(xaudio27) + IXAudio27SourceVoice_GetState((IXAudio27SourceVoice*)data->src, &state); + else + IXAudio2SourceVoice_GetState(data->src, &state, 0); + + ok(state.BuffersQueued == 5 - obs_calls, "Got wrong number of buffers remaining: %u\n", state.BuffersQueued); + ok(state.pCurrentBufferContext == pBufferContext, "Got wrong buffer from GetState\n"); + + ++obs_calls; +} + +static void WINAPI vcb_buf_OnBufferEnd(IXAudio2VoiceCallback *This, + void *pBufferContext) +{ + struct vcb_buf_testdata *data = pBufferContext; + XAUDIO2_VOICE_STATE state; + + ok(data->idx == obe_calls, "Buffer callback out of order: %u\n", data->idx); + + if(xaudio27) + IXAudio27SourceVoice_GetState((IXAudio27SourceVoice*)data->src, &state); + else + IXAudio2SourceVoice_GetState(data->src, &state, 0); + + ok(state.BuffersQueued == 5 - obe_calls - 1, "Got wrong number of buffers remaining: %u\n", state.BuffersQueued); + if(state.BuffersQueued == 0) + ok(state.pCurrentBufferContext == NULL, "Got wrong buffer from GetState: %p\n", state.pCurrentBufferContext); + else + ok(state.pCurrentBufferContext == data + 1, "Got wrong buffer from GetState: %p\n", state.pCurrentBufferContext); + + ++obe_calls; +} + +static void WINAPI vcb_buf_OnLoopEnd(IXAudio2VoiceCallback *This, + void *pBufferContext) +{ + ok(0, "Unexpected OnLoopEnd\n"); +} + +static void WINAPI vcb_buf_OnVoiceError(IXAudio2VoiceCallback *This, + void *pBuffercontext, HRESULT Error) +{ + ok(0, "Unexpected OnVoiceError\n"); +} + +static const IXAudio2VoiceCallbackVtbl vcb_buf_vtbl = { + vcb_buf_OnVoiceProcessingPassStart, + vcb_buf_OnVoiceProcessingPassEnd, + vcb_buf_OnStreamEnd, + vcb_buf_OnBufferStart, + vcb_buf_OnBufferEnd, + vcb_buf_OnLoopEnd, + vcb_buf_OnVoiceError +}; + +static IXAudio2VoiceCallback vcb_buf = { &vcb_buf_vtbl }; + +static int nloopends = 0; +static int nstreamends = 0; + +static void WINAPI loop_buf_OnStreamEnd(IXAudio2VoiceCallback *This) +{ + ++nstreamends; +} + +static void WINAPI loop_buf_OnBufferStart(IXAudio2VoiceCallback *This, + void *pBufferContext) +{ +} + +static void WINAPI loop_buf_OnBufferEnd(IXAudio2VoiceCallback *This, + void *pBufferContext) +{ +} + +static void WINAPI loop_buf_OnLoopEnd(IXAudio2VoiceCallback *This, + void *pBufferContext) +{ + ++nloopends; +} + +static void WINAPI loop_buf_OnVoiceError(IXAudio2VoiceCallback *This, + void *pBuffercontext, HRESULT Error) +{ +} + +static const IXAudio2VoiceCallbackVtbl loop_buf_vtbl = { + vcb_buf_OnVoiceProcessingPassStart, + vcb_buf_OnVoiceProcessingPassEnd, + loop_buf_OnStreamEnd, + loop_buf_OnBufferStart, + loop_buf_OnBufferEnd, + loop_buf_OnLoopEnd, + loop_buf_OnVoiceError +}; + +static IXAudio2VoiceCallback loop_buf = { &loop_buf_vtbl }; + +static void test_buffer_callbacks(IXAudio2 *xa) +{ + HRESULT hr; + IXAudio2MasteringVoice *master; + IXAudio2SourceVoice *src; + WAVEFORMATEX fmt; + XAUDIO2_BUFFER buf; + XAUDIO2_VOICE_STATE state; + struct vcb_buf_testdata testdata[5]; + int i, timeout; + + obs_calls = 0; + obe_calls = 0; + + XA2CALL_0V(StopEngine); + + if(xaudio27) + hr = IXAudio27_CreateMasteringVoice((IXAudio27*)xa, &master, 2, 44100, 0, 0, NULL); + else + hr = IXAudio2_CreateMasteringVoice(xa, &master, 2, 44100, 0, NULL, NULL, AudioCategory_GameEffects); + ok(hr == S_OK, "CreateMasteringVoice failed: %08x\n", hr); + + /* test OnBufferStart/End callbacks */ + fmt.wFormatTag = WAVE_FORMAT_IEEE_FLOAT; + fmt.nChannels = 2; + fmt.nSamplesPerSec = 44100; + fmt.wBitsPerSample = 32; + fmt.nBlockAlign = fmt.nChannels * fmt.wBitsPerSample / 8; + fmt.nAvgBytesPerSec = fmt.nSamplesPerSec * fmt.nBlockAlign; + fmt.cbSize = 0; + + XA2CALL(CreateSourceVoice, &src, &fmt, 0, 1.f, &vcb_buf, NULL, NULL); + ok(hr == S_OK, "CreateSourceVoice failed: %08x\n", hr); + + memset(&buf, 0, sizeof(buf)); + buf.AudioBytes = 4410 * fmt.nBlockAlign; + buf.pAudioData = HeapAlloc(GetProcessHeap(), 0, buf.AudioBytes); + fill_buf((float*)buf.pAudioData, &fmt, 440, 4410); + + /* submit same buffer fragment 5 times */ + for(i = 0; i < 5; ++i){ + testdata[i].idx = i; + testdata[i].src = src; + buf.pContext = &testdata[i]; + + hr = IXAudio2SourceVoice_SubmitSourceBuffer(src, &buf, NULL); + ok(hr == S_OK, "SubmitSourceBuffer failed: %08x\n", hr); + } + + hr = IXAudio2SourceVoice_Start(src, 0, XAUDIO2_COMMIT_NOW); + ok(hr == S_OK, "Start failed: %08x\n", hr); + + + XA2CALL_0(StartEngine); + ok(hr == S_OK, "StartEngine failed: %08x\n", hr); + + if(xaudio27){ + hr = IXAudio27SourceVoice_SetSourceSampleRate((IXAudio27SourceVoice*)src, 48000); + todo_wine ok(hr == S_OK, "SetSourceSampleRate failed: %08x\n", hr); + }else{ + hr = IXAudio2SourceVoice_SetSourceSampleRate(src, 48000); + ok(hr == XAUDIO2_E_INVALID_CALL, "SetSourceSampleRate should have failed: %08x\n", hr); + } + + while(1){ + if(xaudio27) + IXAudio27SourceVoice_GetState((IXAudio27SourceVoice*)src, &state); + else + IXAudio2SourceVoice_GetState(src, &state, 0); + if(state.SamplesPlayed >= 4410 * 5) + break; + Sleep(100); + } + + ok(state.SamplesPlayed == 4410 * 5, "Got wrong samples played\n"); + + if(xaudio27) + IXAudio27SourceVoice_DestroyVoice((IXAudio27SourceVoice*)src); + else + IXAudio2SourceVoice_DestroyVoice(src); + + + /* test OnStreamEnd callback */ + XA2CALL(CreateSourceVoice, &src, &fmt, 0, 1.f, &loop_buf, NULL, NULL); + ok(hr == S_OK, "CreateSourceVoice failed: %08x\n", hr); + + buf.Flags = XAUDIO2_END_OF_STREAM; + + hr = IXAudio2SourceVoice_SubmitSourceBuffer(src, &buf, NULL); + ok(hr == S_OK, "SubmitSourceBuffer failed: %08x\n", hr); + + hr = IXAudio2SourceVoice_Start(src, 0, XAUDIO2_COMMIT_NOW); + ok(hr == S_OK, "Start failed: %08x\n", hr); + + timeout = 0; + while(nstreamends == 0 && timeout < 1000){ + Sleep(100); + timeout += 100; + } + + ok(nstreamends == 1, "Got wrong number of OnStreamEnd calls: %u\n", nstreamends); + + /* xaudio resets SamplesPlayed after processing an end-of-stream buffer */ + if(xaudio27) + IXAudio27SourceVoice_GetState((IXAudio27SourceVoice*)src, &state); + else + IXAudio2SourceVoice_GetState(src, &state, 0); + ok(state.SamplesPlayed == 0, "Got wrong samples played\n"); + + if(xaudio27) + IXAudio27SourceVoice_DestroyVoice((IXAudio27SourceVoice*)src); + else + IXAudio2SourceVoice_DestroyVoice(src); + + + IXAudio2MasteringVoice_DestroyVoice(master); + + HeapFree(GetProcessHeap(), 0, (void*)buf.pAudioData); +} + +static UINT32 play_to_completion(IXAudio2SourceVoice *src, UINT32 max_samples) +{ + XAUDIO2_VOICE_STATE state; + HRESULT hr; + + nloopends = 0; + + hr = IXAudio2SourceVoice_Start(src, 0, XAUDIO2_COMMIT_NOW); + ok(hr == S_OK, "Start failed: %08x\n", hr); + + while(1){ + if(xaudio27) + IXAudio27SourceVoice_GetState((IXAudio27SourceVoice*)src, &state); + else + IXAudio2SourceVoice_GetState(src, &state, 0); + if(state.BuffersQueued == 0) + break; + if(state.SamplesPlayed >= max_samples){ + if(xaudio27) + IXAudio27SourceVoice_ExitLoop((IXAudio27SourceVoice*)src, XAUDIO2_COMMIT_NOW); + else + IXAudio2SourceVoice_ExitLoop(src, XAUDIO2_COMMIT_NOW); + } + Sleep(100); + } + + hr = IXAudio2SourceVoice_Stop(src, 0, XAUDIO2_COMMIT_NOW); + ok(hr == S_OK, "Start failed: %08x\n", hr); + + return state.SamplesPlayed; +} + +static void test_looping(IXAudio2 *xa) +{ + HRESULT hr; + IXAudio2MasteringVoice *master; + IXAudio2SourceVoice *src; + WAVEFORMATEX fmt; + XAUDIO2_BUFFER buf; + UINT32 played, running_total = 0; + + XA2CALL_0V(StopEngine); + + if(xaudio27) + hr = IXAudio27_CreateMasteringVoice((IXAudio27*)xa, &master, 2, 44100, 0, 0, NULL); + else + hr = IXAudio2_CreateMasteringVoice(xa, &master, 2, 44100, 0, NULL, NULL, AudioCategory_GameEffects); + ok(hr == S_OK, "CreateMasteringVoice failed: %08x\n", hr); + + + fmt.wFormatTag = WAVE_FORMAT_IEEE_FLOAT; + fmt.nChannels = 2; + fmt.nSamplesPerSec = 44100; + fmt.wBitsPerSample = 32; + fmt.nBlockAlign = fmt.nChannels * fmt.wBitsPerSample / 8; + fmt.nAvgBytesPerSec = fmt.nSamplesPerSec * fmt.nBlockAlign; + fmt.cbSize = 0; + + XA2CALL(CreateSourceVoice, &src, &fmt, 0, 1.f, &loop_buf, NULL, NULL); + ok(hr == S_OK, "CreateSourceVoice failed: %08x\n", hr); + + memset(&buf, 0, sizeof(buf)); + + buf.AudioBytes = 44100 * fmt.nBlockAlign; + buf.pAudioData = HeapAlloc(GetProcessHeap(), 0, buf.AudioBytes); + fill_buf((float*)buf.pAudioData, &fmt, 440, 44100); + + XA2CALL_0(StartEngine); + ok(hr == S_OK, "StartEngine failed: %08x\n", hr); + + /* play from middle to end */ + buf.PlayBegin = 22050; + buf.PlayLength = 0; + buf.LoopBegin = 0; + buf.LoopLength = 0; + buf.LoopCount = 0; + + hr = IXAudio2SourceVoice_SubmitSourceBuffer(src, &buf, NULL); + ok(hr == S_OK, "SubmitSourceBuffer failed: %08x\n", hr); + + played = play_to_completion(src, -1); + ok(played - running_total == 22050, "Got wrong samples played: %u\n", played - running_total); + running_total = played; + ok(nloopends == 0, "Got wrong OnLoopEnd calls: %u\n", nloopends); + + /* play 4410 samples from middle */ + buf.PlayBegin = 22050; + buf.PlayLength = 4410; + buf.LoopBegin = 0; + buf.LoopLength = 0; + buf.LoopCount = 0; + + hr = IXAudio2SourceVoice_SubmitSourceBuffer(src, &buf, NULL); + ok(hr == S_OK, "SubmitSourceBuffer failed: %08x\n", hr); + + played = play_to_completion(src, -1); + ok(played - running_total == 4410, "Got wrong samples played: %u\n", played - running_total); + running_total = played; + ok(nloopends == 0, "Got wrong OnLoopEnd calls: %u\n", nloopends); + + /* loop 4410 samples in middle */ + buf.PlayBegin = 0; + buf.PlayLength = 0; + buf.LoopBegin = 22050; + buf.LoopLength = 4410; + buf.LoopCount = 1; + + hr = IXAudio2SourceVoice_SubmitSourceBuffer(src, &buf, NULL); + ok(hr == S_OK, "SubmitSourceBuffer failed: %08x\n", hr); + + played = play_to_completion(src, -1); + ok(played - running_total == 44100 + 4410, "Got wrong samples played: %u\n", played - running_total); + running_total = played; + ok(nloopends == 1, "Got wrong OnLoopEnd calls: %u\n", nloopends); + + /* play last half, then loop the whole buffer */ + buf.PlayBegin = 22050; + buf.PlayLength = 0; + buf.LoopBegin = 0; + buf.LoopLength = 0; + buf.LoopCount = 1; + + hr = IXAudio2SourceVoice_SubmitSourceBuffer(src, &buf, NULL); + ok(hr == S_OK, "SubmitSourceBuffer failed: %08x\n", hr); + + played = play_to_completion(src, -1); + ok(played - running_total == 22050 + 44100, "Got wrong samples played: %u\n", played - running_total); + running_total = played; + ok(nloopends == 1, "Got wrong OnLoopEnd calls: %u\n", nloopends); + + /* play short segment from middle, loop to the beginning, and end at PlayEnd */ + buf.PlayBegin = 22050; + buf.PlayLength = 4410; + buf.LoopBegin = 0; + buf.LoopLength = 0; + buf.LoopCount = 1; + + hr = IXAudio2SourceVoice_SubmitSourceBuffer(src, &buf, NULL); + ok(hr == S_OK, "SubmitSourceBuffer failed: %08x\n", hr); + + played = play_to_completion(src, -1); + ok(played - running_total == 4410 + (22050 + 4410), "Got wrong samples played: %u\n", played - running_total); + running_total = played; + ok(nloopends == 1, "Got wrong OnLoopEnd calls: %u\n", nloopends); + + /* invalid: LoopEnd must be <= PlayEnd + * xaudio27: play until LoopEnd, loop to beginning, play until PlayEnd */ + buf.PlayBegin = 22050; + buf.PlayLength = 4410; + buf.LoopBegin = 0; + buf.LoopLength = 22050 + 4410 * 2; + buf.LoopCount = 1; + + hr = IXAudio2SourceVoice_SubmitSourceBuffer(src, &buf, NULL); + if(xaudio27){ + ok(hr == S_OK, "SubmitSourceBuffer failed: %08x\n", hr); + + played = play_to_completion(src, -1); + ok(played - running_total == 4410 + (22050 + 4410 * 2), "Got wrong samples played: %u\n", played - running_total); + running_total = played; + ok(nloopends == 1, "Got wrong OnLoopEnd calls: %u\n", nloopends); + }else + ok(hr == XAUDIO2_E_INVALID_CALL, "SubmitSourceBuffer should have failed: %08x\n", hr); + + /* invalid: LoopEnd must be within play range + * xaudio27: plays only play range */ + buf.PlayBegin = 22050; + buf.PlayLength = 0; /* == until end of buffer */ + buf.LoopBegin = 0; + buf.LoopLength = 22050; + buf.LoopCount = 1; + + hr = IXAudio2SourceVoice_SubmitSourceBuffer(src, &buf, NULL); + if(xaudio27){ + ok(hr == S_OK, "SubmitSourceBuffer failed: %08x\n", hr); + + played = play_to_completion(src, -1); + ok(played - running_total == 22050, "Got wrong samples played: %u\n", played - running_total); + running_total = played; + ok(nloopends == 0, "Got wrong OnLoopEnd calls: %u\n", nloopends); + }else + ok(hr == XAUDIO2_E_INVALID_CALL, "SubmitSourceBuffer should have failed: %08x\n", hr); + + /* invalid: LoopBegin must be before PlayEnd + * xaudio27: crashes */ + if(!xaudio27){ + buf.PlayBegin = 0; + buf.PlayLength = 4410; + buf.LoopBegin = 22050; + buf.LoopLength = 4410; + buf.LoopCount = 1; + + hr = IXAudio2SourceVoice_SubmitSourceBuffer(src, &buf, NULL); + ok(hr == XAUDIO2_E_INVALID_CALL, "SubmitSourceBuffer should have failed: %08x\n", hr); + } + + /* infinite looping buffer */ + buf.PlayBegin = 22050; + buf.PlayLength = 0; + buf.LoopBegin = 0; + buf.LoopLength = 0; + buf.LoopCount = 255; + + hr = IXAudio2SourceVoice_SubmitSourceBuffer(src, &buf, NULL); + ok(hr == S_OK, "SubmitSourceBuffer failed: %08x\n", hr); + + played = play_to_completion(src, running_total + 88200); + ok(played - running_total == 22050 + 44100 * 2, "Got wrong samples played: %u\n", played - running_total); + ok(nloopends == (played - running_total) / 88200 + 1, "Got wrong OnLoopEnd calls: %u\n", nloopends); + running_total = played; + + if(xaudio27) + IXAudio27SourceVoice_DestroyVoice((IXAudio27SourceVoice*)src); + else + IXAudio2SourceVoice_DestroyVoice(src); + IXAudio2MasteringVoice_DestroyVoice(master); + HeapFree(GetProcessHeap(), 0, (void*)buf.pAudioData); +} + +static UINT32 test_DeviceDetails(IXAudio27 *xa) +{ + HRESULT hr; + XAUDIO2_DEVICE_DETAILS dd; + UINT32 count, i; + + hr = IXAudio27_GetDeviceCount(xa, &count); + ok(hr == S_OK, "GetDeviceCount failed: %08x\n", hr); + + if(count == 0) + return 0; + + for(i = 0; i < count; ++i){ + hr = IXAudio27_GetDeviceDetails(xa, i, &dd); + ok(hr == S_OK, "GetDeviceDetails failed: %08x\n", hr); + + if(i == 0) + ok(dd.Role == GlobalDefaultDevice, "Got wrong role for index 0: 0x%x\n", dd.Role); + else + ok(dd.Role == NotDefaultDevice, "Got wrong role for index %u: 0x%x\n", i, dd.Role); + } + + return count; +} + +static void test_xapo_creation_legacy(const char *module, unsigned int version) +{ + HANDLE xapofxdll; + HRESULT hr; + IUnknown *fx_unk; + unsigned int i; + + HRESULT (CDECL *pCreateFX)(REFCLSID,IUnknown**) = NULL; + + /* CLSIDs are the same across all versions */ + static struct { + const GUID *clsid; + BOOL todo; + } const_clsids[] = { + { &CLSID_FXEQ27, FALSE }, + { &CLSID_FXMasteringLimiter27, TRUE }, + { &CLSID_FXReverb27, FALSE }, + { &CLSID_FXEcho27, TRUE}, + /* older versions of xapofx actually have support for new clsids */ + { &CLSID_FXEQ, FALSE }, + { &CLSID_FXMasteringLimiter, TRUE }, + { &CLSID_FXReverb, FALSE }, + { &CLSID_FXEcho, TRUE} + }; + + /* different CLSID for each version */ + static const GUID *avm_clsids[] = { + &CLSID_AudioVolumeMeter20, + &CLSID_AudioVolumeMeter21, + &CLSID_AudioVolumeMeter22, + &CLSID_AudioVolumeMeter23, + &CLSID_AudioVolumeMeter24, + &CLSID_AudioVolumeMeter25, + &CLSID_AudioVolumeMeter26, + &CLSID_AudioVolumeMeter + }; + + static const GUID *ar_clsids[] = { + &CLSID_AudioReverb20, + &CLSID_AudioReverb21, + &CLSID_AudioReverb22, + &CLSID_AudioReverb23, + &CLSID_AudioReverb24, + &CLSID_AudioReverb25, + &CLSID_AudioReverb26, + &CLSID_AudioReverb + }; + + xapofxdll = LoadLibraryA(module); + if(xapofxdll){ + pCreateFX = (void*)GetProcAddress(xapofxdll, "CreateFX"); + ok(pCreateFX != NULL, "%s did not have CreateFX?\n", module); + if(!pCreateFX){ + FreeLibrary(xapofxdll); + return; + } + }else{ + win_skip("Couldn't load %s\n", module); + return; + } + + if(pCreateFX){ + for(i = 0; i < sizeof(const_clsids) / sizeof(*const_clsids); ++i){ + hr = pCreateFX(const_clsids[i].clsid, &fx_unk); + if(const_clsids[i].todo) + todo_wine ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(const_clsids[i].clsid), hr); + else + ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(const_clsids[i].clsid), hr); + if(SUCCEEDED(hr)){ + IXAPO *xapo; + hr = IUnknown_QueryInterface(fx_unk, &IID_IXAPO27, (void**)&xapo); + ok(hr == S_OK, "Couldn't get IXAPO27 interface: %08x\n", hr); + if(SUCCEEDED(hr)) + IXAPO_Release(xapo); + IUnknown_Release(fx_unk); + } + + hr = CoCreateInstance(const_clsids[i].clsid, NULL, CLSCTX_INPROC_SERVER, + &IID_IUnknown, (void**)&fx_unk); + ok(hr == REGDB_E_CLASSNOTREG, "CoCreateInstance should have failed: %08x\n", hr); + if(SUCCEEDED(hr)) + IUnknown_Release(fx_unk); + } + + hr = pCreateFX(avm_clsids[version - 20], &fx_unk); + ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(avm_clsids[version - 20]), hr); + if(SUCCEEDED(hr)){ + IXAPO *xapo; + hr = IUnknown_QueryInterface(fx_unk, &IID_IXAPO27, (void**)&xapo); + ok(hr == S_OK, "Couldn't get IXAPO27 interface: %08x\n", hr); + if(SUCCEEDED(hr)) + IXAPO_Release(xapo); + IUnknown_Release(fx_unk); + } + + hr = pCreateFX(ar_clsids[version - 20], &fx_unk); + ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(ar_clsids[version - 20]), hr); + if(SUCCEEDED(hr)){ + IXAPO *xapo; + hr = IUnknown_QueryInterface(fx_unk, &IID_IXAPO27, (void**)&xapo); + ok(hr == S_OK, "Couldn't get IXAPO27 interface: %08x\n", hr); + if(SUCCEEDED(hr)) + IXAPO_Release(xapo); + IUnknown_Release(fx_unk); + } + } + + FreeLibrary(xapofxdll); +} + +static void test_xapo_creation_modern(const char *module) +{ + HANDLE xaudio2dll; + HRESULT hr; + IUnknown *fx_unk; + unsigned int i; + + HRESULT (CDECL *pCreateFX)(REFCLSID,IUnknown**,void*,UINT32) = NULL; + HRESULT (WINAPI *pCAVM)(IUnknown**) = NULL; + HRESULT (WINAPI *pCAR)(IUnknown**) = NULL; + + /* CLSIDs are the same across all versions */ + static struct { + const GUID *clsid; + BOOL todo; + } const_clsids[] = { + { &CLSID_FXEQ27, FALSE }, + { &CLSID_FXMasteringLimiter27, TRUE }, + { &CLSID_FXReverb27, FALSE }, + { &CLSID_FXEcho27, TRUE}, + { &CLSID_FXEQ, FALSE }, + { &CLSID_FXMasteringLimiter, TRUE }, + { &CLSID_FXReverb, FALSE }, + { &CLSID_FXEcho, TRUE} + }; + + xaudio2dll = LoadLibraryA(module); + if(xaudio2dll){ + pCreateFX = (void*)GetProcAddress(xaudio2dll, "CreateFX"); + ok(pCreateFX != NULL, "%s did not have CreateFX?\n", module); + if(!pCreateFX){ + FreeLibrary(xaudio2dll); + return; + } + }else{ + win_skip("Couldn't load %s\n", module); + return; + } + + if(pCreateFX){ + for(i = 0; i < sizeof(const_clsids) / sizeof(*const_clsids); ++i){ + hr = pCreateFX(const_clsids[i].clsid, &fx_unk, NULL, 0); + if(const_clsids[i].todo) + todo_wine ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(const_clsids[i].clsid), hr); + else + ok(hr == S_OK, "%s: CreateFX(%s) failed: %08x\n", module, wine_dbgstr_guid(const_clsids[i].clsid), hr); + if(SUCCEEDED(hr)){ + IXAPO *xapo; + hr = IUnknown_QueryInterface(fx_unk, &IID_IXAPO, (void**)&xapo); + ok(hr == S_OK, "Couldn't get IXAPO interface: %08x\n", hr); + if(SUCCEEDED(hr)) + IXAPO_Release(xapo); + IUnknown_Release(fx_unk); + } + + hr = CoCreateInstance(const_clsids[i].clsid, NULL, CLSCTX_INPROC_SERVER, + &IID_IUnknown, (void**)&fx_unk); + ok(hr == REGDB_E_CLASSNOTREG, "CoCreateInstance should have failed: %08x\n", hr); + if(SUCCEEDED(hr)) + IUnknown_Release(fx_unk); + } + + /* test legacy CLSID */ + hr = pCreateFX(&CLSID_AudioVolumeMeter, &fx_unk, NULL, 0); + ok(hr == S_OK, "%s: CreateFX(CLSID_AudioVolumeMeter) failed: %08x\n", module, hr); + if(SUCCEEDED(hr)){ + IXAPO *xapo; + hr = IUnknown_QueryInterface(fx_unk, &IID_IXAPO, (void**)&xapo); + ok(hr == S_OK, "Couldn't get IXAPO interface: %08x\n", hr); + if(SUCCEEDED(hr)) + IXAPO_Release(xapo); + IUnknown_Release(fx_unk); + } + } + + pCAVM = (void*)GetProcAddress(xaudio2dll, "CreateAudioVolumeMeter"); + ok(pCAVM != NULL, "%s did not have CreateAudioVolumeMeter?\n", module); + + hr = pCAVM(&fx_unk); + ok(hr == S_OK, "CreateAudioVolumeMeter failed: %08x\n", hr); + if(SUCCEEDED(hr)){ + IXAPO *xapo; + hr = IUnknown_QueryInterface(fx_unk, &IID_IXAPO, (void**)&xapo); + ok(hr == S_OK, "Couldn't get IXAPO interface: %08x\n", hr); + if(SUCCEEDED(hr)) + IXAPO_Release(xapo); + IUnknown_Release(fx_unk); + } + + pCAR = (void*)GetProcAddress(xaudio2dll, "CreateAudioReverb"); + ok(pCAR != NULL, "%s did not have CreateAudioReverb?\n", module); + + hr = pCAR(&fx_unk); + ok(hr == S_OK, "CreateAudioReverb failed: %08x\n", hr); + if(SUCCEEDED(hr)){ + IXAPO *xapo; + hr = IUnknown_QueryInterface(fx_unk, &IID_IXAPO, (void**)&xapo); + ok(hr == S_OK, "Couldn't get IXAPO interface: %08x\n", hr); + if(SUCCEEDED(hr)) + IXAPO_Release(xapo); + IUnknown_Release(fx_unk); + } + + FreeLibrary(xaudio2dll); +} + +static void test_xapo_creation(void) +{ + test_xapo_creation_legacy("xapofx1_1.dll", 22); + test_xapo_creation_legacy("xapofx1_2.dll", 23); + test_xapo_creation_legacy("xapofx1_3.dll", 24); + test_xapo_creation_legacy("xapofx1_3.dll", 25); + test_xapo_creation_legacy("xapofx1_4.dll", 26); + test_xapo_creation_legacy("xapofx1_5.dll", 27); + test_xapo_creation_modern("xaudio2_8.dll"); +} + +static UINT32 check_has_devices(IXAudio2 *xa) +{ + HRESULT hr; + IXAudio2MasteringVoice *master; + + hr = IXAudio2_CreateMasteringVoice(xa, &master, 2, 44100, 0, NULL, NULL, AudioCategory_GameEffects); + if(hr != S_OK) + return 0; + + IXAudio2MasteringVoice_DestroyVoice(master); + + return 1; +} + +START_TEST(xaudio2) +{ + HRESULT hr; + IXAudio27 *xa27 = NULL; + IXAudio2 *xa = NULL; + HANDLE xa28dll; + UINT32 has_devices; + + CoInitialize(NULL); + + xa28dll = LoadLibraryA("xaudio2_8.dll"); + if(xa28dll){ + pXAudio2Create = (void*)GetProcAddress(xa28dll, "XAudio2Create"); + pCreateAudioVolumeMeter = (void*)GetProcAddress(xa28dll, "CreateAudioVolumeMeter"); + } + + test_xapo_creation(); + + /* XAudio 2.7 (Jun 2010 DirectX) */ + hr = CoCreateInstance(&CLSID_XAudio2, NULL, CLSCTX_INPROC_SERVER, + &IID_IXAudio27, (void**)&xa27); + if(hr == S_OK){ + xaudio27 = TRUE; + + hr = IXAudio27_Initialize(xa27, 0, XAUDIO2_ANY_PROCESSOR); + ok(hr == S_OK, "Initialize failed: %08x\n", hr); + + has_devices = test_DeviceDetails(xa27); + if(has_devices){ + test_simple_streaming((IXAudio2*)xa27); + test_buffer_callbacks((IXAudio2*)xa27); + test_looping((IXAudio2*)xa27); + }else + skip("No audio devices available\n"); + + IXAudio27_Release(xa27); + }else + win_skip("XAudio 2.7 not available\n"); + + /* XAudio 2.8 (Win8+) */ + if(pXAudio2Create){ + xaudio27 = FALSE; + + hr = pXAudio2Create(&xa, 0, XAUDIO2_DEFAULT_PROCESSOR); + ok(hr == S_OK, "XAudio2Create failed: %08x\n", hr); + + has_devices = check_has_devices(xa); + if(has_devices){ + test_simple_streaming(xa); + test_buffer_callbacks(xa); + test_looping(xa); + }else + skip("No audio devices available\n"); + + IXAudio2_Release(xa); + }else + win_skip("XAudio 2.8 not available\n"); + + CoUninitialize(); +} diff -Nru wine1.7-1.7.50/dlls/xaudio2_7/xapofx.c wine1.7-1.7.55/dlls/xaudio2_7/xapofx.c --- wine1.7-1.7.50/dlls/xaudio2_7/xapofx.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_7/xapofx.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,779 @@ +/* + * Copyright (c) 2015 Andrew Eikum for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" + +#include + +#define NONAMELESSUNION +#define COBJMACROS + +#include "xaudio_private.h" +#include "xapofx.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(xaudio2); + +typedef struct _VUMeterImpl { + IXAPO IXAPO_iface; + IXAPOParameters IXAPOParameters_iface; + + LONG ref; + + DWORD version; +} VUMeterImpl; + +static VUMeterImpl *VUMeterImpl_from_IXAPO(IXAPO *iface) +{ + return CONTAINING_RECORD(iface, VUMeterImpl, IXAPO_iface); +} + +static VUMeterImpl *VUMeterImpl_from_IXAPOParameters(IXAPOParameters *iface) +{ + return CONTAINING_RECORD(iface, VUMeterImpl, IXAPOParameters_iface); +} + +static HRESULT WINAPI VUMXAPO_QueryInterface(IXAPO *iface, REFIID riid, + void **ppvObject) +{ + VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface); + + TRACE("%p, %s, %p\n", This, wine_dbgstr_guid(riid), ppvObject); + + if(IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IXAPO) || + IsEqualGUID(riid, &IID_IXAPO27)) + *ppvObject = &This->IXAPO_iface; + else if(IsEqualGUID(riid, &IID_IXAPOParameters)) + *ppvObject = &This->IXAPOParameters_iface; + else + *ppvObject = NULL; + + if(*ppvObject){ + IUnknown_AddRef((IUnknown*)*ppvObject); + return S_OK; + } + + return E_NOINTERFACE; +} + +static ULONG WINAPI VUMXAPO_AddRef(IXAPO *iface) +{ + VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface); + ULONG ref = InterlockedIncrement(&This->ref); + TRACE("(%p)->(): Refcount now %u\n", This, ref); + return ref; +} + +static ULONG WINAPI VUMXAPO_Release(IXAPO *iface) +{ + VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p)->(): Refcount now %u\n", This, ref); + + if(!ref) + HeapFree(GetProcessHeap(), 0, This); + + return ref; +} + +static HRESULT WINAPI VUMXAPO_GetRegistrationProperties(IXAPO *iface, + XAPO_REGISTRATION_PROPERTIES **props) +{ + VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface); + TRACE("%p, %p\n", This, props); + /* TODO: check for version == 20 and use XAPO20_REGISTRATION_PROPERTIES */ + return E_NOTIMPL; +} + +static HRESULT WINAPI VUMXAPO_IsInputFormatSupported(IXAPO *iface, + const WAVEFORMATEX *output_fmt, const WAVEFORMATEX *input_fmt, + WAVEFORMATEX **supported_fmt) +{ + VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface); + TRACE("%p, %p, %p, %p\n", This, output_fmt, input_fmt, supported_fmt); + return E_NOTIMPL; +} + +static HRESULT WINAPI VUMXAPO_IsOutputFormatSupported(IXAPO *iface, + const WAVEFORMATEX *input_fmt, const WAVEFORMATEX *output_fmt, + WAVEFORMATEX **supported_fmt) +{ + VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface); + TRACE("%p, %p, %p, %p\n", This, input_fmt, output_fmt, supported_fmt); + return E_NOTIMPL; +} + +static HRESULT WINAPI VUMXAPO_Initialize(IXAPO *iface, const void *data, + UINT32 data_len) +{ + VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface); + TRACE("%p, %p, %u\n", This, data, data_len); + return E_NOTIMPL; +} + +static HRESULT WINAPI VUMXAPO_Reset(IXAPO *iface) +{ + VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface); + TRACE("%p\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI VUMXAPO_LockForProcess(IXAPO *iface, + UINT32 in_params_count, + const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *in_params, + UINT32 out_params_count, + const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *out_params) +{ + VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface); + TRACE("%p, %u, %p, %u, %p\n", This, in_params_count, in_params, + out_params_count, out_params); + return E_NOTIMPL; +} + +static void WINAPI VUMXAPO_UnlockForProcess(IXAPO *iface) +{ + VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface); + TRACE("%p\n", This); +} + +static void WINAPI VUMXAPO_Process(IXAPO *iface, UINT32 in_params_count, + const XAPO_PROCESS_BUFFER_PARAMETERS *in_params, + UINT32 out_params_count, + const XAPO_PROCESS_BUFFER_PARAMETERS *out_params, BOOL enabled) +{ + VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface); + TRACE("%p, %u, %p, %u, %p, %u\n", This, in_params_count, in_params, + out_params_count, out_params, enabled); +} + +static UINT32 WINAPI VUMXAPO_CalcInputFrames(IXAPO *iface, UINT32 output_frames) +{ + VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface); + TRACE("%p, %u\n", This, output_frames); + return 0; +} + +static UINT32 WINAPI VUMXAPO_CalcOutputFrames(IXAPO *iface, UINT32 input_frames) +{ + VUMeterImpl *This = VUMeterImpl_from_IXAPO(iface); + TRACE("%p, %u\n", This, input_frames); + return 0; +} + +static const IXAPOVtbl VUMXAPO_Vtbl = { + VUMXAPO_QueryInterface, + VUMXAPO_AddRef, + VUMXAPO_Release, + VUMXAPO_GetRegistrationProperties, + VUMXAPO_IsInputFormatSupported, + VUMXAPO_IsOutputFormatSupported, + VUMXAPO_Initialize, + VUMXAPO_Reset, + VUMXAPO_LockForProcess, + VUMXAPO_UnlockForProcess, + VUMXAPO_Process, + VUMXAPO_CalcInputFrames, + VUMXAPO_CalcOutputFrames +}; + +static HRESULT WINAPI VUMXAPOParams_QueryInterface(IXAPOParameters *iface, + REFIID riid, void **ppvObject) +{ + VUMeterImpl *This = VUMeterImpl_from_IXAPOParameters(iface); + return VUMXAPO_QueryInterface(&This->IXAPO_iface, riid, ppvObject); +} + +static ULONG WINAPI VUMXAPOParams_AddRef(IXAPOParameters *iface) +{ + VUMeterImpl *This = VUMeterImpl_from_IXAPOParameters(iface); + return VUMXAPO_AddRef(&This->IXAPO_iface); +} + +static ULONG WINAPI VUMXAPOParams_Release(IXAPOParameters *iface) +{ + VUMeterImpl *This = VUMeterImpl_from_IXAPOParameters(iface); + return VUMXAPO_Release(&This->IXAPO_iface); +} + +static void WINAPI VUMXAPOParams_SetParameters(IXAPOParameters *iface, + const void *params, UINT32 params_len) +{ + VUMeterImpl *This = VUMeterImpl_from_IXAPOParameters(iface); + TRACE("%p, %p, %u\n", This, params, params_len); +} + +static void WINAPI VUMXAPOParams_GetParameters(IXAPOParameters *iface, + void *params, UINT32 params_len) +{ + VUMeterImpl *This = VUMeterImpl_from_IXAPOParameters(iface); + TRACE("%p, %p, %u\n", This, params, params_len); +} + +static const IXAPOParametersVtbl VUMXAPOParameters_Vtbl = { + VUMXAPOParams_QueryInterface, + VUMXAPOParams_AddRef, + VUMXAPOParams_Release, + VUMXAPOParams_SetParameters, + VUMXAPOParams_GetParameters +}; + +typedef struct _ReverbImpl { + IXAPO IXAPO_iface; + IXAPOParameters IXAPOParameters_iface; + + LONG ref; + + DWORD version; +} ReverbImpl; + +static ReverbImpl *ReverbImpl_from_IXAPO(IXAPO *iface) +{ + return CONTAINING_RECORD(iface, ReverbImpl, IXAPO_iface); +} + +static ReverbImpl *ReverbImpl_from_IXAPOParameters(IXAPOParameters *iface) +{ + return CONTAINING_RECORD(iface, ReverbImpl, IXAPOParameters_iface); +} + +static HRESULT WINAPI RVBXAPO_QueryInterface(IXAPO *iface, REFIID riid, void **ppvObject) +{ + ReverbImpl *This = ReverbImpl_from_IXAPO(iface); + + TRACE("%p, %s, %p\n", This, wine_dbgstr_guid(riid), ppvObject); + + if(IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IXAPO) || + IsEqualGUID(riid, &IID_IXAPO27)) + *ppvObject = &This->IXAPO_iface; + else if(IsEqualGUID(riid, &IID_IXAPOParameters)) + *ppvObject = &This->IXAPOParameters_iface; + else + *ppvObject = NULL; + + if(*ppvObject){ + IUnknown_AddRef((IUnknown*)*ppvObject); + return S_OK; + } + + return E_NOINTERFACE; +} + +static ULONG WINAPI RVBXAPO_AddRef(IXAPO *iface) +{ + ReverbImpl *This = ReverbImpl_from_IXAPO(iface); + ULONG ref = InterlockedIncrement(&This->ref); + TRACE("(%p)->(): Refcount now %u\n", This, ref); + return ref; +} + +static ULONG WINAPI RVBXAPO_Release(IXAPO *iface) +{ + ReverbImpl *This = ReverbImpl_from_IXAPO(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p)->(): Refcount now %u\n", This, ref); + + if(!ref) + HeapFree(GetProcessHeap(), 0, This); + + return ref; +} + +static HRESULT WINAPI RVBXAPO_GetRegistrationProperties(IXAPO *iface, + XAPO_REGISTRATION_PROPERTIES **props) +{ + ReverbImpl *This = ReverbImpl_from_IXAPO(iface); + TRACE("%p, %p\n", This, props); + /* TODO: check for version == 20 and use XAPO20_REGISTRATION_PROPERTIES */ + return E_NOTIMPL; +} + +static HRESULT WINAPI RVBXAPO_IsInputFormatSupported(IXAPO *iface, + const WAVEFORMATEX *output_fmt, const WAVEFORMATEX *input_fmt, + WAVEFORMATEX **supported_fmt) +{ + ReverbImpl *This = ReverbImpl_from_IXAPO(iface); + TRACE("%p, %p, %p, %p\n", This, output_fmt, input_fmt, supported_fmt); + return E_NOTIMPL; +} + +static HRESULT WINAPI RVBXAPO_IsOutputFormatSupported(IXAPO *iface, + const WAVEFORMATEX *input_fmt, const WAVEFORMATEX *output_fmt, + WAVEFORMATEX **supported_fmt) +{ + ReverbImpl *This = ReverbImpl_from_IXAPO(iface); + TRACE("%p, %p, %p, %p\n", This, input_fmt, output_fmt, supported_fmt); + return E_NOTIMPL; +} + +static HRESULT WINAPI RVBXAPO_Initialize(IXAPO *iface, const void *data, + UINT32 data_len) +{ + ReverbImpl *This = ReverbImpl_from_IXAPO(iface); + TRACE("%p, %p, %u\n", This, data, data_len); + return E_NOTIMPL; +} + +static HRESULT WINAPI RVBXAPO_Reset(IXAPO *iface) +{ + ReverbImpl *This = ReverbImpl_from_IXAPO(iface); + TRACE("%p\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI RVBXAPO_LockForProcess(IXAPO *iface, UINT32 in_params_count, + const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *in_params, + UINT32 out_params_count, + const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *out_params) +{ + ReverbImpl *This = ReverbImpl_from_IXAPO(iface); + TRACE("%p, %u, %p, %u, %p\n", This, in_params_count, in_params, + out_params_count, out_params); + return E_NOTIMPL; +} + +static void WINAPI RVBXAPO_UnlockForProcess(IXAPO *iface) +{ + ReverbImpl *This = ReverbImpl_from_IXAPO(iface); + TRACE("%p\n", This); +} + +static void WINAPI RVBXAPO_Process(IXAPO *iface, UINT32 in_params_count, + const XAPO_PROCESS_BUFFER_PARAMETERS *in_params, + UINT32 out_params_count, + const XAPO_PROCESS_BUFFER_PARAMETERS *out_params, BOOL enabled) +{ + ReverbImpl *This = ReverbImpl_from_IXAPO(iface); + TRACE("%p, %u, %p, %u, %p, %u\n", This, in_params_count, in_params, + out_params_count, out_params, enabled); +} + +static UINT32 WINAPI RVBXAPO_CalcInputFrames(IXAPO *iface, UINT32 output_frames) +{ + ReverbImpl *This = ReverbImpl_from_IXAPO(iface); + TRACE("%p, %u\n", This, output_frames); + return 0; +} + +static UINT32 WINAPI RVBXAPO_CalcOutputFrames(IXAPO *iface, UINT32 input_frames) +{ + ReverbImpl *This = ReverbImpl_from_IXAPO(iface); + TRACE("%p, %u\n", This, input_frames); + return 0; +} + +static const IXAPOVtbl RVBXAPO_Vtbl = { + RVBXAPO_QueryInterface, + RVBXAPO_AddRef, + RVBXAPO_Release, + RVBXAPO_GetRegistrationProperties, + RVBXAPO_IsInputFormatSupported, + RVBXAPO_IsOutputFormatSupported, + RVBXAPO_Initialize, + RVBXAPO_Reset, + RVBXAPO_LockForProcess, + RVBXAPO_UnlockForProcess, + RVBXAPO_Process, + RVBXAPO_CalcInputFrames, + RVBXAPO_CalcOutputFrames +}; + +static HRESULT WINAPI RVBXAPOParams_QueryInterface(IXAPOParameters *iface, + REFIID riid, void **ppvObject) +{ + ReverbImpl *This = ReverbImpl_from_IXAPOParameters(iface); + return RVBXAPO_QueryInterface(&This->IXAPO_iface, riid, ppvObject); +} + +static ULONG WINAPI RVBXAPOParams_AddRef(IXAPOParameters *iface) +{ + ReverbImpl *This = ReverbImpl_from_IXAPOParameters(iface); + return RVBXAPO_AddRef(&This->IXAPO_iface); +} + +static ULONG WINAPI RVBXAPOParams_Release(IXAPOParameters *iface) +{ + ReverbImpl *This = ReverbImpl_from_IXAPOParameters(iface); + return RVBXAPO_Release(&This->IXAPO_iface); +} + +static void WINAPI RVBXAPOParams_SetParameters(IXAPOParameters *iface, + const void *params, UINT32 params_len) +{ + ReverbImpl *This = ReverbImpl_from_IXAPOParameters(iface); + TRACE("%p, %p, %u\n", This, params, params_len); +} + +static void WINAPI RVBXAPOParams_GetParameters(IXAPOParameters *iface, void *params, + UINT32 params_len) +{ + ReverbImpl *This = ReverbImpl_from_IXAPOParameters(iface); + TRACE("%p, %p, %u\n", This, params, params_len); +} + +static const IXAPOParametersVtbl RVBXAPOParameters_Vtbl = { + RVBXAPOParams_QueryInterface, + RVBXAPOParams_AddRef, + RVBXAPOParams_Release, + RVBXAPOParams_SetParameters, + RVBXAPOParams_GetParameters +}; + +typedef struct _EQImpl { + IXAPO IXAPO_iface; + IXAPOParameters IXAPOParameters_iface; + + LONG ref; + + DWORD version; +} EQImpl; + +static EQImpl *EQImpl_from_IXAPO(IXAPO *iface) +{ + return CONTAINING_RECORD(iface, EQImpl, IXAPO_iface); +} + +static EQImpl *EQImpl_from_IXAPOParameters(IXAPOParameters *iface) +{ + return CONTAINING_RECORD(iface, EQImpl, IXAPOParameters_iface); +} + +static HRESULT WINAPI EQXAPO_QueryInterface(IXAPO *iface, REFIID riid, void **ppvObject) +{ + EQImpl *This = EQImpl_from_IXAPO(iface); + + TRACE("%p, %s, %p\n", This, wine_dbgstr_guid(riid), ppvObject); + + if(IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IXAPO) || + IsEqualGUID(riid, &IID_IXAPO27)) + *ppvObject = &This->IXAPO_iface; + else if(IsEqualGUID(riid, &IID_IXAPOParameters)) + *ppvObject = &This->IXAPOParameters_iface; + else + *ppvObject = NULL; + + if(*ppvObject){ + IUnknown_AddRef((IUnknown*)*ppvObject); + return S_OK; + } + + return E_NOINTERFACE; +} + +static ULONG WINAPI EQXAPO_AddRef(IXAPO *iface) +{ + EQImpl *This = EQImpl_from_IXAPO(iface); + ULONG ref = InterlockedIncrement(&This->ref); + TRACE("(%p)->(): Refcount now %u\n", This, ref); + return ref; +} + +static ULONG WINAPI EQXAPO_Release(IXAPO *iface) +{ + EQImpl *This = EQImpl_from_IXAPO(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p)->(): Refcount now %u\n", This, ref); + + if(!ref) + HeapFree(GetProcessHeap(), 0, This); + + return ref; +} + +static HRESULT WINAPI EQXAPO_GetRegistrationProperties(IXAPO *iface, + XAPO_REGISTRATION_PROPERTIES **props) +{ + EQImpl *This = EQImpl_from_IXAPO(iface); + TRACE("%p, %p\n", This, props); + /* TODO: check for version == 20 and use XAPO20_REGISTRATION_PROPERTIES */ + return E_NOTIMPL; +} + +static HRESULT WINAPI EQXAPO_IsInputFormatSupported(IXAPO *iface, + const WAVEFORMATEX *output_fmt, const WAVEFORMATEX *input_fmt, + WAVEFORMATEX **supported_fmt) +{ + EQImpl *This = EQImpl_from_IXAPO(iface); + TRACE("%p, %p, %p, %p\n", This, output_fmt, input_fmt, supported_fmt); + return E_NOTIMPL; +} + +static HRESULT WINAPI EQXAPO_IsOutputFormatSupported(IXAPO *iface, + const WAVEFORMATEX *input_fmt, const WAVEFORMATEX *output_fmt, + WAVEFORMATEX **supported_fmt) +{ + EQImpl *This = EQImpl_from_IXAPO(iface); + TRACE("%p, %p, %p, %p\n", This, input_fmt, output_fmt, supported_fmt); + return E_NOTIMPL; +} + +static HRESULT WINAPI EQXAPO_Initialize(IXAPO *iface, const void *data, + UINT32 data_len) +{ + EQImpl *This = EQImpl_from_IXAPO(iface); + TRACE("%p, %p, %u\n", This, data, data_len); + return E_NOTIMPL; +} + +static HRESULT WINAPI EQXAPO_Reset(IXAPO *iface) +{ + EQImpl *This = EQImpl_from_IXAPO(iface); + TRACE("%p\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI EQXAPO_LockForProcess(IXAPO *iface, UINT32 in_params_count, + const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *in_params, + UINT32 out_params_count, + const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *out_params) +{ + EQImpl *This = EQImpl_from_IXAPO(iface); + TRACE("%p, %u, %p, %u, %p\n", This, in_params_count, in_params, + out_params_count, out_params); + return E_NOTIMPL; +} + +static void WINAPI EQXAPO_UnlockForProcess(IXAPO *iface) +{ + EQImpl *This = EQImpl_from_IXAPO(iface); + TRACE("%p\n", This); +} + +static void WINAPI EQXAPO_Process(IXAPO *iface, UINT32 in_params_count, + const XAPO_PROCESS_BUFFER_PARAMETERS *in_params, + UINT32 out_params_count, + const XAPO_PROCESS_BUFFER_PARAMETERS *out_params, BOOL enabled) +{ + EQImpl *This = EQImpl_from_IXAPO(iface); + TRACE("%p, %u, %p, %u, %p, %u\n", This, in_params_count, in_params, + out_params_count, out_params, enabled); +} + +static UINT32 WINAPI EQXAPO_CalcInputFrames(IXAPO *iface, UINT32 output_frames) +{ + EQImpl *This = EQImpl_from_IXAPO(iface); + TRACE("%p, %u\n", This, output_frames); + return 0; +} + +static UINT32 WINAPI EQXAPO_CalcOutputFrames(IXAPO *iface, UINT32 input_frames) +{ + EQImpl *This = EQImpl_from_IXAPO(iface); + TRACE("%p, %u\n", This, input_frames); + return 0; +} + +static const IXAPOVtbl EQXAPO_Vtbl = { + EQXAPO_QueryInterface, + EQXAPO_AddRef, + EQXAPO_Release, + EQXAPO_GetRegistrationProperties, + EQXAPO_IsInputFormatSupported, + EQXAPO_IsOutputFormatSupported, + EQXAPO_Initialize, + EQXAPO_Reset, + EQXAPO_LockForProcess, + EQXAPO_UnlockForProcess, + EQXAPO_Process, + EQXAPO_CalcInputFrames, + EQXAPO_CalcOutputFrames +}; + +static HRESULT WINAPI EQXAPOParams_QueryInterface(IXAPOParameters *iface, + REFIID riid, void **ppvObject) +{ + EQImpl *This = EQImpl_from_IXAPOParameters(iface); + return EQXAPO_QueryInterface(&This->IXAPO_iface, riid, ppvObject); +} + +static ULONG WINAPI EQXAPOParams_AddRef(IXAPOParameters *iface) +{ + EQImpl *This = EQImpl_from_IXAPOParameters(iface); + return EQXAPO_AddRef(&This->IXAPO_iface); +} + +static ULONG WINAPI EQXAPOParams_Release(IXAPOParameters *iface) +{ + EQImpl *This = EQImpl_from_IXAPOParameters(iface); + return EQXAPO_Release(&This->IXAPO_iface); +} + +static void WINAPI EQXAPOParams_SetParameters(IXAPOParameters *iface, + const void *params, UINT32 params_len) +{ + EQImpl *This = EQImpl_from_IXAPOParameters(iface); + TRACE("%p, %p, %u\n", This, params, params_len); +} + +static void WINAPI EQXAPOParams_GetParameters(IXAPOParameters *iface, void *params, + UINT32 params_len) +{ + EQImpl *This = EQImpl_from_IXAPOParameters(iface); + TRACE("%p, %p, %u\n", This, params, params_len); +} + +static const IXAPOParametersVtbl EQXAPOParameters_Vtbl = { + EQXAPOParams_QueryInterface, + EQXAPOParams_AddRef, + EQXAPOParams_Release, + EQXAPOParams_SetParameters, + EQXAPOParams_GetParameters +}; + +struct xapo_cf { + IClassFactory IClassFactory_iface; + LONG ref; + DWORD version; + const CLSID *class; +}; + +struct xapo_cf *xapo_impl_from_IClassFactory(IClassFactory *iface) +{ + return CONTAINING_RECORD(iface, struct xapo_cf, IClassFactory_iface); +} + +static HRESULT WINAPI xapocf_QueryInterface(IClassFactory *iface, REFIID riid, void **ppobj) +{ + if(IsEqualGUID(riid, &IID_IUnknown) + || IsEqualGUID(riid, &IID_IClassFactory)) + { + IClassFactory_AddRef(iface); + *ppobj = iface; + return S_OK; + } + + *ppobj = NULL; + WARN("(%p)->(%s, %p): interface not found\n", iface, debugstr_guid(riid), ppobj); + return E_NOINTERFACE; +} + +static ULONG WINAPI xapocf_AddRef(IClassFactory *iface) +{ + struct xapo_cf *This = xapo_impl_from_IClassFactory(iface); + ULONG ref = InterlockedIncrement(&This->ref); + TRACE("(%p)->(): Refcount now %u\n", This, ref); + return ref; +} + +static ULONG WINAPI xapocf_Release(IClassFactory *iface) +{ + struct xapo_cf *This = xapo_impl_from_IClassFactory(iface); + ULONG ref = InterlockedDecrement(&This->ref); + TRACE("(%p)->(): Refcount now %u\n", This, ref); + if (!ref) + HeapFree(GetProcessHeap(), 0, This); + return ref; +} + +static HRESULT WINAPI xapocf_CreateInstance(IClassFactory *iface, IUnknown *pOuter, + REFIID riid, void **ppobj) +{ + struct xapo_cf *This = xapo_impl_from_IClassFactory(iface); + HRESULT hr; + + TRACE("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj); + + *ppobj = NULL; + + if(pOuter) + return CLASS_E_NOAGGREGATION; + + if(IsEqualGUID(This->class, &CLSID_AudioVolumeMeter)){ + VUMeterImpl *object; + + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); + if(!object) + return E_OUTOFMEMORY; + + object->IXAPO_iface.lpVtbl = &VUMXAPO_Vtbl; + object->IXAPOParameters_iface.lpVtbl = &VUMXAPOParameters_Vtbl; + object->version = This->version; + + hr = IXAPO_QueryInterface(&object->IXAPO_iface, riid, ppobj); + if(FAILED(hr)){ + HeapFree(GetProcessHeap(), 0, object); + return hr; + } + }else if(IsEqualGUID(This->class, &CLSID_AudioReverb)){ + ReverbImpl *object; + + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); + if(!object) + return E_OUTOFMEMORY; + + object->IXAPO_iface.lpVtbl = &RVBXAPO_Vtbl; + object->IXAPOParameters_iface.lpVtbl = &RVBXAPOParameters_Vtbl; + object->version = This->version; + + hr = IXAPO_QueryInterface(&object->IXAPO_iface, riid, ppobj); + if(FAILED(hr)){ + HeapFree(GetProcessHeap(), 0, object); + return hr; + } + }else if(IsEqualGUID(This->class, &CLSID_FXEQ)){ + EQImpl *object; + + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); + if(!object) + return E_OUTOFMEMORY; + + object->IXAPO_iface.lpVtbl = &EQXAPO_Vtbl; + object->IXAPOParameters_iface.lpVtbl = &EQXAPOParameters_Vtbl; + object->version = This->version; + + hr = IXAPO_QueryInterface(&object->IXAPO_iface, riid, ppobj); + if(FAILED(hr)){ + HeapFree(GetProcessHeap(), 0, object); + return hr; + } + }else + return E_INVALIDARG; + + return S_OK; +} + +static HRESULT WINAPI xapocf_LockServer(IClassFactory *iface, BOOL dolock) +{ + FIXME("(static)->(%d): stub!\n", dolock); + return S_OK; +} + +static const IClassFactoryVtbl xapo_Vtbl = +{ + xapocf_QueryInterface, + xapocf_AddRef, + xapocf_Release, + xapocf_CreateInstance, + xapocf_LockServer +}; + +IClassFactory *make_xapo_factory(REFCLSID clsid, DWORD version) +{ + struct xapo_cf *ret = HeapAlloc(GetProcessHeap(), 0, sizeof(struct xapo_cf)); + ret->IClassFactory_iface.lpVtbl = &xapo_Vtbl; + ret->version = version; + ret->class = clsid; + ret->ref = 0; + return &ret->IClassFactory_iface; +} diff -Nru wine1.7-1.7.50/dlls/xaudio2_7/xaudio_classes.idl wine1.7-1.7.55/dlls/xaudio2_7/xaudio_classes.idl --- wine1.7-1.7.50/dlls/xaudio2_7/xaudio_classes.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_7/xaudio_classes.idl 2015-11-13 14:32:40.000000000 +0000 @@ -26,3 +26,108 @@ uuid(5a508685-a254-4fba-9b82-9a24b00306af) ] coclass XAudio2 { interface IXAudio2; } + +[ + helpstring("XAudio2 Volume Meter Class"), + threading(both), + uuid(cac1105f-619b-4d04-831a-44e1cbf12d57) +] +coclass AudioVolumeMeter { interface IUnknown; } + +[ + helpstring("XAudio2 Reverb Class"), + threading(both), + uuid(6a93130e-1d53-41d1-a9cf-e758800bb179) +] +coclass AudioReverb { interface IUnknown; } + +[ + helpstring("XACT 31 Class"), + threading(both), + uuid(962f5027-99be-4692-a468-85802cf8de61) +] +coclass XACT31 { interface IUnknown; } + +[ + helpstring("XAPOFX1.1 FXReverb Class (Wine)"), + threading(both), + uuid(a90bc001-e897-e897-7439-43FF02000101) +] +coclass FXReverb11 { interface IXAPO; } + +[ + helpstring("XAPOFX1.2 FXReverb Class (Wine)"), + threading(both), + uuid(a90bc001-e897-e897-7439-43FF02000102) +] +coclass FXReverb12 { interface IXAPO; } + +[ + helpstring("XAPOFX1.3 FXReverb Class (Wine)"), + threading(both), + uuid(a90bc001-e897-e897-7439-43FF02000103) +] +coclass FXReverb13 { interface IXAPO; } + +[ + helpstring("XAPOFX1.4 FXReverb Class (Wine)"), + threading(both), + uuid(a90bc001-e897-e897-7439-43FF02000104) +] +coclass FXReverb14 { interface IXAPO; } + +[ + helpstring("XAPOFX1.5 FXReverb Class (Wine)"), + threading(both), + uuid(a90bc001-e897-e897-7439-43FF02000105) +] +coclass FXReverb15 { interface IXAPO; } + +[ + helpstring("XAudio2.8 FXReverb Class (Wine)"), + threading(both), + uuid(a90bc001-e897-e897-7439-43FF02000208) +] +coclass FXReverb28 { interface IXAPO; } + +[ + helpstring("XAPOFX1.1 FXEQ Class (Wine)"), + threading(both), + uuid(a90bc001-e897-e897-7439-43FF00000101) +] +coclass FXEQ11 { interface IXAPO; } + +[ + helpstring("XAPOFX1.2 FXEQ Class (Wine)"), + threading(both), + uuid(a90bc001-e897-e897-7439-43FF00000102) +] +coclass FXEQ12 { interface IXAPO; } + +[ + helpstring("XAPOFX1.3 FXEQ Class (Wine)"), + threading(both), + uuid(a90bc001-e897-e897-7439-43FF00000103) +] +coclass FXEQ13 { interface IXAPO; } + +[ + helpstring("XAPOFX1.4 FXEQ Class (Wine)"), + threading(both), + uuid(a90bc001-e897-e897-7439-43FF00000104) +] +coclass FXEQ14 { interface IXAPO; } + +[ + helpstring("XAPOFX1.5 FXEQ Class (Wine)"), + threading(both), + uuid(a90bc001-e897-e897-7439-43FF00000105) +] +coclass FXEQ15 { interface IXAPO; } + +[ + helpstring("XAudio2.8 FXEQ Class (Wine)"), + threading(both), + uuid(a90bc001-e897-e897-7439-43FF00000208) +] +coclass FXEQ28 { interface IXAPO; } diff -Nru wine1.7-1.7.50/dlls/xaudio2_7/xaudio_dll.c wine1.7-1.7.55/dlls/xaudio2_7/xaudio_dll.c --- wine1.7-1.7.50/dlls/xaudio2_7/xaudio_dll.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_7/xaudio_dll.c 2015-11-13 14:32:40.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2015 Mark Harmstone + * Copyright (c) 2015 Andrew Eikum for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,27 +19,30 @@ #include +#define NONAMELESSUNION #define COBJMACROS -#include "windef.h" -#include "winbase.h" -#include "winuser.h" +#include "initguid.h" + +#include "xaudio_private.h" #include "ole2.h" #include "rpcproxy.h" -#include "wine/debug.h" -#include "wine/list.h" -#include -#include "initguid.h" +#include "xapofx.h" -#include "mmsystem.h" -#include "xaudio2.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(xaudio2); +static ALCdevice *(ALC_APIENTRY *palcLoopbackOpenDeviceSOFT)(const ALCchar*); +static void (ALC_APIENTRY *palcRenderSamplesSOFT)(ALCdevice*, ALCvoid*, ALCsizei); + static HINSTANCE instance; +#define COMPAT_E_INVALID_CALL(v) (v == 20) ? E_INVALIDARG : XAUDIO2_E_INVALID_CALL +#define COMPAT_E_DEVICE_INVALIDATED(v) (v == 20) ? XAUDIO20_E_DEVICE_INVALIDATED : XAUDIO2_E_DEVICE_INVALIDATED + static void dump_fmt(const WAVEFORMATEX *fmt) { TRACE("wFormatTag: 0x%x (", fmt->wFormatTag); @@ -66,6 +70,9 @@ TRACE("dwChannelMask: %08x\n", fmtex->dwChannelMask); TRACE("Samples: %04x\n", fmtex->Samples.wReserved); TRACE("SubFormat: %s\n", wine_dbgstr_guid(&fmtex->SubFormat)); + }else if(fmt->wFormatTag == WAVE_FORMAT_ADPCM){ + ADPCMWAVEFORMAT *fmtadpcm = (void*)fmt; + TRACE("wSamplesPerBlock: %u\n", fmtadpcm->wSamplesPerBlock); } } @@ -80,6 +87,14 @@ case DLL_PROCESS_ATTACH: instance = hinstDLL; DisableThreadLibraryCalls( hinstDLL ); + + if(!alcIsExtensionPresent(NULL, "ALC_SOFT_loopback") || + !(palcLoopbackOpenDeviceSOFT = alcGetProcAddress(NULL, "alcLoopbackOpenDeviceSOFT")) || + !(palcRenderSamplesSOFT = alcGetProcAddress(NULL, "alcRenderSamplesSOFT"))){ + ERR("XAudio2 requires the ALC_SOFT_loopback extension (OpenAL-Soft >= 1.14)\n"); + return FALSE; + } + break; } return TRUE; @@ -102,58 +117,50 @@ return __wine_unregister_resources(instance); } -typedef struct _XA2SourceImpl { - IXAudio27SourceVoice IXAudio27SourceVoice_iface; - IXAudio2SourceVoice IXAudio2SourceVoice_iface; - - BOOL in_use; - - CRITICAL_SECTION lock; - - WAVEFORMATEX *fmt; - - IXAudio2VoiceCallback *cb; - - struct list entry; -} XA2SourceImpl; - -XA2SourceImpl *impl_from_IXAudio2SourceVoice(IXAudio2SourceVoice *iface) +static XA2SourceImpl *impl_from_IXAudio2SourceVoice(IXAudio2SourceVoice *iface) { return CONTAINING_RECORD(iface, XA2SourceImpl, IXAudio2SourceVoice_iface); } -XA2SourceImpl *impl_from_IXAudio27SourceVoice(IXAudio27SourceVoice *iface) +static XA2SubmixImpl *impl_from_IXAudio2SubmixVoice(IXAudio2SubmixVoice *iface) { - return CONTAINING_RECORD(iface, XA2SourceImpl, IXAudio27SourceVoice_iface); + return CONTAINING_RECORD(iface, XA2SubmixImpl, IXAudio2SubmixVoice_iface); } -typedef struct { - IXAudio27 IXAudio27_iface; - IXAudio2 IXAudio2_iface; - IXAudio2MasteringVoice IXAudio2MasteringVoice_iface; - - LONG ref; - - CRITICAL_SECTION lock; - - DWORD version; - - struct list source_voices; -} IXAudio2Impl; - static inline IXAudio2Impl *impl_from_IXAudio2(IXAudio2 *iface) { return CONTAINING_RECORD(iface, IXAudio2Impl, IXAudio2_iface); } -static inline IXAudio2Impl *impl_from_IXAudio27(IXAudio27 *iface) +static IXAudio2Impl *impl_from_IXAudio2MasteringVoice(IXAudio2MasteringVoice *iface) { - return CONTAINING_RECORD(iface, IXAudio2Impl, IXAudio27_iface); + return CONTAINING_RECORD(iface, IXAudio2Impl, IXAudio2MasteringVoice_iface); } -IXAudio2Impl *impl_from_IXAudio2MasteringVoice(IXAudio2MasteringVoice *iface) +static DWORD get_channel_mask(unsigned int channels) { - return CONTAINING_RECORD(iface, IXAudio2Impl, IXAudio2MasteringVoice_iface); + switch(channels){ + case 0: + return 0; + case 1: + return KSAUDIO_SPEAKER_MONO; + case 2: + return KSAUDIO_SPEAKER_STEREO; + case 3: + return KSAUDIO_SPEAKER_STEREO | SPEAKER_LOW_FREQUENCY; + case 4: + return KSAUDIO_SPEAKER_QUAD; /* not _SURROUND */ + case 5: + return KSAUDIO_SPEAKER_QUAD | SPEAKER_LOW_FREQUENCY; + case 6: + return KSAUDIO_SPEAKER_5POINT1; /* not 5POINT1_SURROUND */ + case 7: + return KSAUDIO_SPEAKER_5POINT1 | SPEAKER_BACK_CENTER; + case 8: + return KSAUDIO_SPEAKER_7POINT1_SURROUND; /* Vista deprecates 7POINT1 */ + } + FIXME("Unknown speaker configuration: %u\n", channels); + return 0; } static void WINAPI XA2SRC_GetVoiceDetails(IXAudio2SourceVoice *iface, @@ -167,7 +174,38 @@ const XAUDIO2_VOICE_SENDS *pSendList) { XA2SourceImpl *This = impl_from_IXAudio2SourceVoice(iface); + int i; + XAUDIO2_VOICE_SENDS def_send; + XAUDIO2_SEND_DESCRIPTOR def_desc; + TRACE("%p, %p\n", This, pSendList); + + if(!pSendList){ + def_desc.Flags = 0; + def_desc.pOutputVoice = (IXAudio2Voice*)&This->xa2->IXAudio2MasteringVoice_iface; + + def_send.SendCount = 1; + def_send.pSends = &def_desc; + + pSendList = &def_send; + } + + if(TRACE_ON(xaudio2)){ + for(i = 0; i < pSendList->SendCount; ++i){ + XAUDIO2_SEND_DESCRIPTOR *desc = &pSendList->pSends[i]; + TRACE("Outputting to: 0x%x, %p\n", desc->Flags, desc->pOutputVoice); + } + } + + if(This->nsends < pSendList->SendCount){ + HeapFree(GetProcessHeap(), 0, This->sends); + This->sends = HeapAlloc(GetProcessHeap(), 0, sizeof(*This->sends) * pSendList->SendCount); + This->nsends = pSendList->SendCount; + }else + memset(This->sends, 0, sizeof(*This->sends) * This->nsends); + + memcpy(This->sends, pSendList->pSends, sizeof(*This->sends) * pSendList->SendCount); + return S_OK; } @@ -257,7 +295,14 @@ UINT32 OperationSet) { XA2SourceImpl *This = impl_from_IXAudio2SourceVoice(iface); + ALfloat al_gain; + TRACE("%p, %f, 0x%x\n", This, Volume, OperationSet); + + al_gain = Volume; + + alSourcef(This->al_src, AL_GAIN, al_gain); + return S_OK; } @@ -305,6 +350,7 @@ static void WINAPI XA2SRC_DestroyVoice(IXAudio2SourceVoice *iface) { XA2SourceImpl *This = impl_from_IXAudio2SourceVoice(iface); + ALint processed; TRACE("%p\n", This); @@ -317,8 +363,35 @@ This->in_use = FALSE; + This->running = FALSE; + + IXAudio2SourceVoice_Stop(iface, 0, 0); + + alSourceStop(This->al_src); + + /* unqueue all buffers */ + alSourcei(This->al_src, AL_BUFFER, AL_NONE); + + alGetSourcei(This->al_src, AL_BUFFERS_PROCESSED, &processed); + + if(processed > 0){ + ALuint al_buffers[XAUDIO2_MAX_QUEUED_BUFFERS]; + + alSourceUnqueueBuffers(This->al_src, processed, al_buffers); + } + HeapFree(GetProcessHeap(), 0, This->fmt); + alDeleteBuffers(XAUDIO2_MAX_QUEUED_BUFFERS, This->al_bufs); + alDeleteSources(1, &This->al_src); + + This->in_al_bytes = 0; + This->al_bufs_used = 0; + This->played_frames = 0; + This->nbufs = 0; + This->first_buf = 0; + This->cur_buf = 0; + LeaveCriticalSection(&This->lock); } @@ -326,7 +399,15 @@ UINT32 OperationSet) { XA2SourceImpl *This = impl_from_IXAudio2SourceVoice(iface); + TRACE("%p, 0x%x, 0x%x\n", This, Flags, OperationSet); + + EnterCriticalSection(&This->lock); + + This->running = TRUE; + + LeaveCriticalSection(&This->lock); + return S_OK; } @@ -334,36 +415,261 @@ UINT32 OperationSet) { XA2SourceImpl *This = impl_from_IXAudio2SourceVoice(iface); + TRACE("%p, 0x%x, 0x%x\n", This, Flags, OperationSet); + + EnterCriticalSection(&This->lock); + + This->running = FALSE; + + LeaveCriticalSection(&This->lock); + return S_OK; } +static ALenum get_al_format(const WAVEFORMATEX *fmt) +{ + WAVEFORMATEXTENSIBLE *fmtex = (WAVEFORMATEXTENSIBLE*)fmt; + if(fmt->wFormatTag == WAVE_FORMAT_PCM || + (fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE && + IsEqualGUID(&fmtex->SubFormat, &KSDATAFORMAT_SUBTYPE_PCM))){ + switch(fmt->wBitsPerSample){ + case 8: + switch(fmt->nChannels){ + case 1: + return AL_FORMAT_MONO8; + case 2: + return AL_FORMAT_STEREO8; + case 4: + return AL_FORMAT_QUAD8; + case 6: + return AL_FORMAT_51CHN8; + case 7: + return AL_FORMAT_61CHN8; + case 8: + return AL_FORMAT_71CHN8; + } + case 16: + switch(fmt->nChannels){ + case 1: + return AL_FORMAT_MONO16; + case 2: + return AL_FORMAT_STEREO16; + case 4: + return AL_FORMAT_QUAD16; + case 6: + return AL_FORMAT_51CHN16; + case 7: + return AL_FORMAT_61CHN16; + case 8: + return AL_FORMAT_71CHN16; + } + } + }else if(fmt->wFormatTag == WAVE_FORMAT_IEEE_FLOAT || + (fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE && + IsEqualGUID(&fmtex->SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT))){ + if(fmt->wBitsPerSample == 32){ + switch(fmt->nChannels){ + case 1: + return AL_FORMAT_MONO_FLOAT32; + case 2: + return AL_FORMAT_STEREO_FLOAT32; + } + } + } + return 0; +} + static HRESULT WINAPI XA2SRC_SubmitSourceBuffer(IXAudio2SourceVoice *iface, const XAUDIO2_BUFFER *pBuffer, const XAUDIO2_BUFFER_WMA *pBufferWMA) { XA2SourceImpl *This = impl_from_IXAudio2SourceVoice(iface); + XA2Buffer *buf; + UINT32 buf_idx; + TRACE("%p, %p, %p\n", This, pBuffer, pBufferWMA); + + if(TRACE_ON(xaudio2)){ + TRACE("Flags: 0x%x\n", pBuffer->Flags); + TRACE("AudioBytes: %u\n", pBuffer->AudioBytes); + TRACE("pAudioData: %p\n", pBuffer->pAudioData); + TRACE("PlayBegin: %u\n", pBuffer->PlayBegin); + TRACE("PlayLength: %u\n", pBuffer->PlayLength); + TRACE("LoopBegin: %u\n", pBuffer->LoopBegin); + TRACE("LoopLength: %u\n", pBuffer->LoopLength); + TRACE("LoopCount: %u\n", pBuffer->LoopCount); + TRACE("pContext: %p\n", pBuffer->pContext); + } + + EnterCriticalSection(&This->lock); + + if(This->nbufs >= XAUDIO2_MAX_QUEUED_BUFFERS){ + TRACE("Too many buffers queued!\n"); + LeaveCriticalSection(&This->lock); + return COMPAT_E_INVALID_CALL(This->xa2->version); + } + + buf_idx = (This->first_buf + This->nbufs) % XAUDIO2_MAX_QUEUED_BUFFERS; + buf = &This->buffers[buf_idx]; + memset(buf, 0, sizeof(*buf)); + + /* API contract: pAudioData must remain valid until this buffer is played, + * but pBuffer itself may be reused immediately */ + memcpy(&buf->xa2buffer, pBuffer, sizeof(*pBuffer)); + + if(This->xa2->version == 20){ + if(buf->xa2buffer.LoopCount == XAUDIO20_LOOP_INFINITE) + buf->xa2buffer.LoopCount = XAUDIO2_LOOP_INFINITE; + } + + /* convert samples offsets to bytes */ + if(This->fmt->wFormatTag == WAVE_FORMAT_ADPCM){ + /* ADPCM gives us a number of samples per block, so round down to + * nearest block and convert to bytes */ + buf->xa2buffer.PlayBegin = buf->xa2buffer.PlayBegin / ((ADPCMWAVEFORMAT*)This->fmt)->wSamplesPerBlock * This->fmt->nBlockAlign; + buf->xa2buffer.PlayLength = buf->xa2buffer.PlayLength / ((ADPCMWAVEFORMAT*)This->fmt)->wSamplesPerBlock * This->fmt->nBlockAlign; + buf->xa2buffer.LoopBegin = buf->xa2buffer.LoopBegin / ((ADPCMWAVEFORMAT*)This->fmt)->wSamplesPerBlock * This->fmt->nBlockAlign; + buf->xa2buffer.LoopLength = buf->xa2buffer.LoopLength / ((ADPCMWAVEFORMAT*)This->fmt)->wSamplesPerBlock * This->fmt->nBlockAlign; + }else{ + buf->xa2buffer.PlayBegin *= This->fmt->nBlockAlign; + buf->xa2buffer.PlayLength *= This->fmt->nBlockAlign; + buf->xa2buffer.LoopBegin *= This->fmt->nBlockAlign; + buf->xa2buffer.LoopLength *= This->fmt->nBlockAlign; + } + + if(buf->xa2buffer.PlayLength == 0) + /* set to end of buffer */ + buf->xa2buffer.PlayLength = buf->xa2buffer.AudioBytes - buf->xa2buffer.PlayBegin; + + buf->play_end_bytes = buf->xa2buffer.PlayBegin + buf->xa2buffer.PlayLength; + + if(buf->xa2buffer.LoopCount){ + if(buf->xa2buffer.LoopLength == 0) + /* set to end of play range */ + buf->xa2buffer.LoopLength = buf->play_end_bytes - buf->xa2buffer.LoopBegin; + + if(buf->xa2buffer.LoopBegin >= buf->play_end_bytes){ + /* this actually crashes on native xaudio 2.7 */ + LeaveCriticalSection(&This->lock); + return COMPAT_E_INVALID_CALL(This->xa2->version); + } + + buf->loop_end_bytes = buf->xa2buffer.LoopBegin + buf->xa2buffer.LoopLength; + + /* xaudio 2.7 allows some invalid looping setups, but later versions + * return an error */ + if(This->xa2->version > 27){ + if(buf->loop_end_bytes > buf->play_end_bytes){ + LeaveCriticalSection(&This->lock); + return COMPAT_E_INVALID_CALL(This->xa2->version); + } + + if(buf->loop_end_bytes <= buf->xa2buffer.PlayBegin){ + LeaveCriticalSection(&This->lock); + return COMPAT_E_INVALID_CALL(This->xa2->version); + } + }else{ + if(buf->loop_end_bytes <= buf->xa2buffer.PlayBegin){ + buf->xa2buffer.LoopCount = 0; + buf->loop_end_bytes = buf->play_end_bytes; + } + } + }else{ + buf->xa2buffer.LoopLength = buf->xa2buffer.PlayLength; + buf->xa2buffer.LoopBegin = buf->xa2buffer.PlayBegin; + buf->loop_end_bytes = buf->play_end_bytes; + } + + buf->offs_bytes = buf->xa2buffer.PlayBegin; + buf->cur_end_bytes = buf->loop_end_bytes; + + buf->latest_al_buf = -1; + + ++This->nbufs; + + TRACE("%p: queued buffer %u (%u bytes), now %u buffers held\n", + This, buf_idx, buf->xa2buffer.AudioBytes, This->nbufs); + + LeaveCriticalSection(&This->lock); + return S_OK; } static HRESULT WINAPI XA2SRC_FlushSourceBuffers(IXAudio2SourceVoice *iface) { + UINT i, first, last, to_flush; XA2SourceImpl *This = impl_from_IXAudio2SourceVoice(iface); + TRACE("%p\n", This); + + EnterCriticalSection(&This->lock); + + if(This->running && This->nbufs > 0){ + /* when running, flush only completely unused buffers; the rest remain + * in queue */ + last = (This->first_buf + This->nbufs) % XAUDIO2_MAX_QUEUED_BUFFERS; + first = (This->cur_buf + 1) % XAUDIO2_MAX_QUEUED_BUFFERS; + if(This->cur_buf == last) + /* nothing to do */ + to_flush = 0; + else if(last >= first) + to_flush = last - first; + else + to_flush = last + XAUDIO2_MAX_QUEUED_BUFFERS - first; + }else{ + /* when stopped, flush all buffers */ + first = This->first_buf; + last = (This->first_buf + This->nbufs) % XAUDIO2_MAX_QUEUED_BUFFERS; + to_flush = This->nbufs; + } + + + for(i = first; + i < (first + to_flush) % XAUDIO2_MAX_QUEUED_BUFFERS; + i = (i + 1) % XAUDIO2_MAX_QUEUED_BUFFERS){ + if(This->cb) + IXAudio2VoiceCallback_OnBufferEnd(This->cb, + This->buffers[i].xa2buffer.pContext); + } + + This->nbufs -= to_flush; + This->cur_buf = (This->first_buf + This->nbufs) % XAUDIO2_MAX_QUEUED_BUFFERS; + + LeaveCriticalSection(&This->lock); + return S_OK; } static HRESULT WINAPI XA2SRC_Discontinuity(IXAudio2SourceVoice *iface) { XA2SourceImpl *This = impl_from_IXAudio2SourceVoice(iface); + TRACE("%p\n", This); + + EnterCriticalSection(&This->lock); + + if(This->nbufs > 0){ + DWORD last = (This->first_buf + This->nbufs - 1) % XAUDIO2_MAX_QUEUED_BUFFERS; + This->buffers[last].xa2buffer.Flags |= XAUDIO2_END_OF_STREAM; + } + + LeaveCriticalSection(&This->lock); + return S_OK; } static HRESULT WINAPI XA2SRC_ExitLoop(IXAudio2SourceVoice *iface, UINT32 OperationSet) { XA2SourceImpl *This = impl_from_IXAudio2SourceVoice(iface); + TRACE("%p, 0x%x\n", This, OperationSet); + + EnterCriticalSection(&This->lock); + + This->buffers[This->cur_buf].looped = XAUDIO2_LOOP_INFINITE; + + LeaveCriticalSection(&This->lock); + return S_OK; } @@ -371,21 +677,58 @@ XAUDIO2_VOICE_STATE *pVoiceState, UINT32 Flags) { XA2SourceImpl *This = impl_from_IXAudio2SourceVoice(iface); + TRACE("%p, %p, 0x%x\n", This, pVoiceState, Flags); + + EnterCriticalSection(&This->lock); + + if(!(Flags & XAUDIO2_VOICE_NOSAMPLESPLAYED)) + pVoiceState->SamplesPlayed = This->played_frames; + else + pVoiceState->SamplesPlayed = 0; + + if(This->nbufs) + pVoiceState->pCurrentBufferContext = This->buffers[This->first_buf].xa2buffer.pContext; + else + pVoiceState->pCurrentBufferContext = NULL; + + pVoiceState->BuffersQueued = This->nbufs; + + LeaveCriticalSection(&This->lock); + + TRACE("returning %s, queued: %u\n", wine_dbgstr_longlong(pVoiceState->SamplesPlayed), This->nbufs); } static HRESULT WINAPI XA2SRC_SetFrequencyRatio(IXAudio2SourceVoice *iface, float Ratio, UINT32 OperationSet) { XA2SourceImpl *This = impl_from_IXAudio2SourceVoice(iface); + ALfloat r; + TRACE("%p, %f, 0x%x\n", This, Ratio, OperationSet); + + if(Ratio < XAUDIO2_MIN_FREQ_RATIO) + r = XAUDIO2_MIN_FREQ_RATIO; + else if (Ratio > XAUDIO2_MAX_FREQ_RATIO) + r = XAUDIO2_MAX_FREQ_RATIO; + else + r = Ratio; + + alSourcef(This->al_src, AL_PITCH, r); + return S_OK; } static void WINAPI XA2SRC_GetFrequencyRatio(IXAudio2SourceVoice *iface, float *pRatio) { + ALfloat ratio; XA2SourceImpl *This = impl_from_IXAudio2SourceVoice(iface); + TRACE("%p, %p\n", This, pRatio); + + alGetSourcef(This->al_src, AL_PITCH, &ratio); + + *pRatio = ratio; } static HRESULT WINAPI XA2SRC_SetSourceSampleRate( @@ -393,7 +736,20 @@ UINT32 NewSourceSampleRate) { XA2SourceImpl *This = impl_from_IXAudio2SourceVoice(iface); + TRACE("%p, %u\n", This, NewSourceSampleRate); + + EnterCriticalSection(&This->lock); + + if(This->nbufs){ + LeaveCriticalSection(&This->lock); + return COMPAT_E_INVALID_CALL(This->xa2->version); + } + + This->fmt->nSamplesPerSec = NewSourceSampleRate; + + LeaveCriticalSection(&This->lock); + return S_OK; } @@ -429,435 +785,398 @@ XA2SRC_SetSourceSampleRate }; -static void WINAPI XA27SRC_GetVoiceDetails(IXAudio27SourceVoice *iface, +static void WINAPI XA2M_GetVoiceDetails(IXAudio2MasteringVoice *iface, XAUDIO2_VOICE_DETAILS *pVoiceDetails) { - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - return XA2SRC_GetVoiceDetails(&This->IXAudio2SourceVoice_iface, pVoiceDetails); + IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + TRACE("%p, %p\n", This, pVoiceDetails); + pVoiceDetails->CreationFlags = 0; + pVoiceDetails->InputChannels = This->fmt.Format.nChannels; + pVoiceDetails->InputSampleRate = This->fmt.Format.nSamplesPerSec; } -static HRESULT WINAPI XA27SRC_SetOutputVoices(IXAudio27SourceVoice *iface, +static HRESULT WINAPI XA2M_SetOutputVoices(IXAudio2MasteringVoice *iface, const XAUDIO2_VOICE_SENDS *pSendList) { - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - return XA2SRC_SetOutputVoices(&This->IXAudio2SourceVoice_iface, pSendList); + IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + TRACE("%p, %p\n", This, pSendList); + return S_OK; } -static HRESULT WINAPI XA27SRC_SetEffectChain(IXAudio27SourceVoice *iface, +static HRESULT WINAPI XA2M_SetEffectChain(IXAudio2MasteringVoice *iface, const XAUDIO2_EFFECT_CHAIN *pEffectChain) { - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - return XA2SRC_SetEffectChain(&This->IXAudio2SourceVoice_iface, pEffectChain); + IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + TRACE("%p, %p\n", This, pEffectChain); + return S_OK; } -static HRESULT WINAPI XA27SRC_EnableEffect(IXAudio27SourceVoice *iface, - UINT32 EffectIndex, UINT32 OperationSet) +static HRESULT WINAPI XA2M_EnableEffect(IXAudio2MasteringVoice *iface, UINT32 EffectIndex, + UINT32 OperationSet) { - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - return XA2SRC_EnableEffect(&This->IXAudio2SourceVoice_iface, EffectIndex, OperationSet); + IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + TRACE("%p, %u, 0x%x\n", This, EffectIndex, OperationSet); + return S_OK; } -static HRESULT WINAPI XA27SRC_DisableEffect(IXAudio27SourceVoice *iface, - UINT32 EffectIndex, UINT32 OperationSet) +static HRESULT WINAPI XA2M_DisableEffect(IXAudio2MasteringVoice *iface, UINT32 EffectIndex, + UINT32 OperationSet) { - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - return XA2SRC_DisableEffect(&This->IXAudio2SourceVoice_iface, EffectIndex, OperationSet); + IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + TRACE("%p, %u, 0x%x\n", This, EffectIndex, OperationSet); + return S_OK; } -static void WINAPI XA27SRC_GetEffectState(IXAudio27SourceVoice *iface, - UINT32 EffectIndex, BOOL *pEnabled) +static void WINAPI XA2M_GetEffectState(IXAudio2MasteringVoice *iface, UINT32 EffectIndex, + BOOL *pEnabled) { - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - XA2SRC_GetEffectState(&This->IXAudio2SourceVoice_iface, EffectIndex, pEnabled); + IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + TRACE("%p, %u, %p\n", This, EffectIndex, pEnabled); } -static HRESULT WINAPI XA27SRC_SetEffectParameters(IXAudio27SourceVoice *iface, +static HRESULT WINAPI XA2M_SetEffectParameters(IXAudio2MasteringVoice *iface, UINT32 EffectIndex, const void *pParameters, UINT32 ParametersByteSize, UINT32 OperationSet) { - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - return XA2SRC_SetEffectParameters(&This->IXAudio2SourceVoice_iface, - EffectIndex, pParameters, ParametersByteSize, OperationSet); + IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + TRACE("%p, %u, %p, 0x%x, 0x%x\n", This, EffectIndex, pParameters, + ParametersByteSize, OperationSet); + return S_OK; } -static HRESULT WINAPI XA27SRC_GetEffectParameters(IXAudio27SourceVoice *iface, +static HRESULT WINAPI XA2M_GetEffectParameters(IXAudio2MasteringVoice *iface, UINT32 EffectIndex, void *pParameters, UINT32 ParametersByteSize) { - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - return XA2SRC_GetEffectParameters(&This->IXAudio2SourceVoice_iface, - EffectIndex, pParameters, ParametersByteSize); + IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + TRACE("%p, %u, %p, 0x%x\n", This, EffectIndex, pParameters, + ParametersByteSize); + return S_OK; } -static HRESULT WINAPI XA27SRC_SetFilterParameters(IXAudio27SourceVoice *iface, +static HRESULT WINAPI XA2M_SetFilterParameters(IXAudio2MasteringVoice *iface, const XAUDIO2_FILTER_PARAMETERS *pParameters, UINT32 OperationSet) { - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - return XA2SRC_SetFilterParameters(&This->IXAudio2SourceVoice_iface, - pParameters, OperationSet); + IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + TRACE("%p, %p, 0x%x\n", This, pParameters, OperationSet); + return S_OK; } -static void WINAPI XA27SRC_GetFilterParameters(IXAudio27SourceVoice *iface, +static void WINAPI XA2M_GetFilterParameters(IXAudio2MasteringVoice *iface, XAUDIO2_FILTER_PARAMETERS *pParameters) { - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - XA2SRC_GetFilterParameters(&This->IXAudio2SourceVoice_iface, pParameters); + IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + TRACE("%p, %p\n", This, pParameters); } -static HRESULT WINAPI XA27SRC_SetOutputFilterParameters(IXAudio27SourceVoice *iface, +static HRESULT WINAPI XA2M_SetOutputFilterParameters(IXAudio2MasteringVoice *iface, IXAudio2Voice *pDestinationVoice, const XAUDIO2_FILTER_PARAMETERS *pParameters, UINT32 OperationSet) { - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - return XA2SRC_SetOutputFilterParameters(&This->IXAudio2SourceVoice_iface, - pDestinationVoice, pParameters, OperationSet); + IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + TRACE("%p, %p, %p, 0x%x\n", This, pDestinationVoice, pParameters, OperationSet); + return S_OK; } -static void WINAPI XA27SRC_GetOutputFilterParameters(IXAudio27SourceVoice *iface, +static void WINAPI XA2M_GetOutputFilterParameters(IXAudio2MasteringVoice *iface, IXAudio2Voice *pDestinationVoice, XAUDIO2_FILTER_PARAMETERS *pParameters) { - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - XA2SRC_GetOutputFilterParameters(&This->IXAudio2SourceVoice_iface, - pDestinationVoice, pParameters); + IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + TRACE("%p, %p, %p\n", This, pDestinationVoice, pParameters); } -static HRESULT WINAPI XA27SRC_SetVolume(IXAudio27SourceVoice *iface, float Volume, +static HRESULT WINAPI XA2M_SetVolume(IXAudio2MasteringVoice *iface, float Volume, UINT32 OperationSet) { - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - return XA2SRC_SetVolume(&This->IXAudio2SourceVoice_iface, Volume, - OperationSet); + IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + TRACE("%p, %f, 0x%x\n", This, Volume, OperationSet); + return S_OK; } -static void WINAPI XA27SRC_GetVolume(IXAudio27SourceVoice *iface, float *pVolume) +static void WINAPI XA2M_GetVolume(IXAudio2MasteringVoice *iface, float *pVolume) { - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - XA2SRC_GetVolume(&This->IXAudio2SourceVoice_iface, pVolume); + IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + TRACE("%p, %p\n", This, pVolume); } -static HRESULT WINAPI XA27SRC_SetChannelVolumes(IXAudio27SourceVoice *iface, - UINT32 Channels, const float *pVolumes, UINT32 OperationSet) +static HRESULT WINAPI XA2M_SetChannelVolumes(IXAudio2MasteringVoice *iface, UINT32 Channels, + const float *pVolumes, UINT32 OperationSet) { - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - return XA2SRC_SetChannelVolumes(&This->IXAudio2SourceVoice_iface, Channels, - pVolumes, OperationSet); + IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + TRACE("%p, %u, %p, 0x%x\n", This, Channels, pVolumes, OperationSet); + return S_OK; } -static void WINAPI XA27SRC_GetChannelVolumes(IXAudio27SourceVoice *iface, - UINT32 Channels, float *pVolumes) +static void WINAPI XA2M_GetChannelVolumes(IXAudio2MasteringVoice *iface, UINT32 Channels, + float *pVolumes) { - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - XA2SRC_GetChannelVolumes(&This->IXAudio2SourceVoice_iface, Channels, - pVolumes); + IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + TRACE("%p, %u, %p\n", This, Channels, pVolumes); } -static HRESULT WINAPI XA27SRC_SetOutputMatrix(IXAudio27SourceVoice *iface, +static HRESULT WINAPI XA2M_SetOutputMatrix(IXAudio2MasteringVoice *iface, IXAudio2Voice *pDestinationVoice, UINT32 SourceChannels, UINT32 DestinationChannels, const float *pLevelMatrix, UINT32 OperationSet) { - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - return XA2SRC_SetOutputMatrix(&This->IXAudio2SourceVoice_iface, - pDestinationVoice, SourceChannels, DestinationChannels, - pLevelMatrix, OperationSet); + IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + TRACE("%p, %p, %u, %u, %p, 0x%x\n", This, pDestinationVoice, + SourceChannels, DestinationChannels, pLevelMatrix, OperationSet); + return S_OK; } -static void WINAPI XA27SRC_GetOutputMatrix(IXAudio27SourceVoice *iface, +static void WINAPI XA2M_GetOutputMatrix(IXAudio2MasteringVoice *iface, IXAudio2Voice *pDestinationVoice, UINT32 SourceChannels, UINT32 DestinationChannels, float *pLevelMatrix) { - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - XA2SRC_GetOutputMatrix(&This->IXAudio2SourceVoice_iface, pDestinationVoice, + IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + TRACE("%p, %p, %u, %u, %p\n", This, pDestinationVoice, SourceChannels, DestinationChannels, pLevelMatrix); } -static void WINAPI XA27SRC_DestroyVoice(IXAudio27SourceVoice *iface) +static void WINAPI XA2M_DestroyVoice(IXAudio2MasteringVoice *iface) { - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - XA2SRC_DestroyVoice(&This->IXAudio2SourceVoice_iface); -} + IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); -static HRESULT WINAPI XA27SRC_Start(IXAudio27SourceVoice *iface, UINT32 Flags, - UINT32 OperationSet) -{ - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - return XA2SRC_Start(&This->IXAudio2SourceVoice_iface, Flags, OperationSet); -} + TRACE("%p\n", This); -static HRESULT WINAPI XA27SRC_Stop(IXAudio27SourceVoice *iface, UINT32 Flags, - UINT32 OperationSet) -{ - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - return XA2SRC_Stop(&This->IXAudio2SourceVoice_iface, Flags, OperationSet); -} + EnterCriticalSection(&This->lock); -static HRESULT WINAPI XA27SRC_SubmitSourceBuffer(IXAudio27SourceVoice *iface, - const XAUDIO2_BUFFER *pBuffer, const XAUDIO2_BUFFER_WMA *pBufferWMA) -{ - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - return XA2SRC_SubmitSourceBuffer(&This->IXAudio2SourceVoice_iface, pBuffer, - pBufferWMA); -} + if(!This->aclient){ + LeaveCriticalSection(&This->lock); + return; + } -static HRESULT WINAPI XA27SRC_FlushSourceBuffers(IXAudio27SourceVoice *iface) -{ - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - return XA2SRC_FlushSourceBuffers(&This->IXAudio2SourceVoice_iface); -} + This->running = FALSE; -static HRESULT WINAPI XA27SRC_Discontinuity(IXAudio27SourceVoice *iface) -{ - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - return XA2SRC_Discontinuity(&This->IXAudio2SourceVoice_iface); -} + IAudioRenderClient_Release(This->render); + This->render = NULL; -static HRESULT WINAPI XA27SRC_ExitLoop(IXAudio27SourceVoice *iface, UINT32 OperationSet) -{ - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - return XA2SRC_ExitLoop(&This->IXAudio2SourceVoice_iface, OperationSet); -} + IAudioClient_Release(This->aclient); + This->aclient = NULL; -static void WINAPI XA27SRC_GetState(IXAudio27SourceVoice *iface, - XAUDIO2_VOICE_STATE *pVoiceState) -{ - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - return XA2SRC_GetState(&This->IXAudio2SourceVoice_iface, pVoiceState, 0); -} + alcCloseDevice(This->al_device); + This->al_device = NULL; -static HRESULT WINAPI XA27SRC_SetFrequencyRatio(IXAudio27SourceVoice *iface, - float Ratio, UINT32 OperationSet) -{ - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - return XA2SRC_SetFrequencyRatio(&This->IXAudio2SourceVoice_iface, Ratio, OperationSet); -} + alcDestroyContext(This->al_ctx); + This->al_ctx = NULL; -static void WINAPI XA27SRC_GetFrequencyRatio(IXAudio27SourceVoice *iface, float *pRatio) -{ - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - return XA2SRC_GetFrequencyRatio(&This->IXAudio2SourceVoice_iface, pRatio); + LeaveCriticalSection(&This->lock); } -static HRESULT WINAPI XA27SRC_SetSourceSampleRate( - IXAudio27SourceVoice *iface, - UINT32 NewSourceSampleRate) +/* not present in XAudio2 2.7 */ +static void WINAPI XA2M_GetChannelMask(IXAudio2MasteringVoice *iface, + DWORD *pChannelMask) { - XA2SourceImpl *This = impl_from_IXAudio27SourceVoice(iface); - return XA2SRC_SetSourceSampleRate(&This->IXAudio2SourceVoice_iface, NewSourceSampleRate); + IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + + TRACE("%p %p\n", This, pChannelMask); + + *pChannelMask = This->fmt.dwChannelMask; } -static const IXAudio27SourceVoiceVtbl XAudio27SourceVoice_Vtbl = { - XA27SRC_GetVoiceDetails, - XA27SRC_SetOutputVoices, - XA27SRC_SetEffectChain, - XA27SRC_EnableEffect, - XA27SRC_DisableEffect, - XA27SRC_GetEffectState, - XA27SRC_SetEffectParameters, - XA27SRC_GetEffectParameters, - XA27SRC_SetFilterParameters, - XA27SRC_GetFilterParameters, - XA27SRC_SetOutputFilterParameters, - XA27SRC_GetOutputFilterParameters, - XA27SRC_SetVolume, - XA27SRC_GetVolume, - XA27SRC_SetChannelVolumes, - XA27SRC_GetChannelVolumes, - XA27SRC_SetOutputMatrix, - XA27SRC_GetOutputMatrix, - XA27SRC_DestroyVoice, - XA27SRC_Start, - XA27SRC_Stop, - XA27SRC_SubmitSourceBuffer, - XA27SRC_FlushSourceBuffers, - XA27SRC_Discontinuity, - XA27SRC_ExitLoop, - XA27SRC_GetState, - XA27SRC_SetFrequencyRatio, - XA27SRC_GetFrequencyRatio, - XA27SRC_SetSourceSampleRate +static const struct IXAudio2MasteringVoiceVtbl XAudio2MasteringVoice_Vtbl = { + XA2M_GetVoiceDetails, + XA2M_SetOutputVoices, + XA2M_SetEffectChain, + XA2M_EnableEffect, + XA2M_DisableEffect, + XA2M_GetEffectState, + XA2M_SetEffectParameters, + XA2M_GetEffectParameters, + XA2M_SetFilterParameters, + XA2M_GetFilterParameters, + XA2M_SetOutputFilterParameters, + XA2M_GetOutputFilterParameters, + XA2M_SetVolume, + XA2M_GetVolume, + XA2M_SetChannelVolumes, + XA2M_GetChannelVolumes, + XA2M_SetOutputMatrix, + XA2M_GetOutputMatrix, + XA2M_DestroyVoice, + XA2M_GetChannelMask }; -static void WINAPI XA2M_GetVoiceDetails(IXAudio2MasteringVoice *iface, +static void WINAPI XA2SUB_GetVoiceDetails(IXAudio2SubmixVoice *iface, XAUDIO2_VOICE_DETAILS *pVoiceDetails) { - IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + XA2SubmixImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %p\n", This, pVoiceDetails); } -static HRESULT WINAPI XA2M_SetOutputVoices(IXAudio2MasteringVoice *iface, +static HRESULT WINAPI XA2SUB_SetOutputVoices(IXAudio2SubmixVoice *iface, const XAUDIO2_VOICE_SENDS *pSendList) { - IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + XA2SubmixImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %p\n", This, pSendList); return S_OK; } -static HRESULT WINAPI XA2M_SetEffectChain(IXAudio2MasteringVoice *iface, +static HRESULT WINAPI XA2SUB_SetEffectChain(IXAudio2SubmixVoice *iface, const XAUDIO2_EFFECT_CHAIN *pEffectChain) { - IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + XA2SubmixImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %p\n", This, pEffectChain); return S_OK; } -static HRESULT WINAPI XA2M_EnableEffect(IXAudio2MasteringVoice *iface, UINT32 EffectIndex, +static HRESULT WINAPI XA2SUB_EnableEffect(IXAudio2SubmixVoice *iface, UINT32 EffectIndex, UINT32 OperationSet) { - IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + XA2SubmixImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %u, 0x%x\n", This, EffectIndex, OperationSet); return S_OK; } -static HRESULT WINAPI XA2M_DisableEffect(IXAudio2MasteringVoice *iface, UINT32 EffectIndex, +static HRESULT WINAPI XA2SUB_DisableEffect(IXAudio2SubmixVoice *iface, UINT32 EffectIndex, UINT32 OperationSet) { - IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + XA2SubmixImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %u, 0x%x\n", This, EffectIndex, OperationSet); return S_OK; } -static void WINAPI XA2M_GetEffectState(IXAudio2MasteringVoice *iface, UINT32 EffectIndex, +static void WINAPI XA2SUB_GetEffectState(IXAudio2SubmixVoice *iface, UINT32 EffectIndex, BOOL *pEnabled) { - IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + XA2SubmixImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %u, %p\n", This, EffectIndex, pEnabled); } -static HRESULT WINAPI XA2M_SetEffectParameters(IXAudio2MasteringVoice *iface, +static HRESULT WINAPI XA2SUB_SetEffectParameters(IXAudio2SubmixVoice *iface, UINT32 EffectIndex, const void *pParameters, UINT32 ParametersByteSize, UINT32 OperationSet) { - IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + XA2SubmixImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %u, %p, 0x%x, 0x%x\n", This, EffectIndex, pParameters, ParametersByteSize, OperationSet); return S_OK; } -static HRESULT WINAPI XA2M_GetEffectParameters(IXAudio2MasteringVoice *iface, +static HRESULT WINAPI XA2SUB_GetEffectParameters(IXAudio2SubmixVoice *iface, UINT32 EffectIndex, void *pParameters, UINT32 ParametersByteSize) { - IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + XA2SubmixImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %u, %p, 0x%x\n", This, EffectIndex, pParameters, ParametersByteSize); return S_OK; } -static HRESULT WINAPI XA2M_SetFilterParameters(IXAudio2MasteringVoice *iface, +static HRESULT WINAPI XA2SUB_SetFilterParameters(IXAudio2SubmixVoice *iface, const XAUDIO2_FILTER_PARAMETERS *pParameters, UINT32 OperationSet) { - IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + XA2SubmixImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %p, 0x%x\n", This, pParameters, OperationSet); return S_OK; } -static void WINAPI XA2M_GetFilterParameters(IXAudio2MasteringVoice *iface, +static void WINAPI XA2SUB_GetFilterParameters(IXAudio2SubmixVoice *iface, XAUDIO2_FILTER_PARAMETERS *pParameters) { - IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + XA2SubmixImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %p\n", This, pParameters); } -static HRESULT WINAPI XA2M_SetOutputFilterParameters(IXAudio2MasteringVoice *iface, +static HRESULT WINAPI XA2SUB_SetOutputFilterParameters(IXAudio2SubmixVoice *iface, IXAudio2Voice *pDestinationVoice, const XAUDIO2_FILTER_PARAMETERS *pParameters, UINT32 OperationSet) { - IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + XA2SubmixImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %p, %p, 0x%x\n", This, pDestinationVoice, pParameters, OperationSet); return S_OK; } -static void WINAPI XA2M_GetOutputFilterParameters(IXAudio2MasteringVoice *iface, +static void WINAPI XA2SUB_GetOutputFilterParameters(IXAudio2SubmixVoice *iface, IXAudio2Voice *pDestinationVoice, XAUDIO2_FILTER_PARAMETERS *pParameters) { - IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + XA2SubmixImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %p, %p\n", This, pDestinationVoice, pParameters); } -static HRESULT WINAPI XA2M_SetVolume(IXAudio2MasteringVoice *iface, float Volume, +static HRESULT WINAPI XA2SUB_SetVolume(IXAudio2SubmixVoice *iface, float Volume, UINT32 OperationSet) { - IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + XA2SubmixImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %f, 0x%x\n", This, Volume, OperationSet); return S_OK; } -static void WINAPI XA2M_GetVolume(IXAudio2MasteringVoice *iface, float *pVolume) +static void WINAPI XA2SUB_GetVolume(IXAudio2SubmixVoice *iface, float *pVolume) { - IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + XA2SubmixImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %p\n", This, pVolume); } -static HRESULT WINAPI XA2M_SetChannelVolumes(IXAudio2MasteringVoice *iface, UINT32 Channels, +static HRESULT WINAPI XA2SUB_SetChannelVolumes(IXAudio2SubmixVoice *iface, UINT32 Channels, const float *pVolumes, UINT32 OperationSet) { - IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + XA2SubmixImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %u, %p, 0x%x\n", This, Channels, pVolumes, OperationSet); return S_OK; } -static void WINAPI XA2M_GetChannelVolumes(IXAudio2MasteringVoice *iface, UINT32 Channels, +static void WINAPI XA2SUB_GetChannelVolumes(IXAudio2SubmixVoice *iface, UINT32 Channels, float *pVolumes) { - IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + XA2SubmixImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %u, %p\n", This, Channels, pVolumes); } -static HRESULT WINAPI XA2M_SetOutputMatrix(IXAudio2MasteringVoice *iface, +static HRESULT WINAPI XA2SUB_SetOutputMatrix(IXAudio2SubmixVoice *iface, IXAudio2Voice *pDestinationVoice, UINT32 SourceChannels, UINT32 DestinationChannels, const float *pLevelMatrix, UINT32 OperationSet) { - IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + XA2SubmixImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %p, %u, %u, %p, 0x%x\n", This, pDestinationVoice, SourceChannels, DestinationChannels, pLevelMatrix, OperationSet); return S_OK; } -static void WINAPI XA2M_GetOutputMatrix(IXAudio2MasteringVoice *iface, +static void WINAPI XA2SUB_GetOutputMatrix(IXAudio2SubmixVoice *iface, IXAudio2Voice *pDestinationVoice, UINT32 SourceChannels, UINT32 DestinationChannels, float *pLevelMatrix) { - IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + XA2SubmixImpl *This = impl_from_IXAudio2SubmixVoice(iface); TRACE("%p, %p, %u, %u, %p\n", This, pDestinationVoice, SourceChannels, DestinationChannels, pLevelMatrix); } -static void WINAPI XA2M_DestroyVoice(IXAudio2MasteringVoice *iface) +static void WINAPI XA2SUB_DestroyVoice(IXAudio2SubmixVoice *iface) { - IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); + XA2SubmixImpl *This = impl_from_IXAudio2SubmixVoice(iface); + TRACE("%p\n", This); -} -/* not present in XAudio2 2.7 */ -static void WINAPI XA2M_GetChannelMask(IXAudio2MasteringVoice *iface, - DWORD *pChannelMask) -{ - IXAudio2Impl *This = impl_from_IXAudio2MasteringVoice(iface); - TRACE("%p %p\n", This, pChannelMask); + EnterCriticalSection(&This->lock); + + This->in_use = FALSE; + + LeaveCriticalSection(&This->lock); } -struct IXAudio2MasteringVoiceVtbl XAudio2MasteringVoice_Vtbl = { - XA2M_GetVoiceDetails, - XA2M_SetOutputVoices, - XA2M_SetEffectChain, - XA2M_EnableEffect, - XA2M_DisableEffect, - XA2M_GetEffectState, - XA2M_SetEffectParameters, - XA2M_GetEffectParameters, - XA2M_SetFilterParameters, - XA2M_GetFilterParameters, - XA2M_SetOutputFilterParameters, - XA2M_GetOutputFilterParameters, - XA2M_SetVolume, - XA2M_GetVolume, - XA2M_SetChannelVolumes, - XA2M_GetChannelVolumes, - XA2M_SetOutputMatrix, - XA2M_GetOutputMatrix, - XA2M_DestroyVoice, - XA2M_GetChannelMask +static const struct IXAudio2SubmixVoiceVtbl XAudio2SubmixVoice_Vtbl = { + XA2SUB_GetVoiceDetails, + XA2SUB_SetOutputVoices, + XA2SUB_SetEffectChain, + XA2SUB_EnableEffect, + XA2SUB_DisableEffect, + XA2SUB_GetEffectState, + XA2SUB_SetEffectParameters, + XA2SUB_GetEffectParameters, + XA2SUB_SetFilterParameters, + XA2SUB_GetFilterParameters, + XA2SUB_SetOutputFilterParameters, + XA2SUB_GetOutputFilterParameters, + XA2SUB_SetVolume, + XA2SUB_GetVolume, + XA2SUB_SetChannelVolumes, + XA2SUB_GetChannelVolumes, + XA2SUB_SetOutputMatrix, + XA2SUB_GetOutputMatrix, + XA2SUB_DestroyVoice }; static HRESULT WINAPI IXAudio2Impl_QueryInterface(IXAudio2 *iface, REFIID riid, @@ -870,9 +1189,15 @@ if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IXAudio2)) *ppvObject = &This->IXAudio2_iface; - else if(IsEqualGUID(riid, &IID_IXAudio27)) - *ppvObject = &This->IXAudio27_iface; - else + else if(IsEqualGUID(riid, &IID_IXAudio27)){ + /* all xaudio versions before 28 share an IID */ + if(This->version == 20) + *ppvObject = &This->IXAudio20_iface; + else if(This->version == 21 || This->version == 22) + *ppvObject = &This->IXAudio22_iface; + else + *ppvObject = &This->IXAudio27_iface; + }else *ppvObject = NULL; if(*ppvObject){ @@ -901,14 +1226,41 @@ TRACE("(%p)->(): Refcount now %u\n", This, ref); if (!ref) { + int i; XA2SourceImpl *src, *src2; + XA2SubmixImpl *sub, *sub2; + + if(This->engine){ + This->stop_engine = TRUE; + SetEvent(This->mmevt); + WaitForSingleObject(This->engine, INFINITE); + CloseHandle(This->engine); + } LIST_FOR_EACH_ENTRY_SAFE(src, src2, &This->source_voices, XA2SourceImpl, entry){ + HeapFree(GetProcessHeap(), 0, src->sends); IXAudio2SourceVoice_DestroyVoice(&src->IXAudio2SourceVoice_iface); DeleteCriticalSection(&src->lock); HeapFree(GetProcessHeap(), 0, src); } + LIST_FOR_EACH_ENTRY_SAFE(sub, sub2, &This->submix_voices, XA2SubmixImpl, entry){ + IXAudio2SubmixVoice_DestroyVoice(&sub->IXAudio2SubmixVoice_iface); + DeleteCriticalSection(&sub->lock); + HeapFree(GetProcessHeap(), 0, sub); + } + + IXAudio2MasteringVoice_DestroyVoice(&This->IXAudio2MasteringVoice_iface); + + if(This->devenum) + IMMDeviceEnumerator_Release(This->devenum); + for(i = 0; i < This->ndevs; ++i) + CoTaskMemFree(This->devids[i]); + HeapFree(GetProcessHeap(), 0, This->devids); + HeapFree(GetProcessHeap(), 0, This->cbs); + + CloseHandle(This->mmevt); + DeleteCriticalSection(&This->lock); HeapFree(GetProcessHeap(), 0, This); @@ -920,18 +1272,52 @@ IXAudio2EngineCallback *pCallback) { IXAudio2Impl *This = impl_from_IXAudio2(iface); + int i; - FIXME("(%p)->(%p): stub!\n", This, pCallback); + TRACE("(%p)->(%p)\n", This, pCallback); - return E_NOTIMPL; + EnterCriticalSection(&This->lock); + + for(i = 0; i < This->ncbs; ++i){ + if(!This->cbs[i] || This->cbs[i] == pCallback){ + This->cbs[i] = pCallback; + LeaveCriticalSection(&This->lock); + return S_OK; + } + } + + This->ncbs *= 2; + This->cbs = HeapReAlloc(GetProcessHeap(), 0, This->cbs, This->ncbs * sizeof(*This->cbs)); + + This->cbs[i] = pCallback; + + LeaveCriticalSection(&This->lock); + + return S_OK; } static void WINAPI IXAudio2Impl_UnregisterForCallbacks(IXAudio2 *iface, IXAudio2EngineCallback *pCallback) { IXAudio2Impl *This = impl_from_IXAudio2(iface); + int i; + + TRACE("(%p)->(%p)\n", This, pCallback); + + EnterCriticalSection(&This->lock); + + for(i = 0; i < This->ncbs; ++i){ + if(This->cbs[i] == pCallback) + break; + } + + for(; i < This->ncbs - 1 && This->cbs[i + 1]; ++i) + This->cbs[i] = This->cbs[i + 1]; - FIXME("(%p)->(%p): stub!\n", This, pCallback); + if(i < This->ncbs) + This->cbs[i] = NULL; + + LeaveCriticalSection(&This->lock); } static WAVEFORMATEX *copy_waveformat(const WAVEFORMATEX *wfex) @@ -958,6 +1344,7 @@ { IXAudio2Impl *This = impl_from_IXAudio2(iface); XA2SourceImpl *src; + HRESULT hr; TRACE("(%p)->(%p, %p, 0x%x, %f, %p, %p, %p)\n", This, ppSourceVoice, pSourceFormat, flags, maxFrequencyRatio, pCallback, pSendList, @@ -981,22 +1368,51 @@ list_add_head(&This->source_voices, &src->entry); + src->IXAudio20SourceVoice_iface.lpVtbl = &XAudio20SourceVoice_Vtbl; + src->IXAudio23SourceVoice_iface.lpVtbl = &XAudio23SourceVoice_Vtbl; src->IXAudio27SourceVoice_iface.lpVtbl = &XAudio27SourceVoice_Vtbl; src->IXAudio2SourceVoice_iface.lpVtbl = &XAudio2SourceVoice_Vtbl; InitializeCriticalSection(&src->lock); src->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": XA2SourceImpl.lock"); + + src->xa2 = This; } src->in_use = TRUE; + src->running = FALSE; LeaveCriticalSection(&This->lock); src->cb = pCallback; + src->al_fmt = get_al_format(pSourceFormat); + if(!src->al_fmt){ + src->in_use = FALSE; + WARN("OpenAL can't convert this format!\n"); + return AUDCLNT_E_UNSUPPORTED_FORMAT; + } + + src->submit_blocksize = pSourceFormat->nBlockAlign; + src->fmt = copy_waveformat(pSourceFormat); - if(This->version == 27) + hr = XA2SRC_SetOutputVoices(&src->IXAudio2SourceVoice_iface, pSendList); + if(FAILED(hr)){ + src->in_use = FALSE; + return hr; + } + + alGenSources(1, &src->al_src); + alGenBuffers(XAUDIO2_MAX_QUEUED_BUFFERS, src->al_bufs); + + alSourcePlay(src->al_src); + + if(This->version == 20) + *ppSourceVoice = (IXAudio2SourceVoice*)&src->IXAudio20SourceVoice_iface; + else if(This->version <= 23) + *ppSourceVoice = (IXAudio2SourceVoice*)&src->IXAudio23SourceVoice_iface; + else if(This->version <= 27) *ppSourceVoice = (IXAudio2SourceVoice*)&src->IXAudio27SourceVoice_iface; else *ppSourceVoice = &src->IXAudio2SourceVoice_iface; @@ -1013,12 +1429,72 @@ const XAUDIO2_EFFECT_CHAIN *pEffectChain) { IXAudio2Impl *This = impl_from_IXAudio2(iface); + XA2SubmixImpl *sub; - FIXME("(%p)->(%p, %u, %u, 0x%x, %u, %p, %p): stub!\n", This, ppSubmixVoice, + TRACE("(%p)->(%p, %u, %u, 0x%x, %u, %p, %p)\n", This, ppSubmixVoice, inputChannels, inputSampleRate, flags, processingStage, pSendList, pEffectChain); - return E_NOTIMPL; + EnterCriticalSection(&This->lock); + + LIST_FOR_EACH_ENTRY(sub, &This->submix_voices, XA2SubmixImpl, entry){ + if(!sub->in_use) + break; + } + + if(&sub->entry == &This->submix_voices){ + sub = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*sub)); + if(!sub){ + LeaveCriticalSection(&This->lock); + return E_OUTOFMEMORY; + } + + list_add_head(&This->submix_voices, &sub->entry); + + sub->IXAudio20SubmixVoice_iface.lpVtbl = &XAudio20SubmixVoice_Vtbl; + sub->IXAudio23SubmixVoice_iface.lpVtbl = &XAudio23SubmixVoice_Vtbl; + sub->IXAudio2SubmixVoice_iface.lpVtbl = &XAudio2SubmixVoice_Vtbl; + + InitializeCriticalSection(&sub->lock); + sub->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": XA2SubmixImpl.lock"); + } + + sub->in_use = TRUE; + + LeaveCriticalSection(&This->lock); + + if(This->version == 20) + *ppSubmixVoice = (IXAudio2SubmixVoice*)&sub->IXAudio20SubmixVoice_iface; + else if(This->version <= 23) + *ppSubmixVoice = (IXAudio2SubmixVoice*)&sub->IXAudio23SubmixVoice_iface; + else + *ppSubmixVoice = &sub->IXAudio2SubmixVoice_iface; + + TRACE("Created submix voice: %p\n", sub); + + return S_OK; +} + +static ALenum al_get_loopback_format(const WAVEFORMATEXTENSIBLE *fmt) +{ + if(fmt->Format.wFormatTag == WAVE_FORMAT_PCM || + (fmt->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE && + IsEqualGUID(&fmt->SubFormat, &KSDATAFORMAT_SUBTYPE_PCM))){ + switch(fmt->Format.wBitsPerSample){ + case 8: + return ALC_UNSIGNED_BYTE_SOFT; + case 16: + return ALC_SHORT_SOFT; + case 32: + return ALC_INT_SOFT; + } + }else if(fmt->Format.wFormatTag == WAVE_FORMAT_IEEE_FLOAT || + (fmt->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE && + IsEqualGUID(&fmt->SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT))){ + if(fmt->Format.wBitsPerSample == 32) + return ALC_FLOAT_SOFT; + } + return 0; } static HRESULT WINAPI IXAudio2Impl_CreateMasteringVoice(IXAudio2 *iface, @@ -1028,8 +1504,13 @@ AUDIO_STREAM_CATEGORY streamCategory) { IXAudio2Impl *This = impl_from_IXAudio2(iface); + IMMDevice *dev; + HRESULT hr; + WAVEFORMATEX *fmt; + ALCint attrs[7]; + REFERENCE_TIME period, bufdur; - FIXME("(%p)->(%p, %u, %u, 0x%x, %s, %p, 0x%x): stub!\n", This, + TRACE("(%p)->(%p, %u, %u, 0x%x, %s, %p, 0x%x)\n", This, ppMasteringVoice, inputChannels, inputSampleRate, flags, wine_dbgstr_w(deviceId), pEffectChain, streamCategory); @@ -1039,28 +1520,232 @@ if(pEffectChain) WARN("Effect chain is unimplemented\n"); - /* TODO: Initialize mmdevice */ + EnterCriticalSection(&This->lock); /* there can only be one Mastering Voice, so just build it into XA2 */ - *ppMasteringVoice = &This->IXAudio2MasteringVoice_iface; + if(This->aclient){ + LeaveCriticalSection(&This->lock); + return COMPAT_E_INVALID_CALL(This->version); + } - return S_OK; + if(!deviceId){ + if(This->ndevs == 0){ + LeaveCriticalSection(&This->lock); + return ERROR_NOT_FOUND; + } + deviceId = This->devids[0]; + } + + hr = IMMDeviceEnumerator_GetDevice(This->devenum, deviceId, &dev); + if(FAILED(hr)){ + WARN("GetDevice failed: %08x\n", hr); + hr = COMPAT_E_DEVICE_INVALIDATED(This->version); + goto exit; + } + + hr = IMMDevice_Activate(dev, &IID_IAudioClient, + CLSCTX_INPROC_SERVER, NULL, (void**)&This->aclient); + if(FAILED(hr)){ + WARN("Activate(IAudioClient) failed: %08x\n", hr); + IMMDevice_Release(dev); + hr = COMPAT_E_DEVICE_INVALIDATED(This->version); + goto exit; + } + + IMMDevice_Release(dev); + + hr = IAudioClient_GetMixFormat(This->aclient, &fmt); + if(FAILED(hr)){ + WARN("GetMixFormat failed: %08x\n", hr); + hr = COMPAT_E_DEVICE_INVALIDATED(This->version); + goto exit; + } + + if(sizeof(WAVEFORMATEX) + fmt->cbSize > sizeof(WAVEFORMATEXTENSIBLE)){ + FIXME("Mix format doesn't fit into WAVEFORMATEXTENSIBLE!\n"); + hr = COMPAT_E_DEVICE_INVALIDATED(This->version); + goto exit; + } + + if(inputChannels == XAUDIO2_DEFAULT_CHANNELS) + inputChannels = fmt->nChannels; + if(inputSampleRate == XAUDIO2_DEFAULT_SAMPLERATE) + inputSampleRate = fmt->nSamplesPerSec; + + memcpy(&This->fmt, fmt, sizeof(WAVEFORMATEX) + fmt->cbSize); + This->fmt.Format.nChannels = inputChannels; + This->fmt.Format.nSamplesPerSec = inputSampleRate; + This->fmt.Format.nBlockAlign = This->fmt.Format.nChannels * This->fmt.Format.wBitsPerSample / 8; + This->fmt.Format.nAvgBytesPerSec = This->fmt.Format.nSamplesPerSec * This->fmt.Format.nBlockAlign; + This->fmt.dwChannelMask = get_channel_mask(This->fmt.Format.nChannels); + + CoTaskMemFree(fmt); + fmt = NULL; + + hr = IAudioClient_IsFormatSupported(This->aclient, + AUDCLNT_SHAREMODE_SHARED, &This->fmt.Format, &fmt); + if(hr == S_FALSE){ + if(sizeof(WAVEFORMATEX) + fmt->cbSize > sizeof(WAVEFORMATEXTENSIBLE)){ + FIXME("Mix format doesn't fit into WAVEFORMATEXTENSIBLE!\n"); + hr = COMPAT_E_DEVICE_INVALIDATED(This->version); + goto exit; + } + memcpy(&This->fmt, fmt, sizeof(WAVEFORMATEX) + fmt->cbSize); + } + + CoTaskMemFree(fmt); + + hr = IAudioClient_GetDevicePeriod(This->aclient, &period, NULL); + if(FAILED(hr)){ + WARN("GetDevicePeriod failed: %08x\n", hr); + hr = COMPAT_E_DEVICE_INVALIDATED(This->version); + goto exit; + } + + /* 3 periods or 0.1 seconds */ + bufdur = max(3 * period, 1000000); + + hr = IAudioClient_Initialize(This->aclient, AUDCLNT_SHAREMODE_SHARED, + AUDCLNT_STREAMFLAGS_EVENTCALLBACK, bufdur, + 0, &This->fmt.Format, NULL); + if(FAILED(hr)){ + WARN("Initialize failed: %08x\n", hr); + hr = COMPAT_E_DEVICE_INVALIDATED(This->version); + goto exit; + } + + This->period_frames = MulDiv(period, inputSampleRate, 10000000); + + hr = IAudioClient_SetEventHandle(This->aclient, This->mmevt); + if(FAILED(hr)){ + WARN("Initialize failed: %08x\n", hr); + hr = COMPAT_E_DEVICE_INVALIDATED(This->version); + goto exit; + } + + hr = IAudioClient_GetService(This->aclient, &IID_IAudioRenderClient, + (void**)&This->render); + if(FAILED(hr)){ + WARN("GetService(IAudioRenderClient) failed: %08x\n", hr); + hr = COMPAT_E_DEVICE_INVALIDATED(This->version); + goto exit; + } + + /* setup openal context */ + attrs[0] = ALC_FORMAT_CHANNELS_SOFT; + switch(inputChannels){ + case 1: + attrs[1] = ALC_MONO_SOFT; + break; + case 2: + attrs[1] = ALC_STEREO_SOFT; + break; + case 4: + attrs[1] = ALC_QUAD_SOFT; + break; + case 6: + attrs[1] = ALC_5POINT1_SOFT; + break; + case 7: + attrs[1] = ALC_6POINT1_SOFT; + break; + case 8: + attrs[1] = ALC_7POINT1_SOFT; + break; + default: + WARN("OpenAL doesn't support %u channels\n", inputChannels); + LeaveCriticalSection(&This->lock); + return AUDCLNT_E_UNSUPPORTED_FORMAT; + } + attrs[2] = ALC_FREQUENCY; + attrs[3] = inputSampleRate; + attrs[4] = ALC_FORMAT_TYPE_SOFT; + attrs[5] = al_get_loopback_format(&This->fmt); + attrs[6] = 0; + + if(!attrs[5]){ + WARN("OpenAL can't output samples in this format\n"); + hr = COMPAT_E_DEVICE_INVALIDATED(This->version); + goto exit; + } + + This->al_device = palcLoopbackOpenDeviceSOFT(NULL); + if(!This->al_device){ + WARN("alcLoopbackOpenDeviceSOFT failed\n"); + hr = COMPAT_E_DEVICE_INVALIDATED(This->version); + goto exit; + } + + This->al_ctx = alcCreateContext(This->al_device, attrs); + if(!This->al_ctx){ + WARN("alcCreateContext failed\n"); + hr = COMPAT_E_DEVICE_INVALIDATED(This->version); + goto exit; + } + + if(alcMakeContextCurrent(This->al_ctx) == ALC_FALSE){ + WARN("alcMakeContextCurrent failed\n"); + hr = COMPAT_E_DEVICE_INVALIDATED(This->version); + goto exit; + } + + IAudioClient_Start(This->aclient); + + if(This->version <= 20) + *ppMasteringVoice = (IXAudio2MasteringVoice*)&This->IXAudio20MasteringVoice_iface; + else if(This->version <= 23) + *ppMasteringVoice = (IXAudio2MasteringVoice*)&This->IXAudio23MasteringVoice_iface; + else + *ppMasteringVoice = &This->IXAudio2MasteringVoice_iface; + +exit: + if(FAILED(hr)){ + if(This->render){ + IAudioRenderClient_Release(This->render); + This->render = NULL; + } + if(This->aclient){ + IAudioClient_Release(This->aclient); + This->aclient = NULL; + } + if(This->al_ctx){ + alcDestroyContext(This->al_ctx); + This->al_ctx = NULL; + } + if(This->al_device){ + alcCloseDevice(This->al_device); + This->al_device = NULL; + } + } + + LeaveCriticalSection(&This->lock); + + return hr; } +static DWORD WINAPI engine_threadproc(void *arg); + static HRESULT WINAPI IXAudio2Impl_StartEngine(IXAudio2 *iface) { IXAudio2Impl *This = impl_from_IXAudio2(iface); - FIXME("(%p)->(): stub!\n", This); + TRACE("(%p)->()\n", This); - return E_NOTIMPL; + This->running = TRUE; + + if(!This->engine) + This->engine = CreateThread(NULL, 0, engine_threadproc, This, 0, NULL); + + return S_OK; } static void WINAPI IXAudio2Impl_StopEngine(IXAudio2 *iface) { IXAudio2Impl *This = impl_from_IXAudio2(iface); - FIXME("(%p)->(): stub!\n", This); + TRACE("(%p)->()\n", This); + + This->running = FALSE; } static HRESULT WINAPI IXAudio2Impl_CommitChanges(IXAudio2 *iface, @@ -1068,7 +1753,7 @@ { IXAudio2Impl *This = impl_from_IXAudio2(iface); - FIXME("(%p)->(0x%x): stub!\n", This, operationSet); + TRACE("(%p)->(0x%x): stub!\n", This, operationSet); return E_NOTIMPL; } @@ -1078,7 +1763,9 @@ { IXAudio2Impl *This = impl_from_IXAudio2(iface); - FIXME("(%p)->(%p): stub!\n", This, pPerfData); + TRACE("(%p)->(%p): stub!\n", This, pPerfData); + + memset(pPerfData, 0, sizeof(*pPerfData)); } static void WINAPI IXAudio2Impl_SetDebugConfiguration(IXAudio2 *iface, @@ -1108,154 +1795,17 @@ IXAudio2Impl_SetDebugConfiguration }; -static HRESULT WINAPI XA27_QueryInterface(IXAudio27 *iface, REFIID riid, - void **ppvObject) -{ - IXAudio2Impl *This = impl_from_IXAudio27(iface); - return IXAudio2Impl_QueryInterface(&This->IXAudio2_iface, riid, ppvObject); -} - -static ULONG WINAPI XA27_AddRef(IXAudio27 *iface) -{ - IXAudio2Impl *This = impl_from_IXAudio27(iface); - return IXAudio2Impl_AddRef(&This->IXAudio2_iface); -} - -static ULONG WINAPI XA27_Release(IXAudio27 *iface) -{ - IXAudio2Impl *This = impl_from_IXAudio27(iface); - return IXAudio2Impl_Release(&This->IXAudio2_iface); -} - -static HRESULT WINAPI XA27_GetDeviceCount(IXAudio27 *iface, UINT32 *pCount) -{ - IXAudio2Impl *This = impl_from_IXAudio27(iface); - TRACE("(%p)->(%p)\n", This, pCount); - return E_NOTIMPL; -} - -static HRESULT WINAPI XA27_GetDeviceDetails(IXAudio27 *iface, UINT32 index, - XAUDIO2_DEVICE_DETAILS *pDeviceDetails) -{ - IXAudio2Impl *This = impl_from_IXAudio27(iface); - TRACE("(%p)->(%u, %p)\n", This, index, pDeviceDetails); - return E_NOTIMPL; -} - -static HRESULT WINAPI XA27_Initialize(IXAudio27 *iface, UINT32 flags, - XAUDIO2_PROCESSOR processor) -{ - IXAudio2Impl *This = impl_from_IXAudio27(iface); - TRACE("(%p)->(0x%x, 0x%x)\n", This, flags, processor); - return S_OK; -} - -static HRESULT WINAPI XA27_RegisterForCallbacks(IXAudio27 *iface, - IXAudio2EngineCallback *pCallback) -{ - IXAudio2Impl *This = impl_from_IXAudio27(iface); - return IXAudio2Impl_RegisterForCallbacks(&This->IXAudio2_iface, pCallback); -} - -static void WINAPI XA27_UnregisterForCallbacks(IXAudio27 *iface, - IXAudio2EngineCallback *pCallback) -{ - IXAudio2Impl *This = impl_from_IXAudio27(iface); - IXAudio2Impl_UnregisterForCallbacks(&This->IXAudio2_iface, pCallback); -} - -static HRESULT WINAPI XA27_CreateSourceVoice(IXAudio27 *iface, - IXAudio2SourceVoice **ppSourceVoice, const WAVEFORMATEX *pSourceFormat, - UINT32 flags, float maxFrequencyRatio, - IXAudio2VoiceCallback *pCallback, const XAUDIO2_VOICE_SENDS *pSendList, - const XAUDIO2_EFFECT_CHAIN *pEffectChain) -{ - IXAudio2Impl *This = impl_from_IXAudio27(iface); - return IXAudio2Impl_CreateSourceVoice(&This->IXAudio2_iface, ppSourceVoice, - pSourceFormat, flags, maxFrequencyRatio, pCallback, pSendList, - pEffectChain); -} - -static HRESULT WINAPI XA27_CreateSubmixVoice(IXAudio27 *iface, - IXAudio2SubmixVoice **ppSubmixVoice, UINT32 inputChannels, - UINT32 inputSampleRate, UINT32 flags, UINT32 processingStage, - const XAUDIO2_VOICE_SENDS *pSendList, - const XAUDIO2_EFFECT_CHAIN *pEffectChain) -{ - IXAudio2Impl *This = impl_from_IXAudio27(iface); - return IXAudio2Impl_CreateSubmixVoice(&This->IXAudio2_iface, ppSubmixVoice, - inputChannels, inputSampleRate, flags, processingStage, pSendList, - pEffectChain); -} - -static HRESULT WINAPI XA27_CreateMasteringVoice(IXAudio27 *iface, - IXAudio2MasteringVoice **ppMasteringVoice, UINT32 inputChannels, - UINT32 inputSampleRate, UINT32 flags, UINT32 deviceIndex, - const XAUDIO2_EFFECT_CHAIN *pEffectChain) -{ - IXAudio2Impl *This = impl_from_IXAudio27(iface); - TRACE("(%p)->(%p, %u, %u, 0x%x, %u, %p)\n", This, ppMasteringVoice, - inputChannels, inputSampleRate, flags, deviceIndex, - pEffectChain); - /* TODO: Convert DeviceIndex to DeviceId */ - return IXAudio2Impl_CreateMasteringVoice(&This->IXAudio2_iface, - ppMasteringVoice, inputChannels, inputSampleRate, flags, 0, - pEffectChain, AudioCategory_GameEffects); -} - -static HRESULT WINAPI XA27_StartEngine(IXAudio27 *iface) -{ - IXAudio2Impl *This = impl_from_IXAudio27(iface); - return IXAudio2Impl_StartEngine(&This->IXAudio2_iface); -} - -static void WINAPI XA27_StopEngine(IXAudio27 *iface) -{ - IXAudio2Impl *This = impl_from_IXAudio27(iface); - return IXAudio2Impl_StopEngine(&This->IXAudio2_iface); -} - -static HRESULT WINAPI XA27_CommitChanges(IXAudio27 *iface, UINT32 operationSet) -{ - IXAudio2Impl *This = impl_from_IXAudio27(iface); - return IXAudio2Impl_CommitChanges(&This->IXAudio2_iface, operationSet); -} +struct xaudio2_cf { + IClassFactory IClassFactory_iface; + LONG ref; + DWORD version; +}; -static void WINAPI XA27_GetPerformanceData(IXAudio27 *iface, - XAUDIO2_PERFORMANCE_DATA *pPerfData) +struct xaudio2_cf *impl_from_IClassFactory(IClassFactory *iface) { - IXAudio2Impl *This = impl_from_IXAudio27(iface); - return IXAudio2Impl_GetPerformanceData(&This->IXAudio2_iface, pPerfData); + return CONTAINING_RECORD(iface, struct xaudio2_cf, IClassFactory_iface); } -static void WINAPI XA27_SetDebugConfiguration(IXAudio27 *iface, - const XAUDIO2_DEBUG_CONFIGURATION *pDebugConfiguration, - void *pReserved) -{ - IXAudio2Impl *This = impl_from_IXAudio27(iface); - return IXAudio2Impl_SetDebugConfiguration(&This->IXAudio2_iface, - pDebugConfiguration, pReserved); -} - -static const IXAudio27Vtbl XAudio27_Vtbl = { - XA27_QueryInterface, - XA27_AddRef, - XA27_Release, - XA27_GetDeviceCount, - XA27_GetDeviceDetails, - XA27_Initialize, - XA27_RegisterForCallbacks, - XA27_UnregisterForCallbacks, - XA27_CreateSourceVoice, - XA27_CreateSubmixVoice, - XA27_CreateMasteringVoice, - XA27_StartEngine, - XA27_StopEngine, - XA27_CommitChanges, - XA27_GetPerformanceData, - XA27_SetDebugConfiguration -}; - static HRESULT WINAPI XAudio2CF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppobj) { if(IsEqualGUID(riid, &IID_IUnknown) @@ -1273,21 +1823,103 @@ static ULONG WINAPI XAudio2CF_AddRef(IClassFactory *iface) { - return 2; + struct xaudio2_cf *This = impl_from_IClassFactory(iface); + ULONG ref = InterlockedIncrement(&This->ref); + TRACE("(%p)->(): Refcount now %u\n", This, ref); + return ref; } static ULONG WINAPI XAudio2CF_Release(IClassFactory *iface) { - return 1; + struct xaudio2_cf *This = impl_from_IClassFactory(iface); + ULONG ref = InterlockedDecrement(&This->ref); + TRACE("(%p)->(): Refcount now %u\n", This, ref); + if (!ref) + HeapFree(GetProcessHeap(), 0, This); + return ref; +} + +static HRESULT initialize_mmdevices(IXAudio2Impl *This) +{ + IMMDeviceCollection *devcoll; + UINT devcount; + HRESULT hr; + + if(!This->devenum){ + hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, + CLSCTX_INPROC_SERVER, &IID_IMMDeviceEnumerator, (void**)&This->devenum); + if(FAILED(hr)) + return hr; + } + + hr = IMMDeviceEnumerator_EnumAudioEndpoints(This->devenum, eRender, + DEVICE_STATE_ACTIVE, &devcoll); + if(FAILED(hr)){ + return hr; + } + + hr = IMMDeviceCollection_GetCount(devcoll, &devcount); + if(FAILED(hr)){ + IMMDeviceCollection_Release(devcoll); + return hr; + } + + if(devcount > 0){ + UINT i, count = 1; + IMMDevice *dev, *def_dev; + + /* make sure that device 0 is the default device */ + IMMDeviceEnumerator_GetDefaultAudioEndpoint(This->devenum, eRender, eConsole, &def_dev); + + This->devids = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR *) * devcount); + + for(i = 0; i < devcount; ++i){ + hr = IMMDeviceCollection_Item(devcoll, i, &dev); + if(SUCCEEDED(hr)){ + UINT idx; + + if(dev == def_dev) + idx = 0; + else{ + idx = count; + ++count; + } + + hr = IMMDevice_GetId(dev, &This->devids[idx]); + if(FAILED(hr)){ + WARN("GetId failed: %08x\n", hr); + HeapFree(GetProcessHeap(), 0, This->devids); + This->devids = NULL; + IMMDevice_Release(dev); + return hr; + } + + IMMDevice_Release(dev); + }else{ + WARN("Item failed: %08x\n", hr); + HeapFree(GetProcessHeap(), 0, This->devids); + This->devids = NULL; + IMMDeviceCollection_Release(devcoll); + return hr; + } + } + } + + IMMDeviceCollection_Release(devcoll); + + This->ndevs = devcount; + + return S_OK; } static HRESULT WINAPI XAudio2CF_CreateInstance(IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppobj) { + struct xaudio2_cf *This = impl_from_IClassFactory(iface); HRESULT hr; IXAudio2Impl *object; - TRACE("(static)->(%p,%s,%p)\n", pOuter, debugstr_guid(riid), ppobj); + TRACE("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj); *ppobj = NULL; @@ -1298,23 +1930,45 @@ if(!object) return E_OUTOFMEMORY; + object->IXAudio20_iface.lpVtbl = &XAudio20_Vtbl; + object->IXAudio22_iface.lpVtbl = &XAudio22_Vtbl; object->IXAudio27_iface.lpVtbl = &XAudio27_Vtbl; object->IXAudio2_iface.lpVtbl = &XAudio2_Vtbl; + object->IXAudio20MasteringVoice_iface.lpVtbl = &XAudio20MasteringVoice_Vtbl; + object->IXAudio23MasteringVoice_iface.lpVtbl = &XAudio23MasteringVoice_Vtbl; object->IXAudio2MasteringVoice_iface.lpVtbl = &XAudio2MasteringVoice_Vtbl; if(IsEqualGUID(riid, &IID_IXAudio27)) - object->version = 27; - else + object->version = This->version; + else /* only xaudio 2.8 has a different IID */ object->version = 28; list_init(&object->source_voices); + list_init(&object->submix_voices); + object->mmevt = CreateEventW(NULL, FALSE, FALSE, NULL); InitializeCriticalSection(&object->lock); object->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IXAudio2Impl.lock"); hr = IXAudio2_QueryInterface(&object->IXAudio2_iface, riid, ppobj); - if(FAILED(hr)) + if(FAILED(hr)){ HeapFree(GetProcessHeap(), 0, object); + return hr; + } + + hr = initialize_mmdevices(object); + if(FAILED(hr)){ + IUnknown_Release((IUnknown*)*ppobj); + return hr; + } + + object->ncbs = 4; + object->cbs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, object->ncbs * sizeof(*object->cbs)); + + IXAudio2_StartEngine(&object->IXAudio2_iface); + + TRACE("Created XAudio version %u: %p\n", object->version, object); + return hr; } @@ -1333,7 +1987,14 @@ XAudio2CF_LockServer }; -static IClassFactory xaudio2_cf = { &XAudio2CF_Vtbl }; +static IClassFactory *make_xaudio2_factory(DWORD version) +{ + struct xaudio2_cf *ret = HeapAlloc(GetProcessHeap(), 0, sizeof(struct xaudio2_cf)); + ret->IClassFactory_iface.lpVtbl = &XAudio2CF_Vtbl; + ret->version = version; + ret->ref = 0; + return &ret->IClassFactory_iface; +} HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv) { @@ -1341,10 +2002,330 @@ TRACE("(%s, %s, %p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); - if(IsEqualGUID(rclsid, &CLSID_XAudio2)) { - factory = &xaudio2_cf; + if(IsEqualGUID(rclsid, &CLSID_XAudio20)){ + factory = make_xaudio2_factory(20); + }else if(IsEqualGUID(rclsid, &CLSID_XAudio21)){ + factory = make_xaudio2_factory(21); + }else if(IsEqualGUID(rclsid, &CLSID_XAudio22)){ + factory = make_xaudio2_factory(22); + }else if(IsEqualGUID(rclsid, &CLSID_XAudio23)){ + factory = make_xaudio2_factory(23); + }else if(IsEqualGUID(rclsid, &CLSID_XAudio24)){ + factory = make_xaudio2_factory(24); + }else if(IsEqualGUID(rclsid, &CLSID_XAudio25)){ + factory = make_xaudio2_factory(25); + }else if(IsEqualGUID(rclsid, &CLSID_XAudio26)){ + factory = make_xaudio2_factory(26); + }else if(IsEqualGUID(rclsid, &CLSID_XAudio2)){ + factory = make_xaudio2_factory(27); + + }else if(IsEqualGUID(rclsid, &CLSID_AudioVolumeMeter20)){ + factory = make_xapo_factory(&CLSID_AudioVolumeMeter, 20); + }else if(IsEqualGUID(rclsid, &CLSID_AudioVolumeMeter21)){ + factory = make_xapo_factory(&CLSID_AudioVolumeMeter, 21); + }else if(IsEqualGUID(rclsid, &CLSID_AudioVolumeMeter22)){ + factory = make_xapo_factory(&CLSID_AudioVolumeMeter, 22); + }else if(IsEqualGUID(rclsid, &CLSID_AudioVolumeMeter23)){ + factory = make_xapo_factory(&CLSID_AudioVolumeMeter, 23); + }else if(IsEqualGUID(rclsid, &CLSID_AudioVolumeMeter24)){ + factory = make_xapo_factory(&CLSID_AudioVolumeMeter, 24); + }else if(IsEqualGUID(rclsid, &CLSID_AudioVolumeMeter25)){ + factory = make_xapo_factory(&CLSID_AudioVolumeMeter, 25); + }else if(IsEqualGUID(rclsid, &CLSID_AudioVolumeMeter26)){ + factory = make_xapo_factory(&CLSID_AudioVolumeMeter, 26); + }else if(IsEqualGUID(rclsid, &CLSID_AudioVolumeMeter)){ + factory = make_xapo_factory(&CLSID_AudioVolumeMeter, 27); + + }else if(IsEqualGUID(rclsid, &CLSID_AudioReverb20)){ + factory = make_xapo_factory(&CLSID_AudioReverb, 20); + + }else if(IsEqualGUID(rclsid, &CLSID_AudioReverb21) || + IsEqualGUID(rclsid, &CLSID_WINE_FXReverb10)){ + factory = make_xapo_factory(&CLSID_AudioReverb, 21); + + }else if(IsEqualGUID(rclsid, &CLSID_AudioReverb22) || + IsEqualGUID(rclsid, &CLSID_WINE_FXReverb11)){ + factory = make_xapo_factory(&CLSID_AudioReverb, 22); + + }else if(IsEqualGUID(rclsid, &CLSID_AudioReverb23) || + IsEqualGUID(rclsid, &CLSID_WINE_FXReverb12)){ + factory = make_xapo_factory(&CLSID_AudioReverb, 23); + + }else if(IsEqualGUID(rclsid, &CLSID_AudioReverb24) || + IsEqualGUID(rclsid, &CLSID_WINE_FXReverb13)){ + factory = make_xapo_factory(&CLSID_AudioReverb, 24); + + }else if(IsEqualGUID(rclsid, &CLSID_AudioReverb25)){ + factory = make_xapo_factory(&CLSID_AudioReverb, 25); + + }else if(IsEqualGUID(rclsid, &CLSID_AudioReverb26) || + IsEqualGUID(rclsid, &CLSID_WINE_FXReverb14)){ + factory = make_xapo_factory(&CLSID_AudioReverb, 26); + + }else if(IsEqualGUID(rclsid, &CLSID_AudioReverb) || + IsEqualGUID(rclsid, &CLSID_WINE_FXReverb15)){ + factory = make_xapo_factory(&CLSID_AudioReverb, 27); + + }else if(IsEqualGUID(rclsid, &CLSID_WINE_FXReverb28)){ + factory = make_xapo_factory(&CLSID_AudioReverb, 28); + + + }else if(IsEqualGUID(rclsid, &CLSID_WINE_FXEQ10)){ + factory = make_xapo_factory(&CLSID_FXEQ, 21); + }else if(IsEqualGUID(rclsid, &CLSID_WINE_FXEQ11)){ + factory = make_xapo_factory(&CLSID_FXEQ, 22); + }else if(IsEqualGUID(rclsid, &CLSID_WINE_FXEQ12)){ + factory = make_xapo_factory(&CLSID_FXEQ, 23); + }else if(IsEqualGUID(rclsid, &CLSID_WINE_FXEQ13)){ + factory = make_xapo_factory(&CLSID_FXEQ, 24); + }else if(IsEqualGUID(rclsid, &CLSID_WINE_FXEQ14)){ + factory = make_xapo_factory(&CLSID_FXEQ, 26); + }else if(IsEqualGUID(rclsid, &CLSID_WINE_FXEQ15)){ + factory = make_xapo_factory(&CLSID_FXEQ, 27); + }else if(IsEqualGUID(rclsid, &CLSID_WINE_FXEQ28)){ + factory = make_xapo_factory(&CLSID_FXEQ, 28); } + if(!factory) return CLASS_E_CLASSNOTAVAILABLE; return IClassFactory_QueryInterface(factory, riid, ppv); } + +/* returns TRUE if there is more data avilable in the buffer, FALSE if the + * buffer's data has all been queued */ +static BOOL xa2buffer_queue_period(XA2SourceImpl *src, XA2Buffer *buf, ALuint al_buf) +{ + UINT32 submit_bytes; + const BYTE *submit_buf = NULL; + + if(buf->offs_bytes >= buf->cur_end_bytes){ + WARN("Shouldn't happen: Trying to push frames from a spent buffer?\n"); + return FALSE; + } + + submit_bytes = min(src->xa2->period_frames * src->submit_blocksize, buf->cur_end_bytes - buf->offs_bytes); + submit_buf = buf->xa2buffer.pAudioData + buf->offs_bytes; + buf->offs_bytes += submit_bytes; + + alBufferData(al_buf, src->al_fmt, submit_buf, submit_bytes, + src->fmt->nSamplesPerSec); + + alSourceQueueBuffers(src->al_src, 1, &al_buf); + + src->in_al_bytes += submit_bytes; + src->al_bufs_used++; + + buf->latest_al_buf = al_buf; + + TRACE("queueing %u bytes, now %u in AL\n", submit_bytes, src->in_al_bytes); + + return buf->offs_bytes < buf->cur_end_bytes; +} + +/* Looping: + * + * The looped section of a buffer is a subset of the play area which is looped + * LoopCount times. + * + * v PlayBegin + * vvvvvvvvvvvvvvvvvv PlayLength + * v (PlayEnd) + * [-----PPPLLLLLLLLPPPPPPP------] + * ^ LoopBegin + * ^^^^^^^^ LoopLength + * ^ (LoopEnd) + * + * In the simple case, playback will start at PlayBegin. At LoopEnd, playback + * will move to LoopBegin and repeat that loop LoopCount times. Then, playback + * will cease at LoopEnd. + * + * If PlayLength is zero, then PlayEnd is the end of the buffer. + * + * If LoopLength is zero, then LoopEnd is PlayEnd. + * + * For corner cases and version differences, see tests. + */ +static void update_source_state(XA2SourceImpl *src) +{ + int i; + ALint processed; + ALint bufpos; + + alGetSourcei(src->al_src, AL_BUFFERS_PROCESSED, &processed); + + if(processed > 0){ + ALuint al_buffers[XAUDIO2_MAX_QUEUED_BUFFERS]; + + alSourceUnqueueBuffers(src->al_src, processed, al_buffers); + src->first_al_buf += processed; + src->first_al_buf %= XAUDIO2_MAX_QUEUED_BUFFERS; + src->al_bufs_used -= processed; + + for(i = 0; i < processed; ++i){ + ALint bufsize; + + alGetBufferi(al_buffers[i], AL_SIZE, &bufsize); + + src->in_al_bytes -= bufsize; + src->played_frames += bufsize / src->submit_blocksize; + + if(al_buffers[i] == src->buffers[src->first_buf].latest_al_buf){ + DWORD old_buf = src->first_buf; + + src->first_buf++; + src->first_buf %= XAUDIO2_MAX_QUEUED_BUFFERS; + src->nbufs--; + + TRACE("%p: done with buffer %u\n", src, old_buf); + + if(src->buffers[old_buf].xa2buffer.Flags & XAUDIO2_END_OF_STREAM) + src->played_frames = 0; + + if(src->cb){ + IXAudio2VoiceCallback_OnBufferEnd(src->cb, + src->buffers[old_buf].xa2buffer.pContext); + if(src->buffers[old_buf].xa2buffer.Flags & XAUDIO2_END_OF_STREAM) + IXAudio2VoiceCallback_OnStreamEnd(src->cb); + + if(src->nbufs > 0) + IXAudio2VoiceCallback_OnBufferStart(src->cb, + src->buffers[src->first_buf].xa2buffer.pContext); + } + } + } + } + + alGetSourcei(src->al_src, AL_BYTE_OFFSET, &bufpos); + + /* maintain 4 periods in AL */ + while(src->cur_buf != (src->first_buf + src->nbufs) % XAUDIO2_MAX_QUEUED_BUFFERS && + src->in_al_bytes - bufpos < 4 * src->xa2->period_frames * src->submit_blocksize){ + TRACE("%p: going to queue a period from buffer %u\n", src, src->cur_buf); + + /* starting from an empty buffer */ + if(src->cb && src->cur_buf == src->first_buf && src->buffers[src->cur_buf].offs_bytes == 0 && !src->buffers[src->cur_buf].looped) + IXAudio2VoiceCallback_OnBufferStart(src->cb, + src->buffers[src->first_buf].xa2buffer.pContext); + + if(!xa2buffer_queue_period(src, &src->buffers[src->cur_buf], + src->al_bufs[(src->first_al_buf + src->al_bufs_used) % XAUDIO2_MAX_QUEUED_BUFFERS])){ + XA2Buffer *cur = &src->buffers[src->cur_buf]; + + if(cur->looped < cur->xa2buffer.LoopCount){ + if(cur->xa2buffer.LoopCount != XAUDIO2_LOOP_INFINITE) + ++cur->looped; + else + cur->looped = 1; /* indicate that we are executing a loop */ + + cur->offs_bytes = cur->xa2buffer.LoopBegin; + if(cur->looped == cur->xa2buffer.LoopCount) + cur->cur_end_bytes = cur->play_end_bytes; + else + cur->cur_end_bytes = cur->loop_end_bytes; + + if(src->cb) + IXAudio2VoiceCallback_OnLoopEnd(src->cb, + src->buffers[src->cur_buf].xa2buffer.pContext); + + }else{ + /* buffer is spent, move on */ + src->cur_buf++; + src->cur_buf %= XAUDIO2_MAX_QUEUED_BUFFERS; + } + } + } +} + +static void do_engine_tick(IXAudio2Impl *This) +{ + BYTE *buf; + XA2SourceImpl *src; + HRESULT hr; + UINT32 nframes, i, pad; + + /* maintain up to 3 periods in mmdevapi */ + hr = IAudioClient_GetCurrentPadding(This->aclient, &pad); + if(FAILED(hr)){ + WARN("GetCurrentPadding failed: 0x%x\n", hr); + return; + } + + nframes = This->period_frames * 3 - pad; + + TRACE("frames available: %u\n", nframes); + + if(nframes < This->period_frames) + return; + + if(!nframes) + return; + + for(i = 0; i < This->ncbs && This->cbs[i]; ++i) + IXAudio2EngineCallback_OnProcessingPassStart(This->cbs[i]); + + LIST_FOR_EACH_ENTRY(src, &This->source_voices, XA2SourceImpl, entry){ + ALint st = 0; + + EnterCriticalSection(&src->lock); + + if(!src->in_use || !src->running){ + LeaveCriticalSection(&src->lock); + continue; + } + + if(src->cb){ + if(This->version == 20) + IXAudio20VoiceCallback_OnVoiceProcessingPassStart((IXAudio20VoiceCallback*)src->cb); + else + /* TODO: detect incoming underrun and inform callback */ + IXAudio2VoiceCallback_OnVoiceProcessingPassStart(src->cb, 0); + } + + update_source_state(src); + + alGetSourcei(src->al_src, AL_SOURCE_STATE, &st); + if(st != AL_PLAYING) + alSourcePlay(src->al_src); + + if(src->cb) + IXAudio2VoiceCallback_OnVoiceProcessingPassEnd(src->cb); + + LeaveCriticalSection(&src->lock); + } + + hr = IAudioRenderClient_GetBuffer(This->render, nframes, &buf); + if(FAILED(hr)) + WARN("GetBuffer failed: %08x\n", hr); + + palcRenderSamplesSOFT(This->al_device, buf, nframes); + + hr = IAudioRenderClient_ReleaseBuffer(This->render, nframes, 0); + if(FAILED(hr)) + WARN("ReleaseBuffer failed: %08x\n", hr); + + for(i = 0; i < This->ncbs && This->cbs[i]; ++i) + IXAudio2EngineCallback_OnProcessingPassEnd(This->cbs[i]); +} + +static DWORD WINAPI engine_threadproc(void *arg) +{ + IXAudio2Impl *This = arg; + while(1){ + WaitForSingleObject(This->mmevt, INFINITE); + + if(This->stop_engine) + break; + + EnterCriticalSection(&This->lock); + + if(!This->running || !This->aclient){ + LeaveCriticalSection(&This->lock); + continue; + } + + do_engine_tick(This); + + LeaveCriticalSection(&This->lock); + } + return 0; +} diff -Nru wine1.7-1.7.50/dlls/xaudio2_7/xaudio_private.h wine1.7-1.7.55/dlls/xaudio2_7/xaudio_private.h --- wine1.7-1.7.50/dlls/xaudio2_7/xaudio_private.h 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_7/xaudio_private.h 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2015 Andrew Eikum 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 "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "wine/list.h" + +#include "mmsystem.h" +#include "xaudio2.h" +#include "xaudio2fx.h" +#include "xapo.h" +#include "devpkey.h" +#include "mmdeviceapi.h" +#include "audioclient.h" + +#include +#include +#include + +typedef struct _XA2Buffer { + XAUDIO2_BUFFER xa2buffer; + DWORD offs_bytes; + UINT32 latest_al_buf, looped, loop_end_bytes, play_end_bytes, cur_end_bytes; +} XA2Buffer; + +typedef struct _IXAudio2Impl IXAudio2Impl; + +typedef struct _XA2SourceImpl { + IXAudio20SourceVoice IXAudio20SourceVoice_iface; + IXAudio23SourceVoice IXAudio23SourceVoice_iface; + IXAudio27SourceVoice IXAudio27SourceVoice_iface; + IXAudio2SourceVoice IXAudio2SourceVoice_iface; + + IXAudio2Impl *xa2; + + BOOL in_use; + + CRITICAL_SECTION lock; + + WAVEFORMATEX *fmt; + ALenum al_fmt; + UINT32 submit_blocksize; + + IXAudio2VoiceCallback *cb; + + DWORD nsends; + XAUDIO2_SEND_DESCRIPTOR *sends; + + BOOL running; + + UINT64 played_frames; + + XA2Buffer buffers[XAUDIO2_MAX_QUEUED_BUFFERS]; + UINT32 first_buf, cur_buf, nbufs, in_al_bytes; + + UINT32 scratch_bytes, convert_bytes; + BYTE *scratch_buf, *convert_buf; + + ALuint al_src; + /* most cases will only need about 4 AL buffers, but some corner cases + * could require up to MAX_QUEUED_BUFFERS */ + ALuint al_bufs[XAUDIO2_MAX_QUEUED_BUFFERS]; + DWORD first_al_buf, al_bufs_used; + + struct list entry; +} XA2SourceImpl; + +typedef struct _XA2SubmixImpl { + IXAudio20SubmixVoice IXAudio20SubmixVoice_iface; + IXAudio23SubmixVoice IXAudio23SubmixVoice_iface; + IXAudio2SubmixVoice IXAudio2SubmixVoice_iface; + + BOOL in_use; + + CRITICAL_SECTION lock; + + struct list entry; +} XA2SubmixImpl; + +struct _IXAudio2Impl { + IXAudio20 IXAudio20_iface; + IXAudio22 IXAudio22_iface; + IXAudio27 IXAudio27_iface; + IXAudio2 IXAudio2_iface; + IXAudio20MasteringVoice IXAudio20MasteringVoice_iface; + IXAudio23MasteringVoice IXAudio23MasteringVoice_iface; + IXAudio2MasteringVoice IXAudio2MasteringVoice_iface; + + LONG ref; + + CRITICAL_SECTION lock; + + HANDLE engine, mmevt; + BOOL stop_engine; + + DWORD version; + + struct list source_voices; + struct list submix_voices; + + IMMDeviceEnumerator *devenum; + + WCHAR **devids; + UINT32 ndevs; + + UINT32 last_query_glitches; + + IAudioClient *aclient; + IAudioRenderClient *render; + + UINT32 period_frames; + + WAVEFORMATEXTENSIBLE fmt; + + ALCdevice *al_device; + ALCcontext *al_ctx; + + UINT32 ncbs; + IXAudio2EngineCallback **cbs; + + BOOL running; +}; + +extern const IXAudio27SourceVoiceVtbl XAudio27SourceVoice_Vtbl DECLSPEC_HIDDEN; +extern const IXAudio27Vtbl XAudio27_Vtbl DECLSPEC_HIDDEN; + +extern const IXAudio23SourceVoiceVtbl XAudio23SourceVoice_Vtbl DECLSPEC_HIDDEN; +extern const IXAudio23SubmixVoiceVtbl XAudio23SubmixVoice_Vtbl DECLSPEC_HIDDEN; +extern const IXAudio23MasteringVoiceVtbl XAudio23MasteringVoice_Vtbl DECLSPEC_HIDDEN; + +extern const IXAudio22Vtbl XAudio22_Vtbl DECLSPEC_HIDDEN; + +extern const IXAudio20Vtbl XAudio20_Vtbl DECLSPEC_HIDDEN; +extern const IXAudio20SourceVoiceVtbl XAudio20SourceVoice_Vtbl DECLSPEC_HIDDEN; +extern const IXAudio20SubmixVoiceVtbl XAudio20SubmixVoice_Vtbl DECLSPEC_HIDDEN; +extern const IXAudio20MasteringVoiceVtbl XAudio20MasteringVoice_Vtbl DECLSPEC_HIDDEN; + +extern IClassFactory *make_xapo_factory(REFCLSID clsid, DWORD version); diff -Nru wine1.7-1.7.50/dlls/xaudio2_8/Makefile.in wine1.7-1.7.55/dlls/xaudio2_8/Makefile.in --- wine1.7-1.7.50/dlls/xaudio2_8/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_8/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -1,4 +1,5 @@ MODULE = xaudio2_8.dll +IMPORTLIB = xaudio2_8 IMPORTS = ole32 C_SRCS = \ diff -Nru wine1.7-1.7.50/dlls/xaudio2_8/xaudio2_8.spec wine1.7-1.7.55/dlls/xaudio2_8/xaudio2_8.spec --- wine1.7-1.7.50/dlls/xaudio2_8/xaudio2_8.spec 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_8/xaudio2_8.spec 2015-11-13 14:32:40.000000000 +0000 @@ -1 +1,6 @@ @ stdcall XAudio2Create(ptr long long) +@ stdcall CreateAudioVolumeMeter(ptr) +@ stdcall CreateAudioReverb(ptr) +@ cdecl CreateFX(ptr ptr ptr long) +@ cdecl X3DAudioCalculate(ptr ptr ptr long ptr) +@ cdecl X3DAudioInitialize(long float ptr) diff -Nru wine1.7-1.7.50/dlls/xaudio2_8/xaudio_dll.c wine1.7-1.7.55/dlls/xaudio2_8/xaudio_dll.c --- wine1.7-1.7.50/dlls/xaudio2_8/xaudio_dll.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/xaudio2_8/xaudio_dll.c 2015-11-13 14:32:40.000000000 +0000 @@ -23,9 +23,16 @@ #include "windef.h" #include "winbase.h" #include "winuser.h" +#include "wine/debug.h" #include "initguid.h" #include "xaudio2.h" +#include "xaudio2fx.h" +#include "xapo.h" +#include "xapofx.h" +#include "x3daudio.h" + +WINE_DEFAULT_DEBUG_CHANNEL(xaudio2); BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { @@ -71,3 +78,86 @@ return S_OK; } + +HRESULT WINAPI CreateAudioVolumeMeter(IUnknown **out) +{ + return CoCreateInstance(&CLSID_AudioVolumeMeter, NULL, CLSCTX_INPROC_SERVER, + &IID_IUnknown, (void**)out); +} + +HRESULT WINAPI CreateAudioReverb(IUnknown **out) +{ + return CoCreateInstance(&CLSID_AudioReverb, NULL, CLSCTX_INPROC_SERVER, + &IID_IUnknown, (void**)out); +} + +HRESULT CDECL CreateFX(REFCLSID clsid, IUnknown **out, void *initdata, UINT32 initdata_bytes) +{ + HRESULT hr; + IUnknown *obj; + const GUID *class; + + *out = NULL; + class = clsid; + + if(IsEqualGUID(clsid, &CLSID_FXReverb27) || + IsEqualGUID(clsid, &CLSID_FXReverb)) + class = &CLSID_WINE_FXReverb28; + else if(IsEqualGUID(clsid, &CLSID_FXEQ27) || + IsEqualGUID(clsid, &CLSID_FXEQ)) + class = &CLSID_WINE_FXEQ28; + + hr = CoCreateInstance(class, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)&obj); + if(FAILED(hr)){ + WARN("CoCreateInstance failed: %08x\n", hr); + return hr; + } + + if(initdata && initdata_bytes > 0){ + IXAPO *xapo; + + hr = IUnknown_QueryInterface(obj, &IID_IXAPO, (void**)&xapo); + if(SUCCEEDED(hr)){ + hr = IXAPO_Initialize(xapo, initdata, initdata_bytes); + + IXAPO_Release(xapo); + + if(FAILED(hr)){ + WARN("Initialize failed: %08x\n", hr); + IUnknown_Release(obj); + return hr; + } + } + } + + *out = obj; + + return S_OK; +} + +HRESULT CDECL X3DAudioInitialize(UINT32 chanmask, float speedofsound, + X3DAUDIO_HANDLE handle) +{ + FIXME("0x%x, %f, %p: Stub!\n", chanmask, speedofsound, handle); + return S_OK; +} + +void CDECL X3DAudioCalculate(const X3DAUDIO_HANDLE handle, + const X3DAUDIO_LISTENER *listener, const X3DAUDIO_EMITTER *emitter, + UINT32 flags, X3DAUDIO_DSP_SETTINGS *out) +{ + static int once = 0; + if(!once){ + FIXME("%p %p %p 0x%x %p: Stub!\n", handle, listener, emitter, flags, out); + ++once; + } + + out->LPFDirectCoefficient = 0; + out->LPFReverbCoefficient = 0; + out->ReverbLevel = 0; + out->DopplerFactor = 1; + out->EmitterToListenerAngle = 0; + out->EmitterToListenerDistance = 0; + out->EmitterVelocityComponent = 0; + out->ListenerVelocityComponent = 0; +} diff -Nru wine1.7-1.7.50/dlls/xmllite/reader.c wine1.7-1.7.55/dlls/xmllite/reader.c --- wine1.7-1.7.50/dlls/xmllite/reader.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/xmllite/reader.c 2015-11-13 14:32:40.000000000 +0000 @@ -2855,7 +2855,7 @@ static BOOL WINAPI xmlreader_IsEOF(IXmlReader* iface) { FIXME("(%p): stub\n", iface); - return E_NOTIMPL; + return FALSE; } static const struct IXmlReaderVtbl xmlreader_vtbl = diff -Nru wine1.7-1.7.50/dlls/xmllite/tests/reader.c wine1.7-1.7.55/dlls/xmllite/tests/reader.c --- wine1.7-1.7.50/dlls/xmllite/tests/reader.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/dlls/xmllite/tests/reader.c 2015-11-13 14:32:40.000000000 +0000 @@ -1431,6 +1431,7 @@ ok(value[0] == 'c', "got %s\n", wine_dbgstr_w(value)); IXmlReader_Release(reader); + IStream_Release(stream); } static struct test_entry cdata_tests[] = { diff -Nru wine1.7-1.7.50/documentation/Makefile.in wine1.7-1.7.55/documentation/Makefile.in --- wine1.7-1.7.50/documentation/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/documentation/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -install-man:: - @cd $(top_builddir) && $(MAKE) manpages - for i in man$(api_manext)/*.$(api_manext); do $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/$$i; done - -clean:: - $(RM) -r html api-guide api-guide-xml man$(api_manext) diff -Nru wine1.7-1.7.50/fonts/Makefile.in wine1.7-1.7.55/fonts/Makefile.in --- wine1.7-1.7.50/fonts/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/fonts/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -11,7 +11,3 @@ tahoma.sfd \ tahomabd.sfd \ wingding.sfd - -# Make sure that make_makefiles sees the generated rules -install install-lib:: -clean:: diff -Nru wine1.7-1.7.50/fonts/symbol.sfd wine1.7-1.7.55/fonts/symbol.sfd --- wine1.7-1.7.50/fonts/symbol.sfd 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/fonts/symbol.sfd 2015-11-13 14:32:40.000000000 +0000 @@ -71,7 +71,7 @@ 0 0 EndShort -LangName: 1033 "" "" "Regular" "WineSymbol:Version 0.001" "" "Version 0.001 February 3, 2009, initial release" "" "" "Wine" "Jon Parshall for CodeWeavers" "" "http://www.winehq.org" "http://www.codeweavers.com" "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.+AAoACgAA-This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.+AAoACgAA-A copy of the GNU Lesser General Public License is included in the Wine distribution in the file COPYING.LIB. If you did not receive this copy, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA." "http://www.gnu.org/licenses/lgpl.html" +LangName: 1033 "" "" "Regular" "WineSymbol:Version 1.1" "" "Version 1.1 February 3, 2009, initial release" "" "" "Wine" "Jon Parshall for CodeWeavers" "" "http://www.winehq.org" "http://www.codeweavers.com" "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.+AAoACgAA-This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.+AAoACgAA-A copy of the GNU Lesser General Public License is included in the Wine distribution in the file COPYING.LIB. If you did not receive this copy, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA." "http://www.gnu.org/licenses/lgpl.html" GaspTable: 1 65535 2 0 Encoding: Custom UnicodeInterp: none Binary files /tmp/lGkLrqMI3A/wine1.7-1.7.50/fonts/symbol.ttf and /tmp/i40nZWR050/wine1.7-1.7.55/fonts/symbol.ttf differ diff -Nru wine1.7-1.7.50/include/access.idl wine1.7-1.7.55/include/access.idl --- wine1.7-1.7.50/include/access.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/access.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + [ object, uuid(0c733a8c-2a1c-11ce-ade5-00aa0044773d), @@ -34,7 +38,7 @@ [call_as(AddRefAccessor)] HRESULT RemoteAddRefAccessor([in] HACCESSOR hAccessor, - [in, out, unique, annotation("__out_opt")] DBREFCOUNT *pcRefCount, + [in, out, unique] DBREFCOUNT *pcRefCount, [out] IErrorInfo **ppErrorInfoRem); [local] diff -Nru wine1.7-1.7.50/include/advpub.h wine1.7-1.7.55/include/advpub.h --- wine1.7-1.7.50/include/advpub.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/advpub.h 2015-11-13 14:32:40.000000000 +0000 @@ -135,6 +135,10 @@ #define RSC_FLAG_DELAYREGISTEROCX 0x00000200 #define RSC_FLAG_SETUPAPI 0x00000400 +/* Flags for LaunchINFSection */ +#define LIS_QUIET 0x00000001 +#define LIS_NOGRPCONV 0x00000002 + /* Flags for DelNode */ #define ADN_DEL_IF_EMPTY 0x00000001 #define ADN_DONT_DEL_SUBDIRS 0x00000002 diff -Nru wine1.7-1.7.50/include/asynot.idl wine1.7-1.7.55/include/asynot.idl --- wine1.7-1.7.50/include/asynot.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/asynot.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + [ object, uuid(0c733a96-2a1c-11ce-ade5-00aa0044773d), diff -Nru wine1.7-1.7.50/include/asysta.idl wine1.7-1.7.55/include/asysta.idl --- wine1.7-1.7.50/include/asysta.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/asysta.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + [ object, uuid(0c733a95-2a1c-11ce-ade5-00aa0044773d), diff -Nru wine1.7-1.7.50/include/axcore.idl wine1.7-1.7.55/include/axcore.idl --- wine1.7-1.7.50/include/axcore.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/axcore.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + #define CHARS_IN_GUID 39 cpp_quote("#define CHARS_IN_GUID 39") @@ -655,3 +659,42 @@ { AM_MEDIAEVENT_NONOTIFY = 0x01 }; + +enum _AMSTREAMSELECTINFOFLAGS +{ + AMSTREAMSELECTINFO_ENABLED = 0x1, + AMSTREAMSELECTINFO_EXCLUSIVE = 0x2 +}; + +enum _AMSTREAMSELECTENABLEFLAGS +{ + AMSTREAMSELECTENABLE_ENABLE = 0x1, + AMSTREAMSELECTENABLE_ENABLEALL = 0x2 +}; + +[ +object, +uuid(c1960960-17f5-11d1-abe1-00a0c905f375), +pointer_default(unique) +] +interface IAMStreamSelect : IUnknown +{ + HRESULT Count( + [out] DWORD *streams); + + HRESULT Info( + [in] long index, + [out] AM_MEDIA_TYPE **media_type, + [out] DWORD *flags, + [out] LCID *lcid, + [out] DWORD *group, + [out] WCHAR **name, + [out] IUnknown **object, + [out] IUnknown **unknown); + + HRESULT Enable( + [in] long index, + [in] DWORD flags); +} + +typedef IAMStreamSelect *PAMSTREAMSELECT; diff -Nru wine1.7-1.7.50/include/axextend.idl wine1.7-1.7.55/include/axextend.idl --- wine1.7-1.7.50/include/axextend.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/axextend.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + interface IAMAnalogVideoDecoder; interface IAMAnalogVideoEncoder; interface IAMAudioInputMixer; diff -Nru wine1.7-1.7.50/include/bcrypt.h wine1.7-1.7.55/include/bcrypt.h --- wine1.7-1.7.50/include/bcrypt.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/bcrypt.h 2015-11-13 14:32:40.000000000 +0000 @@ -49,6 +49,7 @@ typedef PVOID BCRYPT_ALG_HANDLE; typedef PVOID BCRYPT_HANDLE; +typedef PVOID BCRYPT_HASH_HANDLE; #define BCRYPT_RNG_USE_ENTROPY_IN_BUFFER 0x00000001 #define BCRYPT_USE_SYSTEM_PREFERRED_RNG 0x00000002 diff -Nru wine1.7-1.7.50/include/binres.idl wine1.7-1.7.55/include/binres.idl --- wine1.7-1.7.50/include/binres.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/binres.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + [ object, uuid(0c733ab1-2a1c-11ce-ade5-00aa0044773d), diff -Nru wine1.7-1.7.50/include/chprst.idl wine1.7-1.7.55/include/chprst.idl --- wine1.7-1.7.50/include/chprst.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/chprst.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + [ object, uuid(0c733a93-2a1c-11ce-ade5-00aa0044773d), diff -Nru wine1.7-1.7.50/include/cmdbas.idl wine1.7-1.7.55/include/cmdbas.idl --- wine1.7-1.7.50/include/cmdbas.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/cmdbas.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + [ object, uuid(0c733a63-2a1c-11ce-ade5-00aa0044773d), diff -Nru wine1.7-1.7.50/include/cmdtxt.idl wine1.7-1.7.55/include/cmdtxt.idl --- wine1.7-1.7.50/include/cmdtxt.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/cmdtxt.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + [ object, uuid(0c733a27-2a1c-11ce-ade5-00aa0044773d), diff -Nru wine1.7-1.7.50/include/commctrl.h wine1.7-1.7.55/include/commctrl.h --- wine1.7-1.7.50/include/commctrl.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/commctrl.h 2015-11-13 14:32:40.000000000 +0000 @@ -42,7 +42,14 @@ LANGID WINAPI GetMUILanguage (VOID); VOID WINAPI InitMUILanguage (LANGID uiLang); -HRESULT WINAPI LoadIconWithScaleDown(HINSTANCE, PCWSTR, int, int, HICON *); +enum _LI_METRIC +{ + LIM_SMALL, + LIM_LARGE +}; + +HRESULT WINAPI LoadIconWithScaleDown(HINSTANCE, const WCHAR *, int, int, HICON *); +HRESULT WINAPI LoadIconMetric(HINSTANCE, const WCHAR *, int, HICON *); #define COMCTL32_VERSION 5 /* dll version */ @@ -1206,14 +1213,15 @@ #define TB_GETSTRINGW (WM_USER+91) #define TB_GETSTRINGA (WM_USER+92) #define TB_GETSTRING WINELIB_NAME_AW(TB_GETSTRING) - -/* undocumented messages in Toolbar */ -#ifdef __WINESRC__ -#define TB_UNKWN45D (WM_USER+93) +#define TB_SETBOUNDINGSIZE (WM_USER+93) #define TB_SETHOTITEM2 (WM_USER+94) +#define TB_HASACCELERATOR (WM_USER+95) #define TB_SETLISTGAP (WM_USER+96) #define TB_GETIMAGELISTCOUNT (WM_USER+98) #define TB_GETIDEALSIZE (WM_USER+99) + +/* undocumented messages in Toolbar */ +#ifdef __WINESRC__ #define TB_UNKWN464 (WM_USER+100) #endif diff -Nru wine1.7-1.7.50/include/config.h.in wine1.7-1.7.55/include/config.h.in --- wine1.7-1.7.50/include/config.h.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/config.h.in 2015-11-13 14:32:40.000000000 +0000 @@ -696,6 +696,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_PTHREAD_NP_H +/* Define to 1 if you have the header file. */ +#undef HAVE_PULSE_PULSEAUDIO_H + /* Define to 1 if you have the header file. */ #undef HAVE_PWD_H diff -Nru wine1.7-1.7.50/include/crtrow.idl wine1.7-1.7.55/include/crtrow.idl --- wine1.7-1.7.50/include/crtrow.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/crtrow.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + [ object, uuid(0c733ab2-2a1c-11ce-ade5-00aa0044773d), diff -Nru wine1.7-1.7.50/include/d3d11.idl wine1.7-1.7.55/include/d3d11.idl --- wine1.7-1.7.50/include/d3d11.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/d3d11.idl 2015-11-13 14:32:40.000000000 +0000 @@ -87,12 +87,17 @@ cpp_quote("#define D3D11_FLOAT32_MAX (3.402823466e+38f)") +const UINT D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT = 32; + const unsigned int D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT = 8; const UINT D3D11_MAX_MAXANISOTROPY = 16; const UINT D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT = 32; const UINT D3D11_VIEWPORT_BOUNDS_MAX = 32767; const INT D3D11_VIEWPORT_BOUNDS_MIN = -32768; +const UINT D3D11_VIEWPORT_AND_SCISSORRECT_MAX_INDEX = 15; +const UINT D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE = 16; + const UINT D3D11_SHADER_MAJOR_VERSION = 5; const UINT D3D11_SHADER_MAX_INSTANCES = 65535; const UINT D3D11_SHADER_MAX_INTERFACES = 253; @@ -528,6 +533,11 @@ D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM3, } D3D11_QUERY; +typedef enum D3D11_QUERY_MISC_FLAG +{ + D3D11_QUERY_MISC_PREDICATEHINT = 0x1, +} D3D11_QUERY_MISC_FLAG; + typedef enum D3D11_ASYNC_GETDATA_FLAG { D3D11_ASYNC_GETDATA_DONOTFLUSH = 0x0001, @@ -1218,6 +1228,195 @@ UINT MiscFlags; } D3D11_TEXTURE3D_DESC; +typedef struct D3D11_VIDEO_DECODER_DESC +{ + GUID Guid; + UINT SampleWidth; + UINT SampleHeight; + DXGI_FORMAT OutputFormat; +} D3D11_VIDEO_DECODER_DESC; + +typedef struct D3D11_VIDEO_DECODER_CONFIG +{ + GUID guidConfigBitstreamEncryption; + GUID guidConfigMBcontrolEncryption; + GUID guidConfigResidDiffEncryption; + UINT ConfigBitstreamRaw; + UINT ConfigMBcontrolRasterOrder; + UINT ConfigResidDiffHost; + UINT ConfigSpatialResid8; + UINT ConfigResid8Subtraction; + UINT ConfigSpatialHost8or9Clipping; + UINT ConfigSpatialResidInterleaved; + UINT ConfigIntraResidUnsigned; + UINT ConfigResidDiffAccelerator; + UINT ConfigHostInverseScan; + UINT ConfigSpecificIDCT; + UINT Config4GroupedCoefs; + USHORT ConfigMinRenderTargetBuffCount; + USHORT ConfigDecoderSpecific; +} D3D11_VIDEO_DECODER_CONFIG; + +typedef enum D3D11_VIDEO_FRAME_FORMAT +{ + D3D11_VIDEO_FRAME_FORMAT_PROGRESSIVE = 0, + D3D11_VIDEO_FRAME_FORMAT_INTERLACED_TOP_FIELD_FIRST = 1, + D3D11_VIDEO_FRAME_FORMAT_INTERLACED_BOTTOM_FIELD_FIRST = 2 +} D3D11_VIDEO_FRAME_FORMAT; + +typedef enum D3D11_VIDEO_USAGE +{ + D3D11_VIDEO_USAGE_PLAYBACK_NORMAL = 0, + D3D11_VIDEO_USAGE_OPTIMAL_SPEED = 1, + D3D11_VIDEO_USAGE_OPTIMAL_QUALITY = 2 +} D3D11_VIDEO_USAGE; + +typedef struct D3D11_VIDEO_PROCESSOR_CONTENT_DESC +{ + D3D11_VIDEO_FRAME_FORMAT InputFrameFormat; + DXGI_RATIONAL InputFrameRate; + UINT InputWidth; + UINT InputHeight; + DXGI_RATIONAL OutputFrameRate; + UINT OutputWidth; + UINT OutputHeight; + D3D11_VIDEO_USAGE Usage; +} D3D11_VIDEO_PROCESSOR_CONTENT_DESC; + +typedef struct D3D11_VIDEO_PROCESSOR_CAPS +{ + UINT DeviceCaps; + UINT FeatureCaps; + UINT FilterCaps; + UINT InputFormatCaps; + UINT AutoStreamCaps; + UINT StereoCaps; + UINT RateConversionCapsCount; + UINT MaxInputStreams; + UINT MaxStreamStates; +} D3D11_VIDEO_PROCESSOR_CAPS; + +typedef struct D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS +{ + UINT PastFrames; + UINT FutureFrames; + UINT ProcessorCaps; + UINT ITelecineCaps; + UINT CustomRateCount; +} D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS; + +typedef struct D3D11_VIDEO_PROCESSOR_CUSTOM_RATE +{ + DXGI_RATIONAL CustomRate; + UINT OutputFrames; + BOOL InputInterlaced; + UINT InputFramesOrFields; +} D3D11_VIDEO_PROCESSOR_CUSTOM_RATE; + +typedef enum D3D11_VIDEO_PROCESSOR_FILTER +{ + D3D11_VIDEO_PROCESSOR_FILTER_BRIGHTNESS = 0, + D3D11_VIDEO_PROCESSOR_FILTER_CONTRAST = 1, + D3D11_VIDEO_PROCESSOR_FILTER_HUE = 2, + D3D11_VIDEO_PROCESSOR_FILTER_SATURATION = 3, + D3D11_VIDEO_PROCESSOR_FILTER_NOISE_REDUCTION = 4, + D3D11_VIDEO_PROCESSOR_FILTER_EDGE_ENHANCEMENT = 5, + D3D11_VIDEO_PROCESSOR_FILTER_ANAMORPHIC_SCALING = 6, + D3D11_VIDEO_PROCESSOR_FILTER_STEREO_ADJUSTMENT = 7 +} D3D11_VIDEO_PROCESSOR_FILTER; + +typedef struct D3D11_VIDEO_PROCESSOR_FILTER_RANGE +{ + int Minimum; + int Maximum; + int Default; + float Multiplier; +} D3D11_VIDEO_PROCESSOR_FILTER_RANGE; + +typedef enum D3D11_AUTHENTICATED_CHANNEL_TYPE +{ + D3D11_AUTHENTICATED_CHANNEL_D3D11 = 1, + D3D11_AUTHENTICATED_CHANNEL_DRIVER_SOFTWARE = 2, + D3D11_AUTHENTICATED_CHANNEL_DRIVER_HARDWARE = 3 +} D3D11_AUTHENTICATED_CHANNEL_TYPE; + +typedef enum D3D11_VDOV_DIMENSION +{ + D3D11_VDOV_DIMENSION_UNKNOWN = 0, + D3D11_VDOV_DIMENSION_TEXTURE2D = 1 +} D3D11_VDOV_DIMENSION; + +typedef struct D3D11_TEX2D_VDOV +{ + UINT ArraySlice; +} D3D11_TEX2D_VDOV; + +typedef struct D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC +{ + GUID DecodeProfile; + D3D11_VDOV_DIMENSION ViewDimension; + union { + D3D11_TEX2D_VDOV Texture2D; + }; +} D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC; + +typedef enum D3D11_VPIV_DIMENSION +{ + D3D11_VPIV_DIMENSION_UNKNOWN = 0, + D3D11_VPIV_DIMENSION_TEXTURE2D = 1 +} D3D11_VPIV_DIMENSION; + +typedef struct D3D11_TEX2D_VPIV +{ + UINT MipSlice; + UINT ArraySlice; +} D3D11_TEX2D_VPIV; + +typedef struct D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC +{ + UINT FourCC; + D3D11_VPIV_DIMENSION ViewDimension; + union { + D3D11_TEX2D_VPIV Texture2D; + }; +} D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC; + +typedef enum D3D11_VPOV_DIMENSION +{ + D3D11_VPOV_DIMENSION_UNKNOWN = 0, + D3D11_VPOV_DIMENSION_TEXTURE2D = 1, + D3D11_VPOV_DIMENSION_TEXTURE2DARRAY = 2 +} D3D11_VPOV_DIMENSION; + +typedef struct D3D11_TEX2D_VPOV +{ + UINT MipSlice; +} D3D11_TEX2D_VPOV; + +typedef struct D3D11_TEX2D_ARRAY_VPOV +{ + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; +} D3D11_TEX2D_ARRAY_VPOV; + +typedef struct D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC +{ + D3D11_VPOV_DIMENSION ViewDimension; + union { + D3D11_TEX2D_VPOV Texture2D; + D3D11_TEX2D_ARRAY_VPOV Texture2DArray; + }; +} D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC; + +typedef struct D3D11_VIDEO_CONTENT_PROTECTION_CAPS +{ + UINT Caps; + UINT KeyExchangeTypeCount; + UINT BlockAlignmentSize; + ULONGLONG ProtectedMemorySize; +} D3D11_VIDEO_CONTENT_PROTECTION_CAPS; + /* A couple forward declarations are needed */ interface ID3D11Device; interface ID3D11ClassLinkage; @@ -1968,6 +2167,210 @@ } [ + object, + uuid(3015a308-dcbd-47aa-a747-192486d14d4a), + local, + pointer_default(unique) +] +interface ID3D11AuthenticatedChannel : ID3D11DeviceChild +{ + HRESULT GetCertificateSize( + UINT *pCertificateSize); + HRESULT GetCertificate( + UINT CertificateSize, + BYTE *pCertificate); + void GetChannelHandle( + HANDLE *pChannelHandle); +} + +[ + object, + uuid(9b32f9ad-bdcc-40a6-a39d-d5c865845720), + local, + pointer_default(unique) +] +interface ID3D11CryptoSession : ID3D11DeviceChild +{ + void GetCryptoType( + GUID *pCryptoType); + void GetDecoderProfile( + GUID *pDecoderProfile); + HRESULT GetCertificateSize( + UINT *pCertificateSize); + HRESULT GetCertificate( + UINT CertificateSize, + BYTE *pCertificate); + void GetCryptoSessionHandle( + HANDLE *pCryptoSessionHandle); +} + +[ + object, + uuid(3c9c5b51-995d-48d1-9b8d-fa5caeded65c), + local, + pointer_default(unique) +] +interface ID3D11VideoDecoder : ID3D11DeviceChild +{ + HRESULT GetCreationParameters( + D3D11_VIDEO_DECODER_DESC *pVideoDesc, + D3D11_VIDEO_DECODER_CONFIG *pConfig); + HRESULT GetDriverHandle( + HANDLE *pDriverHandle); +} + +[ + object, + uuid(31627037-53ab-4200-9061-05faa9ab45f9), + local, + pointer_default(unique) +] +interface ID3D11VideoProcessorEnumerator : ID3D11DeviceChild +{ + HRESULT GetVideoProcessorContentDesc( + D3D11_VIDEO_PROCESSOR_CONTENT_DESC *pContentDesc); + HRESULT CheckVideoProcessorFormat( + DXGI_FORMAT Format, + UINT *pFlags); + HRESULT GetVideoProcessorCaps( + D3D11_VIDEO_PROCESSOR_CAPS *pCaps); + HRESULT GetVideoProcessorRateConversionCaps( + UINT TypeIndex, + D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS *pCaps); + HRESULT GetVideoProcessorCustomRate( + UINT TypeIndex, + UINT CustomRateIndex, + D3D11_VIDEO_PROCESSOR_CUSTOM_RATE *pRate); + HRESULT GetVideoProcessorFilterRange( + D3D11_VIDEO_PROCESSOR_FILTER Filter, + D3D11_VIDEO_PROCESSOR_FILTER_RANGE *pRange); +} + +[ + object, + uuid(1d7b0652-185f-41c6-85ce-0c5be3d4ae6c), + local, + pointer_default(unique) +] +interface ID3D11VideoProcessor : ID3D11DeviceChild +{ + void GetContentDesc( + D3D11_VIDEO_PROCESSOR_CONTENT_DESC *pDesc); + void GetRateConversionCaps( + D3D11_VIDEO_PROCESSOR_RATE_CONVERSION_CAPS *pCaps); +} + +[ + object, + uuid(c2931aea-2a85-4f20-860f-fba1fd256e18), + local, + pointer_default(unique) +] +interface ID3D11VideoDecoderOutputView : ID3D11View +{ + void GetDesc( + D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC *pDesc); +} + +[ + object, + uuid(11ec5a5f-51dc-4945-ab34-6e8c21300ea5), + local, + pointer_default(unique) +] +interface ID3D11VideoProcessorInputView : ID3D11View +{ + void GetDesc( + D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC *pDesc); +} + +[ + object, + uuid(a048285e-25a9-4527-bd93-d68b68c44254), + local, + pointer_default(unique) +] +interface ID3D11VideoProcessorOutputView : ID3D11View +{ + void GetDesc( + D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC *pDesc); +} + +[ + object, + uuid(10ec4d5b-975a-4689-b9e4-d0aac30fe333), + local, + pointer_default(unique) +] +interface ID3D11VideoDevice : IUnknown +{ + HRESULT CreateVideoDecoder( + const D3D11_VIDEO_DECODER_DESC *pVideoDesc, + const D3D11_VIDEO_DECODER_CONFIG *pConfig, + ID3D11VideoDecoder **ppDecoder); + HRESULT CreateVideoProcessor( + ID3D11VideoProcessorEnumerator *pEnum, + UINT RateConversionIndex, + ID3D11VideoProcessor **ppVideoProcessor); + HRESULT CreateAuthenticatedChannel( + D3D11_AUTHENTICATED_CHANNEL_TYPE ChannelType, + ID3D11AuthenticatedChannel **ppAuthenticatedChannel); + HRESULT CreateCryptoSession( + const GUID *pCryptoType, + const GUID *pDecoderProfile, + const GUID *pKeyExchangeType, + ID3D11CryptoSession **ppCryptoSession); + HRESULT CreateVideoDecoderOutputView( + ID3D11Resource *pResource, + const D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC *pDesc, + ID3D11VideoDecoderOutputView **ppVDOVView); + HRESULT CreateVideoProcessorInputView( + ID3D11Resource *pResource, + ID3D11VideoProcessorEnumerator *pEnum, + const D3D11_VIDEO_PROCESSOR_INPUT_VIEW_DESC *pDesc, + ID3D11VideoProcessorInputView **ppVPIView); + HRESULT CreateVideoProcessorOutputView( + ID3D11Resource *pResource, + ID3D11VideoProcessorEnumerator *pEnum, + const D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC *pDesc, + ID3D11VideoProcessorOutputView **ppVPOView); + HRESULT CreateVideoProcessorEnumerator( + const D3D11_VIDEO_PROCESSOR_CONTENT_DESC *pDesc, + ID3D11VideoProcessorEnumerator **ppEnum); + UINT GetVideoDecoderProfileCount(); + HRESULT GetVideoDecoderProfile( + UINT Index, + GUID *pDecoderProfile); + HRESULT CheckVideoDecoderFormat( + const GUID *pDecoderProfile, + DXGI_FORMAT Format, + BOOL *pSupported); + HRESULT GetVideoDecoderConfigCount( + const D3D11_VIDEO_DECODER_DESC *pDesc, + UINT *pCount); + HRESULT GetVideoDecoderConfig( + const D3D11_VIDEO_DECODER_DESC *pDesc, + UINT Index, + D3D11_VIDEO_DECODER_CONFIG *pConfig); + HRESULT GetContentProtectionCaps( + const GUID *pCryptoType, + const GUID *pDecoderProfile, + D3D11_VIDEO_CONTENT_PROTECTION_CAPS *pCaps); + HRESULT CheckCryptoKeyExchange( + const GUID *pCryptoType, + const GUID *pDecoderProfile, + UINT Index, + GUID *pKeyExchangeType); + HRESULT SetPrivateData( + REFGUID guid, + UINT DataSize, + const void *pData); + HRESULT SetPrivateDataInterface( + REFGUID guid, + const IUnknown *pData); +} + +[ object, local, uuid(db6f6ddb-ac77-4e88-8253-819df9bbf140) diff -Nru wine1.7-1.7.50/include/d3d8types.h wine1.7-1.7.55/include/d3d8types.h --- wine1.7-1.7.50/include/d3d8types.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/d3d8types.h 2015-11-13 14:32:40.000000000 +0000 @@ -38,7 +38,7 @@ #define D3DCLIPPLANE4 (1 << 4) #define D3DCLIPPLANE5 (1 << 5) -#define D3DCOLOR_ARGB(a,r,g,b) ((D3DCOLOR)((((a)&0xff)<<24)|(((r)&0xff)<<16)|(((g)&0xff)<<8)|((b)&0xff))) +#define D3DCOLOR_ARGB(a,r,g,b) ((D3DCOLOR)((((a)&0xffu)<<24)|(((r)&0xffu)<<16)|(((g)&0xffu)<<8)|((b)&0xffu))) #define D3DCOLOR_COLORVALUE(r,g,b,a) D3DCOLOR_RGBA((DWORD)((r)*255.f),(DWORD)((g)*255.f),(DWORD)((b)*255.f),(DWORD)((a)*255.f)) #define D3DCOLOR_RGBA(r,g,b,a) D3DCOLOR_ARGB(a,r,g,b) #define D3DCOLOR_XRGB(r,g,b) D3DCOLOR_ARGB(0xff,r,g,b) @@ -263,11 +263,11 @@ #define D3DVSD_CONSTCOUNTMASK (0xF << D3DVSD_CONSTCOUNTSHIFT) #define D3DVSD_DATALOADTYPEMASK (0x1 << D3DVSD_DATALOADTYPESHIFT) #define D3DVSD_STREAMTESSMASK (0x1 << D3DVSD_STREAMTESSSHIFT) -#define D3DVSD_TOKENTYPEMASK (0x7 << D3DVSD_TOKENTYPESHIFT) +#define D3DVSD_TOKENTYPEMASK (0x7u << D3DVSD_TOKENTYPESHIFT) #define D3DVSD_MAKETOKENTYPE(TokenType) \ - ((TokenType << D3DVSD_TOKENTYPESHIFT) & D3DVSD_TOKENTYPEMASK) + (((unsigned)TokenType << D3DVSD_TOKENTYPESHIFT) & D3DVSD_TOKENTYPEMASK) #define D3DVSD_CONST(ConstantAddress, Count) \ (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_CONSTMEM) | ((Count) << D3DVSD_CONSTCOUNTSHIFT) | (ConstantAddress)) diff -Nru wine1.7-1.7.50/include/d3d9.h wine1.7-1.7.55/include/d3d9.h --- wine1.7-1.7.50/include/d3d9.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/d3d9.h 2015-11-13 14:32:40.000000000 +0000 @@ -494,8 +494,8 @@ /*** IDirect3DSwapChain9 methods ***/ #define IDirect3DSwapChain9Ex_Present(p,a,b,c,d,e) (p)->lpVtbl->Present(p,a,b,c,d,e) #define IDirect3DSwapChain9Ex_GetFrontBufferData(p,a) (p)->lpVtbl->GetFrontBufferData(p,a) -#define IDirect3DSwapChain9EX_GetBackBuffer(p,a,b,c) (p)->lpVtbl->GetBackBuffer(p,a,b,c) -#define IDirect3DSwapChain9EX_GetRasterStatus(p,a) (p)->lpVtbl->GetRasterStatus(p,a) +#define IDirect3DSwapChain9Ex_GetBackBuffer(p,a,b,c) (p)->lpVtbl->GetBackBuffer(p,a,b,c) +#define IDirect3DSwapChain9Ex_GetRasterStatus(p,a) (p)->lpVtbl->GetRasterStatus(p,a) #define IDirect3DSwapChain9Ex_GetDisplayMode(p,a) (p)->lpVtbl->GetDisplayMode(p,a) #define IDirect3DSwapChain9Ex_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a) #define IDirect3DSwapChain9Ex_GetPresentParameters(p,a) (p)->lpVtbl->GetPresentParameters(p,a) diff -Nru wine1.7-1.7.50/include/d3d9types.h wine1.7-1.7.55/include/d3d9types.h --- wine1.7-1.7.50/include/d3d9types.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/d3d9types.h 2015-11-13 14:32:40.000000000 +0000 @@ -60,10 +60,10 @@ #define D3DCS_PLANE5 __MSABI_LONG(0x800) #define D3DCS_ALL __MSABI_LONG(0xFFF) -#define D3DFVF_TEXTUREFORMAT1 3 -#define D3DFVF_TEXTUREFORMAT2 0 -#define D3DFVF_TEXTUREFORMAT3 1 -#define D3DFVF_TEXTUREFORMAT4 2 +#define D3DFVF_TEXTUREFORMAT1 3u +#define D3DFVF_TEXTUREFORMAT2 0u +#define D3DFVF_TEXTUREFORMAT3 1u +#define D3DFVF_TEXTUREFORMAT4 2u #define D3DFVF_TEXCOORDSIZE1(CoordIndex) (D3DFVF_TEXTUREFORMAT1 << (CoordIndex*2 + 16)) #define D3DFVF_TEXCOORDSIZE2(CoordIndex) (D3DFVF_TEXTUREFORMAT2) #define D3DFVF_TEXCOORDSIZE3(CoordIndex) (D3DFVF_TEXTUREFORMAT3 << (CoordIndex*2 + 16)) @@ -178,8 +178,8 @@ #define D3DPV_DONOTCOPYDATA (1 << 0) -#define D3DSTREAMSOURCE_INDEXEDDATA (1 << 30) -#define D3DSTREAMSOURCE_INSTANCEDATA (2 << 30) +#define D3DSTREAMSOURCE_INDEXEDDATA (1u << 30) +#define D3DSTREAMSOURCE_INSTANCEDATA (2u << 30) #define D3D_MAX_SIMULTANEOUS_RENDERTARGETS 4 diff -Nru wine1.7-1.7.50/include/d3dcompiler.h wine1.7-1.7.55/include/d3dcompiler.h --- wine1.7-1.7.50/include/d3dcompiler.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/d3dcompiler.h 2015-11-13 14:32:40.000000000 +0000 @@ -107,7 +107,8 @@ HRESULT WINAPI D3DGetOutputSignatureBlob(const void *data, SIZE_T data_size, ID3DBlob **blob); HRESULT WINAPI D3DGetInputAndOutputSignatureBlob(const void *data, SIZE_T data_size, ID3DBlob **blob); HRESULT WINAPI D3DGetDebugInfo(const void *data, SIZE_T data_size, ID3DBlob **blob); - +HRESULT WINAPI D3DReadFileToBlob(const WCHAR *filename, ID3DBlob **contents); +HRESULT WINAPI D3DWriteBlobToFile(ID3DBlob *blob, const WCHAR *filename, BOOL overwrite); HRESULT WINAPI D3DReflect(const void *data, SIZE_T data_size, REFIID riid, void **reflector); HRESULT WINAPI D3DCreateBlob(SIZE_T data_size, ID3DBlob **blob); diff -Nru wine1.7-1.7.50/include/d3drmobj.h wine1.7-1.7.55/include/d3drmobj.h --- wine1.7-1.7.50/include/d3drmobj.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/d3drmobj.h 2015-11-13 14:32:40.000000000 +0000 @@ -3284,7 +3284,7 @@ #define IDirect3DRMTexture_SetDecalOrigin(p,a,b) (p)->SetDecalOrigin(a,b) #define IDirect3DRMTexture_SetDecalScale(p,a) (p)->SetDecalScale(a) #define IDirect3DRMTexture_SetDecalTransparency(p,a) (p)->SetDecalTransparency(a) -#define IDirect3DRMTexture_SetDecalTransparencyColor(p,a) (p)->SetDecalTransparentColor(a) +#define IDirect3DRMTexture_SetDecalTransparentColor(p,a) (p)->SetDecalTransparentColor(a) #define IDirect3DRMTexture_GetDecalSize(p,a,b) (p)->GetDecalSize(a,b) #define IDirect3DRMTexture_GetDecalOrigin(p,a,b) (p)->GetDecalOrigin(a,b) #define IDirect3DRMTexture_GetImage(p) (p)->GetImage() @@ -3292,7 +3292,7 @@ #define IDirect3DRMTexture_GetColors(p) (p)->GetColors() #define IDirect3DRMTexture_GetDecalScale(p) (p)->GetDecalScale() #define IDirect3DRMTexture_GetDecalTransparency(p) (p)->GetDecalTransparency() -#define IDirect3DRMTexture_GetDecalTransparencyColor(p) (p)->GetDecalTransparencyColor() +#define IDirect3DRMTexture_GetDecalTransparentColor(p) (p)->GetDecalTransparentColor() #endif /***************************************************************************** @@ -3404,7 +3404,7 @@ #define IDirect3DRMTexture2_SetDecalOrigin(p,a,b) (p)->SetDecalOrigin(a,b) #define IDirect3DRMTexture2_SetDecalScale(p,a) (p)->SetDecalScale(a) #define IDirect3DRMTexture2_SetDecalTransparency(p,a) (p)->SetDecalTransparency(a) -#define IDirect3DRMTexture2_SetDecalTransparencyColor(p,a) (p)->SetDecalTransparentColor(a) +#define IDirect3DRMTexture2_SetDecalTransparentColor(p,a) (p)->SetDecalTransparentColor(a) #define IDirect3DRMTexture2_GetDecalSize(p,a,b) (p)->GetDecalSize(a,b) #define IDirect3DRMTexture2_GetDecalOrigin(p,a,b) (p)->GetDecalOrigin(a,b) #define IDirect3DRMTexture2_GetImage(p) (p)->GetImage() @@ -3412,7 +3412,7 @@ #define IDirect3DRMTexture2_GetColors(p) (p)->GetColors() #define IDirect3DRMTexture2_GetDecalScale(p) (p)->GetDecalScale() #define IDirect3DRMTexture2_GetDecalTransparency(p) (p)->GetDecalTransparency() -#define IDirect3DRMTexture2_GetDecalTransparencyColor(p) (p)->GetDecalTransparencyColor() +#define IDirect3DRMTexture2_GetDecalTransparentColor(p) (p)->GetDecalTransparentColor() /*** IDirect3DRMTexture2 methods ***/ #define IDirect3DRMTexture2_InitFromImage(p,a) (p)->InitFromImage(a) #define IDirect3DRMTexture2_InitFromResource2(p,a,b,c) (p)->InitFromResource2(a,b,c) @@ -3494,7 +3494,7 @@ #define IDirect3DRMTexture3_SetDecalOrigin(p,a,b) (p)->lpVtbl->SetDecalOrigin(p,a,b) #define IDirect3DRMTexture3_SetDecalScale(p,a) (p)->lpVtbl->SetDecalScale(p,a) #define IDirect3DRMTexture3_SetDecalTransparency(p,a) (p)->lpVtbl->SetDecalTransparency(p,a) -#define IDirect3DRMTexture3_SetDecalTransparencyColor(p,a) (p)->lpVtbl->SetDecalTransparentColor(p,a) +#define IDirect3DRMTexture3_SetDecalTransparentColor(p,a) (p)->lpVtbl->SetDecalTransparentColor(p,a) #define IDirect3DRMTexture3_GetDecalSize(p,a,b) (p)->lpVtbl->GetDecalSize(p,a,b) #define IDirect3DRMTexture3_GetDecalOrigin(p,a,b) (p)->lpVtbl->GetDecalOrigin(p,a,b) #define IDirect3DRMTexture3_GetImage(p) (p)->lpVtbl->GetImage(p) @@ -3502,7 +3502,7 @@ #define IDirect3DRMTexture3_GetColors(p) (p)->lpVtbl->GetColors(p) #define IDirect3DRMTexture3_GetDecalScale(p) (p)->lpVtbl->GetDecalScale(p) #define IDirect3DRMTexture3_GetDecalTransparency(p) (p)->lpVtbl->GetDecalTransparency(p) -#define IDirect3DRMTexture3_GetDecalTransparencyColor(p) (p)->lpVtbl->GetDecalTransparencyColor(p) +#define IDirect3DRMTexture3_GetDecalTransparentColor(p) (p)->lpVtbl->GetDecalTransparentColor(p) #define IDirect3DRMTexture3_InitFromImage(p,a) (p)->lpVtbl->InitFromImage(p,a) #define IDirect3DRMTexture3_InitFromResource2(p,a,b,c) (p)->lpVtbl->InitFromResource2(p,a,b,c) #define IDirect3DRMTexture3_GenerateMIPMap(p,a) (p)->lpVtbl->GenerateMIPMap(p,a) diff -Nru wine1.7-1.7.50/include/d3dx10core.idl wine1.7-1.7.55/include/d3dx10core.idl --- wine1.7-1.7.50/include/d3dx10core.idl 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/include/d3dx10core.idl 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,66 @@ +/* + * Copyright 2015 Alistair Leslie-Hughes + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +import "oaidl.idl"; +import "ocidl.idl"; +import "dxgi.idl"; +import "d3dcommon.idl"; + +[ + object, + local, + pointer_default(unique) +] +interface ID3DX10DataLoader +{ + HRESULT Load(); + HRESULT Decompress([out] void **data, [in] SIZE_T *bytes); + HRESULT Destroy(); +}; + +[ + object, + local, + pointer_default(unique) +] +interface ID3DX10DataProcessor +{ + HRESULT Process([in] void *data, [in] SIZE_T bytes); + HRESULT CreateDeviceObject([out] void **dataobject); + HRESULT Destroy(); +}; + + +[ + object, + local, + pointer_default(unique), + uuid(c93fecfa-6967-478a-abbc-402d90621fcb) +] +interface ID3DX10ThreadPump : IUnknown +{ + HRESULT AddWorkItem([in] ID3DX10DataLoader *loader, [in] ID3DX10DataProcessor *processor, + [in] HRESULT *result, [out] void **object); + UINT GetWorkItemCount(); + + HRESULT WaitForAllItems(); + HRESULT ProcessDeviceWorkItems([in] UINT count); + + HRESULT PurgeAllItems(); + HRESULT GetQueueStatus([in] UINT *queue, [in] UINT *processqueue, [in] UINT *devicequeue); +}; diff -Nru wine1.7-1.7.50/include/d3dx10.h wine1.7-1.7.55/include/d3dx10.h --- wine1.7-1.7.50/include/d3dx10.h 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/include/d3dx10.h 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * Copyright 2015 Andrey Gusev + * + * 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 __D3DX10_H__ +#define __D3DX10_H__ + +#include +#include + +#define D3DX10_DEFAULT (0xffffffffu) +#define D3DX10_FROM_FILE (0xfffffffdu) +#define DXGI_FORMAT_FROM_FILE ((DXGI_FORMAT)0xfffffffdu) + +#include "d3d10.h" +#include "d3dx10core.h" + +#endif diff -Nru wine1.7-1.7.50/include/dbccmd.idl wine1.7-1.7.55/include/dbccmd.idl --- wine1.7-1.7.50/include/dbccmd.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/dbccmd.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + [ object, uuid(0c733a1d-2a1c-11ce-ade5-00aa0044773d), diff -Nru wine1.7-1.7.50/include/dbcses.idl wine1.7-1.7.55/include/dbcses.idl --- wine1.7-1.7.50/include/dbcses.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/dbcses.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + [ object, uuid(0c733a5d-2a1c-11ce-ade5-00aa0044773d), diff -Nru wine1.7-1.7.50/include/dbdsad.idl wine1.7-1.7.55/include/dbdsad.idl --- wine1.7-1.7.50/include/dbdsad.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/dbdsad.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + [ object, uuid(0c733a7a-2a1c-11ce-ade5-00aa0044773d), diff -Nru wine1.7-1.7.50/include/dbinit.idl wine1.7-1.7.55/include/dbinit.idl --- wine1.7-1.7.50/include/dbinit.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/dbinit.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + [ object, uuid(0c733a8b-2a1c-11ce-ade5-00aa0044773d), diff -Nru wine1.7-1.7.50/include/dbprop.idl wine1.7-1.7.55/include/dbprop.idl --- wine1.7-1.7.50/include/dbprop.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/dbprop.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + [ object, uuid(0c733a8a-2a1c-11ce-ade5-00aa0044773d), diff -Nru wine1.7-1.7.50/include/dbs.idl wine1.7-1.7.55/include/dbs.idl --- wine1.7-1.7.50/include/dbs.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/dbs.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + typedef DWORD DBKIND; enum DBKINDENUM { diff -Nru wine1.7-1.7.50/include/ddk/hidpi.h wine1.7-1.7.55/include/ddk/hidpi.h --- wine1.7-1.7.50/include/ddk/hidpi.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/ddk/hidpi.h 2015-11-13 14:32:40.000000000 +0000 @@ -151,24 +151,24 @@ #define HIDP_ERROR_CODES(sev, code) ((NTSTATUS)(((sev) << 28) | (FACILITY_HID_ERROR_CODE << 16) | (code))) -#define HIDP_STATUS_SUCCESS (HIDP_ERROR_CODES(0x0,0x00)) -#define HIDP_STATUS_NULL (HIDP_ERROR_CODES(0x8,0x01)) -#define HIDP_STATUS_INVALID_PREPARSED_DATA (HIDP_ERROR_CODES(0xc,0x01)) -#define HIDP_STATUS_INVALID_REPORT_TYPE (HIDP_ERROR_CODES(0xc,0x02)) -#define HIDP_STATUS_INVALID_REPORT_LENGTH (HIDP_ERROR_CODES(0xc,0x03)) -#define HIDP_STATUS_USAGE_NOT_FOUND (HIDP_ERROR_CODES(0xc,0x04)) -#define HIDP_STATUS_VALUE_OUT_OF_RANGE (HIDP_ERROR_CODES(0xc,0x05)) -#define HIDP_STATUS_BAD_LOG_PHY_VALUES (HIDP_ERROR_CODES(0xc,0x06)) -#define HIDP_STATUS_BUFFER_TOO_SMALL (HIDP_ERROR_CODES(0xc,0x07)) -#define HIDP_STATUS_INTERNAL_ERROR (HIDP_ERROR_CODES(0xc,0x08)) -#define HIDP_STATUS_I8242_TRANS_UNKNOWN (HIDP_ERROR_CODES(0xc,0x09)) -#define HIDP_STATUS_INCOMPATIBLE_REPORT_ID (HIDP_ERROR_CODES(0xc,0x0a)) -#define HIDP_STATUS_NOT_VALUE_ARRAY (HIDP_ERROR_CODES(0xc,0x0b)) -#define HIDP_STATUS_IS_VALUE_ARRAY (HIDP_ERROR_CODES(0xc,0x0c)) -#define HIDP_STATUS_DATA_INDEX_NOT_FOUND (HIDP_ERROR_CODES(0xc,0x0d)) -#define HIDP_STATUS_DATA_INDEX_OUT_OF_RANGE (HIDP_ERROR_CODES(0xc,0x0e)) -#define HIDP_STATUS_BUTTON_NOT_PRESSED (HIDP_ERROR_CODES(0xc,0x0f)) -#define HIDP_STATUS_REPORT_DOES_NOT_EXIST (HIDP_ERROR_CODES(0xc,0x10)) -#define HIDP_STATUS_NOT_IMPLEMENTED (HIDP_ERROR_CODES(0xc,0x20)) +#define HIDP_STATUS_SUCCESS (HIDP_ERROR_CODES(0x0u,0x00)) +#define HIDP_STATUS_NULL (HIDP_ERROR_CODES(0x8u,0x01)) +#define HIDP_STATUS_INVALID_PREPARSED_DATA (HIDP_ERROR_CODES(0xcu,0x01)) +#define HIDP_STATUS_INVALID_REPORT_TYPE (HIDP_ERROR_CODES(0xcu,0x02)) +#define HIDP_STATUS_INVALID_REPORT_LENGTH (HIDP_ERROR_CODES(0xcu,0x03)) +#define HIDP_STATUS_USAGE_NOT_FOUND (HIDP_ERROR_CODES(0xcu,0x04)) +#define HIDP_STATUS_VALUE_OUT_OF_RANGE (HIDP_ERROR_CODES(0xcu,0x05)) +#define HIDP_STATUS_BAD_LOG_PHY_VALUES (HIDP_ERROR_CODES(0xcu,0x06)) +#define HIDP_STATUS_BUFFER_TOO_SMALL (HIDP_ERROR_CODES(0xcu,0x07)) +#define HIDP_STATUS_INTERNAL_ERROR (HIDP_ERROR_CODES(0xcu,0x08)) +#define HIDP_STATUS_I8242_TRANS_UNKNOWN (HIDP_ERROR_CODES(0xcu,0x09)) +#define HIDP_STATUS_INCOMPATIBLE_REPORT_ID (HIDP_ERROR_CODES(0xcu,0x0a)) +#define HIDP_STATUS_NOT_VALUE_ARRAY (HIDP_ERROR_CODES(0xcu,0x0b)) +#define HIDP_STATUS_IS_VALUE_ARRAY (HIDP_ERROR_CODES(0xcu,0x0c)) +#define HIDP_STATUS_DATA_INDEX_NOT_FOUND (HIDP_ERROR_CODES(0xcu,0x0d)) +#define HIDP_STATUS_DATA_INDEX_OUT_OF_RANGE (HIDP_ERROR_CODES(0xcu,0x0e)) +#define HIDP_STATUS_BUTTON_NOT_PRESSED (HIDP_ERROR_CODES(0xcu,0x0f)) +#define HIDP_STATUS_REPORT_DOES_NOT_EXIST (HIDP_ERROR_CODES(0xcu,0x10)) +#define HIDP_STATUS_NOT_IMPLEMENTED (HIDP_ERROR_CODES(0xcu,0x20)) #endif /* __HIDPI_H__ */ diff -Nru wine1.7-1.7.50/include/ddk/hidport.h wine1.7-1.7.55/include/ddk/hidport.h --- wine1.7-1.7.50/include/ddk/hidport.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/ddk/hidport.h 2015-11-13 14:32:40.000000000 +0000 @@ -33,4 +33,47 @@ NTSTATUS WINAPI HidRegisterMinidriver(PHID_MINIDRIVER_REGISTRATION MinidriverRegistration); +typedef struct _HID_DEVICE_EXTENSION +{ + PDEVICE_OBJECT PhysicalDeviceObject; + PDEVICE_OBJECT NextDeviceObject; + PVOID MiniDeviceExtension; +} HID_DEVICE_EXTENSION, *PHID_DEVICE_EXTENSION; + +typedef struct _HID_DEVICE_ATTRIBUTES +{ + ULONG Size; + USHORT VendorID; + USHORT ProductID; + USHORT VersionNumber; + USHORT Reserved[11]; +} HID_DEVICE_ATTRIBUTES, *PHID_DEVICE_ATTRIBUTES; + +typedef struct _HID_DESCRIPTOR +{ + UCHAR bLength; + UCHAR bDescriptorType; + USHORT bcdHID; + UCHAR bCountry; + UCHAR bNumDescriptors; + struct _HID_DESCRIPTOR_DESC_LIST + { + UCHAR bReportType; + USHORT wReportLength; + } DescriptorList[1]; +} HID_DESCRIPTOR, *PHID_DESCRIPTOR; + +#define HID_HID_DESCRIPTOR_TYPE 0x21 +#define HID_REPORT_DESCRIPTOR_TYPE 0x22 + +#define IOCTL_HID_GET_DEVICE_DESCRIPTOR HID_CTL_CODE(0) +#define IOCTL_HID_GET_REPORT_DESCRIPTOR HID_CTL_CODE(1) +#define IOCTL_HID_READ_REPORT HID_CTL_CODE(2) +#define IOCTL_HID_WRITE_REPORT HID_CTL_CODE(3) +#define IOCTL_HID_GET_STRING HID_CTL_CODE(4) +#define IOCTL_HID_ACTIVATE_DEVICE HID_CTL_CODE(7) +#define IOCTL_HID_DEACTIVATE_DEVICE HID_CTL_CODE(8) +#define IOCTL_HID_GET_DEVICE_ATTRIBUTES HID_CTL_CODE(9) +#define IOCTL_HID_SEND_IDLE_NOTIFICATION_REQUEST HID_CTL_CODE(10) + #endif /* __HIDPORT_H__ */ diff -Nru wine1.7-1.7.50/include/ddk/ntifs.h wine1.7-1.7.55/include/ddk/ntifs.h --- wine1.7-1.7.50/include/ddk/ntifs.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/ddk/ntifs.h 2015-11-13 14:32:40.000000000 +0000 @@ -19,6 +19,8 @@ #ifndef __NTIFS_H__ #define __NTIFS_H__ +typedef struct _EX_PUSH_LOCK EX_PUSH_LOCK, *PEX_PUSH_LOCK; + typedef struct _KQUEUE { DISPATCHER_HEADER Header; diff -Nru wine1.7-1.7.50/include/ddk/wdm.h wine1.7-1.7.55/include/ddk/wdm.h --- wine1.7-1.7.50/include/ddk/wdm.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/ddk/wdm.h 2015-11-13 14:32:40.000000000 +0000 @@ -32,6 +32,9 @@ typedef ULONG_PTR KSPIN_LOCK, *PKSPIN_LOCK; +typedef ULONG_PTR ERESOURCE_THREAD; +typedef ERESOURCE_THREAD *PERESOURCE_THREAD; + struct _KDPC; struct _KAPC; struct _IRP; diff -Nru wine1.7-1.7.50/include/devenum.idl wine1.7-1.7.55/include/devenum.idl --- wine1.7-1.7.50/include/devenum.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/devenum.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + import "oaidl.idl"; cpp_quote("#define CDEF_CLASS_DEFAULT 0x0001") diff -Nru wine1.7-1.7.50/include/dwmapi.h wine1.7-1.7.55/include/dwmapi.h --- wine1.7-1.7.50/include/dwmapi.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/dwmapi.h 2015-11-13 14:32:40.000000000 +0000 @@ -107,6 +107,16 @@ BOOL fTransitionOnMaximized; } DWM_BLURBEHIND, *PDWM_BLURBEHIND; +typedef struct _DWM_THUMBNAIL_PROPERTIES +{ + DWORD dwFlags; + RECT rcDestination; + RECT rcSource; + BYTE opacity; + BOOL fVisible; + BOOL fSourceClientAreaOnly; +} DWM_THUMBNAIL_PROPERTIES, *PDWM_THUMBNAIL_PROPERTIES; + #include DWMAPI DwmDefWindowProc(HWND, UINT, WPARAM, LPARAM, LRESULT*); @@ -121,6 +131,7 @@ DWMAPI DwmRegisterThumbnail(HWND, HWND, PHTHUMBNAIL); DWMAPI DwmSetWindowAttribute(HWND, DWORD, LPCVOID, DWORD); DWMAPI DwmUnregisterThumbnail(HTHUMBNAIL); +DWMAPI DwmUpdateThumbnailProperties(HTHUMBNAIL, const DWM_THUMBNAIL_PROPERTIES *); #ifdef __cplusplus } diff -Nru wine1.7-1.7.50/include/dwrite.idl wine1.7-1.7.55/include/dwrite.idl --- wine1.7-1.7.50/include/dwrite.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/dwrite.idl 2015-11-13 14:32:40.000000000 +0000 @@ -73,6 +73,7 @@ DWRITE_FONT_WEIGHT_EXTRA_LIGHT = 200, DWRITE_FONT_WEIGHT_ULTRA_LIGHT = 200, DWRITE_FONT_WEIGHT_LIGHT = 300, + DWRITE_FONT_WEIGHT_SEMI_LIGHT = 350, DWRITE_FONT_WEIGHT_NORMAL = 400, DWRITE_FONT_WEIGHT_REGULAR = 400, DWRITE_FONT_WEIGHT_MEDIUM = 500, diff -Nru wine1.7-1.7.50/include/dxgi.idl wine1.7-1.7.55/include/dxgi.idl --- wine1.7-1.7.50/include/dxgi.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/dxgi.idl 2015-11-13 14:32:40.000000000 +0000 @@ -60,6 +60,8 @@ const DXGI_USAGE DXGI_USAGE_BACK_BUFFER = 0x40L; const DXGI_USAGE DXGI_USAGE_SHARED = 0x80L; const DXGI_USAGE DXGI_USAGE_READ_ONLY = 0x100L; +const DXGI_USAGE DXGI_USAGE_DISCARD_ON_PRESENT = 0x200L; +const DXGI_USAGE DXGI_USAGE_UNORDERED_ACCESS = 0x400L; const UINT DXGI_ENUM_MODES_INTERLACED = 1; const UINT DXGI_ENUM_MODES_SCALING = 2; diff -Nru wine1.7-1.7.50/include/dyngraph.idl wine1.7-1.7.55/include/dyngraph.idl --- wine1.7-1.7.50/include/dyngraph.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/dyngraph.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + interface IPinConnection; interface IPinFlowControl; interface IGraphConfig; diff -Nru wine1.7-1.7.50/include/errrec.idl wine1.7-1.7.55/include/errrec.idl --- wine1.7-1.7.50/include/errrec.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/errrec.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + [ object, uuid(0c733a67-2a1c-11ce-ade5-00aa0044773d), diff -Nru wine1.7-1.7.50/include/gdipluseffects.h wine1.7-1.7.55/include/gdipluseffects.h --- wine1.7-1.7.50/include/gdipluseffects.h 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/include/gdipluseffects.h 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2015 Alistair Leslie-Hughes + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef _GDIPLUSEFFECTS_H +#define _GDIPLUSEFFECTS_H + +DEFINE_GUID(BlurEffectGuid, 0x633c80a4, 0x1843, 0x482b, 0x9e, 0xf2, 0xbe, 0x28, 0x34, 0xc5, 0xfd, 0xd4); +DEFINE_GUID(SharpenEffectGuid, 0x63cbf3ee, 0xc526, 0x402c, 0x8f, 0x71, 0x62, 0xc5, 0x40, 0xbf, 0x51, 0x42); +DEFINE_GUID(ColorMatrixEffectGuid, 0x718f2615, 0x7933, 0x40e3, 0xa5, 0x11, 0x5f, 0x68, 0xfe, 0x14, 0xdd, 0x74); +DEFINE_GUID(ColorLUTEffectGuid, 0xa7ce72a9, 0x0f7f, 0x40d7, 0xb3, 0xcc, 0xd0, 0xc0, 0x2d, 0x5c, 0x32, 0x12); +DEFINE_GUID(BrightnessContrastEffectGuid, 0xd3a1dbe1, 0x8ec4, 0x4c17, 0x9f, 0x4c, 0xea, 0x97, 0xad, 0x1c, 0x34, 0x3d); +DEFINE_GUID(HueSaturationLightnessEffectGuid, 0x8b2dd6c3, 0xeb07, 0x4d87, 0xa5, 0xf0, 0x71, 0x08, 0xe2, 0x6a, 0x9c, 0x5f); +DEFINE_GUID(LevelsEffectGuid, 0x99c354ec, 0x2a31, 0x4f3a, 0x8c, 0x34, 0x17, 0xa8, 0x03, 0xb3, 0x3a, 0x25); +DEFINE_GUID(TintEffectGuid, 0x1077af00, 0x2848, 0x4441, 0x94, 0x89, 0x44, 0xad, 0x4c, 0x2d, 0x7a, 0x2c); +DEFINE_GUID(ColorBalanceEffectGuid, 0x537e597d, 0x251e, 0x48da, 0x96, 0x64, 0x29, 0xca, 0x49, 0x6b, 0x70, 0xf8); +DEFINE_GUID(RedEyeCorrectionEffectGuid, 0x74d29d05, 0x69a4, 0x4266, 0x95, 0x49, 0x3c, 0xc5, 0x28, 0x36, 0xb6, 0x32); +DEFINE_GUID(ColorCurveEffectGuid, 0xdd6a0022, 0x58e4, 0x4a67, 0x9d, 0x9b, 0xd4, 0x8e, 0xb8, 0x81, 0xa5, 0x3d); + +#ifdef __cplusplus +extern "C" { +#endif + +GpStatus WINGDIPAPI GdipCreateEffect(const GUID guid, CGpEffect **effect); +GpStatus WINGDIPAPI GdipDeleteEffect(CGpEffect *effect); + +#ifdef __cplusplus +} +#endif + +#endif diff -Nru wine1.7-1.7.50/include/gdiplus.h wine1.7-1.7.55/include/gdiplus.h --- wine1.7-1.7.50/include/gdiplus.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/gdiplus.h 2015-11-13 14:32:40.000000000 +0000 @@ -37,6 +37,7 @@ #include "gdipluscolor.h" #include "gdipluscolormatrix.h" #include "gdiplusgpstubs.h" +#include "gdipluseffects.h" namespace DllExports { @@ -57,6 +58,7 @@ #include "gdipluscolor.h" #include "gdipluscolormatrix.h" #include "gdiplusgpstubs.h" +#include "gdipluseffects.h" #include "gdiplusflat.h" diff -Nru wine1.7-1.7.50/include/gdipluspixelformats.h wine1.7-1.7.55/include/gdipluspixelformats.h --- wine1.7-1.7.50/include/gdipluspixelformats.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/gdipluspixelformats.h 2015-11-13 14:32:40.000000000 +0000 @@ -102,4 +102,33 @@ #endif /* end of c typedefs */ +typedef enum DitherType +{ + DitherTypeNone, + DitherTypeSolid, + DitherTypeOrdered4x4, + DitherTypeOrdered8x8, + DitherTypeOrdered16x16, + DitherTypeSpiral4x4, + DitherTypeSpiral8x8, + DitherTypeDualSpiral4x4, + DitherTypeDualSpiral8x8, + DitherTypeErrorDiffusion, + DitherTypeMax +} DitherType; + +typedef enum PaletteType +{ + PaletteTypeCustom, + PaletteTypeOptimal, + PaletteTypeFixedBW, + PaletteTypeFixedHalftone8, + PaletteTypeFixedHalftone27, + PaletteTypeFixedHalftone64, + PaletteTypeFixedHalftone125, + PaletteTypeFixedHalftone216, + PaletteTypeFixedHalftone252, + PaletteTypeFixedHalftone256 +} PaletteType; + #endif diff -Nru wine1.7-1.7.50/include/Makefile.in wine1.7-1.7.55/include/Makefile.in --- wine1.7-1.7.50/include/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -1,28 +1,35 @@ -PRIVATE_IDL_H_SRCS = \ - wine/winedxgi.idl - -PUBLIC_IDL_H_SRCS = \ +IDL_SRCS = \ + access.idl \ activaut.idl \ activdbg.idl \ activscp.idl \ amstream.idl \ amvideo.idl \ asptlb.idl \ + asynot.idl \ + asysta.idl \ atliface.idl \ audioclient.idl \ audiopolicy.idl \ austream.idl \ + axcore.idl \ + axextend.idl \ bdaiface.idl \ + binres.idl \ bits.idl \ bits1_5.idl \ bits2_0.idl \ bits2_5.idl \ bits3_0.idl \ + chprst.idl \ + cmdbas.idl \ + cmdtxt.idl \ comcat.idl \ commoncontrols.idl \ control.idl \ cor.idl \ cordebug.idl \ + crtrow.idl \ ctfutb.idl \ ctxtcall.idl \ d2d1.idl \ @@ -32,7 +39,15 @@ d3d11_1.idl \ d3d11sdklayers.idl \ d3dcommon.idl \ + d3dx10core.idl \ + dbccmd.idl \ + dbcses.idl \ + dbdsad.idl \ + dbinit.idl \ + dbprop.idl \ + dbs.idl \ ddstream.idl \ + devenum.idl \ devicetopology.idl \ dimm.idl \ dispex.idl \ @@ -45,7 +60,9 @@ dxgi.idl \ dxgi1_2.idl \ dxva2api.idl \ + dyngraph.idl \ endpointvolume.idl \ + errrec.idl \ exdisp.idl \ fusion.idl \ gameux.idl \ @@ -98,6 +115,7 @@ oleacc.idl \ oledb.idl \ oleidl.idl \ + opnrst.idl \ optary.idl \ perhist.idl \ propidl.idl \ @@ -105,12 +123,23 @@ pstore.idl \ qedit.idl \ richole.idl \ + row.idl \ + rowchg.idl \ + rowpos.idl \ + rowpsc.idl \ + rstbas.idl \ + rstinf.idl \ + rstloc.idl \ + rstnot.idl \ sensevts.idl \ servprov.idl \ + sesprp.idl \ shdeprecated.idl \ shldisp.idl \ shobjidl.idl \ shtypes.idl \ + srcrst.idl \ + stdole2.idl \ strmif.idl \ structuredquerycondition.idl \ taskschd.idl \ @@ -126,6 +155,7 @@ urlhist.idl \ urlmon.idl \ vmr9.idl \ + vmrender.idl \ vss.idl \ wbemcli.idl \ wbemdisp.idl \ @@ -137,6 +167,7 @@ windows.foundation.idl \ wine/itss.idl \ wine/svcctl.idl \ + wine/winedxgi.idl \ winsxs.idl \ wmiutils.idl \ wmp.idl \ @@ -145,21 +176,15 @@ wpcapi.idl \ wtypes.idl \ wuapi.idl \ + xapo.idl \ xaudio2.idl \ + xaudio2fx.idl \ + xmldom.idl \ + xmldso.idl \ xmllite.idl -IDL_TLB_SRCS = \ - stdole2.idl - -XTEMPLATE_SRCS = \ - rmxftmpl.x - -SRCDIR_INCLUDES = \ - $(IDL_TLB_SRCS) \ - $(PUBLIC_IDL_H_SRCS) \ - $(XTEMPLATE_SRCS) \ +HEADER_SRCS = \ accctrl.h \ - access.idl \ aclapi.h \ aclui.h \ adshlp.h \ @@ -168,8 +193,6 @@ amaudio.h \ appcompatapi.h \ appmgmt.h \ - asynot.idl \ - asysta.idl \ atlbase.h \ atlcom.h \ atlwin.h \ @@ -177,23 +200,17 @@ audiosessiontypes.h \ aviriff.h \ avrt.h \ - axcore.idl \ - axextend.idl \ basetsd.h \ basetyps.h \ bcrypt.h \ bdaiface_enums.h \ bdatypes.h \ - binres.idl \ bitsmsg.h \ cderr.h \ cfgmgr32.h \ cguid.h \ - chprst.idl \ cierror.h \ clusapi.h \ - cmdbas.idl \ - cmdtxt.idl \ commctrl.h \ commctrl.rh \ commdlg.h \ @@ -201,7 +218,6 @@ corerror.h \ corhdr.h \ cpl.h \ - crtrow.idl \ cryptdlg.h \ cryptuiapi.h \ custcntl.h \ @@ -229,6 +245,7 @@ d3drmwin.h \ d3dtypes.h \ d3dvec.inl \ + d3dx10.h \ d3dx9.h \ d3dx9anim.h \ d3dx9core.h \ @@ -241,13 +258,7 @@ d3dx9tex.h \ d3dx9xof.h \ davclnt.h \ - dbccmd.idl \ - dbcses.idl \ - dbdsad.idl \ dbghelp.h \ - dbinit.idl \ - dbprop.idl \ - dbs.idl \ dbt.h \ dciddi.h \ dciman.h \ @@ -282,7 +293,6 @@ ddrawgdi.h \ ddrawi.h \ delayloadhandler.h \ - devenum.idl \ devguid.h \ devpkey.h \ devpropdef.h \ @@ -326,10 +336,8 @@ dxfile.h \ dxgiformat.h \ dxgitype.h \ - dyngraph.idl \ errorrep.h \ errors.h \ - errrec.idl \ evcode.h \ evntprov.h \ evntrace.h \ @@ -342,6 +350,7 @@ gdiplus.h \ gdipluscolor.h \ gdipluscolormatrix.h \ + gdipluseffects.h \ gdiplusenums.h \ gdiplusflat.h \ gdiplusgpstubs.h \ @@ -502,7 +511,6 @@ olectl.h \ oledberr.h \ oledlg.h \ - opnrst.idl \ patchapi.h \ pdh.h \ pdhmsg.h \ @@ -510,6 +518,7 @@ pktdef.h \ poppack.h \ powrprof.h \ + prntvpt.h \ profinfo.h \ propkey.h \ propkeydef.h \ @@ -529,10 +538,6 @@ richedit.h \ rmxfguid.h \ roapi.h \ - row.idl \ - rowchg.idl \ - rowpos.idl \ - rowpsc.idl \ rpc.h \ rpcasync.h \ rpcdce.h \ @@ -541,10 +546,6 @@ rpcnterr.h \ rpcproxy.h \ rpcsal.h \ - rstbas.idl \ - rstinf.idl \ - rstloc.idl \ - rstnot.idl \ rtutils.h \ scarderr.h \ schannel.h \ @@ -554,7 +555,6 @@ secext.h \ security.h \ sensapi.h \ - sesprp.idl \ setupapi.h \ sfc.h \ shdispid.h \ @@ -570,7 +570,6 @@ sql.h \ sqlext.h \ sqltypes.h \ - srcrst.idl \ srrestoreptapi.h \ sspi.h \ sti.h \ @@ -599,7 +598,6 @@ verrsrc.h \ vfw.h \ vfwmsgs.h \ - vmrender.idl \ vsstyle.h \ vssym32.h \ vswriter.h \ @@ -608,6 +606,7 @@ werapi.h \ wfext.h \ wia.h \ + wiadef.h \ winbase.h \ wincon.h \ wincred.h \ @@ -663,42 +662,14 @@ wsipx.h \ wsnwlink.h \ wtsapi32.h \ + x3daudio.h \ + xapofx.h \ xcmc.h \ xinput.h \ xmldom.h \ - xmldom.idl \ xmldomdid.h \ - xmldso.idl \ xmldsodid.h \ zmouse.h -IDL_H_SRCS = $(PUBLIC_IDL_H_SRCS) $(PRIVATE_IDL_H_SRCS) -IDL_SRCS = $(IDL_H_SRCS) $(IDL_TLB_SRCS) - -OBJDIR_INCLUDES = $(PUBLIC_IDL_H_SRCS:.idl=.h) $(XTEMPLATE_SRCS:.x=.h) - -all: $(IDL_H_SRCS:.idl=.h) $(IDL_TLB_SRCS:.idl=.tlb) $(XTEMPLATE_SRCS:.x=.h) - -.PHONY: install install-dev uninstall - -install install-dev:: $(OBJDIR_INCLUDES) - for f in $(SRCDIR_INCLUDES); do case $$f in \ - wine/*) $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(includedir)/`expr $$f : 'wine/\(.*\)'` ;; \ - msvcrt/*) $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(includedir)/$$f ;; \ - *) $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(includedir)/windows/$$f ;; \ - esac; done - for f in $(OBJDIR_INCLUDES); do case $$f in \ - wine/*) $(INSTALL_DATA) $$f $(DESTDIR)$(includedir)/`expr $$f : 'wine/\(.*\)'` ;; \ - msvcrt/*) $(INSTALL_DATA) $$f $(DESTDIR)$(includedir)/$$f ;; \ - *) $(INSTALL_DATA) $$f $(DESTDIR)$(includedir)/windows/$$f ;; \ - esac; done - -# Don't just do a rm -rf on $(includedir) -- don't want to wipe out -# anything extra the user may have put there. -uninstall:: - for f in $(SRCDIR_INCLUDES) $(OBJDIR_INCLUDES); do case $$f in \ - wine/*) $(RM) $(DESTDIR)$(includedir)/`expr $$f : 'wine/\(.*\)'` ;; \ - msvcrt/*) $(RM) $(DESTDIR)$(includedir)/$$f ;; \ - *) $(RM) $(DESTDIR)$(includedir)/windows/$$f ;; \ - esac; done - -rmdir $(DESTDIR)$(includedir)/windows/ddk $(DESTDIR)$(includedir)/windows $(DESTDIR)$(includedir)/msvcrt/sys $(DESTDIR)$(includedir)/msvcrt +XTEMPLATE_SRCS = \ + rmxftmpl.x diff -Nru wine1.7-1.7.50/include/mmreg.h wine1.7-1.7.55/include/mmreg.h --- wine1.7-1.7.50/include/mmreg.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/mmreg.h 2015-11-13 14:32:40.000000000 +0000 @@ -107,6 +107,7 @@ #define WAVE_FORMAT_G721_ADPCM 0x0040 /* Antex Electronics Corporation */ #define WAVE_FORMAT_MPEG 0x0050 /* Microsoft Corporation */ #define WAVE_FORMAT_MPEGLAYER3 0x0055 +#define WAVE_FORMAT_MSRT24 0x0082 /* Microsoft Corporation */ #define WAVE_FORMAT_CREATIVE_ADPCM 0x0200 /* Creative Labs, Inc */ #define WAVE_FORMAT_CREATIVE_FASTSPEECH8 0x0202 /* Creative Labs, Inc */ #define WAVE_FORMAT_CREATIVE_FASTSPEECH10 0x0203 /* Creative Labs, Inc */ @@ -128,6 +129,7 @@ #define MM_FRAUNHOFER_IIS 0xAC #define MM_FHGIIS_MPEGLAYER3_DECODE 0x09 +#define MM_FHGIIS_MPEGLAYER3_PROFESSIONAL 0x0d #if !defined(WAVE_FORMAT_EXTENSIBLE) #define WAVE_FORMAT_EXTENSIBLE 0xFFFE /* Microsoft */ diff -Nru wine1.7-1.7.50/include/msctf.idl wine1.7-1.7.55/include/msctf.idl --- wine1.7-1.7.50/include/msctf.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/msctf.idl 2015-11-13 14:32:40.000000000 +0000 @@ -214,6 +214,20 @@ [ object, + uuid(3e90ade3-7594-4cb0-bb58-69628f5f458c), + pointer_default(unique) +] +interface ITfThreadMgrEx : ITfThreadMgr +{ + HRESULT ActivateEx( + [out] TfClientId *id, + [in] DWORD flags); + HRESULT GetActiveFlags( + [out] DWORD *flags); +} + +[ + object, uuid(d7540241-f9a1-4364-befc-dbcd2c4395b7), pointer_default(unique) ] @@ -1641,6 +1655,76 @@ } [ + object, + local, + uuid(ea1ea137-19df-11d7-a6d2-00065b84435c), + pointer_default(unique) +] +interface ITfUIElement : IUnknown +{ + HRESULT GetDescription( + [out] BSTR *description); + + HRESULT GetGUID( + [out] GUID *guid); + + HRESULT Show( + [in] BOOL show); + + HRESULT IsShown( + [out] BOOL *show); +} + +[ + object, + local, + uuid(887aa91e-acba-4931-84da-3c5208cf543f), + pointer_default(unique) +] +interface IEnumTfUIElements : IUnknown +{ + HRESULT Clone( + [out] IEnumTfUIElements **enum_elements); + + HRESULT Next( + [in] ULONG count, + [out, size_is(count), length_is(fetched)] ITfUIElement **element, + [out] ULONG fetched); + + HRESULT Reset(); + + HRESULT Skip( + [in] ULONG count); +} + +[ + object, + local, + uuid(ea1ea135-19df-11d7-a6d2-00065b84435c), + pointer_default(unique) +] +interface ITfUIElementMgr : IUnknown +{ + HRESULT BeginUIElement( + [in] ITfUIElement *element, + [in, out] BOOL *show, + [out] DWORD *id); + + HRESULT UpdateUIElement( + [in] DWORD id); + + HRESULT EndUIElement( + [in] DWORD id); + + HRESULT GetUIElement( + [in] DWORD id, + [out] ITfUIElement **element); + + HRESULT EnumUIElements( + [out] IEnumTfUIElements **enum_elements); +} + +[ object, uuid(73131f9c-56a9-49dd-b0ee-d046633f7528), pointer_default(unique) diff -Nru wine1.7-1.7.50/include/msvcrt/math.h wine1.7-1.7.55/include/msvcrt/math.h --- wine1.7-1.7.50/include/msvcrt/math.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/msvcrt/math.h 2015-11-13 14:32:40.000000000 +0000 @@ -76,7 +76,26 @@ double __cdecl _y1(double); double __cdecl _yn(int, double); -#ifdef __x86_64__ +double __cdecl cbrt(double); +double __cdecl exp2(double); +double __cdecl log2(double); +double __cdecl rint(double); +double __cdecl round(double); +double __cdecl trunc(double); + +float __cdecl cbrtf(float); +float __cdecl exp2f(float); +float __cdecl log2f(float); +float __cdecl rintf(float); +float __cdecl roundf(float); +float __cdecl truncf(float); + +long __cdecl lrint(double); +long __cdecl lrintf(float); +long __cdecl lround(double); +long __cdecl lroundf(float); + +#if defined(__x86_64__) || defined(__arm__) float __cdecl sinf(float); float __cdecl cosf(float); @@ -120,13 +139,13 @@ #define sqrtf(x) ((float)sqrt((double)(x))) #define ceilf(x) ((float)ceil((double)(x))) #define floorf(x) ((float)floor((double)(x))) +#define fabsf(x) ((float)fabs((double)(x))) #define frexpf(x) ((float)frexp((double)(x))) #define modff(x,y) ((float)modf((double)(x), (double*)(y))) #define fmodf(x,y) ((float)fmod((double)(x), (double)(y))) #endif -#define fabsf(x) ((float)fabs((double)(x))) #define ldexpf(x,y) ((float)ldexp((double)(x),(y))) float __cdecl _hypotf(float, float); @@ -146,6 +165,12 @@ # endif #endif +#define FP_INFINITE 1 +#define FP_NAN 2 +#define FP_NORMAL -1 +#define FP_SUBNORMAL -2 +#define FP_ZERO 0 + #ifdef __cplusplus } #endif diff -Nru wine1.7-1.7.50/include/netlistmgr.idl wine1.7-1.7.55/include/netlistmgr.idl --- wine1.7-1.7.50/include/netlistmgr.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/netlistmgr.idl 2015-11-13 14:32:40.000000000 +0000 @@ -44,6 +44,13 @@ NLM_CONNECTIVITY_IPV6_INTERNET = 0x0400 } NLM_CONNECTIVITY; +typedef [v1_enum] enum NLM_DOMAIN_TYPE +{ + NLM_DOMAIN_TYPE_NON_DOMAIN_NETWORK = 0x00, + NLM_DOMAIN_TYPE_DOMAIN_NETWORK = 0x01, + NLM_DOMAIN_TYPE_DOMAIN_AUTHENTICATED = 0x02 +} NLM_DOMAIN_TYPE; + typedef [v1_enum] enum NLM_ENUM_NETWORK { NLM_ENUM_NETWORK_CONNECTED = 0x01, @@ -112,6 +119,20 @@ [ object, pointer_default(unique), + uuid(dcb0000a-570f-4a9b-8d69-199fdba5723b) +] +interface INetworkConnectionCost : IUnknown +{ + HRESULT GetCost( + [out] DWORD *pCost); + + HRESULT GetDataPlanStatus( + [out] NLM_DATAPLAN_STATUS *pDataPlanStatus); +} + +[ + object, + pointer_default(unique), uuid(dcb00009-570f-4a9b-8d69-199fdba5723b) ] interface INetworkCostManagerEvents : IUnknown @@ -125,6 +146,68 @@ } [ + object, + oleautomation, + pointer_default(unique), + dual, + uuid(dcb00003-570f-4a9b-8d69-199fdba5723b) +] +interface IEnumNetworks : IDispatch +{ + [id(DISPID_NEWENUM), propget, hidden, restricted] + HRESULT _NewEnum( + [out, retval] IEnumVARIANT **ppEnumVar); + + [id(1)] + HRESULT Next( + [in] ULONG celt, + [out, size_is(celt), length_is(*pceltFetched)] INetwork **rgelt, + [in, out] ULONG *pceltFetched); + + [id(2)] + HRESULT Skip( + [in] ULONG celt); + + [id(3)] + HRESULT Reset(); + + [id(4)] + HRESULT Clone( + [out, retval] IEnumNetworks **ppEnumNetwork); +} + +[ + object, + oleautomation, + pointer_default(unique), + dual, + uuid(dcb00006-570f-4a9b-8d69-199fdba5723b) +] +interface IEnumNetworkConnections : IDispatch +{ + [id(DISPID_NEWENUM), propget, hidden, restricted] + HRESULT _NewEnum( + [out, retval] IEnumVARIANT **ppEnumVar); + + [id(1)] + HRESULT Next( + [in] ULONG celt, + [out, size_is(celt), length_is(*pceltFetched)] INetworkConnection **rgelt, + [in, out] ULONG *pceltFetched); + + [id(2)] + HRESULT Skip( + [in] ULONG celt); + + [id(3)] + HRESULT Reset(); + + [id(4)] + HRESULT Clone( + [out, retval] IEnumNetworkConnections **ppEnumNetwork); +} + +[ dual, object, oleautomation, @@ -197,3 +280,113 @@ [in] GUID connectionId, [in] NLM_CONNECTION_PROPERTY_CHANGE flags); } + +[ + object, + oleautomation, + pointer_default(unique), + dual, + uuid(dcb00005-570f-4a9b-8d69-199fdba5723b) +] +interface INetworkConnection : IDispatch +{ + [id(1)] + HRESULT GetNetwork( + [out, retval] INetwork **ppNetwork); + + [propget, id(2)] + HRESULT IsConnectedToInternet( + [out, retval] VARIANT_BOOL *pbIsConnected); + + [propget, id(3)] + HRESULT IsConnected( + [out, retval] VARIANT_BOOL *pbIsConnected); + + [id(4)] + HRESULT GetConnectivity( + [out, retval] NLM_CONNECTIVITY *pConnectivity); + + [id(5)] + HRESULT GetConnectionId( + [out, retval] GUID *pgdConnectionId); + + [id(6)] + HRESULT GetAdapterId( + [out, retval] GUID *pgdAdapterId); + + [id(7)] + HRESULT GetDomainType( + [out, retval] NLM_DOMAIN_TYPE *pDomainType); +} + +[ + object, + oleautomation, + pointer_default(unique), + dual, + uuid(dcb00002-570f-4a9b-8d69-199fdba5723b) +] +interface INetwork : IDispatch +{ + typedef enum NLM_NETWORK_CATEGORY + { + NLM_NETWORK_CATEGORY_PUBLIC = 0x00, + NLM_NETWORK_CATEGORY_PRIVATE = 0x01, + NLM_NETWORK_CATEGORY_DOMAIN_AUTHENTICATED = 0x02 + } NLM_NETWORK_CATEGORY; + + [id(1)] + HRESULT GetName( + [out, string, retval] BSTR *pszNetworkName); + + [id(2)] + HRESULT SetName( + [in, string] BSTR szNetworkNewName); + + [id(3)] + HRESULT GetDescription( + [out, string, retval] BSTR *pszDescription); + + [id(4)] + HRESULT SetDescription( + [in, string] BSTR szDescription); + + [id(5)] + HRESULT GetNetworkId( + [out, retval] GUID *pgdGuidNetworkId); + + [id(6)] + HRESULT GetDomainType( + [out, retval] NLM_DOMAIN_TYPE *pNetworkType); + + [id(7)] + HRESULT GetNetworkConnections( + [out, retval] IEnumNetworkConnections **ppEnumNetworkConnection); + + [id(8)] + HRESULT GetTimeCreatedAndConnected( + [out] DWORD *pdwLowDateTimeCreated, + [out] DWORD *pdwHighDateTimeCreated, + [out] DWORD *pdwLowDateTimeConnected, + [out] DWORD *pdwHighDateTimeConnected); + + [propget, id(9)] + HRESULT IsConnectedToInternet( + [out, retval] VARIANT_BOOL *pbIsConnected); + + [propget, id(10)] + HRESULT IsConnected( + [out, retval] VARIANT_BOOL *pbIsConnected); + + [id(11)] + HRESULT GetConnectivity( + [out, retval] NLM_CONNECTIVITY *pConnectivity); + + [id(12)] + HRESULT GetCategory( + [out, retval] NLM_NETWORK_CATEGORY *pCategory); + + [id(13)] + HRESULT SetCategory( + [in] NLM_NETWORK_CATEGORY NewCategory); +} diff -Nru wine1.7-1.7.50/include/odbcinst.h wine1.7-1.7.55/include/odbcinst.h --- wine1.7-1.7.50/include/odbcinst.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/odbcinst.h 2015-11-13 14:32:40.000000000 +0000 @@ -84,8 +84,8 @@ BOOL WINAPI SQLGetConfigMode(UWORD*); BOOL WINAPI SQLGetInstalledDrivers(LPSTR,WORD,WORD*); BOOL WINAPI SQLGetInstalledDriversW(LPWSTR,WORD,WORD*); -int WINAPI SQLGetPrivateProfileString(LPCSTR,LPCSTR,LPCSTR,LPCSTR,int,LPCSTR); -int WINAPI SQLGetPrivateProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR,int,LPCWSTR); +int WINAPI SQLGetPrivateProfileString(LPCSTR,LPCSTR,LPCSTR,LPSTR,int,LPCSTR); +int WINAPI SQLGetPrivateProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR,LPWSTR,int,LPCWSTR); BOOL WINAPI SQLGetTranslator(HWND,LPSTR,WORD,WORD*,LPSTR,WORD,WORD*,DWORD*); BOOL WINAPI SQLGetTranslatorW(HWND,LPWSTR,WORD,WORD*,LPWSTR,WORD,WORD*,DWORD*); BOOL WINAPI SQLInstallDriver(LPCSTR,LPCSTR,LPSTR,WORD,WORD*); diff -Nru wine1.7-1.7.50/include/ole2.h wine1.7-1.7.55/include/ole2.h --- wine1.7-1.7.50/include/ole2.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/ole2.h 2015-11-13 14:32:40.000000000 +0000 @@ -107,6 +107,9 @@ HRESULT WINAPI OleLockRunning(LPUNKNOWN pUnknown, BOOL fLock, BOOL fLastUnlockCloses); HRESULT WINAPI OleCreateFromFile(REFCLSID rclsid, LPCOLESTR lpszFileName, REFIID riid, DWORD renderopt, LPFORMATETC lpFormatEtc, LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, LPVOID* ppvObj); +HRESULT WINAPI OleCreateFromFileEx(REFCLSID clsid, LPCOLESTR filename, REFIID iid, DWORD flags, + DWORD renderopt, ULONG num_fmts, DWORD *adv_flags, LPFORMATETC fmts, IAdviseSink *sink, + DWORD *conns, LPOLECLIENTSITE client_site, LPSTORAGE storage, LPVOID* obj); HRESULT WINAPI OleCreateLink(LPMONIKER pmkLinkSrc, REFIID riid, DWORD renderopt, LPFORMATETC lpFormatEtc, LPOLECLIENTSITE pClientSite, LPSTORAGE pStg, LPVOID* ppvObj); HRESULT WINAPI OleCreate(REFCLSID rclsid, REFIID riid, DWORD renderopt, LPFORMATETC pFormatEtc, LPOLECLIENTSITE pClientSite, diff -Nru wine1.7-1.7.50/include/oleauto.h wine1.7-1.7.55/include/oleauto.h --- wine1.7-1.7.50/include/oleauto.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/oleauto.h 2015-11-13 14:32:40.000000000 +0000 @@ -105,11 +105,15 @@ /* Macros for accessing the fields of the VARIANT type */ #if (__STDC__ && !defined(_FORCENAMELESSUNION)) || defined(NONAMELESSUNION) -#define V_UNION(A,B) ((A)->n1.n2.n3.B) -#define V_VT(A) ((A)->n1.n2.vt) +#define V_VT(A) ((A)->n1.n2.vt) +#define V_UNION(A,B) ((A)->n1.n2.n3.B) +#define V_RECORD(A) (V_UNION(A,brecVal).pvRecord) +#define V_RECORDINFO(A) (V_UNION(A,brecVal).pRecInfo) #else -#define V_UNION(A,B) ((A)->B) -#define V_VT(A) ((A)->vt) +#define V_VT(A) ((A)->vt) +#define V_UNION(A,B) ((A)->B) +#define V_RECORD(A) ((A)->pvRecord) +#define V_RECORDINFO(A) ((A)->pRecInfo) #endif #define V_ISBYREF(A) (V_VT(A) & VT_BYREF) diff -Nru wine1.7-1.7.50/include/oledberr.h wine1.7-1.7.55/include/oledberr.h --- wine1.7-1.7.50/include/oledberr.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/oledberr.h 2015-11-13 14:32:40.000000000 +0000 @@ -23,6 +23,11 @@ #define DB_E_BADBINDINFO 0x80040e08 +#define DB_E_ERRORSINCOMMAND 0x80040e14 +#define DB_E_CANTCANCEL 0x80040e15 +#define DB_E_DIALECTNOTSUPPORTED 0x80040e16 +#define DB_E_DUPLICATEDATASOURCE 0x80040e17 +#define DB_E_CANNOTRESTART 0x80040e18 #define DB_E_NOTFOUND 0x80040e19 #define DB_E_UNSUPPORTEDCONVERSION 0x80040e1d diff -Nru wine1.7-1.7.50/include/opnrst.idl wine1.7-1.7.55/include/opnrst.idl --- wine1.7-1.7.50/include/opnrst.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/opnrst.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + [ object, uuid(0c733a69-2a1c-11ce-ade5-00aa0044773d), diff -Nru wine1.7-1.7.50/include/prntvpt.h wine1.7-1.7.55/include/prntvpt.h --- wine1.7-1.7.50/include/prntvpt.h 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/include/prntvpt.h 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2015 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 _PRNPTNTV_H_ +#define _PRNPTNTV_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +DECLARE_HANDLE(HPTPROVIDER); + +HRESULT WINAPI PTOpenProvider(const WCHAR *printer, DWORD version, HPTPROVIDER *provider); + +#ifdef __cplusplus +} +#endif + +#endif /* _PRNPTNTV_H_ */ diff -Nru wine1.7-1.7.50/include/rmxftmpl.x wine1.7-1.7.55/include/rmxftmpl.x --- wine1.7-1.7.50/include/rmxftmpl.x 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/rmxftmpl.x 2015-11-13 14:32:40.000000000 +0000 @@ -17,6 +17,7 @@ #pragma xftmpl name D3DRM_XTEMPLATES #pragma xftmpl size D3DRM_XTEMPLATE_BYTES +#pragma makedep install template Header { diff -Nru wine1.7-1.7.50/include/rowchg.idl wine1.7-1.7.55/include/rowchg.idl --- wine1.7-1.7.50/include/rowchg.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/rowchg.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + [ local, object, diff -Nru wine1.7-1.7.50/include/row.idl wine1.7-1.7.55/include/row.idl --- wine1.7-1.7.50/include/row.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/row.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + [ local, object, diff -Nru wine1.7-1.7.50/include/rowpos.idl wine1.7-1.7.55/include/rowpos.idl --- wine1.7-1.7.50/include/rowpos.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/rowpos.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + [ object, uuid(0c733a94-2a1c-11ce-ade5-00aa0044773d), diff -Nru wine1.7-1.7.50/include/rowpsc.idl wine1.7-1.7.55/include/rowpsc.idl --- wine1.7-1.7.50/include/rowpsc.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/rowpsc.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + [ object, uuid(0997a571-126e-11d0-9f8a-00a0c9a0631e), diff -Nru wine1.7-1.7.50/include/rstbas.idl wine1.7-1.7.55/include/rstbas.idl --- wine1.7-1.7.50/include/rstbas.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/rstbas.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + [ local, object, diff -Nru wine1.7-1.7.50/include/rstinf.idl wine1.7-1.7.55/include/rstinf.idl --- wine1.7-1.7.50/include/rstinf.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/rstinf.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + [ object, uuid(0c733a55-2a1c-11ce-ade5-00aa0044773d), diff -Nru wine1.7-1.7.50/include/rstloc.idl wine1.7-1.7.55/include/rstloc.idl --- wine1.7-1.7.50/include/rstloc.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/rstloc.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + [ local, object, diff -Nru wine1.7-1.7.50/include/rstnot.idl wine1.7-1.7.55/include/rstnot.idl --- wine1.7-1.7.50/include/rstnot.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/rstnot.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + [ object, uuid(0c733a83-2a1c-11ce-ade5-00aa0044773d), diff -Nru wine1.7-1.7.50/include/sesprp.idl wine1.7-1.7.55/include/sesprp.idl --- wine1.7-1.7.50/include/sesprp.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/sesprp.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + [ object, uuid(0c733a85-2a1c-11ce-ade5-00aa0044773d), diff -Nru wine1.7-1.7.50/include/shellapi.h wine1.7-1.7.55/include/shellapi.h --- wine1.7-1.7.50/include/shellapi.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/shellapi.h 2015-11-13 14:32:40.000000000 +0000 @@ -606,8 +606,8 @@ SIID_MEDIABDR, SIID_MEDIABDRE, SIID_CLUSTEREDDRIVE, - /* Missing: 141 - 174 */ - SIID_MAX_ICONS = 175 + /* Missing: 141 - 177 */ + SIID_MAX_ICONS = 178 }SHSTOCKICONID; typedef struct _SHSTOCKICONINFO diff -Nru wine1.7-1.7.50/include/srcrst.idl wine1.7-1.7.55/include/srcrst.idl --- wine1.7-1.7.50/include/srcrst.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/srcrst.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + [ object, uuid(0c733a1e-2a1c-11ce-ade5-00aa0044773d), diff -Nru wine1.7-1.7.50/include/stdole2.idl wine1.7-1.7.55/include/stdole2.idl --- wine1.7-1.7.50/include/stdole2.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/stdole2.idl 2015-11-13 14:32:40.000000000 +0000 @@ -18,7 +18,10 @@ * */ +#if 0 +#pragma makedep install #pragma makedep typelib +#endif #include diff -Nru wine1.7-1.7.50/include/urlmon.idl wine1.7-1.7.55/include/urlmon.idl --- wine1.7-1.7.50/include/urlmon.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/urlmon.idl 2015-11-13 14:32:40.000000000 +0000 @@ -729,7 +729,8 @@ BINDSTRING_ROOTDOC_URL, BINDSTRING_INITIAL_FILENAME, BINDSTRING_PROXY_USERNAME, - BINDSTRING_PROXY_PASSWORD + BINDSTRING_PROXY_PASSWORD, + BINDSTRING_ENTERPRISE_ID } BINDSTRING; HRESULT GetBindInfo( diff -Nru wine1.7-1.7.50/include/vmrender.idl wine1.7-1.7.55/include/vmrender.idl --- wine1.7-1.7.50/include/vmrender.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/vmrender.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + cpp_quote("#if 0") typedef DWORD IDirectDrawSurface7; typedef DWORD IDirectDraw7; diff -Nru wine1.7-1.7.50/include/webservices.h wine1.7-1.7.55/include/webservices.h --- wine1.7-1.7.50/include/webservices.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/webservices.h 2015-11-13 14:32:40.000000000 +0000 @@ -24,6 +24,13 @@ #endif /* __cplusplus */ typedef struct _WS_ERROR WS_ERROR; +typedef struct _WS_HEAP WS_HEAP; +typedef struct _WS_XML_BUFFER WS_XML_BUFFER; +typedef struct _WS_XML_READER WS_XML_READER; +typedef struct _WS_XML_WRITER WS_XML_WRITER; + +struct _WS_STRUCT_DESCRIPTION; +struct _WS_XML_STRING; typedef enum { WS_ERROR_PROPERTY_STRING_COUNT, @@ -37,7 +44,520 @@ ULONG valueSize; } WS_ERROR_PROPERTY; +typedef enum { + WS_HEAP_PROPERTY_MAX_SIZE, + WS_HEAP_PROPERTY_TRIM_SIZE, + WS_HEAP_PROPERTY_REQUESTED_SIZE, + WS_HEAP_PROPERTY_ACTUAL_SIZE +} WS_HEAP_PROPERTY_ID; + +typedef struct _WS_HEAP_PROPERTY { + WS_HEAP_PROPERTY_ID id; + void *value; + ULONG valueSize; +} WS_HEAP_PROPERTY; + +typedef ULONG WS_XML_BUFFER_PROPERTY_ID; + +typedef struct _WS_XML_BUFFER_PROPERTY { + WS_XML_BUFFER_PROPERTY_ID id; + void *value; + ULONG valueSize; +} WS_XML_BUFFER_PROPERTY; + +typedef enum { + WS_XML_READER_PROPERTY_MAX_DEPTH, + WS_XML_READER_PROPERTY_ALLOW_FRAGMENT, + WS_XML_READER_PROPERTY_MAX_ATTRIBUTES, + WS_XML_READER_PROPERTY_READ_DECLARATION, + WS_XML_READER_PROPERTY_CHARSET, + WS_XML_READER_PROPERTY_ROW, + WS_XML_READER_PROPERTY_COLUMN, + WS_XML_READER_PROPERTY_UTF8_TRIM_SIZE, + WS_XML_READER_PROPERTY_STREAM_BUFFER_SIZE, + WS_XML_READER_PROPERTY_IN_ATTRIBUTE, + WS_XML_READER_PROPERTY_STREAM_MAX_ROOT_MIME_PART_SIZE, + WS_XML_READER_PROPERTY_STREAM_MAX_MIME_HEADERS_SIZE, + WS_XML_READER_PROPERTY_MAX_MIME_PARTS, + WS_XML_READER_PROPERTY_ALLOW_INVALID_CHARACTER_REFERENCES, + WS_XML_READER_PROPERTY_MAX_NAMESPACES +} WS_XML_READER_PROPERTY_ID; + +typedef struct _WS_XML_READER_PROPERTY { + WS_XML_READER_PROPERTY_ID id; + void *value; + ULONG valueSize; +} WS_XML_READER_PROPERTY; + +typedef enum { + WS_XML_WRITER_PROPERTY_MAX_DEPTH, + WS_XML_WRITER_PROPERTY_ALLOW_FRAGMENT, + WS_XML_WRITER_PROPERTY_MAX_ATTRIBUTES, + WS_XML_WRITER_PROPERTY_WRITE_DECLARATION, + WS_XML_WRITER_PROPERTY_INDENT, + WS_XML_WRITER_PROPERTY_BUFFER_TRIM_SIZE, + WS_XML_WRITER_PROPERTY_CHARSET, + WS_XML_WRITER_PROPERTY_BUFFERS, + WS_XML_WRITER_PROPERTY_BUFFER_MAX_SIZE, + WS_XML_WRITER_PROPERTY_BYTES, + WS_XML_WRITER_PROPERTY_IN_ATTRIBUTE, + WS_XML_WRITER_PROPERTY_MAX_MIME_PARTS_BUFFER_SIZE, + WS_XML_WRITER_PROPERTY_INITIAL_BUFFER, + WS_XML_WRITER_PROPERTY_ALLOW_INVALID_CHARACTER_REFERENCES, + WS_XML_WRITER_PROPERTY_MAX_NAMESPACES, + WS_XML_WRITER_PROPERTY_BYTES_WRITTEN, + WS_XML_WRITER_PROPERTY_BYTES_TO_CLOSE, + WS_XML_WRITER_PROPERTY_COMPRESS_EMPTY_ELEMENTS, + WS_XML_WRITER_PROPERTY_EMIT_UNCOMPRESSED_EMPTY_ELEMENTS +} WS_XML_WRITER_PROPERTY_ID; + +typedef struct _WS_XML_WRITER_PROPERTY { + WS_XML_WRITER_PROPERTY_ID id; + void *value; + ULONG valueSize; +} WS_XML_WRITER_PROPERTY; + +typedef struct _WS_BYTES { + ULONG length; + BYTE *bytes; +} WS_BYTES; + +typedef struct _WS_BUFFERS { + ULONG bufferCount; + WS_BYTES *buffers; +} WS_BUFFERS; + +typedef enum { + WS_XML_READER_ENCODING_TYPE_TEXT = 1, + WS_XML_READER_ENCODING_TYPE_BINARY = 2, + WS_XML_READER_ENCODING_TYPE_MTOM = 3, + WS_XML_READER_ENCODING_TYPE_RAW = 4 +} WS_XML_READER_ENCODING_TYPE; + +typedef struct _WS_XML_READER_ENCODING { + WS_XML_READER_ENCODING_TYPE encodingType; +} WS_XML_READER_ENCODING; + +typedef enum { + WS_XML_WRITER_ENCODING_TYPE_TEXT = 1, + WS_XML_WRITER_ENCODING_TYPE_BINARY = 2, + WS_XML_WRITER_ENCODING_TYPE_MTOM = 3, + WS_XML_WRITER_ENCODING_TYPE_RAW = 4 +} WS_XML_WRITER_ENCODING_TYPE; + +typedef struct _WS_XML_WRITER_ENCODING { + WS_XML_WRITER_ENCODING_TYPE encodingType; +} WS_XML_WRITER_ENCODING; + +typedef enum { + WS_CHARSET_AUTO, + WS_CHARSET_UTF8, + WS_CHARSET_UTF16LE, + WS_CHARSET_UTF16BE +} WS_CHARSET; + +typedef struct _WS_XML_READER_TEXT_ENCODING { + WS_XML_READER_ENCODING encoding; + WS_CHARSET charSet; +} WS_XML_READER_TEXT_ENCODING; + +typedef struct _WS_XML_WRITER_TEXT_ENCODING { + WS_XML_WRITER_ENCODING encoding; + WS_CHARSET charSet; +} WS_XML_WRITER_TEXT_ENCODING; + +typedef enum { + WS_XML_READER_INPUT_TYPE_BUFFER = 1, + WS_XML_READER_INPUT_TYPE_STREAM = 2 +} WS_XML_READER_INPUT_TYPE; + +typedef enum { + WS_XML_WRITER_OUTPUT_TYPE_BUFFER = 1, + WS_XML_WRITER_OUTPUT_TYPE_STREAM = 2 +} WS_XML_WRITER_OUTPUT_TYPE; + +typedef struct _WS_XML_READER_INPUT { + WS_XML_READER_INPUT_TYPE inputType; +} WS_XML_READER_INPUT; + +typedef struct _WS_XML_WRITER_OUTPUT { + WS_XML_WRITER_OUTPUT_TYPE outputType; +} WS_XML_WRITER_OUTPUT; + +typedef struct _WS_XML_READER_BUFFER_INPUT { + WS_XML_READER_INPUT input; + void *encodedData; + ULONG encodedDataSize; +} WS_XML_READER_BUFFER_INPUT; + +typedef struct _WS_XML_WRITER_BUFFER_OUTPUT { + WS_XML_WRITER_OUTPUT output; +} WS_XML_WRITER_BUFFER_OUTPUT; + +typedef enum { + WS_SHORT_CALLBACK, + WS_LONG_CALLBACK +} WS_CALLBACK_MODEL; + +typedef void (CALLBACK *WS_ASYNC_CALLBACK) + (HRESULT, WS_CALLBACK_MODEL, void *); + +typedef struct _WS_ASYNC_CONTEXT { + WS_ASYNC_CALLBACK callback; + void *callbackState; +} WS_ASYNC_CONTEXT; + +typedef HRESULT (CALLBACK *WS_READ_CALLBACK) + (void*, void*, ULONG, ULONG*, const WS_ASYNC_CONTEXT*, WS_ERROR*); + +typedef struct _WS_XML_READER_STREAM_INPUT { + WS_XML_READER_INPUT input; + WS_READ_CALLBACK readCallback; + void *readCallbackState; +} WS_XML_READER_STREAM_INPUT; + +typedef struct _WS_XML_DICTIONARY { + GUID guid; + struct _WS_XML_STRING *strings; + ULONG stringCount; + BOOL isConst; +} WS_XML_DICTIONARY; + +typedef struct _WS_XML_STRING { + ULONG length; + BYTE *bytes; + WS_XML_DICTIONARY *dictionary; + ULONG id; +} WS_XML_STRING; + +typedef enum { + WS_ELEMENT_TYPE_MAPPING = 1, + WS_ATTRIBUTE_TYPE_MAPPING = 2, + WS_ELEMENT_CONTENT_TYPE_MAPPING = 3, + WS_ANY_ELEMENT_TYPE_MAPPING = 4 +} WS_TYPE_MAPPING; + +typedef enum { + WS_BOOL_TYPE, + WS_INT8_TYPE, + WS_INT16_TYPE, + WS_INT32_TYPE, + WS_INT64_TYPE, + WS_UINT8_TYPE, + WS_UINT16_TYPE, + WS_UINT32_TYPE, + WS_UINT64_TYPE, + WS_FLOAT_TYPE, + WS_DOUBLE_TYPE, + WS_DECIMAL_TYPE, + WS_DATETIME_TYPE, + WS_TIMESPAN_TYPE, + WS_GUID_TYPE, + WS_UNIQUE_ID_TYPE, + WS_STRING_TYPE, + WS_WSZ_TYPE, + WS_BYTES_TYPE, + WS_XML_STRING_TYPE, + WS_XML_QNAME_TYPE, + WS_XML_BUFFER_TYPE, + WS_CHAR_ARRAY_TYPE, + WS_UTF8_ARRAY_TYPE, + WS_BYTE_ARRAY_TYPE, + WS_DESCRIPTION_TYPE, + WS_STRUCT_TYPE, + WS_CUSTOM_TYPE, + WS_ENDPOINT_ADDRESS_TYPE, + WS_FAULT_TYPE, + WS_VOID_TYPE, + WS_ENUM_TYPE, + WS_DURATION_TYPE, + WS_UNION_TYPE, + WS_ANY_ATTRIBUTES_TYPE +} WS_TYPE; + +typedef enum { + WS_READ_REQUIRED_VALUE = 1, + WS_READ_REQUIRED_POINTER = 2, + WS_READ_OPTIONAL_POINTER = 3, + WS_READ_NILLABLE_POINTER = 4, + WS_READ_NILLABLE_VALUE = 5 +} WS_READ_OPTION; + +typedef enum { + WS_WRITE_REQUIRED_VALUE = 1, + WS_WRITE_REQUIRED_POINTER = 2, + WS_WRITE_NILLABLE_VALUE = 3, + WS_WRITE_NILLABLE_POINTER = 4 +} WS_WRITE_OPTION; + +typedef enum { + WS_TYPE_ATTRIBUTE_FIELD_MAPPING, + WS_ATTRIBUTE_FIELD_MAPPING, + WS_ELEMENT_FIELD_MAPPING, + WS_REPEATING_ELEMENT_FIELD_MAPPING, + WS_TEXT_FIELD_MAPPING, + WS_NO_FIELD_MAPPING, + WS_XML_ATTRIBUTE_FIELD_MAPPING, + WS_ELEMENT_CHOICE_FIELD_MAPPING, + WS_REPEATING_ELEMENT_CHOICE_FIELD_MAPPING, + WS_ANY_ELEMENT_FIELD_MAPPING, + WS_REPEATING_ANY_ELEMENT_FIELD_MAPPING, + WS_ANY_CONTENT_FIELD_MAPPING, + WS_ANY_ATTRIBUTES_FIELD_MAPPING +} WS_FIELD_MAPPING; + +typedef struct _WS_DEFAULT_VALUE { + void *value; + ULONG valueSize; +} WS_DEFAULT_VALUE; + +typedef struct _WS_ITEM_RANGE { + ULONG minItemCount; + ULONG maxItemCount; +} WS_ITEM_RANGE; + +enum +{ + WS_FIELD_POINTER = 0x1, + WS_FIELD_OPTIONAL = 0x2, + WS_FIELD_NILLABLE = 0x4, + WS_FIELD_NILLABLE_ITEM = 0x8, + WS_FIELD_OTHER_NAMESPACE = 0x10 +}; + +typedef struct _WS_FIELD_DESCRIPTION { + WS_FIELD_MAPPING mapping; + WS_XML_STRING *localName; + WS_XML_STRING *ns; + WS_TYPE type; + void *typeDescription; + ULONG offset; + ULONG options; + WS_DEFAULT_VALUE *defaultValue; + ULONG countOffset; + WS_XML_STRING *itemLocalName; + WS_XML_STRING *itemNs; + WS_ITEM_RANGE *itemRange; +} WS_FIELD_DESCRIPTION; + +enum +{ + WS_STRUCT_ABSTRACT = 0x1, + WS_STRUCT_IGNORE_TRAILING_ELEMENT_CONTENT = 0x2, + WS_STRUCT_IGNORE_UNHANDLED_ATTRIBUTES = 0x4 +}; + +typedef struct _WS_STRUCT_DESCRIPTION { + ULONG size; + ULONG alignment; + WS_FIELD_DESCRIPTION **fields; + ULONG fieldCount; + WS_XML_STRING *typeLocalName; + WS_XML_STRING *typeNs; + struct _WS_STRUCT_DESCRIPTION *parentType; + struct _WS_STRUCT_DESCRIPTION **subTypes; + ULONG subTypeCount; + ULONG structOptions; +} WS_STRUCT_DESCRIPTION; + +typedef struct _WS_ATTRIBUTE_DESCRIPTION { + WS_XML_STRING *attributeLocalName; + WS_XML_STRING *attributeNs; + WS_TYPE type; + void *typeDescription; +} WS_ATTRIBUTE_DESCRIPTION; + +typedef struct _WS_STRING { + ULONG length; + WCHAR *chars; +} WS_STRING; + +typedef enum { + WS_XML_NODE_TYPE_ELEMENT = 1, + WS_XML_NODE_TYPE_TEXT = 2, + WS_XML_NODE_TYPE_END_ELEMENT = 3, + WS_XML_NODE_TYPE_COMMENT = 4, + WS_XML_NODE_TYPE_CDATA = 6, + WS_XML_NODE_TYPE_END_CDATA = 7, + WS_XML_NODE_TYPE_EOF = 8, + WS_XML_NODE_TYPE_BOF = 9 +} WS_XML_NODE_TYPE; + +typedef struct _WS_XML_NODE { + WS_XML_NODE_TYPE nodeType; +} WS_XML_NODE; + +typedef enum { + WS_MOVE_TO_ROOT_ELEMENT, + WS_MOVE_TO_NEXT_ELEMENT, + WS_MOVE_TO_PREVIOUS_ELEMENT, + WS_MOVE_TO_CHILD_ELEMENT, + WS_MOVE_TO_END_ELEMENT, + WS_MOVE_TO_PARENT_ELEMENT, + WS_MOVE_TO_NEXT_NODE, + WS_MOVE_TO_PREVIOUS_NODE, + WS_MOVE_TO_FIRST_NODE, + WS_MOVE_TO_BOF, + WS_MOVE_TO_EOF, + WS_MOVE_TO_CHILD_NODE +} WS_MOVE_TO; + +typedef enum { + WS_XML_TEXT_TYPE_UTF8 = 1, + WS_XML_TEXT_TYPE_UTF16 = 2, + WS_XML_TEXT_TYPE_BASE64 = 3, + WS_XML_TEXT_TYPE_BOOL = 4, + WS_XML_TEXT_TYPE_INT32 = 5, + WS_XML_TEXT_TYPE_INT64 = 6, + WS_XML_TEXT_TYPE_UINT64 = 7, + WS_XML_TEXT_TYPE_FLOAT = 8, + WS_XML_TEXT_TYPE_DOUBLE = 9, + WS_XML_TEXT_TYPE_DECIMAL = 10, + WS_XML_TEXT_TYPE_GUID = 11, + WS_XML_TEXT_TYPE_UNIQUE_ID = 12, + WS_XML_TEXT_TYPE_DATETIME = 13, + WS_XML_TEXT_TYPE_TIMESPAN = 14, + WS_XML_TEXT_TYPE_QNAME = 15, + WS_XML_TEXT_TYPE_LIST = 16 +} WS_XML_TEXT_TYPE; + +typedef struct _WS_XML_TEXT { + WS_XML_TEXT_TYPE textType; +} WS_XML_TEXT; + +typedef struct _WS_XML_UTF8_TEXT { + WS_XML_TEXT text; + WS_XML_STRING value; +} WS_XML_UTF8_TEXT; + +typedef struct _WS_XML_ATTRIBUTE { + BYTE singleQuote; + BYTE isXmlNs; + WS_XML_STRING *prefix; + WS_XML_STRING *localName; + WS_XML_STRING *ns; + WS_XML_TEXT *value; +} WS_XML_ATTRIBUTE; + +typedef struct _WS_XML_ELEMENT_NODE { + WS_XML_NODE node; + WS_XML_STRING *prefix; + WS_XML_STRING *localName; + WS_XML_STRING *ns; + ULONG attributeCount; + WS_XML_ATTRIBUTE **attributes; + BOOL isEmpty; +} WS_XML_ELEMENT_NODE; + +typedef struct _WS_XML_TEXT_NODE { + WS_XML_NODE node; + WS_XML_TEXT *text; +} WS_XML_TEXT_NODE; + +typedef struct _WS_XML_COMMENT_NODE { + WS_XML_NODE node; + WS_XML_STRING value; +} WS_XML_COMMENT_NODE; + +typedef struct _WS_XML_NODE_POSITION { + WS_XML_BUFFER *buffer; + void *node; +} WS_XML_NODE_POSITION; + +HRESULT WINAPI WsAlloc(WS_HEAP*, SIZE_T, void**, WS_ERROR*); HRESULT WINAPI WsCreateError(const WS_ERROR_PROPERTY*, ULONG, WS_ERROR**); +HRESULT WINAPI WsCreateHeap(SIZE_T, SIZE_T, const WS_HEAP_PROPERTY*, ULONG, WS_HEAP**, WS_ERROR*); +HRESULT WINAPI WsCreateReader(const WS_XML_READER_PROPERTY*, ULONG, WS_XML_READER**, WS_ERROR*); +HRESULT WINAPI WsCreateWriter(const WS_XML_WRITER_PROPERTY*, ULONG, WS_XML_WRITER**, WS_ERROR*); +HRESULT WINAPI WsCreateXmlBuffer(WS_HEAP*, const WS_XML_BUFFER_PROPERTY*, ULONG, WS_XML_BUFFER**, + WS_ERROR*); +HRESULT WINAPI WsFillReader(WS_XML_READER*, ULONG, const WS_ASYNC_CONTEXT*, WS_ERROR*); +HRESULT WINAPI WsFindAttribute(WS_XML_READER*, const WS_XML_STRING*, const WS_XML_STRING*, BOOL, + ULONG*, WS_ERROR*); +void WINAPI WsFreeError(WS_ERROR*); +void WINAPI WsFreeHeap(WS_HEAP*); +void WINAPI WsFreeReader(WS_XML_READER*); +void WINAPI WsFreeWriter(WS_XML_WRITER*); +HRESULT WINAPI WsGetErrorProperty(WS_ERROR*, WS_ERROR_PROPERTY_ID, void*, ULONG); +HRESULT WINAPI WsGetErrorString(WS_ERROR*, ULONG, WS_STRING*); +HRESULT WINAPI WsGetHeapProperty(WS_HEAP*, WS_HEAP_PROPERTY_ID, void*, ULONG, WS_ERROR*); +HRESULT WINAPI WsGetReaderNode(WS_XML_READER*, const WS_XML_NODE**, WS_ERROR*); +HRESULT WINAPI WsGetReaderPosition(WS_XML_READER*, WS_XML_NODE_POSITION*, WS_ERROR*); +HRESULT WINAPI WsGetReaderProperty(WS_XML_READER*, WS_XML_READER_PROPERTY_ID, void*, ULONG, WS_ERROR*); +HRESULT WINAPI WsGetWriterProperty(WS_XML_WRITER*, WS_XML_WRITER_PROPERTY_ID, void*, ULONG, WS_ERROR*); +HRESULT WINAPI WsGetXmlAttribute(WS_XML_READER*, const WS_XML_STRING*, WS_HEAP*, WCHAR**, + ULONG*, WS_ERROR*); +HRESULT WINAPI WsMoveReader(WS_XML_READER*, WS_MOVE_TO, BOOL*, WS_ERROR*); +HRESULT WINAPI WsMoveWriter(WS_XML_WRITER*, WS_MOVE_TO, BOOL*, WS_ERROR*); +HRESULT WINAPI WsReadAttribute(WS_XML_READER*, const WS_ATTRIBUTE_DESCRIPTION*, WS_READ_OPTION, + WS_HEAP*, void*, ULONG, WS_ERROR*); +HRESULT WINAPI WsReadEndElement(WS_XML_READER*, WS_ERROR*); +HRESULT WINAPI WsReadNode(WS_XML_READER*, WS_ERROR*); +HRESULT WINAPI WsReadStartAttribute(WS_XML_READER*, ULONG, WS_ERROR*); +HRESULT WINAPI WsReadStartElement(WS_XML_READER*, WS_ERROR*); +HRESULT WINAPI WsReadToStartElement(WS_XML_READER*, const WS_XML_STRING*, const WS_XML_STRING*, + BOOL*, WS_ERROR*); +HRESULT WINAPI WsReadType(WS_XML_READER*, WS_TYPE_MAPPING, WS_TYPE, const void*, WS_READ_OPTION, + WS_HEAP*, void*, ULONG, WS_ERROR*); +HRESULT WINAPI WsSetErrorProperty(WS_ERROR*, WS_ERROR_PROPERTY_ID, const void*, ULONG); +HRESULT WINAPI WsSetInput(WS_XML_READER*, const WS_XML_READER_ENCODING*, const WS_XML_READER_INPUT*, + const WS_XML_READER_PROPERTY*, ULONG, WS_ERROR*); +HRESULT WINAPI WsSetInputToBuffer(WS_XML_READER*, WS_XML_BUFFER*, const WS_XML_READER_PROPERTY*, + ULONG, WS_ERROR*); +HRESULT WINAPI WsSetOutput(WS_XML_WRITER*, const WS_XML_WRITER_ENCODING*, const WS_XML_WRITER_OUTPUT*, + const WS_XML_WRITER_PROPERTY*, ULONG, WS_ERROR*); +HRESULT WINAPI WsSetOutputToBuffer(WS_XML_WRITER*, WS_XML_BUFFER*, const WS_XML_WRITER_PROPERTY*, + ULONG, WS_ERROR*); +HRESULT WINAPI WsWriteEndAttribute(WS_XML_WRITER*, WS_ERROR*); +HRESULT WINAPI WsWriteEndElement(WS_XML_WRITER*, WS_ERROR*); +HRESULT WINAPI WsWriteEndStartElement(WS_XML_WRITER*, WS_ERROR*); +HRESULT WINAPI WsWriteStartAttribute(WS_XML_WRITER*, const WS_XML_STRING*, const WS_XML_STRING*, + const WS_XML_STRING*, BOOL, WS_ERROR*); +HRESULT WINAPI WsWriteStartElement(WS_XML_WRITER*, const WS_XML_STRING*, const WS_XML_STRING*, + const WS_XML_STRING*, WS_ERROR*); +HRESULT WINAPI WsWriteText(WS_XML_WRITER*, const WS_XML_TEXT*, WS_ERROR*); +HRESULT WINAPI WsWriteType(WS_XML_WRITER*, WS_TYPE_MAPPING, WS_TYPE, const void*, WS_WRITE_OPTION, + const void*, ULONG, WS_ERROR*); +HRESULT WINAPI WsXmlStringEquals(const WS_XML_STRING*, const WS_XML_STRING*, WS_ERROR*); + +#define WS_S_ASYNC 0x003d0000 +#define WS_S_END 0x003d0001 +#define WS_E_INVALID_FORMAT 0x803d0000 +#define WS_E_OBJECT_FAULTED 0x803d0001 +#define WS_E_NUMERIC_OVERFLOW 0x803d0002 +#define WS_E_INVALID_OPERATION 0x803d0003 +#define WS_E_OPERATION_ABORTED 0x803d0004 +#define WS_E_ENDPOINT_ACCESS_DENIED 0x803d0005 +#define WS_E_OPERATION_TIMED_OUT 0x803d0006 +#define WS_E_OPERATION_ABANDONED 0x803d0007 +#define WS_E_QUOTA_EXCEEDED 0x803d0008 +#define WS_E_NO_TRANSLATION_AVAILABLE 0x803d0009 +#define WS_E_SECURITY_VERIFICATION_FAILURE 0x803d000a +#define WS_E_ADDRESS_IN_USE 0x803d000b +#define WS_E_ADDRESS_NOT_AVAILABLE 0x803d000c +#define WS_E_ENDPOINT_NOT_FOUND 0x803d000d +#define WS_E_ENDPOINT_NOT_AVAILABLE 0x803d000e +#define WS_E_ENDPOINT_FAILURE 0x803d000f +#define WS_E_ENDPOINT_UNREACHABLE 0x803d0010 +#define WS_E_ENDPOINT_ACTION_NOT_SUPPORTED 0x803d0011 +#define WS_E_ENDPOINT_TOO_BUSY 0x803d0012 +#define WS_E_ENDPOINT_FAULT_RECEIVED 0x803d0013 +#define WS_E_ENDPOINT_DISCONNECTED 0x803d0014 +#define WS_E_PROXY_FAILURE 0x803d0015 +#define WS_E_PROXY_ACCESS_DENIED 0x803d0016 +#define WS_E_NOT_SUPPORTED 0x803d0017 +#define WS_E_PROXY_REQUIRES_BASIC_AUTH 0x803d0018 +#define WS_E_PROXY_REQUIRES_DIGEST_AUTH 0x803d0019 +#define WS_E_PROXY_REQUIRES_NTLM_AUTH 0x803d001a +#define WS_E_PROXY_REQUIRES_NEGOTIATE_AUTH 0x803d001b +#define WS_E_SERVER_REQUIRES_BASIC_AUTH 0x803d001c +#define WS_E_SERVER_REQUIRES_DIGEST_AUTH 0x803d001d +#define WS_E_SERVER_REQUIRES_NTLM_AUTH 0x803d001e +#define WS_E_SERVER_REQUIRES_NEGOTIATE_AUTH 0x803d001f +#define WS_E_INVALID_ENDPOINT_URL 0x803d0020 +#define WS_E_OTHER 0x803d0021 +#define WS_E_SECURITY_TOKEN_EXPIRED 0x803d0022 +#define WS_E_SECURITY_SYSTEM_FAILURE 0x803d0023 #ifdef __cplusplus } diff -Nru wine1.7-1.7.50/include/wiadef.h wine1.7-1.7.55/include/wiadef.h --- wine1.7-1.7.50/include/wiadef.h 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/include/wiadef.h 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,22 @@ +/* + * WIA constants + * + * Copyright 2015 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 + */ + +#define WIA_DEVINFO_ENUM_ALL 0x0000000f +#define WIA_DEVINFO_ENUM_LOCAL 0x00000010 diff -Nru wine1.7-1.7.50/include/wia_lh.idl wine1.7-1.7.55/include/wia_lh.idl --- wine1.7-1.7.50/include/wia_lh.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/wia_lh.idl 2015-11-13 14:32:40.000000000 +0000 @@ -20,6 +20,8 @@ import "oaidl.idl"; import "propidl.idl"; +cpp_quote("#include ") + interface IEnumWIA_DEV_INFO; interface IWiaPropertyStorage; interface IWiaItem; diff -Nru wine1.7-1.7.50/include/wia_xp.idl wine1.7-1.7.55/include/wia_xp.idl --- wine1.7-1.7.50/include/wia_xp.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/wia_xp.idl 2015-11-13 14:32:40.000000000 +0000 @@ -20,6 +20,8 @@ import "oaidl.idl"; import "propidl.idl"; +cpp_quote("#include ") + interface IEnumWIA_DEV_INFO; interface IWiaPropertyStorage; interface IWiaItem; diff -Nru wine1.7-1.7.50/include/winbase.h wine1.7-1.7.55/include/winbase.h --- wine1.7-1.7.50/include/winbase.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/winbase.h 2015-11-13 14:32:40.000000000 +0000 @@ -1694,6 +1694,7 @@ #define CallNamedPipe WINELIB_NAME_AW(CallNamedPipe) WINBASEAPI BOOL WINAPI CancelIo(HANDLE); WINBASEAPI BOOL WINAPI CancelIoEx(HANDLE,LPOVERLAPPED); +WINBASEAPI BOOL WINAPI CancelSynchronousIo(HANDLE); WINBASEAPI BOOL WINAPI CancelTimerQueueTimer(HANDLE,HANDLE); WINBASEAPI BOOL WINAPI CancelWaitableTimer(HANDLE); WINBASEAPI BOOL WINAPI CheckNameLegalDOS8Dot3A(const char*,char*,DWORD,BOOL*,BOOL*); @@ -1771,6 +1772,7 @@ #define CreateNamedPipe WINELIB_NAME_AW(CreateNamedPipe) WINBASEAPI BOOL WINAPI CreatePipe(PHANDLE,PHANDLE,LPSECURITY_ATTRIBUTES,DWORD); WINADVAPI BOOL WINAPI CreatePrivateObjectSecurity(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,BOOL,HANDLE,PGENERIC_MAPPING); +WINADVAPI BOOL WINAPI CreatePrivateObjectSecurityWithMultipleInheritance(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR*,GUID**,ULONG,BOOL,ULONG,HANDLE,PGENERIC_MAPPING); WINBASEAPI PTP_POOL WINAPI CreateThreadpool(PVOID); WINBASEAPI PTP_WORK WINAPI CreateThreadpoolWork(PTP_WORK_CALLBACK,PVOID,PTP_CALLBACK_ENVIRON); WINBASEAPI BOOL WINAPI CreateProcessA(LPCSTR,LPSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,LPVOID,LPCSTR,LPSTARTUPINFOA,LPPROCESS_INFORMATION); @@ -1788,9 +1790,12 @@ WINBASEAPI HANDLE WINAPI CreateSemaphoreExA(SECURITY_ATTRIBUTES*,LONG,LONG,LPCSTR,DWORD,DWORD); WINBASEAPI HANDLE WINAPI CreateSemaphoreExW(SECURITY_ATTRIBUTES*,LONG,LONG,LPCWSTR,DWORD,DWORD); #define CreateSemaphoreEx WINELIB_NAME_AW(CreateSemaphoreEx) -WINBASEAPI BOOL WINAPI CreateSymbolicLinkA(LPCSTR,LPCSTR,DWORD); -WINBASEAPI BOOL WINAPI CreateSymbolicLinkW(LPCWSTR,LPCWSTR,DWORD); +WINBASEAPI BOOLEAN WINAPI CreateSymbolicLinkA(LPCSTR,LPCSTR,DWORD); +WINBASEAPI BOOLEAN WINAPI CreateSymbolicLinkW(LPCWSTR,LPCWSTR,DWORD); #define CreateSymbolicLink WINELIB_NAME_AW(CreateSymbolicLink) +WINBASEAPI BOOL WINAPI CreateHardLinkA(LPCSTR,LPCSTR,LPSECURITY_ATTRIBUTES); +WINBASEAPI BOOL WINAPI CreateHardLinkW(LPCWSTR,LPCWSTR,LPSECURITY_ATTRIBUTES); +#define CreateHardLink WINELIB_NAME_AW(CreateHardLink) WINBASEAPI DWORD WINAPI CreateTapePartition(HANDLE,DWORD,DWORD,DWORD); WINBASEAPI HANDLE WINAPI CreateThread(LPSECURITY_ATTRIBUTES,SIZE_T,LPTHREAD_START_ROUTINE,LPVOID,DWORD,LPDWORD); WINBASEAPI HANDLE WINAPI CreateTimerQueue(void); @@ -2537,8 +2542,8 @@ WINBASEAPI BOOL WINAPI TlsSetValue(DWORD,LPVOID); WINBASEAPI BOOL WINAPI TransactNamedPipe(HANDLE,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,LPOVERLAPPED); WINBASEAPI BOOL WINAPI TransmitCommChar(HANDLE,CHAR); -WINBASEAPI BOOL WINAPI TryAcquireSRWLockExclusive(PSRWLOCK); -WINBASEAPI BOOL WINAPI TryAcquireSRWLockShared(PSRWLOCK); +WINBASEAPI BOOLEAN WINAPI TryAcquireSRWLockExclusive(PSRWLOCK); +WINBASEAPI BOOLEAN WINAPI TryAcquireSRWLockShared(PSRWLOCK); WINBASEAPI BOOL WINAPI TryEnterCriticalSection(CRITICAL_SECTION *lpCrit); WINBASEAPI BOOL WINAPI TzSpecificLocalTimeToSystemTime(const TIME_ZONE_INFORMATION*,const SYSTEMTIME*,LPSYSTEMTIME); WINBASEAPI LONG WINAPI UnhandledExceptionFilter(PEXCEPTION_POINTERS); diff -Nru wine1.7-1.7.50/include/windns.h wine1.7-1.7.55/include/windns.h --- wine1.7-1.7.50/include/windns.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/windns.h 2015-11-13 14:32:40.000000000 +0000 @@ -96,8 +96,16 @@ #define DNS_QUERY_NO_NETBT 0x00000080 #define DNS_QUERY_WIRE_ONLY 0x00000100 #define DNS_QUERY_RETURN_MESSAGE 0x00000200 +#define DNS_QUERY_MULTICAST_ONLY 0x00000400 +#define DNS_QUERY_NO_MULTICAST 0x00000800 #define DNS_QUERY_TREAT_AS_FQDN 0x00001000 +#define DNS_QUERY_ADDRCONFIG 0x00002000 +#define DNS_QUERY_DUAL_ADDR 0x00004000 #define DNS_QUERY_DONT_RESET_TTL_VALUES 0x00100000 +#define DNS_QUERY_DISABLE_IDN_ENCODING 0x00200000 +#define DNS_QUERY_APPEND_MULTILABEL 0x00800000 +#define DNS_QUERY_DNSSEC_OK 0x01000000 +#define DNS_QUERY_DNSSEC_CHECKING_DISABLED 0x02000000 #define DNS_QUERY_RESERVED 0xff000000 typedef enum _DNS_NAME_FORMAT @@ -618,6 +626,67 @@ _prrset->pLastRR->pNext = NULL; \ } +#define DNS_ADDR_MAX_SOCKADDR_LENGTH 32 + +#include + +typedef struct _DnsAddr +{ + char MaxSa[DNS_ADDR_MAX_SOCKADDR_LENGTH]; + union { + DWORD DnsAddrUserDword[8]; + } Data; +} DNS_ADDR, *PDNS_ADDR; + +typedef struct _DnsAddrArray +{ + DWORD MaxCount; + DWORD AddrCount; + DWORD Tag; + WORD Family; + WORD WordReserved; + DWORD Flags; + DWORD MatchFlag; + DWORD Reserved1; + DWORD Reserved2; + DNS_ADDR AddrArray[1]; +} DNS_ADDR_ARRAY, *PDNS_ADDR_ARRAY; + +#include + +#define DNS_QUERY_RESULTS_VERSION1 0x1 + +typedef struct _DNS_QUERY_RESULT +{ + ULONG Version; + DNS_STATUS QueryStatus; + ULONG64 QueryOptions; + DNS_RECORD *pQueryRecords; + void *Reserved; +} DNS_QUERY_RESULT, *PDNS_QUERY_RESULT; + +typedef void WINAPI DNS_QUERY_COMPLETION_ROUTINE(void*,DNS_QUERY_RESULT*); +typedef DNS_QUERY_COMPLETION_ROUTINE *PDNS_QUERY_COMPLETION_ROUTINE; + +#define DNS_QUERY_REQUEST_VERSION1 0x1 + +typedef struct _DNS_QUERY_REQUEST +{ + ULONG Version; + const WCHAR *QueryName; + WORD QueryType; + ULONG64 QueryOptions; + PDNS_ADDR_ARRAY pDnsServerList; + ULONG InterfaceIndex; + PDNS_QUERY_COMPLETION_ROUTINE pQueryCompletionCallback; + void *pQueryContext; +} DNS_QUERY_REQUEST, *PDNS_QUERY_REQUEST; + +typedef struct _DNS_QUERY_CANCEL +{ + char Reserved[32]; +} DNS_QUERY_CANCEL, *PDNS_QUERY_CANCEL; + DNS_STATUS WINAPI DnsAcquireContextHandle_A(DWORD,PVOID,PHANDLE); DNS_STATUS WINAPI DnsAcquireContextHandle_W(DWORD,PVOID,PHANDLE); #define DnsAcquireContextHandle WINELIB_NAME_AW(DnsAcquireContextHandle_) @@ -635,6 +704,8 @@ DNS_STATUS WINAPI DnsQuery_W(PCWSTR,WORD,DWORD,PVOID,PDNS_RECORDW*,PVOID*); DNS_STATUS WINAPI DnsQuery_UTF8(PCSTR,WORD,DWORD,PVOID,PDNS_RECORDA*,PVOID*); #define DnsQuery WINELIB_NAME_AW(DnsQuery_) +DNS_STATUS WINAPI DnsQueryEx(DNS_QUERY_REQUEST*,DNS_QUERY_RESULT*,DNS_QUERY_CANCEL*); +DNS_STATUS WINAPI DnsCancelQuery(DNS_QUERY_CANCEL*); DNS_STATUS WINAPI DnsQueryConfig(DNS_CONFIG_TYPE,DWORD,PCWSTR,PVOID,PVOID,PDWORD); BOOL WINAPI DnsRecordCompare(PDNS_RECORD,PDNS_RECORD); PDNS_RECORD WINAPI DnsRecordCopyEx(PDNS_RECORD,DNS_CHARSET,DNS_CHARSET); diff -Nru wine1.7-1.7.50/include/wine/debug.h wine1.7-1.7.55/include/wine/debug.h --- wine1.7-1.7.50/include/wine/debug.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/wine/debug.h 2015-11-13 14:32:40.000000000 +0000 @@ -244,7 +244,7 @@ "|VT_ARRAY", "|VT_VECTOR|VT_ARRAY", "|VT_BYREF", - "|VT_VECTOR|VT_ARRAY", + "|VT_VECTOR|VT_BYREF", "|VT_ARRAY|VT_BYREF", "|VT_VECTOR|VT_ARRAY|VT_BYREF", "|VT_RESERVED", @@ -252,7 +252,7 @@ "|VT_ARRAY|VT_RESERVED", "|VT_VECTOR|VT_ARRAY|VT_RESERVED", "|VT_BYREF|VT_RESERVED", - "|VT_VECTOR|VT_ARRAY|VT_RESERVED", + "|VT_VECTOR|VT_BYREF|VT_RESERVED", "|VT_ARRAY|VT_BYREF|VT_RESERVED", "|VT_VECTOR|VT_ARRAY|VT_BYREF|VT_RESERVED", }; @@ -331,7 +331,7 @@ case VT_VOID: return wine_dbg_sprintf( "%p {VT_VOID}", v ); case VT_RECORD: - return wine_dbg_sprintf( "%p {VT_RECORD: %p %p}", v, V_UNION(v,brecVal).pvRecord, V_UNION(v,brecVal).pRecInfo ); + return wine_dbg_sprintf( "%p {VT_RECORD: %p %p}", v, V_RECORD(v), V_RECORDINFO(v) ); default: return wine_dbg_sprintf( "%p {vt %s}", v, wine_dbgstr_vt(V_VT(v)) ); } diff -Nru wine1.7-1.7.50/include/wine/gdi_driver.h wine1.7-1.7.55/include/wine/gdi_driver.h --- wine1.7-1.7.50/include/wine/gdi_driver.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/wine/gdi_driver.h 2015-11-13 14:32:40.000000000 +0000 @@ -97,7 +97,6 @@ BOOL (*pFontIsLinked)(PHYSDEV); BOOL (*pFrameRgn)(PHYSDEV,HRGN,HBRUSH,INT,INT); BOOL (*pGdiComment)(PHYSDEV,UINT,const BYTE*); - BOOL (*pGdiRealizationInfo)(PHYSDEV,void*); UINT (*pGetBoundsRect)(PHYSDEV,RECT*,UINT); BOOL (*pGetCharABCWidths)(PHYSDEV,UINT,UINT,LPABC); BOOL (*pGetCharABCWidthsI)(PHYSDEV,UINT,UINT,WORD*,LPABC); @@ -105,6 +104,7 @@ INT (*pGetDeviceCaps)(PHYSDEV,INT); BOOL (*pGetDeviceGammaRamp)(PHYSDEV,LPVOID); DWORD (*pGetFontData)(PHYSDEV,DWORD,DWORD,LPVOID,DWORD); + BOOL (*pGetFontRealizationInfo)(PHYSDEV,void*); DWORD (*pGetFontUnicodeRanges)(PHYSDEV,LPGLYPHSET); DWORD (*pGetGlyphIndices)(PHYSDEV,LPCWSTR,INT,LPWORD,DWORD); DWORD (*pGetGlyphOutline)(PHYSDEV,UINT,UINT,LPGLYPHMETRICS,DWORD,LPVOID,const MAT2*); @@ -197,7 +197,7 @@ }; /* increment this when you change the DC function table */ -#define WINE_GDI_DRIVER_VERSION 46 +#define WINE_GDI_DRIVER_VERSION 47 #define GDI_PRIORITY_NULL_DRV 0 /* null driver */ #define GDI_PRIORITY_FONT_DRV 100 /* any font driver */ diff -Nru wine1.7-1.7.50/include/wine/mscvpdb.h wine1.7-1.7.55/include/wine/mscvpdb.h --- wine1.7-1.7.50/include/wine/mscvpdb.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/wine/mscvpdb.h 2015-11-13 14:32:40.000000000 +0000 @@ -1677,10 +1677,13 @@ #define S_COMPILAND_V3 0x1101 #define S_THUNK_V3 0x1102 #define S_BLOCK_V3 0x1103 +#define S_WITH_V3 0x1104 #define S_LABEL_V3 0x1105 #define S_REGISTER_V3 0x1106 #define S_CONSTANT_V3 0x1107 #define S_UDT_V3 0x1108 +#define S_COBOLUDT_V3 0x1109 +#define S_MANYREG_V3 0x110A #define S_BPREL_V3 0x110B #define S_LDATA_V3 0x110C #define S_GDATA_V3 0x110D @@ -1690,16 +1693,86 @@ #define S_REGREL_V3 0x1111 #define S_LTHREAD_V3 0x1112 #define S_GTHREAD_V3 0x1113 +#define S_LPROCMIPS 0x1114 +#define S_GPROCMIPS 0x1115 #define S_MSTOOL_V3 0x1116 /* compiler command line options and build information */ +#define S_MANYREG2 0x1117 +#define S_LPROCIA64 0x1118 +#define S_GPROCIA64 0x1119 +#define S_LOCALSLOT 0x111A +#define S_PARAMSLOT 0x111B +#define S_LMANDATA 0x111C +#define S_GMANDATA 0x111D +#define S_MANFRAMEREL 0x111E +#define S_MANREGISTER 0x111F +#define S_MANSLOT 0x1120 +#define S_MANMANYREG 0x1121 +#define S_MANREGREL 0x1122 +#define S_MANMANYREG2 0x1123 +#define S_UNAMESPACE 0x1124 #define S_PUB_FUNC1_V3 0x1125 /* didn't get the difference between the two */ +#define S_DATAREF_V3 0x1126 #define S_PUB_FUNC2_V3 0x1127 +#define S_ANNOTATIONREF 0x1128 +#define S_TOKENREF 0x1129 +#define S_GMANPROC 0x112A +#define S_LMANPROC 0x112B +#define S_TRAMPOLINE 0x112C +#define S_MANCONSTANT 0x112D +#define S_ATTR_FRAMEREL 0x112E +#define S_ATTR_REGISTER 0x112F +#define S_ATTR_REGREL 0x1130 +#define S_ATTR_MANYREG 0x1131 +#define S_SEPCODE 0x1132 +#define S_LOCAL_2005 0x1133 +#define S_DEFRANGE_2005 0x1134 +#define S_DEFRANGE2_2005 0x1135 #define S_SECTINFO_V3 0x1136 #define S_SUBSECTINFO_V3 0x1137 #define S_ENTRYPOINT_V3 0x1138 +#define S_CALLSITEINFO 0x1139 #define S_SECUCOOKIE_V3 0x113A +#define S_DISCARDED 0x113B #define S_MSTOOLINFO_V3 0x113C #define S_MSTOOLENV_V3 0x113D +#define S_LOCAL_VS2013 0x113E +#define S_DEFRANGE_VS2013 0x113F +#define S_DEFRANGE_SUBFIELD 0x1140 +#define S_DEFRANGE_REGISTER 0x1141 +#define S_DEFRANGE_FRAMEPOINTER_REL 0x1142 +#define S_DEFRANGE_SUBFIELD_REGISTER 0x1143 +#define S_FPOFF_VS2013 0x1144 +#define S_DEFRANGE_REGISTER_REL 0x1145 +#define S_LPROC32_VS2013 0x1146 +#define S_GPROC32_VS2013 0x1147 +#define S_LPROCMIPS_ID 0x1148 +#define S_GPROCMIPS_ID 0x1149 +#define S_LPROCIA64_ID 0x114A +#define S_GPROCIA64_ID 0x114B +#define S_BUILDINFO 0x114C +#define S_INLINESITE 0x114D +#define S_INLINESITE_END 0x114E +#define S_PROC_ID_END 0x114F +#define S_DEFRANGE_HLSL 0x1150 +#define S_GDATA_HLSL 0x1151 +#define S_LDATA_HLSL 0x1152 + +#define S_FILESTATIC 0x1153 +#define S_ARMSWITCHTABLE 0x1159 +#define S_CALLEES 0x115A +#define S_CALLERS 0x115B +#define S_POGODATA 0x115C +#define S_INLINESITE2 0x115D +#define S_HEAPALLOCSITE 0x115E +#define S_MOD_TYPEREF 0x115F +#define S_REF_MINIPDB 0x1160 +#define S_PDBMAP 0x1161 +#define S_GDATA_HLSL32 0x1162 +#define S_LDATA_HLSL32 0x1163 +#define S_GDATA_HLSL32_EX 0x1164 +#define S_LDATA_HLSL32_EX 0x1165 + /* ======================================== * * Line number information * ======================================== */ diff -Nru wine1.7-1.7.50/include/wine/server_protocol.h wine1.7-1.7.55/include/wine/server_protocol.h --- wine1.7-1.7.50/include/wine/server_protocol.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/wine/server_protocol.h 2015-11-13 14:32:40.000000000 +0000 @@ -1896,7 +1896,9 @@ short int win_bottom; short int max_width; short int max_height; - char __pad_46[2]; + short int font_width; + short int font_height; + char __pad_50[6]; }; struct set_console_output_info_reply { @@ -1908,6 +1910,7 @@ #define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20 +#define SET_CONSOLE_OUTPUT_INFO_FONT 0x40 @@ -1932,7 +1935,9 @@ short int win_bottom; short int max_width; short int max_height; - char __pad_34[6]; + short int font_width; + short int font_height; + char __pad_38[2]; }; @@ -3228,13 +3233,11 @@ struct set_irp_result_request { struct request_header __header; - obj_handle_t manager; obj_handle_t handle; unsigned int status; - client_ptr_t file_ptr; data_size_t size; + client_ptr_t file_ptr; /* VARARG(data,bytes); */ - char __pad_36[4]; }; struct set_irp_result_reply { @@ -6149,6 +6152,6 @@ struct terminate_job_reply terminate_job_reply; }; -#define SERVER_PROTOCOL_VERSION 487 +#define SERVER_PROTOCOL_VERSION 489 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff -Nru wine1.7-1.7.50/include/wine/wined3d.h wine1.7-1.7.55/include/wine/wined3d.h --- wine1.7-1.7.50/include/wine/wined3d.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/wine/wined3d.h 2015-11-13 14:32:40.000000000 +0000 @@ -503,13 +503,6 @@ WINED3D_PATCH_EDGE_CONTINUOUS = 1, }; -enum wined3d_backbuffer_type -{ - WINED3D_BACKBUFFER_TYPE_MONO = 0, - WINED3D_BACKBUFFER_TYPE_LEFT = 1, - WINED3D_BACKBUFFER_TYPE_RIGHT = 2, -}; - enum wined3d_swap_effect { WINED3D_SWAP_EFFECT_DISCARD = 1, @@ -724,9 +717,9 @@ BOOL disjoint; }; -#define WINED3DISSUE_BEGIN (1 << 1) -#define WINED3DISSUE_END (1 << 0) -#define WINED3DGETDATA_FLUSH (1 << 0) +#define WINED3DISSUE_BEGIN (1u << 1) +#define WINED3DISSUE_END (1u << 0) +#define WINED3DGETDATA_FLUSH (1u << 0) enum wined3d_stateblock_type { @@ -797,14 +790,13 @@ WINED3D_DISPLAY_ROTATION_270 = 4, }; -#define WINED3DCOLORWRITEENABLE_RED (1 << 0) -#define WINED3DCOLORWRITEENABLE_GREEN (1 << 1) -#define WINED3DCOLORWRITEENABLE_BLUE (1 << 2) -#define WINED3DCOLORWRITEENABLE_ALPHA (1 << 3) +#define WINED3DCOLORWRITEENABLE_RED (1u << 0) +#define WINED3DCOLORWRITEENABLE_GREEN (1u << 1) +#define WINED3DCOLORWRITEENABLE_BLUE (1u << 2) +#define WINED3DCOLORWRITEENABLE_ALPHA (1u << 3) #define WINED3DADAPTER_DEFAULT 0 #define WINED3DENUM_NO_WHQL_LEVEL 2 -#define WINED3DPRESENT_BACK_BUFFER_MAX 3 #define WINED3DTSS_TCI_PASSTHRU 0x00000 #define WINED3DTSS_TCI_CAMERASPACENORMAL 0x10000 @@ -875,12 +867,12 @@ #define WINED3DPRESENT_INTERVAL_IMMEDIATE 0x80000000 #define WINED3DMAXUSERCLIPPLANES 32 -#define WINED3DCLIPPLANE0 (1 << 0) -#define WINED3DCLIPPLANE1 (1 << 1) -#define WINED3DCLIPPLANE2 (1 << 2) -#define WINED3DCLIPPLANE3 (1 << 3) -#define WINED3DCLIPPLANE4 (1 << 4) -#define WINED3DCLIPPLANE5 (1 << 5) +#define WINED3DCLIPPLANE0 (1u << 0) +#define WINED3DCLIPPLANE1 (1u << 1) +#define WINED3DCLIPPLANE2 (1u << 2) +#define WINED3DCLIPPLANE3 (1u << 3) +#define WINED3DCLIPPLANE4 (1u << 4) +#define WINED3DCLIPPLANE5 (1u << 5) /* FVF (Flexible Vertex Format) codes */ #define WINED3DFVF_RESERVED0 0x0001 @@ -912,10 +904,10 @@ #define WINED3DFVF_LASTBETA_D3DCOLOR 0x8000 #define WINED3DFVF_RESERVED2 0x6000 -#define WINED3DFVF_TEXTUREFORMAT1 3 -#define WINED3DFVF_TEXTUREFORMAT2 0 -#define WINED3DFVF_TEXTUREFORMAT3 1 -#define WINED3DFVF_TEXTUREFORMAT4 2 +#define WINED3DFVF_TEXTUREFORMAT1 3u +#define WINED3DFVF_TEXTUREFORMAT2 0u +#define WINED3DFVF_TEXTUREFORMAT3 1u +#define WINED3DFVF_TEXTUREFORMAT4 2u #define WINED3DFVF_TEXCOORDSIZE1(idx) (WINED3DFVF_TEXTUREFORMAT1 << (idx * 2 + 16)) #define WINED3DFVF_TEXCOORDSIZE2(idx) (WINED3DFVF_TEXTUREFORMAT2 << (idx * 2 + 16)) #define WINED3DFVF_TEXCOORDSIZE3(idx) (WINED3DFVF_TEXTUREFORMAT3 << (idx * 2 + 16)) @@ -927,8 +919,8 @@ #define WINED3DCLEAR_STENCIL 0x00000004 /* Stream source flags */ -#define WINED3DSTREAMSOURCE_INDEXEDDATA (1 << 30) -#define WINED3DSTREAMSOURCE_INSTANCEDATA (2 << 30) +#define WINED3DSTREAMSOURCE_INDEXEDDATA (1u << 30) +#define WINED3DSTREAMSOURCE_INSTANCEDATA (2u << 30) /* SetPrivateData flags */ #define WINED3DSPD_IUNKNOWN 0x00000001 @@ -1252,7 +1244,6 @@ #define WINED3D_RESZ_CODE 0x7fa05000 -#define WINED3D_CKEY_COLORSPACE 0x00000001 #define WINED3D_CKEY_DST_BLT 0x00000002 #define WINED3D_CKEY_DST_OVERLAY 0x00000004 #define WINED3D_CKEY_SRC_BLT 0x00000008 @@ -2027,7 +2018,6 @@ struct wined3d_swapchain; struct wined3d_texture; struct wined3d_vertex_declaration; -struct wined3d_volume; struct wined3d_device_parent { @@ -2039,12 +2029,14 @@ void (__cdecl *wined3d_device_created)(struct wined3d_device_parent *device_parent, struct wined3d_device *device); void (__cdecl *mode_changed)(struct wined3d_device_parent *device_parent); void (__cdecl *activate)(struct wined3d_device_parent *device_parent, BOOL activate); - HRESULT (__cdecl *surface_created)(struct wined3d_device_parent *device_parent, void *container_parent, + HRESULT (__cdecl *surface_created)(struct wined3d_device_parent *device_parent, + struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_surface *surface, void **parent, const struct wined3d_parent_ops **parent_ops); - HRESULT (__cdecl *volume_created)(struct wined3d_device_parent *device_parent, void *container_parent, - struct wined3d_volume *volume, void **parent, const struct wined3d_parent_ops **parent_ops); - HRESULT (__cdecl *create_swapchain_surface)(struct wined3d_device_parent *device_parent, void *container_parent, - const struct wined3d_resource_desc *desc, struct wined3d_surface **surface); + HRESULT (__cdecl *volume_created)(struct wined3d_device_parent *device_parent, + struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, + void **parent, const struct wined3d_parent_ops **parent_ops); + HRESULT (__cdecl *create_swapchain_texture)(struct wined3d_device_parent *device_parent, void *parent, + const struct wined3d_resource_desc *desc, struct wined3d_texture **texture); HRESULT (__cdecl *create_swapchain)(struct wined3d_device_parent *device_parent, struct wined3d_swapchain_desc *desc, struct wined3d_swapchain **swapchain); }; @@ -2138,7 +2130,7 @@ struct wined3d_rendertarget_view *view, const RECT *rect, const struct wined3d_color *color); void __cdecl wined3d_device_copy_resource(struct wined3d_device *device, struct wined3d_resource *dst_resource, struct wined3d_resource *src_resource); -void __cdecl wined3d_device_copy_sub_resource_region(struct wined3d_device *device, +HRESULT __cdecl wined3d_device_copy_sub_resource_region(struct wined3d_device *device, struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, unsigned int dst_x, 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); @@ -2156,8 +2148,6 @@ HRESULT __cdecl wined3d_device_end_stateblock(struct wined3d_device *device, struct wined3d_stateblock **stateblock); void __cdecl wined3d_device_evict_managed_resources(struct wined3d_device *device); UINT __cdecl wined3d_device_get_available_texture_mem(const struct wined3d_device *device); -HRESULT __cdecl wined3d_device_get_back_buffer(const struct wined3d_device *device, UINT swapchain_idx, - UINT backbuffer_idx, enum wined3d_backbuffer_type backbuffer_type, struct wined3d_surface **backbuffer); INT __cdecl wined3d_device_get_base_vertex_index(const struct wined3d_device *device); HRESULT __cdecl wined3d_device_get_clip_plane(const struct wined3d_device *device, UINT plane_idx, struct wined3d_vec4 *plane); @@ -2169,8 +2159,6 @@ HRESULT __cdecl wined3d_device_get_device_caps(const struct wined3d_device *device, WINED3DCAPS *caps); HRESULT __cdecl wined3d_device_get_display_mode(const struct wined3d_device *device, UINT swapchain_idx, struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation); -HRESULT __cdecl wined3d_device_get_front_buffer_data(const struct wined3d_device *device, - UINT swapchain_idx, struct wined3d_surface *dst_surface); void __cdecl wined3d_device_get_gamma_ramp(const struct wined3d_device *device, UINT swapchain_idx, struct wined3d_gamma_ramp *ramp); struct wined3d_shader * __cdecl wined3d_device_get_geometry_shader(const struct wined3d_device *device); @@ -2241,8 +2229,6 @@ HRESULT __cdecl wined3d_device_init_gdi(struct wined3d_device *device, struct wined3d_swapchain_desc *swapchain_desc); void __cdecl wined3d_device_multiply_transform(struct wined3d_device *device, enum wined3d_transform_state state, const struct wined3d_matrix *matrix); -HRESULT __cdecl wined3d_device_present(const struct wined3d_device *device, const RECT *src_rect, - const RECT *dst_rect, HWND dst_window_override, const RGNDATA *dirty_region, DWORD flags); HRESULT __cdecl wined3d_device_process_vertices(struct wined3d_device *device, UINT src_start_idx, UINT dst_idx, UINT vertex_count, struct wined3d_buffer *dst_buffer, const struct wined3d_vertex_declaration *declaration, DWORD flags, DWORD dst_fvf); @@ -2259,7 +2245,7 @@ void __cdecl wined3d_device_set_cursor_position(struct wined3d_device *device, int x_screen_space, int y_screen_space, DWORD flags); HRESULT __cdecl wined3d_device_set_cursor_properties(struct wined3d_device *device, - UINT x_hotspot, UINT y_hotspot, struct wined3d_surface *cursor_surface); + UINT x_hotspot, UINT y_hotspot, struct wined3d_texture *texture, unsigned int sub_resource_idx); void __cdecl wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view); HRESULT __cdecl wined3d_device_set_dialog_box_mode(struct wined3d_device *device, BOOL enable_dialogs); @@ -2436,14 +2422,20 @@ struct wined3d_resource_desc *desc); void * __cdecl wined3d_resource_get_parent(const struct wined3d_resource *resource); DWORD __cdecl wined3d_resource_get_priority(const struct wined3d_resource *resource); +HRESULT __cdecl wined3d_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, + struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags); void __cdecl wined3d_resource_set_parent(struct wined3d_resource *resource, void *parent); DWORD __cdecl wined3d_resource_set_priority(struct wined3d_resource *resource, DWORD priority); +HRESULT __cdecl wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx); HRESULT __cdecl wined3d_rendertarget_view_create(const struct wined3d_rendertarget_view_desc *desc, struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_rendertarget_view **view); HRESULT __cdecl wined3d_rendertarget_view_create_from_surface(struct wined3d_surface *surface, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_rendertarget_view **view); +HRESULT __cdecl wined3d_rendertarget_view_create_from_sub_resource(struct wined3d_texture *texture, + unsigned int sub_resource_idx, void *parent, const struct wined3d_parent_ops *parent_ops, + struct wined3d_rendertarget_view **view); ULONG __cdecl wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *view); void * __cdecl wined3d_rendertarget_view_get_parent(const struct wined3d_rendertarget_view *view); struct wined3d_resource * __cdecl wined3d_rendertarget_view_get_resource(const struct wined3d_rendertarget_view *view); @@ -2489,19 +2481,15 @@ const WINEDDBLTFX *blt_fx, enum wined3d_texture_filter_type filter); ULONG __cdecl wined3d_surface_decref(struct wined3d_surface *surface); struct wined3d_surface * __cdecl wined3d_surface_from_resource(struct wined3d_resource *resource); -HRESULT __cdecl wined3d_surface_get_blt_status(const struct wined3d_surface *surface, DWORD flags); -HRESULT __cdecl wined3d_surface_get_flip_status(const struct wined3d_surface *surface, DWORD flags); HRESULT __cdecl wined3d_surface_get_overlay_position(const struct wined3d_surface *surface, LONG *x, LONG *y); void * __cdecl wined3d_surface_get_parent(const struct wined3d_surface *surface); DWORD __cdecl wined3d_surface_get_pitch(const struct wined3d_surface *surface); -HRESULT __cdecl wined3d_surface_get_render_target_data(struct wined3d_surface *surface, - struct wined3d_surface *render_target); struct wined3d_resource * __cdecl wined3d_surface_get_resource(struct wined3d_surface *surface); HRESULT __cdecl wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc); ULONG __cdecl wined3d_surface_incref(struct wined3d_surface *surface); HRESULT __cdecl wined3d_surface_is_lost(const struct wined3d_surface *surface); HRESULT __cdecl wined3d_surface_map(struct wined3d_surface *surface, - struct wined3d_map_desc *map_desc, const RECT *rect, DWORD flags); + struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags); void __cdecl wined3d_surface_preload(struct wined3d_surface *surface); HRESULT __cdecl wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc); HRESULT __cdecl wined3d_surface_restore(struct wined3d_surface *surface); @@ -2515,13 +2503,13 @@ HRESULT __cdecl wined3d_swapchain_create(struct wined3d_device *device, struct wined3d_swapchain_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_swapchain **swapchain); ULONG __cdecl wined3d_swapchain_decref(struct wined3d_swapchain *swapchain); -struct wined3d_surface * __cdecl wined3d_swapchain_get_back_buffer(const struct wined3d_swapchain *swapchain, - UINT backbuffer_idx, enum wined3d_backbuffer_type backbuffer_type); +struct wined3d_texture * __cdecl wined3d_swapchain_get_back_buffer(const struct wined3d_swapchain *swapchain, + UINT backbuffer_idx); struct wined3d_device * __cdecl wined3d_swapchain_get_device(const struct wined3d_swapchain *swapchain); HRESULT __cdecl wined3d_swapchain_get_display_mode(const struct wined3d_swapchain *swapchain, struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation); HRESULT __cdecl wined3d_swapchain_get_front_buffer_data(const struct wined3d_swapchain *swapchain, - struct wined3d_surface *dst_surface); + struct wined3d_texture *dst_texture, unsigned int sub_resource_idx); HRESULT __cdecl wined3d_swapchain_get_gamma_ramp(const struct wined3d_swapchain *swapchain, struct wined3d_gamma_ramp *ramp); void * __cdecl wined3d_swapchain_get_parent(const struct wined3d_swapchain *swapchain); @@ -2543,12 +2531,16 @@ HRESULT __cdecl wined3d_texture_add_dirty_region(struct wined3d_texture *texture, UINT layer, const struct wined3d_box *dirty_region); +HRESULT __cdecl wined3d_texture_blt(struct wined3d_texture *dst_texture, unsigned int dst_idx, const RECT *dst_rect_in, + struct wined3d_texture *src_texture, unsigned int src_idx, const RECT *src_rect_in, DWORD flags, + const WINEDDBLTFX *fx, enum wined3d_texture_filter_type filter); HRESULT __cdecl wined3d_texture_create(struct wined3d_device *device, const struct wined3d_resource_desc *desc, UINT level_count, DWORD surface_flags, const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture); ULONG __cdecl wined3d_texture_decref(struct wined3d_texture *texture); void __cdecl wined3d_texture_generate_mipmaps(struct wined3d_texture *texture); enum wined3d_texture_filter_type __cdecl wined3d_texture_get_autogen_filter_type(const struct wined3d_texture *texture); +HRESULT __cdecl wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC *dc); DWORD __cdecl wined3d_texture_get_level_count(const struct wined3d_texture *texture); DWORD __cdecl wined3d_texture_get_lod(const struct wined3d_texture *texture); void * __cdecl wined3d_texture_get_parent(const struct wined3d_texture *texture); @@ -2562,6 +2554,7 @@ HRESULT __cdecl wined3d_texture_set_color_key(struct wined3d_texture *texture, DWORD flags, const struct wined3d_color_key *color_key); DWORD __cdecl wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod); +HRESULT __cdecl wined3d_texture_release_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC dc); HRESULT __cdecl wined3d_texture_update_desc(struct wined3d_texture *texture, UINT width, UINT height, enum wined3d_format_id format_id, enum wined3d_multisample_type multisample_type, UINT multisample_quality, @@ -2577,16 +2570,6 @@ void * __cdecl wined3d_vertex_declaration_get_parent(const struct wined3d_vertex_declaration *declaration); ULONG __cdecl wined3d_vertex_declaration_incref(struct wined3d_vertex_declaration *declaration); -ULONG __cdecl wined3d_volume_decref(struct wined3d_volume *volume); -struct wined3d_volume * __cdecl wined3d_volume_from_resource(struct wined3d_resource *resource); -void * __cdecl wined3d_volume_get_parent(const struct wined3d_volume *volume); -struct wined3d_resource * __cdecl wined3d_volume_get_resource(struct wined3d_volume *volume); -ULONG __cdecl wined3d_volume_incref(struct wined3d_volume *volume); -HRESULT __cdecl wined3d_volume_map(struct wined3d_volume *volume, - struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags); -void __cdecl wined3d_volume_preload(struct wined3d_volume *volume); -HRESULT __cdecl wined3d_volume_unmap(struct wined3d_volume *volume); - /* Return the integer base-2 logarithm of x. Undefined for x == 0. */ static inline unsigned int wined3d_log2i(unsigned int x) { diff -Nru wine1.7-1.7.50/include/wine/winedxgi.idl wine1.7-1.7.55/include/wine/winedxgi.idl --- wine1.7-1.7.50/include/wine/winedxgi.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/wine/winedxgi.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep header + import "dxgi.idl"; [ @@ -23,7 +25,7 @@ local, uuid(3e1ff30b-c951-48c3-b010-0fb49f3dca71) ] -interface IWineDXGIDevice : IDXGIDevice +interface IWineDXGIDevice : IDXGIDevice1 { HRESULT create_surface( [in] struct wined3d_resource *wined3d_resource, diff -Nru wine1.7-1.7.50/include/winerror.h wine1.7-1.7.55/include/winerror.h --- wine1.7-1.7.50/include/winerror.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/winerror.h 2015-11-13 14:32:40.000000000 +0000 @@ -59,6 +59,7 @@ #define FACILITY_PLA 48 #define FACILITY_FVE 49 #define FACILITY_WINDOWS_DEFENDER 80 +#define FACILITY_DIRECT3D11 0x87c #define SEVERITY_SUCCESS 0 #define SEVERITY_ERROR 1 @@ -1778,6 +1779,7 @@ #define DNS_ERROR_NO_PACKET 9503 #define DNS_ERROR_RCODE 9504 #define DNS_ERROR_UNSECURE_PACKET 9505 +#define DNS_REQUEST_PENDING 9506 #define DNS_ERROR_INVALID_TYPE 9551 #define DNS_ERROR_INVALID_IP_ADDRESS 9552 #define DNS_ERROR_INVALID_PROPERTY 9553 @@ -2077,6 +2079,7 @@ #undef NOERROR /* arpa/nameser_compat.h defines this */ #define E_NOT_SUFFICIENT_BUFFER HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) +#define E_NOT_VALID_STATE HRESULT_FROM_WIN32(ERROR_INVALID_STATE) #ifdef RC_INVOKED #define _HRESULT_TYPEDEF_(x) (x) @@ -2090,6 +2093,7 @@ #define S_FALSE _HRESULT_TYPEDEF_(1) #define E_PENDING _HRESULT_TYPEDEF_(0x8000000A) +#define E_BOUNDS _HRESULT_TYPEDEF_(0x8000000B) #define E_NOTIMPL _HRESULT_TYPEDEF_(0x80004001) diff -Nru wine1.7-1.7.50/include/wingdi.h wine1.7-1.7.55/include/wingdi.h --- wine1.7-1.7.50/include/wingdi.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/wingdi.h 2015-11-13 14:32:40.000000000 +0000 @@ -3306,6 +3306,11 @@ #define DISPLAY_DEVICE_MIRRORING_DRIVER 0x00000008 #define DISPLAY_DEVICE_VGA_COMPATIBLE 0x00000010 +/* For GetDisplayConfigBufferSizes */ +#define QDC_ALL_PATHS 0x00000001 +#define QDC_ONLY_ACTIVE_PATHS 0x00000002 +#define QDC_DATABASE_CURRENT 0x00000004 + #define GDI_ERROR (~0u) #define HGDI_ERROR ((HANDLE)~(ULONG_PTR)0) diff -Nru wine1.7-1.7.50/include/winnls.h wine1.7-1.7.55/include/winnls.h --- wine1.7-1.7.50/include/winnls.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/winnls.h 2015-11-13 14:32:40.000000000 +0000 @@ -734,6 +734,8 @@ /* Define a bunch of callback types */ typedef BOOL (CALLBACK *CALINFO_ENUMPROCEXEX)(LPWSTR,CALID,LPWSTR,LPARAM); +typedef BOOL (CALLBACK *DATEFMT_ENUMPROCEXEX)(LPWSTR,CALID,LPARAM); +typedef BOOL (CALLBACK *TIMEFMT_ENUMPROCEX)(LPWSTR,LPARAM); #if defined(STRICT) typedef BOOL (CALLBACK *CALINFO_ENUMPROCA)(LPSTR); typedef BOOL (CALLBACK *CALINFO_ENUMPROCW)(LPWSTR); @@ -807,7 +809,10 @@ GEO_TIMEZONES, GEO_OFFICIALLANGUAGES, GEO_ISO_UN_NUMBER, - GEO_PARENT + GEO_PARENT, + GEO_DIALINGCODE, + GEO_CURRENCYCODE, + GEO_CURRENCYSYMBOL }; enum SYSGEOCLASS @@ -840,6 +845,7 @@ WINBASEAPI BOOL WINAPI EnumDateFormatsExA(DATEFMT_ENUMPROCEXA,LCID,DWORD); WINBASEAPI BOOL WINAPI EnumDateFormatsExW(DATEFMT_ENUMPROCEXW,LCID,DWORD); #define EnumDateFormatsEx WINELIB_NAME_AW(EnumDateFormatsEx) +WINBASEAPI BOOL WINAPI EnumDateFormatsExEx(DATEFMT_ENUMPROCEXEX,LPCWSTR,DWORD,LPARAM); WINBASEAPI BOOL WINAPI EnumSystemCodePagesA(CODEPAGE_ENUMPROCA,DWORD); WINBASEAPI BOOL WINAPI EnumSystemCodePagesW(CODEPAGE_ENUMPROCW,DWORD); #define EnumSystemCodePages WINELIB_NAME_AW(EnumSystemCodePages) @@ -857,6 +863,7 @@ WINBASEAPI BOOL WINAPI EnumTimeFormatsA(TIMEFMT_ENUMPROCA,LCID,DWORD); WINBASEAPI BOOL WINAPI EnumTimeFormatsW(TIMEFMT_ENUMPROCW,LCID,DWORD); #define EnumTimeFormats WINELIB_NAME_AW(EnumTimeFormats) +WINBASEAPI BOOL WINAPI EnumTimeFormatsEx(TIMEFMT_ENUMPROCEX,LPCWSTR,DWORD,LPARAM); WINBASEAPI BOOL WINAPI EnumUILanguagesA(UILANGUAGE_ENUMPROCA,DWORD,LONG_PTR); WINBASEAPI BOOL WINAPI EnumUILanguagesW(UILANGUAGE_ENUMPROCW,DWORD,LONG_PTR); #define EnumUILanguages WINELIB_NAME_AW(EnumUILanguages) diff -Nru wine1.7-1.7.50/include/winnt.h wine1.7-1.7.55/include/winnt.h --- wine1.7-1.7.50/include/winnt.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/winnt.h 2015-11-13 14:32:40.000000000 +0000 @@ -4181,6 +4181,18 @@ #define DOMAIN_GROUP_RID_ENTERPRISE_ADMINS __MSABI_LONG(0x00000207) #define DOMAIN_GROUP_RID_POLICY_ADMINS __MSABI_LONG(0x00000208) +#define SECURITY_APP_PACKAGE_AUTHORITY {0,0,0,0,0,15} +#define SECURITY_APP_PACKAGE_BASE_RID __MSABI_LONG(0x000000002) +#define SECURITY_BUILTIN_APP_PACKAGE_RID_COUNT __MSABI_LONG(0x000000002) +#define SECURITY_APP_PACKAGE_RID_COUNT __MSABI_LONG(0x000000008) +#define SECURITY_CAPABILITY_BASE_RID __MSABI_LONG(0x000000003) +#define SECURITY_CAPABILITY_APP_RID __MSABI_LONG(0x000000400) +#define SECURITY_BUILTIN_CAPABILITY_RID_COUNT __MSABI_LONG(0x000000002) +#define SECURITY_CAPABILITY_RID_COUNT __MSABI_LONG(0x000000005) +#define SECURITY_PARENT_PACKAGE_RID_COUNT SECURITY_APP_PACKAGE_RID_COUNT +#define SECURITY_CHILD_PACKAGE_RID_COUNT __MSABI_LONG(0x00000000c) +#define SECURITY_BUILTIN_PACKAGE_ANY_PACKAGE __MSABI_LONG(0x000000001) + #define SECURITY_MANDATORY_LABEL_AUTHORITY {0,0,0,0,0,16} #define SECURITY_MANDATORY_UNTRUSTED_RID __MSABI_LONG(0x00000000) #define SECURITY_MANDATORY_LOW_RID __MSABI_LONG(0x00001000) @@ -5810,12 +5822,12 @@ typedef struct _PROCESSOR_RELATIONSHIP { BYTE Flags; - BYTE Reserved[21]; + BYTE EfficiencyClass; + BYTE Reserved[20]; WORD GroupCount; GROUP_AFFINITY GroupMask[ANYSIZE_ARRAY]; } PROCESSOR_RELATIONSHIP, *PPROCESSOR_RELATIONSHIP; - typedef struct _NUMA_NODE_RELATIONSHIP { DWORD NodeNumber; @@ -5828,6 +5840,7 @@ BYTE Level; BYTE Associativity; WORD LineSize; + DWORD CacheSize; PROCESSOR_CACHE_TYPE Type; BYTE Reserved[20]; GROUP_AFFINITY GroupMask; diff -Nru wine1.7-1.7.50/include/winsock2.h wine1.7-1.7.55/include/winsock2.h --- wine1.7-1.7.50/include/winsock2.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/winsock2.h 2015-11-13 14:32:40.000000000 +0000 @@ -112,6 +112,33 @@ #define SD_SEND 0x01 #define SD_BOTH 0x02 +/* Constants for WSAPoll() */ +#ifndef __WINE_WINE_PORT_H +#ifndef USE_WS_PREFIX +#define POLLERR 0x0001 +#define POLLHUP 0x0002 +#define POLLNVAL 0x0004 +#define POLLWRNORM 0x0010 +#define POLLWRBAND 0x0020 +#define POLLRDNORM 0x0100 +#define POLLRDBAND 0x0200 +#define POLLPRI 0x0400 +#define POLLIN (POLLRDNORM|POLLRDBAND) +#define POLLOUT (POLLWRNORM) +#else +#define WS_POLLERR 0x0001 +#define WS_POLLHUP 0x0002 +#define WS_POLLNVAL 0x0004 +#define WS_POLLWRNORM 0x0010 +#define WS_POLLWRBAND 0x0020 +#define WS_POLLRDNORM 0x0100 +#define WS_POLLRDBAND 0x0200 +#define WS_POLLPRI 0x0400 +#define WS_POLLIN (WS_POLLRDNORM|WS_POLLRDBAND) +#define WS_POLLOUT (WS_POLLWRNORM) +#endif +#endif + /* Constants for WSAIoctl() */ #ifdef USE_WS_PREFIX #define WS_IOC_UNIX 0x00000000 @@ -211,6 +238,33 @@ #define LUP_RETURN_ALL (LUP_RETURN_ADDR|LUP_RETURN_BLOB|LUP_RETURN_ALIASES|LUP_RETURN_QUERY_STRING \ |LUP_RETURN_NAME|LUP_RETURN_TYPE|LUP_RETURN_VERSION|LUP_RETURN_COMMENT) +/* Constants for dwNameSpace from struct WSANAMESPACE_INFO */ +#define NS_ALL 0 +#define NS_SAP 1 +#define NS_NDS 2 +#define NS_PEER_BROWSE 3 +#define NS_SLP 5 +#define NS_DHCP 6 +#define NS_TCPIP_LOCAL 10 +#define NS_TCPIP_HOSTS 11 +#define NS_DNS 12 +#define NS_NETBT 13 +#define NS_WINS 14 +#define NS_NLA 15 +#define NS_BTH 16 +#define NS_NBP 20 +#define NS_MS 30 +#define NS_STDA 31 +#define NS_NTDS 32 +#define NS_EMAIL 37 +#define NS_PNRPNAME 38 +#define NS_PNRPCLOUD 39 +#define NS_X500 40 +#define NS_NIS 41 +#define NS_NISPLUS 42 +#define NS_WRQ 50 +#define NS_NETDES 60 + #ifndef GUID_DEFINED #include #endif @@ -259,6 +313,13 @@ #define SECURITY_PROTOCOL_NONE 0x0000 +typedef struct /*WS(pollfd)*/ +{ + SOCKET fd; + SHORT events; + SHORT revents; +} WSAPOLLFD; + #define WSAPROTOCOL_LEN 255 typedef struct _WSAPROTOCOL_INFOA { @@ -662,6 +723,7 @@ int WINAPI WSANSPIoctl(HANDLE,DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,LPWSACOMPLETION); int WINAPI WSANtohl(SOCKET,ULONG,ULONG*); int WINAPI WSANtohs(SOCKET,WS(u_short),WS(u_short)*); +int WINAPI WSAPoll(WSAPOLLFD*,ULONG,int); INT WINAPI WSAProviderConfigChange(LPHANDLE,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE); int WINAPI WSARecv(SOCKET,LPWSABUF,DWORD,LPDWORD,LPDWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE); int WINAPI WSARecvDisconnect(SOCKET,LPWSABUF); @@ -736,6 +798,7 @@ typedef int (WINAPI *LPFN_WSANTOHL)(SOCKET,ULONG,ULONG*); typedef int (WINAPI *LPFN_WSANTOHS)(SOCKET,WS(u_short),WS(u_short)*); typedef INT (WINAPI *LPFN_WSAPROVIDERCONFIGCHANGE)(LPHANDLE,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE); +typedef int (WINAPI *LPFN_WSAPOLL)(WSAPOLLFD*,ULONG,int); typedef int (WINAPI *LPFN_WSARECV)(SOCKET,LPWSABUF,DWORD,LPDWORD,LPDWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE); typedef int (WINAPI *LPFN_WSARECVDISCONNECT)(SOCKET,LPWSABUF); typedef int (WINAPI *LPFN_WSARECVFROM)(SOCKET,LPWSABUF,DWORD,LPDWORD,LPDWORD,struct WS(sockaddr)*,LPINT,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE); diff -Nru wine1.7-1.7.50/include/winternl.h wine1.7-1.7.55/include/winternl.h --- wine1.7-1.7.50/include/winternl.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/winternl.h 2015-11-13 14:32:40.000000000 +0000 @@ -696,7 +696,12 @@ KeyBasicInformation, KeyNodeInformation, KeyFullInformation, - KeyNameInformation + KeyNameInformation, + KeyCachedInformation, + KeyFlagsInformation, + KeyVirtualizationInformation, + KeyHandleTagsInformation, + MaxKeyInfoClass } KEY_INFORMATION_CLASS; typedef enum _KEY_VALUE_INFORMATION_CLASS { @@ -859,6 +864,22 @@ ThreadSetTlsArrayAddress, ThreadIsIoPending, ThreadHideFromDebugger, + ThreadBreakOnTermination, + ThreadSwitchLegacyState, + ThreadIsTerminated, + ThreadLastSystemCall, + ThreadIoPriority, + ThreadCycleTime, + ThreadPagePriority, + ThreadActualBasePriority, + ThreadTebInformation, + ThreadCSwitchMon, + ThreadCSwitchPmu, + ThreadWow64Context, + ThreadGroupInformation, + ThreadUmsInformation, + ThreadCounterProfiling, + ThreadIdealProcessorEx, MaxThreadInfoClass } THREADINFOCLASS; @@ -1008,6 +1029,18 @@ WCHAR Name[1]; } KEY_NAME_INFORMATION, *PKEY_NAME_INFORMATION; +typedef struct _KEY_CACHED_INFORMATION +{ + LARGE_INTEGER LastWriteTime; + ULONG TitleIndex; + ULONG SubKeys; + ULONG MaxNameLen; + ULONG Values; + ULONG MaxValueNameLen; + ULONG MaxValueDataLen; + ULONG NameLength; +} KEY_CACHED_INFORMATION, *PKEY_CACHED_INFORMATION; + typedef struct _KEY_VALUE_ENTRY { PUNICODE_STRING ValueName; @@ -2092,6 +2125,7 @@ NTSYSAPI NTSTATUS WINAPI NtCreateIoCompletion(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,ULONG); NTSYSAPI NTSTATUS WINAPI NtCreateJobObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*); NTSYSAPI NTSTATUS WINAPI NtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,PULONG); +NTSYSAPI NTSTATUS WINAPI NtCreateKeyTransacted(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,const UNICODE_STRING*,ULONG,HANDLE,ULONG*); NTSYSAPI NTSTATUS WINAPI NtCreateKeyedEvent(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG); NTSYSAPI NTSTATUS WINAPI NtCreateMailslotFile(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES,PIO_STATUS_BLOCK,ULONG,ULONG,ULONG,PLARGE_INTEGER); NTSYSAPI NTSTATUS WINAPI NtCreateMutant(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*,BOOLEAN); @@ -2127,6 +2161,7 @@ NTSYSAPI NTSTATUS WINAPI NtFreeVirtualMemory(HANDLE,PVOID*,SIZE_T*,ULONG); NTSYSAPI NTSTATUS WINAPI NtFsControlFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,PVOID,ULONG,PVOID,ULONG); NTSYSAPI NTSTATUS WINAPI NtGetContextThread(HANDLE,CONTEXT*); +NTSYSAPI ULONG WINAPI NtGetCurrentProcessorNumber(void); NTSYSAPI NTSTATUS WINAPI NtGetPlugPlayEvent(ULONG,ULONG,PVOID,ULONG); NTSYSAPI ULONG WINAPI NtGetTickCount(VOID); NTSYSAPI NTSTATUS WINAPI NtGetWriteWatch(HANDLE,ULONG,PVOID,SIZE_T,PVOID*,ULONG_PTR*,ULONG*); @@ -2145,6 +2180,7 @@ NTSYSAPI NTSTATUS WINAPI NtMapViewOfSection(HANDLE,HANDLE,PVOID*,ULONG,SIZE_T,const LARGE_INTEGER*,SIZE_T*,SECTION_INHERIT,ULONG,ULONG); NTSYSAPI NTSTATUS WINAPI NtNotifyChangeDirectoryFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,PVOID,ULONG,ULONG,BOOLEAN); NTSYSAPI NTSTATUS WINAPI NtNotifyChangeKey(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN); +NTSYSAPI NTSTATUS WINAPI NtNotifyChangeMultipleKeys(HANDLE,ULONG,OBJECT_ATTRIBUTES*,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,ULONG,BOOLEAN,PVOID,ULONG,BOOLEAN); NTSYSAPI NTSTATUS WINAPI NtOpenDirectoryObject(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES); NTSYSAPI NTSTATUS WINAPI NtOpenEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *); NTSYSAPI NTSTATUS WINAPI NtOpenEventPair(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES); @@ -2152,6 +2188,9 @@ NTSYSAPI NTSTATUS WINAPI NtOpenIoCompletion(PHANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES); NTSYSAPI NTSTATUS WINAPI NtOpenJobObject(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*); NTSYSAPI NTSTATUS WINAPI NtOpenKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *); +NTSYSAPI NTSTATUS WINAPI NtOpenKeyEx(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG); +NTSYSAPI NTSTATUS WINAPI NtOpenKeyTransacted(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,HANDLE); +NTSYSAPI NTSTATUS WINAPI NtOpenKeyTransactedEx(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,HANDLE); NTSYSAPI NTSTATUS WINAPI NtOpenKeyedEvent(HANDLE*,ACCESS_MASK,const OBJECT_ATTRIBUTES*); NTSYSAPI NTSTATUS WINAPI NtOpenMutant(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*); NTSYSAPI NTSTATUS WINAPI NtOpenObjectAuditAlarm(PUNICODE_STRING,PHANDLE,PUNICODE_STRING,PUNICODE_STRING,PSECURITY_DESCRIPTOR,HANDLE,ACCESS_MASK,ACCESS_MASK,PPRIVILEGE_SET,BOOLEAN,BOOLEAN,PBOOLEAN); @@ -2220,6 +2259,7 @@ NTSYSAPI NTSTATUS WINAPI NtReleaseMutant(HANDLE,PLONG); NTSYSAPI NTSTATUS WINAPI NtReleaseSemaphore(HANDLE,ULONG,PULONG); NTSYSAPI NTSTATUS WINAPI NtRemoveIoCompletion(HANDLE,PULONG_PTR,PULONG_PTR,PIO_STATUS_BLOCK,PLARGE_INTEGER); +NTSYSAPI NTSTATUS WINAPI NtRenameKey(HANDLE,UNICODE_STRING*); NTSYSAPI NTSTATUS WINAPI NtReplaceKey(POBJECT_ATTRIBUTES,HANDLE,POBJECT_ATTRIBUTES); NTSYSAPI NTSTATUS WINAPI NtReplyPort(HANDLE,PLPC_MESSAGE); NTSYSAPI NTSTATUS WINAPI NtReplyWaitReceivePort(HANDLE,PULONG,PLPC_MESSAGE,PLPC_MESSAGE); @@ -2467,6 +2507,8 @@ NTSYSAPI NTSTATUS WINAPI RtlIntegerToChar(ULONG,ULONG,ULONG,PCHAR); NTSYSAPI NTSTATUS WINAPI RtlIntegerToUnicodeString(ULONG,ULONG,UNICODE_STRING *); NTSYSAPI BOOLEAN WINAPI RtlIsActivationContextActive(HANDLE); +NTSYSAPI BOOL WINAPI RtlIsCriticalSectionLocked(RTL_CRITICAL_SECTION *); +NTSYSAPI BOOL WINAPI RtlIsCriticalSectionLockedByThread(RTL_CRITICAL_SECTION *); NTSYSAPI ULONG WINAPI RtlIsDosDeviceName_U(PCWSTR); NTSYSAPI BOOLEAN WINAPI RtlIsNameLegalDOS8Dot3(const UNICODE_STRING*,POEM_STRING,PBOOLEAN); NTSYSAPI BOOLEAN WINAPI RtlIsTextUnicode(LPCVOID,INT,INT *); @@ -2584,6 +2626,7 @@ NTSYSAPI CHAR WINAPI RtlUpperChar(CHAR); NTSYSAPI void WINAPI RtlUpperString(STRING *,const STRING *); NTSYSAPI NTSTATUS WINAPI RtlValidSecurityDescriptor(PSECURITY_DESCRIPTOR); +NTSYSAPI BOOLEAN WINAPI RtlValidRelativeSecurityDescriptor(PSECURITY_DESCRIPTOR,ULONG,SECURITY_INFORMATION); NTSYSAPI BOOLEAN WINAPI RtlValidAcl(PACL); NTSYSAPI BOOLEAN WINAPI RtlValidSid(PSID); NTSYSAPI BOOLEAN WINAPI RtlValidateHeap(HANDLE,ULONG,LPCVOID); diff -Nru wine1.7-1.7.50/include/winuser.h wine1.7-1.7.55/include/winuser.h --- wine1.7-1.7.50/include/winuser.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/winuser.h 2015-11-13 14:32:40.000000000 +0000 @@ -3267,6 +3267,7 @@ WINUSERAPI BOOL WINAPI EnumDisplaySettingsExA(LPCSTR,DWORD,LPDEVMODEA,DWORD); WINUSERAPI BOOL WINAPI EnumDisplaySettingsExW(LPCWSTR,DWORD,LPDEVMODEW,DWORD); #define EnumDisplaySettingsEx WINELIB_NAME_AW(EnumDisplaySettingsEx) +WINUSERAPI LONG WINAPI GetDisplayConfigBufferSizes(UINT32,UINT32*,UINT32*); WINUSERAPI BOOL WINAPI UpdateLayeredWindow(HWND,HDC,POINT*,SIZE*,HDC,POINT*,COLORREF,BLENDFUNCTION*,DWORD); WINUSERAPI BOOL WINAPI UpdateLayeredWindowIndirect(HWND,UPDATELAYEREDWINDOWINFO const*); #endif /* defined(_WINGDI_) && !defined(NOGDI) */ diff -Nru wine1.7-1.7.50/include/ws2def.h wine1.7-1.7.55/include/ws2def.h --- wine1.7-1.7.50/include/ws2def.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/ws2def.h 2015-11-13 14:32:40.000000000 +0000 @@ -110,4 +110,32 @@ (((unsigned char*)cmsg + WSA_CMSG_ALIGN(cmsg->cmsg_len)+WSA_CMSG_ALIGN(((WSACMSGHDR*)((unsigned char*)cmsg + WSA_CMSG_ALIGN(cmsg->cmsg_len)))->cmsg_len) > ((unsigned char*)(mhdr)->Control.buf + (mhdr)->Control.len)) ? NULL : \ (WSACMSGHDR*)((unsigned char*)cmsg + WSA_CMSG_ALIGN(cmsg->cmsg_len)))))) +typedef struct addrinfoexA { + int ai_flags; + int ai_family; + int ai_socktype; + int ai_protocol; + SIZE_T ai_addrlen; + char *ai_canonname; + struct WS(sockaddr) *ai_addr; + void *ai_blob; + SIZE_T ai_bloblen; + GUID *ai_provider; + struct addrinfoexA *ai_next; +} ADDRINFOEXA, *PADDRINFOEXA, *LPADDRINFOEXA; + +typedef struct addrinfoexW { + int ai_flags; + int ai_family; + int ai_socktype; + int ai_protocol; + SIZE_T ai_addrlen; + WCHAR *ai_canonname; + struct WS(sockaddr) *ai_addr; + void *ai_blob; + SIZE_T ai_bloblen; + GUID *ai_provider; + struct addrinfoexW *ai_next; +} ADDRINFOEXW, *PADDRINFOEXW, *LPADDRINFOEXW; + #endif /* _WS2DEF_ */ diff -Nru wine1.7-1.7.50/include/ws2tcpip.h wine1.7-1.7.55/include/ws2tcpip.h --- wine1.7-1.7.50/include/ws2tcpip.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/ws2tcpip.h 2015-11-13 14:32:40.000000000 +0000 @@ -161,6 +161,8 @@ # define gai_strerror WINELIB_NAME_AW(gai_strerror) #endif +typedef void (CALLBACK *LPLOOKUPSERVICE_COMPLETION_ROUTINE)(DWORD,DWORD,WSAOVERLAPPED*); + void WINAPI WS(freeaddrinfo)(LPADDRINFO); #define FreeAddrInfoA WS(freeaddrinfo) void WINAPI FreeAddrInfoW(PADDRINFOW); @@ -169,6 +171,11 @@ #define GetAddrInfoA WS(getaddrinfo) int WINAPI GetAddrInfoW(PCWSTR,PCWSTR,const ADDRINFOW*,PADDRINFOW*); #define GetAddrInfo WINELIB_NAME_AW(GetAddrInfo) +int WINAPI GetAddrInfoExA(const char*,const char*,DWORD,GUID*,const ADDRINFOEXA*,ADDRINFOEXA**,struct timeval*, + OVERLAPPED*,LPLOOKUPSERVICE_COMPLETION_ROUTINE,HANDLE*); +int WINAPI GetAddrInfoExW(const WCHAR*,const WCHAR*,DWORD,GUID*, const ADDRINFOEXW*,ADDRINFOEXW**,struct timeval*, + OVERLAPPED*,LPLOOKUPSERVICE_COMPLETION_ROUTINE,HANDLE*); +#define GetAddrInfoEx WINELIB_NAME_AW(GetAddrInfoExW) int WINAPI WS(getnameinfo)(const SOCKADDR*,WS(socklen_t),PCHAR,DWORD,PCHAR,DWORD,INT); #define GetNameInfoA WS(getnameinfo) INT WINAPI GetNameInfoW(const SOCKADDR*,WS(socklen_t),PWCHAR,DWORD,PWCHAR,DWORD,INT); diff -Nru wine1.7-1.7.50/include/x3daudio.h wine1.7-1.7.55/include/x3daudio.h --- wine1.7-1.7.50/include/x3daudio.h 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/include/x3daudio.h 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2015 Andrew Eikum 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 _X3DAUDIO_H +#define _X3DAUDIO_H + +typedef struct X3DAUDIO_VECTOR { + float x, y, z; +} X3DAUDIO_VECTOR; + +typedef struct X3DAUDIO_CONE { + float InnerAngle; + float OuterAngle; + float InnerVolume; + float OuterVolume; + float InnerLPF; + float OuterLPF; + float InnerReverb; + float OuterReverb; +} X3DAUDIO_CONE; + +typedef struct X3DAUDIO_DISTANCE_CURVE_POINT { + float Distance; + float DSPSetting; +} X3DAUDIO_DISTANCE_CURVE_POINT; + +typedef struct X3DAUDIO_DISTANCE_CURVE { + X3DAUDIO_DISTANCE_CURVE_POINT *pPoints; + UINT32 PointCount; +} X3DAUDIO_DISTANCE_CURVE; + +typedef struct X3DAUDIO_LISTENER { + X3DAUDIO_VECTOR OrientFront; + X3DAUDIO_VECTOR OrientTop; + X3DAUDIO_VECTOR Position; + X3DAUDIO_VECTOR Velocity; + X3DAUDIO_CONE *pCone; +} X3DAUDIO_LISTENER; + +typedef struct X3DAUDIO_EMITTER { + X3DAUDIO_CONE *pCone; + X3DAUDIO_VECTOR OrientFront; + X3DAUDIO_VECTOR OrientTop; + X3DAUDIO_VECTOR Position; + X3DAUDIO_VECTOR Velocity; + float InnerRadius; + float InnerRadiusAngle; + UINT32 ChannelCount; + float ChannelRadius; + float *pChannelAzimuths; + X3DAUDIO_DISTANCE_CURVE *pVolumeCurve; + X3DAUDIO_DISTANCE_CURVE *pLFECurve; + X3DAUDIO_DISTANCE_CURVE *pLPFDirectCurve; + X3DAUDIO_DISTANCE_CURVE *pLPFReverbCurve; + X3DAUDIO_DISTANCE_CURVE *pReverbCurve; + float CurveDistanceScalar; + float DopplerScalar; +} X3DAUDIO_EMITTER; + +typedef struct X3DAUDIO_DSP_SETTINGS { + float *pMatrixCoefficients; + float *pDelayTimes; + UINT32 SrcChannelCount; + UINT32 DstChannelCount; + float LPFDirectCoefficient; + float LPFReverbCoefficient; + float ReverbLevel; + float DopplerFactor; + float EmitterToListenerAngle; + float EmitterToListenerDistance; + float EmitterVelocityComponent; + float ListenerVelocityComponent; +} X3DAUDIO_DSP_SETTINGS; + +#define X3DAUDIO_HANDLE_BYTESIZE 20 +typedef BYTE X3DAUDIO_HANDLE[X3DAUDIO_HANDLE_BYTESIZE]; + +HRESULT CDECL X3DAudioInitialize(UINT32, float, X3DAUDIO_HANDLE); +void CDECL X3DAudioCalculate(const X3DAUDIO_HANDLE, const X3DAUDIO_LISTENER *, + const X3DAUDIO_EMITTER *, UINT32, X3DAUDIO_DSP_SETTINGS *); + +#endif diff -Nru wine1.7-1.7.50/include/xapofx.h wine1.7-1.7.55/include/xapofx.h --- wine1.7-1.7.50/include/xapofx.h 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/include/xapofx.h 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2015 Andrew Eikum 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 + */ + +/* CLSIDs used by CreateFX, but never registered */ + +#ifndef _XAPOFX_H +#define _XAPOFX_H + +/* xapofx 1.0 through 1.5 */ +DEFINE_GUID(CLSID_FXEQ27, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0x55, 0x00, 0x00, 0x00, 0x00); +/* xaudio 2.8 */ +DEFINE_GUID(CLSID_FXEQ, 0xf5e01117, 0xd6c4, 0x485a, 0xa3, 0xf5, 0x69, 0x51, 0x96, 0xf3, 0xdb, 0xfa); +/* wine internal */ +DEFINE_GUID(CLSID_WINE_FXEQ10, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x00, 0x00, 0x01, 0x00); +DEFINE_GUID(CLSID_WINE_FXEQ11, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x00, 0x00, 0x01, 0x01); +DEFINE_GUID(CLSID_WINE_FXEQ12, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x00, 0x00, 0x01, 0x02); +DEFINE_GUID(CLSID_WINE_FXEQ13, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x00, 0x00, 0x01, 0x03); +DEFINE_GUID(CLSID_WINE_FXEQ14, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x00, 0x00, 0x01, 0x04); +DEFINE_GUID(CLSID_WINE_FXEQ15, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x00, 0x00, 0x01, 0x05); +DEFINE_GUID(CLSID_WINE_FXEQ28, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x00, 0x00, 0x02, 0x08); + +/* xapofx 1.0 through 1.5 */ +DEFINE_GUID(CLSID_FXMasteringLimiter27, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0x55, 0x00, 0x00, 0x00, 0x01); +/* xaudio 2.8 */ +DEFINE_GUID(CLSID_FXMasteringLimiter, 0xc4137916, 0x2be1, 0x46fd, 0x85, 0x99, 0x44, 0x15, 0x36, 0xf4, 0x98, 0x56); +/* wine internal */ +DEFINE_GUID(CLSID_WINE_FXMasteringLimiter10, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x01, 0x00, 0x01, 0x00); +DEFINE_GUID(CLSID_WINE_FXMasteringLimiter11, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x01, 0x00, 0x01, 0x01); +DEFINE_GUID(CLSID_WINE_FXMasteringLimiter12, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x01, 0x00, 0x01, 0x02); +DEFINE_GUID(CLSID_WINE_FXMasteringLimiter13, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x01, 0x00, 0x01, 0x03); +DEFINE_GUID(CLSID_WINE_FXMasteringLimiter14, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x01, 0x00, 0x01, 0x04); +DEFINE_GUID(CLSID_WINE_FXMasteringLimiter15, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x01, 0x00, 0x01, 0x05); +DEFINE_GUID(CLSID_WINE_FXMasteringLimiter28, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x01, 0x00, 0x02, 0x08); + +/* xapofx 1.0 through 1.5 */ +DEFINE_GUID(CLSID_FXReverb27, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0x55, 0x00, 0x00, 0x00, 0x02); +/* xaudio 2.8 */ +DEFINE_GUID(CLSID_FXReverb, 0x7d9aca56, 0xcb68, 0x4807, 0xb6, 0x32, 0xb1, 0x37, 0x35, 0x2e, 0x85, 0x96); +/* wine internal */ +DEFINE_GUID(CLSID_WINE_FXReverb10, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x02, 0x00, 0x01, 0x00); +DEFINE_GUID(CLSID_WINE_FXReverb11, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x02, 0x00, 0x01, 0x01); +DEFINE_GUID(CLSID_WINE_FXReverb12, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x02, 0x00, 0x01, 0x02); +DEFINE_GUID(CLSID_WINE_FXReverb13, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x02, 0x00, 0x01, 0x03); +DEFINE_GUID(CLSID_WINE_FXReverb14, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x02, 0x00, 0x01, 0x04); +DEFINE_GUID(CLSID_WINE_FXReverb15, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x02, 0x00, 0x01, 0x05); +DEFINE_GUID(CLSID_WINE_FXReverb28, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x02, 0x00, 0x02, 0x08); + +/* xapofx 1.0 through 1.5 */ +DEFINE_GUID(CLSID_FXEcho27, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0x55, 0x00, 0x00, 0x00, 0x03); +/* xaudio 2.8 */ +DEFINE_GUID(CLSID_FXEcho, 0x5039d740, 0xf736, 0x449a, 0x84, 0xd3, 0xa5, 0x62, 0x02, 0x55, 0x7b, 0x87); +/* wine internal */ +DEFINE_GUID(CLSID_WINE_FXEcho10, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x03, 0x00, 0x01, 0x00); +DEFINE_GUID(CLSID_WINE_FXEcho11, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x03, 0x00, 0x01, 0x01); +DEFINE_GUID(CLSID_WINE_FXEcho12, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x03, 0x00, 0x01, 0x02); +DEFINE_GUID(CLSID_WINE_FXEcho13, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x03, 0x00, 0x01, 0x03); +DEFINE_GUID(CLSID_WINE_FXEcho14, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x03, 0x00, 0x01, 0x04); +DEFINE_GUID(CLSID_WINE_FXEcho15, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x03, 0x00, 0x01, 0x05); +DEFINE_GUID(CLSID_WINE_FXEcho28, 0xa90bc001, 0xe897, 0xe897, 0x74, 0x39, 0x43, 0xFF, 0x03, 0x00, 0x02, 0x08); + +#endif diff -Nru wine1.7-1.7.50/include/xapo.idl wine1.7-1.7.55/include/xapo.idl --- wine1.7-1.7.50/include/xapo.idl 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/include/xapo.idl 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2015 Andrew Eikum 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"; + +#define XAPO_REGISTRATION_STRING_LENGTH 256 + +cpp_quote("#if 0") +typedef struct WAVEFORMATEX +{ + WORD wFormatTag; + WORD nChannels; + DWORD nSamplesPerSec; + DWORD nAvgBytesPerSec; + WORD nBlockAlign; + WORD wBitsPerSample; + WORD cbSize; +} WAVEFORMATEX; + +typedef struct { + WAVEFORMATEX Format; + union { + WORD wValidBitsPerSample; + WORD wSamplesPerBlock; + WORD wReserved; + } Samples; + DWORD dwChannelMask; + GUID SubFormat; +} WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE; +cpp_quote("#else") +cpp_quote("#include ") +cpp_quote("#endif") + +typedef struct XAPO_REGISTRATION_PROPERTIES +{ + CLSID clsid; + WCHAR FriendlyName[XAPO_REGISTRATION_STRING_LENGTH]; + WCHAR CopyrightInfo[XAPO_REGISTRATION_STRING_LENGTH]; + UINT32 MajorVersion; + UINT32 MinorVersion; + UINT32 Flags; + UINT32 MinInputBufferCount; + UINT32 MaxInputBufferCount; + UINT32 MinOutputBufferCount; + UINT32 MaxOutputBufferCount; +} XAPO_REGISTRATION_PROPERTIES; + +typedef struct XAPO20_REGISTRATION_PROPERTIES +{ + CLSID clsid; + WCHAR FriendlyName[XAPO_REGISTRATION_STRING_LENGTH]; + WCHAR CopyrightInfo[XAPO_REGISTRATION_STRING_LENGTH]; + UINT32 MajorVersion; + UINT32 MinorVersion; + UINT32 Flags; + UINT32 MinInputBufferCount; + UINT32 MaxInputBufferCount; + UINT32 MinOutputBufferCount; + UINT32 MaxOutputBufferCount; + UINT32 InterfaceCount; + IID InterfaceArray[1]; +} XAPO20_REGISTRATION_PROPERTIES; + +typedef struct XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS { + const WAVEFORMATEX *pFormat; + UINT32 MaxFrameCount; +} XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS; + +typedef enum XAPO_BUFFER_FLAGS { + XAPO_BUFFER_SILENT, + XAPO_BUFFER_VALID +} XAPO_BUFFER_FLAGS; + +typedef struct XAPO_PROCESS_BUFFER_PARAMETERS { + void *pBuffer; + XAPO_BUFFER_FLAGS BufferFlags; + UINT32 ValidFrameCount; +} XAPO_PROCESS_BUFFER_PARAMETERS; + +/* XAudio2 2.8 version of IXAPO */ +[ + object, + local, + uuid(a410b984-9839-4819-a0be-2856ae6b3adb) +] +interface IXAPO : IUnknown +{ + HRESULT GetRegistrationProperties([out] XAPO_REGISTRATION_PROPERTIES **props); + + HRESULT IsInputFormatSupported(const WAVEFORMATEX *output_fmt, + const WAVEFORMATEX *input_fmt, WAVEFORMATEX **supported_fmt); + + HRESULT IsOutputFormatSupported(const WAVEFORMATEX *input_fmt, + const WAVEFORMATEX *output_fmt, WAVEFORMATEX **supported_fmt); + + HRESULT Initialize(const void *data, UINT32 data_len); + + HRESULT Reset(void); + + HRESULT LockForProcess(UINT32 in_params_count, const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *in_params, + UINT32 out_params_count, const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *out_params); + + void UnlockForProcess(void); + + void Process(UINT32 in_params_count, const XAPO_PROCESS_BUFFER_PARAMETERS *in_params, + UINT32 out_params_count, const XAPO_PROCESS_BUFFER_PARAMETERS *out_params, + BOOL enabled); + + UINT32 CalcInputFrames(UINT32 output_frames); + + UINT32 CalcOutputFrames(UINT32 input_frames); +} + +/* XAudio2 2.7 version of IXAPO is identical to 2.8 */ +cpp_quote("DEFINE_GUID(IID_IXAPO27, 0xa90bc001, 0xe897, 0xe897, 0x55, 0xe4, 0x9e, 0x47, 0x00, 0x00, 0x00, 0x00);") + + +/* XAudio2 2.8 version of IXAPOParameters */ +[ + object, + local, + uuid(26d95c66-80f2-499a-ad54-5ae7f01c6d98) +] +interface IXAPOParameters : IUnknown +{ + void SetParameters(const void *params, UINT32 params_len); + + void GetParameters(void *params, UINT32 params_len); +} + +/* XAudio2 2.7 version of IXAPOParameters is identical to 2.8 */ +cpp_quote("DEFINE_GUID(IID_IXAPO27Parameters, 0xa90bc001, 0xe897, 0xe897, 0x55, 0xe4, 0x9e, 0x47, 0x00, 0x00, 0x00, 0x01);") diff -Nru wine1.7-1.7.50/include/xaudio2fx.idl wine1.7-1.7.55/include/xaudio2fx.idl --- wine1.7-1.7.50/include/xaudio2fx.idl 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/include/xaudio2fx.idl 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2015 Andrew Eikum + * + * 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"; + +[ + uuid(cac1105f-619b-4d04-831a-44e1cbf12d57) +] +coclass AudioVolumeMeter { + interface IUnknown; +} + +[ + uuid(c0c56f46-29b1-44e9-9939-a32ce86867e2) +] +coclass AudioVolumeMeter20 { + interface IUnknown; +} + +[ + uuid(c1e3f122-a2ea-442c-854f-20d98f8357a1) +] +coclass AudioVolumeMeter21 { + interface IUnknown; +} + +[ + uuid(f5ca7b34-8055-42c0-b836-216129eb7e30) +] +coclass AudioVolumeMeter22 { + interface IUnknown; +} + +[ + uuid(e180344b-ac83-4483-959e-18a5c56a5e19) +] +coclass AudioVolumeMeter23 { + interface IUnknown; +} + +[ + uuid(c7338b95-52b8-4542-aa79-42eb016c8c1c) +] +coclass AudioVolumeMeter24 { + interface IUnknown; +} + +[ + uuid(2139e6da-c341-4774-9ac3-b4e026347f64) +] +coclass AudioVolumeMeter25 { + interface IUnknown; +} + +[ + uuid(e48c5a3f-93ef-43bb-a092-2c7ceb946f27) +] +coclass AudioVolumeMeter26 { + interface IUnknown; +} + +[ + uuid(6a93130e-1d53-41d1-a9cf-e758800bb179) +] +coclass AudioReverb { + interface IUnknown; +} + +[ + uuid(6f6ea3a9-2cf5-41cf-91c1-2170b1540063) +] +coclass AudioReverb20 { + interface IUnknown; +} + +[ + uuid(f4769300-b949-4df9-b333-00d33932e9a6) +] +coclass AudioReverb21 { + interface IUnknown; +} + +[ + uuid(629cf0de-3ecc-41e7-9926-f7e43eebec51) +] +coclass AudioReverb22 { + interface IUnknown; +} + +[ + uuid(9cab402c-1d37-44b4-886d-fa4f36170a4c) +] +coclass AudioReverb23 { + interface IUnknown; +} + +[ + uuid(8bb7778b-645b-4475-9a73-1de3170bd3af) +] +coclass AudioReverb24 { + interface IUnknown; +} + +[ + uuid(d06df0d0-8518-441e-822f-5451d5c595b8) +] +coclass AudioReverb25 { + interface IUnknown; +} + +[ + uuid(cecec95a-d894-491a-bee3-5e106fb59f2d) +] +coclass AudioReverb26 { + interface IUnknown; +} diff -Nru wine1.7-1.7.50/include/xaudio2.idl wine1.7-1.7.55/include/xaudio2.idl --- wine1.7-1.7.50/include/xaudio2.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/xaudio2.idl 2015-11-13 14:32:40.000000000 +0000 @@ -21,6 +21,8 @@ import "audiosessiontypes.h"; +cpp_quote("#include ") + [ uuid(5a508685-a254-4fba-9b82-9a24b00306af) ] @@ -29,6 +31,55 @@ } [ + uuid(fac23f48-31f5-45a8-b49b-5225d61401aa) +] +coclass XAudio20 { + interface IUnknown; +} + +[ + uuid(e21a7345-eb21-468e-be50-804db97cf708) +] +coclass XAudio21 { + interface IUnknown; +} + +[ + uuid(b802058a-464a-42db-bc10-b650d6f2586a) +] +coclass XAudio22 { + interface IUnknown; +} + +[ + uuid(4c5e637a-16c7-4de3-9c46-5ed22181962d) +] +coclass XAudio23 { + interface IUnknown; +} + +[ + uuid(03219e78-5bc3-44d1-b92e-f63d89cc6526) +] +coclass XAudio24 { + interface IUnknown; +} + +[ + uuid(4c9b6dde-6809-46e6-a278-9b6a97588670) +] +coclass XAudio25 { + interface IUnknown; +} + +[ + uuid(3eda9b49-2085-498b-9bb2-39a6778493de) +] +coclass XAudio26 { + interface IUnknown; +} + +[ uuid(db05ea35-0329-4d4b-a53a-6dead03d3852) ] coclass XAudio2Debug { @@ -119,6 +170,40 @@ UINT32 ActiveXmaStreams; } XAUDIO2_PERFORMANCE_DATA; +typedef struct XAUDIO22_PERFORMANCE_DATA +{ + UINT64 AudioCyclesSinceLastQuery; + UINT64 TotalCyclesSinceLastQuery; + UINT32 MinimumCyclesPerQuantum; + UINT32 MaximumCyclesPerQuantum; + UINT32 MemoryUsageInBytes; + UINT32 CurrentLatencyInSamples; + UINT32 GlitchesSinceEngineStarted; + UINT32 ActiveSourceVoiceCount; + UINT32 TotalSourceVoiceCount; + UINT32 ActiveSubmixVoiceCount; + UINT32 TotalSubmixVoiceCount; + UINT32 ActiveXmaSourceVoices; + UINT32 ActiveXmaStreams; +} XAUDIO22_PERFORMANCE_DATA; + +typedef struct XAUDIO20_PERFORMANCE_DATA +{ + UINT64 AudioCyclesSinceLastQuery; + UINT64 TotalCyclesSinceLastQuery; + UINT32 MinimumCyclesPerQuantum; + UINT32 MaximumCyclesPerQuantum; + UINT32 MemoryUsageInBytes; + UINT32 CurrentLatencyInSamples; + UINT32 GlitchesSinceLastQuery; + UINT32 ActiveSourceVoiceCount; + UINT32 TotalSourceVoiceCount; + UINT32 ActiveSubmixVoiceCount; + UINT32 TotalSubmixVoiceCount; + UINT32 ActiveXmaSourceVoices; + UINT32 ActiveXmaStreams; +} XAUDIO20_PERFORMANCE_DATA; + typedef enum XAUDIO2_DEVICE_ROLE { NotDefaultDevice = 0x0, @@ -151,6 +236,13 @@ IXAudio2Voice* pOutputVoice; } XAUDIO2_SEND_DESCRIPTOR; +/* XAudio2 2.3's XAUDIO2_VOICE_SENDS struct */ +typedef struct XAUDIO23_VOICE_SENDS +{ + UINT32 OutputCount; + IXAudio2Voice **pOutputVoices; +} XAUDIO23_VOICE_SENDS; + typedef struct XAUDIO2_VOICE_SENDS { UINT32 SendCount; @@ -183,12 +275,14 @@ const float XAUDIO2_MAX_FILTER_ONEOVERQ = 1.5; const float XAUDIO2_MAX_FILTER_FREQUENCY = 1.0; const UINT32 XAUDIO2_MAX_LOOP_COUNT = 254; +const UINT32 XAUDIO20_MAX_LOOP_COUNT = 0x100000; /* xaudio 2.0 */ const UINT32 XAUDIO2_COMMIT_NOW = 0; const UINT32 XAUDIO2_COMMIT_ALL = 0; const UINT32 XAUDIO2_INVALID_OPSET = 0xffffffff; const UINT32 XAUDIO2_NO_LOOP_REGION = 0; const UINT32 XAUDIO2_LOOP_INFINITE = 255; +const UINT32 XAUDIO20_LOOP_INFINITE = ((UINT)-1); /* xaudio 2.0 */ const UINT32 XAUDIO2_DEFAULT_CHANNELS = 0; const UINT32 XAUDIO2_DEFAULT_SAMPLERATE = 0; @@ -220,6 +314,156 @@ float OneOverQ; } XAUDIO2_FILTER_PARAMETERS; +/* XAudio 2.0's IXAudio2Voice */ +/* XAudio2 2.0's IXAudio2Voice interface. Actually called + * IXAudio2Voice in the Mar 2008 DX SDK */ +[ + object, + local +] +interface IXAudio20Voice +{ + void GetVoiceDetails([out] XAUDIO2_VOICE_DETAILS* pVoiceDetails); + + HRESULT SetOutputVoices([in] const XAUDIO23_VOICE_SENDS* pSendList); + + HRESULT SetEffectChain([in] const XAUDIO2_EFFECT_CHAIN* pEffectChain); + + HRESULT EnableEffect( + [in] UINT32 EffectIndex, + [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + HRESULT DisableEffect( + [in] UINT32 EffectIndex, + [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + void GetEffectState( + [in] UINT32 EffectIndex, + [out] BOOL* pEnabled); + + HRESULT SetEffectParameters( + [in] UINT32 EffectIndex, + [in] const void* pParameters, + [in] UINT32 ParametersByteSize, + [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + HRESULT GetEffectParameters( + [in] UINT32 EffectIndex, + [out] void* pParameters, + [in] UINT32 ParametersByteSize); + + HRESULT SetFilterParameters( + [in] const XAUDIO2_FILTER_PARAMETERS* pParameters, + [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + void GetFilterParameters([out] XAUDIO2_FILTER_PARAMETERS* pParameters); + + HRESULT SetVolume( + [in] float Volume, + [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + void GetVolume([out] float* pVolume); + + HRESULT SetChannelVolumes( + [in] UINT32 Channels, + [in, size_is(Channels)] const float* pVolumes, + [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + void GetChannelVolumes( + [in] UINT32 Channels, + [out, size_is(Channels)] float* pVolumes); + + HRESULT SetOutputMatrix( + [in] IXAudio2Voice* pDestinationVoice, + [in] UINT32 SourceChannels, + [in] UINT32 DestinationChannels, + [in, size_is(SourceChannels * DestinationChannels)] const float* pLevelMatrix, + [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + HRESULT GetOutputMatrix( + [in] IXAudio2Voice* pDestinationVoice, + [in] UINT32 SourceChannels, + [in] UINT32 DestinationChannels, + [out, size_is(SourceChannels * DestinationChannels)] float* pLevelMatrix); + + void DestroyVoice(); +} + +/* XAudio 2.3's IXAudio2Voice */ +/* XAudio2 2.3's IXAudio2Voice interface. Actually called + * IXAudio2Voice in the Nov 2008 DX SDK */ +[ + object, + local +] +interface IXAudio23Voice +{ + void GetVoiceDetails([out] XAUDIO2_VOICE_DETAILS* pVoiceDetails); + + HRESULT SetOutputVoices([in] const XAUDIO23_VOICE_SENDS* pSendList); + + HRESULT SetEffectChain([in] const XAUDIO2_EFFECT_CHAIN* pEffectChain); + + HRESULT EnableEffect( + [in] UINT32 EffectIndex, + [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + HRESULT DisableEffect( + [in] UINT32 EffectIndex, + [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + void GetEffectState( + [in] UINT32 EffectIndex, + [out] BOOL* pEnabled); + + HRESULT SetEffectParameters( + [in] UINT32 EffectIndex, + [in] const void* pParameters, + [in] UINT32 ParametersByteSize, + [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + HRESULT GetEffectParameters( + [in] UINT32 EffectIndex, + [out] void* pParameters, + [in] UINT32 ParametersByteSize); + + HRESULT SetFilterParameters( + [in] const XAUDIO2_FILTER_PARAMETERS* pParameters, + [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + void GetFilterParameters([out] XAUDIO2_FILTER_PARAMETERS* pParameters); + + HRESULT SetVolume( + [in] float Volume, + [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + void GetVolume([out] float* pVolume); + + HRESULT SetChannelVolumes( + [in] UINT32 Channels, + [in, size_is(Channels)] const float* pVolumes, + [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + void GetChannelVolumes( + [in] UINT32 Channels, + [out, size_is(Channels)] float* pVolumes); + + HRESULT SetOutputMatrix( + [in] IXAudio2Voice* pDestinationVoice, + [in] UINT32 SourceChannels, + [in] UINT32 DestinationChannels, + [in, size_is(SourceChannels * DestinationChannels)] const float* pLevelMatrix, + [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + void GetOutputMatrix( + [in] IXAudio2Voice* pDestinationVoice, + [in] UINT32 SourceChannels, + [in] UINT32 DestinationChannels, + [out, size_is(SourceChannels * DestinationChannels)] float* pLevelMatrix); + + void DestroyVoice(); +} + [ object, local @@ -330,6 +574,74 @@ [ local ] +/* XAudio2 2.0's IXAudio2SourceVoice interface. Actually called + * IXAudio2SourceVoice in the Mar 2008 DX SDK */ +interface IXAudio20SourceVoice : IXAudio20Voice +{ + HRESULT Start( + [in, defaultvalue(0)] UINT32 Flags, + [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + HRESULT Stop( + [in, defaultvalue(0)] UINT32 Flags, + [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + HRESULT SubmitSourceBuffer( + [in] const XAUDIO2_BUFFER* pBuffer, + [in, defaultvalue(NULL)] const XAUDIO2_BUFFER_WMA* pBufferWMA); + + HRESULT FlushSourceBuffers(); + + HRESULT Discontinuity(); + + HRESULT ExitLoop([in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + void GetState([out] XAUDIO2_VOICE_STATE* pVoiceState); + + HRESULT SetFrequencyRatio( + [in] float Ratio, + [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + void GetFrequencyRatio([out] float* pRatio); +} + +[ + local +] +/* XAudio2 2.3's IXAudio2SourceVoice interface. Actually called + * IXAudio2SourceVoice in the Nov 2008 DX SDK */ +interface IXAudio23SourceVoice : IXAudio23Voice +{ + HRESULT Start( + [in, defaultvalue(0)] UINT32 Flags, + [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + HRESULT Stop( + [in, defaultvalue(0)] UINT32 Flags, + [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + HRESULT SubmitSourceBuffer( + [in] const XAUDIO2_BUFFER* pBuffer, + [in, defaultvalue(NULL)] const XAUDIO2_BUFFER_WMA* pBufferWMA); + + HRESULT FlushSourceBuffers(); + + HRESULT Discontinuity(); + + HRESULT ExitLoop([in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + void GetState([out] XAUDIO2_VOICE_STATE* pVoiceState); + + HRESULT SetFrequencyRatio( + [in] float Ratio, + [in, defaultvalue(XAUDIO2_COMMIT_NOW)] UINT32 OperationSet); + + void GetFrequencyRatio([out] float* pRatio); +} + +[ + local +] /* XAudio2 2.7's IXAudio2SourceVoice interface. Actually called * IXAudio2SourceVoice in the Jun 2010 DX SDK */ interface IXAudio27SourceVoice : IXAudio2Voice @@ -401,6 +713,24 @@ [ local ] +/* XAudio2 2.0's IXAudio2SubmixVoice interface. Actually called + * IXAudio2SubmixVoice in the Mar 2008 DX SDK */ +interface IXAudio20SubmixVoice : IXAudio20Voice +{ +} + +[ + local +] +/* XAudio2 2.3's IXAudio2SubmixVoice interface. Actually called + * IXAudio2SubmixVoice in the Nov 2008 DX SDK */ +interface IXAudio23SubmixVoice : IXAudio23Voice +{ +} + +[ + local +] interface IXAudio2SubmixVoice : IXAudio2Voice { } @@ -408,6 +738,24 @@ [ local ] +/* XAudio2 2.0's IXAudio2MasteringVoice interface. Actually called + * IXAudio2MasteringVoice in the Mar 2008 DX SDK */ +interface IXAudio20MasteringVoice : IXAudio20Voice +{ +} + +[ + local +] +/* XAudio2 2.3's IXAudio2MasteringVoice interface. Actually called + * IXAudio2MasteringVoice in the Nov 2008 DX SDK */ +interface IXAudio23MasteringVoice : IXAudio23Voice +{ +} + +[ + local +] interface IXAudio2MasteringVoice : IXAudio2Voice { /* not present in XAudio2 2.7 */ @@ -418,6 +766,29 @@ object, local ] +interface IXAudio20VoiceCallback +{ + void OnVoiceProcessingPassStart(); + + void OnVoiceProcessingPassEnd(); + + void OnStreamEnd(); + + void OnBufferStart([in] void* pBufferContext); + + void OnBufferEnd([in] void* pBufferContext); + + void OnLoopEnd([in] void* pBufferContext); + + void OnVoiceError( + [in] void* pBuffercontext, + [in] HRESULT Error); +} + +[ + object, + local +] interface IXAudio2VoiceCallback { void OnVoiceProcessingPassStart([in] UINT32 BytesRequired); @@ -449,6 +820,128 @@ [ object, + uuid(8bcf1f58-9fe7-4583-8ac6-e2adc465c8bb), /* all versions before 28 share IID_IXAudio */ +] +/* XAudio2 2.0's IXAudio2 interface. Actually called IXAudio2 in the Mar 2008 + * DX SDK */ +interface IXAudio20 : IUnknown +{ + HRESULT GetDeviceCount([out] UINT32* pCount); + + HRESULT GetDeviceDetails( + [in] UINT32 Index, + [out] XAUDIO2_DEVICE_DETAILS* pDeviceDetails); + + HRESULT Initialize( + [in, defaultvalue(0)] UINT32 Flags, + [in, defaultvalue(XAUDIO2_DEFAULT_PROCESSOR)] XAUDIO2_PROCESSOR XAudio2Processor); + + HRESULT RegisterForCallbacks([in] IXAudio2EngineCallback* pCallback); + + void UnregisterForCallbacks([in] IXAudio2EngineCallback* pCallback); + + HRESULT CreateSourceVoice( + [out] IXAudio2SourceVoice** ppSourceVoice, + [in] const WAVEFORMATEX* pSourceFormat, + [in, defaultvalue(0)] UINT32 Flags, + [in, defaultvalue(XAUDIO2_DEFAULT_FREQ_RATIO)] float MaxFrequencyRatio, + [in, defaultvalue(NULL)] IXAudio2VoiceCallback* pCallback, + [in, defaultvalue(NULL)] const XAUDIO2_VOICE_SENDS* pSendList, + [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain); + + HRESULT CreateSubmixVoice( + [out] IXAudio2SubmixVoice** ppSubmixVoice, + [in] UINT32 InputChannels, + [in] UINT32 InputSampleRate, + [in, defaultvalue(0)] UINT32 Flags, + [in, defaultvalue(0)] UINT32 ProcessingStage, + [in, defaultvalue(NULL)] const XAUDIO2_VOICE_SENDS* pSendList, + [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain); + + HRESULT CreateMasteringVoice( + [out] IXAudio2MasteringVoice** ppMasteringVoice, + [in, defaultvalue(XAUDIO2_DEFAULT_CHANNELS)] UINT32 InputChannels, + [in, defaultvalue(XAUDIO2_DEFAULT_SAMPLERATE)] UINT32 InputSampleRate, + [in, defaultvalue(0)] UINT32 Flags, + [in, defaultvalue(0)] UINT32 DeviceIndex, + [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain); + + HRESULT StartEngine(); + + void StopEngine(); + + HRESULT CommitChanges([in] UINT32 OperationSet); + + void GetPerformanceData([out] XAUDIO20_PERFORMANCE_DATA* pPerfData); + + [local] void SetDebugConfiguration( + [in] const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration, + [in, defaultvalue(NULL)] void* pReserved); +} + +[ + object, + uuid(8bcf1f58-9fe7-4583-8ac6-e2adc465c8bb), /* all versions before 28 share IID_IXAudio */ +] +/* XAudio2 2.2's IXAudio2 interface. Actually called IXAudio2 in the Jun 2010 + * DX SDK */ +interface IXAudio22 : IUnknown +{ + HRESULT GetDeviceCount([out] UINT32* pCount); + + HRESULT GetDeviceDetails( + [in] UINT32 Index, + [out] XAUDIO2_DEVICE_DETAILS* pDeviceDetails); + + HRESULT Initialize( + [in, defaultvalue(0)] UINT32 Flags, + [in, defaultvalue(XAUDIO2_DEFAULT_PROCESSOR)] XAUDIO2_PROCESSOR XAudio2Processor); + + HRESULT RegisterForCallbacks([in] IXAudio2EngineCallback* pCallback); + + void UnregisterForCallbacks([in] IXAudio2EngineCallback* pCallback); + + HRESULT CreateSourceVoice( + [out] IXAudio2SourceVoice** ppSourceVoice, + [in] const WAVEFORMATEX* pSourceFormat, + [in, defaultvalue(0)] UINT32 Flags, + [in, defaultvalue(XAUDIO2_DEFAULT_FREQ_RATIO)] float MaxFrequencyRatio, + [in, defaultvalue(NULL)] IXAudio2VoiceCallback* pCallback, + [in, defaultvalue(NULL)] const XAUDIO2_VOICE_SENDS* pSendList, + [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain); + + HRESULT CreateSubmixVoice( + [out] IXAudio2SubmixVoice** ppSubmixVoice, + [in] UINT32 InputChannels, + [in] UINT32 InputSampleRate, + [in, defaultvalue(0)] UINT32 Flags, + [in, defaultvalue(0)] UINT32 ProcessingStage, + [in, defaultvalue(NULL)] const XAUDIO2_VOICE_SENDS* pSendList, + [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain); + + HRESULT CreateMasteringVoice( + [out] IXAudio2MasteringVoice** ppMasteringVoice, + [in, defaultvalue(XAUDIO2_DEFAULT_CHANNELS)] UINT32 InputChannels, + [in, defaultvalue(XAUDIO2_DEFAULT_SAMPLERATE)] UINT32 InputSampleRate, + [in, defaultvalue(0)] UINT32 Flags, + [in, defaultvalue(0)] UINT32 DeviceIndex, + [in, defaultvalue(NULL)] const XAUDIO2_EFFECT_CHAIN* pEffectChain); + + HRESULT StartEngine(); + + void StopEngine(); + + HRESULT CommitChanges([in] UINT32 OperationSet); + + void GetPerformanceData([out] XAUDIO22_PERFORMANCE_DATA* pPerfData); + + [local] void SetDebugConfiguration( + [in] const XAUDIO2_DEBUG_CONFIGURATION* pDebugConfiguration, + [in, defaultvalue(NULL)] void* pReserved); +} + +[ + object, uuid(8bcf1f58-9fe7-4583-8ac6-e2adc465c8bb), ] /* XAudio2 2.7's IXAudio2 interface. Actually called IXAudio2 in the Jun 2010 @@ -567,6 +1060,7 @@ const UINT32 XAUDIO2_PLAY_TAILS = 32; const UINT32 XAUDIO2_END_OF_STREAM = 64; const UINT32 XAUDIO2_SEND_USEFILTER = 128; +const UINT32 XAUDIO2_VOICE_NOSAMPLESPLAYED = 256; const XAUDIO2_FILTER_TYPE XAUDIO2_DEFAULT_FILTER_TYPE = LowPassFilter; const float XAUDIO2_DEFAULT_FILTER_FREQUENCY = XAUDIO2_MAX_FILTER_FREQUENCY; @@ -580,6 +1074,11 @@ const HRESULT XAUDIO2_E_XAPO_CREATION_FAILED = 0x88960003; const HRESULT XAUDIO2_E_DEVICE_INVALIDATED = 0x88960004; +/* xaudio 2.0 error codes */ +const HRESULT XAUDIO20_E_XMA_DECODER_ERROR = 0x88960001; +const HRESULT XAUDIO20_E_XAPO_CREATION_FAILED = 0x88960002; +const HRESULT XAUDIO20_E_DEVICE_INVALIDATED = 0x88960003; + cpp_quote("#ifdef XAUDIO2_HELPER_FUNCTIONS") cpp_quote("#define _USE_MATH_DEFINES") cpp_quote("#include ") @@ -592,3 +1091,5 @@ cpp_quote("#endif") cpp_quote("HRESULT WINAPI XAudio2Create(IXAudio2** pxaudio2, UINT32 flags, XAUDIO2_PROCESSOR processor);") + +cpp_quote("#include ") diff -Nru wine1.7-1.7.50/include/xmldom.idl wine1.7-1.7.55/include/xmldom.idl --- wine1.7-1.7.50/include/xmldom.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/xmldom.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + #include #include diff -Nru wine1.7-1.7.50/include/xmldso.idl wine1.7-1.7.55/include/xmldso.idl --- wine1.7-1.7.50/include/xmldso.idl 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/include/xmldso.idl 2015-11-13 14:32:40.000000000 +0000 @@ -16,6 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#if 0 +#pragma makedep install +#endif + #include #include diff -Nru wine1.7-1.7.50/libs/wine/casemap.c wine1.7-1.7.55/libs/wine/casemap.c --- wine1.7-1.7.50/libs/wine/casemap.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/libs/wine/casemap.c 2015-11-13 14:32:40.000000000 +0000 @@ -3,15 +3,15 @@ #include "wine/unicode.h" -const WCHAR wine_casemap_lower[3807] = +const WCHAR wine_casemap_lower[4013] = { /* index */ 0x01bf, 0x02bf, 0x03bf, 0x044f, 0x054f, 0x064f, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x06af, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x07af, 0x08ae, - 0x0100, 0x09ab, 0x0100, 0x0100, 0x0a2f, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0b2f, 0x0100, 0x0100, 0x0100, + 0x06af, 0x0100, 0x0100, 0x077d, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x087d, 0x097c, + 0x0100, 0x0a79, 0x0100, 0x0100, 0x0afd, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0bfd, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, @@ -26,7 +26,7 @@ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0c22, 0x0d00, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0cf0, 0x0dce, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, @@ -37,7 +37,7 @@ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0ddf, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0ead, /* defaults */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -260,6 +260,33 @@ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 0x1332 .. 0x13ff */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x97d0, 0x97d0, + 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, + 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, + 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, + 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, + 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, + 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, + 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, + 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, + 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, + 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x97d0, 0x0008, 0x0008, + 0x0008, 0x0008, 0x0008, 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x1e00 .. 0x1eff */ 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, @@ -461,7 +488,7 @@ 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x5abc, 0x5ab1, 0x5ab5, 0x5abf, 0x0000, 0x0000, 0x5aee, 0x5ad6, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x5aeb, 0x03a0, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -501,16 +528,15 @@ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }; -const WCHAR wine_casemap_upper[3994] = +const WCHAR wine_casemap_upper[4433] = { /* index */ 0x019f, 0x029f, 0x039f, 0x045a, 0x0556, 0x0656, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x06dd, 0x07dc, 0x08dc, - 0x0100, 0x09d0, 0x0100, 0x0100, 0x0a55, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0b3f, 0x0c3f, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x06dd, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x07db, 0x08da, 0x09da, + 0x0100, 0x0ace, 0x0100, 0x0100, 0x0b53, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0c3d, 0x0d3d, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, @@ -524,8 +550,9 @@ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0cfe, 0x0ddb, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0dfc, 0x0ed9, + 0x0100, 0x0100, 0x0100, 0x0f91, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, @@ -535,7 +562,7 @@ 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, - 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0e9a, + 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x1051, /* defaults */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -643,7 +670,7 @@ 0xff26, 0x0000, 0x0000, 0xff26, 0x0000, 0x0000, 0x0000, 0xa52a, 0xff26, 0xffbb, 0xff27, 0xff27, 0xffb9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xff25, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xa512, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xa515, 0xa512, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -747,8 +774,7 @@ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /* 0x1d79 .. 0x1dff */ - 0x8a04, 0x0000, 0x0000, 0x0000, 0x0ee6, 0x0000, 0x0000, 0x0000, + /* 0x1379 .. 0x13ff */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -764,7 +790,41 @@ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xfff8, + 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0xfff8, 0x0000, 0x0000, + /* 0x1d02 .. 0x1dff */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8a04, + 0x0000, 0x0000, 0x0000, 0x0ee6, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* 0x1e01 .. 0x1eff */ 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, @@ -989,7 +1049,7 @@ 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -999,11 +1059,35 @@ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - /* 0xff41 .. 0xffff */ - 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, + /* 0xab48 .. 0xabff */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xfc60, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, + 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, + 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, + 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, + 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, + 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, + 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, + 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, + 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, + 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, 0x6830, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + /* 0xff40 .. 0xffff */ + 0x0000, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, 0xffe0, - 0xffe0, 0xffe0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0xffe0, 0xffe0, 0xffe0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -1023,7 +1107,7 @@ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }; const WCHAR wine_digitmap[5933] = { diff -Nru wine1.7-1.7.50/libs/wine/config.c wine1.7-1.7.55/libs/wine/config.c --- wine1.7-1.7.50/libs/wine/config.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/libs/wine/config.c 2015-11-13 14:32:40.000000000 +0000 @@ -249,10 +249,9 @@ } /* retrieve the default dll dir */ -const char *get_dlldir( const char **default_dlldir, const char **dll_prefix ) +const char *get_dlldir( const char **default_dlldir ) { *default_dlldir = DLLDIR; - *dll_prefix = "/" DLLPREFIX; return dlldir; } diff -Nru wine1.7-1.7.50/libs/wine/debug.c wine1.7-1.7.55/libs/wine/debug.c --- wine1.7-1.7.50/libs/wine/debug.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/libs/wine/debug.c 2015-11-13 14:32:40.000000000 +0000 @@ -35,6 +35,7 @@ #if defined(__MINGW32__) || defined(_MSC_VER) WINE_DECLARE_DEBUG_CHANNEL(tid); +WINE_DECLARE_DEBUG_CHANNEL(pid); #endif static const char * const debug_classes[] = { "fixme", "err", "warn", "trace" }; @@ -407,6 +408,8 @@ int ret = 0; #if defined(__MINGW32__) || defined(_MSC_VER) + if (TRACE_ON(pid)) + ret += wine_dbg_printf( "%04x:", GetCurrentProcessId() ); if (TRACE_ON(tid)) ret += wine_dbg_printf( "%04x:", GetCurrentThreadId() ); #endif diff -Nru wine1.7-1.7.50/libs/wine/loader.c wine1.7-1.7.55/libs/wine/loader.c --- wine1.7-1.7.50/libs/wine/loader.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/libs/wine/loader.c 2015-11-13 14:32:40.000000000 +0000 @@ -94,20 +94,19 @@ static const char *build_dir; static const char *default_dlldir; -static const char *dll_prefix; static const char **dll_paths; static unsigned int nb_dll_paths; static int dll_path_maxlen; extern void mmap_init(void); -extern const char *get_dlldir( const char **default_dlldir, const char **dll_prefix ); +extern const char *get_dlldir( const char **default_dlldir ); /* build the dll load path from the WINEDLLPATH variable */ static void build_dll_path(void) { int len, count = 0; char *p, *path = getenv( "WINEDLLPATH" ); - const char *dlldir = get_dlldir( &default_dlldir, &dll_prefix ); + const char *dlldir = get_dlldir( &default_dlldir ); if (path) { @@ -157,7 +156,6 @@ if (len > dll_path_maxlen) dll_path_maxlen = len; dll_paths[nb_dll_paths++] = default_dlldir; } - dll_path_maxlen += strlen( dll_prefix ) - 1; } /* check if the library is the correct architecture */ @@ -244,7 +242,6 @@ default: index -= 2; if (index >= nb_dll_paths) return NULL; - path = prepend( path + 1, dll_prefix, strlen( dll_prefix )); path = prepend( path, dll_paths[index], strlen( dll_paths[index] )); return path; } @@ -851,7 +848,8 @@ { jobject str_obj = (*env)->GetObjectArrayElement( env, cmdline, i ); length = (*env)->GetStringUTFLength( env, str_obj ); - (*env)->GetStringUTFRegion( env, str_obj, 0, length, str ); + (*env)->GetStringUTFRegion( env, str_obj, 0, + (*env)->GetStringLength( env, str_obj ), str ); argv[i] = str; str[length] = 0; str += length + 1; diff -Nru wine1.7-1.7.50/libs/wine/Makefile.in wine1.7-1.7.55/libs/wine/Makefile.in --- wine1.7-1.7.50/libs/wine/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/libs/wine/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -98,19 +98,21 @@ config_EXTRADEFS = \ -DBINDIR='"${bindir}"' \ -DDLLDIR='"${dlldir}"' \ - -DDLLPREFIX='"$(DLLPREFIX)"' \ -DLIB_TO_BINDIR=\"`$(MAKEDEP) -R ${libdir} ${bindir}`\" \ -DLIB_TO_DLLDIR=\"`$(MAKEDEP) -R ${libdir} ${dlldir}`\" \ -DBIN_TO_DLLDIR=\"`$(MAKEDEP) -R ${bindir} ${dlldir}`\" \ -DBIN_TO_DATADIR=\"`$(MAKEDEP) -R ${bindir} ${datadir}/wine`\" -version.c: dummy - version=`(GIT_DIR=$(top_srcdir)/.git git describe HEAD 2>/dev/null || echo "wine-@PACKAGE_VERSION@") | sed -n -e '$$s/\(.*\)/const char wine_build[] = "\1";/p'` && (echo $$version | cmp -s - $@) || echo $$version >$@ || ($(RM) $@ && exit 1) +SHAREDLIB = $(LIBWINE_SHAREDLIB) +IMPORTLIB = $(LIBWINE_IMPORTLIB) +INSTALL_LIB = $(LIBWINE_INSTALL_LIB) +INSTALL_DEV = $(LIBWINE_INSTALL_DEV) + +libwine_LDFLAGS = $(LIBWINE_LDFLAGS) +libwine_DEPS = $(LIBWINE_DEPENDS) -# Make sure that make_makefiles sees the generated rules -.PHONY: install install-lib install-dev uninstall -install install-lib:: -install install-dev:: -clean:: +version.c: dummy + version=`(GIT_DIR=$(top_srcdir)/.git git describe HEAD 2>/dev/null || echo "wine-$(PACKAGE_VERSION)") | sed -n -e '$$s/\(.*\)/const char wine_build[] = "\1";/p'` && (echo $$version | cmp -s - $@) || echo $$version >$@ || ($(RM) $@ && exit 1) -@LIBWINE_RULES@ +dummy: +.PHONY: dummy diff -Nru wine1.7-1.7.50/libs/wine/wctomb.c wine1.7-1.7.55/libs/wine/wctomb.c --- wine1.7-1.7.50/libs/wine/wctomb.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/libs/wine/wctomb.c 2015-11-13 14:32:40.000000000 +0000 @@ -275,6 +275,14 @@ return 1; } +/* compute the default char for the dbcs case */ +static inline WCHAR get_defchar_dbcs( const struct dbcs_table *table, const char *defchar ) +{ + if (!defchar) return table->info.def_char; + if (!defchar[1]) return (unsigned char)defchar[0]; + return ((unsigned char)defchar[0] << 8) | (unsigned char)defchar[1]; +} + /* query necessary dst length for src string */ static int get_length_dbcs( const struct dbcs_table *table, int flags, const WCHAR *src, unsigned int srclen, @@ -282,8 +290,7 @@ { const unsigned short * const uni2cp_low = table->uni2cp_low; const unsigned short * const uni2cp_high = table->uni2cp_high; - WCHAR defchar_value = table->info.def_char; - WCHAR composed; + WCHAR defchar_value, composed; int len, tmp; if (!defchar && !used && !(flags & WC_COMPOSITECHECK)) @@ -295,7 +302,7 @@ return len; } - if (defchar) defchar_value = defchar[1] ? ((defchar[0] << 8) | defchar[1]) : defchar[0]; + defchar_value = get_defchar_dbcs( table, defchar ); if (!used) used = &tmp; /* avoid checking on every char */ *used = 0; for (len = 0; srclen; len++, srclen--, src++) @@ -376,11 +383,10 @@ { const unsigned short * const uni2cp_low = table->uni2cp_low; const unsigned short * const uni2cp_high = table->uni2cp_high; - WCHAR defchar_value = table->info.def_char; + WCHAR defchar_value = get_defchar_dbcs( table, defchar ); WCHAR composed; int len, tmp; - if (defchar) defchar_value = defchar[1] ? ((defchar[0] << 8) | defchar[1]) : defchar[0]; if (!used) used = &tmp; /* avoid checking on every char */ *used = 0; diff -Nru wine1.7-1.7.50/libs/wine/wctype.c wine1.7-1.7.55/libs/wine/wctype.c --- wine1.7-1.7.50/libs/wine/wctype.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/libs/wine/wctype.c 2015-11-13 14:32:40.000000000 +0000 @@ -317,13 +317,13 @@ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, - 0xc300, 0xc300, 0xc300, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0xd200, 0xd200, 0xd200, 0xd200, + 0x0000, 0x0000, 0x0000, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, @@ -390,7 +390,7 @@ 0x1300, 0x1300, 0xd200, 0xd200, 0x0000, 0x0000, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1210, 0x5200, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x1300, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xd200, 0x1200, 0x1200, 0x0000, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x0000, 0x0000, 0x1300, 0x1300, 0x0000, 0x0000, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, @@ -434,7 +434,7 @@ 0xd200, 0x1200, 0x1200, 0x1200, 0x1200, 0x0000, 0xd200, 0xd200, 0xd200, 0x0000, 0xd200, 0xd200, 0xd200, 0xd200, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xd200, 0xd200, 0x0000, - 0x1300, 0x1300, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1300, 0x1300, 0x1300, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1300, 0x1300, 0xd200, 0xd200, 0x0000, 0x0000, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -466,7 +466,7 @@ 0x1200, 0xd200, 0xd200, 0xd200, 0xd200, 0x0000, 0x1200, 0x1200, 0x1200, 0x0000, 0x1200, 0x1200, 0x1200, 0xd200, 0x1300, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1200, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1300, 0x1300, 0x1300, 0xd200, 0xd200, 0x0000, 0x0000, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x0000, 0x0000, @@ -667,18 +667,18 @@ 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, + 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, + 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, + 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, + 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, + 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, + 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, + 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, + 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, + 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, + 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x0000, 0x0000, + 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x0000, 0x0000, 0xb210, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, @@ -829,10 +829,10 @@ 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, - 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, 0x1200, - 0x1200, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1200, 0x1200, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, + 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, + 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, + 0x1300, 0x1300, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1200, 0x0000, 0x0000, 0x0000, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, @@ -1054,7 +1054,7 @@ 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, - 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x0000, 0x0000, + 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x5200, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, @@ -1080,7 +1080,7 @@ 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1301, 0x1302, 0x1300, 0x1300, 0x1300, - 0x1300, 0xb200, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1300, 0xb200, 0xb200, 0xb200, 0x0000, 0x0000, 0x0000, 0x0000, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, @@ -1380,7 +1380,7 @@ 0xb200, 0xb200, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0xb200, 0xb200, 0xb200, 0xb200, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, @@ -1696,8 +1696,8 @@ 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, + 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -1754,7 +1754,7 @@ 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, - 0x1301, 0x1302, 0x1301, 0x1302, 0x1300, 0x1300, 0x0000, 0xd200, + 0x1301, 0x1302, 0x1301, 0x1302, 0x1300, 0x1300, 0xd200, 0xd200, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, @@ -1784,12 +1784,12 @@ 0x1300, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, - 0xb300, 0x1200, 0x1200, 0x1301, 0x1302, 0x1301, 0x1302, 0x0000, + 0xb300, 0x1200, 0x1200, 0x1301, 0x1302, 0x1301, 0x1302, 0x1300, 0x1301, 0x1302, 0x1301, 0x1302, 0x1302, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1302, 0x1301, 0x1301, 0x1301, 0x1301, 0x0000, 0x0000, - 0x1301, 0x1301, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1301, 0x1301, 0x1301, 0x1301, 0x1301, 0x1302, 0x1301, 0x1302, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -1830,7 +1830,7 @@ 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, - 0x1210, 0x1210, 0x1210, 0x1300, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1210, 0x1210, 0x1210, 0x1300, 0x1210, 0x1300, 0x0000, 0x0000, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, @@ -1907,18 +1907,18 @@ 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1200, 0x1300, 0x1300, 0x1300, 0x1300, - 0x0000, 0x0000, 0x0000, 0x0000, 0x1302, 0x1302, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, + 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, + 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, + 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, + 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, + 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, + 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, + 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, + 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, + 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1302, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, @@ -2092,7 +2092,7 @@ 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, - 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0x0000, 0x0000, + 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, Binary files /tmp/lGkLrqMI3A/wine1.7-1.7.50/loader/l_intl.nls and /tmp/i40nZWR050/wine1.7-1.7.55/loader/l_intl.nls differ diff -Nru wine1.7-1.7.50/loader/Makefile.in wine1.7-1.7.55/loader/Makefile.in --- wine1.7-1.7.50/loader/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/loader/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -1,5 +1,3 @@ -EXTRALIBS = $(PTHREAD_LIBS) - C_SRCS = \ main.c \ preloader.c @@ -14,9 +12,21 @@ wine.inf.in \ wine_info.plist.in -@LOADER_RULES@ +PROGRAMS = $(WINELOADER_PROGRAMS) +INSTALL_LIB = $(WINELOADER_PROGRAMS) $(WINELOADER_INSTALL) + +preloader_EXTRADEFS = $(MSVCRTFLAGS) + +wine_OBJS = main.o +wine_DEPS = $(WINELOADER_DEPENDS) +wine_LDFLAGS = $(LDEXECFLAGS) -lwine $(PTHREAD_LIBS) + +wine64_OBJS = main.o +wine64_DEPS = $(WINELOADER_DEPENDS) +wine64_LDFLAGS = $(LDEXECFLAGS) -lwine $(PTHREAD_LIBS) + +wine_preloader_OBJS = preloader.o +wine_preloader_LDFLAGS = -static -nostartfiles -nodefaultlibs -Wl,-Ttext=0x7c400000 -# Make sure that make_makefiles sees the generated rules -.PHONY: install install-lib uninstall -install install-lib:: -clean:: +wine64_preloader_OBJS = preloader.o +wine64_preloader_LDFLAGS = -static -nostartfiles -nodefaultlibs -Wl,-Ttext=0x7c400000 diff -Nru wine1.7-1.7.50/loader/wine.desktop wine1.7-1.7.55/loader/wine.desktop --- wine1.7-1.7.50/loader/wine.desktop 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/loader/wine.desktop 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,31 @@ +[Desktop Entry] +Type=Application +Name=Wine Windows Program Loader +Name[ar]=منظومة واين لتشغيل برامج وندوز +Name[cs]=Zavaděč programů pro Wine +Name[de]=Wine Windows-Programmstarter +Name[es]=Wine Cargador de programas de Windows +Name[lt]=Wine Windows programų paleidyklė +Name[nl]=Wine Windows programmalader +Name[sv]=Wine Windows Programstartare +Name[ro]=Wine - Încărcătorul de programe Windows +Name[ru]=Wine - загрузчик Windows программ +Name[uk]=Wine - завантажувач Windows програм +Name[fr]=Wine - Chargeur de programmes Windows +Name[ca]=Wine - Carregador d'aplicacions del Windows +Name[pt]=Carregador de aplicativos Windows Wine +Name[pt_br]=Carregador de aplicativos Windows Wine +Name[it]=Wine Carica Programmi Windows +Name[da]=Wine, Programstarter til Windows-programmer +Name[nb]=Wine - for kjøring av Windows-programmer +Name[nn]=Wine - for køyring av Windows-program +Name[sr]=Wine - дизач Windows програма +Name[sr@latin]=Wine - dizač Windows programa +Name[hr]=Wine - dizač Windows programa +Name[he]=Wine — מריץ תכניות Windows +Name[ja]=Wine Windowsプログラムローダー +Exec=wine start /unix %f +MimeType=application/x-ms-dos-executable;application/x-msi;application/x-ms-shortcut; +Icon=wine +NoDisplay=true +StartupNotify=true diff -Nru wine1.7-1.7.50/loader/wine.de.UTF-8.man.in wine1.7-1.7.55/loader/wine.de.UTF-8.man.in --- wine1.7-1.7.50/loader/wine.de.UTF-8.man.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/loader/wine.de.UTF-8.man.in 2015-11-13 14:32:40.000000000 +0000 @@ -97,7 +97,7 @@ .B wine -Anwendung an, die genutzt wird, um Windows-Programme zu laden. Wenn diese Variable nicht gesetzt ist, wird versucht, -.B @bindir@/wineserver +.B @bindir@/wine zu laden. Wenn auch dies nicht funktioniert, wird in $PATH und anderen Orten nach wine gesucht. .TP diff -Nru wine1.7-1.7.50/loader/wine.inf.in wine1.7-1.7.55/loader/wine.inf.in --- wine1.7-1.7.50/loader/wine.inf.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/loader/wine.inf.in 2015-11-13 14:32:40.000000000 +0000 @@ -449,6 +449,7 @@ HKLM,System\CurrentControlSet\Control\Class\{745a17a0-74d3-11d0-b6fe-00a0c90f57da},"Class",,"HIDClass" [CurrentVersion] +HKCU,%CurrentVersion%\Run,,16 HKLM,%CurrentVersion%,"CommonFilesDir",,"%16427%" HKLM,%CurrentVersion%,"FirstInstallDateTime",1,21,81,7c,23 HKLM,%CurrentVersion%,"ProductId",,"12345-oem-0000001-54321" @@ -468,12 +469,12 @@ HKLM,%CurrentVersion%\Installer,"InstallerLocation",,"%11%" HKLM,%CurrentVersion%\Policies\System,"EnableLUA",0x10003,0 HKLM,%CurrentVersion%\PreviewHandlers,,16 +HKLM,%CurrentVersion%\Run,,16 HKLM,%CurrentVersion%\Setup,"BootDir",,"%30%" HKLM,%CurrentVersion%\Setup,"SharedDir",,"%25%" HKLM,%CurrentVersion%\Shell Extensions\Approved,,16 HKLM,%CurrentVersion%\Uninstall,,16 -HKCU,%CurrentVersion%\Run,,16 -HKLM,%CurrentVersion%\Run,,16 +HKLM,%CurrentVersion%\Winlogon,,16 HKLM,%CurrentVersionNT%,"InstallDate",0x10003,1273299354 HKLM,%CurrentVersionNT%,"ProductId",,"12345-oem-0000001-54321" HKLM,%CurrentVersionNT%,"RegisteredOrganization",2,"" @@ -634,6 +635,7 @@ HKLM,Software\Microsoft\Driver Signing,,16 HKLM,Software\Microsoft\EnterpriseCertificates,,16 HKLM,Software\Microsoft\EventSystem,,16 +HKLM,Software\Microsoft\MediaPlayer\PlayerUpgrade,"PlayerVersion",2,"12,0,7601,18840" HKLM,Software\Microsoft\MSMQ,,16 HKLM,Software\Microsoft\Non-Driver Signing,,16 HKLM,Software\Microsoft\Notepad\DefaultFonts,,16 @@ -654,10 +656,12 @@ HKLM,Software\Registered Applications,,16 HKLM,System\CurrentControlSet\Control\Lsa,,16 HKLM,System\CurrentControlSet\Control\SecurityProviders\Schannel\Protocols\SSL 2.0\Client,"DisabledByDefault",0x10003,1 +HKLM,System\CurrentControlSet\Control\ServiceGroupOrder,"List",0x00010000,"TDI" HKLM,System\CurrentControlSet\Control\TimeZoneInformation,"StandardName",2,"" HKLM,System\CurrentControlSet\Control\TimeZoneInformation,"TimeZoneKeyName",2,"" HKLM,System\CurrentControlSet\Control\VirtualDeviceDrivers,,16 HKLM,System\CurrentControlSet\Control\VMM32Files,,16 +HKLM,System\Select,"Current",0x10003,1 HKCU,AppEvents\Schemes\Apps\Explorer\Navigating\.Current,,,"" HKCU,Software\Microsoft\Protected Storage System Provider,,16 ; Some apps requires at least four subkeys of Active Setup\Installed Components @@ -673,6 +677,12 @@ HKLM,SOFTWARE\Microsoft\Active Setup\Installed Components\{de5aed00-a4bf-11d1-9948-00c04f98bbc9},"Locale",2,"*" HKLM,SOFTWARE\Microsoft\Active Setup\Installed Components\{de5aed00-a4bf-11d1-9948-00c04f98bbc9},"Version",2,"4,74,9273,0" +HKLM,SOFTWARE\Microsoft\Active Setup\Installed Components\{6BF52A52-394A-11d3-B153-00C04F79FAA6},,2,"Windows Media Player" +HKLM,SOFTWARE\Microsoft\Active Setup\Installed Components\{6BF52A52-394A-11d3-B153-00C04F79FAA6},"ComponentID",2,"wmp" +HKLM,SOFTWARE\Microsoft\Active Setup\Installed Components\{6BF52A52-394A-11d3-B153-00C04F79FAA6},"IsInstalled",2,1 +HKLM,SOFTWARE\Microsoft\Active Setup\Installed Components\{6BF52A52-394A-11d3-B153-00C04F79FAA6},"Locale",2,"*" +HKLM,SOFTWARE\Microsoft\Active Setup\Installed Components\{6BF52A52-394A-11d3-B153-00C04F79FAA6},"Version",2,"12,0,7601,18840" + [Nls] HKLM,System\CurrentControlSet\Control\Nls\Codepage,"37",,"" HKLM,System\CurrentControlSet\Control\Nls\Language,"0401",,"" @@ -2498,6 +2508,7 @@ 10,syswow64,stdole2.tlb 11,,iexplore.exe 11,,winetest.exe,- +12,,fltmgr.sys,- 12,,mountmgr.sys,- 12,,ndis.sys,- ; skip .NET fake dlls in Wine Mono package @@ -2516,6 +2527,7 @@ 11,,msxml6.dll 11,,shdocvw.dll 16422,Internet Explorer,iexplore.exe +16422,Windows Media Player,wmplayer.exe 11,,* [FakeDlls] @@ -2536,6 +2548,7 @@ 11,,iexplore.exe 11,,notepad.exe 11,,winetest.exe,- +12,,fltmgr.sys 12,,mountmgr.sys 12,,ndis.sys ; skip .NET fake dlls in Wine Mono package @@ -2563,6 +2576,7 @@ 16410,Microsoft, 16412,Microsoft, 16422,Internet Explorer,iexplore.exe +16422,Windows Media Player,wmplayer.exe 16427,System\OLE DB,oledb32.dll 16427,System\OLE DB,msdaps.dll 11,,* @@ -3234,6 +3248,7 @@ [Services] HKLM,%CurrentVersion%\RunServices,"winemenubuilder",2,"%11%\winemenubuilder.exe -a -r" HKLM,"System\CurrentControlSet\Services\Eventlog\Application",,16 +HKLM,"System\CurrentControlSet\Services\RpcSs",,16 HKLM,"System\CurrentControlSet\Services\Tcpip\Parameters",,16 HKLM,"System\CurrentControlSet\Services\VxD\MSTCP",,16 HKLM,"System\CurrentControlSet\Services\Winsock\Parameters",,16 diff -Nru wine1.7-1.7.50/MAINTAINERS wine1.7-1.7.55/MAINTAINERS --- wine1.7-1.7.50/MAINTAINERS 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/MAINTAINERS 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,259 @@ + + + List of Wine subsection maintainers + +When submitting patches to Wine, the guidelines at + should be followed. This file +contains a list of maintainers for subsections of Wine. When submitting +patches, you may want to CC relevant people from this list. If you have +questions about your work in an area of Wine, you may find a list of +knowledgeable people here. + +Many areas of Wine don't have a specific maintainer, although there may +be people with knowledge of those areas. If an area is not listed here +at all, you can use the git log to find developers working in that area +recently. Or, you can send a mail to wine-devel, but be aware that there +may simply be no one knowledgeable about that subject on the list. + +This file uses a similar format to the Linux kernel MAINTAINERS file. +Descriptions of section entries used here: + + M: Primary maintainer. CC patches to: FullName + P: Other knowledgeable person. FullName + F: Files and directories with wildcard patterns. + One pattern per line. Multiple F: lines acceptable. + +Maintainers List + + ----------------------------------- + +Audio I/O +M: Andrew Eikum +F: dlls/dsound/ +F: dlls/dswave/ +F: dlls/mmdevapi/ +F: dlls/winealsa.drv/ +F: dlls/winecoreaudio.drv/ +F: dlls/wineoss.drv/ +F: dlls/winepulse.drv/ +F: dlls/winmm/ +F: dlls/x3daudio*/ +F: dlls/xapofx*/ +F: dlls/xaudio*/ + +ARM, ARM64 +M: André Hentschel +F: dlls/dbghelp/cpu_arm* +F: dlls/msvcrt/except_arm.c +F: dlls/ntdll/signal_arm* +F: programs/winedbg/be_arm* + +Common Controls Library +P: Nikolay Sivov +F: dlls/comctl32/ + +Common Item Dialog +P: Vincent Povirk +F: dlls/comdlg32/itemdlg.c +F: dlls/comdlg32/tests/itemdlg.c + +Direct2D +M: Henri Verbeet +F: dlls/d2d*/ + +Direct3D +M: Henri Verbeet +P: Stefan Dösinger +P: Józef Kucia +P: Matteo Bruni +F: dlls/d3d10*/ +F: dlls/d3d11/ +F: dlls/d3d8/ +F: dlls/d3d9/ +F: dlls/d3drm/ +F: dlls/ddraw*/ +F: dlls/dxgi/ +F: dlls/wined3d/ + +Direct3D helper libraries +M: Matteo Bruni +P: Henri Verbeet +P: Stefan Dösinger +P: Józef Kucia +F: dlls/d3dcompiler*/ +F: dlls/d3dx10*/ +F: dlls/d3dx11*/ +F: dlls/d3dx9*/ + +DirectInput +P: Andrew Eikum +F: dlls/dinput/ + +DirectWrite +M: Nikolay Sivov +F: dlls/dwrite/ + +DotNet Runtime +M: Vincent Povirk +F: dlls/mscoree/ + +GDI +M: Huw Davies +F: dlls/gdi32/ + +GDIPlus +M: Vincent Povirk +F: dlls/gdiplus/ + +HID support +M: Aric Stewart +F: dlls/hid/ +F: dlls/hidclass.sys/ + +HTML rendering (Gecko) +M: Jacek Caban +F: dlls/mshtml/ +F: dlls/ieframe/ +F: dlls/shdocvw/ + +Input methods +M: Aric Stewart +F: dlls/imm32/ + +JavaScript +M: Jacek Caban +F: dlls/jscript/ + +Mac OS X graphics driver +M: Ken Thomases +F: dlls/winemac.drv/ + +Media format conversion +M: Andrew Eikum +F: dlls/msacm32/ +F: dlls/*.acm/ + +Microsoft C Runtime +M: Piotr Caban +F: dlls/msvc*/ + +MSI installers +M: Hans Leidekker +F: dlls/msi/ + +Netstat +M: André Hentschel +F: programs/netstat/ + +OLE Embedding +M: Huw Davies +F: dlls/ole32/clipboard.c +F: dlls/ole32/datacache.c +F: dlls/ole32/defaulthandler.c +F: dlls/ole32/ole2.c +F: dlls/ole32/ole2impl.c +F: dlls/ole32/oleobj.c + +OLE RPC +M: Huw Davies +F: dlls/ole32/compobj.c +F: dlls/ole32/marshal.c +F: dlls/ole32/rpc.c +F: dlls/ole32/stubmanager.c +F: dlls/ole32/usrmarshal.c + +OLE Storage +M: Vincent Povirk +F: dlls/ole32/filelockbytes.c +F: dlls/ole32/memlockbytes.c +F: dlls/ole32/stg_stream.c +F: dlls/ole32/storage32.c +F: dlls/ole32/storage32.h +F: dlls/ole32/tests/storage32.c + +OLE Typelibs +P: Andrew Eikum +P: Huw Davies +F: dlls/oleaut32/typelib.c + +OpenMP +M: Sebastian Lackner +F: dlls/vcomp*/ + +Printing +M: Huw Davies +F: dlls/localspl/ +F: dlls/wineps.drv/ +F: dlls/winspool.drv/ + +Richedit +M: Huw Davies +F: dlls/riched20 + +RPC Runtime +P: Huw Davies +F: dlls/rpcrt4 +F: tools/widl + +Threadpool +M: Sebastian Lackner +F: dlls/ntdll/threadpool.c + +Uniscribe +M: Aric Stewart +F: dlls/usp10/ + +Web Services +M: Hans Leidekker +F: dlls/webservices/ + +Windows Imaging Component +M: Vincent Povirk +F: dlls/windowscodecs/ +F: dlls/windowscodecsext/ + +Windows Management Instrumentation +M: Hans Leidekker +F: dlls/wbemdisp/ +F: dlls/wbemprox/ +F: dlls/wmiutils/ + +Wine server, IPC +M: Alexandre Julliard +P: Sebastian Lackner +F: server/ + +Winemaker +M: André Hentschel +F: tools/winemaker/ + +WinHTTP +M: Hans Leidekker +F: dlls/winhttp/ + +WPcap +M: André Hentschel +F: dlls/wpcap/ + +VB Script +M: Jacek Caban +F: dlls/vbscript/ + +X11 Driver +M: Alexandre Julliard +P: Vincent Povirk +F: dlls/winex11.drv/ + +XML parsing +M: Nikolay Sivov +F: dlls/msxml*/ + +THE REST +M: Alexandre Julliard +P: Alex Henrie +P: Andrew Eikum +P: Huw Davies +P: Sebastian Lackner +P: Vincent Povirk +F: * +F: */ diff -Nru wine1.7-1.7.50/Makefile.in wine1.7-1.7.55/Makefile.in --- wine1.7-1.7.50/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -18,6 +18,93 @@ # sgmlpages: compile sgml source for the Wine API Guide # xmlpages: compile xml source for the Wine API Guide +# Start of common header +# The following variable definitions are copied into all makefiles + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +libdir = @libdir@ +datarootdir = @datarootdir@ +datadir = @datadir@ +mandir = @mandir@ +fontdir = ${datadir}/wine/fonts +includedir = @includedir@/wine +dlldir = @dlldir@ +fakedlldir = ${dlldir}/fakedlls +top_srcdir = @top_srcdir@ +top_builddir = @top_builddir@ +srcdir = @srcdir@ +SHELL = /bin/sh +RM = rm -f +MV = mv +CC = @CC@ +CXX = @CXX@ +CPPBIN = @CPPBIN@ +CROSSCC = @CROSSCC@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +EXTRACFLAGS = @EXTRACFLAGS@ +MSVCRTFLAGS = @BUILTINFLAG@ +TARGETFLAGS = @TARGETFLAGS@ +UNWINDFLAGS = @UNWINDFLAGS@ +LDEXECFLAGS = @LDEXECFLAGS@ +LIBS = @LIBS@ +BISON = @BISON@ +FLEX = @FLEX@ +EXEEXT = @EXEEXT@ +TOOLSEXT = @TOOLSEXT@ +DLLTOOL = @DLLTOOL@ +AR = @AR@ +ARFLAGS = @ARFLAGS@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +LN_S = @LN_S@ +TOOLSDIR = @TOOLSDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +DLLFLAGS = @DLLFLAGS@ +PRELINK = @PRELINK@ +FONTFORGE = @FONTFORGE@ +RSVG = @RSVG@ +CONVERT = @CONVERT@ +ICOTOOL = @ICOTOOL@ +MSGFMT = @MSGFMT@ +CROSSTARGET = @CROSSTARGET@ +LINGUAS = @LINGUAS@ +RUNTESTFLAGS = -q -P wine +MAKEDEP = $(TOOLSDIR)/tools/makedep$(TOOLSEXT) +WINEBUILD = $(TOOLSDIR)/tools/winebuild/winebuild$(TOOLSEXT) +WRC = $(TOOLSDIR)/tools/wrc/wrc$(TOOLSEXT) +LIBPORT = $(top_builddir)/libs/port/libwine_port.a +LIBWPP = $(top_builddir)/libs/wpp/libwpp.a +LIBWINE = -L$(top_builddir)/libs/wine -lwine +LIBWINE_STATIC = $(top_builddir)/libs/wine/libwine_static.a +PACKAGE_VERSION = @PACKAGE_VERSION@ +SED_CMD = LC_ALL=C sed -e 's,@bindir\@,$(bindir),g' -e 's,@dlldir\@,$(dlldir),g' -e 's,@PACKAGE_STRING\@,@PACKAGE_STRING@,g' -e 's,@PACKAGE_VERSION\@,@PACKAGE_VERSION@,g' +LDRPATH_INSTALL = @LDRPATH_INSTALL@ +LDRPATH_LOCAL = @LDRPATH_LOCAL@ +INSTALL_PROGRAM = STRIPPROG="$(STRIP)" $(top_srcdir)/tools/install-sh $(INSTALL_PROGRAM_FLAGS) +INSTALL_SCRIPT = $(top_srcdir)/tools/install-sh $(INSTALL_SCRIPT_FLAGS) +INSTALL_DATA = $(top_srcdir)/tools/install-sh -m 644 $(INSTALL_DATA_FLAGS) +prog_manext = 1 +api_manext = 3w +conf_manext = 5 +WINELOADER_PROGRAMS = @WINELOADER_PROGRAMS@ +WINELOADER_DEPENDS = @WINELOADER_DEPENDS@ +WINELOADER_INSTALL = @WINELOADER_INSTALL@ +LIBWINE_SHAREDLIB = @LIBWINE_SHAREDLIB@ +LIBWINE_IMPORTLIB = @LIBWINE_IMPORTLIB@ +LIBWINE_INSTALL_LIB = @LIBWINE_INSTALL_LIB@ +LIBWINE_INSTALL_DEV = @LIBWINE_INSTALL_DEV@ +LIBWINE_LDFLAGS = @LIBWINE_LDFLAGS@ +LIBWINE_DEPENDS = @LIBWINE_DEPENDS@ +ALL_TEST_RESOURCES = @ALL_TEST_RESOURCES@ +@ALL_VARS_RULES@ +@SET_MAKE@ + +# End of common header + all: wine @echo "Wine build complete." @@ -37,21 +124,30 @@ clean:: __clean__ distclean:: clean $(RM) config.* configure.lineno TAGS tags include/config.h include/stamp-h Makefile Make.tmp .gitignore - $(RM) -r autom4te.cache + $(RM) -r autom4te.cache documentation/html documentation/api-guide documentation/api-guide-xml documentation/man$(api_manext) # Rules for uninstalling .PHONY: install install-lib install-dev uninstall __uninstall__ uninstall:: __uninstall__ - -rmdir $(DESTDIR)$(fontdir) $(DESTDIR)$(datadir)/wine $(DESTDIR)$(fakedlldir) $(DESTDIR)$(dlldir) $(DESTDIR)$(includedir) + -rmdir $(DESTDIR)$(fontdir) $(DESTDIR)$(datadir)/wine $(DESTDIR)$(fakedlldir) $(DESTDIR)$(dlldir) $(DESTDIR)$(includedir)/windows/ddk \ + $(DESTDIR)$(includedir)/windows $(DESTDIR)$(includedir)/msvcrt/sys $(DESTDIR)$(includedir)/msvcrt $(DESTDIR)$(includedir) + +# Rules for API documentation + +install-manpages:: manpages + for i in documentation/man$(api_manext)/*.$(api_manext); do $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/$$i; done + +.PHONY: install-manpages # Dependencies between directories # dependencies needed to build any dll or program __tooldeps__: libs/port libs/wine libs/wpp __builddeps__: __tooldeps__ include -.PHONY: depend check test testclean crosstest __tooldeps__ __builddeps__ +.PHONY: depend dummy check test testclean crosstest __tooldeps__ __builddeps__ +dummy: loader: libs/port libs/wine tools server: libs/port libs/wine tools include fonts: tools/sfnt2fon diff -Nru wine1.7-1.7.50/Make.vars.in wine1.7-1.7.55/Make.vars.in --- wine1.7-1.7.50/Make.vars.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/Make.vars.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,78 +0,0 @@ -# @configure_input@ -*-Makefile-*- - -prefix = @prefix@ -exec_prefix = @exec_prefix@ -bindir = @bindir@ -libdir = @libdir@ -datarootdir = @datarootdir@ -datadir = @datadir@ -mandir = @mandir@ -fontdir = ${datadir}/wine/fonts -includedir = @includedir@/wine -dlldir = @dlldir@ -fakedlldir = ${dlldir}/fakedlls -top_srcdir = @top_srcdir@ -top_builddir = @top_builddir@ -srcdir = @srcdir@ -SHELL = /bin/sh -RM = rm -f -MV = mv -CC = @CC@ -CXX = @CXX@ -CPPBIN = @CPPBIN@ -CROSSCC = @CROSSCC@ -CFLAGS = @CFLAGS@ -CPPFLAGS = @CPPFLAGS@ -EXTRACFLAGS = @EXTRACFLAGS@ -MSVCRTFLAGS = @BUILTINFLAG@ -TARGETFLAGS = @TARGETFLAGS@ -UNWINDFLAGS = @UNWINDFLAGS@ -LIBS = @LIBS@ -BISON = @BISON@ -FLEX = @FLEX@ -EXEEXT = @EXEEXT@ -DLLPREFIX = @DLLPREFIX@ -TOOLSEXT = @TOOLSEXT@ -DLLTOOL = @DLLTOOL@ -AR = @AR@ -ARFLAGS = @ARFLAGS@ -RANLIB = @RANLIB@ -STRIP = @STRIP@ -LN_S = @LN_S@ -TOOLSDIR = @TOOLSDIR@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -DLLFLAGS = @DLLFLAGS@ -PRELINK = @PRELINK@ -FONTFORGE = @FONTFORGE@ -RSVG = @RSVG@ -CONVERT = @CONVERT@ -ICOTOOL = @ICOTOOL@ -MSGFMT = @MSGFMT@ -CROSSTARGET = @CROSSTARGET@ -LINGUAS = @LINGUAS@ -RUNTESTFLAGS = -q -P wine -MAKEDEP = $(TOOLSDIR)/tools/makedep$(TOOLSEXT) -WINEBUILD = $(TOOLSDIR)/tools/winebuild/winebuild$(TOOLSEXT) -WRC = $(TOOLSDIR)/tools/wrc/wrc$(TOOLSEXT) -LIBPORT = $(top_builddir)/libs/port/libwine_port.a -LIBWPP = $(top_builddir)/libs/wpp/libwpp.a -LIBWINE = -L$(top_builddir)/libs/wine -lwine -LIBWINE_STATIC = $(top_builddir)/libs/wine/libwine_static.a -SED_CMD = LC_ALL=C sed -e 's,@bindir\@,$(bindir),g' -e 's,@dlldir\@,$(dlldir),g' -e 's,@PACKAGE_STRING\@,@PACKAGE_STRING@,g' -e 's,@PACKAGE_VERSION\@,@PACKAGE_VERSION@,g' -LDRPATH_INSTALL = @LDRPATH_INSTALL@ -LDRPATH_LOCAL = @LDRPATH_LOCAL@ -INSTALL_PROGRAM = STRIPPROG="$(STRIP)" $(top_srcdir)/tools/install-sh $(INSTALL_PROGRAM_FLAGS) -INSTALL_SCRIPT = $(top_srcdir)/tools/install-sh $(INSTALL_SCRIPT_FLAGS) -INSTALL_DATA = $(top_srcdir)/tools/install-sh -m 644 $(INSTALL_DATA_FLAGS) -prog_manext = 1 -api_manext = 3w -conf_manext = 5 -@ALL_VARS_RULES@ -@SET_MAKE@ - -all: -dummy: -.PHONY: all dummy - -# End of common header diff -Nru wine1.7-1.7.50/po/ar.po wine1.7-1.7.55/po/ar.po --- wine1.7-1.7.50/po/ar.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/ar.po 2015-11-13 14:32:40.000000000 +0000 @@ -55,20 +55,19 @@ msgstr "&معلومات الدّعم" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "حسنًا" @@ -136,19 +135,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "ألغِ" @@ -305,7 +304,7 @@ msgid "&Apply" msgstr "&تطبيق" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "مساعدة" @@ -340,7 +339,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7394,72 +7393,72 @@ msgid "Off" msgstr "إيقاف" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "عنصر إدخال" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "نوع العنصر:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "نتيجة" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "أنشئ الآن" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "أنشئ متحكمًا" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "أنشئ من ملف" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "أ&ضف متحكمًا..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "اعرض كرمز" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "استعرض..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "الملف:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "لصق خاص" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "المصدر:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "الص&ق" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "الصق و&صلة" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "كـ:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "اع&رض كرمز" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "غ&ير الرمز..." @@ -7489,28 +7488,40 @@ msgid "Add Control" msgstr "أضف متحكمًا" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "ال&خط..." +#: oledlg.rc:36 +#, fuzzy +#| msgid "&Object" +msgid "%1 %2 &Object" +msgstr "الع&نصر" + +#: oledlg.rc:34 +#, fuzzy +#| msgid "&Object" +msgid "%1 &Object" +msgstr "الع&نصر" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "الع&نصر" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "أضف المحتوى الموجود في الحافظة إلى المستند كـ %s." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." msgstr "" "أضف المحتوى الموجود في الحافظة إلى المستند لذلك يمكنك تفعيله بواسطة %s." -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." @@ -7518,7 +7529,7 @@ "أضف المحتوى الموجود في الحافظة إلى المستند لذلك يمكنك تفعيله بواسطة %s. و " "يمكن عرضها كرمز." -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7527,7 +7538,7 @@ "أدخل محتويات الحافظة إلى المستند كـ %s.البيانات يشير إلى الملف المصدر و " "التغيير في الملف سينعكس على المستند." -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7536,7 +7547,7 @@ "أدخل صورة من محتويات الحافظة إلى المستند ، الصورة تشير إلى الملف المصدر و " "التغيير في الملف سينعكس على المستند." -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7545,19 +7556,19 @@ "إنشاء اختصار يشير إلى موقع المحتويات في الحافظة. الاختصار يشير إلى الملف " "المصدر و التغيير في الملف سينعكس على المستند." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "أدخل المحتوى من الحافظة إلى المستند." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "نوع غير معروف" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "مصدر غير معروف" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "البرنامج الذي تم إنشاؤه" @@ -8039,7 +8050,7 @@ msgid "Message" msgstr "الرسالة" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "ن&عم" @@ -8047,7 +8058,7 @@ msgid "Yes to &all" msgstr "نعم &للكل" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "لا" @@ -8569,23 +8580,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "ال&تالي\tCtrl+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "أحب&ط" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "أ&عد المحاولة" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "تجا&هل" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "حاول &ثانية" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "ا&ستمر" diff -Nru wine1.7-1.7.50/po/bg.po wine1.7-1.7.55/po/bg.po --- wine1.7-1.7.50/po/bg.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/bg.po 2015-11-13 14:32:40.000000000 +0000 @@ -57,20 +57,19 @@ msgstr "Информация" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "OK" @@ -144,19 +143,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Отмени" @@ -318,7 +317,7 @@ msgid "&Apply" msgstr "&Потвърди" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Помощ" @@ -353,7 +352,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7496,79 +7495,79 @@ msgid "Off" msgstr "Изключено" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "" -#: oledlg.rc:63 +#: oledlg.rc:65 #, fuzzy msgid "Create New" msgstr "Създай нова папка" -#: oledlg.rc:65 +#: oledlg.rc:67 #, fuzzy msgid "Create Control" msgstr "Контрол на потока" -#: oledlg.rc:67 +#: oledlg.rc:69 #, fuzzy msgid "Create From File" msgstr "Създай нова папка" -#: oledlg.rc:70 +#: oledlg.rc:72 #, fuzzy msgid "&Add Control..." msgstr "&Добави..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 #, fuzzy msgid "Browse..." msgstr "&Избери..." -#: oledlg.rc:74 +#: oledlg.rc:76 #, fuzzy msgid "File:" msgstr "Файл" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Източник:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "&Вмъкни" -#: oledlg.rc:86 +#: oledlg.rc:88 #, fuzzy msgid "Paste &Link" msgstr "Вмъкни като връзка" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "" -#: oledlg.rc:97 +#: oledlg.rc:99 #, fuzzy msgid "Change &Icon..." msgstr "Подреди &иконите" @@ -7597,67 +7596,75 @@ msgid "Add Control" msgstr "" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "&Шрифт..." +#: oledlg.rc:36 +msgid "%1 %2 &Object" +msgstr "" + +#: oledlg.rc:34 +msgid "%1 &Object" +msgstr "" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "" -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." msgstr "" -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." msgstr "" -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " "your document." msgstr "" -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " "in your document." msgstr "" -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " "be reflected in your document." msgstr "" -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "" -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "" -#: oledlg.rc:47 +#: oledlg.rc:49 #, fuzzy msgid "Unknown Source" msgstr "Пре&гледай изходния код" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "" @@ -8148,7 +8155,7 @@ msgid "Message" msgstr "" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Да" @@ -8156,7 +8163,7 @@ msgid "Yes to &all" msgstr "" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&Не" @@ -8690,23 +8697,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "Пре&крати" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "От&ново" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Пропусни" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "" diff -Nru wine1.7-1.7.50/po/ca.po wine1.7-1.7.55/po/ca.po --- wine1.7-1.7.50/po/ca.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/ca.po 2015-11-13 14:32:40.000000000 +0000 @@ -59,20 +59,19 @@ msgstr "Informació de suport" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "D'acord" @@ -143,19 +142,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Cancel·la" @@ -317,7 +316,7 @@ msgid "&Apply" msgstr "&Aplica" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Ajuda" @@ -352,7 +351,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7372,72 +7371,72 @@ msgid "Off" msgstr "Inactiu" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Inserció d'un objecte" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Tipus d'objecte:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Resultat" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Crea'n un de nou" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Crea control" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Crea'l des d'un fitxer" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "&Afegeix control..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "Mostra'l com a icona" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Navega..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "Fitxer:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Enganxada amb opcions" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Origen:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "Engan&xa" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "Enganxa en&llaç" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "&Com a:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "Mostra'l com a &icona" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "&Canvia d'icona..." @@ -7470,21 +7469,33 @@ msgstr "Afegeix control" # Including the ellipsis would make this string too long -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "T&ipus de lletra" +#: oledlg.rc:36 +#, fuzzy +#| msgid "&Object" +msgid "%1 %2 &Object" +msgstr "&Objecte" + +#: oledlg.rc:34 +#, fuzzy +#| msgid "&Object" +msgid "%1 &Object" +msgstr "&Objecte" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "&Objecte" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "Insereix el contingut del porta-retalls al vostre document com a %s." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7492,7 +7503,7 @@ "Insereix el contingut del porta-retalls al vostre document perquè el pugueu " "activar utilitzant %s." -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." @@ -7500,7 +7511,7 @@ "Insereix el contingut del porta-retalls al vostre document perquè el pugueu " "activar utilitzant %s. Es mostrarà com a icona." -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7510,7 +7521,7 @@ "dades amb el fitxer d'origen perquè que els canvis al fitxer es reflecteixin " "al vostre document." -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7520,7 +7531,7 @@ "la imatge amb el fitxer d'origen perquè els canvis al fitxer es reflecteixin " "al vostre document." -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7530,19 +7541,19 @@ "retalls. S'enllaça la drecera amb el fitxer d'origen perquè els canvis al " "fitxer es reflecteixin al vostre document." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "Insereix el contingut del porta-retalls al vostre document." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "Tipus desconegut" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Font desconegut" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "el programa que l'ha creat" @@ -8026,7 +8037,7 @@ msgid "Message" msgstr "Missatge" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Sí" @@ -8034,7 +8045,7 @@ msgid "Yes to &all" msgstr "Sí a &tots" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&No" @@ -8573,23 +8584,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "&Següent\tCtrl+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "&Avorta" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "&Reintenta" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Ignora" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "&Torna a intentar" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "&Continua" diff -Nru wine1.7-1.7.50/po/cs.po wine1.7-1.7.55/po/cs.po --- wine1.7-1.7.50/po/cs.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/cs.po 2015-11-13 14:32:40.000000000 +0000 @@ -58,20 +58,19 @@ msgstr "Informace o podpoře" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "OK" @@ -141,19 +140,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Storno" @@ -314,7 +313,7 @@ msgid "&Apply" msgstr "&Použít" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Nápověda" @@ -349,7 +348,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7325,72 +7324,72 @@ msgid "Off" msgstr "Vypnuto" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Vložit objekt" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Typ objektu:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Výsledek" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Vytvořit nový" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Vytvořit propojení" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Vytvořit ze souboru" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "Přidat propojení..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "Zobrazit jako ikonu" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Procházet..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "Soubor:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Vložit jinak" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Zdroj:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "Vl&ožit" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "V&ložit odkaz" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "Jako:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "&Zobrazit jako ikonu" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "Změnit &ikonu..." @@ -7420,21 +7419,33 @@ msgid "Add Control" msgstr "Přidat řídící prvek" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "&Písmo..." +#: oledlg.rc:36 +#, fuzzy +#| msgid "&Object" +msgid "%1 %2 &Object" +msgstr "&Objekt" + +#: oledlg.rc:34 +#, fuzzy +#| msgid "&Object" +msgid "%1 &Object" +msgstr "&Objekt" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "&Objekt" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "Vloží obsah schránky do Vašeho dokumentu jako %s." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7442,7 +7453,7 @@ "Vloží obsah schránky do vašeho dokumentu tak, že je vložené možné aktivovat " "s použitím %s." -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." @@ -7450,7 +7461,7 @@ "Vloží obsah schránky do Vašeho dokumentu tak, že vložené můžete aktivovat s " "použitím %s. Bude zobrazeno jako ikona." -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7459,7 +7470,7 @@ "Vloží obsah schránky do Vašeho dokumentu jako %s. Data jsou napojena na " "zdrojový soubor, takže jeho změny se promítnou též ve Vašem dokumentu." -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7468,26 +7479,26 @@ "Vloží do Vašeho dokumentu obrázek obsahu schránky. Obrázek je napojen na " "původní soubor, takže jeho změny se odrazí i ve Vašem dokumentu." -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " "be reflected in your document." msgstr "" -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "Vloží obsah schránky do Vašeho dokumentu." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "Neznámý typ" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Neznámý zdroj" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "aplikace, ve které bylo vytvořeno" @@ -7969,7 +7980,7 @@ msgid "Message" msgstr "Zpráva" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Ano" @@ -7977,7 +7988,7 @@ msgid "Yes to &all" msgstr "Ano &všem" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&Ne" @@ -8508,23 +8519,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "Následující\tCtrl+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "&Přerušit" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "&Zkusit znovu" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Ignorovat" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "&Zkusit znovu" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "&Pokračovat" diff -Nru wine1.7-1.7.50/po/da.po wine1.7-1.7.55/po/da.po --- wine1.7-1.7.50/po/da.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/da.po 2015-11-13 14:32:40.000000000 +0000 @@ -57,20 +57,19 @@ msgstr "Support information" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "OK" @@ -139,19 +138,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Annuller" @@ -322,7 +321,7 @@ msgid "&Apply" msgstr "&Anvend" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Hjælp" @@ -357,7 +356,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7470,72 +7469,72 @@ msgid "Off" msgstr "Fra" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Indsæt objekt" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Objekttype:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Resultat" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Opret ny" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Opret control" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Opret fra fil" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "&Tilføj Control..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "Vis som ikon" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Gennemse..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "Fil:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Indsæt speciel" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Kilde:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "&Indsæt" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "Indsæt &genvej" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "&Som:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "&Vis som ikon" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "Ændre &ikon..." @@ -7567,21 +7566,33 @@ msgid "Add Control" msgstr "Tilføj kontrol" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "&Skrifttype..." +#: oledlg.rc:36 +#, fuzzy +#| msgid "&Object" +msgid "%1 %2 &Object" +msgstr "&Objekt" + +#: oledlg.rc:34 +#, fuzzy +#| msgid "&Object" +msgid "%1 &Object" +msgstr "&Objekt" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "&Objekt" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "Indsætter indholdet fra klippebordet ind i dokumentet som %s." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7589,7 +7600,7 @@ "Indsætter indholdet fra udklipsholderen ind i dokumentet, så du kan aktivere " "det med %s." -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." @@ -7597,7 +7608,7 @@ "Indsætter indholdet fra udklipsholderen ind i dokumentet, så du kan aktivere " "det med %s. Det vil blive vist som et ikon." -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7606,7 +7617,7 @@ "Indsætter indholdet fra udklipsholderen ind i dokumentet som %s. Data er " "koblet til kildefilen så ændringer også sker i dit dokument." -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7615,7 +7626,7 @@ "Indsætter et billede af udklipsholderen i dokumentet. Billedet kobles til " "kildefilen så ændringer også sker i dokumentet ." -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7625,19 +7636,19 @@ "udklipsholderen. Genvejen kobles til kildefilen så ændringer også sker i " "dokumentet." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "Indsætter indholdet fra udklipsholderen ind i dokumentet." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "Ukendt type" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Ukendt kilde" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "programmet der lavede det" @@ -8119,7 +8130,7 @@ msgid "Message" msgstr "Meddelelse" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Ja" @@ -8127,7 +8138,7 @@ msgid "Yes to &all" msgstr "Ja to &alt" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&Nej" @@ -8665,23 +8676,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "Næs&te/tCtrl+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "Af&bryd" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "&Gentag" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Ignorer" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "&Prøv igen" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "&Fortsæt" diff -Nru wine1.7-1.7.50/po/de.po wine1.7-1.7.55/po/de.po --- wine1.7-1.7.50/po/de.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/de.po 2015-11-13 14:32:40.000000000 +0000 @@ -5,7 +5,7 @@ "Project-Id-Version: Wine\n" "Report-Msgid-Bugs-To: http://bugs.winehq.org\n" "POT-Creation-Date: N/A\n" -"PO-Revision-Date: 2015-07-19 02:02+0200\n" +"PO-Revision-Date: 2015-11-06 12:55+0100\n" "Last-Translator: Julian Rüger\n" "Language-Team: German\n" "Language: de\n" @@ -57,20 +57,19 @@ msgstr "Informationen" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "OK" @@ -106,7 +105,7 @@ #: appwiz.rc:86 msgid "Product Updates:" -msgstr "Produkt Updates:" +msgstr "Produkt-Updates:" #: appwiz.rc:87 msgid "Comments:" @@ -142,19 +141,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Abbrechen" @@ -187,7 +186,7 @@ msgid "" "Allows you to install new software, or remove existing software from your " "computer." -msgstr "Erlaubt es ihnen, neue Software hinzuzufügen oder zu entfernen." +msgstr "Erlaubt es Ihnen, neue Software hinzuzufügen oder zu entfernen." #: appwiz.rc:33 taskmgr.rc:262 winecfg.rc:33 msgid "Applications" @@ -296,7 +295,7 @@ #: avifil32.rc:36 msgid "Wine AVI-default-filehandler" -msgstr "Wine AVI-Standard-Dateibehandlungsroutine" +msgstr "Wine-AVI-Standard-Dateibehandlungsroutine" #: avifil32.rc:37 msgid "uncompressed" @@ -314,7 +313,7 @@ msgid "&Apply" msgstr "&Anwenden" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "&Hilfe" @@ -349,7 +348,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -806,7 +805,7 @@ #: comdlg32.rc:33 msgid "Please verify that the correct file name was given" -msgstr "Bitte überprüfen sie, ob der korrekte Dateiname angegeben wurde" +msgstr "Bitte überprüfen Sie, ob der korrekte Dateiname angegeben wurde" #: comdlg32.rc:34 msgid "" @@ -958,11 +957,11 @@ "Please enter a value between %1!d! and %2!d!." msgstr "" "Dieser Wert liegt nicht auf der Seite.\n" -"Bitte geben sie einen Wert zwischen %1!d! und %2!d! an." +"Bitte geben Sie einen Wert zwischen %1!d! und %2!d! an." #: comdlg32.rc:60 msgid "The 'from' entry cannot exceed the 'to' entry." -msgstr "Der 'von' Eintrag kann nicht größer sein als der 'bis' Eintrag." +msgstr "Der 'von'-Eintrag kann nicht größer sein als der 'bis'-Eintrag." #: comdlg32.rc:62 msgid "" @@ -1147,7 +1146,7 @@ #: comdlg32.rc:77 msgid "Default Printer; " -msgstr "Standard Drucker; " +msgstr "Standard-Drucker; " #: comdlg32.rc:78 msgid "There are %d documents in the queue" @@ -1251,11 +1250,11 @@ #: crypt32.rc:39 msgid "CRL Reason Code" -msgstr "CRL Grundcode" +msgstr "CRL-Grundcode" #: crypt32.rc:40 msgid "CRL Distribution Points" -msgstr "CRL Verteilungspunkte" +msgstr "CRL-Verteilungspunkte" #: crypt32.rc:41 msgid "Enhanced Key Usage" @@ -1311,7 +1310,7 @@ #: crypt32.rc:54 msgid "S/MIME Capabilities" -msgstr "S/MIME Möglichkeiten" +msgstr "S/MIME-Möglichkeiten" #: crypt32.rc:55 msgid "Prefer Signed Data" @@ -1332,7 +1331,7 @@ #: crypt32.rc:59 msgid "Certification Authority Issuer" -msgstr "Zertifizierungsstellen Emittent" +msgstr "Zertifizierungsstellen-Emittent" #: crypt32.rc:60 msgid "Certification Template Name" @@ -1348,35 +1347,35 @@ #: crypt32.rc:63 msgid "Netscape Cert Type" -msgstr "Netscape Zertifikatstyp" +msgstr "Netscape-Zertifikatstyp" #: crypt32.rc:64 msgid "Netscape Base URL" -msgstr "Netscape Basis-URL" +msgstr "Netscape-Basis-URL" #: crypt32.rc:65 msgid "Netscape Revocation URL" -msgstr "Netscape Sperrungs-URL" +msgstr "Netscape-Sperrungs-URL" #: crypt32.rc:66 msgid "Netscape CA Revocation URL" -msgstr "Netscape CA Sperrungs-URL" +msgstr "Netscape-CA-Sperrungs-URL" #: crypt32.rc:67 msgid "Netscape Cert Renewal URL" -msgstr "Netscape Zertifikatserneuerungs-URL" +msgstr "Netscape-Zertifikatserneuerungs-URL" #: crypt32.rc:68 msgid "Netscape CA Policy URL" -msgstr "Netscape CA Richtlinien-URL" +msgstr "Netscape-CA-Richtlinien-URL" #: crypt32.rc:69 msgid "Netscape SSL ServerName" -msgstr "Netscape SSL Servername" +msgstr "Netscape-SSL-Servername" #: crypt32.rc:70 msgid "Netscape Comment" -msgstr "Netscape Kommentar" +msgstr "Netscape-Kommentar" #: crypt32.rc:71 msgid "Country/Region" @@ -1432,11 +1431,11 @@ #: crypt32.rc:84 msgid "CA Version" -msgstr "CA Version" +msgstr "CA-Version" #: crypt32.rc:85 msgid "Cross CA Version" -msgstr "Kreuz CA Version" +msgstr "Kreuz-CA-Version" #: crypt32.rc:86 msgid "Serialized Signature Serial Number" @@ -1448,7 +1447,7 @@ #: crypt32.rc:88 msgid "Windows Product Update" -msgstr "Windows Produkt Aktualisierung" +msgstr "Windows-Produkt-Aktualisierung" #: crypt32.rc:89 msgid "Enrollment Name Value Pair" @@ -1464,11 +1463,11 @@ #: crypt32.rc:92 msgid "CRL Number" -msgstr "CRL Nummer" +msgstr "CRL-Nummer" #: crypt32.rc:93 msgid "Delta CRL Indicator" -msgstr "Delta CRL Indikator" +msgstr "Delta-CRL-Indikator" #: crypt32.rc:94 msgid "Issuing Distribution Point" @@ -1508,43 +1507,43 @@ #: crypt32.rc:103 msgid "CMC Data" -msgstr "CMC Daten" +msgstr "CMC-Daten" #: crypt32.rc:104 msgid "CMC Response" -msgstr "CMC Antwort" +msgstr "CMC-Antwort" #: crypt32.rc:105 msgid "Unsigned CMC Request" -msgstr "Unsignierte CMC Antwort" +msgstr "Unsignierte CMC-Anfrage" #: crypt32.rc:106 msgid "CMC Status Info" -msgstr "CMC Statusinformation" +msgstr "CMC-Statusinformation" #: crypt32.rc:107 msgid "CMC Extensions" -msgstr "CMC Erweiterungen" +msgstr "CMC-Erweiterungen" #: crypt32.rc:108 msgid "CMC Attributes" -msgstr "CMC Attribute" +msgstr "CMC-Attribute" #: crypt32.rc:109 msgid "PKCS 7 Data" -msgstr "PKCS 7 Daten" +msgstr "PKCS-7-Daten" #: crypt32.rc:110 msgid "PKCS 7 Signed" -msgstr "PKCS 7 signiert" +msgstr "PKCS-7-signiert" #: crypt32.rc:111 msgid "PKCS 7 Enveloped" -msgstr "PKCS 7 umhüllt" +msgstr "PKCS-7-umhüllt" #: crypt32.rc:112 msgid "PKCS 7 Signed Enveloped" -msgstr "PKCS 7 signiert und umhüllt" +msgstr "PKCS-7-signiert und -umhüllt" #: crypt32.rc:113 msgid "PKCS 7 Digested" @@ -1552,11 +1551,11 @@ #: crypt32.rc:114 msgid "PKCS 7 Encrypted" -msgstr "PKCS 7 verschlüsselt" +msgstr "PKCS-7-verschlüsselt" #: crypt32.rc:115 msgid "Previous CA Certificate Hash" -msgstr "Vorheriger CA Zertifikatshash" +msgstr "Vorheriger CA-Zertifikatshash" #: crypt32.rc:116 msgid "Virtual Base CRL Number" @@ -1564,11 +1563,11 @@ #: crypt32.rc:117 msgid "Next CRL Publish" -msgstr "Nächste CRL Veröffentlichung" +msgstr "Nächste CRL-Veröffentlichung" #: crypt32.rc:118 msgid "CA Encryption Certificate" -msgstr "CA Verschlüsselungszertifikat" +msgstr "CA-Verschlüsselungszertifikat" #: crypt32.rc:119 cryptui.rc:148 msgid "Key Recovery Agent" @@ -1592,7 +1591,7 @@ #: crypt32.rc:124 msgid "Published CRL Locations" -msgstr "Veröffentlichte CRL Standorte" +msgstr "Veröffentlichte CRL-Standorte" #: crypt32.rc:125 msgid "Enforce Certificate Chain Policy" @@ -1644,15 +1643,15 @@ #: crypt32.rc:137 msgid "Client Information" -msgstr "Client Informationen" +msgstr "Client-Informationen" #: crypt32.rc:138 msgid "Server Authentication" -msgstr "Server Authentifizierung" +msgstr "Server-Authentifizierung" #: crypt32.rc:139 msgid "Client Authentication" -msgstr "Client Authentifizierung" +msgstr "Client-Authentifizierung" #: crypt32.rc:140 msgid "Code Signing" @@ -1676,15 +1675,15 @@ #: crypt32.rc:145 msgid "IP security end system" -msgstr "IP Sicherheitsendsystem" +msgstr "IP-Sicherheitsendsystem" #: crypt32.rc:146 msgid "IP security tunnel termination" -msgstr "IP Sicherheitstunnelabschluss" +msgstr "IP-Sicherheitstunnelabschluss" #: crypt32.rc:147 msgid "IP security user" -msgstr "IP Sicherheitsbenutzer" +msgstr "IP-Sicherheitsbenutzer" #: crypt32.rc:148 msgid "Encrypting File System" @@ -1692,19 +1691,19 @@ #: crypt32.rc:149 cryptui.rc:133 msgid "Windows Hardware Driver Verification" -msgstr "Windows Hardware Treiber Verifizierung" +msgstr "Windows-Hardware-Treiber-Verifizierung" #: crypt32.rc:150 cryptui.rc:134 msgid "Windows System Component Verification" -msgstr "Windows System Komponenten Verifizierung" +msgstr "Windows-Systemkomponenten-Verifizierung" #: crypt32.rc:151 cryptui.rc:135 msgid "OEM Windows System Component Verification" -msgstr "OEM Windows System Komponenten Verifizierung" +msgstr "OEM-Windows-Systemkomponenten-Verifizierung" #: crypt32.rc:152 cryptui.rc:136 msgid "Embedded Windows System Component Verification" -msgstr "Embedded Windows System Komponenten Verifizierung" +msgstr "Embedded-Windows-Systemkomponenten-Verifizierung" #: crypt32.rc:153 cryptui.rc:143 msgid "Key Pack Licenses" @@ -1712,11 +1711,11 @@ #: crypt32.rc:154 cryptui.rc:144 msgid "License Server Verification" -msgstr "Lizenzserver Verifizierung" +msgstr "Lizenzserver-Verifizierung" #: crypt32.rc:155 cryptui.rc:146 msgid "Smart Card Logon" -msgstr "Smartcard Anmeldung" +msgstr "Smartcard-Anmeldung" #: crypt32.rc:156 cryptui.rc:142 msgid "Digital Rights" @@ -1736,7 +1735,7 @@ #: crypt32.rc:160 msgid "IP security IKE intermediate" -msgstr "Dazwischenliegende IP Sicherheits-IKE" +msgstr "Intermediäre IP-Sicherheits-IKE" #: crypt32.rc:161 cryptui.rc:132 msgid "File Recovery" @@ -1744,7 +1743,7 @@ #: crypt32.rc:162 cryptui.rc:137 msgid "Root List Signer" -msgstr "Stammlisten Signierer" +msgstr "Stammlisten-Signierer" #: crypt32.rc:163 msgid "All application policies" @@ -1752,7 +1751,7 @@ #: crypt32.rc:164 cryptui.rc:149 msgid "Directory Service Email Replication" -msgstr "Verzeichnisdienst für E-Mail Replikation" +msgstr "Verzeichnisdienst für E-Mail-Replikation" #: crypt32.rc:165 cryptui.rc:145 msgid "Certificate Request Agent" @@ -1776,7 +1775,7 @@ #: crypt32.rc:174 msgid "Intermediate Certification Authorities" -msgstr "Zwischenzertifizierungsstellen" +msgstr "Intermediäre Zertifizierungsstellen" #: crypt32.rc:175 msgid "Other People" @@ -1808,11 +1807,11 @@ #: crypt32.rc:186 msgid "Email Address=" -msgstr "E-Mail Adresse=" +msgstr "E-Mail-Adresse=" #: crypt32.rc:187 msgid "DNS Name=" -msgstr "DNS Name=" +msgstr "DNS-Name=" #: crypt32.rc:188 msgid "Directory Address" @@ -1824,7 +1823,7 @@ #: crypt32.rc:190 msgid "IP Address=" -msgstr "IP Adresse=" +msgstr "IP-Adresse=" #: crypt32.rc:191 msgid "Mask=" @@ -1840,7 +1839,7 @@ #: crypt32.rc:194 msgid "Subject Type=" -msgstr "Subjekt Typ=" +msgstr "Subjekt-Typ=" #: crypt32.rc:195 msgctxt "Certificate Authority" @@ -1879,7 +1878,7 @@ #: crypt32.rc:203 msgid "CA Issuers" -msgstr "CA Emittent" +msgstr "CA-Emittent" #: crypt32.rc:204 msgid "Unknown Access Method" @@ -1891,7 +1890,7 @@ #: crypt32.rc:206 msgid "CRL Distribution Point" -msgstr "CRL Verteilungspunkt" +msgstr "CRL-Verteilungspunkt" #: crypt32.rc:207 msgid "Distribution Point Name" @@ -1903,15 +1902,15 @@ #: crypt32.rc:209 msgid "RDN Name" -msgstr "RDN Name" +msgstr "RDN-Name" #: crypt32.rc:210 msgid "CRL Reason=" -msgstr "CRL Begründung=" +msgstr "CRL-Begründung=" #: crypt32.rc:211 msgid "CRL Issuer" -msgstr "CRL Ausgeber" +msgstr "CRL-Ausgeber" #: crypt32.rc:212 msgid "Key Compromise" @@ -1919,7 +1918,7 @@ #: crypt32.rc:213 msgid "CA Compromise" -msgstr "CA Infekt" +msgstr "CA-Infekt" #: crypt32.rc:214 msgid "Affiliation Changed" @@ -1987,7 +1986,7 @@ #: crypt32.rc:230 msgid "Off-line CRL Signing" -msgstr "Offline Signieren der CRL" +msgstr "Offline-Signieren der CRL" #: crypt32.rc:231 msgid "CRL Signing" @@ -2003,11 +2002,11 @@ #: crypt32.rc:234 msgid "SSL Client Authentication" -msgstr "SSL Client-Authentifizierung" +msgstr "SSL-Client-Authentifizierung" #: crypt32.rc:235 msgid "SSL Server Authentication" -msgstr "SSL Server-Authentifizierung" +msgstr "SSL-Server-Authentifizierung" #: crypt32.rc:236 msgid "S/MIME" @@ -2019,15 +2018,15 @@ #: crypt32.rc:238 msgid "SSL CA" -msgstr "SSL CA" +msgstr "SSL-CA" #: crypt32.rc:239 msgid "S/MIME CA" -msgstr "S/MIME CA" +msgstr "S/MIME-CA" #: crypt32.rc:240 msgid "Signature CA" -msgstr "Signatur CA" +msgstr "Signatur-CA" #: cryptdlg.rc:30 msgid "Certificate Policy" @@ -2039,11 +2038,11 @@ #: cryptdlg.rc:32 msgid "Policy Qualifier Info" -msgstr "Richtlinien Qualifizierungs Information" +msgstr "Richtlinien-Qualifizierungs-Information" #: cryptdlg.rc:33 msgid "Policy Qualifier Id=" -msgstr "Richtlinien Qualifizierungs-ID=" +msgstr "Richtlinien-Qualifizierungs-ID=" #: cryptdlg.rc:36 msgid "Qualifier" @@ -2166,11 +2165,11 @@ #: cryptui.rc:280 cryptui.rc:291 cryptui.rc:308 cryptui.rc:322 cryptui.rc:71 msgid "Certificate Import Wizard" -msgstr "Zertifikat Importassistent" +msgstr "Zertifikat-Importassistent" #: cryptui.rc:283 msgid "Welcome to the Certificate Import Wizard" -msgstr "Willkommen beim Zertifikat Importassistent" +msgstr "Willkommen beim Zertifikat-Importassistent" #: cryptui.rc:286 msgid "" @@ -2184,10 +2183,10 @@ "\n" "To continue, click Next." msgstr "" -"Dieser Assistent hilft ihnen Zertifikate, Zertifikatssperrlisten und " +"Dieser Assistent hilft Ihnen Zertifikate, Zertifikatssperrlisten und " "Zertifikatsvertrauenslisten aus einer Datei zu importieren.\n" "\n" -"Ein Zertifikat dient zur Identifikation von Ihnen oder ihrem Computer. Es " +"Ein Zertifikat dient zur Identifikation von Ihnen oder Ihrem Computer. Es " "kann auch für die Authentifizierung und zum Unterzeichnen genutzt werden. " "Zertifikatsspeicher sind Sammlungen von Zertifikaten, Zertifikatssperrlisten " "und Zertifikatsvertrauenslisten.\n" @@ -2220,7 +2219,7 @@ #: cryptui.rc:303 cryptui.rc:81 cryptui.rc:162 msgid "Microsoft Serialized Certificate Store (*.sst)" -msgstr "Microsoft Speicher serieller Zertifikate (*.sst)" +msgstr "Microsoft-Speicher serieller Zertifikate (*.sst)" #: cryptui.rc:311 msgid "" @@ -2240,7 +2239,7 @@ #: cryptui.rc:325 msgid "Completing the Certificate Import Wizard" -msgstr "Fertigstellung des Zertifikat Importassistenten" +msgstr "Fertigstellung des Zertifikat-Importassistenten" #: cryptui.rc:327 msgid "You have successfully completed the Certificate Import Wizard." @@ -2301,11 +2300,11 @@ #: cryptui.rc:370 cryptui.rc:381 cryptui.rc:394 cryptui.rc:404 cryptui.rc:427 #: cryptui.rc:436 cryptui.rc:150 msgid "Certificate Export Wizard" -msgstr "Zertifikat Exportassistent" +msgstr "Zertifikat-Exportassistent" #: cryptui.rc:373 msgid "Welcome to the Certificate Export Wizard" -msgstr "Willkommen beim Zertifikat Exportassistent" +msgstr "Willkommen beim Zertifikat-Exportassistent" #: cryptui.rc:376 msgid "" @@ -2319,10 +2318,10 @@ "\n" "To continue, click Next." msgstr "" -"Dieser Assistent hilft ihnen Zertifikate, Zertifikatssperrlisten und " +"Dieser Assistent hilft Ihnen Zertifikate, Zertifikatssperrlisten und " "Zertifikatsvertrauenslisten in eine Datei zu exportieren.\n" "\n" -"Ein Zertifikat dient zur Identifikation von Ihnen oder ihrem Computer. Es " +"Ein Zertifikat dient zur Identifikation von Ihnen oder Ihrem Computer. Es " "kann auch für die Authentifizierung und zum Unterzeichnen genutzt werden. " "Zertifikatsspeicher sind Sammlungen von Zertifikaten, Zertifikatssperrlisten " "und Zertifikatsvertrauenslisten.\n" @@ -2391,7 +2390,7 @@ #: cryptui.rc:439 msgid "Completing the Certificate Export Wizard" -msgstr "Fertigstellung des Zertifikat Exportassistenten" +msgstr "Fertigstellung des Zertifikat-Exportassistenten" #: cryptui.rc:441 msgid "You have successfully completed the Certificate Export Wizard." @@ -2533,7 +2532,7 @@ #: cryptui.rc:62 msgid "SHA1 hash" -msgstr "SHA1 Hash" +msgstr "SHA1-Hash" #: cryptui.rc:63 msgid "Enhanced key usage (property)" @@ -2591,7 +2590,7 @@ #: cryptui.rc:77 msgid "X.509 Certificate (*.cer; *.crt)" -msgstr "X.509 Zertifikat (*.cer; *.crt)" +msgstr "X.509-Zertifikat (*.cer; *.crt)" #: cryptui.rc:78 msgid "Personal Information Exchange (*.pfx; *.p12)" @@ -2607,7 +2606,7 @@ #: cryptui.rc:82 msgid "CMS/PKCS #7 Messages (*.spc; *.p7b)" -msgstr "CMS/PKCS #7 Zertifikate (*.spc; *.p7b)" +msgstr "CMS/PKCS-#7-Zertifikate (*.spc; *.p7b)" #: cryptui.rc:84 msgid "Please select a file." @@ -2651,7 +2650,7 @@ #: cryptui.rc:96 msgid "CMS/PKCS #7 Message" -msgstr "CMS/PKCS #7 Zertifikat" +msgstr "CMS/PKCS-#7-Zertifikat" #: cryptui.rc:97 msgid "Personal Information Exchange" @@ -2817,7 +2816,7 @@ #: cryptui.rc:127 msgid "Protects e-mail messages" -msgstr "Sichert E-Mail Nachrichten" +msgstr "Sichert E-Mail-Nachrichten" #: cryptui.rc:128 msgid "Allows secure communication over the Internet" @@ -2841,7 +2840,7 @@ #: cryptui.rc:151 msgid "Export Format" -msgstr "Export Format" +msgstr "Export-Format" #: cryptui.rc:152 msgid "Choose the format in which the content will be saved." @@ -2849,7 +2848,7 @@ #: cryptui.rc:153 msgid "Export Filename" -msgstr "Export Dateiname" +msgstr "Export-Dateiname" #: cryptui.rc:154 msgid "Specify the name of the file in which the content will be saved." @@ -2869,7 +2868,7 @@ #: cryptui.rc:160 msgid "CMS/PKCS #7 Messages (*.p7b)" -msgstr "CMS/PKCS #7 Zertifikate (*.p7b)" +msgstr "CMS/PKCS-#7-Zertifikate (*.p7b)" #: cryptui.rc:161 msgid "Personal Information Exchange (*.pfx)" @@ -2913,7 +2912,7 @@ #: cryptui.rc:173 msgid "You may password-protect a private key." -msgstr "Der private Schlüssel sollte Passwortgeschützt sein." +msgstr "Der private Schlüssel sollte passwortgeschützt sein." #: cryptui.rc:174 msgid "The passwords do not match." @@ -3225,7 +3224,7 @@ #: iccvid.rc:28 iccvid.rc:29 msgid "Cinepak Video codec" -msgstr "Cinepak Video Codec" +msgstr "Cinepak-Video-Codec" #: ieframe.rc:28 shell32.rc:114 notepad.rc:29 oleview.rc:30 oleview.rc:80 #: progman.rc:32 taskmgr.rc:35 view.rc:31 winefile.rc:28 winhlp32.rc:31 @@ -3435,11 +3434,11 @@ #: inetcpl.rc:31 msgid "Internet Settings" -msgstr "Internet Einstellungen" +msgstr "Internet-Einstellungen" #: inetcpl.rc:32 msgid "Configure Wine Internet Browser and related settings" -msgstr "Wine Internet Browser und zugehörige Einstellungen anpassen" +msgstr "Wine-Internet-Browser und zugehörige Einstellungen anpassen" #: inetcpl.rc:33 msgid "Security settings for zone: " @@ -3656,11 +3655,11 @@ #: jscript.rc:60 msgid "VBArray object expected" -msgstr "VBArray Objekt erwartet" +msgstr "VBArray-Objekt erwartet" #: jscript.rc:61 msgid "JScript object expected" -msgstr "JScript Objekt erwartet" +msgstr "JScript-Objekt erwartet" #: jscript.rc:62 msgid "Syntax error in regular expression" @@ -3688,7 +3687,7 @@ #: jscript.rc:68 msgid "Array object expected" -msgstr "Array Objekt erwartet" +msgstr "Array-Objekt erwartet" #: winerror.mc:26 msgid "Success.\n" @@ -3972,15 +3971,15 @@ #: winerror.mc:376 msgid "Too many semaphores.\n" -msgstr "Zu viele Semaphoren.\n" +msgstr "Zu viele Semaphore.\n" #: winerror.mc:381 msgid "Exclusive semaphore already owned.\n" -msgstr "Exklusive Semaphore bereits zugewiesen.\n" +msgstr "Exklusiver Semaphor bereits zugewiesen.\n" #: winerror.mc:386 msgid "Semaphore is set.\n" -msgstr "Semaphore ist gesetzt.\n" +msgstr "Semaphor ist gesetzt.\n" #: winerror.mc:391 msgid "Too many semaphore requests.\n" @@ -4420,7 +4419,7 @@ #: winerror.mc:946 msgid "Too many posts to semaphore.\n" -msgstr "Zu viele Posts an Semaphore.\n" +msgstr "Zu viele Posts an Semaphor.\n" #: winerror.mc:951 msgid "Read/WriteProcessMemory partially completed.\n" @@ -4770,7 +4769,7 @@ #: winerror.mc:1381 msgid "I/O device error.\n" -msgstr "E/A Gerätefehler.\n" +msgstr "E/A-Gerätefehler.\n" #: winerror.mc:1386 msgid "No serial devices found.\n" @@ -4786,7 +4785,7 @@ #: winerror.mc:1401 msgid "Serial I/O counter timeout.\n" -msgstr "Zeitüberschreitung von seriellem E/A Zähler.\n" +msgstr "Zeitüberschreitung von seriellem E/A-Zähler.\n" #: winerror.mc:1406 msgid "Floppy ID address mark not found.\n" @@ -4934,7 +4933,7 @@ #: winerror.mc:1586 msgid "No running tracking service.\n" -msgstr "Kein laufender Tracking Dienst.\n" +msgstr "Kein laufender Tracking-Dienst.\n" #: winerror.mc:1591 msgid "No such volume ID.\n" @@ -4966,7 +4965,7 @@ #: winerror.mc:1626 msgid "The journal entry was deleted.\n" -msgstr "Der Journal Eintrag wurde gelöscht.\n" +msgstr "Der Journal-Eintrag wurde gelöscht.\n" #: winerror.mc:1631 msgid "Invalid device name.\n" @@ -5182,7 +5181,7 @@ #: winerror.mc:1901 msgid "Not supported on Small Business Server.\n" -msgstr "Nicht auf Small Business Servern unterstützt.\n" +msgstr "Nicht auf Small-Business-Servern unterstützt.\n" #: winerror.mc:1906 msgid "Not all privileges assigned.\n" @@ -5442,7 +5441,7 @@ #: winerror.mc:2226 msgid "Bad logon session state.\n" -msgstr "Fehlerhafter Logon Sitzungsstatus.\n" +msgstr "Fehlerhafter Logon-Sitzungsstatus.\n" #: winerror.mc:2231 msgid "Logon session ID collision.\n" @@ -5554,7 +5553,7 @@ #: winerror.mc:2371 msgid "No user session key.\n" -msgstr "Kein Benutzer Sitzungsschlüssel.\n" +msgstr "Kein Benutzer-Sitzungsschlüssel.\n" #: winerror.mc:2376 msgid "License quota exceeded.\n" @@ -5778,11 +5777,11 @@ #: winerror.mc:2651 msgid "No non-paged system resources.\n" -msgstr "Keine non-paged Systemressourcen.\n" +msgstr "Keine Non-Paged-Systemressourcen.\n" #: winerror.mc:2656 msgid "No paged system resources.\n" -msgstr "Keine paged Systemressourcen.\n" +msgstr "Keine Paged-Systemressourcen.\n" #: winerror.mc:2661 msgid "No working set quota.\n" @@ -5838,7 +5837,7 @@ #: winerror.mc:2726 msgid "Installer service failed.\n" -msgstr "Installer Dienst gescheitert.\n" +msgstr "Installer-Dienst gescheitert.\n" #: winerror.mc:2731 msgid "Installation aborted by user.\n" @@ -6254,7 +6253,7 @@ #: winerror.mc:3251 msgid "RPC divide-by-zero.\n" -msgstr "RPC Division-durch-Null.\n" +msgstr "RPC-Division-durch-Null.\n" #: winerror.mc:3256 msgid "Address error.\n" @@ -6262,7 +6261,7 @@ #: winerror.mc:3261 msgid "Floating-point divide-by-zero.\n" -msgstr "Fließkomma Division-durch-Null.\n" +msgstr "Fließkomma-Division-durch-Null.\n" #: winerror.mc:3266 msgid "Floating-point underflow.\n" @@ -6462,7 +6461,7 @@ #: winerror.mc:3511 msgid "RPC comm failure.\n" -msgstr "RPC Kommunikationsausfall.\n" +msgstr "RPC-Kommunikationsausfall.\n" #: winerror.mc:3516 msgid "Unsupported authorization level.\n" @@ -6482,7 +6481,7 @@ #: winerror.mc:3536 msgid "Security package error.\n" -msgstr "Sicherheitspaket Fehler.\n" +msgstr "Sicherheitspaket-Fehler.\n" #: winerror.mc:3541 msgid "Thread not canceled.\n" @@ -6610,7 +6609,7 @@ #: winerror.mc:3696 msgid "RPC entry type mismatch.\n" -msgstr "Falscher Typ von RPC Eintrag.\n" +msgstr "Falscher Typ von RPC-Eintrag.\n" #: winerror.mc:3701 msgid "Not all objects could be exported.\n" @@ -6844,9 +6843,9 @@ "Protokollierung und Benutzeroberfläche für die oberen Befehle anpassen:\n" "\t/l[*][i|w|e|a|r|u|c|m|o|p|v|][+|!] Protokolldatei\n" "\t/q{|n|b|r|f|n+|b+|b-}\n" -"MSI Service registrieren:\n" +"MSI-Dienst registrieren:\n" "\t/y\n" -"Registrierung des MSI Service aufheben:\n" +"Registrierung des MSI-Dienstes aufheben:\n" "\t/z\n" "Diese Hilfe anzeigen:\n" "\t/help\n" @@ -6874,14 +6873,14 @@ #: msrle32.rc:31 msgid "Wine MS-RLE video codec" -msgstr "Wine MS-RLE Videodekoder" +msgstr "Wine-MS-RLE-Videodekoder" #: msrle32.rc:32 msgid "" "Wine MS-RLE video codec\n" "Copyright 2002 by Michael Guennewig" msgstr "" -"Wine MS-RLE Videodekoder\n" +"Wine-MS-RLE-Videodekoder\n" "Copyright 2002 Michael Günnewig" #: msvfw32.rc:33 @@ -6922,7 +6921,7 @@ #: msvidc32.rc:29 msgid "Wine Video 1 video codec" -msgstr "Wine Video 1 Video Codec" +msgstr "Wine-Video-1-Videocodec" #: oleacc.rc:31 msgid "unknown object" @@ -7150,15 +7149,15 @@ #: oleacc.rc:87 msgid "drop down button" -msgstr "Dropdown Schaltfläche" +msgstr "Dropdown-Schaltfläche" #: oleacc.rc:88 msgid "menu button" -msgstr "Menü Schaltfläche" +msgstr "Menü-Schaltfläche" #: oleacc.rc:89 msgid "grid drop down button" -msgstr "Raster Dropdown Schaltfläche" +msgstr "Raster-Dropdown-Schaltfläche" #: oleacc.rc:90 msgid "white space" @@ -7182,7 +7181,7 @@ #: oleacc.rc:95 msgid "outline button" -msgstr "Gliederung Schaltfläche" +msgstr "Gliederungs-Schaltfläche" #: oleacc.rc:97 msgctxt "object state" @@ -7360,72 +7359,72 @@ msgid "Off" msgstr "Aus" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Objekt einfügen" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Objekttyp:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Ergebnis" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "&Neu erstellen" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "S&teuerelement erstellen" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "A&us Datei erstellen" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "Steuerelement hin&zufügen..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "Als &Symbol anzeigen" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Durchsuchen..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "Datei:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Inhalte einfügen" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Quelle:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "E&infügen" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "&Verknüpfung einfügen" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "&Als:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "Als Sym&bol anzeigen" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "&Symbol ändern..." @@ -7457,19 +7456,27 @@ msgid "Add Control" msgstr "Steuerelement hinzufügen" -#: oledlg.rc:34 +#: oledlg.rc:35 msgid "&Convert..." msgstr "&Konvertieren..." +#: oledlg.rc:36 +msgid "%1 %2 &Object" +msgstr "%2-&Objekt %1" + +#: oledlg.rc:34 +msgid "%1 &Object" +msgstr "&Objekt %1" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "&Objekt" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "Fügt den Inhalt der Zwischenablage in Ihr Dokument als %s ein." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7477,7 +7484,7 @@ "Fügt den Inhalt der Zwischenablage so in Ihr Dokument ein, dass Sie ihn mit " "%s aktivieren können." -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." @@ -7485,7 +7492,7 @@ "Fügt den Inhalt der Zwischenablage so in Ihr Dokument ein, dass Sie ihn mit " "%s aktivieren können. Er wird als Symbol dargestellt." -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7495,7 +7502,7 @@ "sind mit der Ursprungsdatei verknüpft, so dass Änderungen an dieser in Ihrem " "Dokument erscheinen." -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7505,7 +7512,7 @@ "mit der Ursprungsdatei verknüpft, so dass Änderungen an dieser in Ihrem " "Dokument erscheinen." -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7515,19 +7522,19 @@ "zeigt. Die Verknüpfung ist mit der Ursprungsdatei verknüpft, so dass " "Änderungen an dieser in Ihrem Dokument erscheinen." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "Fügt den Inhalt der Zwischenablage in Ihr Dokument ein." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "Unbekannter Typ" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Unbekannte Quelle" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "dem Erzeugerprogramm" @@ -7862,11 +7869,11 @@ #: shdoclc.rc:235 msgid "Left Edge" -msgstr "Linke Ecke" +msgstr "Linker Rand" #: shdoclc.rc:236 msgid "Right Edge" -msgstr "Rechte Ecke" +msgstr "Rechter Rand" #: shdoclc.rc:238 msgid "Page Left" @@ -7886,7 +7893,7 @@ #: shdoclc.rc:28 msgid "Wine Internet Explorer" -msgstr "Wine Internet Explorer" +msgstr "Wine-Internet-Explorer" #: shdoclc.rc:33 msgid "&w&bPage &p" @@ -8009,7 +8016,7 @@ msgid "Message" msgstr "Meldung" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Ja" @@ -8017,7 +8024,7 @@ msgid "Yes to &all" msgstr "Ja zu &allen" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&Nein" @@ -8031,7 +8038,7 @@ #: shell32.rc:328 msgid "Running on %s" -msgstr "Wine Version %s" +msgstr "Wine-Version %s" #: shell32.rc:329 msgid "Wine was brought to you by:" @@ -8350,7 +8357,7 @@ "\n" "Wenn Dateien im Zielordner die gleichen Namen haben,\n" "werden diese durch Inhalte des Quellordners ersetzt.\n" -"Möchten sie trotzdem fortfahren?" +"Möchten Sie trotzdem fortfahren?" #: shell32.rc:238 msgid "New Folder" @@ -8358,7 +8365,7 @@ #: shell32.rc:240 msgid "Wine Control Panel" -msgstr "Wine Systemsteuerung" +msgstr "Wine-Systemsteuerung" #: shell32.rc:195 msgid "Unable to display Run File dialog box (internal error)" @@ -8445,7 +8452,7 @@ #: shell32.rc:256 msgid "Wine License" -msgstr "Wine Lizenz" +msgstr "Wine-Lizenz" #: shell32.rc:158 msgid "Trash" @@ -8499,7 +8506,7 @@ "When installed, an ActiveX component has full access to your computer. Do " "not click install unless you have absolute trust in the above source." msgstr "" -"Eine installierte ActiveX-Komponente hat Vollzugriff auf ihren Computer. " +"Eine installierte ActiveX-Komponente hat Vollzugriff auf Ihren Computer. " "Klicken Sie nicht auf Installieren, wenn Sie der obigen Quelle nicht absolut " "vertrauen." @@ -8552,23 +8559,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "Nächs&ter\tStrg+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "Abbr&uch" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "&Wiederholen" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Ignorieren" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "&Erneut versuchen" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "&Fortsetzen" @@ -8761,7 +8768,7 @@ "The current MIDI Mapper setup refers to a MIDI device that is not installed " "on the system." msgstr "" -"Die gegenwärtigen MIDI-Mapper Einstellungen beziehen sich auf ein MIDI-" +"Die gegenwärtigen MIDI-Mapper-Einstellungen beziehen sich auf ein MIDI-" "Gerät, das nicht installiert ist." #: winmm.rc:57 @@ -8769,7 +8776,7 @@ "The current MIDI setup is damaged. Copy the original MIDIMAP.CFG file to the " "Windows SYSTEM directory, and then try again." msgstr "" -"Das aktuelle MIDI-Setup ist beschädigt. Kopieren sie die ursprüngliche Datei " +"Das aktuelle MIDI-Setup ist beschädigt. Kopieren Sie die ursprüngliche Datei " "MIDIMAP.CFG in das Windows-Systemverzeichnis und versuchen Sie es erneut." #: winmm.rc:60 @@ -9378,7 +9385,7 @@ #: wldap32.rc:66 msgid "Alias Dereference Problem" -msgstr "Alias Dereferenzierungsproblem" +msgstr "Alias-Dereferenzierungsproblem" #: wldap32.rc:78 msgid "Inappropriate Authentication" @@ -9494,7 +9501,7 @@ #: wldap32.rc:122 msgid "Operation not supported by this version of the LDAP protocol" -msgstr "Operation durch diese Version des LDAP-Protokoll nicht unterstützt" +msgstr "Operation durch diese Version des LDAP-Protokolls nicht unterstützt" #: wldap32.rc:123 msgid "Specified control was not found in message" @@ -9560,10 +9567,10 @@ "\n" " + Setzt ein Attribut.\n" " - Löscht ein Attribut.\n" -" R Schreibschutz Dateiattribut.\n" -" A Archiv Dateiattribut.\n" -" S System Dateiattribut.\n" -" H Verbergen Dateiattribut.\n" +" R Schreibschutz-Dateiattribut.\n" +" A Archiv-Dateiattribut.\n" +" S System-Dateiattribut.\n" +" H Verbergen-Dateiattribut.\n" " [Laufwerk:][Pfad][Dateiname]\n" " Gibt eine Datei oder mehrere Dateien für attrib an.\n" " /S Zutreffende Dateien im aktuellen Verzeichnis und Unterverzeichnissen " @@ -9646,7 +9653,7 @@ #: cmd.rc:56 msgid "CTTY changes the input/output device.\n" -msgstr "CTTY Ändert das Eingabe/Ausgabe - Gerät.\n" +msgstr "CTTY ändert das Eingabe/Ausgabe - Gerät.\n" #: cmd.rc:59 msgid "DATE shows or changes the system date.\n" @@ -9860,11 +9867,11 @@ "unmittelbar danach), erscheint am Zeilenanfang, wenn cmd auf Eingabe\n" "wartet.\n" "\n" -"Die folgenden Zeichen haben eine besondere Bedeutung:\n" +"Die folgenden Zeichenketten haben eine besondere Bedeutung:\n" "\n" "$$ Dollarzeichen $_ Zeilenvorschub $b Pipe-Zeichen (|)\n" -"$d aktuelles Datum $e Escape $g > Zeichen\n" -"$l < Zeichen $n aktuelles Laufwerk $p aktueller Pfad\n" +"$d aktuelles Datum $e Escape $g Größerzeichen (>)\n" +"$l Kleinerzeichen (<) $n aktuelles Laufwerk $p aktueller Pfad\n" "$q Gleichheitszeichen $t aktuelle Zeit $v cmd-Version\n" "\n" "Hinweis: Eingabe des PROMPT-Befehls ohne Argumente setzt den Prompt auf\n" @@ -10008,7 +10015,7 @@ #: cmd.rc:237 msgid "TIME sets or shows the current system time.\n" -msgstr "TIME Setzt oder zeigt die aktuelle Systemzeit an.\n" +msgstr "TIME setzt oder zeigt die aktuelle Systemzeit an.\n" #: cmd.rc:240 msgid "TITLE sets the window title for the cmd window.\n" @@ -10033,14 +10040,14 @@ "\n" "The verify flag has no function in Wine.\n" msgstr "" -"VERIFY wird benutzt, um das Verify Flag zu setzen, zu löschen oder zu\n" +"VERIFY wird benutzt, um das Verify-Flag zu setzen, zu löschen oder zu\n" "testen. Gültige Eingaben sind:\n" "\n" "VERIFY ON\tSetzt das Flag.\n" "VERIFY OFF\tLöscht das Flag.\n" "VERIFY\t\tZeigt an, ob ON oder OFF verwendet wird.\n" "\n" -"Das Verify Flag hat keine Funktion in Wine.\n" +"Das Verify-Flag hat keine Funktion in Wine.\n" #: cmd.rc:256 msgid "VER displays the version of cmd you are running.\n" @@ -10048,7 +10055,7 @@ #: cmd.rc:259 msgid "VOL shows the volume label of a disk device.\n" -msgstr "VOL zeigt die Datenträgernummer an.\n" +msgstr "VOL zeigt die Datenträgerbezeichnung an.\n" #: cmd.rc:263 msgid "" @@ -10198,7 +10205,7 @@ msgstr "" "In CMD eingebaute Befehle sind:\n" "ASSOC\t\tZeigt oder ändert die Zuordnung von Dateierweiterungen\n" -"ATTRIB\t\tZeigt oder ändert die DOS Dateieigenschaften\n" +"ATTRIB\t\tZeigt oder ändert die DOS-Dateieigenschaften\n" "CALL\t\tRuft eine Batch-Datei innerhalb einer anderen auf\n" "CD (CHDIR)\tWechselt in ein Verzeichnis\n" "CHOICE\t\tWartet auf einen Tastendruck aus einer wählbaren Liste\n" @@ -10238,7 +10245,7 @@ #: cmd.rc:353 msgid "Are you sure?" -msgstr "Sind sie sicher?" +msgstr "Sind Sie sicher?" #: cmd.rc:354 xcopy.rc:43 msgctxt "Yes key" @@ -10363,7 +10370,7 @@ #: cmd.rc:384 msgid "Wine Command Prompt" -msgstr "Wine Befehlsprozessor" +msgstr "Wine-Befehlsprozessor" #: cmd.rc:385 msgid "Microsoft Windows %1!S!\n" @@ -10397,7 +10404,7 @@ msgid "" "Can't recognize '%1' as an internal or external command, or batch script.\n" msgstr "" -"'%1' konnte nicht als interner oder externer Befehl,\n" +"'%1' konnte nicht als interner oder externer Befehl\n" "oder als Batch-Skript erkannt werden.\n" #: cmd.rc:393 @@ -10426,7 +10433,7 @@ #: dxdiag.rc:30 msgid "DirectX Diagnostic Tool" -msgstr "DirectX Diagnosewerkzeug" +msgstr "DirectX-Diagnosewerkzeug" #: dxdiag.rc:31 msgid "Usage: dxdiag [/whql:off | /whql:on] [/t filename | /x filename]" @@ -10434,7 +10441,7 @@ #: explorer.rc:31 msgid "Wine Explorer" -msgstr "Wine Explorer" +msgstr "Wine-Explorer" #: explorer.rc:33 msgid "Start" @@ -10482,7 +10489,7 @@ #: ipconfig.rc:36 msgid "IPv4 address" -msgstr "IPv4 Adresse" +msgstr "IPv4-Adresse" #: ipconfig.rc:37 msgid "Hostname" @@ -10522,11 +10529,11 @@ #: ipconfig.rc:49 msgid "Default gateway" -msgstr "Standard Gateway" +msgstr "Standardgateway" #: ipconfig.rc:50 msgid "IPv6 address" -msgstr "IPv6 Adresse" +msgstr "IPv6-Adresse" #: net.rc:30 msgid "" @@ -10594,27 +10601,27 @@ #: net.rc:37 msgid "The %1 service is starting.\n" -msgstr "Der %1 Dienst startet.\n" +msgstr "Der Dienst %1 startet.\n" #: net.rc:38 msgid "The %1 service was started successfully.\n" -msgstr "Der %1 Dienst wurde erfolgreich gestartet.\n" +msgstr "Der Dienst %1 wurde erfolgreich gestartet.\n" #: net.rc:39 msgid "The %1 service failed to start.\n" -msgstr "Der Start des %1 Dienstes ist fehlgeschlagen.\n" +msgstr "Der Start des Dienstes %1 ist fehlgeschlagen.\n" #: net.rc:40 msgid "The %1 service is stopping.\n" -msgstr "Der %1 Dienst wird gestoppt.\n" +msgstr "Der Dienst %1 wird gestoppt.\n" #: net.rc:41 msgid "The %1 service was stopped successfully.\n" -msgstr "Der %1 Dienst wurde erfolgreich beendet.\n" +msgstr "Der Dienst %1 wurde erfolgreich beendet.\n" #: net.rc:42 msgid "The %1 service failed to stop.\n" -msgstr "Der %1 Dienst konnte nicht beendet werden.\n" +msgstr "Der Dienst %1 konnte nicht beendet werden.\n" #: net.rc:44 msgid "There are no entries in the list.\n" @@ -10696,11 +10703,11 @@ #: netstat.rc:39 msgid "Unicast packets" -msgstr "Unicast Pakete" +msgstr "Unicast-Pakete" #: netstat.rc:40 msgid "Non-unicast packets" -msgstr "Nicht-Unicast Pakete" +msgstr "Nicht-Unicast-Pakete" #: netstat.rc:41 msgid "Discards" @@ -11024,15 +11031,15 @@ #: oleview.rc:42 msgid "&CoCreateInstance Flag" -msgstr "&CoCreateInstance Flag" +msgstr "&CoCreateInstance-Flag" #: oleview.rc:44 msgid "&In-process server" -msgstr "&In-Prozess Server" +msgstr "&In-Prozess-Server" #: oleview.rc:45 msgid "In-process &handler" -msgstr "In-Prozess &Handler" +msgstr "In-Prozess-&Handler" #: oleview.rc:46 msgid "&Local server" @@ -11064,7 +11071,7 @@ #: oleview.rc:57 msgid "Copy &HTML object Tag to clipboard" -msgstr "&HTML Objekt-Tag in Zwischenablage kopieren" +msgstr "&HTML-Objekt-Tag in Zwischenablage kopieren" #: oleview.rc:63 msgid "&Expert mode" @@ -11172,7 +11179,7 @@ #: oleview.rc:99 msgid "OleView - OLE/COM Object Viewer" -msgstr "OleView - OLE/COM Objektbetrachter" +msgstr "OleView - OLE/COM-Objektbetrachter" #: oleview.rc:100 msgid "version 1.0" @@ -11180,7 +11187,7 @@ #: oleview.rc:103 msgid "TypeLib files (*.tlb; *.olb; *.dll; *.ocx; *.exe)" -msgstr "TypeLib Dateien (*.tlb; *.olb; *.dll; *.ocx; *.exe)" +msgstr "TypeLib-Dateien (*.tlb; *.olb; *.dll; *.ocx; *.exe)" #: oleview.rc:106 msgid "Bind to file via a File Moniker" @@ -11192,7 +11199,7 @@ #: oleview.rc:108 msgid "Change machine wide Distributed COM settings" -msgstr "Maschinenweite Distributed COM Einstellungen ändern" +msgstr "Maschinenweite Distributed-COM-Einstellungen ändern" #: oleview.rc:109 msgid "Run the Wine registry editor" @@ -11200,7 +11207,7 @@ #: oleview.rc:110 msgid "Quit the application. Prompts to save changes" -msgstr "Anwendung beenden. Frag ob Änderungen zu speichern sind" +msgstr "Anwendung beenden. Fragt ob Änderungen zu speichern sind" #: oleview.rc:111 msgid "Create an instance of the selected object" @@ -11251,11 +11258,11 @@ #: oleview.rc:116 msgid "Ask for an in-process server when calling CoGetClassObject" -msgstr "Für Aufruf von CoGetClassObject nach In-Prozess Server fragen" +msgstr "Für Aufruf von CoGetClassObject nach In-Prozess-Server fragen" #: oleview.rc:117 msgid "Ask for an in-process handler when calling CoGetClassObject" -msgstr "Für Aufruf von CoGetClassObject nach In-Prozess Handler fragen" +msgstr "Für Aufruf von CoGetClassObject nach In-Prozess-Handler fragen" #: oleview.rc:118 msgid "Ask for a local server when calling CoGetClassObject" @@ -11812,7 +11819,7 @@ #: regedit.rc:197 msgid "Win9x/NT4 Registry files (REGEDIT4)" -msgstr "Win9x/NT4 Registrierungsdateien (REGEDIT4)" +msgstr "Win9x/NT4-Registrierungsdateien (REGEDIT4)" #: regedit.rc:204 msgid "(Default)" @@ -11965,7 +11972,7 @@ "Provides DLL registration services.\n" "\n" msgstr "" -"Wine DLL-Registrierungswerkzeug\n" +"Wine-DLL-Registrierungswerkzeug\n" "\n" "Stellt Dienste zur DLL-Registrierung bereit.\n" "\n" @@ -12086,23 +12093,23 @@ #: taskkill.rc:36 msgid "Close message sent to top-level windows of process with PID %1!u!.\n" msgstr "" -"Ein Beendigungssignal wurde an die Top-Level Fenster des Prozesses mit der " +"Ein Beendigungssignal wurde an die Top-Level-Fenster des Prozesses mit der " "PID %1!u! geschickt.\n" #: taskkill.rc:37 msgid "" "Close message sent to top-level windows of process \"%1\" with PID %2!u!.\n" msgstr "" -"Ein Beendigungssignal wurde an die Top-Level Fenster des Prozesses \"%1\" " +"Ein Beendigungssignal wurde an die Top-Level-Fenster des Prozesses \"%1\" " "mit der PID %2!u! geschickt.\n" #: taskkill.rc:38 msgid "Process with PID %1!u! was forcibly terminated.\n" -msgstr "Prozess mit der PID %1!u! wurde zum beenden gezwungen.\n" +msgstr "Prozess mit der PID %1!u! wurde zum Beenden gezwungen.\n" #: taskkill.rc:39 msgid "Process \"%1\" with PID %2!u! was forcibly terminated.\n" -msgstr "Prozess \"%1\" mit der PID %2!u! wurde zum beenden gezwungen.\n" +msgstr "Prozess \"%1\" mit der PID %2!u! wurde zum Beenden gezwungen.\n" #: taskkill.rc:40 msgid "Error: Could not find process \"%1\".\n" @@ -12110,7 +12117,7 @@ #: taskkill.rc:41 msgid "Error: Unable to enumerate the process list.\n" -msgstr "Fehler: Konnte die Prozessliste nicht Enumerieren.\n" +msgstr "Fehler: Konnte die Prozessliste nicht enumerieren.\n" #: taskkill.rc:42 msgid "Error: Unable to terminate process \"%1\".\n" @@ -12170,7 +12177,7 @@ #: taskmgr.rc:69 taskmgr.rc:258 msgid "&CPU History" -msgstr "&CPU Verlauf" +msgstr "&CPU-Verlauf" #: taskmgr.rc:71 taskmgr.rc:259 msgid "&One Graph, All CPUs" @@ -12266,11 +12273,11 @@ #: taskmgr.rc:364 msgid "&Show processes from all users" -msgstr "P&rozesse aller Benutzern anzeigen" +msgstr "P&rozesse aller Benutzer anzeigen" #: taskmgr.rc:372 msgid "CPU usage" -msgstr "CPU Auslastung" +msgstr "CPU-Auslastung" #: taskmgr.rc:373 msgid "Mem usage" @@ -12608,7 +12615,7 @@ #: taskmgr.rc:190 msgid "Task Manager is minimized when a SwitchTo operation is performed" msgstr "" -"Der Task-Manager minimiert sich, wenn eine 'Wechseln zu' Operation " +"Der Task-Manager minimiert sich, wenn eine 'Wechseln zu'-Operation " "ausgeführt wird" #: taskmgr.rc:191 @@ -12719,7 +12726,7 @@ #: taskmgr.rc:229 msgid "Restores the Task Manager from its hidden state" -msgstr "Stellt den Task-Manager von seiner versteckten Status wieder her" +msgstr "Stellt den Task-Manager aus seinem versteckten Status wieder her" #: taskmgr.rc:230 msgid "Removes the process from the system" @@ -12748,7 +12755,7 @@ #: taskmgr.rc:240 msgid "Sets process to the ABOVE NORMAL priority class" -msgstr "Setzt den Prozess in die HÖHER ALS NORMAL-Prioritätsklasse" +msgstr "Setzt den Prozess in die HÖHER-ALS-NORMAL-Prioritätsklasse" #: taskmgr.rc:242 msgid "Sets process to the NORMAL priority class" @@ -12756,7 +12763,7 @@ #: taskmgr.rc:244 msgid "Sets process to the BELOW NORMAL priority class" -msgstr "Setzt den Prozess in die NIEDRIGER ALS NORMAL-Prioritätsklasse" +msgstr "Setzt den Prozess in die NIEDRIGER-ALS-NORMAL-Prioritätsklasse" #: taskmgr.rc:245 msgid "Sets process to the LOW priority class" @@ -12848,7 +12855,7 @@ #: taskmgr.rc:301 msgid "Task Manager Warning" -msgstr "Task Manager Warnung" +msgstr "Task-Manager-Warnung" #: taskmgr.rc:304 msgid "" @@ -12908,7 +12915,7 @@ #: taskmgr.rc:322 msgid "System Idle Process" -msgstr "Leerlauf Prozess" +msgstr "Leerlaufprozess" #: taskmgr.rc:323 msgid "Not Responding" @@ -12924,7 +12931,7 @@ #: uninstaller.rc:29 msgid "Wine Application Uninstaller" -msgstr "Wine Anwendungsentferner" +msgstr "Wine-Anwendungsentferner" #: uninstaller.rc:30 msgid "" @@ -12938,18 +12945,17 @@ #: uninstaller.rc:31 msgid "uninstaller: The application with GUID '%1' was not found\n" -msgstr "" +msgstr "Uninstaller: Die Anwendung mit der GUID '%1' wurde nicht gefunden\n" #: uninstaller.rc:32 msgid "" "uninstaller: The option '--remove' must be followed by an application GUID\n" msgstr "" +"Uninstaller: Auf die Option '--remove' muss eine Anwendungs-GUID folgen\n" #: uninstaller.rc:33 -#, fuzzy -#| msgid "Error: Invalid option '%c'.\n" msgid "uninstaller: Invalid option [%1]\n" -msgstr "Fehler: Ungültige Option '%c'.\n" +msgstr "Uninstaller: Ungültige Option [%1]\n" #: uninstaller.rc:35 msgid "" @@ -12958,6 +12964,10 @@ "Uninstall applications from the current Wine prefix.\n" "\n" msgstr "" +"Wine-Anwendungsentferner\n" +"\n" +"Deinstalliert Anwendungen aus dem aktuellen Wineprefix.\n" +"\n" #: uninstaller.rc:43 msgid "" @@ -12972,6 +12982,17 @@ " [no option] Launch the graphical version of this program.\n" "\n" msgstr "" +"Aufruf:\n" +" uninstaller [Optionen]\n" +"\n" +"Optionen:\n" +" --help\t Zeigt diese Hilfe an.\n" +" --list\t Zeigt alle im aktuellen Wineprefix installierten Anwendungen " +"an.\n" +" --remove {GUID} Deinstalliert die angegebene Anwendung.\n" +"\t\t Benutzen Sie '--list', um die Anwendungs-GUID zu bestimmen.\n" +" [keine Option] Startet die grafische Version dieses Programms.\n" +"\n" #: view.rc:36 msgid "&Pan" @@ -12991,7 +13012,7 @@ #: view.rc:49 msgid "Regular Metafile Viewer" -msgstr "Regulärer Metafile Betrachter" +msgstr "Regulärer Metafile-Betrachter" #: wineboot.rc:31 msgid "Waiting for Program" @@ -13035,7 +13056,7 @@ #: winecfg.rc:143 msgid "Windows registration information" -msgstr "Windows Registrierungs-Informationen" +msgstr "Windows-Registrierungsinformationen" #: winecfg.rc:144 msgid "&Owner:" @@ -13102,7 +13123,7 @@ #: winecfg.rc:184 msgid "This is a sample text using 10 point Tahoma" -msgstr "Dies ist ein Beispieltext in 10 Punkt Tahoma" +msgstr "Dies ist ein Beispieltext in 10-Punkt-Tahoma" #: winecfg.rc:191 msgid "DLL overrides" @@ -13765,7 +13786,7 @@ #: wineconsole.rc:44 msgid "wineconsole: Couldn't parse event id\n" -msgstr "wineconsole: Ereignis-ID konnte nicht geparsed werden\n" +msgstr "wineconsole: Parsen der Ereignis-ID fehlgeschlagen\n" #: wineconsole.rc:45 msgid "wineconsole: Invalid backend\n" @@ -13875,7 +13896,7 @@ #: winedbg.rc:38 msgid "Wine program crash" -msgstr "Wine Programmabsturz" +msgstr "Wine-Programmabsturz" #: winedbg.rc:39 msgid "Internal errors - invalid parameters received" @@ -13971,7 +13992,7 @@ #: winefile.rc:84 msgid "&About Wine File Manager" -msgstr "&Über Wine Dateimanager" +msgstr "&Über Wine-Dateimanager" #: winefile.rc:125 msgid "Select destination" @@ -14060,7 +14081,7 @@ #: winefile.rc:96 msgid "Wine File Manager" -msgstr "Wine Dateimanager" +msgstr "Wine-Dateimanager" #: winefile.rc:98 msgid "root fs" @@ -14247,7 +14268,7 @@ #: winhlp32.rc:59 msgid "&About Wine Help" -msgstr "&Über Wine Hilfe" +msgstr "&Über Wine-Hilfe" #: winhlp32.rc:67 msgid "Annotation..." @@ -14267,7 +14288,7 @@ #: winhlp32.rc:81 msgid "Wine Help" -msgstr "Wine Hilfe" +msgstr "Wine-Hilfe" #: winhlp32.rc:86 msgid "Error while reading the help file `%s'" @@ -14409,7 +14430,7 @@ #: wordpad.rc:96 msgid "&About Wine Wordpad" -msgstr "Ü&ber Wine Wordpad" +msgstr "Ü&ber Wine-Wordpad" #: wordpad.rc:133 msgid "Automatic" diff -Nru wine1.7-1.7.50/po/el.po wine1.7-1.7.55/po/el.po --- wine1.7-1.7.50/po/el.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/el.po 2015-11-13 14:32:40.000000000 +0000 @@ -53,20 +53,19 @@ msgstr "" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "" @@ -133,19 +132,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Άκυρο" @@ -297,7 +296,7 @@ msgid "&Apply" msgstr "&Εφαρμογή" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Βοήθεια" @@ -332,7 +331,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7362,76 +7361,76 @@ msgid "Off" msgstr "Ανενεργό" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "" -#: oledlg.rc:63 +#: oledlg.rc:65 #, fuzzy msgid "Create New" msgstr "Δημιουργία νέου καταλόγου" -#: oledlg.rc:65 +#: oledlg.rc:67 #, fuzzy msgid "Create Control" msgstr "&Περιεχόμενα" -#: oledlg.rc:67 +#: oledlg.rc:69 #, fuzzy msgid "Create From File" msgstr "Δημιουργία νέου καταλόγου" -#: oledlg.rc:70 +#: oledlg.rc:72 #, fuzzy msgid "&Add Control..." msgstr "&Περιεχόμενα" -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "" -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "" @@ -7459,66 +7458,74 @@ msgid "Add Control" msgstr "" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy msgid "&Convert..." msgstr "Εκτύπωση" +#: oledlg.rc:36 +msgid "%1 %2 &Object" +msgstr "" + +#: oledlg.rc:34 +msgid "%1 &Object" +msgstr "" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "" -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." msgstr "" -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." msgstr "" -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " "your document." msgstr "" -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " "in your document." msgstr "" -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " "be reflected in your document." msgstr "" -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "" -#: oledlg.rc:46 +#: oledlg.rc:48 #, fuzzy msgid "Unknown Type" msgstr "&Περιεχόμενα" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "" @@ -8005,7 +8012,7 @@ msgid "Message" msgstr "" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "" @@ -8013,7 +8020,7 @@ msgid "Yes to &all" msgstr "" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 #, fuzzy msgid "&No" msgstr "όχι" @@ -8529,23 +8536,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "" -#: user32.rc:88 +#: user32.rc:87 #, fuzzy msgid "&Continue" msgstr "&Περιεχόμενα" diff -Nru wine1.7-1.7.50/po/en.po wine1.7-1.7.55/po/en.po --- wine1.7-1.7.50/po/en.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/en.po 2015-11-13 14:32:40.000000000 +0000 @@ -57,20 +57,19 @@ msgstr "Support Information" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "OK" @@ -140,19 +139,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Cancel" @@ -313,7 +312,7 @@ msgid "&Apply" msgstr "&Apply" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Help" @@ -348,7 +347,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7348,72 +7347,72 @@ msgid "Off" msgstr "Off" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Insert Object" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Object Type:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Result" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Create New" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Create Control" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Create From File" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "&Add Control..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "Display As Icon" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Browse..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "File:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Paste Special" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Source:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "&Paste" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "Paste &Link" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "&As:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "&Display As Icon" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "Change &Icon..." @@ -7445,19 +7444,27 @@ msgid "Add Control" msgstr "Add Control" -#: oledlg.rc:34 +#: oledlg.rc:35 msgid "&Convert..." msgstr "&Convert..." +#: oledlg.rc:36 +msgid "%1 %2 &Object" +msgstr "%1 %2 &Object" + +#: oledlg.rc:34 +msgid "%1 &Object" +msgstr "%1 &Object" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "&Object" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "Inserts the contents of the clipboard into your document as %s." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7465,7 +7472,7 @@ "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." @@ -7473,7 +7480,7 @@ "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7483,7 +7490,7 @@ "linked to the source file so that changes to the file will be reflected in " "your document." -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7493,7 +7500,7 @@ "is linked to the source file so that changes to the file will be reflected " "in your document." -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7503,19 +7510,19 @@ "The shortcut is linked to the source file so that changes to the file will " "be reflected in your document." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "Inserts the contents of the clipboard into your document." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "Unknown Type" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Unknown Source" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "the program which created it" @@ -7997,7 +8004,7 @@ msgid "Message" msgstr "Message" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Yes" @@ -8005,7 +8012,7 @@ msgid "Yes to &all" msgstr "Yes to &all" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&No" @@ -8533,23 +8540,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "Nex&t\tCtrl+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "&Abort" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "&Retry" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Ignore" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "&Try Again" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "&Continue" diff -Nru wine1.7-1.7.50/po/en_US.po wine1.7-1.7.55/po/en_US.po --- wine1.7-1.7.50/po/en_US.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/en_US.po 2015-11-13 14:32:40.000000000 +0000 @@ -57,20 +57,19 @@ msgstr "Support Information" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "OK" @@ -140,19 +139,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Cancel" @@ -313,7 +312,7 @@ msgid "&Apply" msgstr "&Apply" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Help" @@ -348,7 +347,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7348,72 +7347,72 @@ msgid "Off" msgstr "Off" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Insert Object" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Object Type:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Result" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Create New" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Create Control" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Create From File" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "&Add Control..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "Display As Icon" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Browse..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "File:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Paste Special" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Source:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "&Paste" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "Paste &Link" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "&As:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "&Display As Icon" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "Change &Icon..." @@ -7445,19 +7444,27 @@ msgid "Add Control" msgstr "Add Control" -#: oledlg.rc:34 +#: oledlg.rc:35 msgid "&Convert..." msgstr "&Convert..." +#: oledlg.rc:36 +msgid "%1 %2 &Object" +msgstr "%1 %2 &Object" + +#: oledlg.rc:34 +msgid "%1 &Object" +msgstr "%1 &Object" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "&Object" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "Inserts the contents of the clipboard into your document as %s." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7465,7 +7472,7 @@ "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." @@ -7473,7 +7480,7 @@ "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7483,7 +7490,7 @@ "linked to the source file so that changes to the file will be reflected in " "your document." -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7493,7 +7500,7 @@ "is linked to the source file so that changes to the file will be reflected " "in your document." -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7503,19 +7510,19 @@ "The shortcut is linked to the source file so that changes to the file will " "be reflected in your document." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "Inserts the contents of the clipboard into your document." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "Unknown Type" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Unknown Source" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "the program which created it" @@ -7997,7 +8004,7 @@ msgid "Message" msgstr "Message" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Yes" @@ -8005,7 +8012,7 @@ msgid "Yes to &all" msgstr "Yes to &all" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&No" @@ -8533,23 +8540,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "Nex&t\tCtrl+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "&Abort" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "&Retry" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Ignore" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "&Try Again" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "&Continue" diff -Nru wine1.7-1.7.50/po/eo.po wine1.7-1.7.55/po/eo.po --- wine1.7-1.7.50/po/eo.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/eo.po 2015-11-13 14:32:40.000000000 +0000 @@ -62,20 +62,19 @@ msgstr "Informoj pri Helpo" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "Bone" @@ -138,19 +137,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Rezigni" @@ -304,7 +303,7 @@ msgid "&Apply" msgstr "&Apliki" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Helpo" @@ -339,7 +338,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7278,72 +7277,72 @@ msgid "Off" msgstr "Malŝaltita" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Krei Novan" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Regado" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Krei Novan Dosieron" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "&Aldoni umaĵon..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "" -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "Dosiero:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Fonto:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "&Alglui" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "Alglui &ligilon" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "&Kiel:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "Ŝanĝi &piktogramon..." @@ -7371,66 +7370,74 @@ msgid "Add Control" msgstr "" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "&Tiparo..." +#: oledlg.rc:36 +msgid "%1 %2 &Object" +msgstr "" + +#: oledlg.rc:34 +msgid "%1 &Object" +msgstr "" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "" -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." msgstr "" -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." msgstr "" -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " "your document." msgstr "" -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " "in your document." msgstr "" -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " "be reflected in your document." msgstr "" -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "" -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "" @@ -7910,7 +7917,7 @@ msgid "Message" msgstr "Mesaĝo" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Jes" @@ -7918,7 +7925,7 @@ msgid "Yes to &all" msgstr "Jes al &ĉio" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&Ne" @@ -8429,23 +8436,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "&Sekva\tStir+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "&Nuligi" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "&Reprovi" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Ignori" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "&Reprovi" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "&Daŭrigi" diff -Nru wine1.7-1.7.50/po/es.po wine1.7-1.7.55/po/es.po --- wine1.7-1.7.50/po/es.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/es.po 2015-11-13 14:32:40.000000000 +0000 @@ -57,20 +57,19 @@ msgstr "Información de Soporte" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "Aceptar" @@ -141,19 +140,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Cancelar" @@ -325,7 +324,7 @@ msgid "&Apply" msgstr "&Aplicar" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Ayuda" @@ -360,7 +359,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7480,72 +7479,72 @@ msgid "Off" msgstr "Desactivado" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Insertar objeto" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Tipo de objeto:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Resultado" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Crear nuevo" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Crear control" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Crear desde archivo" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "&Añadir control..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "Mostrar como icono" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Buscar..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "Archivo:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Pegado especial" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Origen:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "&Pegar" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "Pegar &enlace" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "&Como:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "&Mostrar como icono" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "Cambiar &icono..." @@ -7577,21 +7576,33 @@ msgid "Add Control" msgstr "Añadir control" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "&Fuente..." +#: oledlg.rc:36 +#, fuzzy +#| msgid "&Object" +msgid "%1 %2 &Object" +msgstr "&Objeto" + +#: oledlg.rc:34 +#, fuzzy +#| msgid "&Object" +msgid "%1 &Object" +msgstr "&Objeto" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "&Objeto" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "Inserta el contenido del portapapeles en su documento como %s." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7599,7 +7610,7 @@ "Inserta el contenido del portapapeles en su documento de modo que pueda " "activarlo usando %s." -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." @@ -7607,7 +7618,7 @@ "Inserta el contenido del portapapeles en su documento de modo que pueda " "activarlo usando %s. Será mostrado como un icono." -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7617,7 +7628,7 @@ "estarán enlazados al archivo de origen, por lo que los cambios en el archivo " "se reflejarán en su documento." -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7627,7 +7638,7 @@ "estará enlazada al archivo de origen, por lo que los cambios en el archivo " "se reflejarán en su documento." -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7637,19 +7648,19 @@ "portapapeles. El acceso directo estará enlazado al archivo de origen, por lo " "que los cambios en el archivo se reflejarán en su documento." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "Inserta el contenido del portapapeles en su documento." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "Tipo desconocido" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Origen desconocido" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "el programa que lo creó" @@ -8132,7 +8143,7 @@ msgid "Message" msgstr "Mensaje" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Sí" @@ -8140,7 +8151,7 @@ msgid "Yes to &all" msgstr "Sí a &todo" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&No" @@ -8679,23 +8690,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "Siguien&te\t\tCtrl+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "A&bortar" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "&Reintentar" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Ignorar" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "&Volver a Intentar" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "&Continuar" diff -Nru wine1.7-1.7.50/po/fa.po wine1.7-1.7.55/po/fa.po --- wine1.7-1.7.50/po/fa.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/fa.po 2015-11-13 14:32:40.000000000 +0000 @@ -54,20 +54,19 @@ msgstr "اطلاعات" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "قبول" @@ -133,19 +132,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "انصراف" @@ -296,7 +295,7 @@ msgid "&Apply" msgstr "" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 #, fuzzy msgid "Help" msgstr "&کمک" @@ -332,7 +331,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7342,77 +7341,77 @@ msgid "Off" msgstr "" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "" -#: oledlg.rc:65 +#: oledlg.rc:67 #, fuzzy msgid "Create Control" msgstr "&محتویات" -#: oledlg.rc:67 +#: oledlg.rc:69 #, fuzzy msgid "Create From File" msgstr "&پرونده" -#: oledlg.rc:70 +#: oledlg.rc:72 #, fuzzy msgid "&Add Control..." msgstr "&محتویات" -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "" -#: oledlg.rc:74 +#: oledlg.rc:76 #, fuzzy msgid "File:" msgstr "&پرونده" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 #, fuzzy msgid "&Paste" msgstr "&چسباندن\tCtrl+V" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "" @@ -7440,66 +7439,74 @@ msgid "Add Control" msgstr "" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "&قلم‌ها..." +#: oledlg.rc:36 +msgid "%1 %2 &Object" +msgstr "" + +#: oledlg.rc:34 +msgid "%1 &Object" +msgstr "" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "" -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." msgstr "" -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." msgstr "" -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " "your document." msgstr "" -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " "in your document." msgstr "" -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " "be reflected in your document." msgstr "" -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "" -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "" @@ -7995,7 +8002,7 @@ msgid "Message" msgstr "" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "" @@ -8003,7 +8010,7 @@ msgid "Yes to &all" msgstr "" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "" @@ -8522,24 +8529,24 @@ msgid "Nex&t\tCtrl+F6" msgstr "" -#: user32.rc:82 +#: user32.rc:81 #, fuzzy msgid "&Abort" msgstr "&درباره نت‌پد" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "" -#: user32.rc:88 +#: user32.rc:87 #, fuzzy msgid "&Continue" msgstr "&محتویات" diff -Nru wine1.7-1.7.50/po/fi.po wine1.7-1.7.55/po/fi.po --- wine1.7-1.7.50/po/fi.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/fi.po 2015-11-13 14:32:40.000000000 +0000 @@ -56,20 +56,19 @@ msgstr "Tukitietoja" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "OK" @@ -138,19 +137,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Peruuta" @@ -309,7 +308,7 @@ msgid "&Apply" msgstr "&Käytä" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Ohje" @@ -344,7 +343,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7344,72 +7343,72 @@ msgid "Off" msgstr "Pois päältä" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Lisää objekti" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Objektityyppi:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Tulos" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Luo uusi" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Luo kontrolli" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Luo tiedostosta" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "Lisää kontrolli..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "Näytä kuvakkeena" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Selaa..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "Tiedosto:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Liitä erityinen" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Lähde:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "L&iitä" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "&Liitä linkki" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "&Muoto:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "&Näytä kuvakkeena" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "&Vaihda kuvaketta..." @@ -7441,19 +7440,27 @@ msgid "Add Control" msgstr "Lisää kontrolli" -#: oledlg.rc:34 +#: oledlg.rc:35 msgid "&Convert..." msgstr "&Muunna..." +#: oledlg.rc:36 +msgid "%1 %2 &Object" +msgstr "%1 %2 &Objekti" + +#: oledlg.rc:34 +msgid "%1 &Object" +msgstr "%1 &Objekti" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "&Objekti" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "Lisää leikepöydän sisällön dokumenttiisi tyyppinä %s." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7461,7 +7468,7 @@ "Lisää leikepöydän sisällön dokumenttiisi niin, että voit aktivoida sen %s:" "lla." -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." @@ -7469,7 +7476,7 @@ "Lisää leikepöydän sisällön dokumenttiisi niin, että voit aktivoida sen %s:" "lla. Se näytetään kuvakkeena." -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7478,7 +7485,7 @@ "Lisää leikepöydän sisällön dokumenttiisi tyyppinä %s. Data on linkitetty " "lähdetiedostoon, joten muutokset tiedostoon vaikuttavat dokumenttiisi." -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7487,7 +7494,7 @@ "Lisää kuvan leikepöydän sisällöstä dokumenttiisi. Kuva on linkitetty " "lähdetiedostoon, joten muutokset tiedostoon vaikuttavat dokumenttiisi." -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7497,19 +7504,19 @@ "linkitetty lähdetiedostoon, joten muutokset tiedostoon vaikuttavat " "dokumenttiisi." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "Lisää leikepöydän sisällön dokumenttiisi." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "Tuntematon tyyppi" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Tuntematon lähde" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "ohjelma, joka loi sen" @@ -7991,7 +7998,7 @@ msgid "Message" msgstr "Viesti" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Kyllä" @@ -7999,7 +8006,7 @@ msgid "Yes to &all" msgstr "Kyllä k&aikkiin" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&Ei" @@ -8526,23 +8533,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "&Seuraava\tCtrl+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "&Keskeytä" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "&Uudelleen" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Hylkää" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "&Yritä uudelleen" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "&Jatka" @@ -9904,14 +9911,12 @@ "/i Käynnistä ohjelma tuoreilla ympäristömuuttujilla.\n" "/min Käynnistä ohjelma pienennettynä.\n" "/max Käynnistä ohjelma suurennettuna.\n" -"/low Käynnistä ohjelma matalassa prioriteettiluokassa.\n" -"/normal Käynnistä ohjelma normaalissa prioriteettiluokassa.\n" -"/high Käynnistä ohjelma korkeassa prioriteettiluokassa.\n" -"/realtime Käynnistä ohjelma reaaliaikaisessa prioriteettiluokassa.\n" -"/abovenormal Käynnistä ohjelma normaalia korkeammassa\n" -" prioriteettiluokassa.\n" -"/belownormal Käynnistä ohjelma normaalia matalammassa\n" -" prioriteettiluokassa.\n" +"/low Käynnistä ohjelma prioriteetilla 'matala'.\n" +"/normal Käynnistä ohjelma prioriteetilla 'normaali'.\n" +"/high Käynnistä ohjelma prioriteetilla 'korkea'.\n" +"/realtime Käynnistä ohjelma prioriteetilla 'reaaliaikainen'.\n" +"/abovenormal Käynnistä ohjelma prioriteetilla 'normaalia korkeampi'.\n" +"/belownormal Käynnistä ohjelma prioriteetilla 'normaalia matalampi'.\n" "/node n Käynnistä ohjelma määrätyllä NUMA-solmulla.\n" "/affinity peite Käynnistä ohjelma määrätyllä affiniteettipeitteellä.\n" "/wait Odota, että ohjelma sulkeutuu, ja palauta sen paluuarvo.\n" @@ -12829,18 +12834,16 @@ #: uninstaller.rc:31 msgid "uninstaller: The application with GUID '%1' was not found\n" -msgstr "" +msgstr "uninstaller: Ei löydy ohjelmaa, jonka GUID olisi '%1'\n" #: uninstaller.rc:32 msgid "" "uninstaller: The option '--remove' must be followed by an application GUID\n" -msgstr "" +msgstr "uninstaller: Valitsinta '--remove' täytyy seurata ohjelman GUID\n" #: uninstaller.rc:33 -#, fuzzy -#| msgid "Error: Invalid option '%c'.\n" msgid "uninstaller: Invalid option [%1]\n" -msgstr "Virhe: Viallinen vaihtoehto '%c'.\n" +msgstr "uninstaller: Virheellinen valitsin [%1]\n" #: uninstaller.rc:35 msgid "" @@ -12849,6 +12852,10 @@ "Uninstall applications from the current Wine prefix.\n" "\n" msgstr "" +"Winen ohjelmanpoistaja\n" +"\n" +"Poista ohjelmia nykyisestä Wine-prefiksistä.\n" +"\n" #: uninstaller.rc:43 msgid "" @@ -12863,6 +12870,16 @@ " [no option] Launch the graphical version of this program.\n" "\n" msgstr "" +"Käyttö:\n" +" uninstaller [valitsimet]\n" +"\n" +"Valitsimet:\n" +" --help\t Näytä tämä viesti.\n" +" --list\t Listaa tähän Wine-prefiksiin asennetut ohjelmat.\n" +" --remove {GUID} Poista valittu ohjelma.\n" +"\t\t Käytä valitsinta '--list' GUIDin löytämiseen.\n" +" [ei valitsinta] Käynnistä tämän ohjelman graafinen versio.\n" +"\n" #: view.rc:36 msgid "&Pan" diff -Nru wine1.7-1.7.50/po/fr.po wine1.7-1.7.55/po/fr.po --- wine1.7-1.7.50/po/fr.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/fr.po 2015-11-13 14:32:40.000000000 +0000 @@ -5,7 +5,7 @@ "Project-Id-Version: Wine\n" "Report-Msgid-Bugs-To: http://bugs.winehq.org\n" "POT-Creation-Date: N/A\n" -"PO-Revision-Date: 2015-07-18 09:12+0100\n" +"PO-Revision-Date: 2015-10-03 11:45+0100\n" "Last-Translator: Frédéric Delanoy \n" "Language-Team: French\n" "Language: fr\n" @@ -57,20 +57,19 @@ msgstr "Informations de support" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "OK" @@ -142,19 +141,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Annuler" @@ -317,7 +316,7 @@ msgid "&Apply" msgstr "&Appliquer" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Aide" @@ -352,7 +351,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7395,72 +7394,72 @@ msgid "Off" msgstr "Inactif" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Insérer objet" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Type d'objet :" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Résultat" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Créer nouveau" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Créer un contrôle" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Créer depuis le fichier" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "&Ajouter un contrôle..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "Afficher comme une icône" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Parcourir..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "Fichier :" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Collage spécial" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Source :" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "Co&ller" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "Coller le &lien" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "&Comme :" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "&Afficher comme une icône" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "Changer l'&icône..." @@ -7492,19 +7491,27 @@ msgid "Add Control" msgstr "Ajouter un contrôle" -#: oledlg.rc:34 +#: oledlg.rc:35 msgid "&Convert..." msgstr "&Convertir..." +#: oledlg.rc:36 +msgid "%1 %2 &Object" +msgstr "&Objet %1 %2" + +#: oledlg.rc:34 +msgid "%1 &Object" +msgstr "&Objet %1" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "&Objet" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "Insère le contenu du presse-papiers dans votre document comme %s." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7512,7 +7519,7 @@ "Insère le contenu du presse-papiers dans votre document de sorte que vous " "puissiez l'activer en utilisant %s." -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." @@ -7520,7 +7527,7 @@ "Insère le contenu du presse-papiers dans votre document afin de pouvoir " "l'activer en utilisant %s. Il sera affiché comme une icône." -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7530,7 +7537,7 @@ "données sont liées au fichier source afin que les modifications de celui-ci " "soient répercutées dans votre document." -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7540,7 +7547,7 @@ "est liée au fichier source afin que les modifications de celui-ci soient " "répercutées dans votre document." -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7550,19 +7557,19 @@ "papiers. Le raccourci est lié au fichier source afin que les modifications " "de celui-ci soient répercutées dans votre document." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "Insère le contenu du presse-papiers dans votre document." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "Type inconnu" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Source inconnue" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "le programme avec lequel il a été créé" @@ -8045,7 +8052,7 @@ msgid "Message" msgstr "Message" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Oui" @@ -8053,7 +8060,7 @@ msgid "Yes to &all" msgstr "Oui pour &tous" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&Non" @@ -8588,23 +8595,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "Sui&vant\tCtrl+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "A&bandonner" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "Ré&péter" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Ignorer" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "&Réessayer" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "&Continuer" @@ -9299,11 +9306,11 @@ #: winmm.rc:138 msgid "Master Volume" -msgstr "" +msgstr "Volume principal" #: winmm.rc:139 msgid "Mute" -msgstr "" +msgstr "Muet" #: winspool.rc:37 msgid "Print to File" @@ -12999,18 +13006,18 @@ #: uninstaller.rc:31 msgid "uninstaller: The application with GUID '%1' was not found\n" -msgstr "" +msgstr "uninstaller : l'application de GUID « %1 » est introuvable\n" #: uninstaller.rc:32 msgid "" "uninstaller: The option '--remove' must be followed by an application GUID\n" msgstr "" +"uninstaller : l'option « --remove » doit être suivie d'un GUID " +"d'application\n" #: uninstaller.rc:33 -#, fuzzy -#| msgid "Error: Invalid option '%c'.\n" msgid "uninstaller: Invalid option [%1]\n" -msgstr "Erreur : option « %c » invalide.\n" +msgstr "uninstaller : option [%1] invalide\n" #: uninstaller.rc:35 msgid "" @@ -13019,6 +13026,10 @@ "Uninstall applications from the current Wine prefix.\n" "\n" msgstr "" +"Programme de désinstallation des applications Wine\n" +"\n" +"Désinstalle des applications du préfixe Wine courant.\n" +"\n" #: uninstaller.rc:43 msgid "" @@ -13033,6 +13044,17 @@ " [no option] Launch the graphical version of this program.\n" "\n" msgstr "" +"Usage :\n" +" uninstaller [options]\n" +"\n" +"Options :\n" +" --help\t Afficher ces informations.\n" +" --list\t Lister toutes les applications installées dans ce préfix " +"Wine.\n" +" --remove {GUID} Désinstaller l'application spécifiée.\n" +"\t\t Utilisez « --list » pour déterminer le GUID de l'application.\n" +" [aucune option] Lancer la version graphique de ce programme.\n" +"\n" #: view.rc:36 msgid "&Pan" diff -Nru wine1.7-1.7.50/po/he.po wine1.7-1.7.55/po/he.po --- wine1.7-1.7.50/po/he.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/he.po 2015-11-13 14:32:40.000000000 +0000 @@ -64,20 +64,19 @@ msgstr "פרטי תמיכה" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "אישור" @@ -146,19 +145,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "ביטול" @@ -318,7 +317,7 @@ msgid "&Apply" msgstr "ה&חלה" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "עזרה" @@ -353,7 +352,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7630,72 +7629,72 @@ msgid "Off" msgstr "כבוי" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "הוספת עצם" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "סוג העצם:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "תוצאה" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "יצירת חדש" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "יצירת פקד" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "יצירה מקובץ" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "הוספת &פקד..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "הצגה כסמל" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "עיון..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "קובץ:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "הדבקה מיוחדת" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "מקור:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "ה&דבקה" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "הדבקת &קישור" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "ב&תור:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "ה&צגה כסמל" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "החלפת ה&סמל..." @@ -7725,27 +7724,39 @@ msgid "Add Control" msgstr "הוספת פקד" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "&גופן..." +#: oledlg.rc:36 +#, fuzzy +#| msgid "&Object" +msgid "%1 %2 &Object" +msgstr "&עצם" + +#: oledlg.rc:34 +#, fuzzy +#| msgid "&Object" +msgid "%1 &Object" +msgstr "&עצם" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "&עצם" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "הוספת תוכן לוח הגזירים למסמך שלך בתור %s." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." msgstr "הוספת תוכן לוח הגזירים למסמך שלך כדי שניתן יהיה להפעילו באמצעות %s." -#: oledlg.rc:41 +#: oledlg.rc:43 #, fuzzy msgid "" "Inserts the contents of the clipboard into your document so that you can " @@ -7754,7 +7765,7 @@ "הוספת תוכן לוח הגזירים למסמך שלך כדי שניתן יהיה להפעילו באמצעות %s. העצם " "יוצג כסמל." -#: oledlg.rc:42 +#: oledlg.rc:44 #, fuzzy msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " @@ -7764,7 +7775,7 @@ "הוספת תוכן לוח הגזירים למסמך שלך כדי שניתן יהיה להפעילו באמצעות %s. הנתונים " "יהיו מקושרים לקובץ המקור כך ששינויים בקובץ המקור ישפיעו גם על המסמך שלך." -#: oledlg.rc:43 +#: oledlg.rc:45 #, fuzzy msgid "" "Inserts a picture of the clipboard contents into your document. The picture " @@ -7774,7 +7785,7 @@ "הוספת תמונה מתוכן לוח הגזירים למסמך שלך. התמונה מקושרת לקובץ המקור כך " "ששינויים לקובץ ישפיעו גם על המסמך שלך." -#: oledlg.rc:44 +#: oledlg.rc:46 #, fuzzy msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " @@ -7784,19 +7795,19 @@ "הוספת קיצור דרך המצביע אל מיקום תוכן לוח הגזירים. קיצור הדרך מקושר לקובץ " "המקור כך ששינויים לקובץ המקור ישפיעו גם על המסמך שלך." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "הוספת תוכן לוח הגזירים למסמך שלך." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "סוג לא ידוע" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "מקור לא ידוע" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "התכנית שיצרה אותו" @@ -8280,7 +8291,7 @@ msgid "Message" msgstr "הודעה" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&כן" @@ -8288,7 +8299,7 @@ msgid "Yes to &all" msgstr "כ&ן להכול" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&לא" @@ -8835,23 +8846,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "&סיום" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "&ניסיון חוזר" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "ה&תעלמות" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "&ניסיון חוזר" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "ה&משך" diff -Nru wine1.7-1.7.50/po/hi.po wine1.7-1.7.55/po/hi.po --- wine1.7-1.7.50/po/hi.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/hi.po 2015-11-13 14:32:40.000000000 +0000 @@ -53,20 +53,19 @@ msgstr "" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "" @@ -130,19 +129,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "" @@ -293,7 +292,7 @@ msgid "&Apply" msgstr "" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "" @@ -328,7 +327,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7230,72 +7229,72 @@ msgid "Off" msgstr "" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "" -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "" -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "" @@ -7323,66 +7322,74 @@ msgid "Add Control" msgstr "" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "फ़ॉन्ट (&F)..." +#: oledlg.rc:36 +msgid "%1 %2 &Object" +msgstr "" + +#: oledlg.rc:34 +msgid "%1 &Object" +msgstr "" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "" -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." msgstr "" -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." msgstr "" -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " "your document." msgstr "" -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " "in your document." msgstr "" -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " "be reflected in your document." msgstr "" -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "" -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "" @@ -7869,7 +7876,7 @@ msgid "Message" msgstr "" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "" @@ -7877,7 +7884,7 @@ msgid "Yes to &all" msgstr "" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "" @@ -8373,24 +8380,24 @@ msgid "Nex&t\tCtrl+F6" msgstr "" -#: user32.rc:82 +#: user32.rc:81 #, fuzzy msgid "&Abort" msgstr "क्लॉक के बारे में (&A)..." -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "" diff -Nru wine1.7-1.7.50/po/hr.po wine1.7-1.7.55/po/hr.po --- wine1.7-1.7.50/po/hr.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/hr.po 2015-11-13 14:32:40.000000000 +0000 @@ -57,20 +57,19 @@ msgstr "Informacije o podršci" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "U redu" @@ -140,19 +139,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Otkaži" @@ -312,7 +311,7 @@ msgid "&Apply" msgstr "&Primijeni" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Pomoć" @@ -347,7 +346,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7399,72 +7398,72 @@ msgid "Off" msgstr "Isključeno" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Unos objekta" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Vrsta objekta:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Rezultat" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Napravi novo" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Napravi kontrolu" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Napravi iz datoteke" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "&Dodaj kontrolu..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "Prikaži kao ikonicu" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Potraži..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "Datoteka:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Posebno lijepljenje" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Izvor:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "&Zalijepi" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "Zalijepi &vezu" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "&Kao:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "&Prikaži kao ikonicu" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "Promijeni &ikonicu..." @@ -7496,21 +7495,33 @@ msgid "Add Control" msgstr "Dodaj kontrolu" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "&Font..." +#: oledlg.rc:36 +#, fuzzy +#| msgid "&Object" +msgid "%1 %2 &Object" +msgstr "&Objekt" + +#: oledlg.rc:34 +#, fuzzy +#| msgid "&Object" +msgid "%1 &Object" +msgstr "&Objekt" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "&Objekt" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "Umeće sadržaj iz ostave u dokument kao %s." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7518,7 +7529,7 @@ "Umeće sadržaj iz ostave u dokument kako biste ga mogli aktivirati koristeći " "%s." -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." @@ -7526,7 +7537,7 @@ "Umeće sadržaj iz ostave u dokument kako biste ga mogli aktivirati koristeći " "%s. Biti će prikazano kao ikonica." -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7536,7 +7547,7 @@ "datotekom što znači kako će se promjene datoteke reflektirati u vaš " "dokumentu." -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7545,7 +7556,7 @@ "Umeće sliku sadržaja ostave u dokument. Slika će biti povezana s izvornom " "datotekom što znači kako će promjene datoteke reflektirati u vaš dokument." -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7555,19 +7566,19 @@ "povezana s izvornom datotekom što znači kako će promjene datoteke " "reflektirati u vaš dokument." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "Umeće sadržaj iz ostave u dokument." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "Nepoznata vrsta" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Nepoznat izvor" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "program koji ga je napravio" @@ -8050,7 +8061,7 @@ msgid "Message" msgstr "Poruka" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Da" @@ -8058,7 +8069,7 @@ msgid "Yes to &all" msgstr "Da za &sve" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&Ne" @@ -8584,23 +8595,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "Sljedeće\tCtrl+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "&Prekini" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "Pokušaj &ponovo" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Zanemari" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "Pok&ušaj ponovo" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "&Nastavi" diff -Nru wine1.7-1.7.50/po/hu.po wine1.7-1.7.55/po/hu.po --- wine1.7-1.7.50/po/hu.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/hu.po 2015-11-13 14:32:40.000000000 +0000 @@ -57,20 +57,19 @@ msgstr "Támogatási információ" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "OK" @@ -142,19 +141,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Mégse" @@ -326,7 +325,7 @@ msgid "&Apply" msgstr "&Alkalmaz" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Súgó" @@ -361,7 +360,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7428,72 +7427,72 @@ msgid "Off" msgstr "Ki" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Objektum beszúrása" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Objektum típus:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Eredmény" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Új létrehozása" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Vezérlő létrehozása" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Létrehozás fájlból" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "Vezérlő hozzá&adása..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "Megjelenítés ikonként" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Tallózás..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "Fájl:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Speciális beillesztés" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Forrás:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "&Beillesztés" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "Beillesztés &linkként" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "&Mint:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "Megjelenítés i&konként" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "&Ikon megváltoztatása..." @@ -7525,21 +7524,33 @@ msgid "Add Control" msgstr "Vezérlő hozzáadása" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "&Betűtípus..." +#: oledlg.rc:36 +#, fuzzy +#| msgid "&Object" +msgid "%1 %2 &Object" +msgstr "&Objektum" + +#: oledlg.rc:34 +#, fuzzy +#| msgid "&Object" +msgid "%1 &Object" +msgstr "&Objektum" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "&Objektum" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "A vágólap tartalmának beillesztése az Ön dokumentumába mint: %s." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7547,7 +7558,7 @@ "A vágólap tartalmának beillesztése az Ön dokumentumába, amit a következő " "használatával aktiválhat: %s." -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." @@ -7555,7 +7566,7 @@ "A vágólap tartalmának beillesztése az Ön dokumentumába, amit a következő " "használatával aktiválhat %s. Ikonként fog megjelnni." -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7565,7 +7576,7 @@ "össze van kapcsolva a forrásfájllal, így a fájl módosítása hatással lesz a " "dokumentumra." -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7575,7 +7586,7 @@ "kapcsolva a forrásfájllal, így a fájl módosítása hatással lesz a " "dokumentumra." -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7585,19 +7596,19 @@ "parancsikon össze van kapcsolva a forrásfájllal, így a fájl módosítása " "hatással lesz a dokumentumra." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "A vágólap tartalmának beillesztése az Ön dokumentumába." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "Ismeretlen típus" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Ismeretlen forrás" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "a program ami létrehozta" @@ -8080,7 +8091,7 @@ msgid "Message" msgstr "Üzenet" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Igen" @@ -8088,7 +8099,7 @@ msgid "Yes to &all" msgstr "&Összesre igen" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&Nem" @@ -8624,23 +8635,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "&Előre\tCtrl+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "&Leállítás" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "&Ismét" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Kihagyás" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "&Ismét" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "&Folytatás" diff -Nru wine1.7-1.7.50/po/it.po wine1.7-1.7.55/po/it.po --- wine1.7-1.7.50/po/it.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/it.po 2015-11-13 14:32:40.000000000 +0000 @@ -62,20 +62,19 @@ msgstr "Informazioni di supporto" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "Ok" @@ -147,19 +146,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Annulla" @@ -332,7 +331,7 @@ msgid "&Apply" msgstr "&Applica" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Aiuto" @@ -367,7 +366,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7497,72 +7496,72 @@ msgid "Off" msgstr "Off" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Inserisci oggetto" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Tipo di oggetto:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Risultato" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Crea nuovo" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Crea controllo" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Crea da file" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "&Aggiungi controllo..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "Visualizza come icona" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Sfoglia..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "File:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Incolla speciale" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Origine:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "&Incolla" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "Incolla &collegamento" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "&Come:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "&Mostra come icona" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "Cambia &icona..." @@ -7594,21 +7593,33 @@ msgid "Add Control" msgstr "Aggiungi controllo" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "&Carattere..." +#: oledlg.rc:36 +#, fuzzy +#| msgid "&Object" +msgid "%1 %2 &Object" +msgstr "&Elemento" + +#: oledlg.rc:34 +#, fuzzy +#| msgid "&Object" +msgid "%1 &Object" +msgstr "&Elemento" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "&Elemento" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "Inserisce i contenuti degli appunti nel tuo documento come %s." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7616,7 +7627,7 @@ "Inserisce i contenuti degli appunti nel tuo documento permettendoti di " "attivarlo usando %s." -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." @@ -7624,7 +7635,7 @@ "Inserisce i contenuti degli appunti nel tuo documento permettendoti di " "attivarlo usando %s. Sarà mostrato come un'icona." -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7634,7 +7645,7 @@ "collegati al file sorgente in modo che i cambiamenti in quello si riflettano " "sul tuo documento." -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7644,7 +7655,7 @@ "collegata al file sorgente in modo che i cambiamenti in quello si riflettano " "sul tuo documento." -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7654,19 +7665,19 @@ "appunti. La scorciatoia è collegata al file sorgente in modo che i " "cambiamenti in quello si riflettano sul tuo documento." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "Inserisce i contenuti degli appunti nel tuo documento." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "Tipo sconosciuto" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Sorgente sconosciuta" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "Il programma che lo ha creato" @@ -8148,7 +8159,7 @@ msgid "Message" msgstr "Messaggio" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Sì" @@ -8156,7 +8167,7 @@ msgid "Yes to &all" msgstr "Sì a &tutti" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&No" @@ -8694,23 +8705,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "&Prossimo\tCtrl+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "&Abbandona" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "&Riprova" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Ignora" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "&Riprova" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "&Continua" diff -Nru wine1.7-1.7.50/po/ja.po wine1.7-1.7.55/po/ja.po --- wine1.7-1.7.50/po/ja.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/ja.po 2015-11-13 14:32:40.000000000 +0000 @@ -58,20 +58,19 @@ msgstr "サポート情報" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "OK" @@ -141,19 +140,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "キャンセル" @@ -315,7 +314,7 @@ msgid "&Apply" msgstr "適用(&A)" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "ヘルプ" @@ -350,7 +349,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7344,72 +7343,72 @@ msgid "Off" msgstr "オフ" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "オブジェクトの挿入" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "オブジェクトの種類:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "結果" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "新規作成" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "コントロールを作成" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "ファイルから作成" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "コントロールを追加(&A)..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "アイコンとして表示" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "参照..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "ファイル:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "形式を選択して貼り付け" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "コピー元:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "貼り付け(&P)" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "リンク貼り付け(&L)" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "形式(&A):" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "アイコンとして表示(&D)" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "アイコンの変更(&I)..." @@ -7441,25 +7440,37 @@ msgid "Add Control" msgstr "コントロールを追加" -#: oledlg.rc:34 +#: oledlg.rc:35 msgid "&Convert..." msgstr "変換(&C)..." +#: oledlg.rc:36 +#, fuzzy +#| msgid "&Object" +msgid "%1 %2 &Object" +msgstr "オブジェクト(&O)" + +#: oledlg.rc:34 +#, fuzzy +#| msgid "&Object" +msgid "%1 &Object" +msgstr "オブジェクト(&O)" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "オブジェクト(&O)" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "クリップボードの内容を %s として、文書に挿入します。" -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." msgstr "クリップボードの内容を文書に挿入します。 %s を利用して、編集できます。" -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." @@ -7467,7 +7478,7 @@ "クリップボードの内容を文書に挿入します。 %s を利用して、編集できます。アイコ" "ンとして表示されます。" -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7476,7 +7487,7 @@ "クリップボードの内容を %s として、文書に挿入します。データは元のファイルとリ" "ンクしているため、元のファイルへの変更はこの文書に反映されます。" -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7485,7 +7496,7 @@ "クリップボード内の画像を文書に挿入します。画像は元のファイルとリンクしている" "ため、元のファイルへの変更はこの文書に反映されます。" -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7494,19 +7505,19 @@ "クリップボード内の場所を指すショートカットを挿入します。ショートカットは元の" "ファイルとリンクしているため、元のファイルへの変更はこの文書に反映されます。" -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "クリップボードの内容を挿入します。" -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "不明な形式" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "不明" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "作成プログラム" @@ -7988,7 +7999,7 @@ msgid "Message" msgstr "メッセージ" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "はい(&Y)" @@ -7996,7 +8007,7 @@ msgid "Yes to &all" msgstr "すべてはい(&A)" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "いいえ(&N)" @@ -8523,23 +8534,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "次のウィンドウ(&T)\tCtrl+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "中止(&A)" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "再試行(&R)" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "無視(&I)" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "再試行(&T)" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "続ける(&C)" diff -Nru wine1.7-1.7.50/po/ko.po wine1.7-1.7.55/po/ko.po --- wine1.7-1.7.50/po/ko.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/ko.po 2015-11-13 14:32:40.000000000 +0000 @@ -56,20 +56,19 @@ msgstr "지원 정보" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "확인" @@ -139,19 +138,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "취소" @@ -313,7 +312,7 @@ msgid "&Apply" msgstr "적용(&A)" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "도움말" @@ -348,7 +347,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7402,72 +7401,72 @@ msgid "Off" msgstr "비작동" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "객체 삽입" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "객체 타입:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "결과" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "새로 만들기" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "컨트롤 만들기" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "파일로부터 만들기" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "컨트롤 추가(&A)..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "아이콘으로 보기" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "찾기..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "파일:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "특별하게 붙여넣기" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "원본:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "붙여넣기(&P)" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "링크로 붙여넣기(&L)" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "다른 이름으로(&A):" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "아이콘으로 보기(&D)" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "아이콘 바꾸기(&I)..." @@ -7499,21 +7498,33 @@ msgid "Add Control" msgstr "컨트롤 더하기" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "글꼴(&F)..." +#: oledlg.rc:36 +#, fuzzy +#| msgid "&Object" +msgid "%1 %2 &Object" +msgstr "객체(&O)" + +#: oledlg.rc:34 +#, fuzzy +#| msgid "&Object" +msgid "%1 &Object" +msgstr "객체(&O)" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "객체(&O)" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "당신의 문서 %s에 클립보드의 내용 삽입하기." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7521,7 +7532,7 @@ "당신의 문서에 클립보드의 내용들을 첨부하면 %s를 사용해서 이것을 실행할 수 있" "습니다." -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." @@ -7529,7 +7540,7 @@ "당신의 문서에 클립보드의 내용들을 첨부하면 %s를 사용해서 이것을 활성화할 수 " "있습니다. 이것은 아이콘으로 나타내질 겁니다." -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7538,7 +7549,7 @@ "당신의 문서 %s에 클립보드의 내용을 삽입합니다. 이 데이터는 원본 파일에 연결되" "어 있어서 파일이 바뀌면 당신의 문서에 영향을 미칠 것입니다." -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7547,7 +7558,7 @@ "당신의 문서에 클립보드에 있는 그림을 집어넣습니다. 이 그림은 원본 파일에 연결" "되어 있어서 파일이 바뀌면 당신의 문서에 영향을 미칠 것입니다." -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7556,19 +7567,19 @@ "당신의 문서에 클립보드에 있는 단축아이콘을 집어넣습니다. 이 단축아이콘은 원" "본 파일에 연결되어 있어서 파일이 바뀌면 당신의 문서에 영향을 미칠 것입니다." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "당신의 문서에 클립보드의 내용 삽입하기." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "알수 없는 형식" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "알수 없는 원본" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "내가 만든 프로그램" @@ -8049,7 +8060,7 @@ msgid "Message" msgstr "메시지" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "예(&Y)" @@ -8057,7 +8068,7 @@ msgid "Yes to &all" msgstr "모두 예(&A)" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "아니오(&N)" @@ -8581,23 +8592,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "다음(&T)\tCtrl+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "중단(&A)" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "재시도(&R)" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "무시(&I)" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "다시 시도(&T)" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "계속(&C)" diff -Nru wine1.7-1.7.50/po/lt.po wine1.7-1.7.55/po/lt.po --- wine1.7-1.7.50/po/lt.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/lt.po 2015-11-13 14:32:40.000000000 +0000 @@ -5,7 +5,7 @@ "Project-Id-Version: Wine\n" "Report-Msgid-Bugs-To: http://bugs.winehq.org\n" "POT-Creation-Date: N/A\n" -"PO-Revision-Date: 2015-08-18 20:53+0300\n" +"PO-Revision-Date: 2015-09-09 22:11+0300\n" "Last-Translator: Aurimas Fišeras \n" "Language-Team: Lithuanian \n" "Language: lt\n" @@ -59,20 +59,19 @@ msgstr "Priežiūros informacija" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "Gerai" @@ -142,19 +141,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Atsisakyti" @@ -314,7 +313,7 @@ msgid "&Apply" msgstr "&Vykdyti" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Žinynas" @@ -349,7 +348,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7355,72 +7354,72 @@ msgid "Off" msgstr "Išjungta" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Įterpti objektą" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Objekto tipas:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Rezultatas" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Sukurti naują" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Sukurti valdiklį" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Sukurti iš failo" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "&Pridėti valdiklį..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "Rodyti kaip piktogramą" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Parinkti..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "Failas:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Įdėti kaip" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Šaltinis:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "Į&dėti" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "Įdėti &saitą" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "&Kaip:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "&Rodyti kaip piktogramą" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "Keisti &piktogramą..." @@ -7452,19 +7451,27 @@ msgid "Add Control" msgstr "Pridėti valdiklį" -#: oledlg.rc:34 +#: oledlg.rc:35 msgid "&Convert..." msgstr "&Konvertuoti..." +#: oledlg.rc:36 +msgid "%1 %2 &Object" +msgstr "%1 %2 &objektą" + +#: oledlg.rc:34 +msgid "%1 &Object" +msgstr "%1 &objektas" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "&Objektas" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "Įterpia iškarpinės turinį į dokumentą kaip %s." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7472,7 +7479,7 @@ "Įterpia iškarpinės turinį į dokumentą, kad galėtumėte jį aktyvuoti naudodami " "%s." -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." @@ -7480,7 +7487,7 @@ "Įterpia iškarpinės turinį į dokumentą, kad galėtumėte jį aktyvuoti naudodami " "%s. Jis bus rodomas kaip piktograma." -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7489,7 +7496,7 @@ "Įterpia iškarpinės turinį į dokumentą kaip %s. Duomenys yra susieti su " "šaltinio failu, todėl failo pakeitimai bus atspindėti dokumente." -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7498,7 +7505,7 @@ "Įterpia iškarpinės turinio paveikslą į dokumentą. Paveikslas susietas su " "šaltinio failu, todėl failo pakeitimai bus atspindėti dokumente." -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7507,19 +7514,19 @@ "Įterpia nuorodą, kuri rodo į iškarpinės turinį. Nuoroda susieta su šaltinio " "failu, todėl failo pakeitimai bus atspindėti dokumente." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "Įterpia iškarpinės turinį į dokumentą." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "Nežinomas tipas" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Nežinomas šaltinis" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "programa, kuri jį sukūrė" @@ -8001,7 +8008,7 @@ msgid "Message" msgstr "Pranešimas" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Taip" @@ -8009,7 +8016,7 @@ msgid "Yes to &all" msgstr "Taip &visiems" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&Ne" @@ -8537,23 +8544,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "Ki&tas\tVald+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "Nut&raukti" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "&Pakartoti" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "N&epaisyti" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "&Mėginti vėl" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "Tę&sti" @@ -12883,6 +12890,10 @@ "Uninstall applications from the current Wine prefix.\n" "\n" msgstr "" +"Wine programų šalinimo programa\n" +"\n" +"Šalinkite programas iš dabartinio Wine prefikso.\n" +"\n" #: uninstaller.rc:43 msgid "" @@ -12897,6 +12908,16 @@ " [no option] Launch the graphical version of this program.\n" "\n" msgstr "" +"Naudojimas:\n" +" uninstaller [parametrai]\n" +"\n" +"Parametrai:\n" +" --help\t Parodo šią informaciją.\n" +" --list\t Parodo visas įdiegtas programas šiame Wine prefikse.\n" +" --remove {GUID} Pašalina nurodytą programą.\n" +"\t\t Naudokite „--list“ programos GUID nustatyti.\n" +" [be parametrų] Paleidžia šios programos grafinę versiją.\n" +"\n" #: view.rc:36 msgid "&Pan" diff -Nru wine1.7-1.7.50/po/ml.po wine1.7-1.7.55/po/ml.po --- wine1.7-1.7.50/po/ml.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/ml.po 2015-11-13 14:32:40.000000000 +0000 @@ -53,20 +53,19 @@ msgstr "" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "" @@ -130,19 +129,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "" @@ -293,7 +292,7 @@ msgid "&Apply" msgstr "" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "" @@ -328,7 +327,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7230,72 +7229,72 @@ msgid "Off" msgstr "" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "" -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "" -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "" @@ -7323,66 +7322,74 @@ msgid "Add Control" msgstr "" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "_അക്ഷരസഞ്ചയം..." +#: oledlg.rc:36 +msgid "%1 %2 &Object" +msgstr "" + +#: oledlg.rc:34 +msgid "%1 &Object" +msgstr "" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "" -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." msgstr "" -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." msgstr "" -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " "your document." msgstr "" -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " "in your document." msgstr "" -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " "be reflected in your document." msgstr "" -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "" -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "" @@ -7869,7 +7876,7 @@ msgid "Message" msgstr "" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "" @@ -7877,7 +7884,7 @@ msgid "Yes to &all" msgstr "" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "" @@ -8373,24 +8380,24 @@ msgid "Nex&t\tCtrl+F6" msgstr "" -#: user32.rc:82 +#: user32.rc:81 #, fuzzy msgid "&Abort" msgstr "ക്ലോക്കിനെപ്പറ്റി _അറിയുക..." -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "" diff -Nru wine1.7-1.7.50/po/nb_NO.po wine1.7-1.7.55/po/nb_NO.po --- wine1.7-1.7.50/po/nb_NO.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/nb_NO.po 2015-11-13 14:32:40.000000000 +0000 @@ -58,20 +58,19 @@ msgstr "Støtteinformasjon" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "OK" @@ -141,19 +140,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Avbryt" @@ -313,7 +312,7 @@ msgid "&Apply" msgstr "&Bruk" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Hjelp" @@ -348,7 +347,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7418,72 +7417,72 @@ msgid "Off" msgstr "Av" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Sett inn objekt" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Objekttype:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Resultat" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Opprett ny" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Opprett kontroller" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Opprett fra fil" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "&Legg til kontroller..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "Vis som ikon" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Bla..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "Fil:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Lim inn spesiell" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Kilde:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "&Lim inn" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "Lim inn kob&ling" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "&Som:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "&Vis som ikon" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "Endre &ikon..." @@ -7515,21 +7514,33 @@ msgid "Add Control" msgstr "Legg til kontroller" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "Skri&ft..." +#: oledlg.rc:36 +#, fuzzy +#| msgid "&Object" +msgid "%1 %2 &Object" +msgstr "&Objekt" + +#: oledlg.rc:34 +#, fuzzy +#| msgid "&Object" +msgid "%1 &Object" +msgstr "&Objekt" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "&Objekt" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "Setter innholdet fra utklippstavlen inn i dokumentet som %s." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7537,7 +7548,7 @@ "Setter innholdet fra utklippstavlen inn i dokumentet så du kan aktivere det " "med %s." -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." @@ -7545,7 +7556,7 @@ "Setter innholdet fra utklippstavlen inn i dokumentet så du kan aktivere det " "med %s. Det vises som et ikon." -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7554,7 +7565,7 @@ "Setter innholdet fra utklippstavlen inn i dokumentet som %s. Det kobles til " "kildefilen så endringer i denne også skjer i dokumentet." -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7563,7 +7574,7 @@ "Setter inn et bilde av utklippstavleinnholdet i dokumentet. Bildet kobles " "til kildefilen så endringer i denne også skjer i dokumentet." -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7573,19 +7584,19 @@ "utklippstavlen. Snarveien kobles til kildefilen så endringer i denne også " "skjer i dokumentet." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "Setter innholdet fra utklippstavlen inn i dokumentet." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "Ukjent type" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Ukjent kilde" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "programmet som laget det" @@ -8067,7 +8078,7 @@ msgid "Message" msgstr "Meldings" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Ja" @@ -8075,7 +8086,7 @@ msgid "Yes to &all" msgstr "Ja til &alt" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&Nei" @@ -8603,23 +8614,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "Nes&e\tCtrl + F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "&Stopp" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "P&røv igjen" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Ignorer" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "P&røv igjen" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "&Fortsett" diff -Nru wine1.7-1.7.50/po/nl.po wine1.7-1.7.55/po/nl.po --- wine1.7-1.7.50/po/nl.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/nl.po 2015-11-13 14:32:40.000000000 +0000 @@ -57,20 +57,19 @@ msgstr "Ondersteuning" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "OK" @@ -142,19 +141,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Annuleren" @@ -315,7 +314,7 @@ msgid "&Apply" msgstr "&Toepassen" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Help" @@ -350,7 +349,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7470,72 +7469,72 @@ msgid "Off" msgstr "Uit" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Object invoegen" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Objecttype:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Resultaat" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Nieuw" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Creëren" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Bestand gebruiken" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "Stuurelement &toevoegen..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "Als pictogram weergeven" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Bladeren..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "Bestandsnaam:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Plakken (Speciaal)" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Bron:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "&Plakken" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "Plak &verwijzing" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "&Als:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "Als pictogram &weergeven" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "Wijzig p&ictogram..." @@ -7565,21 +7564,33 @@ msgid "Add Control" msgstr "Toevoegen" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "&Lettertype..." +#: oledlg.rc:36 +#, fuzzy +#| msgid "&Object" +msgid "%1 %2 &Object" +msgstr "&Object" + +#: oledlg.rc:34 +#, fuzzy +#| msgid "&Object" +msgid "%1 &Object" +msgstr "&Object" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "&Object" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "Voegt de inhoud van het klembord in uw document in als %s." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7587,7 +7598,7 @@ "Voegt de inhoud van het klembord in uw document in zodat u het kan activeren " "met %s." -#: oledlg.rc:41 +#: oledlg.rc:43 #, fuzzy msgid "" "Inserts the contents of the clipboard into your document so that you can " @@ -7596,7 +7607,7 @@ "Voegt de inhoud van het klembord in uw document in zodat u het kan activeren " "met %s. Het zal getoond worden als een icoon." -#: oledlg.rc:42 +#: oledlg.rc:44 #, fuzzy msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " @@ -7607,7 +7618,7 @@ "verbonden met het bron bestand zodat wijzigingen in dat bestand worden " "getoond in uw document." -#: oledlg.rc:43 +#: oledlg.rc:45 #, fuzzy msgid "" "Inserts a picture of the clipboard contents into your document. The picture " @@ -7618,7 +7629,7 @@ "verbonden met het bronbestand, zodat wijzigingen in dat bestand worden " "getoond in uw document." -#: oledlg.rc:44 +#: oledlg.rc:46 #, fuzzy msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " @@ -7629,19 +7640,19 @@ "klembord. De verwijzing is verbonden met het bronbestand, zodat wijzigingen " "in dat bestand worden getoond in uw document." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "Voegt de inhoud van het klembord in uw document." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "Onbekend type" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Onbekende bron" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "het programma die het gecreëerd heeft" @@ -8123,7 +8134,7 @@ msgid "Message" msgstr "Message" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Ja" @@ -8131,7 +8142,7 @@ msgid "Yes to &all" msgstr "Ja op &alles" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&Nee" @@ -8657,23 +8668,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "Volgende\tCtrl+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "A&fbreken" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "O&pnieuw" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "N&egeren" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "P&robeer opnieuw" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "&Verder" diff -Nru wine1.7-1.7.50/po/or.po wine1.7-1.7.55/po/or.po --- wine1.7-1.7.50/po/or.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/or.po 2015-11-13 14:32:40.000000000 +0000 @@ -53,20 +53,19 @@ msgstr "" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "" @@ -130,19 +129,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "" @@ -293,7 +292,7 @@ msgid "&Apply" msgstr "" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "" @@ -328,7 +327,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7230,72 +7229,72 @@ msgid "Off" msgstr "" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "" -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "" -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "" @@ -7323,66 +7322,74 @@ msgid "Add Control" msgstr "" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "ଅକ୍ଷରରୂପ (&F)..." +#: oledlg.rc:36 +msgid "%1 %2 &Object" +msgstr "" + +#: oledlg.rc:34 +msgid "%1 &Object" +msgstr "" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "" -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." msgstr "" -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." msgstr "" -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " "your document." msgstr "" -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " "in your document." msgstr "" -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " "be reflected in your document." msgstr "" -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "" -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "" @@ -7869,7 +7876,7 @@ msgid "Message" msgstr "" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "" @@ -7877,7 +7884,7 @@ msgid "Yes to &all" msgstr "" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "" @@ -8373,24 +8380,24 @@ msgid "Nex&t\tCtrl+F6" msgstr "" -#: user32.rc:82 +#: user32.rc:81 #, fuzzy msgid "&Abort" msgstr "ଘଡ଼ି ବିଷୟରେ (&A)..." -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "" diff -Nru wine1.7-1.7.50/po/pa.po wine1.7-1.7.55/po/pa.po --- wine1.7-1.7.50/po/pa.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/pa.po 2015-11-13 14:32:40.000000000 +0000 @@ -53,20 +53,19 @@ msgstr "" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "" @@ -130,19 +129,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "" @@ -293,7 +292,7 @@ msgid "&Apply" msgstr "" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "" @@ -328,7 +327,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7230,72 +7229,72 @@ msgid "Off" msgstr "" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "" -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "" -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "" @@ -7323,66 +7322,74 @@ msgid "Add Control" msgstr "" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "ਫੌਂਟ(&F)..." +#: oledlg.rc:36 +msgid "%1 %2 &Object" +msgstr "" + +#: oledlg.rc:34 +msgid "%1 &Object" +msgstr "" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "" -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." msgstr "" -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." msgstr "" -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " "your document." msgstr "" -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " "in your document." msgstr "" -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " "be reflected in your document." msgstr "" -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "" -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "" @@ -7869,7 +7876,7 @@ msgid "Message" msgstr "" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "" @@ -7877,7 +7884,7 @@ msgid "Yes to &all" msgstr "" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "" @@ -8373,24 +8380,24 @@ msgid "Nex&t\tCtrl+F6" msgstr "" -#: user32.rc:82 +#: user32.rc:81 #, fuzzy msgid "&Abort" msgstr "ਘੜੀ ਬਾਰੇ(&A)..." -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "" diff -Nru wine1.7-1.7.50/po/pl.po wine1.7-1.7.55/po/pl.po --- wine1.7-1.7.50/po/pl.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/pl.po 2015-11-13 14:32:40.000000000 +0000 @@ -62,20 +62,19 @@ msgstr "Informacje o wsparciu" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "OK" @@ -146,19 +145,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Anuluj" @@ -319,7 +318,7 @@ msgid "&Apply" msgstr "Z&astosuj" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Pomoc" @@ -354,7 +353,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7368,72 +7367,72 @@ msgid "Off" msgstr "Wyłączone" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Wstaw obiekt" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Rodzaj obiektu:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Wynik" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Utwórz nowy" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Utwórz kontrolkę" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Utwórz z pliku" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "&Dodaj kontrolkę..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "Wyświetlaj jako ikonę" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Przeglądaj..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "Plik:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Wklej specjalnie" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Kopiuj pliki z:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "Wkl&ej" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "Wklej &łącze" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "&Jako:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "W&yświetlaj jako ikonę" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "Zmień &ikonę..." @@ -7465,19 +7464,27 @@ msgid "Add Control" msgstr "Dodaj kontrolkę" -#: oledlg.rc:34 +#: oledlg.rc:35 msgid "&Convert..." msgstr "&Konwertuj..." +#: oledlg.rc:36 +msgid "%1 %2 &Object" +msgstr "%1 &Obiekt %2" + +#: oledlg.rc:34 +msgid "%1 &Object" +msgstr "&Obiekt %1" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "&Obiekt" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "Wstawia zawartość schowka do dokumentu jako %s." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7485,7 +7492,7 @@ "Wstawia zawartość schowka do dokumentu, tak aby mógł być aktywowany za " "pomocą %s." -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." @@ -7493,7 +7500,7 @@ "Wstawia zawartość schowka do dokumentu, tak aby mógł być aktywowany za " "pomocą %s. Będzie wyświetlany jako ikona." -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7503,7 +7510,7 @@ "plikiem źródłowym, dzięki czemu zmiany w pliku będą odzwierciedlone w " "dokumencie." -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7513,7 +7520,7 @@ "plikiem źródłowym, dzięki czemu zmiany w pliku będą odzwierciedlone w " "dokumencie." -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7523,19 +7530,19 @@ "plikiem źródłowym, dzięki czemu zmiany w pliku będą odzwierciedlone w " "dokumencie." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "Wstawia zawartość schowka do dokumentu." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "Nieznany typ" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Nieznane źródło" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "program, który go stworzył" @@ -8017,7 +8024,7 @@ msgid "Message" msgstr "Komunikat" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Tak" @@ -8025,7 +8032,7 @@ msgid "Yes to &all" msgstr "Tak na &wszystkie" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&Nie" @@ -8557,23 +8564,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "Nas&tępny\tCtrl+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "&Zaniechaj" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "&Ponów próbę" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Ignoruj" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "&Spróbuj ponownie" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "&Kontynuuj" @@ -12898,18 +12905,16 @@ #: uninstaller.rc:31 msgid "uninstaller: The application with GUID '%1' was not found\n" -msgstr "" +msgstr "usuwanie programów: Nie znaleziono aplikacji o GUID '%1'\n" #: uninstaller.rc:32 msgid "" "uninstaller: The option '--remove' must be followed by an application GUID\n" -msgstr "" +msgstr "usuwanie programów: Po opcji '--remove' należy podać GUID aplikacji\n" #: uninstaller.rc:33 -#, fuzzy -#| msgid "Error: Invalid option '%c'.\n" msgid "uninstaller: Invalid option [%1]\n" -msgstr "Błąd: Nieprawidłowa opcja '%c'.\n" +msgstr "usuwanie programów: Nieprawidłowa opcja [%1]\n" #: uninstaller.rc:35 msgid "" @@ -12918,6 +12923,10 @@ "Uninstall applications from the current Wine prefix.\n" "\n" msgstr "" +"Wine - Usuwanie programów\n" +"\n" +"Usuń programy z bieżącego prefiksu Wine.\n" +"\n" #: uninstaller.rc:43 msgid "" @@ -12932,6 +12941,16 @@ " [no option] Launch the graphical version of this program.\n" "\n" msgstr "" +"Sposób użycia:\n" +" uninstaller [opcje]\n" +"\n" +"Opcje:\n" +" --help\t Wyświetl tę instrukcję.\n" +" --list\t Wyświetl wszystkie aplikacje zainstalowane w tym prefiksie " +"Wine.\n" +" --remove {GUID} Usuń wskazaną aplikację.\n" +"\t\t Użyj '--list' do sprawdzenia GUID aplikacji.\n" +" [brak opcji] Uruchom graficzną wersję tego programu.\n" #: view.rc:36 msgid "&Pan" diff -Nru wine1.7-1.7.50/po/pt_BR.po wine1.7-1.7.55/po/pt_BR.po --- wine1.7-1.7.50/po/pt_BR.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/pt_BR.po 2015-11-13 14:32:40.000000000 +0000 @@ -57,20 +57,19 @@ msgstr "Informação de Suporte" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "OK" @@ -141,19 +140,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Cancelar" @@ -315,7 +314,7 @@ msgid "&Apply" msgstr "&Aplicar" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Ajuda" @@ -350,7 +349,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -3147,10 +3146,8 @@ msgstr "Ver Código Fo&nte" #: hhctrl.rc:83 -#, fuzzy -#| msgid "Properties" msgid "Proper&ties" -msgstr "Propriedades" +msgstr "&Propriedades" #: hhctrl.rc:87 shdoclc.rc:79 shdoclc.rc:93 shdoclc.rc:117 shdoclc.rc:159 #: shdoclc.rc:183 user32.rc:60 wordpad.rc:104 @@ -7366,72 +7363,72 @@ msgid "Off" msgstr "Desligado" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Inserir objeto" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Tipo de objeto:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Resultado" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Criar novo" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Criar controle" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Criar do arquivo" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "&Adicionar Controle..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "Mostrar como ícone" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Procurar..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "Arquivo:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Colar Especial" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Origem:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "C&olar" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "Colar a&talho" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "&Como:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "&Mostrar como ícone" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "Mudar &Ícone..." @@ -7463,21 +7460,31 @@ msgid "Add Control" msgstr "Adicionar Controle" +#: oledlg.rc:35 +msgid "&Convert..." +msgstr "&Converter..." + +#: oledlg.rc:36 +#, fuzzy +#| msgid "&Object" +msgid "%1 %2 &Object" +msgstr "&Objeto" + #: oledlg.rc:34 #, fuzzy -#| msgid "&Font..." -msgid "&Convert..." -msgstr "&Fonte..." +#| msgid "&Object" +msgid "%1 &Object" +msgstr "&Objeto" #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "&Objeto" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "Insere o conteúdo da área de transferência no seu documento como %s." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7485,7 +7492,7 @@ "Insere o conteúdo da área de transferência no seu documento para que seja " "possível ativá-lo usando %s." -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." @@ -7493,7 +7500,7 @@ "Insere o conteúdo da área de transferência no seu documento para que seja " "possível ativá-lo usando %s. Será mostrado como um ícone." -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7503,7 +7510,7 @@ "dados estão ligados ao arquivo de origem para que alterações ao arquivo se " "reflitam no seu documento." -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7513,7 +7520,7 @@ "ligada ao arquivo de origem para que alterações ao arquivo se reflitam no " "seu documento." -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7523,19 +7530,19 @@ "transferência. O atalho fica ligado ao arquivo de origem para que alterações " "ao arquivo se reflitam no seu documento." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "Insere o conteúdo da área de transferência no seu documento." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "Tipo Desconhecido" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Origem Desconhecida" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "o programa que o criou" @@ -8017,7 +8024,7 @@ msgid "Message" msgstr "Mensagem" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Sim" @@ -8025,7 +8032,7 @@ msgid "Yes to &all" msgstr "Sim para &todos" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&Não" @@ -8554,23 +8561,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "&Próximo\tCtrl+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "&Abortar" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "&Repetir" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Ignorar" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "&Tente Novamente" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "&Continuar" @@ -8591,10 +8598,8 @@ msgstr "Frente e verso:" #: wineps.rc:50 -#, fuzzy -#| msgid "&Setup" msgid "Setup" -msgstr "&Configurar" +msgstr "Configurar" #: wininet.rc:42 wininet.rc:62 msgid "Realm" @@ -8922,16 +8927,12 @@ "em disco suficiente ou que ainda esteja conectado a rede." #: winmm.rc:86 -#, fuzzy -#| msgid "" -#| "Cannot find the specified device. Make sure it is installed or that the " -#| "device name is spelled correctly." msgid "" "Cannot find the specified device. Make sure it is installed and that the " "device name is spelled correctly." msgstr "" "Não é possível encontrar o dispositivo especificado. Certifique-se que está " -"instalado ou que o nome do dispositivo foi escrito corretamente." +"instalado e que o nome do dispositivo foi escrito corretamente." #: winmm.rc:87 msgid "" @@ -9252,16 +9253,12 @@ "espaço em disco suficiente ou que ainda esteja conectado na rede." #: winmm.rc:136 -#, fuzzy -#| msgid "Wine Mono Installer" msgid "Wine Sound Mapper" -msgstr "Instalador Wine Mono" +msgstr "Mapeador de Som do Wine" #: winmm.rc:137 -#, fuzzy -#| msgid "column" msgid "Volume" -msgstr "coluna" +msgstr "Volume" #: winmm.rc:138 msgid "Master Volume" @@ -9798,7 +9795,6 @@ "MOVE falhará se o local antigo e o novo local estão em unidades diferentes.\n" #: cmd.rc:142 -#, fuzzy msgid "" "PATH displays or changes the cmd search path.\n" "\n" @@ -9813,8 +9809,8 @@ "PATH mostra ou permite mudar o caminho de busca de programas do cmd.\n" "\n" "Digitando PATH mostrará a atual configuração do comando PATH (inicialmente\n" -"este valor é especificado no arquivo wine.conf). Para mudar as\n" -"configurações, digite novos valores no comando PATH.\n" +"lido do registro). Para mudar as configurações digite novos valores no " +"comando PATH.\n" "\n" "Também é possível modificar o comando PATH usando a variável de ambiente\n" "PATH, por exemplo:\n" @@ -11595,10 +11591,8 @@ msgstr "Erro: Parâmetros da linha de comandos inválidos\n" #: reg.rc:37 -#, fuzzy -#| msgid "Error: Unable to add keys to remote machine\n" msgid "Error: Unable to access remote machine\n" -msgstr "Erro: Incapaz de adicionar chaves à máquina remota\n" +msgstr "Erro: Não foi possível acessar a máquina remota\n" #: reg.rc:38 msgid "" @@ -11608,10 +11602,8 @@ "especificado\n" #: reg.rc:39 -#, fuzzy -#| msgid "Unsupported type.\n" msgid "Error: Unsupported type\n" -msgstr "Tipo não suportado.\n" +msgstr "Erro: Tipo não suportado.\n" #: regedit.rc:34 msgid "&Registry" @@ -12946,10 +12938,8 @@ msgstr "" #: uninstaller.rc:33 -#, fuzzy -#| msgid "Error: Invalid option '%c'.\n" msgid "uninstaller: Invalid option [%1]\n" -msgstr "Erro: Opção inválida '%c'.\n" +msgstr "uninstaller: Opção inválida [%1].\n" #: uninstaller.rc:35 msgid "" @@ -13239,10 +13229,8 @@ msgstr "&Testar Som" #: winecfg.rc:277 winecfg.rc:90 -#, fuzzy -#| msgid "Wine configuration" msgid "Speaker configuration" -msgstr "Configuração do Wine" +msgstr "Configuração dos alto-falantes" #: winecfg.rc:280 msgid "Speakers:" @@ -13354,21 +13342,19 @@ #: winecfg.rc:91 msgid "5.1 Surround" -msgstr "" +msgstr "Surround 5.1" #: winecfg.rc:92 -#, fuzzy -#| msgid "graphic" msgid "Quadraphonic" -msgstr "gráfico" +msgstr "Quadrafônico" #: winecfg.rc:93 msgid "Stereo" -msgstr "" +msgstr "Estéreo" #: winecfg.rc:94 msgid "Mono" -msgstr "" +msgstr "Mono" #: winecfg.rc:54 msgid "" @@ -13629,16 +13615,12 @@ msgstr "Histórico de comandos" #: wineconsole.rc:69 -#, fuzzy -#| msgid "Buffer zone" msgid "&Buffer size:" -msgstr "Zona do buffer" +msgstr "Tamanho do &buffer:" #: wineconsole.rc:72 -#, fuzzy -#| msgid "&Remove doubles" msgid "&Remove duplicates" -msgstr "&Remover duplicados" +msgstr "Remover &duplicados" #: wineconsole.rc:74 msgid "Popup menu" @@ -13653,22 +13635,16 @@ msgstr "&Rotação" #: wineconsole.rc:78 -#, fuzzy -#| msgid "&Close console" msgid "Console" -msgstr "&Fechar o console" +msgstr "Console" #: wineconsole.rc:79 -#, fuzzy -#| msgid "Quick edit" msgid "&Quick Edit mode" -msgstr "Edição rápida" +msgstr "Modo de &edição rápida" #: wineconsole.rc:80 -#, fuzzy -#| msgid "&Expert mode" msgid "&Insert mode" -msgstr "&Modo Experiente" +msgstr "Modo de &inserção" #: wineconsole.rc:88 msgid "&Font" diff -Nru wine1.7-1.7.50/po/pt_PT.po wine1.7-1.7.55/po/pt_PT.po --- wine1.7-1.7.50/po/pt_PT.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/pt_PT.po 2015-11-13 14:32:40.000000000 +0000 @@ -57,20 +57,19 @@ msgstr "Informação de Suporte" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "OK" @@ -141,19 +140,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Cancelar" @@ -315,7 +314,7 @@ msgid "&Apply" msgstr "&Aplicar" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Ajuda" @@ -350,7 +349,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7335,72 +7334,72 @@ msgid "Off" msgstr "Desligado" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Inserir objecto" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Tipo de objecto:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Resultado" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Criar novo" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Criar controlo" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Criar do ficheiro" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "&Adicionar Controlo..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "Mostrar como ícone" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Procurar..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "Ficheiro:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Colar Especial" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Origem:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "Co&lar" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "Colar &Ligação" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "&Como:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "&Mostrar como Ícone" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "Mudar &Ícone..." @@ -7432,21 +7431,33 @@ msgid "Add Control" msgstr "Adicionar Controlo" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "Tipo de &Letra..." +#: oledlg.rc:36 +#, fuzzy +#| msgid "&Object" +msgid "%1 %2 &Object" +msgstr "&Objecto" + +#: oledlg.rc:34 +#, fuzzy +#| msgid "&Object" +msgid "%1 &Object" +msgstr "&Objecto" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "&Objecto" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "Insere o conteúdo da área de transferência no seu documento como %s." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7454,7 +7465,7 @@ "Insere o conteúdo da área de transferência no seu documento para que o possa " "activar usando %s." -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." @@ -7462,7 +7473,7 @@ "Insere o conteúdo da área de transferência no seu documento para que o possa " "activar usando %s. Vai ser mostrado como um ícone." -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7472,7 +7483,7 @@ "dados estão ligados ao ficheiro de origem para que alterações ao ficheiro se " "reflictam no seu documento." -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7482,7 +7493,7 @@ "ligada ao ficheiro de origem para que alterações ao ficheiro se reflictam no " "seu documento." -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7492,19 +7503,19 @@ "transferência. O atalho fica ligado ao ficheiro de origem para que " "alterações ao ficheiro se reflictam no seu documento." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "Insere o conteúdo da área de transferência no seu documento." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "Tipo Desconhecido" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Origem Desconhecida" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "o programa que o criou" @@ -7987,7 +7998,7 @@ msgid "Message" msgstr "Mensagem" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Sim" @@ -7995,7 +8006,7 @@ msgid "Yes to &all" msgstr "Sim a &todos" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&Não" @@ -8526,23 +8537,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "&Próximo\tCtrl+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "&Abortar" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "&Repetir" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Ignorar" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "&Tente Novamente" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "&Continuar" diff -Nru wine1.7-1.7.50/po/rm.po wine1.7-1.7.55/po/rm.po --- wine1.7-1.7.50/po/rm.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/rm.po 2015-11-13 14:32:40.000000000 +0000 @@ -57,20 +57,19 @@ msgstr "INFUORMAZIUN" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "" @@ -135,19 +134,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "" @@ -297,7 +296,7 @@ msgid "&Apply" msgstr "" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 #, fuzzy msgid "Help" msgstr "&Ag�d" @@ -334,7 +333,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7282,75 +7281,75 @@ msgid "Off" msgstr "" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "" -#: oledlg.rc:67 +#: oledlg.rc:69 #, fuzzy msgid "Create From File" msgstr "Wine ag�d" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "" -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "" -#: oledlg.rc:74 +#: oledlg.rc:76 #, fuzzy msgid "File:" msgstr "&Datoteca" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "" -#: oledlg.rc:86 +#: oledlg.rc:88 #, fuzzy msgid "Paste &Link" msgstr "&Rivir" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "" @@ -7378,65 +7377,73 @@ msgid "Add Control" msgstr "" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy msgid "&Convert..." msgstr "&Stampar tema" +#: oledlg.rc:36 +msgid "%1 %2 &Object" +msgstr "" + +#: oledlg.rc:34 +msgid "%1 &Object" +msgstr "" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "" -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." msgstr "" -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." msgstr "" -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " "your document." msgstr "" -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " "in your document." msgstr "" -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " "be reflected in your document." msgstr "" -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "" -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "" @@ -7924,7 +7931,7 @@ msgid "Message" msgstr "" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "" @@ -7932,7 +7939,7 @@ msgid "Yes to &all" msgstr "" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "" @@ -8436,24 +8443,24 @@ msgid "Nex&t\tCtrl+F6" msgstr "" -#: user32.rc:82 +#: user32.rc:81 #, fuzzy msgid "&Abort" msgstr "I&nfuormaziuns" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "" diff -Nru wine1.7-1.7.50/po/ro.po wine1.7-1.7.55/po/ro.po --- wine1.7-1.7.50/po/ro.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/ro.po 2015-11-13 14:32:40.000000000 +0000 @@ -57,20 +57,19 @@ msgstr "Informații de asistență" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "OK" @@ -135,19 +134,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Renunță" @@ -299,7 +298,7 @@ msgid "&Apply" msgstr "A&plică" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "&Ajutor" @@ -334,7 +333,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7592,72 +7591,72 @@ msgid "Off" msgstr "Dezactivat" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Inserare obiect" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Tipul obiectului:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Rezultat" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Creează nou" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Creează un control" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Creează din fișier" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "&Adăugă un control..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "Afișează ca pictogramă" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Navighează..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "Fișier:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Inserare specială" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Sursă:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "&Inserează" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "Inserează &legătura" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "C&a:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "A&fișează ca pictogramă" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "Schimbare p&ictogramă..." @@ -7689,21 +7688,33 @@ msgid "Add Control" msgstr "Adaugă un control" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "&Font..." +#: oledlg.rc:36 +#, fuzzy +#| msgid "&Object" +msgid "%1 %2 &Object" +msgstr "&Obiect" + +#: oledlg.rc:34 +#, fuzzy +#| msgid "&Object" +msgid "%1 &Object" +msgstr "&Obiect" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "&Obiect" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "Inserează conținutul din clipboard în document ca %s." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7711,7 +7722,7 @@ "Inserează conținutul din clipboard în document astfel încât să îl puteți " "activa utilizând %s." -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." @@ -7719,7 +7730,7 @@ "Inserează conținutul din clipboard în document astfel încât să îl puteți " "activa utilizând %s. Va fi afișat ca o pictogramă." -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7729,7 +7740,7 @@ "fișierul sursă, astfel încât modificările aduse fișierului vor fi reflectate " "în document." -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7739,7 +7750,7 @@ "legată de fișierul sursă, astfel încât modificările aduse fișierului vor fi " "reflectate în document." -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7749,19 +7760,19 @@ "Scurtătura este legată de fișierul sursă, astfel încât modificările aduse " "fișierului vor fi reflectate în document." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "Inserează conținutul din clipboard în document." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "Tip necunoscut" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Sursă necunoscută" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "programul care l-a creat" @@ -8243,7 +8254,7 @@ msgid "Message" msgstr "Mesaj" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Da" @@ -8251,7 +8262,7 @@ msgid "Yes to &all" msgstr "Da la &toate" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&Nu" @@ -8797,23 +8808,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "Înain&te\tCtrl+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "&Anulează" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "R&eîncearcă" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Ignoră" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "&Încearcă din nou" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "&Continuă" diff -Nru wine1.7-1.7.50/po/ru.po wine1.7-1.7.55/po/ru.po --- wine1.7-1.7.50/po/ru.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/ru.po 2015-11-13 14:32:40.000000000 +0000 @@ -58,20 +58,19 @@ msgstr "Сведения о поддержке" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "ОК" @@ -143,19 +142,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Отмена" @@ -315,7 +314,7 @@ msgid "&Apply" msgstr "При&менить" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "&Справка" @@ -350,7 +349,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7357,72 +7356,72 @@ msgid "Off" msgstr "Выключено" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Вставить объект" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Тип объекта:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Результат" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Создать новый" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Создать элемент управления" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Создать из файла" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "&Добавить элемент управления..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "Показывать как значок" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Обзор..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "Файл:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Специальная вставка" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Откуда:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "Вст&авить" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "Вставить &Ссылку" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "&Как:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "&Показывать как значок" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "Изменить &значок..." @@ -7454,19 +7453,31 @@ msgid "Add Control" msgstr "Добавить элемент управления" -#: oledlg.rc:34 +#: oledlg.rc:35 msgid "&Convert..." msgstr "&Конвертировать..." +#: oledlg.rc:36 +#, fuzzy +#| msgid "&Object" +msgid "%1 %2 &Object" +msgstr "&Объект" + +#: oledlg.rc:34 +#, fuzzy +#| msgid "&Object" +msgid "%1 &Object" +msgstr "&Объект" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "&Объект" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "Вставка содержимого буфера обмена в документ как %s." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7474,7 +7485,7 @@ "Вставка содержимого буфера обмена в документ так, что его можно активировать " "с помощью %s." -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." @@ -7482,7 +7493,7 @@ "Вставка содержимого буфера обмена в документ так, его можно будет " "активировать с помощью %s. Он будет отображаться в виде значка." -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7491,7 +7502,7 @@ "Вставка содержимого буфера обмена в документ как %s. Данные будут связаны с " "исходным файлом, так что изменения в нём будут отражаться в документе." -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7500,7 +7511,7 @@ "Вставка изображения из буфера обмена в документ. Изображение будет связано с " "исходным файлом, так что изменения в нём будут отражаться в документе." -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7510,19 +7521,19 @@ "обмена. Ссылка будет связана с исходным файлом, так что изменения в нём " "будут отражаться в документе." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "Вставка содержимое буфера обмена в документ." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "Неизвестный тип" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Неизвестный источник" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "программа, которая его создала" @@ -8004,7 +8015,7 @@ msgid "Message" msgstr "Сообщение" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Да" @@ -8012,7 +8023,7 @@ msgid "Yes to &all" msgstr "Да для &всех" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&Нет" @@ -8537,23 +8548,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "С&ледующее\tCtrl+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "&Отменить" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "По&втор" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Пропустить" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "По&вторить" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "П&родолжить" diff -Nru wine1.7-1.7.50/po/sk.po wine1.7-1.7.55/po/sk.po --- wine1.7-1.7.50/po/sk.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/sk.po 2015-11-13 14:32:40.000000000 +0000 @@ -62,20 +62,19 @@ msgstr "Informácie o podpore" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "OK" @@ -147,19 +146,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Zrušiť" @@ -332,7 +331,7 @@ msgid "&Apply" msgstr "&Použiť" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Pomocník" @@ -367,7 +366,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7368,75 +7367,75 @@ msgid "Off" msgstr "" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "" -#: oledlg.rc:63 +#: oledlg.rc:65 #, fuzzy msgid "Create New" msgstr "Vytvoriť nový adresár" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "" -#: oledlg.rc:67 +#: oledlg.rc:69 #, fuzzy msgid "Create From File" msgstr "Vytvoriť nový adresár" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "" -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "" -#: oledlg.rc:74 +#: oledlg.rc:76 #, fuzzy msgid "File:" msgstr "Súbor" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Zdroj:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "V&ložiť" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "" @@ -7464,66 +7463,78 @@ msgid "Add Control" msgstr "" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Import..." msgid "&Convert..." msgstr "&Importovať..." +#: oledlg.rc:36 +#, fuzzy +#| msgid "Object" +msgid "%1 %2 &Object" +msgstr "Objekt" + +#: oledlg.rc:34 +#, fuzzy +#| msgid "Object" +msgid "%1 &Object" +msgstr "Objekt" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "" -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." msgstr "" -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." msgstr "" -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " "your document." msgstr "" -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " "in your document." msgstr "" -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " "be reflected in your document." msgstr "" -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "" -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "" @@ -8027,7 +8038,7 @@ msgid "Message" msgstr "" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "Án&o" @@ -8035,7 +8046,7 @@ msgid "Yes to &all" msgstr "" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&Nie" @@ -8552,23 +8563,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "&Prerušiť" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "&Skúsiť znova" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Ignorovať" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "" diff -Nru wine1.7-1.7.50/po/sl.po wine1.7-1.7.55/po/sl.po --- wine1.7-1.7.50/po/sl.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/sl.po 2015-11-13 14:32:40.000000000 +0000 @@ -62,20 +62,19 @@ msgstr "Podporni podatki" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "V redu" @@ -146,19 +145,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Prekliči" @@ -331,7 +330,7 @@ msgid "&Apply" msgstr "&Uporabi" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Pomoč" @@ -366,7 +365,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7489,72 +7488,72 @@ msgid "Off" msgstr "Izključeno" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Vstavi predmet" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Vrsta predmeta:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Rezultat" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Ustvari nov" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Ustvari nadzornik" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Ustvari iz datoteke" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "&Dodaj nadzornik ..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "Prikaži kot ikono" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Brskaj ..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "Datoteka:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Posebno lepljenje" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Izvor:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "&Prilepi" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "Prilepi po&vezavo" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "Prilepi &kot:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "P&rikaži kot ikono" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "Spremeni &ikono ..." @@ -7584,21 +7583,33 @@ msgid "Add Control" msgstr "Dodaj nadzornik" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "&Pisava ..." +#: oledlg.rc:36 +#, fuzzy +#| msgid "&Object" +msgid "%1 %2 &Object" +msgstr "&Predmet" + +#: oledlg.rc:34 +#, fuzzy +#| msgid "&Object" +msgid "%1 &Object" +msgstr "&Predmet" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "&Predmet" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "Vstavi vsebino odložišča v vaš dokument kot predmet vrste %s." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7606,7 +7617,7 @@ "Vstavi vsebino odložišča v vaš dokument, tako da jo lahko urejate s " "programom %s." -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." @@ -7614,7 +7625,7 @@ "Vstavi vsebino odložišča v vaš dokument, tako da jo lahko omogočite s " "programom %s. Prikazana bo kot ikona." -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7624,7 +7635,7 @@ "povezava z izvorno datoteko, tako da bodo spremembe datoteke izražene tudi v " "vašem dokumentu." -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7633,7 +7644,7 @@ "Vstavi sliko vsebine odložišča v vaš dokument. Ustvarjena bo povezava z " "izvorno datoteko, tako da bodo spremembe datoteke izražene tudi v dokumentu." -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7642,19 +7653,19 @@ "Vstavi bližnjico do vsebine odložišča. Ustvarjena bo povezava z izvorno " "datoteko, tako da bodo spremembe datoteke izražene tudi v vašem dokumentu." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "Vstavi vsebino odložišča v vaš dokument." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "Neznana vrsta" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Neznan vir" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "program, ki jo je ustvaril" @@ -8136,7 +8147,7 @@ msgid "Message" msgstr "Sporočilo" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Da" @@ -8144,7 +8155,7 @@ msgid "Yes to &all" msgstr "Da za &vse" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&Ne" @@ -8679,23 +8690,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "Na&prej\tCtrl+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "P&rekini" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "P&onovi" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "Pr&ezri" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "Poskusi &znova" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "Nada&ljuj" diff -Nru wine1.7-1.7.50/po/sr_RS@cyrillic.po wine1.7-1.7.55/po/sr_RS@cyrillic.po --- wine1.7-1.7.50/po/sr_RS@cyrillic.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/sr_RS@cyrillic.po 2015-11-13 14:32:40.000000000 +0000 @@ -57,20 +57,19 @@ msgstr "Подршка" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "У реду" @@ -140,19 +139,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Откажи" @@ -318,7 +317,7 @@ msgid "&Apply" msgstr "&Примени" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Помоћ" @@ -353,7 +352,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7673,72 +7672,72 @@ msgid "Off" msgstr "Искључено" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Унос објекта" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Врста објекта:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Резултат" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Направи ново" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Направи контролу" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Направи из датотеке" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "&Додај контролу..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "Прикажи као иконицу" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Потражи..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "Датотека:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Убацивање" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Извор:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "&Убаци" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "Убаци &везу" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "&Као:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "&Прикажи као иконицу" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "Промени &иконицу..." @@ -7774,22 +7773,32 @@ msgid "Add Control" msgstr "Додај контролу" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "&Фонт..." +#: oledlg.rc:36 +#, fuzzy +msgid "%1 %2 &Object" +msgstr "Не постоји такав објекат" + +#: oledlg.rc:34 +#, fuzzy +msgid "%1 &Object" +msgstr "Не постоји такав објекат" + #: oledlg.rc:33 oleview.rc:40 #, fuzzy msgid "&Object" msgstr "Не постоји такав објекат" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "Умеће садржај из оставе у документ као %s." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7797,7 +7806,7 @@ "Умеће садржај из оставе у документ како бисте га могли активирати користећи " "%s." -#: oledlg.rc:41 +#: oledlg.rc:43 #, fuzzy msgid "" "Inserts the contents of the clipboard into your document so that you can " @@ -7806,7 +7815,7 @@ "Умеће садржај из оставе у документ како бисте га могли активирати користећи " "%s. Биће приказано као иконица." -#: oledlg.rc:42 +#: oledlg.rc:44 #, fuzzy msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " @@ -7816,7 +7825,7 @@ "Умеће садржај из оставе у документ као %s. Подаци су повезани с изворишном " "датотеком, тако да ће измене датотеке бити рефлектоване у документу." -#: oledlg.rc:43 +#: oledlg.rc:45 #, fuzzy msgid "" "Inserts a picture of the clipboard contents into your document. The picture " @@ -7826,7 +7835,7 @@ "Умеће слику из оставе у документ. Слика је повезана с изворишном датотеком, " "тако да ће измене датотеке бити рефлектоване у документу." -#: oledlg.rc:44 +#: oledlg.rc:46 #, fuzzy msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " @@ -7836,19 +7845,19 @@ "Умеће пречицу која води до локације садржаја оставе. Пречица је повезана с " "изворишном датотеком, тако да ће измене бити рефлектоване у документу." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "Умеће садржај из оставе у документ." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "Непозната врста" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Непознат извор" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "програм који га је направио" @@ -8346,7 +8355,7 @@ msgid "Message" msgstr "Порука" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Да" @@ -8354,7 +8363,7 @@ msgid "Yes to &all" msgstr "Да за &све" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&Не" @@ -8897,23 +8906,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "&Прекини" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "Покушај &поново" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Занемари" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "Пок&ушај поново" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "&Настави" diff -Nru wine1.7-1.7.50/po/sr_RS@latin.po wine1.7-1.7.55/po/sr_RS@latin.po --- wine1.7-1.7.50/po/sr_RS@latin.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/sr_RS@latin.po 2015-11-13 14:32:40.000000000 +0000 @@ -57,20 +57,19 @@ msgstr "Podrška" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "U redu" @@ -140,19 +139,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Otkaži" @@ -323,7 +322,7 @@ msgid "&Apply" msgstr "&Primeni" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Pomoć" @@ -358,7 +357,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7770,72 +7769,72 @@ msgid "Off" msgstr "Isključeno" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Unos objekta" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Vrsta objekta:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Rezultat" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Napravi novo" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Napravi kontrolu" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Napravi iz datoteke" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "&Dodaj kontrolu..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "Prikaži kao ikonicu" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Potraži..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "Datoteka:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Ubacivanje" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Izvor:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "&Ubaci" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "Ubaci &vezu" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "&Kao:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "&Prikaži kao ikonicu" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "Promeni &ikonicu..." @@ -7871,21 +7870,31 @@ msgid "Add Control" msgstr "Dodaj kontrolu" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy msgid "&Convert..." msgstr "Štampaj..." +#: oledlg.rc:36 +#, fuzzy +msgid "%1 %2 &Object" +msgstr "Ne postoji takav objekat" + +#: oledlg.rc:34 +#, fuzzy +msgid "%1 &Object" +msgstr "Ne postoji takav objekat" + #: oledlg.rc:33 oleview.rc:40 #, fuzzy msgid "&Object" msgstr "Ne postoji takav objekat" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "Umeće sadržaj iz ostave u dokument kao %s." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7893,7 +7902,7 @@ "Umeće sadržaj iz ostave u dokument kako biste ga mogli aktivirati koristeći " "%s." -#: oledlg.rc:41 +#: oledlg.rc:43 #, fuzzy msgid "" "Inserts the contents of the clipboard into your document so that you can " @@ -7902,7 +7911,7 @@ "Umeće sadržaj iz ostave u dokument kako biste ga mogli aktivirati koristeći " "%s. Biće prikazano kao ikonica." -#: oledlg.rc:42 +#: oledlg.rc:44 #, fuzzy msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " @@ -7912,7 +7921,7 @@ "Umeće sadržaj iz ostave u dokument kao %s. Podaci su povezani s izvorišnom " "datotekom, tako da će izmene datoteke biti reflektovane u dokumentu." -#: oledlg.rc:43 +#: oledlg.rc:45 #, fuzzy msgid "" "Inserts a picture of the clipboard contents into your document. The picture " @@ -7922,7 +7931,7 @@ "Umeće sliku iz ostave u dokument. Slika je povezana s izvorišnom datotekom, " "tako da će izmene datoteke biti reflektovane u dokumentu." -#: oledlg.rc:44 +#: oledlg.rc:46 #, fuzzy msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " @@ -7932,19 +7941,19 @@ "Umeće prečicu koja vodi do lokacije sadržaja ostave. Prečica je povezana s " "izvorišnom datotekom, tako da će izmene biti reflektovane u dokumentu." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "Umeće sadržaj iz ostave u dokument." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "Nepoznata vrsta" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Nepoznat izvor" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "program koji ga je napravio" @@ -8447,7 +8456,7 @@ msgid "Message" msgstr "Poruka" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Da" @@ -8455,7 +8464,7 @@ msgid "Yes to &all" msgstr "Da za &sve" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&Ne" @@ -8999,23 +9008,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "&Prekini" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "Pokušaj &ponovo" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Zanemari" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "Pok&ušaj ponovo" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "&Nastavi" diff -Nru wine1.7-1.7.50/po/sv.po wine1.7-1.7.55/po/sv.po --- wine1.7-1.7.50/po/sv.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/sv.po 2015-11-13 14:32:40.000000000 +0000 @@ -57,20 +57,19 @@ msgstr "Supportinformation" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "OK" @@ -140,19 +139,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Avbryt" @@ -312,7 +311,7 @@ msgid "&Apply" msgstr "&Verkställ" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Hjälp" @@ -347,7 +346,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7336,72 +7335,72 @@ msgid "Off" msgstr "Av" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Infoga objekt" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Objekttyp:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Resultat" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Skapa ny" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Skapa en kontroll" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Skapa från fil" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "&Lägg till kontroll..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "Visa som ikon" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Bläddra..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "Fil:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Klistra in special" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Källa:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "Klistra &in" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "Klistra in &länk" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "&Som:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "&Visa som ikon" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "Byt &ikon..." @@ -7429,64 +7428,76 @@ msgid "Add Control" msgstr "Lägg till kontroll" -#: oledlg.rc:34 +#: oledlg.rc:35 msgid "&Convert..." msgstr "" +#: oledlg.rc:36 +#, fuzzy +#| msgid "&Object" +msgid "%1 %2 &Object" +msgstr "&Objekt" + +#: oledlg.rc:34 +#, fuzzy +#| msgid "&Object" +msgid "%1 &Object" +msgstr "&Objekt" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "&Objekt" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "" -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." msgstr "" -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." msgstr "" -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " "your document." msgstr "" -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " "in your document." msgstr "" -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " "be reflected in your document." msgstr "" -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "" -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "Okänd typ" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Okänd källa" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "programmet som skapade det" @@ -7968,7 +7979,7 @@ msgid "Message" msgstr "Meddelande" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Ja" @@ -7976,7 +7987,7 @@ msgid "Yes to &all" msgstr "Ja till &allt" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&Nej" @@ -8502,23 +8513,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "&Nästa\tCtrl+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "&Avbryt" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "&Försök igen" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Ignorera" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "&Försök igen" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "For&tsätt" diff -Nru wine1.7-1.7.50/po/te.po wine1.7-1.7.55/po/te.po --- wine1.7-1.7.50/po/te.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/te.po 2015-11-13 14:32:40.000000000 +0000 @@ -53,20 +53,19 @@ msgstr "" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "" @@ -130,19 +129,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "" @@ -293,7 +292,7 @@ msgid "&Apply" msgstr "" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "" @@ -328,7 +327,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7230,72 +7229,72 @@ msgid "Off" msgstr "" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "" -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "" -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "" @@ -7323,66 +7322,74 @@ msgid "Add Control" msgstr "" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "ఫాంట్ (&F)..." +#: oledlg.rc:36 +msgid "%1 %2 &Object" +msgstr "" + +#: oledlg.rc:34 +msgid "%1 &Object" +msgstr "" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "" -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." msgstr "" -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." msgstr "" -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " "your document." msgstr "" -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " "in your document." msgstr "" -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " "be reflected in your document." msgstr "" -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "" -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "" @@ -7869,7 +7876,7 @@ msgid "Message" msgstr "" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "" @@ -7877,7 +7884,7 @@ msgid "Yes to &all" msgstr "" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "" @@ -8373,24 +8380,24 @@ msgid "Nex&t\tCtrl+F6" msgstr "" -#: user32.rc:82 +#: user32.rc:81 #, fuzzy msgid "&Abort" msgstr "గడియారం గురించి... (&A)" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "" diff -Nru wine1.7-1.7.50/po/th.po wine1.7-1.7.55/po/th.po --- wine1.7-1.7.50/po/th.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/th.po 2015-11-13 14:32:40.000000000 +0000 @@ -54,20 +54,19 @@ msgstr "รายละเอียด" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "ตกลง" @@ -134,19 +133,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "ยกเลิก" @@ -296,7 +295,7 @@ msgid "&Apply" msgstr "มีผลทันที" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "ช่วยเหลีอ" @@ -331,7 +330,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7380,77 +7379,77 @@ msgid "Off" msgstr "ปิด" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "" -#: oledlg.rc:63 +#: oledlg.rc:65 #, fuzzy msgid "Create New" msgstr "สร้างไดเรกทอรีใหม่" -#: oledlg.rc:65 +#: oledlg.rc:67 #, fuzzy msgid "Create Control" msgstr "เนื้อหา" -#: oledlg.rc:67 +#: oledlg.rc:69 #, fuzzy msgid "Create From File" msgstr "สร้างไดเรกทอรีใหม่" -#: oledlg.rc:70 +#: oledlg.rc:72 #, fuzzy msgid "&Add Control..." msgstr "เนื้อหา" -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "" -#: oledlg.rc:74 +#: oledlg.rc:76 #, fuzzy msgid "File:" msgstr "แฟ้ม" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "" @@ -7478,7 +7477,7 @@ msgid "Add Control" msgstr "" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy msgid "&Convert..." msgstr "" @@ -7487,60 +7486,68 @@ "#-#-#-#-# th.po (Wine) #-#-#-#-#\n" "รูปแบบดัวอักษร..." +#: oledlg.rc:36 +msgid "%1 %2 &Object" +msgstr "" + +#: oledlg.rc:34 +msgid "%1 &Object" +msgstr "" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "" -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." msgstr "" -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." msgstr "" -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " "your document." msgstr "" -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " "in your document." msgstr "" -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " "be reflected in your document." msgstr "" -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "" -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "" @@ -8030,7 +8037,7 @@ msgid "Message" msgstr "" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "" @@ -8038,7 +8045,7 @@ msgid "Yes to &all" msgstr "" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 #, fuzzy msgid "&No" msgstr "ไม่ใช่" @@ -8552,24 +8559,24 @@ msgid "Nex&t\tCtrl+F6" msgstr "" -#: user32.rc:82 +#: user32.rc:81 #, fuzzy msgid "&Abort" msgstr "เกี่ยวกับนาฬิกา..." -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "" -#: user32.rc:88 +#: user32.rc:87 #, fuzzy msgid "&Continue" msgstr "เนื้อหา" diff -Nru wine1.7-1.7.50/po/tr.po wine1.7-1.7.55/po/tr.po --- wine1.7-1.7.50/po/tr.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/tr.po 2015-11-13 14:32:40.000000000 +0000 @@ -6,7 +6,7 @@ "Report-Msgid-Bugs-To: http://bugs.winehq.org\n" "POT-Creation-Date: N/A\n" "PO-Revision-Date: 2013-10-30 12:44+0100\n" -"Last-Translator: Volkan Gezer \n" +"Last-Translator: Can Taşan \n" "Language-Team: Turkish \n" "Language: tr\n" "MIME-Version: 1.0\n" @@ -25,7 +25,7 @@ "drive, click Install." msgstr "" "Disketten, CD-ROM sürücüsünden veya sabit diskinizden yeni bir program " -"yüklemek için, Yükle tıklayın." +"yüklemek için, Yükle'yi tıklatın." #: appwiz.rc:62 msgid "&Install..." @@ -39,11 +39,11 @@ msgstr "" "Aşağıdaki yazılım otomatik olarak kaldırılabilir. Bir programı kaldırmak " "veya yüklü bileşenlerini düzenlemek için listeden seçtikten sonra Düzenle/" -"Kaldır tıklayın." +"Kaldır'ı tıklatın." #: appwiz.rc:67 msgid "&Support Information" -msgstr "&Destek Bilgileri" +msgstr "&Destek Bilgisi" #: appwiz.rc:68 regedit.rc:45 regedit.rc:90 msgid "&Modify..." @@ -56,23 +56,22 @@ #: appwiz.rc:75 msgid "Support Information" -msgstr "Destek Bilgileri" +msgstr "Destek Bilgisi" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "Tamam" @@ -94,11 +93,11 @@ #: appwiz.rc:83 msgid "Support Information:" -msgstr "Destek Bilgileri:" +msgstr "Destek Bilgisi:" #: appwiz.rc:84 msgid "Support Telephone:" -msgstr "Destek Telefon:" +msgstr "Destek Telefonu:" #: appwiz.rc:85 msgid "Readme:" @@ -114,7 +113,7 @@ #: appwiz.rc:100 msgid "Wine Gecko Installer" -msgstr "Wine Gecko Kurucusu" +msgstr "Wine Gecko Yükleyicisi" #: appwiz.rc:103 msgid "" @@ -142,25 +141,25 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "İptal" #: appwiz.rc:115 msgid "Wine Mono Installer" -msgstr "Wine Mono Kurucusu" +msgstr "Wine Mono Yükleyicisi" #: appwiz.rc:118 msgid "" @@ -180,15 +179,15 @@ #: appwiz.rc:31 msgid "Add/Remove Programs" -msgstr "Programları Ekle/Kaldır" +msgstr "Program Ekle/Kaldır" #: appwiz.rc:32 msgid "" "Allows you to install new software, or remove existing software from your " "computer." msgstr "" -"Bilgisayarınıza yeni yazılım yüklemenize veya bilgisayarınızdan yazılım " -"kaldırmanıza izin verir." +"Bilgisayarınıza yeni yazılım yüklemenizi veya bilgisayarınızdan yazılım " +"kaldırmanızı sağlar." #: appwiz.rc:33 taskmgr.rc:262 winecfg.rc:33 msgid "Applications" @@ -199,12 +198,12 @@ "Unable to execute the uninstaller, '%s'. Do you want to remove the uninstall " "entry for this program from the registry?" msgstr "" -"'%s' kaldırma komutu çalıştırılamadı. Sistem kaydından bu kaldırma girişini " +"'%s' kaldırma komutu çalıştırılamadı. Sistem kaydından bu kaldırma girdisini " "silmek ister misiniz?" #: appwiz.rc:36 msgid "Not specified" -msgstr "belirlenmedi" +msgstr "Belirlenmedi" #: appwiz.rc:38 shell32.rc:144 shell32.rc:241 regedit.rc:125 winefile.rc:107 msgid "Name" @@ -248,8 +247,8 @@ "Unexpected checksum of downloaded file. Aborting installation of corrupted " "file." msgstr "" -"İndirilen dosyada beklenmeyen sağlama toplamı. Bozuk dosyanın kurulumu iptal " -"ediliyor." +"İndirilen dosyada beklenmeyen sağlama toplamı (checksum). Bozuk dosyanın " +"kurulumu iptal ediliyor." #: avifil32.rc:42 msgid "Compress options" @@ -315,7 +314,7 @@ msgid "&Apply" msgstr "&Uygula" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "Yardım" @@ -350,7 +349,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -448,7 +447,7 @@ #: comdlg32.rc:205 comdlg32.rc:382 msgid "Print range" -msgstr "Aralığı yazdır" +msgstr "Yazdırma aralığı" #: comdlg32.rc:206 comdlg32.rc:383 regedit.rc:219 msgid "&All" @@ -847,11 +846,11 @@ #: comdlg32.rc:40 msgid "The selection contains a non-folder object" -msgstr "" +msgstr "Seçim klasör olmayan bir öge içeriyor" #: comdlg32.rc:45 msgid "Up One Level" -msgstr "Bir Düzey Yukarı" +msgstr "Bir Dizin Yukarı" #: comdlg32.rc:46 msgid "Create New Folder" @@ -951,7 +950,7 @@ #: comdlg32.rc:56 msgid "Unreadable Entry" -msgstr "Okunamayan Giriş" +msgstr "Okunamayan Girdi" #: comdlg32.rc:58 msgid "" @@ -982,7 +981,7 @@ "This large number of copies is not supported by your printer.\n" "Please enter a value between 1 and %d." msgstr "" -"Bu kadar büyük sayıda kopya yazınız tarafından desteklenmiyor.\n" +"Bu kadar büyük sayıda kopya yazıcınız tarafından desteklenmiyor.\n" "Lütffen 1 ile %d arasında bir değer girin." #: comdlg32.rc:67 @@ -1038,10 +1037,8 @@ msgstr "Dosya Aç" #: comdlg32.rc:147 -#, fuzzy -#| msgid "New Folder" msgid "Select Folder" -msgstr "Yeni Klasör" +msgstr "Dizin Seç" #: comdlg32.rc:83 oleview.rc:98 msgid "Ready" @@ -1121,7 +1118,7 @@ #: comdlg32.rc:102 msgid "No toner; " -msgstr "Toner yok; " +msgstr "Kartuş yok; " #: comdlg32.rc:103 msgid "Page punt; " @@ -1137,7 +1134,7 @@ #: comdlg32.rc:106 msgid "The printer door is open; " -msgstr "Yazıcı kapısı açık; " +msgstr "Yazıcı kapağı açık; " #: comdlg32.rc:107 msgid "Print server unknown; " @@ -1182,11 +1179,11 @@ #: credui.rc:30 msgid "Connect to %s" -msgstr "%s Bağlan" +msgstr "%s'ye bağlan" #: credui.rc:31 msgid "Connecting to %s" -msgstr "%s bağlanıyor" +msgstr "%s'ye bağlanıyor" #: credui.rc:32 msgid "Logon unsuccessful" @@ -1218,7 +1215,7 @@ #: crypt32.rc:30 msgid "Authority Key Identifier" -msgstr "Uzmak Anahtar Tanımlayıcı" +msgstr "Uzman Anahtar Tanımlayıcı" #: crypt32.rc:31 msgid "Key Attributes" @@ -1459,7 +1456,7 @@ #: crypt32.rc:90 msgid "OS Version" -msgstr "OS Sürümü" +msgstr "İşletim Sistemi Sürümü" #: crypt32.rc:91 msgid "Enrollment CSP" @@ -1475,7 +1472,7 @@ #: crypt32.rc:94 msgid "Issuing Distribution Point" -msgstr "Dağıt Noktası Sağlanıyor" +msgstr "Dağıtım Noktası Sağlanıyor" #: crypt32.rc:95 msgid "Freshest CRL" @@ -1603,7 +1600,7 @@ #: crypt32.rc:126 msgid "Transaction Id" -msgstr "İşlem Id'si" +msgstr "İşlem Kimliği" #: crypt32.rc:127 msgid "Sender Nonce" @@ -1643,7 +1640,7 @@ #: crypt32.rc:136 msgid "Private Key Usage Period" -msgstr "Özel Anahtar Kullanım Peryodu" +msgstr "Özel Anahtar Kullanım Periyodu" #: crypt32.rc:137 msgid "Client Information" @@ -1691,7 +1688,7 @@ #: crypt32.rc:148 msgid "Encrypting File System" -msgstr "Dosya Sistemi Şifreleniyor" +msgstr "Dosya Sistemi Şifrelemesi" #: crypt32.rc:149 cryptui.rc:133 msgid "Windows Hardware Driver Verification" @@ -1735,7 +1732,7 @@ #: crypt32.rc:159 cryptui.rc:140 msgid "Document Signing" -msgstr "Doküman İmzalama" +msgstr "Belge İmzalama" #: crypt32.rc:160 msgid "IP security IKE intermediate" @@ -1886,7 +1883,7 @@ #: crypt32.rc:204 msgid "Unknown Access Method" -msgstr "Bilinmeyen Erişim Methodu" +msgstr "Bilinmeyen Erişim Yöntemi" #: crypt32.rc:205 msgid "Alternative Name" @@ -2151,19 +2148,19 @@ #: cryptui.rc:260 msgid "" "Add the object identifier (OID) for the certificate purpose you wish to add:" -msgstr "Eklemek istediğiniz sertifika amacı için nesne kimliği (OID) ekle:" +msgstr "Eklemek istediğiniz sertifika amacı için nesne kimliği (OID) ekleyin:" #: cryptui.rc:268 cryptui.rc:69 msgid "Select Certificate Store" -msgstr "Sertifika Mağazasını Seç" +msgstr "Sertifika Deposunu Seç" #: cryptui.rc:271 msgid "Select the certificate store you want to use:" -msgstr "Kullanmak istediğiniz sertifika mağazasını seçin:" +msgstr "Kullanmak istediğiniz sertifika deposunu seçin:" #: cryptui.rc:274 msgid "&Show physical stores" -msgstr "Fizik&sel mağazaları göster" +msgstr "Fizik&sel depoları göster" #: cryptui.rc:280 cryptui.rc:291 cryptui.rc:308 cryptui.rc:322 cryptui.rc:71 msgid "Certificate Import Wizard" @@ -2190,10 +2187,10 @@ "\n" "Bir sertifika, sizi veya iletişim kurduğunuz bilgisayarınızı tanımlamanızda " "kullanılabilir. Ayrıca yetkilendirme ve iletileri imzalamada da " -"kullanılabilir. Sertifika mağazaları; sertifikalar, sertifika iptal " -"listeleri ve sertifika güven listelerinden oluşan koleksiyonlardır.\n" +"kullanılabilir. Sertifika depoları; sertifikalar, sertifika iptal listeleri " +"ve sertifika güven listelerinden oluşan koleksiyonlardır.\n" "\n" -"Devam etmek için İleri tıklayın." +"Devam etmek için İleri'yi tıklatın." #: cryptui.rc:294 cryptui.rc:430 msgid "&File name:" @@ -2221,23 +2218,23 @@ #: cryptui.rc:303 cryptui.rc:81 cryptui.rc:162 msgid "Microsoft Serialized Certificate Store (*.sst)" -msgstr "Microsoft Numaralandırılmış Sertifika Mağazası (*.sst)" +msgstr "Microsoft Numaralandırılmış Sertifika Deposu (*.sst)" #: cryptui.rc:311 msgid "" "Wine can automatically select the certificate store, or you can specify a " "location for the certificates." msgstr "" -"Wine otomatik olarak bir sertifika mağazası seçebilir veya sertifikalar için " +"Wine otomatik olarak bir sertifika deposu seçebilir veya sertifikalar için " "siz de bir konum belirleyebilirsiniz." #: cryptui.rc:313 msgid "&Automatically select certificate store" -msgstr "Sertifik&a mağazasını otomatik seç" +msgstr "Sertifik&a deposunu otomatik seç" #: cryptui.rc:315 msgid "&Place all certificates in the following store:" -msgstr "&Tüm sertifikaları aşağıdaki mağazaya yerleştir:" +msgstr "&Tüm sertifikaları aşağıdaki depoya yerleştir:" #: cryptui.rc:325 msgid "Completing the Certificate Import Wizard" @@ -2320,15 +2317,15 @@ "\n" "To continue, click Next." msgstr "" -"Bu sihirbaz; bir sertifika mağazasından sertifika, sertifika iptal listesi " -"ve sertifika güven listesini bir dosyaya aktarmanıza yardım edecektir.\n" +"Bu sihirbaz; bir sertifika deposundan sertifika, sertifika iptal listesi ve " +"sertifika güven listesini bir dosyaya aktarmanıza yardım edecektir.\n" "\n" "Bir sertifika, sizi ve iletişim kurduğunuz bilgisayarınızı tanımlamada " "kullanılabilir. Ayrıca yetkilendirme ve iletileri imzalama da " -"kullanılabilir. Sertifika mağazaları; sertifikalar, sertifika iptal listesi " -"ve sertifika güven listesinden oluşan koleksiyonlardır.\n" +"kullanılabilir. Sertifika depoları; sertifikalar, sertifika iptal listesi ve " +"sertifika güven listesinden oluşan koleksiyonlardır.\n" "\n" -"Devam etmek için İleri tıklayın." +"Devam etmek için İleri'yi tıklatın." #: cryptui.rc:384 msgid "" @@ -2352,11 +2349,11 @@ #: cryptui.rc:399 msgid "&Confirm password:" -msgstr "&Parola onayla:" +msgstr "&Parolayı onayla:" #: cryptui.rc:407 msgid "Select the format you want to use:" -msgstr "Kullanmak biçimi seçin:" +msgstr "Kullanmak istediğiniz biçimi seçin:" #: cryptui.rc:408 msgid "&DER-encoded X.509 (*.cer)" @@ -2420,7 +2417,7 @@ "trusted root certificate store." msgstr "" "Bu kök sertifikasına güvenilmiyor. Güvenmek için, sisteminizin güvenilir kök " -"sertifika mağazasına eklemeniz gerekli." +"sertifika deposuna eklemeniz gerekli." #: cryptui.rc:34 msgid "This certificate could not be validated to a trusted root certificate." @@ -2428,7 +2425,7 @@ #: cryptui.rc:35 msgid "This certificate's issuer could not be found." -msgstr "Bu sertifika dağıtımcısı bulunamadı." +msgstr "Bu sertifikanın dağıtımcısı bulunamadı." #: cryptui.rc:36 msgid "All the intended purposes of this certificate could not be verified." @@ -2436,7 +2433,7 @@ #: cryptui.rc:37 msgid "This certificate is intended for the following purposes:" -msgstr "Bu sertifika aşağıdaki isteklerde amaçlanıyor:" +msgstr "Bu sertifika aşağıdaki istekler için amaçlanıyor:" #: cryptui.rc:38 msgid "Issued to: " @@ -2456,15 +2453,16 @@ #: cryptui.rc:42 msgid "This certificate has an invalid signature." -msgstr "Bu sertifikanın geçersiz imzası var." +msgstr "Bu sertifikanın geçersiz bir imzası var." #: cryptui.rc:43 msgid "This certificate has expired or is not yet valid." -msgstr "Bu sertifikanın süresi dolmuş veya henüz geçerli değil." +msgstr "Bu sertifikanın süresi dolmuş veya sertifika henüz geçerli değil." #: cryptui.rc:44 msgid "This certificate's validity period exceeds that of its issuer." -msgstr "Bu sertifikanın geçerlilik süresi dağıtıcısını aşmakta." +msgstr "" +"Bu sertifikanın geçerlilik süresi dağıtıcısının geçerlilik süresini aşmakta." #: cryptui.rc:45 msgid "This certificate was revoked by its issuer." @@ -2496,7 +2494,7 @@ #: cryptui.rc:52 msgid "Critical Extensions Only" -msgstr "Sadece Kritik Eklentile" +msgstr "Sadece Kritik Eklentiler" #: cryptui.rc:53 msgid "Properties Only" @@ -2540,7 +2538,7 @@ #: cryptui.rc:64 msgid "Friendly name" -msgstr "Dostça isim" +msgstr "Kolay hatırlanabilir isim" #: cryptui.rc:65 shell32.rc:242 ipconfig.rc:44 msgid "Description" @@ -2560,7 +2558,7 @@ #: cryptui.rc:70 msgid "Please select a certificate store." -msgstr "Lütfen bir sertifika mağazası seçin." +msgstr "Lütfen bir sertifika deposu seçin." #: cryptui.rc:72 msgid "" @@ -2580,15 +2578,15 @@ #: cryptui.rc:75 cryptui.rc:98 msgid "Certificate Store" -msgstr "Sertifika Mağazası" +msgstr "Sertifika Deposu" #: cryptui.rc:76 msgid "" "Certificate stores are collections of certificates, certificate revocation " "lists, and certificate trust lists." msgstr "" -"Sertifika mağazaları, sertifikalar, sertifika iptal listesi ve sertifika " -"güven listelerinin koleksiyonlarıdır." +"Sertifika depoları; sertifikalar, sertifika iptal listesi ve sertifika güven " +"listelerinin koleksiyonlarıdır." #: cryptui.rc:77 msgid "X.509 Certificate (*.cer; *.crt)" @@ -2616,7 +2614,7 @@ #: cryptui.rc:85 msgid "The file format is not recognized. Please select another file." -msgstr "Dosya biçimi tanınmadı. Lütfen başka dosya seçin." +msgstr "Dosya biçimi bilinmiyor. Lütfen başka dosya seçin." #: cryptui.rc:86 msgid "Could not open " @@ -2688,7 +2686,7 @@ #: cryptui.rc:107 msgid "Friendly Name" -msgstr "Dostça İsim" +msgstr "Kolay Hatırlanabilir İsim" #: cryptui.rc:109 cryptui.rc:123 msgid "" @@ -2725,11 +2723,6 @@ "Bu sertifikayı silmek istediğinizden emin misiniz?" #: cryptui.rc:113 -#, fuzzy -#| msgid "" -#| "You will no longer be able to encrypt messages with these certificates, " -#| "or verify messages signed with it.\n" -#| "Are you sure you want to remove these certificates?" msgid "" "You will no longer be able to encrypt messages with these certificates, or " "verify messages signed with them.\n" @@ -2829,7 +2822,7 @@ #: cryptui.rc:129 msgid "Allows data to be signed with the current time" -msgstr "Geçerli zaman ile verinin imzalanmasına izin verir" +msgstr "Şu anki zaman ile verinin imzalanmasına izin verir" #: cryptui.rc:130 msgid "Allows you to digitally sign a certificate trust list" @@ -2861,7 +2854,7 @@ #: cryptui.rc:155 msgid "The specified file already exists. Do you want to replace it?" -msgstr "Belirtilen isim mevcut. Üzerine yazılsın mı?" +msgstr "Belirtilen dosya zaten mevcut. Üzerine yazılsın mı?" #: cryptui.rc:156 msgid "DER-Encoded Binary X.509 (*.cer)" @@ -2921,7 +2914,7 @@ #: cryptui.rc:174 msgid "The passwords do not match." -msgstr "Parolalar eşleşmedi." +msgstr "Parolalar eşleşmiyor." #: cryptui.rc:175 msgid "Note: The private key for this certificate could not be opened." @@ -2973,7 +2966,7 @@ #: dinput.rc:56 msgid "Show Assigned First" -msgstr "İlk, Atananları Göster" +msgstr "İlk Atananları Göster" #: dinput.rc:37 msgid "Action" @@ -3001,7 +2994,7 @@ #: gdi32.rc:30 msgid "Cyrillic" -msgstr "Kril" +msgstr "Kiril" #: gdi32.rc:31 msgid "Greek" @@ -3009,7 +3002,7 @@ #: gdi32.rc:32 msgid "Turkish" -msgstr "Turkçe" +msgstr "Türkçe" #: gdi32.rc:33 msgid "Hebrew" @@ -3045,7 +3038,7 @@ #: gdi32.rc:41 msgid "CHINESE_BIG5" -msgstr "CHINESE_BIG5" +msgstr "ÇİNCE_BIG5" #: gdi32.rc:42 msgid "Hangul(Johab)" @@ -3097,7 +3090,7 @@ #: gphoto2.rc:51 msgid "Connecting to camera" -msgstr "Kameraya bağlanılıayor" +msgstr "Kameraya bağlanılıyor" #: gphoto2.rc:55 msgid "Connecting to camera... Please Wait" @@ -3105,7 +3098,7 @@ #: hhctrl.rc:59 msgid "S&ync" -msgstr "&Senk." +msgstr "&Senkronize et" #: hhctrl.rc:60 hhctrl.rc:73 shdoclc.rc:41 winhlp32.rc:89 msgid "&Back" @@ -3142,10 +3135,8 @@ msgstr "&Kaynağı Göster" #: hhctrl.rc:83 -#, fuzzy -#| msgid "Properties" msgid "Proper&ties" -msgstr "Özellikler" +msgstr "&Özellikler" #: hhctrl.rc:87 shdoclc.rc:79 shdoclc.rc:93 shdoclc.rc:117 shdoclc.rc:159 #: shdoclc.rc:183 user32.rc:60 wordpad.rc:104 @@ -3287,7 +3278,7 @@ #: ieframe.rc:60 msgid "&About Internet Explorer" -msgstr "&İnternet Explorer Hakkında" +msgstr "&Internet Explorer Hakkında" #: ieframe.rc:90 msgid "Open URL" @@ -3295,7 +3286,7 @@ #: ieframe.rc:93 msgid "Specify the URL you wish to open in Internet Explorer" -msgstr "Internet Explorer'da açmak istediğiniz URL'yi belirtin" +msgstr "Internet Explorer'de açmak istediğiniz URL'yi belirtin" #: ieframe.rc:94 msgid "Open:" @@ -3304,7 +3295,7 @@ #: ieframe.rc:70 msgctxt "home page" msgid "Home" -msgstr "Ev" +msgstr "Ana Sayfa" #: ieframe.rc:71 winhlp32.rc:69 msgid "Print..." @@ -3356,7 +3347,8 @@ #: inetcpl.rc:57 msgid "You can delete cached pages, cookies and other data." -msgstr "Belleğe alınmış sayfaları, çerezleri ve diğer verileri silebilirsiniz." +msgstr "" +"Önbelleğe alınmış sayfaları, çerezleri ve diğer verileri silebilirsiniz." #: inetcpl.rc:59 msgid "Delete &files..." @@ -3441,11 +3433,11 @@ #: inetcpl.rc:32 msgid "Configure Wine Internet Browser and related settings" -msgstr "Wine Internet Tarayıcısı ve bağlı ayarlarını yapılandır" +msgstr "Wine Internet Tarayıcısı ve ilgili ayarları yapılandır" #: inetcpl.rc:33 msgid "Security settings for zone: " -msgstr "Bölge için güvenlik ayarları: " +msgstr "Şu bölge için güvenlik ayarları: " #: inetcpl.rc:34 msgid "Custom" @@ -3477,7 +3469,7 @@ #: joy.rc:39 winecfg.rc:213 msgid "&Disable" -msgstr "&Etkisizleştir" +msgstr "&Devre Dışı Bırak" #: joy.rc:40 msgid "&Enable" @@ -3489,7 +3481,7 @@ #: joy.rc:43 msgid "Disabled" -msgstr "Etkin değil" +msgstr "Devre dışı" #: joy.rc:45 msgid "" @@ -3576,16 +3568,12 @@ msgstr "Beklenen ')'" #: jscript.rc:40 -#, fuzzy -#| msgid "Subject Key Identifier" msgid "Expected identifier" -msgstr "Konu Anahtar Kimliği" +msgstr "Beklenen Anahtar Kimliği" #: jscript.rc:41 -#, fuzzy -#| msgid "Expected ';'" msgid "Expected '='" -msgstr "Beklenen ';'" +msgstr "Beklenen '='" #: jscript.rc:42 msgid "Invalid character" @@ -3616,20 +3604,16 @@ msgstr "Etiket bulunamadı" #: jscript.rc:49 -#, fuzzy -#| msgid "Expected ';'" msgid "Expected '@end'" -msgstr "Beklenen ';'" +msgstr "Beklenen '@end'" #: jscript.rc:50 msgid "Conditional compilation is turned off" msgstr "Şartlı derleme kapatıldı" #: jscript.rc:51 -#, fuzzy -#| msgid "Expected ';'" msgid "Expected '@'" -msgstr "Beklenen ';'" +msgstr "Beklenen '@'" #: jscript.rc:54 msgid "Number expected" @@ -3789,7 +3773,7 @@ #: winerror.mc:136 msgid "Bad command.\n" -msgstr "Kötü komut.\n" +msgstr "Yanlış komut.\n" #: winerror.mc:141 msgid "CRC error.\n" @@ -3797,7 +3781,7 @@ #: winerror.mc:146 msgid "Bad length.\n" -msgstr "Bozuk uzunluk.\n" +msgstr "Yanlış uzunluk.\n" #: winerror.mc:151 winerror.mc:526 msgid "Seek error.\n" @@ -3837,7 +3821,7 @@ #: winerror.mc:196 msgid "Wrong disk.\n" -msgstr "Hatalı disk.\n" +msgstr "Yanlış disk.\n" #: winerror.mc:201 msgid "Sharing buffer exceeded.\n" @@ -3865,7 +3849,7 @@ #: winerror.mc:231 msgid "Bad network path.\n" -msgstr "Kötü ağ yolu.\n" +msgstr "Yanlış ağ yolu.\n" #: winerror.mc:236 msgid "Network busy.\n" @@ -3881,19 +3865,19 @@ #: winerror.mc:251 msgid "Adapter hardware error.\n" -msgstr "Bağlayıcı donanım hatası.\n" +msgstr "Adaptör donanım hatası.\n" #: winerror.mc:256 msgid "Bad network response.\n" -msgstr "Bozuk ağ yanıtı.\n" +msgstr "Yanlış ağ yanıtı.\n" #: winerror.mc:261 msgid "Unexpected network error.\n" -msgstr "Beklenmedik ağ hatası.\n" +msgstr "Beklenmeyen ağ hatası.\n" #: winerror.mc:266 msgid "Bad remote adapter.\n" -msgstr "Bozuk uzak bağlayıcı.\n" +msgstr "Yanlış uzak adaptör.\n" #: winerror.mc:271 msgid "Print queue full.\n" @@ -3913,15 +3897,15 @@ #: winerror.mc:291 msgid "Network access denied.\n" -msgstr "Ağ erişimi engellendi.\n" +msgstr "Ağa erişim engellendi.\n" #: winerror.mc:296 msgid "Bad device type.\n" -msgstr "Kötü aygıt türü.\n" +msgstr "Yanlış aygıt türü.\n" #: winerror.mc:301 msgid "Bad network name.\n" -msgstr "Kötü ağ adı.\n" +msgstr "Yanlış ağ adı.\n" #: winerror.mc:306 msgid "Too many network names.\n" @@ -3985,7 +3969,7 @@ #: winerror.mc:381 msgid "Exclusive semaphore already owned.\n" -msgstr "Dışsal semafor zaten sahipli.\n" +msgstr "Dışsal bayrak işareti zaten sahipli.\n" #: winerror.mc:386 msgid "Semaphore is set.\n" @@ -4045,11 +4029,11 @@ #: winerror.mc:461 msgid "Bad driver level.\n" -msgstr "Bozuk sürücü seviyesi.\n" +msgstr "Yanlış sürücü seviyesi.\n" #: winerror.mc:466 msgid "Call not implemented.\n" -msgstr "Çalıştırılamaz.\n" +msgstr "Çağrı eklenmemiş.\n" #: winerror.mc:471 msgid "Semaphore timeout.\n" @@ -4181,7 +4165,7 @@ #: winerror.mc:636 msgid "Volume label too long.\n" -msgstr "Hacim etiketi çok uzun.\n" +msgstr "Birim etiketi çok uzun.\n" #: winerror.mc:641 msgid "Too many TCBs.\n" @@ -4201,7 +4185,7 @@ #: winerror.mc:661 msgid "Bad thread ID address.\n" -msgstr "Bozuk iş yığını kimlik adresi.\n" +msgstr "Yanlış iş parçacığı kimlik adresi.\n" #: winerror.mc:666 msgid "Bad arguments to DosExecPgm.\n" @@ -4229,7 +4213,7 @@ #: winerror.mc:696 msgid "Cancel violation.\n" -msgstr "İhlali iptal et.\n" +msgstr "İptal etmede ihlal.\n" #: winerror.mc:701 msgid "Atomic locks not supported.\n" @@ -4305,15 +4289,15 @@ #: winerror.mc:791 msgid "Ring 2 segment must be movable.\n" -msgstr "Dönüş 2 segmenti hareketli olmalı.\n" +msgstr "Dönüş 2 segmenti taşınabilir olmalı.\n" #: winerror.mc:796 msgid "Relocation chain exceeds segment limit in %1.\n" -msgstr "" +msgstr "Yeniden konumlandırma dizisi %1'de segment sınırını aşıyor.\n" #: winerror.mc:801 msgid "Infinite loop in relocation chain in %1.\n" -msgstr "" +msgstr "%1 yeniden konumlandırma dizisinde sonsuz döngü.\n" #: winerror.mc:806 msgid "Environment variable not found.\n" @@ -4341,7 +4325,7 @@ #: winerror.mc:836 msgid "Error setting signal handler.\n" -msgstr "Sinyal ele alıcısı ayarlanırken hata.\n" +msgstr "Sinyal işleyicisi ayarlanırken hata.\n" #: winerror.mc:841 msgid "Segment locked.\n" @@ -4353,7 +4337,7 @@ #: winerror.mc:851 msgid "Nesting LoadModule calls not allowed.\n" -msgstr "" +msgstr "LoadModule çağrılarını katmanlamaya (nesting) izin verilmiyor.\n" #: winerror.mc:856 msgid "Machine type mismatch.\n" @@ -4361,7 +4345,7 @@ #: winerror.mc:861 msgid "Bad pipe.\n" -msgstr "Kötü iletişim tüneli.\n" +msgstr "Yanlış iletişim tüneli.\n" #: winerror.mc:866 msgid "Pipe busy.\n" @@ -4397,7 +4381,7 @@ #: winerror.mc:906 msgid "Cannot use Copy API.\n" -msgstr "Kopyalama API'ı kullanılamaz.\n" +msgstr "Kopyalama API'si kullanılamaz.\n" #: winerror.mc:911 msgid "Directory name invalid.\n" @@ -4405,31 +4389,31 @@ #: winerror.mc:916 msgid "Extended attributes didn't fit.\n" -msgstr "" +msgstr "Genişletilmiş özellikler uymadı.\n" #: winerror.mc:921 msgid "Extended attribute file corrupt.\n" -msgstr "" +msgstr "Genişletilmiş özellik dosyası bozuk.\n" #: winerror.mc:926 msgid "Extended attribute table full.\n" -msgstr "" +msgstr "Genişletilmiş özellik dosyası dolu.\n" #: winerror.mc:931 msgid "Invalid extended attribute handle.\n" -msgstr "" +msgstr "Yanlış genişletilmiş özellik işlemesi.\n" #: winerror.mc:936 msgid "Extended attributes not supported.\n" -msgstr "" +msgstr "Genişletilmiş özellikler desteklenmiyor.\n" #: winerror.mc:941 msgid "Mutex not owned by caller.\n" -msgstr "" +msgstr "Çağıran, mutex'e (karşılıklı hariç tutma) sahip değil.\n" #: winerror.mc:946 msgid "Too many posts to semaphore.\n" -msgstr "" +msgstr "İşaretlemek için çok fazla ileti.\n" #: winerror.mc:951 msgid "Read/WriteProcessMemory partially completed.\n" @@ -4437,11 +4421,11 @@ #: winerror.mc:956 msgid "The oplock wasn't granted.\n" -msgstr "" +msgstr "Oplock'a izin verilmedi.\n" #: winerror.mc:961 msgid "Invalid oplock message received.\n" -msgstr "" +msgstr "Geçersiz oplock mesajı alındı.\n" #: winerror.mc:966 msgid "Message 0x%1 not found in file %2.\n" @@ -4465,7 +4449,7 @@ #: winerror.mc:991 msgid "Extended attribute access denied.\n" -msgstr "Uzatılmış nitelik erişimi reddedildi.\n" +msgstr "Genişletilmiş özellik erişimi reddedildi.\n" #: winerror.mc:996 msgid "I/O operation aborted.\n" @@ -4473,11 +4457,11 @@ #: winerror.mc:1001 msgid "Overlapped I/O incomplete.\n" -msgstr "" +msgstr "Çakışan (overlapped) G/Ç tamamlanmadı.\n" #: winerror.mc:1006 msgid "Overlapped I/O pending.\n" -msgstr "" +msgstr "Çakışan (overlapped) G/Ç askıda bekliyor.\n" #: winerror.mc:1011 msgid "No access to memory location.\n" @@ -4517,7 +4501,7 @@ #: winerror.mc:1056 msgid "Nonexistent token.\n" -msgstr "" +msgstr "Bulunmayan simge (token).\n" #: winerror.mc:1061 msgid "Registry corrupt.\n" @@ -4541,7 +4525,7 @@ #: winerror.mc:1086 msgid "Registry has been recovered.\n" -msgstr "Kayıt kurtarıldı.\n" +msgstr "Kayıt defteri kurtarıldı.\n" #: winerror.mc:1091 msgid "Registry is corrupt.\n" @@ -4565,43 +4549,43 @@ #: winerror.mc:1116 msgid "Registry key has subkeys.\n" -msgstr "" +msgstr "Kayıt anahtarının alt anahtarı var.\n" #: winerror.mc:1121 msgid "Subkey must be volatile.\n" -msgstr "" +msgstr "Alt anahtar geçici olmalı.\n" #: winerror.mc:1126 msgid "Notify change request in progress.\n" -msgstr "" +msgstr "Bildirim değiştirme isteği işleniyor.\n" #: winerror.mc:1131 msgid "Dependent services are running.\n" -msgstr "" +msgstr "Bağlı hizmetler çalışıyor.\n" #: winerror.mc:1136 msgid "Invalid service control.\n" -msgstr "Servis kontrolü geçersiz.\n" +msgstr "Hizmet kontrolü geçersiz.\n" #: winerror.mc:1141 msgid "Service request timeout.\n" -msgstr "" +msgstr "Hizmet isteği zaman aşımına uğradı.\n" #: winerror.mc:1146 msgid "Cannot create service thread.\n" -msgstr "" +msgstr "Hizmet iş parçacığı oluşturulamıyor.\n" #: winerror.mc:1151 msgid "Service database locked.\n" -msgstr "" +msgstr "Hizmet veritabanı kilitli.\n" #: winerror.mc:1156 msgid "Service already running.\n" -msgstr "" +msgstr "Hizmet zaten çalışıyor.\n" #: winerror.mc:1161 msgid "Invalid service account.\n" -msgstr "" +msgstr "Geçersiz hizmet hesabı.\n" #: winerror.mc:1166 msgid "Service is disabled.\n" @@ -4609,15 +4593,15 @@ #: winerror.mc:1171 msgid "Circular dependency.\n" -msgstr "" +msgstr "Sirküler bağlılık.\n" #: winerror.mc:1176 msgid "Service does not exist.\n" -msgstr "" +msgstr "Hizmet bulunmuyor.\n" #: winerror.mc:1181 msgid "Service cannot accept control message.\n" -msgstr "" +msgstr "Hizmet, kontrol mesajını kabul edemiyor.\n" #: winerror.mc:1186 msgid "Service not active.\n" @@ -4625,7 +4609,7 @@ #: winerror.mc:1191 msgid "Service controller connect failed.\n" -msgstr "" +msgstr "Hizmet denetleyicisine bağlantı başarısız.\n" #: winerror.mc:1196 msgid "Exception in service.\n" @@ -4653,7 +4637,7 @@ #: winerror.mc:1226 msgid "Service start-hang.\n" -msgstr "" +msgstr "Hizmet, başlarken dondu.\n" #: winerror.mc:1231 msgid "Invalid service lock.\n" @@ -4669,19 +4653,19 @@ #: winerror.mc:1246 msgid "System running last-known-good config.\n" -msgstr "" +msgstr "Sistem, bilinen son iyi yapılandırmada çalışıyor.\n" #: winerror.mc:1251 msgid "Service dependency deleted.\n" -msgstr "" +msgstr "Hizmet bağlılığı silindi.\n" #: winerror.mc:1256 msgid "Boot already accepted as last-good config.\n" -msgstr "" +msgstr "Önyükleme zaten son iyi yapılandırma olarak kabul edildi.\n" #: winerror.mc:1261 msgid "Service not started since last boot.\n" -msgstr "" +msgstr "Hizmet, son açılıştan beri başlatılmamış.\n" #: winerror.mc:1266 msgid "Duplicate service name.\n" @@ -4693,19 +4677,19 @@ #: winerror.mc:1276 msgid "Driver failure cannot be detected.\n" -msgstr "Sürücü başarısızlığı tespit edilemed.\n" +msgstr "Sürücü hatası tespit edilemedi.\n" #: winerror.mc:1281 msgid "Process abort cannot be detected.\n" -msgstr "" +msgstr "İşlem durdurulması tespit edilemedi.\n" #: winerror.mc:1286 msgid "No recovery program for service.\n" -msgstr "" +msgstr "Hizmet için kurtarma programı yok.\n" #: winerror.mc:1291 msgid "Service not implemented by exe.\n" -msgstr "" +msgstr "Hizmet, çalıştırılabilir dosya olarak eklenmedi.\n" #: winerror.mc:1296 msgid "End of media.\n" @@ -4713,7 +4697,7 @@ #: winerror.mc:1301 msgid "Filemark detected.\n" -msgstr "" +msgstr "Filemark bulundu.\n" #: winerror.mc:1306 msgid "Beginning of media.\n" @@ -4721,7 +4705,7 @@ #: winerror.mc:1311 msgid "Setmark detected.\n" -msgstr "" +msgstr "Setmark bulundu.\n" #: winerror.mc:1316 msgid "No data detected.\n" @@ -4729,7 +4713,7 @@ #: winerror.mc:1321 msgid "Partition failure.\n" -msgstr "Disk Bölümü hatası.\n" +msgstr "Disk bölümü hatası.\n" #: winerror.mc:1326 msgid "Invalid block length.\n" @@ -4741,7 +4725,7 @@ #: winerror.mc:1336 msgid "Unable to lock media.\n" -msgstr "" +msgstr "Ortam kilitlenemedi.\n" #: winerror.mc:1341 msgid "Unable to unload media.\n" @@ -4753,7 +4737,7 @@ #: winerror.mc:1351 msgid "I/O bus reset.\n" -msgstr "I/O bus sıfırlaması.\n" +msgstr "G/Ç veriyolu sıfırlaması.\n" #: winerror.mc:1356 msgid "No media in drive.\n" @@ -4761,11 +4745,9 @@ #: winerror.mc:1361 msgid "No Unicode translation.\n" -msgstr "" +msgstr "Unicode çeviri yok.\n" #: winerror.mc:1366 -#, fuzzy -#| msgid "DLL init failed.\n" msgid "DLL initialization failed.\n" msgstr "DLL yükleme başarısız.\n" @@ -4783,91 +4765,91 @@ #: winerror.mc:1386 msgid "No serial devices found.\n" -msgstr "Aygıt seri numarası bulunamadı.\n" +msgstr "Herhangi bir seri aygıt bulunamadı.\n" #: winerror.mc:1391 msgid "Shared IRQ busy.\n" -msgstr "" +msgstr "Paylaşılan IRQ meşgul.\n" #: winerror.mc:1396 msgid "Serial I/O completed.\n" -msgstr "" +msgstr "Seri G/Ç tamamlandı.\n" #: winerror.mc:1401 msgid "Serial I/O counter timeout.\n" -msgstr "" +msgstr "Seri G/Ç sayacı zaman aşımına uğradı.\n" #: winerror.mc:1406 msgid "Floppy ID address mark not found.\n" -msgstr "" +msgstr "Disket kimlik adres işareti bulunamadı.\n" #: winerror.mc:1411 msgid "Floppy reports wrong cylinder.\n" -msgstr "" +msgstr "Disket yanlış silindir ana sektörü bildiriyor.\n" #: winerror.mc:1416 msgid "Unknown floppy error.\n" -msgstr "" +msgstr "Bilinmeyen disket hatası.\n" #: winerror.mc:1421 msgid "Floppy registers inconsistent.\n" -msgstr "" +msgstr "Disket uyumsuz olarak kayıt yapıyor.\n" #: winerror.mc:1426 msgid "Hard disk recalibrate failed.\n" -msgstr "" +msgstr "Sabit diskin yeniden ayarlanması başarısız.\n" #: winerror.mc:1431 msgid "Hard disk operation failed.\n" -msgstr "" +msgstr "Sabit disk işlemi başarısız.\n" #: winerror.mc:1436 msgid "Hard disk reset failed.\n" -msgstr "" +msgstr "Sabit diskin sıfırlanması başarısız.\n" #: winerror.mc:1441 msgid "End of tape media.\n" -msgstr "" +msgstr "Kaset ortamının sonu.\n" #: winerror.mc:1446 msgid "Not enough server memory.\n" -msgstr "" +msgstr "Sunucuda yeterli bellek yok.\n" #: winerror.mc:1451 msgid "Possible deadlock.\n" -msgstr "" +msgstr "Olası kilitlenme (deadlock).\n" #: winerror.mc:1456 msgid "Incorrect alignment.\n" -msgstr "" +msgstr "Yanlış sıralama.\n" #: winerror.mc:1461 msgid "Set-power-state vetoed.\n" -msgstr "" +msgstr "Güç durumunun ayarlanması reddedildi.\n" #: winerror.mc:1466 msgid "Set-power-state failed.\n" -msgstr "" +msgstr "Güç durumunun ayarlanması başarısız.\n" #: winerror.mc:1471 msgid "Too many links.\n" -msgstr "" +msgstr "Çok fazla bağlantı.\n" #: winerror.mc:1476 msgid "Newer windows version needed.\n" -msgstr "" +msgstr "Daha yeni Windows sürümü gerekli.\n" #: winerror.mc:1481 msgid "Wrong operating system.\n" -msgstr "" +msgstr "Yanlış işletim sistemi.\n" #: winerror.mc:1486 msgid "Single-instance application.\n" -msgstr "" +msgstr "Tek durumlu uygulama.\n" #: winerror.mc:1491 msgid "Real-mode application.\n" -msgstr "" +msgstr "Gerçek kipte DOS uygulaması.\n" #: winerror.mc:1496 msgid "Invalid DLL.\n" @@ -4879,7 +4861,7 @@ #: winerror.mc:1506 msgid "DDE failure.\n" -msgstr "" +msgstr "DDE hatası.\n" #: winerror.mc:1511 msgid "DLL not found.\n" @@ -4887,43 +4869,43 @@ #: winerror.mc:1516 msgid "Out of user handles.\n" -msgstr "" +msgstr "Kullanıcı işlemi yok.\n" #: winerror.mc:1521 msgid "Message can only be used in synchronous calls.\n" -msgstr "" +msgstr "Mesaj sadece senkronize çağrılarda kullanılabilir.\n" #: winerror.mc:1526 msgid "The source element is empty.\n" -msgstr "" +msgstr "Kaynak bileşen boş.\n" #: winerror.mc:1531 msgid "The destination element is full.\n" -msgstr "" +msgstr "Konum elementi dolu.\n" #: winerror.mc:1536 msgid "The element address is invalid.\n" -msgstr "" +msgstr "Element adresi geçersiz.\n" #: winerror.mc:1541 msgid "The magazine is not present.\n" -msgstr "" +msgstr "Kartuş deposu hazır değil.\n" #: winerror.mc:1546 msgid "The device needs reinitialization.\n" -msgstr "" +msgstr "Aygıtın yeniden başlatılmaya ihtiyacı var.\n" #: winerror.mc:1551 msgid "The device requires cleaning.\n" -msgstr "" +msgstr "Aygıtın temizlenmeye ihtiyacı var.\n" #: winerror.mc:1556 msgid "The device door is open.\n" -msgstr "" +msgstr "Aygıtın kapağı açık.\n" #: winerror.mc:1561 msgid "The device is not connected.\n" -msgstr "" +msgstr "Aygıt bağlı değil.\n" #: winerror.mc:1566 msgid "Element not found.\n" @@ -4935,47 +4917,47 @@ #: winerror.mc:1576 msgid "Property set not found.\n" -msgstr "" +msgstr "Özellik ayarı bulunamadı.\n" #: winerror.mc:1581 msgid "Point not found.\n" -msgstr "" +msgstr "İşaret bulunamadı.\n" #: winerror.mc:1586 msgid "No running tracking service.\n" -msgstr "" +msgstr "Çalışan bir izleme hizmeti yok.\n" #: winerror.mc:1591 msgid "No such volume ID.\n" -msgstr "" +msgstr "Böyle bir birim etiketi yok.\n" #: winerror.mc:1596 msgid "Unable to remove the file to be replaced.\n" -msgstr "" +msgstr "Yenilenecek dosya kaldırılamıyor.\n" #: winerror.mc:1601 msgid "Unable to move the replacement file into place.\n" -msgstr "" +msgstr "Yenileme dosyası hedef noktaya taşınamıyor.\n" #: winerror.mc:1606 msgid "Moving the replacement file failed.\n" -msgstr "" +msgstr "Yenileme dosyası taşınamıyor.\n" #: winerror.mc:1611 msgid "The journal is being deleted.\n" -msgstr "" +msgstr "Günlük siliniyor.\n" #: winerror.mc:1616 msgid "The journal is not active.\n" -msgstr "" +msgstr "Günlük etkin değil.\n" #: winerror.mc:1621 msgid "Potential matching file found.\n" -msgstr "" +msgstr "Olası eşleşen dosya bulundu.\n" #: winerror.mc:1626 msgid "The journal entry was deleted.\n" -msgstr "" +msgstr "Günlük girişi silinmiş.\n" #: winerror.mc:1631 msgid "Invalid device name.\n" @@ -4983,15 +4965,15 @@ #: winerror.mc:1636 msgid "Connection unavailable.\n" -msgstr "" +msgstr "Bağlantı kullanılamıyor.\n" #: winerror.mc:1641 msgid "Device already remembered.\n" -msgstr "" +msgstr "Aygıt zaten biliniyor.\n" #: winerror.mc:1646 msgid "No network or bad path.\n" -msgstr "" +msgstr "Ağ yok veya yanlış dosya yolu.\n" #: winerror.mc:1651 msgid "Invalid network provider name.\n" @@ -5007,11 +4989,11 @@ #: winerror.mc:1666 msgid "Not a container.\n" -msgstr "" +msgstr "Taşıyıcı veri tipi (container) değil.\n" #: winerror.mc:1671 msgid "Extended error.\n" -msgstr "" +msgstr "Geniş hata.\n" #: winerror.mc:1676 msgid "Invalid group name.\n" @@ -5023,15 +5005,15 @@ #: winerror.mc:1686 msgid "Invalid event name.\n" -msgstr "" +msgstr "Geçersiz olay adı.\n" #: winerror.mc:1691 msgid "Invalid domain name.\n" -msgstr "" +msgstr "Geçersiz alan adı.\n" #: winerror.mc:1696 msgid "Invalid service name.\n" -msgstr "Geçersiz servis adı.\n" +msgstr "Geçersiz hizmet adı.\n" #: winerror.mc:1701 msgid "Invalid network name.\n" @@ -5043,23 +5025,23 @@ #: winerror.mc:1716 msgid "Invalid message name.\n" -msgstr "" +msgstr "Geçersiz mesaj adı.\n" #: winerror.mc:1721 msgid "Invalid message destination.\n" -msgstr "" +msgstr "Geçersiz mesaj konumu.\n" #: winerror.mc:1726 msgid "Session credential conflict.\n" -msgstr "" +msgstr "Oturuma güvenilmiyor.\n" #: winerror.mc:1731 msgid "Remote session limit exceeded.\n" -msgstr "" +msgstr "Uzak oturum sınırı aşıldı.\n" #: winerror.mc:1736 msgid "Duplicate domain or workgroup name.\n" -msgstr "" +msgstr "Yinelenmiş alan adı veya çalışma grubu adı.\n" #: winerror.mc:1741 msgid "No network.\n" @@ -5067,11 +5049,11 @@ #: winerror.mc:1746 msgid "Operation canceled by user.\n" -msgstr "" +msgstr "İşlem kullanıcı tarafından iptal edildi.\n" #: winerror.mc:1751 msgid "File has a user-mapped section.\n" -msgstr "" +msgstr "Dosyada kullanıcı tarafından kullanılan (user-mapped) bir bölüm var.\n" #: winerror.mc:1756 winerror.mc:3751 msgid "Connection refused.\n" @@ -5083,11 +5065,11 @@ #: winerror.mc:1766 msgid "Address already associated with transport endpoint.\n" -msgstr "" +msgstr "Adres zaten taşımanın bitiş noktasıyla bağlı.\n" #: winerror.mc:1771 msgid "Address not associated with transport endpoint.\n" -msgstr "" +msgstr "Adres taşımanın bitiş noktasıyla bağlı değil.\n" #: winerror.mc:1776 msgid "Connection invalid.\n" @@ -5099,19 +5081,19 @@ #: winerror.mc:1786 msgid "Network unreachable.\n" -msgstr "Ağ ulaşılamaz.\n" +msgstr "Ağa ulaşılamıyor.\n" #: winerror.mc:1791 msgid "Host unreachable.\n" -msgstr "Uzak sunucu ulaşılamaz.\n" +msgstr "Uzak sunucuya ulaşılamıyor.\n" #: winerror.mc:1796 msgid "Protocol unreachable.\n" -msgstr "Protokol ulaşılamaz.\n" +msgstr "Protokole ulaşılamıyor.\n" #: winerror.mc:1801 msgid "Port unreachable.\n" -msgstr "Bağlantı noktası ulaşılamaz.\n" +msgstr "Bağlantı noktasına ulaşılamıyor.\n" #: winerror.mc:1806 msgid "Request aborted.\n" @@ -5139,7 +5121,7 @@ #: winerror.mc:1836 msgid "Incorrect network address.\n" -msgstr "Geçersiz ağ adresi.\n" +msgstr "Yanlış ağ adresi.\n" #: winerror.mc:1841 msgid "Service already registered.\n" @@ -5147,11 +5129,11 @@ #: winerror.mc:1846 msgid "Service not found.\n" -msgstr "Servis bulunamadı.\n" +msgstr "Hizmet bulunamadı.\n" #: winerror.mc:1851 msgid "User not authenticated.\n" -msgstr "Kullanıcı yetkilendirmesi başarısız.\n" +msgstr "Kullanıcı yetkilendirilmemiş.\n" #: winerror.mc:1856 msgid "User not logged on.\n" @@ -5163,7 +5145,7 @@ #: winerror.mc:1866 msgid "Already initialized.\n" -msgstr "" +msgstr "Zaten başlatılmış.\n" #: winerror.mc:1871 msgid "No more local devices.\n" @@ -5175,7 +5157,7 @@ #: winerror.mc:1881 msgid "The domain controller already exists.\n" -msgstr "Bu alan adı denetleyicisi mevcut.\n" +msgstr "Bu alan adı denetleyicisi zaten mevcut.\n" #: winerror.mc:1886 msgid "Supported only when connected.\n" @@ -5219,7 +5201,7 @@ #: winerror.mc:1936 msgid "Incompatible revision levels.\n" -msgstr "Uyumsuz gözden geçirme seviyeleri.\n" +msgstr "Uyumsuz revizyon seviyeleri.\n" #: winerror.mc:1941 msgid "Invalid owner.\n" @@ -5231,7 +5213,7 @@ #: winerror.mc:1951 msgid "No impersonation token.\n" -msgstr "Kişiselleştirme belirtisi yok.\n" +msgstr "Taklit işareti (token) yok.\n" #: winerror.mc:1956 msgid "Can't disable mandatory group.\n" @@ -5255,7 +5237,7 @@ #: winerror.mc:1981 msgid "Invalid account name.\n" -msgstr "Geçersiz hesap adı.\n" +msgstr "Yanlış hesap adı.\n" #: winerror.mc:1986 msgid "User already exists.\n" @@ -5263,7 +5245,7 @@ #: winerror.mc:1991 msgid "No such user.\n" -msgstr "Kullanıcı yok.\n" +msgstr "Böyle bir kullanıcı yok.\n" #: winerror.mc:1996 msgid "Group already exists.\n" @@ -5271,7 +5253,7 @@ #: winerror.mc:2001 msgid "No such group.\n" -msgstr "Grup bulunamadı.\n" +msgstr "Böyle bir grup bulunamadı.\n" #: winerror.mc:2006 msgid "User already in group.\n" @@ -5315,7 +5297,7 @@ #: winerror.mc:2056 msgid "Password expired.\n" -msgstr "Parola süresi dolmuş.\n" +msgstr "Parolanın geçerlilik süresi dolmuş.\n" #: winerror.mc:2061 msgid "Account disabled.\n" @@ -5323,91 +5305,91 @@ #: winerror.mc:2066 msgid "No security ID mapped.\n" -msgstr "" +msgstr "Kullanılan kimlik yok.\n" #: winerror.mc:2071 msgid "Too many LUIDs requested.\n" -msgstr "" +msgstr "Çok fazla LUID isteniyor.\n" #: winerror.mc:2076 msgid "LUIDs exhausted.\n" -msgstr "" +msgstr "LUID'ler bitti.\n" #: winerror.mc:2081 msgid "Invalid sub authority.\n" -msgstr "" +msgstr "Geçersiz alt yetki.\n" #: winerror.mc:2086 msgid "Invalid ACL.\n" -msgstr "" +msgstr "Geçersiz ACL.\n" #: winerror.mc:2091 msgid "Invalid SID.\n" -msgstr "" +msgstr "Geçersiz SID.\n" #: winerror.mc:2096 msgid "Invalid security descriptor.\n" -msgstr "" +msgstr "Geçersiz güvenlik tanımlayıcısı.\n" #: winerror.mc:2101 msgid "Bad inherited ACL.\n" -msgstr "" +msgstr "Alınan ACL bozuk.\n" #: winerror.mc:2106 msgid "Server disabled.\n" -msgstr "" +msgstr "Sunucu devre dışı.\n" #: winerror.mc:2111 msgid "Server not disabled.\n" -msgstr "" +msgstr "Sunucu devre dışı değil.\n" #: winerror.mc:2116 msgid "Invalid ID authority.\n" -msgstr "" +msgstr "Geçersiz kimlik yetkisi.\n" #: winerror.mc:2121 msgid "Allotted space exceeded.\n" -msgstr "" +msgstr "Paylaştırılmış alan aşıldı.\n" #: winerror.mc:2126 msgid "Invalid group attributes.\n" -msgstr "" +msgstr "Geçersiz grup özellikleri.\n" #: winerror.mc:2131 msgid "Bad impersonation level.\n" -msgstr "" +msgstr "Geçersiz taklit seviyesi.\n" #: winerror.mc:2136 msgid "Can't open anonymous security token.\n" -msgstr "" +msgstr "Anonim güvenlik işareti açılamıyor.\n" #: winerror.mc:2141 msgid "Bad validation class.\n" -msgstr "" +msgstr "Yanlış doğrulama sınıfı.\n" #: winerror.mc:2146 msgid "Bad token type.\n" -msgstr "" +msgstr "Yanlış işaret (token) türü.\n" #: winerror.mc:2151 msgid "No security on object.\n" -msgstr "" +msgstr "Nesnede güvenlik yok.\n" #: winerror.mc:2156 msgid "Can't access domain information.\n" -msgstr "" +msgstr "Alan adı bilgisine erişilemiyor.\n" #: winerror.mc:2161 msgid "Invalid server state.\n" -msgstr "" +msgstr "Geçersiz sunucu durumu.\n" #: winerror.mc:2166 msgid "Invalid domain state.\n" -msgstr "" +msgstr "Geçersiz alan adı durumu.\n" #: winerror.mc:2171 msgid "Invalid domain role.\n" -msgstr "" +msgstr "Geçersiz alan adı görevi (role).\n" #: winerror.mc:2176 msgid "No such domain.\n" @@ -5423,139 +5405,139 @@ #: winerror.mc:2191 msgid "Internal database corruption.\n" -msgstr "" +msgstr "İç veri tabanında bozukluk.\n" #: winerror.mc:2196 msgid "Internal error.\n" -msgstr "" +msgstr "İç hata.\n" #: winerror.mc:2201 msgid "Generic access types not mapped.\n" -msgstr "" +msgstr "Temel erişim türleri ilişkilendirilmemiş.\n" #: winerror.mc:2206 msgid "Bad descriptor format.\n" -msgstr "" +msgstr "Yanlış tanımlayıcı biçim.\n" #: winerror.mc:2211 msgid "Not a logon process.\n" -msgstr "" +msgstr "Oturum açma işlemi değil.\n" #: winerror.mc:2216 msgid "Logon session ID exists.\n" -msgstr "" +msgstr "Oturum açma kimliği bulunuyor.\n" #: winerror.mc:2221 msgid "Unknown authentication package.\n" -msgstr "" +msgstr "Bilinmeyen yetkilendirme paketi.\n" #: winerror.mc:2226 msgid "Bad logon session state.\n" -msgstr "" +msgstr "Yanlış oturum açma durumu.\n" #: winerror.mc:2231 msgid "Logon session ID collision.\n" -msgstr "" +msgstr "Oturum açma kimlik çakışması.\n" #: winerror.mc:2236 msgid "Invalid logon type.\n" -msgstr "" +msgstr "Geçersiz oturum açma türü.\n" #: winerror.mc:2241 msgid "Cannot impersonate.\n" -msgstr "" +msgstr "Taklit edilemiyor.\n" #: winerror.mc:2246 msgid "Invalid transaction state.\n" -msgstr "" +msgstr "Geçersiz iş durumu.\n" #: winerror.mc:2251 msgid "Security DB commit failure.\n" -msgstr "" +msgstr "Güvenlik veritabanı (DB) işleme hatası.\n" #: winerror.mc:2256 msgid "Account is built-in.\n" -msgstr "" +msgstr "Yerleşik hesap.\n" #: winerror.mc:2261 msgid "Group is built-in.\n" -msgstr "" +msgstr "Yerleşik grup.\n" #: winerror.mc:2266 msgid "User is built-in.\n" -msgstr "" +msgstr "Yerleşik kullanıcı.\n" #: winerror.mc:2271 msgid "Group is primary for user.\n" -msgstr "" +msgstr "Grup, kullanıcı için birincil.\n" #: winerror.mc:2276 msgid "Token already in use.\n" -msgstr "" +msgstr "İşaret (token) zaten kullanılıyor.\n" #: winerror.mc:2281 msgid "No such local group.\n" -msgstr "" +msgstr "Böyle bir yerel grup yok.\n" #: winerror.mc:2286 msgid "User not in local group.\n" -msgstr "" +msgstr "Kullanıcı yerel grupta değil.\n" #: winerror.mc:2291 msgid "User already in local group.\n" -msgstr "" +msgstr "Kullanıcı zaten yerel grupta.\n" #: winerror.mc:2296 msgid "Local group already exists.\n" -msgstr "" +msgstr "Yerel grup zaten bulunuyor.\n" #: winerror.mc:2301 winerror.mc:2326 msgid "Logon type not granted.\n" -msgstr "" +msgstr "Giriş türüne izin verilmedi.\n" #: winerror.mc:2306 msgid "Too many secrets.\n" -msgstr "" +msgstr "Çok fazla sır.\n" #: winerror.mc:2311 msgid "Secret too long.\n" -msgstr "" +msgstr "Sır çok uzun.\n" #: winerror.mc:2316 msgid "Internal security DB error.\n" -msgstr "" +msgstr "İç güvenlik veritabanı (DB) hatası.\n" #: winerror.mc:2321 msgid "Too many context IDs.\n" -msgstr "" +msgstr "Çok fazla kaynak kimlik.\n" #: winerror.mc:2331 msgid "Cross-encrypted NT password required.\n" -msgstr "" +msgstr "Çapraz şifrelenmiş NT parolası gerekli.\n" #: winerror.mc:2336 msgid "No such member.\n" -msgstr "" +msgstr "Böyle bir üye yok.\n" #: winerror.mc:2341 msgid "Invalid member.\n" -msgstr "" +msgstr "Geçersiz üye.\n" #: winerror.mc:2346 msgid "Too many SIDs.\n" -msgstr "" +msgstr "Çok fazla SID.\n" #: winerror.mc:2351 msgid "Cross-encrypted LM password required.\n" -msgstr "" +msgstr "Çapraz şifrelenmiş LM parolası gerekli.\n" #: winerror.mc:2356 msgid "No inheritable components.\n" -msgstr "" +msgstr "Alınabilecek bileşen yok.\n" #: winerror.mc:2361 msgid "File or directory corrupt.\n" -msgstr "" +msgstr "Dosya veya dizin bozuk.\n" #: winerror.mc:2366 msgid "Disk is corrupt.\n" @@ -5575,87 +5557,87 @@ #: winerror.mc:2386 msgid "Mutual authentication failed.\n" -msgstr "" +msgstr "Mutual yetkilendirme başarısız.\n" #: winerror.mc:2391 msgid "Time skew between client and server.\n" -msgstr "" +msgstr "Sunucu ve istemci arasında zamanlama hatası.\n" #: winerror.mc:2396 msgid "Invalid window handle.\n" -msgstr "" +msgstr "Yanlış pencere işlemesi.\n" #: winerror.mc:2401 msgid "Invalid menu handle.\n" -msgstr "" +msgstr "Yanlış menü işlemesi.\n" #: winerror.mc:2406 msgid "Invalid cursor handle.\n" -msgstr "" +msgstr "Yanlış imleç işlemesi.\n" #: winerror.mc:2411 msgid "Invalid accelerator table handle.\n" -msgstr "" +msgstr "Yanlış hızlandırıcı tablo işlemesi.\n" #: winerror.mc:2416 msgid "Invalid hook handle.\n" -msgstr "" +msgstr "Yanlış hook işlemesi.\n" #: winerror.mc:2421 msgid "Invalid DWP handle.\n" -msgstr "" +msgstr "Yanlış DWP işlemesi.\n" #: winerror.mc:2426 msgid "Can't create top-level child window.\n" -msgstr "" +msgstr "Üst seviye küçük pencere oluşturulamıyor.\n" #: winerror.mc:2431 msgid "Can't find window class.\n" -msgstr "" +msgstr "Pencere sınıfı bulunamıyor.\n" #: winerror.mc:2436 msgid "Window owned by another thread.\n" -msgstr "" +msgstr "Pencereye başka bir iş parçacığı sahip.\n" #: winerror.mc:2441 msgid "Hotkey already registered.\n" -msgstr "" +msgstr "Kısayol zaten kayıtlı.\n" #: winerror.mc:2446 msgid "Class already exists.\n" -msgstr "" +msgstr "Sınıf zaten bulunuyor.\n" #: winerror.mc:2451 msgid "Class does not exist.\n" -msgstr "" +msgstr "Sınıf bulunmuyor.\n" #: winerror.mc:2456 msgid "Class has open windows.\n" -msgstr "" +msgstr "Sınıfın açık pencereleri var.\n" #: winerror.mc:2461 msgid "Invalid index.\n" -msgstr "" +msgstr "Geçersiz dizin.\n" #: winerror.mc:2466 msgid "Invalid icon handle.\n" -msgstr "" +msgstr "Geçersiz simge işlemesi.\n" #: winerror.mc:2471 msgid "Private dialog index.\n" -msgstr "" +msgstr "Özel iletişim dizini.\n" #: winerror.mc:2476 msgid "List box ID not found.\n" -msgstr "" +msgstr "Liste kutusu kimliği bulunamadı.\n" #: winerror.mc:2481 msgid "No wildcard characters.\n" -msgstr "" +msgstr "Joker karakter yok.\n" #: winerror.mc:2486 msgid "Clipboard not open.\n" -msgstr "" +msgstr "Pano açık değil.\n" #: winerror.mc:2491 msgid "Hotkey not registered.\n" @@ -5671,59 +5653,59 @@ #: winerror.mc:2506 msgid "Invalid combo box message.\n" -msgstr "" +msgstr "Geçersiz birleşik giriş kutusu (combo box) mesajı.\n" #: winerror.mc:2511 msgid "Not a combo box window.\n" -msgstr "" +msgstr "Birleşik giriş kutusu (combo box) penceresi değil.\n" #: winerror.mc:2516 msgid "Invalid edit height.\n" -msgstr "" +msgstr "Uzunluk ayarı geçersiz.\n" #: winerror.mc:2521 msgid "DC not found.\n" -msgstr "" +msgstr "DC bulunamadı.\n" #: winerror.mc:2526 msgid "Invalid hook filter.\n" -msgstr "" +msgstr "Geçersiz hook filtresi.\n" #: winerror.mc:2531 msgid "Invalid filter procedure.\n" -msgstr "" +msgstr "Geçersiz filtreleme yordamı.\n" #: winerror.mc:2536 msgid "Hook procedure needs module handle.\n" -msgstr "" +msgstr "Hook yordamının modül işlemesine ihtiyacı var.\n" #: winerror.mc:2541 msgid "Global-only hook procedure.\n" -msgstr "" +msgstr "Sadece genel hook yordamı.\n" #: winerror.mc:2546 msgid "Journal hook already set.\n" -msgstr "" +msgstr "Jurnal hook zaten ayarlanmış.\n" #: winerror.mc:2551 msgid "Hook procedure not installed.\n" -msgstr "" +msgstr "Hook yordamı yüklenmemiş.\n" #: winerror.mc:2556 msgid "Invalid list box message.\n" -msgstr "" +msgstr "Geçersiz liste kutusu mesajı.\n" #: winerror.mc:2561 msgid "Invalid LB_SETCOUNT sent.\n" -msgstr "" +msgstr "Geçersiz LB_SETCOUNT gönderildi.\n" #: winerror.mc:2566 msgid "No tab stops on this list box.\n" -msgstr "" +msgstr "Bu liste kutusunda sekme durağı (tab stop) yok.\n" #: winerror.mc:2571 msgid "Can't destroy object owned by another thread.\n" -msgstr "" +msgstr "Başka bir iş parçacığının sahip olduğu nesne silinemiyor.\n" #: winerror.mc:2576 msgid "Child window menus not allowed.\n" @@ -5731,43 +5713,43 @@ #: winerror.mc:2581 msgid "Window has no system menu.\n" -msgstr "" +msgstr "Pencerenin sistem menüsü yok.\n" #: winerror.mc:2586 msgid "Invalid message box style.\n" -msgstr "" +msgstr "Geçersiz mesaj kutusu stili.\n" #: winerror.mc:2591 msgid "Invalid SPI parameter.\n" -msgstr "" +msgstr "Geçersiz SPI parametresi.\n" #: winerror.mc:2596 msgid "Screen already locked.\n" -msgstr "" +msgstr "Ekran zaten kilitli.\n" #: winerror.mc:2601 msgid "Window handles have different parents.\n" -msgstr "" +msgstr "Pencere işlemeleri (handle) farklı üst işlemelere sahip.\n" #: winerror.mc:2606 msgid "Not a child window.\n" -msgstr "" +msgstr "Alt pencere değil.\n" #: winerror.mc:2611 msgid "Invalid GW command.\n" -msgstr "" +msgstr "Geçersiz GW komutu.\n" #: winerror.mc:2616 msgid "Invalid thread ID.\n" -msgstr "" +msgstr "Geçersiz iş parçacığı kimliği.\n" #: winerror.mc:2621 msgid "Not an MDI child window.\n" -msgstr "" +msgstr "MDI alt penceresi değil.\n" #: winerror.mc:2626 msgid "Popup menu already active.\n" -msgstr "" +msgstr "Açılır menü zaten etkin.\n" #: winerror.mc:2631 msgid "No scrollbars.\n" @@ -5779,7 +5761,7 @@ #: winerror.mc:2641 msgid "Invalid ShowWin command.\n" -msgstr "" +msgstr "Geçersiz ShowWin komutu.\n" #: winerror.mc:2646 msgid "No system resources.\n" @@ -5787,79 +5769,79 @@ #: winerror.mc:2651 msgid "No non-paged system resources.\n" -msgstr "" +msgstr "Sayfalanmamış (non-paged) sistem kaynağı yok.\n" #: winerror.mc:2656 msgid "No paged system resources.\n" -msgstr "" +msgstr "Sayfalanmış (paged) sistem kaynağı yok.\n" #: winerror.mc:2661 msgid "No working set quota.\n" -msgstr "" +msgstr "Çalışan ayarlı bir kota yok.\n" #: winerror.mc:2666 msgid "No page file quota.\n" -msgstr "" +msgstr "Disk belleği (page file) kotası yok.\n" #: winerror.mc:2671 msgid "Exceeded commitment limit.\n" -msgstr "" +msgstr "Ayrılma sınırı aşıldı.\n" #: winerror.mc:2676 msgid "Menu item not found.\n" -msgstr "" +msgstr "Menü ögesi bulunamadı.\n" #: winerror.mc:2681 msgid "Invalid keyboard handle.\n" -msgstr "" +msgstr "Geçersiz klavye işlemesi.\n" #: winerror.mc:2686 msgid "Hook type not allowed.\n" -msgstr "" +msgstr "Hook türüne izin verilmiyor.\n" #: winerror.mc:2691 msgid "Interactive window station required.\n" -msgstr "" +msgstr "İnteraktif pencere istasyonu gerekli.\n" #: winerror.mc:2696 msgid "Timeout.\n" -msgstr "Zaman Aşımı.\n" +msgstr "Zamanaşımı.\n" #: winerror.mc:2701 msgid "Invalid monitor handle.\n" -msgstr "" +msgstr "Geçersiz monitör işlemesi.\n" #: winerror.mc:2706 msgid "Event log file corrupt.\n" -msgstr "" +msgstr "Olay günlük dosyası bozuk.\n" #: winerror.mc:2711 msgid "Event log can't start.\n" -msgstr "" +msgstr "Olay günlüğü başlatılamıyor.\n" #: winerror.mc:2716 msgid "Event log file full.\n" -msgstr "" +msgstr "Olay günlük dosyası dolu.\n" #: winerror.mc:2721 msgid "Event log file changed.\n" -msgstr "" +msgstr "Olay günlük dosyası değiştirilmiş.\n" #: winerror.mc:2726 msgid "Installer service failed.\n" -msgstr "" +msgstr "Kurulum hizmeti başarısız.\n" #: winerror.mc:2731 msgid "Installation aborted by user.\n" -msgstr "" +msgstr "Kurulum, kullanıcı tarafından iptal edildi.\n" #: winerror.mc:2736 msgid "Installation failure.\n" -msgstr "" +msgstr "Kurulum hatası.\n" #: winerror.mc:2741 msgid "Installation suspended.\n" -msgstr "" +msgstr "Kurulum duraklatıldı.\n" #: winerror.mc:2746 msgid "Unknown product.\n" @@ -5879,23 +5861,23 @@ #: winerror.mc:2766 msgid "Invalid handle state.\n" -msgstr "" +msgstr "Geçersiz işleme durumu.\n" #: winerror.mc:2771 msgid "Bad configuration.\n" -msgstr "Kötü yapılandırma.\n" +msgstr "Hatalı yapılandırma.\n" #: winerror.mc:2776 msgid "Index is missing.\n" -msgstr "" +msgstr "İndeks yok.\n" #: winerror.mc:2781 msgid "Installation source is missing.\n" -msgstr "" +msgstr "Kurulum kaynağı yok.\n" #: winerror.mc:2786 msgid "Wrong installation package version.\n" -msgstr "Hatalı kurulum paket sürümü.\n" +msgstr "Kurulum paketi sürümü hatalı.\n" #: winerror.mc:2791 msgid "Product uninstalled.\n" @@ -5903,11 +5885,11 @@ #: winerror.mc:2796 msgid "Invalid query syntax.\n" -msgstr "" +msgstr "Geçersiz sorgu sözdizimi.\n" #: winerror.mc:2801 msgid "Invalid field.\n" -msgstr "" +msgstr "Geçersiz alan.\n" #: winerror.mc:2806 msgid "Device removed.\n" @@ -5927,115 +5909,115 @@ #: winerror.mc:2826 msgid "Installer user interface failed.\n" -msgstr "" +msgstr "Kurulumun kullanıcı arayüzü başarısız.\n" #: winerror.mc:2831 msgid "Failed to open installation log file.\n" -msgstr "" +msgstr "Kurulum günlük dosyasını açma başarısız.\n" #: winerror.mc:2836 msgid "Installation language not supported.\n" -msgstr "" +msgstr "Kurulum dili desteklenmiyor.\n" #: winerror.mc:2841 msgid "Installation transform failed to apply.\n" -msgstr "" +msgstr "Kurulum dönüştürmesi başarısız.\n" #: winerror.mc:2846 msgid "Installation package rejected.\n" -msgstr "" +msgstr "Kurulum paketi reddedildi.\n" #: winerror.mc:2851 msgid "Function could not be called.\n" -msgstr "" +msgstr "Fonksiyon çağrılamadı.\n" #: winerror.mc:2856 msgid "Function failed.\n" -msgstr "" +msgstr "Fonksiyon başarısız.\n" #: winerror.mc:2861 msgid "Invalid table.\n" -msgstr "" +msgstr "Geçersiz tablo.\n" #: winerror.mc:2866 msgid "Data type mismatch.\n" -msgstr "" +msgstr "Veri türü eşleşmiyor.\n" #: winerror.mc:2871 winerror.mc:3081 msgid "Unsupported type.\n" -msgstr "" +msgstr "Desteklenmeyen tür.\n" #: winerror.mc:2876 msgid "Creation failed.\n" -msgstr "" +msgstr "Oluşturulamıyor.\n" #: winerror.mc:2881 msgid "Temporary directory not writable.\n" -msgstr "" +msgstr "Geçici klasöre yazılamıyor.\n" #: winerror.mc:2886 msgid "Installation platform not supported.\n" -msgstr "" +msgstr "Kurulum platformu desteklenmiyor.\n" #: winerror.mc:2891 msgid "Installer not used.\n" -msgstr "" +msgstr "Kurulum programı kullanılmamış.\n" #: winerror.mc:2896 msgid "Failed to open the patch package.\n" -msgstr "" +msgstr "Yama paketini açma başarısız.\n" #: winerror.mc:2901 msgid "Invalid patch package.\n" -msgstr "" +msgstr "Geçersiz yama paketi.\n" #: winerror.mc:2906 msgid "Unsupported patch package.\n" -msgstr "" +msgstr "Desteklenmeyen yama paketi.\n" #: winerror.mc:2911 msgid "Another version is installed.\n" -msgstr "" +msgstr "Başka bir sürüm yüklenmiş.\n" #: winerror.mc:2916 msgid "Invalid command line.\n" -msgstr "" +msgstr "Geçersiz komut satırı.\n" #: winerror.mc:2921 msgid "Remote installation not allowed.\n" -msgstr "" +msgstr "Uzaktan kuruluma izin verilmiyor.\n" #: winerror.mc:2926 msgid "Reboot initiated after successful install.\n" -msgstr "" +msgstr "Başarılı bir kurulumdan sonra yeniden başlatıldı.\n" #: winerror.mc:2931 msgid "Invalid string binding.\n" -msgstr "" +msgstr "Geçersiz dize değeri ilişkilendirmesi.\n" #: winerror.mc:2936 msgid "Wrong kind of binding.\n" -msgstr "" +msgstr "Yanlış ilişkilendirme türü.\n" #: winerror.mc:2941 msgid "Invalid binding.\n" -msgstr "" +msgstr "Geçersiz ilişkilendirme.\n" #: winerror.mc:2946 msgid "RPC protocol sequence not supported.\n" -msgstr "" +msgstr "RPC protokol sıralaması desteklenmiyor.\n" #: winerror.mc:2951 msgid "Invalid RPC protocol sequence.\n" -msgstr "" +msgstr "Geçersiz RPC protokol sıralaması.\n" #: winerror.mc:2956 msgid "Invalid string UUID.\n" -msgstr "" +msgstr "Geçersiz dize değeri UUID'i.\n" #: winerror.mc:2961 msgid "Invalid endpoint format.\n" -msgstr "" +msgstr "Geçersiz bitiş noktası biçimi.\n" #: winerror.mc:2966 msgid "Invalid network address.\n" @@ -6043,7 +6025,7 @@ #: winerror.mc:2971 msgid "No endpoint found.\n" -msgstr "" +msgstr "Bitiş noktası bulunamadı.\n" #: winerror.mc:2976 msgid "Invalid timeout value.\n" @@ -6051,27 +6033,27 @@ #: winerror.mc:2981 msgid "Object UUID not found.\n" -msgstr "" +msgstr "Nesne UUID'i bulunamadı.\n" #: winerror.mc:2986 msgid "UUID already registered.\n" -msgstr "" +msgstr "UUID zaten kayıtlı.\n" #: winerror.mc:2991 msgid "UUID type already registered.\n" -msgstr "" +msgstr "UUID türü zaten kayıtlı.\n" #: winerror.mc:2996 msgid "Server already listening.\n" -msgstr "" +msgstr "Sunucu zaten dinliyor.\n" #: winerror.mc:3001 msgid "No protocol sequences registered.\n" -msgstr "" +msgstr "Herhangi bir protokol sıralaması kaydedilmemiş.\n" #: winerror.mc:3006 msgid "RPC server not listening.\n" -msgstr "" +msgstr "RPC sunucusu dinlemiyor.\n" #: winerror.mc:3011 msgid "Unknown manager type.\n" @@ -6083,51 +6065,51 @@ #: winerror.mc:3021 msgid "No bindings.\n" -msgstr "" +msgstr "İlişkilendirme yok.\n" #: winerror.mc:3026 msgid "No protocol sequences.\n" -msgstr "" +msgstr "Protokol sıralaması yok.\n" #: winerror.mc:3031 msgid "Can't create endpoint.\n" -msgstr "" +msgstr "Bitiş noktası oluşturulamıyor.\n" #: winerror.mc:3036 msgid "Out of resources.\n" -msgstr "" +msgstr "Kaynak yok.\n" #: winerror.mc:3041 msgid "RPC server unavailable.\n" -msgstr "" +msgstr "RPC sunucusu kullanılamıyor.\n" #: winerror.mc:3046 msgid "RPC server too busy.\n" -msgstr "" +msgstr "RPC sunucusu meşgul.\n" #: winerror.mc:3051 msgid "Invalid network options.\n" -msgstr "" +msgstr "Geçersiz ağ ayarları.\n" #: winerror.mc:3056 msgid "No RPC call active.\n" -msgstr "" +msgstr "Etkin bir RPC çağrısı yok.\n" #: winerror.mc:3061 msgid "RPC call failed.\n" -msgstr "" +msgstr "RPC çağrısı başarısız.\n" #: winerror.mc:3066 msgid "RPC call failed and didn't execute.\n" -msgstr "" +msgstr "RPC çağrısı başarısız ve çalıştırılmadı.\n" #: winerror.mc:3071 msgid "RPC protocol error.\n" -msgstr "" +msgstr "RPC protokol hatası.\n" #: winerror.mc:3076 msgid "Unsupported transfer syntax.\n" -msgstr "" +msgstr "Desteklenmeyen transfer sözdizimi.\n" #: winerror.mc:3086 msgid "Invalid tag.\n" @@ -6135,19 +6117,19 @@ #: winerror.mc:3091 msgid "Invalid array bounds.\n" -msgstr "" +msgstr "Geçersiz dizi sınırı.\n" #: winerror.mc:3096 msgid "No entry name.\n" -msgstr "İsim girilmedi.\n" +msgstr "Giriş adı yok.\n" #: winerror.mc:3101 msgid "Invalid name syntax.\n" -msgstr "" +msgstr "Geçersiz ad söz dizimi.\n" #: winerror.mc:3106 msgid "Unsupported name syntax.\n" -msgstr "" +msgstr "Desteklenmeyen ad söz dizimi.\n" #: winerror.mc:3111 msgid "No network address.\n" @@ -6155,67 +6137,67 @@ #: winerror.mc:3116 msgid "Duplicate endpoint.\n" -msgstr "" +msgstr "Yinelenmiş bitiş noktası.\n" #: winerror.mc:3121 msgid "Unknown authentication type.\n" -msgstr "" +msgstr "Bilinmeyen yetkilendirme türü.\n" #: winerror.mc:3126 msgid "Maximum calls too low.\n" -msgstr "" +msgstr "Maksimum çağrı sayısı çok az.\n" #: winerror.mc:3131 msgid "String too long.\n" -msgstr "" +msgstr "Dize değeri çok uzun.\n" #: winerror.mc:3136 msgid "Protocol sequence not found.\n" -msgstr "" +msgstr "Protokol sıralaması bulunamadı.\n" #: winerror.mc:3141 msgid "Procedure number out of range.\n" -msgstr "" +msgstr "Prosedür numarası aralık dışında.\n" #: winerror.mc:3146 msgid "Binding has no authentication data.\n" -msgstr "" +msgstr "İlişkilendirmenin yetkilendirme verisi yok.\n" #: winerror.mc:3151 msgid "Unknown authentication service.\n" -msgstr "" +msgstr "Bilinmeyen yetkilendirme hizmeti.\n" #: winerror.mc:3156 msgid "Unknown authentication level.\n" -msgstr "" +msgstr "Bilinmeyen yetkilendirme seviyesi.\n" #: winerror.mc:3161 msgid "Invalid authentication identity.\n" -msgstr "" +msgstr "Geçersiz yetkilendirme kimliği.\n" #: winerror.mc:3166 msgid "Unknown authorization service.\n" -msgstr "" +msgstr "Bilinmeyen yetkilendirme hizmeti.\n" #: winerror.mc:3171 msgid "Invalid entry.\n" -msgstr "Geçersiz girdi.\n" +msgstr "Geçersiz giriş.\n" #: winerror.mc:3176 msgid "Can't perform operation.\n" -msgstr "" +msgstr "İşlem yapılamıyor.\n" #: winerror.mc:3181 msgid "Endpoints not registered.\n" -msgstr "" +msgstr "Bitiş noktaları kaydedilmemiş.\n" #: winerror.mc:3186 msgid "Nothing to export.\n" -msgstr "" +msgstr "Dışa verilecek bir şey yok.\n" #: winerror.mc:3191 msgid "Incomplete name.\n" -msgstr "" +msgstr "Eksik ad.\n" #: winerror.mc:3196 msgid "Invalid version option.\n" @@ -6223,11 +6205,11 @@ #: winerror.mc:3201 msgid "No more members.\n" -msgstr "" +msgstr "Daha başka bir üye yak.\n" #: winerror.mc:3206 msgid "Not all objects unexported.\n" -msgstr "" +msgstr "Bütün nesneler dışarı verilmedi.\n" #: winerror.mc:3211 msgid "Interface not found.\n" @@ -6235,15 +6217,15 @@ #: winerror.mc:3216 msgid "Entry already exists.\n" -msgstr "" +msgstr "Giriş zaten var.\n" #: winerror.mc:3221 msgid "Entry not found.\n" -msgstr "Girdi bulunamadı.\n" +msgstr "Giriş bulunamadı.\n" #: winerror.mc:3226 msgid "Name service unavailable.\n" -msgstr "" +msgstr "Ad hizmeti kullanılamıyor.\n" #: winerror.mc:3231 msgid "Invalid network address family.\n" @@ -6251,19 +6233,19 @@ #: winerror.mc:3236 msgid "Operation not supported.\n" -msgstr "" +msgstr "İşlem desteklenmiyor.\n" #: winerror.mc:3241 msgid "No security context available.\n" -msgstr "" +msgstr "Kullanılabilir güvenlik kaynağı yok.\n" #: winerror.mc:3246 msgid "RPCInternal error.\n" -msgstr "" +msgstr "RPC iç hatası.\n" #: winerror.mc:3251 msgid "RPC divide-by-zero.\n" -msgstr "" +msgstr "RPC'de sıfıra bölme.\n" #: winerror.mc:3256 msgid "Address error.\n" @@ -6271,111 +6253,111 @@ #: winerror.mc:3261 msgid "Floating-point divide-by-zero.\n" -msgstr "" +msgstr "Kayan noktada sıfıra bölme.\n" #: winerror.mc:3266 msgid "Floating-point underflow.\n" -msgstr "" +msgstr "Kayan noktada çok az veri (underflow).\n" #: winerror.mc:3271 msgid "Floating-point overflow.\n" -msgstr "" +msgstr "Kayan noktada taşma.\n" #: winerror.mc:3276 msgid "No more entries.\n" -msgstr "" +msgstr "Başka bir giriş yok.\n" #: winerror.mc:3281 msgid "Character translation table open failed.\n" -msgstr "" +msgstr "Karakter çevrim tablosu açılamıyor.\n" #: winerror.mc:3286 msgid "Character translation table file too small.\n" -msgstr "" +msgstr "Karakter çevrim tablo dosyası çok küçük.\n" #: winerror.mc:3291 msgid "Null context handle.\n" -msgstr "" +msgstr "Sıfır kaynak işlemesi.\n" #: winerror.mc:3296 msgid "Context handle damaged.\n" -msgstr "" +msgstr "Kaynak işlemesi bozuk.\n" #: winerror.mc:3301 msgid "Binding handle mismatch.\n" -msgstr "" +msgstr "İlişkilendirme işlemesi eşleşmiyor.\n" #: winerror.mc:3306 msgid "Cannot get call handle.\n" -msgstr "" +msgstr "Çağrı işlemesi alınamıyor.\n" #: winerror.mc:3311 msgid "Null reference pointer.\n" -msgstr "" +msgstr "Referans işaretçisi yok.\n" #: winerror.mc:3316 msgid "Enumeration value out of range.\n" -msgstr "" +msgstr "Sıralama değeri aralık dışında.\n" #: winerror.mc:3321 msgid "Byte count too small.\n" -msgstr "" +msgstr "Bit sayısı çok küçük.\n" #: winerror.mc:3326 msgid "Bad stub data.\n" -msgstr "" +msgstr "Bozuk taslak (stub) verisi.\n" #: winerror.mc:3331 msgid "Invalid user buffer.\n" -msgstr "" +msgstr "Geçersiz kullanıcı tamponu.\n" #: winerror.mc:3336 msgid "Unrecognized media.\n" -msgstr "" +msgstr "Tanınmayan ortam.\n" #: winerror.mc:3341 msgid "No trust secret.\n" -msgstr "" +msgstr "Güvenilir sır yok.\n" #: winerror.mc:3346 msgid "No trust SAM account.\n" -msgstr "" +msgstr "Güvenilir SAM hesabı yok.\n" #: winerror.mc:3351 msgid "Trusted domain failure.\n" -msgstr "" +msgstr "Güvenilir alan adı başarısız.\n" #: winerror.mc:3356 msgid "Trusted relationship failure.\n" -msgstr "" +msgstr "Güvenilir ilişki başarısız.\n" #: winerror.mc:3361 msgid "Trust logon failure.\n" -msgstr "" +msgstr "Güvenilir giriş başarısız.\n" #: winerror.mc:3366 msgid "RPC call already in progress.\n" -msgstr "" +msgstr "RPC çağrısı zaten işleniyor.\n" #: winerror.mc:3371 msgid "NETLOGON is not started.\n" -msgstr "" +msgstr "NETLOGON başlatılmamış.\n" #: winerror.mc:3376 msgid "Account expired.\n" -msgstr "" +msgstr "Hesabın süresi doldu.\n" #: winerror.mc:3381 msgid "Redirector has open handles.\n" -msgstr "" +msgstr "Yeniden yönlendiricinin açık işlemleri var.\n" #: winerror.mc:3386 msgid "Printer driver already installed.\n" -msgstr "" +msgstr "Yazıcı sürücüsü zaten yüklenmiş.\n" #: winerror.mc:3391 msgid "Unknown port.\n" -msgstr "" +msgstr "Bilinmeyen port.\n" #: winerror.mc:3396 msgid "Unknown printer driver.\n" @@ -6383,15 +6365,15 @@ #: winerror.mc:3401 msgid "Unknown print processor.\n" -msgstr "" +msgstr "Bilinmeyen yazdırma işlemcisi.\n" #: winerror.mc:3406 msgid "Invalid separator file.\n" -msgstr "" +msgstr "Geçersiz ayırıcı dosya.\n" #: winerror.mc:3411 msgid "Invalid priority.\n" -msgstr "" +msgstr "Geçersiz öncelik.\n" #: winerror.mc:3416 msgid "Invalid printer name.\n" @@ -6399,7 +6381,7 @@ #: winerror.mc:3421 msgid "Printer already exists.\n" -msgstr "" +msgstr "Yazıcı zaten var.\n" #: winerror.mc:3426 msgid "Invalid printer command.\n" @@ -6411,31 +6393,31 @@ #: winerror.mc:3436 msgid "Invalid environment.\n" -msgstr "" +msgstr "Geçersiz ortam.\n" #: winerror.mc:3441 msgid "No more bindings.\n" -msgstr "" +msgstr "Başka bir ilişkilendirme yok.\n" #: winerror.mc:3446 msgid "Can't log on with inter-domain trust account.\n" -msgstr "" +msgstr "Alan adları-arası güven hesabıyla oturum açılamıyor.\n" #: winerror.mc:3451 msgid "Can't log on with workstation trust account.\n" -msgstr "" +msgstr "İş istasyonu güven hesabıyla oturum açılamıyor.\n" #: winerror.mc:3456 msgid "Can't log on with server trust account.\n" -msgstr "" +msgstr "Sunucu güven hesabıyla oturum açılamıyor.\n" #: winerror.mc:3461 msgid "Domain trust information inconsistent.\n" -msgstr "" +msgstr "Alan adı güven bilgisi uyumsuz.\n" #: winerror.mc:3466 msgid "Server has open handles.\n" -msgstr "" +msgstr "Sunucunun açık işlemleri var.\n" #: winerror.mc:3471 msgid "Resource data not found.\n" @@ -6463,7 +6445,7 @@ #: winerror.mc:3501 msgid "RPC call canceled.\n" -msgstr "RPC çağrımı iptal edildi.\n" +msgstr "RPC çağrısı iptal edildi.\n" #: winerror.mc:3506 msgid "Binding incomplete.\n" @@ -6479,15 +6461,15 @@ #: winerror.mc:3521 msgid "No principal name registered.\n" -msgstr "" +msgstr "Herhangi bir ana ad kayıtlı değil.\n" #: winerror.mc:3526 msgid "Not an RPC error.\n" -msgstr "" +msgstr "RPC hatası değil.\n" #: winerror.mc:3531 msgid "UUID is local only.\n" -msgstr "" +msgstr "Sadece yerel UUID.\n" #: winerror.mc:3536 msgid "Security package error.\n" @@ -6495,7 +6477,7 @@ #: winerror.mc:3541 msgid "Thread not canceled.\n" -msgstr "" +msgstr "İş parçacığı iptal edilmemiş.\n" #: winerror.mc:3546 msgid "Invalid handle operation.\n" @@ -6503,23 +6485,23 @@ #: winerror.mc:3551 msgid "Wrong serializing package version.\n" -msgstr "" +msgstr "Hatalı serileştirme paket sürümü.\n" #: winerror.mc:3556 msgid "Wrong stub version.\n" -msgstr "" +msgstr "Hatalı taslak (stub) sürümü.\n" #: winerror.mc:3561 msgid "Invalid pipe object.\n" -msgstr "" +msgstr "Geçersiz tünel nesnesi.\n" #: winerror.mc:3566 msgid "Wrong pipe order.\n" -msgstr "" +msgstr "Geçersiz tünel sırası.\n" #: winerror.mc:3571 msgid "Wrong pipe version.\n" -msgstr "" +msgstr "Hatalı tünel sürümü.\n" #: winerror.mc:3576 msgid "Group member not found.\n" @@ -6527,7 +6509,7 @@ #: winerror.mc:3581 msgid "Can't create endpoint mapper DB.\n" -msgstr "" +msgstr "'Endpoint mapper DB' oluşturulamıyor.\n" #: winerror.mc:3586 msgid "Invalid object.\n" @@ -6567,7 +6549,7 @@ #: winerror.mc:3631 msgid "Account locked out.\n" -msgstr "" +msgstr "Hesap kilitli.\n" #: winerror.mc:3636 msgid "Invalid pixel format.\n" @@ -6583,27 +6565,27 @@ #: winerror.mc:3651 msgid "Incomplete RPC send.\n" -msgstr "" +msgstr "Eksik RPC göndermesi.\n" #: winerror.mc:3656 msgid "Invalid asynchronous RPC handle.\n" -msgstr "" +msgstr "Geçersiz asenkronize RPC işlemesi.\n" #: winerror.mc:3661 msgid "Invalid asynchronous RPC call.\n" -msgstr "" +msgstr "Geçersiz asenkronize RPC çağrısı.\n" #: winerror.mc:3666 msgid "RPC pipe closed.\n" -msgstr "" +msgstr "RPC tüneli kapalı.\n" #: winerror.mc:3671 msgid "Discipline error on RPC pipe.\n" -msgstr "" +msgstr "RPC tünelinde düzen hatası.\n" #: winerror.mc:3676 msgid "No data on RPC pipe.\n" -msgstr "" +msgstr "RPC tünelinde veri yok.\n" #: winerror.mc:3681 msgid "No site name available.\n" @@ -6611,7 +6593,7 @@ #: winerror.mc:3686 msgid "The file cannot be accessed.\n" -msgstr "Dosya erişilemez.\n" +msgstr "Dosyaya erişilemiyor.\n" #: winerror.mc:3691 msgid "The filename cannot be resolved.\n" @@ -6654,16 +6636,12 @@ msgstr "Kullanıcı adı bulunamadı.\n" #: winerror.mc:3741 -#, fuzzy -#| msgid "The site does not exist.\n" msgid "This network connection does not exist.\n" -msgstr "Site mevcut değil.\n" +msgstr "Ağ bağlantısı mevcut değil.\n" #: winerror.mc:3746 -#, fuzzy -#| msgid "Connection refused.\n" msgid "Connection reset by peer.\n" -msgstr "Bağlantı reddedildi.\n" +msgstr "Bağlantı eş tarafından sıfırlandı.\n" #: localspl.rc:31 localui.rc:31 winspool.rc:30 msgid "Local Port" @@ -6870,11 +6848,11 @@ #: msi.rc:61 msgid "install source for feature missing" -msgstr "eksik özellik için kurulum kaynağı" +msgstr "özellik için kurulum kaynağı yok" #: msi.rc:62 msgid "network drive for feature missing" -msgstr "eksik özellik için ağ sürücüsü" +msgstr "özellik için ağ sürücüsü yok" #: msi.rc:63 msgid "feature from:" @@ -6886,19 +6864,19 @@ #: msrle32.rc:31 msgid "Wine MS-RLE video codec" -msgstr "Wine MS-RLE vidyo çözücü" +msgstr "Wine MS-RLE video çözücü" #: msrle32.rc:32 msgid "" "Wine MS-RLE video codec\n" "Copyright 2002 by Michael Guennewig" msgstr "" -"Wine MS-RLE vidyo çözücü\n" +"Wine MS-RLE video çözücü\n" "Telif Hakkı 2002 Michael Günnewig" #: msvfw32.rc:33 msgid "Video Compression" -msgstr "Vidyo Sıkıştırma" +msgstr "Video Sıkıştırma" #: msvfw32.rc:39 msgid "&Compressor:" @@ -6926,7 +6904,7 @@ #: msvfw32.rc:55 msgid "kB/s" -msgstr "KB/san" +msgstr "KB/sn" #: msvfw32.rc:28 msgid "Full Frames (Uncompressed)" @@ -6934,7 +6912,7 @@ #: msvidc32.rc:29 msgid "Wine Video 1 video codec" -msgstr "Wine Vidyo 1 vidyo çözücü" +msgstr "Wine Video 1 video çözücü" #: oleacc.rc:31 msgid "unknown object" @@ -6994,7 +6972,7 @@ #: oleacc.rc:45 msgid "application" -msgstr "uygulamalar" +msgstr "uygulama" #: oleacc.rc:46 msgid "document" @@ -7178,118 +7156,100 @@ #: oleacc.rc:91 msgid "page tab list" -msgstr "sayfa sekme listesi" +msgstr "Sayfa sekme listesi" #: oleacc.rc:92 msgid "clock" -msgstr "saat" +msgstr "Saat" #: oleacc.rc:93 msgid "split button" -msgstr "ayır düğmesi" +msgstr "Ayır düğmesi" #: oleacc.rc:94 msgid "IP address" -msgstr "İP adresi" +msgstr "IP adresi" #: oleacc.rc:95 msgid "outline button" msgstr "anahat düğmesi" #: oleacc.rc:97 -#, fuzzy -#| msgid "Normal" msgctxt "object state" msgid "normal" -msgstr "Normal" +msgstr "normal" #: oleacc.rc:98 -#, fuzzy -#| msgid "Unavailable" msgctxt "object state" msgid "unavailable" -msgstr "Kullanılabilir Değil" +msgstr "kullanılamaz" #: oleacc.rc:99 -#, fuzzy -#| msgid "Select" msgctxt "object state" msgid "selected" -msgstr "Seç" +msgstr "seçili" #: oleacc.rc:100 -#, fuzzy -#| msgid "Paused" msgctxt "object state" msgid "focused" -msgstr "Duraklatıldı" +msgstr "odaklanmış" #: oleacc.rc:101 -#, fuzzy -#| msgid "&Compressed" msgctxt "object state" msgid "pressed" -msgstr "S&ıkıştırılmış" +msgstr "sıkıştırılmış" #: oleacc.rc:102 msgctxt "object state" msgid "checked" -msgstr "" +msgstr "kontrol edilmiş" #: oleacc.rc:103 -#, fuzzy -#| msgid "Mixed" msgctxt "object state" msgid "mixed" -msgstr "Karışık" +msgstr "karışık" #: oleacc.rc:104 -#, fuzzy -#| msgid "&Read Only" msgctxt "object state" msgid "read only" -msgstr "&Salt Okunur" +msgstr "salt Okunur" #: oleacc.rc:105 msgctxt "object state" msgid "hot tracked" -msgstr "" +msgstr "aktif izlenen" #: oleacc.rc:106 -#, fuzzy -#| msgid "Defaults" msgctxt "object state" msgid "default" -msgstr "Varsayılanlar" +msgstr "varsayılanlar" #: oleacc.rc:107 msgctxt "object state" msgid "expanded" -msgstr "" +msgstr "genişletilmiş" #: oleacc.rc:108 msgctxt "object state" msgid "collapsed" -msgstr "" +msgstr "daraltılmış" #: oleacc.rc:109 msgctxt "object state" msgid "busy" -msgstr "" +msgstr "meşgul" #: oleacc.rc:110 msgctxt "object state" msgid "floating" -msgstr "" +msgstr "kayan" #: oleacc.rc:111 msgctxt "object state" msgid "marqueed" -msgstr "" +msgstr "kayan" #: oleacc.rc:112 -#, fuzzy -#| msgid "animation" msgctxt "object state" msgid "animated" msgstr "animasyon" @@ -7297,104 +7257,82 @@ #: oleacc.rc:113 msgctxt "object state" msgid "invisible" -msgstr "" +msgstr "görünmez" #: oleacc.rc:114 msgctxt "object state" msgid "offscreen" -msgstr "" +msgstr "ekran dışında" #: oleacc.rc:115 -#, fuzzy -#| msgid "&enable" msgctxt "object state" msgid "sizeable" -msgstr "&etkinleştir" +msgstr "boyutlandırılabilir" #: oleacc.rc:116 -#, fuzzy -#| msgid "&enable" msgctxt "object state" msgid "moveable" -msgstr "&etkinleştir" +msgstr "taşınabilir" #: oleacc.rc:117 msgctxt "object state" msgid "self voicing" -msgstr "" +msgstr "kendi kendini seslendiren" #: oleacc.rc:118 -#, fuzzy -#| msgid "Paused" msgctxt "object state" msgid "focusable" -msgstr "Duraklatıldı" +msgstr "odaklanabilir" #: oleacc.rc:119 -#, fuzzy -#| msgid "table" msgctxt "object state" msgid "selectable" -msgstr "tablo" +msgstr "seçilebilir" #: oleacc.rc:120 -#, fuzzy -#| msgid "link" msgctxt "object state" msgid "linked" -msgstr "bağlantı" +msgstr "bağlı" #: oleacc.rc:121 msgctxt "object state" msgid "traversed" -msgstr "" +msgstr "çapraz" #: oleacc.rc:122 -#, fuzzy -#| msgid "table" msgctxt "object state" msgid "multi selectable" -msgstr "tablo" +msgstr "çoklu seçim" #: oleacc.rc:123 -#, fuzzy -#| msgid "Please select a file." msgctxt "object state" msgid "extended selectable" -msgstr "Lütfen bir dosya seçin." +msgstr "genişletilmiş seçim" #: oleacc.rc:124 -#, fuzzy -#| msgid "alert" msgctxt "object state" msgid "alert low" -msgstr "uyarı" +msgstr "düşük öncelikli uyarı" #: oleacc.rc:125 -#, fuzzy -#| msgid "alert" msgctxt "object state" msgid "alert medium" -msgstr "uyarı" +msgstr "orta öncelikli uyarı" #: oleacc.rc:126 -#, fuzzy -#| msgid "alert" msgctxt "object state" msgid "alert high" -msgstr "uyarı" +msgstr "yüksek öncelikli uyarı" #: oleacc.rc:127 -#, fuzzy -#| msgid "Write protected.\n" msgctxt "object state" msgid "protected" -msgstr "Yazma korumalı.\n" +msgstr "korumalı" #: oleacc.rc:128 msgctxt "object state" msgid "has popup" -msgstr "" +msgstr "açılır penceresi var" #: oleaut32.rc:30 oleview.rc:147 msgid "True" @@ -7412,72 +7350,72 @@ msgid "Off" msgstr "Kapalı" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Nesne Ekle" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Nesne Türü:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Sonuç" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Yeni Oluştur" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Denetim Oluştur" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Dosyadan Oluştur" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "&Denetim Ekle..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "Simge Olarak Göster" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Gözat..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "Dosya:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Özel Yapıştır" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Kaynak:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "&Yapıştır" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "Bağ&lantı Yapıştır" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "&Farklı:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "&Simge Olarak Göster" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "Simge &değiştir..." @@ -7508,21 +7446,27 @@ msgid "Add Control" msgstr "Denetim Ekle" -#: oledlg.rc:34 -#, fuzzy -#| msgid "&Font..." +#: oledlg.rc:35 msgid "&Convert..." -msgstr "&Yazıtipi..." +msgstr "&Dönüştür..." + +#: oledlg.rc:36 +msgid "%1 %2 &Object" +msgstr "%1 %2 &Nesnesi" + +#: oledlg.rc:34 +msgid "%1 &Object" +msgstr "%1 &Nesnesi" #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "&Nesne" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "Panonun içeriklerini dokümanınıza %s olarak ekler." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7530,7 +7474,7 @@ "Panonun içeriklerini dokümanınıza ekler ve %s kullanarak " "etkinleştirebilirsiniz." -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." @@ -7538,7 +7482,7 @@ "Panonun içeriklerini dokümanınıza ekler ve %s kullanarak " "etkinleştirebilirsiniz. Simge olarak gösterilecektir." -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7547,16 +7491,16 @@ "Panonun içeriklerini dokümanınıza %s olarak ekler. Veri kaynak dosyasına " "bağlanılır ve dosyadaki değişiklikler dokümanınıza yansıtılır." -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " "in your document." msgstr "" -"Dokümanınıza pano içeriğinin resmini ekler. Resim kaynak dosyasına " -"bağlanılır ve dosyadaki değişiklikler dokümanınıza yansıtılır." +"Belgenize pano içeriğinin resmini ekler. Resim kaynak dosyasına bağlanılır " +"ve dosyadaki değişiklikler Belgenize yansıtılır." -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7566,19 +7510,19 @@ "dosyasına bağlanır ve böylece dosyaya yapılan değişiklikler belgenize " "yansıtılır." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." -msgstr "Panonun içeriklerini dokümanınıza ekler." +msgstr "Panonun içeriklerini belgenize ekler." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" -msgstr "Tanımlanmamış Tür" +msgstr "Bilinmeyen Tür" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Bilinmeyen Kaynak" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "oluşturan program" @@ -7598,7 +7542,7 @@ #: sane.rc:32 msgctxt "unit: bits" msgid "b" -msgstr "b" +msgstr "bayt" #: sane.rc:34 wineps.rc:49 winecfg.rc:183 msgctxt "unit: dots/inch" @@ -7677,7 +7621,7 @@ #: setupapi.rc:34 msgid "Type the path where the file is located, and then click OK." -msgstr "Dosyanın bulunduğu yolu yazın ve Tamam tıklayın." +msgstr "Dosyanın bulunduğu yolu yazın ve Tamam'ı tıklatın." #: shdoclc.rc:42 msgid "F&orward" @@ -7869,7 +7813,7 @@ #: shdoclc.rc:210 msgid "Performance Meters" -msgstr "Başarım Ölçücüleri" +msgstr "Performans Ölçücüleri" #: shdoclc.rc:211 msgid "Save HTML" @@ -7960,7 +7904,7 @@ #: shell32.rc:33 shell32.rc:48 shell32.rc:125 shell32.rc:165 taskmgr.rc:67 #: taskmgr.rc:112 taskmgr.rc:254 msgid "&Details" -msgstr "&Ayrıntılı" +msgstr "&Ayrıntılar" #: shell32.rc:51 winefile.rc:78 msgid "Arrange &Icons" @@ -7988,7 +7932,7 @@ #: shell32.rc:60 msgid "Line up Icons" -msgstr "Izgaraya Uydur" +msgstr "Simgeleri Düzenle" #: shell32.rc:65 msgid "Paste as Link" @@ -8042,7 +7986,7 @@ #: shell32.rc:130 msgid "&About Control Panel" -msgstr "&Kontrol Paneli Hakkında" +msgstr "&Denetim Masası Hakkında" #: shell32.rc:273 shell32.rc:288 msgid "Browse for Folder" @@ -8060,7 +8004,7 @@ msgid "Message" msgstr "Mesaj" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Evet" @@ -8068,7 +8012,7 @@ msgid "Yes to &all" msgstr "T&ümüne evet" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&Hayır" @@ -8086,7 +8030,7 @@ #: shell32.rc:329 msgid "Wine was brought to you by:" -msgstr "Wine'ı size sunan geliştiriciler:" +msgstr "Wine'yi size sunan geliştiriciler:" #: shell32.rc:337 msgid "" @@ -8156,7 +8100,7 @@ #: shell32.rc:159 msgid "Control Panel" -msgstr "Kontrol Paneli" +msgstr "Denetim Masası" #: shell32.rc:166 msgid "Select" @@ -8168,7 +8112,7 @@ #: shell32.rc:190 msgid "Do you want to simulate a Windows reboot?" -msgstr "Windows Yeniden Başlatma taklit edilsin mi?" +msgstr "Windows'u yeniden başlatma taklit edilsin mi?" #: shell32.rc:191 msgid "Shutdown" @@ -8196,7 +8140,7 @@ #: shell32.rc:207 msgid "Start Menu" -msgstr "Başlat Menüs" +msgstr "Başlat Menüsü" #: shell32.rc:208 msgid "My Music" @@ -8404,7 +8348,7 @@ #: shell32.rc:240 msgid "Wine Control Panel" -msgstr "Wine Kontrol Paneli" +msgstr "Wine Denetim Masası" #: shell32.rc:195 msgid "Unable to display Run File dialog box (internal error)" @@ -8416,7 +8360,7 @@ #: shell32.rc:198 msgid "Executable files (*.exe)" -msgstr "Uygulama dosyaları (*.exe)" +msgstr "Çalıştırılabilir dosyalar (*.exe)" #: shell32.rc:244 msgid "There is no Windows program configured to open this type of file." @@ -8475,7 +8419,7 @@ "Franklin St, Fifth Floor, Boston, MA 02110-1301, USA." msgstr "" "Wine ücretsiz bir yazılım olup; Free Software Foundation tarafından " -"dağıtılan GNU Lesser Genel Kamu Lisansı'nın 2.1 veya (seçimi size bağlı) " +"dağıtılan GNU Kısıtlı Genel Kamu Lisansı'nın 2.1 veya (seçimi size bağlı) " "herhangi sonraki sürümü altında şartlara bağlı kalarak tekrar dağıtabilir ve/" "veya düzenlenebilir.\n" "\n" @@ -8485,7 +8429,7 @@ "Genel Kamu Lisansı'na bakın.\n" "\n" "Wine ile birlikte GNU Lesser Genel Kamu Lisansı'nın bir kopyasını almış " -"olmanız gerekli. Eğer almamışsanız Free Software Foundation, Inc., 51 " +"olmanız gereklidir. Eğer almamışsanız Free Software Foundation, Inc., 51 " "Franklin St, Fifth Floor, Boston, MA 02110-1301, USA adresine yazın." #: shell32.rc:256 @@ -8521,7 +8465,7 @@ #: shlwapi.rc:33 msgctxt "time unit: seconds" msgid " sec" -msgstr " san" +msgstr " sn" #: urlmon.rc:32 wininet.rc:77 msgid "Security Warning" @@ -8545,7 +8489,7 @@ "not click install unless you have absolute trust in the above source." msgstr "" "Yüklendiğinde, bir ActiveX bileşeni bilgisayarınıza tam erişime sahip olur. " -"Eğer yukarıdaki kaynağa tamamen güvenmiyorsanız, yükle tıklamayın." +"Eğer yukarıdaki kaynağa tamamen güvenmiyorsanız, Yükle'yi tıklatmayın." #: urlmon.rc:51 msgid "Installation of component failed: %08x" @@ -8596,23 +8540,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "İle&ri\tCtrl+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "&Vazgeç" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "&Yeniden Dene" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "Y&oksay" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "&Yeniden Dene" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "&Devam Et" @@ -8633,10 +8577,8 @@ msgstr "Çift Yönlü:" #: wineps.rc:50 -#, fuzzy -#| msgid "&Setup" msgid "Setup" -msgstr "&Ayarla" +msgstr "Ayarla" #: wininet.rc:42 wininet.rc:62 msgid "Realm" @@ -8644,7 +8586,7 @@ #: wininet.rc:57 msgid "Authentication Required" -msgstr "Yerkilendirme Gerekli" +msgstr "Yetkilendirme Gerekli" #: wininet.rc:61 msgid "Server" @@ -8652,7 +8594,7 @@ #: wininet.rc:80 msgid "There is a problem with the certificate for this site." -msgstr "Bu sitenin sertifikasında bir problem var." +msgstr "Bu sitenin sertifikasında bir sorun var." #: wininet.rc:82 msgid "Do you want to continue anyway?" @@ -8678,7 +8620,7 @@ #: wininet.rc:32 msgid "" "There is at least one unspecified security problem with this certificate." -msgstr "Bu sertifika ile en az bir belirtilmemiş güvenlik problemi var." +msgstr "Bu sertifika ile en az bir tane belirtilmemiş güvenlik problemi var." #: winmm.rc:32 msgid "The specified command was carried out." @@ -8888,7 +8830,7 @@ "manufacturer about obtaining a new driver." msgstr "" "Aygıt sürücüsünde bir sorun var. Yeni bir sürücü edinmek için aygıtın " -"üreticisiyle bağlantı kurun." +"üreticisiyle iletişime geçin." #: winmm.rc:74 msgid "The specified command requires a parameter. Please supply one." @@ -8953,10 +8895,6 @@ "ya da ağa bağlı olduğunuzdan emin olun." #: winmm.rc:86 -#, fuzzy -#| msgid "" -#| "Cannot find the specified device. Make sure it is installed or that the " -#| "device name is spelled correctly." msgid "" "Cannot find the specified device. Make sure it is installed and that the " "device name is spelled correctly." @@ -9268,24 +9206,20 @@ "olduğunuzdan veya ağa bağlı olduğunuzdan emin olun." #: winmm.rc:136 -#, fuzzy -#| msgid "Wine Mono Installer" msgid "Wine Sound Mapper" -msgstr "Wine Mono Kurucusu" +msgstr "Wine Ses Haritalayıcısı" #: winmm.rc:137 -#, fuzzy -#| msgid "column" msgid "Volume" -msgstr "sütun" +msgstr "Ses Düzeyi" #: winmm.rc:138 msgid "Master Volume" -msgstr "" +msgstr "Ana Ses Düzeyi" #: winmm.rc:139 msgid "Mute" -msgstr "" +msgstr "Sessiz" #: winspool.rc:37 msgid "Print to File" @@ -9297,11 +9231,11 @@ #: winspool.rc:31 msgid "The output file already exists. Click OK to overwrite." -msgstr "Çıkış dosyası zaten var. Üzerine yazmak için Tamam tıklayın." +msgstr "Çıktı dosyası zaten var. Üzerine yazmak için Tamam tıklayın." #: winspool.rc:32 msgid "Unable to create the output file." -msgstr "Çıkış dosyası oluşturulamıyor." +msgstr "Çıktı dosyası oluşturulamıyor." #: wldap32.rc:30 msgid "Success" @@ -9313,7 +9247,7 @@ #: wldap32.rc:32 msgid "Protocol Error" -msgstr "İletişim Kuralı Hatası" +msgstr "Protokol Hatası" #: wldap32.rc:33 msgid "Time Limit Exceeded" @@ -9337,7 +9271,7 @@ #: wldap32.rc:38 msgid "Strong Authentication Required" -msgstr "Güçlü Yerkilendirme Gerekli" +msgstr "Güçlü Yetkilendirme Gerekli" #: wldap32.rc:39 msgid "Referral (v2)" @@ -9353,7 +9287,7 @@ #: wldap32.rc:42 msgid "Unavailable Critical Extension" -msgstr "Kullanılabilir Olmayan Kritik Uzantı" +msgstr "Kullanılamayan Kritik Uzantı" #: wldap32.rc:43 msgid "Confidentiality Required" @@ -9583,12 +9517,12 @@ " + Bir nitelik ayarlar.\n" " - Bir niteliği temizler.\n" " R Salt okunur dosya niteliği.\n" -" A Arşiv dosya niteliği.\n" -" S Sistem dosya niteliği.\n" +" A Arşiv dosyası niteliği.\n" +" S Sistem dosyası niteliği.\n" " H Gizli dosya niteliği.\n" " [sürücü:][yol][dosyaadı]\n" " Nitelikleme için işlenecek dosya veya dosyaları belirtir.\n" -" /S Geçerli klasör ve alt klasörlerinde eşlelen dosyaları işler.\n" +" /S Geçerli klasör ve alt klasörlerinde eşleşen dosyaları işler.\n" " /D Klasörleri de işler.\n" #: clock.rc:32 @@ -9650,12 +9584,12 @@ "CD is the short version of CHDIR. It changes the current\n" "default directory.\n" msgstr "" -"CD CHDIR komutunun kısa sürümüdür. Geçerli öntanımlı dizini\n" +"CD CHDIR komutunun kısa şeklidir. Şimdiki dizini\n" "değiştirir.\n" #: cmd.rc:47 msgid "CHDIR changes the current default directory.\n" -msgstr "CHDIR geçerli öntanımlı dizini değiştirir.\n" +msgstr "CHDIR şimdiki dizini değiştirir.\n" #: cmd.rc:50 msgid "CLS clears the console screen.\n" @@ -9784,11 +9718,11 @@ "\n" "Sözdizimi: LABEL [sürücü:]\n" "Komut sizden verilen sürücü için yeni bir etiket girmenizi bekleyecektir.\n" -"Disk bölüm etiketini VOL komutu ile gösterebilirsiniz.\n" +"Disk birim etiketini VOL komutu ile gösterebilirsiniz.\n" #: cmd.rc:121 msgid "MD is the short version of MKDIR. It creates a subdirectory.\n" -msgstr "MD MKDIR komutunun kısa sürümüdür. Bir alt dizin oluşturur.\n" +msgstr "MD MKDIR komutunun kısa şeklidir. Bir alt dizin oluşturur.\n" #: cmd.rc:123 msgid "MKDIR creates a subdirectory.\n" @@ -9812,7 +9746,6 @@ "verecektir.\n" #: cmd.rc:142 -#, fuzzy msgid "" "PATH displays or changes the cmd search path.\n" "\n" @@ -9830,7 +9763,7 @@ "wine.conf dosyanızda verilen değer olacaktır). Ayarı değiştirmek için PATH\n" "komutuna yeni değeri ekleyin.\n" "\n" -"Ayrıca PATH ayarını düzenlemek için PATH çevre değikenini de\n" +"Ayrıca PATH ayarını düzenlemek için PATH çevre değişkenini de\n" "kullanabilirsiniz, örneğin:\n" "PATH %PATH%;c:\\temp\n" @@ -9901,7 +9834,7 @@ #: cmd.rc:176 msgid "REN is the short version of RENAME. It renames a file.\n" msgstr "" -"REN RENAME komutunun kısa sürümüdür. Bir dosyayı yeniden " +"REN RENAME komutunun kısa şeklidir. Bir dosyayı yeniden " "adlandırır.\n" #: cmd.rc:178 @@ -9910,7 +9843,7 @@ #: cmd.rc:181 msgid "RD is the short version of RMDIR. It deletes a directory.\n" -msgstr "RD RMDIR komutunun kısa sürümüdür. Bir dizini siler.\n" +msgstr "RD RMDIR komutunun kısa şeklidir. Bir dizini siler.\n" #: cmd.rc:183 msgid "RMDIR deletes a directory.\n" @@ -10020,11 +9953,11 @@ #: cmd.rc:237 msgid "TIME sets or shows the current system time.\n" -msgstr "" +msgstr "TIME şimdiki sistem tarihini görüntüler veya değiştirir.\n" #: cmd.rc:240 msgid "TITLE sets the window title for the cmd window.\n" -msgstr "TIELE cmd penceresi için pencere başlığını ayarlar.\n" +msgstr "TITLE cmd penceresi için pencere başlığını ayarlar.\n" #: cmd.rc:244 msgid "" @@ -10050,21 +9983,23 @@ "VERIFY OFF\tBayrağı kaldır.\n" "VERIFY\t\tBayrağın durumunu gösterir.\n" "\n" -"Doğrulama bayrağının Wine'da bir işlevi yoktur.\n" +"Doğrulama bayrağının Wine'de bir işlevi yoktur.\n" #: cmd.rc:256 msgid "VER displays the version of cmd you are running.\n" -msgstr "" +msgstr "VER şu anda çalıştırdığınız cmd'nin sürümünü görüntüler.\n" #: cmd.rc:259 msgid "VOL shows the volume label of a disk device.\n" -msgstr "" +msgstr "VOL bir disk sürücüsünün birim etiketini görüntüler.\n" #: cmd.rc:263 msgid "" "ENDLOCAL ends localization of environment changes in a batch file which\n" "were introduced by a preceding SETLOCAL.\n" msgstr "" +"ENDLOCAL bir toplu iş dosyasında daha önce SETLOCAL tarafından başlatılan\n" +"ortam değişikliklerinin yerelleştirilmesini sonlandırır.\n" #: cmd.rc:271 msgid "" @@ -10075,18 +10010,26 @@ "file, whichever comes first), at which point the previous environment\n" "settings are restored.\n" msgstr "" +"SETLOCAL bir toplu iş dosyasında ortam değişikliklerinin yerelleştirilmesini " +"başlatır.\n" +"\n" +"Bir SETLOCAL'dan sonra başlatılan çevresel değişiklikler (toplu iş " +"dosyasında yerel)\n" +"sonraki ENDLOCAL ile karşılaşılana dek, (veya dosya sonunda, hangisi önce " +"gelirse)\n" +"önceki ortam ayarlarının tutulduğu yerde korunur.\n" #: cmd.rc:275 msgid "" "PUSHD saves the current directory onto a stack, and then\n" "changes the current directory to the supplied one.\n" msgstr "" -"CD CHDIR komutunun kısa sürümüdür. Geçerli öntanımlı dizini " +"CD CHDIR komutunun kısa şeklidir. Geçerli öntanımlı dizini " "değiştirir.\n" #: cmd.rc:278 msgid "POPD changes current directory to the last one saved with PUSHD.\n" -msgstr "" +msgstr "POPD şimdiki dizini en son PUSHD ile kaydedilen dizine değiştirir.\n" #: cmd.rc:288 msgid "" @@ -10099,6 +10042,16 @@ "Specifying no file type after the equal sign removes the current\n" "association, if any.\n" msgstr "" +"ASSOC dosya uzantı ilişkilendirmelerini görüntüler veya değiştirir.\n" +"\n" +"Sözdizimi: ASSOC[.ext[=[dosyatürü]]]\n" +"\n" +"Parametreler olmadan ASSOC şimdiki dosya ilişkilendirmelerini görüntüler.\n" +"Eğer sadece bir dosya türüyle kullanılırsa, şimdiki ilişkilendirmeyi " +"görüntüler.\n" +"Eşittir işaretinin yanında dosya tipi belirtilmezse, varsa şimdiki " +"ilişkilendirmeyi\n" +"kaldırır.\n" #: cmd.rc:300 msgid "" @@ -10113,10 +10066,23 @@ "Specifying no open command after the equal sign removes the command string\n" "associated to the specified file type.\n" msgstr "" +"FTYPE dosya türleriyle ilişkili açık komutları görüntüler veya değiştirir.\n" +"\n" +"Sözdizimi: FTYPE [dosyatürü[=[açıkkomut]]]\n" +"\n" +"Parametreler olmadan, açık komutların tanımlandığı dosya türleri " +"görüntülenir.\n" +"Eğer tek bir dosya türüyle kullanılırsa, varsa ilişkili açık komut " +"görüntülenir.\n" +"Eşittir işaretinden sonra açık komut belirtilmezse, o dosya türü için " +"şimdiki\n" +"ilişkilendirme kaldırılır.\n" #: cmd.rc:303 msgid "MORE displays output of files or piped input in pages.\n" msgstr "" +"MORE dosya çıktılarını veya tünellenmiş girdiyi sayfalar halinde\n" +"görüntüler.\n" #: cmd.rc:308 msgid "" @@ -10126,7 +10092,8 @@ msgstr "" "CHOICE bir metin görüntüler ve Kullanıcı seçilebilir listeden izin verilen\n" "bir tuşa basıncaya kadar bekler.\n" -"CHOICE çoğu zaman bir toplu dosyada menü seçimi inşası için kullanılır.\n" +"CHOICE çoğu zaman bir toplu iş dosyasında menü seçimi inşası için " +"kullanılır.\n" #: cmd.rc:312 msgid "" @@ -10220,7 +10187,7 @@ #: cmd.rc:353 msgid "Are you sure?" -msgstr "Emin misin?" +msgstr "Emin misiniz?" #: cmd.rc:354 xcopy.rc:43 msgctxt "Yes key" @@ -10251,6 +10218,7 @@ #: cmd.rc:360 msgid "Line in Batch processing possibly truncated. Using:\n" msgstr "" +"Toplu iş dosyası işlemesindeki satır olasılıkla kesik. Şu kullanılıyor:\n" #: cmd.rc:362 msgid "Argument missing\n" @@ -10294,7 +10262,7 @@ #: cmd.rc:373 msgid "Cannot call batch label outside of a batch script\n" -msgstr "" +msgstr "Toplu iş dosyası kodlarının dışından yığın etiketi çağrılamıyor\n" #: cmd.rc:374 xcopy.rc:45 msgctxt "All key" @@ -10315,7 +10283,7 @@ #: cmd.rc:378 msgid "Verify must be ON or OFF\n" -msgstr "" +msgstr "Doğrulama AÇIK veya KAPALI olmalıdır\n" #: cmd.rc:379 msgid "Parameter error\n" @@ -10347,7 +10315,7 @@ #: cmd.rc:385 msgid "Microsoft Windows %1!S!\n" -msgstr "" +msgstr "Microsoft Windows %1!S!\n" #: cmd.rc:386 msgid "More? " @@ -10377,6 +10345,7 @@ msgid "" "Can't recognize '%1' as an internal or external command, or batch script.\n" msgstr "" +"'%1', iç veya dış komut olarak, veya toplu iş dosyası olarak tanınmıyor.\n" #: cmd.rc:393 msgid "Division by zero error.\n" @@ -10392,13 +10361,15 @@ #: cmd.rc:396 msgid "Mismatch in parentheses.\n" -msgstr "Dengelenmemiş parantez.\n" +msgstr "Parantezler eşleşmiyor.\n" #: cmd.rc:397 msgid "" "Badly formed number - must be one of decimal (12),\n" " hexadecimal (0x34) or octal (056).\n" msgstr "" +"Hatalı numara biçimi - ondalık (12), onaltılı (0x34) veya sekizli (056) " +"olmalıdır.\n" #: dxdiag.rc:30 msgid "DirectX Diagnostic Tool" @@ -10410,11 +10381,9 @@ #: explorer.rc:31 msgid "Wine Explorer" -msgstr "Wine Gezgin" +msgstr "Wine Gezgini" #: explorer.rc:33 -#, fuzzy -#| msgid "StartUp" msgid "Start" msgstr "Başlangıç" @@ -10434,7 +10403,7 @@ msgid "" "Error: Setting the system hostname is not possible with the hostname " "utility.\n" -msgstr "" +msgstr "Hata: hostname aracı ile sistem adı ayarlanamaz.\n" #: ipconfig.rc:30 msgid "Usage: ipconfig [ /? | /all ]\n" @@ -10442,7 +10411,7 @@ #: ipconfig.rc:31 msgid "Error: Unknown or invalid command line parameters specified\n" -msgstr "" +msgstr "Hata: Bilinmeyen veya geçersiz komut satırı parametreleri belirtildi\n" #: ipconfig.rc:32 msgid "%1 adapter %2\n" @@ -10454,7 +10423,7 @@ #: ipconfig.rc:35 msgid "Connection-specific DNS suffix" -msgstr "" +msgstr "Bağlantıya-özel DNS son eki" #: ipconfig.rc:36 msgid "IPv4 address" @@ -10486,7 +10455,7 @@ #: ipconfig.rc:43 msgid "IP routing enabled" -msgstr "" +msgstr "IP yönlendirmesi etkin" #: ipconfig.rc:45 msgid "Physical address" @@ -10531,6 +10500,12 @@ "Displays the list of running services if 'service' is omitted. Otherwise " "'service' is the name of the service to start.\n" msgstr "" +"Bu komutun sözdizimi:\n" +"\n" +"NET START [hizmet]\n" +"\n" +"Eğer 'hizmet' belirtilmemişse, çalışan hizmetlerin listesi görüntülenir. " +"Aksi halde 'hizmet', başlatılacak hizmetin adıdır.\n" #: net.rc:32 msgid "" @@ -10540,6 +10515,11 @@ "\n" "Where 'service' is the name of the service to stop.\n" msgstr "" +"Bu komutun sözdizimi:\n" +"\n" +"NET STOP hizmet\n" +"\n" +"'hizmet, durdurulacak hizmetin adıdır.\n" #: net.rc:33 msgid "Stopping dependent service: %1\n" @@ -10551,11 +10531,11 @@ #: net.rc:35 msgid "Could not get handle to service control manager.\n" -msgstr "" +msgstr "İşleme, hizmet kontrol yöneticisine alınamıyor.\n" #: net.rc:36 msgid "Could not get handle to service.\n" -msgstr "" +msgstr "İşleme, hizmete alınamıyor.\n" #: net.rc:37 msgid "The %1 service is starting.\n" @@ -10563,27 +10543,27 @@ #: net.rc:38 msgid "The %1 service was started successfully.\n" -msgstr "" +msgstr "%1 hizmeti başarıyla başlatıldı.\n" #: net.rc:39 msgid "The %1 service failed to start.\n" -msgstr "" +msgstr "%1 hizmeti başlatılamadı.\n" #: net.rc:40 msgid "The %1 service is stopping.\n" -msgstr "" +msgstr "%1 hizmeti durduruluyor.\n" #: net.rc:41 msgid "The %1 service was stopped successfully.\n" -msgstr "" +msgstr "%1 hizmeti başarıyla durduruldu.\n" #: net.rc:42 msgid "The %1 service failed to stop.\n" -msgstr "" +msgstr "%1 hizmeti durdurulamadı.\n" #: net.rc:44 msgid "There are no entries in the list.\n" -msgstr "" +msgstr "Listede herhangi bir girdi yok.\n" #: net.rc:45 msgid "" @@ -10645,7 +10625,7 @@ #: netstat.rc:35 msgid "Interface Statistics" -msgstr "Arayüz Ayarları" +msgstr "Arayüz İstatistikleri" #: netstat.rc:36 msgid "Sent" @@ -10661,15 +10641,15 @@ #: netstat.rc:39 msgid "Unicast packets" -msgstr "" +msgstr "Tek yöne yayın paketleri" #: netstat.rc:40 msgid "Non-unicast packets" -msgstr "" +msgstr "Çok yöne yayın paketleri" #: netstat.rc:41 msgid "Discards" -msgstr "" +msgstr "Atlananlar" #: netstat.rc:42 msgid "Errors" @@ -10681,59 +10661,59 @@ #: netstat.rc:44 msgid "TCP Statistics for IPv4" -msgstr "" +msgstr "IPv4 için TCP İstatistikleri" #: netstat.rc:45 msgid "Active Opens" -msgstr "" +msgstr "Etkin Açıklar" #: netstat.rc:46 msgid "Passive Opens" -msgstr "" +msgstr "Devre Dışı Açıklar" #: netstat.rc:47 msgid "Failed Connection Attempts" -msgstr "" +msgstr "Başarısız Bağlantı Denemeleri" #: netstat.rc:48 msgid "Reset Connections" -msgstr "" +msgstr "Bağlantıları Sıfırla" #: netstat.rc:49 msgid "Current Connections" -msgstr "" +msgstr "Şimdiki Bağlantılar" #: netstat.rc:50 msgid "Segments Received" -msgstr "" +msgstr "Alınan Parçalar" #: netstat.rc:51 msgid "Segments Sent" -msgstr "" +msgstr "Gönderilen Parçalar" #: netstat.rc:52 msgid "Segments Retransmitted" -msgstr "" +msgstr "Yeniden İletilen Parçalar" #: netstat.rc:53 msgid "UDP Statistics for IPv4" -msgstr "" +msgstr "IPv4 için UDP İstatistikleri" #: netstat.rc:54 msgid "Datagrams Received" -msgstr "" +msgstr "Alınan Datagramlar" #: netstat.rc:55 msgid "No Ports" -msgstr "" +msgstr "Port Yok" #: netstat.rc:56 msgid "Receive Errors" -msgstr "" +msgstr "Alış Hataları" #: netstat.rc:57 msgid "Datagrams Sent" -msgstr "" +msgstr "Gönderilen Datagramlar" #: notepad.rc:30 msgid "&New\tCtrl+N" @@ -10997,7 +10977,7 @@ #: oleview.rc:45 msgid "In-process &handler" -msgstr "" +msgstr "Süreç içi &işleyici" #: oleview.rc:46 msgid "&Local server" @@ -11025,11 +11005,11 @@ #: oleview.rc:56 msgid "Copy C&LSID to clipboard" -msgstr "" +msgstr "C&LSID'i panoya kopyala" #: oleview.rc:57 msgid "Copy &HTML object Tag to clipboard" -msgstr "" +msgstr "&HTML nesne etiketini panoya kopyala" #: oleview.rc:63 msgid "&Expert mode" @@ -11037,7 +11017,7 @@ #: oleview.rc:65 msgid "&Hidden component categories" -msgstr "" +msgstr "&Gizli bileşen kategorileri" #: oleview.rc:67 oleview.rc:89 winefile.rc:65 wordpad.rc:71 wordpad.rc:264 msgid "&Toolbar" @@ -11061,15 +11041,15 @@ #: oleview.rc:87 msgid "&Group by type kind" -msgstr "" +msgstr "Tür çeşidine göre g&rupla" #: oleview.rc:157 msgid "Connect to another machine" -msgstr "" +msgstr "Başka bir makineye bağlan" #: oleview.rc:160 msgid "&Machine name:" -msgstr "&Makina adı:" +msgstr "&Makine adı:" #: oleview.rc:168 msgid "System Configuration" @@ -11081,11 +11061,11 @@ #: oleview.rc:172 msgid "&Enable Distributed COM" -msgstr "" +msgstr "&Dağıtılmış COM'u Etkinleştir" #: oleview.rc:173 msgid "Enable &Remote Connections (Win95 only)" -msgstr "" +msgstr "&Uzaktan Bağlantılar'ı Etkinleştir (sadece Win95)" #: oleview.rc:174 msgid "" @@ -11093,7 +11073,7 @@ "They have no effect on Wine performance." msgstr "" "Bu ayarlar sadece kayıt değerlerini değiştirir.\n" -"Wine performansında bir etkileri yoktur." +"Wine performansı üzerine bir etkileri yoktur." #: oleview.rc:181 msgid "Default Interface Viewer" @@ -11113,7 +11093,7 @@ #: oleview.rc:194 msgid "IPersist Interface Viewer" -msgstr "" +msgstr "IPersist Arayüz Gösterici" #: oleview.rc:197 oleview.rc:209 msgid "Class Name:" @@ -11125,19 +11105,19 @@ #: oleview.rc:206 msgid "IPersistStream Interface Viewer" -msgstr "" +msgstr "IPersistStream Arayüz Gösterici" #: oleview.rc:96 oleview.rc:97 msgid "OleView" -msgstr "" +msgstr "OleView" #: oleview.rc:101 msgid "ITypeLib viewer" -msgstr "" +msgstr "ITypeLib Görüntüleyicisi" #: oleview.rc:99 msgid "OleView - OLE/COM Object Viewer" -msgstr "" +msgstr "OleView - OLE/COM Nesne Görüntüleyicisi" #: oleview.rc:100 msgid "version 1.0" @@ -11149,52 +11129,52 @@ #: oleview.rc:106 msgid "Bind to file via a File Moniker" -msgstr "" +msgstr "Dosyaya File Moniker ile ilişkilendir" #: oleview.rc:107 msgid "Open a TypeLib file and view the contents" -msgstr "" +msgstr "Bir TypeLib dosyası aç ve içindekileri görüntüle" #: oleview.rc:108 msgid "Change machine wide Distributed COM settings" -msgstr "" +msgstr "Genel Dağıtılan COM ayarlarını değiştir" #: oleview.rc:109 msgid "Run the Wine registry editor" -msgstr "" +msgstr "Wine kayıt defteri düzenleyicisini çalıştır" #: oleview.rc:110 msgid "Quit the application. Prompts to save changes" -msgstr "" +msgstr "Uygulamadan çık. Değişiklikleri kaydetmenizi ister" #: oleview.rc:111 msgid "Create an instance of the selected object" -msgstr "" +msgstr "Seçilen nesnenin örneğini oluştur" #: oleview.rc:112 msgid "Create an instance of the selected object on a specific machine" -msgstr "" +msgstr "Seçilen nesnenin örneğini özel bir makinede oluştur" #: oleview.rc:113 msgid "Release the currently selected object instance" -msgstr "" +msgstr "Seçili nesne örneğini bırak" #: oleview.rc:114 msgid "Copy the GUID of the currently selected item to the clipboard" -msgstr "" +msgstr "Seçilen nesnenin GUID'ini panoya kopyala" #: oleview.rc:115 msgid "Display the viewer for the selected item" -msgstr "" +msgstr "Seçilen nesne için görüntüleyiciyi göster" #: oleview.rc:120 msgid "Toggle between expert and novice display mode" -msgstr "" +msgstr "Uzman ve acemi görüntüleme modları arasında geçiş yap" #: oleview.rc:121 msgid "" "Toggle the display of component categories that are not meant to be visible" -msgstr "" +msgstr "Görüntülenmesi istemeyen bileşen kategorilerinin görünümünü kapat" #: oleview.rc:122 msgid "Show or hide the toolbar" @@ -11214,63 +11194,63 @@ #: oleview.rc:116 msgid "Ask for an in-process server when calling CoGetClassObject" -msgstr "" +msgstr "CoGetClassObject'i çağırırken işlem içi sunucu iste" #: oleview.rc:117 msgid "Ask for an in-process handler when calling CoGetClassObject" -msgstr "" +msgstr "CoGetClassObject'i çağırırken işlem içi işleyici iste" #: oleview.rc:118 msgid "Ask for a local server when calling CoGetClassObject" -msgstr "" +msgstr "CoGetClassObject'i çağırırken yerel sunucu iste" #: oleview.rc:119 msgid "Ask for a remote server when calling CoGetClassObject" -msgstr "" +msgstr "CoGetClassObject'i çağırırken uzak sunucu iste" #: oleview.rc:131 msgid "ObjectClasses" -msgstr "" +msgstr "NesneSınıfları" #: oleview.rc:132 msgid "Grouped by Component Category" -msgstr "" +msgstr "Bileşen Kategorisine Göre Sınıflandırıldı" #: oleview.rc:133 msgid "OLE 1.0 Objects" -msgstr "" +msgstr "OLE 1.0 Nesneleri" #: oleview.rc:134 msgid "COM Library Objects" -msgstr "" +msgstr "COM Kütüphane Nesneleri" #: oleview.rc:135 msgid "All Objects" -msgstr "" +msgstr "Bütün Nesneler" #: oleview.rc:136 msgid "Application IDs" -msgstr "" +msgstr "Uygulama Kimlikleri" #: oleview.rc:137 msgid "Type Libraries" -msgstr "" +msgstr "Tür Kitaplıkları" #: oleview.rc:138 msgid "ver." -msgstr "" +msgstr "Sürüm" #: oleview.rc:139 msgid "Interfaces" -msgstr "" +msgstr "Arayüzler" #: oleview.rc:141 msgid "Registry" -msgstr "" +msgstr "Kayıt" #: oleview.rc:142 msgid "Implementation" -msgstr "" +msgstr "İmplementasyon" #: oleview.rc:143 msgid "Activation" @@ -11278,7 +11258,7 @@ #: oleview.rc:145 msgid "CoGetClassObject failed." -msgstr "" +msgstr "CoGetClassObject başarısız." #: oleview.rc:146 msgid "Unknown error" @@ -11290,23 +11270,23 @@ #: oleview.rc:151 msgid "LoadTypeLib( %1 ) failed ($%2!x!)" -msgstr "" +msgstr "LoadTypeLib ( %1 ) başarısız ($%2!x!)" #: oleview.rc:152 msgid "Inherited Interfaces" -msgstr "" +msgstr "Alınan Arayüzler" #: oleview.rc:127 msgid "Save as an .IDL or .H file" -msgstr "" +msgstr ".IDL veya .H dosyası olarak kaydet" #: oleview.rc:128 msgid "Close window" -msgstr "" +msgstr "Pencereyi kapat" #: oleview.rc:129 msgid "Group typeinfos by kind" -msgstr "" +msgstr "Tür bilgilerini türe göre grupla" #: progman.rc:33 msgid "&New..." @@ -11334,7 +11314,7 @@ #: progman.rc:42 msgid "E&xit Windows" -msgstr "" +msgstr "&Windows'tan Çık" #: progman.rc:44 taskmgr.rc:41 winefile.rc:62 winhlp32.rc:47 msgid "&Options" @@ -11474,7 +11454,7 @@ #: progman.rc:70 msgid "Not implemented" -msgstr "" +msgstr "Eklenmedi/Geliştirilmedi" #: progman.rc:71 msgid "Error reading `%s'." @@ -11527,47 +11507,50 @@ "REG [ ADD | DELETE | QUERY ]\n" "REG command /?\n" msgstr "" +"Komut sözdizimi:\n" +"\n" +"REG [ ADD | DELETE | QUERY ]\n" +"REG komut /?\n" #: reg.rc:31 msgid "" "REG ADD key_name [/v value_name | /ve] [/t type] [/s separator] [/d data] [/" "f]\n" msgstr "" +"REG ADD anahtar_adı [/v değer_adı | /ve] [/t tür] [/s ayraç] [/d veri] [/f]\n" #: reg.rc:32 msgid "REG DELETE key_name [/v value_name | /ve | /va] [/f]\n" -msgstr "" +msgstr "REG DELETE anahtar_adı [/v değer_adı | /ve | /va] [/f]\n" #: reg.rc:33 msgid "REG QUERY key_name [/v value_name | /ve] [/s]\n" -msgstr "" +msgstr "REG QUERY anahtar_adı [/v değer_adı | /ve] [/s]\n" #: reg.rc:34 msgid "The operation completed successfully\n" -msgstr "" +msgstr "İşlem başarıyla tamamlandı\n" #: reg.rc:35 msgid "Error: Invalid key name\n" -msgstr "" +msgstr "Hata: Geçersiz anahtar adı\n" #: reg.rc:36 msgid "Error: Invalid command line parameters\n" -msgstr "" +msgstr "Hata: Geçersiz komut satırı parametreleri\n" #: reg.rc:37 msgid "Error: Unable to access remote machine\n" -msgstr "" +msgstr "Hata: Uzak makineye erişilemiyor\n" #: reg.rc:38 msgid "" "Error: The system was unable to find the specified registry key or value\n" -msgstr "" +msgstr "Hata: Sistem belirtilen kayıt anahtarını veya değeri bulamadı\n" #: reg.rc:39 -#, fuzzy -#| msgid "Error: Command line not supported\n" msgid "Error: Unsupported type\n" -msgstr "Hata: Komut satırı desteklenmiyor\n" +msgstr "Hata: Desteklenmeyen tür\n" #: regedit.rc:34 msgid "&Registry" @@ -11587,7 +11570,7 @@ #: regedit.rc:51 regedit.rc:102 msgid "&String Value" -msgstr "&Dizge Değeri" +msgstr "&Dize Değeri" #: regedit.rc:52 regedit.rc:103 msgid "&Binary Value" @@ -11595,15 +11578,15 @@ #: regedit.rc:53 regedit.rc:104 msgid "&DWORD Value" -msgstr "&Çift Sözcük Değeri" +msgstr "&DWORD Değeri" #: regedit.rc:54 regedit.rc:105 msgid "&Multi-String Value" -msgstr "" +msgstr "&Çoklu Dize Değeri" #: regedit.rc:55 regedit.rc:106 msgid "&Expandable String Value" -msgstr "" +msgstr "&Genişletilebilir Dize Değeri" #: regedit.rc:59 regedit.rc:110 msgid "&Rename\tF2" @@ -11627,7 +11610,7 @@ #: regedit.rc:70 winefile.rc:49 msgid "Sp&lit" -msgstr "" +msgstr "A&yır" #: regedit.rc:77 msgid "&Remove Favorite..." @@ -11635,19 +11618,19 @@ #: regedit.rc:82 msgid "&About Registry Editor" -msgstr "Sistem Kayıt Düzenleyicisi &Hakkında" +msgstr "Kayıt Defteri Düzenleyicisi &Hakkında" #: regedit.rc:91 msgid "Modify Binary Data..." -msgstr "" +msgstr "İkili Değeri Değiştir..." #: regedit.rc:218 msgid "Export registry" -msgstr "" +msgstr "Kayıt Defterini Ver" #: regedit.rc:220 msgid "S&elected branch:" -msgstr "" +msgstr "S&eçilen kısım:" #: regedit.rc:229 msgid "Find:" @@ -11687,7 +11670,7 @@ #: regedit.rc:264 msgid "Edit String" -msgstr "Dizgeyi Düzenle" +msgstr "Dizeyi Düzenle" #: regedit.rc:267 regedit.rc:280 regedit.rc:296 regedit.rc:309 msgid "Value name:" @@ -11699,7 +11682,7 @@ #: regedit.rc:277 msgid "Edit DWORD" -msgstr "Çift Dizgeyi Düzenle" +msgstr "DWORD Düzenle" #: regedit.rc:284 msgid "Base" @@ -11719,7 +11702,7 @@ #: regedit.rc:306 msgid "Edit Multi-String" -msgstr "" +msgstr "Çoklu Dizeyi Düzenle" #: regedit.rc:137 msgid "Contains commands for working with the whole registry" @@ -11757,19 +11740,19 @@ #: regedit.rc:194 msgid "Import Registry File" -msgstr "" +msgstr "Kayıt Dosyasından Al" #: regedit.rc:195 msgid "Export Registry File" -msgstr "" +msgstr "Kayıt Dosyasına Ver" #: regedit.rc:196 msgid "Registry files (*.reg)" -msgstr "" +msgstr "Kayıt dosyaları (*.reg)" #: regedit.rc:197 msgid "Win9x/NT4 Registry files (REGEDIT4)" -msgstr "" +msgstr "Win9X/NT4 Kayıt Dosyaları (REGEDIT4)" #: regedit.rc:204 msgid "(Default)" @@ -11777,11 +11760,11 @@ #: regedit.rc:205 msgid "(value not set)" -msgstr "" +msgstr "(değer belirlenmemiş)" #: regedit.rc:206 msgid "(cannot display value)" -msgstr "" +msgstr "(değer görüntülenemiyor)" #: regedit.rc:207 msgid "(unknown %d)" @@ -11893,7 +11876,7 @@ #: regedit.rc:186 msgid "Are you sure you want to delete these values?" -msgstr "" +msgstr "Bu değerleri silmek istediğinizden emin misiniz?" #: regedit.rc:187 msgid "New Key #%d" @@ -11913,7 +11896,7 @@ #: regedit.rc:174 msgid "Exports selected branch of the registry to a text file" -msgstr "Sistem kaydının seçilen kısmını dosyasına aktarır" +msgstr "Sistem kaydının seçilen kısmını metin dosyasına aktarır" #: regsvr32.rc:32 msgid "" @@ -11922,6 +11905,10 @@ "Provides DLL registration services.\n" "\n" msgstr "" +"Wine DLL Kayıt Aracı\n" +"\n" +"DLL kayıt hizmetlerini yürütür.\n" +"\n" #: regsvr32.rc:40 msgid "" @@ -11936,54 +11923,64 @@ " [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" "\n" msgstr "" +"Kullanım:\n" +" regsvr32 [/u] [/s] [/n] [/i[:komutsatırı]] DllAdı\n" +"\n" +"Seçenekler:\n" +" [/u] Bir sunucunun kaydını kaldır.\n" +" [/s] Sessiz (hiçbir mesaj görüntülenmeyecek).\n" +" [/i] DllInstall'ı, isteğe bağlı [komutsatırı] geçirerek çağır.\n" +"\t[/u] ile kullanıldığında DllInstall kaldırma kipinde çağrılır.\n" +" [/n] DllRegisterServer'i çağırma. Bu seçenek [/i] ile kullanılır.\n" +"\n" #: regsvr32.rc:41 msgid "" "regsvr32: Invalid or unrecognized switch [%1]\n" "\n" msgstr "" +"regsvr32: Geçersiz veya bilinmeyen değişken [%1]\n" +"\n" #: regsvr32.rc:42 -#, fuzzy -#| msgid "Failed to open '%1'\n" msgid "regsvr32: Failed to load DLL '%1'\n" -msgstr "'%1' açılamadı\n" +msgstr "regsvr32: '%1' DLL dosyası yüklenemedi.\n" #: regsvr32.rc:43 msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" -msgstr "" +msgstr "regsvr32: '%1!S!', '%2% DLL dosyasında yok.\n" #: regsvr32.rc:44 msgid "regsvr32: Failed to register DLL '%1'\n" -msgstr "" +msgstr "regsvr32: '%1' DLL dosyası kaydedilemedi.\n" #: regsvr32.rc:45 msgid "regsvr32: Successfully registered DLL '%1'\n" -msgstr "" +msgstr "regsvr32: '%1' DLL dosyası başarıyla kaydedildi.\n" #: regsvr32.rc:46 msgid "regsvr32: Failed to unregister DLL '%1'\n" -msgstr "" +msgstr "regsvr32: '%1' DLL dosyası kayıttan kaldırılamadı.\n" #: regsvr32.rc:47 msgid "regsvr32: Successfully unregistered DLL '%1'\n" -msgstr "" +msgstr "regsvr32: '%1' DLL dosyası başarıyla kayıttan kaldırıldı.\n" #: regsvr32.rc:48 msgid "regsvr32: Failed to install DLL '%1'\n" -msgstr "" +msgstr "regsvr32: '%1' DLL dosyası yüklenemedi.\n" #: regsvr32.rc:49 msgid "regsvr32: Successfully installed DLL '%1'\n" -msgstr "" +msgstr "regsvr32: '%1' DLL dosyası başarıyla yüklendi.\n" #: regsvr32.rc:50 msgid "regsvr32: Failed to uninstall DLL '%1'\n" -msgstr "" +msgstr "regsvr32: '%1' DLL dosyası kaldırılamadı.\n" #: regsvr32.rc:51 msgid "regsvr32: Successfully uninstalled DLL '%1'\n" -msgstr "" +msgstr "regsvr32: '%1' DLL dosyası başarıyla kaldırıldı.\n" #: start.rc:58 msgid "" @@ -11996,64 +11993,67 @@ #: start.rc:60 msgid "Could not translate the specified Unix filename to a DOS filename." -msgstr "" +msgstr "Belirtilen Unix dosya adı, bir DOS dosya adına çevrilemedi." #: taskkill.rc:30 msgid "Usage: taskkill [/?] [/f] [/im ProcessName | /pid ProcessID]\n" -msgstr "" +msgstr "Kullanım: taskkill [/?] [/f] [/im İşlemAdı | /pid İşlemKimliği]\n" #: taskkill.rc:31 msgid "Error: Unknown or invalid command line option specified.\n" -msgstr "" +msgstr "Hata: Bilinmeyen veya geçersiz komut satırı seçeneği.\n" #: taskkill.rc:32 msgid "Error: Invalid command line parameter specified.\n" -msgstr "" +msgstr "Hata: Geçersiz komut satırı parametresi.\n" #: taskkill.rc:33 msgid "Error: One of options /im or /pid must be specified.\n" -msgstr "" +msgstr "Hata: /im veya /pid belirlenmeli.\n" #: taskkill.rc:34 msgid "Error: Option %1 expects a command line parameter.\n" -msgstr "" +msgstr "Hata: %1 ayarı komut satırı parametresi bekliyor.\n" #: taskkill.rc:35 msgid "Error: Options /im and /pid are mutually exclusive.\n" -msgstr "" +msgstr "Hata: /im ve /pid ayarları ayrışık. (mutually exclusive).\n" #: taskkill.rc:36 msgid "Close message sent to top-level windows of process with PID %1!u!.\n" msgstr "" +"PID'i %1!u! olan üst seviye pencere işlemine kapanma mesajı gönderildi.\n" #: taskkill.rc:37 msgid "" "Close message sent to top-level windows of process \"%1\" with PID %2!u!.\n" msgstr "" +"PID'i %2!u! olan \"%1\" üst seviye pencere işlemine kapanma mesajı " +"gönderildi.\n" #: taskkill.rc:38 msgid "Process with PID %1!u! was forcibly terminated.\n" -msgstr "" +msgstr "PID'i %1!u! olan işlem zorla sonlandırıldı.\n" #: taskkill.rc:39 msgid "Process \"%1\" with PID %2!u! was forcibly terminated.\n" -msgstr "" +msgstr "PID'i %2!u! olan \"%1\" işlemi zorla sonlandırıldı.\n" #: taskkill.rc:40 msgid "Error: Could not find process \"%1\".\n" -msgstr "" +msgstr "Hata: \"%1\" işlemi bulunamıyor.\n" #: taskkill.rc:41 msgid "Error: Unable to enumerate the process list.\n" -msgstr "" +msgstr "Hata: İşlem listesi oluşturulamıyor.\n" #: taskkill.rc:42 msgid "Error: Unable to terminate process \"%1\".\n" -msgstr "" +msgstr "Hata: \"%1\" işlemi sonlandırılamıyor.\n" #: taskkill.rc:43 msgid "Error: Process self-termination is not permitted.\n" -msgstr "" +msgstr "Hata: İşlemin kendini sonlandırmasına izin verilmiyor.\n" #: taskmgr.rc:37 taskmgr.rc:108 msgid "&New Task (Run...)" @@ -12109,7 +12109,7 @@ #: taskmgr.rc:71 taskmgr.rc:259 msgid "&One Graph, All CPUs" -msgstr "&Bir Grafikte Tüm CPU'ler" +msgstr "&Bir Grafikte Tüm CPU'lar" #: taskmgr.rc:73 taskmgr.rc:260 msgid "One Graph &Per CPU" @@ -12153,15 +12153,15 @@ #: taskmgr.rc:130 msgid "&Go To Process" -msgstr "S&ürece Git" +msgstr "İ&şleme Git" #: taskmgr.rc:149 taskmgr.rc:363 msgid "&End Process" -msgstr "Süreci &Sonlandır" +msgstr "İşlemi &Sonlandır" #: taskmgr.rc:150 msgid "End Process &Tree" -msgstr "Süreç A&ğacını Sonlandır" +msgstr "İşlem A&ğacını Sonlandır" #: taskmgr.rc:152 winedbg.rc:32 msgid "&Debug" @@ -12185,7 +12185,7 @@ #: taskmgr.rc:169 msgid "Set &Affinity..." -msgstr "&Yakınlığı Belirt..." +msgstr "İ&lişkiyi Belirt..." #: taskmgr.rc:170 msgid "Edit Debug &Channels..." @@ -12201,7 +12201,7 @@ #: taskmgr.rc:364 msgid "&Show processes from all users" -msgstr "&Tüm kullanıcı süreçlerini göster" +msgstr "&Tüm kullanıcı işlemlerini göster" #: taskmgr.rc:372 msgid "CPU usage" @@ -12209,7 +12209,7 @@ #: taskmgr.rc:373 msgid "Mem usage" -msgstr "BELLEK Kullanımı" +msgstr "Bellek Kullanımı" #: taskmgr.rc:374 msgid "Totals" @@ -12217,7 +12217,7 @@ #: taskmgr.rc:375 msgid "Commit charge (K)" -msgstr "" +msgstr "Ayrılmış Belllek (K)" #: taskmgr.rc:376 msgid "Physical memory (K)" @@ -12229,15 +12229,15 @@ #: taskmgr.rc:378 taskmgr.rc:290 msgid "Handles" -msgstr "Tutanaklar" +msgstr "İşleyiciler" #: taskmgr.rc:379 taskmgr.rc:291 msgid "Threads" -msgstr "Evreler" +msgstr "İş Parçacıkları" #: taskmgr.rc:380 taskmgr.rc:263 msgid "Processes" -msgstr "Süreçler" +msgstr "İşlemler" #: taskmgr.rc:387 taskmgr.rc:396 taskmgr.rc:405 msgid "Total" @@ -12249,7 +12249,7 @@ #: taskmgr.rc:389 msgid "Peak" -msgstr "Zirve" +msgstr "En Yüksek" #: taskmgr.rc:398 msgid "System Cache" @@ -12277,13 +12277,15 @@ #: taskmgr.rc:439 msgid "Processor Affinity" -msgstr "" +msgstr "İşlemci İlişkisi" #: taskmgr.rc:444 msgid "" "The Processor Affinity setting controls which CPUs the process will be " "allowed to execute on." msgstr "" +"İşlemci İlişkisi sekmesi, işlemin hangi işlemcilerin üzerinde çalışmasına " +"izin verileceğini ayarlar." #: taskmgr.rc:446 msgid "CPU 0" @@ -12420,7 +12422,7 @@ #: taskmgr.rc:519 msgid "" "Select the columns that will appear on the Process page of the Task Manager." -msgstr "Görev Yöneticisinin Süreç sekmesinde görüntülenecek sütunları seçin." +msgstr "Görev Yöneticisinin İşlem sekmesinde görüntülenecek sütunları seçin." #: taskmgr.rc:521 msgid "&Image Name" @@ -12428,15 +12430,15 @@ #: taskmgr.rc:523 msgid "&PID (Process Identifier)" -msgstr "&PID (Süreç Kimliği)" +msgstr "&PID (İşlem Kimliği)" #: taskmgr.rc:525 msgid "&CPU Usage" -msgstr "&MİB Kullanımı" +msgstr "&CPU Kullanımı" #: taskmgr.rc:527 msgid "CPU Tim&e" -msgstr "MİB S&üresi" +msgstr "CPU S&üresi" #: taskmgr.rc:529 msgid "&Memory Usage" @@ -12444,11 +12446,11 @@ #: taskmgr.rc:531 msgid "Memory Usage &Delta" -msgstr "Bellek Kullanımı &Delta" +msgstr "Bellek Kullanımı F&arkı" #: taskmgr.rc:533 msgid "Pea&k Memory Usage" -msgstr "Bellek Kullanım &Zirvesi" +msgstr "En &Yüksek Bellek Kullanımı" #: taskmgr.rc:535 msgid "Page &Faults" @@ -12476,7 +12478,7 @@ #: taskmgr.rc:547 msgid "Page F&aults Delta" -msgstr "Sayfalama Hat. &Delta" +msgstr "Sayfalama Hat. &Farkı" #: taskmgr.rc:549 msgid "&Virtual Memory Size" @@ -12496,11 +12498,11 @@ #: taskmgr.rc:557 msgid "&Handle Count" -msgstr "&Tutanak Sayısı" +msgstr "İş&leyici Sayısı" #: taskmgr.rc:559 msgid "&Thread Count" -msgstr "&Evre Sayısı" +msgstr "&İş Parçacığı Sayısı" #: taskmgr.rc:561 taskmgr.rc:292 msgid "GDI Objects" @@ -12613,27 +12615,27 @@ #: taskmgr.rc:215 msgid "Shows 16-bit tasks under the associated ntvdm.exe" -msgstr "16-bit süreçleri ilişkili ntvdm.exe altında gösterir" +msgstr "16-bit işlemleri ilişkili ntvdm.exe altında gösterir" #: taskmgr.rc:216 msgid "Select which columns will be visible on the Process page" -msgstr "Hangi süreçlerin Süreç sekmesinde görünebilir olacağını seçin" +msgstr "Hangi süreçlerin İşlem sekmesinde görünebilir olacağını seçin" #: taskmgr.rc:217 msgid "Displays kernel time in the performance graphs" -msgstr "Başarım grafiklerinde çekirdek sürelerini gösterir" +msgstr "Performans grafiklerinde çekirdek sürelerini gösterir" #: taskmgr.rc:219 msgid "A single history graph shows total CPU usage" -msgstr "Tek bir geçmiş grafiği toplam MİB (CPU) kullanımını gösterir" +msgstr "Tek bir geçmiş grafiği toplam işlemci kullanımını gösterir" #: taskmgr.rc:220 msgid "Each CPU has its own history graph" -msgstr "Her MİB'nin (CPU) kendi geçmiş grafiği olur" +msgstr "Her işlemcinin kendi geçmiş grafiği olur" #: taskmgr.rc:222 msgid "Brings a task to the foreground, switch focus to that task" -msgstr "Bir görevi önplana getirir ve o görevi odaklar" +msgstr "Bir görevi önplana getirir ve o göreve odaklanır" #: taskmgr.rc:227 msgid "Tells the selected tasks to close" @@ -12649,47 +12651,47 @@ #: taskmgr.rc:230 msgid "Removes the process from the system" -msgstr "Sistemden süreci siler" +msgstr "Sistemden işlemi kaldırır" #: taskmgr.rc:232 msgid "Removes this process and all descendants from the system" -msgstr "Bu süreci ve onun alt dallarını sistemden siler" +msgstr "Bu işlemi ve onun alt dallarını sistemden siler" #: taskmgr.rc:233 msgid "Attaches the debugger to this process" -msgstr "Hata ayıklayıcıyı bu sürece iliştirir" +msgstr "Hata ayıklayıcıyı bu işleme iliştirir" #: taskmgr.rc:235 msgid "Controls which processors the process will be allowed to run on" -msgstr "Sürecin hangi işlemciler üzerinde çalışabileceğini denetler" +msgstr "İşlemin hangi işlemciler üzerinde çalışabileceğini denetler" #: taskmgr.rc:237 msgid "Sets process to the REALTIME priority class" -msgstr "Süreci GERÇEKZAMAN öncelik sınıfında çalışmaya ayarlar" +msgstr "İşlemi GERÇEKZAMAN öncelik sınıfında çalışmaya ayarlar" #: taskmgr.rc:238 msgid "Sets process to the HIGH priority class" -msgstr "Süreci YÜKSEK öncelik sınıfında çalışmaya ayarlar" +msgstr "İşlemi YÜKSEK öncelik sınıfında çalışmaya ayarlar" #: taskmgr.rc:240 msgid "Sets process to the ABOVE NORMAL priority class" -msgstr "Süreci NORMAL ÜZERİ öncelik sınıfında çalışmaya ayarlar" +msgstr "İşlemi NORMAL ÜZERİ öncelik sınıfında çalışmaya ayarlar" #: taskmgr.rc:242 msgid "Sets process to the NORMAL priority class" -msgstr "Süreci NORMAL öncelik sınıfında çalışmaya ayarlar" +msgstr "İşlemi NORMAL öncelik sınıfında çalışmaya ayarlar" #: taskmgr.rc:244 msgid "Sets process to the BELOW NORMAL priority class" -msgstr "Süreci NORMAL ALTI öncelik sınıfında çalışmaya ayarlar" +msgstr "İşlemi NORMAL ALTI öncelik sınıfında çalışmaya ayarlar" #: taskmgr.rc:245 msgid "Sets process to the LOW priority class" -msgstr "Süreci DÜŞÜK öncelik sınıfında çalışmaya ayarlar" +msgstr "İşlemi DÜŞÜK öncelik sınıfında çalışmaya ayarlar" #: taskmgr.rc:247 msgid "Controls Debug Channels" -msgstr "" +msgstr "Hata Ayıklama Kanallarını Denetler" #: taskmgr.rc:264 msgid "Performance" @@ -12701,7 +12703,7 @@ #: taskmgr.rc:266 msgid "Processes: %d" -msgstr "Süreçler: %d" +msgstr "İşlemler: %d" #: taskmgr.rc:267 msgid "Mem Usage: %1!u!kB / %2!u!kB" @@ -12729,23 +12731,23 @@ #: taskmgr.rc:277 msgid "Mem Delta" -msgstr "Bell. Delta" +msgstr "Bell. Farkı" #: taskmgr.rc:278 msgid "Peak Mem Usage" -msgstr "" +msgstr "En Yüksek Bell. Kull." #: taskmgr.rc:279 msgid "Page Faults" -msgstr "" +msgstr "Sayfa Hataları" #: taskmgr.rc:280 msgid "USER Objects" -msgstr "" +msgstr "KULLANICI Nesneleri" #: taskmgr.rc:283 msgid "Session ID" -msgstr "" +msgstr "Oturum Kimliği" #: taskmgr.rc:284 msgid "Username" @@ -12753,23 +12755,23 @@ #: taskmgr.rc:285 msgid "PF Delta" -msgstr "" +msgstr "Sayfa Dosyası Değişimi" #: taskmgr.rc:286 msgid "VM Size" -msgstr "" +msgstr "Sanal Bellek Boyutu" #: taskmgr.rc:287 msgid "Paged Pool" -msgstr "" +msgstr "Sayfalanmış Havuz" #: taskmgr.rc:288 msgid "NP Pool" -msgstr "" +msgstr "Sayfalanmamış Havuz" #: taskmgr.rc:289 msgid "Base Pri" -msgstr "" +msgstr "Temel Öncelik" #: taskmgr.rc:301 msgid "Task Manager Warning" @@ -12781,7 +12783,7 @@ "cause undesired results including system instability. Are you\n" "sure you want to change the priority class?" msgstr "" -"UYARI: Bu sürecin öncelik sınıfını değiştirmek sistem kararsızlığı da\n" +"UYARI: Bu işlemin öncelik sınıfını değiştirmek sistem kararsızlığı da\n" "dahil, istenmeyen sonuçlar doğurabilir. Öncelik sınıfını değiştirmek\n" "istediğinizden emin misiniz?" @@ -12797,30 +12799,30 @@ "data before it is terminated. Are you sure you want to\n" "terminate the process?" msgstr "" -"UYARI: Bir süreci sonlandırmak, veri kaynı ve sistem kararsızlığı\n" -"gibi istenmeyen sonuçlar doğurabilir. Sürece, sonlandırılmadan\n" +"UYARI: Bir işlemi sonlandırmak, veri kaybı ve sistem kararsızlığı\n" +"gibi istenmeyen sonuçlar doğurabilir. İşleme, sonlandırılmadan\n" "önce durumunu veya verilerini kaydetme şansı verilmeyecek.\n" -"Süreci sonlandırmak istediğinizden emin misiniz?" +"İşleme sonlandırmak istediğinizden emin misiniz?" #: taskmgr.rc:311 msgid "Unable to Terminate Process" -msgstr "Süreç Sonlandırma Başarısız" +msgstr "İşlem Sonlandırma Başarısız" #: taskmgr.rc:313 msgid "" "WARNING: Debugging this process may result in loss of data.\n" "Are you sure you wish to attach the debugger?" msgstr "" -"UYARI: Bu süreçte hata ayıklaması yapmak veri kaybı ile sonuçlanabilir.\n" +"UYARI: Bu işlemde hata ayıklaması yapmak veri kaybı ile sonuçlanabilir.\n" "Hata ayıklayıcıya iliştirmek istiyor musunuz?" #: taskmgr.rc:314 msgid "Unable to Debug Process" -msgstr "Süreç Hata Ayıklama Başarısız" +msgstr "İşlemde Hata Ayıklama Başarısız" #: taskmgr.rc:315 msgid "The process must have affinity with at least one processor" -msgstr "" +msgstr "İşlem en az bir işlemciyle ilgili olmalıdır" #: taskmgr.rc:316 msgid "Invalid Option" @@ -12828,11 +12830,11 @@ #: taskmgr.rc:317 msgid "Unable to Access or Set Process Affinity" -msgstr "" +msgstr "İşlem İlişkisine Erişme veya Ayarlama Başarısız" #: taskmgr.rc:322 msgid "System Idle Process" -msgstr "" +msgstr "Sistem Boşta İşlemi" #: taskmgr.rc:323 msgid "Not Responding" @@ -12856,23 +12858,23 @@ "executable.\n" "Do you want to remove the uninstall entry from the registry?" msgstr "" -"'%s' kaldırma komutu çalıştırılamadı, çalıştırıbilir dosya var olmayabilir.\n" -"Sistem kaydından bu kaldırma girişini silmek ister misiniz?" +"'%s' kaldırma komutu çalıştırılabilir dosya var olmadığından " +"çalıştırılamadı.\n" +"Kayıt defterinden bu kaldırma girişini silmek ister misiniz?" #: uninstaller.rc:31 msgid "uninstaller: The application with GUID '%1' was not found\n" -msgstr "" +msgstr "uninstaller: GUID'i '%1' olan uygulama bulunamadı\n" #: uninstaller.rc:32 msgid "" "uninstaller: The option '--remove' must be followed by an application GUID\n" msgstr "" +"uninstaller: --remove seçeneğinden sonra bir uygulama GUID'i girilmelidir\n" #: uninstaller.rc:33 -#, fuzzy -#| msgid "Error: Invalid option '%c'.\n" msgid "uninstaller: Invalid option [%1]\n" -msgstr "Hata: '%c' geçersiz seçenek.\n" +msgstr "uninstaller: '%1' geçersiz seçenek.\n" #: uninstaller.rc:35 msgid "" @@ -12881,6 +12883,10 @@ "Uninstall applications from the current Wine prefix.\n" "\n" msgstr "" +"Wine Uygulama Kaldırıcısı\n" +"\n" +"Şimdiki Wine yapılandırmanızdan uygulamaları kaldırır.\n" +"\n" #: uninstaller.rc:43 msgid "" @@ -12895,6 +12901,16 @@ " [no option] Launch the graphical version of this program.\n" "\n" msgstr "" +"Kullanım:\n" +" uninstaller [seçenekler]\n" +"\n" +"Seçenekler:\n" +" --help\t Yardımı görüntüler.\n" +" --list\t Bu Wine yapılandırmasında yüklü bütün uygulamaları listeler.\n" +" --remove {GUID} Belirtilen uygulamayı kaldırır.\n" +"\t\t Uygulama GUID'ini belirlemek için '--list' seçeneğini kullanın.\n" +" [no option] Bu programın grafik sürümünü başlatır.\n" +"\n" #: view.rc:36 msgid "&Pan" @@ -12914,7 +12930,7 @@ #: view.rc:49 msgid "Regular Metafile Viewer" -msgstr "" +msgstr "Genel Meta Dosya Görüntüleyicisi" #: wineboot.rc:31 msgid "Waiting for Program" @@ -12922,7 +12938,7 @@ #: wineboot.rc:35 msgid "Terminate Process" -msgstr "" +msgstr "İşlemi Sonlandır" #: wineboot.rc:36 msgid "" @@ -12952,7 +12968,7 @@ "option) any later version." msgstr "" "Bu program ücretsiz bir yazılım olup; Free Software Foundation tarafından " -"dağıtılan GNU Lesser Genel Kamu Lisansı'nın 2.1 veya (seçimi size bağlı) " +"dağıtılan GNU Kısıtlı Genel Kamu Lisansı'nın 2.1 veya (seçimi size bağlı) " "herhangi sonraki sürümü altında şartlara bağlı kalarak tekrar dağıtabilir ve/" "veya düzenlenebilir." @@ -13085,17 +13101,15 @@ msgstr "Sürücü Harfini Seçin" #: winecfg.rc:232 -#, fuzzy -#| msgid "Wine configuration" msgid "Drive configuration" -msgstr "Wine yapılandırması" +msgstr "Sürücü yapılandırması" #: winecfg.rc:233 msgid "" "Failed to connect to the mount manager, the drive configuration cannot be " "edited." msgstr "" -"Bağlama yöneticisine bağlanılamadı, sürücü yapılandırması düzenlenemez." +"Bağlama yöneticisine bağlanılamadı, sürücü yapılandırması düzenlenemiyor." #: winecfg.rc:236 msgid "&Add..." @@ -13151,7 +13165,7 @@ #: winecfg.rc:270 msgid "Input device:" -msgstr "Girdi aygıtı:" +msgstr "Giriş aygıtı:" #: winecfg.rc:271 msgid "Voice input device:" @@ -13162,14 +13176,12 @@ msgstr "&Ses Testi" #: winecfg.rc:277 winecfg.rc:90 -#, fuzzy -#| msgid "Wine configuration" msgid "Speaker configuration" -msgstr "Wine yapılandırması" +msgstr "Hoparlör yapılandırması" #: winecfg.rc:280 msgid "Speakers:" -msgstr "" +msgstr "Hoparlörler:" #: winecfg.rc:288 msgid "Appearance" @@ -13181,7 +13193,7 @@ #: winecfg.rc:291 msgid "&Install theme..." -msgstr "Tema kur..." +msgstr "Tema yükle..." #: winecfg.rc:296 msgid "It&em:" @@ -13273,25 +13285,23 @@ #: winecfg.rc:88 msgid "(System default)" -msgstr "(Varsayılan sistem)" +msgstr "(Sistem varsayılan)" #: winecfg.rc:91 msgid "5.1 Surround" -msgstr "" +msgstr "5.1 Çevresel" #: winecfg.rc:92 -#, fuzzy -#| msgid "graphic" msgid "Quadraphonic" -msgstr "grafik" +msgstr "Kadrafonik" #: winecfg.rc:93 msgid "Stereo" -msgstr "" +msgstr "Stereo" #: winecfg.rc:94 msgid "Mono" -msgstr "" +msgstr "Mono" #: winecfg.rc:54 msgid "" @@ -13392,13 +13402,11 @@ #: winecfg.rc:77 msgctxt "Drive letter" msgid "Letter" -msgstr "Zarf" +msgstr "Sürücü Harfi" #: winecfg.rc:78 -#, fuzzy -#| msgid "New Folder" msgid "Target folder" -msgstr "Yeni Klasör" +msgstr "Hedef Klasör" #: winecfg.rc:79 msgid "" @@ -13412,11 +13420,11 @@ #: winecfg.rc:99 msgid "Controls Background" -msgstr "Arkaplanı Denetler" +msgstr "Arkaplan Denetimi" #: winecfg.rc:100 msgid "Controls Text" -msgstr "Metni Denetler" +msgstr "Metin Denetimi" #: winecfg.rc:102 msgid "Menu Background" @@ -13436,7 +13444,7 @@ #: winecfg.rc:106 msgid "Selection Text" -msgstr "Seçim Metni" +msgstr "Metin Seçimi" #: winecfg.rc:107 msgid "Tooltip Background" @@ -13456,75 +13464,75 @@ #: winecfg.rc:111 msgid "Active Title Bar" -msgstr "" +msgstr "Etkin Başlık Çubuğu" #: winecfg.rc:112 msgid "Active Title Text" -msgstr "" +msgstr "Etkin Başlık Metni" #: winecfg.rc:113 msgid "Inactive Title Bar" -msgstr "" +msgstr "Etkin Olmayan Başlık Çubuğu" #: winecfg.rc:114 msgid "Inactive Title Text" -msgstr "" +msgstr "Etkin Olmayan Başlık Metni" #: winecfg.rc:115 msgid "Message Box Text" -msgstr "" +msgstr "İleti Kutusu Metni" #: winecfg.rc:116 msgid "Application Workspace" -msgstr "" +msgstr "Uygulama Çalışma Alanı" #: winecfg.rc:117 msgid "Window Frame" -msgstr "" +msgstr "Pencere Çerçevesi" #: winecfg.rc:118 msgid "Active Border" -msgstr "" +msgstr "Etkin Çerçeve" #: winecfg.rc:119 msgid "Inactive Border" -msgstr "" +msgstr "Etkin Olmayan Çerçeve" #: winecfg.rc:120 msgid "Controls Shadow" -msgstr "" +msgstr "Gölge Denetimi" #: winecfg.rc:121 msgid "Gray Text" -msgstr "" +msgstr "Gri Metin" #: winecfg.rc:122 msgid "Controls Highlight" -msgstr "" +msgstr "Belirtme Denetimi" #: winecfg.rc:123 msgid "Controls Dark Shadow" -msgstr "" +msgstr "Koyu Gölge Denetimi" #: winecfg.rc:124 msgid "Controls Light" -msgstr "" +msgstr "Işık Denetimi" #: winecfg.rc:125 msgid "Controls Alternate Background" -msgstr "" +msgstr "Arkaplan Sıra Denetimi" #: winecfg.rc:126 msgid "Hot Tracked Item" -msgstr "" +msgstr "Aktif İzlenen Nesne" #: winecfg.rc:127 msgid "Active Title Bar Gradient" -msgstr "" +msgstr "Etkin Başlık Çubuğu Gradyanı" #: winecfg.rc:128 msgid "Inactive Title Bar Gradient" -msgstr "" +msgstr "Etkin Olmayan Başlık Çubuğu Gradyanı" #: winecfg.rc:129 msgid "Menu Highlight" @@ -13555,16 +13563,12 @@ msgstr "Komut geçmişi" #: wineconsole.rc:69 -#, fuzzy -#| msgid "Buffer zone" msgid "&Buffer size:" -msgstr "Tampon bölge" +msgstr "Tampon boyutu:" #: wineconsole.rc:72 -#, fuzzy -#| msgid "&Remove doubles" msgid "&Remove duplicates" -msgstr "&Çiftleri sil" +msgstr "&Tekrarları sil" #: wineconsole.rc:74 msgid "Popup menu" @@ -13576,25 +13580,19 @@ #: wineconsole.rc:76 msgid "S&hift" -msgstr "&Kaydır" +msgstr "K&aydır" #: wineconsole.rc:78 -#, fuzzy -#| msgid "&Close console" msgid "Console" -msgstr "&Konsolu kapat" +msgstr "Ko&nsol" #: wineconsole.rc:79 -#, fuzzy -#| msgid "Quick edit" msgid "&Quick Edit mode" -msgstr "Hızlı düzenle" +msgstr "&Hızlı düzenleme modu" #: wineconsole.rc:80 -#, fuzzy -#| msgid "&Expert mode" msgid "&Insert mode" -msgstr "&Uzman modu" +msgstr "&Mod ekleyin" #: wineconsole.rc:88 msgid "&Font" @@ -13694,7 +13692,7 @@ #: wineconsole.rc:37 msgid "Each character is %1!u! pixels wide and %2!u! pixels high" -msgstr "" +msgstr "Her karakter %1!u! piksel geniş ve %2!u! piksel yüksek" #: wineconsole.rc:38 msgid "This is a test" @@ -13749,7 +13747,7 @@ #: wineconsole.rc:53 msgid " The Wine program to launch in the console.\n" msgstr "" -" Konsole içerisinde çalıştırılacak Wine programı.\n" +" Konsol içerisinde çalıştırılacak Wine programı.\n" #: wineconsole.rc:54 msgid "" @@ -13783,7 +13781,7 @@ "may want to check the Application " "Database for tips about running this application." msgstr "" -"Bu programdaki veya Wine içerisindeki bir sorundan dolayı olabilir. Bu " +"Bu, programdaki veya Wine içerisindeki bir sorundan dolayı olabilir. Bu " "uygulamayı çalıştırma hakkında ipuçları için Uygulama Veritabanı sayfasını kontrol etmek isteyebilirsiniz." @@ -13802,10 +13800,10 @@ "button, then file a bug report " "and attach that file to the report." msgstr "" -"Eğer bu problem Windows altında yoksa ve henüz rapor edilmemişse, \"Farklı " -"Kaydet\" düğmesi kullanarak ayrıntılı bilgiyi bir dosyaya kaydedebilir; " -"ardından bu dosyayı ekleyerek bir dosya hatası raporu gönderebilirsiniz." +"Eğer bu problem Windows'ta yoksa ve henüz bildirilmemişse, \"Farklı Kaydet\" " +"düğmesi kullanarak ayrıntılı bilgiyi bir dosyaya kaydedebilir; ardından bu " +"dosyayı ekleyerek bir hata raporu gönderebilirsiniz." #: winedbg.rc:38 msgid "Wine program crash" @@ -13937,7 +13935,7 @@ #: winefile.rc:152 msgid "Show Hidden/&System Files" -msgstr "Gizli/Sistem Özellikli Dosyaları &Göster" +msgstr "Gizli Dosyaları/Sistem Dosyalarını &Göster" #: winefile.rc:163 msgid "&File Name:" @@ -14237,7 +14235,7 @@ #: wmic.rc:29 msgid "Error: Alias not found\n" -msgstr "Hata: Sahte isim bulunamadı\n" +msgstr "Hata: Takma ad bulunamadı\n" #: wmic.rc:30 msgid "Error: Invalid query\n" @@ -14555,7 +14553,7 @@ #: wordpad.rc:185 msgid "Finished searching the document." -msgstr "Dokümanı arama tamamlandı." +msgstr "Belgeyi arama tamamlandı." #: wordpad.rc:186 msgid "Failed to load the RichEdit library." @@ -14587,7 +14585,7 @@ #: wordpad.rc:194 msgid "Could not open the file." -msgstr "Dosya açıklamadı." +msgstr "Dosya açılamadı." #: wordpad.rc:195 msgid "You do not have access to open the file." @@ -14595,7 +14593,7 @@ #: wordpad.rc:196 msgid "Printing not implemented." -msgstr "Yazdırma kullanılamıyor." +msgstr "Yazdırma eklenmedi." #: wordpad.rc:197 msgid "Cannot add more than 32 tab stops." diff -Nru wine1.7-1.7.50/po/uk.po wine1.7-1.7.55/po/uk.po --- wine1.7-1.7.50/po/uk.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/uk.po 2015-11-13 14:32:40.000000000 +0000 @@ -5,7 +5,7 @@ "Project-Id-Version: Wine\n" "Report-Msgid-Bugs-To: http://bugs.winehq.org\n" "POT-Creation-Date: N/A\n" -"PO-Revision-Date: 2015-08-19 13:56+0200\n" +"PO-Revision-Date: 2015-10-17 15:42+0200\n" "Last-Translator: Andrey Gusev \n" "Language-Team: Ukrainian\n" "Language: uk\n" @@ -56,20 +56,19 @@ msgstr "Дані підтримки" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "OK" @@ -139,19 +138,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Скасувати" @@ -310,7 +309,7 @@ msgid "&Apply" msgstr "&Застосувати" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "&Довідка" @@ -345,7 +344,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -4847,7 +4846,7 @@ #: winerror.mc:1476 msgid "Newer windows version needed.\n" -msgstr "Необхідна новіша версія windows.\n" +msgstr "Необхідна новіша версія Windows.\n" #: winerror.mc:1481 msgid "Wrong operating system.\n" @@ -7434,72 +7433,72 @@ msgid "Off" msgstr "Вимкнено" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "Вставка об'єкта" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "Тип об'єкта:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "Результат" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "Створити новий" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "Створити елемент управління" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "Створити з файла" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "&Додати елемент управління..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "У вигляді значка" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "Огляд..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "Файл:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "Спеціальна вставка" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "Джерело:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "Вст&авити" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "&Зв'язати" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "&Як:" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "&У вигляді значка" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "З&мінити значок..." @@ -7531,19 +7530,27 @@ msgid "Add Control" msgstr "Додати елемент управління" -#: oledlg.rc:34 +#: oledlg.rc:35 msgid "&Convert..." msgstr "&Конвертувати..." +#: oledlg.rc:36 +msgid "%1 %2 &Object" +msgstr "&Об'єкт %1 %2" + +#: oledlg.rc:34 +msgid "%1 &Object" +msgstr "&Об'єкт %1" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "&Об'єкт" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "Вставка до документа вмісту буфера у форматі: %s." -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." @@ -7551,7 +7558,7 @@ "Вставка до документа вмісту буфера, що дає змогу активувати об'єкт за " "допомогою %s." -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." @@ -7559,7 +7566,7 @@ "Вставка до документа вмісту буфера, що дає змогу активувати об'єкт за " "допомогою %s. Об'єкт буде показано як значок." -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7568,7 +7575,7 @@ "Вставка до документа вмісту буфера у форматі: %s. Дані будуть зв'язані з " "вихідним файлом, що дасть змогу відображувати в документі внесені зміни." -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7577,7 +7584,7 @@ "Вставка до документа зображення вмісту буфера. Зображення буде зв'язане з " "вихідним файлом, що дасть змогу відображувати в документі внесені зміни." -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7587,19 +7594,19 @@ "буде зв'язаний із вихідним файлом, що дасть змогу відображувати в документі " "внесені зміни." -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "Вставка вмісту буфера до документа." -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "Невідомий тип" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "Невідоме джерело" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "програми, яка його створила" @@ -8081,7 +8088,7 @@ msgid "Message" msgstr "Повідомлення" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Так" @@ -8089,7 +8096,7 @@ msgid "Yes to &all" msgstr "Так для &всіх" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&Ні" @@ -8613,23 +8620,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "Нас&тупний\tCtrl+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "П&ерервати" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "По&втор" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Пропустити" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "&Ще спроба" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "П&родовжити" @@ -8972,10 +8979,6 @@ "вільного місця, або що комп'ютер ще підключений до мережі." #: winmm.rc:86 -#, fuzzy -#| msgid "" -#| "Cannot find the specified device. Make sure it is installed or that the " -#| "device name is spelled correctly." msgid "" "Cannot find the specified device. Make sure it is installed and that the " "device name is spelled correctly." @@ -11980,7 +11983,7 @@ msgstr "" "Утиліта реєстрації DLL у Wine\n" "\n" -"Слугує сервісом для реєстрації DLL\n" +"Слугує сервісом для реєстрації DLL.\n" "\n" #: regsvr32.rc:40 @@ -12021,7 +12024,7 @@ #: regsvr32.rc:43 msgid "regsvr32: '%1!S!' not implemented in DLL '%2'\n" -msgstr "regsvr32: %1 не реалізовано у DLL '%2'\n" +msgstr "regsvr32: '%1!S!' не реалізовано у DLL '%2'\n" #: regsvr32.rc:44 msgid "regsvr32: Failed to register DLL '%1'\n" @@ -14346,7 +14349,7 @@ #: wordpad.rc:64 msgid "&Def. char format" -msgstr "Формат символів &за замовч." +msgstr "Формат символів &за замовчуванням" #: wordpad.rc:65 msgid "Paragrap&h format" diff -Nru wine1.7-1.7.50/po/wa.po wine1.7-1.7.55/po/wa.po --- wine1.7-1.7.50/po/wa.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/wa.po 2015-11-13 14:32:40.000000000 +0000 @@ -57,20 +57,19 @@ msgstr "Informåcion" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "I Va" @@ -137,19 +136,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "Rinoncî" @@ -301,7 +300,7 @@ msgid "&Apply" msgstr "&Mete èn Oûve" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "" @@ -337,7 +336,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7320,73 +7319,73 @@ msgid "Off" msgstr "" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "" -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "" -#: oledlg.rc:74 +#: oledlg.rc:76 #, fuzzy msgid "File:" msgstr "&Fitchî" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "C&laper" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "" @@ -7414,7 +7413,7 @@ msgid "Add Control" msgstr "" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy msgid "&Convert..." msgstr "" @@ -7423,60 +7422,68 @@ "#-#-#-#-# wa.po (Wine) #-#-#-#-#\n" "&Font..." +#: oledlg.rc:36 +msgid "%1 %2 &Object" +msgstr "" + +#: oledlg.rc:34 +msgid "%1 &Object" +msgstr "" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "" -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." msgstr "" -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." msgstr "" -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " "your document." msgstr "" -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " "in your document." msgstr "" -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " "be reflected in your document." msgstr "" -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "" -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "" @@ -7968,7 +7975,7 @@ msgid "Message" msgstr "" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "&Oyi" @@ -7976,7 +7983,7 @@ msgid "Yes to &all" msgstr "" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "&Neni" @@ -8484,23 +8491,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "&Rinoncî" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "Ri&peter" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "&Passer hute" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "" diff -Nru wine1.7-1.7.50/po/wine.pot wine1.7-1.7.55/po/wine.pot --- wine1.7-1.7.50/po/wine.pot 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/wine.pot 2015-11-13 14:32:40.000000000 +0000 @@ -49,20 +49,19 @@ msgstr "" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "" @@ -125,19 +124,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "" @@ -286,7 +285,7 @@ msgid "&Apply" msgstr "" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "" @@ -321,7 +320,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7185,72 +7184,72 @@ msgid "Off" msgstr "" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "" -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "" -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "" @@ -7278,64 +7277,72 @@ msgid "Add Control" msgstr "" -#: oledlg.rc:34 +#: oledlg.rc:35 msgid "&Convert..." msgstr "" +#: oledlg.rc:36 +msgid "%1 %2 &Object" +msgstr "" + +#: oledlg.rc:34 +msgid "%1 &Object" +msgstr "" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "" -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." msgstr "" -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." msgstr "" -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " "your document." msgstr "" -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " "in your document." msgstr "" -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " "be reflected in your document." msgstr "" -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "" -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "" @@ -7815,7 +7822,7 @@ msgid "Message" msgstr "" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "" @@ -7823,7 +7830,7 @@ msgid "Yes to &all" msgstr "" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "" @@ -8318,23 +8325,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "" diff -Nru wine1.7-1.7.50/po/zh_CN.po wine1.7-1.7.55/po/zh_CN.po --- wine1.7-1.7.50/po/zh_CN.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/zh_CN.po 2015-11-13 14:32:40.000000000 +0000 @@ -52,20 +52,19 @@ msgstr "技术支持信息" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "确定" @@ -132,19 +131,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "取消" @@ -297,7 +296,7 @@ msgid "&Apply" msgstr "应用(&A)" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "帮助" @@ -332,7 +331,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7278,72 +7277,72 @@ msgid "Off" msgstr "关" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "插入对象" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "对象类型:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "结果" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "新建" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "建立控件" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "建立于文件" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "添加控件(&A)..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "显示为图标" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "浏览..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "文件:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "特殊粘贴" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "源文件:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "粘贴(&P)" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "粘贴链接(&L)" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "为(&A):" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "显示为图标(&D)" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "改变图标(&I)..." @@ -7372,34 +7371,46 @@ msgid "Add Control" msgstr "添加控件" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "字体(&F)..." +#: oledlg.rc:36 +#, fuzzy +#| msgid "&Object" +msgid "%1 %2 &Object" +msgstr "对象(&O)" + +#: oledlg.rc:34 +#, fuzzy +#| msgid "&Object" +msgid "%1 &Object" +msgstr "对象(&O)" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "对象(&O)" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "将剪贴板的内容以 %s 插入到你的文件。" -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." msgstr "将剪贴板的内容插入到你的文件以便你可以使用 %s。" -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." msgstr "" "将剪贴板的内容插入到你的文件,你可以用 %s 激活它。插入的内容会显示为图标。" -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7408,7 +7419,7 @@ "将剪贴板的内容以 %s 插入到你的文件。 数据是链接到源文件的, 对源文件的任何改动" "都会反映到反映到你的文档中。" -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7417,7 +7428,7 @@ "插入剪贴板中的图片。图片是链接到源文件的,对源文件的任何改动都会反映到你的文" "档中。" -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7426,19 +7437,19 @@ "插入指向剪贴板中文件的快捷方式。快捷方式是链接到源文件的,对源文件的任何改动" "都会反映到你的文档中。" -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "将剪贴板的内容插入到你的文件。" -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "不明类型" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "不明来源" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "不明应用程序" @@ -7918,7 +7929,7 @@ msgid "Message" msgstr "消息" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "是(&Y)" @@ -7926,7 +7937,7 @@ msgid "Yes to &all" msgstr "全部选是 (&A)" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "否(&N)" @@ -8433,23 +8444,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "中止(&A)" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "重试(&R)" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "忽略(&I)" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "再试(&T)" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "继续(&C)" diff -Nru wine1.7-1.7.50/po/zh_TW.po wine1.7-1.7.55/po/zh_TW.po --- wine1.7-1.7.50/po/zh_TW.po 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/po/zh_TW.po 2015-11-13 14:32:40.000000000 +0000 @@ -55,20 +55,19 @@ msgstr "技術支援資訊" #: appwiz.rc:78 avifil32.rc:54 comctl32.rc:55 comdlg32.rc:231 comdlg32.rc:261 -#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 -#: credui.rc:52 cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 -#: ieframe.rc:96 localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 -#: mshtml.rc:47 mshtml.rc:57 msvfw32.rc:36 oledlg.rc:60 oledlg.rc:92 -#: serialui.rc:41 setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 -#: shell32.rc:340 shlwapi.rc:44 user32.rc:80 user32.rc:98 wininet.rc:51 -#: wininet.rc:71 winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 -#: oleview.rc:175 progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 -#: progman.rc:180 progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 -#: regedit.rc:271 regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 -#: taskmgr.rc:517 winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 -#: winefile.rc:131 winefile.rc:154 winefile.rc:184 winemine.rc:71 -#: winemine.rc:81 winemine.rc:95 wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 -#: wordpad.rc:249 +#: comdlg32.rc:304 comdlg32.rc:358 comdlg32.rc:397 comdlg32.rc:451 credui.rc:52 +#: cryptui.rc:263 cryptui.rc:275 cryptui.rc:365 dinput.rc:46 ieframe.rc:96 +#: localui.rc:44 localui.rc:57 mpr.rc:49 msacm32.rc:53 mshtml.rc:47 +#: mshtml.rc:57 msvfw32.rc:36 oledlg.rc:62 oledlg.rc:94 serialui.rc:41 +#: setupapi.rc:59 shell32.rc:276 shell32.rc:300 shell32.rc:322 shell32.rc:340 +#: shlwapi.rc:44 user32.rc:83 user32.rc:98 wininet.rc:51 wininet.rc:71 +#: winspool.rc:42 net.rc:47 notepad.rc:117 oleview.rc:162 oleview.rc:175 +#: progman.rc:106 progman.rc:124 progman.rc:142 progman.rc:158 progman.rc:180 +#: progman.rc:199 progman.rc:216 regedit.rc:247 regedit.rc:258 regedit.rc:271 +#: regedit.rc:287 regedit.rc:300 regedit.rc:313 taskmgr.rc:442 taskmgr.rc:517 +#: winecfg.rc:214 winecfg.rc:224 wineconsole.rc:135 winefile.rc:131 +#: winefile.rc:154 winefile.rc:184 winemine.rc:71 winemine.rc:81 winemine.rc:95 +#: wordpad.rc:207 wordpad.rc:218 wordpad.rc:236 wordpad.rc:249 msgid "OK" msgstr "確定" @@ -136,19 +135,19 @@ #: comctl32.rc:71 comdlg32.rc:170 comdlg32.rc:192 comdlg32.rc:210 #: comdlg32.rc:232 comdlg32.rc:262 comdlg32.rc:305 comdlg32.rc:327 #: comdlg32.rc:347 comdlg32.rc:359 comdlg32.rc:398 comdlg32.rc:452 -#: comdlg32.rc:477 comdlg32.rc:495 credui.rc:53 cryptui.rc:264 cryptui.rc:276 +#: comdlg32.rc:477 comdlg32.rc:500 credui.rc:53 cryptui.rc:264 cryptui.rc:276 #: cryptui.rc:366 dinput.rc:47 ieframe.rc:97 inetcpl.rc:81 localui.rc:45 #: localui.rc:58 mpr.rc:50 msacm32.rc:54 mshtml.rc:48 mshtml.rc:58 -#: msvfw32.rc:37 oledlg.rc:61 oledlg.rc:93 serialui.rc:42 setupapi.rc:42 +#: msvfw32.rc:37 oledlg.rc:63 oledlg.rc:95 serialui.rc:42 setupapi.rc:42 #: setupapi.rc:60 shell32.rc:277 shell32.rc:301 shell32.rc:312 shell32.rc:341 -#: shlwapi.rc:45 user32.rc:81 user32.rc:99 wininet.rc:52 wininet.rc:72 +#: shlwapi.rc:45 user32.rc:84 user32.rc:99 wininet.rc:52 wininet.rc:72 #: winspool.rc:43 notepad.rc:118 oleview.rc:163 oleview.rc:176 progman.rc:107 #: progman.rc:125 progman.rc:143 progman.rc:159 progman.rc:181 progman.rc:200 #: progman.rc:217 regedit.rc:248 regedit.rc:259 regedit.rc:272 regedit.rc:288 #: regedit.rc:301 regedit.rc:314 taskmgr.rc:443 taskmgr.rc:518 wineboot.rc:34 #: winecfg.rc:215 winecfg.rc:225 wineconsole.rc:136 winefile.rc:132 -#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 -#: wordpad.rc:219 wordpad.rc:237 wordpad.rc:250 +#: winefile.rc:155 winefile.rc:185 winemine.rc:96 wordpad.rc:208 wordpad.rc:219 +#: wordpad.rc:237 wordpad.rc:250 msgid "Cancel" msgstr "取消" @@ -302,7 +301,7 @@ msgid "&Apply" msgstr "套用(&A)" -#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:89 +#: comctl32.rc:58 comctl32.rc:72 comdlg32.rc:306 user32.rc:88 msgid "Help" msgstr "說明" @@ -337,7 +336,7 @@ #: comctl32.rc:86 comdlg32.rc:171 comdlg32.rc:193 comdlg32.rc:264 #: comdlg32.rc:328 comdlg32.rc:348 comdlg32.rc:360 comdlg32.rc:478 -#: comdlg32.rc:496 ieframe.rc:58 msacm32.rc:52 oledlg.rc:94 shell32.rc:128 +#: comdlg32.rc:501 ieframe.rc:58 msacm32.rc:52 oledlg.rc:96 shell32.rc:128 #: clock.rc:44 notepad.rc:60 notepad.rc:119 oleview.rc:72 progman.rc:55 #: progman.rc:108 progman.rc:126 progman.rc:144 progman.rc:160 progman.rc:184 #: progman.rc:202 progman.rc:219 regedit.rc:79 taskmgr.rc:87 winefile.rc:82 @@ -7364,72 +7363,72 @@ msgid "Off" msgstr "關" -#: oledlg.rc:53 +#: oledlg.rc:55 msgid "Insert Object" msgstr "插入物件" -#: oledlg.rc:59 +#: oledlg.rc:61 msgid "Object Type:" msgstr "物件類型:" -#: oledlg.rc:62 oledlg.rc:100 +#: oledlg.rc:64 oledlg.rc:102 msgid "Result" msgstr "結果" -#: oledlg.rc:63 +#: oledlg.rc:65 msgid "Create New" msgstr "新增" -#: oledlg.rc:65 +#: oledlg.rc:67 msgid "Create Control" msgstr "建立控制項" -#: oledlg.rc:67 +#: oledlg.rc:69 msgid "Create From File" msgstr "建立於檔案" -#: oledlg.rc:70 +#: oledlg.rc:72 msgid "&Add Control..." msgstr "新增控制項(&A)..." -#: oledlg.rc:71 +#: oledlg.rc:73 msgid "Display As Icon" msgstr "顯示為圖示" -#: oledlg.rc:73 setupapi.rc:61 +#: oledlg.rc:75 setupapi.rc:61 msgid "Browse..." msgstr "瀏覽..." -#: oledlg.rc:74 +#: oledlg.rc:76 msgid "File:" msgstr "檔案:" -#: oledlg.rc:80 +#: oledlg.rc:82 msgid "Paste Special" msgstr "特殊貼上" -#: oledlg.rc:83 setupapi.rc:43 +#: oledlg.rc:85 setupapi.rc:43 msgid "Source:" msgstr "原始檔案:" -#: oledlg.rc:84 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 +#: oledlg.rc:86 shdoclc.rc:50 shdoclc.rc:82 shdoclc.rc:95 shdoclc.rc:135 #: shdoclc.rc:162 shdoclc.rc:186 user32.rc:62 wineconsole.rc:33 wordpad.rc:106 msgid "&Paste" msgstr "貼上(&P)" -#: oledlg.rc:86 +#: oledlg.rc:88 msgid "Paste &Link" msgstr "貼上連結(&L)" -#: oledlg.rc:88 +#: oledlg.rc:90 msgid "&As:" msgstr "為(&A):" -#: oledlg.rc:95 +#: oledlg.rc:97 msgid "&Display As Icon" msgstr "顯示為圖示(&D)" -#: oledlg.rc:97 +#: oledlg.rc:99 msgid "Change &Icon..." msgstr "變更圖示(&I)..." @@ -7457,33 +7456,45 @@ msgid "Add Control" msgstr "加入控制項" -#: oledlg.rc:34 +#: oledlg.rc:35 #, fuzzy #| msgid "&Font..." msgid "&Convert..." msgstr "字型(&F)..." +#: oledlg.rc:36 +#, fuzzy +#| msgid "&Object" +msgid "%1 %2 &Object" +msgstr "物件(&O)" + +#: oledlg.rc:34 +#, fuzzy +#| msgid "&Object" +msgid "%1 &Object" +msgstr "物件(&O)" + #: oledlg.rc:33 oleview.rc:40 msgid "&Object" msgstr "物件(&O)" -#: oledlg.rc:39 +#: oledlg.rc:41 msgid "Inserts the contents of the clipboard into your document as %s." msgstr "將剪貼簿的內容以 %s 插入至您的檔案。" -#: oledlg.rc:40 +#: oledlg.rc:42 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s." msgstr "將剪貼簿的內容插入到您的檔案以便您可以使用 %s。" -#: oledlg.rc:41 +#: oledlg.rc:43 msgid "" "Inserts the contents of the clipboard into your document so that you can " "activate it using %s. It will be displayed as an icon." msgstr "將剪貼簿的內容插入到您的文件以便您可以用 %s 啟動它, 一般顯示為圖示。" -#: oledlg.rc:42 +#: oledlg.rc:44 msgid "" "Inserts the contents of the clipboard into your document as %s. The data is " "linked to the source file so that changes to the file will be reflected in " @@ -7492,7 +7503,7 @@ "將剪貼簿的內容以 %s 插入到您的文件。 資料是連結到來源檔案的, 對來源檔案的任何" "變更都會影響到您的文件。" -#: oledlg.rc:43 +#: oledlg.rc:45 msgid "" "Inserts a picture of the clipboard contents into your document. The picture " "is linked to the source file so that changes to the file will be reflected " @@ -7501,7 +7512,7 @@ "將剪貼簿的圖片插入到您的文件。 圖片是連結到來源檔案的, 對來源檔案的任何變更都" "會影響到您的文件。" -#: oledlg.rc:44 +#: oledlg.rc:46 msgid "" "Inserts a shortcut which points to the location of the clipboard contents. " "The shortcut is linked to the source file so that changes to the file will " @@ -7510,19 +7521,19 @@ "將剪貼簿的捷徑插入到您的檔案。 捷徑是連結到來源檔案的, 對來源檔案的任何變更都" "會影響到您的檔案。" -#: oledlg.rc:45 +#: oledlg.rc:47 msgid "Inserts the contents of the clipboard into your document." msgstr "將剪貼簿的內容插入到您的文件。" -#: oledlg.rc:46 +#: oledlg.rc:48 msgid "Unknown Type" msgstr "不明類型" -#: oledlg.rc:47 +#: oledlg.rc:49 msgid "Unknown Source" msgstr "不明來源" -#: oledlg.rc:48 +#: oledlg.rc:50 msgid "the program which created it" msgstr "不明應用程式" @@ -8004,7 +8015,7 @@ msgid "Message" msgstr "訊息" -#: shell32.rc:309 shlwapi.rc:46 user32.rc:85 +#: shell32.rc:309 shlwapi.rc:46 user32.rc:79 msgid "&Yes" msgstr "是(&Y)" @@ -8012,7 +8023,7 @@ msgid "Yes to &all" msgstr "全部皆是(&A)" -#: shell32.rc:311 shlwapi.rc:47 user32.rc:86 +#: shell32.rc:311 shlwapi.rc:47 user32.rc:80 msgid "&No" msgstr "否(&N)" @@ -8533,23 +8544,23 @@ msgid "Nex&t\tCtrl+F6" msgstr "下一個(&T)\tCtrl+F6" -#: user32.rc:82 +#: user32.rc:81 msgid "&Abort" msgstr "中止(&A)" -#: user32.rc:83 +#: user32.rc:82 msgid "&Retry" msgstr "重試(&R)" -#: user32.rc:84 +#: user32.rc:85 msgid "&Ignore" msgstr "忽略(&I)" -#: user32.rc:87 +#: user32.rc:86 msgid "&Try Again" msgstr "再試(&T)" -#: user32.rc:88 +#: user32.rc:87 msgid "&Continue" msgstr "繼續(&C)" diff -Nru wine1.7-1.7.50/programs/cmd/builtins.c wine1.7-1.7.55/programs/cmd/builtins.c --- wine1.7-1.7.50/programs/cmd/builtins.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/cmd/builtins.c 2015-11-13 14:32:40.000000000 +0000 @@ -1005,7 +1005,7 @@ if (!srcisdevice) FindClose (hff); } else { /* Error if the first file was not found */ - if (!anyconcats || (anyconcats && !writtenoneconcat)) { + if (!anyconcats || !writtenoneconcat) { WCMD_print_error (); errorlevel = 1; } diff -Nru wine1.7-1.7.50/programs/cmd/tests/batch.c wine1.7-1.7.55/programs/cmd/tests/batch.c --- wine1.7-1.7.50/programs/cmd/tests/batch.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/cmd/tests/batch.c 2015-11-13 14:32:40.000000000 +0000 @@ -320,13 +320,14 @@ /* If we rewind to the beginning of the line, don't increment line number */ line--; } - else if (!is_exp_resync || (is_exp_resync && !err)) + else if (!is_exp_resync || !err) { exp_ptr = exp_nl+1; if(exp_nl+1 < exp_data+exp_size && exp_nl[0] == '\r' && exp_nl[1] == '\n') exp_ptr++; } - if (!is_out_resync || (is_out_resync && !err)) + + if (!is_out_resync || !err) { out_ptr = out_nl+1; if(out_nl+1 < out_data+out_size && out_nl[0] == '\r' && out_nl[1] == '\n') diff -Nru wine1.7-1.7.50/programs/cmd/wcmdmain.c wine1.7-1.7.55/programs/cmd/wcmdmain.c --- wine1.7-1.7.50/programs/cmd/wcmdmain.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/cmd/wcmdmain.c 2015-11-13 14:32:40.000000000 +0000 @@ -879,7 +879,7 @@ if (startchar == '%' && forvaridx != -1 && forloopcontext.variable[forvaridx]) { /* Replace the 2 characters, % and for variable character */ WCMD_strsubstW(p, p + 2, forloopcontext.variable[forvaridx], -1); - } else if (!atExecute || (atExecute && startchar == '!')) { + } else if (!atExecute || startchar == '!') { p = WCMD_expand_envvar(p, startchar); /* In a FOR loop, see if this is the variable to replace */ diff -Nru wine1.7-1.7.50/programs/msiexec/Makefile.in wine1.7-1.7.55/programs/msiexec/Makefile.in --- wine1.7-1.7.50/programs/msiexec/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/msiexec/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -11,3 +11,5 @@ MANPAGES = msiexec.man.in SVG_SRCS = msiexec.svg + +INSTALL_LIB = msiexec.exe msiexec diff -Nru wine1.7-1.7.50/programs/msiexec/msiexec.c wine1.7-1.7.55/programs/msiexec/msiexec.c --- wine1.7-1.7.50/programs/msiexec/msiexec.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/msiexec/msiexec.c 2015-11-13 14:32:40.000000000 +0000 @@ -886,10 +886,6 @@ { InstallUILevel = INSTALLUILEVEL_NONE; } - else if(msi_strequal(argvW[i]+2, "b")) - { - InstallUILevel = INSTALLUILEVEL_BASIC; - } else if(msi_strequal(argvW[i]+2, "r")) { InstallUILevel = INSTALLUILEVEL_REDUCED; @@ -902,28 +898,25 @@ { InstallUILevel = INSTALLUILEVEL_NONE|INSTALLUILEVEL_ENDDIALOG; } - else if(msi_strequal(argvW[i]+2, "b+")) - { - InstallUILevel = INSTALLUILEVEL_BASIC|INSTALLUILEVEL_ENDDIALOG; - } - else if(msi_strequal(argvW[i]+2, "b-")) - { - InstallUILevel = INSTALLUILEVEL_BASIC|INSTALLUILEVEL_PROGRESSONLY; - } - else if(msi_strequal(argvW[i]+2, "b+!")) - { - WINE_FIXME("Unhandled modifier: !\n"); - InstallUILevel = INSTALLUILEVEL_BASIC|INSTALLUILEVEL_ENDDIALOG|INSTALLUILEVEL_HIDECANCEL; - } - else if(msi_strequal(argvW[i]+2, "b-!")) - { - WINE_FIXME("Unhandled modifier: !\n"); - InstallUILevel = INSTALLUILEVEL_BASIC|INSTALLUILEVEL_PROGRESSONLY|INSTALLUILEVEL_HIDECANCEL; - } - else if(msi_strequal(argvW[i]+2, "b!")) + else if(msi_strprefix(argvW[i]+2, "b")) { - WINE_FIXME("Unhandled modifier: !\n"); - InstallUILevel = INSTALLUILEVEL_BASIC|INSTALLUILEVEL_HIDECANCEL; + const WCHAR *ptr = argvW[i] + 3; + + InstallUILevel = INSTALLUILEVEL_BASIC; + + while (*ptr) + { + if (msi_strprefix(ptr, "+")) + InstallUILevel |= INSTALLUILEVEL_ENDDIALOG; + if (msi_strprefix(ptr, "-")) + InstallUILevel |= INSTALLUILEVEL_PROGRESSONLY; + if (msi_strprefix(ptr, "!")) + { + WINE_FIXME("Unhandled modifier: !\n"); + InstallUILevel |= INSTALLUILEVEL_HIDECANCEL; + } + ptr++; + } } else { @@ -931,6 +924,14 @@ wine_dbgstr_w(argvW[i]+2)); } } + else if(msi_option_equal(argvW[i], "passive")) + { + static const WCHAR rebootpromptW[] = + {'R','E','B','O','O','T','P','R','O','M','P','T','=','"','S','"',0}; + + InstallUILevel = INSTALLUILEVEL_BASIC|INSTALLUILEVEL_PROGRESSONLY|INSTALLUILEVEL_HIDECANCEL; + StringListAppend(&property_list, rebootpromptW); + } else if(msi_option_equal(argvW[i], "y")) { FunctionDllRegisterServer = TRUE; diff -Nru wine1.7-1.7.50/programs/notepad/main.c wine1.7-1.7.55/programs/notepad/main.c --- wine1.7-1.7.50/programs/notepad/main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/notepad/main.c 2015-11-13 14:32:40.000000000 +0000 @@ -702,9 +702,18 @@ { switch (AlertFileDoesNotExist(file_name)) { case IDYES: + { + + HANDLE file; SetFileNameAndEncoding(file_name, ENCODING_ANSI); + + file = CreateFileW(file_name, GENERIC_WRITE, FILE_SHARE_WRITE, + NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + if (file != INVALID_HANDLE_VALUE) CloseHandle(file); + UpdateWindowCaption(); break; + } case IDNO: break; diff -Nru wine1.7-1.7.50/programs/notepad/Makefile.in wine1.7-1.7.55/programs/notepad/Makefile.in --- wine1.7-1.7.50/programs/notepad/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/notepad/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -11,3 +11,5 @@ MANPAGES = notepad.man.in SVG_SRCS = notepad.svg + +INSTALL_LIB = notepad.exe notepad diff -Nru wine1.7-1.7.50/programs/oleview/details.c wine1.7-1.7.55/programs/oleview/details.c --- wine1.7-1.7.50/programs/oleview/details.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/oleview/details.c 2015-11-13 14:32:40.000000000 +0000 @@ -397,7 +397,8 @@ memset(&wcd, 0, sizeof(WNDCLASSW)); wcd.lpfnWndProc = DetailsProc; wcd.lpszClassName = wszDetailsClass; - wcd.hbrBackground = (HBRUSH)COLOR_WINDOW; + wcd.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); + wcd.hCursor = LoadCursorW(0, (LPCWSTR)IDC_ARROW); if(!RegisterClassW(&wcd)) return NULL; diff -Nru wine1.7-1.7.50/programs/oleview/oleview.c wine1.7-1.7.55/programs/oleview/oleview.c --- wine1.7-1.7.50/programs/oleview/oleview.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/oleview/oleview.c 2015-11-13 14:32:40.000000000 +0000 @@ -422,7 +422,7 @@ LoadStringW(globals.hMainInst, IDS_OPEN, wszTitle, sizeof(wszTitle)/sizeof(wszTitle[0])); LoadStringW(globals.hMainInst, IDS_OPEN_FILTER_TYPELIB, filter_typelib, sizeof(filter_typelib)/sizeof(WCHAR)); LoadStringW(globals.hMainInst, IDS_OPEN_FILTER_ALL, filter_all, sizeof(filter_all)/sizeof(WCHAR)); - snprintfW( filter, MAX_PATH, filterW, filter_typelib, 0, 0, filter_all, 0, 0 ); + wsprintfW( filter, filterW, filter_typelib, 0, 0, filter_all, 0, 0 ); InitOpenFileName(hWnd, &ofn, filter, wszTitle, wszName); if(GetOpenFileNameW(&ofn)) CreateTypeLibWindow(globals.hMainInst, wszName); break; @@ -499,6 +499,7 @@ memset(&wc, 0, sizeof(WNDCLASSW)); wc.lpfnWndProc = WndProc; wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); + wc.hCursor = LoadCursorW(0, (LPCWSTR)IDC_ARROW); wc.lpszMenuName = MAKEINTRESOURCEW(IDM_MENU); wc.lpszClassName = wszAppName; @@ -557,12 +558,9 @@ { MSG msg; HANDLE hAccelTable; - - if(!hPrevInst) - { - if(!InitApplication(hInst)) - return FALSE; - } + + if(!InitApplication(hInst)) + return FALSE; if(!InitInstance(hInst, nCmdShow)) return FALSE; diff -Nru wine1.7-1.7.50/programs/oleview/pane.c wine1.7-1.7.55/programs/oleview/pane.c --- wine1.7-1.7.50/programs/oleview/pane.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/oleview/pane.c 2015-11-13 14:32:40.000000000 +0000 @@ -135,7 +135,8 @@ memset(&wcc, 0, sizeof(WNDCLASSW)); wcc.lpfnWndProc = PaneProc; - wcc.hbrBackground = (HBRUSH)(COLOR_WINDOW); + wcc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); + wcc.hCursor = LoadCursorW(0, (LPCWSTR)IDC_ARROW); wcc.lpszClassName = wszPaneClass; if(!RegisterClassW(&wcc)) diff -Nru wine1.7-1.7.50/programs/oleview/tree.c wine1.7-1.7.55/programs/oleview/tree.c --- wine1.7-1.7.50/programs/oleview/tree.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/oleview/tree.c 2015-11-13 14:32:40.000000000 +0000 @@ -82,7 +82,7 @@ tvis.hParent = item; tvis.hInsertAfter = TVI_LAST; - SendMessageW(globals.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi); + if (!SendMessageW(globals.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi)) return; if(!tvi.lParam || ((ITEM_INFO *)tvi.lParam)->loaded || !(((ITEM_INFO *)tvi.lParam)->cFlag&SHOWALL)) return; @@ -154,9 +154,7 @@ while(hCur) { tvi.hItem = hCur; - SendMessageW(globals.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi); - - if(!tvi.lParam) + if(!SendMessageW(globals.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi) || !tvi.lParam) { hCur = (HTREEITEM)SendMessageW(globals.hTree, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)hCur); @@ -192,9 +190,7 @@ memset(&tvi, 0, sizeof(TVITEMW)); tvi.hItem = item; - SendMessageW(globals.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi); - - if(!tvi.lParam) return; + if(!SendMessageW(globals.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi) || !tvi.lParam) return; pU = ((ITEM_INFO *)tvi.lParam)->pU; @@ -223,18 +219,18 @@ { TVITEMW tvi; int bufLen; - BOOL ret; + BOOL ret = FALSE; memset(buffer, 0, bufSize * sizeof(WCHAR)); memset(&tvi, 0, sizeof(TVITEMW)); tvi.hItem = item; - SendMessageW(globals.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi); - ret = (tvi.lParam && ((ITEM_INFO *)tvi.lParam)->cFlag & REGPATH); + if (SendMessageW(globals.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi)) + ret = (tvi.lParam && ((ITEM_INFO *)tvi.lParam)->cFlag & REGPATH); while(TRUE) { - SendMessageW(globals.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi); + if(!SendMessageW(globals.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi)) break; if(tvi.lParam && (((ITEM_INFO *)tvi.lParam)->cFlag & (REGPATH|REGTOP))) { @@ -318,7 +314,7 @@ while(curSearch) { tvi.hItem = curSearch; - SendMessageW(globals.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi); + if(!SendMessageW(globals.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi)) break; if(tvi.lParam && !lstrcmpW(((ITEM_INFO *)tvi.lParam)->info, wszComp)) { @@ -631,15 +627,13 @@ TVM_GETNEXTITEM, TVGN_PARENT, (LPARAM)del); tvi.hItem = del; - SendMessageW(globals.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi); - - if(tvi.lParam) + if(SendMessageW(globals.hTree, TVM_GETITEMW, 0, (LPARAM)&tvi) && tvi.lParam) { if(((ITEM_INFO *)tvi.lParam)->loaded) ReleaseInst(del); HeapFree(GetProcessHeap(), 0, (ITEM_INFO *)tvi.lParam); - } - SendMessageW(globals.hTree, TVM_DELETEITEM, 0, (LPARAM)del); + SendMessageW(globals.hTree, TVM_DELETEITEM, 0, (LPARAM)del); + } if(!cur) break; } @@ -703,6 +697,8 @@ memset(&wct, 0, sizeof(WNDCLASSW)); wct.lpfnWndProc = TreeProc; wct.lpszClassName = wszTreeClass; + wct.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); + wct.hCursor = LoadCursorW(0, (LPCWSTR)IDC_ARROW); if(!RegisterClassW(&wct)) return NULL; diff -Nru wine1.7-1.7.50/programs/oleview/typelib.c wine1.7-1.7.55/programs/oleview/typelib.c --- wine1.7-1.7.50/programs/oleview/typelib.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/oleview/typelib.c 2015-11-13 14:32:40.000000000 +0000 @@ -1626,6 +1626,7 @@ memset(&wcc, 0, sizeof(WNDCLASSW)); wcc.lpfnWndProc = TypeLibProc; wcc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); + wcc.hCursor = LoadCursorW(0, (LPCWSTR)IDC_ARROW); wcc.lpszMenuName = MAKEINTRESOURCEW(IDM_TYPELIB); wcc.lpszClassName = wszTypeLib; diff -Nru wine1.7-1.7.50/programs/reg/reg.c wine1.7-1.7.55/programs/reg/reg.c --- wine1.7-1.7.50/programs/reg/reg.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/reg/reg.c 2015-11-13 14:32:40.000000000 +0000 @@ -22,6 +22,32 @@ #define ARRAY_SIZE(A) (sizeof(A)/sizeof(*A)) +static const WCHAR short_hklm[] = {'H','K','L','M',0}; +static const WCHAR short_hkcu[] = {'H','K','C','U',0}; +static const WCHAR short_hkcr[] = {'H','K','C','R',0}; +static const WCHAR short_hku[] = {'H','K','U',0}; +static const WCHAR short_hkcc[] = {'H','K','C','C',0}; +static const WCHAR long_hklm[] = {'H','K','E','Y','_','L','O','C','A','L','_','M','A','C','H','I','N','E',0}; +static const WCHAR long_hkcu[] = {'H','K','E','Y','_','C','U','R','R','E','N','T','_','U','S','E','R',0}; +static const WCHAR long_hkcr[] = {'H','K','E','Y','_','C','L','A','S','S','E','S','_','R','O','O','T',0}; +static const WCHAR long_hku[] = {'H','K','E','Y','_','U','S','E','R','S',0}; +static const WCHAR long_hkcc[] = {'H','K','E','Y','_','C','U','R','R','E','N','T','_','C','O','N','F','I','G',0}; + +static const struct +{ + HKEY key; + const WCHAR *short_name; + const WCHAR *long_name; +} +root_rels[] = +{ + {HKEY_LOCAL_MACHINE, short_hklm, long_hklm}, + {HKEY_CURRENT_USER, short_hkcu, long_hkcu}, + {HKEY_CLASSES_ROOT, short_hkcr, long_hkcr}, + {HKEY_USERS, short_hku, long_hku}, + {HKEY_CURRENT_CONFIG, short_hkcc, long_hkcc}, +}; + static const WCHAR type_none[] = {'R','E','G','_','N','O','N','E',0}; static const WCHAR type_sz[] = {'R','E','G','_','S','Z',0}; static const WCHAR type_expand_sz[] = {'R','E','G','_','E','X','P','A','N','D','_','S','Z',0}; @@ -95,51 +121,26 @@ return reg_printfW(formatW, msg_buffer); } -static int reg_StrCmpNIW(LPCWSTR str, LPCWSTR comp, int len) +static inline BOOL path_rootname_cmp(const WCHAR *input_path, const WCHAR *rootkey_name) { - int i; + DWORD length = strlenW(rootkey_name); - for (i = 0; i < len; i++) - { - if (!str[i]) - { - len = i + 1; - break; - } - } - - return CompareStringW(CP_ACP, NORM_IGNORECASE, str, len, comp, len) - CSTR_EQUAL; + return (!strncmpiW(input_path, rootkey_name, length) && + (input_path[length] == 0 || input_path[length] == '\\')); } -static HKEY get_rootkey(LPWSTR key) +static HKEY path_get_rootkey(const WCHAR *path) { - static const WCHAR szHKLM[] = {'H','K','L','M',0}; - static const WCHAR szHKEY_LOCAL_MACHINE[] = {'H','K','E','Y','_','L','O','C','A','L','_','M','A','C','H','I','N','E',0}; - static const WCHAR szHKCU[] = {'H','K','C','U',0}; - static const WCHAR szHKEY_CURRENT_USER[] = {'H','K','E','Y','_','C','U','R','R','E','N','T','_','U','S','E','R',0}; - static const WCHAR szHKCR[] = {'H','K','C','R',0}; - static const WCHAR szHKEY_CLASSES_ROOT[] = {'H','K','E','Y','_','C','L','A','S','S','E','S','_','R','O','O','T',0}; - static const WCHAR szHKU[] = {'H','K','U',0}; - static const WCHAR szHKEY_USERS[] = {'H','K','E','Y','_','U','S','E','R','S',0}; - static const WCHAR szHKCC[] = {'H','K','C','C',0}; - static const WCHAR szHKEY_CURRENT_CONFIG[] = {'H','K','E','Y','_','C','U','R','R','E','N','T','_','C','O','N','F','I','G',0}; - - if (!reg_StrCmpNIW(key, szHKLM, 4) || - !reg_StrCmpNIW(key, szHKEY_LOCAL_MACHINE, 18)) - return HKEY_LOCAL_MACHINE; - else if (!reg_StrCmpNIW(key, szHKCU, 4) || - !reg_StrCmpNIW(key, szHKEY_CURRENT_USER, 17)) - return HKEY_CURRENT_USER; - else if (!reg_StrCmpNIW(key, szHKCR, 4) || - !reg_StrCmpNIW(key, szHKEY_CLASSES_ROOT, 17)) - return HKEY_CLASSES_ROOT; - else if (!reg_StrCmpNIW(key, szHKU, 3) || - !reg_StrCmpNIW(key, szHKEY_USERS, 10)) - return HKEY_USERS; - else if (!reg_StrCmpNIW(key, szHKCC, 4) || - !reg_StrCmpNIW(key, szHKEY_CURRENT_CONFIG, 19)) - return HKEY_CURRENT_CONFIG; - else return NULL; + DWORD i; + + for (i = 0; i < ARRAY_SIZE(root_rels); i++) + { + if (path_rootname_cmp(path, root_rels[i].short_name) || + path_rootname_cmp(path, root_rels[i].long_name)) + return root_rels[i].key; + } + + return NULL; } static DWORD wchar_get_type(const WCHAR *type_name) @@ -158,6 +159,19 @@ return ~0u; } +/* hexchar_to_byte from programs/regedit/hexedit.c */ +static inline BYTE hexchar_to_byte(WCHAR ch) +{ + if (ch >= '0' && ch <= '9') + return ch - '0'; + else if (ch >= 'a' && ch <= 'f') + return ch - 'a' + 10; + else if (ch >= 'A' && ch <= 'F') + return ch - 'A' + 10; + else + return -1; +} + static LPBYTE get_regdata(LPWSTR data, DWORD reg_type, WCHAR separator, DWORD *reg_count) { LPBYTE out_data = NULL; @@ -187,6 +201,36 @@ ((LPDWORD)out_data)[0] = val; break; } + case REG_BINARY: + { + static const WCHAR nohex[] = {'E','r','r','o','r',':',' ','/','d',' ','r','e','q','u','i','r','e','s',' ','h','e','x',' ','d','a','t','a','.','\n',0}; + BYTE hex0, hex1; + int i = 0, destByteIndex = 0, datalen = lstrlenW(data); + *reg_count = ((datalen + datalen % 2) / 2) * sizeof(BYTE); + out_data = HeapAlloc(GetProcessHeap(), 0, *reg_count); + if(datalen % 2) + { + hex1 = hexchar_to_byte(data[i++]); + if(hex1 == 0xFF) + goto no_hex_data; + out_data[destByteIndex++] = hex1; + } + for(;i + 1 < datalen;i += 2) + { + hex0 = hexchar_to_byte(data[i]); + hex1 = hexchar_to_byte(data[i + 1]); + if(hex0 == 0xFF || hex1 == 0xFF) + goto no_hex_data; + out_data[destByteIndex++] = (hex0 << 4) | hex1; + } + break; + no_hex_data: + /* cleanup, print error */ + HeapFree(GetProcessHeap(), 0, out_data); + reg_printfW(nohex); + out_data = NULL; + break; + } default: { static const WCHAR unhandled[] = {'U','n','h','a','n','d','l','e','d',' ','T','y','p','e',' ','0','x','%','x',' ',' ','d','a','t','a',' ','%','s','\n',0}; @@ -237,7 +281,7 @@ } p++; - root = get_rootkey(key_name); + root = path_get_rootkey(key_name); if (!root) { reg_message(STRING_INVALID_KEY); @@ -307,7 +351,7 @@ } p++; - root = get_rootkey(key_name); + root = path_get_rootkey(key_name); if (!root) { reg_message(STRING_INVALID_KEY); diff -Nru wine1.7-1.7.50/programs/reg/tests/reg.c wine1.7-1.7.55/programs/reg/tests/reg.c --- wine1.7-1.7.50/programs/reg/tests/reg.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/reg/tests/reg.c 2015-11-13 14:32:40.000000000 +0000 @@ -214,7 +214,7 @@ run_reg_exe("reg add HKEY_CURRENT_USER\\" KEY_BASE " /ve /t REG_BINARY /d deadbeef /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r); dword = 0xefbeadde; - verify_reg(hkey, "", REG_BINARY, &dword, sizeof(DWORD), TODO_REG_SIZE); + verify_reg(hkey, "", REG_BINARY, &dword, sizeof(DWORD), 0); run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_BINARY /v bin1 /f /d 0xDeAdBeEf", &r); todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r); @@ -235,8 +235,8 @@ err = RegQueryValueExA(hkey, "bin4", NULL, &type, (void *) (buffer+12), &size); ok(err == ERROR_SUCCESS, "RegQueryValueEx failed: got %d\n", err); ok(type == REG_BINARY, "got wrong type %u\n", type); - todo_wine ok(size == 6, "got wrong size %u\n", size); - todo_wine ok(memcmp(buffer, buffer+12, 6) == 0 || + ok(size == 6, "got wrong size %u\n", size); + ok(memcmp(buffer, buffer+12, 6) == 0 || broken(memcmp(buffer+6, buffer+12, 6) == 0 /* WinXP */), "got wrong data\n"); run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_BINARY /v bin5 /d \"\" /f", &r); diff -Nru wine1.7-1.7.50/programs/regedit/listview.c wine1.7-1.7.55/programs/regedit/listview.c --- wine1.7-1.7.50/programs/regedit/listview.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/regedit/listview.c 2015-11-13 14:32:40.000000000 +0000 @@ -333,10 +333,11 @@ if (g_columnToSort == ~0U) g_columnToSort = 0; - if (g_columnToSort == 1 && l->dwValType != r->dwValType) + if (g_columnToSort == 1) return g_invertSort ? (int)r->dwValType - (int)l->dwValType : (int)l->dwValType - (int)r->dwValType; if (g_columnToSort == 2) { /* FIXME: Sort on value */ + return 0; } return g_invertSort ? lstrcmpiW(r->name, l->name) : lstrcmpiW(l->name, r->name); } diff -Nru wine1.7-1.7.50/programs/regedit/Makefile.in wine1.7-1.7.55/programs/regedit/Makefile.in --- wine1.7-1.7.50/programs/regedit/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/regedit/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -20,3 +20,5 @@ MANPAGES = regedit.man.in SVG_SRCS = regedit.svg + +INSTALL_LIB = regedit.exe regedit diff -Nru wine1.7-1.7.50/programs/regsvr32/Makefile.in wine1.7-1.7.55/programs/regsvr32/Makefile.in --- wine1.7-1.7.50/programs/regsvr32/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/regsvr32/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -8,3 +8,5 @@ RC_SRCS = regsvr32.rc MANPAGES = regsvr32.man.in + +INSTALL_LIB = regsvr32.exe regsvr32 diff -Nru wine1.7-1.7.50/programs/regsvr32/regsvr32.c wine1.7-1.7.55/programs/regsvr32/regsvr32.c --- wine1.7-1.7.50/programs/regsvr32/regsvr32.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/regsvr32/regsvr32.c 2015-11-13 14:32:40.000000000 +0000 @@ -19,9 +19,6 @@ * 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 - * - * This version deliberately differs in error handling compared to the - * Windows version. */ #define WIN32_LEAN_AND_MEAN @@ -107,7 +104,7 @@ if(!*DllHandle) { output_write(STRING_DLL_LOAD_FAILED, strDll); - ExitProcess(1); + ExitProcess(LOADLIBRARY_FAILED); } proc = (VOID *) GetProcAddress(*DllHandle, procName); if(!proc) @@ -127,13 +124,13 @@ pfRegister = LoadProc(strDll, "DllRegisterServer", &DllHandle); if (!pfRegister) - return 0; + return GETPROCADDRESS_FAILED; hr = pfRegister(); if(FAILED(hr)) { output_write(STRING_REGISTER_FAILED, strDll); - return -1; + return DLLSERVER_FAILED; } output_write(STRING_REGISTER_SUCCESSFUL, strDll); @@ -150,13 +147,13 @@ pfUnregister = LoadProc(strDll, "DllUnregisterServer", &DllHandle); if (!pfUnregister) - return 0; + return GETPROCADDRESS_FAILED; hr = pfUnregister(); if(FAILED(hr)) { output_write(STRING_UNREGISTER_FAILED, strDll); - return -1; + return DLLSERVER_FAILED; } output_write(STRING_UNREGISTER_SUCCESSFUL, strDll); @@ -173,7 +170,7 @@ pfInstall = LoadProc(strDll, "DllInstall", &DllHandle); if (!pfInstall) - return 0; + return GETPROCADDRESS_FAILED; hr = pfInstall(install, command_line); if(FAILED(hr)) @@ -182,7 +179,7 @@ output_write(STRING_INSTALL_FAILED, strDll); else output_write(STRING_UNINSTALL_FAILED, strDll); - return -1; + return DLLSERVER_FAILED; } if (install) output_write(STRING_INSTALL_SUCCESSFUL, strDll); @@ -221,7 +218,7 @@ int wmain(int argc, WCHAR* argv[]) { - int i; + int i, res, ret = 0; BOOL CallRegister = TRUE; BOOL CallInstall = FALSE; BOOL Unregister = FALSE; @@ -231,10 +228,8 @@ OleInitialize(NULL); - /* Strictly, the Microsoft version processes all the flags before + /* We mirror the Microsoft version by processing all of the flags before * the files (e.g. regsvr32 file1 /s file2 is silent even for file1). - * For ease, we will not replicate that and will process the arguments - * in order. * * Note the complication that this version may be passed Unix format filenames * which could be mistaken for flags. The Windows version conveniently @@ -243,8 +238,14 @@ */ for(i = 1; i < argc; i++) { - if ((argv[i][0] == '/' || argv[i][0] == '-') && (!argv[i][2] || argv[i][2] == ':')) + if (argv[i][0] == '/' || argv[i][0] == '-') { + if (!argv[i][1]) + return INVALID_ARG; + + if (argv[i][2] && argv[i][2] != ':') + continue; + switch (tolowerW(argv[i][1])) { case 'u': @@ -268,16 +269,34 @@ default: output_write(STRING_UNRECOGNIZED_SWITCH, argv[i]); output_write(STRING_USAGE); - return 1; + return INVALID_ARG; } + argv[i] = NULL; } - else + } + + if (!CallInstall && !CallRegister) /* flags: /n or /u /n */ + return INVALID_ARG; + + for (i = 1; i < argc; i++) + { + if (argv[i]) { WCHAR *DllName = argv[i]; - int res = 0; + res = 0; DllFound = TRUE; - if (!CallInstall || (CallInstall && CallRegister)) + if (CallInstall && Unregister) + res = InstallDll(!Unregister, DllName, wsCommandLine); + + /* The Windows version stops processing the current file on the first error. */ + if (res) + { + ret = res; + continue; + } + + if (!CallInstall || CallRegister) { if(Unregister) res = UnregisterDll(DllName); @@ -286,16 +305,19 @@ } if (res) - return res; - /* Confirmed. The Windows version stops on the first error. */ - - if (CallInstall) { - res = InstallDll(!Unregister, DllName, wsCommandLine); + ret = res; + continue; } + if (CallInstall && !Unregister) + res = InstallDll(!Unregister, DllName, wsCommandLine); + if (res) - return res; + { + ret = res; + continue; + } } } @@ -303,10 +325,11 @@ { output_write(STRING_HEADER); output_write(STRING_USAGE); - return 1; + return INVALID_ARG; } OleUninitialize(); - return 0; + /* return the most recent error code, even if later DLLs succeed */ + return ret; } diff -Nru wine1.7-1.7.50/programs/regsvr32/regsvr32.h wine1.7-1.7.55/programs/regsvr32/regsvr32.h --- wine1.7-1.7.50/programs/regsvr32/regsvr32.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/regsvr32/regsvr32.h 2015-11-13 14:32:40.000000000 +0000 @@ -18,6 +18,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +/* Exit codes */ +#define INVALID_ARG 1 +#define LOADLIBRARY_FAILED 3 +#define GETPROCADDRESS_FAILED 4 +#define DLLSERVER_FAILED 5 + /* Resource strings */ #define STRING_HEADER 1000 #define STRING_USAGE 1001 diff -Nru wine1.7-1.7.50/programs/taskmgr/dbgchnl.c wine1.7-1.7.55/programs/taskmgr/dbgchnl.c --- wine1.7-1.7.50/programs/taskmgr/dbgchnl.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/taskmgr/dbgchnl.c 2015-11-13 14:32:40.000000000 +0000 @@ -280,7 +280,8 @@ HANDLE hProcess; NMITEMACTIVATE* nmia = (NMITEMACTIVATE*)lParam; - hProcess = OpenProcess(PROCESS_VM_OPERATION | PROCESS_VM_READ | PROCESS_VM_WRITE, FALSE, get_selected_pid()); + hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_OPERATION | PROCESS_VM_READ | PROCESS_VM_WRITE, + FALSE, get_selected_pid()); if (!hProcess) return; /* FIXME message box */ lhti.pt = nmia->ptAction; hChannelLV = GetDlgItem(hDlg, IDC_DEBUG_CHANNELS_LIST); diff -Nru wine1.7-1.7.50/programs/wineboot/Makefile.in wine1.7-1.7.55/programs/wineboot/Makefile.in --- wine1.7-1.7.50/programs/wineboot/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/wineboot/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -10,3 +10,5 @@ RC_SRCS = wineboot.rc MANPAGES = wineboot.man.in + +INSTALL_LIB = wineboot.exe wineboot diff -Nru wine1.7-1.7.50/programs/wineboot/wineboot.c wine1.7-1.7.55/programs/wineboot/wineboot.c --- wine1.7-1.7.50/programs/wineboot/wineboot.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/wineboot/wineboot.c 2015-11-13 14:32:40.000000000 +0000 @@ -85,8 +85,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(wineboot); -#define MAX_LINE_LENGTH (2*MAX_PATH+2) - extern BOOL shutdown_close_windows( BOOL force ); extern BOOL shutdown_all_desktops( BOOL force ); extern void kill_processes( BOOL kill_desktop ); @@ -321,10 +319,10 @@ WCHAR buffer[60]; const WCHAR *arch; - NtQuerySystemInformation( SystemCpuInformation, &sci, sizeof(sci), NULL ); - if (RegCreateKeyW( HKEY_LOCAL_MACHINE, EnvironW, &env_key )) return; + NtQuerySystemInformation( SystemCpuInformation, &sci, sizeof(sci), NULL ); + sprintfW( buffer, PercentDW, NtCurrentTeb()->Peb->NumberOfProcessors ); set_reg_value( env_key, NumProcW, buffer ); diff -Nru wine1.7-1.7.50/programs/winecfg/Makefile.in wine1.7-1.7.55/programs/winecfg/Makefile.in --- wine1.7-1.7.50/programs/winecfg/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/winecfg/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -22,3 +22,5 @@ SVG_SRCS = \ logo.svg \ winecfg.svg + +INSTALL_LIB = winecfg.exe winecfg diff -Nru wine1.7-1.7.50/programs/wineconsole/dialog.c wine1.7-1.7.55/programs/wineconsole/dialog.c --- wine1.7-1.7.50/programs/wineconsole/dialog.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/wineconsole/dialog.c 2015-11-13 14:32:40.000000000 +0000 @@ -300,7 +300,7 @@ struct dialog_info* di = (struct dialog_info*)lParam; WCUSER_DumpTextMetric(tm, FontType); - if (WCUSER_ValidateFontMetric(di->data, tm, FontType)) + if (WCUSER_ValidateFontMetric(di->data, tm, FontType, TRUE)) { di->nFont++; } @@ -372,7 +372,7 @@ return 0; } - if (WCUSER_ValidateFontMetric(di->data, tm, FontType)) + if (WCUSER_ValidateFontMetric(di->data, tm, FontType, TRUE)) { int idx = 0; diff -Nru wine1.7-1.7.50/programs/wineconsole/Makefile.in wine1.7-1.7.55/programs/wineconsole/Makefile.in --- wine1.7-1.7.50/programs/wineconsole/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/wineconsole/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -13,3 +13,5 @@ RC_SRCS = wineconsole.rc MANPAGES = wineconsole.man.in + +INSTALL_LIB = wineconsole.exe wineconsole diff -Nru wine1.7-1.7.50/programs/wineconsole/user.c wine1.7-1.7.55/programs/wineconsole/user.c --- wine1.7-1.7.50/programs/wineconsole/user.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/wineconsole/user.c 2015-11-13 14:32:40.000000000 +0000 @@ -55,6 +55,7 @@ WCHAR* line; RECT r; HBRUSH hbr; + INT *dx; /* no font has been set up yet, don't worry about filling the bitmap, * we'll do it once a font is chosen @@ -66,6 +67,7 @@ */ if (!(line = HeapAlloc(GetProcessHeap(), 0, data->curcfg.sb_width * sizeof(WCHAR)))) WINECON_Fatal("OOM\n"); + dx = HeapAlloc( GetProcessHeap(), 0, data->curcfg.sb_width * sizeof(*dx) ); hOldFont = SelectObject(PRIVATE(data)->hMemDC, PRIVATE(data)->hFont); for (j = upd_tp; j <= upd_bm; j++) @@ -79,10 +81,11 @@ for (k = i; k < data->curcfg.sb_width && cell[k].Attributes == attr; k++) { line[k - i] = cell[k].Char.UnicodeChar; + dx[k - i] = data->curcfg.cell_width; } - TextOutW(PRIVATE(data)->hMemDC, i * data->curcfg.cell_width, - j * data->curcfg.cell_height, line, k - i); - if (PRIVATE(data)->ext_leading && + ExtTextOutW( PRIVATE(data)->hMemDC, i * data->curcfg.cell_width, j * data->curcfg.cell_height, + 0, NULL, line, k - i, dx ); + if (PRIVATE(data)->ext_leading && (hbr = CreateSolidBrush(WCUSER_ColorMap[(attr>>4)&0x0F]))) { r.left = i * data->curcfg.cell_width; @@ -96,6 +99,7 @@ } } SelectObject(PRIVATE(data)->hMemDC, hOldFont); + HeapFree(GetProcessHeap(), 0, dx); HeapFree(GetProcessHeap(), 0, line); } @@ -329,7 +333,8 @@ struct font_chooser { struct inner_data* data; - int done; + BOOL check_screen_size; + BOOL done; }; /****************************************************************** @@ -337,11 +342,12 @@ * * 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 fontType) +BOOL WCUSER_ValidateFontMetric(const struct inner_data* data, const TEXTMETRICW* tm, + DWORD type, BOOL check_screen_size) { BOOL ret = TRUE; - if (fontType & RASTER_FONTTYPE) + 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 && @@ -373,7 +379,7 @@ struct font_chooser* fc = (struct font_chooser*)lParam; WCUSER_DumpTextMetric(tm, FontType); - if (WCUSER_ValidateFontMetric(fc->data, tm, FontType)) + if (WCUSER_ValidateFontMetric(fc->data, tm, FontType, fc->check_screen_size)) { LOGFONTW mlf = *lf; @@ -431,62 +437,25 @@ TEXTMETRICW tm; HDC hDC; HFONT hFont, hOldFont; - int w, i, buf[256]; if (!(hDC = GetDC(hWnd))) return NULL; - if (!(hFont = CreateFontIndirectW(lf))) goto err1; - - hOldFont = SelectObject(hDC, hFont); - GetTextMetricsW(hDC, &tm); - - /* FIXME: - * the current freetype engine (at least 2.0.x with x <= 8) and its implementation - * in Wine don't return adequate values for fixed fonts - * In Windows, those fonts are expected to return the same value for - * - the average width - * - the largest width - * - the width of all characters in the font - * This isn't true in Wine. As a temporary workaround, we get as the width of the - * cell, the width of the first character in the font, after checking that all - * characters in the font have the same width (I hear paranoia coming) - * when this gets fixed, the code should be using tm.tmAveCharWidth - * or tm.tmMaxCharWidth as the cell width. - */ - GetCharWidth32W(hDC, tm.tmFirstChar, tm.tmFirstChar, &w); - for (i = tm.tmFirstChar + 1; i <= tm.tmLastChar; i += sizeof(buf) / sizeof(buf[0])) + if (!(hFont = CreateFontIndirectW(lf))) { - int j, k; - - k = min(tm.tmLastChar - i, sizeof(buf) / sizeof(buf[0]) - 1); - GetCharWidth32W(hDC, i, i + k, buf); - for (j = 0; j <= k; j++) - { - if (buf[j] != w) - { - WINE_WARN("Non uniform cell width: [%d]=%d [%d]=%d\n" - "This may be caused by old freetype libraries, >= 2.0.8 is recommended\n", - i + j, buf[j], tm.tmFirstChar, w); - goto err; - } - } + ReleaseDC(hWnd, hDC); + return NULL; } + hOldFont = SelectObject(hDC, hFont); + GetTextMetricsW(hDC, &tm); SelectObject(hDC, hOldFont); ReleaseDC(hWnd, hDC); - config->cell_width = w; + config->cell_width = tm.tmMaxCharWidth; config->cell_height = tm.tmHeight + tm.tmExternalLeading; config->font_weight = tm.tmWeight; lstrcpyW(config->face_name, lf->lfFaceName); if (el) *el = tm.tmExternalLeading; return hFont; - err: - if (hDC && hOldFont) SelectObject(hDC, hOldFont); - if (hFont) DeleteObject(hFont); - err1: - if (hDC) ReleaseDC(hWnd, hDC); - - return NULL; } /****************************************************************** @@ -568,7 +537,11 @@ /* try to find an acceptable font */ WINE_WARN("Couldn't match the font from registry... trying to find one\n"); fc.data = data; - fc.done = 0; + 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"); } diff -Nru wine1.7-1.7.50/programs/wineconsole/winecon_private.h wine1.7-1.7.55/programs/wineconsole/winecon_private.h --- wine1.7-1.7.50/programs/wineconsole/winecon_private.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/wineconsole/winecon_private.h 2015-11-13 14:32:40.000000000 +0000 @@ -59,6 +59,7 @@ HANDLE hConIn; /* console input handle */ HANDLE hConOut; /* screen buffer handle: has to be changed when active sb changes */ HANDLE hSynchro; /* waitable handle signalled by server when something in server has been modified */ + HANDLE hProcess; /* handle to the child process or NULL */ HWND hWnd; /* handle of 'user' window or NULL for 'curses' */ INT nCmdShow; /* argument of WinMain */ BOOL in_set_config; /* to handle re-entrant calls to WINECON_SetConfig */ diff -Nru wine1.7-1.7.50/programs/wineconsole/wineconsole.c wine1.7-1.7.55/programs/wineconsole/wineconsole.c --- wine1.7-1.7.50/programs/wineconsole/wineconsole.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/wineconsole/wineconsole.c 2015-11-13 14:32:40.000000000 +0000 @@ -27,7 +27,7 @@ #include "winecon_private.h" #include "winnls.h" #include "winuser.h" - +#include "wine/unicode.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(wineconsole); @@ -421,9 +421,19 @@ } data->curcfg.menu_mask = cfg->menu_mask; data->curcfg.quick_edit = cfg->quick_edit; - if (1 /* FIXME: font info has changed */) + if (strcmpiW(data->curcfg.face_name, cfg->face_name) || data->curcfg.cell_width != cfg->cell_width || + data->curcfg.cell_height != cfg->cell_height || data->curcfg.font_weight != cfg->font_weight) { data->fnSetFont(data, cfg->face_name, cfg->cell_height, cfg->font_weight); + SERVER_START_REQ(set_console_output_info) + { + req->handle = wine_server_obj_handle( data->hConOut ); + req->mask = SET_CONSOLE_OUTPUT_INFO_FONT; + req->font_width = cfg->cell_width; + req->font_height = cfg->cell_height; + wine_server_call( req ); + } + SERVER_END_REQ; } if (data->curcfg.def_attr != cfg->def_attr) { @@ -541,6 +551,7 @@ if (data->hConIn) CloseHandle(data->hConIn); if (data->hConOut) CloseHandle(data->hConOut); if (data->hSynchro) CloseHandle(data->hSynchro); + if (data->hProcess) CloseHandle(data->hProcess); HeapFree(GetProcessHeap(), 0, data->curcfg.registry); HeapFree(GetProcessHeap(), 0, data->cells); HeapFree(GetProcessHeap(), 0, data); @@ -749,7 +760,7 @@ done = CreateProcessW(NULL, cmdLine, NULL, NULL, TRUE, 0L, NULL, NULL, &startup, &info); if (done) { - CloseHandle(info.hProcess); + data->hProcess = info.hProcess; CloseHandle(info.hThread); } @@ -892,8 +903,18 @@ if (!ret) { - WINE_TRACE("calling MainLoop.\n"); - ret = data->fnMainLoop(data); + DWORD exitcode; + + WINE_TRACE("calling MainLoop.\n"); + ret = data->fnMainLoop(data); + + if (!ret && data->hProcess && + WaitForSingleObject(data->hProcess, INFINITE) == WAIT_OBJECT_0 && + GetExitCodeProcess(data->hProcess, &exitcode)) + { + WINE_TRACE("forwarding exitcode %u from child process\n", exitcode); + ret = exitcode; + } } WINECON_Delete(data); diff -Nru wine1.7-1.7.50/programs/wineconsole/winecon_user.h wine1.7-1.7.55/programs/wineconsole/winecon_user.h --- wine1.7-1.7.50/programs/wineconsole/winecon_user.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/wineconsole/winecon_user.h 2015-11-13 14:32:40.000000000 +0000 @@ -46,8 +46,8 @@ 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_ValidateFontMetric(const struct inner_data* data, - const TEXTMETRICW* tm, DWORD fontType); +extern BOOL WCUSER_ValidateFontMetric(const struct inner_data* data, const TEXTMETRICW* tm, + DWORD type, BOOL check_screen_size); 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 wine1.7-1.7.50/programs/winedbg/Makefile.in wine1.7-1.7.55/programs/winedbg/Makefile.in --- wine1.7-1.7.50/programs/winedbg/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/winedbg/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -34,3 +34,5 @@ BISON_SRCS = dbg.y MANPAGES = winedbg.man.in + +INSTALL_LIB = winedbg.exe winedbg diff -Nru wine1.7-1.7.50/programs/winedbg/tgt_minidump.c wine1.7-1.7.55/programs/winedbg/tgt_minidump.c --- wine1.7-1.7.50/programs/winedbg/tgt_minidump.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/winedbg/tgt_minidump.c 2015-11-13 14:32:40.000000000 +0000 @@ -289,6 +289,9 @@ case PROCESSOR_ARCHITECTURE_ARM: str = "ARM"; break; + case PROCESSOR_ARCHITECTURE_ARM64: + str = "ARM64"; + break; case PROCESSOR_ARCHITECTURE_MSIL: str = "MSIL"; break; @@ -346,10 +349,29 @@ else if (msi->u.s.ProductType == 3) str = "Server 2008"; else str = "6-????"; break; - case 2: str = "Win8"; break; + case 2: + if (msi->u.s.ProductType == 1) str = "Win8"; + else if (msi->u.s.ProductType == 3) str = "Server 2012"; + else str = "6-????"; + break; + case 3: + if (msi->u.s.ProductType == 1) str = "Win8.1"; + else if (msi->u.s.ProductType == 3) str = "Server 2012 R2"; + else str = "6-????"; + break; default: str = "6-????"; break; } break; + case 10: + switch (msi->MinorVersion) + { + case 0: + if (msi->u.s.ProductType == 1) str = "Win10"; + else str = "10-????"; + break; + default: str = "10-????"; break; + } + break; default: str = "???"; break; } dbg_printf(" on Windows %s (%u)\n", str, msi->BuildNumber); diff -Nru wine1.7-1.7.50/programs/winefile/Makefile.in wine1.7-1.7.55/programs/winefile/Makefile.in --- wine1.7-1.7.50/programs/winefile/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/winefile/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -12,3 +12,5 @@ MANPAGES = winefile.man.in SVG_SRCS = winefile.svg + +INSTALL_LIB = winefile.exe winefile diff -Nru wine1.7-1.7.50/programs/winemenubuilder/winemenubuilder.c wine1.7-1.7.55/programs/winemenubuilder/winemenubuilder.c --- wine1.7-1.7.50/programs/winemenubuilder/winemenubuilder.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/winemenubuilder/winemenubuilder.c 2015-11-13 14:32:40.000000000 +0000 @@ -3427,7 +3427,7 @@ if (data == NULL) break; lret = RegEnumValueW(hkey, i, value, &valueSize, NULL, NULL, (BYTE*)data, &dataSize); - if (lret == ERROR_SUCCESS || lret != ERROR_MORE_DATA) + if (lret != ERROR_MORE_DATA) break; valueSize *= 2; dataSize *= 2; diff -Nru wine1.7-1.7.50/programs/winemine/main.c wine1.7-1.7.55/programs/winemine/main.c --- wine1.7-1.7.50/programs/winemine/main.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/winemine/main.c 2015-11-13 14:32:40.000000000 +0000 @@ -80,38 +80,31 @@ RegOpenKeyExW( HKEY_CURRENT_USER, registry_key, 0, KEY_QUERY_VALUE, &hkey ); size = sizeof( p_board->pos.x ); - if( !RegQueryValueExW( hkey, xposW, NULL, &type, - (LPBYTE) &p_board->pos.x, &size ) == ERROR_SUCCESS ) + if( RegQueryValueExW( hkey, xposW, NULL, &type, (BYTE*) &p_board->pos.x, &size ) ) p_board->pos.x = 0; size = sizeof( p_board->pos.y ); - if( !RegQueryValueExW( hkey, yposW, NULL, &type, - (LPBYTE) &p_board->pos.y, &size ) == ERROR_SUCCESS ) + if( RegQueryValueExW( hkey, yposW, NULL, &type, (BYTE*) &p_board->pos.y, &size ) ) p_board->pos.y = 0; size = sizeof( p_board->rows ); - if( !RegQueryValueExW( hkey, heightW, NULL, &type, - (LPBYTE) &p_board->rows, &size ) == ERROR_SUCCESS ) + if( RegQueryValueExW( hkey, heightW, NULL, &type, (BYTE*) &p_board->rows, &size ) ) p_board->rows = BEGINNER_ROWS; size = sizeof( p_board->cols ); - if( !RegQueryValueExW( hkey, widthW, NULL, &type, - (LPBYTE) &p_board->cols, &size ) == ERROR_SUCCESS ) + if( RegQueryValueExW( hkey, widthW, NULL, &type, (BYTE*) &p_board->cols, &size ) ) p_board->cols = BEGINNER_COLS; size = sizeof( p_board->mines ); - if( !RegQueryValueExW( hkey, minesW, NULL, &type, - (LPBYTE) &p_board->mines, &size ) == ERROR_SUCCESS ) + if( RegQueryValueExW( hkey, minesW, NULL, &type, (BYTE*) &p_board->mines, &size ) ) p_board->mines = BEGINNER_MINES; size = sizeof( p_board->difficulty ); - if( !RegQueryValueExW( hkey, difficultyW, NULL, &type, - (LPBYTE) &p_board->difficulty, &size ) == ERROR_SUCCESS ) + if( RegQueryValueExW( hkey, difficultyW, NULL, &type, (BYTE*) &p_board->difficulty, &size ) ) p_board->difficulty = BEGINNER; size = sizeof( p_board->IsMarkQ ); - if( !RegQueryValueExW( hkey, markW, NULL, &type, - (LPBYTE) &p_board->IsMarkQ, &size ) == ERROR_SUCCESS ) + if( RegQueryValueExW( hkey, markW, NULL, &type, (BYTE*) &p_board->IsMarkQ, &size ) ) p_board->IsMarkQ = TRUE; for( i = 0; i < 3; i++ ) { @@ -127,8 +120,7 @@ for( i = 0; i < 3; i++ ) { wsprintfW( key_name, timeW, i+1 ); size = sizeof( p_board->best_time[i] ); - if( !RegQueryValueExW( hkey, key_name, NULL, &type, - (LPBYTE) &p_board->best_time[i], &size ) == ERROR_SUCCESS ) + if( RegQueryValueExW( hkey, key_name, NULL, &type, (BYTE*) &p_board->best_time[i], &size ) ) p_board->best_time[i] = 999; } RegCloseKey( hkey ); @@ -1003,7 +995,7 @@ LoadStringW( board.hInst, IDS_APPNAME, appname, sizeof(appname)/sizeof(WCHAR) ); LoadStringW( board.hInst, IDS_ABOUT, other, sizeof(other)/sizeof(WCHAR) ); ShellAboutW( hWnd, appname, other, - LoadImageA( board.hInst, "WINEMINE", IMAGE_ICON, 48, 48, LR_SHARED )); + LoadImageW(board.hInst, MAKEINTRESOURCEW(IDI_WINEMINE), IMAGE_ICON, 48, 48, LR_SHARED)); return 0; } default: diff -Nru wine1.7-1.7.50/programs/winemine/Makefile.in wine1.7-1.7.55/programs/winemine/Makefile.in --- wine1.7-1.7.50/programs/winemine/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/winemine/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -12,3 +12,5 @@ MANPAGES = winemine.man.in SVG_SRCS = winemine.svg + +INSTALL_LIB = winemine.exe winemine diff -Nru wine1.7-1.7.50/programs/winepath/Makefile.in wine1.7-1.7.55/programs/winepath/Makefile.in --- wine1.7-1.7.50/programs/winepath/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/winepath/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -4,3 +4,5 @@ C_SRCS = winepath.c MANPAGES = winepath.man.in + +INSTALL_LIB = winepath.exe winepath diff -Nru wine1.7-1.7.50/programs/winetest/Makefile.in wine1.7-1.7.55/programs/winetest/Makefile.in --- wine1.7-1.7.50/programs/winetest/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/programs/winetest/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -14,10 +14,12 @@ SVG_SRCS = winetest.svg -EXTRA_OBJS = build.res @ALL_TEST_RESOURCES@ +EXTRA_OBJS = build.res $(ALL_TEST_RESOURCES) EXTRA_TARGETS = build.rc build.nfo +INSTALL_LIB = none + build.rc: dummy build="BUILD_INFO STRINGRES build.nfo STRINGTABLE { 1 \"`GIT_DIR=$(top_srcdir)/.git git rev-parse HEAD 2>/dev/null`\" }" && (echo $$build | cmp -s - $@) || echo $$build >$@ || ($(RM) $@ && exit 1) @@ -26,3 +28,6 @@ build.res: build.rc build.nfo $(WRC) -o $@ build.rc + +dummy: +.PHONY: dummy diff -Nru wine1.7-1.7.50/programs/wmplayer/main.c wine1.7-1.7.55/programs/wmplayer/main.c --- wine1.7-1.7.50/programs/wmplayer/main.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/programs/wmplayer/main.c 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,33 @@ +/* + * Copyright 2015 Austin English + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wmplayer); + +int wmain(int argc, WCHAR *argv[]) +{ + int i; + + WINE_FIXME("stub:"); + for (i = 0; i < argc; i++) + WINE_FIXME(" %s", wine_dbgstr_w(argv[i])); + WINE_FIXME("\n"); + + return 0; +} diff -Nru wine1.7-1.7.50/programs/wmplayer/Makefile.in wine1.7-1.7.55/programs/wmplayer/Makefile.in --- wine1.7-1.7.50/programs/wmplayer/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/programs/wmplayer/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,7 @@ +MODULE = wmplayer.exe +APPMODE = -mwindows -municode + +RC_SRCS = version.rc + +C_SRCS = \ + main.c diff -Nru wine1.7-1.7.50/programs/wmplayer/version.rc wine1.7-1.7.55/programs/wmplayer/version.rc --- wine1.7-1.7.50/programs/wmplayer/version.rc 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.55/programs/wmplayer/version.rc 2015-11-13 14:32:40.000000000 +0000 @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2015 Austin English + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define WINE_FILEDESCRIPTION_STR "Windows Media Player" +#define WINE_FILENAME_STR "wmplayer.exe" +#define WINE_FILETYPE VFT_APP +#define WINE_FILEVERSION 12,0,7601,18840 +#define WINE_FILEVERSION_STR "12.0.7601.18840" +#define WINE_PRODUCTVERSION 12,0,7601,18840 +#define WINE_PRODUCTVERSION_STR "12.0.7601.18840" + +#include "wine/wine_common_ver.rc" diff -Nru wine1.7-1.7.50/server/console.c wine1.7-1.7.55/server/console.c --- wine1.7-1.7.50/server/console.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/server/console.c 2015-11-13 14:32:40.000000000 +0000 @@ -121,6 +121,12 @@ console_input_events_destroy /* destroy */ }; +struct font_info +{ + short int width; + short int height; +}; + struct screen_buffer { struct object obj; /* object header */ @@ -139,6 +145,7 @@ unsigned short attr; /* default attribute for screen buffer */ rectangle_t win; /* current visible window on the screen buffer * * as seen in wineconsole */ + struct font_info font; /* console font information */ struct fd *fd; /* for bare console, attached output fd */ }; @@ -411,6 +418,8 @@ screen_buffer->win.top = 0; screen_buffer->win.bottom = screen_buffer->max_height - 1; screen_buffer->data = NULL; + screen_buffer->font.width = 0; + screen_buffer->font.height = 0; list_add_head( &screen_buffer_list, &screen_buffer->entry ); if (fd == -1) @@ -632,7 +641,6 @@ (console->recnum + count) * sizeof(INPUT_RECORD) ))) { set_error( STATUS_NO_MEMORY ); - release_object( console ); return -1; } console->records = new_rec; @@ -1020,6 +1028,11 @@ screen_buffer->max_width = req->max_width; screen_buffer->max_height = req->max_height; } + if (req->mask & SET_CONSOLE_OUTPUT_INFO_FONT) + { + screen_buffer->font.width = req->font_width; + screen_buffer->font.height = req->font_height; + } return 1; } @@ -1677,6 +1690,8 @@ reply->win_bottom = screen_buffer->win.bottom; reply->max_width = screen_buffer->max_width; reply->max_height = screen_buffer->max_height; + reply->font_width = screen_buffer->font.width; + reply->font_height = screen_buffer->font.height; release_object( screen_buffer ); } } @@ -1782,7 +1797,7 @@ { if (process->console && process->console->renderer == current) { - *(struct console_input**)user = process->console; + *(struct console_input**)user = (struct console_input *)grab_object( process->console ); return 1; } return 0; diff -Nru wine1.7-1.7.50/server/device.c wine1.7-1.7.55/server/device.c --- wine1.7-1.7.50/server/device.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/server/device.c 2015-11-13 14:32:40.000000000 +0000 @@ -807,11 +807,6 @@ DECL_HANDLER(set_irp_result) { struct irp_call *irp; - struct device_manager *manager; - - if (!(manager = (struct device_manager *)get_handle_obj( current->process, req->manager, - 0, &device_manager_ops ))) - return; if ((irp = (struct irp_call *)get_handle_obj( current->process, req->handle, 0, &irp_call_ops ))) { @@ -820,7 +815,6 @@ close_handle( current->process, req->handle ); /* avoid an extra round-trip for close */ release_object( irp ); } - release_object( manager ); } diff -Nru wine1.7-1.7.50/server/directory.c wine1.7-1.7.55/server/directory.c --- wine1.7-1.7.50/server/directory.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/server/directory.c 2015-11-13 14:32:40.000000000 +0000 @@ -287,7 +287,11 @@ struct object *obj, *new_obj = NULL; struct unicode_str new_name; - if (!name || !name->len) return alloc_object( ops ); + if (!name || !name->len) + { + if ((new_obj = alloc_object( ops ))) clear_error(); + return new_obj; + } if (!(obj = find_object_dir( root, name, attributes, &new_name ))) return NULL; if (!new_name.len) diff -Nru wine1.7-1.7.50/server/fd.c wine1.7-1.7.55/server/fd.c --- wine1.7-1.7.50/server/fd.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/server/fd.c 2015-11-13 14:32:40.000000000 +0000 @@ -44,10 +44,7 @@ #include #endif #ifdef HAVE_SYS_VFS_H -/* - * Solaris defines its system list in sys/list.h. - * This need to be workaround it here. - */ +/* Work around a conflict with Solaris' system list defined in sys/list.h. */ #define list SYSLIST #define list_next SYSLIST_NEXT #define list_prev SYSLIST_PREV @@ -1835,34 +1832,40 @@ fd->closed = closed_fd; fd->cacheable = !inode->device->removable; list_add_head( &inode->open, &fd->inode_entry ); + closed_fd = NULL; /* check directory options */ if ((options & FILE_DIRECTORY_FILE) && !S_ISDIR(st.st_mode)) { - release_object( fd ); set_error( STATUS_NOT_A_DIRECTORY ); - return NULL; + goto error; } if ((options & FILE_NON_DIRECTORY_FILE) && S_ISDIR(st.st_mode)) { - release_object( fd ); set_error( STATUS_FILE_IS_A_DIRECTORY ); - return NULL; + goto error; } if ((err = check_sharing( fd, access, sharing, flags, options ))) { - release_object( fd ); set_error( err ); - return NULL; + goto error; + } + + /* can't unlink files if we don't have permission to access */ + if ((options & FILE_DELETE_ON_CLOSE) && !(flags & O_CREAT) && + !(st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH))) + { + set_error( STATUS_CANNOT_DELETE ); + goto error; } - closed_fd->unlink = (options & FILE_DELETE_ON_CLOSE) != 0; + + fd->closed->unlink = (options & FILE_DELETE_ON_CLOSE) != 0; if (flags & O_TRUNC) { if (S_ISDIR(st.st_mode)) { - release_object( fd ); set_error( STATUS_OBJECT_NAME_COLLISION ); - return NULL; + goto error; } ftruncate( fd->unix_fd, 0 ); } @@ -1877,6 +1880,7 @@ free( closed_fd ); fd->cacheable = 1; } + if (root_fd != -1) fchdir( server_dir_fd ); /* go back to the server dir */ return fd; error: diff -Nru wine1.7-1.7.50/server/hook.c wine1.7-1.7.55/server/hook.c --- wine1.7-1.7.50/server/hook.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/server/hook.c 2015-11-13 14:32:40.000000000 +0000 @@ -356,7 +356,7 @@ { struct hook_table *table = get_queue_hooks( current ); struct hook_table *global_hooks = get_global_hooks( current ); - unsigned int ret = 1 << 31; /* set high bit to indicate that the bitmap is valid */ + unsigned int ret = 1u << 31; /* set high bit to indicate that the bitmap is valid */ int id; for (id = WH_MINHOOK; id <= WH_WINEVENT; id++) diff -Nru wine1.7-1.7.50/server/Makefile.in wine1.7-1.7.55/server/Makefile.in --- wine1.7-1.7.50/server/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/server/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -1,4 +1,4 @@ -EXTRALIBS = $(POLL_LIBS) $(RT_LIBS) +PROGRAMS = wineserver C_SRCS = \ async.c \ @@ -45,25 +45,11 @@ window.c \ winstation.c -PROGRAMS = wineserver wineserver-installed - MANPAGES = \ wineserver.de.UTF-8.man.in \ wineserver.fr.UTF-8.man.in \ wineserver.man.in -OBJS = $(C_SRCS:.c=.o) - -wineserver: $(OBJS) - $(CC) -o $@ $(OBJS) $(LIBWINE) $(LIBPORT) $(LDFLAGS) $(EXTRALIBS) $(LIBS) $(LDRPATH_LOCAL) - -wineserver-installed: $(OBJS) - $(CC) -o $@ $(OBJS) $(LIBWINE) $(LIBPORT) $(LDFLAGS) $(EXTRALIBS) $(LIBS) $(LDRPATH_INSTALL) - -.PHONY: install install-lib uninstall - -install install-lib:: wineserver-installed install-man-pages - $(INSTALL_PROGRAM) wineserver-installed $(DESTDIR)$(bindir)/wineserver +EXTRALIBS = -lwine $(POLL_LIBS) $(RT_LIBS) -uninstall:: - $(RM) $(DESTDIR)$(bindir)/wineserver +INSTALL_LIB = $(PROGRAMS) diff -Nru wine1.7-1.7.50/server/named_pipe.c wine1.7-1.7.55/server/named_pipe.c --- wine1.7-1.7.50/server/named_pipe.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/server/named_pipe.c 2015-11-13 14:32:40.000000000 +0000 @@ -671,7 +671,11 @@ struct named_pipe *pipe = NULL; struct unicode_str new_name; - if (!name || !name->len) return alloc_object( &named_pipe_ops ); + if (!name || !name->len) + { + if ((pipe = alloc_object( &named_pipe_ops ))) clear_error(); + return pipe; + } if (!(obj = find_object_dir( root, name, attr, &new_name ))) { diff -Nru wine1.7-1.7.50/server/object.c wine1.7-1.7.55/server/object.c --- wine1.7-1.7.50/server/object.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/server/object.c 2015-11-13 14:32:40.000000000 +0000 @@ -242,7 +242,11 @@ { struct object *obj; - if (!name || !name->len) return alloc_object( ops ); + if (!name || !name->len) + { + if ((obj = alloc_object( ops ))) clear_error(); + return obj; + } if ((obj = find_object( namespace, name, attributes ))) { diff -Nru wine1.7-1.7.50/server/process.c wine1.7-1.7.55/server/process.c --- wine1.7-1.7.50/server/process.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/server/process.c 2015-11-13 14:32:40.000000000 +0000 @@ -1181,8 +1181,6 @@ if (!(thread = create_process( socket_fd, current, req->inherit_all ))) goto done; process = thread->process; - process->debug_children = (req->create_flags & DEBUG_PROCESS) - && !(req->create_flags & DEBUG_ONLY_THIS_PROCESS); process->startup_info = (struct startup_info *)grab_object( info ); if (parent->job @@ -1223,9 +1221,15 @@ /* attach to the debugger if requested */ if (req->create_flags & (DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS)) + { set_process_debugger( process, current ); + process->debug_children = !(req->create_flags & DEBUG_ONLY_THIS_PROCESS); + } else if (parent->debugger && parent->debug_children) + { set_process_debugger( process, parent->debugger ); + process->debug_children = 1; + } if (!(req->create_flags & CREATE_NEW_PROCESS_GROUP)) process->group_id = parent->group_id; diff -Nru wine1.7-1.7.50/server/protocol.def wine1.7-1.7.55/server/protocol.def --- wine1.7-1.7.50/server/protocol.def 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/server/protocol.def 2015-11-13 14:32:40.000000000 +0000 @@ -1495,6 +1495,8 @@ short int win_bottom; short int max_width; /* maximum size (width x height) for the window */ short int max_height; + short int font_width; /* font size (width x height) */ + short int font_height; @END #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x01 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x02 @@ -1502,6 +1504,7 @@ #define SET_CONSOLE_OUTPUT_INFO_ATTR 0x08 #define SET_CONSOLE_OUTPUT_INFO_DISPLAY_WINDOW 0x10 #define SET_CONSOLE_OUTPUT_INFO_MAX_SIZE 0x20 +#define SET_CONSOLE_OUTPUT_INFO_FONT 0x40 /* Get info about a console (output only) */ @@ -1521,6 +1524,8 @@ short int win_bottom; short int max_width; /* maximum size (width x height) for the window */ short int max_height; + short int font_width; /* font size (width x height) */ + short int font_height; @END /* Add input records to a console input queue */ @@ -2345,11 +2350,10 @@ /* Store results of an async irp */ @REQ(set_irp_result) - obj_handle_t manager; /* handle to the device manager */ obj_handle_t handle; /* handle to the irp */ unsigned int status; /* status of the irp */ - client_ptr_t file_ptr; /* opaque pointer to the file object */ data_size_t size; /* result size (input or output depending on the operation) */ + client_ptr_t file_ptr; /* opaque pointer to the file object */ VARARG(data,bytes); /* output data of the irp */ @END diff -Nru wine1.7-1.7.50/server/queue.c wine1.7-1.7.55/server/queue.c --- wine1.7-1.7.50/server/queue.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/server/queue.c 2015-11-13 14:32:40.000000000 +0000 @@ -374,7 +374,7 @@ } /* set the cursor clip rectangle */ -static void set_clip_rectangle( struct desktop *desktop, const rectangle_t *rect ) +static void set_clip_rectangle( struct desktop *desktop, const rectangle_t *rect, int send_clip_msg ) { rectangle_t top_rect; int x, y; @@ -392,7 +392,7 @@ } else desktop->cursor.clip = top_rect; - if (desktop->cursor.clip_msg) + if (desktop->cursor.clip_msg && send_clip_msg) post_desktop_message( desktop, desktop->cursor.clip_msg, rect != NULL, 0 ); /* warp the mouse to be inside the clip rect */ @@ -405,7 +405,7 @@ static void set_foreground_input( struct desktop *desktop, struct thread_input *input ) { if (desktop->foreground_input == input) return; - set_clip_rectangle( desktop, NULL ); + set_clip_rectangle( desktop, NULL, 1 ); desktop->foreground_input = input; } @@ -3091,7 +3091,7 @@ if (req->clip_msg && get_top_window_owner(desktop) == current->process) desktop->cursor.clip_msg = req->clip_msg; - set_clip_rectangle( desktop, (req->flags & SET_CURSOR_NOCLIP) ? NULL : &req->clip ); + set_clip_rectangle( desktop, (req->flags & SET_CURSOR_NOCLIP) ? NULL : &req->clip, 0 ); } reply->new_x = input->desktop->cursor.x; diff -Nru wine1.7-1.7.50/server/registry.c wine1.7-1.7.55/server/registry.c --- wine1.7-1.7.50/server/registry.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/server/registry.c 2015-11-13 14:32:40.000000000 +0000 @@ -93,7 +93,7 @@ { WCHAR *name; /* value name */ unsigned short namelen; /* length of value name */ - unsigned short type; /* value type */ + unsigned int type; /* value type */ data_size_t len; /* value data length in bytes */ void *data; /* pointer to value data */ }; @@ -814,6 +814,7 @@ free(key->class); if (!(key->class = memdup( class->str, key->classlen ))) key->classlen = 0; } + touch_key( key->parent, REG_NOTIFY_CHANGE_NAME ); grab_object( key ); return key; } @@ -905,26 +906,25 @@ reply->max_data = 0; break; case KeyFullInformation: + case KeyCachedInformation: for (i = 0; i <= key->last_subkey; i++) { - struct key *subkey = key->subkeys[i]; - len = subkey->namelen / sizeof(WCHAR); - if (len > max_subkey) max_subkey = len; - len = subkey->classlen / sizeof(WCHAR); - if (len > max_class) max_class = len; + if (key->subkeys[i]->namelen > max_subkey) max_subkey = key->subkeys[i]->namelen; + if (key->subkeys[i]->classlen > max_class) max_class = key->subkeys[i]->classlen; } for (i = 0; i <= key->last_value; i++) { - len = key->values[i].namelen / sizeof(WCHAR); - if (len > max_value) max_value = len; - len = key->values[i].len; - if (len > max_data) max_data = len; + if (key->values[i].namelen > max_value) max_value = key->values[i].namelen; + if (key->values[i].len > max_data) max_data = key->values[i].len; } reply->max_subkey = max_subkey; reply->max_class = max_class; reply->max_value = max_value; reply->max_data = max_data; - namelen = 0; /* only return the class */ + reply->namelen = namelen; + if (info_class == KeyCachedInformation) + classlen = 0; /* don't return any data, only its size */ + namelen = 0; /* don't return name */ break; default: set_error( STATUS_INVALID_PARAMETER ); @@ -2289,6 +2289,11 @@ list_add_head( &key->notify_list, ¬ify->entry ); } } + if (notify) + { + reset_event( event ); + set_error( STATUS_PENDING ); + } release_object( event ); } release_object( key ); diff -Nru wine1.7-1.7.50/server/request.h wine1.7-1.7.55/server/request.h --- wine1.7-1.7.50/server/request.h 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/server/request.h 2015-11-13 14:32:40.000000000 +0000 @@ -1112,7 +1112,9 @@ C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, win_bottom) == 40 ); C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, max_width) == 42 ); C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, max_height) == 44 ); -C_ASSERT( sizeof(struct set_console_output_info_request) == 48 ); +C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, font_width) == 46 ); +C_ASSERT( FIELD_OFFSET(struct set_console_output_info_request, font_height) == 48 ); +C_ASSERT( sizeof(struct set_console_output_info_request) == 56 ); C_ASSERT( FIELD_OFFSET(struct get_console_output_info_request, handle) == 12 ); C_ASSERT( sizeof(struct get_console_output_info_request) == 16 ); C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, cursor_size) == 8 ); @@ -1128,6 +1130,8 @@ C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, win_bottom) == 28 ); C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, max_width) == 30 ); C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, max_height) == 32 ); +C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, font_width) == 34 ); +C_ASSERT( FIELD_OFFSET(struct get_console_output_info_reply, font_height) == 36 ); C_ASSERT( sizeof(struct get_console_output_info_reply) == 40 ); C_ASSERT( FIELD_OFFSET(struct write_console_input_request, handle) == 12 ); C_ASSERT( sizeof(struct write_console_input_request) == 16 ); @@ -1563,12 +1567,11 @@ C_ASSERT( FIELD_OFFSET(struct ioctl_reply, wait) == 8 ); C_ASSERT( FIELD_OFFSET(struct ioctl_reply, options) == 12 ); C_ASSERT( sizeof(struct ioctl_reply) == 16 ); -C_ASSERT( FIELD_OFFSET(struct set_irp_result_request, manager) == 12 ); -C_ASSERT( FIELD_OFFSET(struct set_irp_result_request, handle) == 16 ); -C_ASSERT( FIELD_OFFSET(struct set_irp_result_request, status) == 20 ); +C_ASSERT( FIELD_OFFSET(struct set_irp_result_request, handle) == 12 ); +C_ASSERT( FIELD_OFFSET(struct set_irp_result_request, status) == 16 ); +C_ASSERT( FIELD_OFFSET(struct set_irp_result_request, size) == 20 ); C_ASSERT( FIELD_OFFSET(struct set_irp_result_request, file_ptr) == 24 ); -C_ASSERT( FIELD_OFFSET(struct set_irp_result_request, size) == 32 ); -C_ASSERT( sizeof(struct set_irp_result_request) == 40 ); +C_ASSERT( sizeof(struct set_irp_result_request) == 32 ); C_ASSERT( FIELD_OFFSET(struct get_irp_result_request, handle) == 12 ); C_ASSERT( FIELD_OFFSET(struct get_irp_result_request, user_arg) == 16 ); C_ASSERT( sizeof(struct get_irp_result_request) == 24 ); diff -Nru wine1.7-1.7.50/server/sock.c wine1.7-1.7.55/server/sock.c --- wine1.7-1.7.50/server/sock.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/server/sock.c 2015-11-13 14:32:40.000000000 +0000 @@ -546,6 +546,11 @@ switch(code) { case WS_SIO_ADDRESS_LIST_CHANGE: + if ((sock->state & FD_WINE_NONBLOCKING) && !blocking) + { + set_error( STATUS_CANT_WAIT ); + return 0; + } if (!(ifchange_q = sock_get_ifchange_q( sock ))) return 0; if (!(async = create_async( current, ifchange_q, async_data ))) return 0; if (blocking) wait_handle = alloc_handle( current->process, async, SYNCHRONIZE, 0 ); diff -Nru wine1.7-1.7.50/server/thread.c wine1.7-1.7.55/server/thread.c --- wine1.7-1.7.50/server/thread.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/server/thread.c 2015-11-13 14:32:40.000000000 +0000 @@ -1500,10 +1500,10 @@ /* Optimization: ignore APC_NONE calls, they are only used to * wake up a thread, but since we got here the thread woke up already. */ - if (apc->call.type != APC_NONE) + if (apc->call.type != APC_NONE && + (reply->apc_handle = alloc_handle( current->process, apc, SYNCHRONIZE, 0 ))) { - if ((reply->apc_handle = alloc_handle( current->process, apc, SYNCHRONIZE, 0 ))) - reply->call = apc->call; + reply->call = apc->call; release_object( apc ); break; } @@ -1602,13 +1602,12 @@ if (!(apc = (struct thread_apc *)get_handle_obj( current->process, req->handle, 0, &thread_apc_ops ))) return; - if (!apc->executed) set_error( STATUS_PENDING ); - else - { - reply->result = apc->result; - /* close the handle directly to avoid an extra round-trip */ - close_handle( current->process, req->handle ); - } + + if (apc->executed) reply->result = apc->result; + else set_error( STATUS_PENDING ); + + /* close the handle directly to avoid an extra round-trip */ + close_handle( current->process, req->handle ); release_object( apc ); } diff -Nru wine1.7-1.7.50/server/trace.c wine1.7-1.7.55/server/trace.c --- wine1.7-1.7.50/server/trace.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/server/trace.c 2015-11-13 14:32:40.000000000 +0000 @@ -1959,6 +1959,8 @@ fprintf( stderr, ", win_bottom=%d", req->win_bottom ); fprintf( stderr, ", max_width=%d", req->max_width ); fprintf( stderr, ", max_height=%d", req->max_height ); + fprintf( stderr, ", font_width=%d", req->font_width ); + fprintf( stderr, ", font_height=%d", req->font_height ); } static void dump_get_console_output_info_request( const struct get_console_output_info_request *req ) @@ -1981,6 +1983,8 @@ fprintf( stderr, ", win_bottom=%d", req->win_bottom ); fprintf( stderr, ", max_width=%d", req->max_width ); fprintf( stderr, ", max_height=%d", req->max_height ); + fprintf( stderr, ", font_width=%d", req->font_width ); + fprintf( stderr, ", font_height=%d", req->font_height ); } static void dump_write_console_input_request( const struct write_console_input_request *req ) @@ -2834,11 +2838,10 @@ static void dump_set_irp_result_request( const struct set_irp_result_request *req ) { - fprintf( stderr, " manager=%04x", req->manager ); - fprintf( stderr, ", handle=%04x", req->handle ); + fprintf( stderr, " handle=%04x", req->handle ); fprintf( stderr, ", status=%08x", req->status ); - dump_uint64( ", file_ptr=", &req->file_ptr ); fprintf( stderr, ", size=%u", req->size ); + dump_uint64( ", file_ptr=", &req->file_ptr ); dump_varargs_bytes( ", data=", cur_size ); } diff -Nru wine1.7-1.7.50/tools/config.guess wine1.7-1.7.55/tools/config.guess --- wine1.7-1.7.50/tools/config.guess 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/tools/config.guess 2015-11-13 14:32:40.000000000 +0000 @@ -1,10 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012, 2013 Free Software Foundation, Inc. +# Copyright 1992-2015 Free Software Foundation, Inc. -timestamp='2012-12-30' +timestamp='2015-08-20' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -26,12 +24,12 @@ # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # -# Originally written by Per Bothner. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` @@ -52,9 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, -2012, 2013 Free Software Foundation, Inc. +Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -88,7 +84,7 @@ exit 1 fi -trap 'exit 1' HUP INT TERM +trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires @@ -102,7 +98,7 @@ set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || @@ -136,6 +132,27 @@ UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + ;; +esac + # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -151,20 +168,27 @@ # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || \ + echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) + arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ @@ -180,6 +204,13 @@ os=netbsd ;; esac + # Determine ABI tags. + case "${UNAME_MACHINE_ARCH}" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + ;; + esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need @@ -190,13 +221,13 @@ release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" + echo "${machine}-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` @@ -218,6 +249,9 @@ *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -562,8 +596,9 @@ else IBM_ARCH=powerpc fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi @@ -809,7 +844,7 @@ *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; - i*:MSYS*:*) + *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) @@ -857,21 +892,21 @@ exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -884,59 +919,57 @@ EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + e2k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build @@ -955,54 +988,63 @@ #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; - or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-gnu + echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu + echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu + echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1235,19 +1277,31 @@ exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi - fi ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) @@ -1338,154 +1392,6 @@ exit ;; esac -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - cat >&2 <. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -70,9 +68,7 @@ version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, -2012, 2013 Free Software Foundation, Inc. +Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -121,7 +117,7 @@ case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os @@ -256,19 +252,21 @@ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc \ + | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ + | ba \ | be32 | be64 \ | bfin \ - | c4x | clipper \ + | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ @@ -286,8 +284,10 @@ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ @@ -297,16 +297,16 @@ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ - | nios | nios2 \ + | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ - | open8 \ - | or32 \ + | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ + | riscv32 | riscv64 \ | rl78 | rx \ | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -314,6 +314,7 @@ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -328,7 +329,10 @@ c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -370,21 +374,23 @@ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ + | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ @@ -404,8 +410,10 @@ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ @@ -414,19 +422,21 @@ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ + | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ + | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ @@ -434,6 +444,7 @@ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ + | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -510,6 +521,9 @@ basic_machine=i386-pc os=-aros ;; + asmjs) + basic_machine=asmjs-unknown + ;; aux) basic_machine=m68k-apple os=-aux @@ -771,6 +785,9 @@ basic_machine=m68k-isi os=-sysv ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; m68knommu) basic_machine=m68k-unknown os=-linux @@ -798,7 +815,7 @@ os=-mingw64 ;; mingw32) - basic_machine=i386-pc + basic_machine=i686-pc os=-mingw32 ;; mingw32ce) @@ -826,6 +843,10 @@ basic_machine=powerpc-unknown os=-morphos ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; msdos) basic_machine=i386-pc os=-msdos @@ -834,7 +855,7 @@ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) - basic_machine=i386-pc + basic_machine=i686-pc os=-msys ;; mvs) @@ -1358,7 +1379,7 @@ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ @@ -1371,14 +1392,14 @@ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1550,6 +1571,9 @@ c4x-* | tic4x-*) os=-coff ;; + c8051-*) + os=-elf + ;; hexagon-*) os=-elf ;; diff -Nru wine1.7-1.7.50/tools/makedep.c wine1.7-1.7.55/tools/makedep.c --- wine1.7-1.7.50/tools/makedep.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/tools/makedep.c 2015-11-13 14:32:40.000000000 +0000 @@ -40,6 +40,7 @@ INCL_NORMAL, /* #include "foo.h" */ INCL_SYSTEM, /* #include */ INCL_IMPORT, /* idl import "foo.idl" */ + INCL_IMPORTLIB, /* idl importlib "foo.tlb" */ INCL_CPP_QUOTE, /* idl cpp_quote("#include \"foo.h\"") */ INCL_CPP_QUOTE_SYSTEM /* idl cpp_quote("#include ") */ }; @@ -71,7 +72,7 @@ char *sourcename; /* source file name for generated headers */ struct incl_file *included_by; /* file that included this one */ int included_line; /* line where this file was included */ - int system; /* is it a system include (#include ) */ + enum incl_type type; /* type of include */ struct incl_file *owner; unsigned int files_count; /* files in use */ unsigned int files_size; /* total allocated size */ @@ -121,6 +122,8 @@ static const struct strarray empty_strarray; +enum install_rules { INSTALL_LIB, INSTALL_DEV, NB_INSTALL_RULES }; + /* variables common to all makefiles */ static struct strarray linguas; static struct strarray dll_flags; @@ -137,22 +140,26 @@ static const char *exe_ext; static const char *dll_ext; static const char *man_ext; -static const char *dll_prefix; static const char *crosstarget; static const char *fontforge; static const char *convert; static const char *rsvg; static const char *icotool; +static const char *dlltool; struct makefile { struct strarray vars; - struct strarray include_args; + struct strarray include_paths; struct strarray define_args; + struct strarray programs; + struct strarray scripts; struct strarray appmode; struct strarray imports; struct strarray delayimports; struct strarray extradllflags; + struct strarray install_lib; + struct strarray install_dev; struct list sources; struct list includes; const char *base_dir; @@ -163,6 +170,7 @@ const char *parent_dir; const char *module; const char *testdll; + const char *sharedlib; const char *staticlib; const char *importlib; int use_msvcrt; @@ -171,8 +179,7 @@ static struct makefile *top_makefile; -static const char *makefile_name = "Makefile"; -static const char *Separator = "### Dependencies"; +static const char *output_makefile_name = "Makefile"; static const char *input_file_name; static const char *output_file_name; static const char *temp_file_name; @@ -185,8 +192,7 @@ "Usage: makedep [options] directories\n" "Options:\n" " -R from to Compute the relative path between two directories\n" - " -fxxx Store output in file 'xxx' (default: Makefile)\n" - " -sxxx Use 'xxx' as separator (default: \"### Dependencies\")\n"; + " -fxxx Store output in file 'xxx' (default: Makefile)\n"; #ifndef __GNUC__ @@ -310,7 +316,7 @@ va_end(ap); if (n == -1) size *= 2; else if ((size_t)n >= size) size = n + 1; - else return p; + else return xrealloc( p, n + 1 ); free(p); } } @@ -321,8 +327,8 @@ */ static int strendswith( const char* str, const char* end ) { - int l = strlen(str); - int m = strlen(end); + size_t l = strlen( str ); + size_t m = strlen( end ); return l >= m && strcmp(str + l - m, end) == 0; } @@ -374,7 +380,7 @@ /******************************************************************* * strarray_exists */ -static int strarray_exists( struct strarray *array, const char *str ) +static int strarray_exists( const struct strarray *array, const char *str ) { unsigned int i; @@ -397,12 +403,12 @@ * * Find a value in a name/value pair string array. */ -static char *strarray_get_value( const struct strarray *array, const char *name ) +static const char *strarray_get_value( const struct strarray *array, const char *name ) { unsigned int i; for (i = 0; i < array->count; i += 2) - if (!strcmp( array->str[i], name )) return xstrdup( array->str[i + 1] ); + if (!strcmp( array->str[i], name )) return array->str[i + 1]; return NULL; } @@ -471,8 +477,8 @@ static char *replace_extension( const char *name, const char *old_ext, const char *new_ext ) { char *ret; - int name_len = strlen( name ); - int ext_len = strlen( old_ext ); + size_t name_len = strlen( name ); + size_t ext_len = strlen( old_ext ); if (name_len >= ext_len && !strcmp( name + name_len - ext_len, old_ext )) name_len -= ext_len; ret = xmalloc( name_len + strlen( new_ext ) + 1 ); @@ -483,6 +489,25 @@ /******************************************************************* + * replace_filename + */ +static char *replace_filename( const char *path, const char *name ) +{ + const char *p; + char *ret; + size_t len; + + if (!path) return xstrdup( name ); + if (!(p = strrchr( path, '/' ))) return xstrdup( name ); + len = p - path + 1; + ret = xmalloc( len + strlen( name ) + 1 ); + memcpy( ret, path, len ); + strcpy( ret + len, name ); + return ret; +} + + +/******************************************************************* * strarray_replace_extension */ static struct strarray strarray_replace_extension( const struct strarray *array, @@ -501,9 +526,9 @@ /******************************************************************* * replace_substr */ -static char *replace_substr( const char *str, const char *start, unsigned int len, const char *replace ) +static char *replace_substr( const char *str, const char *start, size_t len, const char *replace ) { - unsigned int pos = start - str; + size_t pos = start - str; char *ret = xmalloc( pos + strlen(replace) + strlen(start + len) + 1 ); memcpy( ret, str, pos ); strcpy( ret + pos, replace ); @@ -573,7 +598,7 @@ /******************************************************************* * base_dir_path */ -static char *base_dir_path( struct makefile *make, const char *path ) +static char *base_dir_path( const struct makefile *make, const char *path ) { return concat_paths( make->base_dir, path ); } @@ -582,7 +607,7 @@ /******************************************************************* * obj_dir_path */ -static char *obj_dir_path( struct makefile *make, const char *path ) +static char *obj_dir_path( const struct makefile *make, const char *path ) { return concat_paths( make->obj_dir, path ); } @@ -591,7 +616,7 @@ /******************************************************************* * src_dir_path */ -static char *src_dir_path( struct makefile *make, const char *path ) +static char *src_dir_path( const struct makefile *make, const char *path ) { if (make->src_dir) return concat_paths( make->src_dir, path ); return obj_dir_path( make, path ); @@ -601,7 +626,7 @@ /******************************************************************* * top_obj_dir_path */ -static char *top_obj_dir_path( struct makefile *make, const char *path ) +static char *top_obj_dir_path( const struct makefile *make, const char *path ) { return concat_paths( make->top_obj_dir, path ); } @@ -610,7 +635,7 @@ /******************************************************************* * top_dir_path */ -static char *top_dir_path( struct makefile *make, const char *path ) +static char *top_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 ); @@ -629,7 +654,7 @@ /******************************************************************* * tools_dir_path */ -static char *tools_dir_path( struct makefile *make, const char *path ) +static char *tools_dir_path( const struct makefile *make, const char *path ) { if (tools_dir) return top_obj_dir_path( make, strmake( "%s/tools/%s", tools_dir, path )); return top_obj_dir_path( make, strmake( "tools/%s", path )); @@ -639,7 +664,7 @@ /******************************************************************* * tools_path */ -static char *tools_path( struct makefile *make, const char *name ) +static char *tools_path( const struct makefile *make, const char *name ) { return strmake( "%s/%s%s", tools_dir_path( make, name ), name, tools_ext ); } @@ -651,7 +676,7 @@ static char *get_line( FILE *file ) { static char *buffer; - static unsigned int size; + static size_t size; if (!size) { @@ -758,7 +783,7 @@ /******************************************************************* * find_src_file */ -static struct incl_file *find_src_file( struct makefile *make, const char *name ) +static struct incl_file *find_src_file( const struct makefile *make, const char *name ) { struct incl_file *file; @@ -770,7 +795,7 @@ /******************************************************************* * find_include_file */ -static struct incl_file *find_include_file( struct makefile *make, const char *name ) +static struct incl_file *find_include_file( const struct makefile *make, const char *name ) { struct incl_file *file; @@ -785,7 +810,7 @@ * Add an include file if it doesn't already exists. */ static struct incl_file *add_include( struct makefile *make, struct incl_file *parent, - const char *name, int line, int system ) + const char *name, int line, enum incl_type type ) { struct incl_file *include; @@ -804,7 +829,7 @@ include->name = xstrdup(name); include->included_by = parent; include->included_line = line; - include->system = system; + include->type = type; list_add_tail( &make->includes, &include->entry ); found: parent->files[parent->files_count++] = include; @@ -943,6 +968,21 @@ char *p = buffer; while (*p && isspace(*p)) p++; + if (!strncmp( p, "importlib", 9 )) + { + p += 9; + while (*p && isspace(*p)) p++; + if (*p++ != '(') continue; + while (*p && isspace(*p)) p++; + if (*p++ != '"') continue; + include = p; + while (*p && (*p != '"')) p++; + if (!*p) fatal_error( "malformed importlib directive\n" ); + *p = 0; + add_dependency( source, include, INCL_IMPORTLIB ); + continue; + } + if (!strncmp( p, "import", 6 )) { p += 6; @@ -1115,6 +1155,26 @@ } +static const struct +{ + const char *ext; + void (*parse)( struct file *file, FILE *f ); +} parse_functions[] = +{ + { ".c", parse_c_file }, + { ".h", parse_c_file }, + { ".inl", parse_c_file }, + { ".l", parse_c_file }, + { ".m", parse_c_file }, + { ".rh", parse_c_file }, + { ".x", parse_c_file }, + { ".y", parse_c_file }, + { ".idl", parse_idl_file }, + { ".rc", parse_rc_file }, + { ".in", parse_in_file }, + { ".sfd", parse_sfd_file } +}; + /******************************************************************* * load_file */ @@ -1122,7 +1182,7 @@ { struct file *file; FILE *f; - unsigned int hash = hash_filename( name ); + unsigned int i, hash = hash_filename( name ); LIST_FOR_EACH_ENTRY( file, &files[hash], struct file, entry ) if (!strcmp( name, file->name )) return file; @@ -1133,15 +1193,12 @@ input_file_name = file->name; input_line = 0; - if (strendswith( name, ".idl" )) parse_idl_file( file, f ); - else if (strendswith( name, ".rc" )) parse_rc_file( file, f ); - else if (strendswith( name, ".in" )) parse_in_file( file, f ); - else if (strendswith( name, ".sfd" )) parse_sfd_file( file, f ); - else if (strendswith( name, ".c" ) || - strendswith( name, ".m" ) || - strendswith( name, ".h" ) || - strendswith( name, ".l" ) || - strendswith( name, ".y" )) parse_c_file( file, f ); + for (i = 0; i < sizeof(parse_functions) / sizeof(parse_functions[0]); i++) + { + if (!strendswith( name, parse_functions[i].ext )) continue; + parse_functions[i].parse( file, f ); + break; + } fclose( f ); input_file_name = NULL; @@ -1151,13 +1208,33 @@ /******************************************************************* - * open_file + * open_include_path_file + * + * Open a file from a directory on the include path. */ -static struct file *open_file( struct makefile *make, const char *path, char **filename ) +static struct file *open_include_path_file( const struct makefile *make, const char *dir, + const char *name, char **filename ) { - struct file *ret = load_file( base_dir_path( make, path )); + char *src_path = base_dir_path( make, concat_paths( dir, name )); + struct file *ret = load_file( src_path ); - if (ret) *filename = xstrdup( path ); + if (ret) *filename = src_dir_path( make, concat_paths( dir, name )); + return ret; +} + + +/******************************************************************* + * open_file_same_dir + * + * Open a file in the same directory as the parent. + */ +static struct file *open_file_same_dir( const struct incl_file *parent, const char *name, char **filename ) +{ + char *src_path = replace_filename( parent->file->name, name ); + struct file *ret = load_file( src_path ); + + if (ret) *filename = replace_filename( parent->filename, name ); + free( src_path ); return ret; } @@ -1167,7 +1244,7 @@ * * Open a file in the source directory of the makefile. */ -static struct file *open_local_file( struct makefile *make, const char *path, char **filename ) +static struct file *open_local_file( const struct makefile *make, const char *path, char **filename ) { char *src_path = root_dir_path( base_dir_path( make, path )); struct file *ret = load_file( src_path ); @@ -1192,7 +1269,7 @@ * * Open a file in the top-level source directory. */ -static struct file *open_global_file( struct makefile *make, const char *path, char **filename ) +static struct file *open_global_file( const struct makefile *make, const char *path, char **filename ) { char *src_path = root_dir_path( path ); struct file *ret = load_file( src_path ); @@ -1208,7 +1285,7 @@ * * Open a file in the global include source directory. */ -static struct file *open_global_header( struct makefile *make, const char *path, char **filename ) +static struct file *open_global_header( const struct makefile *make, const char *path, char **filename ) { return open_global_file( make, strmake( "include/%s", path ), filename ); } @@ -1217,7 +1294,7 @@ /******************************************************************* * open_src_file */ -static struct file *open_src_file( struct makefile *make, struct incl_file *pFile ) +static struct file *open_src_file( const struct makefile *make, struct incl_file *pFile ) { struct file *file = open_local_file( make, pFile->name, &pFile->filename ); @@ -1229,10 +1306,10 @@ /******************************************************************* * open_include_file */ -static struct file *open_include_file( struct makefile *make, struct incl_file *pFile ) +static struct file *open_include_file( const struct makefile *make, struct incl_file *pFile ) { struct file *file = NULL; - char *filename, *p; + char *filename; unsigned int i, len; errno = ENOENT; @@ -1257,6 +1334,16 @@ return file; } + /* check for corresponding tlb file in source dir */ + + if (strendswith( pFile->name, ".tlb" ) && + (file = open_local_file( make, replace_extension( pFile->name, ".tlb", ".idl" ), &filename ))) + { + pFile->sourcename = filename; + pFile->filename = obj_dir_path( make, pFile->name ); + return file; + } + /* now try in source dir */ if ((file = open_local_file( make, pFile->name, &pFile->filename ))) return file; @@ -1290,6 +1377,16 @@ return file; } + /* check for corresponding .tlb file in global includes */ + + if (strendswith( pFile->name, ".tlb" ) && + (file = open_global_header( make, replace_extension( pFile->name, ".tlb", ".idl" ), &filename ))) + { + pFile->sourcename = filename; + pFile->filename = top_obj_dir_path( make, strmake( "include/%s", pFile->name )); + return file; + } + /* check in global includes source dir */ if ((file = open_global_header( make, pFile->name, &pFile->filename ))) return file; @@ -1300,9 +1397,9 @@ return file; /* now search in include paths */ - for (i = 0; i < make->include_args.count; i++) + for (i = 0; i < make->include_paths.count; i++) { - const char *dir = make->include_args.str[i] + 2; /* skip -I */ + const char *dir = make->include_paths.str[i]; const char *prefix = make->top_src_dir ? make->top_src_dir : make->top_obj_dir; if (prefix) @@ -1318,22 +1415,14 @@ } if (*dir != '/') { - if ((file = open_file( make, concat_paths( dir, pFile->name ), &pFile->filename ))) + if ((file = open_include_path_file( make, dir, pFile->name, &pFile->filename ))) return file; } } - if (pFile->system) return NULL; /* ignore system files we cannot find */ + if (pFile->type == INCL_SYSTEM) return NULL; /* ignore system files we cannot find */ /* try in src file directory */ - if ((p = strrchr(pFile->included_by->filename, '/'))) - { - int l = p - pFile->included_by->filename + 1; - filename = xmalloc(l + strlen(pFile->name) + 1); - memcpy( filename, pFile->included_by->filename, l ); - strcpy( filename + l, pFile->name ); - if ((file = open_file( make, filename, &pFile->filename ))) return file; - free( filename ); - } + if ((file = open_file_same_dir( pFile->included_by, pFile->name, &pFile->filename ))) return file; fprintf( stderr, "%s:%d: error: ", pFile->included_by->file->name, pFile->included_line ); perror( pFile->name ); @@ -1366,10 +1455,13 @@ { case INCL_NORMAL: case INCL_IMPORT: - add_include( make, parent, file->deps[i].name, file->deps[i].line, 0 ); + add_include( make, parent, file->deps[i].name, file->deps[i].line, INCL_NORMAL ); + break; + case INCL_IMPORTLIB: + add_include( make, parent, file->deps[i].name, file->deps[i].line, INCL_IMPORTLIB ); break; case INCL_SYSTEM: - add_include( make, parent, file->deps[i].name, file->deps[i].line, 1 ); + add_include( make, parent, file->deps[i].name, file->deps[i].line, INCL_SYSTEM ); break; case INCL_CPP_QUOTE: case INCL_CPP_QUOTE_SYSTEM: @@ -1384,16 +1476,8 @@ */ static void parse_file( struct makefile *make, struct incl_file *source, int src ) { - struct file *file; - - /* don't try to open certain types of files */ - if (strendswith( source->name, ".tlb" )) - { - source->filename = obj_dir_path( make, source->name ); - return; - } + struct file *file = src ? open_src_file( make, source ) : open_include_file( make, source ); - file = src ? open_src_file( make, source ) : open_include_file( make, source ); if (!file) return; source->file = file; @@ -1407,9 +1491,11 @@ { unsigned int i; + if (strendswith( source->name, ".tlb" )) return; /* typelibs don't include anything */ + /* generated .h file always includes these */ - add_include( make, source, "rpc.h", 0, 1 ); - add_include( make, source, "rpcndr.h", 0, 1 ); + add_include( make, source, "rpc.h", 0, INCL_NORMAL ); + add_include( make, source, "rpcndr.h", 0, INCL_NORMAL ); for (i = 0; i < file->deps_count; i++) { switch (file->deps[i].type) @@ -1417,18 +1503,19 @@ case INCL_IMPORT: if (strendswith( file->deps[i].name, ".idl" )) add_include( make, source, replace_extension( file->deps[i].name, ".idl", ".h" ), - file->deps[i].line, 0 ); + file->deps[i].line, INCL_NORMAL ); else - add_include( make, source, file->deps[i].name, file->deps[i].line, 0 ); + add_include( make, source, file->deps[i].name, file->deps[i].line, INCL_NORMAL ); break; case INCL_CPP_QUOTE: - add_include( make, source, file->deps[i].name, file->deps[i].line, 0 ); + add_include( make, source, file->deps[i].name, file->deps[i].line, INCL_NORMAL ); break; case INCL_CPP_QUOTE_SYSTEM: - add_include( make, source, file->deps[i].name, file->deps[i].line, 1 ); + add_include( make, source, file->deps[i].name, file->deps[i].line, INCL_SYSTEM ); break; case INCL_NORMAL: case INCL_SYSTEM: + case INCL_IMPORTLIB: break; } } @@ -1462,11 +1549,29 @@ /******************************************************************* + * open_input_makefile + */ +static FILE *open_input_makefile( const struct makefile *make ) +{ + FILE *ret; + + if (make->base_dir) + input_file_name = root_dir_path( base_dir_path( make, strmake( "%s.in", output_makefile_name ))); + else + input_file_name = output_makefile_name; /* always use output name for main Makefile */ + + input_line = 0; + if (!(ret = fopen( input_file_name, "r" ))) fatal_perror( "open" ); + return ret; +} + + +/******************************************************************* * get_make_variable */ -static char *get_make_variable( struct makefile *make, const char *name ) +static const char *get_make_variable( const struct makefile *make, const char *name ) { - char *ret; + const char *ret; if ((ret = strarray_get_value( &cmdline_vars, name ))) return ret; if ((ret = strarray_get_value( &make->vars, name ))) return ret; @@ -1478,14 +1583,15 @@ /******************************************************************* * get_expanded_make_variable */ -static char *get_expanded_make_variable( struct makefile *make, const char *name ) +static char *get_expanded_make_variable( const struct makefile *make, const char *name ) { - char *p, *end, *var, *expand, *tmp; + const char *var; + char *p, *end, *expand, *tmp; - expand = get_make_variable( make, name ); - if (!expand) return NULL; + var = get_make_variable( make, name ); + if (!var) return NULL; - p = expand; + p = expand = xstrdup( var ); while ((p = strchr( p, '$' ))) { if (p[1] == '(') @@ -1495,24 +1601,21 @@ if (strchr( p + 2, ':' )) fatal_error( "pattern replacement not supported for '%s'\n", p + 2 ); var = get_make_variable( make, p + 2 ); tmp = replace_substr( expand, p, end - p, var ? var : "" ); - free( var ); + /* switch to the new string */ + p = tmp + (p - expand); + free( expand ); + expand = tmp; } else if (p[1] == '{') /* don't expand ${} variables */ { if (!(end = strchr( p + 2, '}' ))) fatal_error( "syntax error in '%s'\n", expand ); p = end + 1; - continue; } else if (p[1] == '$') { - tmp = replace_substr( expand, p, 2, "$" ); + p += 2; } else fatal_error( "syntax error in '%s'\n", expand ); - - /* switch to the new string */ - p = tmp + (p - expand); - free( expand ); - expand = tmp; } /* consider empty variables undefined */ @@ -1527,7 +1630,7 @@ /******************************************************************* * get_expanded_make_var_array */ -static struct strarray get_expanded_make_var_array( struct makefile *make, const char *name ) +static struct strarray get_expanded_make_var_array( const struct makefile *make, const char *name ) { struct strarray ret = empty_strarray; char *value, *token; @@ -1540,6 +1643,19 @@ /******************************************************************* + * file_local_var + */ +static char *file_local_var( const char *file, const char *name ) +{ + char *p, *var; + + var = strmake( "%s_%s", file, name ); + for (p = var; *p; p++) if (!isalnum( *p )) *p = '_'; + return var; +} + + +/******************************************************************* * set_make_variable */ static int set_make_variable( struct strarray *array, const char *assignment ) @@ -1580,10 +1696,7 @@ if (!strcmp( make->base_dir, "." )) make->base_dir = NULL; } - input_file_name = base_dir_path( make, makefile_name ); - if (!(file = fopen( input_file_name, "r" ))) fatal_perror( "open" ); - - input_line = 0; + file = open_input_makefile( make ); while ((buffer = get_line( file ))) { if (separator && !strncmp( buffer, separator, strlen(separator) )) break; @@ -1641,6 +1754,10 @@ add_dependency( file->file, replace_extension( source->name, ".idl", ".h" ), INCL_NORMAL ); add_all_includes( make, file, file->file ); } + if (source->file->flags & FLAG_IDL_TYPELIB) + { + add_generated_source( make, replace_extension( source->name, ".idl", ".tlb" ), NULL ); + } if (source->file->flags & FLAG_IDL_REGTYPELIB) { add_generated_source( make, replace_extension( source->name, ".idl", "_t.res" ), NULL ); @@ -1649,6 +1766,18 @@ { add_generated_source( make, replace_extension( source->name, ".idl", "_r.res" ), NULL ); } + if (source->file->flags & FLAG_IDL_HEADER) + { + add_generated_source( make, replace_extension( source->name, ".idl", ".h" ), NULL ); + } + if (!source->file->flags && strendswith( source->name, ".idl" )) + { + add_generated_source( make, replace_extension( source->name, ".idl", ".h" ), NULL ); + } + if (strendswith( source->name, ".x" )) + { + add_generated_source( make, replace_extension( source->name, ".x", ".h" ), NULL ); + } if (strendswith( source->name, ".y" )) { file = add_generated_source( make, replace_extension( source->name, ".y", ".tab.c" ), NULL ); @@ -1670,7 +1799,7 @@ source->files = NULL; } } - if (get_make_variable( make, "TESTDLL" )) + if (make->testdll) { file = add_generated_source( make, "testlist.o", "testlist.c" ); add_dependency( file->file, "wine/test.h", INCL_NORMAL ); @@ -1702,7 +1831,7 @@ /******************************************************************* * output_filenames_obj_dir */ -static void output_filenames_obj_dir( struct makefile *make, struct strarray array ) +static void output_filenames_obj_dir( const struct makefile *make, struct strarray array ) { unsigned int i; @@ -1711,56 +1840,232 @@ /******************************************************************* - * output_include + * get_dependencies */ -static void output_include( struct incl_file *pFile, struct incl_file *owner ) +static void get_dependencies( struct strarray *deps, struct incl_file *file, struct incl_file *source ) { - int i; + unsigned int i; + + if (!file->filename) return; + + if (file != source) + { + if (file->owner == source) return; /* already processed */ + if (file->type == INCL_IMPORTLIB && + !(source->file->flags & (FLAG_IDL_TYPELIB | FLAG_IDL_REGTYPELIB))) + return; /* library is imported only when building a typelib */ + file->owner = source; + strarray_add( deps, file->filename ); + } + for (i = 0; i < file->files_count; i++) get_dependencies( deps, file->files[i], source ); +} + + +/******************************************************************* + * get_local_dependencies + * + * Get the local dependencies of a given target. + */ +static struct strarray get_local_dependencies( const struct makefile *make, const char *name, + struct strarray targets ) +{ + unsigned int i; + struct strarray deps = get_expanded_make_var_array( make, file_local_var( name, "DEPS" )); + + for (i = 0; i < deps.count; i++) + { + if (strarray_exists( &targets, deps.str[i] )) + deps.str[i] = obj_dir_path( make, deps.str[i] ); + else + deps.str[i] = src_dir_path( make, deps.str[i] ); + } + return deps; +} + - if (pFile->owner == owner) return; - if (!pFile->filename) return; - pFile->owner = owner; - output_filename( pFile->filename ); - for (i = 0; i < pFile->files_count; i++) output_include( pFile->files[i], owner ); +/******************************************************************* + * add_install_rule + */ +static void add_install_rule( const struct makefile *make, struct strarray *install_rules, + const char *target, const char *file, const char *dest ) +{ + if (strarray_exists( &make->install_lib, target )) + { + strarray_add( &install_rules[INSTALL_LIB], file ); + strarray_add( &install_rules[INSTALL_LIB], dest ); + } + else if (strarray_exists( &make->install_dev, target )) + { + strarray_add( &install_rules[INSTALL_DEV], file ); + strarray_add( &install_rules[INSTALL_DEV], dest ); + } +} + + +/******************************************************************* + * get_include_install_path + * + * Determine the installation path for a given include file. + */ +static const char *get_include_install_path( const char *name ) +{ + if (!strncmp( name, "wine/", 5 )) return name + 5; + if (!strncmp( name, "msvcrt/", 7 )) return name; + return strmake( "windows/%s", name ); +} + + +/******************************************************************* + * get_shared_library_name + * + * Determine possible names for a shared library with a version number. + */ +static struct strarray get_shared_lib_names( const char *libname ) +{ + struct strarray ret = empty_strarray; + const char *ext, *p; + char *name, *first, *second; + size_t len = 0; + + strarray_add( &ret, libname ); + + for (p = libname; (p = strchr( p, '.' )); p++) + if ((len = strspn( p + 1, "0123456789." ))) break; + + if (!len) return ret; + ext = p + 1 + len; + if (*ext && ext[-1] == '.') ext--; + + /* keep only the first group of digits */ + name = xstrdup( libname ); + first = name + (p - libname); + if ((second = strchr( first + 1, '.' ))) + { + strcpy( second, ext ); + strarray_add( &ret, xstrdup( name )); + } + /* now remove all digits */ + strcpy( first, ext ); + strarray_add( &ret, name ); + return ret; +} + + +/******************************************************************* + * output_install_rules + * + * Rules are stored as a (file,dest) pair of values. + * The first char of dest indicates the type of install. + */ +static struct strarray output_install_rules( const struct makefile *make, struct strarray files, + const char *target, struct strarray *phony_targets ) +{ + unsigned int i; + char *install_sh; + struct strarray uninstall = empty_strarray; + struct strarray targets = empty_strarray; + + if (!files.count) return uninstall; + + for (i = 0; i < files.count; i += 2) + if (strchr( "dps", files.str[i + 1][0] )) /* only for files copied from object dir */ + strarray_add_uniq( &targets, files.str[i] ); + + output( "install %s::", target ); + output_filenames_obj_dir( make, targets ); + output( "\n" ); + + install_sh = top_dir_path( make, "tools/install-sh" ); + for (i = 0; i < files.count; i += 2) + { + const char *file = files.str[i]; + const char *dest = files.str[i + 1]; + + switch (*dest) + { + case 'd': /* data file */ + output( "\t%s -m 644 $(INSTALL_DATA_FLAGS) %s $(DESTDIR)%s\n", + install_sh, obj_dir_path( make, file ), dest + 1 ); + break; + case 'D': /* data file in source dir */ + output( "\t%s -m 644 $(INSTALL_DATA_FLAGS) %s $(DESTDIR)%s\n", + install_sh, src_dir_path( make, file ), dest + 1 ); + break; + case 'p': /* program file */ + output( "\tSTRIPPROG=\"$(STRIP)\" %s $(INSTALL_PROGRAM_FLAGS) %s $(DESTDIR)%s\n", + install_sh, obj_dir_path( make, file ), dest + 1 ); + break; + case 's': /* script */ + output( "\t%s $(INSTALL_SCRIPT_FLAGS) %s $(DESTDIR)%s\n", + install_sh, obj_dir_path( make, file ), dest + 1 ); + break; + case 'S': /* script in source dir */ + output( "\t%s $(INSTALL_SCRIPT_FLAGS) %s $(DESTDIR)%s\n", + install_sh, src_dir_path( make, file ), dest + 1 ); + break; + case 'y': /* symlink */ + output( "\trm -f $(DESTDIR)%s && $(LN_S) %s $(DESTDIR)%s\n", dest + 1, file, dest + 1 ); + break; + default: + assert(0); + } + } + + for (i = 0; i < files.count; i += 2) + strarray_add( &uninstall, strmake( "$(DESTDIR)%s", files.str[i + 1] + 1 )); + + strarray_add_uniq( phony_targets, "install" ); + strarray_add_uniq( phony_targets, target ); + return uninstall; } /******************************************************************* * output_sources */ -static struct strarray output_sources( struct makefile *make, struct strarray *testlist_files ) +static struct strarray output_sources( const struct makefile *make, struct strarray *testlist_files ) { struct incl_file *source; - unsigned int i; + unsigned int i, j; struct strarray object_files = empty_strarray; struct strarray crossobj_files = empty_strarray; struct strarray res_files = empty_strarray; struct strarray clean_files = empty_strarray; + struct strarray uninstall_files = empty_strarray; struct strarray po_files = empty_strarray; struct strarray mo_files = empty_strarray; struct strarray mc_files = empty_strarray; struct strarray ok_files = empty_strarray; + struct strarray in_files = empty_strarray; struct strarray dlldata_files = empty_strarray; struct strarray c2man_files = empty_strarray; struct strarray implib_objs = empty_strarray; struct strarray includes = empty_strarray; struct strarray subdirs = empty_strarray; struct strarray phony_targets = empty_strarray; - struct strarray all_targets = get_expanded_make_var_array( make, "PROGRAMS" ); + struct strarray all_targets = empty_strarray; + struct strarray install_rules[NB_INSTALL_RULES]; + char *ldrpath_local = get_expanded_make_variable( make, "LDRPATH_LOCAL" ); + char *ldrpath_install = get_expanded_make_variable( make, "LDRPATH_INSTALL" ); + + for (i = 0; i < NB_INSTALL_RULES; i++) install_rules[i] = empty_strarray; for (i = 0; i < linguas.count; i++) strarray_add( &mo_files, strmake( "%s/%s.mo", top_obj_dir_path( make, "po" ), linguas.str[i] )); + strarray_add( &phony_targets, "all" ); strarray_add( &includes, strmake( "-I%s", obj_dir_path( make, "" ))); 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 ))); - if (make->top_obj_dir) strarray_add( &includes, strmake( "-I%s", top_obj_dir_path( make, "include" ))); + 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" ))); - strarray_addall( &includes, make->include_args ); + for (i = 0; i < make->include_paths.count; i++) + strarray_add( &includes, strmake( "-I%s", obj_dir_path( make, make->include_paths.str[i] ))); LIST_FOR_EACH_ENTRY( source, &make->sources, struct incl_file, entry ) { + struct strarray dependencies = empty_strarray; struct strarray extradefs; char *obj = xstrdup( source->name ); char *ext = get_extension( obj ); @@ -1775,7 +2080,8 @@ strarray_add_uniq( &subdirs, subdir ); } - extradefs = get_expanded_make_var_array( make, strmake( "%s_EXTRADEFS", obj )); + extradefs = get_expanded_make_var_array( make, file_local_var( obj, "EXTRADEFS" )); + get_dependencies( &dependencies, source, source ); if (!strcmp( ext, "y" )) /* yacc file */ { @@ -1794,7 +2100,6 @@ else output( "%s.tab.c: %s\n", obj, source->filename ); output( "\t$(BISON) -p %s_ -o $@ %s\n", obj, source->filename ); - continue; /* no dependencies */ } else if (!strcmp( ext, "x" )) /* template file */ { @@ -1802,14 +2107,20 @@ tools_dir_path( make, "make_xftmpl" ), tools_ext, source->filename ); output( "\t%s%s -H -o $@ %s\n", tools_dir_path( make, "make_xftmpl" ), tools_ext, source->filename ); - strarray_add( &clean_files, strmake( "%s.h", obj )); - continue; /* no dependencies */ + if (source->file->flags & FLAG_INSTALL) + { + strarray_add( &install_rules[INSTALL_DEV], source->name ); + strarray_add( &install_rules[INSTALL_DEV], + strmake( "D$(includedir)/%s", get_include_install_path( source->name ) )); + strarray_add( &install_rules[INSTALL_DEV], strmake( "%s.h", obj )); + strarray_add( &install_rules[INSTALL_DEV], + strmake( "d$(includedir)/%s.h", get_include_install_path( obj ) )); + } } else if (!strcmp( ext, "l" )) /* lex file */ { output( "%s.yy.c: %s\n", obj_dir_path( make, obj ), source->filename ); output( "\t$(FLEX) -o$@ %s\n", source->filename ); - continue; /* no dependencies */ } else if (!strcmp( ext, "rc" )) /* resource file */ { @@ -1840,6 +2151,8 @@ output( "\n" ); } output( "%s.res:", obj_dir_path( make, obj )); + output_filenames( dependencies ); + output( "\n" ); } else if (!strcmp( ext, "mc" )) /* message file */ { @@ -1859,14 +2172,16 @@ } else output( "\n" ); output( "%s.res:", obj_dir_path( make, obj )); + output_filenames( dependencies ); + output( "\n" ); } else if (!strcmp( ext, "idl" )) /* IDL file */ { struct strarray targets = empty_strarray; char *dest; - if (!source->file->flags || find_include_file( make, strmake( "%s.h", obj ))) - source->file->flags |= FLAG_IDL_HEADER; + if (!source->file->flags) source->file->flags |= FLAG_IDL_HEADER | FLAG_INSTALL; + if (find_include_file( make, strmake( "%s.h", obj ))) source->file->flags |= FLAG_IDL_HEADER; for (i = 0; i < sizeof(idl_outputs) / sizeof(idl_outputs[0]); i++) { @@ -1876,6 +2191,19 @@ strarray_add( &targets, dest ); } if (source->file->flags & FLAG_IDL_PROXY) strarray_add( &dlldata_files, source->name ); + if (source->file->flags & FLAG_INSTALL) + { + strarray_add( &install_rules[INSTALL_DEV], xstrdup( source->name )); + strarray_add( &install_rules[INSTALL_DEV], + strmake( "D$(includedir)/%s.idl", get_include_install_path( obj ) )); + if (source->file->flags & FLAG_IDL_HEADER) + { + strarray_add( &install_rules[INSTALL_DEV], strmake( "%s.h", obj )); + strarray_add( &install_rules[INSTALL_DEV], + strmake( "d$(includedir)/%s.h", get_include_install_path( obj ) )); + } + } + if (!targets.count) continue; output_filenames_obj_dir( make, targets ); output( ": %s\n", tools_path( make, "widl" )); output( "\t%s -o $@", tools_path( make, "widl" ) ); @@ -1888,34 +2216,42 @@ output( "\n" ); output_filenames_obj_dir( make, targets ); output( ": %s", source->filename ); + output_filenames( dependencies ); + output( "\n" ); } else if (!strcmp( ext, "in" )) /* .in file or man page */ { if (strendswith( obj, ".man" ) && source->file->args) { + struct strarray symlinks; char *dir, *dest = replace_extension( obj, ".man", "" ); char *lang = strchr( dest, '.' ); char *section = source->file->args; if (lang) { *lang++ = 0; - dir = strmake( "$(DESTDIR)$(mandir)/%s/man%s", lang, section ); + dir = strmake( "$(mandir)/%s/man%s", lang, section ); } - else dir = strmake( "$(DESTDIR)$(mandir)/man%s", section ); - output( "install-man-pages:: %s\n", obj_dir_path( make, obj )); - output( "\t$(INSTALL_DATA) %s %s/%s.%s\n", obj_dir_path( make, obj ), dir, dest, section ); - output( "uninstall::\n" ); - output( "\t$(RM) %s/%s.%s\n", dir, dest, section ); + else dir = strmake( "$(mandir)/man%s", section ); + add_install_rule( make, install_rules, dest, xstrdup(obj), + strmake( "d%s/%s.%s", dir, dest, section )); + symlinks = get_expanded_make_var_array( make, file_local_var( dest, "SYMLINKS" )); + for (i = 0; i < symlinks.count; i++) + add_install_rule( make, install_rules, symlinks.str[i], + strmake( "%s.%s", dest, section ), + strmake( "y%s/%s.%s", dir, symlinks.str[i], section )); free( dest ); free( dir ); - strarray_add( &all_targets, xstrdup(obj) ); - strarray_add_uniq( &phony_targets, "install-man-pages" ); - strarray_add_uniq( &phony_targets, "uninstall" ); } - else strarray_add( &clean_files, xstrdup(obj) ); + strarray_add( &in_files, xstrdup(obj) ); + strarray_add( &all_targets, xstrdup(obj) ); output( "%s: %s\n", obj_dir_path( make, obj ), source->filename ); - output( "\t$(SED_CMD) %s >$@ || ($(RM) $@ && false)\n", source->filename ); + output( "\t$(SED_CMD) %s >$@ || (rm -f $@ && false)\n", source->filename ); output( "%s:", obj_dir_path( make, obj )); + output_filenames( dependencies ); + output( "\n" ); + add_install_rule( make, install_rules, obj, xstrdup( obj ), + strmake( "d$(datadir)/wine/%s", obj )); } else if (!strcmp( ext, "sfd" )) /* font file */ { @@ -1929,10 +2265,8 @@ } if (source->file->flags & FLAG_INSTALL) { - output( "install install-lib::\n" ); - output( "\t$(INSTALL_DATA) %s $(DESTDIR)$(fontdir)/%s.ttf\n", ttf_file, obj ); - output( "uninstall::\n" ); - output( "\t$(RM) $(DESTDIR)$(fontdir)/%s.ttf\n", obj ); + strarray_add( &install_rules[INSTALL_LIB], strmake( "%s.ttf", obj )); + strarray_add( &install_rules[INSTALL_LIB], strmake( "D$(fontdir)/%s.ttf", obj )); } if (source->file->flags & FLAG_SFD_FONTS) { @@ -1947,20 +2281,10 @@ output( "%s: %s %s\n", obj_dir_path( make, font ), tools_path( make, "sfnt2fon" ), ttf_file ); output( "\t%s -o $@ %s %s\n", tools_path( make, "sfnt2fon" ), ttf_file, args ); - output( "install install-lib:: %s\n", font ); - output( "\t$(INSTALL_DATA) %s $(DESTDIR)$(fontdir)/%s\n", - obj_dir_path( make, font ), font ); - output( "uninstall::\n" ); - output( "\t$(RM) $(DESTDIR)$(fontdir)/%s\n", font ); + strarray_add( &install_rules[INSTALL_LIB], xstrdup(font) ); + strarray_add( &install_rules[INSTALL_LIB], strmake( "d$(fontdir)/%s", font )); } } - if (source->file->flags & (FLAG_INSTALL | FLAG_SFD_FONTS)) - { - strarray_add_uniq( &phony_targets, "install" ); - strarray_add_uniq( &phony_targets, "install-lib" ); - strarray_add_uniq( &phony_targets, "uninstall" ); - } - continue; /* no dependencies */ } else if (!strcmp( ext, "svg" )) /* svg file */ { @@ -1971,12 +2295,27 @@ output( "\tCONVERT=\"%s\" ICOTOOL=\"%s\" RSVG=\"%s\" %s %s $@\n", convert, icotool, rsvg, top_dir_path( make, "tools/buildimage" ), source->filename ); } - continue; /* no dependencies */ } else if (!strcmp( ext, "res" )) { strarray_add( &res_files, source->name ); - continue; /* no dependencies */ + } + else if (!strcmp( ext, "tlb" )) + { + strarray_add( &all_targets, source->name ); + } + else if (!strcmp( ext, "h" ) || !strcmp( ext, "rh" ) || !strcmp( ext, "inl" )) /* header file */ + { + if (source->file->flags & FLAG_GENERATED) + { + strarray_add( &all_targets, source->name ); + } + else + { + strarray_add( &install_rules[INSTALL_DEV], source->name ); + strarray_add( &install_rules[INSTALL_DEV], + strmake( "D$(includedir)/%s", get_include_install_path( source->name ) )); + } } else { @@ -2029,11 +2368,10 @@ output( "%s.o", obj_dir_path( make, obj )); if (crosstarget && need_cross) output( " %s.cross.o", obj_dir_path( make, obj )); output( ":" ); + output_filenames( dependencies ); + output( "\n" ); } free( obj ); - - for (i = 0; i < source->files_count; i++) output_include( source->files[i], source ); - output( "\n" ); } /* rules for files that depend on multiple sources */ @@ -2097,11 +2435,17 @@ { strarray_add( &all_targets, strmake( "%s%s", make->module, dll_ext )); strarray_add( &all_targets, strmake( "%s.fake", make->module )); + add_install_rule( make, install_rules, make->module, strmake( "%s%s", make->module, dll_ext ), + strmake( "p$(dlldir)/%s%s", make->module, dll_ext )); + add_install_rule( make, install_rules, make->module, strmake( "%s.fake", make->module ), + strmake( "d$(fakedlldir)/%s", make->module )); output( "%s%s %s.fake:", module_path, dll_ext, module_path ); } else { strarray_add( &all_targets, make->module ); + add_install_rule( make, install_rules, make->module, make->module, + strmake( "p$(%s)/%s", spec_file ? "dlldir" : "bindir", make->module )); output( "%s:", module_path ); } if (spec_file) output_filename( spec_file ); @@ -2136,17 +2480,23 @@ output_filenames( target_flags ); if (make->is_win16) output_filename( "-m16" ); output( "\n" ); + 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( "\t$(RM) $@\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 @@ -2159,6 +2509,9 @@ output_filenames( target_flags ); output_filenames_obj_dir( make, implib_objs ); output( "\n" ); + add_install_rule( make, install_rules, make->importlib, + strmake( "lib%s.a", make->importlib ), + strmake( "d$(dlldir)/lib%s.a", make->importlib )); } if (crosstarget && !make->is_win16) { @@ -2217,6 +2570,12 @@ } else output( "manpages htmlpages sgmlpages xmlpages::\n" ); } + else if (*dll_ext) + { + char *binary = replace_extension( make->module, ".exe", "" ); + add_install_rule( make, install_rules, binary, tools_dir_path( make, "wineapploader" ), + strmake( "s$(bindir)/%s", binary )); + } } if (make->staticlib) @@ -2224,7 +2583,7 @@ strarray_add( &all_targets, make->staticlib ); output( "%s:", obj_dir_path( make, make->staticlib )); output_filenames_obj_dir( make, object_files ); - output( "\n\t$(RM) $@\n" ); + output( "\n\trm -f $@\n" ); output( "\t$(AR) $(ARFLAGS) $@" ); output_filenames_obj_dir( make, object_files ); output( "\n\t$(RANLIB) $@\n" ); @@ -2235,13 +2594,60 @@ strarray_add( &all_targets, name ); output( "%s:", obj_dir_path( make, name )); output_filenames_obj_dir( make, crossobj_files ); - output( "\n\t$(RM) $@\n" ); + output( "\n\trm -f $@\n" ); output( "\t%s-ar $(ARFLAGS) $@", crosstarget ); output_filenames_obj_dir( make, crossobj_files ); output( "\n\t%s-ranlib $@\n", crosstarget ); } } + if (make->sharedlib) + { + char *basename, *p; + struct strarray names = get_shared_lib_names( make->sharedlib ); + struct strarray all_libs = empty_strarray; + + basename = xstrdup( make->sharedlib ); + if ((p = strchr( basename, '.' ))) *p = 0; + + strarray_addall( &all_libs, get_expanded_make_var_array( make, + file_local_var( basename, "LDFLAGS" ))); + strarray_addall( &all_libs, get_expanded_make_var_array( make, "EXTRALIBS" )); + strarray_addall( &all_libs, libs ); + + output( "%s:", obj_dir_path( make, make->sharedlib )); + output_filenames_obj_dir( make, object_files ); + output_filenames( get_local_dependencies( make, basename, in_files )); + output( "\n" ); + output( "\t$(CC) -o $@" ); + output_filenames_obj_dir( make, object_files ); + output_filenames( all_libs ); + output_filename( "$(LDFLAGS)" ); + output( "\n" ); + add_install_rule( make, install_rules, make->sharedlib, make->sharedlib, + strmake( "p$(libdir)/%s", make->sharedlib )); + for (i = 1; i < names.count; i++) + { + output( "%s: %s\n", obj_dir_path( make, names.str[i] ), obj_dir_path( make, names.str[i-1] )); + output( "\trm -f $@ && $(LN_S) %s $@\n", names.str[i-1] ); + add_install_rule( make, install_rules, names.str[i], names.str[i-1], + strmake( "y$(libdir)/%s", names.str[i] )); + } + strarray_addall( &all_targets, names ); + } + + if (make->importlib && !make->module) /* stand-alone import lib (for libwine) */ + { + char *def_file = replace_extension( make->importlib, ".a", ".def" ); + + if (!strncmp( def_file, "lib", 3 )) def_file += 3; + output( "%s: %s\n", obj_dir_path( make, make->importlib ), src_dir_path( make, def_file )); + output( "\t%s -l $@ -d %s\n", dlltool, src_dir_path( make, def_file )); + add_install_rule( make, install_rules, make->importlib, make->importlib, + strmake( "d$(libdir)/%s", make->importlib )); + strarray_add( &all_targets, make->importlib ); + } + if (make->testdll) { char *testmodule = replace_extension( make->testdll, ".dll", "_test.exe" ); @@ -2251,7 +2657,7 @@ for (i = 0; i < make->imports.count; i++) strarray_add( &all_libs, strmake( "-l%s", make->imports.str[i] )); - strarray_addall( &all_libs, get_expanded_make_var_array( make, "LIBS" )); + strarray_addall( &all_libs, libs ); strarray_add( &all_targets, strmake( "%s%s", testmodule, dll_ext )); strarray_add( &clean_files, strmake( "%s%s", stripped, dll_ext )); @@ -2321,7 +2727,7 @@ output_filenames_obj_dir( make, ok_files ); output( "\n" ); output( "testclean::\n" ); - output( "\t$(RM)" ); + output( "\trm -f" ); output_filenames_obj_dir( make, ok_files ); output( "\n" ); strarray_addall( &clean_files, ok_files ); @@ -2331,6 +2737,75 @@ *testlist_files = strarray_replace_extension( &ok_files, ".ok", "" ); } + for (i = 0; i < make->programs.count; i++) + { + char *program_installed = NULL; + char *program = strmake( "%s%s", make->programs.str[i], exe_ext ); + struct strarray all_libs = empty_strarray; + struct strarray deps = get_local_dependencies( make, make->programs.str[i], in_files ); + struct strarray objs = get_expanded_make_var_array( make, + file_local_var( make->programs.str[i], "OBJS" )); + struct strarray symlinks = get_expanded_make_var_array( make, + file_local_var( make->programs.str[i], "SYMLINKS" )); + + if (!objs.count) objs = object_files; + output( "%s:", obj_dir_path( make, program ) ); + output_filenames_obj_dir( make, objs ); + output_filenames( deps ); + output( "\n" ); + output( "\t$(CC) -o $@" ); + output_filenames_obj_dir( make, objs ); + strarray_add( &all_libs, top_obj_dir_path( make, "libs/port/libwine_port.a" )); + strarray_addall( &all_libs, get_expanded_make_var_array( make, "EXTRALIBS" )); + strarray_addall( &all_libs, libs ); + strarray_addall( &all_libs, get_expanded_make_var_array( make, + file_local_var( make->programs.str[i], "LDFLAGS" ))); + + if (strarray_exists( &all_libs, "-lwine" )) + { + strarray_add( &all_libs, strmake( "-L%s", top_obj_dir_path( make, "libs/wine" ))); + if (ldrpath_local && ldrpath_install) + { + program_installed = strmake( "%s-installed%s", make->programs.str[i], exe_ext ); + output_filename( ldrpath_local ); + output_filenames( all_libs ); + output_filename( "$(LDFLAGS)" ); + output( "\n" ); + output( "%s:", obj_dir_path( make, program_installed ) ); + output_filenames_obj_dir( make, objs ); + output_filenames( deps ); + output( "\n" ); + output( "\t$(CC) -o $@" ); + output_filenames_obj_dir( make, objs ); + output_filename( ldrpath_install ); + strarray_add( &all_targets, program_installed ); + } + } + + output_filenames( all_libs ); + output_filename( "$(LDFLAGS)" ); + output( "\n" ); + strarray_add( &all_targets, program ); + + if (symlinks.count) + { + output_filenames_obj_dir( make, symlinks ); + output( ": %s\n", obj_dir_path( make, program )); + output( "\trm -f $@ && $(LN_S) %s $@\n", obj_dir_path( make, program )); + strarray_addall( &all_targets, symlinks ); + } + + add_install_rule( make, install_rules, program, program_installed ? program_installed : program, + strmake( "p$(bindir)/%s", program )); + for (j = 0; j < symlinks.count; j++) + add_install_rule( make, install_rules, symlinks.str[j], program, + strmake( "y$(bindir)/%s%s", symlinks.str[j], exe_ext )); + } + + for (i = 0; i < make->scripts.count; i++) + add_install_rule( make, install_rules, make->scripts.str[i], make->scripts.str[i], + strmake( "S$(bindir)/%s", make->scripts.str[i] )); + if (all_targets.count) { output( "all:" ); @@ -2338,6 +2813,19 @@ output( "\n" ); } + strarray_addall( &uninstall_files, output_install_rules( make, install_rules[INSTALL_LIB], + "install-lib", &phony_targets )); + strarray_addall( &uninstall_files, output_install_rules( make, install_rules[INSTALL_DEV], + "install-dev", &phony_targets )); + if (uninstall_files.count) + { + output( "uninstall::\n" ); + output( "\trm -f" ); + output_filenames( uninstall_files ); + output( "\n" ); + strarray_add_uniq( &phony_targets, "uninstall" ); + } + strarray_addall( &clean_files, object_files ); strarray_addall( &clean_files, crossobj_files ); strarray_addall( &clean_files, res_files ); @@ -2347,7 +2835,7 @@ if (clean_files.count) { output( "%s::\n", obj_dir_path( make, "clean" )); - output( "\t$(RM)" ); + output( "\trm -f" ); output_filenames_obj_dir( make, clean_files ); output( "\n" ); if (make->obj_dir) output( "__clean__: %s\n", obj_dir_path( make, "clean" )); @@ -2513,38 +3001,48 @@ /******************************************************************* + * output_top_variables + */ +static void output_top_variables( const struct makefile *make ) +{ + unsigned int i; + struct strarray *vars = &top_makefile->vars; + + if (!make->base_dir) return; /* don't output variables in the top makefile */ + + output( "# Automatically generated by make depend; DO NOT EDIT!!\n\n" ); + output( "all:\n\n" ); + for (i = 0; i < vars->count; i += 2) + output( "%s = %s\n", vars->str[i], get_make_variable( make, vars->str[i] )); + output( "\n" ); +} + + +/******************************************************************* * output_dependencies */ -static void output_dependencies( struct makefile *make, const char *path ) +static void output_dependencies( const struct makefile *make ) { struct strarray targets, testlist_files = empty_strarray, ignore_files = empty_strarray; + char buffer[1024]; + FILE *src_file; - if (Separator && ((output_file = fopen( path, "r" )))) - { - char buffer[1024]; - FILE *tmp_file = create_temp_file( path ); - int found = 0; - - while (fgets( buffer, sizeof(buffer), output_file ) && !found) - { - if (fwrite( buffer, 1, strlen(buffer), tmp_file ) != strlen(buffer)) fatal_perror( "write" ); - found = !strncmp( buffer, Separator, strlen(Separator) ); - } - if (fclose( output_file )) fatal_perror( "write" ); - output_file = tmp_file; - if (!found) output( "\n%s\n", Separator ); - } - else - { - if (!(output_file = fopen( path, Separator ? "a" : "w" ))) - fatal_perror( "%s", path ); - } + output_file_name = base_dir_path( make, output_makefile_name ); + output_file = create_temp_file( output_file_name ); + output_top_variables( make ); + + /* copy the contents of the source makefile */ + src_file = open_input_makefile( make ); + while (fgets( buffer, sizeof(buffer), src_file )) + if (fwrite( buffer, 1, strlen(buffer), output_file ) != strlen(buffer)) fatal_perror( "write" ); + if (fclose( src_file )) fatal_perror( "close" ); + input_file_name = NULL; targets = output_sources( make, &testlist_files ); fclose( output_file ); output_file = NULL; - if (temp_file_name) rename_temp_file( path ); + rename_temp_file( output_file_name ); strarray_add( &ignore_files, ".gitignore" ); strarray_add( &ignore_files, "Makefile" ); @@ -2555,6 +3053,8 @@ output_testlist( base_dir_path( make, "testlist.c" ), testlist_files ); if (!make->src_dir && make->base_dir) output_gitignore( base_dir_path( make, ".gitignore" ), ignore_files ); + + output_file_name = NULL; } @@ -2572,6 +3072,7 @@ "IDL_SRCS", "BISON_SRCS", "LEX_SRCS", + "HEADER_SRCS", "XTEMPLATE_SRCS", "SVG_SRCS", "FONT_SRCS", @@ -2585,7 +3086,7 @@ struct incl_file *file; struct makefile *make; - make = parse_makefile( path, Separator ); + make = parse_makefile( path, NULL ); if (root_src_dir) { @@ -2599,13 +3100,18 @@ make->parent_dir = get_expanded_make_variable( make, "PARENTSRC" ); make->module = get_expanded_make_variable( make, "MODULE" ); make->testdll = get_expanded_make_variable( make, "TESTDLL" ); + make->sharedlib = get_expanded_make_variable( make, "SHAREDLIB" ); make->staticlib = get_expanded_make_variable( make, "STATICLIB" ); make->importlib = get_expanded_make_variable( make, "IMPORTLIB" ); + make->programs = get_expanded_make_var_array( make, "PROGRAMS" ); + make->scripts = get_expanded_make_var_array( make, "SCRIPTS" ); make->appmode = get_expanded_make_var_array( make, "APPMODE" ); make->imports = get_expanded_make_var_array( make, "IMPORTS" ); make->delayimports = get_expanded_make_var_array( make, "DELAYIMPORTS" ); make->extradllflags = get_expanded_make_var_array( make, "EXTRADLLFLAGS" ); + make->install_lib = get_expanded_make_var_array( make, "INSTALL_LIB" ); + make->install_dev = get_expanded_make_var_array( make, "INSTALL_DEV" ); if (make->module && strendswith( make->module, ".a" )) make->staticlib = make->module; @@ -2613,16 +3119,19 @@ make->use_msvcrt = strarray_exists( &make->appmode, "-mno-cygwin" ); for (i = 0; i < make->imports.count && !make->use_msvcrt; i++) - make->use_msvcrt = !strncmp( make->imports.str[i], "msvcr", 5 ); + make->use_msvcrt = !strncmp( make->imports.str[i], "msvcr", 5 ) || + !strcmp( make->imports.str[i], "ucrtbase" ); - make->include_args = empty_strarray; + if (make->module && !make->install_lib.count) strarray_add( &make->install_lib, make->module ); + + make->include_paths = empty_strarray; make->define_args = empty_strarray; strarray_add( &make->define_args, "-D__WINESRC__" ); value = get_expanded_make_var_array( make, "EXTRAINCL" ); for (i = 0; i < value.count; i++) if (!strncmp( value.str[i], "-I", 2 )) - strarray_add_uniq( &make->include_args, value.str[i] ); + strarray_add_uniq( &make->include_paths, value.str[i] + 2 ); else strarray_add_uniq( &make->define_args, value.str[i] ); strarray_addall( &make->define_args, get_expanded_make_var_array( make, "EXTRADEFS" )); @@ -2630,6 +3139,9 @@ list_init( &make->sources ); list_init( &make->includes ); + /* FIXME: target dir has to exist to allow locating srcdir-relative include files */ + if (make->base_dir) create_dir( make->base_dir ); + for (var = source_vars; *var; var++) { value = get_expanded_make_var_array( make, *var ); @@ -2650,9 +3162,7 @@ LIST_FOR_EACH_ENTRY( file, &make->includes, struct incl_file, entry ) parse_file( make, file, 0 ); - output_file_name = base_dir_path( make, makefile_name ); - output_dependencies( make, output_file_name ); - output_file_name = NULL; + output_dependencies( make ); } @@ -2692,15 +3202,11 @@ switch(opt[1]) { case 'f': - if (opt[2]) makefile_name = opt + 2; + if (opt[2]) output_makefile_name = opt + 2; break; case 'R': relative_dir_mode = 1; break; - case 's': - if (opt[2]) Separator = opt + 2; - else Separator = NULL; - break; default: fprintf( stderr, "Unknown option '%s'\n%s", opt, Usage ); exit(1); @@ -2736,7 +3242,7 @@ if (argc != 3) { - fprintf( stderr, "Option -r needs two directories\n%s", Usage ); + fprintf( stderr, "Option -R needs two directories\n%s", Usage ); exit( 1 ); } relpath = get_relative_path( argv[1], argv[2] ); @@ -2775,17 +3281,17 @@ exe_ext = get_expanded_make_variable( top_makefile, "EXEEXT" ); man_ext = get_expanded_make_variable( top_makefile, "api_manext" ); dll_ext = (exe_ext && !strcmp( exe_ext, ".exe" )) ? "" : ".so"; - dll_prefix = get_expanded_make_variable( top_makefile, "DLLPREFIX" ); crosstarget = get_expanded_make_variable( top_makefile, "CROSSTARGET" ); fontforge = get_expanded_make_variable( top_makefile, "FONTFORGE" ); convert = get_expanded_make_variable( top_makefile, "CONVERT" ); rsvg = get_expanded_make_variable( top_makefile, "RSVG" ); icotool = get_expanded_make_variable( top_makefile, "ICOTOOL" ); + dlltool = get_expanded_make_variable( top_makefile, "DLLTOOL" ); if (root_src_dir && !strcmp( root_src_dir, "." )) root_src_dir = NULL; if (tools_dir && !strcmp( tools_dir, "." )) tools_dir = NULL; + if (!exe_ext) exe_ext = ""; if (!tools_ext) tools_ext = ""; - if (!dll_prefix) dll_prefix = ""; if (!man_ext) man_ext = "3w"; for (i = 1; i < argc; i++) update_makefile( argv[i] ); diff -Nru wine1.7-1.7.50/tools/Makefile.in wine1.7-1.7.55/tools/Makefile.in --- wine1.7-1.7.50/tools/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/tools/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -1,30 +1,8 @@ PROGRAMS = \ - make_xftmpl$(EXEEXT) - -MANPAGES = \ - winemaker.de.UTF-8.man.in \ - winemaker.fr.UTF-8.man.in \ - winemaker.man.in + make_xftmpl C_SRCS = \ - make_xftmpl.c \ - makedep.c + make_xftmpl.c IN_SRCS = \ wineapploader.in - -all: wineapploader - -make_xftmpl$(EXEEXT): make_xftmpl.o - $(CC) $(CFLAGS) -o $@ make_xftmpl.o $(LIBPORT) $(LDFLAGS) - -.PHONY: install install-lib install-dev uninstall - -install install-lib:: - $(INSTALL_DATA) $(srcdir)/wine.desktop $(DESTDIR)$(datadir)/applications/wine.desktop - -install install-dev:: install-man-pages - $(INSTALL_SCRIPT) $(srcdir)/winemaker $(DESTDIR)$(bindir)/winemaker - -uninstall:: - $(RM) $(DESTDIR)$(datadir)/applications/wine.desktop $(DESTDIR)$(bindir)/winemaker diff -Nru wine1.7-1.7.50/tools/make_makefiles wine1.7-1.7.55/tools/make_makefiles --- wine1.7-1.7.50/tools/make_makefiles 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/tools/make_makefiles 2015-11-13 14:32:40.000000000 +0000 @@ -21,28 +21,6 @@ use strict; -# Programs that we want to install in the bin directory too -my %bin_install = -( - "msiexec" => 1, - "notepad" => 1, - "regedit" => 1, - "regsvr32" => 1, - "wineboot" => 1, - "winecfg" => 1, - "wineconsole" => 1, - "winedbg" => 1, - "winefile" => 1, - "winemine" => 1, - "winepath" => 1, -); - -# Programs that we don't want to install at all -my %dont_install = -( - "winetest" => 1, -); - # Dlls and programs that are 16-bit specific my %modules16 = ( @@ -69,47 +47,12 @@ "wine/svcctl.idl" => 1, ); -my %private_idl_headers = ( - "access.idl" => 1, - "asynot.idl" => 1, - "asysta.idl" => 1, - "axcore.idl" => 1, - "axextend.idl" => 1, - "binres.idl" => 1, - "chprst.idl" => 1, - "cmdbas.idl" => 1, - "cmdtxt.idl" => 1, - "crtrow.idl" => 1, - "dbccmd.idl" => 1, - "dbcses.idl" => 1, - "dbdsad.idl" => 1, - "dbinit.idl" => 1, - "dbprop.idl" => 1, - "dbs.idl" => 1, - "devenum.idl" => 1, - "dyngraph.idl" => 1, - "errrec.idl" => 1, - "opnrst.idl" => 1, - "row.idl" => 1, - "rowchg.idl" => 1, - "rowpos.idl" => 1, - "rowpsc.idl" => 1, - "rstbas.idl" => 1, - "rstinf.idl" => 1, - "rstloc.idl" => 1, - "rstnot.idl" => 1, - "srcrst.idl" => 1, - "sesprp.idl" => 1, - "vmrender.idl" => 1, - "xmldom.idl" => 1, - "xmldso.idl" => 1, - "wine/winedxgi.idl" => 1, -); - my %ignored_source_files = ( "dlls/wineps.drv/afm2c.c" => 1, "dlls/wineps.drv/mkagl.c" => 1, + "include/config.h.in" => 1, "programs/winetest/dist.rc" => 1, + "tools/makedep.c" => 1, ); my (@linguas, @makefiles, %makefiles); @@ -257,6 +200,10 @@ while (/\\$/) { chop; $_ .= ; chomp; } # merge continued lines next if (/^\s*$/); + if (/\@[A-Z_]+\@/) # config.status substitution variable + { + die "Configure substitution is not allowed in $file"; + } if (/^\s*(MODULE|IMPORTLIB|TESTDLL|PARENTSRC|APPMODE)\s*=\s*(.*)/) { my $var = $1; @@ -264,13 +211,11 @@ ${$make{"=flags"}}{"implib"} = 1 if $var eq "IMPORTLIB"; next; } - if (/^\s*(BISON_SRCS|LEX_SRCS|IDL_SRCS|IMPLIB_SRCS|C_SRCS|OBJC_SRCS|MC_SRCS|RC_SRCS|SVG_SRCS|FONT_SRCS|IN_SRCS|PROGRAMS|EXTRA_TARGETS|MANPAGES)\s*=\s*(.*)/) + if (/^\s*(BISON_SRCS|LEX_SRCS|IDL_SRCS|C_SRCS|OBJC_SRCS|MC_SRCS|RC_SRCS|SVG_SRCS|FONT_SRCS|IN_SRCS|PROGRAMS|EXTRA_TARGETS|MANPAGES|EXTRA_OBJS|INSTALL_LIB|INSTALL_DEV)\s*=\s*(.*)/) { my $var = $1; my @list = split(/\s+/, $2); $make{$var} = \@list; - ${$make{"=flags"}}{"clean"} = 1 if $var eq "PROGRAMS"; - ${$make{"=flags"}}{"clean"} = 1 if $var eq "EXTRA_TARGETS"; next; } if (/(install-lib|install-dev|clean)\s*:/) @@ -286,9 +231,24 @@ if ($file =~ /^programs\/([^\/]+)\/Makefile/) { - ${$make{"=flags"}}{"install"} = 1 unless $dont_install{$1}; - ${$make{"=flags"}}{"installbin"} = 1 if $bin_install{$1}; + my $prog = $1; + if (defined $make{"INSTALL_LIB"}) + { + ${$make{"=flags"}}{"install"} = 1 if grep { "$prog.exe" eq $_; } @{$make{"INSTALL_LIB"}}; + ${$make{"=flags"}}{"installbin"} = 1 if grep { $prog eq $_; } @{$make{"INSTALL_LIB"}}; + } + else + { + ${$make{"=flags"}}{"install"} = 1; + } + } + + unless (defined $make{"MODULE"}) + { + ${$make{"=flags"}}{"install-lib"} = 1 if defined $make{"INSTALL_LIB"}; + ${$make{"=flags"}}{"install-dev"} = 1 if defined $make{"INSTALL_DEV"}; } + ${$make{"=flags"}}{"clean"} = 1 if defined $make{"PROGRAMS"} || defined $make{"EXTRA_TARGETS"} || defined $make{"EXTRA_OBJS"}; if (defined $make{"=flags"} && defined $make{"MODULE"}) { @@ -306,13 +266,32 @@ my %flags; open FILE, $file or die "cannot open $file"; - while () + if ($file =~ /\.sfd$/) { - next unless /^#\s*pragma\s+makedep\s+(.*)/; - foreach my $flag (split /\s+/, $1) + while () { - last if $flag eq "depend"; - $flags{$flag} = 1; + next unless /^UComments:\s*\"(.*)\"$/; + foreach my $pragma (split /\+AAoA/, $1) + { + next unless $pragma =~ /^#\s*pragma\s+makedep\s+(.*)/; + foreach my $flag (split /\s+/, $1) + { + $flags{$flag} = 1; + last if $flag eq "font"; + } + } + } + } + else + { + while () + { + next unless /^#\s*pragma\s+makedep\s+(.*)/; + foreach my $flag (split /\s+/, $1) + { + last if $flag eq "depend"; + $flags{$flag} = 1; + } } } close FILE; @@ -369,78 +348,63 @@ my $make = $makefiles{"$dir/Makefile"}; my $name = substr( $file, length($dir) + 1 ); + my %flags = get_makedep_flags( $file ); + + next if $file =~ /^include\/wine\// && !%flags && !$exported_wine_headers{$name}; ${$make}{"=flags"}{"clean"} = 1 if $subdir; - if ($dir eq "include") + if ($name =~ /\.m$/) { push @{${$make}{"=OBJC_SRCS"}}, $name; } + elsif ($name =~ /\.l$/) { push @{${$make}{"=LEX_SRCS"}}, $name; } + elsif ($name =~ /\.y$/) { push @{${$make}{"=BISON_SRCS"}}, $name; } + elsif ($name =~ /\.x$/) { push @{${$make}{"=XTEMPLATE_SRCS"}}, $name; } + elsif ($name =~ /\.rh$/) { push @{${$make}{"=HEADER_SRCS"}}, $name; } + elsif ($name =~ /\.inl$/) { push @{${$make}{"=HEADER_SRCS"}}, $name; } + elsif ($name =~ /\.svg$/) { push @{${$make}{"=SVG_SRCS"}}, $name; } + elsif ($name =~ /\.sfd$/) { - next if ($name =~ /\.in$/); - if ($name =~ /^wine\// && !$exported_wine_headers{$name}) - { - if ($private_idl_headers{$name}) { push @{${$make}{"=PRIVATE_IDL_H_SRCS"}}, $name; } - next; - } - if ($name =~ /stdole2\.idl$/) { push @{${$make}{"=IDL_TLB_SRCS"}}, $name; } - elsif ($private_idl_headers{$name}) { push @{${$make}{"=SRCDIR_INCLUDES"}}, $name; } - elsif ($name =~ /\.h$/) { push @{${$make}{"=SRCDIR_INCLUDES"}}, $name; } - elsif ($name =~ /\.x$/) { push @{${$make}{"=XTEMPLATE_SRCS"}}, $name; } - elsif ($name =~ /\.rh$/) { push @{${$make}{"=SRCDIR_INCLUDES"}}, $name; } - elsif ($name =~ /\.inl$/) { push @{${$make}{"=SRCDIR_INCLUDES"}}, $name; } - elsif ($name =~ /\.idl$/) { push @{${$make}{"=PUBLIC_IDL_H_SRCS"}}, $name; } - else { die "unknown file $name in include dir"; } + ${${$make}{"=flags"}}{"clean"} = 1 if defined $flags{"font"}; + ${${$make}{"=flags"}}{"install-lib"} = 1 if defined $flags{"install"}; + push @{${$make}{"=FONT_SRCS"}}, $name; } - else + elsif ($name =~ /\.c$/) { - if ($name =~ /\.m$/) { push @{${$make}{"=OBJC_SRCS"}}, $name; } - elsif ($name =~ /\.l$/) { push @{${$make}{"=LEX_SRCS"}}, $name; } - elsif ($name =~ /\.y$/) { push @{${$make}{"=BISON_SRCS"}}, $name; } - elsif ($name =~ /\.svg$/) { push @{${$make}{"=SVG_SRCS"}}, $name; } - elsif ($name =~ /\.sfd$/) { push @{${$make}{"=FONT_SRCS"}}, $name; } - elsif ($name =~ /\.c$/) - { - my %flags = get_makedep_flags( $file ); - if (defined $flags{"implib"}) - { - push @{${$make}{"=IMPLIB_SRCS"}}, $name; - ${${$make}{"=flags"}}{"staticimplib"} = 1; - } - push @{${$make}{"=C_SRCS"}}, $name; - } - elsif ($name =~ /\.rc$/) - { - my %flags = get_makedep_flags( $file ); - ${${$make}{"=flags"}}{"po"} = 1 if defined $flags{"po"}; - push @{${$make}{"=RC_SRCS"}}, $name; - } - elsif ($name =~ /\.mc$/) - { - push @{${$make}{"=MC_SRCS"}}, $name; - ${${$make}{"=flags"}}{"mc"} = 1; - } - elsif ($name =~ /\.idl$/) - { - push @{${$make}{"=IDL_SRCS"}}, $name; - ${${$make}{"=flags"}}{"clean"} = 1; - } - elsif ($name =~ /\.man\.in$/) - { - push @{${$make}{"=MANPAGES"}}, $name; - ${${$make}{"=flags"}}{"manpage"} = 1; - } - elsif ($name =~ /\.in$/) - { - push @{${$make}{"=IN_SRCS"}}, $name; - } + ${${$make}{"=flags"}}{"staticimplib"} = 1 if defined $flags{"implib"}; + push @{${$make}{"=C_SRCS"}}, $name; + } + elsif ($name =~ /\.h$/) + { + next if $dir ne "include"; + push @{${$make}{"=HEADER_SRCS"}}, $name; + ${${$make}{"=flags"}}{"install-dev"} = 1; + } + elsif ($name =~ /\.rc$/) + { + ${${$make}{"=flags"}}{"po"} = 1 if defined $flags{"po"}; + push @{${$make}{"=RC_SRCS"}}, $name; + } + elsif ($name =~ /\.mc$/) + { + push @{${$make}{"=MC_SRCS"}}, $name; + ${${$make}{"=flags"}}{"mc"} = 1; + } + elsif ($name =~ /\.idl$/) + { + die "no makedep flags specified in $file" unless %flags || $dir eq "include"; + push @{${$make}{"=IDL_SRCS"}}, $name; + ${${$make}{"=flags"}}{"clean"} = 1; + } + elsif ($name =~ /\.man\.in$/) + { + push @{${$make}{"=MANPAGES"}}, $name; + ${${$make}{"=flags"}}{($file =~ /^programs\//) ? "manpage" : "clean"} = 1; + } + elsif ($name =~ /\.in$/) + { + push @{${$make}{"=IN_SRCS"}}, $name; } } - # add extra variables to include source list - my $make = $makefiles{"include/Makefile"}; - unshift @{${$make}{"=SRCDIR_INCLUDES"}}, "\$(XTEMPLATE_SRCS)"; - unshift @{${$make}{"=SRCDIR_INCLUDES"}}, "\$(PUBLIC_IDL_H_SRCS)"; - unshift @{${$make}{"=SRCDIR_INCLUDES"}}, "\$(IDL_TLB_SRCS)"; - unshift @{${$make}{"=IDL_SRCS"}}, "\$(IDL_H_SRCS) \$(IDL_TLB_SRCS)"; - # preserve shared source files from the parent makefile foreach my $file (@makefiles) { @@ -553,15 +517,10 @@ replace_makefile_variable( $file, "OBJC_SRCS" ); replace_makefile_variable( $file, "RC_SRCS" ); replace_makefile_variable( $file, "IDL_SRCS" ); + replace_makefile_variable( $file, "HEADER_SRCS" ); replace_makefile_variable( $file, "XTEMPLATE_SRCS" ); replace_makefile_variable( $file, "IN_SRCS" ); - replace_makefile_variable( $file, "IMPLIB_SRCS" ); replace_makefile_variable( $file, "MANPAGES" ); - next unless $file eq "include/Makefile"; - replace_makefile_variable( $file, "PRIVATE_IDL_H_SRCS" ); - replace_makefile_variable( $file, "PUBLIC_IDL_H_SRCS" ); - replace_makefile_variable( $file, "IDL_TLB_SRCS" ); - replace_makefile_variable( $file, "SRCDIR_INCLUDES" ); } push @lines, "dnl End of auto-generated output commands\n"; diff -Nru wine1.7-1.7.50/tools/make_specfiles wine1.7-1.7.55/tools/make_specfiles --- wine1.7-1.7.50/tools/make_specfiles 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/tools/make_specfiles 2015-11-13 14:32:40.000000000 +0000 @@ -50,6 +50,25 @@ "msvcr120_app", ], [ + "ucrtbase", + "api-ms-win-crt-conio-l1-1-0", + "api-ms-win-crt-convert-l1-1-0", + "api-ms-win-crt-environment-l1-1-0", + "api-ms-win-crt-filesystem-l1-1-0", + "api-ms-win-crt-heap-l1-1-0", + "api-ms-win-crt-locale-l1-1-0", + "api-ms-win-crt-math-l1-1-0", + "api-ms-win-crt-multibyte-l1-1-0", + "api-ms-win-crt-private-l1-1-0", + "api-ms-win-crt-process-l1-1-0", + "api-ms-win-crt-runtime-l1-1-0", + "api-ms-win-crt-stdio-l1-1-0", + "api-ms-win-crt-string-l1-1-0", + "api-ms-win-crt-time-l1-1-0", + "api-ms-win-crt-utility-l1-1-0", + "vcruntime140", + ], + [ "msvcp120", "msvcp120_app", ], @@ -120,6 +139,7 @@ ], [ "vcomp", + "vcomp120", "vcomp110", "vcomp100", "vcomp90", @@ -359,7 +379,7 @@ if ($parent{callconv} ne "stub" || $parent{args}) { my $callconv = $parent{callconv} ne "stub" ? $parent{callconv} : - $parent{spec} =~ /msvc/ ? "cdecl" : "stdcall"; # hack + $parent{spec} =~ /(msvc|ucrtbase)/ ? "cdecl" : "stdcall"; # hack $_ = sprintf "$descr{ordinal} %s %s%s", $callconv, $flags, $func; if ($parent{target} =~ /$group_head\./) # use the same forward as parent if possible diff -Nru wine1.7-1.7.50/tools/make_unicode wine1.7-1.7.55/tools/make_unicode --- wine1.7-1.7.50/tools/make_unicode 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/tools/make_unicode 2015-11-13 14:32:40.000000000 +0000 @@ -23,7 +23,7 @@ # base URLs for www.unicode.org files my $MAPPINGS = "http://www.unicode.org/Public/MAPPINGS"; -my $UNIDATA = "http://www.unicode.org/Public/7.0.0/ucd"; +my $UNIDATA = "http://www.unicode.org/Public/8.0.0/ucd"; my $REPORTS = "http://www.unicode.org/reports"; my $RFCS = "http://www.rfc-editor.org/rfc"; my $VERTICALDATA = "http://www.unicode.org/Public/vertical/revision-11"; @@ -169,7 +169,11 @@ "Joiner" => 0x001b, "Number_Joiner" => 0x001c, "Number" => 0x001d, - "Brahmi_Joining_Number" => 0x001e + "Brahmi_Joining_Number" => 0x001e, + "Consonant_With_Stacker" => 0x001f, + "Consonant_Prefixed" => 0x0020, + "Syllable_Modifier" => 0x0021, + "Consonant_Killer" => 0x0022 ); my %matra_types = @@ -1207,7 +1211,7 @@ } close $INPUT; - $INPUT = open_data_file( $UNIDATA, "IndicMatraCategory.txt" ); + $INPUT = open_data_file( $UNIDATA, "IndicPositionalCategory.txt" ); while (<$INPUT>) { next if /^\#/; # skip comments @@ -1238,7 +1242,7 @@ print "Building $filename\n"; print OUTPUT "/* Unicode Indic Syllabic Category */\n"; print OUTPUT "/* generated from $UNIDATA/IndicSyllabicCategory.txt */\n"; - print OUTPUT "/* and from $UNIDATA/IndicMatraCategory.txt */\n"; + print OUTPUT "/* and from $UNIDATA/IndicPositionalCategory.txt */\n"; print OUTPUT "/* DO NOT EDIT!! */\n\n"; dump_two_level_mapping( "indic_syllabic_table", @indic_table); diff -Nru wine1.7-1.7.50/tools/sfnt2fon/Makefile.in wine1.7-1.7.55/tools/sfnt2fon/Makefile.in --- wine1.7-1.7.50/tools/sfnt2fon/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/tools/sfnt2fon/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -1,9 +1,6 @@ -PROGRAMS = sfnt2fon$(EXEEXT) +PROGRAMS = sfnt2fon C_SRCS = sfnt2fon.c EXTRAINCL = $(FREETYPE_CFLAGS) -EXTRALIBS = $(FREETYPE_LIBS) - -sfnt2fon$(EXEEXT): sfnt2fon.o - $(CC) $(CFLAGS) -o $@ sfnt2fon.o $(LIBWINE_STATIC) $(LIBPORT) $(EXTRALIBS) $(LDFLAGS) +EXTRALIBS = $(FREETYPE_LIBS) $(LIBWINE_STATIC) diff -Nru wine1.7-1.7.50/tools/widl/Makefile.in wine1.7-1.7.55/tools/widl/Makefile.in --- wine1.7-1.7.50/tools/widl/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/tools/widl/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -1,4 +1,4 @@ -PROGRAMS = widl$(EXEEXT) +PROGRAMS = widl MANPAGES = widl.man.in C_SRCS = \ @@ -21,15 +21,6 @@ widl_EXTRADEFS = -DDEFAULT_INCLUDE_DIR=\"${includedir}/windows/\" -OBJS = $(C_SRCS:.c=.o) $(BISON_SRCS:.y=.tab.o) $(LEX_SRCS:.l=.yy.o) +EXTRALIBS = $(LIBWPP) -widl$(EXEEXT): $(OBJS) $(LIBWPP) - $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBWPP) $(LIBPORT) $(LDFLAGS) - -.PHONY: install install-dev uninstall - -install install-dev:: $(PROGRAMS) install-man-pages - $(INSTALL_PROGRAM) widl$(EXEEXT) $(DESTDIR)$(bindir)/widl$(EXEEXT) - -uninstall:: - $(RM) $(DESTDIR)$(bindir)/widl$(EXEEXT) +INSTALL_DEV = $(PROGRAMS) diff -Nru wine1.7-1.7.50/tools/widl/parser.y wine1.7-1.7.55/tools/widl/parser.y --- wine1.7-1.7.50/tools/widl/parser.y 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/tools/widl/parser.y 2015-11-13 14:32:40.000000000 +0000 @@ -123,7 +123,6 @@ static statement_t *make_statement_module(type_t *type); static statement_t *make_statement_typedef(var_list_t *names); static statement_t *make_statement_import(const char *str); -static statement_t *make_statement_typedef(var_list_t *names); static statement_list_t *append_statement(statement_list_t *list, statement_t *stmt); static statement_list_t *append_statements(statement_list_t *, statement_list_t *); static attr_list_t *append_attribs(attr_list_t *, attr_list_t *); @@ -1881,22 +1880,24 @@ const declarator_t *decl; type_t *type = decl_spec->type; + if (is_attr(attrs, ATTR_UUID) && !is_attr(attrs, ATTR_PUBLIC)) + attrs = append_attr( attrs, make_attr(ATTR_PUBLIC) ); + /* We must generate names for tagless enum, struct or union. Typedef-ing a tagless enum, struct or union means we want the typedef to be included in a library hence the public attribute. */ - if ((type_get_type_detect_alias(type) == TYPE_ENUM || - type_get_type_detect_alias(type) == TYPE_STRUCT || - type_get_type_detect_alias(type) == TYPE_UNION || - type_get_type_detect_alias(type) == TYPE_ENCAPSULATED_UNION) && - !type->name) + if (type_get_type_detect_alias(type) == TYPE_ENUM || + type_get_type_detect_alias(type) == TYPE_STRUCT || + type_get_type_detect_alias(type) == TYPE_UNION || + type_get_type_detect_alias(type) == TYPE_ENCAPSULATED_UNION) { - if (! is_attr(attrs, ATTR_PUBLIC) && ! is_attr (attrs, ATTR_HIDDEN)) - attrs = append_attr( attrs, make_attr(ATTR_PUBLIC) ); - type->name = gen_name(); + if (!type->name) + type->name = gen_name(); + + /* replace existing attributes when generating a typelib */ + if (do_typelib) + type->attrs = attrs; } - else if (is_attr(attrs, ATTR_UUID) && !is_attr(attrs, ATTR_PUBLIC) - && !is_attr(attrs, ATTR_HIDDEN)) - attrs = append_attr( attrs, make_attr(ATTR_PUBLIC) ); LIST_FOR_EACH_ENTRY( decl, decls, const declarator_t, entry ) { diff -Nru wine1.7-1.7.50/tools/widl/typetree.c wine1.7-1.7.55/tools/widl/typetree.c --- wine1.7-1.7.50/tools/widl/typetree.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/tools/widl/typetree.c 2015-11-13 14:32:40.000000000 +0000 @@ -300,7 +300,12 @@ type_t *type_new_struct(char *name, struct namespace *namespace, int defined, var_list_t *fields) { type_t *tag_type = name ? find_type(name, namespace, tsSTRUCT) : NULL; - type_t *t = make_type(TYPE_STRUCT); + type_t *t; + + /* avoid creating duplicate typelib type entries */ + if (tag_type && do_typelib) return tag_type; + + t = make_type(TYPE_STRUCT); t->name = name; t->namespace = namespace; diff -Nru wine1.7-1.7.50/tools/widl/write_msft.c wine1.7-1.7.55/tools/widl/write_msft.c --- wine1.7-1.7.50/tools/widl/write_msft.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/tools/widl/write_msft.c 2015-11-13 14:32:40.000000000 +0000 @@ -494,10 +494,23 @@ MSFT_GuidEntry *guid_space; int hash_key; + chat("adding uuid {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\n", + guid->guid.Data1, guid->guid.Data2, guid->guid.Data3, + guid->guid.Data4[0], guid->guid.Data4[1], guid->guid.Data4[2], guid->guid.Data4[3], + guid->guid.Data4[4], guid->guid.Data4[5], guid->guid.Data4[6], guid->guid.Data4[7]); + hash_key = ctl2_hash_guid(&guid->guid); offset = ctl2_find_guid(typelib, hash_key, &guid->guid); - if (offset != -1) return offset; + if (offset != -1) + { + if (pedantic) + warning("duplicate uuid {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\n", + guid->guid.Data1, guid->guid.Data2, guid->guid.Data3, + guid->guid.Data4[0], guid->guid.Data4[1], guid->guid.Data4[2], guid->guid.Data4[3], + guid->guid.Data4[4], guid->guid.Data4[5], guid->guid.Data4[6], guid->guid.Data4[7]); + return -1; + } offset = ctl2_alloc_segment(typelib, MSFT_SEG_GUID, sizeof(MSFT_GuidEntry), 0); @@ -745,6 +758,7 @@ static void add_structure_typeinfo(msft_typelib_t *typelib, type_t *structure); static void add_interface_typeinfo(msft_typelib_t *typelib, type_t *interface); static void add_enum_typeinfo(msft_typelib_t *typelib, type_t *enumeration); +static void add_union_typeinfo(msft_typelib_t *typelib, type_t *tunion); static void add_coclass_typeinfo(msft_typelib_t *typelib, type_t *cls); static void add_dispinterface_typeinfo(msft_typelib_t *typelib, type_t *dispinterface); @@ -993,6 +1007,9 @@ case TYPE_ENUM: add_enum_typeinfo(typelib, type); break; + case TYPE_UNION: + add_union_typeinfo(typelib, type); + break; case TYPE_COCLASS: add_coclass_typeinfo(typelib, type); break; @@ -1128,9 +1145,12 @@ if (typeoffset == typelib->typelib_segdir[MSFT_SEG_TYPEDESC].length) { int mix_field; - + if (target_type & 0x80000000) { mix_field = ((target_type >> 16) & 0x3fff) | VT_BYREF; + } else if (is_array(ref)) { + type_t *element_type = type_alias_get_aliasee(type_array_get_element(ref)); + mix_field = get_type_vt(element_type) | VT_ARRAY | VT_BYREF; } else { typedata = (void *)&typelib->typelib_segment_data[MSFT_SEG_TYPEDESC][target_type]; mix_field = ((typedata[0] >> 16) == 0x7fff)? 0x7fff: 0x7ffe; @@ -1749,6 +1769,10 @@ typedata[4] = typeinfo->datawidth; typeinfo->datawidth += var_datawidth; break; + case TKIND_UNION: + typedata[4] = typeinfo->datawidth; + typeinfo->datawidth = max(typeinfo->datawidth, var_datawidth); + break; case TKIND_DISPATCH: var_kind = 3; /* VAR_DISPATCH */ typeinfo->datawidth = pointer_size; @@ -1833,7 +1857,7 @@ MSFT_TypeInfoBase *typeinfo; MSFT_GuidEntry guidentry; - chat("create_msft_typeinfo: name %s kind %d\n", name, kind); + chat("create_msft_typeinfo: name %s kind %d index %d\n", name, kind, typelib->typelib_header.nrtypeinfos); msft_typeinfo = xmalloc(sizeof(*msft_typeinfo)); memset( msft_typeinfo, 0, sizeof(*msft_typeinfo) ); @@ -1967,7 +1991,7 @@ static void add_dispatch(msft_typelib_t *typelib) { - int guid_offset, impfile_offset; + int guid_offset, impfile_offset, hash_key; MSFT_GuidEntry guidentry; MSFT_ImpInfo impinfo; GUID stdole = {0x00020430,0x0000,0x0000,{0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}}; @@ -1978,7 +2002,10 @@ guidentry.guid = stdole; guidentry.hreftype = 2; guidentry.next_hash = -1; - guid_offset = ctl2_alloc_guid(typelib, &guidentry); + hash_key = ctl2_hash_guid(&guidentry.guid); + guid_offset = ctl2_find_guid(typelib, hash_key, &guidentry.guid); + if (guid_offset == -1) + guid_offset = ctl2_alloc_guid(typelib, &guidentry); impfile_offset = alloc_importfile(typelib, guid_offset, 2, 0, "stdole2.tlb"); guidentry.guid = iid_idispatch; @@ -1986,7 +2013,11 @@ guidentry.next_hash = -1; impinfo.flags = TKIND_INTERFACE << 24 | MSFT_IMPINFO_OFFSET_IS_GUID; impinfo.oImpFile = impfile_offset; - impinfo.oGuid = ctl2_alloc_guid(typelib, &guidentry); + hash_key = ctl2_hash_guid(&guidentry.guid); + guid_offset = ctl2_find_guid(typelib, hash_key, &guidentry.guid); + if (guid_offset == -1) + guid_offset = ctl2_alloc_guid(typelib, &guidentry); + impinfo.oGuid = guid_offset; typelib->typelib_header.dispatchpos = alloc_msft_importinfo(typelib, &impinfo) | 0x01; } @@ -2067,6 +2098,10 @@ add_interface_typeinfo(typelib, inherit); } + /* check typelib_idx again, it could have been added while resolving the parent interface */ + if (-1 < interface->typelib_idx) + return; + interface->typelib_idx = typelib->typelib_header.nrtypeinfos; msft_typeinfo = create_msft_typeinfo(typelib, TKIND_INTERFACE, interface->name, interface->attrs); msft_typeinfo->typeinfo->size = pointer_size; @@ -2138,22 +2173,57 @@ add_var_desc(msft_typeinfo, idx++, cur); } -static void add_typedef_typeinfo(msft_typelib_t *typelib, type_t *tdef) +static void add_union_typeinfo(msft_typelib_t *typelib, type_t *tunion) { + int idx = 0; + var_t *cur; msft_typeinfo_t *msft_typeinfo; - int alignment; + + if (-1 < tunion->typelib_idx) + return; + + tunion->typelib_idx = typelib->typelib_header.nrtypeinfos; + msft_typeinfo = create_msft_typeinfo(typelib, TKIND_UNION, tunion->name, tunion->attrs); + msft_typeinfo->typeinfo->size = 0; + + if (type_union_get_cases(tunion)) + LIST_FOR_EACH_ENTRY(cur, type_union_get_cases(tunion), var_t, entry) + add_var_desc(msft_typeinfo, idx++, cur); +} + +static void add_typedef_typeinfo(msft_typelib_t *typelib, type_t *tdef) +{ + msft_typeinfo_t *msft_typeinfo = NULL; + int alignment, datatype1, datatype2, size, duplicate = 0; + type_t *type; if (-1 < tdef->typelib_idx) return; - tdef->typelib_idx = typelib->typelib_header.nrtypeinfos; - msft_typeinfo = create_msft_typeinfo(typelib, TKIND_ALIAS, tdef->name, tdef->attrs); - encode_type(typelib, get_type_vt(type_alias_get_aliasee(tdef)), - type_alias_get_aliasee(tdef), - &msft_typeinfo->typeinfo->datatype1, - &msft_typeinfo->typeinfo->size, - &alignment, &msft_typeinfo->typeinfo->datatype2); - msft_typeinfo->typeinfo->typekind |= (alignment << 11 | alignment << 6); + type = type_alias_get_aliasee(tdef); + + if (!type->name || strcmp(tdef->name, type->name) != 0) + { + tdef->typelib_idx = typelib->typelib_header.nrtypeinfos; + msft_typeinfo = create_msft_typeinfo(typelib, TKIND_ALIAS, tdef->name, tdef->attrs); + } + else + duplicate = 1; + + encode_type(typelib, get_type_vt(type), type, + &datatype1, &size, &alignment, &datatype2); + + if (msft_typeinfo) + { + msft_typeinfo->typeinfo->datatype1 = datatype1; + msft_typeinfo->typeinfo->size = size; + msft_typeinfo->typeinfo->datatype2 = datatype2; + msft_typeinfo->typeinfo->typekind |= (alignment << 11 | alignment << 6); + } + + /* avoid adding duplicate type definitions */ + if (duplicate) + tdef->typelib_idx = type->typelib_idx; } static void add_coclass_typeinfo(msft_typelib_t *typelib, type_t *cls) @@ -2274,6 +2344,9 @@ case TYPE_ENUM: add_enum_typeinfo(typelib, type); break; + case TYPE_UNION: + add_union_typeinfo(typelib, type); + break; case TYPE_COCLASS: add_coclass_typeinfo(typelib, type); break; diff -Nru wine1.7-1.7.50/tools/winebuild/Makefile.in wine1.7-1.7.55/tools/winebuild/Makefile.in --- wine1.7-1.7.50/tools/winebuild/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/tools/winebuild/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -1,4 +1,4 @@ -PROGRAMS = winebuild$(EXEEXT) +PROGRAMS = winebuild MANPAGES = winebuild.man.in C_SRCS = \ @@ -12,15 +12,4 @@ spec32.c \ utils.c -OBJS = $(C_SRCS:.c=.o) - -winebuild$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBPORT) $(LDFLAGS) - -.PHONY: install install-dev uninstall - -install install-dev:: $(PROGRAMS) install-man-pages - $(INSTALL_PROGRAM) winebuild$(EXEEXT) $(DESTDIR)$(bindir)/winebuild$(EXEEXT) - -uninstall:: - $(RM) $(DESTDIR)$(bindir)/winebuild$(EXEEXT) +INSTALL_DEV = $(PROGRAMS) diff -Nru wine1.7-1.7.50/tools/wine.desktop wine1.7-1.7.55/tools/wine.desktop --- wine1.7-1.7.50/tools/wine.desktop 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/tools/wine.desktop 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Wine Windows Program Loader -Name[ar]=منظومة واين لتشغيل برامج وندوز -Name[cs]=Zavaděč programů pro Wine -Name[de]=Wine Windows-Programmstarter -Name[es]=Wine Cargador de programas de Windows -Name[lt]=Wine Windows programų paleidyklė -Name[nl]=Wine Windows programmalader -Name[sv]=Wine Windows Programstartare -Name[ro]=Wine - Încărcătorul de programe Windows -Name[ru]=Wine - загрузчик Windows программ -Name[uk]=Wine - завантажувач Windows програм -Name[fr]=Wine - Chargeur de programmes Windows -Name[ca]=Wine - Carregador d'aplicacions del Windows -Name[pt]=Carregador de aplicativos Windows Wine -Name[pt_br]=Carregador de aplicativos Windows Wine -Name[it]=Wine Carica Programmi Windows -Name[da]=Wine, Programstarter til Windows-programmer -Name[nb]=Wine - for kjøring av Windows-programmer -Name[nn]=Wine - for køyring av Windows-program -Name[sr]=Wine - дизач Windows програма -Name[sr@latin]=Wine - dizač Windows programa -Name[hr]=Wine - dizač Windows programa -Name[he]=Wine — מריץ תכניות Windows -Name[ja]=Wine Windowsプログラムローダー -Exec=wine start /unix %f -MimeType=application/x-ms-dos-executable;application/x-msi;application/x-ms-shortcut; -Icon=wine -NoDisplay=true -StartupNotify=true diff -Nru wine1.7-1.7.50/tools/winedump/Makefile.in wine1.7-1.7.55/tools/winedump/Makefile.in --- wine1.7-1.7.50/tools/winedump/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/tools/winedump/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -1,5 +1,6 @@ -PROGRAMS = winedump$(EXEEXT) +PROGRAMS = winedump MANPAGES = winedump.man.in +SCRIPTS = function_grep.pl C_SRCS = \ debug.c \ @@ -23,16 +24,4 @@ symbol.c \ tlb.c -OBJS = $(C_SRCS:.c=.o) - -winedump$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o winedump$(EXEEXT) $(OBJS) $(LIBPORT) $(LDFLAGS) - -.PHONY: install install-dev uninstall - -install install-dev:: $(PROGRAMS) install-man-pages - $(INSTALL_PROGRAM) winedump$(EXEEXT) $(DESTDIR)$(bindir)/winedump$(EXEEXT) - $(INSTALL_SCRIPT) $(srcdir)/function_grep.pl $(DESTDIR)$(bindir)/function_grep.pl - -uninstall:: - $(RM) $(DESTDIR)$(bindir)/function_grep.pl $(DESTDIR)$(bindir)/winedump$(EXEEXT) +INSTALL_DEV = $(PROGRAMS) $(SCRIPTS) diff -Nru wine1.7-1.7.50/tools/winedump/minidump.c wine1.7-1.7.55/tools/winedump/minidump.c --- wine1.7-1.7.50/tools/winedump/minidump.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/tools/winedump/minidump.c 2015-11-13 14:32:40.000000000 +0000 @@ -287,6 +287,9 @@ case PROCESSOR_ARCHITECTURE_ARM: str = "ARM"; break; + case PROCESSOR_ARCHITECTURE_ARM64: + str = "ARM64"; + break; case PROCESSOR_ARCHITECTURE_AMD64: str = "X86_64"; break; @@ -358,6 +361,16 @@ default: str = "6-????"; break; } break; + case 10: + switch (msi->MinorVersion) + { + case 0: + if (msi->u.s.ProductType == 1) str = "Win10"; + else str = "10-????"; + break; + default: str = "10-????"; break; + } + break; default: str = "???"; break; } printf(" Version: Windows %s (%u)\n", str, msi->BuildNumber); diff -Nru wine1.7-1.7.50/tools/winegcc/Makefile.in wine1.7-1.7.55/tools/winegcc/Makefile.in --- wine1.7-1.7.50/tools/winegcc/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/tools/winegcc/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -1,10 +1,9 @@ -PROGRAMS = \ - winecpp$(EXEEXT) \ - winegcc$(EXEEXT) \ - wineg++$(EXEEXT) +PROGRAMS = winegcc MANPAGES = winegcc.man.in +winegcc_SYMLINKS = winecpp wineg++ + C_SRCS = \ utils.c \ winegcc.c @@ -19,21 +18,4 @@ -DLD="\"$(LD)\"" \ -DPRELINK="\"$(PRELINK)\"" -winegcc$(EXEEXT): winegcc.o utils.o - $(CC) $(CFLAGS) -o $@ winegcc.o utils.o $(LIBPORT) $(LDFLAGS) - -winecpp$(EXEEXT) wineg++$(EXEEXT): winegcc$(EXEEXT) - $(RM) $@ && $(LN_S) winegcc$(EXEEXT) $@ - -.PHONY: install install-dev uninstall - -install install-dev:: $(PROGRAMS) install-man-pages - $(INSTALL_PROGRAM) winegcc$(EXEEXT) $(DESTDIR)$(bindir)/winegcc$(EXEEXT) - cd $(DESTDIR)$(bindir) && $(RM) wineg++$(EXEEXT) && $(LN_S) winegcc$(EXEEXT) wineg++$(EXEEXT) - cd $(DESTDIR)$(bindir) && $(RM) winecpp$(EXEEXT) && $(LN_S) winegcc$(EXEEXT) winecpp$(EXEEXT) - cd $(DESTDIR)$(mandir)/man$(prog_manext) && $(RM) wineg++.$(prog_manext) && $(LN_S) winegcc.$(prog_manext) wineg++.$(prog_manext) - cd $(DESTDIR)$(mandir)/man$(prog_manext) && $(RM) winecpp.$(prog_manext) && $(LN_S) winegcc.$(prog_manext) winecpp.$(prog_manext) - -uninstall:: - $(RM) $(DESTDIR)$(bindir)/winegcc$(EXEEXT) $(DESTDIR)$(bindir)/wineg++$(EXEEXT) $(DESTDIR)$(bindir)/winecpp$(EXEEXT) - $(RM) $(DESTDIR)$(mandir)/man$(prog_manext)/wineg++.$(prog_manext) $(DESTDIR)$(mandir)/man$(prog_manext)/winecpp.$(prog_manext) +INSTALL_DEV = $(PROGRAMS) $(winegcc_SYMLINKS) diff -Nru wine1.7-1.7.50/tools/winegcc/winegcc.c wine1.7-1.7.55/tools/winegcc/winegcc.c --- wine1.7-1.7.50/tools/winegcc/winegcc.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/tools/winegcc/winegcc.c 2015-11-13 14:32:40.000000000 +0000 @@ -776,6 +776,7 @@ char *output_file; const char *spec_o_name; const char *output_name, *spec_file, *lang; + const char *prelink = NULL; int generate_app_loader = 1; int fake_module = 0; unsigned int j; @@ -1134,6 +1135,13 @@ } break; default: + if (opts->image_base) + { + 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 + prelink = PRELINK; + } break; } @@ -1167,10 +1175,9 @@ spawn(opts->prefix, link_args, 0); strarray_free (link_args); - /* set the base address */ - if (opts->image_base && !opts->target) + /* set the base address with prelink if linker support is not present */ + if (prelink && !opts->target) { - const char *prelink = PRELINK; if (prelink[0] && strcmp(prelink,"false")) { strarray *prelink_args = strarray_alloc(); File /tmp/lGkLrqMI3A/wine1.7-1.7.50/tools/winemaker is a regular file while file /tmp/i40nZWR050/wine1.7-1.7.55/tools/winemaker is a directory diff -Nru wine1.7-1.7.50/tools/winemaker.de.UTF-8.man.in wine1.7-1.7.55/tools/winemaker.de.UTF-8.man.in --- wine1.7-1.7.50/tools/winemaker.de.UTF-8.man.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/tools/winemaker.de.UTF-8.man.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,265 +0,0 @@ -.\" -*- nroff -*- -.TH WINEMAKER 1 "Januar 2012" "@PACKAGE_STRING@" "Wine Entwicklerhandbuch" -.SH NAME -winemaker \- Erzeugt eine Build-Infrastruktur, um Windows Programme unter Unix zu kompilieren -.SH ÜBERSICHT -.B "winemaker " -[ -.BR "--nobanner " "] [ " "--backup " "| " "--nobackup " "] [ "--nosource-fix " -] -.br - [ -.BR "--lower-none " "| " "--lower-all " "| " "--lower-uppercase " -] -.br - [ -.BR "--lower-include " "| " "--nolower-include " ]\ [ " --mfc " "| " "--nomfc " -] -.br - [ -.BR "--guiexe " "| " "--windows " "| " "--cuiexe " "| " "--console " "| " "--dll " "| " "--lib " -] -.br - [ -.BI "-D" macro "\fR[=\fIdefn\fR] ] [" "\ " "-I" "dir\fR ]\ [ " "-P" "dir\fR ] [ " "-i" "dll\fR ] [ " "-L" "dir\fR ] [ " "-l" "library " -] -.br - [ -.BR "--nodlls " "] [ " "--nomsvcrt " "] [ " "--interactive " "] [ " "--single-target \fIname\fR " -] -.br - [ -.BR "--generated-files " "] [ " "--nogenerated-files " "] -] -.br - [ -.BR "--wine32 " "] -.br -.IR " Arbeitsverzeichnis" " | " "Projektdatei" " | " "Workspacedatei" - -.SH BESCHREIBUNG -.PP -.B winemaker -ist ein Perl-Script um Ihnen das Konvertieren von Windows-Quellcode -zu einem Winelib-Programm zu erleichtern. -.PP -Zu diesem Zweck beherrscht Winemaker folgende Operationen: -.PP -- Quellcodedateien und Verzeichnisse in Kleinbuchstaben umbenennen, falls -diese beim Übertragen komplett in Großbuchstaben angekommen sind. -.PP -- Konvertierung von DOS- zu Unix-Zeilenenden (CRLF nach LF). -.PP -- Include-Anweisungen und Resourcenreferenzen durchsuchen, um Backslashes -durch Slashes zu ersetzen. -.PP -- Während des obigen Schrittes wird Winemaker ebenfalls nach der angegebenen Datei -im Includepfad suchen und die entsprechende Zeile, falls nötig, mit der korrekten -Groß-/Kleinschreibweise austauschen. -.PP -- Winemaker wird ebenso andere, exotischere Probleme wie die Benutzung von -'#pragma pack', 'afxres.h' in nicht-MFC-Projekten und mehr untersuchen. -Sollte etwas ungwöhnliches vorkommen, wird Winemaker Sie warnen. -.PP -- Winemaker kann eine ganze Verzeichnisstruktur auf einmal durchsuchen, -schätzen welche ausführbaren Dateien und Bibliotheken Sie zu erstellen -gedenken, diese den passenden Quelldateien zuordnen und entsprechende Makefiles -generieren. -.PP -- letztendlich wird Winemaker eine globale Makefile für den normalen Gebrauch erzeugen. -.PP -- Winemaker erkennt MFC-basierte Projekte und erstellt angepasste Dateien. -.PP -- Existierende Projektdateien können von Winemaker gelesen werden. -Unterstützt sind dsp, dsw, vcproj und sln-Dateien. -.PP -.SH ARGUMENTE -.TP -.B --nobanner -Unterdrückt die Anzeige des Banners. -.TP -.B --backup -Lässt Winemaker Backups von allen Quellcodedateien anlegen, an denen -Änderungen vorgenommen werden. Diese Option ist Standard. -.TP -.B --nobackup -Lässt Winemaker keine Backups anlegen. -.TP -.B --nosource-fix -Weist Winemaker an, keine Quellcodedateien zu ändern (z.B. DOS zu Unix -Konvertierung). Verhindert Fehlermeldungen bei schreibgeschützten Dateien. -.TP -.B --lower-all -Alle Dateien und Verzeichnisse werden in Kleinschreibung umbenannt. -.TP -.B --lower-uppercase -Nur Dateien und Verzeichnisse, die komplett groß geschrieben sind, werden -in Kleinschreibung umbenannt. -"HALLO.C" würde beispielsweise umbenannt werden, "Welt.c" jedoch nicht. -.TP -.B --lower-none -Keine Dateien und Verzeichnisse werden in Kleinschreibung umbenannt. -Beachten Sie, dass dies nicht die Umbenennung von Dateien verhindert, deren -Erweiterungen nicht unverändert verarbeitet werden können, z.B. ".Cxx". -Diese Option ist Standard. -.TP -.B "--lower-include " -Wenn die Datei zu einer Include-Anweisung (oder einer anderen Form von -Dateireferenz für Resourcen) nicht auffindbar ist, wird der Dateiname in -Kleinschreibung umbenannt. Diese Option ist Standard. -.TP -.B "--nolower-include " -Es werden keine Änderungen an Include-Anweisungen oder Referenzen vorgenommen, -wenn die entsprechende Datei nicht auffindbar ist. -.TP -.BR "--guiexe " "| " "--windows" -Legt fest, dass für jedes gefundene, ausführbare Target, oder Target unbekannten -Typs angenommen wird, dass es sich um eine grafische Anwendung handelt. -Diese Option ist Standard. -.TP -.BR "--cuiexe " "| " "--console" -Legt fest, dass für jedes gefundene, ausführbare Target, oder Target unbekannten -Typs angenommen wird, dass es sich um eine Konsolenanwendung handelt. -.TP -.B --dll -Winemaker wird im Zweifelsfall annehmen, dass es sich bei einem unbekannten -Target um eine DLL handelt. -.TP -.B --lib -Winemaker wird im Zweifelsfall annehmen, dass es sich bei einem unbekannten -Target um eine statische Bibliothek handelt. -.TP -.B --mfc -Teilt Winemaker mit, dass es sich um MFC-basierte Ziele handelt. In solch einem -Fall passt Winemaker Pfade für Header und Bibliotheken entsprechend an und -verlinkt die Ziele mit der MFC-Bibliothek. -.TP -.B --nomfc -Teilt Winemaker mit, dass es sich nicht um MFC-basierte Ziele handelt. Diese -Option verhindert die Benutzung von MFC-Bibliotheken, selbst wenn Winemaker -Dateien wie "stdafx.cpp" oder "stdafx.h" begegnet, was normalerweise automatisch -MFC aktivieren würde, wenn weder \fB--nomfc\fR noch \fB--mfc\fR angegeben wurden. -.TP -.BI -D macro "\fR[=\fIdefn\fR]" -Fügt diese Makrodefinition zur globalen Makroliste hinzu. -.TP -.BI -I dir -Hängt das angegebene Verzeichnis dem globalen Include-Pfad an. -.TP -.BI -P dir -Hängt das angegebene Verzeichnis dem globalen DLL-Pfad an. -.TP -.BI -i dll -Fügt die angegebene Winelib-Bibliothek zur globalen Liste der zu importierenden -Winelib-Bibliotheken hinzu. -.TP -.BI -L dir -Hängt das angegebene Verzeichnis dem globalen Bibliotheks-Pfad an. -.TP -.BI -l library -Fügt die angegebene Bibliothek zur globalen Liste der zu verlinkenden -Bibliotheken hinzu. -.TP -.B --nodlls -Diese Option teilt Winemaker mit, nicht den Standardsatz an Winelib-Bibliotheken -zu importieren. Dies bedeutet, dass jede DLL, die Ihr Quellcode nutzt, explizit -mit \fB-i\fR an Winemaker übergeben werden muss. -Die Standard-Bibliotheken sind: odbc32.dll, odbccp32.dll, ole32.dll, -oleaut32.dll und winspool.drv. -.TP -.B --nomsvcrt -Setzt einige Optionen, die winegcc daran hindern, gegen msvcrt zu kompilieren. -Nutzen Sie diese Option bei cpp-Dateien, die einbinden. -.TP -.B --interactive -Versetzt Winemaker in einen interaktiven Modus. In diesem Modus wird Winemaker -Sie für die Targetliste jedes Verzeichnisses nach Bestätigung und jeweils -target- und verzeichnisspezifischen Optionen fragen. -.TP -.BI --single-target " name" -Gibt an, dass es nur ein einziges Target gibt, namens \fIname\fR. -.TP -.B --generated-files -Weist Winemaker an, eine Makefile zu erzeugen. Diese Option ist Standard. -.TP -.B --nogenerated-files -Weist Winemaker an, keine Makefile zu erzeugen. -.TP -.B --wine32 -Weist Winemaker an, ein 32-Bit Target zu erstellen. Dies ist nützlich bei -wow64-Systemen. Ohne diese Option wird die Standardarchitektur benutzt. - -.SH BEISPIELE -.PP -Ein typischer Winemaker Aufruf: -.PP -$ winemaker --lower-uppercase -DSTRICT . -.PP -Damit scannt Winemaker das aktuelle Verzeichnis und die Unterverzeichnisse nach -Quellcodedateien. Jede Datei und jedes Verzeichnis, das ganz in Großbuchstaben -geschrieben ist, wird in Kleinbuchstaben umbenannt. Danach werden alle Quellcodedateien -an die Kompilierung mit Winelib angepasst und Makefiles erzeugt. -'-DSTRICT' gibt an, dass das STRICT-Makro gesetzt sein muss, um diesen Quellcode -zu kompilieren. Letztendlich wird Winemaker die globale Makefile erzeugen. -.PP -Der nächste Schritt wäre dann: -.PP -$ make -.PP -Wenn Sie an diesem Punkt Compilerfehler erhalten (was recht wahrscheinlich ist, -ab einer gewissen Projektgröße), sollten Sie den Winelib User Guide zu Rate -ziehen, um Problemlösungen und Tipps zu finden. -.PP -Bei einem MFC-basierten Projekt sollten Sie stattdessen folgenden Befehl ausführen: -.PP -$ winemaker --lower-uppercase --mfc . -.br -$ make -.PP -Mit einer existierenden Projektdatei lautet der passende Befehl: -.PP -$ winemaker meinprojekt.dsp -.br -$ make -.PP - -.SH TODO / FEHLER -.PP -In einigen Fällen werden Sie die Makefile oder den Quellcode von Hand -nachbearbeiten müssen. -.PP -Angenommen, die fertigen Windows-Bibliotheken oder Binärdateien sind vorhanden, -könnte mit winedump ermittelt werden, um welche Art von ausführbarer Datei es -sich handelt (grafisch oder Konsole), gegen welche Bibliotheken sie gelinkt -sind und welche Funktionen exportiert werden (bei Bibliotheken). All diese -Informationen könnten dann für das Winelib-Projekt verwendet werden. -.PP -Weiterhin ist Winemaker nicht sehr gut darin, die Bibliothek zu finden, die -die Anwendung enthält: Sie muss entweder im aktuellen Verzeichnis oder im -.IR LD_LIBRARY_PATH liegen. -.PP -Winemaker unterstützt noch keine Messagedateien und deren Compiler. -.PP -Fehler können im -.UR http://bugs.winehq.org -.B Wine Bugtracker -.UE -gemeldet werden. -.SH AUTOREN -François Gouget für CodeWeavers -.br -Dimitrie O. Paun -.br -André Hentschel -.SH VERFÜGBARKEIT -.B Winemaker -ist Teil der Wine-Distribution, verfügbar im WineHQ, dem -.UR http://www.winehq.org/ -.B Hauptquartier der Wine-Entwicklung -.UE . -.SH SIEHE AUCH -.BR wine (1), -.br -.UR http://www.winehq.org/help -.B Wine-Dokumentation und Support -.UE . diff -Nru wine1.7-1.7.50/tools/winemaker.fr.UTF-8.man.in wine1.7-1.7.55/tools/winemaker.fr.UTF-8.man.in --- wine1.7-1.7.50/tools/winemaker.fr.UTF-8.man.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/tools/winemaker.fr.UTF-8.man.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,289 +0,0 @@ -.TH WINEMAKER 1 "jan 2012" "@PACKAGE_STRING@" "Manuel des développeurs de Wine" -.SH NOM -winemaker \- générer une infrastructure de construction pour la compilation de programmes Windows sur UNIX -.SH SYNOPSIS -.B "winemaker " -[ -.BR "--nobanner " "] [ " "--backup " "| " "--nobackup " "] [ "--nosource-fix " -] -.br - [ -.BR "--lower-none " "| " "--lower-all " "| " "--lower-uppercase " -] -.br - [ -.BR "--lower-include " "| " "--nolower-include " ]\ [ " --mfc " "| " "--nomfc " -] -.br - [ -.BR "--guiexe " "| " "--windows " "| " "--cuiexe " "| " "--console " "| " "--dll " "| " "--lib " -] -.br - [ -.BI "-D" macro "\fR[=\fIdéfn\fR] ] [" "\ " "-I" "rép\fR ]\ [ " "-P" "rép\fR ] [ " "-i" "dll\fR ] [ " "-L" "rép\fR ] [ " "-l" "bibliothèque " -] -.br - [ -.BR "--nodlls " "] [ " "--nomsvcrt " "] [ " "--interactive " "] [ " "--single-target \fInom\fR " -] -.br - [ -.BR "--generated-files " "] [ " "--nogenerated-files " "] -] -.br - [ -.BR "--wine32 " "] -.br -.IR " répertoire_de_travail" "| " "fichier_projet" "| " "fichier_espace_de_travail" - -.SH DESCRIPTION -.PP -.B winemaker -est un script perl conçu pour vous aider à entamer le -processus de conversion de vos sources Windows en programmes Winelib. -.PP -À cet effet, il peut effectuer les opérations suivantes : -.PP --\ renommer vos fichiers sources et répertoires en minuscules s'ils ont été -convertis en majuscules durant le transfert. -.PP --\ convertir les fins de ligne DOS en fins de ligne UNIX (CRLF vers LF). -.PP --\ balayer les directives d'inclusion et les références aux fichiers -de ressources pour y remplacer les backslashs par des slashs. -.PP --\ durant l'étape ci-dessus, -.B winemaker -va également effectuer une recherche insensible à la casse du fichier -référencé dans le chemin d'inclusion, et réécrire la directive d'inclusion -avec la casse correcte si nécessaire. -.PP -.RB "-\ " winemaker -recherchera également d'autres problèmes plus exotiques comme l'emploi -de \fI#pragma pack\fR, l'utilisation de \fIafxres.h\fR dans des projets -non MFC, etc. Quand il trouve de tels points nébuleux, il émettra des -avertissements. -.PP -.RB "-\ " winemaker -peut également balayer un arbre de répertoires complet en une seule passe, -deviner quels sont les exécutables et bibliothèques en cours de construction, -les faire correspondre à des fichiers sources, et générer le \fIMakefile\fR -correspondant. -.PP --\ finalement, -.B winemaker -générera un \fIMakefile\fR global pour une utilisation classique. -.PP -.RB "-\ " winemaker -comprend les projets de type MFC, et génère des fichiers appropriés. -.PP -.RB "-\ " winemaker -est capable de lire des fichiers projets existants (dsp, dsw, vcproj et sln). -.PP -.SH OPTIONS -.TP -.B --nobanner -Désactiver l'affichage de la bannière. -.TP -.B --backup -Effectuer une sauvegarde préalable de tous les fichiers modifiés. -Comportement par défaut. -.TP -.B --nobackup -Ne pas effectuer de sauvegarde des fichiers sources modifiés. -.TP -.B --nosource-fix -Ne pas essayer de corriger les fichiers sources (p.ex. la conversion -DOS vers UNIX). Cela évite des messages d'erreur si des fichiers sont -en lecture seule. -.TP -.B --lower-all -Renommer tous les fichiers et répertoires en minuscules. -.TP -.B --lower-uppercase -Ne renommer que les fichiers et répertoires qui ont un nom composé -uniquement de majuscules. -Ainsi, \fIHELLO.C\fR serait renommé, mais pas \fIWorld.c\fR. -.TP -.B --lower-none -Ne pas renommer de fichiers et répertoires en minuscules. Notez que cela -n'empêche pas le renommage d'un fichier si son extension ne peut être traitée -telle quelle, comme par exemple « .Cxx ». Comportement par défaut. -.TP -.B "--lower-include " -Convertir en minuscules les noms de fichiers associés à des directives -d'inclusion (ou à d'autres formes de références de fichiers pour les -fichiers ressources) que -.B winemaker -n'arrive pas à trouver. Comportement par défaut. -.TP -.B "--nolower-include " -Ne pas modifier la directive d'inclusion si le fichier référencé ne peut -être trouvé. -.TP -.BR "--guiexe " "| " "--windows" -Présumer une application graphique quand une cible exécutable ou une cible d'un -type inconnu est rencontrée. -Comportement par défaut. -.TP -.BR "--cuiexe " "| " "--console" -Présumer une application en mode console quand une cible exécutable ou une cible d'un -type inconnu est rencontrée. -.TP -.B --dll -Présumer une DLL quand une cible d'un type inconnu est rencontrée (c.-à-d. si -.B winemaker -ne peut déterminer s'il s'agit d'un exécutable, d'une DLL ou d'une bibliothèque statique). -.TP -.B --lib -Présumer une bibliothèque statique quand une cible d'un type inconnu est rencontrée (c.-à-d. si -.B winemaker -ne peut déterminer s'il s'agit d'un exécutable, d'une DLL ou d'une bibliothèque statique). -.TP -.B --mfc -Spécifier que les cibles utilisent les MFC. Dans ce cas, -.B winemaker -adapte les chemins d'inclusion et des bibliothèques en conséquence, -et lie la cible avec la bibliothèque MFC. -.TP -.B --nomfc -Spécifier que les cibles n'utilisent pas les MFC. Cette option empêche -l'utilisation des bibliothèques MFC même si -.B winemaker -rencontre des fichiers \fIstdafx.cpp\fR ou \fIstdafx.h\fR qui activeraient -les MFC automatiquement en temps normal si ni \fB--nomfc\fR ni \fB--mfc\fR n'était -spécifiée. -.TP -.BI -D macro "\fR[\fB=\fIdéfn\fR]" -Ajouter la définition de macro spécifiée à la liste globale des -définitions de macros. -.TP -.BI -I répertoire -Ajouter le répertoire spécifié au chemin global d'inclusion. -.TP -.BI -P répertoire -Ajouter le répertoire spécifié au chemin global des DLL. -.TP -.BI -i dll -Ajouter la bibliothèque Winelib à la liste global de bibliothèques Winelib -à importer. -.TP -.BI -L répertoire -Ajouter le répertoire spécifié au chemin global des bibliothèques. -.TP -.BI -l bibliothèque -Ajouter la bibliothèque spécifiée à la liste globale de bibliothèques à utiliser lors de l'édition des liens. -.TP -.B --nodlls -Ne pas utiliser l'ensemble standard de bibliothèques Winelib pour les imports, -c.-à-d. que toute DLL utilisée par votre code doit être explicitement spécifiée à l'aide d'options -\fB-i\fR. -L'ensemble standard de bibliothèques est : \fIodbc32.dll\fR, \fIodbccp32.dll\fR, \fIole32.dll\fR, -\fIoleaut32.dll\fR et \fIwinspool.drv\fR. -.TP -.B --nomsvcrt -Définir certaines options afin que winegcc n'utilise pas -msvcrt durant la compilation. Utilisez cette option si certains fichiers cpp -incluent \fI\fR. -.TP -.B --interactive -Utiliser le mode interactif. Dans ce mode, -.B winemaker -demandera de confirmer la liste de cibles pour chaque répertoire, et ensuite -de fournir des options spécifiques de répertoire et/ou de cible. -.TP -.BR --single-target " nom" -Spécifier qu'il n'y a qu'une seule cible, appelée \fInom\fR. -.TP -.B --generated-files -Générer le \fIMakefile\fR. Comportement par défaut. -.TP -.B --nogenerated-files -Ne pas générer le \fIMakefile\fR. -.TP -.B --wine32 -Générer une cible 32 bits. Utile sur les systèmes wow64. Sans cette option, -l'architecture par défaut est utilisée. - -.SH EXEMPLES -.PP -Voici quelques exemples typiques d'utilisation de -.B winemaker -: -.PP -$ winemaker --lower-uppercase -DSTRICT . -.PP -Recherche des fichiers sources dans le répertoire courant et ses -sous-répertoires. Quand un fichier ou répertoire a un nom composé -uniquement de majuscules, le renomme en minuscules. Ensuite, adapte tous -ces fichiers sources pour une compilation avec Winelib, et génère des -\fIMakefile\fRs. \fB-DSTRICT\fR spécifie que la macro \fBSTRICT\fR doit -être définie lors de la compilation des sources. -Finalement, un \fIMakefile\fR est créé. -.PP -L'étape suivante serait : -.PP -$ make -.PP -Si vous obtenez des erreurs de compilation à ce moment (ce qui est plus que -probable pour un projet d'une taille raisonnable), vous devriez consulter -le guide de l'utilisateur de Winelib pour trouver des moyens de les résoudre. -.PP -Pour un projet utilisant les MFC, vous devriez plutôt exécuter les commandes -suivantes\ : -.PP -$ winemaker --lower-uppercase --mfc . -.br -$ make -.PP -Pour un fichier projet existant, vous devriez exécuter les commandes suivantes : -.PP -$ winemaker monprojet.dsp -.br -$ make -.PP - -.SH LIMITATIONS / PROBLÈMES -.PP -Dans certains cas, vous devrez éditer manuellement le \fIMakefile\fR ou les fichiers -sources. -.PP -En supposant que l'exécutable ou la bibliothèque windows est disponible, on peut -utiliser -.B winedump -pour en déterminer le type (graphique ou en mode console) et les -bibliothèques auxquelles il est lié (pour les exécutables), ou quelles fonctions -elle exporte (pour les bibliothèques). On pourrait ensuite restituer tous ces -réglages pour la cible Winelib correspondante. -.PP -De plus, -.B winemaker -n'est pas très apte à trouver la bibliothèque contenant l'exécutable : elle doit -être soit dans le répertoire courant, soit dans un des répertoires de -.BR LD_LIBRARY_PATH . -.PP -.B winemaker -ne prend pas encore en charge les fichiers de messages, ni le compilateur -de messages. -.PP -Les bugs peuvent être signalés (en anglais) sur le -.UR http://bugs.winehq.org -.B système de suivi des problèmes de Wine -.UE . -.SH AUTEURS -François Gouget pour CodeWeavers -.br -Dimitrie O. Paun -.br -André Hentschel -.SH DISPONIBILITÉ -\fBwinemaker\fR fait partie de la distribution de Wine, qui est disponible sur WineHQ, le -.UR http://www.winehq.org/ -.B quartier général du développement de Wine -.UE . -.SH VOIR AUSSI -.BR wine (1), -.br -.UR http://www.winehq.org/help -.B Documentation et support de Wine -.UE . diff -Nru wine1.7-1.7.50/tools/winemaker.man.in wine1.7-1.7.55/tools/winemaker.man.in --- wine1.7-1.7.50/tools/winemaker.man.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/tools/winemaker.man.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,250 +0,0 @@ -.TH WINEMAKER 1 "Jan 2012" "@PACKAGE_STRING@" "Wine Developers Manual" -.SH NAME -winemaker \- generate a build infrastructure for compiling Windows programs on Unix -.SH SYNOPSIS -.B "winemaker " -[ -.BR "--nobanner " "] [ " "--backup " "| " "--nobackup " "] [ "--nosource-fix " -] -.br - [ -.BR "--lower-none " "| " "--lower-all " "| " "--lower-uppercase " -] -.br - [ -.BR "--lower-include " "| " "--nolower-include " ]\ [ " --mfc " "| " "--nomfc " -] -.br - [ -.BR "--guiexe " "| " "--windows " "| " "--cuiexe " "| " "--console " "| " "--dll " "| " "--lib " -] -.br - [ -.BI "-D" macro "\fR[=\fIdefn\fR] ] [" "\ " "-I" "dir\fR ]\ [ " "-P" "dir\fR ] [ " "-i" "dll\fR ] [ " "-L" "dir\fR ] [ " "-l" "library " -] -.br - [ -.BR "--nodlls " "] [ " "--nomsvcrt " "] [ " "--interactive " "] [ " "--single-target \fIname\fR " -] -.br - [ -.BR "--generated-files " "] [ " "--nogenerated-files " "] -] -.br - [ -.BR "--wine32 " "] -.br -.IR " work_directory" " | " "project_file" " | " "workspace_file" - -.SH DESCRIPTION -.PP -.B winemaker -is a perl script designed to help you bootstrap the -process of converting your Windows sources to Winelib programs. -.PP -In order to do this \fBwinemaker\fR can perform the following operations: -.PP -- rename your source files and directories to lowercase in the event they -got all uppercased during the transfer. -.PP -- perform DOS to Unix (CRLF to LF) conversions. -.PP -- scan the include statements and resource file references to replace the -backslashes with forward slashes. -.PP -- during the above step \fBwinemaker\fR will also perform a case insensitive search -of the referenced file in the include path and rewrite the include statement -with the right case if necessary. -.PP -- \fBwinemaker\fR will also check other more exotic issues like \fI#pragma pack\fR -usage, use of \fIafxres.h\fR in non MFC projects, and more. Whenever it -encounters something out of the ordinary, it will warn you about it. -.PP -- \fBwinemaker\fR can also scan a complete directory tree at once, guess what are -the executables and libraries you are trying to build, match them with -source files, and generate the corresponding \fIMakefile\fR. -.PP -- finally \fBwinemaker\fR will generate a global \fIMakefile\fR for normal use. -.PP -- \fBwinemaker\fR knows about MFC-based project and will generate customized files. -.PP -- \fBwinemaker\fR can read existing project files. It supports dsp, dsw, vcproj and sln files. -.PP -.SH OPTIONS -.TP -.B --nobanner -Disable the printing of the banner. -.TP -.B --backup -Perform a backup of all the modified source files. This is the default. -.TP -.B --nobackup -Do not backup modified source files. -.TP -.B --nosource-fix -Do no try to fix the source files (e.g. DOS to Unix -conversion). This prevents complaints if the files are readonly. -.TP -.B --lower-all -Rename all files and directories to lowercase. -.TP -.B --lower-uppercase -Only rename files and directories that have an all uppercase name. -So \fIHELLO.C\fR would be renamed but not \fIWorld.c\fR. -.TP -.B --lower-none -Do not rename files and directories to lower case. Note -that this does not prevent the renaming of a file if its extension cannot -be handled as is, e.g. ".Cxx". This is the default. -.TP -.B --lower-include -When the file corresponding to an include statement (or other form of file reference -for resource files) cannot be found, convert that filename to lowercase. This is the default. -.TP -.B --nolower-include -Do not modify the include statement if the referenced file cannot be found. -.TP -.BR "--guiexe " "| " "--windows" -Assume a graphical application when an executable target or a target of -unknown type is found. This is the default. -.TP -.BR "--cuiexe " "| " "--console" -Assume a console application when an executable target or a target of -unknown type is found. -.TP -.B --dll -Assume a dll when a target of unknown type is found, i.e. when \fBwinemaker\fR is unable to -determine whether it is an executable, a dll, or a static library, -.TP -.B --lib -Assume a static library when a target of unknown type is found, i.e. when \fBwinemaker\fR is -unable to determine whether it is an executable, a dll, or a static library, -.TP -.B --mfc -Specify that the targets are MFC based. In such a case \fBwinemaker\fR adapts -the include and library paths accordingly, and links the target with the -MFC library. -.TP -.B --nomfc -Specify that targets are not MFC-based. This option disables use of MFC libraries -even if \fBwinemaker\fR encounters files \fIstdafx.cpp\fR or \fIstdafx.h\fR that would cause it -to enable MFC automatically if neither \fB--nomfc\fR nor \fB--mfc\fR was specified. -.TP -.BI -D macro "\fR[\fB=\fIdefn\fR]" -Add the specified macro definition to the global list of macro definitions. -.TP -.BI -I dir -Append the specified directory to the global include path. -.TP -.BI -P dir -Append the specified directory to the global dll path. -.TP -.BI -i dll -Add the Winelib library to the global list of Winelib libraries to import. -.TP -.BI -L dir -Append the specified directory to the global library path. -.TP -.BI -l library -Add the specified library to the global list of libraries to link with. -.TP -.B --nodlls -Do not use the standard set of Winelib libraries for imports. -That is, any DLL your code uses must be explicitly passed with \fB-i\fR options. -The standard set of libraries is: \fIodbc32.dll\fR, \fIodbccp32.dll\fR, \fIole32.dll\fR, -\fIoleaut32.dll\fR and \fIwinspool.drv\fR. -.TP -.B --nomsvcrt -Set some options to tell \fBwinegcc\fR not to compile against msvcrt. -Use this option if you have cpp-files that include \fI\fR. -.TP -.B --interactive -Use interactive mode. In this mode \fBwinemaker\fR will ask you to -confirm the list of targets for each directory, and then to provide directory and -target specific options. -.TP -.BI --single-target " name" -Specify that there is only one target, called \fIname\fR. -.TP -.B --generated-files -Generate the \fIMakefile\fR. This is the default. -.TP -.B --nogenerated-files -Do not generate the \fIMakefile\fR. -.TP -.B --wine32 -Generate a 32-bit target. This is useful on wow64 systems. -Without that option the default architecture is used. - -.SH EXAMPLES -.PP -Here is a typical \fBwinemaker\fR use: -.PP -$ winemaker --lower-uppercase -DSTRICT . -.PP -The above tells \fBwinemaker\fR to scan the current directory and its -subdirectories for source files. Whenever if finds a file or directory which -name is all uppercase, it should rename it to lowercase. It should then fix -all these source files for compilation with Winelib and generate \fIMakefile\fRs. -The \fB-DSTRICT\fR specifies that the \fBSTRICT\fR macro must be set when compiling -these sources. Finally a \fIMakefile\fR will be created. -.PP -The next step would be: -.PP -$ make -.PP -If at this point you get compilation errors (which is quite likely for a -reasonably sized project) then you should consult the Winelib User Guide to -find tips on how to resolve them. -.PP -For an MFC-based project you would have to run the following commands instead: -.PP -$ winemaker --lower-uppercase --mfc . -.br -$ make -.PP -For an existing project-file you would have to run the following commands: -.PP -$ winemaker myproject.dsp -.br -$ make -.PP - -.SH TODO / BUGS -In some cases you will have to edit the \fIMakefile\fR or source files manually. -.PP -Assuming that the windows executable/library is available, we could -use \fBwinedump\fR to determine what kind of executable it is (graphical -or console), which libraries it is linked with, and which functions it -exports (for libraries). We could then restore all these settings for the -corresponding Winelib target. -.PP -Furthermore \fBwinemaker\fR is not very good at finding the library containing the -executable: it must either be in the current directory or in the -.BR LD_LIBRARY_PATH . -.PP -\fBwinemaker\fR does not support message files and the message compiler yet. -.PP -Bugs can be reported on the -.UR http://bugs.winehq.org -.B Wine bug tracker -.UE . -.SH AUTHORS -François Gouget for CodeWeavers -.br -Dimitrie O. Paun -.br -André Hentschel -.SH AVAILABILITY -.B winemaker -is part of the Wine distribution, which is available through WineHQ, -the -.UR http://www.winehq.org/ -.B Wine development headquarters -.UE . -.SH SEE ALSO -.BR wine (1), -.br -.UR http://www.winehq.org/help -.B Wine documentation and support -.UE . diff -Nru wine1.7-1.7.50/tools/wmc/Makefile.in wine1.7-1.7.55/tools/wmc/Makefile.in --- wine1.7-1.7.50/tools/wmc/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/tools/wmc/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -1,6 +1,5 @@ -PROGRAMS = wmc$(EXEEXT) +PROGRAMS = wmc MANPAGES = wmc.man.in -ALL_LIBS = $(GETTEXTPO_LIBS) $(LIBWINE_STATIC) $(LIBPORT) C_SRCS = \ lang.c \ @@ -12,15 +11,6 @@ BISON_SRCS = mcy.y -OBJS = $(C_SRCS:.c=.o) $(BISON_SRCS:.y=.tab.o) +EXTRALIBS = $(GETTEXTPO_LIBS) $(LIBWINE_STATIC) -wmc$(EXEEXT): $(OBJS) - $(CC) $(CFLAGS) -o $@ $(OBJS) $(ALL_LIBS) $(LDFLAGS) - -.PHONY: install install-dev uninstall - -install install-dev:: wmc$(EXEEXT) install-man-pages - $(INSTALL_PROGRAM) wmc$(EXEEXT) $(DESTDIR)$(bindir)/wmc$(EXEEXT) - -uninstall:: - $(RM) $(DESTDIR)$(bindir)/wmc$(EXEEXT) +INSTALL_DEV = $(PROGRAMS) diff -Nru wine1.7-1.7.50/tools/wrc/Makefile.in wine1.7-1.7.55/tools/wrc/Makefile.in --- wine1.7-1.7.50/tools/wrc/Makefile.in 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/tools/wrc/Makefile.in 2015-11-13 14:32:40.000000000 +0000 @@ -1,6 +1,5 @@ -PROGRAMS = wrc$(EXEEXT) +PROGRAMS = wrc MANPAGES = wrc.man.in -ALL_LIBS = $(GETTEXTPO_LIBS) $(LIBWPP) $(LIBWINE_STATIC) $(LIBPORT) C_SRCS = \ dumpres.c \ @@ -18,15 +17,6 @@ wrc_EXTRADEFS = -DINCLUDEDIR="\"${includedir}\"" -OBJS = $(C_SRCS:.c=.o) $(BISON_SRCS:.y=.tab.o) $(LEX_SRCS:.l=.yy.o) +EXTRALIBS = $(GETTEXTPO_LIBS) $(LIBWPP) $(LIBWINE_STATIC) -wrc$(EXEEXT): $(OBJS) $(LIBWPP) - $(CC) $(CFLAGS) -o $@ $(OBJS) $(ALL_LIBS) $(LDFLAGS) - -.PHONY: install install-dev uninstall - -install install-dev:: wrc$(EXEEXT) install-man-pages - $(INSTALL_PROGRAM) wrc$(EXEEXT) $(DESTDIR)$(bindir)/wrc$(EXEEXT) - -uninstall:: - $(RM) $(DESTDIR)$(bindir)/wrc$(EXEEXT) +INSTALL_DEV = $(PROGRAMS) diff -Nru wine1.7-1.7.50/tools/wrc/utils.c wine1.7-1.7.55/tools/wrc/utils.c --- wine1.7-1.7.50/tools/wrc/utils.c 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/tools/wrc/utils.c 2015-11-13 14:32:40.000000000 +0000 @@ -453,6 +453,7 @@ { LANG_INDONESIAN, SUBLANG_NEUTRAL, 1252 }, { LANG_INUKTITUT, SUBLANG_NEUTRAL, 0 }, { LANG_INUKTITUT, SUBLANG_INUKTITUT_CANADA_LATIN, 0 }, + { LANG_INVARIANT, SUBLANG_NEUTRAL, 0 }, { LANG_IRISH, SUBLANG_NEUTRAL, 1252 }, { LANG_ITALIAN, SUBLANG_NEUTRAL, 1252 }, { LANG_JAPANESE, SUBLANG_NEUTRAL, 932 }, diff -Nru wine1.7-1.7.50/VERSION wine1.7-1.7.55/VERSION --- wine1.7-1.7.50/VERSION 2015-08-21 14:05:30.000000000 +0000 +++ wine1.7-1.7.55/VERSION 2015-11-13 14:32:40.000000000 +0000 @@ -1 +1 @@ -Wine version 1.7.50 +Wine version 1.7.55